@hearsay-tools/squawk 0.18.0-pr4407.8607 → 0.18.0-pr4407.8625
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/automations/tools.d.ts +8 -8
- package/dist/ci-wait/controller.d.ts +7 -7
- package/dist/delegation/transport.d.ts +65 -65
- package/dist/features/mcp/cli.d.ts +14 -0
- package/dist/features/mcp/cli.js +87 -0
- package/dist/features/mcp/cli.js.map +1 -0
- package/dist/features/mcp/index.d.ts +9 -0
- package/dist/features/mcp/index.js +13 -0
- package/dist/features/mcp/index.js.map +1 -0
- package/dist/features/mcp/stdio.d.ts +10 -0
- package/dist/features/mcp/stdio.js +41 -0
- package/dist/features/mcp/stdio.js.map +1 -0
- package/dist/features/mcp/tools.d.ts +19 -0
- package/dist/features/mcp/tools.js +476 -0
- package/dist/features/mcp/tools.js.map +1 -0
- package/dist/server/activity-routes.d.ts +23 -23
- package/dist/server/live-routes.d.ts +6 -6
- package/dist/server/models-routes.d.ts +12 -12
- package/dist/server/provider-sign-in-routes.d.ts +2 -2
- package/dist/server/providers-routes.d.ts +57 -57
- package/dist/server/repo-routes.d.ts +34 -34
- package/dist/server/reports-api.d.ts +2 -2
- package/dist/server/runs-routes.d.ts +277 -277
- package/dist/server/server.d.ts +1472 -1472
- package/dist/server/workspace-live-routes.d.ts +6 -6
- package/dist/server/workspace-routes.d.ts +84 -84
- package/dist/task-cli/cli.js +54 -221
- package/dist/task-cli/cli.js.map +1 -1
- package/dist/task-cli/discovery.d.ts +22 -1
- package/dist/task-cli/discovery.js +69 -17
- package/dist/task-cli/discovery.js.map +1 -1
- package/dist/task-cli/http.d.ts +15 -13
- package/dist/task-cli/http.js +16 -6
- package/dist/task-cli/http.js.map +1 -1
- package/dist/task-cli/operations.d.ts +156 -0
- package/dist/task-cli/operations.js +388 -0
- package/dist/task-cli/operations.js.map +1 -0
- package/dist/task-cli/watch.d.ts +31 -8
- package/dist/task-cli/watch.js +159 -91
- package/dist/task-cli/watch.js.map +1 -1
- package/package.json +4 -4
- package/web/dist/assets/{accounts-section-DbLoty0g.js → accounts-section-D7EK3_7b.js} +1 -1
- package/web/dist/assets/{activity-motion-DsIybVZn.js → activity-motion-2BQBW4lA.js} +1 -1
- package/web/dist/assets/{activity-route-BXehwJ4N.js → activity-route-Ct06t8Y9.js} +1 -1
- package/web/dist/assets/{agent-config-section-BKANTX-h.js → agent-config-section-D6Lcc7c5.js} +1 -1
- package/web/dist/assets/{agent-defaults-section-D7ohQxAI.js → agent-defaults-section-BnDBbzuG.js} +1 -1
- package/web/dist/assets/{appearance-rXtZGJD_.js → appearance-CM6ahUyy.js} +1 -1
- package/web/dist/assets/{automations-route-h7bwC5xx.js → automations-route-7B_DF4O1.js} +1 -1
- package/web/dist/assets/{commit-list-yW-pZ7Bc.js → commit-list-O4ugJ12w.js} +1 -1
- package/web/dist/assets/{diff-CfS2Qosw.js → diff-DKZvZQ2G.js} +2 -2
- package/web/dist/assets/{diff-controls-DUiipGjf.js → diff-controls-BpTFu29H.js} +1 -1
- package/web/dist/assets/{diff-view-pPxrBBze.js → diff-view-D4yXb2w7.js} +1 -1
- package/web/dist/assets/{file-preview-CGAcZe9q.js → file-preview-CUhut4J9.js} +1 -1
- package/web/dist/assets/{git-toolbar-Dwndizit.js → git-toolbar-po0QJciG.js} +1 -1
- package/web/dist/assets/{github-DJ0jdSaa.js → github-TgLTixC7.js} +1 -1
- package/web/dist/assets/{global-activity-route-BV9RmVEz.js → global-activity-route-OHCmn0ZO.js} +1 -1
- package/web/dist/assets/{image-preview-Bvd30ghX.js → image-preview-Sisptm3b.js} +1 -1
- package/web/dist/assets/{index-B-_22hXp.js → index-CvVmG4Yu.js} +5 -5
- package/web/dist/assets/{markdown-BDjWFex4.js → markdown-jle_P0a2.js} +1 -1
- package/web/dist/assets/{notifications-section-ALnp6W1u.js → notifications-section-Bhqr3yOz.js} +1 -1
- package/web/dist/assets/page-shell-DQPYcKyL.css +1 -0
- package/web/dist/assets/{preview-pane-connected-rud-axMx.js → preview-pane-connected-CBt_nlmX.js} +1 -1
- package/web/dist/assets/{projects-section-BTyOG2uL.js → projects-section-DnGSWHZJ.js} +1 -1
- package/web/dist/assets/{prompt-templates-section-BQdQIVys.js → prompt-templates-section-8kBTviSw.js} +1 -1
- package/web/dist/assets/{remote-settings-notice-DeCObYJC.js → remote-settings-notice-D7G8cXSx.js} +1 -1
- package/web/dist/assets/{repo-git-CegVXOtZ.js → repo-git-DqBUjQMh.js} +1 -1
- package/web/dist/assets/{report-reader-zqO4yokN.js → report-reader-DtSBGt0O.js} +1 -1
- package/web/dist/assets/{reports-DP-sxf1p.js → reports-ea3-iuBm.js} +1 -1
- package/web/dist/assets/{resources-section-B19JoAbk.js → resources-section-CpXFFHXl.js} +1 -1
- package/web/dist/assets/{run-header-PqdYTt5O.js → run-header-BWTrj0_2.js} +1 -1
- package/web/dist/assets/{select-CEH-C-jh.js → select-aiSr0uTB.js} +1 -1
- package/web/dist/assets/{session-context-section-C33VjuF4.js → session-context-section-BRaZbxVO.js} +1 -1
- package/web/dist/assets/{settings-agent-picker-4PfVRtdT.js → settings-agent-picker-DMIqQhkC.js} +1 -1
- package/web/dist/assets/{settings-shell-CE1EKMmX.js → settings-shell-DwMbZhxp.js} +1 -1
- package/web/dist/assets/{sidebar-section-DOTH6fiq.js → sidebar-section-ClrORHpO.js} +1 -1
- package/web/dist/assets/{skills-BuxDnPg-.js → skills-B97qjJ7j.js} +1 -1
- package/web/dist/assets/{task-changes-D8rzLeLg.js → task-changes-BEfLx9dF.js} +1 -1
- package/web/dist/assets/{task-commits-BpcYm-FY.js → task-commits-6f0GpNF7.js} +1 -1
- package/web/dist/assets/{task-files-DaaC4c18.js → task-files-CA2xTRaM.js} +1 -1
- package/web/dist/assets/{task-github-item-D8kwUMZL.js → task-github-item-BWapcDJr.js} +1 -1
- package/web/dist/assets/{task-thread-9E6bYoV6.js → task-thread-0rKVutjQ.js} +1 -1
- package/web/dist/assets/{thread-state-_-bLdUA2.js → thread-state-C3eDWXYs.js} +1 -1
- package/web/dist/assets/{use-hand-to-agent-state-B-chm1Rk.js → use-hand-to-agent-state-DrAmCxn8.js} +1 -1
- package/web/dist/assets/{workflows-Df3RjnXf.js → workflows-CW-1K6tq.js} +1 -1
- package/web/dist/assets/{workspace-tools-CAQH-2K5.js → workspace-tools-BzDQrP3y.js} +1 -1
- package/web/dist/assets/{worktrees-section-CN78zo2m.js → worktrees-section-ay1jJn_w.js} +1 -1
- package/web/dist/index.html +3 -3
- package/web/dist/assets/page-shell-DPQBoUpR.css +0 -1
- /package/web/dist/assets/{page-shell-h8a6oznS.js → page-shell-7pLJMOgh.js} +0 -0
package/dist/task-cli/watch.js
CHANGED
|
@@ -42,7 +42,20 @@ function attentionKey(entry) {
|
|
|
42
42
|
function isFailure(entry) {
|
|
43
43
|
return entry.status === 'missing' || entry.status === 'failed' || entry.status === 'cancelled';
|
|
44
44
|
}
|
|
45
|
-
|
|
45
|
+
function sleep(ms, signal) {
|
|
46
|
+
if (signal?.aborted)
|
|
47
|
+
return Promise.resolve();
|
|
48
|
+
return new Promise((resolve) => {
|
|
49
|
+
const onAbort = () => { clearTimeout(timer); resolve(); };
|
|
50
|
+
const timer = setTimeout(() => { signal?.removeEventListener('abort', onAbort); resolve(); }, ms);
|
|
51
|
+
signal?.addEventListener('abort', onAbort, { once: true });
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
const DEFAULT_HEARTBEAT_MS = 15_000;
|
|
55
|
+
function throwIfAborted(signal, what) {
|
|
56
|
+
if (signal?.aborted)
|
|
57
|
+
throw new TaskCliError(2, { code: 'cancelled', error: `${what} cancelled` });
|
|
58
|
+
}
|
|
46
59
|
/**
|
|
47
60
|
* Grace for the millisecond race between a budget-bounded poll's abort and the
|
|
48
61
|
* deadline check (#538): `AbortSignal.timeout(budget)` can fire while
|
|
@@ -82,10 +95,16 @@ export function abortedPoll(error) {
|
|
|
82
95
|
export async function requestRunSummaries(cockpit, timeoutMs, options = {}) {
|
|
83
96
|
const start = Date.now();
|
|
84
97
|
const path = options.archived === 'recent' ? '/run-summaries?archived=recent' : '/run-summaries';
|
|
85
|
-
const result = await request(cockpit, path,
|
|
98
|
+
const result = await request(cockpit, path, {
|
|
99
|
+
...(timeoutMs === undefined ? {} : { timeoutMs }),
|
|
100
|
+
...(options.signal ? { signal: options.signal } : {}),
|
|
101
|
+
});
|
|
86
102
|
if (result.status === 404) {
|
|
87
103
|
const left = timeoutMs === undefined ? undefined : Math.max(1, timeoutMs - (Date.now() - start));
|
|
88
|
-
const full = await request(cockpit, '/runs',
|
|
104
|
+
const full = await request(cockpit, '/runs', {
|
|
105
|
+
...(left === undefined ? {} : { timeoutMs: left }),
|
|
106
|
+
...(options.signal ? { signal: options.signal } : {}),
|
|
107
|
+
});
|
|
89
108
|
if (full.status !== 200)
|
|
90
109
|
refuse(full);
|
|
91
110
|
const runs = apiRunSchema.array().safeParse(full.data);
|
|
@@ -102,38 +121,54 @@ export async function requestRunSummaries(cockpit, timeoutMs, options = {}) {
|
|
|
102
121
|
* than holding the caller for a full request timeout.
|
|
103
122
|
*/
|
|
104
123
|
export async function waitForRuns(cockpit, ids, options) {
|
|
105
|
-
const
|
|
124
|
+
const waitStartedAt = Date.now();
|
|
125
|
+
const deadline = waitStartedAt + options.timeoutMs;
|
|
106
126
|
let entries = ids.map((id) => ({ id, status: 'unknown' }));
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
127
|
+
const heartbeat = options.onHeartbeat
|
|
128
|
+
? setInterval(() => {
|
|
129
|
+
if (options.signal?.aborted)
|
|
130
|
+
return;
|
|
131
|
+
void Promise.resolve(options.onHeartbeat(Date.now() - waitStartedAt, entries)).catch(() => { });
|
|
132
|
+
}, options.heartbeatMs ?? DEFAULT_HEARTBEAT_MS)
|
|
133
|
+
: undefined;
|
|
134
|
+
try {
|
|
135
|
+
for (;;) {
|
|
136
|
+
throwIfAborted(options.signal, 'wait');
|
|
137
|
+
const budget = deadline - Date.now();
|
|
138
|
+
const timedOut = () => ({ exitCode: 3, until: options.until, runs: entries, timedOut: true });
|
|
139
|
+
if (budget <= 0)
|
|
119
140
|
return timedOut();
|
|
120
|
-
|
|
141
|
+
const pollStart = Date.now();
|
|
142
|
+
let result;
|
|
143
|
+
try {
|
|
144
|
+
result = await requestRunSummaries(cockpit, budget, { signal: options.signal });
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
throwIfAborted(options.signal, 'wait');
|
|
148
|
+
if (Date.now() >= deadline)
|
|
149
|
+
return timedOut();
|
|
150
|
+
if (abortedPoll(error) && pollHitDeadline(pollStart, budget))
|
|
151
|
+
return timedOut();
|
|
152
|
+
throw error;
|
|
153
|
+
}
|
|
154
|
+
const byId = new Map(result.map((run) => [run.id, run]));
|
|
155
|
+
entries = ids.map((id) => entryFor(id, byId.get(id)));
|
|
156
|
+
const ended = entries.filter((entry) => endsWait(entry, options.until));
|
|
157
|
+
const done = options.mode === 'any' ? ended.length > 0 : ended.length === entries.length;
|
|
158
|
+
if (done) {
|
|
159
|
+
// 0 when every judged run is done/review or stopped for attention; 1 on failed/cancelled/missing.
|
|
160
|
+
const judged = options.mode === 'any' ? ended : entries;
|
|
161
|
+
return { exitCode: judged.some(isFailure) && (options.mode === 'all' || judged.every(isFailure)) ? 1 : 0, until: options.until, runs: entries, timedOut: false };
|
|
162
|
+
}
|
|
163
|
+
const remaining = deadline - Date.now();
|
|
164
|
+
if (remaining <= 0)
|
|
121
165
|
return timedOut();
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
const byId = new Map(result.map((run) => [run.id, run]));
|
|
125
|
-
entries = ids.map((id) => entryFor(id, byId.get(id)));
|
|
126
|
-
const ended = entries.filter((entry) => endsWait(entry, options.until));
|
|
127
|
-
const done = options.mode === 'any' ? ended.length > 0 : ended.length === entries.length;
|
|
128
|
-
if (done) {
|
|
129
|
-
// 0 when every judged run is done/review or stopped for attention; 1 on failed/cancelled/missing.
|
|
130
|
-
const judged = options.mode === 'any' ? ended : entries;
|
|
131
|
-
return { exitCode: judged.some(isFailure) && (options.mode === 'all' || judged.every(isFailure)) ? 1 : 0, until: options.until, runs: entries, timedOut: false };
|
|
166
|
+
await sleep(Math.min(options.pollMs ?? DEFAULT_POLL_MS, remaining), options.signal);
|
|
132
167
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
168
|
+
}
|
|
169
|
+
finally {
|
|
170
|
+
if (heartbeat !== undefined)
|
|
171
|
+
clearInterval(heartbeat);
|
|
137
172
|
}
|
|
138
173
|
}
|
|
139
174
|
const LOG_TYPES = new Set(['text', 'tool-call', 'tool-result', 'step-start', 'error', 'user-message']);
|
|
@@ -181,15 +216,20 @@ class LineTail {
|
|
|
181
216
|
maxChars;
|
|
182
217
|
lines = [];
|
|
183
218
|
size = 0;
|
|
219
|
+
droppedAny = false;
|
|
184
220
|
constructor(maxChars) {
|
|
185
221
|
this.maxChars = maxChars;
|
|
186
222
|
}
|
|
223
|
+
get truncated() {
|
|
224
|
+
return this.droppedAny;
|
|
225
|
+
}
|
|
187
226
|
push(line) {
|
|
188
227
|
this.lines.push(line);
|
|
189
228
|
this.size += line.length + (this.lines.length > 1 ? 1 : 0);
|
|
190
229
|
while (this.size > this.maxChars && this.lines.length) {
|
|
191
230
|
const dropped = this.lines.shift();
|
|
192
231
|
this.size -= dropped.length + (this.lines.length ? 1 : 0);
|
|
232
|
+
this.droppedAny = true;
|
|
193
233
|
}
|
|
194
234
|
}
|
|
195
235
|
drain() {
|
|
@@ -221,31 +261,8 @@ async function* sseFrames(body) {
|
|
|
221
261
|
}
|
|
222
262
|
}
|
|
223
263
|
}
|
|
224
|
-
/**
|
|
225
|
-
* `log`, read from the run's SSE stream, which replays every event after `afterSeq` and then
|
|
226
|
-
* streams live. The route subscribes to live `run` updates BEFORE it replays, so a `run` frame
|
|
227
|
-
* says nothing about where the replay is; the only reliable boundary is a `seq`. So:
|
|
228
|
-
*
|
|
229
|
-
* - the replay ends at `asOfSeq`, the event file's high-water mark read from `GET /history` just
|
|
230
|
-
* before connecting — everything up to it is the tail, bounded to `maxChars`, and without
|
|
231
|
-
* `follow` the command ends there;
|
|
232
|
-
* - with `follow`, the end is judged the way `wait` judges it (#931): `endsWait` over an entry
|
|
233
|
-
* built by `entryFor` from a run read (`GET /runs/:id`), so `--until attention` (the default)
|
|
234
|
-
* also stops on a run that needs its caller, and `--until settled` only on a terminal status.
|
|
235
|
-
* The run is read once after the replay boundary and again whenever a `run` frame changes what
|
|
236
|
-
* attention reads; never on a timer;
|
|
237
|
-
* - the deciding run ends the command only once the stream has caught up with a SECOND high-water
|
|
238
|
-
* read taken after that decision, so events the engine wrote just before parking or finishing
|
|
239
|
-
* are not dropped when the status frame overtakes them (exit 0/1, the final line is the
|
|
240
|
-
* judged run with `until`). A deleted run (`missing`, exit 1) has no history left to drain, and
|
|
241
|
-
* its feed closes without a `run` frame (or its events route 404s), so a closed or refused
|
|
242
|
-
* stream is checked against a run read before it is reported as the cockpit failing (exit 2).
|
|
243
|
-
*
|
|
244
|
-
* One `deadline` bounds every request, the history reads included (exit 3). Deduped by `seq`.
|
|
245
|
-
* The stream rather than `GET /history` pages: a history page starts at its first transcript
|
|
246
|
-
* item, so it drops lifecycle events such as the opening `step-start`.
|
|
247
|
-
*/
|
|
248
264
|
export async function readLog(cockpit, id, options) {
|
|
265
|
+
throwIfAborted(options.signal, 'log read');
|
|
249
266
|
const tail = new LineTail(options.maxChars);
|
|
250
267
|
const remaining = () => options.deadline - Date.now();
|
|
251
268
|
let lastSeq = options.afterSeq;
|
|
@@ -261,49 +278,27 @@ export async function readLog(cockpit, id, options) {
|
|
|
261
278
|
if (boundarySeq === undefined)
|
|
262
279
|
return timedOut();
|
|
263
280
|
let replaying = boundarySeq > options.afterSeq;
|
|
264
|
-
if (!replaying && !options.follow)
|
|
281
|
+
if (!replaying && !options.follow) {
|
|
282
|
+
options.onSnapshotMeta?.({ lastSeq, truncated: false });
|
|
265
283
|
return 0;
|
|
284
|
+
}
|
|
266
285
|
// Nothing to replay: the boundary is already behind us, so the first run read is owed now.
|
|
267
286
|
readOwed = !replaying;
|
|
268
287
|
const controller = new AbortController();
|
|
269
288
|
const timer = setTimeout(() => controller.abort(), Math.max(remaining(), 0));
|
|
289
|
+
const eventSignal = options.signal ? AbortSignal.any([controller.signal, options.signal]) : controller.signal;
|
|
290
|
+
const fetchImpl = cockpit.fetch ?? globalThis.fetch;
|
|
270
291
|
try {
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
redirect: 'error', signal: controller.signal, headers: { accept: 'text/event-stream' },
|
|
275
|
-
});
|
|
276
|
-
}
|
|
277
|
-
catch (error) {
|
|
278
|
-
if (controller.signal.aborted)
|
|
279
|
-
return timedOut();
|
|
280
|
-
throw new TaskCliError(2, { code: 'unavailable', error: `cockpit request failed: ${error instanceof Error ? error.message : String(error)}` });
|
|
281
|
-
}
|
|
292
|
+
const response = await openEventStream(fetchImpl, `${cockpit.api}/runs/${encodeURIComponent(id)}/events?afterSeq=${lastSeq}`, eventSignal, controller.signal, options.signal);
|
|
293
|
+
if (response === 'timed-out')
|
|
294
|
+
return timedOut();
|
|
282
295
|
if (!response.ok || !response.body)
|
|
283
296
|
return await refusedOrMissing(response);
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
if (!applyFrame(frame))
|
|
287
|
-
continue;
|
|
288
|
-
let exit = step();
|
|
289
|
-
if (exit === 'judge')
|
|
290
|
-
exit = await judge();
|
|
291
|
-
if (exit === 'drain') {
|
|
292
|
-
drainSeq = await highWater();
|
|
293
|
-
if (drainSeq === undefined)
|
|
294
|
-
return timedOut();
|
|
295
|
-
exit = step();
|
|
296
|
-
}
|
|
297
|
-
if (typeof exit === 'number')
|
|
298
|
-
return exit;
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
catch (error) {
|
|
302
|
-
if (!controller.signal.aborted)
|
|
303
|
-
throw error;
|
|
304
|
-
}
|
|
305
|
-
if (controller.signal.aborted)
|
|
297
|
+
const streamExit = await consumeEventStream(response.body, controller.signal, options.signal, handleFrame);
|
|
298
|
+
if (streamExit === 'timed-out')
|
|
306
299
|
return timedOut();
|
|
300
|
+
if (typeof streamExit === 'number')
|
|
301
|
+
return streamExit;
|
|
307
302
|
// Deleting a run resets its feed and closes the stream without a `run` frame, so a follow
|
|
308
303
|
// asks whether the run is still there before calling the close a cockpit failure.
|
|
309
304
|
const exit = await endIfMissing();
|
|
@@ -315,6 +310,20 @@ export async function readLog(cockpit, id, options) {
|
|
|
315
310
|
clearTimeout(timer);
|
|
316
311
|
controller.abort();
|
|
317
312
|
}
|
|
313
|
+
async function handleFrame(frame) {
|
|
314
|
+
if (!applyFrame(frame))
|
|
315
|
+
return undefined;
|
|
316
|
+
let exit = step();
|
|
317
|
+
if (exit === 'judge')
|
|
318
|
+
exit = await judge();
|
|
319
|
+
if (exit === 'drain') {
|
|
320
|
+
drainSeq = await highWater();
|
|
321
|
+
if (drainSeq === undefined)
|
|
322
|
+
return timedOut();
|
|
323
|
+
exit = step();
|
|
324
|
+
}
|
|
325
|
+
return typeof exit === 'number' ? exit : undefined;
|
|
326
|
+
}
|
|
318
327
|
/**
|
|
319
328
|
* Ends the replay at its boundary (and owes the first run read there); then a run read that
|
|
320
329
|
* `endsWait` accepts ends the command once drained, unless a changed `run` frame owes a new
|
|
@@ -324,10 +333,13 @@ export async function readLog(cockpit, id, options) {
|
|
|
324
333
|
if (replaying && seenSeq >= boundarySeq) {
|
|
325
334
|
replaying = false;
|
|
326
335
|
readOwed = true;
|
|
336
|
+
const truncated = tail.truncated;
|
|
327
337
|
for (const line of tail.drain())
|
|
328
338
|
options.print(line);
|
|
329
|
-
if (!options.follow)
|
|
339
|
+
if (!options.follow) {
|
|
340
|
+
options.onSnapshotMeta?.({ lastSeq, truncated });
|
|
330
341
|
return 0;
|
|
342
|
+
}
|
|
331
343
|
}
|
|
332
344
|
if (replaying)
|
|
333
345
|
return undefined;
|
|
@@ -453,14 +465,19 @@ export async function readLog(cockpit, id, options) {
|
|
|
453
465
|
}
|
|
454
466
|
/** One budget-bounded read; undefined once the deadline has passed. */
|
|
455
467
|
async function bounded(path) {
|
|
468
|
+
throwIfAborted(options.signal, 'log read');
|
|
456
469
|
const budget = remaining();
|
|
457
470
|
if (budget <= 0)
|
|
458
471
|
return undefined;
|
|
459
472
|
const startedAt = Date.now();
|
|
460
473
|
try {
|
|
461
|
-
return await request(cockpit, path, {
|
|
474
|
+
return await request(cockpit, path, {
|
|
475
|
+
timeoutMs: budget,
|
|
476
|
+
...(options.signal ? { signal: options.signal } : {}),
|
|
477
|
+
});
|
|
462
478
|
}
|
|
463
479
|
catch (error) {
|
|
480
|
+
throwIfAborted(options.signal, 'log read');
|
|
464
481
|
if (remaining() <= 0)
|
|
465
482
|
return undefined;
|
|
466
483
|
if (abortedPoll(error) && pollHitDeadline(startedAt, budget))
|
|
@@ -491,4 +508,55 @@ export async function readLog(cockpit, id, options) {
|
|
|
491
508
|
return run.success ? entryFor(id, toRunSummary(run.data)) : invalidResponse('run');
|
|
492
509
|
}
|
|
493
510
|
}
|
|
511
|
+
async function openEventStream(fetchImpl, url, eventSignal, deadlineSignal, callerSignal) {
|
|
512
|
+
try {
|
|
513
|
+
return await fetchImpl(url, { redirect: 'error', signal: eventSignal, headers: { accept: 'text/event-stream' } });
|
|
514
|
+
}
|
|
515
|
+
catch (error) {
|
|
516
|
+
throwIfAborted(callerSignal, 'log read');
|
|
517
|
+
if (deadlineSignal.aborted)
|
|
518
|
+
return 'timed-out';
|
|
519
|
+
throw new TaskCliError(2, { code: 'unavailable', error: `cockpit request failed: ${error instanceof Error ? error.message : String(error)}` });
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
async function consumeEventStream(body, deadlineSignal, callerSignal, onFrame) {
|
|
523
|
+
try {
|
|
524
|
+
for await (const frame of sseFrames(body)) {
|
|
525
|
+
throwIfAborted(callerSignal, 'log read');
|
|
526
|
+
const exit = await onFrame(frame);
|
|
527
|
+
if (exit !== undefined)
|
|
528
|
+
return exit;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
catch (error) {
|
|
532
|
+
throwIfAborted(callerSignal, 'log read');
|
|
533
|
+
if (!deadlineSignal.aborted)
|
|
534
|
+
throw error;
|
|
535
|
+
}
|
|
536
|
+
throwIfAborted(callerSignal, 'log read');
|
|
537
|
+
return deadlineSignal.aborted ? 'timed-out' : undefined;
|
|
538
|
+
}
|
|
539
|
+
/** Snapshot replay of a run's transcript, bounded to `maxChars`, without writing stdout. */
|
|
540
|
+
export async function readLogSnapshot(cockpit, id, options) {
|
|
541
|
+
const events = [];
|
|
542
|
+
let meta = { lastSeq: options.afterSeq, truncated: false };
|
|
543
|
+
const exit = await readLog(cockpit, id, {
|
|
544
|
+
afterSeq: options.afterSeq,
|
|
545
|
+
maxChars: options.maxChars,
|
|
546
|
+
follow: false,
|
|
547
|
+
until: DEFAULT_WAIT_UNTIL,
|
|
548
|
+
deadline: Date.now() + (options.timeoutMs ?? 45_000),
|
|
549
|
+
signal: options.signal,
|
|
550
|
+
print: (line) => {
|
|
551
|
+
const parsed = JSON.parse(line);
|
|
552
|
+
if (!('timedOut' in parsed))
|
|
553
|
+
events.push(parsed);
|
|
554
|
+
},
|
|
555
|
+
onSnapshotMeta: (next) => { meta = next; },
|
|
556
|
+
});
|
|
557
|
+
if (exit === 3) {
|
|
558
|
+
throw new TaskCliError(3, { code: 'timeout', error: 'timed out reading task log' });
|
|
559
|
+
}
|
|
560
|
+
return { events, lastSeq: meta.lastSeq, truncated: meta.truncated };
|
|
561
|
+
}
|
|
494
562
|
//# sourceMappingURL=watch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch.js","sourceRoot":"","sources":["../../src/task-cli/watch.ts"],"names":[],"mapp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EAAE,CAAC,IAAI,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC;KAC3C,CAAC,CAAC;IACH,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;QACf,MAAM,IAAI,YAAY,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,4BAA4B,EAAE,CAAC,CAAC;IACtF,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC;AACtE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hearsay-tools/squawk",
|
|
3
|
-
"version": "0.18.0-pr4407.
|
|
3
|
+
"version": "0.18.0-pr4407.8625",
|
|
4
4
|
"description": "Local cockpit for running and tracking AI agent tasks in your repo. Uses your logged-in `claude` CLI and `gh` — zero config, zero database.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -69,8 +69,8 @@
|
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@babel/parser": "^8.0.8",
|
|
71
71
|
"@babel/types": "^8.0.8",
|
|
72
|
-
"@open-mercato/cezar-api-client": "0.18.0-pr4407.
|
|
73
|
-
"@open-mercato/cezar-contract": "0.18.0-pr4407.
|
|
72
|
+
"@open-mercato/cezar-api-client": "0.18.0-pr4407.8625",
|
|
73
|
+
"@open-mercato/cezar-contract": "0.18.0-pr4407.8625",
|
|
74
74
|
"@types/node": "^24.19.1",
|
|
75
75
|
"@types/ws": "^8.18.1",
|
|
76
76
|
"esbuild": "^0.28.1",
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"publishConfig": {
|
|
88
88
|
"access": "public"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "91c08eedc6ee205e9e294bfe58f74e4a8d9c1cd2"
|
|
91
91
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{l as r,m as i,o as a,s as o,u as s}from"./live-reads-Crd6fVGH.js";import{Ln as c,Nn as l,Nr as u,Pn as d,an as f,pi as p,ti as m}from"./project-scope-context-Rv6S_BXt.js";import{n as h}from"./toaster-BXnLIU3z.js";import{Ct as g,Et as _,Ft as v,Mt as y,Qt as b,St as x,Vt as S,ft as ee,lt as te,pt as C,qt as w,ut as T,vt as E}from"./queries-qCF-eOqZ.js";import{f as ne}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{y as re}from"./design-icons-CzEoMH9c.js";import{t as ie}from"./createLucideIcon-BHp8sXmF.js";import{t as ae}from"./folder-browser-B7IbnF0d.js";import{t as D}from"./button-B7MKxYjT.js";import{t as oe}from"./badge-DQ3U69Ht.js";import{a as O,i as k,o as A,r as j,s as M,t as N}from"./dialog-B531GGAo.js";import{t as P}from"./status-dot-BRzVlF2X.js";import{n as F}from"./agents-settings-path-7X6_cvUg.js";import{t as I}from"./centered-state-V15AR_qo.js";import{Gt as L,Ht as R,Jt as z,Kt as B,N as V,Ut as H,Wt as U,Yt as W,j as G,qt as K}from"./index-B-_22hXp.js";import{t as q}from"./settings-select-CCIMGnyA.js";import{n as J,r as se,t as ce}from"./settings-agent-picker-4PfVRtdT.js";import{n as le,r as ue,t as de}from"./remote-settings-notice-DeCObYJC.js";var fe=ie(`id-card`,[[`path`,{d:`M16 10h2`,key:`8sgtl7`}],[`path`,{d:`M16 14h2`,key:`epxaof`}],[`path`,{d:`M6.17 15a3 3 0 0 1 5.66 0`,key:`n6f512`}],[`circle`,{cx:`9`,cy:`11`,r:`2`,key:`yxgjnd`}],[`rect`,{x:`2`,y:`5`,width:`20`,height:`14`,rx:`2`,key:`qneu4z`}]]),Y=e(t(),1),X=n(),pe=`~/.claude-second`;function me({open:e,onOpenChange:t,providers:n,initialProvider:a}){let s=i().data,[c,l]=(0,Y.useState)(null),[u,d]=(0,Y.useState)(null),[f,p]=(0,Y.useState)(a??n[0]??`claude`),[m,g]=(0,Y.useState)(``),[_,v]=(0,Y.useState)(``),[y,b]=(0,Y.useState)(!1),x=C(),S=_.trim();return(0,X.jsx)(N,{open:e,onOpenChange:t,children:(0,X.jsxs)(j,{"data-slot":`add-account-dialog`,className:`sm:max-w-lg`,children:[(0,X.jsxs)(A,{children:[(0,X.jsx)(M,{children:`Add agent account`}),(0,X.jsx)(k,{children:`The config folder this account uses. It does not have to exist yet — Connect signs in and the CLI creates it.`})]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsxs)(`label`,{className:`flex items-center gap-2 text-[13px]`,children:[(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`Agent`}),(0,X.jsx)(q,{"aria-label":`Agent`,"data-slot":`add-account-provider`,value:f,onChange:e=>p(e.target.value),className:`rounded-md border border-input bg-card px-2 py-1 text-[13px] outline-none focus-visible:border-ring`,children:n.map(e=>(0,X.jsx)(`option`,{value:e,children:o(s,e)},e))})]}),(0,X.jsxs)(`label`,{className:`flex min-w-0 flex-1 items-center gap-2 text-[13px]`,children:[(0,X.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`Name`}),(0,X.jsx)(`input`,{type:`text`,"aria-label":`Account name`,"data-slot":`add-account-label`,value:m,placeholder:`Work`,onChange:e=>g(e.target.value),className:`min-w-0 flex-1 rounded-md border border-input bg-card px-2 py-1 text-[13px] outline-none focus-visible:border-ring`})]})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsxs)(`label`,{className:`flex min-w-0 items-center gap-2 text-[13px]`,children:[(0,X.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`Folder`}),(0,X.jsx)(`input`,{type:`text`,spellCheck:!1,autoComplete:`off`,"aria-label":`Config folder`,"data-slot":`add-account-dir`,value:_,placeholder:r(s,f)?.accountFolderExample??pe,onChange:e=>{v(e.target.value),d(null),x.reset()},className:`min-w-0 flex-1 rounded-md border border-input bg-card px-2 py-1 font-mono text-[13px] outline-none focus-visible:border-ring`}),(0,X.jsx)(D,{type:`button`,variant:`ghost`,size:`sm`,"data-action":`add-account-browse`,"aria-expanded":y,onClick:()=>b(e=>!e),children:y?`Hide folders`:`Browse…`})]}),(0,X.jsxs)(`p`,{className:`text-xs text-soft-foreground`,children:[`A `,(0,X.jsx)(`code`,{children:`~`}),` is kept as written and expanded when the agent runs.`]})]}),y?(0,X.jsx)(ae,{path:c,selected:u,onSelect:e=>{d(e),v(e.path),x.reset()},onEnter:e=>{l(e),d(null),x.reset()},showHidden:!0,emptyHint:`No subfolders here — pick this folder by typing its path above.`}):null,x.isError?(0,X.jsx)(`p`,{"data-slot":`add-account-error`,className:`min-w-0 break-words text-[13px] text-danger`,children:x.error instanceof Error?x.error.message:`could not add that folder`}):null,(0,X.jsxs)(O,{className:`min-w-0 sm:items-center sm:justify-end`,children:[(0,X.jsx)(D,{variant:`outline`,onClick:()=>t(!1),children:`Cancel`}),(0,X.jsx)(D,{"data-slot":`add-account-confirm`,disabled:S===``||x.isPending,onClick:()=>{S===``||x.isPending||x.mutate({provider:f,configDir:S,...m.trim()?{label:m.trim()}:{}},{onSuccess:()=>{t(!1),g(``),v(``),d(null),b(!1),h(`Account added — use Connect to sign in`)}})},children:x.isPending?`Adding…`:`Add account`})]})]})})}async function he(e){return c(await d.api.v1[`runner-install`][`:runner`].$get({param:{runner:e}}),`/runner-install/:runner`)}async function ge(e,t){return c(await d.api.v1[`runner-install`][`:runner`].$post({param:{runner:e},json:{action:t}}),`/runner-install/:runner`)}var _e={idle:``,checking:`Checking for updates…`,downloading:`Downloading CLI…`,verifying:`Verifying CLI…`,extracting:`Extracting CLI…`,activating:`Activating CLI…`,removing:`Removing CLI…`,failed:``};function ve(e){let t=E().data?.capabilities?.settingsAdmin===!0,n=p(),r=[`runner-install`,e],i=m({queryKey:r,queryFn:()=>he(e),enabled:t,retry:!1,refetchInterval:e=>{if(e.state.error)return!1;let t=e.state.data?.phase;return t&&t!==`idle`&&t!==`failed`?1e3:6e4}}),a=b({mutationFn:t=>ge(e,t),retry:!1,onSuccess:e=>{n.setQueryData(r,e)}}),o=i.data;return{allowed:t,data:o,busy:a.isPending||!!o&&o.phase!==`idle`&&o.phase!==`failed`,error:a.error?.message??i.error?.message??o?.error,action:a,status:i}}function ye({state:e}){let{data:t,busy:n,action:r,status:i}=e;if(t?.supported===!1)return(0,X.jsx)(`p`,{children:`This host is not supported by the CLI installer.`});let a=!!t?.installedVersion;return(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,X.jsx)(D,{className:`min-h-11 active:opacity-80`,disabled:n||!t,onClick:()=>r.mutate(a?`update`:`install`),children:a?`Update CLI`:`Install CLI`}),a?(0,X.jsx)(D,{className:`min-h-11 active:opacity-80`,variant:`outline`,disabled:n,onClick:()=>r.mutate(`remove`),children:`Remove CLI`}):null,(0,X.jsx)(D,{className:`min-h-11 active:opacity-80`,variant:`outline`,disabled:n,onClick:()=>{i.isError?i.refetch():r.mutate(`check`)},children:`Check for updates`})]})}function be({runner:e}){let t=ve(e),{allowed:n,data:r,busy:i,error:a}=t;return n?(0,X.jsxs)(`section`,{"aria-label":`CLI installation`,className:`grid gap-3`,children:[(0,X.jsxs)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:[r?.installedVersion?`Installed CLI ${r.installedVersion}`:`CLI not installed`,r?.latestVersion?` · Latest ${r.latestVersion}`:``,i&&r?` · ${_e[r.phase]}`:``]}),a?(0,X.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:a}):null,(0,X.jsx)(ye,{state:t}),r?.installedVersion?(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Removing the CLI keeps account data and lets running tasks finish.`}):null]}):null}var xe={connected:{label:`Connected`,tone:`success`},disconnected:{label:`Not connected`,tone:`pending`},"not-installed":{label:`Not installed`,tone:`neutral`},unknown:{label:`Could not verify`,tone:`danger`}};function Se(){let e=T(),t=i();if(e.isPending||t.isPending)return(0,X.jsx)(`p`,{"data-slot":`accounts-loading`,className:`p-4 text-[13px] text-soft-foreground md:p-6`,children:`Loading agents…`});let n=e.error??t.error;return n?(0,X.jsx)(I,{icon:(0,X.jsx)(fe,{}),tone:`danger`,title:`Agents did not load`,subtitle:n.message,heading:`h2`}):(0,X.jsx)(Te,{data:e.data,runners:t.data})}function Ce(e){let t=e.replace(/^\/(?:home|Users)\/[^/]+/,`~`),n=t.split(`/`);return n.length>4?`…/${n.slice(-3).join(`/`)}`:t}function we(){let{hash:e}=ne();(0,Y.useEffect)(()=>{if(!e)return;let t=document.getElementById(decodeURIComponent(e.slice(1)));t&&(t.scrollIntoView?.({block:`start`}),t.focus({preventScroll:!0}))},[e])}function Te({data:e,runners:t}){let n=E(),[r,i]=(0,Y.useState)(null),[a,o]=(0,Y.useState)(null),s=_();return we(),ue(),(0,X.jsxs)(`div`,{"data-slot":`accounts-section`,className:`mx-auto flex w-full max-w-2xl flex-col gap-5 p-4 pb-[calc(90px+env(safe-area-inset-bottom))] md:p-6 md:pb-6`,children:[(0,X.jsx)(le,{risk:`Agent accounts run each CLI with the configured host folder`}),e.editable?null:(0,X.jsxs)(`p`,{"data-slot":`accounts-hosted`,className:`text-[13px] text-muted-foreground`,children:[`Agent accounts are read-only on this remote cockpit. Run`,` `,(0,X.jsx)(`code`,{children:de}),` on the host to add, edit, or sign in to accounts here.`]}),(0,X.jsx)(`div`,{"data-slot":`agent-cards`,className:`flex flex-col gap-3`,children:t.runners.map(r=>(0,X.jsx)(Ae,{entry:r,check:n.data?.checks?.find(e=>e.name===r.id),settingsAdmin:n.data?.capabilities?.settingsAdmin===!0,runners:t,editable:e.editable,accounts:e.profiles.filter(e=>e.provider===r.id),canCarryAccounts:e.profileCapableProviders.includes(r.id),onAdd:()=>i(r.id),onRemove:o},r.id))}),(0,X.jsx)(je,{runners:t}),r===null?null:(0,X.jsx)(me,{open:!0,onOpenChange:e=>!e&&i(null),providers:e.profileCapableProviders,initialProvider:r},r),(0,X.jsx)(R,{open:a!==null,onOpenChange:e=>!e&&o(null),children:(0,X.jsxs)(L,{"data-slot":`accounts-remove-confirm`,children:[(0,X.jsxs)(z,{children:[(0,X.jsxs)(W,{children:[`Remove “`,a?.label,`”?`]}),(0,X.jsxs)(B,{children:[`This only forgets the account. Nothing in `,a?.configDir??`this account’s folder`,` is deleted — not your login, not your sessions. Projects using it fall back to the default account, and tasks that ran under it can no longer be resumed from here.`]})]}),(0,X.jsxs)(K,{children:[(0,X.jsx)(U,{children:`Cancel`}),(0,X.jsx)(H,{"data-action":`accounts-remove-confirm`,disabled:s.isPending,onClick:()=>{let e=a;e&&s.mutate(e.id,{onSuccess:()=>{o(null),h(`Removed ${e.label}`)},onError:e=>h(e.message,{tone:`danger`})})},children:`Remove`})]})]})})]})}function Ee({entry:e,check:t}){return t===void 0?(0,X.jsx)(`span`,{"data-slot":`agent-installed`,children:`Checking CLI…`}):t.available?(0,X.jsxs)(`span`,{className:`whitespace-nowrap`,children:[(0,X.jsx)(`span`,{"data-slot":`agent-installed`,children:`CLI installed`}),t.version?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`settings-agent-summary-sep`,children:`·`}),(0,X.jsx)(Oe,{version:t.version})]}):null]}):(0,X.jsxs)(`span`,{"data-slot":`agent-installed`,children:[`CLI not installed`,e.installHint?(0,X.jsxs)(X.Fragment,{children:[` — `,(0,X.jsx)(`code`,{className:`break-all`,children:e.installHint})]}):null]})}var De=/^mock \(\w*DRY_RUN=1\)$/;function Oe({version:e}){return De.test(e)?(0,X.jsx)(`span`,{"data-slot":`agent-version`,"data-dry-run":``,title:e,className:`rounded bg-muted/60 px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground`,children:`Dry run`}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`sr-only`,children:`, version `}),(0,X.jsx)(`span`,{"data-slot":`agent-version`,className:`text-muted-foreground`,children:e})]})}function ke({items:e}){let t=e.filter(e=>e!=null&&e!==!1);return t.length===0?null:(0,X.jsx)(`p`,{"data-slot":`agent-summary`,className:`settings-agent-summary`,children:t.map((e,t)=>(0,X.jsxs)(`span`,{className:`settings-agent-summary-item`,children:[t>0?(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`settings-agent-summary-sep`,children:`·`}):null,e]},t))})}function Z({titleId:e,title:t,summary:n,actions:r,actionsSlot:i}){return(0,X.jsxs)(`div`,{"data-slot":`agent-head`,className:`settings-agent-head`,children:[(0,X.jsxs)(`div`,{className:`settings-agent-heading`,children:[(0,X.jsx)(`h3`,{id:e,className:`settings-account-provider-title`,children:t}),(0,X.jsx)(ke,{items:n})]}),r?(0,X.jsx)(`div`,{"data-slot":i,className:`settings-account-actions`,children:r}):null]})}function Ae({entry:e,check:t,settingsAdmin:n,runners:r,editable:i,accounts:a,canCarryAccounts:o,onAdd:s,onRemove:c}){let l=e.id,u=e.displayName,d=e.managedInstall===!0&&n,f=a.filter(e=>e.isDefault).length,p=`${F(l)}-title`,m=i&&o?(0,X.jsx)(D,{type:`button`,variant:`outline`,size:`sm`,"data-action":`accounts-add`,"data-provider":l,onClick:s,children:`Add account`}):null,h={titleId:p,title:u,facts:[d?null:(0,X.jsx)(Ee,{entry:e,check:t}),i||a.length>0?(0,X.jsxs)(`span`,{className:`settings-account-count`,title:`${f} discovered, ${a.length-f} added`,children:[a.length,` `,a.length===1?`account`:`accounts`]}):null],addButton:m},[g,..._]=a;return(0,X.jsxs)(`section`,{id:F(l),tabIndex:-1,"aria-labelledby":p,"data-slot":`accounts-provider`,"data-provider":l,className:`settings-agent-card flex flex-col rounded-lg border border-border bg-card`,children:[g===void 0?(0,X.jsx)(Z,{titleId:p,title:u,summary:h.facts,actions:m,actionsSlot:`accounts-actions`}):null,d?(0,X.jsx)(be,{runner:l}):null,g===void 0?null:(0,X.jsxs)(`ul`,{className:`settings-agent-accounts`,children:[(0,X.jsx)($,{account:g,runners:r,editable:i,onRemove:()=>c(g),agent:h}),_.map(e=>(0,X.jsx)($,{account:e,runners:r,editable:i,onRemove:()=>c(e)},e.id))]}),i&&!o?(0,X.jsxs)(`p`,{"data-slot":`accounts-single-only`,className:`settings-agent-note`,children:[`One account only: `,u,` keeps its login outside its config folder, so a second folder would change settings without changing who is billed.`]}):!i&&a.length===0&&e.browserLogin?(0,X.jsxs)(`div`,{"data-slot":`hosted-sign-in`,className:`settings-agent-note flex flex-wrap items-center gap-3`,children:[(0,X.jsx)(`span`,{children:`Discovered account`}),(0,X.jsx)(J,{provider:l,label:u})]}):null]})}function je({runners:e}){let[t,n]=(0,Y.useState)(null),r=p(),i=v(),o=x(),c=w(s(e)),l=b({mutationFn:e=>f(e),onSuccess:e=>r.setQueryData(S.config,e),onError:e=>h(e.message,{tone:`danger`})});if(i.data===void 0)return null;let u=se([],e),d=i.data.agentDefaults.runner??`claude`,m=a(t??d,s(e))??t??d,g=i.data.agentDefaults.models??{};return(0,X.jsxs)(`section`,{"data-slot":`accounts-defaults`,className:`flex flex-col gap-3 rounded-lg border border-border bg-card/40 p-3.5`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h3`,{className:`text-[13px] font-semibold text-foreground`,children:`Defaults for new projects`}),(0,X.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`What a project runs when it has not chosen for itself — set once instead of per repository. A project that has chosen keeps its own.`})]}),(0,X.jsx)(ce,{rows:u,runner:d,accountFor:()=>null,providerStatus:o,disabled:l.isPending,onPick:e=>{e!==d&&l.mutate({agentDefaults:{runner:e}})}}),(0,X.jsxs)(`div`,{className:`settings-account-models flex flex-col gap-2`,children:[(0,X.jsxs)(`label`,{className:`settings-model-agent-choice`,children:[(0,X.jsx)(`span`,{children:`Default model for`}),(0,X.jsx)(q,{"aria-label":`Model agent`,value:m,onChange:e=>n(e.target.value),children:e.runners.map(e=>(0,X.jsx)(`option`,{value:e.id,children:e.displayName},e.id))})]}),e.runners.filter(e=>e.id===m).map(t=>(0,X.jsxs)(`label`,{className:`settings-account-model flex flex-wrap items-center gap-3`,children:[(0,X.jsx)(re,{className:`size-4 text-accent-icon shrink-0`}),(0,X.jsx)(`span`,{className:`w-28 shrink-0 text-xs text-muted-foreground`,children:t.displayName}),(0,X.jsxs)(q,{"aria-label":`Default model for ${t.pickerLabel}`,"data-slot":`accounts-default-model`,"data-runner":t.id,value:g[t.id]??``,disabled:l.isPending,onChange:e=>l.mutate({agentDefaults:{models:{[t.id]:e.target.value||null}}}),className:`block w-64 max-w-full rounded-md border border-input bg-card px-3 py-1.5 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-50`,children:[V(t.id,e,c[t.id]?.data,[g[t.id]]).map(e=>(0,X.jsx)(`option`,{value:e.id,children:e.id===``?`Native default`:e.label},e.id)),(0,X.jsx)(Q,{runner:t.id,runners:e,catalog:c[t.id]})]})]},t.id))]})]})}function Q({runner:e,runners:t,catalog:n}){let r=G(e,t,n);return r?(0,X.jsx)(`option`,{disabled:!0,children:r}):null}function Me({account:e,runners:t,status:n,editable:i}){let a=ee();return(0,X.jsxs)(X.Fragment,{children:[n&&n.status!==`connected`&&r(t,e.provider)?.browserLogin?(0,X.jsx)(J,{provider:e.provider,...e.isDefault?{}:{profileId:e.id},label:e.label}):null,i&&n&&n.status!==`connected`&&r(t,e.provider)?.terminalLogin!==!1?(0,X.jsx)(D,{type:`button`,size:`sm`,"data-action":`account-connect`,disabled:a.isPending,onClick:()=>a.mutate({provider:e.provider,...e.isDefault?{}:{profileId:e.id}},{onSuccess:e=>h(e.opened?`Finish signing in in the terminal, then Check again.`:`This account is already connected.`),onError:e=>h(e instanceof l&&e.command?`${e.message} — run: ${e.command}`:e.message,{tone:`danger`})}),children:`Connect`}):null]})}function Ne(e,t,n,r){return!n||n.requiresAccountHome===!1?null:e.exists?!e.looksValid&&e.configDir?{slot:`account-unrecognised`,label:`Unrecognized folder`,guidance:`This folder does not look like ${o(t,e.provider)} config yet.`}:null:{slot:`account-missing`,label:`Not initialized`,guidance:r?n.status===`connected`?`Folder not created yet. Use Check again to refresh.`:`Folder not created yet. Connect will make it.`:`Folder not created on the host yet.`}}function $({account:e,runners:t,editable:n,onRemove:r,agent:i}){let a=u(e),o=g(),s=te(a,e.status===void 0),c=e.status??s.data?.status,l=c?xe[c.status]:void 0,d=Ne(e,t,c,n),f=d?(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,title:l?`Sign-in: ${l.label}`:void 0,children:[(0,X.jsx)(P,{tone:`pending`}),(0,X.jsx)(`span`,{"data-slot":d.slot,className:`text-foreground`,children:d.label})]}):(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,X.jsx)(P,{tone:l?.tone??`neutral`,pulse:l===void 0}),(0,X.jsx)(`span`,{"data-slot":`account-status`,className:`text-foreground`,children:l?.label??`Checking…`})]}),p=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Me,{account:e,runners:t,status:c,editable:n}),(0,X.jsx)(D,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-recheck`,disabled:o.isPending,title:`Re-probe this account's login now, instead of waiting for the cached answer`,onClick:()=>o.mutate(a,{onError:e=>h(e.message,{tone:`danger`})}),children:`Check again`})]}),m=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`settings-account-label`,children:e.label}),e.isDefault?(0,X.jsx)(oe,{variant:`outline`,"data-slot":`account-discovered`,className:`shrink-0 text-[11px] font-normal text-muted-foreground`,children:`discovered`}):null]}),_=e.configDir?(0,X.jsx)(`span`,{"data-slot":`account-path`,className:`settings-account-path`,title:e.path,children:Ce(e.configDir)}):null,v=d?(0,X.jsx)(`p`,{"data-slot":`account-folder-guidance`,className:`settings-account-hint`,children:d.guidance}):null,y=c?.hint?(0,X.jsx)(`p`,{className:`settings-account-hint`,children:c.hint}):null,b=n&&!e.isDefault?(0,X.jsx)(Pe,{account:e,onRemove:r}):null,x=(0,X.jsxs)(`div`,{className:`settings-account-readout`,children:[(0,X.jsxs)(`div`,{className:`settings-account-meta-line`,children:[m,f]}),_,v,y]});return i?(0,X.jsxs)(`li`,{"data-slot":`account-row`,"data-account":e.id,"data-primary":``,className:`settings-account-primary`,children:[(0,X.jsx)(Z,{titleId:i.titleId,title:i.title,summary:i.facts,actions:(0,X.jsxs)(X.Fragment,{children:[p,i.addButton]}),actionsSlot:`account-actions`}),(0,X.jsxs)(`div`,{className:`settings-account-meta`,children:[x,b?(0,X.jsx)(`div`,{className:`settings-account-actions`,children:b}):null]})]}):(0,X.jsxs)(`li`,{"data-slot":`account-row`,"data-account":e.id,className:`settings-account-line`,children:[x,(0,X.jsxs)(`div`,{"data-slot":`account-actions`,className:`settings-account-actions`,children:[p,b]})]})}function Pe({account:e,onRemove:t}){let[n,r]=(0,Y.useState)(!1),[i,a]=(0,Y.useState)(e.label),o=y();return(0,X.jsx)(X.Fragment,{children:e.isDefault?null:(0,X.jsx)(`div`,{"data-slot":`account-manage`,className:`settings-account-management`,children:n?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`input`,{type:`text`,autoFocus:!0,"aria-label":`Name for ${e.label}`,"data-slot":`account-rename-input`,value:i,onChange:e=>a(e.target.value),className:`w-48 rounded-md border border-input bg-card px-2 py-1 text-xs outline-none focus-visible:border-ring`}),(0,X.jsx)(D,{type:`button`,size:`sm`,"data-action":`account-rename-save`,disabled:o.isPending||i.trim()===``||i.trim()===e.label,onClick:()=>o.mutate({id:e.id,label:i.trim()},{onSuccess:()=>r(!1),onError:e=>h(e.message,{tone:`danger`})}),children:`Save`}),(0,X.jsx)(D,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>{a(e.label),r(!1)},children:`Cancel`})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(D,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-rename`,onClick:()=>r(!0),children:`Rename`}),(0,X.jsx)(D,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-remove`,onClick:t,children:`Remove account`}),(0,X.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Renaming changes what Squawk calls this account, not its folder.`})]})})})}export{Se as GlobalAgentsSection};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{l as r,m as i,o as a,s as o,u as s}from"./live-reads-Crd6fVGH.js";import{Ln as c,Nn as l,Nr as u,Pn as d,an as f,pi as p,ti as m}from"./project-scope-context-Rv6S_BXt.js";import{n as h}from"./toaster-BXnLIU3z.js";import{Ct as g,Et as _,Ft as v,Mt as y,Qt as b,St as x,Vt as S,ft as ee,lt as te,pt as C,qt as w,ut as T,vt as E}from"./queries-qCF-eOqZ.js";import{f as ne}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{y as re}from"./design-icons-CzEoMH9c.js";import{t as ie}from"./createLucideIcon-BHp8sXmF.js";import{t as ae}from"./folder-browser-B7IbnF0d.js";import{t as D}from"./button-B7MKxYjT.js";import{t as oe}from"./badge-DQ3U69Ht.js";import{a as O,i as k,o as A,r as j,s as M,t as N}from"./dialog-B531GGAo.js";import{t as P}from"./status-dot-BRzVlF2X.js";import{n as F}from"./agents-settings-path-7X6_cvUg.js";import{t as I}from"./centered-state-V15AR_qo.js";import{Gt as L,Ht as R,Jt as z,Kt as B,N as V,Ut as H,Wt as U,Yt as W,j as G,qt as K}from"./index-CvVmG4Yu.js";import{t as q}from"./settings-select-CCIMGnyA.js";import{n as J,r as se,t as ce}from"./settings-agent-picker-DMIqQhkC.js";import{n as le,r as ue,t as de}from"./remote-settings-notice-D7G8cXSx.js";var fe=ie(`id-card`,[[`path`,{d:`M16 10h2`,key:`8sgtl7`}],[`path`,{d:`M16 14h2`,key:`epxaof`}],[`path`,{d:`M6.17 15a3 3 0 0 1 5.66 0`,key:`n6f512`}],[`circle`,{cx:`9`,cy:`11`,r:`2`,key:`yxgjnd`}],[`rect`,{x:`2`,y:`5`,width:`20`,height:`14`,rx:`2`,key:`qneu4z`}]]),Y=e(t(),1),X=n(),pe=`~/.claude-second`;function me({open:e,onOpenChange:t,providers:n,initialProvider:a}){let s=i().data,[c,l]=(0,Y.useState)(null),[u,d]=(0,Y.useState)(null),[f,p]=(0,Y.useState)(a??n[0]??`claude`),[m,g]=(0,Y.useState)(``),[_,v]=(0,Y.useState)(``),[y,b]=(0,Y.useState)(!1),x=C(),S=_.trim();return(0,X.jsx)(N,{open:e,onOpenChange:t,children:(0,X.jsxs)(j,{"data-slot":`add-account-dialog`,className:`sm:max-w-lg`,children:[(0,X.jsxs)(A,{children:[(0,X.jsx)(M,{children:`Add agent account`}),(0,X.jsx)(k,{children:`The config folder this account uses. It does not have to exist yet — Connect signs in and the CLI creates it.`})]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsxs)(`label`,{className:`flex items-center gap-2 text-[13px]`,children:[(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`Agent`}),(0,X.jsx)(q,{"aria-label":`Agent`,"data-slot":`add-account-provider`,value:f,onChange:e=>p(e.target.value),className:`rounded-md border border-input bg-card px-2 py-1 text-[13px] outline-none focus-visible:border-ring`,children:n.map(e=>(0,X.jsx)(`option`,{value:e,children:o(s,e)},e))})]}),(0,X.jsxs)(`label`,{className:`flex min-w-0 flex-1 items-center gap-2 text-[13px]`,children:[(0,X.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`Name`}),(0,X.jsx)(`input`,{type:`text`,"aria-label":`Account name`,"data-slot":`add-account-label`,value:m,placeholder:`Work`,onChange:e=>g(e.target.value),className:`min-w-0 flex-1 rounded-md border border-input bg-card px-2 py-1 text-[13px] outline-none focus-visible:border-ring`})]})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsxs)(`label`,{className:`flex min-w-0 items-center gap-2 text-[13px]`,children:[(0,X.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`Folder`}),(0,X.jsx)(`input`,{type:`text`,spellCheck:!1,autoComplete:`off`,"aria-label":`Config folder`,"data-slot":`add-account-dir`,value:_,placeholder:r(s,f)?.accountFolderExample??pe,onChange:e=>{v(e.target.value),d(null),x.reset()},className:`min-w-0 flex-1 rounded-md border border-input bg-card px-2 py-1 font-mono text-[13px] outline-none focus-visible:border-ring`}),(0,X.jsx)(D,{type:`button`,variant:`ghost`,size:`sm`,"data-action":`add-account-browse`,"aria-expanded":y,onClick:()=>b(e=>!e),children:y?`Hide folders`:`Browse…`})]}),(0,X.jsxs)(`p`,{className:`text-xs text-soft-foreground`,children:[`A `,(0,X.jsx)(`code`,{children:`~`}),` is kept as written and expanded when the agent runs.`]})]}),y?(0,X.jsx)(ae,{path:c,selected:u,onSelect:e=>{d(e),v(e.path),x.reset()},onEnter:e=>{l(e),d(null),x.reset()},showHidden:!0,emptyHint:`No subfolders here — pick this folder by typing its path above.`}):null,x.isError?(0,X.jsx)(`p`,{"data-slot":`add-account-error`,className:`min-w-0 break-words text-[13px] text-danger`,children:x.error instanceof Error?x.error.message:`could not add that folder`}):null,(0,X.jsxs)(O,{className:`min-w-0 sm:items-center sm:justify-end`,children:[(0,X.jsx)(D,{variant:`outline`,onClick:()=>t(!1),children:`Cancel`}),(0,X.jsx)(D,{"data-slot":`add-account-confirm`,disabled:S===``||x.isPending,onClick:()=>{S===``||x.isPending||x.mutate({provider:f,configDir:S,...m.trim()?{label:m.trim()}:{}},{onSuccess:()=>{t(!1),g(``),v(``),d(null),b(!1),h(`Account added — use Connect to sign in`)}})},children:x.isPending?`Adding…`:`Add account`})]})]})})}async function he(e){return c(await d.api.v1[`runner-install`][`:runner`].$get({param:{runner:e}}),`/runner-install/:runner`)}async function ge(e,t){return c(await d.api.v1[`runner-install`][`:runner`].$post({param:{runner:e},json:{action:t}}),`/runner-install/:runner`)}var _e={idle:``,checking:`Checking for updates…`,downloading:`Downloading CLI…`,verifying:`Verifying CLI…`,extracting:`Extracting CLI…`,activating:`Activating CLI…`,removing:`Removing CLI…`,failed:``};function ve(e){let t=E().data?.capabilities?.settingsAdmin===!0,n=p(),r=[`runner-install`,e],i=m({queryKey:r,queryFn:()=>he(e),enabled:t,retry:!1,refetchInterval:e=>{if(e.state.error)return!1;let t=e.state.data?.phase;return t&&t!==`idle`&&t!==`failed`?1e3:6e4}}),a=b({mutationFn:t=>ge(e,t),retry:!1,onSuccess:e=>{n.setQueryData(r,e)}}),o=i.data;return{allowed:t,data:o,busy:a.isPending||!!o&&o.phase!==`idle`&&o.phase!==`failed`,error:a.error?.message??i.error?.message??o?.error,action:a,status:i}}function ye({state:e}){let{data:t,busy:n,action:r,status:i}=e;if(t?.supported===!1)return(0,X.jsx)(`p`,{children:`This host is not supported by the CLI installer.`});let a=!!t?.installedVersion;return(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,X.jsx)(D,{className:`min-h-11 active:opacity-80`,disabled:n||!t,onClick:()=>r.mutate(a?`update`:`install`),children:a?`Update CLI`:`Install CLI`}),a?(0,X.jsx)(D,{className:`min-h-11 active:opacity-80`,variant:`outline`,disabled:n,onClick:()=>r.mutate(`remove`),children:`Remove CLI`}):null,(0,X.jsx)(D,{className:`min-h-11 active:opacity-80`,variant:`outline`,disabled:n,onClick:()=>{i.isError?i.refetch():r.mutate(`check`)},children:`Check for updates`})]})}function be({runner:e}){let t=ve(e),{allowed:n,data:r,busy:i,error:a}=t;return n?(0,X.jsxs)(`section`,{"aria-label":`CLI installation`,className:`grid gap-3`,children:[(0,X.jsxs)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:[r?.installedVersion?`Installed CLI ${r.installedVersion}`:`CLI not installed`,r?.latestVersion?` · Latest ${r.latestVersion}`:``,i&&r?` · ${_e[r.phase]}`:``]}),a?(0,X.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:a}):null,(0,X.jsx)(ye,{state:t}),r?.installedVersion?(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Removing the CLI keeps account data and lets running tasks finish.`}):null]}):null}var xe={connected:{label:`Connected`,tone:`success`},disconnected:{label:`Not connected`,tone:`pending`},"not-installed":{label:`Not installed`,tone:`neutral`},unknown:{label:`Could not verify`,tone:`danger`}};function Se(){let e=T(),t=i();if(e.isPending||t.isPending)return(0,X.jsx)(`p`,{"data-slot":`accounts-loading`,className:`p-4 text-[13px] text-soft-foreground md:p-6`,children:`Loading agents…`});let n=e.error??t.error;return n?(0,X.jsx)(I,{icon:(0,X.jsx)(fe,{}),tone:`danger`,title:`Agents did not load`,subtitle:n.message,heading:`h2`}):(0,X.jsx)(Te,{data:e.data,runners:t.data})}function Ce(e){let t=e.replace(/^\/(?:home|Users)\/[^/]+/,`~`),n=t.split(`/`);return n.length>4?`…/${n.slice(-3).join(`/`)}`:t}function we(){let{hash:e}=ne();(0,Y.useEffect)(()=>{if(!e)return;let t=document.getElementById(decodeURIComponent(e.slice(1)));t&&(t.scrollIntoView?.({block:`start`}),t.focus({preventScroll:!0}))},[e])}function Te({data:e,runners:t}){let n=E(),[r,i]=(0,Y.useState)(null),[a,o]=(0,Y.useState)(null),s=_();return we(),ue(),(0,X.jsxs)(`div`,{"data-slot":`accounts-section`,className:`mx-auto flex w-full max-w-2xl flex-col gap-5 p-4 pb-[calc(90px+env(safe-area-inset-bottom))] md:p-6 md:pb-6`,children:[(0,X.jsx)(le,{risk:`Agent accounts run each CLI with the configured host folder`}),e.editable?null:(0,X.jsxs)(`p`,{"data-slot":`accounts-hosted`,className:`text-[13px] text-muted-foreground`,children:[`Agent accounts are read-only on this remote cockpit. Run`,` `,(0,X.jsx)(`code`,{children:de}),` on the host to add, edit, or sign in to accounts here.`]}),(0,X.jsx)(`div`,{"data-slot":`agent-cards`,className:`flex flex-col gap-3`,children:t.runners.map(r=>(0,X.jsx)(Ae,{entry:r,check:n.data?.checks?.find(e=>e.name===r.id),settingsAdmin:n.data?.capabilities?.settingsAdmin===!0,runners:t,editable:e.editable,accounts:e.profiles.filter(e=>e.provider===r.id),canCarryAccounts:e.profileCapableProviders.includes(r.id),onAdd:()=>i(r.id),onRemove:o},r.id))}),(0,X.jsx)(je,{runners:t}),r===null?null:(0,X.jsx)(me,{open:!0,onOpenChange:e=>!e&&i(null),providers:e.profileCapableProviders,initialProvider:r},r),(0,X.jsx)(R,{open:a!==null,onOpenChange:e=>!e&&o(null),children:(0,X.jsxs)(L,{"data-slot":`accounts-remove-confirm`,children:[(0,X.jsxs)(z,{children:[(0,X.jsxs)(W,{children:[`Remove “`,a?.label,`”?`]}),(0,X.jsxs)(B,{children:[`This only forgets the account. Nothing in `,a?.configDir??`this account’s folder`,` is deleted — not your login, not your sessions. Projects using it fall back to the default account, and tasks that ran under it can no longer be resumed from here.`]})]}),(0,X.jsxs)(K,{children:[(0,X.jsx)(U,{children:`Cancel`}),(0,X.jsx)(H,{"data-action":`accounts-remove-confirm`,disabled:s.isPending,onClick:()=>{let e=a;e&&s.mutate(e.id,{onSuccess:()=>{o(null),h(`Removed ${e.label}`)},onError:e=>h(e.message,{tone:`danger`})})},children:`Remove`})]})]})})]})}function Ee({entry:e,check:t}){return t===void 0?(0,X.jsx)(`span`,{"data-slot":`agent-installed`,children:`Checking CLI…`}):t.available?(0,X.jsxs)(`span`,{className:`whitespace-nowrap`,children:[(0,X.jsx)(`span`,{"data-slot":`agent-installed`,children:`CLI installed`}),t.version?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`settings-agent-summary-sep`,children:`·`}),(0,X.jsx)(Oe,{version:t.version})]}):null]}):(0,X.jsxs)(`span`,{"data-slot":`agent-installed`,children:[`CLI not installed`,e.installHint?(0,X.jsxs)(X.Fragment,{children:[` — `,(0,X.jsx)(`code`,{className:`break-all`,children:e.installHint})]}):null]})}var De=/^mock \(\w*DRY_RUN=1\)$/;function Oe({version:e}){return De.test(e)?(0,X.jsx)(`span`,{"data-slot":`agent-version`,"data-dry-run":``,title:e,className:`rounded bg-muted/60 px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground`,children:`Dry run`}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`sr-only`,children:`, version `}),(0,X.jsx)(`span`,{"data-slot":`agent-version`,className:`text-muted-foreground`,children:e})]})}function ke({items:e}){let t=e.filter(e=>e!=null&&e!==!1);return t.length===0?null:(0,X.jsx)(`p`,{"data-slot":`agent-summary`,className:`settings-agent-summary`,children:t.map((e,t)=>(0,X.jsxs)(`span`,{className:`settings-agent-summary-item`,children:[t>0?(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`settings-agent-summary-sep`,children:`·`}):null,e]},t))})}function Z({titleId:e,title:t,summary:n,actions:r,actionsSlot:i}){return(0,X.jsxs)(`div`,{"data-slot":`agent-head`,className:`settings-agent-head`,children:[(0,X.jsxs)(`div`,{className:`settings-agent-heading`,children:[(0,X.jsx)(`h3`,{id:e,className:`settings-account-provider-title`,children:t}),(0,X.jsx)(ke,{items:n})]}),r?(0,X.jsx)(`div`,{"data-slot":i,className:`settings-account-actions`,children:r}):null]})}function Ae({entry:e,check:t,settingsAdmin:n,runners:r,editable:i,accounts:a,canCarryAccounts:o,onAdd:s,onRemove:c}){let l=e.id,u=e.displayName,d=e.managedInstall===!0&&n,f=a.filter(e=>e.isDefault).length,p=`${F(l)}-title`,m=i&&o?(0,X.jsx)(D,{type:`button`,variant:`outline`,size:`sm`,"data-action":`accounts-add`,"data-provider":l,onClick:s,children:`Add account`}):null,h={titleId:p,title:u,facts:[d?null:(0,X.jsx)(Ee,{entry:e,check:t}),i||a.length>0?(0,X.jsxs)(`span`,{className:`settings-account-count`,title:`${f} discovered, ${a.length-f} added`,children:[a.length,` `,a.length===1?`account`:`accounts`]}):null],addButton:m},[g,..._]=a;return(0,X.jsxs)(`section`,{id:F(l),tabIndex:-1,"aria-labelledby":p,"data-slot":`accounts-provider`,"data-provider":l,className:`settings-agent-card flex flex-col rounded-lg border border-border bg-card`,children:[g===void 0?(0,X.jsx)(Z,{titleId:p,title:u,summary:h.facts,actions:m,actionsSlot:`accounts-actions`}):null,d?(0,X.jsx)(be,{runner:l}):null,g===void 0?null:(0,X.jsxs)(`ul`,{className:`settings-agent-accounts`,children:[(0,X.jsx)($,{account:g,runners:r,editable:i,onRemove:()=>c(g),agent:h}),_.map(e=>(0,X.jsx)($,{account:e,runners:r,editable:i,onRemove:()=>c(e)},e.id))]}),i&&!o?(0,X.jsxs)(`p`,{"data-slot":`accounts-single-only`,className:`settings-agent-note`,children:[`One account only: `,u,` keeps its login outside its config folder, so a second folder would change settings without changing who is billed.`]}):!i&&a.length===0&&e.browserLogin?(0,X.jsxs)(`div`,{"data-slot":`hosted-sign-in`,className:`settings-agent-note flex flex-wrap items-center gap-3`,children:[(0,X.jsx)(`span`,{children:`Discovered account`}),(0,X.jsx)(J,{provider:l,label:u})]}):null]})}function je({runners:e}){let[t,n]=(0,Y.useState)(null),r=p(),i=v(),o=x(),c=w(s(e)),l=b({mutationFn:e=>f(e),onSuccess:e=>r.setQueryData(S.config,e),onError:e=>h(e.message,{tone:`danger`})});if(i.data===void 0)return null;let u=se([],e),d=i.data.agentDefaults.runner??`claude`,m=a(t??d,s(e))??t??d,g=i.data.agentDefaults.models??{};return(0,X.jsxs)(`section`,{"data-slot":`accounts-defaults`,className:`flex flex-col gap-3 rounded-lg border border-border bg-card/40 p-3.5`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h3`,{className:`text-[13px] font-semibold text-foreground`,children:`Defaults for new projects`}),(0,X.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`What a project runs when it has not chosen for itself — set once instead of per repository. A project that has chosen keeps its own.`})]}),(0,X.jsx)(ce,{rows:u,runner:d,accountFor:()=>null,providerStatus:o,disabled:l.isPending,onPick:e=>{e!==d&&l.mutate({agentDefaults:{runner:e}})}}),(0,X.jsxs)(`div`,{className:`settings-account-models flex flex-col gap-2`,children:[(0,X.jsxs)(`label`,{className:`settings-model-agent-choice`,children:[(0,X.jsx)(`span`,{children:`Default model for`}),(0,X.jsx)(q,{"aria-label":`Model agent`,value:m,onChange:e=>n(e.target.value),children:e.runners.map(e=>(0,X.jsx)(`option`,{value:e.id,children:e.displayName},e.id))})]}),e.runners.filter(e=>e.id===m).map(t=>(0,X.jsxs)(`label`,{className:`settings-account-model flex flex-wrap items-center gap-3`,children:[(0,X.jsx)(re,{className:`size-4 text-accent-icon shrink-0`}),(0,X.jsx)(`span`,{className:`w-28 shrink-0 text-xs text-muted-foreground`,children:t.displayName}),(0,X.jsxs)(q,{"aria-label":`Default model for ${t.pickerLabel}`,"data-slot":`accounts-default-model`,"data-runner":t.id,value:g[t.id]??``,disabled:l.isPending,onChange:e=>l.mutate({agentDefaults:{models:{[t.id]:e.target.value||null}}}),className:`block w-64 max-w-full rounded-md border border-input bg-card px-3 py-1.5 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-50`,children:[V(t.id,e,c[t.id]?.data,[g[t.id]]).map(e=>(0,X.jsx)(`option`,{value:e.id,children:e.id===``?`Native default`:e.label},e.id)),(0,X.jsx)(Q,{runner:t.id,runners:e,catalog:c[t.id]})]})]},t.id))]})]})}function Q({runner:e,runners:t,catalog:n}){let r=G(e,t,n);return r?(0,X.jsx)(`option`,{disabled:!0,children:r}):null}function Me({account:e,runners:t,status:n,editable:i}){let a=ee();return(0,X.jsxs)(X.Fragment,{children:[n&&n.status!==`connected`&&r(t,e.provider)?.browserLogin?(0,X.jsx)(J,{provider:e.provider,...e.isDefault?{}:{profileId:e.id},label:e.label}):null,i&&n&&n.status!==`connected`&&r(t,e.provider)?.terminalLogin!==!1?(0,X.jsx)(D,{type:`button`,size:`sm`,"data-action":`account-connect`,disabled:a.isPending,onClick:()=>a.mutate({provider:e.provider,...e.isDefault?{}:{profileId:e.id}},{onSuccess:e=>h(e.opened?`Finish signing in in the terminal, then Check again.`:`This account is already connected.`),onError:e=>h(e instanceof l&&e.command?`${e.message} — run: ${e.command}`:e.message,{tone:`danger`})}),children:`Connect`}):null]})}function Ne(e,t,n,r){return!n||n.requiresAccountHome===!1?null:e.exists?!e.looksValid&&e.configDir?{slot:`account-unrecognised`,label:`Unrecognized folder`,guidance:`This folder does not look like ${o(t,e.provider)} config yet.`}:null:{slot:`account-missing`,label:`Not initialized`,guidance:r?n.status===`connected`?`Folder not created yet. Use Check again to refresh.`:`Folder not created yet. Connect will make it.`:`Folder not created on the host yet.`}}function $({account:e,runners:t,editable:n,onRemove:r,agent:i}){let a=u(e),o=g(),s=te(a,e.status===void 0),c=e.status??s.data?.status,l=c?xe[c.status]:void 0,d=Ne(e,t,c,n),f=d?(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,title:l?`Sign-in: ${l.label}`:void 0,children:[(0,X.jsx)(P,{tone:`pending`}),(0,X.jsx)(`span`,{"data-slot":d.slot,className:`text-foreground`,children:d.label})]}):(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,X.jsx)(P,{tone:l?.tone??`neutral`,pulse:l===void 0}),(0,X.jsx)(`span`,{"data-slot":`account-status`,className:`text-foreground`,children:l?.label??`Checking…`})]}),p=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Me,{account:e,runners:t,status:c,editable:n}),(0,X.jsx)(D,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-recheck`,disabled:o.isPending,title:`Re-probe this account's login now, instead of waiting for the cached answer`,onClick:()=>o.mutate(a,{onError:e=>h(e.message,{tone:`danger`})}),children:`Check again`})]}),m=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`settings-account-label`,children:e.label}),e.isDefault?(0,X.jsx)(oe,{variant:`outline`,"data-slot":`account-discovered`,className:`shrink-0 text-[11px] font-normal text-muted-foreground`,children:`discovered`}):null]}),_=e.configDir?(0,X.jsx)(`span`,{"data-slot":`account-path`,className:`settings-account-path`,title:e.path,children:Ce(e.configDir)}):null,v=d?(0,X.jsx)(`p`,{"data-slot":`account-folder-guidance`,className:`settings-account-hint`,children:d.guidance}):null,y=c?.hint?(0,X.jsx)(`p`,{className:`settings-account-hint`,children:c.hint}):null,b=n&&!e.isDefault?(0,X.jsx)(Pe,{account:e,onRemove:r}):null,x=(0,X.jsxs)(`div`,{className:`settings-account-readout`,children:[(0,X.jsxs)(`div`,{className:`settings-account-meta-line`,children:[m,f]}),_,v,y]});return i?(0,X.jsxs)(`li`,{"data-slot":`account-row`,"data-account":e.id,"data-primary":``,className:`settings-account-primary`,children:[(0,X.jsx)(Z,{titleId:i.titleId,title:i.title,summary:i.facts,actions:(0,X.jsxs)(X.Fragment,{children:[p,i.addButton]}),actionsSlot:`account-actions`}),(0,X.jsxs)(`div`,{className:`settings-account-meta`,children:[x,b?(0,X.jsx)(`div`,{className:`settings-account-actions`,children:b}):null]})]}):(0,X.jsxs)(`li`,{"data-slot":`account-row`,"data-account":e.id,className:`settings-account-line`,children:[x,(0,X.jsxs)(`div`,{"data-slot":`account-actions`,className:`settings-account-actions`,children:[p,b]})]})}function Pe({account:e,onRemove:t}){let[n,r]=(0,Y.useState)(!1),[i,a]=(0,Y.useState)(e.label),o=y();return(0,X.jsx)(X.Fragment,{children:e.isDefault?null:(0,X.jsx)(`div`,{"data-slot":`account-manage`,className:`settings-account-management`,children:n?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`input`,{type:`text`,autoFocus:!0,"aria-label":`Name for ${e.label}`,"data-slot":`account-rename-input`,value:i,onChange:e=>a(e.target.value),className:`w-48 rounded-md border border-input bg-card px-2 py-1 text-xs outline-none focus-visible:border-ring`}),(0,X.jsx)(D,{type:`button`,size:`sm`,"data-action":`account-rename-save`,disabled:o.isPending||i.trim()===``||i.trim()===e.label,onClick:()=>o.mutate({id:e.id,label:i.trim()},{onSuccess:()=>r(!1),onError:e=>h(e.message,{tone:`danger`})}),children:`Save`}),(0,X.jsx)(D,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>{a(e.label),r(!1)},children:`Cancel`})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(D,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-rename`,onClick:()=>r(!0),children:`Rename`}),(0,X.jsx)(D,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-remove`,onClick:t,children:`Remove account`}),(0,X.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Renaming changes what Squawk calls this account, not its folder.`})]})})})}export{Se as GlobalAgentsSection};
|