@github/copilot-sdk 1.0.13 → 1.0.14-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.
- package/README.md +16 -0
- package/dist/cjs/cliVersion.js +1 -1
- package/dist/cjs/client.js +19 -3
- package/dist/cjs/factory.js +1 -0
- package/dist/cjs/ffiRuntimeHost.js +140 -55
- package/dist/cjs/generated/rpc.js +59 -7
- package/dist/cjs/session.js +56 -8
- package/dist/cliVersion.d.ts +1 -1
- package/dist/cliVersion.js +1 -1
- package/dist/client.d.ts +3 -0
- package/dist/client.js +19 -3
- package/dist/factory.d.ts +42 -16
- package/dist/factory.js +1 -0
- package/dist/ffiRuntimeHost.d.ts +8 -2
- package/dist/ffiRuntimeHost.js +140 -55
- package/dist/generated/rpc.d.ts +706 -45
- package/dist/generated/rpc.js +59 -7
- package/dist/generated/session-events.d.ts +461 -17
- package/dist/index.d.ts +2 -2
- package/dist/session.d.ts +1 -0
- package/dist/session.js +57 -9
- package/dist/types.d.ts +18 -1
- package/docs/factories.md +36 -19
- package/package.json +12 -11
package/dist/generated/rpc.js
CHANGED
|
@@ -238,13 +238,13 @@ function createServerRpc(connection) {
|
|
|
238
238
|
/**
|
|
239
239
|
* Enables installed plugins for new sessions.
|
|
240
240
|
*
|
|
241
|
-
* @param params Plugin names (or specs) to enable.
|
|
241
|
+
* @param params Plugin names (or specs) to enable, plus the optional working directory the repository-controlled guard is evaluated against.
|
|
242
242
|
*/
|
|
243
243
|
enable: async (params) => connection.sendRequest("plugins.enable", params),
|
|
244
244
|
/**
|
|
245
245
|
* Disables installed plugins for new sessions.
|
|
246
246
|
*
|
|
247
|
-
* @param params Plugin names (or specs) to disable.
|
|
247
|
+
* @param params Plugin names (or specs) to disable, plus the optional working directory the repository-controlled guard is evaluated against.
|
|
248
248
|
*/
|
|
249
249
|
disable: async (params) => connection.sendRequest("plugins.disable", params),
|
|
250
250
|
/** @experimental */
|
|
@@ -494,7 +494,15 @@ function createServerRpc(connection) {
|
|
|
494
494
|
*/
|
|
495
495
|
list: async (params) => connection.sendRequest("sessions.list", params),
|
|
496
496
|
/**
|
|
497
|
-
* Reads
|
|
497
|
+
* Reads client-owned metadata for multiple persisted local sessions without opening them. Results preserve request order and report missing, corrupt, unsupported, or temporarily unavailable sessions independently.
|
|
498
|
+
*
|
|
499
|
+
* @param params Bounded batch request for client-owned metadata from persisted local sessions.
|
|
500
|
+
*
|
|
501
|
+
* @returns Ordered client metadata outcomes for the requested local sessions.
|
|
502
|
+
*/
|
|
503
|
+
getClientMetadata: async (params) => connection.sendRequest("sessions.getClientMetadata", params),
|
|
504
|
+
/**
|
|
505
|
+
* Reads a page of durable events directly from a local session's persisted journal without creating, resuming, or activating the session. The first read pins the currently opened journal generation and its byte-length boundary; opaque cursor continuations remain on that generation across runtime-owned compaction, truncation, and rewrite operations, which replace the live path atomically, and events appended after the boundary are excluded. For cold hydration, await the first successful page before activation and establish lossless live-event buffering before resume; merge subsequent live events by ID, preserving persisted order and letting live payloads win. Continuations are process-local, single-use capabilities bound to the originating session and storage context and must be paged sequentially; concurrent or repeated use of the same cursor expires that duplicate read rather than reading the generation twice. A complete snapshot has cursorStatus 'ok' and hasMore false. Snapshots expire after five idle minutes, with at most eight retained per process and idle-only eviction under pressure; completion and cancelled-worker exit release their handles. No transcript copy is created, but retained handles may keep replaced files' disk blocks alive until release. Pages have a soft 1 MiB serialized event-array budget including resolved binary assets; one oversized event is returned alone to guarantee progress. Working memory also includes a record/lookahead and asset resolution; resolving the first binary reference may scan the full pinned generation to build a bounded offset index. If the snapshot expires, is evicted, is cancelled before a continuation is established, or becomes unreadable after an observable unsupported in-place shortening, the continuation returns cursorStatus 'expired' with an empty terminal page and never falls back to a different generation. A missing or initially unreadable journal is an RPC error. Persisted history excludes ephemeral events and may omit payloads that are reconstructed only for an active session; use the active session event stream for post-resume live events.
|
|
498
506
|
*
|
|
499
507
|
* @param params Pagination options for reading an inactive or active local session's persisted event journal.
|
|
500
508
|
*
|
|
@@ -775,7 +783,15 @@ function createSessionRpc(connection, sessionId) {
|
|
|
775
783
|
*
|
|
776
784
|
* @returns Managed sandbox enforcement state for a session.
|
|
777
785
|
*/
|
|
778
|
-
getEnforcementStatus: async () => connection.sendRequest("session.sandbox.getEnforcementStatus", { sessionId })
|
|
786
|
+
getEnforcementStatus: async () => connection.sendRequest("session.sandbox.getEnforcementStatus", { sessionId }),
|
|
787
|
+
/**
|
|
788
|
+
* Disables sandboxing for the remainder of the current session and approves the referenced pending sandbox-bypass permission request. The request is rejected unless the exact request is still pending and the effective sandbox policy permits bypass.
|
|
789
|
+
*
|
|
790
|
+
* @param params Request to disable sandboxing for the current session while resolving an active sandbox-bypass permission prompt.
|
|
791
|
+
*
|
|
792
|
+
* @returns Result of attempting to disable sandboxing for the current session.
|
|
793
|
+
*/
|
|
794
|
+
disableForSession: async (params) => connection.sendRequest("session.sandbox.disableForSession", { sessionId, ...params })
|
|
779
795
|
},
|
|
780
796
|
/**
|
|
781
797
|
* Aborts the current agent turn.
|
|
@@ -939,6 +955,14 @@ function createSessionRpc(connection, sessionId) {
|
|
|
939
955
|
* @returns Complete current or terminal factory run envelope.
|
|
940
956
|
*/
|
|
941
957
|
cancel: async (params) => connection.sendRequest("session.factory.cancel", { sessionId, ...params }),
|
|
958
|
+
/**
|
|
959
|
+
* Pauses a running factory and returns its settled run envelope.
|
|
960
|
+
*
|
|
961
|
+
* @param params Parameters for pausing a running factory.
|
|
962
|
+
*
|
|
963
|
+
* @returns Complete current or terminal factory run envelope.
|
|
964
|
+
*/
|
|
965
|
+
pause: async (params) => connection.sendRequest("session.factory.pause", { sessionId, ...params }),
|
|
942
966
|
/**
|
|
943
967
|
* Records a batch of ordered factory progress lines.
|
|
944
968
|
*
|
|
@@ -999,6 +1023,14 @@ function createSessionRpc(connection, sessionId) {
|
|
|
999
1023
|
* @returns Immediate acknowledgement and Auto preference snapshot after a switch request. This result never implies that a pending preference committed.
|
|
1000
1024
|
*/
|
|
1001
1025
|
switchAutoTier: async (params) => connection.sendRequest("session.model.switchAutoTier", { sessionId, ...params }),
|
|
1026
|
+
/**
|
|
1027
|
+
* Replaces or clears the host-supplied model allowlist for a running session.
|
|
1028
|
+
*
|
|
1029
|
+
* @param params Host-supplied exact model selection IDs to allow for this running session. CAPI IDs are intersected with repository `.github/allowed_models.txt` policy; provider-qualified IDs remain exempt from repository-only policy but are restricted by this host list. Omit or pass null to clear the host restriction; an explicit empty or disjoint list is rejected. Validation and pre-selection fallback failures preserve the previous restriction. Failures after a fallback selection commits retain the new restriction and selected model; callers should inspect current session state after such an error.
|
|
1030
|
+
*
|
|
1031
|
+
* @returns The applied host allowlist and effective session model policy after intersection.
|
|
1032
|
+
*/
|
|
1033
|
+
setAllowedModels: async (params) => connection.sendRequest("session.model.setAllowedModels", { sessionId, ...params }),
|
|
1002
1034
|
/**
|
|
1003
1035
|
* Updates the session's reasoning effort without changing the selected model.
|
|
1004
1036
|
*
|
|
@@ -1244,7 +1276,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1244
1276
|
/**
|
|
1245
1277
|
* Starts fleet mode by submitting the fleet orchestration prompt to the session.
|
|
1246
1278
|
*
|
|
1247
|
-
* @param params
|
|
1279
|
+
* @param params Parameters for starting fleet orchestration: an optional user prompt combined with the fleet instructions, plus the send options forwarded to the resulting turn.
|
|
1248
1280
|
*
|
|
1249
1281
|
* @returns Indicates whether fleet mode was successfully activated.
|
|
1250
1282
|
*/
|
|
@@ -1786,7 +1818,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1786
1818
|
*/
|
|
1787
1819
|
set: async (params) => connection.sendRequest("session.tools.set", { sessionId, ...params }),
|
|
1788
1820
|
/**
|
|
1789
|
-
*
|
|
1821
|
+
* Sets the current session's live subagent settings override, which takes precedence over persisted user settings until cleared. Persisted user settings remain the source of truth for future sessions.
|
|
1790
1822
|
*
|
|
1791
1823
|
* @param params Subagent settings to apply to the current session
|
|
1792
1824
|
*
|
|
@@ -2136,6 +2168,20 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2136
2168
|
* @returns Point-in-time snapshot of slow-changing session identifier and state fields
|
|
2137
2169
|
*/
|
|
2138
2170
|
snapshot: async () => connection.sendRequest("session.metadata.snapshot", { sessionId }),
|
|
2171
|
+
/**
|
|
2172
|
+
* Returns the client-owned string metadata persisted with this local session. The metadata is not included in model context, events, telemetry, snapshots, or remote exports.
|
|
2173
|
+
*
|
|
2174
|
+
* @returns Client-owned, case-sensitive string metadata persisted with a local session. Clients should namespace keys by owner. Keys must be non-empty and at most 256 UTF-8 bytes; keys under `copilot/` and `github/` are reserved. Values may contain at most 16 KiB of UTF-8 data. A bag may contain at most 128 entries and its serialized sidecar may contain at most 64 KiB. The runtime stores but never interprets these values.
|
|
2175
|
+
*/
|
|
2176
|
+
getClientMetadata: async () => connection.sendRequest("session.metadata.getClientMetadata", { sessionId }),
|
|
2177
|
+
/**
|
|
2178
|
+
* Atomically patches the client-owned string metadata persisted with this local session and returns the committed bag.
|
|
2179
|
+
*
|
|
2180
|
+
* @param params Atomic patch for client-owned session metadata. Operations apply in clear, remove, then set order. The resulting bag must satisfy the ClientMetadata entry and serialized-size limits. Local storage coordinates concurrent runtime processes; custom SessionFs providers must serialize writers that access the same session from multiple processes.
|
|
2181
|
+
*
|
|
2182
|
+
* @returns Client-owned, case-sensitive string metadata persisted with a local session. Clients should namespace keys by owner. Keys must be non-empty and at most 256 UTF-8 bytes; keys under `copilot/` and `github/` are reserved. Values may contain at most 16 KiB of UTF-8 data. A bag may contain at most 128 entries and its serialized sidecar may contain at most 64 KiB. The runtime stores but never interprets these values.
|
|
2183
|
+
*/
|
|
2184
|
+
updateClientMetadata: async (params) => connection.sendRequest("session.metadata.updateClientMetadata", { sessionId, ...params }),
|
|
2139
2185
|
/**
|
|
2140
2186
|
* Reports whether the local session is currently processing user/agent messages.
|
|
2141
2187
|
*
|
|
@@ -2593,7 +2639,13 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
2593
2639
|
*
|
|
2594
2640
|
* @returns Resolved persisted factory identity and resumed run envelope.
|
|
2595
2641
|
*/
|
|
2596
|
-
resumeFromTool: async (params) => connection.sendRequest("session.factory.resumeFromTool", { sessionId, ...params })
|
|
2642
|
+
resumeFromTool: async (params) => connection.sendRequest("session.factory.resumeFromTool", { sessionId, ...params }),
|
|
2643
|
+
/**
|
|
2644
|
+
* Atomically pauses an owned factory attempt at a durable checkpoint.
|
|
2645
|
+
*
|
|
2646
|
+
* @param params Parameters for an owned durable pause checkpoint.
|
|
2647
|
+
*/
|
|
2648
|
+
pauseAtCheckpoint: async (params) => connection.sendRequest("session.factory.pauseAtCheckpoint", { sessionId, ...params })
|
|
2597
2649
|
},
|
|
2598
2650
|
/** @experimental */
|
|
2599
2651
|
model: {
|