@github/copilot-sdk 1.0.17-preview.9 → 1.0.17-unstable.37553872417.gc9f6176
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 +0 -41
- package/dist/cjs/cliVersion.js +1 -1
- package/dist/cjs/client.js +2 -44
- package/dist/cjs/extension.js +0 -2
- package/dist/cjs/generated/rpc.js +10 -198
- package/dist/cjs/session.js +0 -67
- package/dist/cliVersion.d.ts +1 -1
- package/dist/cliVersion.js +1 -1
- package/dist/client.d.ts +0 -1
- package/dist/client.js +2 -44
- package/dist/extension.d.ts +1 -1
- package/dist/extension.js +0 -2
- package/dist/generated/rpc.d.ts +197 -686
- package/dist/generated/rpc.js +10 -198
- package/dist/generated/session-events.d.ts +3 -19
- package/dist/index.d.ts +1 -1
- package/dist/session.d.ts +0 -7
- package/dist/session.js +0 -67
- package/dist/types.d.ts +0 -76
- package/package.json +12 -12
package/dist/client.js
CHANGED
|
@@ -1184,9 +1184,6 @@ class CopilotClient {
|
|
|
1184
1184
|
if (config.gitHubToken !== void 0 && config.gitHubTokenProvider !== void 0) {
|
|
1185
1185
|
throw new Error("gitHubToken and gitHubTokenProvider are mutually exclusive");
|
|
1186
1186
|
}
|
|
1187
|
-
if (config.cloud != null && config.skillProvider) {
|
|
1188
|
-
throw new Error("Skill providers are not supported for cloud sessions.");
|
|
1189
|
-
}
|
|
1190
1187
|
if (!this.connection) {
|
|
1191
1188
|
await this.start();
|
|
1192
1189
|
}
|
|
@@ -1246,9 +1243,6 @@ class CopilotClient {
|
|
|
1246
1243
|
if (config.hooks) {
|
|
1247
1244
|
s.registerHooks(config.hooks);
|
|
1248
1245
|
}
|
|
1249
|
-
if (config.skillProvider) {
|
|
1250
|
-
s.registerSkillProvider(config.skillProvider);
|
|
1251
|
-
}
|
|
1252
1246
|
if (transformCallbacks) {
|
|
1253
1247
|
s.registerTransformCallbacks(transformCallbacks);
|
|
1254
1248
|
}
|
|
@@ -1355,7 +1349,6 @@ class CopilotClient {
|
|
|
1355
1349
|
enableSessionStore: config.enableSessionStore,
|
|
1356
1350
|
enableSkills: config.enableSkills,
|
|
1357
1351
|
skillDirectories: config.skillDirectories,
|
|
1358
|
-
...config.skillProvider ? { hasSkillProvider: true } : {},
|
|
1359
1352
|
pluginDirectories: config.pluginDirectories,
|
|
1360
1353
|
instructionDirectories: config.instructionDirectories,
|
|
1361
1354
|
disabledSkills: config.disabledSkills,
|
|
@@ -1509,9 +1502,6 @@ class CopilotClient {
|
|
|
1509
1502
|
if (config.hooks) {
|
|
1510
1503
|
session.registerHooks(config.hooks);
|
|
1511
1504
|
}
|
|
1512
|
-
if (config.skillProvider) {
|
|
1513
|
-
session.registerSkillProvider(config.skillProvider);
|
|
1514
|
-
}
|
|
1515
1505
|
const modeDefaults = this.configDefaultsForMode();
|
|
1516
1506
|
config = { ...modeDefaults, ...config };
|
|
1517
1507
|
config.customAgentsLocalOnly ??= modeDefaults.customAgentsLocalOnly;
|
|
@@ -1525,10 +1515,9 @@ class CopilotClient {
|
|
|
1525
1515
|
if (config.onEvent) {
|
|
1526
1516
|
session.on(config.onEvent);
|
|
1527
1517
|
}
|
|
1528
|
-
const toolFilterOptions = this.resolveToolFilterOptions(config);
|
|
1529
1518
|
this.setupSessionFs(session, config);
|
|
1530
|
-
const replacedSession = this.sessions.get(sessionId);
|
|
1531
1519
|
this.sessions.set(sessionId, session);
|
|
1520
|
+
const toolFilterOptions = this.resolveToolFilterOptions(config);
|
|
1532
1521
|
const gitHubTokenProviderRegistrationId = this.registerGitHubTokenProvider(
|
|
1533
1522
|
config.gitHubTokenProvider,
|
|
1534
1523
|
sessionId
|
|
@@ -1621,7 +1610,6 @@ class CopilotClient {
|
|
|
1621
1610
|
defaultAgent: config.defaultAgent,
|
|
1622
1611
|
agent: config.agent,
|
|
1623
1612
|
skillDirectories: config.skillDirectories,
|
|
1624
|
-
...config.skillProvider ? { hasSkillProvider: true } : {},
|
|
1625
1613
|
pluginDirectories: config.pluginDirectories,
|
|
1626
1614
|
instructionDirectories: config.instructionDirectories,
|
|
1627
1615
|
disabledSkills: config.disabledSkills,
|
|
@@ -1666,13 +1654,7 @@ class CopilotClient {
|
|
|
1666
1654
|
this.commitGitHubTokenProvider(sessionId, gitHubTokenProviderRegistrationId);
|
|
1667
1655
|
} catch (e) {
|
|
1668
1656
|
session._markDisconnected();
|
|
1669
|
-
|
|
1670
|
-
if (replacedSession) {
|
|
1671
|
-
this.sessions.set(sessionId, replacedSession);
|
|
1672
|
-
} else {
|
|
1673
|
-
this.sessions.delete(sessionId);
|
|
1674
|
-
}
|
|
1675
|
-
}
|
|
1657
|
+
this.sessions.delete(sessionId);
|
|
1676
1658
|
if (gitHubTokenProviderRegistrationId !== void 0) {
|
|
1677
1659
|
this.githubTokenProviders.delete(gitHubTokenProviderRegistrationId);
|
|
1678
1660
|
}
|
|
@@ -2648,20 +2630,6 @@ stderr: ${stderrOutput}` : ""}`
|
|
|
2648
2630
|
return await this.handleHooksInvoke(params);
|
|
2649
2631
|
}
|
|
2650
2632
|
);
|
|
2651
|
-
this.connection.onRequest(
|
|
2652
|
-
"skillProvider.list",
|
|
2653
|
-
async (params, token) => await this.resolveSkillProviderSession(params)._handleSkillProviderList(token)
|
|
2654
|
-
);
|
|
2655
|
-
this.connection.onRequest(
|
|
2656
|
-
"skillProvider.read",
|
|
2657
|
-
async (params, token) => {
|
|
2658
|
-
const session = this.resolveSkillProviderSession(params);
|
|
2659
|
-
if (typeof params.name !== "string") {
|
|
2660
|
-
throw new Error("Invalid skillProvider.read payload");
|
|
2661
|
-
}
|
|
2662
|
-
return await session._handleSkillProviderRead(params.name, token);
|
|
2663
|
-
}
|
|
2664
|
-
);
|
|
2665
2633
|
const connection = this.connection;
|
|
2666
2634
|
const messageWriter = this.messageWriter;
|
|
2667
2635
|
const cliProcess = this.isExternalServer ? null : this.cliProcess;
|
|
@@ -2818,16 +2786,6 @@ stderr: ${stderrOutput}` : ""}`
|
|
|
2818
2786
|
});
|
|
2819
2787
|
return { response };
|
|
2820
2788
|
}
|
|
2821
|
-
resolveSkillProviderSession(params) {
|
|
2822
|
-
if (!params || typeof params.sessionId !== "string") {
|
|
2823
|
-
throw new Error("Invalid skillProvider payload");
|
|
2824
|
-
}
|
|
2825
|
-
const session = this.sessions.get(params.sessionId);
|
|
2826
|
-
if (!session) {
|
|
2827
|
-
throw new Error(`Session not found: ${params.sessionId}`);
|
|
2828
|
-
}
|
|
2829
|
-
return session;
|
|
2830
|
-
}
|
|
2831
2789
|
async handleHooksInvoke(params) {
|
|
2832
2790
|
if (!params || typeof params.sessionId !== "string" || typeof params.hookType !== "string") {
|
|
2833
2791
|
throw new Error("Invalid hooks invoke payload");
|
package/dist/extension.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { CopilotSession } from "./session.js";
|
|
|
2
2
|
import { type PermissionHandler, type ResumeSessionConfig } from "./types.js";
|
|
3
3
|
import type { WorkflowHandle } from "./workflow.js";
|
|
4
4
|
export { Canvas, CanvasError, createCanvas, type CanvasAction, type CanvasDeclaration, type CanvasHostContext, type CanvasJsonSchema, type CanvasOptions, } from "./canvas.js";
|
|
5
|
-
export type JoinSessionConfig = Omit<ResumeSessionConfig, "onPermissionRequest" | "extensionSdkPath"
|
|
5
|
+
export type JoinSessionConfig = Omit<ResumeSessionConfig, "onPermissionRequest" | "extensionSdkPath"> & {
|
|
6
6
|
onPermissionRequest?: PermissionHandler;
|
|
7
7
|
/**
|
|
8
8
|
* Names of sensitive environment variables this extension needs, such as
|
package/dist/extension.js
CHANGED
|
@@ -22,13 +22,11 @@ async function joinSession(config = {}) {
|
|
|
22
22
|
const client = new CopilotClient({ _internalConnection: { kind: "parent-process" } });
|
|
23
23
|
const {
|
|
24
24
|
extensionSdkPath: _stripped,
|
|
25
|
-
skillProvider: _strippedSkillProvider,
|
|
26
25
|
workflows,
|
|
27
26
|
requestedEnvironmentVariables,
|
|
28
27
|
...rest
|
|
29
28
|
} = config;
|
|
30
29
|
void _stripped;
|
|
31
|
-
void _strippedSkillProvider;
|
|
32
30
|
return client.resumeSessionForExtension(
|
|
33
31
|
sessionId,
|
|
34
32
|
{
|