@github/copilot-sdk
Advanced tools
+0
-4
@@ -437,6 +437,2 @@ import { createServerRpc } from "./generated/rpc.js"; | ||
| private isToolResultObject; | ||
| /** | ||
| * Attempt to reconnect to the server | ||
| */ | ||
| private reconnect; | ||
| } |
+7
-19
@@ -128,3 +128,3 @@ import { spawn } from "node:child_process"; | ||
| autoStart: options.autoStart ?? true, | ||
| autoRestart: options.autoRestart ?? true, | ||
| autoRestart: false, | ||
| env: options.env ?? process.env, | ||
@@ -409,3 +409,4 @@ githubToken: options.githubToken, | ||
| parameters: toJsonSchema(tool.parameters), | ||
| overridesBuiltInTool: tool.overridesBuiltInTool | ||
| overridesBuiltInTool: tool.overridesBuiltInTool, | ||
| skipPermission: tool.skipPermission | ||
| })), | ||
@@ -501,3 +502,4 @@ systemMessage: config.systemMessage, | ||
| parameters: toJsonSchema(tool.parameters), | ||
| overridesBuiltInTool: tool.overridesBuiltInTool | ||
| overridesBuiltInTool: tool.overridesBuiltInTool, | ||
| skipPermission: tool.skipPermission | ||
| })), | ||
@@ -932,4 +934,2 @@ provider: config.provider, | ||
| } | ||
| } else if (this.options.autoRestart && this.state === "connected") { | ||
| void this.reconnect(); | ||
| } | ||
@@ -1040,7 +1040,6 @@ }); | ||
| this.connection.onClose(() => { | ||
| if (this.state === "connected" && this.options.autoRestart) { | ||
| void this.reconnect(); | ||
| } | ||
| this.state = "disconnected"; | ||
| }); | ||
| this.connection.onError((_error) => { | ||
| this.state = "disconnected"; | ||
| }); | ||
@@ -1199,13 +1198,2 @@ } | ||
| } | ||
| /** | ||
| * Attempt to reconnect to the server | ||
| */ | ||
| async reconnect() { | ||
| this.state = "disconnected"; | ||
| try { | ||
| await this.stop(); | ||
| await this.start(); | ||
| } catch (_error) { | ||
| } | ||
| } | ||
| } | ||
@@ -1212,0 +1200,0 @@ export { |
+6
-2
@@ -59,4 +59,3 @@ /** | ||
| /** | ||
| * Auto-restart the CLI server if it crashes | ||
| * @default true | ||
| * @deprecated This option has no effect and will be removed in a future release. | ||
| */ | ||
@@ -140,2 +139,6 @@ autoRestart?: boolean; | ||
| overridesBuiltInTool?: boolean; | ||
| /** | ||
| * When true, the tool can execute without a permission prompt. | ||
| */ | ||
| skipPermission?: boolean; | ||
| } | ||
@@ -151,2 +154,3 @@ /** | ||
| overridesBuiltInTool?: boolean; | ||
| skipPermission?: boolean; | ||
| }): Tool<T>; | ||
@@ -153,0 +157,0 @@ export interface ToolCallRequestPayload { |
+1
-1
@@ -7,3 +7,3 @@ { | ||
| }, | ||
| "version": "0.1.33-preview.0", | ||
| "version": "0.1.33-preview.1", | ||
| "description": "TypeScript SDK for programmatic control of GitHub Copilot CLI via JSON-RPC", | ||
@@ -10,0 +10,0 @@ "main": "./dist/index.js", |
+13
-1
@@ -85,3 +85,2 @@ # Copilot SDK for Node.js/TypeScript | ||
| - `autoStart?: boolean` - Auto-start server (default: true) | ||
| - `autoRestart?: boolean` - Auto-restart on crash (default: true) | ||
| - `githubToken?: string` - GitHub token for authentication. When provided, takes priority over other auth methods. | ||
@@ -430,2 +429,15 @@ - `useLoggedInUser?: boolean` - Whether to use logged-in user for authentication (default: true, but false when `githubToken` is provided). Cannot be used with `cliUrl`. | ||
| #### Skipping Permission Prompts | ||
| Set `skipPermission: true` on a tool definition to allow it to execute without triggering a permission prompt: | ||
| ```ts | ||
| defineTool("safe_lookup", { | ||
| description: "A read-only lookup that needs no confirmation", | ||
| parameters: z.object({ id: z.string() }), | ||
| skipPermission: true, | ||
| handler: async ({ id }) => { /* your logic */ }, | ||
| }) | ||
| ``` | ||
| ### System Message Customization | ||
@@ -432,0 +444,0 @@ |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
283229
0.04%718
1.7%7216
-0.17%