(taskId: string, visibility: ShareVisibility = "organization")
| 15 | } |
| 16 | |
| 17 | async shareTask(taskId: string, visibility: ShareVisibility = "organization"): Promise<ShareResponse> { |
| 18 | try { |
| 19 | const response = await this.cloudAPI.shareTask(taskId, visibility) |
| 20 | |
| 21 | if (response.success && response.shareUrl) { |
| 22 | const vscode = await importVscode() |
| 23 | |
| 24 | if (vscode?.env?.clipboard?.writeText) { |
| 25 | try { |
| 26 | await vscode.env.clipboard.writeText(response.shareUrl) |
| 27 | } catch (copyErr) { |
| 28 | this.log("[ShareService] Clipboard write failed (non-fatal):", copyErr) |
| 29 | } |
| 30 | } else { |
| 31 | this.log("[ShareService] VS Code clipboard unavailable; running outside extension host.") |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | return response |
| 36 | } catch (error) { |
| 37 | this.log("[ShareService] Error sharing task:", error) |
| 38 | throw error |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | async canShareTask(): Promise<boolean> { |
| 43 | try { |
nothing calls this directly
no test coverage detected