You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add VS Code launch config for debugging SDK/runtime (#925)
* Add VS Code launch config for debugging sdk/runtime
* Cleanup
* Make all SDKs consistent in support for COPILOT_CLI_PATH
* Respect uv lockfile to avoid getting new ty versions randomly
* Clean up Node readme
* Update python-sdk-tests.yml
* Different fix for random ty versioning
??thrownewInvalidOperationException($"Copilot CLI not found at '{searchedPath}'. Ensure the SDK NuGet package was restored correctly or provide an explicit CliPath.");
Copy file name to clipboardExpand all lines: nodejs/README.md
+42-28Lines changed: 42 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,10 @@ await client.stop();
60
60
Sessions also support `Symbol.asyncDispose` for use with [`await using`](https://github.com/tc39/proposal-explicit-resource-management) (TypeScript 5.2+/Node.js 18.0+):
// session is automatically disconnected when leaving scope
65
68
```
66
69
@@ -76,7 +79,7 @@ new CopilotClient(options?: CopilotClientOptions)
76
79
77
80
**Options:**
78
81
79
-
-`cliPath?: string` - Path to CLI executable (default: "copilot" from PATH)
82
+
-`cliPath?: string` - Path to CLI executable (default: uses COPILOT_CLI_PATH env var or bundled instance)
80
83
-`cliArgs?: string[]` - Extra arguments prepended before SDK-managed flags (e.g. `["./dist-cli/index.js"]` when using `node`)
81
84
-`cliUrl?: string` - URL of existing CLI server to connect to (e.g., `"localhost:8080"`, `"http://127.0.0.1:9000"`, or just `"8080"`). When provided, the client will not spawn a CLI process.
82
85
-`port?: number` - Server port (default: 0 for random)
-`session.updated` - A session was updated (e.g., new messages)
@@ -293,7 +297,7 @@ if (session.capabilities.ui?.elicitation) {
293
297
294
298
Interactive UI methods for showing dialogs to the user. Only available when the CLI host supports elicitation (`session.capabilities.ui?.elicitation === true`). See [UI Elicitation](#ui-elicitation) for full details.
295
299
296
-
##### `destroy(): Promise<void>`*(deprecated)*
300
+
##### `destroy(): Promise<void>`_(deprecated)_
297
301
298
302
Deprecated — use `disconnect()` instead.
299
303
@@ -454,8 +458,10 @@ defineTool("edit_file", {
454
458
description: "Custom file editor with project-specific validation",
Available section IDs: `identity`, `tone`, `tool_efficiency`, `environment_context`, `code_change_rules`, `guidelines`, `safety`, `tool_instructions`, `custom_instructions`, `last_instructions`. Use the `SYSTEM_PROMPT_SECTIONS` constant for descriptions of each section.
587
598
588
599
Each section override supports four actions:
600
+
589
601
-**`replace`** — Replace the section content entirely
590
602
-**`remove`** — Remove the section from the prompt
591
603
-**`append`** — Add content after the existing section
> - When using a custom provider, the `model` parameter is **required**. The SDK will throw an error if no model is specified.
738
751
> - For Azure OpenAI endpoints (`*.openai.azure.com`), you **must** use `type: "azure"`, not `type: "openai"`.
739
752
> - The `baseUrl` should be just the host (e.g., `https://my-resource.openai.azure.com`). Do **not** include `/openai/v1` in the URL - the SDK handles path construction automatically.
@@ -744,9 +757,9 @@ The SDK supports OpenTelemetry for distributed tracing. Provide a `telemetry` co
744
757
745
758
```typescript
746
759
const client =newCopilotClient({
747
-
telemetry: {
748
-
otlpEndpoint: "http://localhost:4318",
749
-
},
760
+
telemetry: {
761
+
otlpEndpoint: "http://localhost:4318",
762
+
},
750
763
});
751
764
```
752
765
@@ -772,12 +785,12 @@ If you're already using `@opentelemetry/api` in your app and want this linkage,
0 commit comments