@github/copilot-sdk-win32-x64 1.0.15-preview.0 → 1.0.15-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.
@@ -0,0 +1,4 @@
1
+ import type { ResponseSchema, ZodSchema } from "./types.js";
2
+ export declare function isZodSchema(value: unknown): value is ZodSchema;
3
+ export declare function toJsonSchema(schema: ZodSchema | Record<string, unknown> | undefined): Record<string, unknown> | undefined;
4
+ export declare function isResponseSchema(value: unknown): value is ResponseSchema;
@@ -1,8 +1,9 @@
1
1
  import { createSessionRpc } from "./generated/rpc.js";
2
2
  import type { ModelSwitchAutoTierResult } from "./generated/rpc.js";
3
3
  import type { OpenCanvasInstance } from "./generated/rpc.js";
4
- import type { MessageOptions, ContextTier, ReasoningEffort, ReasoningSummary, AutoTier, ModelCapabilitiesOverride, SessionCapabilities, SessionEvent, SessionEventHandler, SessionEventType, SessionUiApi, TypedSessionEventHandler } from "./types.js";
4
+ import type { MessageOptions, ResponseSchema, ContextTier, ReasoningEffort, ReasoningSummary, AutoTier, ModelCapabilitiesOverride, SessionCapabilities, SessionEvent, SessionEventHandler, SessionEventType, SessionUiApi, TypedSessionEventHandler } from "./types.js";
5
5
  import { type SessionFactoryApi } from "./factory.js";
6
+ import { type SessionWorkflowApi } from "./workflow.js";
6
7
  /** Assistant message event - the final response from the assistant. */
7
8
  export type AssistantMessageEvent = Extract<SessionEvent, {
8
9
  type: "assistant.message";
@@ -50,6 +51,8 @@ export declare class CopilotSession {
50
51
  private commandHandlers;
51
52
  private factories;
52
53
  private factoryAbortControllers;
54
+ private workflows;
55
+ private workflowAbortControllers;
53
56
  private permissionHandler?;
54
57
  private mcpAuthHandler?;
55
58
  private userInputHandler?;
@@ -65,6 +68,7 @@ export declare class CopilotSession {
65
68
  private _capabilities;
66
69
  private openCanvasInstances;
67
70
  private disconnected;
71
+ private readonly pendingStructuredWaits;
68
72
  private disconnecting;
69
73
  private onDisconnected?;
70
74
  /**
@@ -74,6 +78,7 @@ export declare class CopilotSession {
74
78
  * change or be removed in future SDK or CLI releases.
75
79
  */
76
80
  readonly factory: SessionFactoryApi;
81
+ readonly workflow: SessionWorkflowApi;
77
82
  /**
78
83
  * Resolve a start/resume envelope into the terminal envelope callers expect.
79
84
  *
@@ -93,6 +98,18 @@ export declare class CopilotSession {
93
98
  * dropped invalidation from leaving the wait pending forever.
94
99
  */
95
100
  private waitForFactoryRun;
101
+ private settleWorkflowRun;
102
+ /**
103
+ * Resolve when a workflow run reaches a terminal status.
104
+ *
105
+ * The subscription is installed *before* the first read so a transition
106
+ * landing between the two cannot be missed, and re-reads are serialized so
107
+ * overlapping invalidation events cannot interleave — the run's revision
108
+ * advances once per operation, so a burst of events is common and must
109
+ * collapse into a single in-flight read. A bounded periodic re-read keeps a
110
+ * dropped invalidation from leaving the wait pending forever.
111
+ */
112
+ private waitForWorkflowRun;
96
113
  /**
97
114
  * Typed session-scoped RPC methods.
98
115
  */
@@ -122,13 +139,14 @@ export declare class CopilotSession {
122
139
  */
123
140
  get ui(): SessionUiApi;
124
141
  /**
125
- * Sends a message to this session and waits for the response.
142
+ * Sends a message to this session and returns once it is admitted.
126
143
  *
127
144
  * The message is processed asynchronously. Subscribe to events via {@link on}
128
145
  * to receive streaming responses and other session events.
129
146
  *
130
147
  * @param options - The message options including the prompt and optional attachments
131
- * @returns A promise that resolves with the message ID of the response
148
+ * @returns The submitted user message's ID, not an assistant response ID.
149
+ * When this send starts a run, root assistant messages carry it as originatingMessageId.
132
150
  * @throws Error if the session has been disconnected or the connection fails
133
151
  *
134
152
  * @example
@@ -149,6 +167,9 @@ export declare class CopilotSession {
149
167
  * assistant has finished processing the message.
150
168
  *
151
169
  * Events are still delivered to handlers registered via {@link on} while waiting.
170
+ * With a schema as the second argument, returns its parsed, validated result.
171
+ * Structured waits select only root-agent output originating from this send;
172
+ * other queued work may delay session.idle but cannot replace the result.
152
173
  *
153
174
  * @param options - The message options including the prompt and optional attachments
154
175
  * @param timeout - Timeout in milliseconds (default: 60000). Controls how long to wait; does not abort in-flight agent work.
@@ -165,7 +186,9 @@ export declare class CopilotSession {
165
186
  * ```
166
187
  */
167
188
  sendAndWait(prompt: string, timeout?: number): Promise<AssistantMessageEvent | undefined>;
189
+ sendAndWait<TResult>(options: MessageOptions | string, responseSchema: ResponseSchema<TResult>, timeout?: number): Promise<TResult>;
168
190
  sendAndWait(options: MessageOptions, timeout?: number): Promise<AssistantMessageEvent | undefined>;
191
+ private sendAndWaitForStructuredMessage;
169
192
  /**
170
193
  * Subscribes to events from this session.
171
194
  *
@@ -4,14 +4,14 @@
4
4
  import type { Canvas } from "./canvas.js";
5
5
  import type { SessionFsProvider } from "./sessionFsProvider.js";
6
6
  import type { CopilotRequestHandler } from "./copilotRequestHandler.js";
7
- import type { AutoTier, PermissionRequest as GeneratedPermissionRequest, PermissionRequestedData as GeneratedPermissionRequestedData, PermissionRequestedEvent as GeneratedPermissionRequestedEvent, ReasoningSummary, SessionLimitsConfig, SessionEvent as GeneratedSessionEvent } from "./generated/session-events.js";
7
+ import type { AttachmentExtensionContext as GeneratedExtensionContextAttachment, AutoTier, PermissionRequest as GeneratedPermissionRequest, PermissionRequestedData as GeneratedPermissionRequestedData, PermissionRequestedEvent as GeneratedPermissionRequestedEvent, ReasoningSummary, SessionLimitsConfig, SessionEvent as GeneratedSessionEvent } from "./generated/session-events.js";
8
8
  import type { CopilotSession } from "./session.js";
9
9
  import type { FactoryJsonSchema, JsonValue } from "./factory.js";
10
- import type { GitHubTokenAcquireRequest, GitHubTokenAcquireResult, GitHubTelemetryNotification, ModelBillingTokenPrices, OpenCanvasInstance, RemoteSessionMode, CurrentToolMetadata } from "./generated/rpc.js";
10
+ import type { ExtensionLaunchProviderHandler as GeneratedExtensionLaunchProvider, GitHubTokenAcquireRequest, GitHubTokenAcquireResult, GitHubTelemetryNotification, ModelBillingTokenPrices, OpenCanvasInstance, RemoteSessionMode, CurrentToolMetadata } from "./generated/rpc.js";
11
11
  import type { ToolSet } from "./toolSet.js";
12
12
  export type { RemoteSessionMode } from "./generated/rpc.js";
13
13
  export type { CurrentToolMetadata } from "./generated/rpc.js";
14
- export type { GitHubTokenAcquireReason, GitHubTokenAcquireResult, GitHubTelemetryNotification, GitHubTelemetryEvent, GitHubTelemetryClientInfo, } from "./generated/rpc.js";
14
+ export type { ExtensionLaunchProfile, ExtensionLaunchProviderResolveRequest, ExtensionLaunchProviderResolveResult, GitHubTokenAcquireReason, GitHubTokenAcquireResult, GitHubTelemetryNotification, GitHubTelemetryEvent, GitHubTelemetryClientInfo, } from "./generated/rpc.js";
15
15
  /**
16
16
  * Arguments passed to a session's {@link GitHubTokenProvider}.
17
17
  *
@@ -282,6 +282,14 @@ export interface CopilotClientOptions {
282
282
  * startup before any sessions can be created.
283
283
  */
284
284
  builtinPluginDirectories?: readonly string[];
285
+ /**
286
+ * Connection-level extension launch profile provider.
287
+ * When set, the client registers the provider during startup before any
288
+ * session can be created.
289
+ *
290
+ * @experimental
291
+ */
292
+ extensionLaunchProvider?: ExtensionLaunchProvider;
285
293
  /**
286
294
  * Log level for the Copilot runtime. When omitted, the runtime uses its
287
295
  * own default (currently `"info"`).
@@ -409,6 +417,8 @@ export interface CopilotClientOptions {
409
417
  */
410
418
  clientInfo?: CopilotClientInfo;
411
419
  }
420
+ /** Resolves launch profiles for extension entrypoints discovered by the runtime. */
421
+ export type ExtensionLaunchProvider = GeneratedExtensionLaunchProvider;
412
422
  /**
413
423
  * Configuration for creating a session
414
424
  */
@@ -510,6 +520,13 @@ export interface ZodSchema<T = unknown> {
510
520
  _output: T;
511
521
  toJSONSchema(): Record<string, unknown>;
512
522
  }
523
+ /**
524
+ * A Zod-compatible output schema that both describes and parses a typed result.
525
+ * TypeScript types are erased at runtime, so typed output requires a schema value.
526
+ */
527
+ export interface ResponseSchema<T = unknown> extends ZodSchema<T> {
528
+ parse(value: unknown): T;
529
+ }
513
530
  /**
514
531
  * Tool definition. Parameters can be either:
515
532
  * - A Zod schema (provides type inference for handler)
@@ -2740,6 +2757,8 @@ export interface ProviderModelConfig {
2740
2757
  * Message provenance, independent of delivery mode.
2741
2758
  */
2742
2759
  export type MessageSource = "user" | "system" | `agent-${string}`;
2760
+ /** Structured context contributed by an extension. */
2761
+ export type ExtensionContextAttachment = GeneratedExtensionContextAttachment;
2743
2762
  export interface MessageOptions {
2744
2763
  /**
2745
2764
  * The prompt/message to send
@@ -2752,7 +2771,7 @@ export interface MessageOptions {
2752
2771
  */
2753
2772
  source?: MessageSource;
2754
2773
  /**
2755
- * File, directory, selection, or blob attachments
2774
+ * File, directory, selection, blob, or extension context attachments
2756
2775
  */
2757
2776
  attachments?: Array<{
2758
2777
  type: "file";
@@ -2782,7 +2801,7 @@ export interface MessageOptions {
2782
2801
  data: string;
2783
2802
  mimeType: string;
2784
2803
  displayName?: string;
2785
- }>;
2804
+ } | ExtensionContextAttachment>;
2786
2805
  /**
2787
2806
  * Message delivery mode
2788
2807
  * - "enqueue": Add to queue (default)
@@ -2802,6 +2821,19 @@ export interface MessageOptions {
2802
2821
  * If provided, this is shown in the timeline instead of `prompt`.
2803
2822
  */
2804
2823
  displayPrompt?: string;
2824
+ /**
2825
+ * JSON Schema or a Zod schema for this run's output, including requests after tool calls.
2826
+ * Independent sends do not inherit it. Ordinary immediate steering retains the active
2827
+ * schema and origin, even when promoted to a follow-up after the model request finishes.
2828
+ * Specifying a schema with mode "immediate" is rejected, even while idle.
2829
+ * This is not a persisted session default and does not survive a context reset.
2830
+ *
2831
+ * sendAndWait still returns an assistant message event. For a typed result, pass a
2832
+ * Zod-compatible schema as sendAndWait's second argument instead.
2833
+ * Streaming events remain text and may include intermediate messages.
2834
+ * Use rpc.send's responseFormat for provider-specific name, description and strict options.
2835
+ */
2836
+ responseSchema?: ZodSchema | Record<string, unknown>;
2805
2837
  }
2806
2838
  /**
2807
2839
  * All possible event type strings from SessionEvent
@@ -0,0 +1,364 @@
1
+ import type { WorkflowGetRunProgressRequest, WorkflowListRunsRequest, WorkflowListRunsResult, WorkflowProgressPage, WorkflowRunDetail, WorkflowRunResult, WorkflowRunStatus, WorkflowRunSummary } from "./generated/rpc.js";
2
+ import type { ContextTier } from "./generated/session-events.js";
3
+ import type { CopilotSession } from "./session.js";
4
+ import type { JsonValue } from "./factory.js";
5
+ export type { WorkflowRunResult };
6
+ export type { WorkflowAgentSummary, WorkflowPhaseStatus, WorkflowPhaseObservation, WorkflowProgressLine, WorkflowProgressPage, WorkflowRunDetail, WorkflowRunStatus, WorkflowRunSummary, } from "./generated/rpc.js";
7
+ /**
8
+ * Options for paging durable workflow runs.
9
+ *
10
+ * @experimental Part of the experimental Dynamic Workflows surface and may
11
+ * change or be removed in future SDK or CLI releases.
12
+ */
13
+ export type WorkflowListRunsOptions = WorkflowListRunsRequest;
14
+ /**
15
+ * A page of durable workflow runs and its paging metadata.
16
+ *
17
+ * @experimental Part of the experimental Dynamic Workflows surface and may
18
+ * change or be removed in future SDK or CLI releases.
19
+ */
20
+ export type WorkflowRunsPage = WorkflowListRunsResult;
21
+ /**
22
+ * Whether a workflow run status is terminal.
23
+ *
24
+ * @experimental Part of the experimental Dynamic Workflows surface and may
25
+ * change or be removed in future SDK or CLI releases.
26
+ */
27
+ export declare function isWorkflowRunTerminal(status: WorkflowRunStatus): boolean;
28
+ declare const workflowHandleBrand: unique symbol;
29
+ /**
30
+ * Conservative JSON shape language accepted by the Dynamic Workflows surface, for
31
+ * both structured workflow agent output and a workflow's declared `argsSchema`.
32
+ *
33
+ * This is a best-effort structural guard — used to decide whether a subagent's
34
+ * structured output should be accepted or retried, and whether a caller's
35
+ * workflow `args` match the declared shape — **not** a full JSON Schema
36
+ * validator. Only these keywords are honored: `type`, `required`, `enum`,
37
+ * `const`, recursive `properties`/`items`, and `anyOf`/`oneOf`/`allOf`. A `type`
38
+ * is one of `null`, `boolean`, `integer`, `number`, `string`, `array`, or
39
+ * `object`, or a non-empty array of those (for example `["object", "null"]`).
40
+ *
41
+ * Everything else is **ignored, not enforced**. In particular, string
42
+ * constraints (`pattern`, `minLength`, `maxLength`, `format`), numeric ranges
43
+ * (`minimum`, `maximum`), and `additionalProperties` do not reject
44
+ * non-conforming output. Boolean schemas are outside this accepted shape.
45
+ * `oneOf` is treated like `anyOf` (at least one branch must match) rather than
46
+ * strict exactly-one. Author schemas within this subset; do not rely on
47
+ * unsupported constraints for correctness.
48
+ *
49
+ * @experimental Part of the experimental Dynamic Workflows surface and may
50
+ * change or be removed in future SDK or CLI releases.
51
+ */
52
+ export type WorkflowJsonSchema = {
53
+ [key: string]: JsonValue;
54
+ };
55
+ /**
56
+ * Static resource ceilings declared by a workflow before it runs.
57
+ *
58
+ * @experimental Part of the experimental Dynamic Workflows surface and may
59
+ * change or be removed in future SDK or CLI releases.
60
+ */
61
+ export interface WorkflowLimits {
62
+ /** Maximum number of workflow subagents that may run concurrently. Must be positive when present. */
63
+ maxConcurrentSubagents?: number;
64
+ /** Maximum total number of workflow subagents that may be spawned. Must be positive when present. */
65
+ maxTotalSubagents?: number;
66
+ /** Maximum AI credits consumed by workflow subagents and descendants. This post-paid ceiling is soft. */
67
+ maxAiCredits?: number;
68
+ /**
69
+ * Maximum accumulated active-execution time, in seconds. Active execution includes the entire extension body,
70
+ * subprocess waits, queued-agent waits, and sleeps. The limit is armed from the remaining headroom when a run
71
+ * resumes; time between attempts is not counted. Must be finite and positive when present.
72
+ */
73
+ timeoutSeconds?: number;
74
+ }
75
+ /**
76
+ * Registration metadata for an extension-authored workflow.
77
+ *
78
+ * @experimental Part of the experimental Dynamic Workflows surface and may
79
+ * change or be removed in future SDK or CLI releases.
80
+ */
81
+ export interface WorkflowMeta {
82
+ /** Stable workflow name used for invocation. */
83
+ name: string;
84
+ /** Human-readable workflow description. */
85
+ description: string;
86
+ /** Display metadata for the progress phases the workflow may report. */
87
+ phases: Array<{
88
+ title: string;
89
+ detail?: string;
90
+ }>;
91
+ /**
92
+ * Optional declared shape of the arguments this workflow expects as `ctx.args`.
93
+ *
94
+ * The runtime records and validates this schema when the workflow contribution
95
+ * is registered. Workflow bodies should still validate any semantic constraints
96
+ * they depend on because the public `session.workflow.run(...)` API forwards
97
+ * arguments directly.
98
+ */
99
+ argsSchema?: WorkflowJsonSchema;
100
+ /** Optional resource ceilings presented before execution. */
101
+ limits?: WorkflowLimits;
102
+ }
103
+ /**
104
+ * Options for one workflow-scoped subagent call.
105
+ *
106
+ * @experimental Part of the experimental Dynamic Workflows surface and may
107
+ * change or be removed in future SDK or CLI releases.
108
+ */
109
+ export interface WorkflowAgentOptions {
110
+ label?: string;
111
+ schema?: WorkflowJsonSchema;
112
+ model?: string;
113
+ reasoningEffort?: string;
114
+ contextTier?: ContextTier;
115
+ agent?: string;
116
+ }
117
+ export declare const WORKFLOW_AGENT_OPTION_KEYS: readonly ["label", "schema", "model", "reasoningEffort", "contextTier", "agent"];
118
+ /**
119
+ * Options for a durable workflow step.
120
+ *
121
+ * @experimental Part of the experimental Dynamic Workflows surface and may
122
+ * change or be removed in future SDK or CLI releases.
123
+ */
124
+ export interface WorkflowStepOptions {
125
+ /** Skip the journal and always invoke the producer. */
126
+ volatile?: boolean;
127
+ }
128
+ /**
129
+ * Per-invocation workflow resource ceiling overrides.
130
+ *
131
+ * An omitted field preserves the existing/default ceiling, a number replaces
132
+ * it, and `null` explicitly makes that dimension unlimited.
133
+ *
134
+ * @experimental Part of the experimental Dynamic Workflows surface and may
135
+ * change or be removed in future SDK or CLI releases.
136
+ */
137
+ export interface WorkflowLimitOverrides {
138
+ maxConcurrentSubagents?: number | null;
139
+ maxTotalSubagents?: number | null;
140
+ maxAiCredits?: number | null;
141
+ timeoutSeconds?: number | null;
142
+ }
143
+ /**
144
+ * One stage in a per-item workflow pipeline.
145
+ *
146
+ * @experimental Part of the experimental Dynamic Workflows surface and may
147
+ * change or be removed in future SDK or CLI releases.
148
+ */
149
+ export type WorkflowPipelineStage<TInput = unknown, TResult = unknown> = (previous: TInput, item: unknown, index: number) => Promise<TResult> | TResult;
150
+ /**
151
+ * Context passed to an extension-authored workflow body.
152
+ *
153
+ * @experimental Part of the experimental Dynamic Workflows surface and may
154
+ * change or be removed in future SDK or CLI releases.
155
+ */
156
+ export interface WorkflowContext<TArgs extends JsonValue = JsonValue> {
157
+ /** Stable identifier for the current workflow run. */
158
+ readonly runId: string;
159
+ /** Spawn and await one workflow-scoped subagent. */
160
+ agent(prompt: string, options?: WorkflowAgentOptions): Promise<unknown>;
161
+ /** Memoize an arbitrary producer under a stable author-supplied key. */
162
+ step(key: string, producer: () => Promise<JsonValue> | JsonValue, options?: WorkflowStepOptions): Promise<JsonValue>;
163
+ /**
164
+ * Pause this run at a durable, one-shot checkpoint.
165
+ *
166
+ * The first attempt to reach a key pauses and aborts cooperatively. A
167
+ * resumed attempt returns from the same key and continues.
168
+ */
169
+ pause(key: string): Promise<void>;
170
+ /**
171
+ * Run thunks concurrently and await all of them.
172
+ *
173
+ * A thunk that throws becomes `null` in the result array, so one failed
174
+ * item does not lose the rest. Cancellation and hard runtime failures
175
+ * (`ResponseError`, `ConnectionError`) are the exception: those propagate
176
+ * and reject the whole call, because they mean the run itself is in
177
+ * trouble rather than one item having failed.
178
+ */
179
+ parallel<TResult>(thunks: Array<() => Promise<TResult> | TResult>): Promise<Array<TResult | null>>;
180
+ /**
181
+ * Run each item through every stage without barriers between stages.
182
+ *
183
+ * A stage that throws drops that item to `null` and skips its remaining
184
+ * stages. As with {@link WorkflowContext.parallel}, cancellation and hard
185
+ * runtime failures propagate instead of being recorded per item.
186
+ */
187
+ pipeline(items: unknown[], ...stages: WorkflowPipelineStage[]): Promise<unknown[]>;
188
+ /** Start a named workflow progress phase. */
189
+ phase(title: string): void;
190
+ /** Emit a workflow progress line. */
191
+ log(message: string): void;
192
+ /** Reject because nested workflows are not supported. */
193
+ workflow(name: string, args?: JsonValue): Promise<JsonValue | void>;
194
+ /** Caller-supplied input, forwarded verbatim. */
195
+ args: TArgs;
196
+ /**
197
+ * The session instance returned by `joinSession`. It refuses calls that
198
+ * start, resume, or pause a workflow run.
199
+ */
200
+ session: CopilotSession;
201
+ /** Cooperative cancellation signal for the current workflow run. */
202
+ signal: AbortSignal;
203
+ }
204
+ /**
205
+ * Definition accepted by {@link defineWorkflow}.
206
+ *
207
+ * @experimental Part of the experimental Dynamic Workflows surface and may
208
+ * change or be removed in future SDK or CLI releases.
209
+ */
210
+ export interface WorkflowDefinition<TArgs extends JsonValue = JsonValue, TResult extends JsonValue | void = JsonValue | void> {
211
+ meta: WorkflowMeta;
212
+ run(context: WorkflowContext<TArgs>): Promise<TResult>;
213
+ }
214
+ /**
215
+ * A deeply immutable view of a value.
216
+ *
217
+ * `defineWorkflow` deep-freezes the metadata it stores, so the handle's view of
218
+ * it has to be readonly all the way down or `handle.meta.name = "..."` and
219
+ * `handle.meta.phases.push(...)` would compile and then throw at runtime.
220
+ */
221
+ type DeepReadonly<T> = T extends (infer U)[] ? readonly DeepReadonly<U>[] : T extends object ? {
222
+ readonly [K in keyof T]: DeepReadonly<T[K]>;
223
+ } : T;
224
+ /**
225
+ * Opaque reusable reference to a defined workflow.
226
+ *
227
+ * @experimental Part of the experimental Dynamic Workflows surface and may
228
+ * change or be removed in future SDK or CLI releases.
229
+ */
230
+ export interface WorkflowHandle<TArgs extends JsonValue = JsonValue, TResult extends JsonValue | void = JsonValue | void> {
231
+ readonly meta: DeepReadonly<WorkflowMeta>;
232
+ readonly [workflowHandleBrand]: {
233
+ readonly args: TArgs;
234
+ readonly result: TResult;
235
+ };
236
+ }
237
+ /**
238
+ * Options for invoking a workflow.
239
+ *
240
+ * @experimental Part of the experimental Dynamic Workflows surface and may
241
+ * change or be removed in future SDK or CLI releases.
242
+ */
243
+ export interface WorkflowRunOptions<TArgs extends JsonValue = JsonValue> {
244
+ /** Input surfaced as `context.args`. */
245
+ args?: TArgs;
246
+ /** Optional per-invocation resource ceiling overrides. */
247
+ limits?: WorkflowLimitOverrides;
248
+ /** Whether to notify the originating session when the workflow completes. */
249
+ notifyOnComplete?: boolean;
250
+ /** Whether to emit workflow phase names to the session transcript. */
251
+ logPhaseNames?: boolean;
252
+ }
253
+ /**
254
+ * Options for resuming a workflow run by ID.
255
+ *
256
+ * @experimental Part of the experimental Dynamic Workflows surface and may
257
+ * change or be removed in future SDK or CLI releases.
258
+ */
259
+ export interface WorkflowResumeOptions {
260
+ /** Optional per-invocation resource ceiling overrides. */
261
+ limits?: WorkflowLimitOverrides;
262
+ /** Whether to notify the originating session when the workflow completes. */
263
+ notifyOnComplete?: boolean;
264
+ /** Whether to emit workflow phase names to the session transcript. */
265
+ logPhaseNames?: boolean;
266
+ }
267
+ /**
268
+ * Machine-readable pre-execution workflow resume failure.
269
+ *
270
+ * @experimental Part of the experimental Dynamic Workflows surface and may
271
+ * change or be removed in future SDK or CLI releases.
272
+ */
273
+ export type WorkflowResumeErrorCode = "not_found" | "non_resumable" | "workflow_run_not_resumable" | "already_active" | "workflow_already_running" | "workflow_limits_invalid" | "workflow_session_disposed" | "workflow_storage_unavailable" | "workflow_storage_corrupt";
274
+ /**
275
+ * Friendly workflow API exposed on a session.
276
+ *
277
+ * @experimental Part of the experimental Dynamic Workflows surface and may
278
+ * change or be removed in future SDK or CLI releases.
279
+ */
280
+ export interface SessionWorkflowApi {
281
+ /**
282
+ * Run a registered workflow and resolve with its run envelope.
283
+ *
284
+ * The envelope is returned for every outcome, including `error`, `halted`,
285
+ * `paused`, and `cancelled` — inspect `status` and read `result` only when
286
+ * the run completed. `paused` settles the current attempt, but the same
287
+ * durable run can later resume under its existing run ID. SDK-initiated
288
+ * runs do not request permission, so they have no declined outcome.
289
+ * Failures that occur before a run exists (such as an unknown workflow or
290
+ * attempting to start a run while the session is at its active top-level
291
+ * run limit) still reject.
292
+ */
293
+ run(name: string, options?: WorkflowRunOptions): Promise<WorkflowRunResult>;
294
+ run<TArgs extends JsonValue>(workflow: WorkflowHandle<TArgs, JsonValue | void>, options?: WorkflowRunOptions<TArgs>): Promise<WorkflowRunResult>;
295
+ /**
296
+ * Resume a run from its persisted workflow name, arguments, journal, and accounting.
297
+ *
298
+ * Resolves with the run envelope like {@link SessionWorkflowApi.run}.
299
+ * SDK-initiated resumes do not request permission. A pre-execution failure
300
+ * with a documented resume code rejects with {@link WorkflowResumeError}.
301
+ */
302
+ resume(runId: string, options?: WorkflowResumeOptions): Promise<WorkflowRunResult>;
303
+ /** Read the latest durable envelope for a workflow run. */
304
+ getRun(runId: string): Promise<WorkflowRunResult>;
305
+ /**
306
+ * Wait for the current attempt to settle and resolve with its envelope.
307
+ *
308
+ * Resolves as soon as the run reaches `completed`, `error`, `halted`,
309
+ * `paused`, or `cancelled`, and resolves immediately when the current
310
+ * attempt has already settled. A `paused` envelope is an attempt-level
311
+ * snapshot: resuming the same durable run can later change the envelope
312
+ * returned by {@link SessionWorkflowApi.getRun}.
313
+ *
314
+ * This watches the runtime's `factory.run_updated` compatibility event and
315
+ * periodically re-reads the durable envelope so a missed event cannot
316
+ * leave the wait hanging. Pass a `signal` to stop waiting; aborting rejects
317
+ * and has no effect on the run itself, which keeps executing. Use
318
+ * {@link SessionWorkflowApi.cancel} to actually stop it.
319
+ */
320
+ waitForRun(runId: string, options?: {
321
+ signal?: AbortSignal;
322
+ }): Promise<WorkflowRunResult>;
323
+ /**
324
+ * List the newest default page of this session's durable workflow runs.
325
+ *
326
+ * This backwards-compatible overload returns only the runs array. Pass
327
+ * paging options to receive the full page, including its cursors and
328
+ * truncation metadata.
329
+ */
330
+ listRuns(): Promise<WorkflowRunSummary[]>;
331
+ /**
332
+ * Page this session's durable workflow runs.
333
+ *
334
+ * `afterSeq` and `beforeSeq` are exclusive cursors. The result includes
335
+ * `oldestSeq`, `newestSeq`, `hasMoreNewer`, and `omittedOlder` so callers
336
+ * can continue paging without using the raw RPC client.
337
+ */
338
+ listRuns(options: WorkflowListRunsOptions): Promise<WorkflowRunsPage>;
339
+ /** Read durable phases, direct agents, and the latest progress tail for a run. */
340
+ getRunDetail(runId: string): Promise<WorkflowRunDetail>;
341
+ /** Page durable progress forward, backward, or from the latest tail. */
342
+ getRunProgress(runId: string, options?: Omit<WorkflowGetRunProgressRequest, "runId">): Promise<WorkflowProgressPage>;
343
+ /** Pause a running workflow attempt and return its `paused` envelope. */
344
+ pause(runId: string): Promise<WorkflowRunResult>;
345
+ /** Cancel a workflow run and return its terminal envelope. */
346
+ cancel(runId: string): Promise<WorkflowRunResult>;
347
+ }
348
+ /**
349
+ * Error thrown when a workflow cannot be resumed before execution begins.
350
+ *
351
+ * @experimental Part of the experimental Dynamic Workflows surface and may
352
+ * change or be removed in future SDK or CLI releases.
353
+ */
354
+ export declare class WorkflowResumeError extends Error {
355
+ readonly code: WorkflowResumeErrorCode;
356
+ constructor(code: WorkflowResumeErrorCode, message: string);
357
+ }
358
+ /**
359
+ * Defines an extension-authored workflow and returns an opaque registration handle.
360
+ *
361
+ * @experimental Part of the experimental Dynamic Workflows surface and may
362
+ * change or be removed in future SDK or CLI releases.
363
+ */
364
+ export declare function defineWorkflow<TArgs extends JsonValue = JsonValue, TResult extends JsonValue | void = JsonValue | void>(definition: WorkflowDefinition<TArgs, TResult>): WorkflowHandle<TArgs, TResult>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@github/copilot-sdk-win32-x64",
3
- "version": "1.0.15-preview.0",
3
+ "version": "1.0.15-preview.1",
4
4
  "description": "Platform runtime for @github/copilot-sdk (win32-x64)",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,8 +1,9 @@
1
1
  {
2
+ "$schema": "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json",
2
3
  "mcpServers": {
3
4
  "computer-use": {
4
5
  "args": [],
5
- "command": "${PLUGIN_ROOT}/computer-use-mcp.exe",
6
+ "command": "./computer-use-mcp.exe",
6
7
  "cwd": "${PLUGIN_ROOT}",
7
8
  "type": "stdio"
8
9
  }
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
3
+ "description": "Computer Use is currently in preview.",
4
+ "name": "computer-use",
5
+ "version": "0.1.92"
6
+ }
Binary file
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/prebuilds/win32-x64/runtime.node
3
- size: 90981664 bytes
4
- sha256: 4d6e025dbaca975df74a27d433dc7ae9dfd4aca658326eb7ecb574be82c5518e
3
+ size: 91650848 bytes
4
+ sha256: 3a675975449061c440ddd3c45a48f2e673dcae8b9a15b0efc58db3af871b5c65
@@ -11,9 +11,9 @@ import { resolve as resolvePath } from "node:path";
11
11
  import { pathToFileURL } from "node:url";
12
12
 
13
13
  // The previous child_process.fork host supplied an IPC channel, which caused
14
- // Node to terminate the extension automatically if its parent disappeared.
15
- // Rust's stdio-only spawn has no equivalent channel, so preserve that liveness
16
- // contract explicitly to avoid orphaning extensions after a forced CLI exit.
14
+ // Node to remain alive for the extension's lifetime and terminate automatically
15
+ // if its parent disappeared. Rust's stdio-only spawn has no equivalent channel,
16
+ // so this referenced watchdog preserves both parts of that lifecycle contract.
17
17
  const parentPid = Number(process.env.COPILOT_EXTENSION_PARENT_PID);
18
18
  if (!Number.isSafeInteger(parentPid) || parentPid <= 0 || process.ppid !== parentPid) {
19
19
  process.exit(0);
@@ -28,7 +28,6 @@ const parentWatch = setInterval(() => {
28
28
  process.exit(0);
29
29
  }
30
30
  }, 1000);
31
- parentWatch.unref();
32
31
 
33
32
  // Register the ESM SDK resolver hook before loading the extension
34
33
  Module.register("./extension_sdk_resolver.mjs", import.meta.url);
Binary file