@github/copilot-sdk 0.1.31 → 0.1.33-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/dist/client.d.ts +53 -2
- package/dist/client.js +221 -77
- package/dist/extension.d.ts +19 -2
- package/dist/extension.js +18 -2
- package/dist/generated/rpc.d.ts +119 -0
- package/dist/generated/rpc.js +5 -0
- package/dist/generated/session-events.d.ts +419 -20
- package/dist/session.d.ts +33 -3
- package/dist/session.js +53 -2
- package/dist/types.d.ts +27 -2
- package/docs/agent-author.md +263 -0
- package/docs/examples.md +668 -0
- package/docs/extensions.md +59 -0
- package/package.json +3 -2
package/dist/generated/rpc.d.ts
CHANGED
|
@@ -40,16 +40,34 @@ export interface ModelsListResult {
|
|
|
40
40
|
* Model capabilities and limits
|
|
41
41
|
*/
|
|
42
42
|
capabilities: {
|
|
43
|
+
/**
|
|
44
|
+
* Feature flags indicating what the model supports
|
|
45
|
+
*/
|
|
43
46
|
supports: {
|
|
47
|
+
/**
|
|
48
|
+
* Whether this model supports vision/image input
|
|
49
|
+
*/
|
|
44
50
|
vision?: boolean;
|
|
45
51
|
/**
|
|
46
52
|
* Whether this model supports reasoning effort configuration
|
|
47
53
|
*/
|
|
48
54
|
reasoningEffort?: boolean;
|
|
49
55
|
};
|
|
56
|
+
/**
|
|
57
|
+
* Token limits for prompts, outputs, and context window
|
|
58
|
+
*/
|
|
50
59
|
limits: {
|
|
60
|
+
/**
|
|
61
|
+
* Maximum number of prompt/input tokens
|
|
62
|
+
*/
|
|
51
63
|
max_prompt_tokens?: number;
|
|
64
|
+
/**
|
|
65
|
+
* Maximum number of output/completion tokens
|
|
66
|
+
*/
|
|
52
67
|
max_output_tokens?: number;
|
|
68
|
+
/**
|
|
69
|
+
* Maximum total context window size in tokens
|
|
70
|
+
*/
|
|
53
71
|
max_context_window_tokens: number;
|
|
54
72
|
};
|
|
55
73
|
};
|
|
@@ -57,13 +75,22 @@ export interface ModelsListResult {
|
|
|
57
75
|
* Policy state (if applicable)
|
|
58
76
|
*/
|
|
59
77
|
policy?: {
|
|
78
|
+
/**
|
|
79
|
+
* Current policy state for this model
|
|
80
|
+
*/
|
|
60
81
|
state: string;
|
|
82
|
+
/**
|
|
83
|
+
* Usage terms or conditions for this model
|
|
84
|
+
*/
|
|
61
85
|
terms: string;
|
|
62
86
|
};
|
|
63
87
|
/**
|
|
64
88
|
* Billing information
|
|
65
89
|
*/
|
|
66
90
|
billing?: {
|
|
91
|
+
/**
|
|
92
|
+
* Billing cost multiplier relative to the base rate
|
|
93
|
+
*/
|
|
67
94
|
multiplier: number;
|
|
68
95
|
};
|
|
69
96
|
/**
|
|
@@ -145,6 +172,9 @@ export interface AccountGetQuotaResult {
|
|
|
145
172
|
};
|
|
146
173
|
}
|
|
147
174
|
export interface SessionModelGetCurrentResult {
|
|
175
|
+
/**
|
|
176
|
+
* Currently active model identifier
|
|
177
|
+
*/
|
|
148
178
|
modelId?: string;
|
|
149
179
|
}
|
|
150
180
|
export interface SessionModelGetCurrentParams {
|
|
@@ -154,6 +184,9 @@ export interface SessionModelGetCurrentParams {
|
|
|
154
184
|
sessionId: string;
|
|
155
185
|
}
|
|
156
186
|
export interface SessionModelSwitchToResult {
|
|
187
|
+
/**
|
|
188
|
+
* Currently active model identifier after the switch
|
|
189
|
+
*/
|
|
157
190
|
modelId?: string;
|
|
158
191
|
}
|
|
159
192
|
export interface SessionModelSwitchToParams {
|
|
@@ -161,7 +194,14 @@ export interface SessionModelSwitchToParams {
|
|
|
161
194
|
* Target session identifier
|
|
162
195
|
*/
|
|
163
196
|
sessionId: string;
|
|
197
|
+
/**
|
|
198
|
+
* Model identifier to switch to
|
|
199
|
+
*/
|
|
164
200
|
modelId: string;
|
|
201
|
+
/**
|
|
202
|
+
* Reasoning effort level to use for the model
|
|
203
|
+
*/
|
|
204
|
+
reasoningEffort?: string;
|
|
165
205
|
}
|
|
166
206
|
export interface SessionModeGetResult {
|
|
167
207
|
/**
|
|
@@ -399,6 +439,9 @@ export interface SessionCompactionCompactParams {
|
|
|
399
439
|
sessionId: string;
|
|
400
440
|
}
|
|
401
441
|
export interface SessionToolsHandlePendingToolCallResult {
|
|
442
|
+
/**
|
|
443
|
+
* Whether the tool call result was handled successfully
|
|
444
|
+
*/
|
|
402
445
|
success: boolean;
|
|
403
446
|
}
|
|
404
447
|
export interface SessionToolsHandlePendingToolCallParams {
|
|
@@ -418,6 +461,9 @@ export interface SessionToolsHandlePendingToolCallParams {
|
|
|
418
461
|
error?: string;
|
|
419
462
|
}
|
|
420
463
|
export interface SessionPermissionsHandlePendingPermissionRequestResult {
|
|
464
|
+
/**
|
|
465
|
+
* Whether the permission request was handled successfully
|
|
466
|
+
*/
|
|
421
467
|
success: boolean;
|
|
422
468
|
}
|
|
423
469
|
export interface SessionPermissionsHandlePendingPermissionRequestParams {
|
|
@@ -442,6 +488,74 @@ export interface SessionPermissionsHandlePendingPermissionRequestParams {
|
|
|
442
488
|
message: string;
|
|
443
489
|
};
|
|
444
490
|
}
|
|
491
|
+
export interface SessionLogResult {
|
|
492
|
+
/**
|
|
493
|
+
* The unique identifier of the emitted session event
|
|
494
|
+
*/
|
|
495
|
+
eventId: string;
|
|
496
|
+
}
|
|
497
|
+
export interface SessionLogParams {
|
|
498
|
+
/**
|
|
499
|
+
* Target session identifier
|
|
500
|
+
*/
|
|
501
|
+
sessionId: string;
|
|
502
|
+
/**
|
|
503
|
+
* Human-readable message
|
|
504
|
+
*/
|
|
505
|
+
message: string;
|
|
506
|
+
/**
|
|
507
|
+
* Log severity level. Determines how the message is displayed in the timeline. Defaults to "info".
|
|
508
|
+
*/
|
|
509
|
+
level?: "info" | "warning" | "error";
|
|
510
|
+
/**
|
|
511
|
+
* When true, the message is transient and not persisted to the session event log on disk
|
|
512
|
+
*/
|
|
513
|
+
ephemeral?: boolean;
|
|
514
|
+
}
|
|
515
|
+
export interface SessionShellExecResult {
|
|
516
|
+
/**
|
|
517
|
+
* Unique identifier for tracking streamed output
|
|
518
|
+
*/
|
|
519
|
+
processId: string;
|
|
520
|
+
}
|
|
521
|
+
export interface SessionShellExecParams {
|
|
522
|
+
/**
|
|
523
|
+
* Target session identifier
|
|
524
|
+
*/
|
|
525
|
+
sessionId: string;
|
|
526
|
+
/**
|
|
527
|
+
* Shell command to execute
|
|
528
|
+
*/
|
|
529
|
+
command: string;
|
|
530
|
+
/**
|
|
531
|
+
* Working directory (defaults to session working directory)
|
|
532
|
+
*/
|
|
533
|
+
cwd?: string;
|
|
534
|
+
/**
|
|
535
|
+
* Timeout in milliseconds (default: 30000)
|
|
536
|
+
*/
|
|
537
|
+
timeout?: number;
|
|
538
|
+
}
|
|
539
|
+
export interface SessionShellKillResult {
|
|
540
|
+
/**
|
|
541
|
+
* Whether the signal was sent successfully
|
|
542
|
+
*/
|
|
543
|
+
killed: boolean;
|
|
544
|
+
}
|
|
545
|
+
export interface SessionShellKillParams {
|
|
546
|
+
/**
|
|
547
|
+
* Target session identifier
|
|
548
|
+
*/
|
|
549
|
+
sessionId: string;
|
|
550
|
+
/**
|
|
551
|
+
* Process identifier returned by shell.exec
|
|
552
|
+
*/
|
|
553
|
+
processId: string;
|
|
554
|
+
/**
|
|
555
|
+
* Signal to send (default: SIGTERM)
|
|
556
|
+
*/
|
|
557
|
+
signal?: "SIGTERM" | "SIGKILL" | "SIGINT";
|
|
558
|
+
}
|
|
445
559
|
/** Create typed server-scoped RPC methods (no session required). */
|
|
446
560
|
export declare function createServerRpc(connection: MessageConnection): {
|
|
447
561
|
ping: (params: PingParams) => Promise<PingResult>;
|
|
@@ -493,4 +607,9 @@ export declare function createSessionRpc(connection: MessageConnection, sessionI
|
|
|
493
607
|
permissions: {
|
|
494
608
|
handlePendingPermissionRequest: (params: Omit<SessionPermissionsHandlePendingPermissionRequestParams, "sessionId">) => Promise<SessionPermissionsHandlePendingPermissionRequestResult>;
|
|
495
609
|
};
|
|
610
|
+
log: (params: Omit<SessionLogParams, "sessionId">) => Promise<SessionLogResult>;
|
|
611
|
+
shell: {
|
|
612
|
+
exec: (params: Omit<SessionShellExecParams, "sessionId">) => Promise<SessionShellExecResult>;
|
|
613
|
+
kill: (params: Omit<SessionShellKillParams, "sessionId">) => Promise<SessionShellKillResult>;
|
|
614
|
+
};
|
|
496
615
|
};
|
package/dist/generated/rpc.js
CHANGED
|
@@ -49,6 +49,11 @@ function createSessionRpc(connection, sessionId) {
|
|
|
49
49
|
},
|
|
50
50
|
permissions: {
|
|
51
51
|
handlePendingPermissionRequest: async (params) => connection.sendRequest("session.permissions.handlePendingPermissionRequest", { sessionId, ...params })
|
|
52
|
+
},
|
|
53
|
+
log: async (params) => connection.sendRequest("session.log", { sessionId, ...params }),
|
|
54
|
+
shell: {
|
|
55
|
+
exec: async (params) => connection.sendRequest("session.shell.exec", { sessionId, ...params }),
|
|
56
|
+
kill: async (params) => connection.sendRequest("session.shell.kill", { sessionId, ...params })
|
|
52
57
|
}
|
|
53
58
|
};
|
|
54
59
|
}
|