@xmoon76/dsh-pi-tui 0.5.7 → 0.5.9

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.
Files changed (78) hide show
  1. package/README.en.md +64 -26
  2. package/README.md +64 -26
  3. package/cordis.patch.yml +13 -0
  4. package/dist/acp-stdio.mjs +151 -0
  5. package/dist/{bootstrap-C9nl6e13.mjs → bootstrap-CVyHGQDX.mjs} +22330 -6888
  6. package/dist/browser-CDUSHIIr.mjs +76 -0
  7. package/dist/builtins.mjs +2 -2
  8. package/dist/{client-bootstrap-CGezi85O.mjs → client-bootstrap-4UoeVIHE.mjs} +2407 -1830
  9. package/dist/client-runtime-BHBlVUf5.mjs +1376 -0
  10. package/dist/{daemon-launcher-H_1r5Cqs.mjs → daemon-launcher-DxIgjBHW.mjs} +1551 -57
  11. package/dist/daemon-launcher.d.mts +85 -14
  12. package/dist/daemon-launcher.mjs +2 -2
  13. package/dist/diagnostics-Db5iVcuJ.mjs +123 -0
  14. package/dist/{entry-control-jBfKn1qO.mjs → entry-control-BDLZgg4m.mjs} +1 -1
  15. package/dist/{extensions-6a5vvJUT.mjs → extensions-Dx7ncPNA.mjs} +1 -4
  16. package/dist/extensions.mjs +1 -1
  17. package/dist/handoff-BjoEy3f8.mjs +106 -0
  18. package/dist/history-search-limits-Cx2UvRC2.mjs +16 -0
  19. package/dist/history-search-remote-BHuoellG.mjs +113 -0
  20. package/dist/history-search-remote-BzXdvrxk.mjs +26 -0
  21. package/dist/history-search-seat-BcHJTpeB.mjs +639 -0
  22. package/dist/history-search-seat-rZcq0XV6.mjs +639 -0
  23. package/dist/{host-bootstrap-MVxks641.mjs → host-bootstrap-BfnufpnW.mjs} +37 -72
  24. package/dist/{host-foundation-probe-DK7n5jDu.mjs → host-foundation-probe-DlD8-N_Q.mjs} +2 -2
  25. package/dist/host-runtime.mjs +5611 -290
  26. package/dist/index.d.mts +13 -6
  27. package/dist/index.mjs +22766 -6893
  28. package/dist/installed-dsh-BjUiJSwR.mjs +142 -0
  29. package/dist/interaction-port-D1Yv9zgu.mjs +45 -0
  30. package/dist/local-acp-control-CC5z4Xbq.mjs +304 -0
  31. package/dist/local-acp-endpoint-D1jYdJdv.mjs +41 -0
  32. package/dist/local-acp-listener-Cmgb5M0H.mjs +9493 -0
  33. package/dist/local-acp-status-B_25Q6kU.mjs +101 -0
  34. package/dist/local-client.mjs +719 -93
  35. package/dist/local-daemon-control-BFJAC8Kg.mjs +2199 -0
  36. package/dist/local-daemon-control-Bm3imctD.mjs +2101 -0
  37. package/dist/{local-discovery-BPZw1wEd.mjs → local-discovery-BMhaGIiJ.mjs} +254 -544
  38. package/dist/{local-discovery-BMoNXZjJ.mjs → local-discovery-Ba7_-NNC.mjs} +1 -1
  39. package/dist/{local-discovery-Bq3jLAn1.mjs → local-discovery-QSbFpjK2.mjs} +301 -544
  40. package/dist/local-host.mjs +970 -501
  41. package/dist/local-profile-daemon-admin-otpm69R6.mjs +469 -0
  42. package/dist/{local-scope-DEuGAy8l.mjs → local-scope-5DEKA_lW.mjs} +1075 -31
  43. package/dist/{local-transport-X4ZCe2uE.mjs → local-transport-DeWmdZ5E.mjs} +14 -3
  44. package/dist/{local-web-control-DKWtXIkr.mjs → local-web-control-Dny93N-r.mjs} +10 -7
  45. package/dist/{local-workspace-object-D06GL0UO.mjs → local-workspace-object-D0RVQt8U.mjs} +33 -9
  46. package/dist/model-selection-CYlqg2DV.mjs +83 -0
  47. package/dist/native-client-domains-Dg4srzYt.mjs +2 -0
  48. package/dist/native-client.d.mts +735 -0
  49. package/dist/native-client.mjs +3534 -0
  50. package/dist/{open-CmOBxSjN.mjs → open-QQva8-ar.mjs} +24 -20
  51. package/dist/{pi-tui-remote-contribution-Do8ECrUy.mjs → pi-tui-remote-contribution-565wiLWp.mjs} +741 -150
  52. package/dist/preferences.mjs +1 -1
  53. package/dist/{profile-preferences-migration-CThz4rHH.mjs → profile-preferences-migration-CNOWIdnr.mjs} +1 -1
  54. package/dist/{profile-preferences-migration-BfUGdPZx.mjs → profile-preferences-migration-IrnXcJWK.mjs} +10 -8
  55. package/dist/{prompt-sections-DXmjB58H.mjs → prompt-sections-Bi-9_Gr_.mjs} +28 -10
  56. package/dist/{prompt-sections-DUKmWb8g.mjs → prompt-sections-DFS1dqsY.mjs} +342 -56
  57. package/dist/{dist-BFgC-5tL.mjs → recall-scope-9Nuoto_i.mjs} +353 -1
  58. package/dist/rolldown-runtime-8H4AJuhK.mjs +14 -0
  59. package/dist/schema-CCLvDa7Q.mjs +177 -0
  60. package/dist/{schema-qE_P09zJ.mjs → schema-t97l3aK8.mjs} +56 -3
  61. package/dist/{session-DC0XQr5O.mjs → session-Cs8iLCEx.mjs} +784 -342
  62. package/dist/{session-Cihe8PPS.mjs → session-EBRZF6Ow.mjs} +783 -341
  63. package/dist/session-create-facts-CkfG5DpQ.mjs +20 -0
  64. package/dist/{startup-CarQxWwi.d.mts → startup-Dti3Udne.d.mts} +30 -3
  65. package/dist/{startup-CARqn3kV.mjs → startup-UtFQSDe_.mjs} +90 -15
  66. package/dist/startup.d.mts +2 -2
  67. package/dist/startup.mjs +1 -1
  68. package/dist/task-read-remote-DRtkXDrZ.mjs +1083 -0
  69. package/dist/{terminal-progress-source-D4DHyXDo.mjs → terminal-progress-source-VsczdXA-.mjs} +610 -335
  70. package/dist/{transcript-view-a7cROAaI.mjs → transcript-view-B6vCnukn.mjs} +2284 -1166
  71. package/dist/{transcript-view-hvNVkPtv.mjs → transcript-view-DSSdE2vK.mjs} +2191 -765
  72. package/dist/write-failure-xNKczXH7.mjs +189 -0
  73. package/package.json +25 -8
  74. package/dist/local-acp-listener-CNkguN5-.mjs +0 -2566
  75. package/dist/local-daemon-control-Bg9s2aYi.mjs +0 -1424
  76. package/dist/local-daemon-control-Cu_4FIdd.mjs +0 -1585
  77. package/dist/local-profile-daemon-admin-AXgVH-6y.mjs +0 -91
  78. package/dist/preset-BcWqOtY7.mjs +0 -46
@@ -0,0 +1,735 @@
1
+ //#region src/app/remote-process/native-client.d.ts
2
+ declare const NATIVE_CLIENT_API_VERSION: 1;
3
+ type NativeJsonValue = null | boolean | number | string | readonly NativeJsonValue[] | {
4
+ readonly [key: string]: NativeJsonValue;
5
+ };
6
+ interface NativeFailure {
7
+ readonly code: string;
8
+ readonly message: string;
9
+ }
10
+ type NativeNotDispatchedFailure = {
11
+ readonly kind: 'not-dispatched';
12
+ } & NativeFailure;
13
+ type NativeRejectedFailure = {
14
+ readonly kind: 'rejected';
15
+ } & NativeFailure;
16
+ type NativeUnsupportedFailure = {
17
+ readonly kind: 'unsupported';
18
+ } & NativeFailure;
19
+ type NativeUnavailableFailure = {
20
+ readonly kind: 'unavailable';
21
+ } & NativeFailure;
22
+ type NativeStaleFailure = {
23
+ readonly kind: 'stale';
24
+ } & NativeFailure;
25
+ type NativeClosedFailure = {
26
+ readonly kind: 'closed';
27
+ } & NativeFailure;
28
+ /** A dispatched write whose outcome could not be proven. */
29
+ type NativeUnknownFailure = {
30
+ readonly kind: 'unknown';
31
+ } & NativeFailure;
32
+ /** A create/open unknown that genuinely knows the requested Session id. */
33
+ type NativeUnknownRequestedFailure = NativeUnknownFailure & {
34
+ readonly requestedSessionId: string;
35
+ };
36
+ /** A permission/Plan unknown; commandId is known only after a settled execution. */
37
+ type NativeConfigurationUnknownFailure = NativeUnknownFailure & {
38
+ readonly commandId?: string;
39
+ };
40
+ /** Actual read outcomes: no accepted, committed or unknown success claim. */
41
+ type NativeReadFailure = NativeRejectedFailure | NativeUnsupportedFailure | NativeUnavailableFailure | NativeStaleFailure | NativeClosedFailure;
42
+ type NativeReadResult<T> = {
43
+ readonly kind: 'ok';
44
+ readonly value: T;
45
+ } | NativeReadFailure;
46
+ /** A read result that can also prove a caller cancellation before dispatch. */
47
+ type NativeCancellableReadResult<T> = NativeReadResult<T> | NativeNotDispatchedFailure;
48
+ /** Actual mutation outcomes: no generic `ok` and no admission ACK. */
49
+ type NativeMutationFailure = NativeRejectedFailure | NativeUnknownFailure | NativeUnsupportedFailure | NativeUnavailableFailure | NativeStaleFailure | NativeClosedFailure;
50
+ type NativeMutationResult<T> = {
51
+ readonly kind: 'committed';
52
+ readonly value: T;
53
+ } | NativeMutationFailure;
54
+ /** A permission/Plan configuration mutation: only this family correlates a settled command. */
55
+ type NativeConfigurationMutationFailure = Exclude<NativeMutationFailure, NativeUnknownFailure> | NativeConfigurationUnknownFailure;
56
+ type NativeConfigurationMutationResult<T> = {
57
+ readonly kind: 'committed';
58
+ readonly value: T;
59
+ } | NativeConfigurationMutationFailure;
60
+ /** One official admission ACK; never a committed, stopped or terminal claim. */
61
+ type NativeAdmissionResult<T> = {
62
+ readonly kind: 'accepted';
63
+ readonly value: T;
64
+ } | NativeMutationFailure;
65
+ type NativeCreateResult = {
66
+ readonly kind: 'committed';
67
+ readonly value: {
68
+ readonly sessionId: string;
69
+ };
70
+ } | {
71
+ readonly kind: 'published-with-error';
72
+ readonly sessionId: string;
73
+ readonly code: string;
74
+ readonly message: string;
75
+ readonly requestedSessionId?: string;
76
+ } | NativeRejectedFailure | NativeUnavailableFailure | NativeClosedFailure | NativeUnknownRequestedFailure;
77
+ type NativeOpenResult = {
78
+ readonly kind: 'ok';
79
+ readonly value: NativeSession;
80
+ } | NativeUnavailableFailure | NativeStaleFailure | NativeClosedFailure | NativeUnknownRequestedFailure;
81
+ type NativePromptFailure = NativeNotDispatchedFailure | NativeRejectedFailure | NativeUnsupportedFailure | NativeUnavailableFailure | NativeStaleFailure | NativeClosedFailure;
82
+ type NativePromptResult = {
83
+ readonly kind: 'accepted';
84
+ readonly requestId: string;
85
+ } | ({
86
+ readonly kind: 'unknown';
87
+ readonly requestId: string;
88
+ } & NativeFailure) | NativePromptFailure;
89
+ interface NativePromptResolutionOptions {
90
+ readonly maxMessages?: number;
91
+ readonly pageLimit?: number;
92
+ }
93
+ type NativePromptResolution = {
94
+ readonly source: 'accepted-echo';
95
+ readonly requestId: string;
96
+ } | {
97
+ readonly source: 'inbox-insertion';
98
+ readonly requestId: string;
99
+ readonly messageId: string;
100
+ readonly target: 'next-turn' | 'next-step';
101
+ readonly seq: number;
102
+ } | {
103
+ readonly source: 'user-message';
104
+ readonly requestId: string;
105
+ readonly messageId: string;
106
+ readonly seq: number;
107
+ readonly turn?: number;
108
+ readonly step?: number;
109
+ };
110
+ type NativePromptResolutionResult = {
111
+ readonly kind: 'accepted';
112
+ readonly requestId: string;
113
+ readonly value: NativePromptResolution;
114
+ } | ({
115
+ readonly kind: 'unknown';
116
+ readonly requestId: string;
117
+ } & NativeFailure) | Exclude<NativePromptResult, {
118
+ readonly kind: 'accepted' | 'unknown';
119
+ }>;
120
+ interface NativeDarwinKernelIdentity {
121
+ readonly platform: 'darwin';
122
+ readonly pid: number;
123
+ readonly bootUUID: string;
124
+ readonly uniqueId: string;
125
+ readonly parentUniqueId: string;
126
+ readonly processUUID: string;
127
+ readonly startSec: string;
128
+ readonly startUsec: string;
129
+ readonly ppid: number;
130
+ readonly pgid: number;
131
+ readonly sid: number;
132
+ readonly uid: number;
133
+ readonly state: number;
134
+ }
135
+ type NativeHostKernelIdentity = {
136
+ readonly platform: 'linux';
137
+ readonly hostStarttime: string;
138
+ } | NativeDarwinKernelIdentity;
139
+ interface NativeHostIdentity {
140
+ readonly scopeId: string;
141
+ readonly instanceId: string;
142
+ readonly hostPid: number;
143
+ readonly kernel: NativeHostKernelIdentity;
144
+ readonly protocol: string;
145
+ readonly dshVersion: string;
146
+ readonly bundleVersion: string;
147
+ readonly buildId: string;
148
+ }
149
+ type NativeLocalizedText = string | {
150
+ readonly en: string;
151
+ readonly [locale: string]: string;
152
+ };
153
+ interface NativeQuestionOption {
154
+ readonly label: string;
155
+ readonly description?: string;
156
+ }
157
+ type NativeQuestionIntent = {
158
+ readonly kind: 'plan-review';
159
+ readonly approve: string;
160
+ readonly callId?: string;
161
+ } | {
162
+ readonly kind: 'approval';
163
+ readonly approve: string;
164
+ readonly reject: string;
165
+ readonly always?: string;
166
+ readonly subject?: {
167
+ readonly name: string;
168
+ readonly icon?: string;
169
+ };
170
+ readonly display?: {
171
+ readonly question: {
172
+ readonly en: string;
173
+ readonly [locale: string]: string;
174
+ };
175
+ readonly detail?: {
176
+ readonly en: string;
177
+ readonly [locale: string]: string;
178
+ };
179
+ readonly approve?: {
180
+ readonly en: string;
181
+ readonly [locale: string]: string;
182
+ };
183
+ };
184
+ };
185
+ interface NativeQuestionItem {
186
+ readonly id: string;
187
+ readonly question: string;
188
+ readonly detail?: string;
189
+ readonly header?: string;
190
+ readonly options?: readonly NativeQuestionOption[];
191
+ readonly multiSelect?: boolean;
192
+ readonly intent?: NativeQuestionIntent;
193
+ }
194
+ interface NativeQuestionRequest {
195
+ readonly sessionId: string;
196
+ readonly callId?: string;
197
+ readonly timed?: boolean;
198
+ readonly questions: readonly NativeQuestionItem[];
199
+ readonly signal?: AbortSignal;
200
+ }
201
+ interface NativeQuestionAnswer {
202
+ readonly answers: readonly {
203
+ readonly id: string;
204
+ readonly selected: readonly string[];
205
+ readonly custom?: string;
206
+ }[];
207
+ }
208
+ interface NativeApprovalRequest {
209
+ readonly sessionId: string;
210
+ readonly callId?: string;
211
+ readonly toolName: string;
212
+ readonly reason?: string;
213
+ readonly displayReason?: {
214
+ readonly en: string;
215
+ readonly [locale: string]: string;
216
+ };
217
+ readonly signal?: AbortSignal;
218
+ }
219
+ type NativeApprovalOutcome = 'allowed-once' | 'rejected' | 'cancelled' | 'unavailable';
220
+ interface NativeAttachOptions {
221
+ readonly dshAnchor: string;
222
+ readonly profile: string;
223
+ readonly expectedScopeId?: string;
224
+ readonly expectedInstanceId?: string;
225
+ readonly signal?: AbortSignal;
226
+ readonly onQuestion?: (request: NativeQuestionRequest) => Promise<NativeQuestionAnswer>;
227
+ readonly onApproval?: (request: NativeApprovalRequest) => Promise<NativeApprovalOutcome>;
228
+ }
229
+ interface NativeClientStatus {
230
+ readonly transport: 'connecting' | 'connected' | 'disconnected' | 'closed';
231
+ readonly generationId?: number;
232
+ readonly activeWrappers: number;
233
+ readonly liveSockets: number;
234
+ readonly pendingInteractions: number;
235
+ readonly interactionIdentityGaps: number;
236
+ readonly identity: NativeHostIdentity;
237
+ }
238
+ interface NativeSessionSummary {
239
+ readonly sessionId: string;
240
+ readonly title?: string;
241
+ readonly cwd?: string;
242
+ readonly agentAvailable: boolean;
243
+ readonly running: boolean;
244
+ readonly blank: boolean;
245
+ readonly updatedAt: number;
246
+ readonly parentSessionId?: string;
247
+ readonly origin?: 'subagent';
248
+ readonly formatStatus?: 'current' | 'migration-required';
249
+ }
250
+ interface NativeHistoryOptions {
251
+ readonly beforeSeq?: number;
252
+ readonly throughSeq?: number;
253
+ readonly maxMessages?: number;
254
+ readonly turnWindow?: {
255
+ readonly minMessages: number;
256
+ readonly minTurns: number;
257
+ };
258
+ }
259
+ /** Cancellation for one root passive read. */
260
+ interface NativeReadOptions {
261
+ readonly signal?: AbortSignal;
262
+ }
263
+ interface NativeRootHistoryOptions extends NativeHistoryOptions, NativeReadOptions {}
264
+ interface NativeWaitOptions extends NativeReadOptions {
265
+ readonly timeoutMs?: number;
266
+ readonly afterSeq?: number;
267
+ readonly maxMessages?: number;
268
+ }
269
+ interface NativeSessionEvent {
270
+ readonly type: string;
271
+ readonly seq: number;
272
+ readonly time: number;
273
+ readonly data: NativeJsonValue;
274
+ readonly ignorable?: true;
275
+ readonly surfaceOp?: 'append' | {
276
+ readonly op: 'replace';
277
+ readonly startSeq: number;
278
+ readonly endSeq: number;
279
+ };
280
+ readonly sourceEventSeqs?: readonly number[];
281
+ }
282
+ interface NativeLiveChunkEvent {
283
+ readonly type: 'assistant/live-chunk';
284
+ readonly seq: number;
285
+ readonly time: number;
286
+ readonly data: {
287
+ readonly attemptId: string;
288
+ readonly turn: number;
289
+ readonly step: number;
290
+ readonly chunk: NativeJsonValue;
291
+ };
292
+ }
293
+ type NativeSessionEventEntry = {
294
+ readonly type: 'event';
295
+ readonly event: NativeSessionEvent;
296
+ } | {
297
+ readonly type: 'transient';
298
+ readonly event: NativeLiveChunkEvent;
299
+ };
300
+ type NativeSessionChange = {
301
+ readonly kind: 'replace';
302
+ readonly entries: readonly NativeSessionEventEntry[];
303
+ } | {
304
+ readonly kind: 'prepend';
305
+ readonly entries: readonly NativeSessionEventEntry[];
306
+ } | {
307
+ readonly kind: 'append';
308
+ readonly entries: readonly NativeSessionEventEntry[];
309
+ } | {
310
+ readonly kind: 'settle-assistant';
311
+ readonly attemptId: string;
312
+ readonly entry?: NativeSessionEventEntry;
313
+ };
314
+ interface NativeHistoryPage {
315
+ readonly cursor: number;
316
+ readonly records: readonly NativeSessionEventEntry[];
317
+ readonly hasMore: boolean;
318
+ }
319
+ /** One passive Session header, read from its exact official follow opening. */
320
+ interface NativeSessionInfo {
321
+ readonly sessionId: string;
322
+ readonly createdAt: number;
323
+ readonly cwd?: string;
324
+ readonly parentSessionId?: string;
325
+ readonly isSeeded: boolean;
326
+ readonly origin?: 'subagent';
327
+ readonly delegationDepth?: number;
328
+ readonly agentPreset?: string;
329
+ }
330
+ /** One bounded official Session content-search result. */
331
+ interface NativeSessionSearchResult {
332
+ readonly items: readonly {
333
+ readonly sessionId: string;
334
+ readonly snippet: string;
335
+ }[];
336
+ readonly hasMore: boolean;
337
+ }
338
+ interface NativeSessionQueuedItem {
339
+ readonly id: string;
340
+ readonly placement: 'queued' | 'steering' | 'context';
341
+ readonly rpcId?: string;
342
+ readonly content: readonly NativeJsonValue[];
343
+ }
344
+ interface NativeSessionState {
345
+ readonly cursor: number;
346
+ readonly active: boolean;
347
+ readonly running: boolean;
348
+ readonly queue: readonly NativeSessionQueuedItem[] | null;
349
+ readonly pendingInput: readonly ('approval' | 'question' | 'other')[];
350
+ }
351
+ interface NativeSessionWaitResult {
352
+ readonly reason: 'idle' | 'input-required' | 'timeout';
353
+ readonly state: NativeSessionState;
354
+ readonly output: {
355
+ readonly records: readonly NativeSessionEventEntry[];
356
+ readonly truncated: boolean;
357
+ };
358
+ }
359
+ interface NativeSessionHistoryWindow {
360
+ readonly entries: readonly NativeSessionEventEntry[];
361
+ readonly hasMore: boolean;
362
+ readonly revision: number;
363
+ readonly change: NativeSessionChange;
364
+ }
365
+ interface NativeFileAttachmentRef {
366
+ readonly attachmentId: string;
367
+ readonly name: string;
368
+ readonly bytes: number;
369
+ }
370
+ interface NativeImageAttachmentRef {
371
+ readonly attachmentId: string;
372
+ readonly mediaType: 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif';
373
+ readonly bytes: number;
374
+ readonly width: number;
375
+ readonly height: number;
376
+ readonly name?: string;
377
+ readonly originalDimensions?: {
378
+ readonly width: number;
379
+ readonly height: number;
380
+ };
381
+ }
382
+ interface NativePendingSubmission {
383
+ readonly requestId: string;
384
+ readonly placement: 'transcript' | 'queued' | 'steering';
385
+ readonly time: number;
386
+ readonly text: string;
387
+ readonly attachments: readonly ({
388
+ readonly type: 'image';
389
+ readonly value: {
390
+ readonly previewUrl?: string;
391
+ readonly name?: string;
392
+ readonly width?: number;
393
+ readonly height?: number;
394
+ };
395
+ } | {
396
+ readonly type: 'file';
397
+ readonly value: NativeFileAttachmentRef;
398
+ })[];
399
+ }
400
+ interface NativePlanProjection {
401
+ readonly active: boolean;
402
+ readonly pending: boolean;
403
+ }
404
+ interface NativeTokenUsage {
405
+ readonly uncachedInputTokens: number;
406
+ readonly outputTokens: number;
407
+ readonly cacheReadTokens: number;
408
+ readonly cacheWriteTokens: number;
409
+ }
410
+ interface NativeContextPressure {
411
+ readonly pressureTokens?: number;
412
+ readonly projectedTokens?: number;
413
+ readonly contextWindow?: number;
414
+ }
415
+ interface NativeUserQuestionProjection {
416
+ readonly active: readonly {
417
+ readonly callId: string;
418
+ readonly questions: readonly NativeQuestionItem[];
419
+ readonly state: 'open' | 'continued';
420
+ }[];
421
+ readonly settled: readonly {
422
+ readonly callId: string;
423
+ readonly answers: readonly {
424
+ readonly id: string;
425
+ readonly selected: readonly string[];
426
+ readonly custom?: string;
427
+ }[];
428
+ }[];
429
+ }
430
+ interface NativeSessionSnapshot {
431
+ readonly sessionId: string;
432
+ readonly pendingSubmissions: readonly NativePendingSubmission[];
433
+ readonly running: boolean;
434
+ readonly subagent: {
435
+ readonly parentSessionId: string;
436
+ readonly childSessionId: string;
437
+ readonly mode: 'one-shot' | 'continuable' | 'unknown';
438
+ } | null;
439
+ readonly removed: boolean;
440
+ readonly openState: 'cold' | 'loading' | 'open' | 'error';
441
+ readonly openError: NativeFailure | null;
442
+ readonly hasMore: boolean;
443
+ readonly historyWasPartial: boolean;
444
+ readonly loadingOlder: boolean;
445
+ readonly historyLoadStatus: 'idle' | 'loading' | 'pendingConsumption' | 'error';
446
+ readonly promptError: {
447
+ readonly op: 'send' | 'stop';
448
+ readonly error: NativeFailure;
449
+ } | null;
450
+ readonly blank: boolean;
451
+ readonly lastAgentError: string | null;
452
+ readonly promptAttempted: boolean;
453
+ readonly awaitingFirstTurn: boolean;
454
+ readonly projections: {
455
+ readonly state: 'idle' | 'loading' | 'ready' | 'error' | 'migration-required';
456
+ readonly title?: string | null;
457
+ readonly plan?: NativePlanProjection;
458
+ readonly tokenUsage?: NativeTokenUsage;
459
+ readonly contextPressure?: NativeContextPressure;
460
+ readonly userQuestions?: NativeUserQuestionProjection;
461
+ readonly inbox?: {
462
+ readonly 'next-turn': readonly NativeJsonValue[];
463
+ readonly 'next-step': readonly NativeJsonValue[];
464
+ };
465
+ };
466
+ }
467
+ interface NativeSessionView {
468
+ readonly sessionId: string;
469
+ readonly snapshot: NativeSessionSnapshot;
470
+ readonly window: NativeSessionHistoryWindow;
471
+ readonly reconcileRequired: boolean;
472
+ }
473
+ type NativePromptPart = {
474
+ readonly type: 'text';
475
+ readonly text: string;
476
+ } | {
477
+ readonly type: 'image';
478
+ readonly mediaType: NativeImageAttachmentRef['mediaType'];
479
+ readonly bytes: Uint8Array;
480
+ readonly name?: string;
481
+ } | {
482
+ readonly type: 'file';
483
+ readonly name: string;
484
+ readonly bytes: Uint8Array;
485
+ };
486
+ interface NativePromptInput {
487
+ readonly content: readonly NativePromptPart[];
488
+ readonly mode?: 'queue' | 'steer';
489
+ readonly signal?: AbortSignal;
490
+ }
491
+ type NativeQueueAction = {
492
+ readonly kind: 'edit';
493
+ readonly content: readonly {
494
+ readonly type: 'text';
495
+ readonly text: string;
496
+ }[];
497
+ } | {
498
+ readonly kind: 'remove';
499
+ } | {
500
+ readonly kind: 'steer';
501
+ };
502
+ interface NativeModelSelection {
503
+ readonly provider: string;
504
+ readonly model: string;
505
+ readonly reasoningEffort?: string;
506
+ }
507
+ interface NativeModelSelectionProjection {
508
+ readonly lastUsed: NativeModelSelection | null;
509
+ readonly next: NativeModelSelection | null;
510
+ }
511
+ interface NativeModelCatalog {
512
+ readonly default: NativeModelSelection;
513
+ readonly routableProviders: readonly string[];
514
+ readonly groups: readonly {
515
+ readonly id: string;
516
+ readonly name: string;
517
+ readonly models: readonly {
518
+ readonly id: string;
519
+ readonly name: string;
520
+ readonly description?: string;
521
+ readonly reasoning?: {
522
+ readonly efforts: readonly {
523
+ readonly id: string;
524
+ readonly name: string;
525
+ readonly description?: string;
526
+ }[];
527
+ readonly defaultEffort?: string;
528
+ };
529
+ readonly badge?: {
530
+ readonly text: NativeLocalizedText;
531
+ readonly tone: 'neutral' | 'info' | 'success' | 'warning';
532
+ };
533
+ }[];
534
+ }[];
535
+ readonly failures: readonly {
536
+ readonly id: string;
537
+ readonly name: string;
538
+ readonly message: string;
539
+ }[];
540
+ }
541
+ interface NativePresetRoster {
542
+ readonly presets: readonly {
543
+ readonly id: string;
544
+ readonly isDefault?: boolean;
545
+ readonly name?: string;
546
+ readonly description?: string;
547
+ readonly broken?: string;
548
+ }[];
549
+ }
550
+ interface NativePermissionCatalog {
551
+ readonly options: readonly {
552
+ readonly value: string;
553
+ readonly name: string;
554
+ readonly description?: string;
555
+ }[];
556
+ readonly defaultOptions: readonly {
557
+ readonly value: string;
558
+ readonly name: string;
559
+ readonly description?: string;
560
+ }[];
561
+ readonly defaultPreset: string;
562
+ }
563
+ interface NativePermissionSelection {
564
+ readonly currentValue: string;
565
+ }
566
+ type NativePolicySide<T extends string> = {
567
+ readonly state: 'ready';
568
+ readonly effective: T;
569
+ readonly override?: T;
570
+ } | {
571
+ readonly state: 'unavailable';
572
+ readonly reason: 'service-not-installed';
573
+ };
574
+ type NativeSessionPolicyRead = {
575
+ readonly kind: 'ready';
576
+ readonly sessionId: string;
577
+ readonly approval: NativePolicySide<'ask' | 'never'>;
578
+ readonly sandbox: NativePolicySide<'read-only' | 'workspace-write' | 'danger-full-access'>;
579
+ };
580
+ interface NativeSessionConfiguration {
581
+ readonly modelSelection?: NativeModelSelectionProjection;
582
+ readonly currentModel?: NativeModelSelection;
583
+ readonly agentPreset?: string | null;
584
+ readonly title?: string | null;
585
+ readonly permissions?: NativePermissionSelection;
586
+ readonly plan?: NativePlanProjection;
587
+ }
588
+ interface NativeCommandDescriptor {
589
+ readonly definitionId?: string;
590
+ readonly name: string;
591
+ readonly description: string;
592
+ readonly input?: {
593
+ readonly hint: string;
594
+ readonly attachments?: boolean;
595
+ };
596
+ }
597
+ /** One official human-invocable skill in the current owned Session. */
598
+ interface NativeSkillDescriptor {
599
+ readonly name: string;
600
+ readonly description: string;
601
+ readonly whenToUse?: string;
602
+ readonly modelInvocable: boolean;
603
+ }
604
+ type NativeCommandResult = {
605
+ readonly kind: 'success';
606
+ readonly text?: string;
607
+ readonly sourceEventSeq?: number;
608
+ } | {
609
+ readonly kind: 'error';
610
+ readonly text: string;
611
+ };
612
+ interface NativeCommandExecution {
613
+ readonly commandId: string;
614
+ readonly result: NativeCommandResult;
615
+ }
616
+ interface NativeWorkspace {
617
+ readonly workspaceId: string;
618
+ readonly path: string;
619
+ readonly title: string;
620
+ }
621
+ interface NativeWorkspaceSummary extends NativeWorkspace {
622
+ readonly sessionIds: readonly string[];
623
+ }
624
+ interface NativeWorkspaceCreateResult {
625
+ readonly workspace: NativeWorkspace;
626
+ readonly created: boolean;
627
+ }
628
+ interface NativeFileReadInput {
629
+ readonly path: string;
630
+ readonly baseFile?: string;
631
+ readonly range?: {
632
+ readonly offset?: number;
633
+ readonly length?: number;
634
+ };
635
+ }
636
+ interface NativeFileBytes {
637
+ readonly absolutePath: string;
638
+ readonly version: string;
639
+ readonly bytes?: number;
640
+ readonly offset: number;
641
+ readonly data: Uint8Array;
642
+ readonly eof: boolean;
643
+ }
644
+ interface NativeStoredImage {
645
+ readonly attachment: NativeImageAttachmentRef;
646
+ readonly data: Uint8Array;
647
+ }
648
+ interface NativeJob {
649
+ readonly id: string;
650
+ readonly kind: string;
651
+ readonly label: string;
652
+ readonly status: 'running' | 'stopping' | 'completed' | 'killed' | 'failed';
653
+ readonly progress?: string;
654
+ readonly detail?: string;
655
+ readonly startedAt: number;
656
+ readonly finishedAt?: number;
657
+ }
658
+ type NativeSubagentEntry = {
659
+ readonly kind: 'child';
660
+ readonly id: string;
661
+ readonly label?: string;
662
+ readonly mode: 'one-shot' | 'continuable' | 'external';
663
+ readonly activity: 'running' | 'inactive';
664
+ readonly hasChildren: boolean;
665
+ readonly parentId: string;
666
+ readonly depth: number;
667
+ readonly path?: string;
668
+ } | {
669
+ readonly kind: 'diagnostic';
670
+ readonly id: string;
671
+ readonly reason: 'corrupt' | 'unsupported' | 'unavailable';
672
+ readonly parentId: string;
673
+ readonly depth: number;
674
+ };
675
+ interface NativeSubagentSnapshot {
676
+ readonly parentSessionId: string;
677
+ readonly parentAvailable: boolean;
678
+ readonly descendants: readonly NativeSubagentEntry[];
679
+ }
680
+ interface NativeSession {
681
+ snapshot(): NativeReadResult<NativeSessionSnapshot>;
682
+ history(options?: NativeHistoryOptions): Promise<NativeReadResult<NativeHistoryPage>>;
683
+ subscribe(listener: (result: NativeReadResult<NativeSessionView>) => void): () => void;
684
+ prompt(input: NativePromptInput): Promise<NativePromptResult>;
685
+ resolvePrompt(requestId: string, options?: NativePromptResolutionOptions): Promise<NativePromptResolutionResult>;
686
+ cancel(): Promise<NativeAdmissionResult<undefined>>;
687
+ updateQueue(itemId: string, action: NativeQueueAction): Promise<NativeAdmissionResult<undefined>>;
688
+ rename(title: string): Promise<NativeMutationResult<{
689
+ readonly title: string;
690
+ readonly seq: number;
691
+ }>>;
692
+ selectModel(input: Omit<NativeModelSelection, 'reasoningEffort'> & {
693
+ readonly reasoningEffort?: string;
694
+ }): Promise<NativeMutationResult<NativeModelSelection>>;
695
+ selectPreset(presetId: string): Promise<NativeMutationResult<string>>;
696
+ selectPermissionPreset(presetId: string): Promise<NativeConfigurationMutationResult<NativePermissionSelection>>;
697
+ selectPlanMode(active: boolean): Promise<NativeConfigurationMutationResult<NativePlanProjection>>;
698
+ commands(): Promise<NativeReadResult<readonly NativeCommandDescriptor[]>>;
699
+ skills(): Promise<NativeReadResult<readonly NativeSkillDescriptor[]>>;
700
+ command(line: string): Promise<NativeMutationResult<NativeCommandExecution | {
701
+ readonly matched: false;
702
+ }>>;
703
+ readFile(input: NativeFileReadInput): Promise<NativeReadResult<NativeFileBytes>>;
704
+ readAttachment(attachment: NativeImageAttachmentRef): Promise<NativeReadResult<NativeStoredImage>>;
705
+ observeJobs(listener: (result: NativeReadResult<readonly NativeJob[]>) => void): () => void;
706
+ observeSubagents(listener: (result: NativeReadResult<NativeSubagentSnapshot>) => void): () => void;
707
+ close(): Promise<void>;
708
+ }
709
+ interface NativeClient {
710
+ status(): NativeReadResult<NativeClientStatus>;
711
+ subscribeStatus(listener: (result: NativeReadResult<NativeClientStatus>) => void): () => void;
712
+ listSessions(options?: NativeReadOptions): Promise<NativeCancellableReadResult<readonly NativeSessionSummary[]>>;
713
+ searchSessions(query: string, options?: NativeReadOptions): Promise<NativeCancellableReadResult<NativeSessionSearchResult>>;
714
+ readSessionInfo(sessionId: string, options?: NativeReadOptions): Promise<NativeCancellableReadResult<NativeSessionInfo>>;
715
+ readSessionState(sessionId: string, options?: NativeReadOptions): Promise<NativeCancellableReadResult<NativeSessionState>>;
716
+ waitSession(sessionId: string, options?: NativeWaitOptions): Promise<NativeCancellableReadResult<NativeSessionWaitResult>>;
717
+ listWorkspaces(): Promise<NativeReadResult<readonly NativeWorkspaceSummary[]>>;
718
+ readSession(sessionId: string, options?: NativeRootHistoryOptions): Promise<NativeCancellableReadResult<NativeHistoryPage>>;
719
+ createWorkspace(path: string): Promise<NativeMutationResult<NativeWorkspaceCreateResult>>;
720
+ createSession(input?: {
721
+ readonly workspaceId?: string;
722
+ readonly sessionId?: string;
723
+ readonly agentPreset?: string;
724
+ }): Promise<NativeCreateResult>;
725
+ openSession(sessionId: string): Promise<NativeOpenResult>;
726
+ readConfiguration(sessionId: string, options?: NativeReadOptions): Promise<NativeCancellableReadResult<NativeSessionConfiguration>>;
727
+ readSessionPolicy(sessionId: string, options?: NativeReadOptions): Promise<NativeCancellableReadResult<NativeSessionPolicyRead>>;
728
+ modelCatalog(): Promise<NativeReadResult<NativeModelCatalog>>;
729
+ listPresets(): Promise<NativeReadResult<NativePresetRoster>>;
730
+ permissionCatalog(): Promise<NativeReadResult<NativePermissionCatalog>>;
731
+ close(): Promise<void>;
732
+ }
733
+ declare function attachNativeClient(options: NativeAttachOptions): Promise<NativeClient>;
734
+ //#endregion
735
+ export { NATIVE_CLIENT_API_VERSION, NativeAdmissionResult, NativeApprovalOutcome, NativeApprovalRequest, NativeAttachOptions, NativeCancellableReadResult, NativeClient, NativeClientStatus, NativeClosedFailure, NativeCommandDescriptor, NativeCommandExecution, NativeCommandResult, NativeConfigurationMutationFailure, NativeConfigurationMutationResult, NativeConfigurationUnknownFailure, NativeContextPressure, NativeCreateResult, NativeDarwinKernelIdentity, NativeFailure, NativeFileAttachmentRef, NativeFileBytes, NativeFileReadInput, NativeHistoryOptions, NativeHistoryPage, NativeHostIdentity, NativeHostKernelIdentity, NativeImageAttachmentRef, NativeJob, NativeJsonValue, NativeLiveChunkEvent, NativeLocalizedText, NativeModelCatalog, NativeModelSelection, NativeModelSelectionProjection, NativeMutationFailure, NativeMutationResult, NativeNotDispatchedFailure, NativeOpenResult, NativePendingSubmission, NativePermissionCatalog, NativePermissionSelection, NativePlanProjection, NativePolicySide, NativePresetRoster, NativePromptFailure, NativePromptInput, NativePromptPart, NativePromptResolution, NativePromptResolutionOptions, NativePromptResolutionResult, NativePromptResult, NativeQuestionAnswer, NativeQuestionIntent, NativeQuestionItem, NativeQuestionOption, NativeQuestionRequest, NativeQueueAction, NativeReadFailure, NativeReadOptions, NativeReadResult, NativeRejectedFailure, NativeRootHistoryOptions, NativeSession, NativeSessionChange, NativeSessionConfiguration, NativeSessionEvent, NativeSessionEventEntry, NativeSessionHistoryWindow, NativeSessionInfo, NativeSessionPolicyRead, NativeSessionQueuedItem, NativeSessionSearchResult, NativeSessionSnapshot, NativeSessionState, NativeSessionSummary, NativeSessionView, NativeSessionWaitResult, NativeSkillDescriptor, NativeStaleFailure, NativeStoredImage, NativeSubagentEntry, NativeSubagentSnapshot, NativeTokenUsage, NativeUnavailableFailure, NativeUnknownFailure, NativeUnknownRequestedFailure, NativeUnsupportedFailure, NativeUserQuestionProjection, NativeWaitOptions, NativeWorkspace, NativeWorkspaceCreateResult, NativeWorkspaceSummary, attachNativeClient };