@corenel/harness 0.2.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/dist/acp/agentMap.d.ts +34 -0
  2. package/dist/acp/agentMap.d.ts.map +1 -0
  3. package/dist/acp/agentMap.js +110 -0
  4. package/dist/acp/agentMap.js.map +1 -0
  5. package/dist/acp/index.d.ts +4 -0
  6. package/dist/acp/index.d.ts.map +1 -0
  7. package/dist/acp/index.js +6 -0
  8. package/dist/acp/index.js.map +1 -0
  9. package/dist/acp/policyMap.d.ts +55 -0
  10. package/dist/acp/policyMap.d.ts.map +1 -0
  11. package/dist/acp/policyMap.js +121 -0
  12. package/dist/acp/policyMap.js.map +1 -0
  13. package/dist/acp/types.d.ts +41 -0
  14. package/dist/acp/types.d.ts.map +1 -0
  15. package/dist/acp/types.js +14 -0
  16. package/dist/acp/types.js.map +1 -0
  17. package/dist/api/backend.d.ts +39 -0
  18. package/dist/api/backend.d.ts.map +1 -0
  19. package/dist/api/backend.js +126 -0
  20. package/dist/api/backend.js.map +1 -0
  21. package/dist/api/client.d.ts +95 -0
  22. package/dist/api/client.d.ts.map +1 -0
  23. package/dist/api/client.js +212 -0
  24. package/dist/api/client.js.map +1 -0
  25. package/dist/api/fileMirrorSource.d.ts +24 -0
  26. package/dist/api/fileMirrorSource.d.ts.map +1 -0
  27. package/dist/api/fileMirrorSource.js +59 -0
  28. package/dist/api/fileMirrorSource.js.map +1 -0
  29. package/dist/api/mirror.d.ts +102 -0
  30. package/dist/api/mirror.d.ts.map +1 -0
  31. package/dist/api/mirror.js +204 -0
  32. package/dist/api/mirror.js.map +1 -0
  33. package/dist/api/mirrorScheduler.d.ts +56 -0
  34. package/dist/api/mirrorScheduler.d.ts.map +1 -0
  35. package/dist/api/mirrorScheduler.js +167 -0
  36. package/dist/api/mirrorScheduler.js.map +1 -0
  37. package/dist/core/loop.d.ts +2 -0
  38. package/dist/core/loop.d.ts.map +1 -1
  39. package/dist/core/loop.js +1 -0
  40. package/dist/core/loop.js.map +1 -1
  41. package/dist/install/lockfile.d.ts +79 -0
  42. package/dist/install/lockfile.d.ts.map +1 -0
  43. package/dist/install/lockfile.js +155 -0
  44. package/dist/install/lockfile.js.map +1 -0
  45. package/dist/install/store.d.ts +13 -0
  46. package/dist/install/store.d.ts.map +1 -0
  47. package/dist/install/store.js +38 -0
  48. package/dist/install/store.js.map +1 -0
  49. package/dist/log.d.ts.map +1 -1
  50. package/dist/log.js +6 -1
  51. package/dist/log.js.map +1 -1
  52. package/dist/prompts/host.d.ts +4 -0
  53. package/dist/prompts/host.d.ts.map +1 -1
  54. package/dist/prompts/host.js.map +1 -1
  55. package/dist/prompts/index.d.ts.map +1 -1
  56. package/dist/prompts/index.js +4 -0
  57. package/dist/prompts/index.js.map +1 -1
  58. package/dist/prompts/library/defaults.generated.js +1 -1
  59. package/dist/prompts/library/defaults.generated.js.map +1 -1
  60. package/dist/providers/gateway.d.ts +3 -0
  61. package/dist/providers/gateway.d.ts.map +1 -1
  62. package/dist/providers/gateway.js +3 -0
  63. package/dist/providers/gateway.js.map +1 -1
  64. package/dist/sessions/apiLeaseStore.d.ts +10 -0
  65. package/dist/sessions/apiLeaseStore.d.ts.map +1 -0
  66. package/dist/sessions/apiLeaseStore.js +41 -0
  67. package/dist/sessions/apiLeaseStore.js.map +1 -0
  68. package/dist/sessions/head.d.ts +90 -0
  69. package/dist/sessions/head.d.ts.map +1 -0
  70. package/dist/sessions/head.js +82 -0
  71. package/dist/sessions/head.js.map +1 -0
  72. package/dist/sessions/inflight.d.ts +58 -0
  73. package/dist/sessions/inflight.d.ts.map +1 -0
  74. package/dist/sessions/inflight.js +0 -0
  75. package/dist/sessions/inflight.js.map +1 -0
  76. package/dist/sessions/lease.d.ts +59 -0
  77. package/dist/sessions/lease.d.ts.map +1 -0
  78. package/dist/sessions/lease.js +115 -0
  79. package/dist/sessions/lease.js.map +1 -0
  80. package/dist/sessions/leaseStore.d.ts +46 -0
  81. package/dist/sessions/leaseStore.d.ts.map +1 -0
  82. package/dist/sessions/leaseStore.js +58 -0
  83. package/dist/sessions/leaseStore.js.map +1 -0
  84. package/dist/sessions/timeline.d.ts +134 -0
  85. package/dist/sessions/timeline.d.ts.map +1 -0
  86. package/dist/sessions/timeline.js +127 -0
  87. package/dist/sessions/timeline.js.map +1 -0
  88. package/dist/sidecar/host.d.ts +223 -3
  89. package/dist/sidecar/host.d.ts.map +1 -1
  90. package/dist/sidecar/host.js +592 -2
  91. package/dist/sidecar/host.js.map +1 -1
  92. package/dist/sidecar/server.d.ts +124 -2
  93. package/dist/sidecar/server.d.ts.map +1 -1
  94. package/dist/sidecar/server.js +608 -9
  95. package/dist/sidecar/server.js.map +1 -1
  96. package/dist/snapshot/effects.d.ts +69 -0
  97. package/dist/snapshot/effects.d.ts.map +1 -0
  98. package/dist/snapshot/effects.js +67 -0
  99. package/dist/snapshot/effects.js.map +1 -0
  100. package/dist/snapshot/manifest.d.ts +73 -0
  101. package/dist/snapshot/manifest.d.ts.map +1 -0
  102. package/dist/snapshot/manifest.js +141 -0
  103. package/dist/snapshot/manifest.js.map +1 -0
  104. package/dist/snapshot/tree.d.ts +62 -0
  105. package/dist/snapshot/tree.d.ts.map +1 -0
  106. package/dist/snapshot/tree.js +147 -0
  107. package/dist/snapshot/tree.js.map +1 -0
  108. package/dist/tools/builtins.d.ts.map +1 -1
  109. package/dist/tools/builtins.js +61 -2
  110. package/dist/tools/builtins.js.map +1 -1
  111. package/dist/tools/namespaces.d.ts +1 -1
  112. package/dist/tools/namespaces.d.ts.map +1 -1
  113. package/dist/tools/namespaces.js +24 -0
  114. package/dist/tools/namespaces.js.map +1 -1
  115. package/dist/tools/todo.d.ts.map +1 -1
  116. package/dist/tools/todo.js +12 -0
  117. package/dist/tools/todo.js.map +1 -1
  118. package/package.json +6 -2
@@ -0,0 +1,127 @@
1
+ export const TOOL_STATUSES = ['executing', 'completed', 'failed', 'refused', 'unknown'];
2
+ /** The `k` these lines carry in SESSION.jsonl. Distinct from 'meta'/'turn' so the
3
+ * chat fold and this one can share a file and ignore each other. */
4
+ export const TIMELINE_KIND = 'tl';
5
+ export function encodeEntry(entry) {
6
+ return JSON.stringify({ k: TIMELINE_KIND, e: entry }) + '\n';
7
+ }
8
+ /** Payloads at or under this go inline; larger ones become a blob ref. Keeps a
9
+ * line bounded and the file readable (spec s4.3.1, decision 6). */
10
+ export const INLINE_LIMIT_BYTES = 4096;
11
+ /**
12
+ * Decide where a tool result lives.
13
+ *
14
+ * Measured in UTF-8 bytes, not characters: a 3000-character CJK result is ~9 KB
15
+ * on disk, and a limit that counts characters would quietly blow the bound it
16
+ * exists to hold.
17
+ */
18
+ export function fitsInline(text, limit = INLINE_LIMIT_BYTES) {
19
+ return utf8Bytes(text) <= limit;
20
+ }
21
+ function utf8Bytes(s) {
22
+ // TextEncoder is present in node >= 11 and every browser we target; the manual
23
+ // fallback keeps this module usable in a bare test environment.
24
+ if (typeof TextEncoder !== 'undefined')
25
+ return new TextEncoder().encode(s).length;
26
+ let n = 0;
27
+ for (const ch of s) {
28
+ const c = ch.codePointAt(0) ?? 0;
29
+ n += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;
30
+ }
31
+ return n;
32
+ }
33
+ /** A tool call carrying its result in the right place. Throws rather than
34
+ * silently storing both, because "exactly one is non-null" is the invariant every
35
+ * reader depends on. */
36
+ export function withResult(entry, result) {
37
+ if ('inline' in result && 'ref' in result)
38
+ throw new Error('a tool result is inline or a ref, never both');
39
+ return 'inline' in result
40
+ ? { ...entry, resultInline: result.inline, resultRef: null }
41
+ : { ...entry, resultRef: result.ref, resultInline: null };
42
+ }
43
+ /**
44
+ * Fold a SESSION.jsonl text into the timeline.
45
+ *
46
+ * Unparseable lines are skipped, exactly as the chat fold does, so a crash
47
+ * mid-append costs the final line and nothing else. Later lines at the same index
48
+ * supersede earlier ones, which is how a tool call moves
49
+ * executing -> completed without ever editing a byte.
50
+ *
51
+ * Compaction is applied on READ: entries covered by a `summary` are dropped from
52
+ * the result, while their indices stay reserved. The raw span is still in the
53
+ * file and still in the blob store, so nothing is lost — the fold just stops
54
+ * handing it to the model.
55
+ */
56
+ export function foldTimeline(text) {
57
+ const byIndex = new Map();
58
+ let highest = -1;
59
+ for (const raw of text.split('\n')) {
60
+ const s = raw.trim();
61
+ if (!s)
62
+ continue;
63
+ let line;
64
+ try {
65
+ line = JSON.parse(s);
66
+ }
67
+ catch {
68
+ continue;
69
+ }
70
+ if (line.k !== TIMELINE_KIND)
71
+ continue;
72
+ const e = line.e;
73
+ if (!e || typeof e !== 'object')
74
+ continue;
75
+ if (!Number.isInteger(e.index) || e.index < 0 || typeof e.type !== 'string')
76
+ continue;
77
+ byIndex.set(e.index, e);
78
+ if (e.index > highest)
79
+ highest = e.index;
80
+ }
81
+ // Compaction is applied last, so a summary can supersede entries that were
82
+ // themselves superseded earlier in the file.
83
+ const covered = new Set();
84
+ for (const e of byIndex.values()) {
85
+ if (e.type !== 'summary')
86
+ continue;
87
+ const { from, to } = e.replaces;
88
+ if (!Number.isInteger(from) || !Number.isInteger(to) || to < from)
89
+ continue;
90
+ for (let i = from; i <= to; i++)
91
+ if (i !== e.index)
92
+ covered.add(i);
93
+ }
94
+ const entries = [...byIndex.entries()]
95
+ .filter(([i]) => !covered.has(i))
96
+ .sort((a, b) => a[0] - b[0])
97
+ .map(([, e]) => e);
98
+ return { entries, nextIndex: highest + 1 };
99
+ }
100
+ /**
101
+ * Build the summary entry that compacts a span.
102
+ *
103
+ * Refuses to swallow a `tool_call`: those carry replay semantics (s4.4), and a
104
+ * compaction that dropped one would make resume unable to tell whether the call
105
+ * ran. Summarizing prose is a size optimization; summarizing away a side effect
106
+ * is data loss.
107
+ */
108
+ export function compactSpan(input) {
109
+ const swallowed = input.entries.filter((e) => e.index >= input.from && e.index <= input.to && e.type === 'tool_call');
110
+ if (swallowed.length) {
111
+ throw new Error(`compaction would drop ${swallowed.length} tool_call entr${swallowed.length === 1 ? 'y' : 'ies'}; they carry replay semantics`);
112
+ }
113
+ if (input.index <= input.to) {
114
+ // The summary must sit after the span it replaces, or the fold would see it
115
+ // covering itself and the indices would stop being monotonic.
116
+ throw new Error('a summary must take an index after the span it replaces');
117
+ }
118
+ return {
119
+ index: input.index,
120
+ at: input.at,
121
+ type: 'summary',
122
+ replaces: { from: input.from, to: input.to },
123
+ spanRef: input.spanRef,
124
+ content: input.content,
125
+ };
126
+ }
127
+ //# sourceMappingURL=timeline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeline.js","sourceRoot":"","sources":["../../sessions/timeline.ts"],"names":[],"mappings":"AAyCA,MAAM,CAAC,MAAM,aAAa,GAA0B,CAAC,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;AAmC/G;oEACoE;AACpE,MAAM,CAAC,MAAM,aAAa,GAAG,IAAa,CAAC;AAI3C,MAAM,UAAU,WAAW,CAAC,KAAoB;IAC9C,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;AAC/D,CAAC;AAED;mEACmE;AACnE,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAEvC;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,KAAK,GAAG,kBAAkB;IACjE,OAAO,SAAS,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC;AAClC,CAAC;AAED,SAAS,SAAS,CAAC,CAAS;IAC1B,+EAA+E;IAC/E,gEAAgE;IAChE,IAAI,OAAO,WAAW,KAAK,WAAW;QAAE,OAAO,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IAClF,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,KAAK,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC;QACnB,MAAM,CAAC,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O,EAAE,KAAK,CAAC,OAAO;KACvB,CAAC;AACJ,CAAC"}
@@ -1,6 +1,6 @@
1
- import type { AgentTool, IMemoryProvider, IKeyValueStore, ISearchProvider, ISessionStore, PermissionRequest, AskQuestion, AskAnswers, AgentEvent, PermissionDecision } from '@corenel/protocol';
1
+ import type { AgentTool, IMemoryProvider, IKeyValueStore, ISearchProvider, ISessionStore, PermissionRequest, AskQuestion, AskAnswers, AgentEvent, PermissionDecision, DaemonRunActivity, DaemonRegistration, ProcInfo, RunRecordInfo, SessionInfo, SessionRepoSpec, SessionSnapshotInfo } from '@corenel/protocol';
2
2
  import type { FileService } from '@corenel/protocol';
3
- import { type SidecarChannel, type SidecarInfo } from '@corenel/protocol';
3
+ import { type SidecarChannel, type SidecarInfo, type AcpPromptPart, type AcpModeInfo, type AcpStartOptions } from '@corenel/protocol';
4
4
  /** The host's live capabilities a connected sidecar may proxy into. Only the ones
5
5
  * provided are reachable; a proxy call to a missing one is rejected. */
6
6
  export interface HostProviders {
@@ -23,6 +23,13 @@ export interface SidecarHostOptions {
23
23
  /** The host's dot-dir name (e.g. '.corenel', '.prompd'), sent informationally in
24
24
  * `hello` so the sidecar knows it for future workspace-state features. */
25
25
  stateDir?: string;
26
+ /** The sidecar's working-directory set changed (a client added one). Carries the
27
+ * COMPLETE set, which REPLACES what the host holds -- never append. Fires on any
28
+ * connected client's add, not just this one's, so two browsers stay in agreement. */
29
+ onRoots?: (s: {
30
+ root: string;
31
+ roots: string[];
32
+ }) => void;
26
33
  /** This client's durable identity, sent in `hello` so the sidecar can record
27
34
  * who connected (routing Slice-2 sync). Additive: omitting them just means the
28
35
  * sidecar records no host entry for this connection. */
@@ -54,6 +61,35 @@ export interface SidecarHostOptions {
54
61
  decision: PermissionDecision;
55
62
  by: 'client' | 'timeout' | 'unattended';
56
63
  }) => void;
64
+ /** A daemon-side run started (no `endedAt`) or settled. Broadcast to every
65
+ * connected client, like a permission ask: a trigger-fired run has nobody
66
+ * watching, so this is the ONLY way a browser learns it happened. */
67
+ onRunActivity?: (activity: DaemonRunActivity) => void;
68
+ /** The COMPLETE set of agents the daemon will fire. Replaces the receiver's
69
+ * previous set - never merge, or an agent deleted on the daemon would live
70
+ * forever in a client that was connected when it went. */
71
+ onRegistrations?: (list: DaemonRegistration[]) => void;
72
+ }
73
+ /** What a caller wants to hear about one process. Both handlers are optional:
74
+ * a client that only wants to know when a build finishes should not have to
75
+ * accept its output. */
76
+ /** What a caller wants to hear about one session. Both optional: a client that
77
+ * only wants metrics should not have to accept logs. */
78
+ export interface SessionWatcher {
79
+ onMetrics?: (sample: unknown) => void;
80
+ onLog?: (line: string) => void;
81
+ }
82
+ export interface ProcWatcher {
83
+ onOut?: (chunk: {
84
+ seq: number;
85
+ stream: 'out' | 'err';
86
+ text: string;
87
+ }) => void;
88
+ /** Fires exactly once, then the watcher is dropped. */
89
+ onExit?: (end: {
90
+ code: number | null;
91
+ signal?: string;
92
+ }) => void;
57
93
  }
58
94
  export declare class SidecarHost {
59
95
  private readonly ch;
@@ -64,8 +100,23 @@ export declare class SidecarHost {
64
100
  private readonly httpPending;
65
101
  private runSeq;
66
102
  private readonly runPending;
103
+ private acpSeq;
104
+ private readonly acpPending;
67
105
  private syncSeq;
68
106
  private readonly syncPending;
107
+ private rootsSeq;
108
+ private readonly rootsPending;
109
+ private procSeq;
110
+ private readonly procPending;
111
+ /** Watchers by procId, NOT by request id: a process outlives the request that
112
+ * spawned it, and the same process can be watched by a spawn and later by a
113
+ * reattach. Keyed by the only durable identity there is. */
114
+ private readonly procWatchers;
115
+ private sessionSeq;
116
+ private readonly sessionPending;
117
+ /** Per-session stream handlers, keyed by session because a session outlives
118
+ * the request that started watching it. */
119
+ private readonly sessionWatchers;
69
120
  private features;
70
121
  private info;
71
122
  private readonly imported;
@@ -79,10 +130,138 @@ export declare class SidecarHost {
79
130
  private onMessage;
80
131
  /** Whether the connected sidecar advertised the loopback HTTP proxy. */
81
132
  supportsHttpProxy(): boolean;
133
+ /** Everything the sidecar advertised. A copy — the internal list must not be
134
+ * mutable from outside. For surfaces that SHOW capabilities; code that DEPENDS
135
+ * on one should use the specific supportsX() so the feature name lives here. */
136
+ advertisedFeatures(): string[];
82
137
  /** Whether the connected sidecar advertised a wired crew runner — i.e. it can
83
138
  * actually fire daemon-tier triggers (schedule/continuous/self-directed) on its
84
139
  * own clock, not just serve tools. */
85
140
  supportsRunner(): boolean;
141
+ /** True when the daemon was started with --acp and can proxy an external
142
+ * agent. A client must check this before offering the surface: a daemon
143
+ * without it answers acp-start with an error. */
144
+ supportsAcp(): boolean;
145
+ /** True when the daemon can run long-lived processes - i.e. the operator
146
+ * allowed shell. A client MUST check this before offering the surface: a
147
+ * daemon without it answers every proc message with an error. */
148
+ supportsProcs(): boolean;
149
+ /** Start a long-running command on the sidecar and stream its output.
150
+ *
151
+ * This is the counterpart to the one-shot `sidecar_shell_exec` tool, not a
152
+ * replacement: use the tool when you want the result of something that
153
+ * finishes, and this when you want to WATCH something that may not.
154
+ *
155
+ * The returned promise settles on the spawn, not on the exit - the process is
156
+ * still running when it resolves. `watch` keeps receiving output until
157
+ * `onExit`, which fires exactly once.
158
+ */
159
+ procSpawn(command: string, watch?: ProcWatcher, opts?: {
160
+ cwd?: string;
161
+ root?: string;
162
+ label?: string;
163
+ }): Promise<ProcInfo>;
164
+ /** Re-attach to a process the daemon is already running - after a reload, or
165
+ * from a second tab. `sinceSeq` is the last chunk this client already has, so
166
+ * the replay is exactly the rest; omit it to replay the whole buffered tail.
167
+ *
168
+ * `truncated` in the result means the daemon's tail no longer reaches back to
169
+ * where you were: there is a GAP, and a UI that renders the replay as if it
170
+ * were continuous would be lying about what the process printed. */
171
+ procAttach(procId: string, watch?: ProcWatcher, sinceSeq?: number): Promise<{
172
+ proc: ProcInfo;
173
+ truncated: boolean;
174
+ }>;
175
+ /** Everything the daemon is running, or recently ran. Called on attach: a
176
+ * process nobody can see is worse than one that died. */
177
+ procList(): Promise<ProcInfo[]>;
178
+ /** Write to a running process's stdin. */
179
+ procInput(procId: string, text: string): Promise<void>;
180
+ /** Stop a process. Idempotent on the daemon side. */
181
+ procKill(procId: string): Promise<void>;
182
+ /** Stop receiving a process's output without stopping the process. */
183
+ procUnwatch(procId: string, watch: ProcWatcher): void;
184
+ private addProcWatcher;
185
+ /** True when the daemon runs sessions at all. A client MUST check this before
186
+ * offering the surface: a daemon without it answers every session message
187
+ * with an error. */
188
+ supportsSessions(): boolean;
189
+ /**
190
+ * Whether the OPERATOR allowed run transcripts to be kept at all.
191
+ *
192
+ * False means no run on this daemon can be recorded however it asks, so a
193
+ * surface must not offer the choice — a control that cannot be honoured is
194
+ * worse than an absent one. True does NOT mean recording is on: each run
195
+ * still opts in (`run(..., { keepTranscript: true })`).
196
+ */
197
+ supportsKeepTranscripts(): boolean;
198
+ /** Every session the daemon knows about. */
199
+ sessionList(): Promise<SessionInfo[]>;
200
+ /**
201
+ * Create a session on a directory, or FROM a repository.
202
+ *
203
+ * Exactly one of `workdir` and `repo`. With `repo` the daemon clones on its
204
+ * own host, using its own git credentials, and mounts the result — which is
205
+ * why the caller cannot name the directory: it does not exist yet. The
206
+ * returned SessionInfo carries `source` with the resolved commit.
207
+ */
208
+ sessionCreate(spec: {
209
+ workdir?: string;
210
+ repo?: SessionRepoSpec;
211
+ owner?: string;
212
+ fromSnapshot?: string;
213
+ }): Promise<SessionInfo>;
214
+ /**
215
+ * Whether this daemon can create a session FROM a repository.
216
+ *
217
+ * False means the operator declared no `--clone-under` directory, so there is
218
+ * nowhere a checkout could be written and the option must not be offered.
219
+ */
220
+ supportsSessionClone(): boolean;
221
+ /**
222
+ * Pause a session, and learn whether it actually drained.
223
+ *
224
+ * `drained: false` means work was STILL RUNNING when the wait gave up. A
225
+ * caller about to capture needs that: it is the difference between a snapshot
226
+ * and a torn one.
227
+ */
228
+ sessionPause(sessionId: string, drainMs?: number): Promise<{
229
+ drained: boolean;
230
+ remaining: string[];
231
+ }>;
232
+ sessionResume(sessionId: string): Promise<void>;
233
+ sessionDestroy(sessionId: string): Promise<void>;
234
+ sessionCommit(sessionId: string, name?: string): Promise<SessionSnapshotInfo>;
235
+ /**
236
+ * One agent's finished runs, newest first, as the DAEMON recorded them.
237
+ *
238
+ * The durable counterpart to the live `run-activity` broadcasts: those say
239
+ * what is happening while this browser is attached and are lost on
240
+ * disconnect, this says what happened at all. Scoped to this client by the
241
+ * daemon, from the identity the connection authenticated with.
242
+ *
243
+ * An empty list means no record, which a caller renders rather than treats
244
+ * as an error — a daemon that keeps none is a normal daemon.
245
+ */
246
+ runHistory(agent: string, limit?: number): Promise<RunRecordInfo[]>;
247
+ /**
248
+ * One run's kept events, as the daemon stored them.
249
+ *
250
+ * Empty means the words were never kept — the default, since transcripts are
251
+ * opt-in. A caller decides what to show from `RunRecordInfo.transcript`,
252
+ * which says whether there was ever anything to fetch.
253
+ */
254
+ runTranscript(agent: string, runId: string): Promise<unknown[]>;
255
+ /** Every capture this daemon could restore from, newest first.
256
+ *
257
+ * An empty list is a real answer — a daemon whose backend cannot capture has
258
+ * nothing to restore from — so a caller uses the length to decide whether to
259
+ * offer the choice, not to detect a failure. */
260
+ sessionSnapshots(): Promise<SessionSnapshotInfo[]>;
261
+ /** Start receiving a session's metrics and logs. */
262
+ sessionWatch(sessionId: string, watch: SessionWatcher): Promise<void>;
263
+ sessionUnwatch(sessionId: string): Promise<void>;
264
+ private sessionCall;
86
265
  /** The sidecar's advertised self-description (root/platform), or {} if it sent
87
266
  * none. Valid only after connect() resolves. */
88
267
  sidecarInfo(): SidecarInfo;
@@ -99,11 +278,40 @@ export declare class SidecarHost {
99
278
  * `onEvent` as they arrive. Resolves once the run completes (`run-done`) with
100
279
  * the daemon-assigned runId, final text, and stop reason; rejects on
101
280
  * `run-error` or if the connection drops while the run is in flight. */
102
- run(agent: string, input: string, onEvent: (e: AgentEvent) => void): Promise<{
281
+ run(agent: string, input: string, onEvent: (e: AgentEvent) => void, opts?: {
282
+ sessionId?: string;
283
+ /** Ask the daemon to KEEP this run's words. A request inside the
284
+ * operator's boundary: a daemon that did not permit transcripts keeps
285
+ * nothing regardless, so this can only ever narrow, never widen. Check
286
+ * `supportsKeepTranscripts()` before offering the choice. */
287
+ keepTranscript?: boolean;
288
+ }): Promise<{
103
289
  runId: string;
104
290
  text: string;
105
291
  stopReason: string;
106
292
  }>;
293
+ /** Start a proxied external ACP agent on the sidecar. The returned promise
294
+ * settles on the handshake; `onUpdate` keeps receiving the agent's stream for
295
+ * the life of the session. Permission asks do NOT come through here — they use
296
+ * the existing permission-ask broadcast, the same path a crew run uses. */
297
+ acpStart(target: string, onUpdate: (update: unknown) => void, opts?: AcpStartOptions): Promise<{
298
+ runId: string;
299
+ sessionId: string;
300
+ agent: string;
301
+ modes?: AcpModeInfo[];
302
+ currentModeId?: string;
303
+ resumed?: boolean;
304
+ }>;
305
+ /** Send one turn to the proxied agent. */
306
+ acpPrompt(text: string, content?: readonly AcpPromptPart[]): Promise<{
307
+ stopReason: string;
308
+ }>;
309
+ /** Switch the proxied agent's mode. Rejects when it does not offer that mode. */
310
+ acpSetMode(modeId: string): Promise<{
311
+ modeId: string;
312
+ }>;
313
+ /** Interrupt the current turn. Fire-and-forget, like cancel in ACP itself. */
314
+ acpCancel(): void;
107
315
  /** Answer an outstanding permission ask. Fire-and-forget over the wire — the
108
316
  * actual drop of the prompt is driven by the server's `permission-resolved`
109
317
  * broadcast (`onPermissionResolved`), not by this call returning. */
@@ -118,6 +326,18 @@ export declare class SidecarHost {
118
326
  * confining `path` to definition, non-state paths BEFORE calling this --
119
327
  * this method has no opinion on what `path` is. */
120
328
  hostSyncDelete(path: string): Promise<void>;
329
+ /** True when the operator started the sidecar with --allow-add-under, so a client
330
+ * may add a working directory this session. Feature-detected from the welcome --
331
+ * an older sidecar simply never advertises it. */
332
+ canAddRoots(): boolean;
333
+ /** Directory NAMES under `path`, or the declared areas themselves when `path` is
334
+ * omitted. Names only: never files, contents or stats. Rejects with the sidecar's
335
+ * message (e.g. outside every allowed area). */
336
+ browseRoots(path?: string): Promise<string[]>;
337
+ /** Promote `path` to a working directory for the rest of the session. Resolves on
338
+ * acceptance -- the resulting set arrives separately via `onRoots`, broadcast to
339
+ * every connected client -- and rejects with the sidecar's refusal message. */
340
+ addRoot(path: string): Promise<void>;
121
341
  private invoke;
122
342
  /** Answer a sidecar's proxy-provider call from the host's live store. The
123
343
  * allowlist (HOST_METHODS) is the least-privilege boundary — a sidecar can
@@ -1 +1 @@
1
- {"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../sidecar/host.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACV,SAAS,EAAE,eAAe,EAAE,cAAc,EAAE,eAAe,EAAE,aAAa,EAC1E,iBAAiB,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,kBAAkB,EAC3E,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAEL,KAAK,cAAc,EAAsC,KAAK,WAAW,EAC1E,MAAM,mBAAmB,CAAC;AAE3B;wEACwE;AACxE,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,EAAE,CAAC,EAAE,cAAc,CAAC;IACpB,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,mEAAmE;IACnE,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,uDAAuD;IACvD,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,iBAAiB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACvD,0CAA0C;IAC1C,GAAG,CAAC,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,KAAK,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;CAChE;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,cAAc,CAAC;IACxB;kFAC8E;IAC9E,KAAK,EAAE,MAAM,CAAC;IACd;8EAC0E;IAC1E,QAAQ,CA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