@microsoft/copilot-sdk 2.0.0-preview.0 → 2.0.0-preview.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +525 -374
- package/dist/cjs/cliVersion.js +1 -1
- package/dist/cjs/client.js +814 -559
- package/dist/cjs/extension.js +11 -9
- package/dist/cjs/generated/rpc.js +7 -7
- package/dist/cjs/sdkProtocolVersion.js +1 -1
- package/dist/cjs/session.js +2 -2
- package/dist/cjs/toolSet.js +1 -1
- package/dist/cjs/types.js +41 -13
- package/dist/cliVersion.d.ts +1 -1
- package/dist/cliVersion.js +1 -1
- package/dist/client.d.ts +46 -45
- package/dist/client.js +825 -562
- package/dist/extension.d.ts +7 -5
- package/dist/extension.js +11 -9
- package/dist/generated/rpc.d.ts +833 -436
- package/dist/generated/rpc.js +7 -7
- package/dist/generated/session-events.d.ts +16 -0
- package/dist/host.d.ts +7 -3
- package/dist/index.d.ts +2 -1
- package/dist/sdkProtocolVersion.d.ts +1 -1
- package/dist/sdkProtocolVersion.js +1 -1
- package/dist/session.d.ts +6 -6
- package/dist/session.js +2 -2
- package/dist/toolSet.d.ts +6 -5
- package/dist/toolSet.js +1 -1
- package/dist/types.d.ts +1252 -1293
- package/dist/types.js +41 -13
- package/docs/examples.md +1 -1
- package/package.json +12 -12
package/dist/extension.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { CopilotClient } from "./client.js";
|
|
2
2
|
import type { CopilotSession } from "./session.js";
|
|
3
|
-
import { type
|
|
3
|
+
import { type ResumeSessionOptions, type SessionExtensionOptions, type SessionSkillOptions, type SessionToolOptions } from "./types.js";
|
|
4
4
|
import type { WorkflowHandle } from "./workflow.js";
|
|
5
5
|
export { Canvas, CanvasError, createCanvas, type CanvasAction, type CanvasDeclaration, type CanvasHostContext, type CanvasJsonSchema, type CanvasOptions, } from "./canvas.js";
|
|
6
|
-
export type
|
|
7
|
-
|
|
6
|
+
export type JoinSessionOptions = Omit<ResumeSessionOptions, "extensions" | "skills" | "tools"> & {
|
|
7
|
+
extensions?: Omit<SessionExtensionOptions, "sdkPath">;
|
|
8
|
+
skills?: Omit<SessionSkillOptions, "provider">;
|
|
9
|
+
tools?: Omit<SessionToolOptions, "imageGeneration">;
|
|
8
10
|
/**
|
|
9
11
|
* Names of sensitive environment variables this extension needs, such as
|
|
10
12
|
* `"GITHUB_TOKEN"`.
|
|
@@ -63,7 +65,7 @@ export { defineWorkflow, WorkflowResumeError, isWorkflowRunTerminal, type Workfl
|
|
|
63
65
|
* ```typescript
|
|
64
66
|
* import { joinSession } from "@microsoft/copilot-sdk/extension";
|
|
65
67
|
*
|
|
66
|
-
* const session = await joinSession({ tools: [myTool] });
|
|
68
|
+
* const session = await joinSession({ tools: { definitions: [myTool] } });
|
|
67
69
|
* ```
|
|
68
70
|
*/
|
|
69
|
-
export declare function joinSession(config?:
|
|
71
|
+
export declare function joinSession(config?: JoinSessionOptions): Promise<JoinedSession>;
|
package/dist/extension.js
CHANGED
|
@@ -23,14 +23,10 @@ async function joinSession(config = {}) {
|
|
|
23
23
|
mode: "coding-agent",
|
|
24
24
|
_internalConnection: { kind: "parent-process" }
|
|
25
25
|
});
|
|
26
|
-
const {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
workflows,
|
|
31
|
-
requestedEnvironmentVariables,
|
|
32
|
-
...rest
|
|
33
|
-
} = config;
|
|
26
|
+
const { workflows, requestedEnvironmentVariables, ...rest } = config;
|
|
27
|
+
const { sdkPath: _stripped, ...extensions } = config.extensions ?? {};
|
|
28
|
+
const { provider: _strippedSkillProvider, ...skills } = config.skills ?? {};
|
|
29
|
+
const { imageGeneration: _strippedImageGeneration, ...tools } = config.tools ?? {};
|
|
34
30
|
void _stripped;
|
|
35
31
|
void _strippedSkillProvider;
|
|
36
32
|
void _strippedImageGeneration;
|
|
@@ -38,7 +34,13 @@ async function joinSession(config = {}) {
|
|
|
38
34
|
sessionId,
|
|
39
35
|
{
|
|
40
36
|
...rest,
|
|
41
|
-
|
|
37
|
+
extensions,
|
|
38
|
+
skills,
|
|
39
|
+
tools,
|
|
40
|
+
permissions: {
|
|
41
|
+
...rest.permissions,
|
|
42
|
+
onRequest: config.permissions?.onRequest ?? defaultJoinSessionPermissionHandler
|
|
43
|
+
},
|
|
42
44
|
suppressResumeEvent: config.suppressResumeEvent ?? true
|
|
43
45
|
},
|
|
44
46
|
{ workflows },
|