@stateset/sandbox-cli 3.3.1 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +140 -0
- package/README.md +467 -41
- package/dist/client.d.ts +131 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +21 -0
- package/dist/client.js.map +1 -1
- package/dist/commands/billing.js +36 -2
- package/dist/commands/billing.js.map +1 -1
- package/dist/commands/config.js +8 -1
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +48 -15
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/sandbox.d.ts.map +1 -1
- package/dist/commands/sandbox.js +222 -17
- package/dist/commands/sandbox.js.map +1 -1
- package/dist/commands/swarm.d.ts +18 -0
- package/dist/commands/swarm.d.ts.map +1 -0
- package/dist/commands/swarm.js +379 -0
- package/dist/commands/swarm.js.map +1 -0
- package/dist/commands/terminal.d.ts +3 -1
- package/dist/commands/terminal.d.ts.map +1 -1
- package/dist/commands/terminal.js +58 -1
- package/dist/commands/terminal.js.map +1 -1
- package/dist/commands/workbench.d.ts +138 -0
- package/dist/commands/workbench.d.ts.map +1 -0
- package/dist/commands/workbench.js +531 -0
- package/dist/commands/workbench.js.map +1 -0
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/utils/ephemeral-storage.d.ts +12 -0
- package/dist/utils/ephemeral-storage.d.ts.map +1 -0
- package/dist/utils/ephemeral-storage.js +39 -0
- package/dist/utils/ephemeral-storage.js.map +1 -0
- package/dist/utils/swarm-dispatcher.d.ts +50 -0
- package/dist/utils/swarm-dispatcher.d.ts.map +1 -0
- package/dist/utils/swarm-dispatcher.js +137 -0
- package/dist/utils/swarm-dispatcher.js.map +1 -0
- package/dist/utils/swarm-plan.d.ts +69 -0
- package/dist/utils/swarm-plan.d.ts.map +1 -0
- package/dist/utils/swarm-plan.js +321 -0
- package/dist/utils/swarm-plan.js.map +1 -0
- package/dist/utils/template-create.d.ts +36 -0
- package/dist/utils/template-create.d.ts.map +1 -0
- package/dist/utils/template-create.js +118 -0
- package/dist/utils/template-create.js.map +1 -0
- package/dist/workbench/actions.d.ts +1 -1
- package/dist/workbench/actions.d.ts.map +1 -1
- package/dist/workbench/actions.js +1 -0
- package/dist/workbench/actions.js.map +1 -1
- package/dist/workbench/agents.d.ts +96 -0
- package/dist/workbench/agents.d.ts.map +1 -0
- package/dist/workbench/agents.js +370 -0
- package/dist/workbench/agents.js.map +1 -0
- package/dist/workbench/commands.d.ts.map +1 -1
- package/dist/workbench/commands.js +7 -1
- package/dist/workbench/commands.js.map +1 -1
- package/dist/workbench/model.d.ts +5 -1
- package/dist/workbench/model.d.ts.map +1 -1
- package/dist/workbench/model.js +15 -2
- package/dist/workbench/model.js.map +1 -1
- package/dist/workbench/terminal.d.ts +1 -1
- package/dist/workbench/terminal.d.ts.map +1 -1
- package/dist/workbench/terminal.js +108 -78
- package/dist/workbench/terminal.js.map +1 -1
- package/package.json +15 -7
|
@@ -10,6 +10,7 @@ import { COMMAND_LIMIT, commandReceipt } from './execution.js';
|
|
|
10
10
|
import { creationDraft, creationLines, creationRequest, creationTextFields, creationFieldLimit, resourceClasses, inferenceProviders } from './creation.js';
|
|
11
11
|
import { overviewLines, shortId, timeLeft } from './overview.js';
|
|
12
12
|
import { filterActions, workbenchActions } from './actions.js';
|
|
13
|
+
import { agentCell, agentColumns, agentDetailLines, agentLines, agentSummary } from './agents.js';
|
|
13
14
|
import { connectionLines, snapshotStale } from './connection.js';
|
|
14
15
|
import { randomUUID } from 'node:crypto';
|
|
15
16
|
import { workerLines, workerRow } from './workers.js';
|
|
@@ -56,12 +57,16 @@ const help = [
|
|
|
56
57
|
'Agent chat: b opens saved bundles offline; f opens task files; Esc returns to chat.',
|
|
57
58
|
'j/k or Up/Down: select a sandbox',
|
|
58
59
|
'PageUp/PageDown: move one page; Home/End: first/last',
|
|
59
|
-
'/: search IDs, statuses and creating Herdr panes',
|
|
60
|
+
'/: search IDs, statuses, agent names and creating Herdr panes',
|
|
60
61
|
'Enter: apply search or open selected sandbox details',
|
|
61
62
|
'Esc: cancel search, clear filter or return to the list',
|
|
62
63
|
'?: open this help; r: refresh shared state',
|
|
63
64
|
'a: open session activity for all sandboxes',
|
|
64
65
|
'o: overview of statuses, running allocations and upcoming expiries',
|
|
66
|
+
'v: agents recorded under --agents directories, by fleet, with phase, branch and pull request',
|
|
67
|
+
'Workbenches of the current repository (stateset workbench up) are recorded without --agents.',
|
|
68
|
+
'AGENT and PHASE columns come from those records; Enter adds task, objective, cost and errors.',
|
|
69
|
+
'* marks likely duplicates: agents still working under matching names; details name the pair.',
|
|
65
70
|
't: cycle list sort: ID, expiry, status, newest; selection stays pinned',
|
|
66
71
|
'TIME LEFT: ! warns at 2 minutes; due awaits backend status.',
|
|
67
72
|
'b: buy prepaid credits through your browser and Stripe',
|
|
@@ -87,6 +92,12 @@ const help = [
|
|
|
87
92
|
function pageSize(height) {
|
|
88
93
|
return Math.max(1, Math.min(200, height) - 8);
|
|
89
94
|
}
|
|
95
|
+
/** The list and the agents screen keep one row for the note about skipped agent records. */
|
|
96
|
+
function noteRows(model, view, height) {
|
|
97
|
+
return model.agents.note && height >= 10 && (!view.screen || view.screen === 'list' || view.screen === 'agents') ? 1 : 0;
|
|
98
|
+
}
|
|
99
|
+
/** The only styling in a frame, added after cleaning so that none of it comes from data. */
|
|
100
|
+
function dim(line) { return line ? `\x1b[2m${line}\x1b[22m` : line; }
|
|
90
101
|
function availableActions(model, options, id, now = Date.now()) {
|
|
91
102
|
return workbenchActions({ row: model.rows.find(row => row.id === id), busy: model.busy,
|
|
92
103
|
readOnly: options.readOnly, backend: options.backend || 'api', connected: Boolean(model.lastUpdated),
|
|
@@ -126,66 +137,68 @@ function screenContent(model, options, width, view, now = Date.now()) {
|
|
|
126
137
|
view.actionMessage || '',
|
|
127
138
|
] : view.screen === 'connection' ? connectionLines(model, options.intervalMs, now)
|
|
128
139
|
: view.screen === 'overview' ? overviewLines(model.rows, now)
|
|
129
|
-
: view.screen === '
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
view.
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
view.commandResult
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
'
|
|
154
|
-
|
|
155
|
-
options.
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
'
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
140
|
+
: view.screen === 'agents' ? agentLines(model.agents, model.rows, Boolean(model.lastUpdated) && !model.error, width)
|
|
141
|
+
: view.screen === 'create' && view.creation
|
|
142
|
+
? creationLines(view.creation, options.createOptions, options.backend || 'api', Boolean(view.creationReview))
|
|
143
|
+
: view.screen === 'command' && view.commandMode === 'spawn' && view.workerLaunch ? [
|
|
144
|
+
...workerLaunchLines(view.command || '', view.workerLaunch, Boolean(view.commandReview)),
|
|
145
|
+
`Sandbox: ${view.commandId}`, view.commandMessage || '',
|
|
146
|
+
] : view.screen === 'command' && view.commandMode === 'python' && view.workerLaunch && (view.commandEditing || view.commandReview) ? [
|
|
147
|
+
...pythonLines(view.command || '', view.workerLaunch, Boolean(view.commandReview), view.python),
|
|
148
|
+
`Sandbox: ${view.commandId}`, view.commandMessage || '',
|
|
149
|
+
] : view.screen === 'command' ? [
|
|
150
|
+
view.commandMode === 'python' ? 'PYTHON TASK RESULT' : 'RUN COMMAND', `Sandbox: ${view.commandId}`,
|
|
151
|
+
...(view.commandMode === 'python' && view.python ? [`Python task: ${view.python.name} | ${view.python.id}`, `Artifacts: ${view.python.directory}`]
|
|
152
|
+
: [model.api.executeStream ? 'Runs sh -lc inside this sandbox. Output streams live.' : 'Runs sh -lc inside this sandbox. Output appears after completion.']),
|
|
153
|
+
...(view.commandEditing ? [`Type or paste a command (max ${COMMAND_LIMIT} characters). Enter reviews; Ctrl+U clears.`,
|
|
154
|
+
...`$ ${view.command || ''}_`.split('\n')]
|
|
155
|
+
: [view.commandMode === 'python' ? `Source: ${view.python?.source}` : `$ ${view.command || ''}`]),
|
|
156
|
+
view.commandMessage || '',
|
|
157
|
+
...(view.commandResult ? [
|
|
158
|
+
view.commandResult.status,
|
|
159
|
+
...(view.commandResult.executionId ? [`Execution: ${view.commandResult.executionId}`] : []),
|
|
160
|
+
...(view.commandResult.truncated ? ['Output truncated (server limit or 64 KiB per stream).'] : []),
|
|
161
|
+
'STDOUT', ...(view.commandResult.stdout || '(empty)').split(/\r?\n/),
|
|
162
|
+
'STDERR', ...(view.commandResult.stderr || '(empty)').split(/\r?\n/),
|
|
163
|
+
] : []),
|
|
164
|
+
] : view.screen === 'subscription' ? [
|
|
165
|
+
'SUBSCRIPTION',
|
|
166
|
+
...(options.billing ? [
|
|
167
|
+
options.readOnly ? 'Read-only: subscription actions are disabled.' : 'Enter reviews opening subscription plans in your browser.',
|
|
168
|
+
'Sign in as the owner and verify the organization.',
|
|
169
|
+
'Select a plan and review recurring fees plus usage before confirming.',
|
|
170
|
+
'Cancelling: use Reactivate Subscription before the period ends.',
|
|
171
|
+
'Canceled: start a new subscription; existing credits do not restart it.',
|
|
172
|
+
'Opening this page does not change your plan or submit payment.',
|
|
173
|
+
view.subscriptionMessage || '',
|
|
174
|
+
...(view.subscriptionUrl ? ['Subscription link (o opens it again):', view.subscriptionUrl] : []),
|
|
175
|
+
] : ['Local Docker sandboxes do not require a subscription.']),
|
|
176
|
+
] : view.screen === 'billing' ? [
|
|
177
|
+
'BUY CREDITS',
|
|
178
|
+
...(options.billing ? [
|
|
179
|
+
`USD amount: $${view.creditAmount ?? '25'}${view.creditEditing ? '_' : ''}`,
|
|
180
|
+
'Type an amount ($5-$2,000); Enter reviews it.',
|
|
181
|
+
options.readOnly ? 'Read-only: purchases are disabled.' : 'Payment is completed in your browser.',
|
|
182
|
+
'Sign in as the owner and verify the organization before paying.',
|
|
183
|
+
'Stripe confirms payment before credits are applied.',
|
|
184
|
+
'Credits fund an active metered subscription; they do not change your plan.',
|
|
185
|
+
'Need a subscription? Press s to review plans or reactivate.',
|
|
186
|
+
'Return here after payment; r refreshes sandboxes.',
|
|
187
|
+
view.creditMessage || '',
|
|
188
|
+
...(view.creditUrl ? ['Billing link (o opens it again):', view.creditUrl] : []),
|
|
189
|
+
] : ['Local Docker sandboxes do not require credits.']),
|
|
190
|
+
] : view.screen === 'activity' ? [
|
|
191
|
+
'ACTIVITY | all sandboxes',
|
|
192
|
+
'Current session; newest first; last 100 observations.',
|
|
193
|
+
...(model.activity.length ? model.activity.map(event => `${event.at.toISOString()} | ${event.message}`)
|
|
194
|
+
: ['Waiting for the first observation...']),
|
|
195
|
+
] : view.screen === 'help' ? help : row ? [
|
|
196
|
+
`ID: ${row.id}`, `Status: ${row.status}`, `CPU: ${row.cpus || '-'}`,
|
|
197
|
+
`Memory: ${row.memory || '-'}`, `Created: ${row.createdAt || '-'}`,
|
|
198
|
+
`Expires: ${row.expiresAt || '-'}`, `Time left: ${timeLeft(row, now)}`, `Backend: ${row.backend || 'api'}`,
|
|
199
|
+
`Creating Herdr pane: ${row.origin || '-'}`,
|
|
200
|
+
...agentDetailLines(model.agents, row.id),
|
|
201
|
+
] : ['Selected sandbox is no longer available. Esc returns to the list.'];
|
|
189
202
|
// Wrap before slicing so full IDs and pane names remain inspectable in splits.
|
|
190
203
|
const plain = stripTerminalStyles(content.join('\n'));
|
|
191
204
|
return (options.redact?.(plain) ?? plain).split('\n').flatMap(line => {
|
|
@@ -202,7 +215,7 @@ export function dashboardLines(model, options, width, height, confirmation, view
|
|
|
202
215
|
};
|
|
203
216
|
const baseTitle = `STATESET SANDBOX${options.readOnly ? ' [read only]' : ''}`;
|
|
204
217
|
const running = model.rows.filter(row => row.status.toLowerCase() === 'running').length;
|
|
205
|
-
const title = `${baseTitle}${!view.screen || view.screen === 'list' ? ` | ${running} running/${model.rows.length} total | sort:${model.sortMode}` : ''}`;
|
|
218
|
+
const title = `${baseTitle}${!view.screen || view.screen === 'list' ? ` | ${running} running/${model.rows.length} total | sort:${model.sortMode}${model.agents.duplicates.size ? ` | dup:${model.agents.duplicates.size}` : ''}` : ''}`;
|
|
206
219
|
if (height < 8 || width < 24)
|
|
207
220
|
return [title, 'Resize to at least 25x8', 'q quits; sandboxes stay alive'].slice(0, height).map(clean);
|
|
208
221
|
const status = model.readRetryAt > now ? `STALE / rate limited: API reads resume in ${Math.ceil((model.readRetryAt - now) / 1000)}s`
|
|
@@ -210,17 +223,22 @@ export function dashboardLines(model, options, width, height, confirmation, view
|
|
|
210
223
|
? `STALE / unavailable: ${model.error}`
|
|
211
224
|
: snapshotStale(model, options.intervalMs, now) ? 'STALE: refresh delayed. Press c for connection diagnostics.'
|
|
212
225
|
: model.lastUpdated ? `Updated ${model.lastUpdated.toISOString()} | ${model.rows.length} sandboxes` : 'Connecting...';
|
|
213
|
-
const
|
|
226
|
+
const agents = model.agents;
|
|
227
|
+
const note = noteRows(model, view, height);
|
|
228
|
+
// With agent columns the wide layout needs more room beside CPU and memory.
|
|
229
|
+
const compact = width < 60 || (agents.bySandbox.size > 0 && width < 64);
|
|
214
230
|
const rows = model.visibleRows;
|
|
215
231
|
const search = view.searching ? `Search: /${model.filter}_ Enter:apply Esc:cancel`
|
|
216
232
|
: model.filter ? `Filter: ${model.filter} | ${rows.length}/${model.rows.length} matches | Esc:clear` : undefined;
|
|
217
233
|
if (view.screen && view.screen !== 'list') {
|
|
218
234
|
const wrapped = screenContent(model, options, width, view, now);
|
|
219
|
-
const room = height - 5;
|
|
235
|
+
const room = height - 5 - note;
|
|
220
236
|
const offset = Math.max(0, Math.min(view.scroll || 0, Math.max(0, wrapped.length - room)));
|
|
221
237
|
const lines = [title, options.label, status, ...wrapped.slice(offset, offset + room)];
|
|
222
|
-
while (lines.length < height - 2)
|
|
238
|
+
while (lines.length < height - 2 - note)
|
|
223
239
|
lines.push('');
|
|
240
|
+
if (note)
|
|
241
|
+
lines.push(agents.note);
|
|
224
242
|
const actionReason = view.screen === 'actions' ? view.actionMessage
|
|
225
243
|
|| filterActions(availableActions(model, options, view.actionTarget, now), view.actionQuery)
|
|
226
244
|
.find(action => action.id === view.actionSelected)?.reason : undefined;
|
|
@@ -261,34 +279,42 @@ export function dashboardLines(model, options, width, height, confirmation, view
|
|
|
261
279
|
? view.commandEditing ? view.commandMode !== 'exec' ? 'Tab:field Enter:review Esc:back Ctrl+C:quit' : 'Enter:review Esc:back Ctrl+C:quit'
|
|
262
280
|
: `z:cancel r:receipt f:files${canEditCommand(model, options, view.commandId, now) ? ' x:edit' : ''} h:history Esc:back q:quit`
|
|
263
281
|
: 'F2:actions Esc:back j/k:scroll q:quit');
|
|
264
|
-
return lines.map(clean);
|
|
282
|
+
return lines.map((line, index) => note && index === height - 3 ? dim(clean(line)) : clean(line));
|
|
265
283
|
}
|
|
266
|
-
const idWidth = width - 40;
|
|
267
|
-
const
|
|
284
|
+
const idWidth = compact ? width - 21 : width - 40;
|
|
285
|
+
const split = agents.bySandbox.size ? agentColumns(idWidth) : { id: idWidth, name: 0, phase: 0 };
|
|
286
|
+
const idHeading = split.name ? `${'ID'.padEnd(split.id)} ${'AGENT'.padEnd(split.name)} ${compact ? 'PHASE' : 'PHASE'.padEnd(split.phase)}` : compact ? 'ID' : 'ID'.padEnd(idWidth);
|
|
287
|
+
const heading = compact ? ` STATUS TIME LEFT ${idHeading}` : ` ${idHeading} ${'STATUS'.padEnd(11)} ${'CPU'.padEnd(5)} ${'MEMORY'.padEnd(8)} TIME LEFT`;
|
|
268
288
|
const lines = [title, options.label, status, search || heading];
|
|
269
289
|
if (height === 8)
|
|
270
290
|
lines.pop();
|
|
271
|
-
const room = Math.max(1, height - lines.length - 4);
|
|
291
|
+
const room = Math.max(1, height - lines.length - 4 - note);
|
|
272
292
|
const selected = rows.findIndex(row => row.id === model.selectedId);
|
|
273
293
|
const start = Math.max(0, selected - room + 1);
|
|
274
294
|
for (const row of rows.slice(start, start + room)) {
|
|
275
295
|
const prefix = row.id === model.selectedId ? '> ' : ' ';
|
|
276
296
|
const cell = (value, size) => padCells(clean(value), size);
|
|
297
|
+
// The name is cut to its column; the ID keeps both ends in what is left.
|
|
298
|
+
const id = split.name ? `${shortId(row.id, split.id).padEnd(split.id)} ${cell(agentCell(agents, row.id, split.name), split.name)} ${cell(agents.bySandbox.get(row.id)?.[0]?.phase || '-', split.phase)}`
|
|
299
|
+
: compact ? shortId(row.id, idWidth) : shortId(row.id, idWidth).padEnd(idWidth);
|
|
277
300
|
lines.push(compact
|
|
278
|
-
? `${prefix}${cell(row.status, 9)} ${cell(timeLeft(row, now), 8)} ${
|
|
279
|
-
: `${prefix}${
|
|
301
|
+
? `${prefix}${cell(row.status, 9)} ${cell(timeLeft(row, now), 8)} ${id}`
|
|
302
|
+
: `${prefix}${id} ${cell(row.status, 11)} ${cell(row.cpus || '-', 5)} ${cell(row.memory || '-', 8)} ${timeLeft(row, now)}`);
|
|
280
303
|
}
|
|
281
304
|
if (!rows.length)
|
|
282
305
|
lines.push(model.filter ? 'No matches. Esc clears search.' : model.lastUpdated
|
|
283
306
|
? options.readOnly ? 'No sandboxes.' : 'No sandboxes. Press n to create.' : 'Waiting for backend...');
|
|
284
|
-
while (lines.length < height - 4)
|
|
307
|
+
while (lines.length < height - 4 - note)
|
|
285
308
|
lines.push('');
|
|
309
|
+
if (note)
|
|
310
|
+
lines.push(agents.note);
|
|
286
311
|
const row = model.selected;
|
|
287
|
-
|
|
312
|
+
const agent = row ? agentSummary(agents, row.id) : '';
|
|
313
|
+
lines.push(row ? `${row.id} | ${agent ? `${agent} | ` : ''}CPU ${row.cpus || '-'} | RAM ${row.memory || '-'} | ${row.status}` : 'Nothing selected');
|
|
288
314
|
lines.push(confirmation ? `${confirmation} [y] confirm / [Esc] cancel` : view.searching ? search : model.busy ? `BUSY: ${model.message}` : model.message);
|
|
289
|
-
lines.push(confirmation ? 'y:confirm Esc:cancel' : options.readOnly ? 'F2:actions m:tasks j/k:select r:refresh c:connection' : 'F2:actions m:tasks l:delegate n:new x:exec i:python g:agent');
|
|
315
|
+
lines.push(confirmation ? 'y:confirm Esc:cancel' : options.readOnly ? 'F2:actions m:tasks v:agents j/k:select r:refresh c:connection' : 'F2:actions m:tasks v:agents l:delegate n:new x:exec i:python g:agent');
|
|
290
316
|
lines.push(view.searching ? 'Enter:apply Esc:cancel Ctrl+C:quit' : 'q:quit /:search Enter:details o:overview t:sort ?:help r:refresh a:activity');
|
|
291
|
-
return lines.slice(0, height).map(clean);
|
|
317
|
+
return lines.slice(0, height).map((line, index) => note && index === height - 5 ? dim(clean(line)) : clean(line));
|
|
292
318
|
}
|
|
293
319
|
/** No terminal reset or subprocess panes: works in a Herdr/tmux split. */
|
|
294
320
|
export async function runDashboard(model, options, input = process.stdin, output = process.stdout) {
|
|
@@ -362,7 +388,7 @@ export async function runDashboard(model, options, input = process.stdin, output
|
|
|
362
388
|
chatContextChanged();
|
|
363
389
|
if (view.screen !== 'list') {
|
|
364
390
|
const width = Math.max(1, Math.min(500, (output.columns || 80) - 1));
|
|
365
|
-
const room = Math.max(1, Math.min(200, output.rows || 24) - 5);
|
|
391
|
+
const room = Math.max(1, Math.min(200, output.rows || 24) - 5 - noteRows(model, view, Math.min(200, output.rows || 24)));
|
|
366
392
|
const end = Math.max(0, screenContent(model, options, width, view).length - room);
|
|
367
393
|
view.scroll = ((view.screen === 'command' && view.commandEditing && (view.commandMode === 'exec' || view.workerLaunch?.field === 0))
|
|
368
394
|
|| (view.screen === 'agentChat' && view.chat?.follow)) && !pending ? end : Math.max(0, Math.min(view.scroll || 0, end));
|
|
@@ -734,7 +760,7 @@ export async function runDashboard(model, options, input = process.stdin, output
|
|
|
734
760
|
void refresh();
|
|
735
761
|
return;
|
|
736
762
|
}
|
|
737
|
-
const screens = { overview: 'overview', activity: 'activity', connection: 'connection', credits: 'billing', subscription: 'subscription', help: 'help' };
|
|
763
|
+
const screens = { overview: 'overview', activity: 'activity', connection: 'connection', credits: 'billing', subscription: 'subscription', help: 'help', agents: 'agents' };
|
|
738
764
|
if (actionId in screens) {
|
|
739
765
|
view.screen = screens[actionId];
|
|
740
766
|
view.scroll = 0;
|
|
@@ -2483,7 +2509,7 @@ export async function runDashboard(model, options, input = process.stdin, output
|
|
|
2483
2509
|
});
|
|
2484
2510
|
}
|
|
2485
2511
|
}
|
|
2486
|
-
if (key.name === 'escape' || (key.name === 'return' && view.screen !== 'billing' && view.screen !== 'subscription') || text === '?' || key.name === 'a' || (key.name === 'o' && view.screen === 'overview'))
|
|
2512
|
+
if (key.name === 'escape' || (key.name === 'return' && view.screen !== 'billing' && view.screen !== 'subscription') || text === '?' || key.name === 'a' || (key.name === 'o' && view.screen === 'overview') || (key.name === 'v' && view.screen === 'agents'))
|
|
2487
2513
|
view.screen = 'list';
|
|
2488
2514
|
if (key.name === 's' && view.screen === 'billing') {
|
|
2489
2515
|
view.screen = 'subscription';
|
|
@@ -2511,6 +2537,10 @@ export async function runDashboard(model, options, input = process.stdin, output
|
|
|
2511
2537
|
view.screen = 'overview';
|
|
2512
2538
|
view.scroll = 0;
|
|
2513
2539
|
}
|
|
2540
|
+
if (key.name === 'v') {
|
|
2541
|
+
view.screen = 'agents';
|
|
2542
|
+
view.scroll = 0;
|
|
2543
|
+
}
|
|
2514
2544
|
if (key.name === 't')
|
|
2515
2545
|
model.cycleSort();
|
|
2516
2546
|
if (key.name === 'b') {
|