@github/copilot-sdk 1.0.29 → 1.0.30-preview.0
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 +98 -7
- package/dist/cjs/cliVersion.js +1 -1
- package/dist/cjs/client.js +619 -93
- package/dist/cjs/decisions.js +139 -0
- package/dist/cjs/generated/rpc.js +164 -14
- package/dist/cjs/index.js +7 -0
- package/dist/cjs/session.js +98 -9
- package/dist/cliVersion.d.ts +1 -1
- package/dist/cliVersion.js +1 -1
- package/dist/client.d.ts +36 -3
- package/dist/client.js +621 -93
- package/dist/decisions.d.ts +65 -0
- package/dist/decisions.js +113 -0
- package/dist/generated/rpc.d.ts +1429 -127
- package/dist/generated/rpc.js +164 -14
- package/dist/generated/session-events.d.ts +213 -19
- package/dist/index.d.ts +4 -2
- package/dist/index.js +8 -0
- package/dist/session.d.ts +11 -2
- package/dist/session.js +98 -9
- package/dist/types.d.ts +141 -22
- package/docs/agent-author.md +1 -1
- package/docs/examples.md +77 -17
- package/package.json +12 -12
package/dist/client.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createServerRpc } from "./generated/rpc.js";
|
|
2
|
+
import { CopilotDecisions } from "./decisions.js";
|
|
2
3
|
import { CopilotSession } from "./session.js";
|
|
3
4
|
import { AhpHost, type AhpHostOptions } from "./host.js";
|
|
4
5
|
import type { CopilotClientOptions, GetAuthStatusResponse, GetStatusResponse, ModelInfo, ResumeSessionConfig, SessionConfig, SessionLifecycleEventType, SessionLifecycleHandler, SessionListFilter, SessionMetadata, TypedSessionLifecycleHandler } from "./types.js";
|
|
@@ -8,6 +9,7 @@ export declare class CopilotClient {
|
|
|
8
9
|
private ffiHost;
|
|
9
10
|
private connection;
|
|
10
11
|
private requestAdapter;
|
|
12
|
+
private pendingMemoryStores;
|
|
11
13
|
private messageWriter;
|
|
12
14
|
private connectionClosed;
|
|
13
15
|
private connectionEpoch;
|
|
@@ -17,7 +19,16 @@ export declare class CopilotClient {
|
|
|
17
19
|
private state;
|
|
18
20
|
/** Shared in-flight start; concurrent callers await it instead of spawning another CLI. */
|
|
19
21
|
private startPromise;
|
|
22
|
+
private shutdownCanceledStartup;
|
|
23
|
+
private stopPromise;
|
|
24
|
+
private forceStopPromise;
|
|
20
25
|
private sessions;
|
|
26
|
+
private pendingSessionResumes;
|
|
27
|
+
private sessionInitializations;
|
|
28
|
+
private failedAutoModeRecoveryCleanups;
|
|
29
|
+
private sessionInitializationContext;
|
|
30
|
+
private sessionInitializationLifetime;
|
|
31
|
+
private sessionInitializationGeneration;
|
|
21
32
|
private hostExitCallbacks;
|
|
22
33
|
private hostSessionFactories;
|
|
23
34
|
private hostAuthenticators;
|
|
@@ -42,6 +53,7 @@ export declare class CopilotClient {
|
|
|
42
53
|
private typedLifecycleHandlers;
|
|
43
54
|
private _rpc;
|
|
44
55
|
private _internalRpc;
|
|
56
|
+
private _decisions;
|
|
45
57
|
private processExitPromise;
|
|
46
58
|
private processTransportError;
|
|
47
59
|
private negotiatedProtocolVersion;
|
|
@@ -49,7 +61,7 @@ export declare class CopilotClient {
|
|
|
49
61
|
private sessionFsConfig;
|
|
50
62
|
private requestHandler;
|
|
51
63
|
private extensionLaunchProvider?;
|
|
52
|
-
private readonly
|
|
64
|
+
private readonly network?;
|
|
53
65
|
private installationConfirmationHandler?;
|
|
54
66
|
private builtinPluginDirectories;
|
|
55
67
|
private onGitHubTelemetry?;
|
|
@@ -60,6 +72,13 @@ export declare class CopilotClient {
|
|
|
60
72
|
* @throws Error if the client is not connected
|
|
61
73
|
*/
|
|
62
74
|
get rpc(): ReturnType<typeof createServerRpc>;
|
|
75
|
+
/**
|
|
76
|
+
* One-off yes/no, pick-one and rating questions answered by Copilot decision
|
|
77
|
+
* models. Requires the runtime's `DECISIONS_API` feature flag.
|
|
78
|
+
*
|
|
79
|
+
* @experimental
|
|
80
|
+
*/
|
|
81
|
+
get decisions(): CopilotDecisions;
|
|
63
82
|
private logDebugTiming;
|
|
64
83
|
private logDebug;
|
|
65
84
|
/**
|
|
@@ -105,7 +124,7 @@ export declare class CopilotClient {
|
|
|
105
124
|
private connectionExtraArgs;
|
|
106
125
|
/**
|
|
107
126
|
* Parse CLI URL into host and port
|
|
108
|
-
* Supports
|
|
127
|
+
* Supports raw TCP addresses: "host:port", "[ipv6]:port", "http://host:port", or just "port"
|
|
109
128
|
*/
|
|
110
129
|
private parseCliUrl;
|
|
111
130
|
private validateSessionFsConfig;
|
|
@@ -166,6 +185,7 @@ export declare class CopilotClient {
|
|
|
166
185
|
* ```
|
|
167
186
|
*/
|
|
168
187
|
stop(): Promise<Error[]>;
|
|
188
|
+
private doStop;
|
|
169
189
|
/**
|
|
170
190
|
* Alias for {@link stop} that lets `CopilotClient` participate in `await using`
|
|
171
191
|
* blocks for automatic cleanup.
|
|
@@ -188,7 +208,8 @@ export declare class CopilotClient {
|
|
|
188
208
|
* - Sends SIGKILL to the CLI process (if spawned by this client)
|
|
189
209
|
* - Waits for the spawned CLI process to exit
|
|
190
210
|
*
|
|
191
|
-
* @returns
|
|
211
|
+
* @returns Resolves after disconnection and spawned-process exit; later starts
|
|
212
|
+
* wait for pending startup cleanup.
|
|
192
213
|
* @throws If the spawned CLI process cannot be terminated
|
|
193
214
|
*
|
|
194
215
|
* @example
|
|
@@ -207,6 +228,7 @@ export declare class CopilotClient {
|
|
|
207
228
|
* ```
|
|
208
229
|
*/
|
|
209
230
|
forceStop(): Promise<void>;
|
|
231
|
+
private doForceStop;
|
|
210
232
|
/** Mode-specific defaults spread under the caller's config (app values win). */
|
|
211
233
|
private configDefaultsForMode;
|
|
212
234
|
/** Mode-specific default for enableExperimentalMode. */
|
|
@@ -231,6 +253,11 @@ export declare class CopilotClient {
|
|
|
231
253
|
*/
|
|
232
254
|
private updateSessionOptionsForMode;
|
|
233
255
|
createSession(config: SessionConfig): Promise<CopilotSession>;
|
|
256
|
+
private invalidateSessionInitializations;
|
|
257
|
+
private getSessionInitializationSignal;
|
|
258
|
+
private runInitializationCallback;
|
|
259
|
+
private acquireSessionInitialization;
|
|
260
|
+
private createSessionInternal;
|
|
234
261
|
/**
|
|
235
262
|
* Resumes an existing conversation session by its ID.
|
|
236
263
|
*
|
|
@@ -257,6 +284,9 @@ export declare class CopilotClient {
|
|
|
257
284
|
*/
|
|
258
285
|
resumeSession(sessionId: string, config: ResumeSessionConfig): Promise<CopilotSession>;
|
|
259
286
|
private resumeSessionInternal;
|
|
287
|
+
private resumeSessionWithInitialization;
|
|
288
|
+
private requireAutoModeRecovery;
|
|
289
|
+
private recordFailedAutoModeRecoveryCleanup;
|
|
260
290
|
/**
|
|
261
291
|
* Start a complete AHP listener hosted in-process by this runtime.
|
|
262
292
|
*
|
|
@@ -273,6 +303,7 @@ export declare class CopilotClient {
|
|
|
273
303
|
*/
|
|
274
304
|
startAhpHost(options: AhpHostOptions): Promise<AhpHost>;
|
|
275
305
|
private handleHostExit;
|
|
306
|
+
private abortPendingMemoryStores;
|
|
276
307
|
private disconnectHosts;
|
|
277
308
|
private releaseHostSessions;
|
|
278
309
|
private releaseHostSession;
|
|
@@ -358,6 +389,7 @@ export declare class CopilotClient {
|
|
|
358
389
|
* ```
|
|
359
390
|
*/
|
|
360
391
|
deleteSession(sessionId: string): Promise<void>;
|
|
392
|
+
private requestSessionDeletion;
|
|
361
393
|
/**
|
|
362
394
|
* List all available sessions.
|
|
363
395
|
*
|
|
@@ -508,6 +540,7 @@ export declare class CopilotClient {
|
|
|
508
540
|
*/
|
|
509
541
|
private connectViaTcp;
|
|
510
542
|
private attachConnectionHandlers;
|
|
543
|
+
private resolveSessionCallback;
|
|
511
544
|
private handleSessionEventNotification;
|
|
512
545
|
private handleSessionLifecycleNotification;
|
|
513
546
|
private handleUserInputRequest;
|