@github/copilot-sdk-linuxmusl-x64 1.0.14-preview.1 → 1.0.14
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/copilot-sdk/cliVersion.d.ts +2 -0
- package/copilot-sdk/client.d.ts +5 -1
- package/copilot-sdk/docs/factories.md +36 -19
- package/copilot-sdk/extension.js +906 -185
- package/copilot-sdk/factory.d.ts +42 -16
- package/copilot-sdk/ffiRuntimeHost.d.ts +8 -2
- package/copilot-sdk/generated/rpc.d.ts +1683 -84
- package/copilot-sdk/generated/session-events.d.ts +987 -93
- package/copilot-sdk/index.d.ts +2 -2
- package/copilot-sdk/index.js +905 -184
- package/copilot-sdk/runtimeArtifacts.d.ts +13 -1
- package/copilot-sdk/session.d.ts +53 -1
- package/copilot-sdk/types.d.ts +78 -3
- package/package.json +1 -1
- package/prebuilds/linuxmusl-x64/runtime.node +0 -0
- package/schemas/api.schema.json +669 -107
- package/schemas/session-events.schema.json +560 -11
- package/sdk/index.js +256 -254
- package/tgrep/bin/linux-x64/tgrep +0 -0
- package/tgrep/bin/linuxmusl-x64/tgrep +0 -0
package/copilot-sdk/factory.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { FactoryGetRunProgressRequest, FactoryListRunsRequest, FactoryListRunsResult, FactoryProgressPage, FactoryRunDetail, FactoryRunResult, FactoryRunStatus, FactoryRunSummary } from "./generated/rpc.js";
|
|
2
2
|
import type { ContextTier } from "./generated/session-events.js";
|
|
3
3
|
import type { CopilotSession } from "./session.js";
|
|
4
|
-
import type {
|
|
4
|
+
import type { FactoryMeta } from "./types.js";
|
|
5
5
|
export type { FactoryRunResult };
|
|
6
6
|
export type { FactoryAgentSummary, FactoryPhaseStatus, FactoryPhaseObservation, FactoryProgressLine, FactoryProgressPage, FactoryRunDetail, FactoryRunStatus, FactoryRunSummary, } from "./generated/rpc.js";
|
|
7
7
|
/**
|
|
@@ -81,6 +81,21 @@ export interface FactoryStepOptions {
|
|
|
81
81
|
/** Skip the journal and always invoke the producer. */
|
|
82
82
|
volatile?: boolean;
|
|
83
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Per-invocation factory resource ceiling overrides.
|
|
86
|
+
*
|
|
87
|
+
* An omitted field preserves the existing/default ceiling, a number replaces
|
|
88
|
+
* it, and `null` explicitly makes that dimension unlimited.
|
|
89
|
+
*
|
|
90
|
+
* @experimental Part of the experimental Agent Factories surface and may
|
|
91
|
+
* change or be removed in future SDK or CLI releases.
|
|
92
|
+
*/
|
|
93
|
+
export interface FactoryLimitOverrides {
|
|
94
|
+
maxConcurrentSubagents?: number | null;
|
|
95
|
+
maxTotalSubagents?: number | null;
|
|
96
|
+
maxAiCredits?: number | null;
|
|
97
|
+
timeoutSeconds?: number | null;
|
|
98
|
+
}
|
|
84
99
|
/**
|
|
85
100
|
* One stage in a per-item factory pipeline.
|
|
86
101
|
*
|
|
@@ -101,6 +116,13 @@ export interface FactoryContext<TArgs extends JsonValue = JsonValue> {
|
|
|
101
116
|
agent(prompt: string, options?: FactoryAgentOptions): Promise<unknown>;
|
|
102
117
|
/** Memoize an arbitrary producer under a stable author-supplied key. */
|
|
103
118
|
step(key: string, producer: () => Promise<JsonValue> | JsonValue, options?: FactoryStepOptions): Promise<JsonValue>;
|
|
119
|
+
/**
|
|
120
|
+
* Pause this run at a durable, one-shot checkpoint.
|
|
121
|
+
*
|
|
122
|
+
* The first attempt to reach a key pauses and aborts cooperatively. A
|
|
123
|
+
* resumed attempt returns from the same key and continues.
|
|
124
|
+
*/
|
|
125
|
+
pause(key: string): Promise<void>;
|
|
104
126
|
/**
|
|
105
127
|
* Run thunks concurrently and await all of them.
|
|
106
128
|
*
|
|
@@ -129,7 +151,7 @@ export interface FactoryContext<TArgs extends JsonValue = JsonValue> {
|
|
|
129
151
|
args: TArgs;
|
|
130
152
|
/**
|
|
131
153
|
* The session instance returned by `joinSession`. It refuses calls that
|
|
132
|
-
* start or
|
|
154
|
+
* start, resume, or pause a factory run.
|
|
133
155
|
*/
|
|
134
156
|
session: CopilotSession;
|
|
135
157
|
/** Cooperative cancellation signal for the current factory run. */
|
|
@@ -178,7 +200,7 @@ export interface RunOptions<TArgs extends JsonValue = JsonValue> {
|
|
|
178
200
|
/** Input surfaced as `context.args`. */
|
|
179
201
|
args?: TArgs;
|
|
180
202
|
/** Optional per-invocation resource ceiling overrides. */
|
|
181
|
-
limits?:
|
|
203
|
+
limits?: FactoryLimitOverrides;
|
|
182
204
|
/** Whether to notify the originating session when the factory completes. */
|
|
183
205
|
notifyOnComplete?: boolean;
|
|
184
206
|
/** Whether to emit factory phase names to the session transcript. */
|
|
@@ -198,7 +220,7 @@ export interface RunOptions<TArgs extends JsonValue = JsonValue> {
|
|
|
198
220
|
*/
|
|
199
221
|
export interface ResumeOptions {
|
|
200
222
|
/** Optional per-invocation resource ceiling overrides. */
|
|
201
|
-
limits?:
|
|
223
|
+
limits?: FactoryLimitOverrides;
|
|
202
224
|
/** Whether to notify the originating session when the factory completes. */
|
|
203
225
|
notifyOnComplete?: boolean;
|
|
204
226
|
/** Whether to emit factory phase names to the session transcript. */
|
|
@@ -222,13 +244,14 @@ export interface SessionFactoryApi {
|
|
|
222
244
|
* Run a registered factory and resolve with its run envelope.
|
|
223
245
|
*
|
|
224
246
|
* The envelope is returned for every outcome, including `error`, `halted`,
|
|
225
|
-
* and `cancelled` — inspect `status` and read `result` only when
|
|
226
|
-
* completed.
|
|
227
|
-
*
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
*
|
|
231
|
-
*
|
|
247
|
+
* `paused`, and `cancelled` — inspect `status` and read `result` only when
|
|
248
|
+
* the run completed. `paused` settles the current attempt, but the same
|
|
249
|
+
* durable run can later resume under its existing run ID. SDK-initiated
|
|
250
|
+
* runs do not request permission, so they have no declined outcome. The
|
|
251
|
+
* model's `run_factory` tool requests permission before a durable row
|
|
252
|
+
* exists; declining it creates no run row. Failures that occur before a run
|
|
253
|
+
* exists (such as an unknown factory or attempting to start a run while the
|
|
254
|
+
* session is at its active top-level run limit) still reject.
|
|
232
255
|
*/
|
|
233
256
|
run(name: string, options?: RunOptions): Promise<FactoryRunResult>;
|
|
234
257
|
run<TArgs extends JsonValue>(factory: FactoryHandle<TArgs, JsonValue | void>, options?: RunOptions<TArgs>): Promise<FactoryRunResult>;
|
|
@@ -243,12 +266,13 @@ export interface SessionFactoryApi {
|
|
|
243
266
|
/** Read the latest durable envelope for a factory run. */
|
|
244
267
|
getRun(runId: string): Promise<FactoryRunResult>;
|
|
245
268
|
/**
|
|
246
|
-
* Wait for
|
|
269
|
+
* Wait for the current attempt to settle and resolve with its envelope.
|
|
247
270
|
*
|
|
248
|
-
* Resolves as soon as the run reaches `completed`, `error`, `halted`,
|
|
249
|
-
* `cancelled`, and resolves immediately when
|
|
250
|
-
*
|
|
251
|
-
*
|
|
271
|
+
* Resolves as soon as the run reaches `completed`, `error`, `halted`,
|
|
272
|
+
* `paused`, or `cancelled`, and resolves immediately when the current
|
|
273
|
+
* attempt has already settled. A `paused` envelope is an attempt-level
|
|
274
|
+
* snapshot: resuming the same durable run can later change the envelope
|
|
275
|
+
* returned by {@link SessionFactoryApi.getRun}.
|
|
252
276
|
*
|
|
253
277
|
* This watches the run's `factory.run_updated` invalidation events and
|
|
254
278
|
* periodically re-reads the durable envelope so a missed event cannot
|
|
@@ -279,6 +303,8 @@ export interface SessionFactoryApi {
|
|
|
279
303
|
getRunDetail(runId: string): Promise<FactoryRunDetail>;
|
|
280
304
|
/** Page durable progress forward, backward, or from the latest tail. */
|
|
281
305
|
getRunProgress(runId: string, options?: Omit<FactoryGetRunProgressRequest, "runId">): Promise<FactoryProgressPage>;
|
|
306
|
+
/** Pause a running factory attempt and return its `paused` envelope. */
|
|
307
|
+
pause(runId: string): Promise<FactoryRunResult>;
|
|
282
308
|
/** Cancel a factory run and return its terminal envelope. */
|
|
283
309
|
cancel(runId: string): Promise<FactoryRunResult>;
|
|
284
310
|
}
|
|
@@ -4,12 +4,16 @@ export declare class FfiRuntimeHost {
|
|
|
4
4
|
private readonly cliEntrypoint;
|
|
5
5
|
private readonly environment;
|
|
6
6
|
private readonly args;
|
|
7
|
+
private static readonly quarantinedHosts;
|
|
7
8
|
private readonly lib;
|
|
8
9
|
private serverId;
|
|
9
10
|
private connectionId;
|
|
10
11
|
private disposed;
|
|
12
|
+
private starting;
|
|
11
13
|
private outboundCallback;
|
|
12
14
|
private keepAliveTimer;
|
|
15
|
+
private cleanupRetryTimer;
|
|
16
|
+
private cleanupInProgress;
|
|
13
17
|
/** The stream JSON-RPC reads server→client frames from. */
|
|
14
18
|
readonly receiveStream: PassThrough;
|
|
15
19
|
/** The stream JSON-RPC writes client→server frames to. */
|
|
@@ -30,6 +34,8 @@ export declare class FfiRuntimeHost {
|
|
|
30
34
|
*/
|
|
31
35
|
private feedInbound;
|
|
32
36
|
private unregisterCallback;
|
|
33
|
-
|
|
34
|
-
|
|
37
|
+
private scheduleCleanupRetry;
|
|
38
|
+
private tryFinalizeCleanup;
|
|
39
|
+
/** Awaits the initial cleanup attempt; a non-quiescent close is retried in the background. */
|
|
40
|
+
dispose(): Promise<void>;
|
|
35
41
|
}
|