@github/copilot-sdk 0.3.0 → 1.0.0-beta.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.
@@ -38,6 +38,34 @@ export type ExtensionSource = "project" | "user";
38
38
  * via the `definition` "ExtensionStatus".
39
39
  */
40
40
  export type ExtensionStatus = "running" | "disabled" | "failed" | "starting";
41
+ /**
42
+ * Tool call result (string or expanded result object)
43
+ *
44
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
45
+ * via the `definition` "ExternalToolResult".
46
+ */
47
+ export type ExternalToolResult = string | ExternalToolTextResultForLlm;
48
+ /**
49
+ * A content block within a tool result, which may be text, terminal output, image, audio, or a resource
50
+ *
51
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
52
+ * via the `definition` "ExternalToolTextResultForLlmContent".
53
+ */
54
+ export type ExternalToolTextResultForLlmContent = ExternalToolTextResultForLlmContentText | ExternalToolTextResultForLlmContentTerminal | ExternalToolTextResultForLlmContentImage | ExternalToolTextResultForLlmContentAudio | ExternalToolTextResultForLlmContentResourceLink | ExternalToolTextResultForLlmContentResource;
55
+ /**
56
+ * Theme variant this icon is intended for
57
+ *
58
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
59
+ * via the `definition` "ExternalToolTextResultForLlmContentResourceLinkIconTheme".
60
+ */
61
+ export type ExternalToolTextResultForLlmContentResourceLinkIconTheme = "light" | "dark";
62
+ /**
63
+ * The embedded resource contents, either text or base64-encoded binary
64
+ *
65
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
66
+ * via the `definition` "ExternalToolTextResultForLlmContentResourceDetails".
67
+ */
68
+ export type ExternalToolTextResultForLlmContentResourceDetails = EmbeddedTextResourceContents | EmbeddedBlobResourceContents;
41
69
  export type FilterMapping = {
42
70
  [k: string]: FilterMappingValue;
43
71
  } | FilterMappingString;
@@ -79,6 +107,7 @@ export type McpServerConfigLocalType = "local" | "stdio";
79
107
  * via the `definition` "McpServerConfigHttpType".
80
108
  */
81
109
  export type McpServerConfigHttpType = "http" | "sse";
110
+ export type McpServerConfigHttpOauthGrantType = "authorization_code" | "client_credentials";
82
111
  /**
83
112
  * Connection status: connected, failed, needs-auth, pending, disabled, or not_configured
84
113
  *
@@ -100,7 +129,7 @@ export type McpServerSource = "user" | "workspace" | "plugin" | "builtin";
100
129
  * via the `definition` "SessionMode".
101
130
  */
102
131
  export type SessionMode = "interactive" | "plan" | "autopilot";
103
- export type PermissionDecision = PermissionDecisionApproveOnce | PermissionDecisionApproveForSession | PermissionDecisionApproveForLocation | PermissionDecisionReject | PermissionDecisionUserNotAvailable;
132
+ export type PermissionDecision = PermissionDecisionApproveOnce | PermissionDecisionApproveForSession | PermissionDecisionApproveForLocation | PermissionDecisionApprovePermanently | PermissionDecisionReject | PermissionDecisionUserNotAvailable;
104
133
  /**
105
134
  * The approval to add as a session-scoped rule
106
135
  *
@@ -144,12 +173,41 @@ export type SessionFsSetProviderConventions = "windows" | "posix";
144
173
  */
145
174
  export type ShellKillSignal = "SIGTERM" | "SIGKILL" | "SIGINT";
146
175
  /**
147
- * Tool call result (string or expanded result object)
176
+ * Current lifecycle status of the task
177
+ *
178
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
179
+ * via the `definition` "TaskAgentInfoStatus".
180
+ */
181
+ export type TaskAgentInfoStatus = "running" | "idle" | "completed" | "failed" | "cancelled";
182
+ /**
183
+ * How the agent is currently being managed by the runtime
148
184
  *
149
185
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
150
- * via the `definition` "ToolsHandlePendingToolCall".
186
+ * via the `definition` "TaskAgentInfoExecutionMode".
151
187
  */
152
- export type ToolsHandlePendingToolCall = string | ToolCallResult;
188
+ export type TaskAgentInfoExecutionMode = "sync" | "background";
189
+ export type TaskInfo = TaskAgentInfo | TaskShellInfo;
190
+ /**
191
+ * Current lifecycle status of the task
192
+ *
193
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
194
+ * via the `definition` "TaskShellInfoStatus".
195
+ */
196
+ export type TaskShellInfoStatus = "running" | "idle" | "completed" | "failed" | "cancelled";
197
+ /**
198
+ * Whether the shell runs inside a managed PTY session or as an independent background process
199
+ *
200
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
201
+ * via the `definition` "TaskShellInfoAttachmentMode".
202
+ */
203
+ export type TaskShellInfoAttachmentMode = "attached" | "detached";
204
+ /**
205
+ * Whether the shell command is currently sync-waited or background-managed
206
+ *
207
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
208
+ * via the `definition` "TaskShellInfoExecutionMode".
209
+ */
210
+ export type TaskShellInfoExecutionMode = "sync" | "background";
153
211
  export type UIElicitationFieldValue = string | number | boolean | string[];
154
212
  export type UIElicitationSchemaProperty = UIElicitationStringEnumField | UIElicitationStringOneOfField | UIElicitationArrayEnumField | UIElicitationArrayAnyOfField | UIElicitationSchemaPropertyBoolean | UIElicitationSchemaPropertyString | UIElicitationSchemaPropertyNumber;
155
213
  export type UIElicitationSchemaPropertyStringFormat = "email" | "uri" | "date" | "date-time";
@@ -229,6 +287,10 @@ export interface AgentInfo {
229
287
  * Description of the agent's purpose
230
288
  */
231
289
  description: string;
290
+ /**
291
+ * Absolute local file path of the agent definition. Only set for file-based agents loaded from disk; remote agents do not have a path.
292
+ */
293
+ path?: string;
232
294
  }
233
295
  /** @experimental */
234
296
  export interface AgentList {
@@ -271,6 +333,28 @@ export interface CommandsHandlePendingCommandResult {
271
333
  */
272
334
  success: boolean;
273
335
  }
336
+ /** @internal */
337
+ export interface ConnectRequest {
338
+ /**
339
+ * Connection token; required when the server was started with COPILOT_CONNECTION_TOKEN
340
+ */
341
+ token?: string;
342
+ }
343
+ /** @internal */
344
+ export interface ConnectResult {
345
+ /**
346
+ * Always true on success
347
+ */
348
+ ok: true;
349
+ /**
350
+ * Server protocol version number
351
+ */
352
+ protocolVersion: number;
353
+ /**
354
+ * Server package version
355
+ */
356
+ version: string;
357
+ }
274
358
  export interface CurrentModel {
275
359
  /**
276
360
  * Currently active model identifier
@@ -289,6 +373,34 @@ export interface DiscoveredMcpServer {
289
373
  */
290
374
  enabled: boolean;
291
375
  }
376
+ export interface EmbeddedBlobResourceContents {
377
+ /**
378
+ * URI identifying the resource
379
+ */
380
+ uri: string;
381
+ /**
382
+ * MIME type of the blob content
383
+ */
384
+ mimeType?: string;
385
+ /**
386
+ * Base64-encoded binary content of the resource
387
+ */
388
+ blob: string;
389
+ }
390
+ export interface EmbeddedTextResourceContents {
391
+ /**
392
+ * URI identifying the resource
393
+ */
394
+ uri: string;
395
+ /**
396
+ * MIME type of the text content
397
+ */
398
+ mimeType?: string;
399
+ /**
400
+ * Text content of the resource
401
+ */
402
+ text: string;
403
+ }
292
404
  export interface Extension {
293
405
  /**
294
406
  * Source-qualified ID (e.g., 'project:my-ext', 'user:auth-helper')
@@ -326,6 +438,195 @@ export interface ExtensionsEnableRequest {
326
438
  */
327
439
  id: string;
328
440
  }
441
+ /**
442
+ * Expanded external tool result payload
443
+ *
444
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
445
+ * via the `definition` "ExternalToolTextResultForLlm".
446
+ */
447
+ export interface ExternalToolTextResultForLlm {
448
+ /**
449
+ * Text result returned to the model
450
+ */
451
+ textResultForLlm: string;
452
+ /**
453
+ * Execution outcome classification. Optional for back-compat; normalized to 'success' (or 'failure' when error is present) when missing or unrecognized.
454
+ */
455
+ resultType?: string;
456
+ /**
457
+ * Optional error message for failed executions
458
+ */
459
+ error?: string;
460
+ /**
461
+ * Detailed log content for timeline display
462
+ */
463
+ sessionLog?: string;
464
+ /**
465
+ * Optional tool-specific telemetry
466
+ */
467
+ toolTelemetry?: {
468
+ [k: string]: unknown;
469
+ };
470
+ /**
471
+ * Structured content blocks from the tool
472
+ */
473
+ contents?: ExternalToolTextResultForLlmContent[];
474
+ [k: string]: unknown;
475
+ }
476
+ /**
477
+ * Plain text content block
478
+ *
479
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
480
+ * via the `definition` "ExternalToolTextResultForLlmContentText".
481
+ */
482
+ export interface ExternalToolTextResultForLlmContentText {
483
+ /**
484
+ * Content block type discriminator
485
+ */
486
+ type: "text";
487
+ /**
488
+ * The text content
489
+ */
490
+ text: string;
491
+ }
492
+ /**
493
+ * Terminal/shell output content block with optional exit code and working directory
494
+ *
495
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
496
+ * via the `definition` "ExternalToolTextResultForLlmContentTerminal".
497
+ */
498
+ export interface ExternalToolTextResultForLlmContentTerminal {
499
+ /**
500
+ * Content block type discriminator
501
+ */
502
+ type: "terminal";
503
+ /**
504
+ * Terminal/shell output text
505
+ */
506
+ text: string;
507
+ /**
508
+ * Process exit code, if the command has completed
509
+ */
510
+ exitCode?: number;
511
+ /**
512
+ * Working directory where the command was executed
513
+ */
514
+ cwd?: string;
515
+ }
516
+ /**
517
+ * Image content block with base64-encoded data
518
+ *
519
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
520
+ * via the `definition` "ExternalToolTextResultForLlmContentImage".
521
+ */
522
+ export interface ExternalToolTextResultForLlmContentImage {
523
+ /**
524
+ * Content block type discriminator
525
+ */
526
+ type: "image";
527
+ /**
528
+ * Base64-encoded image data
529
+ */
530
+ data: string;
531
+ /**
532
+ * MIME type of the image (e.g., image/png, image/jpeg)
533
+ */
534
+ mimeType: string;
535
+ }
536
+ /**
537
+ * Audio content block with base64-encoded data
538
+ *
539
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
540
+ * via the `definition` "ExternalToolTextResultForLlmContentAudio".
541
+ */
542
+ export interface ExternalToolTextResultForLlmContentAudio {
543
+ /**
544
+ * Content block type discriminator
545
+ */
546
+ type: "audio";
547
+ /**
548
+ * Base64-encoded audio data
549
+ */
550
+ data: string;
551
+ /**
552
+ * MIME type of the audio (e.g., audio/wav, audio/mpeg)
553
+ */
554
+ mimeType: string;
555
+ }
556
+ /**
557
+ * Resource link content block referencing an external resource
558
+ *
559
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
560
+ * via the `definition` "ExternalToolTextResultForLlmContentResourceLink".
561
+ */
562
+ export interface ExternalToolTextResultForLlmContentResourceLink {
563
+ /**
564
+ * Icons associated with this resource
565
+ */
566
+ icons?: ExternalToolTextResultForLlmContentResourceLinkIcon[];
567
+ /**
568
+ * Resource name identifier
569
+ */
570
+ name: string;
571
+ /**
572
+ * Human-readable display title for the resource
573
+ */
574
+ title?: string;
575
+ /**
576
+ * URI identifying the resource
577
+ */
578
+ uri: string;
579
+ /**
580
+ * Human-readable description of the resource
581
+ */
582
+ description?: string;
583
+ /**
584
+ * MIME type of the resource content
585
+ */
586
+ mimeType?: string;
587
+ /**
588
+ * Size of the resource in bytes
589
+ */
590
+ size?: number;
591
+ /**
592
+ * Content block type discriminator
593
+ */
594
+ type: "resource_link";
595
+ }
596
+ /**
597
+ * Icon image for a resource
598
+ *
599
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
600
+ * via the `definition` "ExternalToolTextResultForLlmContentResourceLinkIcon".
601
+ */
602
+ export interface ExternalToolTextResultForLlmContentResourceLinkIcon {
603
+ /**
604
+ * URL or path to the icon image
605
+ */
606
+ src: string;
607
+ /**
608
+ * MIME type of the icon image
609
+ */
610
+ mimeType?: string;
611
+ /**
612
+ * Available icon sizes (e.g., ['16x16', '32x32'])
613
+ */
614
+ sizes?: string[];
615
+ theme?: ExternalToolTextResultForLlmContentResourceLinkIconTheme;
616
+ }
617
+ /**
618
+ * Embedded resource content block with inline text or binary data
619
+ *
620
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
621
+ * via the `definition` "ExternalToolTextResultForLlmContentResource".
622
+ */
623
+ export interface ExternalToolTextResultForLlmContentResource {
624
+ /**
625
+ * Content block type discriminator
626
+ */
627
+ type: "resource";
628
+ resource: ExternalToolTextResultForLlmContentResourceDetails;
629
+ }
329
630
  /** @experimental */
330
631
  export interface FleetStartRequest {
331
632
  /**
@@ -340,7 +641,18 @@ export interface FleetStartResult {
340
641
  */
341
642
  started: boolean;
342
643
  }
343
- export interface HandleToolCallResult {
644
+ export interface HandlePendingToolCallRequest {
645
+ /**
646
+ * Request ID of the pending tool call
647
+ */
648
+ requestId: string;
649
+ result?: ExternalToolResult;
650
+ /**
651
+ * Error message if the tool call failed
652
+ */
653
+ error?: string;
654
+ }
655
+ export interface HandlePendingToolCallResult {
344
656
  /**
345
657
  * Whether the tool call result was handled successfully
346
658
  */
@@ -507,6 +819,7 @@ export interface McpServerConfigHttp {
507
819
  };
508
820
  oauthClientId?: string;
509
821
  oauthPublicClient?: boolean;
822
+ oauthGrantType?: McpServerConfigHttpOauthGrantType;
510
823
  }
511
824
  export interface McpConfigDisableRequest {
512
825
  /**
@@ -811,7 +1124,7 @@ export interface ModeSetRequest {
811
1124
  }
812
1125
  export interface NameGetResult {
813
1126
  /**
814
- * The session name, falling back to the auto-generated summary, or null if neither exists
1127
+ * The session name (user-set or auto-generated), or null if not yet set
815
1128
  */
816
1129
  name: string | null;
817
1130
  }
@@ -832,7 +1145,11 @@ export interface PermissionDecisionApproveForSession {
832
1145
  * Approved and remembered for the rest of the session
833
1146
  */
834
1147
  kind: "approve-for-session";
835
- approval: PermissionDecisionApproveForSessionApproval;
1148
+ approval?: PermissionDecisionApproveForSessionApproval;
1149
+ /**
1150
+ * The URL domain to approve for this session
1151
+ */
1152
+ domain?: string;
836
1153
  }
837
1154
  export interface PermissionDecisionApproveForSessionApprovalCommands {
838
1155
  kind: "commands";
@@ -897,6 +1214,16 @@ export interface PermissionDecisionApproveForLocationApprovalCustomTool {
897
1214
  kind: "custom-tool";
898
1215
  toolName: string;
899
1216
  }
1217
+ export interface PermissionDecisionApprovePermanently {
1218
+ /**
1219
+ * Approved and persisted across sessions
1220
+ */
1221
+ kind: "approve-permanently";
1222
+ /**
1223
+ * The URL domain to approve permanently
1224
+ */
1225
+ domain: string;
1226
+ }
900
1227
  export interface PermissionDecisionReject {
901
1228
  /**
902
1229
  * Denied by the user during an interactive prompt
@@ -1407,6 +1734,194 @@ export interface SkillsEnableRequest {
1407
1734
  */
1408
1735
  name: string;
1409
1736
  }
1737
+ export interface TaskAgentInfo {
1738
+ /**
1739
+ * Task kind
1740
+ */
1741
+ type: "agent";
1742
+ /**
1743
+ * Unique task identifier
1744
+ */
1745
+ id: string;
1746
+ /**
1747
+ * Tool call ID associated with this agent task
1748
+ */
1749
+ toolCallId: string;
1750
+ /**
1751
+ * Short description of the task
1752
+ */
1753
+ description: string;
1754
+ status: TaskAgentInfoStatus;
1755
+ /**
1756
+ * ISO 8601 timestamp when the task was started
1757
+ */
1758
+ startedAt: string;
1759
+ /**
1760
+ * ISO 8601 timestamp when the task finished
1761
+ */
1762
+ completedAt?: string;
1763
+ /**
1764
+ * Accumulated active execution time in milliseconds
1765
+ */
1766
+ activeTimeMs?: number;
1767
+ /**
1768
+ * ISO 8601 timestamp when the current active period began
1769
+ */
1770
+ activeStartedAt?: string;
1771
+ /**
1772
+ * Error message when the task failed
1773
+ */
1774
+ error?: string;
1775
+ /**
1776
+ * Type of agent running this task
1777
+ */
1778
+ agentType: string;
1779
+ /**
1780
+ * Prompt passed to the agent
1781
+ */
1782
+ prompt: string;
1783
+ /**
1784
+ * Result text from the task when available
1785
+ */
1786
+ result?: string;
1787
+ /**
1788
+ * Model used for the task when specified
1789
+ */
1790
+ model?: string;
1791
+ executionMode?: TaskAgentInfoExecutionMode;
1792
+ /**
1793
+ * Whether the task is currently in the original sync wait and can be moved to background mode. False once it is already backgrounded, idle, finished, or no longer has a promotable sync waiter.
1794
+ */
1795
+ canPromoteToBackground?: boolean;
1796
+ /**
1797
+ * Most recent response text from the agent
1798
+ */
1799
+ latestResponse?: string;
1800
+ /**
1801
+ * ISO 8601 timestamp when the agent entered idle state
1802
+ */
1803
+ idleSince?: string;
1804
+ }
1805
+ export interface TaskShellInfo {
1806
+ /**
1807
+ * Task kind
1808
+ */
1809
+ type: "shell";
1810
+ /**
1811
+ * Unique task identifier
1812
+ */
1813
+ id: string;
1814
+ /**
1815
+ * Short description of the task
1816
+ */
1817
+ description: string;
1818
+ status: TaskShellInfoStatus;
1819
+ /**
1820
+ * ISO 8601 timestamp when the task was started
1821
+ */
1822
+ startedAt: string;
1823
+ /**
1824
+ * ISO 8601 timestamp when the task finished
1825
+ */
1826
+ completedAt?: string;
1827
+ /**
1828
+ * Command being executed
1829
+ */
1830
+ command: string;
1831
+ attachmentMode: TaskShellInfoAttachmentMode;
1832
+ executionMode?: TaskShellInfoExecutionMode;
1833
+ /**
1834
+ * Whether this shell task can be promoted to background mode
1835
+ */
1836
+ canPromoteToBackground?: boolean;
1837
+ /**
1838
+ * Path to the detached shell log, when available
1839
+ */
1840
+ logPath?: string;
1841
+ /**
1842
+ * Process ID when available
1843
+ */
1844
+ pid?: number;
1845
+ }
1846
+ /** @experimental */
1847
+ export interface TaskList {
1848
+ /**
1849
+ * Currently tracked tasks
1850
+ */
1851
+ tasks: TaskInfo[];
1852
+ }
1853
+ /** @experimental */
1854
+ export interface TasksCancelRequest {
1855
+ /**
1856
+ * Task identifier
1857
+ */
1858
+ id: string;
1859
+ }
1860
+ /** @experimental */
1861
+ export interface TasksCancelResult {
1862
+ /**
1863
+ * Whether the task was successfully cancelled
1864
+ */
1865
+ cancelled: boolean;
1866
+ }
1867
+ /** @experimental */
1868
+ export interface TasksPromoteToBackgroundRequest {
1869
+ /**
1870
+ * Task identifier
1871
+ */
1872
+ id: string;
1873
+ }
1874
+ /** @experimental */
1875
+ export interface TasksPromoteToBackgroundResult {
1876
+ /**
1877
+ * Whether the task was successfully promoted to background mode
1878
+ */
1879
+ promoted: boolean;
1880
+ }
1881
+ /** @experimental */
1882
+ export interface TasksRemoveRequest {
1883
+ /**
1884
+ * Task identifier
1885
+ */
1886
+ id: string;
1887
+ }
1888
+ /** @experimental */
1889
+ export interface TasksRemoveResult {
1890
+ /**
1891
+ * Whether the task was removed. Returns false if the task does not exist or is still running/idle (cancel it first).
1892
+ */
1893
+ removed: boolean;
1894
+ }
1895
+ /** @experimental */
1896
+ export interface TasksStartAgentRequest {
1897
+ /**
1898
+ * Type of agent to start (e.g., 'explore', 'task', 'general-purpose')
1899
+ */
1900
+ agentType: string;
1901
+ /**
1902
+ * Task prompt for the agent
1903
+ */
1904
+ prompt: string;
1905
+ /**
1906
+ * Short name for the agent, used to generate a human-readable ID
1907
+ */
1908
+ name: string;
1909
+ /**
1910
+ * Short description of the task
1911
+ */
1912
+ description?: string;
1913
+ /**
1914
+ * Optional model override
1915
+ */
1916
+ model?: string;
1917
+ }
1918
+ /** @experimental */
1919
+ export interface TasksStartAgentResult {
1920
+ /**
1921
+ * Generated agent ID for the background task
1922
+ */
1923
+ agentId: string;
1924
+ }
1410
1925
  export interface Tool {
1411
1926
  /**
1412
1927
  * Tool identifier (e.g., "bash", "grep", "str_replace_editor")
@@ -1431,43 +1946,12 @@ export interface Tool {
1431
1946
  */
1432
1947
  instructions?: string;
1433
1948
  }
1434
- export interface ToolCallResult {
1435
- /**
1436
- * Text result to send back to the LLM
1437
- */
1438
- textResultForLlm: string;
1439
- /**
1440
- * Type of the tool result
1441
- */
1442
- resultType?: string;
1443
- /**
1444
- * Error message if the tool call failed
1445
- */
1446
- error?: string;
1447
- /**
1448
- * Telemetry data from tool execution
1449
- */
1450
- toolTelemetry?: {
1451
- [k: string]: unknown;
1452
- };
1453
- }
1454
1949
  export interface ToolList {
1455
1950
  /**
1456
1951
  * List of available built-in tools with metadata
1457
1952
  */
1458
1953
  tools: Tool[];
1459
1954
  }
1460
- export interface ToolsHandlePendingToolCallRequest {
1461
- /**
1462
- * Request ID of the pending tool call
1463
- */
1464
- requestId: string;
1465
- result?: ToolsHandlePendingToolCall;
1466
- /**
1467
- * Error message if the tool call failed
1468
- */
1469
- error?: string;
1470
- }
1471
1955
  export interface ToolsListRequest {
1472
1956
  /**
1473
1957
  * Optional model ID — when provided, the returned tool list reflects model-specific overrides
@@ -1616,6 +2100,16 @@ export interface UsageGetMetricsResult {
1616
2100
  * Raw count of user-initiated API requests
1617
2101
  */
1618
2102
  totalUserRequests: number;
2103
+ /**
2104
+ * Session-wide accumulated nano-AI units cost
2105
+ */
2106
+ totalNanoAiu?: number;
2107
+ /**
2108
+ * Session-wide per-token-type accumulated token counts
2109
+ */
2110
+ tokenDetails?: {
2111
+ [k: string]: UsageMetricsTokenDetail;
2112
+ };
1619
2113
  /**
1620
2114
  * Total time spent in model API calls (milliseconds)
1621
2115
  */
@@ -1644,6 +2138,12 @@ export interface UsageGetMetricsResult {
1644
2138
  */
1645
2139
  lastCallOutputTokens: number;
1646
2140
  }
2141
+ export interface UsageMetricsTokenDetail {
2142
+ /**
2143
+ * Accumulated token count for this token type
2144
+ */
2145
+ tokenCount: number;
2146
+ }
1647
2147
  /**
1648
2148
  * Aggregated code change metrics
1649
2149
  *
@@ -1667,6 +2167,16 @@ export interface UsageMetricsCodeChanges {
1667
2167
  export interface UsageMetricsModelMetric {
1668
2168
  requests: UsageMetricsModelMetricRequests;
1669
2169
  usage: UsageMetricsModelMetricUsage;
2170
+ /**
2171
+ * Accumulated nano-AI units cost for this model
2172
+ */
2173
+ totalNanoAiu?: number;
2174
+ /**
2175
+ * Token count details per type
2176
+ */
2177
+ tokenDetails?: {
2178
+ [k: string]: UsageMetricsModelMetricTokenDetail;
2179
+ };
1670
2180
  }
1671
2181
  /**
1672
2182
  * Request count and cost metrics for this model
@@ -1712,6 +2222,12 @@ export interface UsageMetricsModelMetricUsage {
1712
2222
  */
1713
2223
  reasoningTokens?: number;
1714
2224
  }
2225
+ export interface UsageMetricsModelMetricTokenDetail {
2226
+ /**
2227
+ * Accumulated token count for this token type
2228
+ */
2229
+ tokenCount: number;
2230
+ }
1715
2231
  export interface WorkspacesCreateFileRequest {
1716
2232
  /**
1717
2233
  * Relative path within the workspace files directory
@@ -1733,8 +2249,9 @@ export interface WorkspacesGetWorkspaceResult {
1733
2249
  repository?: string;
1734
2250
  host_type?: "github" | "ado";
1735
2251
  branch?: string;
1736
- summary?: string;
1737
2252
  name?: string;
2253
+ user_named?: boolean;
2254
+ summary?: string;
1738
2255
  summary_count?: number;
1739
2256
  created_at?: string;
1740
2257
  updated_at?: string;
@@ -1801,8 +2318,17 @@ export declare function createServerRpc(connection: MessageConnection): {
1801
2318
  fork: (params: SessionsForkRequest) => Promise<SessionsForkResult>;
1802
2319
  };
1803
2320
  };
2321
+ /**
2322
+ * Create typed server-scoped RPC methods that are part of the SDK's internal
2323
+ * surface (e.g. handshake helpers). Not exported on the public client API.
2324
+ * @internal
2325
+ */
2326
+ export declare function createInternalServerRpc(connection: MessageConnection): {
2327
+ connect: (params: ConnectRequest) => Promise<ConnectResult>;
2328
+ };
1804
2329
  /** Create typed session-scoped RPC methods. */
1805
2330
  export declare function createSessionRpc(connection: MessageConnection, sessionId: string): {
2331
+ suspend: () => Promise<void>;
1806
2332
  auth: {
1807
2333
  getStatus: () => Promise<SessionAuthStatus>;
1808
2334
  };
@@ -1845,6 +2371,14 @@ export declare function createSessionRpc(connection: MessageConnection, sessionI
1845
2371
  reload: () => Promise<AgentReloadResult>;
1846
2372
  };
1847
2373
  /** @experimental */
2374
+ tasks: {
2375
+ startAgent: (params: TasksStartAgentRequest) => Promise<TasksStartAgentResult>;
2376
+ list: () => Promise<TaskList>;
2377
+ promoteToBackground: (params: TasksPromoteToBackgroundRequest) => Promise<TasksPromoteToBackgroundResult>;
2378
+ cancel: (params: TasksCancelRequest) => Promise<TasksCancelResult>;
2379
+ remove: (params: TasksRemoveRequest) => Promise<TasksRemoveResult>;
2380
+ };
2381
+ /** @experimental */
1848
2382
  skills: {
1849
2383
  list: () => Promise<SkillList>;
1850
2384
  enable: (params: SkillsEnableRequest) => Promise<void>;
@@ -1874,7 +2408,7 @@ export declare function createSessionRpc(connection: MessageConnection, sessionI
1874
2408
  reload: () => Promise<void>;
1875
2409
  };
1876
2410
  tools: {
1877
- handlePendingToolCall: (params: ToolsHandlePendingToolCallRequest) => Promise<HandleToolCallResult>;
2411
+ handlePendingToolCall: (params: HandlePendingToolCallRequest) => Promise<HandlePendingToolCallResult>;
1878
2412
  };
1879
2413
  commands: {
1880
2414
  handlePendingCommand: (params: CommandsHandlePendingCommandRequest) => Promise<CommandsHandlePendingCommandResult>;