@pragma-sh/constants 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2883 @@
1
+ /* AUTO-GENERATED from schema.json. Do not edit. Run `bun run generate`. */
2
+
3
+ /**
4
+ * Which world a terminal session's shell lives in. `native` runs the host's own shell through the host's PTY (a pseudo-terminal on macOS and Linux, ConPTY on Windows). `wsl` runs a Linux shell inside a WSL distribution, served by a Linux `pragma-server` running in that distribution. Only Windows offers a real choice; macOS and Linux always resolve to `native`.
5
+ *
6
+ * This interface was referenced by `Constants`'s JSON-Schema
7
+ * via the `definition` "TerminalBackend".
8
+ */
9
+ export type TerminalBackend = "native" | "wsl";
10
+ /**
11
+ * Top-level request/response RPC domains served by pragma-server over the Unix-socket frame protocol.
12
+ *
13
+ * This interface was referenced by `Constants`'s JSON-Schema
14
+ * via the `definition` "ProtocolRpcMethod".
15
+ */
16
+ export type ProtocolRpcMethod =
17
+ | "git"
18
+ | "filesystem"
19
+ | "database"
20
+ | "kanban"
21
+ | "worktrees"
22
+ | "projects"
23
+ | "tabs"
24
+ | "settings"
25
+ | "github"
26
+ | "ai"
27
+ | "exec"
28
+ | "automations"
29
+ | "plugins"
30
+ | "tunnel"
31
+ | "ports"
32
+ | "scratchpads"
33
+ | "whiteboards"
34
+ | "wsl"
35
+ | "fanouts";
36
+ /**
37
+ * Snapshot-then-delta subscription event streams served by pragma-server.
38
+ *
39
+ * This interface was referenced by `Constants`'s JSON-Schema
40
+ * via the `definition` "ProtocolEventKind".
41
+ */
42
+ export type ProtocolEventKind =
43
+ | "agentStatus"
44
+ | "worktreeChanged"
45
+ | "kanbanChanged"
46
+ | "tabsChanged"
47
+ | "fileChanged"
48
+ | "echoMode"
49
+ | "automationPending"
50
+ | "automationsChanged"
51
+ | "workspace"
52
+ | "fanouts";
53
+ /**
54
+ * Stable protocol-level RPC error codes.
55
+ *
56
+ * This interface was referenced by `Constants`'s JSON-Schema
57
+ * via the `definition` "ProtocolErrorCode".
58
+ */
59
+ export type ProtocolErrorCode =
60
+ "invalidPayload" | "unsupportedMethod" | "notFound" | "staleWrite" | "permissionDenied" | "internal";
61
+ /**
62
+ * How a desktop update is applied. `reload` swaps the webview UI overlay and leaves the host running. `restart` always runs the full OS installer.
63
+ *
64
+ * This interface was referenced by `Constants`'s JSON-Schema
65
+ * via the `definition` "UpdateApplyMode".
66
+ */
67
+ export type UpdateApplyMode = "reload" | "restart";
68
+ /**
69
+ * Installer target id sent on the check request so a restart offer returns the right asset.
70
+ *
71
+ * This interface was referenced by `Constants`'s JSON-Schema
72
+ * via the `definition` "UpdatePlatform".
73
+ */
74
+ export type UpdatePlatform =
75
+ | "darwin-aarch64"
76
+ | "darwin-x86_64"
77
+ | "linux-x86_64-deb"
78
+ | "linux-x86_64-rpm"
79
+ | "linux-x86_64-appimage"
80
+ | "linux-aarch64-deb"
81
+ | "linux-aarch64-rpm"
82
+ | "linux-aarch64-appimage"
83
+ | "windows-x86_64";
84
+ /**
85
+ * Lifecycle of one fanout. Deliberately separate from agent runtime status: an attempt's agent may be idle while the fanout is still `active`.
86
+ *
87
+ * This interface was referenced by `Constants`'s JSON-Schema
88
+ * via the `definition` "FanoutStatus".
89
+ */
90
+ export type FanoutStatus =
91
+ | "provisioning"
92
+ | "active"
93
+ | "attention"
94
+ | "partial"
95
+ | "ready"
96
+ | "failed"
97
+ | "interrupted"
98
+ | "cancelled"
99
+ | "finalizing"
100
+ | "needsResolution"
101
+ | "cleanupFailed"
102
+ | "completed";
103
+ /**
104
+ * Lifecycle of one fanout attempt. `interrupted` means the host restarted while the attempt was live; its prompt is never replayed automatically.
105
+ *
106
+ * This interface was referenced by `Constants`'s JSON-Schema
107
+ * via the `definition` "FanoutMemberStatus".
108
+ */
109
+ export type FanoutMemberStatus =
110
+ "pending" | "provisioning" | "running" | "attention" | "done" | "failed" | "interrupted" | "cancelled" | "selected";
111
+ /**
112
+ * Durable progress marker for the destructive pick transaction. Persisted after every successful step so a retry resumes at the first incomplete stage instead of repeating a destructive one.
113
+ *
114
+ * This interface was referenced by `Constants`'s JSON-Schema
115
+ * via the `definition` "FanoutFinalizeStage".
116
+ */
117
+ export type FanoutFinalizeStage =
118
+ | "validating"
119
+ | "committingWinner"
120
+ | "merging"
121
+ | "promotingScratchpads"
122
+ | "stoppingSessions"
123
+ | "cleaningUp"
124
+ | "completed";
125
+ /**
126
+ * Machine-readable reason a fanout operation failed, preserved through the CLI, the gateway, and the SDK so callers branch on a code rather than on message text.
127
+ *
128
+ * This interface was referenced by `Constants`'s JSON-Schema
129
+ * via the `definition` "FanoutFailureCode".
130
+ */
131
+ export type FanoutFailureCode =
132
+ | "invalidSelector"
133
+ | "unknownAgent"
134
+ | "unknownModel"
135
+ | "unknownReasoning"
136
+ | "activeFanoutExists"
137
+ | "dirtyParent"
138
+ | "worktreeCreateFailed"
139
+ | "setupFailed"
140
+ | "launchFailed"
141
+ | "notFound"
142
+ | "conflict"
143
+ | "descendantWorktree"
144
+ | "commitMessageFailed"
145
+ | "mergeConflict"
146
+ | "promotionFailed"
147
+ | "cleanupFailed"
148
+ | "internal";
149
+ /**
150
+ * Where a fanout's single parent comes from: an existing worktree, or a fresh coordination worktree created from a source worktree.
151
+ *
152
+ * This interface was referenced by `Constants`'s JSON-Schema
153
+ * via the `definition` "FanoutParentSpec".
154
+ */
155
+ export type FanoutParentSpec = FanoutExistingParent | FanoutNewParent;
156
+ /**
157
+ * Follow-up delivery outcome per member: `accepted` is the fire-and-forget terminal state, the rest are only observable when waiting.
158
+ *
159
+ * This interface was referenced by `Constants`'s JSON-Schema
160
+ * via the `definition` "FanoutDeliveryState".
161
+ */
162
+ export type FanoutDeliveryState = "accepted" | "delivered" | "failed" | "timedOut";
163
+ /**
164
+ * Brokered control operations routed by pragma-server to the running app (the single controller). The CLI publishes these; the app executes the matching Tauri command and returns a ControlResult. Direct-to-server reads (tab read, agent status, agent report) are not ControlMethods.
165
+ *
166
+ * This interface was referenced by `Constants`'s JSON-Schema
167
+ * via the `definition` "ControlMethod".
168
+ */
169
+ export type ControlMethod =
170
+ | "worktreesList"
171
+ | "worktreeCreate"
172
+ | "worktreeRename"
173
+ | "worktreeSetHidden"
174
+ | "worktreeDelete"
175
+ | "worktreeStatus"
176
+ | "tabsList"
177
+ | "tabOpen"
178
+ | "tabClose"
179
+ | "tabRename"
180
+ | "tabExec"
181
+ | "splitList"
182
+ | "splitSet"
183
+ | "splitAddTab"
184
+ | "splitClear"
185
+ | "browserNavigate"
186
+ | "browserBack"
187
+ | "browserForward"
188
+ | "browserReload"
189
+ | "browserClose"
190
+ | "browserScroll"
191
+ | "browserFocus"
192
+ | "browserClick"
193
+ | "browserEval"
194
+ | "browserScreenshot"
195
+ | "agentStart"
196
+ | "agentSessionLaunch"
197
+ | "boardDraftCreate"
198
+ | "scratchpadCreate";
199
+ /**
200
+ * Where an automation file was discovered.
201
+ *
202
+ * This interface was referenced by `Constants`'s JSON-Schema
203
+ * via the `definition` "AutomationScope".
204
+ */
205
+ export type AutomationScope = "global" | "local";
206
+ /**
207
+ * Server trust state for an automation file.
208
+ *
209
+ * This interface was referenced by `Constants`'s JSON-Schema
210
+ * via the `definition` "AutomationTrust".
211
+ */
212
+ export type AutomationTrust = "trusted" | "approved" | "pending" | "rejected";
213
+ /**
214
+ * Automation trigger family.
215
+ *
216
+ * This interface was referenced by `Constants`'s JSON-Schema
217
+ * via the `definition` "AutomationTriggerKind".
218
+ */
219
+ export type AutomationTriggerKind = "cron" | "event" | "unknown";
220
+ /**
221
+ * Runtime load/run state surfaced by the host automation runner.
222
+ *
223
+ * This interface was referenced by `Constants`'s JSON-Schema
224
+ * via the `definition` "AutomationStatus".
225
+ */
226
+ export type AutomationStatus = "pending" | "loaded" | "running" | "idle" | "rejected" | "error";
227
+ /**
228
+ * How the stored GitHub token was obtained: the OAuth device flow or adoption of the gh CLI's token.
229
+ *
230
+ * This interface was referenced by `Constants`'s JSON-Schema
231
+ * via the `definition` "GitHubAuthMethod".
232
+ */
233
+ export type GitHubAuthMethod = "deviceFlow" | "cli";
234
+ /**
235
+ * Which world a terminal session's shell lives in. `native` runs the host's own shell through the host's PTY (a pseudo-terminal on macOS and Linux, ConPTY on Windows). `wsl` runs a Linux shell inside a WSL distribution, served by a Linux `pragma-server` running in that distribution. Only Windows offers a real choice; macOS and Linux always resolve to `native`.
236
+ */
237
+ export type TerminalBackend1 = "native" | "wsl";
238
+ /**
239
+ * Which `.pragma` layer a setting or asset belongs to: the user's home directory or the selected project.
240
+ *
241
+ * This interface was referenced by `Constants`'s JSON-Schema
242
+ * via the `definition` "SettingsScope".
243
+ */
244
+ export type SettingsScope = "global" | "project";
245
+ /**
246
+ * Which sounds directory the clip was found in.
247
+ */
248
+ export type SettingsScope1 = "global" | "project";
249
+ /**
250
+ * Optional agent capability used to exclude unsupported agent-verification scenarios.
251
+ *
252
+ * This interface was referenced by `Constants`'s JSON-Schema
253
+ * via the `definition` "AgentFeature".
254
+ */
255
+ export type AgentFeature =
256
+ "questions" | "commandApproval" | "commands" | "subagents" | "abort" | "interrupt" | "usageLimits" | "sessionName";
257
+ /**
258
+ * One interactive run-script entry: either a single command string or a split layout tree.
259
+ *
260
+ * This interface was referenced by `Constants`'s JSON-Schema
261
+ * via the `definition` "RunScriptEntry".
262
+ */
263
+ export type RunScriptEntry = string | RunScriptSplit;
264
+ /**
265
+ * A binary split node. Use exactly one axis: left/right for horizontal, or top/bottom for vertical.
266
+ *
267
+ * This interface was referenced by `Constants`'s JSON-Schema
268
+ * via the `definition` "RunScriptSplit".
269
+ */
270
+ export type RunScriptSplit = RunScriptHorizontalSplit | RunScriptVerticalSplit;
271
+ /**
272
+ * A command string leaf or a nested split layout node.
273
+ *
274
+ * This interface was referenced by `Constants`'s JSON-Schema
275
+ * via the `definition` "RunScriptNode".
276
+ */
277
+ export type RunScriptNode = string | RunScriptSplit;
278
+ /**
279
+ * Discriminates what a tab hosts: a shell terminal, an embedded browser, a file editor, a scratchpad, a whiteboard, a read-only diff, the read-only daemon log viewer, a pull-request review, or a plugin web view.
280
+ *
281
+ * This interface was referenced by `Constants`'s JSON-Schema
282
+ * via the `definition` "TabKind".
283
+ */
284
+ export type TabKind =
285
+ "terminal" | "browser" | "editor" | "scratchpad" | "whiteboard" | "diff" | "log" | "pr-review" | "plugin-webview";
286
+ /**
287
+ * Shared recursive split-pane tree. A node is either a tab-spec leaf or a binary split (left/right for horizontal, top/bottom for vertical). The CLI split layout and the live frontend split layout both use this shape.
288
+ *
289
+ * This interface was referenced by `Constants`'s JSON-Schema
290
+ * via the `definition` "SplitNode".
291
+ */
292
+ export type SplitNode = SplitTabLeaf | SplitSplit;
293
+ /**
294
+ * A binary split node: exactly one axis, horizontal (left/right) or vertical (top/bottom). Mirrors RunScriptSplit.
295
+ *
296
+ * This interface was referenced by `Constants`'s JSON-Schema
297
+ * via the `definition` "SplitSplit".
298
+ */
299
+ export type SplitSplit = SplitHorizontal | SplitVertical;
300
+ /**
301
+ * Runtime status for a frontend-managed interactive run-script session.
302
+ *
303
+ * This interface was referenced by `Constants`'s JSON-Schema
304
+ * via the `definition` "ScriptRunStatus".
305
+ */
306
+ export type ScriptRunStatus = "idle" | "running" | "stopping";
307
+ /**
308
+ * Runtime status an external agent reports for a terminal tab. `cleared` is a transient signal that removes the agent's indicator entirely (used when the agent process exits), as opposed to `done`, which leaves a green "finished, go look" dot.
309
+ *
310
+ * This interface was referenced by `Constants`'s JSON-Schema
311
+ * via the `definition` "AgentStatus".
312
+ */
313
+ export type AgentStatus = "running" | "attention" | "done" | "cleared";
314
+ /**
315
+ * CLI report command names; each maps to an AgentStatus, except `session-name`, which renames the session without changing status.
316
+ *
317
+ * This interface was referenced by `Constants`'s JSON-Schema
318
+ * via the `definition` "AgentReportKind".
319
+ */
320
+ export type AgentReportKind = "started" | "stopped" | "attention" | "cleared" | "session-name";
321
+ /**
322
+ * Reason an agent needs the user's attention.
323
+ *
324
+ * This interface was referenced by `Constants`'s JSON-Schema
325
+ * via the `definition` "AgentAttentionKind".
326
+ */
327
+ export type AgentAttentionKind = "question" | "command";
328
+ /**
329
+ * Agent event stream message frame kind.
330
+ *
331
+ * This interface was referenced by `Constants`'s JSON-Schema
332
+ * via the `definition` "AgentMessageKind".
333
+ */
334
+ export type AgentMessageKind = "message";
335
+ /**
336
+ * Role/source for one rich agent message entry.
337
+ *
338
+ * This interface was referenced by `Constants`'s JSON-Schema
339
+ * via the `definition` "AgentMessageRole".
340
+ */
341
+ export type AgentMessageRole = "assistant" | "tool" | "user" | "system";
342
+ /**
343
+ * Lifecycle status for a tool call reported inside an AgentMessage.
344
+ *
345
+ * This interface was referenced by `Constants`'s JSON-Schema
346
+ * via the `definition` "AgentToolCallStatus".
347
+ */
348
+ export type AgentToolCallStatus = "running" | "done" | "error";
349
+ /**
350
+ * File interaction kind reported inside an AgentMessage.
351
+ *
352
+ * This interface was referenced by `Constants`'s JSON-Schema
353
+ * via the `definition` "AgentFileChangeKind".
354
+ */
355
+ export type AgentFileChangeKind = "read" | "edited" | "created" | "deleted";
356
+ /**
357
+ * Which axis of change a diff/listing record refers to. committed (base branch → HEAD), staged (HEAD → index), and unstaged (index → working tree) are the three listing axes. worktree (base branch → working tree) is the unified review side every Changes-sidebar click opens — it compares the file's current on-disk content against what used to be on the worktree at its fork point, regardless of which list the file appears in.
358
+ *
359
+ * This interface was referenced by `Constants`'s JSON-Schema
360
+ * via the `definition` "DiffSide".
361
+ */
362
+ export type DiffSide = "committed" | "staged" | "unstaged" | "worktree";
363
+ /**
364
+ * How a file changed relative to the diff base.
365
+ *
366
+ * This interface was referenced by `Constants`'s JSON-Schema
367
+ * via the `definition` "ChangeStatus".
368
+ */
369
+ export type ChangeStatus = "added" | "modified" | "deleted" | "renamed" | "untracked";
370
+ /**
371
+ * How a watched entry changed on disk, as reported by the pragma-server worktree filesystem watcher.
372
+ *
373
+ * This interface was referenced by `Constants`'s JSON-Schema
374
+ * via the `definition` "FileChangeKind".
375
+ */
376
+ export type FileChangeKind = "created" | "modified" | "removed";
377
+ /**
378
+ * Column a prompt card lives in on the project Kanban board.
379
+ *
380
+ * This interface was referenced by `Constants`'s JSON-Schema
381
+ * via the `definition` "KanbanPromptStatus".
382
+ */
383
+ export type KanbanPromptStatus = "draft" | "inProgress" | "reviewNeeded" | "completed";
384
+ /**
385
+ * How a reviewed card was completed: committed and merged, committed with a PR opened, or finished manually.
386
+ *
387
+ * This interface was referenced by `Constants`'s JSON-Schema
388
+ * via the `definition` "KanbanCompletedAction".
389
+ */
390
+ export type KanbanCompletedAction = "commitMerge" | "commitPr" | "manual";
391
+ /**
392
+ * When the card's agent run is started. MVP supports manual start only.
393
+ *
394
+ * This interface was referenced by `Constants`'s JSON-Schema
395
+ * via the `definition` "KanbanSchedulingMode".
396
+ */
397
+ export type KanbanSchedulingMode = "manual";
398
+
399
+ /**
400
+ * Shared compile-time constants. Single source of truth for both the TypeScript frontend (src) and the Rust backend (src-tauri). Edit values.json; never edit generated code.
401
+ */
402
+ export interface Constants {
403
+ app: AppInfo;
404
+ window: WindowDefaults;
405
+ editorLaunchers: EditorLaunchers;
406
+ scripts: Scripts;
407
+ agents: Agents;
408
+ platform: Platform;
409
+ daemon: Daemon;
410
+ gateway: Gateway;
411
+ protocol: Protocol;
412
+ github: GitHub;
413
+ plugins: Plugins;
414
+ theme: Theme;
415
+ tunnel: Tunnel;
416
+ keybindings: KeybindingsFiles;
417
+ agentStatus: AgentStatusDefaults;
418
+ terminalDefaults: TerminalDefaults;
419
+ tabs: TabDefaults;
420
+ bench: Bench;
421
+ files: FileReadLimits;
422
+ scratchpads: Scratchpads;
423
+ whiteboards: WhiteboardDefaults;
424
+ fanout: FanoutDefaults;
425
+ updates: Updates;
426
+ onboarding: Onboarding;
427
+ }
428
+ /**
429
+ * This interface was referenced by `Constants`'s JSON-Schema
430
+ * via the `definition` "AppInfo".
431
+ */
432
+ export interface AppInfo {
433
+ /**
434
+ * Human-readable product name.
435
+ */
436
+ name: string;
437
+ /**
438
+ * Reverse-DNS bundle identifier.
439
+ */
440
+ identifier: string;
441
+ /**
442
+ * Semantic version string.
443
+ */
444
+ version: string;
445
+ }
446
+ /**
447
+ * This interface was referenced by `Constants`'s JSON-Schema
448
+ * via the `definition` "WindowDefaults".
449
+ */
450
+ export interface WindowDefaults {
451
+ defaultWidth: number;
452
+ defaultHeight: number;
453
+ minWidth: number;
454
+ minHeight: number;
455
+ /**
456
+ * Height in px of the custom draggable titlebar strip the frontend reserves above the content. Must clear the inset macOS traffic lights.
457
+ */
458
+ titlebarHeight: number;
459
+ /**
460
+ * macOS traffic-light button inset in px from the top-left window corner, applied via tauri-plugin-decorum so the controls center vertically within the custom titlebar.
461
+ */
462
+ trafficLightInset: number;
463
+ }
464
+ /**
465
+ * This interface was referenced by `Constants`'s JSON-Schema
466
+ * via the `definition` "EditorLaunchers".
467
+ */
468
+ export interface EditorLaunchers {
469
+ defaultEditorId: string;
470
+ options: EditorLauncher[];
471
+ }
472
+ /**
473
+ * This interface was referenced by `Constants`'s JSON-Schema
474
+ * via the `definition` "EditorLauncher".
475
+ */
476
+ export interface EditorLauncher {
477
+ id: string;
478
+ name: string;
479
+ /**
480
+ * Iconify icon name, preferably from the simple-icons namespace for branded editors.
481
+ */
482
+ brandIcon: string;
483
+ /**
484
+ * Hex color used to render the monochrome Iconify brand glyph.
485
+ */
486
+ brandColor: string;
487
+ /**
488
+ * Executable name used to launch the editor with the worktree path. Null uses the system file explorer.
489
+ */
490
+ cliCommand: string | null;
491
+ }
492
+ /**
493
+ * Shared script execution limits used by project lifecycle scripts.
494
+ *
495
+ * This interface was referenced by `Constants`'s JSON-Schema
496
+ * via the `definition` "Scripts".
497
+ */
498
+ export interface Scripts {
499
+ /**
500
+ * Maximum number of headless project script commands Pragma runs at once. Interactive run scripts create terminal tabs and are not limited by this value.
501
+ */
502
+ maxConcurrentCommands: number;
503
+ /**
504
+ * Project-root-relative POSIX path of the optional project script config file. Read by the Rust backend and matched against worktree file-watch events by the frontend to hot-reload script buttons.
505
+ */
506
+ configPath: string;
507
+ /**
508
+ * Other agent orchestrators whose checked-in lifecycle-script config Pragma can import into `.pragma/scripts.json`. Order is the detection priority: when a project carries more than one, the first match wins.
509
+ */
510
+ migrationSources: ScriptMigrationSource[];
511
+ /**
512
+ * Conventional-commit subject for the generated `.pragma/scripts.json` commit, written when the import prompt's commit toggle is on. The commit carries no trailers: the user is its sole author.
513
+ */
514
+ migrationCommitMessage: string;
515
+ }
516
+ /**
517
+ * One importable foreign script config: its identifier, display name, and the project-root-relative paths that identify it.
518
+ *
519
+ * This interface was referenced by `Constants`'s JSON-Schema
520
+ * via the `definition` "ScriptMigrationSource".
521
+ */
522
+ export interface ScriptMigrationSource {
523
+ /**
524
+ * Stable identifier the frontend sends back over IPC to import this source. Never a display string.
525
+ */
526
+ id: string;
527
+ /**
528
+ * Tool name shown in the import prompt.
529
+ */
530
+ label: string;
531
+ /**
532
+ * Project-root-relative POSIX paths this tool stores its lifecycle scripts in, in probe order.
533
+ *
534
+ * @minItems 1
535
+ */
536
+ configPaths: [string, ...string[]];
537
+ }
538
+ /**
539
+ * Shared agent-launch timing used by both the frontend's terminal-write scheduling and the Rust CLI/broker launch path.
540
+ *
541
+ * This interface was referenced by `Constants`'s JSON-Schema
542
+ * via the `definition` "Agents".
543
+ */
544
+ export interface Agents {
545
+ /**
546
+ * Delay before writing an agent's start command to a freshly spawned PTY, giving the shell time to become ready. There is no readiness signal from the PTY, so this is a best-effort fixed delay.
547
+ */
548
+ startDelayMs: number;
549
+ /**
550
+ * Maximum extra wait for a bracketed-prefill agent to enter its alternate screen before the prompt is sent anyway.
551
+ */
552
+ altScreenExtraWaitMs: number;
553
+ /**
554
+ * Delay after a late alternate-screen entry before sending the prompt, allowing the TUI input widget to mount.
555
+ */
556
+ altScreenSettleMs: number;
557
+ }
558
+ /**
559
+ * Per-operating-system launch defaults shared by the Rust session layer and the TypeScript settings UI. Values here are defaults only: a project may override them in its `.pragma/config.json`.
560
+ *
561
+ * This interface was referenced by `Constants`'s JSON-Schema
562
+ * via the `definition` "Platform".
563
+ */
564
+ export interface Platform {
565
+ shells: DefaultShells;
566
+ wsl: Wsl;
567
+ defaultBackend: TerminalBackend;
568
+ }
569
+ /**
570
+ * Fallback shell used when the environment names none. On macOS and Linux the `SHELL` environment variable wins when it is set; Windows has no such convention, so the candidate list is probed in order instead.
571
+ *
572
+ * This interface was referenced by `Constants`'s JSON-Schema
573
+ * via the `definition` "DefaultShells".
574
+ */
575
+ export interface DefaultShells {
576
+ /**
577
+ * Shell launched on macOS when `SHELL` is unset.
578
+ */
579
+ macos: string;
580
+ /**
581
+ * Shell launched on Linux when `SHELL` is unset.
582
+ */
583
+ linux: string;
584
+ /**
585
+ * Windows shell candidates, probed in order and resolved against `PATH`. PowerShell 7+ (`pwsh.exe`) is preferred over the in-box Windows PowerShell (`powershell.exe`) because it ships the modern ConPTY behaviour; the last entry must be a shell that is present on every Windows install so resolution cannot fail.
586
+ *
587
+ * @minItems 1
588
+ */
589
+ windows: [string, ...string[]];
590
+ }
591
+ /**
592
+ * How the Windows client reaches a Linux `pragma-server` running inside a WSL distribution. The Windows side never translates `\\wsl$\` paths: the Linux server owns its own filesystem world and is addressed exactly like a remote host.
593
+ *
594
+ * This interface was referenced by `Constants`'s JSON-Schema
595
+ * via the `definition` "Wsl".
596
+ */
597
+ export interface Wsl {
598
+ /**
599
+ * Executable used to run a command inside a WSL distribution.
600
+ */
601
+ launcher: string;
602
+ /**
603
+ * Arguments that list installed distributions with their state and WSL version. The output is UTF-16LE encoded, which the parser has to decode before splitting.
604
+ */
605
+ listArgs: string[];
606
+ /**
607
+ * Name of the Linux `pragma-server` executable expected on the distribution's PATH, or installed by Pragma into the distribution when it is missing.
608
+ */
609
+ serverBinary: string;
610
+ }
611
+ /**
612
+ * Contract between the Pragma app and the detached PTY daemon.
613
+ *
614
+ * This interface was referenced by `Constants`'s JSON-Schema
615
+ * via the `definition` "Daemon".
616
+ */
617
+ export interface Daemon {
618
+ /**
619
+ * Internal daemon wire-protocol SemVer, spoken on Hello, `gateway.json` and `/v1/health`. Mirrored from crates/pragma-protocol's package version by `bun run generate`; do not edit by hand. Comparison is exact equality, and that is load-bearing: every peer here ships in one bundle, so a version that no longer matches is a stale process to evict, not a peer to negotiate with. Remote clients use `gateway.apiVersion` instead.
620
+ */
621
+ protocolVersion: string;
622
+ /**
623
+ * File name of the server's local IPC endpoint inside the server directory. A Unix-domain socket on every supported platform: macOS and Linux use the kernel's AF_UNIX, Windows uses the AF_UNIX support present since Windows 10 build 17063. The server binds it and every native client connects to it, so the name must never be spelled out by hand on either side of the language boundary.
624
+ */
625
+ socketFile: string;
626
+ /**
627
+ * File name of the startup lock the server holds inside the server directory, used to keep a second server from binding over a live one.
628
+ */
629
+ lockFile: string;
630
+ /**
631
+ * File name the detached server writes its stdout and stderr to inside the server directory.
632
+ */
633
+ logFile: string;
634
+ }
635
+ /**
636
+ * Local HTTP gateway discovery and authentication constants shared by Rust gateway code and TypeScript clients.
637
+ *
638
+ * This interface was referenced by `Constants`'s JSON-Schema
639
+ * via the `definition` "Gateway".
640
+ */
641
+ export interface Gateway {
642
+ /**
643
+ * SemVer of the client-facing gateway HTTP contract, advertised in the pairing payload so a remote client can reject an incompatible host before it stores a connection. Deliberately NOT `daemon.protocolVersion`: that one is the internal daemon frame protocol and is bumped by every desktop release, whereas Pragma Go and the web build embed their copy of this value at build time and ship on their own cadence. Comparison is exact equality, so bump this only on a breaking change to the `/v1` API, and only in the same release as a client build that embeds the new value — a client that never launches cannot be updated first.
644
+ */
645
+ apiVersion: string;
646
+ /**
647
+ * Filename written beside daemon.sock with gateway port, token, pid, and protocol version.
648
+ */
649
+ discoveryFile: string;
650
+ /**
651
+ * Filename written beside daemon.sock holding the persistent 0600 bearer token, so the token survives gateway restarts and stays stable across paired devices until explicitly regenerated.
652
+ */
653
+ tokenFile: string;
654
+ /**
655
+ * Filename written beside daemon.sock holding devices that successfully authenticated with the gateway.
656
+ */
657
+ devicesFile: string;
658
+ /**
659
+ * HTTP authorization header name used for bearer-token authentication.
660
+ */
661
+ tokenHeader: string;
662
+ /**
663
+ * HTTP headers carrying installation-scoped mobile device metadata.
664
+ */
665
+ deviceHeaders: {
666
+ id: string;
667
+ name: string;
668
+ platform: string;
669
+ appVersion: string;
670
+ };
671
+ push: GatewayPush;
672
+ web: GatewayWeb;
673
+ }
674
+ /**
675
+ * Expo push delivery constants. The gateway watches the agent status stream and pushes to every registered phone; the mobile app registers its Expo token through `/v1/push/tokens`.
676
+ *
677
+ * This interface was referenced by `Constants`'s JSON-Schema
678
+ * via the `definition` "GatewayPush".
679
+ */
680
+ export interface GatewayPush {
681
+ /**
682
+ * Expo push service endpoint the gateway POSTs batches of messages to.
683
+ */
684
+ sendUrl: string;
685
+ /**
686
+ * Largest number of messages sent in one request; Expo documents 100 per call.
687
+ */
688
+ batchSize: number;
689
+ /**
690
+ * How long a desktop presence heartbeat counts as current. While a heartbeat says the desktop is focused, phone pushes are suppressed — the user is already looking at the alert. A desktop that dies without blurring stops suppressing after this window.
691
+ */
692
+ presenceTtlMs: number;
693
+ /**
694
+ * Accepted Expo push token prefixes. A token that matches none is rejected at registration rather than failing later inside Expo.
695
+ */
696
+ tokenPrefixes: string[];
697
+ }
698
+ /**
699
+ * Where the gateway serves the Pragma Go web bundle from, and how that bundle is staged. Shared so the Expo export, the staging script, the Rust static-file routes, and the desktop's shareable link all agree on one path.
700
+ *
701
+ * This interface was referenced by `Constants`'s JSON-Schema
702
+ * via the `definition` "GatewayWeb".
703
+ */
704
+ export interface GatewayWeb {
705
+ /**
706
+ * Default access state for the public Pragma Go browser bundle. Users override it with gateway.webEnabled in the global config file.
707
+ */
708
+ enabled: boolean;
709
+ /**
710
+ * URL prefix the exported web bundle is deployed and served under. Passed to Expo as `EXPO_BASE_URL` at export time so the asset URLs baked into `index.html` match the routes the gateway answers.
711
+ */
712
+ basePath: string;
713
+ /**
714
+ * Filename inside the staged bundle listing every servable asset with its URL path, content type, and encoding. The gateway serves only what this manifest names, so a request path is looked up as a map key and never joined onto a filesystem path.
715
+ */
716
+ manifestFile: string;
717
+ /**
718
+ * Directory name under the desktop app's Tauri resources holding the staged bundle.
719
+ */
720
+ resourceDir: string;
721
+ }
722
+ /**
723
+ * Shared schema source of truth for the host-server RPC and subscription protocol. The frame codec itself lives in `pragma-protocol`; these values name the cross-language methods, events, and errors.
724
+ *
725
+ * This interface was referenced by `Constants`'s JSON-Schema
726
+ * via the `definition` "Protocol".
727
+ */
728
+ export interface Protocol {
729
+ rpcMethods: ProtocolRpcMethod[];
730
+ events: ProtocolEventKind[];
731
+ errors: ProtocolErrorCode[];
732
+ }
733
+ /**
734
+ * GitHub integration contract: the secret-free OAuth Device Flow client id, scopes, and the endpoint URLs shared by the Rust backend (device flow + token exchange) and the frontend Octokit client.
735
+ *
736
+ * This interface was referenced by `Constants`'s JSON-Schema
737
+ * via the `definition` "GitHub".
738
+ */
739
+ export interface GitHub {
740
+ /**
741
+ * Client id of the registered Pragma GitHub OAuth App (device flow enabled). No client secret — a distributed desktop app can't keep one secret.
742
+ */
743
+ oauthClientId: string;
744
+ /**
745
+ * OAuth scopes requested during the device flow (e.g. `repo`).
746
+ */
747
+ scopes: string[];
748
+ /**
749
+ * Endpoint that issues a device + user code (`POST https://github.com/login/device/code`).
750
+ */
751
+ deviceCodeUrl: string;
752
+ /**
753
+ * Page the user opens to enter the user code (`https://github.com/login/device`).
754
+ */
755
+ deviceVerifyUrl: string;
756
+ /**
757
+ * Endpoint polled to exchange an authorized device code for an access token.
758
+ */
759
+ accessTokenUrl: string;
760
+ /**
761
+ * Base URL for the GitHub REST/GraphQL API (Octokit `baseUrl`).
762
+ */
763
+ apiBaseUrl: string;
764
+ /**
765
+ * Pragma's public GitHub home page, linked from the pull-request signature footer.
766
+ */
767
+ homepageUrl: string;
768
+ prSignature: PrSignature;
769
+ }
770
+ /**
771
+ * The "Created with Pragma" footer appended to pull requests Pragma opens. The markers delimit the block so Pragma can strip it again when it renders a PR body, and so a body written by an older Pragma is still recognised.
772
+ *
773
+ * This interface was referenced by `Constants`'s JSON-Schema
774
+ * via the `definition` "PrSignature".
775
+ */
776
+ export interface PrSignature {
777
+ /**
778
+ * Whether the footer is appended when the user has not configured `github.prSignature`.
779
+ */
780
+ enabled: boolean;
781
+ /**
782
+ * HTML comment opening the footer block. Everything from here to `endMarker` is Pragma-owned and is stripped before the body is shown in Pragma.
783
+ */
784
+ startMarker: string;
785
+ /**
786
+ * HTML comment closing the footer block.
787
+ */
788
+ endMarker: string;
789
+ /**
790
+ * Text of the small "Open worktree" link rendered under the footer heading.
791
+ */
792
+ linkLabel: string;
793
+ /**
794
+ * Web redirector the badge links to, which forwards its query string to the `pragma://open` deep link. GitHub's markdown sanitizer keeps only `http`/`https`/`mailto` hrefs, so a `pragma://` URL would render as inert text.
795
+ */
796
+ openUrl: string;
797
+ }
798
+ /**
799
+ * Plugin-system constants shared by the Rust config reader and the TypeScript loader.
800
+ *
801
+ * This interface was referenced by `Constants`'s JSON-Schema
802
+ * via the `definition` "Plugins".
803
+ */
804
+ export interface Plugins {
805
+ /**
806
+ * Relative path of the Pragma config file that declares plugin entries. Resolved against the home directory for global plugins and against the project root for project plugins.
807
+ */
808
+ configFileName: string;
809
+ /**
810
+ * Plugin storage scopes supported by the host runtime. v1 persists global plugin key/value state; project scope is reserved for project-addressed plugin config/storage layers.
811
+ */
812
+ storageScopes: ("global" | "project")[];
813
+ }
814
+ /**
815
+ * Optional color-theme override file read by the desktop app. Shared so the Rust reader/writer and the TypeScript theme runtime agree on the file location and the color-scheme blocks it may declare.
816
+ *
817
+ * This interface was referenced by `Constants`'s JSON-Schema
818
+ * via the `definition` "Theme".
819
+ */
820
+ export interface Theme {
821
+ /**
822
+ * Relative path of the optional theme file. Resolved against the home directory for the global theme and against the project root for a project theme — the same layout rule as `plugins.configFileName`. Both files are optional; the app merges built-in defaults <- global <- project per token.
823
+ */
824
+ fileName: string;
825
+ /**
826
+ * Color-scheme blocks a theme file may declare under `colors`. Each maps to the matching CSS variable block in the app stylesheet (`:root` for light, `.dark` for dark).
827
+ */
828
+ modes: ("light" | "dark")[];
829
+ }
830
+ /**
831
+ * Defaults for the remote-access tunnel that exposes the local HTTP gateway to a paired mobile device. A user overrides these per-install via the `tunnel` key in `~/.pragma/config.json`. Shared so the Rust tunnel supervisor and any TypeScript config UI agree on the shipped defaults.
832
+ *
833
+ * This interface was referenced by `Constants`'s JSON-Schema
834
+ * via the `definition` "Tunnel".
835
+ */
836
+ export interface Tunnel {
837
+ /**
838
+ * Default tunnel command template. `{port}` is the only substitution and is replaced with the live gateway port. Ships targeting ngrok's JSON log output.
839
+ */
840
+ defaultCommand: string;
841
+ /**
842
+ * Default regular expression whose first capture group is the public tunnel URL, matched against both stdout and stderr lines. Covers ngrok's JSON `"url":"https://…"` log and plain `https://…` URLs (e.g. cloudflared).
843
+ */
844
+ defaultUrlPattern: string;
845
+ }
846
+ /**
847
+ * Location of the editable keybindings file. Resolved against the home directory for global bindings and against the project root for project bindings, so Rust and the Settings UI agree on one path.
848
+ *
849
+ * This interface was referenced by `Constants`'s JSON-Schema
850
+ * via the `definition` "KeybindingsFiles".
851
+ */
852
+ export interface KeybindingsFiles {
853
+ /**
854
+ * Relative path of the keybindings file (e.g. `.pragma/keybindings.json`). A project file only needs the actions it overrides; missing actions fall back to the global file, then to the built-in defaults.
855
+ */
856
+ configFileName: string;
857
+ }
858
+ /**
859
+ * Shipped defaults and limits for agent alert notifications and sounds. A user overrides these per install/project via the `agentStatus` key of `.pragma/config.json`.
860
+ *
861
+ * This interface was referenced by `Constants`'s JSON-Schema
862
+ * via the `definition` "AgentStatusDefaults".
863
+ */
864
+ export interface AgentStatusDefaults {
865
+ /**
866
+ * Relative directory scanned for alert sounds. Resolved against the home directory for global sounds and against the project root for project sounds.
867
+ */
868
+ soundsDirName: string;
869
+ /**
870
+ * Longest allowed alert clip. Longer uploads are rejected rather than truncated.
871
+ */
872
+ maxSoundSeconds: number;
873
+ /**
874
+ * Largest allowed alert clip in bytes, bounding what crosses IPC when a clip is imported or played.
875
+ */
876
+ maxSoundBytes: number;
877
+ /**
878
+ * Lower-case file extensions (no dot) treated as alert sounds when listing the sounds directory.
879
+ */
880
+ soundExtensions: string[];
881
+ /**
882
+ * Whether platform notifications fire for agent alerts when the user has not configured `agentStatus.notificationsEnabled`.
883
+ */
884
+ notificationsEnabled: boolean;
885
+ notificationText: AgentNotificationText;
886
+ }
887
+ /**
888
+ * Templates for the text of an agent alert. Rendered identically by the desktop toast, the desktop platform notification, and the Expo push the gateway sends to a paired phone, so all three read the same. `{agent}`, `{project}`, `{worktree}`, and `{tab}` are substituted; no other placeholder is recognised.
889
+ *
890
+ * This interface was referenced by `Constants`'s JSON-Schema
891
+ * via the `definition` "AgentNotificationText".
892
+ */
893
+ export interface AgentNotificationText {
894
+ /**
895
+ * Title when the agent finished its turn. Takes `{agent}`.
896
+ */
897
+ doneTitle: string;
898
+ /**
899
+ * Title when the agent needs attention for an unclassified reason. Takes `{agent}`.
900
+ */
901
+ attentionTitle: string;
902
+ /**
903
+ * Title when the agent is waiting for an answer. Takes `{agent}`.
904
+ */
905
+ questionTitle: string;
906
+ /**
907
+ * Title when the agent is asking to run a command. Takes `{agent}`.
908
+ */
909
+ commandTitle: string;
910
+ /**
911
+ * Joins the project and worktree names in the body line.
912
+ */
913
+ locationSeparator: string;
914
+ /**
915
+ * Appended to the body when the reporting tab has a name of its own. Takes `{tab}`.
916
+ */
917
+ tabSuffix: string;
918
+ /**
919
+ * Body used when neither the project nor the worktree could be resolved — a report can arrive for a worktree the client has not loaded yet.
920
+ */
921
+ unknownLocation: string;
922
+ }
923
+ /**
924
+ * Shipped defaults for terminal launching. A user overrides these per install/project via the `terminal` key of `.pragma/config.json` (`TerminalSettings`).
925
+ *
926
+ * This interface was referenced by `Constants`'s JSON-Schema
927
+ * via the `definition` "TerminalDefaults".
928
+ */
929
+ export interface TerminalDefaults {
930
+ /**
931
+ * WSL distribution names hidden from the shell picker by default because they back other tools rather than interactive shells (Docker Desktop's VM distros).
932
+ */
933
+ hiddenDistros: string[];
934
+ /**
935
+ * Whether a plain new tab defaults to the shell profile most recently picked for that project instead of the configured default terminal.
936
+ */
937
+ rememberLastShell: boolean;
938
+ /**
939
+ * Largest file (typically an image) that may be dropped onto a terminal. The bytes are copied to the host that runs the PTY in one `filesystem` RPC, so this plus its base64 expansion must stay inside the protocol's frame limit.
940
+ */
941
+ maxDroppedFileBytes: number;
942
+ /**
943
+ * Directory under the host's temporary directory that holds copies of files dropped onto a terminal, whose absolute paths are pasted into the PTY.
944
+ */
945
+ droppedFilesDirName: string;
946
+ /**
947
+ * How long a per-drop directory under `droppedFilesDirName` may sit on disk before a sweep deletes it. The host sweeps once at startup and on a fixed interval after that (`DROPPED_FILES_SWEEP_INTERVAL` in `pragma-server`), so a drop is retained for at most this age plus one sweep interval.
948
+ */
949
+ droppedFilesMaxAgeMs: number;
950
+ }
951
+ /**
952
+ * Shipped tab defaults shared by the desktop app and any host that has to reason about a tab's name.
953
+ *
954
+ * This interface was referenced by `Constants`'s JSON-Schema
955
+ * via the `definition` "TabDefaults".
956
+ */
957
+ export interface TabDefaults {
958
+ /**
959
+ * Fallback title per tab kind, used for a tab whose shell or page has not named itself. A tab still carrying its default title has no name worth showing in a notification, so both languages compare against these.
960
+ */
961
+ defaultTitles: {
962
+ fallback: string;
963
+ browser: string;
964
+ log: string;
965
+ scratchpad: string;
966
+ whiteboard: string;
967
+ prReview: string;
968
+ pluginWebview: string;
969
+ };
970
+ }
971
+ /**
972
+ * Names the terminal benchmark (`@pragma-sh/bench`) and the desktop app agree on. The app installs the hook global in dev builds only; the benchmark's injected runner reads it back by the same name.
973
+ *
974
+ * This interface was referenced by `Constants`'s JSON-Schema
975
+ * via the `definition` "Bench".
976
+ */
977
+ export interface Bench {
978
+ /**
979
+ * `window` property under which a dev build exposes read-only access to its live xterm instances. Absent in production builds.
980
+ */
981
+ hookGlobal: string;
982
+ /**
983
+ * `window` property the benchmark installs its own injected scenario runner under. Owned by the benchmark, never by the app.
984
+ */
985
+ runnerGlobal: string;
986
+ /**
987
+ * Leading token of the status line the `pragma-bench tui` payload paints on its first row. The runner scans painted frames for it to learn which input the terminal has finished rendering.
988
+ */
989
+ markerPrefix: string;
990
+ /**
991
+ * Title given to the terminal tab the benchmark opens, so a run is identifiable in the UI and reclaimable after a crash.
992
+ */
993
+ tabTitle: string;
994
+ }
995
+ /**
996
+ * Limits for reading a binary file in chunks over the `filesystem` RPC. A single chunk plus its base64 expansion must stay well inside the protocol's frame limit, so the host rejects any request for more than `chunkBytes` at once and the frontend loops until the whole file is read.
997
+ *
998
+ * This interface was referenced by `Constants`'s JSON-Schema
999
+ * via the `definition` "FileReadLimits".
1000
+ */
1001
+ export interface FileReadLimits {
1002
+ /**
1003
+ * Largest number of raw bytes one `readBytesRange` request may return. Base64 inflates this by 4/3 on the wire.
1004
+ */
1005
+ chunkBytes: number;
1006
+ /**
1007
+ * Largest binary file a viewer will assemble in memory from chunks. Bigger files are refused with a message instead of exhausting the webview's heap.
1008
+ */
1009
+ maxBinaryBytes: number;
1010
+ }
1011
+ /**
1012
+ * Managed scratchpad file contract shared by the CLI, desktop host, and editor.
1013
+ *
1014
+ * This interface was referenced by `Constants`'s JSON-Schema
1015
+ * via the `definition` "Scratchpads".
1016
+ */
1017
+ export interface Scratchpads {
1018
+ directory: string;
1019
+ extension: string;
1020
+ frontmatterKey: string;
1021
+ version: number;
1022
+ }
1023
+ /**
1024
+ * Host persistence and validation limits for worktree-scoped whiteboards.
1025
+ *
1026
+ * This interface was referenced by `Constants`'s JSON-Schema
1027
+ * via the `definition` "WhiteboardDefaults".
1028
+ */
1029
+ export interface WhiteboardDefaults {
1030
+ databaseFile: string;
1031
+ defaultTitle: string;
1032
+ maxTitleChars: number;
1033
+ maxSceneBytes: number;
1034
+ maxRenderDimension: number;
1035
+ }
1036
+ /**
1037
+ * Shipped defaults for fanout orchestration: the host state file, attempt branch naming, the member floor, and follow-up delivery timeouts. Both `pragma-server` and the desktop read these instead of hard-coding either side.
1038
+ *
1039
+ * This interface was referenced by `Constants`'s JSON-Schema
1040
+ * via the `definition` "FanoutDefaults".
1041
+ */
1042
+ export interface FanoutDefaults {
1043
+ /**
1044
+ * Owner-only durable fanout record, written beside the server socket.
1045
+ */
1046
+ stateFile: string;
1047
+ /**
1048
+ * Leading segment of every generated attempt branch (`<prefix>/<fanout>/<member>`).
1049
+ */
1050
+ branchPrefix: string;
1051
+ /**
1052
+ * Fewest attempts a fanout may have. A single attempt is an ordinary agent launch.
1053
+ */
1054
+ minMembers: number;
1055
+ /**
1056
+ * Default bound on concurrently launching attempts.
1057
+ */
1058
+ defaultJobs: number;
1059
+ /**
1060
+ * How long a waiting follow-up send waits for each member's delivery receipt.
1061
+ */
1062
+ deliveryTimeoutMs: number;
1063
+ /**
1064
+ * Environment variable exported into every attempt session with the owning fanout id.
1065
+ */
1066
+ envFanoutId: string;
1067
+ /**
1068
+ * Environment variable exported into every attempt session with its member id.
1069
+ */
1070
+ envMemberId: string;
1071
+ }
1072
+ /**
1073
+ * Shipped defaults for desktop auto-updates. User overrides live in global `.pragma/config.json` under `updates`.
1074
+ *
1075
+ * This interface was referenced by `Constants`'s JSON-Schema
1076
+ * via the `definition` "Updates".
1077
+ */
1078
+ export interface Updates {
1079
+ /**
1080
+ * Production Next.js check endpoint. Dev builds use `devCheckUrl` unless user overrides `other.serverUrl`.
1081
+ */
1082
+ checkUrl: string;
1083
+ /**
1084
+ * Check endpoint used by `pragma-dev-*` builds so they never poll production.
1085
+ */
1086
+ devCheckUrl: string;
1087
+ /**
1088
+ * How often a production (or opted-in) session re-checks for an update.
1089
+ */
1090
+ pollIntervalMs: number;
1091
+ /**
1092
+ * Default for whether the desktop polls on launch and on an interval.
1093
+ */
1094
+ autoDownload: boolean;
1095
+ /**
1096
+ * GitHub Release asset name for the per-release manifest.
1097
+ */
1098
+ manifestFile: string;
1099
+ /**
1100
+ * Directory name under the instance data dir that holds the optional UI overlay (`<data>/<uiDirName>/<version>/`).
1101
+ */
1102
+ uiDirName: string;
1103
+ /**
1104
+ * Sidebar button that applies a downloaded (or on-click) update.
1105
+ */
1106
+ buttonLabel: string;
1107
+ /**
1108
+ * Link label for the GitHub Release notes URL.
1109
+ */
1110
+ changelogLabel: string;
1111
+ /**
1112
+ * Modal title shown before a restart (installer) update.
1113
+ */
1114
+ restartWarningTitle: string;
1115
+ /**
1116
+ * Modal body warning that the app server restarts and terminals stop.
1117
+ */
1118
+ restartWarningBody: string;
1119
+ /**
1120
+ * Supported apply modes, in display order.
1121
+ *
1122
+ * @minItems 2
1123
+ */
1124
+ applyModes: [UpdateApplyMode, UpdateApplyMode, ...UpdateApplyMode[]];
1125
+ /**
1126
+ * Installer platform ids the check API accepts.
1127
+ *
1128
+ * @minItems 1
1129
+ */
1130
+ platforms: [UpdatePlatform, ...UpdatePlatform[]];
1131
+ }
1132
+ /**
1133
+ * Shipped values for the first-run onboarding flow: where its preview videos stream from, and which global skill directories the skills step can install into.
1134
+ *
1135
+ * This interface was referenced by `Constants`'s JSON-Schema
1136
+ * via the `definition` "Onboarding".
1137
+ */
1138
+ export interface Onboarding {
1139
+ /**
1140
+ * Base URL the onboarding preview videos are streamed from (the marketing site's `public/media`). Videos are streamed rather than bundled so installers stay small.
1141
+ */
1142
+ mediaBaseUrl: string;
1143
+ skill: OnboardingSkill;
1144
+ }
1145
+ /**
1146
+ * The Pragma skill offered during onboarding and the global directories it can be installed into.
1147
+ *
1148
+ * This interface was referenced by `Constants`'s JSON-Schema
1149
+ * via the `definition` "OnboardingSkill".
1150
+ */
1151
+ export interface OnboardingSkill {
1152
+ /**
1153
+ * Directory name the skill is written as, inside each target directory.
1154
+ */
1155
+ id: string;
1156
+ /**
1157
+ * Install destinations offered by the skills step.
1158
+ */
1159
+ targets: OnboardingSkillTarget[];
1160
+ }
1161
+ /**
1162
+ * One skill install destination. The frontend sends `id` over IPC; the backend resolves `directory` against the home directory.
1163
+ *
1164
+ * This interface was referenced by `Constants`'s JSON-Schema
1165
+ * via the `definition` "OnboardingSkillTarget".
1166
+ */
1167
+ export interface OnboardingSkillTarget {
1168
+ /**
1169
+ * Stable identifier sent over IPC.
1170
+ */
1171
+ id: string;
1172
+ /**
1173
+ * Directory holding the skill, relative to the user's home directory.
1174
+ */
1175
+ directory: string;
1176
+ /**
1177
+ * Button label shown in onboarding.
1178
+ */
1179
+ label: string;
1180
+ }
1181
+ /**
1182
+ * One failure attached to a fanout or a single member.
1183
+ *
1184
+ * This interface was referenced by `Constants`'s JSON-Schema
1185
+ * via the `definition` "FanoutFailure".
1186
+ */
1187
+ export interface FanoutFailure {
1188
+ code: FanoutFailureCode;
1189
+ message: string;
1190
+ /**
1191
+ * Member the failure belongs to, or null for a fanout-wide failure.
1192
+ */
1193
+ memberId?: string | null;
1194
+ /**
1195
+ * Finalize stage the failure happened in, when it happened during a pick.
1196
+ */
1197
+ stage?: FanoutFinalizeStage | null;
1198
+ }
1199
+ /**
1200
+ * One requested attempt before resolution. `selector` is the raw `agent[.model[.reasoning]]` text a CLI caller typed; a structured caller may instead set the fields directly. Duplicate selectors are valid — sampling one model twice is a supported use.
1201
+ *
1202
+ * This interface was referenced by `Constants`'s JSON-Schema
1203
+ * via the `definition` "FanoutMemberSelector".
1204
+ */
1205
+ export interface FanoutMemberSelector {
1206
+ /**
1207
+ * Raw selector text: a catalog agent id optionally followed by `.<modelId>` and `.<reasoningId>`.
1208
+ */
1209
+ selector: string;
1210
+ /**
1211
+ * Explicit model id, overriding anything parsed out of `selector`.
1212
+ */
1213
+ modelId?: string | null;
1214
+ /**
1215
+ * Explicit reasoning id, overriding both `selector` and the request-wide default.
1216
+ */
1217
+ reasoningId?: string | null;
1218
+ }
1219
+ /**
1220
+ * One durable fanout attempt: a worktree branched from the fanout's captured base commit, plus the agent-owned terminal tab running in it.
1221
+ *
1222
+ * This interface was referenced by `Constants`'s JSON-Schema
1223
+ * via the `definition` "FanoutMember".
1224
+ */
1225
+ export interface FanoutMember {
1226
+ id: string;
1227
+ /**
1228
+ * Stable creation order, so the comparison grid column order never shuffles.
1229
+ */
1230
+ ordinal: number;
1231
+ /**
1232
+ * The selector text this member was created from, retained for retry and display.
1233
+ */
1234
+ selector: string;
1235
+ /**
1236
+ * Fully qualified plugin catalog id (`plugin.agent`) used to resolve launch metadata.
1237
+ */
1238
+ catalogAgentId: string;
1239
+ /**
1240
+ * Runtime reporter/watcher id the agent event stream is keyed by. Never derive this at a call site — the host resolves it from the plugin's watcher metadata.
1241
+ */
1242
+ runtimeAgentId: string;
1243
+ modelId: string | null;
1244
+ reasoningId: string | null;
1245
+ branch: string;
1246
+ worktreeId: string | null;
1247
+ tabId: string | null;
1248
+ /**
1249
+ * Tabs this member previously ran in. A retry moves the current tab id here.
1250
+ */
1251
+ priorTabIds: string[];
1252
+ status: FanoutMemberStatus;
1253
+ failure: FanoutFailure | null;
1254
+ }
1255
+ /**
1256
+ * One durable fanout: a single parent worktree, an immutable base commit, one shared prompt, and N isolated attempts. A parent may own at most one fanout that is not in a terminal state.
1257
+ *
1258
+ * This interface was referenced by `Constants`'s JSON-Schema
1259
+ * via the `definition` "Fanout".
1260
+ */
1261
+ export interface Fanout {
1262
+ id: string;
1263
+ projectId: string;
1264
+ parentWorktreeId: string;
1265
+ /**
1266
+ * Worktree a newly-created coordination parent was branched from; null when an existing parent was used.
1267
+ */
1268
+ sourceWorktreeId: string | null;
1269
+ /**
1270
+ * True when this fanout created its own parent worktree.
1271
+ */
1272
+ ownsParent: boolean;
1273
+ /**
1274
+ * Exact parent HEAD captured at creation. Every attempt branches from it and every comparison diffs against it, even after the parent moves on.
1275
+ */
1276
+ baseCommit: string;
1277
+ title: string;
1278
+ prompt: string;
1279
+ status: FanoutStatus;
1280
+ winningMemberId: string | null;
1281
+ finalizeStage: FanoutFinalizeStage | null;
1282
+ failure?: FanoutFailure | null;
1283
+ members: FanoutMember[];
1284
+ createdAt: string;
1285
+ updatedAt: string;
1286
+ }
1287
+ /**
1288
+ * This interface was referenced by `Constants`'s JSON-Schema
1289
+ * via the `definition` "FanoutExistingParent".
1290
+ */
1291
+ export interface FanoutExistingParent {
1292
+ kind: "existing";
1293
+ worktreeId: string;
1294
+ }
1295
+ /**
1296
+ * This interface was referenced by `Constants`'s JSON-Schema
1297
+ * via the `definition` "FanoutNewParent".
1298
+ */
1299
+ export interface FanoutNewParent {
1300
+ kind: "new";
1301
+ sourceWorktreeId: string;
1302
+ branch: string;
1303
+ title?: string | null;
1304
+ }
1305
+ /**
1306
+ * This interface was referenced by `Constants`'s JSON-Schema
1307
+ * via the `definition` "FanoutCreateRequest".
1308
+ */
1309
+ export interface FanoutCreateRequest {
1310
+ projectId: string;
1311
+ parent: FanoutParentSpec;
1312
+ prompt: string;
1313
+ /**
1314
+ * Display title. Derived from the prompt's first line when omitted.
1315
+ */
1316
+ title?: string | null;
1317
+ /**
1318
+ * Reasoning effort applied to every member that does not name its own.
1319
+ */
1320
+ defaultReasoningId?: string | null;
1321
+ members: FanoutMemberSelector[];
1322
+ /**
1323
+ * Bound on concurrently launching attempts. Git worktree mutations are serialized regardless.
1324
+ */
1325
+ jobs?: number | null;
1326
+ /**
1327
+ * Repeating a create with the same key returns the existing fanout instead of provisioning a second one.
1328
+ */
1329
+ idempotencyKey?: string | null;
1330
+ }
1331
+ /**
1332
+ * Addresses one fanout by exactly one of its id or any worktree that belongs to it (its parent, or any attempt).
1333
+ *
1334
+ * This interface was referenced by `Constants`'s JSON-Schema
1335
+ * via the `definition` "FanoutRef".
1336
+ */
1337
+ export interface FanoutRef {
1338
+ fanoutId?: string | null;
1339
+ worktreeId?: string | null;
1340
+ }
1341
+ /**
1342
+ * This interface was referenced by `Constants`'s JSON-Schema
1343
+ * via the `definition` "FanoutReadRequest".
1344
+ */
1345
+ export interface FanoutReadRequest {
1346
+ fanoutId?: string | null;
1347
+ worktreeId?: string | null;
1348
+ memberId?: string | null;
1349
+ all?: boolean | null;
1350
+ lines?: number | null;
1351
+ }
1352
+ /**
1353
+ * One member's terminal output. `text` is the escape-stripped rendering; `data` is the same bounded window as base64 raw bytes, which the SDK decodes to a Uint8Array.
1354
+ *
1355
+ * This interface was referenced by `Constants`'s JSON-Schema
1356
+ * via the `definition` "FanoutReadTarget".
1357
+ */
1358
+ export interface FanoutReadTarget {
1359
+ memberId: string;
1360
+ worktreeId: string;
1361
+ tabId: string;
1362
+ runtimeAgentId: string;
1363
+ bytes: number;
1364
+ text: string;
1365
+ data: string;
1366
+ }
1367
+ /**
1368
+ * This interface was referenced by `Constants`'s JSON-Schema
1369
+ * via the `definition` "FanoutReadResult".
1370
+ */
1371
+ export interface FanoutReadResult {
1372
+ fanoutId: string;
1373
+ targets: FanoutReadTarget[];
1374
+ }
1375
+ /**
1376
+ * Who a follow-up goes to: every live member, or one stable member id.
1377
+ *
1378
+ * This interface was referenced by `Constants`'s JSON-Schema
1379
+ * via the `definition` "FanoutSendTarget".
1380
+ */
1381
+ export interface FanoutSendTarget {
1382
+ kind: "all" | "member";
1383
+ memberId?: string | null;
1384
+ }
1385
+ /**
1386
+ * This interface was referenced by `Constants`'s JSON-Schema
1387
+ * via the `definition` "FanoutSendRequest".
1388
+ */
1389
+ export interface FanoutSendRequest {
1390
+ fanoutId?: string | null;
1391
+ worktreeId?: string | null;
1392
+ target: FanoutSendTarget;
1393
+ message: string;
1394
+ /**
1395
+ * Caller-supplied id making a retry idempotent: a message already delivered under this id is not typed twice.
1396
+ */
1397
+ messageId?: string | null;
1398
+ /**
1399
+ * Wait for bounded per-member receipts (the default) instead of returning after durable enqueue.
1400
+ */
1401
+ waitForDelivery?: boolean | null;
1402
+ }
1403
+ /**
1404
+ * This interface was referenced by `Constants`'s JSON-Schema
1405
+ * via the `definition` "FanoutDeliveryReceipt".
1406
+ */
1407
+ export interface FanoutDeliveryReceipt {
1408
+ memberId: string;
1409
+ worktreeId: string;
1410
+ tabId: string;
1411
+ runtimeAgentId: string;
1412
+ messageId: string;
1413
+ state: FanoutDeliveryState;
1414
+ error?: string | null;
1415
+ }
1416
+ /**
1417
+ * This interface was referenced by `Constants`'s JSON-Schema
1418
+ * via the `definition` "FanoutSendResult".
1419
+ */
1420
+ export interface FanoutSendResult {
1421
+ fanoutId: string;
1422
+ messageId: string;
1423
+ receipts: FanoutDeliveryReceipt[];
1424
+ }
1425
+ /**
1426
+ * Addresses one member of one fanout — used by retry and pick.
1427
+ *
1428
+ * This interface was referenced by `Constants`'s JSON-Schema
1429
+ * via the `definition` "FanoutMemberRequest".
1430
+ */
1431
+ export interface FanoutMemberRequest {
1432
+ fanoutId?: string | null;
1433
+ worktreeId?: string | null;
1434
+ memberId: string;
1435
+ }
1436
+ /**
1437
+ * The durable fanout after a mutation, plus any failures that did not abort it. `partial` is true when at least one member failed while others stayed healthy.
1438
+ *
1439
+ * This interface was referenced by `Constants`'s JSON-Schema
1440
+ * via the `definition` "FanoutResult".
1441
+ */
1442
+ export interface FanoutResult {
1443
+ fanout: Fanout;
1444
+ partial: boolean;
1445
+ failures: FanoutFailure[];
1446
+ }
1447
+ /**
1448
+ * Outcome of the destructive pick transaction. A conflicted or partly-cleaned pick still returns the durable fanout so a caller can resume from `stage`.
1449
+ *
1450
+ * This interface was referenced by `Constants`'s JSON-Schema
1451
+ * via the `definition` "FanoutPickResult".
1452
+ */
1453
+ export interface FanoutPickResult {
1454
+ fanout: Fanout;
1455
+ stage: FanoutFinalizeStage;
1456
+ winningMemberId: string;
1457
+ /**
1458
+ * Commit created from the winner's uncommitted changes, when there were any.
1459
+ */
1460
+ commit?: string | null;
1461
+ /**
1462
+ * Parent-relative paths the winner's scratchpads were promoted to.
1463
+ */
1464
+ promotedScratchpads: string[];
1465
+ deletedWorktreeIds: string[];
1466
+ /**
1467
+ * Attempt worktrees cleanup could not remove. Non-empty means `cleanupFailed`, never `completed`.
1468
+ */
1469
+ survivingWorktreeIds: string[];
1470
+ failures: FanoutFailure[];
1471
+ }
1472
+ /**
1473
+ * Snapshot and delta payload of the `fanouts` subscription. v1 keeps deltas trivial: every delta is a full replacement of the host's fanout set.
1474
+ *
1475
+ * This interface was referenced by `Constants`'s JSON-Schema
1476
+ * via the `definition` "FanoutSubscriptionPayload".
1477
+ */
1478
+ export interface FanoutSubscriptionPayload {
1479
+ fanouts: Fanout[];
1480
+ }
1481
+ /**
1482
+ * Automation metadata shared by the server and app UI.
1483
+ *
1484
+ * This interface was referenced by `Constants`'s JSON-Schema
1485
+ * via the `definition` "AutomationInfo".
1486
+ */
1487
+ export interface AutomationInfo {
1488
+ id: string;
1489
+ name: string;
1490
+ description: string;
1491
+ /**
1492
+ * Absolute host path to the automation source file.
1493
+ */
1494
+ path: string;
1495
+ /**
1496
+ * Path relative to the automation root, suitable for editor tabs when local.
1497
+ */
1498
+ relativePath: string;
1499
+ /**
1500
+ * Changes whenever the automation source file contents change.
1501
+ */
1502
+ sourceVersion: string;
1503
+ scope: AutomationScope;
1504
+ trust: AutomationTrust;
1505
+ triggerKind: AutomationTriggerKind;
1506
+ status: AutomationStatus;
1507
+ projectId: string | null;
1508
+ worktreeId: string | null;
1509
+ worktreeLabel: string | null;
1510
+ lastRunAt: string | null;
1511
+ nextRunAt: string | null;
1512
+ error: string | null;
1513
+ }
1514
+ /**
1515
+ * Project/worktree roots the app registers with the host server so local automations can run while the app is closed.
1516
+ *
1517
+ * This interface was referenced by `Constants`'s JSON-Schema
1518
+ * via the `definition` "AutomationRootRegistration".
1519
+ */
1520
+ export interface AutomationRootRegistration {
1521
+ projectId: string;
1522
+ projectPath: string;
1523
+ worktrees: AutomationWorktreeRoot[];
1524
+ }
1525
+ /**
1526
+ * One worktree path registered for automation discovery.
1527
+ *
1528
+ * This interface was referenced by `Constants`'s JSON-Schema
1529
+ * via the `definition` "AutomationWorktreeRoot".
1530
+ */
1531
+ export interface AutomationWorktreeRoot {
1532
+ worktreeId: string;
1533
+ path: string;
1534
+ label: string;
1535
+ isMain: boolean;
1536
+ }
1537
+ /**
1538
+ * Delta payload broadcast when a local automation needs approval.
1539
+ *
1540
+ * This interface was referenced by `Constants`'s JSON-Schema
1541
+ * via the `definition` "AutomationPendingPayload".
1542
+ */
1543
+ export interface AutomationPendingPayload {
1544
+ automation: AutomationInfo;
1545
+ }
1546
+ /**
1547
+ * Delta payload broadcast when automation list or runtime state changes.
1548
+ *
1549
+ * This interface was referenced by `Constants`'s JSON-Schema
1550
+ * via the `definition` "AutomationsChangedPayload".
1551
+ */
1552
+ export interface AutomationsChangedPayload {
1553
+ automations: AutomationInfo[];
1554
+ }
1555
+ /**
1556
+ * Persisted `github` block of the global `.pragma/config.json`. Global-only: there is no project layer, matching the rest of the GitHub settings. Every field is optional; a missing one means the shipped default.
1557
+ *
1558
+ * This interface was referenced by `Constants`'s JSON-Schema
1559
+ * via the `definition` "GitHubSettings".
1560
+ */
1561
+ export interface GitHubSettings {
1562
+ /**
1563
+ * Whether Pragma appends the "Created with Pragma" footer to pull requests it opens.
1564
+ */
1565
+ prSignature?: boolean;
1566
+ }
1567
+ /**
1568
+ * Persisted `other` block of global `.pragma/config.json`. Global-only. Every field is optional; missing values use shipped updater defaults.
1569
+ *
1570
+ * This interface was referenced by `Constants`'s JSON-Schema
1571
+ * via the `definition` "OtherSettings".
1572
+ */
1573
+ export interface OtherSettings {
1574
+ /**
1575
+ * Override for server providing update metadata. Empty/omitted uses shipped production or dev default.
1576
+ */
1577
+ serverUrl?: string;
1578
+ /**
1579
+ * When true, Pragma polls on launch, on an interval, and when the window becomes visible. When false, only Check now runs. The download itself starts when the user clicks Install Update.
1580
+ */
1581
+ autoDownload?: boolean;
1582
+ }
1583
+ /**
1584
+ * The authenticated GitHub user, as surfaced to the UI.
1585
+ *
1586
+ * This interface was referenced by `Constants`'s JSON-Schema
1587
+ * via the `definition` "GitHubUser".
1588
+ */
1589
+ export interface GitHubUser {
1590
+ /**
1591
+ * GitHub username (login).
1592
+ */
1593
+ login: string;
1594
+ /**
1595
+ * Display name; null when the user has not set one.
1596
+ */
1597
+ name: string | null;
1598
+ /**
1599
+ * Avatar image URL.
1600
+ */
1601
+ avatarUrl: string;
1602
+ }
1603
+ /**
1604
+ * Drives the setup modal and the Pull Request subtab: whether a token is stored, whether the gh CLI is an option, the signed-in user, and whether setup was skipped.
1605
+ *
1606
+ * This interface was referenced by `Constants`'s JSON-Schema
1607
+ * via the `definition` "GitHubAuthStatus".
1608
+ */
1609
+ export interface GitHubAuthStatus {
1610
+ /**
1611
+ * True when a usable GitHub token is stored in the backend's 0600 plaintext token file under the app data dir (not the OS keychain; see src-tauri/src/github.rs).
1612
+ */
1613
+ authenticated: boolean;
1614
+ /**
1615
+ * True when the `gh` CLI is installed and authenticated, so the CLI login option can be shown.
1616
+ */
1617
+ ghAvailable: boolean;
1618
+ /**
1619
+ * The authenticated user, or null when not authenticated.
1620
+ */
1621
+ user: GitHubUser | null;
1622
+ /**
1623
+ * How the stored token was obtained, or null when not authenticated (or stored by a build that predates method tracking).
1624
+ */
1625
+ authMethod: GitHubAuthMethod | null;
1626
+ /**
1627
+ * True once the user has skipped the setup modal; the modal never returns while true.
1628
+ */
1629
+ setupDismissed: boolean;
1630
+ }
1631
+ /**
1632
+ * Result of a fetch + ahead/behind comparison against the upstream of a worktree's branch — the create-PR pre-flight.
1633
+ *
1634
+ * This interface was referenced by `Constants`'s JSON-Schema
1635
+ * via the `definition` "BranchSyncStatus".
1636
+ */
1637
+ export interface BranchSyncStatus {
1638
+ /**
1639
+ * The worktree's current branch.
1640
+ */
1641
+ branch: string;
1642
+ /**
1643
+ * Commits the local branch is ahead of its upstream.
1644
+ */
1645
+ ahead: number;
1646
+ /**
1647
+ * Commits the local branch is behind its upstream. Non-zero blocks PR creation.
1648
+ */
1649
+ behind: number;
1650
+ /**
1651
+ * True when the branch already tracks a remote upstream; false means it must be pushed first.
1652
+ */
1653
+ hasUpstream: boolean;
1654
+ }
1655
+ /**
1656
+ * Owner/repo plus branch context parsed from a worktree's `origin` remote, used to address the GitHub API.
1657
+ *
1658
+ * This interface was referenced by `Constants`'s JSON-Schema
1659
+ * via the `definition` "GitHubRepoRef".
1660
+ */
1661
+ export interface GitHubRepoRef {
1662
+ /**
1663
+ * Repository owner (user or org).
1664
+ */
1665
+ owner: string;
1666
+ /**
1667
+ * Repository name (no `.git`).
1668
+ */
1669
+ repo: string;
1670
+ /**
1671
+ * The repo's default branch (PR base).
1672
+ */
1673
+ defaultBranch: string;
1674
+ /**
1675
+ * The worktree's current branch (PR head).
1676
+ */
1677
+ headBranch: string;
1678
+ /**
1679
+ * The branch of the worktree's parent worktree — the branch this worktree was created to merge back into, used as the default PR base. Null for the main/parentless worktree.
1680
+ */
1681
+ parentBranch: string | null;
1682
+ }
1683
+ /**
1684
+ * One concrete choice of shell world for a terminal session: the resolved form of a `TerminalSettings` default, or the profile a single tab was opened with. Carried on the spawn request so the session layer launches the same shell the picker named, and persisted on the tab so a respawned session keeps it.
1685
+ *
1686
+ * This interface was referenced by `Constants`'s JSON-Schema
1687
+ * via the `definition` "ShellProfile".
1688
+ */
1689
+ export interface ShellProfile {
1690
+ backend: TerminalBackend;
1691
+ /**
1692
+ * WSL distribution launched when `backend` is `wsl`. Null uses the distribution WSL itself marks as default. Always null for `native`.
1693
+ */
1694
+ distro?: string | null;
1695
+ }
1696
+ /**
1697
+ * Persisted `agentStatus` block of a global or project `.pragma/config.json`. Every field is optional: a project value overrides the global one, which overrides AgentStatusDefaults.
1698
+ *
1699
+ * This interface was referenced by `Constants`'s JSON-Schema
1700
+ * via the `definition` "AgentStatusSettings".
1701
+ */
1702
+ export interface AgentStatusSettings {
1703
+ /**
1704
+ * Whether an agent alert raises a platform notification.
1705
+ */
1706
+ notificationsEnabled?: boolean;
1707
+ /**
1708
+ * File name (not a path) of the clip in the sounds directory played on every agent alert. Null plays the built-in chime instead.
1709
+ */
1710
+ soundName?: string | null;
1711
+ }
1712
+ /**
1713
+ * Persisted `terminal` block of a global or project `.pragma/config.json`. Every field is optional: a project value overrides the global one, which overrides TerminalDefaults. Only meaningful on Windows, where both a native shell and WSL distributions are launchable; macOS and Linux always resolve to the native shell.
1714
+ *
1715
+ * This interface was referenced by `Constants`'s JSON-Schema
1716
+ * via the `definition` "TerminalSettings".
1717
+ */
1718
+ export interface TerminalSettings {
1719
+ /**
1720
+ * Native shell program (name on PATH or absolute path) launched for terminal sessions. On Windows this picks between the candidate shells (e.g. `pwsh.exe` vs `powershell.exe`); on macOS/Linux it wins over the `SHELL` environment variable.
1721
+ */
1722
+ shell?: string;
1723
+ backend?: TerminalBackend1;
1724
+ /**
1725
+ * WSL distribution launched when `backend` is `wsl`. Null uses the distribution WSL itself marks as default.
1726
+ */
1727
+ distro?: string | null;
1728
+ /**
1729
+ * WSL distribution names omitted from the shell picker. Replaces the shipped TerminalDefaults list rather than merging with it.
1730
+ */
1731
+ hiddenDistros?: string[];
1732
+ /**
1733
+ * Whether a plain new tab defaults to the shell profile most recently picked for that project instead of the configured default terminal.
1734
+ */
1735
+ rememberLastShell?: boolean;
1736
+ }
1737
+ /**
1738
+ * One installed WSL distribution, parsed from `wsl.exe --list --verbose`.
1739
+ *
1740
+ * This interface was referenced by `Constants`'s JSON-Schema
1741
+ * via the `definition` "WslDistro".
1742
+ */
1743
+ export interface WslDistro {
1744
+ /**
1745
+ * Distribution name as WSL reports it (e.g. `Ubuntu-24.04`).
1746
+ */
1747
+ name: string;
1748
+ /**
1749
+ * Whether the distribution is currently running.
1750
+ */
1751
+ running: boolean;
1752
+ /**
1753
+ * WSL version the distribution runs under (1 or 2).
1754
+ */
1755
+ version: number;
1756
+ /**
1757
+ * Whether WSL treats this distribution as its default.
1758
+ */
1759
+ default: boolean;
1760
+ }
1761
+ /**
1762
+ * Result of probing WSL availability on the host that owns a worktree — the desktop machine for a local project, the remote daemon's machine for an SSH one. `distros` is empty on non-Windows hosts and on Windows installs without WSL.
1763
+ *
1764
+ * This interface was referenced by `Constants`'s JSON-Schema
1765
+ * via the `definition` "WslDistroList".
1766
+ */
1767
+ export interface WslDistroList {
1768
+ /**
1769
+ * Whether the host that answered the probe runs Windows, the only platform where WSL distributions can exist.
1770
+ */
1771
+ isWindows: boolean;
1772
+ /**
1773
+ * Installed WSL distributions, before any user-configured hiding.
1774
+ */
1775
+ distros: WslDistro[];
1776
+ }
1777
+ /**
1778
+ * One alert clip discovered in a scope's sounds directory.
1779
+ *
1780
+ * This interface was referenced by `Constants`'s JSON-Schema
1781
+ * via the `definition` "AgentSound".
1782
+ */
1783
+ export interface AgentSound {
1784
+ /**
1785
+ * File name including extension, unique within its directory.
1786
+ */
1787
+ name: string;
1788
+ scope: SettingsScope1;
1789
+ }
1790
+ /**
1791
+ * Contents of one scope's sounds directory, plus the directory path to show in Settings.
1792
+ *
1793
+ * This interface was referenced by `Constants`'s JSON-Schema
1794
+ * via the `definition` "AgentSoundList".
1795
+ */
1796
+ export interface AgentSoundList {
1797
+ /**
1798
+ * Host-resolved absolute path of the scanned sounds directory (it may not exist yet).
1799
+ */
1800
+ dir: string;
1801
+ sounds: AgentSound[];
1802
+ }
1803
+ /**
1804
+ * One selectable reasoning-effort level for an agent model. Promoted from @pragma-sh/plugin so the catalog wire type has one source of truth.
1805
+ *
1806
+ * This interface was referenced by `Constants`'s JSON-Schema
1807
+ * via the `definition` "AgentReasoning".
1808
+ */
1809
+ export interface AgentReasoning {
1810
+ id: string;
1811
+ name: string;
1812
+ }
1813
+ /**
1814
+ * One selectable model for an agent, with optional reasoning levels.
1815
+ *
1816
+ * This interface was referenced by `Constants`'s JSON-Schema
1817
+ * via the `definition` "AgentModelEntry".
1818
+ */
1819
+ export interface AgentModelEntry {
1820
+ id: string;
1821
+ name: string;
1822
+ reasoning?: AgentReasoning[];
1823
+ }
1824
+ /**
1825
+ * Reference to a plugin-contributed agent icon asset, fetched by content hash through the gateway `/v1/assets/{hash}` route.
1826
+ *
1827
+ * This interface was referenced by `Constants`'s JSON-Schema
1828
+ * via the `definition` "AgentIcon".
1829
+ */
1830
+ export interface AgentIcon {
1831
+ /**
1832
+ * Lowercase-hex sha256 of the icon bytes; also the ETag and cache key.
1833
+ */
1834
+ hash: string;
1835
+ /**
1836
+ * Icon MIME type (e.g. `image/svg+xml`).
1837
+ */
1838
+ mime: string;
1839
+ }
1840
+ /**
1841
+ * One launchable agent in the resolved plugin catalog.
1842
+ *
1843
+ * This interface was referenced by `Constants`'s JSON-Schema
1844
+ * via the `definition` "CatalogAgent".
1845
+ */
1846
+ export interface CatalogAgent {
1847
+ id: string;
1848
+ name: string;
1849
+ /**
1850
+ * Id of the plugin that contributed this agent.
1851
+ */
1852
+ pluginId: string;
1853
+ /**
1854
+ * Where the contributing plugin was resolved from. A `project` agent belongs to exactly one project root and must not be offered to another one.
1855
+ */
1856
+ scope?: "global" | "project" | null;
1857
+ /**
1858
+ * Absolute root the contributing plugin was resolved from: the project root for `project` scope or the home directory for `global`.
1859
+ */
1860
+ root?: string | null;
1861
+ /**
1862
+ * Runtime reporter/watcher id the agent event stream is keyed by, when the plugin declares a watcher. Callers must use this rather than re-deriving an id from the dotted catalog id.
1863
+ */
1864
+ runtimeAgentId?: string | null;
1865
+ icon?: AgentIcon | null;
1866
+ models: AgentModelEntry[];
1867
+ /**
1868
+ * Capabilities the agent declares unsupported; agent verification skips matching scenarios.
1869
+ */
1870
+ excludeFeatures?: AgentFeature[];
1871
+ launch: AgentLaunchConfig;
1872
+ }
1873
+ /**
1874
+ * Resolved launch commands and terminal-input behavior needed by the persistent host to start an agent without a desktop webview.
1875
+ *
1876
+ * This interface was referenced by `Constants`'s JSON-Schema
1877
+ * via the `definition` "AgentLaunchConfig".
1878
+ */
1879
+ export interface AgentLaunchConfig {
1880
+ commands: AgentLaunchCommand[];
1881
+ startupInput?: AgentStartupInput[];
1882
+ prefillDelayMs?: number;
1883
+ prefillMode?: "bracketed" | "plain";
1884
+ prefillSubmit?: string;
1885
+ prefillSubmitDelayMs?: number;
1886
+ }
1887
+ /**
1888
+ * This interface was referenced by `Constants`'s JSON-Schema
1889
+ * via the `definition` "AgentLaunchCommand".
1890
+ */
1891
+ export interface AgentLaunchCommand {
1892
+ modelId: string | null;
1893
+ reasoningId: string | null;
1894
+ command: string[];
1895
+ }
1896
+ /**
1897
+ * This interface was referenced by `Constants`'s JSON-Schema
1898
+ * via the `definition` "AgentStartupInput".
1899
+ */
1900
+ export interface AgentStartupInput {
1901
+ delayMs: number;
1902
+ data: string;
1903
+ }
1904
+ /**
1905
+ * The resolved set of launchable agents contributed by all loaded plugins, assembled by the pragma-plugins sidecar and cached by pragma-server.
1906
+ *
1907
+ * This interface was referenced by `Constants`'s JSON-Schema
1908
+ * via the `definition` "AgentCatalog".
1909
+ */
1910
+ export interface AgentCatalog {
1911
+ agents: CatalogAgent[];
1912
+ }
1913
+ /**
1914
+ * The QR-encoded payload a desktop shows so a mobile client can connect to this host's gateway through the remote-access tunnel.
1915
+ *
1916
+ * This interface was referenced by `Constants`'s JSON-Schema
1917
+ * via the `definition` "PairingPayload".
1918
+ */
1919
+ export interface PairingPayload {
1920
+ /**
1921
+ * Public tunnel base URL of the local HTTP gateway.
1922
+ */
1923
+ url: string;
1924
+ /**
1925
+ * Gateway bearer token the paired device must present.
1926
+ */
1927
+ token: string;
1928
+ /**
1929
+ * pragma-protocol SemVer the host speaks, so the client can reject an incompatible host early.
1930
+ */
1931
+ protocolVersion: string;
1932
+ /**
1933
+ * Human-readable name of the host, shown on the paired device.
1934
+ */
1935
+ hostName: string;
1936
+ }
1937
+ /**
1938
+ * Project-owned `.pragma/scripts.json` lifecycle scripts. The file is optional; omitted keys behave as empty.
1939
+ *
1940
+ * This interface was referenced by `Constants`'s JSON-Schema
1941
+ * via the `definition` "ProjectScriptsConfig".
1942
+ */
1943
+ export interface ProjectScriptsConfig {
1944
+ /**
1945
+ * Headless commands run after a worktree is created, from the new worktree root.
1946
+ */
1947
+ setup?: string[];
1948
+ /**
1949
+ * Interactive scripts opened from the workspace header as terminal tabs and optional split layouts, keyed by name. The `run` and `build` keys are the default entries the header always reserves buttons for; any other key is a custom script and renders its own header button.
1950
+ */
1951
+ runScripts?: {
1952
+ [k: string]: RunScriptDefinition;
1953
+ };
1954
+ /**
1955
+ * Headless commands run before a worktree is deleted, from the target worktree root. Failures block deletion.
1956
+ */
1957
+ teardown?: string[];
1958
+ }
1959
+ /**
1960
+ * One named interactive script: the commands it opens and the icon its header button uses.
1961
+ *
1962
+ * This interface was referenced by `Constants`'s JSON-Schema
1963
+ * via the `definition` "RunScriptDefinition".
1964
+ */
1965
+ export interface RunScriptDefinition {
1966
+ /**
1967
+ * Interactive commands opened as terminal tabs and optional split layouts.
1968
+ */
1969
+ command: RunScriptEntry[];
1970
+ /**
1971
+ * Iconify icon name shown on the script's header button. Omitted for `run`/`build` falls back to the built-in play/hammer icons; omitted for a custom script falls back to a generic terminal icon.
1972
+ */
1973
+ icon?: string | null;
1974
+ }
1975
+ /**
1976
+ * This interface was referenced by `Constants`'s JSON-Schema
1977
+ * via the `definition` "RunScriptHorizontalSplit".
1978
+ */
1979
+ export interface RunScriptHorizontalSplit {
1980
+ left: RunScriptNode;
1981
+ right: RunScriptNode;
1982
+ }
1983
+ /**
1984
+ * This interface was referenced by `Constants`'s JSON-Schema
1985
+ * via the `definition` "RunScriptVerticalSplit".
1986
+ */
1987
+ export interface RunScriptVerticalSplit {
1988
+ top: RunScriptNode;
1989
+ bottom: RunScriptNode;
1990
+ }
1991
+ /**
1992
+ * A leaf pane in a shared SplitNode tree: a tab spec. `kind` selects the tab type; `command` seeds a terminal tab, `url` a browser tab, `file` an editor/diff tab. This intentionally diverges from RunScriptSplit (whose leaves are bare command strings) so the CLI split tree describes tabs, not commands.
1993
+ *
1994
+ * This interface was referenced by `Constants`'s JSON-Schema
1995
+ * via the `definition` "SplitTabLeaf".
1996
+ */
1997
+ export interface SplitTabLeaf {
1998
+ kind: TabKind;
1999
+ /**
2000
+ * Start command for a terminal tab leaf.
2001
+ */
2002
+ command?: string | null;
2003
+ /**
2004
+ * Starting URL for a browser tab leaf.
2005
+ */
2006
+ url?: string | null;
2007
+ /**
2008
+ * Worktree-relative path for an editor/diff tab leaf.
2009
+ */
2010
+ file?: string | null;
2011
+ }
2012
+ /**
2013
+ * A horizontal split node in a shared SplitNode tree (left/right panes).
2014
+ *
2015
+ * This interface was referenced by `Constants`'s JSON-Schema
2016
+ * via the `definition` "SplitHorizontal".
2017
+ */
2018
+ export interface SplitHorizontal {
2019
+ left: SplitNode;
2020
+ right: SplitNode;
2021
+ }
2022
+ /**
2023
+ * A vertical split node in a shared SplitNode tree (top/bottom panes).
2024
+ *
2025
+ * This interface was referenced by `Constants`'s JSON-Schema
2026
+ * via the `definition` "SplitVertical".
2027
+ */
2028
+ export interface SplitVertical {
2029
+ top: SplitNode;
2030
+ bottom: SplitNode;
2031
+ }
2032
+ /**
2033
+ * This interface was referenced by `Constants`'s JSON-Schema
2034
+ * via the `definition` "Project".
2035
+ */
2036
+ export interface Project {
2037
+ id: string;
2038
+ name: string;
2039
+ path: string;
2040
+ /**
2041
+ * User-chosen emoji shown in the project switcher; null falls back to a favicon found in the checkout, then to the project name's initial.
2042
+ */
2043
+ iconEmoji: string | null;
2044
+ orderIndex: number;
2045
+ createdAt: string;
2046
+ }
2047
+ /**
2048
+ * This interface was referenced by `Constants`'s JSON-Schema
2049
+ * via the `definition` "Worktree".
2050
+ */
2051
+ export interface Worktree {
2052
+ id: string;
2053
+ projectId: string;
2054
+ parentId: string | null;
2055
+ branch: string;
2056
+ title: string | null;
2057
+ path: string;
2058
+ isMain: boolean;
2059
+ /**
2060
+ * True when the user has hidden this worktree from the sidebar. Persists across restarts.
2061
+ */
2062
+ hidden: boolean;
2063
+ createdAt: string;
2064
+ }
2065
+ /**
2066
+ * A TCP listening port owned by a process descended from a live Pragma terminal tab shell.
2067
+ *
2068
+ * This interface was referenced by `Constants`'s JSON-Schema
2069
+ * via the `definition` "OpenPort".
2070
+ */
2071
+ export interface OpenPort {
2072
+ port: number;
2073
+ process: string;
2074
+ pid: number;
2075
+ tabId: string;
2076
+ worktreeId: string;
2077
+ }
2078
+ /**
2079
+ * A managed scratchpad file discovered on disk, independent of whether it currently has an open tab.
2080
+ *
2081
+ * This interface was referenced by `Constants`'s JSON-Schema
2082
+ * via the `definition` "ScratchpadSummary".
2083
+ */
2084
+ export interface ScratchpadSummary {
2085
+ id: string;
2086
+ title: string;
2087
+ /**
2088
+ * Worktree-relative POSIX path to the scratchpad's MDX file.
2089
+ */
2090
+ filePath: string;
2091
+ }
2092
+ /**
2093
+ * A managed scratchpad plus its MDX source and attached-agent metadata, as served by the host's `scratchpads` RPC to clients that render the document themselves.
2094
+ *
2095
+ * This interface was referenced by `Constants`'s JSON-Schema
2096
+ * via the `definition` "ScratchpadFile".
2097
+ */
2098
+ export interface ScratchpadFile {
2099
+ id: string;
2100
+ title: string;
2101
+ /**
2102
+ * Worktree-relative POSIX path to the scratchpad's MDX file.
2103
+ */
2104
+ filePath: string;
2105
+ /**
2106
+ * The full MDX source, frontmatter included.
2107
+ */
2108
+ contents: string;
2109
+ /**
2110
+ * Terminal tab id this scratchpad prompts, or null when nothing is attached.
2111
+ */
2112
+ agentTabId: string | null;
2113
+ /**
2114
+ * Catalog agent id of the attached tab, or null when nothing is attached.
2115
+ */
2116
+ agentId: string | null;
2117
+ /**
2118
+ * Epoch milliseconds the scratchpad was created, from its managed frontmatter.
2119
+ */
2120
+ createdAt: number;
2121
+ }
2122
+ /**
2123
+ * Serializable Excalidraw scene. Core fields are validated while element, app-state, and binary-file extensions remain forward compatible with Excalidraw releases.
2124
+ *
2125
+ * This interface was referenced by `Constants`'s JSON-Schema
2126
+ * via the `definition` "ExcalidrawScene".
2127
+ */
2128
+ export interface ExcalidrawScene {
2129
+ type: "excalidraw";
2130
+ version: number;
2131
+ source?: string;
2132
+ elements: {
2133
+ id: string;
2134
+ type: string;
2135
+ [k: string]: unknown;
2136
+ }[];
2137
+ appState: {
2138
+ [k: string]: unknown;
2139
+ };
2140
+ files: {
2141
+ [k: string]: unknown;
2142
+ };
2143
+ }
2144
+ /**
2145
+ * One durable worktree-scoped Excalidraw document.
2146
+ *
2147
+ * This interface was referenced by `Constants`'s JSON-Schema
2148
+ * via the `definition` "Whiteboard".
2149
+ */
2150
+ export interface Whiteboard {
2151
+ id: string;
2152
+ worktreeId: string;
2153
+ title: string;
2154
+ scene: ExcalidrawScene;
2155
+ version: number;
2156
+ createdAt: number;
2157
+ updatedAt: number;
2158
+ }
2159
+ /**
2160
+ * This interface was referenced by `Constants`'s JSON-Schema
2161
+ * via the `definition` "WhiteboardCreateInput".
2162
+ */
2163
+ export interface WhiteboardCreateInput {
2164
+ worktreeId: string;
2165
+ title: string;
2166
+ scene: ExcalidrawScene;
2167
+ }
2168
+ /**
2169
+ * This interface was referenced by `Constants`'s JSON-Schema
2170
+ * via the `definition` "WhiteboardEditInput".
2171
+ */
2172
+ export interface WhiteboardEditInput {
2173
+ worktreeId: string;
2174
+ id: string;
2175
+ title: string;
2176
+ scene: ExcalidrawScene;
2177
+ expectedVersion: number;
2178
+ }
2179
+ /**
2180
+ * This interface was referenced by `Constants`'s JSON-Schema
2181
+ * via the `definition` "WhiteboardListInput".
2182
+ */
2183
+ export interface WhiteboardListInput {
2184
+ worktreeId: string;
2185
+ query?: string;
2186
+ }
2187
+ /**
2188
+ * This interface was referenced by `Constants`'s JSON-Schema
2189
+ * via the `definition` "WhiteboardIdInput".
2190
+ */
2191
+ export interface WhiteboardIdInput {
2192
+ worktreeId: string;
2193
+ id: string;
2194
+ }
2195
+ /**
2196
+ * Base64-encoded PNG rendering of one whiteboard.
2197
+ *
2198
+ * This interface was referenced by `Constants`'s JSON-Schema
2199
+ * via the `definition` "WhiteboardViewResult".
2200
+ */
2201
+ export interface WhiteboardViewResult {
2202
+ data: string;
2203
+ }
2204
+ /**
2205
+ * One tool call surfaced by an agent message.
2206
+ *
2207
+ * This interface was referenced by `Constants`'s JSON-Schema
2208
+ * via the `definition` "AgentToolCall".
2209
+ */
2210
+ export interface AgentToolCall {
2211
+ id: string;
2212
+ name: string;
2213
+ status: AgentToolCallStatus;
2214
+ summary?: string;
2215
+ }
2216
+ /**
2217
+ * A path touched by an agent, without file contents.
2218
+ *
2219
+ * This interface was referenced by `Constants`'s JSON-Schema
2220
+ * via the `definition` "AgentFileChange".
2221
+ */
2222
+ export interface AgentFileChange {
2223
+ path: string;
2224
+ change: AgentFileChangeKind;
2225
+ }
2226
+ /**
2227
+ * Append-only rich message entry reported by an agent. Consumers upsert by id when tool-call state changes.
2228
+ *
2229
+ * This interface was referenced by `Constants`'s JSON-Schema
2230
+ * via the `definition` "AgentMessage".
2231
+ */
2232
+ export interface AgentMessage {
2233
+ agent: string;
2234
+ worktreeId: string;
2235
+ tabId: string;
2236
+ id: string;
2237
+ role: AgentMessageRole;
2238
+ text?: string;
2239
+ toolCalls?: AgentToolCall[];
2240
+ files?: AgentFileChange[];
2241
+ /**
2242
+ * Count of active sub-agents visible to the reporting plugin; no nested transcript is carried.
2243
+ */
2244
+ subAgentsActive: number;
2245
+ /**
2246
+ * Emitter timestamp in milliseconds since Unix epoch.
2247
+ */
2248
+ ts: number;
2249
+ }
2250
+ /**
2251
+ * Status report sent by pragma-cli through pragma-server to native clients.
2252
+ *
2253
+ * This interface was referenced by `Constants`'s JSON-Schema
2254
+ * via the `definition` "AgentReportPayload".
2255
+ */
2256
+ export interface AgentReportPayload {
2257
+ agent: string;
2258
+ worktreeId: string;
2259
+ tabId: string;
2260
+ /**
2261
+ * New agent status, or null for a status-less report (e.g. a `session-name` rename) that must leave the stored status untouched.
2262
+ */
2263
+ status: AgentStatus | null;
2264
+ /**
2265
+ * Human-readable name of the agent's active session. Reported on session create/rename/switch; the client renames the hosting tab unless the user renamed it manually.
2266
+ */
2267
+ sessionName?: string;
2268
+ attentionKind?: AgentAttentionKind | null;
2269
+ /**
2270
+ * The command (or tool invocation) the agent is asking permission to run. Set when attentionKind is `command` so a non-terminal client can show it and approve remotely.
2271
+ */
2272
+ command?: string;
2273
+ /**
2274
+ * The question the agent is asking. Set when attentionKind is `question` so a non-terminal client can show it and answer remotely.
2275
+ */
2276
+ question?: string;
2277
+ /**
2278
+ * Answer choices for a `question` attention. Empty/omitted when the question is free-text only or when attentionKind is `command`.
2279
+ */
2280
+ options?: QuestionOption[];
2281
+ /**
2282
+ * Multiple questions for a `question` attention. When present, clients render a back/next question wizard and submit every answer together; the legacy `question`/`options` fields are still used for a single question.
2283
+ */
2284
+ questions?: AgentQuestion[];
2285
+ /**
2286
+ * Correlation id for a command-approval or question round-trip. The reporter sets it on a `command`/`question` attention report and waits for a matching AgentDecision/AgentAnswer before proceeding.
2287
+ */
2288
+ requestId?: string;
2289
+ }
2290
+ /**
2291
+ * A selectable answer to an agent question.
2292
+ *
2293
+ * This interface was referenced by `Constants`'s JSON-Schema
2294
+ * via the `definition` "QuestionOption".
2295
+ */
2296
+ export interface QuestionOption {
2297
+ /**
2298
+ * Answer text sent back to the agent when selected.
2299
+ */
2300
+ label: string;
2301
+ /**
2302
+ * Optional explanation shown beneath the answer label.
2303
+ */
2304
+ description?: string;
2305
+ }
2306
+ /**
2307
+ * One question in a multi-question attention request. Each entry carries its own prompt and optional answer choices.
2308
+ *
2309
+ * This interface was referenced by `Constants`'s JSON-Schema
2310
+ * via the `definition` "AgentQuestion".
2311
+ */
2312
+ export interface AgentQuestion {
2313
+ /**
2314
+ * The question the agent is asking.
2315
+ */
2316
+ question: string;
2317
+ /**
2318
+ * Answer choices for this question. Empty/omitted when the question is free-text only.
2319
+ */
2320
+ options?: QuestionOption[];
2321
+ }
2322
+ /**
2323
+ * Approve/deny verdict for a command-approval request, published by the controlling client and fanned out to agent subscribers. The waiting reporter (a blocking harness hook or a plugin watcher) matches it by requestId.
2324
+ *
2325
+ * This interface was referenced by `Constants`'s JSON-Schema
2326
+ * via the `definition` "AgentDecision".
2327
+ */
2328
+ export interface AgentDecision {
2329
+ agent: string;
2330
+ worktreeId: string;
2331
+ tabId: string;
2332
+ requestId: string;
2333
+ /**
2334
+ * true to run the command, false to reject it.
2335
+ */
2336
+ approved: boolean;
2337
+ }
2338
+ /**
2339
+ * Reply to a `question` attention request, published by the controlling client and fanned out to agent subscribers. The waiting reporter (a blocking harness hook or a plugin watcher) matches it by requestId.
2340
+ *
2341
+ * This interface was referenced by `Constants`'s JSON-Schema
2342
+ * via the `definition` "AgentAnswer".
2343
+ */
2344
+ export interface AgentAnswer {
2345
+ agent: string;
2346
+ worktreeId: string;
2347
+ tabId: string;
2348
+ requestId: string;
2349
+ /**
2350
+ * The reply text. Present when the question was answered; omitted when dismissed.
2351
+ */
2352
+ answer?: string;
2353
+ /**
2354
+ * true when the question was dismissed without an answer.
2355
+ */
2356
+ dismissed: boolean;
2357
+ }
2358
+ /**
2359
+ * Free-form input (an interjection) sent by the controlling client to a running agent and fanned out to agent subscribers. A blocking harness hook or a plugin watcher delivers `text` into the agent's turn (via a harness input API, or by writing it to the tab's PTY). Unlike AgentDecision/AgentAnswer this is not tied to an outstanding request; `requestId` is optional and only set when the interjection answers a specific prompt.
2360
+ *
2361
+ * This interface was referenced by `Constants`'s JSON-Schema
2362
+ * via the `definition` "AgentInput".
2363
+ */
2364
+ export interface AgentInput {
2365
+ agent: string;
2366
+ worktreeId: string;
2367
+ tabId: string;
2368
+ /**
2369
+ * The message text to deliver to the running agent.
2370
+ */
2371
+ text: string;
2372
+ /**
2373
+ * Optional correlation id when the interjection answers a specific outstanding prompt.
2374
+ */
2375
+ requestId?: string;
2376
+ }
2377
+ /**
2378
+ * Transient request to interrupt a running agent's current turn, published by the controlling client and fanned out to agent subscribers. Delivery is best-effort with no replay buffer: a watcher subscribed to the matching tab sends an interrupt (ESC) to the agent's PTY. Unlike AgentDecision/AgentAnswer it is not required to carry a requestId.
2379
+ *
2380
+ * This interface was referenced by `Constants`'s JSON-Schema
2381
+ * via the `definition` "AgentInterrupt".
2382
+ */
2383
+ export interface AgentInterrupt {
2384
+ agent: string;
2385
+ worktreeId: string;
2386
+ tabId: string;
2387
+ /**
2388
+ * Optional correlation id when the interrupt targets a specific outstanding request.
2389
+ */
2390
+ requestId?: string;
2391
+ }
2392
+ /**
2393
+ * Mirror of the desktop app's entire workspace state (all projects, worktrees, and tabs), published to pragma-server so remote clients (e.g. a paired phone) can render the session launcher without registering as the controller. The desktop publishes the full snapshot on every mutation; v1 keeps deltas trivial (every delta is a full replacement).
2394
+ *
2395
+ * This interface was referenced by `Constants`'s JSON-Schema
2396
+ * via the `definition` "WorkspaceSnapshot".
2397
+ */
2398
+ export interface WorkspaceSnapshot {
2399
+ projects: Project[];
2400
+ worktrees: Worktree[];
2401
+ tabs: Tab[];
2402
+ }
2403
+ /**
2404
+ * This interface was referenced by `Constants`'s JSON-Schema
2405
+ * via the `definition` "Tab".
2406
+ */
2407
+ export interface Tab {
2408
+ id: string;
2409
+ projectId: string;
2410
+ worktreeId: string;
2411
+ kind: TabKind;
2412
+ title: string | null;
2413
+ /**
2414
+ * The current page URL for browser tabs; null for terminal tabs.
2415
+ */
2416
+ url: string | null;
2417
+ /**
2418
+ * Worktree-relative path for editor/diff tabs; null for terminal/browser tabs.
2419
+ */
2420
+ filePath: string | null;
2421
+ /**
2422
+ * Durable whiteboard id for whiteboard tabs; null for every other tab kind.
2423
+ */
2424
+ whiteboardId: string | null;
2425
+ /**
2426
+ * Which diff side a diff tab shows; null for non-diff tabs.
2427
+ */
2428
+ diffSide: DiffSide | null;
2429
+ /**
2430
+ * Commit hash a commit-scoped diff tab shows (first parent → commit); null for range diffs and non-diff tabs.
2431
+ */
2432
+ diffCommit: string | null;
2433
+ /**
2434
+ * Pull-request number a pr-review tab reviews; null for non-PR tabs.
2435
+ */
2436
+ prNumber: number | null;
2437
+ /**
2438
+ * Owning plugin id for plugin-webview tabs; null for non-plugin tabs.
2439
+ */
2440
+ pluginId: string | null;
2441
+ /**
2442
+ * Plugin-defined web view id for plugin-webview tabs; null for non-plugin tabs.
2443
+ */
2444
+ pluginViewId: string | null;
2445
+ /**
2446
+ * JSON-encoded payload supplied when opening a plugin-webview tab; null when omitted or for non-plugin tabs.
2447
+ */
2448
+ pluginPayload: string | null;
2449
+ /**
2450
+ * Optional dedupe key used to focus an existing plugin-webview tab instead of opening another.
2451
+ */
2452
+ pluginDedupeKey: string | null;
2453
+ /**
2454
+ * Catalog id of the agent launched into this terminal tab, set at launch time. Drives the tab's agent icon and default title; null for tabs without an agent.
2455
+ */
2456
+ agentId: string | null;
2457
+ /**
2458
+ * True once the user has manually renamed a terminal tab via double-click/context menu. Shell-emitted title updates (OSC 0/2) and agent session-name renames are ignored while this is true. Always false for non-terminal tabs.
2459
+ */
2460
+ userRenamed: boolean;
2461
+ /**
2462
+ * Fanout this terminal tab is an attempt of. Optional rather than nullable: absent on every tab that is not a fanout attempt.
2463
+ */
2464
+ fanoutId?: string | null;
2465
+ /**
2466
+ * Fanout member this terminal tab runs. Always set together with `fanoutId`.
2467
+ */
2468
+ fanoutMemberId?: string | null;
2469
+ /**
2470
+ * Shell profile this terminal tab was opened with, so a session respawned after a daemon restart returns to the same shell instead of the current default. Optional rather than nullable: absent on every tab created before shell selection existed, and on non-terminal tabs.
2471
+ */
2472
+ shell?: ShellProfile | null;
2473
+ orderIndex: number;
2474
+ createdAt: string;
2475
+ }
2476
+ /**
2477
+ * Payload for the brokered `agentSessionLaunch` control method. The desktop creates or resolves the target worktree + tab, replies with `{ worktreeId, tabId }` immediately, then asynchronously spawns the agent + watcher through the proven Kanban background-launch sequence. Either an existing `worktreeId` or a `newWorktree` spec must be provided.
2478
+ *
2479
+ * This interface was referenced by `Constants`'s JSON-Schema
2480
+ * via the `definition` "AgentSessionLaunchPayload".
2481
+ */
2482
+ export interface AgentSessionLaunchPayload {
2483
+ projectId: string;
2484
+ /**
2485
+ * Id of an existing worktree to launch into. Mutually exclusive with `newWorktree`.
2486
+ */
2487
+ worktreeId: string | null;
2488
+ /**
2489
+ * Describes a fresh worktree to create when `worktreeId` is absent. Mutually exclusive with `worktreeId`.
2490
+ */
2491
+ newWorktree: NewWorktreeSpec | null;
2492
+ agentId: string;
2493
+ modelId?: string | null;
2494
+ reasoningId?: string | null;
2495
+ /**
2496
+ * Raw shell snippet appended to the agent's base launch command instead of catalog model/reasoning args (for example `--model moonshot/kimi-k3`). Overrides `modelId`/`reasoningId` when set.
2497
+ */
2498
+ modelCmd?: string | null;
2499
+ prompt?: string | null;
2500
+ /**
2501
+ * When true, the host server launches the session itself (PTY + watcher, no desktop tab) even while a desktop controller is connected. Used by `pragma-cli agent verify` so scenario sessions do not open a desktop tab per step.
2502
+ */
2503
+ headless?: boolean | null;
2504
+ }
2505
+ /**
2506
+ * Spec for creating a fresh worktree as part of an `agentSessionLaunch` request. Omitted/optional fields fall back to Pragma defaults.
2507
+ *
2508
+ * This interface was referenced by `Constants`'s JSON-Schema
2509
+ * via the `definition` "NewWorktreeSpec".
2510
+ */
2511
+ export interface NewWorktreeSpec {
2512
+ parentWorktreeId: string;
2513
+ branch: string;
2514
+ title?: string | null;
2515
+ }
2516
+ /**
2517
+ * A single entry in a worktree directory listing.
2518
+ *
2519
+ * This interface was referenced by `Constants`'s JSON-Schema
2520
+ * via the `definition` "DirEntry".
2521
+ */
2522
+ export interface DirEntry {
2523
+ /**
2524
+ * The entry's file name (no directory part).
2525
+ */
2526
+ name: string;
2527
+ /**
2528
+ * Worktree-relative POSIX path (forward slashes) to the entry.
2529
+ */
2530
+ path: string;
2531
+ isDir: boolean;
2532
+ }
2533
+ /**
2534
+ * This interface was referenced by `Constants`'s JSON-Schema
2535
+ * via the `definition` "ChangedFile".
2536
+ */
2537
+ export interface ChangedFile {
2538
+ /**
2539
+ * Worktree-relative POSIX path of the changed file.
2540
+ */
2541
+ path: string;
2542
+ /**
2543
+ * Previous path for a rename; null otherwise.
2544
+ */
2545
+ oldPath: string | null;
2546
+ status: ChangeStatus;
2547
+ side: DiffSide;
2548
+ /**
2549
+ * Lines added in this file's diff on its side. Null for binary files (git reports -/-) and for untracked files whose on-disk line count could not be determined.
2550
+ */
2551
+ additions: number | null;
2552
+ /**
2553
+ * Lines removed in this file's diff on its side. Null for binary files and for untracked files. 0 for untracked files (a brand-new file has nothing to remove).
2554
+ */
2555
+ deletions: number | null;
2556
+ }
2557
+ /**
2558
+ * This interface was referenced by `Constants`'s JSON-Schema
2559
+ * via the `definition` "WorktreeChanges".
2560
+ */
2561
+ export interface WorktreeChanges {
2562
+ committed: ChangedFile[];
2563
+ staged: ChangedFile[];
2564
+ unstaged: ChangedFile[];
2565
+ }
2566
+ /**
2567
+ * One commit on a worktree's branch since its fork point with the parent branch, with the files it changed.
2568
+ *
2569
+ * This interface was referenced by `Constants`'s JSON-Schema
2570
+ * via the `definition` "WorktreeCommit".
2571
+ */
2572
+ export interface WorktreeCommit {
2573
+ /**
2574
+ * The full commit hash.
2575
+ */
2576
+ hash: string;
2577
+ /**
2578
+ * The abbreviated commit hash.
2579
+ */
2580
+ shortHash: string;
2581
+ /**
2582
+ * The commit subject (first message line).
2583
+ */
2584
+ subject: string;
2585
+ /**
2586
+ * The author name followed by any Co-authored-by trailer names, deduplicated.
2587
+ */
2588
+ authors: string[];
2589
+ /**
2590
+ * Files this commit changed relative to its first parent.
2591
+ */
2592
+ files: ChangedFile[];
2593
+ }
2594
+ /**
2595
+ * A page of a worktree's commits since its fork point, newest first.
2596
+ *
2597
+ * This interface was referenced by `Constants`'s JSON-Schema
2598
+ * via the `definition` "WorktreeCommitList".
2599
+ */
2600
+ export interface WorktreeCommitList {
2601
+ commits: WorktreeCommit[];
2602
+ /**
2603
+ * Total commits in the fork-point range, independent of the requested page size.
2604
+ */
2605
+ totalCount: number;
2606
+ }
2607
+ /**
2608
+ * This interface was referenced by `Constants`'s JSON-Schema
2609
+ * via the `definition` "FileDiff".
2610
+ */
2611
+ export interface FileDiff {
2612
+ path: string;
2613
+ /**
2614
+ * The base-side text; empty when the file was added or is binary.
2615
+ */
2616
+ oldText: string;
2617
+ /**
2618
+ * The new-side text; empty when the file was deleted or is binary.
2619
+ */
2620
+ newText: string;
2621
+ /**
2622
+ * True when git reports the file as binary; old/new text are empty.
2623
+ */
2624
+ binary: boolean;
2625
+ }
2626
+ /**
2627
+ * A single filesystem change delivered over a `fileChanged` subscription by the pragma-server worktree watcher. Drives live file previews on the client.
2628
+ *
2629
+ * This interface was referenced by `Constants`'s JSON-Schema
2630
+ * via the `definition` "FileChange".
2631
+ */
2632
+ export interface FileChange {
2633
+ /**
2634
+ * Worktree-relative POSIX path (forward slashes) of the changed entry.
2635
+ */
2636
+ path: string;
2637
+ kind: FileChangeKind;
2638
+ }
2639
+ /**
2640
+ * One base64-encoded slice of a binary file, returned by a chunked read.
2641
+ *
2642
+ * This interface was referenced by `Constants`'s JSON-Schema
2643
+ * via the `definition` "FileChunk".
2644
+ */
2645
+ export interface FileChunk {
2646
+ /**
2647
+ * The slice's bytes, base64-encoded. Empty once the offset is at or past the end of the file.
2648
+ */
2649
+ base64: string;
2650
+ /**
2651
+ * Byte offset the slice was read from.
2652
+ */
2653
+ offset: number;
2654
+ /**
2655
+ * Total on-disk size of the file in bytes, so a caller can size its buffer from the first chunk.
2656
+ */
2657
+ byteSize: number;
2658
+ /**
2659
+ * True when this slice reaches the end of the file and no further request is needed.
2660
+ */
2661
+ eof: boolean;
2662
+ }
2663
+ /**
2664
+ * This interface was referenced by `Constants`'s JSON-Schema
2665
+ * via the `definition` "FileContents".
2666
+ */
2667
+ export interface FileContents {
2668
+ path: string;
2669
+ /**
2670
+ * The decoded UTF-8 text; empty when binary or truncated.
2671
+ */
2672
+ text: string;
2673
+ /**
2674
+ * True when the bytes are not valid UTF-8.
2675
+ */
2676
+ binary: boolean;
2677
+ /**
2678
+ * True when the file exceeds the read cap and was not read.
2679
+ */
2680
+ truncated: boolean;
2681
+ /**
2682
+ * On-disk size in bytes from the file metadata.
2683
+ */
2684
+ byteSize: number;
2685
+ }
2686
+ /**
2687
+ * One host-owned command-palette filename or literal code match.
2688
+ *
2689
+ * This interface was referenced by `Constants`'s JSON-Schema
2690
+ * via the `definition` "PaletteSearchMatch".
2691
+ */
2692
+ export interface PaletteSearchMatch {
2693
+ worktreeId: string;
2694
+ /**
2695
+ * Worktree-relative POSIX path.
2696
+ */
2697
+ path: string;
2698
+ kind: "file" | "code";
2699
+ score: number;
2700
+ line?: number | null;
2701
+ column?: number | null;
2702
+ snippet?: string | null;
2703
+ }
2704
+ /**
2705
+ * Bounded host search results for visible worktrees in one project.
2706
+ *
2707
+ * This interface was referenced by `Constants`'s JSON-Schema
2708
+ * via the `definition` "PaletteSearchResponse".
2709
+ */
2710
+ export interface PaletteSearchResponse {
2711
+ matches: PaletteSearchMatch[];
2712
+ truncated: boolean;
2713
+ }
2714
+ /**
2715
+ * This interface was referenced by `Constants`'s JSON-Schema
2716
+ * via the `definition` "ProjectIcon".
2717
+ */
2718
+ export interface ProjectIcon {
2719
+ mime: string;
2720
+ dataBase64: string;
2721
+ }
2722
+ /**
2723
+ * Status of a worktree's working copy, used to warn the user before destructive operations.
2724
+ *
2725
+ * This interface was referenced by `Constants`'s JSON-Schema
2726
+ * via the `definition` "WorktreeStatus".
2727
+ */
2728
+ export interface WorktreeStatus {
2729
+ /**
2730
+ * True when the worktree has uncommitted changes, staged changes, or untracked files that `git status` would surface.
2731
+ */
2732
+ dirty: boolean;
2733
+ }
2734
+ /**
2735
+ * A persisted prompt card on a project's Kanban board, scoped by projectId.
2736
+ *
2737
+ * This interface was referenced by `Constants`'s JSON-Schema
2738
+ * via the `definition` "KanbanPromptCard".
2739
+ */
2740
+ export interface KanbanPromptCard {
2741
+ id: string;
2742
+ projectId: string;
2743
+ /**
2744
+ * The worktree backing this card once it starts running; null for a draft.
2745
+ */
2746
+ worktreeId?: string | null;
2747
+ /**
2748
+ * Branch the card targets — an existing project worktree branch or a new one to create.
2749
+ */
2750
+ branchName: string;
2751
+ prompt: string;
2752
+ agentId: string;
2753
+ /**
2754
+ * Selected model id for the agent launch; null uses the agent default.
2755
+ */
2756
+ modelId?: string | null;
2757
+ /**
2758
+ * Selected reasoning level id for the agent launch; null uses automatic reasoning.
2759
+ */
2760
+ reasoningId?: string | null;
2761
+ status: KanbanPromptStatus;
2762
+ /**
2763
+ * Terminal tab/daemon session id the agent runs in once started; null before launch.
2764
+ */
2765
+ agentTabId?: string | null;
2766
+ /**
2767
+ * Which completion path finished the card; null until completed.
2768
+ */
2769
+ completedAction?: KanbanCompletedAction | null;
2770
+ /**
2771
+ * URL of the pull request opened during completion, when applicable.
2772
+ */
2773
+ pullRequestUrl?: string | null;
2774
+ /**
2775
+ * Number of the pull request opened during completion, when applicable.
2776
+ */
2777
+ pullRequestNumber?: number | null;
2778
+ schedulingMode: KanbanSchedulingMode;
2779
+ /**
2780
+ * Reserved for scheduled runs; always null in the manual MVP.
2781
+ */
2782
+ scheduledFor?: string | null;
2783
+ createdAt: string;
2784
+ updatedAt: string;
2785
+ /**
2786
+ * When the card first moved to inProgress; null before launch.
2787
+ */
2788
+ startedAt?: string | null;
2789
+ /**
2790
+ * When the card moved to completed; null until completed.
2791
+ */
2792
+ completedAt?: string | null;
2793
+ }
2794
+ /**
2795
+ * Payload for creating an agent-board draft through the brokered desktop controller.
2796
+ *
2797
+ * This interface was referenced by `Constants`'s JSON-Schema
2798
+ * via the `definition` "BoardDraftCreatePayload".
2799
+ */
2800
+ export interface BoardDraftCreatePayload {
2801
+ prompt: string;
2802
+ /**
2803
+ * Existing worktree whose project and branch receive the draft.
2804
+ */
2805
+ worktreeId: string;
2806
+ agentId: string;
2807
+ modelId?: string | null;
2808
+ reasoningId?: string | null;
2809
+ }
2810
+ /**
2811
+ * This interface was referenced by `Constants`'s JSON-Schema
2812
+ * via the `definition` "KeybindingChord".
2813
+ */
2814
+ export interface KeybindingChord {
2815
+ modifiers: ("cmd" | "ctrl" | "alt" | "shift")[];
2816
+ key: string;
2817
+ }
2818
+ /**
2819
+ * This interface was referenced by `Constants`'s JSON-Schema
2820
+ * via the `definition` "PlatformChord".
2821
+ */
2822
+ export interface PlatformChord {
2823
+ mac: KeybindingChord;
2824
+ linux: KeybindingChord;
2825
+ }
2826
+ /**
2827
+ * This interface was referenced by `Constants`'s JSON-Schema
2828
+ * via the `definition` "Keybindings".
2829
+ */
2830
+ export interface Keybindings {
2831
+ nextTab: PlatformChord;
2832
+ previousTab: PlatformChord;
2833
+ closeTopTab: PlatformChord;
2834
+ newTerminalTab: PlatformChord;
2835
+ newBrowserTab: PlatformChord;
2836
+ newWhiteboard: PlatformChord;
2837
+ clearTerminal: PlatformChord;
2838
+ browserReload: PlatformChord;
2839
+ browserDevtools: PlatformChord;
2840
+ browserCopyUrl: PlatformChord;
2841
+ splitHorizontal: PlatformChord;
2842
+ splitVertical: PlatformChord;
2843
+ deleteFile: PlatformChord;
2844
+ scrollTerminalBottom: PlatformChord;
2845
+ openCommandPalette: PlatformChord;
2846
+ openCommandMode: PlatformChord;
2847
+ openSettings: PlatformChord;
2848
+ switchToWorkspace1: PlatformChord;
2849
+ switchToWorkspace2: PlatformChord;
2850
+ switchToWorkspace3: PlatformChord;
2851
+ switchToWorkspace4: PlatformChord;
2852
+ switchToWorkspace5: PlatformChord;
2853
+ switchToWorkspace6: PlatformChord;
2854
+ switchToWorkspace7: PlatformChord;
2855
+ switchToWorkspace8: PlatformChord;
2856
+ switchToWorkspace9: PlatformChord;
2857
+ switchToWorktree1: PlatformChord;
2858
+ switchToWorktree2: PlatformChord;
2859
+ switchToWorktree3: PlatformChord;
2860
+ switchToWorktree4: PlatformChord;
2861
+ switchToWorktree5: PlatformChord;
2862
+ switchToWorktree6: PlatformChord;
2863
+ switchToWorktree7: PlatformChord;
2864
+ switchToWorktree8: PlatformChord;
2865
+ switchToWorktree9: PlatformChord;
2866
+ switchToTab1: PlatformChord;
2867
+ switchToTab2: PlatformChord;
2868
+ switchToTab3: PlatformChord;
2869
+ switchToTab4: PlatformChord;
2870
+ switchToTab5: PlatformChord;
2871
+ switchToTab6: PlatformChord;
2872
+ switchToTab7: PlatformChord;
2873
+ switchToTab8: PlatformChord;
2874
+ switchToTab9: PlatformChord;
2875
+ }
2876
+ /**
2877
+ * This interface was referenced by `Constants`'s JSON-Schema
2878
+ * via the `definition` "KeybindingsConfig".
2879
+ */
2880
+ export interface KeybindingsConfig {
2881
+ version: number;
2882
+ bindings: Keybindings;
2883
+ }