@github/copilot-sdk 1.0.15-preview.0 → 1.0.15-preview.2

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.
@@ -1,2 +1,2 @@
1
- export declare const COPILOT_CLI_VERSION = "1.0.87-0";
1
+ export declare const COPILOT_CLI_VERSION = "1.0.89-1";
2
2
  export declare const COPILOT_CLI_USE_NPM_PACKAGE = false;
@@ -1,4 +1,4 @@
1
- const COPILOT_CLI_VERSION = "1.0.87-0";
1
+ const COPILOT_CLI_VERSION = "1.0.89-1";
2
2
  const COPILOT_CLI_USE_NPM_PACKAGE = false;
3
3
  export {
4
4
  COPILOT_CLI_USE_NPM_PACKAGE,
package/dist/client.js CHANGED
@@ -1315,11 +1315,14 @@ class CopilotClient {
1315
1315
  async resumeSession(sessionId, config) {
1316
1316
  return this.resumeSessionInternal(sessionId, config);
1317
1317
  }
1318
- /** @internal */
1319
- async resumeSessionForExtension(sessionId, config, factories, extensionOptions) {
1320
- return this.resumeSessionInternal(sessionId, config, factories, extensionOptions);
1318
+ async resumeSessionForExtension(sessionId, config, contributions = {}, extensionOptions) {
1319
+ return this.resumeSessionInternal(sessionId, config, contributions, extensionOptions);
1321
1320
  }
1322
- async resumeSessionInternal(sessionId, config, factories, extensionOptions) {
1321
+ async resumeSessionInternal(sessionId, config, contributions = {}, extensionOptions) {
1322
+ const { factories, workflows } = Array.isArray(contributions) ? { factories: contributions, workflows: void 0 } : contributions;
1323
+ if (factories !== void 0 && workflows !== void 0) {
1324
+ throw new Error("Session configuration cannot include both factories and workflows");
1325
+ }
1323
1326
  if (config.gitHubToken !== void 0 && config.gitHubTokenProvider !== void 0) {
1324
1327
  throw new Error("gitHubToken and gitHubTokenProvider are mutually exclusive");
1325
1328
  }
@@ -1340,6 +1343,7 @@ class CopilotClient {
1340
1343
  session.registerCanvases(config.canvases);
1341
1344
  session.registerCommands(config.commands);
1342
1345
  session.registerFactories(factories);
1346
+ session.registerWorkflows(workflows);
1343
1347
  const {
1344
1348
  wireProvider: bearerWireProvider,
1345
1349
  wireProviders: bearerWireProviders,
@@ -1421,6 +1425,7 @@ class CopilotClient {
1421
1425
  toolSearch: config.toolSearch,
1422
1426
  canvases: config.canvases?.map((canvas) => canvas.declaration),
1423
1427
  factories: factories?.map((factory) => factory.meta),
1428
+ workflows: workflows?.map((workflow) => workflow.meta),
1424
1429
  requestCanvasRenderer: config.requestCanvasRenderer,
1425
1430
  requestExtensions: config.requestExtensions,
1426
1431
  extensionSdkPath: config.extensionSdkPath,
@@ -1,7 +1,27 @@
1
1
  import type { CopilotSession } from "./session.js";
2
2
  import { type PermissionHandler, type ResumeSessionConfig } from "./types.js";
3
3
  import type { FactoryHandle } from "./factory.js";
4
+ import type { WorkflowHandle } from "./workflow.js";
4
5
  export { Canvas, CanvasError, createCanvas, type CanvasAction, type CanvasDeclaration, type CanvasHostContext, type CanvasJsonSchema, type CanvasOptions, } from "./canvas.js";
6
+ type JoinSessionContributionConfig = {
7
+ /**
8
+ * Factory handles to register when the extension joins the session.
9
+ *
10
+ * @experimental Part of the experimental Agent Factories surface and may
11
+ * change or be removed in future SDK or CLI releases.
12
+ */
13
+ factories?: FactoryHandle[];
14
+ workflows?: never;
15
+ } | {
16
+ factories?: never;
17
+ /**
18
+ * Workflow handles to register when the extension joins the session.
19
+ *
20
+ * @experimental Part of the experimental Dynamic Workflows surface and may
21
+ * change or be removed in future SDK or CLI releases.
22
+ */
23
+ workflows?: WorkflowHandle[];
24
+ };
5
25
  export type JoinSessionConfig = Omit<ResumeSessionConfig, "onPermissionRequest" | "extensionSdkPath"> & {
6
26
  onPermissionRequest?: PermissionHandler;
7
27
  /**
@@ -33,16 +53,10 @@ export type JoinSessionConfig = Omit<ResumeSessionConfig, "onPermissionRequest"
33
53
  * ```
34
54
  */
35
55
  requestedEnvironmentVariables?: string[];
36
- /**
37
- * Factory handles to register when the extension joins the session.
38
- *
39
- * @experimental Part of the experimental Agent Factories surface and may
40
- * change or be removed in future SDK or CLI releases.
41
- */
42
- factories?: FactoryHandle[];
43
- };
56
+ } & JoinSessionContributionConfig;
44
57
  export type { ExtensionInfo, FactoryLimits, FactoryMeta } from "./types.js";
45
58
  export { defineFactory, FactoryResumeError, isFactoryRunTerminal, type RunOptions, type ResumeOptions, type FactoryResumeErrorCode, type SessionFactoryApi, type FactoryAgentOptions, type FactoryContext, type FactoryDefinition, type FactoryHandle, type FactoryJsonSchema, type JsonValue, type FactoryPipelineStage, type FactoryStepOptions, type FactoryRunResult, type FactoryRunStatus, type FactoryRunSummary, type FactoryListRunsOptions, type FactoryRunsPage, type FactoryRunDetail, type FactoryProgressPage, type FactoryProgressLine, type FactoryPhaseObservation, type FactoryPhaseStatus, type FactoryAgentSummary, } from "./factory.js";
59
+ export { defineWorkflow, WorkflowResumeError, isWorkflowRunTerminal, type WorkflowRunOptions, type WorkflowResumeOptions, type WorkflowLimitOverrides, type WorkflowResumeErrorCode, type SessionWorkflowApi, type WorkflowAgentOptions, type WorkflowContext, type WorkflowDefinition, type WorkflowHandle, type WorkflowJsonSchema, type WorkflowLimits, type WorkflowMeta, type WorkflowPipelineStage, type WorkflowStepOptions, type WorkflowRunResult, type WorkflowRunStatus, type WorkflowRunSummary, type WorkflowListRunsOptions, type WorkflowRunsPage, type WorkflowRunDetail, type WorkflowProgressPage, type WorkflowProgressLine, type WorkflowPhaseObservation, type WorkflowPhaseStatus, type WorkflowAgentSummary, } from "./workflow.js";
46
60
  /**
47
61
  * Joins the current foreground session.
48
62
  *
package/dist/extension.js CHANGED
@@ -12,6 +12,11 @@ import {
12
12
  FactoryResumeError,
13
13
  isFactoryRunTerminal
14
14
  } from "./factory.js";
15
+ import {
16
+ defineWorkflow,
17
+ WorkflowResumeError,
18
+ isWorkflowRunTerminal
19
+ } from "./workflow.js";
15
20
  async function joinSession(config = {}) {
16
21
  const sessionId = process.env.SESSION_ID;
17
22
  if (!sessionId) {
@@ -23,10 +28,14 @@ async function joinSession(config = {}) {
23
28
  const {
24
29
  extensionSdkPath: _stripped,
25
30
  factories,
31
+ workflows,
26
32
  requestedEnvironmentVariables,
27
33
  ...rest
28
34
  } = config;
29
35
  void _stripped;
36
+ if (factories !== void 0 && workflows !== void 0) {
37
+ throw new Error("joinSession cannot register both factories and workflows");
38
+ }
30
39
  return client.resumeSessionForExtension(
31
40
  sessionId,
32
41
  {
@@ -34,7 +43,7 @@ async function joinSession(config = {}) {
34
43
  onPermissionRequest: config.onPermissionRequest ?? defaultJoinSessionPermissionHandler,
35
44
  suppressResumeEvent: config.suppressResumeEvent ?? true
36
45
  },
37
- factories,
46
+ { factories, workflows },
38
47
  requestedEnvironmentVariables?.length ? { requestedEnvironmentVariables } : void 0
39
48
  );
40
49
  }
@@ -42,8 +51,11 @@ export {
42
51
  Canvas,
43
52
  CanvasError,
44
53
  FactoryResumeError,
54
+ WorkflowResumeError,
45
55
  createCanvas,
46
56
  defineFactory,
57
+ defineWorkflow,
47
58
  isFactoryRunTerminal,
59
+ isWorkflowRunTerminal,
48
60
  joinSession
49
61
  };