@jmfederico/pi-web 1.202607.1 → 1.202607.3
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 +8 -8
- package/dist/cli.js +17 -5
- package/dist/cli.js.map +1 -1
- package/dist/client/assets/{CodeViewer-uASb28Y1.js → CodeViewer-CDVbMiN9.js} +1 -1
- package/dist/client/assets/{TerminalPanel-DfTmykFw.js → TerminalPanel-CTS1CgqF.js} +2 -2
- package/dist/client/assets/{UnifiedDiffViewer-laQN1x7P.js → UnifiedDiffViewer-Cqke12ZX.js} +1 -1
- package/dist/client/assets/index-LME0LfPb.js +4068 -0
- package/dist/client/index.html +1 -1
- package/dist/config.js +52 -0
- package/dist/config.js.map +1 -1
- package/dist/pi-web-plugins/info/infoInternals.js +208 -0
- package/dist/pi-web-plugins/info/pi-web-plugin.js +12 -15
- package/dist/pi-web-plugins/relays/markdownDocument.js +81 -0
- package/dist/pi-web-plugins/relays/package.json +9 -0
- package/dist/pi-web-plugins/relays/pi-web-plugin.js +44 -0
- package/dist/pi-web-plugins/relays/relayDiscovery.js +96 -0
- package/dist/pi-web-plugins/relays/relaysPanelElement.js +393 -0
- package/dist/pi-web-plugins/relays/vendor/README.md +24 -0
- package/dist/pi-web-plugins/relays/vendor/marked.esm.js +76 -0
- package/dist/plugin-api.d.ts +7 -1
- package/dist/server/configRoutes.js +11 -0
- package/dist/server/configRoutes.js.map +1 -1
- package/dist/server/diagnostics/nodePtyNativeModule.js +36 -0
- package/dist/server/diagnostics/nodePtyNativeModule.js.map +1 -0
- package/dist/server/git/gitService.js +176 -5
- package/dist/server/git/gitService.js.map +1 -1
- package/dist/server/piWebStatus.js +6 -3
- package/dist/server/piWebStatus.js.map +1 -1
- package/dist/server/realtime/sessionEventHub.js +4 -0
- package/dist/server/realtime/sessionEventHub.js.map +1 -1
- package/dist/server/sessiond/sessionServiceDependencies.js +32 -0
- package/dist/server/sessiond/sessionServiceDependencies.js.map +1 -0
- package/dist/server/sessiond.js +127 -79
- package/dist/server/sessiond.js.map +1 -1
- package/dist/server/sessions/askUserTool.js +105 -0
- package/dist/server/sessions/askUserTool.js.map +1 -0
- package/dist/server/sessions/authService.js +58 -7
- package/dist/server/sessions/authService.js.map +1 -1
- package/dist/server/sessions/extensionDialogWaiters.js +76 -0
- package/dist/server/sessions/extensionDialogWaiters.js.map +1 -0
- package/dist/server/sessions/globalProviderPolicy.js +167 -0
- package/dist/server/sessions/globalProviderPolicy.js.map +1 -0
- package/dist/server/sessions/modelCatalogRefresher.js +192 -0
- package/dist/server/sessions/modelCatalogRefresher.js.map +1 -0
- package/dist/server/sessions/parentSessionLocator.js +75 -0
- package/dist/server/sessions/parentSessionLocator.js.map +1 -0
- package/dist/server/sessions/pendingAskStore.js +278 -0
- package/dist/server/sessions/pendingAskStore.js.map +1 -0
- package/dist/server/sessions/pendingExtensionDialogStore.js +196 -0
- package/dist/server/sessions/pendingExtensionDialogStore.js.map +1 -0
- package/dist/server/sessions/piSessionService.js +1226 -130
- package/dist/server/sessions/piSessionService.js.map +1 -1
- package/dist/server/sessions/plainTextTheme.js +112 -0
- package/dist/server/sessions/plainTextTheme.js.map +1 -0
- package/dist/server/sessions/sessionCommandService.js +68 -9
- package/dist/server/sessions/sessionCommandService.js.map +1 -1
- package/dist/server/sessions/sessionFileHeader.js +45 -0
- package/dist/server/sessions/sessionFileHeader.js.map +1 -0
- package/dist/server/sessions/sessionNotificationStore.js +484 -0
- package/dist/server/sessions/sessionNotificationStore.js.map +1 -0
- package/dist/server/sessions/sessionRoutes.js +273 -1
- package/dist/server/sessions/sessionRoutes.js.map +1 -1
- package/dist/server/sessions/sessionTreeProjection.js +250 -0
- package/dist/server/sessions/sessionTreeProjection.js.map +1 -0
- package/dist/server/sessions/sessionUnreadStore.js +520 -0
- package/dist/server/sessions/sessionUnreadStore.js.map +1 -0
- package/dist/server/sessions/spawnSessionTool.js +2 -2
- package/dist/server/sessions/spawnSessionTool.js.map +1 -1
- package/dist/server/sessions/spawnSubsessionTool.js +10 -12
- package/dist/server/sessions/spawnSubsessionTool.js.map +1 -1
- package/dist/server/sessions/spawnTargetResolver.js +3 -16
- package/dist/server/sessions/spawnTargetResolver.js.map +1 -1
- package/dist/server/workspaces/gitWorktreeDiscovery.js +9 -0
- package/dist/server/workspaces/gitWorktreeDiscovery.js.map +1 -1
- package/dist/server/workspaces/projectWorkspaceCwds.js +22 -0
- package/dist/server/workspaces/projectWorkspaceCwds.js.map +1 -0
- package/dist/server/workspaces/workspaceService.js +15 -2
- package/dist/server/workspaces/workspaceService.js.map +1 -1
- package/dist/shared/activity.js +9 -1
- package/dist/shared/activity.js.map +1 -1
- package/dist/shared/apiTypes.d.ts +452 -2
- package/dist/shared/apiTypes.js +34 -0
- package/dist/shared/apiTypes.js.map +1 -1
- package/dist/shared/capabilities.js +9 -0
- package/dist/shared/capabilities.js.map +1 -1
- package/dist/shared/federatedRoutes.js +12 -0
- package/dist/shared/federatedRoutes.js.map +1 -1
- package/docs/config.md +84 -7
- package/docs/plugins.md +87 -17
- package/install.sh +1 -1
- package/package.json +9 -7
- package/dist/client/assets/index-Dhapi0oR.js +0 -3093
- package/dist/server/sessiond/sessionDaemonStartup.js +0 -49
- package/dist/server/sessiond/sessionDaemonStartup.js.map +0 -1
- package/dist/server/sessions/sessionArchiveMigration.js +0 -590
- package/dist/server/sessions/sessionArchiveMigration.js.map +0 -1
|
@@ -7,6 +7,9 @@ export declare const PI_WEB_CAPABILITIES: {
|
|
|
7
7
|
readonly sessionsReload: "sessions.reload";
|
|
8
8
|
readonly sessionsClearQueue: "sessions.clearQueue";
|
|
9
9
|
readonly sessionsPersistedState: "sessions.persistedState";
|
|
10
|
+
readonly sessionsNotifications: "sessions.notifications";
|
|
11
|
+
readonly sessionsUnread: "sessions.unread";
|
|
12
|
+
readonly sessionsAskUser: "sessions.askUser";
|
|
10
13
|
readonly promptAttachments: "prompt.attachments";
|
|
11
14
|
readonly workspaceFileSuggestions: "workspace.fileSuggestions";
|
|
12
15
|
readonly piPackagesManage: "piPackages.manage";
|
|
@@ -84,6 +87,18 @@ export interface PiWebConfigValues {
|
|
|
84
87
|
* while the capability stabilizes. Requires spawnSessions to be enabled.
|
|
85
88
|
*/
|
|
86
89
|
subsessions?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* When true, LLMs can post a question set to the browser via the ask_user
|
|
92
|
+
* tool. On by default; set to `false` to remove the tool from the runtime.
|
|
93
|
+
*/
|
|
94
|
+
askUser?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* How long an extension dialog may wait for an answer before the daemon
|
|
97
|
+
* auto-cancels it, in milliseconds. Applies only when the extension set no
|
|
98
|
+
* `timeout` of its own (the sooner of the two wins); `0` waits forever.
|
|
99
|
+
* Tuning knob only — extension dialogs are always enabled.
|
|
100
|
+
*/
|
|
101
|
+
extensionDialogsTimeoutMs?: number;
|
|
87
102
|
/** Desired Pi-compatible agent profile and companion CLI (Pi by default). */
|
|
88
103
|
agent?: PiWebAgentConfig;
|
|
89
104
|
}
|
|
@@ -135,6 +150,7 @@ export interface PiWebConfigEnvOverrides {
|
|
|
135
150
|
allowedHosts: boolean;
|
|
136
151
|
spawnSessions: boolean;
|
|
137
152
|
subsessions: boolean;
|
|
153
|
+
askUser: boolean;
|
|
138
154
|
agentCommand: boolean;
|
|
139
155
|
agentDir: boolean;
|
|
140
156
|
/** The configured directory environment source, even when Pi compatibility is inactive for the desired command. */
|
|
@@ -173,6 +189,116 @@ export interface SessionRef {
|
|
|
173
189
|
id: string;
|
|
174
190
|
cwd: string;
|
|
175
191
|
}
|
|
192
|
+
export declare const SESSION_UNREAD_LIMIT = 1000;
|
|
193
|
+
export declare const SESSION_UNREAD_SESSION_ID_MAX_LENGTH = 512;
|
|
194
|
+
export declare const SESSION_UNREAD_CWD_MAX_LENGTH: number;
|
|
195
|
+
export declare const SESSION_UNREAD_CATALOG_ID_MAX_LENGTH = 512;
|
|
196
|
+
export declare const SESSION_UNREAD_COMPLETED_AT_MAX_LENGTH = 64;
|
|
197
|
+
export interface SessionUnreadSummary {
|
|
198
|
+
sessionId: string;
|
|
199
|
+
cwd: string;
|
|
200
|
+
/** Monotonic within a catalog and never greater than its containing revision. */
|
|
201
|
+
completionOrder: number;
|
|
202
|
+
completedAt: string;
|
|
203
|
+
}
|
|
204
|
+
export interface SessionUnreadCatalogSnapshot {
|
|
205
|
+
/** Stable for one persisted catalog epoch; changes when unread state is reset. */
|
|
206
|
+
catalogId: string;
|
|
207
|
+
/** Monotonic catalog mutation revision; at least every contained completion order. */
|
|
208
|
+
catalogRevision: number;
|
|
209
|
+
/** Bounded by `SESSION_UNREAD_LIMIT` and ordered newest completion first. */
|
|
210
|
+
sessions: SessionUnreadSummary[];
|
|
211
|
+
}
|
|
212
|
+
export interface SessionUnreadAcknowledgeRequest {
|
|
213
|
+
cwd: string;
|
|
214
|
+
/** The catalog epoch in which `throughCompletionOrder` was observed. */
|
|
215
|
+
catalogId: string;
|
|
216
|
+
throughCompletionOrder: number;
|
|
217
|
+
}
|
|
218
|
+
/** Authoritative delta for one session in the daemon-owned unread catalog. */
|
|
219
|
+
export interface SessionUnreadEvent {
|
|
220
|
+
type: "sessions.unread";
|
|
221
|
+
catalogId: string;
|
|
222
|
+
/** At least `unread.completionOrder` when carrying an unread summary. */
|
|
223
|
+
catalogRevision: number;
|
|
224
|
+
sessionId: string;
|
|
225
|
+
cwd: string;
|
|
226
|
+
unread: SessionUnreadSummary | null;
|
|
227
|
+
}
|
|
228
|
+
export declare const SESSION_NOTIFICATION_LIMIT = 100;
|
|
229
|
+
export declare const SESSION_NOTIFICATION_MESSAGE_BYTES: number;
|
|
230
|
+
export type SessionNotificationSeverity = "info" | "warning" | "error";
|
|
231
|
+
export interface SessionNotification {
|
|
232
|
+
id: string;
|
|
233
|
+
message: string;
|
|
234
|
+
truncated: boolean;
|
|
235
|
+
severity: SessionNotificationSeverity;
|
|
236
|
+
receivedAt: string;
|
|
237
|
+
order: number;
|
|
238
|
+
}
|
|
239
|
+
export interface SessionNotificationSummary {
|
|
240
|
+
sessionId: string;
|
|
241
|
+
cwd: string;
|
|
242
|
+
inboxRevision: number;
|
|
243
|
+
retainedCount: number;
|
|
244
|
+
discardedCount: number;
|
|
245
|
+
highestSeverity?: SessionNotificationSeverity;
|
|
246
|
+
}
|
|
247
|
+
export interface SessionNotificationDismissThrough {
|
|
248
|
+
order: number;
|
|
249
|
+
overflowWatermark: number;
|
|
250
|
+
}
|
|
251
|
+
export interface SessionNotificationInboxSnapshot {
|
|
252
|
+
daemonInstanceId: string;
|
|
253
|
+
catalogRevision: number;
|
|
254
|
+
summary: SessionNotificationSummary;
|
|
255
|
+
notifications: SessionNotification[];
|
|
256
|
+
dismissThrough: SessionNotificationDismissThrough;
|
|
257
|
+
}
|
|
258
|
+
export interface SessionNotificationCatalogSnapshot {
|
|
259
|
+
daemonInstanceId: string;
|
|
260
|
+
catalogRevision: number;
|
|
261
|
+
sessions: SessionNotificationSummary[];
|
|
262
|
+
}
|
|
263
|
+
export interface SessionNotificationDismissRequest {
|
|
264
|
+
cwd: string;
|
|
265
|
+
daemonInstanceId: string;
|
|
266
|
+
notificationId: string;
|
|
267
|
+
}
|
|
268
|
+
export interface SessionNotificationDismissAllRequest {
|
|
269
|
+
cwd: string;
|
|
270
|
+
daemonInstanceId: string;
|
|
271
|
+
throughOrder: number;
|
|
272
|
+
throughOverflowWatermark: number;
|
|
273
|
+
}
|
|
274
|
+
export type SessionNotificationClearReason = "runtime-close" | "archive" | "delete" | "restore" | "archive-reconcile" | "replacement" | "initialization-failed" | "service-dispose";
|
|
275
|
+
export type SessionNotificationInboxDelta = {
|
|
276
|
+
kind: "added";
|
|
277
|
+
notification: SessionNotification;
|
|
278
|
+
evictedNotificationId?: string;
|
|
279
|
+
} | {
|
|
280
|
+
kind: "dismissed";
|
|
281
|
+
notificationIds: string[];
|
|
282
|
+
} | {
|
|
283
|
+
kind: "cleared";
|
|
284
|
+
reason: SessionNotificationClearReason;
|
|
285
|
+
} | {
|
|
286
|
+
kind: "resync";
|
|
287
|
+
};
|
|
288
|
+
export interface SessionNotificationInboxEvent {
|
|
289
|
+
type: "notifications.inbox";
|
|
290
|
+
daemonInstanceId: string;
|
|
291
|
+
catalogRevision: number;
|
|
292
|
+
summary: SessionNotificationSummary;
|
|
293
|
+
dismissThrough: SessionNotificationDismissThrough;
|
|
294
|
+
delta: SessionNotificationInboxDelta;
|
|
295
|
+
}
|
|
296
|
+
export interface SessionNotificationSummaryEvent {
|
|
297
|
+
type: "notifications.summary";
|
|
298
|
+
daemonInstanceId: string;
|
|
299
|
+
catalogRevision: number;
|
|
300
|
+
summary: SessionNotificationSummary;
|
|
301
|
+
}
|
|
176
302
|
export interface SessionInfo extends SessionRef {
|
|
177
303
|
path: string;
|
|
178
304
|
/** True when the server has verified a backing session file exists; false when known transient. */
|
|
@@ -183,6 +309,21 @@ export interface SessionInfo extends SessionRef {
|
|
|
183
309
|
messageCount: number;
|
|
184
310
|
firstMessage: string;
|
|
185
311
|
parentSessionPath?: string;
|
|
312
|
+
/**
|
|
313
|
+
* Working directory of the parent session, read from the parent session file
|
|
314
|
+
* header. Only populated when the parent is outside this listing's cwd, so a
|
|
315
|
+
* child whose parent lives in another worktree can point at it instead of
|
|
316
|
+
* only reporting that the parent is unavailable here.
|
|
317
|
+
*/
|
|
318
|
+
parentSessionCwd?: string;
|
|
319
|
+
/** Session id of an out-of-cwd parent, so the browser can select it after switching workspace. */
|
|
320
|
+
parentSessionId?: string;
|
|
321
|
+
/**
|
|
322
|
+
* Number of sessions in other workspaces of the same project that record this
|
|
323
|
+
* session as their parent. Only set when non-zero, so a parent can show that
|
|
324
|
+
* it has children which are not nested beneath it in this workspace.
|
|
325
|
+
*/
|
|
326
|
+
childSessionsElsewhere?: number;
|
|
186
327
|
archived?: boolean;
|
|
187
328
|
archivedAt?: string;
|
|
188
329
|
}
|
|
@@ -253,11 +394,249 @@ export interface SessionActivity {
|
|
|
253
394
|
label: string;
|
|
254
395
|
detail?: string;
|
|
255
396
|
at: string;
|
|
397
|
+
/**
|
|
398
|
+
* Set only on the startup window's own reports. A startup phase is genuinely
|
|
399
|
+
* in progress, so it is published as `active` and rendered like any other
|
|
400
|
+
* activity, but *starting* a session is not *working* in it: there is nothing
|
|
401
|
+
* to stop, nothing that blocks reloading from disk, and no workspace-level
|
|
402
|
+
* work to report. `isSessionActive()` reads this to keep the two apart.
|
|
403
|
+
*/
|
|
404
|
+
startup?: boolean;
|
|
256
405
|
}
|
|
257
406
|
export interface QueuedSessionMessage {
|
|
258
407
|
kind: "steer" | "followUp";
|
|
259
408
|
text: string;
|
|
260
409
|
}
|
|
410
|
+
/**
|
|
411
|
+
* `customType` of the follow-up custom message that carries a closed ask back to
|
|
412
|
+
* the model and into the transcript. Its `details` are an {@link AskUserOutcome}.
|
|
413
|
+
*/
|
|
414
|
+
export declare const ASK_USER_ANSWERS_CUSTOM_TYPE = "pi-web.ask.answers";
|
|
415
|
+
/** Largest question set one `ask_user` call may post. */
|
|
416
|
+
export declare const ASK_USER_QUESTION_LIMIT = 20;
|
|
417
|
+
/** Largest option list one question may offer. */
|
|
418
|
+
export declare const ASK_USER_OPTION_LIMIT = 12;
|
|
419
|
+
/** Length bound for ids: the ask id, question ids, and option values. */
|
|
420
|
+
export declare const ASK_USER_ID_MAX_LENGTH = 128;
|
|
421
|
+
/** Length bound for model-authored prose: questions, details, and option labels. */
|
|
422
|
+
export declare const ASK_USER_TEXT_MAX_LENGTH = 1000;
|
|
423
|
+
/** Length bound for the free text a user types as a custom answer. */
|
|
424
|
+
export declare const ASK_USER_OTHER_TEXT_MAX_LENGTH = 4000;
|
|
425
|
+
/** One selectable option of an {@link AskUserQuestion}. */
|
|
426
|
+
export interface AskUserQuestionOption {
|
|
427
|
+
/** Stable machine value reported back to the model. */
|
|
428
|
+
value: string;
|
|
429
|
+
/** Short human label rendered in the browser. */
|
|
430
|
+
label: string;
|
|
431
|
+
/** Optional clarifying line rendered under the label. */
|
|
432
|
+
detail?: string;
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* One question of an `ask_user` set. Questions are never required: the user may
|
|
436
|
+
* submit while leaving any of them untouched, and unanswered questions are
|
|
437
|
+
* reported to the model as such.
|
|
438
|
+
*/
|
|
439
|
+
export interface AskUserQuestion {
|
|
440
|
+
/** Unique within the ask; used as the answer key. */
|
|
441
|
+
id: string;
|
|
442
|
+
/** The question itself, as one plain-text line. */
|
|
443
|
+
question: string;
|
|
444
|
+
/** Optional supporting context rendered under the question. */
|
|
445
|
+
detail?: string;
|
|
446
|
+
/** Offered options; may be empty when only free text makes sense. */
|
|
447
|
+
options: AskUserQuestionOption[];
|
|
448
|
+
/**
|
|
449
|
+
* Compatibility marker for older clients. Canonical questions set this to
|
|
450
|
+
* true because every question offers a custom free-text answer.
|
|
451
|
+
*/
|
|
452
|
+
allowOther?: boolean;
|
|
453
|
+
/** When true, several options may be selected at once. */
|
|
454
|
+
multiple?: boolean;
|
|
455
|
+
}
|
|
456
|
+
/**
|
|
457
|
+
* The open, unanswered question set of a session. Daemon-owned and reported in
|
|
458
|
+
* {@link SessionStatus}, so a reconnecting or reloading browser rehydrates it
|
|
459
|
+
* without depending on having seen the `ask.opened` event.
|
|
460
|
+
*/
|
|
461
|
+
export interface PendingAskUser {
|
|
462
|
+
askId: string;
|
|
463
|
+
askedAt: string;
|
|
464
|
+
questions: AskUserQuestion[];
|
|
465
|
+
}
|
|
466
|
+
/** Why an ask stopped being the session's open ask. */
|
|
467
|
+
export type AskUserCloseReason = "submitted" | "superseded" | "cancelled";
|
|
468
|
+
/**
|
|
469
|
+
* What the user replied to one question. Absent from a submission means the
|
|
470
|
+
* question was left untouched; an empty `values` with no `otherText` means the
|
|
471
|
+
* same thing.
|
|
472
|
+
*/
|
|
473
|
+
export interface AskUserAnswer {
|
|
474
|
+
/** Matches an {@link AskUserQuestion.id} of the open ask. */
|
|
475
|
+
id: string;
|
|
476
|
+
/** Selected {@link AskUserQuestionOption.value} entries; several only when the question allows it. */
|
|
477
|
+
values: string[];
|
|
478
|
+
/** Free text typed as the question's custom answer. */
|
|
479
|
+
otherText?: string;
|
|
480
|
+
}
|
|
481
|
+
/** One submit of the open ask: answers for some or all of its questions. */
|
|
482
|
+
export interface AskUserSubmission {
|
|
483
|
+
answers: AskUserAnswer[];
|
|
484
|
+
}
|
|
485
|
+
/**
|
|
486
|
+
* One question of a closed ask paired with what came back for it. Carries the
|
|
487
|
+
* question itself so the record renders without the original ask still existing.
|
|
488
|
+
*/
|
|
489
|
+
export interface AskUserQuestionRecord {
|
|
490
|
+
question: AskUserQuestion;
|
|
491
|
+
/** True when at least one option was selected or custom text was given. */
|
|
492
|
+
answered: boolean;
|
|
493
|
+
values: string[];
|
|
494
|
+
otherText?: string;
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
* The complete result of an ask, computed when it closes. Shared by the
|
|
498
|
+
* model-facing follow-up message and the browser's read-only record, so both
|
|
499
|
+
* report the same answered and unanswered questions.
|
|
500
|
+
*/
|
|
501
|
+
export interface AskUserOutcome {
|
|
502
|
+
askId: string;
|
|
503
|
+
reason: AskUserCloseReason;
|
|
504
|
+
askedAt: string;
|
|
505
|
+
closedAt: string;
|
|
506
|
+
questions: AskUserQuestionRecord[];
|
|
507
|
+
answeredCount: number;
|
|
508
|
+
/** Ids of the questions left unanswered, in the order they were asked. */
|
|
509
|
+
unansweredIds: string[];
|
|
510
|
+
/** One line, for example `Answered 3 of 5; unanswered: q2, q5`. */
|
|
511
|
+
summary: string;
|
|
512
|
+
}
|
|
513
|
+
/**
|
|
514
|
+
* Result of the browser closing an ask by submitting or cancelling it.
|
|
515
|
+
*
|
|
516
|
+
* `"stale"` is an ordinary race rather than an error: the named ask was already
|
|
517
|
+
* submitted, superseded by a newer one, or gone with its session runtime. The
|
|
518
|
+
* browser drops its card and trusts `sessionStatus`, which is returned in both
|
|
519
|
+
* cases so closing an ask needs no follow-up status request.
|
|
520
|
+
*/
|
|
521
|
+
export interface AskUserCloseResponse {
|
|
522
|
+
result: "closed" | "stale";
|
|
523
|
+
/** Present only when this call is the one that closed the ask. */
|
|
524
|
+
outcome?: AskUserOutcome;
|
|
525
|
+
sessionStatus: SessionStatus;
|
|
526
|
+
}
|
|
527
|
+
/** Length bound for extension-dialog ids. */
|
|
528
|
+
export declare const EXTENSION_DIALOG_ID_MAX_LENGTH = 128;
|
|
529
|
+
/** Length bound for extension-authored dialog prose: titles, messages, options, placeholders. */
|
|
530
|
+
export declare const EXTENSION_DIALOG_TEXT_MAX_LENGTH = 1000;
|
|
531
|
+
/** Largest option list one `select` dialog may offer. */
|
|
532
|
+
export declare const EXTENSION_DIALOG_OPTION_LIMIT = 24;
|
|
533
|
+
/** Length bound for the text a user types into an `input` dialog. */
|
|
534
|
+
export declare const EXTENSION_DIALOG_INPUT_MAX_LENGTH = 4000;
|
|
535
|
+
/** Which extension UI dialog primitive a pending dialog belongs to. */
|
|
536
|
+
export type ExtensionDialogKind = "confirm" | "select" | "input";
|
|
537
|
+
/**
|
|
538
|
+
* The value a user gave in an extension dialog: a boolean for `confirm`, the
|
|
539
|
+
* chosen option for `select`, the typed text for `input`. Absent when the
|
|
540
|
+
* dialog closed without an answer.
|
|
541
|
+
*/
|
|
542
|
+
export type ExtensionDialogAnswer = boolean | string;
|
|
543
|
+
/**
|
|
544
|
+
* Why a dialog stopped being open. `"answered"` carries an
|
|
545
|
+
* {@link ExtensionDialogAnswer}; every other reason is a close without one.
|
|
546
|
+
*/
|
|
547
|
+
export type ExtensionDialogCloseReason = "answered" | "cancelled" | "timeout" | "aborted" | "session-ended";
|
|
548
|
+
/**
|
|
549
|
+
* One open extension dialog of a session, opened by `ctx.ui.confirm()`,
|
|
550
|
+
* `ctx.ui.select()`, or `ctx.ui.input()`. Daemon-owned and reported in
|
|
551
|
+
* {@link SessionStatus.pendingDialogs}, so a reconnecting or reloading browser
|
|
552
|
+
* rehydrates it without depending on having seen the `dialog.opened` event.
|
|
553
|
+
*
|
|
554
|
+
* Unlike asks, several dialogs may be open per session at once: each dialog is
|
|
555
|
+
* an independent blocking wait inside extension code, so opening never
|
|
556
|
+
* supersedes an existing one.
|
|
557
|
+
*/
|
|
558
|
+
export interface PendingExtensionDialog {
|
|
559
|
+
dialogId: string;
|
|
560
|
+
kind: ExtensionDialogKind;
|
|
561
|
+
title: string;
|
|
562
|
+
/** Supporting line of a `confirm` dialog. */
|
|
563
|
+
message?: string;
|
|
564
|
+
/** Offered choices of a `select` dialog. */
|
|
565
|
+
options?: string[];
|
|
566
|
+
/** Placeholder text of an `input` dialog. */
|
|
567
|
+
placeholder?: string;
|
|
568
|
+
askedAt: string;
|
|
569
|
+
/**
|
|
570
|
+
* When the dialog auto-cancels, as ISO: the sooner of the extension's own
|
|
571
|
+
* `timeout` and the daemon's `extensionDialogsTimeoutMs` default. Absent
|
|
572
|
+
* when the dialog waits forever.
|
|
573
|
+
*/
|
|
574
|
+
timeoutAt?: string;
|
|
575
|
+
/** Opened while a run was in flight, so `agent_end` settles it as `"aborted"`. */
|
|
576
|
+
runScoped: boolean;
|
|
577
|
+
}
|
|
578
|
+
/**
|
|
579
|
+
* The complete result of a closed extension dialog. Unlike an ask outcome it
|
|
580
|
+
* stays small — the dialog itself is not embedded, because a settled card is a
|
|
581
|
+
* browser-local record that stays until the user dismisses it; reloads
|
|
582
|
+
* rehydrate open dialogs from {@link SessionStatus.pendingDialogs} alone.
|
|
583
|
+
*/
|
|
584
|
+
export interface ExtensionDialogOutcome {
|
|
585
|
+
dialogId: string;
|
|
586
|
+
reason: ExtensionDialogCloseReason;
|
|
587
|
+
/** Present only when `reason` is `"answered"`. */
|
|
588
|
+
answer?: ExtensionDialogAnswer;
|
|
589
|
+
askedAt: string;
|
|
590
|
+
closedAt: string;
|
|
591
|
+
}
|
|
592
|
+
/**
|
|
593
|
+
* Browser request to answer an open extension dialog with the user's value.
|
|
594
|
+
* `cwd` rides along as the standard session-lookup field, as on every other
|
|
595
|
+
* session route; whether the value fits the dialog's kind is the store's call,
|
|
596
|
+
* so an ill-fitting answer is a 400 that leaves the dialog open.
|
|
597
|
+
*/
|
|
598
|
+
export interface ExtensionDialogAnswerRequest {
|
|
599
|
+
cwd?: string;
|
|
600
|
+
dialogId: string;
|
|
601
|
+
value: ExtensionDialogAnswer;
|
|
602
|
+
}
|
|
603
|
+
/** Browser request to dismiss an open extension dialog without an answer. */
|
|
604
|
+
export interface ExtensionDialogCancelRequest {
|
|
605
|
+
cwd?: string;
|
|
606
|
+
dialogId: string;
|
|
607
|
+
}
|
|
608
|
+
/**
|
|
609
|
+
* Result of the browser answering or cancelling an extension dialog. Mirrors
|
|
610
|
+
* {@link AskUserCloseResponse}: `"stale"` is an ordinary lost race — another
|
|
611
|
+
* browser, a timeout, or a teardown closed the dialog first — not an error.
|
|
612
|
+
* The browser drops its card and trusts `sessionStatus`, which is returned in
|
|
613
|
+
* both cases so closing a dialog needs no follow-up status request.
|
|
614
|
+
*/
|
|
615
|
+
export interface ExtensionDialogCloseResponse {
|
|
616
|
+
result: "closed" | "stale";
|
|
617
|
+
/** Present only when this call is the one that closed the dialog. */
|
|
618
|
+
outcome?: ExtensionDialogOutcome;
|
|
619
|
+
sessionStatus: SessionStatus;
|
|
620
|
+
}
|
|
621
|
+
/**
|
|
622
|
+
* Progress of the session startup window, where the daemon is still
|
|
623
|
+
* constructing the agent session and no `PiAgentSession` exists yet, so
|
|
624
|
+
* `activity.update` cannot be published for it.
|
|
625
|
+
*
|
|
626
|
+
* `startupToken` is the opaque label a create request supplied, echoed back so a
|
|
627
|
+
* browser row still waiting for a session id recognises its own construction.
|
|
628
|
+
* The daemon never interprets it and it never becomes the session id:
|
|
629
|
+
* `activity.sessionId` always carries the real id, which is how an *open* of a
|
|
630
|
+
* session the browser already knows is routed instead.
|
|
631
|
+
*
|
|
632
|
+
* `activity.phase === "idle"` means the startup window ended with nothing left
|
|
633
|
+
* to report, so a browser that substituted its own text should restore it.
|
|
634
|
+
*/
|
|
635
|
+
export interface SessionStartupProgressEvent {
|
|
636
|
+
type: "session.startup";
|
|
637
|
+
startupToken?: string;
|
|
638
|
+
activity: SessionActivity;
|
|
639
|
+
}
|
|
261
640
|
/**
|
|
262
641
|
* A pi-native image attachment carried with a prompt. The wire format mirrors
|
|
263
642
|
* pi's own `ImageContent` shape (`{ type: "image", data, mimeType }`) so these
|
|
@@ -422,6 +801,17 @@ export interface SessionStatus {
|
|
|
422
801
|
* there are none. See {@link SessionWarning}.
|
|
423
802
|
*/
|
|
424
803
|
warnings?: SessionWarning[];
|
|
804
|
+
/**
|
|
805
|
+
* The session's open `ask_user` question set, when one is waiting for the
|
|
806
|
+
* user. Daemon-owned, so it survives browser reload and web/API restarts.
|
|
807
|
+
*/
|
|
808
|
+
pendingAsk?: PendingAskUser;
|
|
809
|
+
/**
|
|
810
|
+
* The session's open extension dialogs, oldest first, when any are waiting
|
|
811
|
+
* for the user. Daemon-owned, so they survive browser reload and web/API
|
|
812
|
+
* restarts. Several may be open at once; the UI presents them as a queue.
|
|
813
|
+
*/
|
|
814
|
+
pendingDialogs?: PendingExtensionDialog[];
|
|
425
815
|
}
|
|
426
816
|
export interface WorkspaceActivity {
|
|
427
817
|
cwd: string;
|
|
@@ -498,6 +888,8 @@ export interface GitStatusFile {
|
|
|
498
888
|
oldPath?: string;
|
|
499
889
|
index: GitFileState;
|
|
500
890
|
workingTree: GitFileState;
|
|
891
|
+
submoduleFromCommit?: string;
|
|
892
|
+
submoduleToCommit?: string;
|
|
501
893
|
}
|
|
502
894
|
export interface GitStatusResponse {
|
|
503
895
|
isGitRepo: boolean;
|
|
@@ -507,6 +899,7 @@ export interface GitStatusResponse {
|
|
|
507
899
|
ahead?: number;
|
|
508
900
|
behind?: number;
|
|
509
901
|
files: GitStatusFile[];
|
|
902
|
+
submodules: string[];
|
|
510
903
|
}
|
|
511
904
|
export interface GitDiffResponse {
|
|
512
905
|
path?: string;
|
|
@@ -661,6 +1054,44 @@ export interface CommandOption {
|
|
|
661
1054
|
label: string;
|
|
662
1055
|
description?: string;
|
|
663
1056
|
}
|
|
1057
|
+
export type SessionTreeNodeKind = "user" | "assistant" | "tool-result" | "bash" | "custom-message" | "compaction" | "branch-summary" | "model-change" | "thinking-level-change" | "session-info" | "label" | "custom" | "other";
|
|
1058
|
+
export interface SessionTreeNode {
|
|
1059
|
+
id: string;
|
|
1060
|
+
parentId: string | null;
|
|
1061
|
+
kind: SessionTreeNodeKind;
|
|
1062
|
+
summary: string;
|
|
1063
|
+
timestamp?: string;
|
|
1064
|
+
label?: string;
|
|
1065
|
+
}
|
|
1066
|
+
export interface SessionTreeSnapshot {
|
|
1067
|
+
/** Pre-order, parent-linked projection of all retained roots and descendants. */
|
|
1068
|
+
nodes: SessionTreeNode[];
|
|
1069
|
+
activeLeafId: string | null;
|
|
1070
|
+
/** Root-to-leaf IDs for explicit, non-color-only active-path rendering. */
|
|
1071
|
+
activePathIds: string[];
|
|
1072
|
+
}
|
|
1073
|
+
export declare const SESSION_TREE_CUSTOM_INSTRUCTIONS_MAX_LENGTH = 10000;
|
|
1074
|
+
export type SessionTreeSummaryChoice = {
|
|
1075
|
+
mode: "none";
|
|
1076
|
+
} | {
|
|
1077
|
+
mode: "default";
|
|
1078
|
+
} | {
|
|
1079
|
+
mode: "custom";
|
|
1080
|
+
instructions: string;
|
|
1081
|
+
};
|
|
1082
|
+
export interface SessionTreeNavigateRequest {
|
|
1083
|
+
targetId: string;
|
|
1084
|
+
/** Leaf shown when the navigator opened; null is valid for an empty/root position. */
|
|
1085
|
+
expectedLeafId: string | null;
|
|
1086
|
+
summary: SessionTreeSummaryChoice;
|
|
1087
|
+
}
|
|
1088
|
+
export type SessionTreeNavigateResult = {
|
|
1089
|
+
cancelled: false;
|
|
1090
|
+
editorText?: string;
|
|
1091
|
+
} | {
|
|
1092
|
+
cancelled: true;
|
|
1093
|
+
aborted?: boolean;
|
|
1094
|
+
};
|
|
664
1095
|
export interface MessagePage {
|
|
665
1096
|
messages: unknown[];
|
|
666
1097
|
start: number;
|
|
@@ -689,6 +1120,9 @@ export type CommandResult = {
|
|
|
689
1120
|
requestId: string;
|
|
690
1121
|
title: string;
|
|
691
1122
|
options: CommandOption[];
|
|
1123
|
+
} | {
|
|
1124
|
+
type: "tree";
|
|
1125
|
+
tree: SessionTreeSnapshot;
|
|
692
1126
|
} | {
|
|
693
1127
|
type: "unsupported";
|
|
694
1128
|
message: string;
|
|
@@ -764,9 +1198,25 @@ type SessionUiEventBody = {
|
|
|
764
1198
|
type: "command.output";
|
|
765
1199
|
level: "info" | "success" | "error";
|
|
766
1200
|
message: string;
|
|
767
|
-
|
|
1201
|
+
notificationId?: string;
|
|
1202
|
+
} | SessionNotificationInboxEvent | {
|
|
768
1203
|
type: "session.error";
|
|
769
1204
|
message: string;
|
|
1205
|
+
} | {
|
|
1206
|
+
type: "ask.opened";
|
|
1207
|
+
ask: PendingAskUser;
|
|
1208
|
+
} | {
|
|
1209
|
+
type: "ask.closed";
|
|
1210
|
+
askId: string;
|
|
1211
|
+
reason: AskUserCloseReason;
|
|
1212
|
+
} | {
|
|
1213
|
+
type: "dialog.opened";
|
|
1214
|
+
dialog: PendingExtensionDialog;
|
|
1215
|
+
} | {
|
|
1216
|
+
type: "dialog.closed";
|
|
1217
|
+
dialogId: string;
|
|
1218
|
+
reason: ExtensionDialogCloseReason;
|
|
1219
|
+
answer?: ExtensionDialogAnswer;
|
|
770
1220
|
} | {
|
|
771
1221
|
type: "session.name";
|
|
772
1222
|
sessionId: string;
|
|
@@ -780,5 +1230,5 @@ type SessionUiEventBody = {
|
|
|
780
1230
|
};
|
|
781
1231
|
export type GlobalSessionEvent = Extract<SessionUiEventBody, {
|
|
782
1232
|
type: "status.update" | "activity.update" | "session.name" | "session.created";
|
|
783
|
-
}
|
|
1233
|
+
}> | SessionNotificationSummaryEvent | SessionUnreadEvent | SessionStartupProgressEvent;
|
|
784
1234
|
export type RealtimeEvent = GlobalSessionEvent | TerminalUiEvent | WorkspaceActivityUiEvent;
|
package/dist/shared/apiTypes.js
CHANGED
|
@@ -5,10 +5,44 @@ export const PI_WEB_CAPABILITIES = {
|
|
|
5
5
|
sessionsReload: "sessions.reload",
|
|
6
6
|
sessionsClearQueue: "sessions.clearQueue",
|
|
7
7
|
sessionsPersistedState: "sessions.persistedState",
|
|
8
|
+
sessionsNotifications: "sessions.notifications",
|
|
9
|
+
sessionsUnread: "sessions.unread",
|
|
10
|
+
sessionsAskUser: "sessions.askUser",
|
|
8
11
|
promptAttachments: "prompt.attachments",
|
|
9
12
|
workspaceFileSuggestions: "workspace.fileSuggestions",
|
|
10
13
|
piPackagesManage: "piPackages.manage",
|
|
11
14
|
selectedMachineSettings: "settings.selectedMachine",
|
|
12
15
|
agentProfileConfig: "settings.agentProfile",
|
|
13
16
|
};
|
|
17
|
+
export const SESSION_UNREAD_LIMIT = 1_000;
|
|
18
|
+
export const SESSION_UNREAD_SESSION_ID_MAX_LENGTH = 512;
|
|
19
|
+
export const SESSION_UNREAD_CWD_MAX_LENGTH = 32 * 1024;
|
|
20
|
+
export const SESSION_UNREAD_CATALOG_ID_MAX_LENGTH = 512;
|
|
21
|
+
export const SESSION_UNREAD_COMPLETED_AT_MAX_LENGTH = 64;
|
|
22
|
+
export const SESSION_NOTIFICATION_LIMIT = 100;
|
|
23
|
+
export const SESSION_NOTIFICATION_MESSAGE_BYTES = 8 * 1024;
|
|
24
|
+
/**
|
|
25
|
+
* `customType` of the follow-up custom message that carries a closed ask back to
|
|
26
|
+
* the model and into the transcript. Its `details` are an {@link AskUserOutcome}.
|
|
27
|
+
*/
|
|
28
|
+
export const ASK_USER_ANSWERS_CUSTOM_TYPE = "pi-web.ask.answers";
|
|
29
|
+
/** Largest question set one `ask_user` call may post. */
|
|
30
|
+
export const ASK_USER_QUESTION_LIMIT = 20;
|
|
31
|
+
/** Largest option list one question may offer. */
|
|
32
|
+
export const ASK_USER_OPTION_LIMIT = 12;
|
|
33
|
+
/** Length bound for ids: the ask id, question ids, and option values. */
|
|
34
|
+
export const ASK_USER_ID_MAX_LENGTH = 128;
|
|
35
|
+
/** Length bound for model-authored prose: questions, details, and option labels. */
|
|
36
|
+
export const ASK_USER_TEXT_MAX_LENGTH = 1_000;
|
|
37
|
+
/** Length bound for the free text a user types as a custom answer. */
|
|
38
|
+
export const ASK_USER_OTHER_TEXT_MAX_LENGTH = 4_000;
|
|
39
|
+
/** Length bound for extension-dialog ids. */
|
|
40
|
+
export const EXTENSION_DIALOG_ID_MAX_LENGTH = 128;
|
|
41
|
+
/** Length bound for extension-authored dialog prose: titles, messages, options, placeholders. */
|
|
42
|
+
export const EXTENSION_DIALOG_TEXT_MAX_LENGTH = 1_000;
|
|
43
|
+
/** Largest option list one `select` dialog may offer. */
|
|
44
|
+
export const EXTENSION_DIALOG_OPTION_LIMIT = 24;
|
|
45
|
+
/** Length bound for the text a user types into an `input` dialog. */
|
|
46
|
+
export const EXTENSION_DIALOG_INPUT_MAX_LENGTH = 4_000;
|
|
47
|
+
export const SESSION_TREE_CUSTOM_INSTRUCTIONS_MAX_LENGTH = 10_000;
|
|
14
48
|
//# sourceMappingURL=apiTypes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiTypes.js","sourceRoot":"","sources":["../../src/shared/apiTypes.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,sBAAsB,EAAE,yBAAyB;IACjD,qBAAqB,EAAE,wBAAwB;IAC/C,eAAe,EAAE,kBAAkB;IACnC,cAAc,EAAE,iBAAiB;IACjC,kBAAkB,EAAE,qBAAqB;IACzC,sBAAsB,EAAE,yBAAyB;IACjD,iBAAiB,EAAE,oBAAoB;IACvC,wBAAwB,EAAE,2BAA2B;IACrD,gBAAgB,EAAE,mBAAmB;IACrC,uBAAuB,EAAE,0BAA0B;IACnD,kBAAkB,EAAE,uBAAuB;CACnC,CAAC"}
|
|
1
|
+
{"version":3,"file":"apiTypes.js","sourceRoot":"","sources":["../../src/shared/apiTypes.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,mBAAmB,G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MAAM,8BAA8B,GAAG,GAAG,CAAC;AAClD,iGAAiG;AACjG,MAAM,CAAC,MAAM,gCAAgC,GAAG,KAAK,CAAC;AACtD,yDAAyD;AACzD,MAAM,CAAC,MAAM,6BAA6B,GAAG,EAAE,CAAC;AAChD,qEAAqE;AACrE,MAAM,CAAC,MAAM,iCAAiC,GAAG,KAAK,CAAC;AAklBvD,MAAM,CAAC,MAAM,2CAA2C,GAAG,MAAM,CAAC"}
|
|
@@ -9,6 +9,9 @@ export const WEB_RUNTIME_CAPABILITIES = [
|
|
|
9
9
|
PI_WEB_CAPABILITIES.sessionsReload,
|
|
10
10
|
PI_WEB_CAPABILITIES.sessionsClearQueue,
|
|
11
11
|
PI_WEB_CAPABILITIES.sessionsPersistedState,
|
|
12
|
+
PI_WEB_CAPABILITIES.sessionsNotifications,
|
|
13
|
+
PI_WEB_CAPABILITIES.sessionsUnread,
|
|
14
|
+
PI_WEB_CAPABILITIES.sessionsAskUser,
|
|
12
15
|
PI_WEB_CAPABILITIES.promptAttachments,
|
|
13
16
|
PI_WEB_CAPABILITIES.workspaceFileSuggestions,
|
|
14
17
|
PI_WEB_CAPABILITIES.piPackagesManage,
|
|
@@ -22,6 +25,9 @@ export const SESSIOND_RUNTIME_CAPABILITIES = [
|
|
|
22
25
|
PI_WEB_CAPABILITIES.sessionsReload,
|
|
23
26
|
PI_WEB_CAPABILITIES.sessionsClearQueue,
|
|
24
27
|
PI_WEB_CAPABILITIES.sessionsPersistedState,
|
|
28
|
+
PI_WEB_CAPABILITIES.sessionsNotifications,
|
|
29
|
+
PI_WEB_CAPABILITIES.sessionsUnread,
|
|
30
|
+
PI_WEB_CAPABILITIES.sessionsAskUser,
|
|
25
31
|
PI_WEB_CAPABILITIES.promptAttachments,
|
|
26
32
|
];
|
|
27
33
|
const EFFECTIVE_CAPABILITY_REQUIREMENTS = {
|
|
@@ -31,6 +37,9 @@ const EFFECTIVE_CAPABILITY_REQUIREMENTS = {
|
|
|
31
37
|
[PI_WEB_CAPABILITIES.sessionsReload]: ["web", "sessiond"],
|
|
32
38
|
[PI_WEB_CAPABILITIES.sessionsClearQueue]: ["web", "sessiond"],
|
|
33
39
|
[PI_WEB_CAPABILITIES.sessionsPersistedState]: ["web", "sessiond"],
|
|
40
|
+
[PI_WEB_CAPABILITIES.sessionsNotifications]: ["web", "sessiond"],
|
|
41
|
+
[PI_WEB_CAPABILITIES.sessionsUnread]: ["web", "sessiond"],
|
|
42
|
+
[PI_WEB_CAPABILITIES.sessionsAskUser]: ["web", "sessiond"],
|
|
34
43
|
[PI_WEB_CAPABILITIES.promptAttachments]: ["web", "sessiond"],
|
|
35
44
|
[PI_WEB_CAPABILITIES.workspaceFileSuggestions]: ["web"],
|
|
36
45
|
[PI_WEB_CAPABILITIES.piPackagesManage]: ["web"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../../src/shared/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAgF,MAAM,eAAe,CAAC;AAElI,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAG/B,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAC5E,MAAM,sBAAsB,GAAwB,IAAI,GAAG,CAAC,yBAAyB,CAAC,CAAC;AAEvF,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,mBAAmB,CAAC,sBAAsB;IAC1C,mBAAmB,CAAC,qBAAqB;IACzC,mBAAmB,CAAC,eAAe;IACnC,mBAAmB,CAAC,cAAc;IAClC,mBAAmB,CAAC,kBAAkB;IACtC,mBAAmB,CAAC,sBAAsB;IAC1C,mBAAmB,CAAC,iBAAiB;IACrC,mBAAmB,CAAC,wBAAwB;IAC5C,mBAAmB,CAAC,gBAAgB;IACpC,mBAAmB,CAAC,uBAAuB;IAC3C,mBAAmB,CAAC,kBAAkB;CACO,CAAC;AAEhD,MAAM,CAAC,MAAM,6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B,GAAG,iCAAiC,CAAC,UAAU,CAAC,CAAC;QACzE,OAAO,kBAAkB,CAAC,KAAK,CAAC,CAAC,SAAS,EAAE,EAAE;YAC5C,MAAM,OAAO,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;YACtC,OAAO,OAAO,EAAE,SAAS,KAAK,IAAI,IAAI,uBAAuB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QACrF,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export const PI_PACKAGE_MUTATION_PROXY_TIMEOUT_MS = 5 * 60_000;
|
|
2
|
+
export const SESSION_TREE_NAVIGATION_PROXY_TIMEOUT_MS = 5 * 60_000;
|
|
2
3
|
export const FEDERATED_HTTP_ROUTES = [
|
|
3
4
|
{ method: "GET", path: "/pi-web/status" },
|
|
4
5
|
{ method: "GET", path: "/config" },
|
|
@@ -36,11 +37,17 @@ export const FEDERATED_HTTP_ROUTES = [
|
|
|
36
37
|
{ method: "GET", path: "/activity" },
|
|
37
38
|
{ method: "GET", path: "/sessions" },
|
|
38
39
|
{ method: "POST", path: "/sessions" },
|
|
40
|
+
{ method: "GET", path: "/sessions/unread" },
|
|
41
|
+
{ method: "GET", path: "/sessions/notifications" },
|
|
39
42
|
{ method: "POST", path: "/sessions/cleanup/preview" },
|
|
40
43
|
{ method: "POST", path: "/sessions/cleanup" },
|
|
41
44
|
{ method: "POST", path: "/sessions/bulk/archive" },
|
|
42
45
|
{ method: "POST", path: "/sessions/bulk/delete-archived" },
|
|
43
46
|
{ method: "GET", path: "/sessions/:sessionId/messages" },
|
|
47
|
+
{ method: "GET", path: "/sessions/:sessionId/notifications" },
|
|
48
|
+
{ method: "POST", path: "/sessions/:sessionId/notifications/dismiss" },
|
|
49
|
+
{ method: "POST", path: "/sessions/:sessionId/notifications/dismiss-all" },
|
|
50
|
+
{ method: "POST", path: "/sessions/:sessionId/unread/acknowledge" },
|
|
44
51
|
{ method: "GET", path: "/sessions/:sessionId/status" },
|
|
45
52
|
{ method: "GET", path: "/sessions/:sessionId/stream-snapshot" },
|
|
46
53
|
{ method: "GET", path: "/sessions/:sessionId/models" },
|
|
@@ -52,11 +59,16 @@ export const FEDERATED_HTTP_ROUTES = [
|
|
|
52
59
|
{ method: "GET", path: "/sessions/:sessionId/commands" },
|
|
53
60
|
{ method: "POST", path: "/sessions/:sessionId/prompt" },
|
|
54
61
|
{ method: "POST", path: "/sessions/:sessionId/queue/clear" },
|
|
62
|
+
{ method: "POST", path: "/sessions/:sessionId/ask/submit" },
|
|
63
|
+
{ method: "POST", path: "/sessions/:sessionId/ask/cancel" },
|
|
64
|
+
{ method: "POST", path: "/sessions/:sessionId/dialogs/answer" },
|
|
65
|
+
{ method: "POST", path: "/sessions/:sessionId/dialogs/cancel" },
|
|
55
66
|
{ method: "POST", path: "/sessions/:sessionId/warnings/dismiss" },
|
|
56
67
|
{ method: "POST", path: "/sessions/:sessionId/attachments" },
|
|
57
68
|
{ method: "POST", path: "/sessions/:sessionId/shell" },
|
|
58
69
|
{ method: "POST", path: "/sessions/:sessionId/commands/run" },
|
|
59
70
|
{ method: "POST", path: "/sessions/:sessionId/commands/respond" },
|
|
71
|
+
{ method: "POST", path: "/sessions/:sessionId/tree/navigate", timeoutMs: SESSION_TREE_NAVIGATION_PROXY_TIMEOUT_MS },
|
|
60
72
|
{ method: "POST", path: "/sessions/:sessionId/abort" },
|
|
61
73
|
{ method: "POST", path: "/sessions/:sessionId/stop" },
|
|
62
74
|
{ method: "POST", path: "/sessions/:sessionId/archive" },
|