@skrr-ai/cli 0.1.91 → 0.1.93
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/base-command.d.ts +44 -0
- package/dist/base-command.js +96 -0
- package/dist/commands/agents/badge.d.ts +41 -0
- package/dist/commands/agents/badge.js +158 -0
- package/dist/commands/agents/create.d.ts +24 -0
- package/dist/commands/agents/create.js +212 -0
- package/dist/commands/agents/embed.d.ts +20 -0
- package/dist/commands/agents/embed.js +61 -0
- package/dist/commands/agents/share.d.ts +27 -0
- package/dist/commands/agents/share.js +100 -0
- package/dist/commands/agents/vanity.d.ts +21 -0
- package/dist/commands/agents/vanity.js +77 -0
- package/dist/commands/agents/visibility.d.ts +21 -1
- package/dist/commands/agents/visibility.js +112 -0
- package/dist/commands/commands.d.ts +1 -0
- package/dist/commands/commands.js +22 -9
- package/dist/commands/earnings/attributions.d.ts +17 -0
- package/dist/commands/earnings/attributions.js +82 -0
- package/dist/commands/earnings/index.js +2 -1
- package/dist/commands/generate-recovery-code.js +4 -3
- package/dist/commands/github/allow-tools.d.ts +1 -0
- package/dist/commands/github/app/install.d.ts +1 -0
- package/dist/commands/github/app/status.d.ts +1 -0
- package/dist/commands/github/connect.d.ts +1 -0
- package/dist/commands/github/connections.d.ts +1 -0
- package/dist/commands/github/disconnect.d.ts +1 -0
- package/dist/commands/github/finalize.d.ts +1 -0
- package/dist/commands/github/reconnect.d.ts +1 -0
- package/dist/commands/github/run.d.ts +1 -0
- package/dist/commands/github/tools.d.ts +1 -0
- package/dist/commands/integrations/connections/connect.d.ts +1 -0
- package/dist/commands/integrations/connections/disconnect.d.ts +1 -0
- package/dist/commands/integrations/connections/finalize.d.ts +1 -0
- package/dist/commands/integrations/connections/list.d.ts +1 -0
- package/dist/commands/integrations/connections/reconnect.d.ts +1 -0
- package/dist/commands/integrations/execute.d.ts +1 -0
- package/dist/commands/integrations/search.d.ts +1 -0
- package/dist/commands/integrations/toolkits.d.ts +1 -0
- package/dist/commands/integrations/tools/allow.d.ts +1 -0
- package/dist/commands/integrations/tools/list.d.ts +1 -0
- package/dist/commands/login.js +12 -0
- package/dist/commands/machines/dedicated/logs.d.ts +19 -0
- package/dist/commands/machines/dedicated/logs.js +103 -0
- package/dist/commands/machines/dedicated/power/index.js +3 -2
- package/dist/commands/machines/dedicated/power/set.js +1 -1
- package/dist/commands/machines/dedicated/power/waiting.d.ts +13 -0
- package/dist/commands/machines/dedicated/power/waiting.js +36 -0
- package/dist/commands/open.d.ts +24 -0
- package/dist/commands/open.js +74 -0
- package/dist/commands/projects/archive.d.ts +1 -0
- package/dist/commands/projects/archive.js +23 -0
- package/dist/commands/projects/delete.d.ts +1 -0
- package/dist/commands/projects/delete.js +23 -0
- package/dist/commands/projects/list.d.ts +3 -0
- package/dist/commands/projects/list.js +12 -2
- package/dist/commands/spaces/actions/add.js +4 -3
- package/dist/commands/spaces/actions/available.js +3 -2
- package/dist/commands/spaces/actions/list.js +5 -4
- package/dist/commands/spaces/actions/replace.js +6 -5
- package/dist/commands/spaces/archive.js +3 -2
- package/dist/commands/spaces/auto-executor/preview.js +4 -3
- package/dist/commands/spaces/auto-executor/run.js +4 -3
- package/dist/commands/spaces/auto-executor/runs.js +3 -2
- package/dist/commands/spaces/auto-executor/update.js +4 -3
- package/dist/commands/spaces/bootstrap.js +3 -2
- package/dist/commands/spaces/briefs/delete.js +3 -2
- package/dist/commands/spaces/briefs/get.js +3 -2
- package/dist/commands/spaces/briefs/list.js +3 -2
- package/dist/commands/spaces/briefs/set.js +5 -4
- package/dist/commands/spaces/capacity.js +5 -4
- package/dist/commands/spaces/conversations.js +3 -2
- package/dist/commands/spaces/cycles/create.js +3 -2
- package/dist/commands/spaces/cycles/graph.js +2 -1
- package/dist/commands/spaces/cycles/list.js +3 -2
- package/dist/commands/spaces/cycles/settings.js +4 -3
- package/dist/commands/spaces/cycles/show.js +3 -2
- package/dist/commands/spaces/cycles/update.js +3 -2
- package/dist/commands/spaces/delete.js +4 -3
- package/dist/commands/spaces/expertise-suggestions.js +4 -3
- package/dist/commands/spaces/files/delete.js +3 -2
- package/dist/commands/spaces/files/folders/create.js +3 -2
- package/dist/commands/spaces/files/folders/delete.js +3 -2
- package/dist/commands/spaces/files/folders/list.js +3 -2
- package/dist/commands/spaces/files/folders/update.js +3 -2
- package/dist/commands/spaces/files/list.js +3 -2
- package/dist/commands/spaces/files/move.js +3 -2
- package/dist/commands/spaces/files/rename.js +3 -2
- package/dist/commands/spaces/files/upload.js +6 -5
- package/dist/commands/spaces/github-automations/set.js +3 -2
- package/dist/commands/spaces/github-automations/show.js +3 -2
- package/dist/commands/spaces/goals.js +2 -1
- package/dist/commands/spaces/heartbeats/create.js +4 -3
- package/dist/commands/spaces/heartbeats/delete.js +4 -3
- package/dist/commands/spaces/heartbeats/list.js +4 -3
- package/dist/commands/spaces/heartbeats/status.js +3 -2
- package/dist/commands/spaces/heartbeats/update.js +4 -3
- package/dist/commands/spaces/insights.js +5 -4
- package/dist/commands/spaces/labels/add.js +4 -3
- package/dist/commands/spaces/labels/list.js +2 -1
- package/dist/commands/spaces/labels/remove.js +4 -3
- package/dist/commands/spaces/list.d.ts +3 -0
- package/dist/commands/spaces/list.js +11 -2
- package/dist/commands/spaces/live/cards/create.js +3 -2
- package/dist/commands/spaces/live/cards/list.js +3 -2
- package/dist/commands/spaces/live/cards/reorder.js +7 -2
- package/dist/commands/spaces/live/scene.js +4 -3
- package/dist/commands/spaces/members/add.js +7 -6
- package/dist/commands/spaces/members/list.js +4 -3
- package/dist/commands/spaces/members/remove.js +7 -6
- package/dist/commands/spaces/move.js +3 -2
- package/dist/commands/spaces/pin.js +5 -4
- package/dist/commands/spaces/preferences/show.js +4 -3
- package/dist/commands/spaces/preferences/tabs.js +4 -3
- package/dist/commands/spaces/revisions.js +3 -2
- package/dist/commands/spaces/room/ensure.js +5 -4
- package/dist/commands/spaces/room/messages.js +3 -2
- package/dist/commands/spaces/room/show.js +5 -4
- package/dist/commands/spaces/skills/add.js +4 -3
- package/dist/commands/spaces/skills/list.js +3 -2
- package/dist/commands/spaces/skills/pin.js +4 -3
- package/dist/commands/spaces/skills/remove.js +4 -3
- package/dist/commands/spaces/snapshot.js +3 -2
- package/dist/commands/spaces/states/archive.js +3 -2
- package/dist/commands/spaces/states/create.js +3 -2
- package/dist/commands/spaces/states/list.js +3 -2
- package/dist/commands/spaces/states/reorder.js +2 -1
- package/dist/commands/spaces/states/update.js +3 -2
- package/dist/commands/spaces/summary.js +4 -3
- package/dist/commands/spaces/tasks.d.ts +3 -0
- package/dist/commands/spaces/tasks.js +14 -3
- package/dist/commands/spaces/triggers/delete.js +5 -4
- package/dist/commands/spaces/triggers/set.js +4 -3
- package/dist/commands/spaces/triggers/show.js +4 -3
- package/dist/commands/spaces/unarchive.js +3 -2
- package/dist/commands/spaces/update.js +5 -4
- package/dist/commands/spaces/views/create.js +3 -2
- package/dist/commands/spaces/views/list.js +3 -2
- package/dist/commands/spaces/views/reorder.js +6 -3
- package/dist/commands/spaces/views/subscribe.js +2 -1
- package/dist/commands/spaces/views/subscriptions.js +1 -0
- package/dist/commands/spaces/views/unsubscribe.js +2 -1
- package/dist/commands/spaces/widgets/add.js +4 -3
- package/dist/commands/spaces/widgets/list.js +3 -2
- package/dist/commands/spaces/widgets/remove.js +5 -4
- package/dist/commands/spaces/work-graph.js +2 -1
- package/dist/commands/store/install.d.ts +1 -1
- package/dist/commands/store/install.js +24 -8
- package/dist/commands/store/show.d.ts +25 -0
- package/dist/commands/store/show.js +203 -0
- package/dist/commands/store/stats.d.ts +33 -0
- package/dist/commands/store/stats.js +258 -0
- package/dist/commands/tasks/actions/attach.js +1 -1
- package/dist/commands/tasks/actions/detach.js +4 -3
- package/dist/commands/tasks/activity.js +3 -2
- package/dist/commands/tasks/ancestors.js +2 -1
- package/dist/commands/tasks/approvals/create.js +2 -1
- package/dist/commands/tasks/approvals/delete.js +3 -2
- package/dist/commands/tasks/approvals/list.js +5 -4
- package/dist/commands/tasks/approvals/resolve.js +2 -1
- package/dist/commands/tasks/archive.js +3 -2
- package/dist/commands/tasks/assign.js +4 -3
- package/dist/commands/tasks/attachments/delete.js +3 -2
- package/dist/commands/tasks/attachments/download.d.ts +1 -0
- package/dist/commands/tasks/attachments/download.js +20 -1
- package/dist/commands/tasks/attachments/list.js +2 -1
- package/dist/commands/tasks/attachments/set-role.js +2 -1
- package/dist/commands/tasks/attachments/upload.js +2 -1
- package/dist/commands/tasks/bulk-update.d.ts +1 -0
- package/dist/commands/tasks/bulk-update.js +106 -15
- package/dist/commands/tasks/cancel-cascade.d.ts +1 -0
- package/dist/commands/tasks/cancel-cascade.js +13 -3
- package/dist/commands/tasks/cascade-status.js +2 -1
- package/dist/commands/tasks/chat/send.d.ts +44 -0
- package/dist/commands/tasks/chat/send.js +112 -0
- package/dist/commands/tasks/checkout.js +3 -2
- package/dist/commands/tasks/children.js +2 -1
- package/dist/commands/tasks/comments/add.js +7 -6
- package/dist/commands/tasks/comments/anchor.js +8 -7
- package/dist/commands/tasks/comments/delete.js +3 -2
- package/dist/commands/tasks/comments/list.js +2 -1
- package/dist/commands/tasks/comments/reopen.js +3 -2
- package/dist/commands/tasks/comments/resolve.js +3 -2
- package/dist/commands/tasks/create-tree.d.ts +63 -0
- package/dist/commands/tasks/create-tree.js +197 -4
- package/dist/commands/tasks/delete.js +5 -4
- package/dist/commands/tasks/descendants.js +2 -1
- package/dist/commands/tasks/dri-plan.js +3 -2
- package/dist/commands/tasks/dri-run.js +3 -2
- package/dist/commands/tasks/dri-status.js +2 -1
- package/dist/commands/tasks/duplicate-pipeline.js +2 -1
- package/dist/commands/tasks/execution-summary.js +2 -1
- package/dist/commands/tasks/execution-timeline.js +2 -1
- package/dist/commands/tasks/fork.js +1 -0
- package/dist/commands/tasks/forward.js +4 -3
- package/dist/commands/tasks/handover.js +1 -0
- package/dist/commands/tasks/interrupt.js +3 -2
- package/dist/commands/tasks/labels/attach.js +4 -3
- package/dist/commands/tasks/labels/detach.js +4 -3
- package/dist/commands/tasks/labels/suggest.js +5 -4
- package/dist/commands/tasks/list.d.ts +27 -1
- package/dist/commands/tasks/list.js +101 -3
- package/dist/commands/tasks/move.js +4 -3
- package/dist/commands/tasks/output.js +6 -5
- package/dist/commands/tasks/pause-schedule.js +3 -2
- package/dist/commands/tasks/promote.js +1 -0
- package/dist/commands/tasks/prompt-log.js +2 -1
- package/dist/commands/tasks/release.js +5 -4
- package/dist/commands/tasks/remind.js +2 -1
- package/dist/commands/tasks/replay.js +3 -2
- package/dist/commands/tasks/report.js +1 -0
- package/dist/commands/tasks/resume-schedule.js +3 -2
- package/dist/commands/tasks/retry-schedule.js +3 -2
- package/dist/commands/tasks/retry.js +10 -9
- package/dist/commands/tasks/revisions.js +2 -1
- package/dist/commands/tasks/runs.js +6 -5
- package/dist/commands/tasks/schedule.js +3 -2
- package/dist/commands/tasks/self-schedule.js +6 -5
- package/dist/commands/tasks/skills/pin.js +3 -2
- package/dist/commands/tasks/skills/unpin.js +3 -2
- package/dist/commands/tasks/snooze.js +6 -5
- package/dist/commands/tasks/start-all.js +5 -4
- package/dist/commands/tasks/subscribe.js +1 -0
- package/dist/commands/tasks/tags/add.js +4 -3
- package/dist/commands/tasks/tags/remove.js +4 -3
- package/dist/commands/tasks/timeline.js +3 -2
- package/dist/commands/tasks/today.d.ts +4 -1
- package/dist/commands/tasks/today.js +12 -2
- package/dist/commands/tasks/transcript.js +6 -5
- package/dist/commands/tasks/unschedule.js +3 -2
- package/dist/commands/tasks/unsnooze.js +3 -2
- package/dist/commands/tasks/unsubscribe.js +2 -1
- package/dist/commands/tasks/update.js +5 -4
- package/dist/commands/tasks/wait.js +5 -4
- package/dist/lib/agent-distribution.d.ts +37 -0
- package/dist/lib/agent-distribution.js +63 -0
- package/dist/lib/agent-ref.d.ts +69 -0
- package/dist/lib/agent-ref.js +168 -0
- package/dist/lib/api-fetch.d.ts +2 -0
- package/dist/lib/api-fetch.js +14 -3
- package/dist/lib/command-hygiene.d.ts +13 -0
- package/dist/lib/command-hygiene.js +62 -2
- package/dist/lib/dedicated-power.d.ts +16 -1
- package/dist/lib/dedicated-power.js +153 -2
- package/dist/lib/dry-run-plans.d.ts +50 -0
- package/dist/lib/dry-run-plans.js +85 -0
- package/dist/lib/json-output.d.ts +31 -0
- package/dist/lib/json-output.js +78 -0
- package/dist/lib/list-output.d.ts +75 -0
- package/dist/lib/list-output.js +266 -0
- package/dist/lib/machine-daemon-log.d.ts +36 -0
- package/dist/lib/machine-daemon-log.js +78 -0
- package/dist/lib/node-adapter.js +10 -1
- package/dist/lib/open-target.d.ts +12 -0
- package/dist/lib/open-target.js +108 -0
- package/dist/lib/rate-limit-retry.d.ts +45 -0
- package/dist/lib/rate-limit-retry.js +88 -0
- package/dist/lib/store-listing.d.ts +45 -0
- package/dist/lib/store-listing.js +186 -0
- package/dist/lib/task-batch.d.ts +67 -0
- package/dist/lib/task-batch.js +227 -0
- package/dist/lib/terminal-qr.d.ts +55 -0
- package/dist/lib/terminal-qr.js +119 -0
- package/dist/lib/web-url.d.ts +11 -0
- package/dist/lib/web-url.js +24 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.d.ts +68 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.js +47 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.d.ts +68 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.js +46 -0
- package/dist/node_modules/@skrr-ai/auth-core/package.json +1 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +6615 -6112
- package/oclif.manifest.json +41499 -32585
- package/package.json +2 -1
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatDaemonLogLine = formatDaemonLogLine;
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const dedicated_lease_command_1 = require("../../../lib/dedicated-lease-command");
|
|
6
|
+
const machine_daemon_log_1 = require("../../../lib/machine-daemon-log");
|
|
7
|
+
/** One line as it prints: UTC time (the daemon's clock), level, then the daemon's own text. */
|
|
8
|
+
function formatDaemonLogLine(line) {
|
|
9
|
+
const at = new Date(line.at).toISOString().replace('T', ' ').replace('Z', '');
|
|
10
|
+
return `${at} ${line.level.toUpperCase().padEnd(5)} ${line.text}`;
|
|
11
|
+
}
|
|
12
|
+
class DedicatedMachinesLogs extends dedicated_lease_command_1.DedicatedLeaseCommand {
|
|
13
|
+
static summary = "Read the tail of a Dedicated Runtime machine's daemon log";
|
|
14
|
+
static description = "Shows the last lines the machine's daemon logged about itself — why it reconnected, " +
|
|
15
|
+
're-registered or failed to sign in — so you can debug it without reading syslog, which ' +
|
|
16
|
+
"the machine's workload user cannot. The daemon keeps a short, recent log in memory and " +
|
|
17
|
+
"redacts credentials before keeping a line; it is not the machine's system log and it does " +
|
|
18
|
+
'not survive a daemon restart (the start time is printed). A machine whose image predates ' +
|
|
19
|
+
'this says so: update it with `machines dedicated update-image`. Anyone the machine is ' +
|
|
20
|
+
'shared with at the watch tier or above can read it; each read is on the audit record.';
|
|
21
|
+
static examples = [
|
|
22
|
+
'<%= config.bin %> machines dedicated logs <lease-id>',
|
|
23
|
+
'<%= config.bin %> machines dedicated logs <lease-id> --since 30m --level warn',
|
|
24
|
+
'<%= config.bin %> machines dedicated logs <lease-id> --lines 300 --json',
|
|
25
|
+
];
|
|
26
|
+
static args = {
|
|
27
|
+
lease: core_1.Args.string({
|
|
28
|
+
ignoreStdin: true,
|
|
29
|
+
description: dedicated_lease_command_1.DEDICATED_LEASE_ARG_DESCRIPTION,
|
|
30
|
+
required: true,
|
|
31
|
+
}),
|
|
32
|
+
};
|
|
33
|
+
static flags = {
|
|
34
|
+
lines: core_1.Flags.integer({
|
|
35
|
+
description: `The newest N lines (1-${machine_daemon_log_1.COMPUTER_DAEMON_LOG_LIMITS.maxLines})`,
|
|
36
|
+
default: machine_daemon_log_1.COMPUTER_DAEMON_LOG_LIMITS.defaultLines,
|
|
37
|
+
min: 1,
|
|
38
|
+
max: machine_daemon_log_1.COMPUTER_DAEMON_LOG_LIMITS.maxLines,
|
|
39
|
+
}),
|
|
40
|
+
since: core_1.Flags.string({
|
|
41
|
+
description: 'Only lines from this long ago: 90s, 30m, 2h, 1d (at most 24h)',
|
|
42
|
+
}),
|
|
43
|
+
level: core_1.Flags.string({
|
|
44
|
+
description: 'Only this level and above',
|
|
45
|
+
options: [...machine_daemon_log_1.COMPUTER_DAEMON_LOG_LEVELS],
|
|
46
|
+
}),
|
|
47
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
48
|
+
};
|
|
49
|
+
async run() {
|
|
50
|
+
this.requireAuth();
|
|
51
|
+
const { args, flags } = await this.parse(DedicatedMachinesLogs);
|
|
52
|
+
const leaseId = await this.resolveLeaseArg(args.lease);
|
|
53
|
+
let sinceMs;
|
|
54
|
+
try {
|
|
55
|
+
sinceMs = flags.since ? (0, machine_daemon_log_1.parseDaemonLogSince)(flags.since) : undefined;
|
|
56
|
+
}
|
|
57
|
+
catch (err) {
|
|
58
|
+
this.error(err instanceof Error ? err.message : String(err), { exit: 2 });
|
|
59
|
+
}
|
|
60
|
+
let result;
|
|
61
|
+
try {
|
|
62
|
+
result = await (0, machine_daemon_log_1.getMachineDaemonLog)(`lease:${leaseId}`, {
|
|
63
|
+
lines: flags.lines,
|
|
64
|
+
...(sinceMs !== undefined ? { sinceMs } : {}),
|
|
65
|
+
...(flags.level
|
|
66
|
+
? { level: flags.level }
|
|
67
|
+
: {}),
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
catch (err) {
|
|
71
|
+
const failure = (0, machine_daemon_log_1.describeDaemonLogFailure)(err, { bin: this.config.bin, leaseId });
|
|
72
|
+
if (failure)
|
|
73
|
+
this.failWithCliError({ ...failure, exit: 1 });
|
|
74
|
+
return this.callDedicated(async () => {
|
|
75
|
+
throw err;
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
if (flags.json) {
|
|
79
|
+
this.log(JSON.stringify(result, null, 2));
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (result.lines.length === 0) {
|
|
83
|
+
// Empty is "nothing matched in what the daemon still holds", never "the
|
|
84
|
+
// daemon logged nothing": the log is a short in-memory window.
|
|
85
|
+
this.log(flags.since || flags.level
|
|
86
|
+
? 'No log lines match those filters in what the daemon still holds.'
|
|
87
|
+
: 'The daemon has logged nothing since it started (or since its log was last cleared by a restart).');
|
|
88
|
+
}
|
|
89
|
+
for (const line of result.lines)
|
|
90
|
+
this.log(formatDaemonLogLine(line));
|
|
91
|
+
const started = new Date(result.startedAt).toISOString();
|
|
92
|
+
const notes = [`daemon started ${started}`];
|
|
93
|
+
if (result.truncated)
|
|
94
|
+
notes.push('more matched than this shows: raise --lines or narrow --since');
|
|
95
|
+
if (result.ringFull)
|
|
96
|
+
notes.push("older lines have rolled off the daemon's short log");
|
|
97
|
+
if (result.redactedLines > 0) {
|
|
98
|
+
notes.push(`${result.redactedLines} line(s) in the log had credential-shaped text masked`);
|
|
99
|
+
}
|
|
100
|
+
this.log(`-- ${notes.join('; ')}`);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
exports.default = DedicatedMachinesLogs;
|
|
@@ -6,7 +6,7 @@ const core_1 = require("@oclif/core");
|
|
|
6
6
|
* on its own. `set` is the standing policy; more verbs arrive with the power card.
|
|
7
7
|
*/
|
|
8
8
|
class DedicatedMachinesPower extends core_1.Command {
|
|
9
|
-
static description = 'Power policy of a Dedicated Runtime — when it may stop and start on its own. Files are preserved across stops.\n\nSubcommands:\n show state, policy, holders, usage, next wake\n explain why it stayed on, stopped or woke, and the fix\n set always_on | on_demand | manual (+ --idle-after, --budget-hours)\n keep-awake --for <duration> | --until <iso> | --clear';
|
|
9
|
+
static description = 'Power policy of a Dedicated Runtime — when it may stop and start on its own. Files are preserved across stops.\n\nSubcommands:\n show state, policy, holders, usage, next wake\n explain why it stayed on, stopped or woke, and the fix\n waiting work waiting for the machine\n set always_on | on_demand | manual (+ --idle-after, --budget-hours/--no-budget)\n keep-awake --for <duration> | --until <iso> | --clear';
|
|
10
10
|
static examples = [
|
|
11
11
|
'<%= config.bin %> machines dedicated power set <lease-id> --policy manual',
|
|
12
12
|
'<%= config.bin %> machines dedicated power set <lease-id> --policy on_demand --idle-after 60',
|
|
@@ -15,7 +15,8 @@ class DedicatedMachinesPower extends core_1.Command {
|
|
|
15
15
|
this.log('skrr machines dedicated power commands:');
|
|
16
16
|
this.log(' skrr machines dedicated power show state, policy, holders, usage, next wake');
|
|
17
17
|
this.log(' skrr machines dedicated power explain why it stayed on, stopped or woke, and the fix');
|
|
18
|
-
this.log(' skrr machines dedicated power
|
|
18
|
+
this.log(' skrr machines dedicated power waiting work waiting for the machine');
|
|
19
|
+
this.log(' skrr machines dedicated power set always_on | on_demand | manual (+ --idle-after, --budget-hours/--no-budget)');
|
|
19
20
|
this.log(' skrr machines dedicated power keep-awake --for <duration> | --until <iso> | --clear');
|
|
20
21
|
this.log('');
|
|
21
22
|
this.log('Every command takes a lease id (or `self` on the machine) and --json.');
|
|
@@ -80,7 +80,7 @@ class DedicatedMachinesPowerSet extends dedicated_lease_command_1.DedicatedLease
|
|
|
80
80
|
this.log(JSON.stringify({ ok: false, ...refusal }, null, 2));
|
|
81
81
|
}
|
|
82
82
|
else {
|
|
83
|
-
this.log(`
|
|
83
|
+
this.log(`On demand is not available for ${leaseId}: ${refusal.reason}`);
|
|
84
84
|
this.log(` ${refusal.detail}`);
|
|
85
85
|
this.log(` Fix: ${refusal.fix}`);
|
|
86
86
|
this.log(' The power policy was not changed.');
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DedicatedLeaseCommand } from '../../../../lib/dedicated-lease-command';
|
|
2
|
+
/** `skrr machines dedicated power waiting` — what is waiting for this machine. Read-only. */
|
|
3
|
+
export default class DedicatedMachinesPowerWaiting extends DedicatedLeaseCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static args: {
|
|
7
|
+
lease: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
8
|
+
};
|
|
9
|
+
static flags: {
|
|
10
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const dedicated_lease_command_1 = require("../../../../lib/dedicated-lease-command");
|
|
5
|
+
const dedicated_power_1 = require("../../../../lib/dedicated-power");
|
|
6
|
+
/** `skrr machines dedicated power waiting` — what is waiting for this machine. Read-only. */
|
|
7
|
+
class DedicatedMachinesPowerWaiting extends dedicated_lease_command_1.DedicatedLeaseCommand {
|
|
8
|
+
static description = 'List work waiting for a Dedicated Runtime: parked trigger fires and runs, queued runs, and work just aimed at it. Derived from the schedulers own records. A source that cannot be read is said, not read as nothing waiting. Read-only.';
|
|
9
|
+
static examples = [
|
|
10
|
+
'<%= config.bin %> machines dedicated power waiting <lease-id>',
|
|
11
|
+
'<%= config.bin %> machines dedicated power waiting self --json',
|
|
12
|
+
];
|
|
13
|
+
static args = {
|
|
14
|
+
lease: core_1.Args.string({
|
|
15
|
+
description: dedicated_lease_command_1.DEDICATED_LEASE_ARG_DESCRIPTION,
|
|
16
|
+
required: true,
|
|
17
|
+
ignoreStdin: true,
|
|
18
|
+
}),
|
|
19
|
+
};
|
|
20
|
+
static flags = {
|
|
21
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
22
|
+
};
|
|
23
|
+
async run() {
|
|
24
|
+
this.requireAuth();
|
|
25
|
+
const { args, flags } = await this.parse(DedicatedMachinesPowerWaiting);
|
|
26
|
+
const leaseId = await this.resolveLeaseArg(args.lease);
|
|
27
|
+
const waiting = await this.callDedicated(() => (0, dedicated_power_1.getDedicatedWaitingWork)(leaseId, this.scopeFrom(flags)));
|
|
28
|
+
if (flags.json) {
|
|
29
|
+
this.log(JSON.stringify(waiting, null, 2));
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
for (const line of (0, dedicated_power_1.describeWaitingWork)(waiting))
|
|
33
|
+
this.log(line);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.default = DedicatedMachinesPowerWaiting;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BaseCommand } from '../base-command';
|
|
2
|
+
/**
|
|
3
|
+
* Open a Skrr web page in the browser: a URL someone sent you, a site path, or
|
|
4
|
+
* a typed reference such as `space:<id>` or `listing:<agentId>`.
|
|
5
|
+
*
|
|
6
|
+
* Not signed-in on purpose: a link is an address, not a permission — the page
|
|
7
|
+
* itself decides what the viewer sees. The one API read it can make is the
|
|
8
|
+
* anonymous share-code resolve, for an app-scheme link that names nothing but
|
|
9
|
+
* a code.
|
|
10
|
+
* Like every `<entity> open`, a non-interactive shell (a pipe, a script, an
|
|
11
|
+
* agent) gets the URL printed instead of a browser it cannot see.
|
|
12
|
+
*/
|
|
13
|
+
export default class Open extends BaseCommand {
|
|
14
|
+
static description: string;
|
|
15
|
+
static examples: string[];
|
|
16
|
+
static args: {
|
|
17
|
+
target: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
18
|
+
};
|
|
19
|
+
static flags: {
|
|
20
|
+
print: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
21
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
22
|
+
};
|
|
23
|
+
run(): Promise<void>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
|
+
const base_command_1 = require("../base-command");
|
|
6
|
+
const entity_open_1 = require("../lib/entity-open");
|
|
7
|
+
const open_target_1 = require("../lib/open-target");
|
|
8
|
+
/**
|
|
9
|
+
* Open a Skrr web page in the browser: a URL someone sent you, a site path, or
|
|
10
|
+
* a typed reference such as `space:<id>` or `listing:<agentId>`.
|
|
11
|
+
*
|
|
12
|
+
* Not signed-in on purpose: a link is an address, not a permission — the page
|
|
13
|
+
* itself decides what the viewer sees. The one API read it can make is the
|
|
14
|
+
* anonymous share-code resolve, for an app-scheme link that names nothing but
|
|
15
|
+
* a code.
|
|
16
|
+
* Like every `<entity> open`, a non-interactive shell (a pipe, a script, an
|
|
17
|
+
* agent) gets the URL printed instead of a browser it cannot see.
|
|
18
|
+
*/
|
|
19
|
+
class Open extends base_command_1.BaseCommand {
|
|
20
|
+
static description = `Open a ${data_provider_1.BRAND.displayName} URL, site path or <kind>:<id> reference in the browser (--print to only print the URL)`;
|
|
21
|
+
static examples = [
|
|
22
|
+
'<%= config.bin %> open https://skrr.ai/a/agent_abc123',
|
|
23
|
+
'<%= config.bin %> open listing:agent_abc123',
|
|
24
|
+
'<%= config.bin %> open skrr://agent/agent_abc123',
|
|
25
|
+
'<%= config.bin %> open space:sp_123 --print',
|
|
26
|
+
'<%= config.bin %> open /spaces/sp_123/tasks --json',
|
|
27
|
+
];
|
|
28
|
+
static args = {
|
|
29
|
+
target: core_1.Args.string({
|
|
30
|
+
required: true,
|
|
31
|
+
ignoreStdin: true,
|
|
32
|
+
description: `A ${data_provider_1.BRAND.displayName} URL, a site path (/…), <kind>:<id> (${open_target_1.OPEN_REF_KINDS.join(', ')}), or an agent id or skrr:// link (opens its listing)`,
|
|
33
|
+
}),
|
|
34
|
+
};
|
|
35
|
+
static flags = {
|
|
36
|
+
print: core_1.Flags.boolean({ char: 'p', description: 'Print the URL without opening a browser' }),
|
|
37
|
+
json: core_1.Flags.boolean({ description: 'Print {url, form, opened} as JSON without opening' }),
|
|
38
|
+
};
|
|
39
|
+
async run() {
|
|
40
|
+
const { args, flags } = await this.parse(Open);
|
|
41
|
+
let resolved;
|
|
42
|
+
try {
|
|
43
|
+
resolved = await (0, open_target_1.resolveOpenTarget)(args.target, this.cliConfig.baseURL);
|
|
44
|
+
}
|
|
45
|
+
catch (err) {
|
|
46
|
+
if (err instanceof open_target_1.OpenTargetError) {
|
|
47
|
+
this.failWithCliError({ message: err.message, code: err.code, exit: 1, retryable: false });
|
|
48
|
+
}
|
|
49
|
+
throw err;
|
|
50
|
+
}
|
|
51
|
+
const launch = !flags.print && !flags.json && Boolean(process.stdout.isTTY);
|
|
52
|
+
if (launch) {
|
|
53
|
+
try {
|
|
54
|
+
await (0, entity_open_1.launchEntityUrl)(resolved.url, 'web');
|
|
55
|
+
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
// Say what failed and still hand over the URL — the person can open it.
|
|
58
|
+
this.failWithCliError({
|
|
59
|
+
message: `Could not open a browser (${err.message}). The URL: ${resolved.url}`,
|
|
60
|
+
code: 'OPEN_BROWSER_FAILED',
|
|
61
|
+
exit: 1,
|
|
62
|
+
retryable: true,
|
|
63
|
+
details: { url: resolved.url },
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (flags.json) {
|
|
68
|
+
this.log(JSON.stringify({ ...resolved, opened: launch }, null, 2));
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
this.log(launch ? `Opened browser: ${resolved.url}` : resolved.url);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.default = Open;
|
|
@@ -14,6 +14,7 @@ export default class ProjectsArchive extends BaseCommand {
|
|
|
14
14
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
15
|
space: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
16
16
|
unarchive: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
17
|
+
'dry-run': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
17
18
|
};
|
|
18
19
|
run(): Promise<void>;
|
|
19
20
|
}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const core_1 = require("@oclif/core");
|
|
4
4
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
5
|
const base_command_1 = require("../../base-command");
|
|
6
|
+
const dry_run_plans_1 = require("../../lib/dry-run-plans");
|
|
6
7
|
/**
|
|
7
8
|
* Same verb shape as `goals archive` — one command, `--unarchive` to restore.
|
|
8
9
|
* Archive rides the DELETE route (which archives by default); unarchive is a
|
|
@@ -13,6 +14,7 @@ class ProjectsArchive extends base_command_1.BaseCommand {
|
|
|
13
14
|
static examples = [
|
|
14
15
|
'<%= config.bin %> projects archive <project-id> --space <space>',
|
|
15
16
|
'<%= config.bin %> projects archive <project-id> --space <space> --unarchive',
|
|
17
|
+
'<%= config.bin %> projects archive <project-id> --space <space> --dry-run --json',
|
|
16
18
|
];
|
|
17
19
|
static args = {
|
|
18
20
|
id: core_1.Args.string({
|
|
@@ -27,11 +29,32 @@ class ProjectsArchive extends base_command_1.BaseCommand {
|
|
|
27
29
|
description: 'Owning space — id, ref, or name. Needed only for a bare ref (OSK-P-12); an id or a qualified ref `<space>/<project>` resolves on its own.',
|
|
28
30
|
}),
|
|
29
31
|
unarchive: core_1.Flags.boolean({ description: 'Unarchive the project instead of archiving it' }),
|
|
32
|
+
'dry-run': core_1.Flags.boolean({
|
|
33
|
+
description: 'Read the project and print what would change without changing it',
|
|
34
|
+
}),
|
|
30
35
|
};
|
|
31
36
|
async run() {
|
|
32
37
|
this.requireAuth();
|
|
33
38
|
const { args, flags } = await this.parse(ProjectsArchive);
|
|
34
39
|
const { projectRef, spaceId } = await this.resolveProjectReference(args.id, flags.space);
|
|
40
|
+
if (flags['dry-run']) {
|
|
41
|
+
let project;
|
|
42
|
+
try {
|
|
43
|
+
project = (await data_provider_1.dataService.getSpaceProject(spaceId, projectRef));
|
|
44
|
+
}
|
|
45
|
+
catch (err) {
|
|
46
|
+
this.handleApiError(err, { subject: `project ${projectRef}` });
|
|
47
|
+
}
|
|
48
|
+
const plan = (0, dry_run_plans_1.planProjectChange)(flags.unarchive ? 'unarchive' : 'archive', project, projectRef);
|
|
49
|
+
if (flags.json)
|
|
50
|
+
this.log(JSON.stringify(plan, null, 2));
|
|
51
|
+
else {
|
|
52
|
+
this.log(`Dry run: would ${plan.action} project ${projectRef}. Nothing was changed.`);
|
|
53
|
+
for (const note of plan.notes)
|
|
54
|
+
this.log(`Note: ${note}`);
|
|
55
|
+
}
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
35
58
|
let result;
|
|
36
59
|
try {
|
|
37
60
|
result = flags.unarchive
|
|
@@ -13,6 +13,7 @@ export default class ProjectsDelete extends BaseCommand {
|
|
|
13
13
|
static flags: {
|
|
14
14
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
15
|
space: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
16
|
+
'dry-run': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
16
17
|
yes: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
17
18
|
};
|
|
18
19
|
run(): Promise<void>;
|
|
@@ -4,6 +4,7 @@ const core_1 = require("@oclif/core");
|
|
|
4
4
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
5
|
const base_command_1 = require("../../base-command");
|
|
6
6
|
const prompt_1 = require("../../lib/prompt");
|
|
7
|
+
const dry_run_plans_1 = require("../../lib/dry-run-plans");
|
|
7
8
|
/**
|
|
8
9
|
* Hard delete (`?mode=delete`): removes the project and detaches member
|
|
9
10
|
* tasks/goals (invariant P3 — never cascades into the work itself). The
|
|
@@ -14,6 +15,7 @@ class ProjectsDelete extends base_command_1.BaseCommand {
|
|
|
14
15
|
static examples = [
|
|
15
16
|
'<%= config.bin %> projects delete <project-id> --space <space>',
|
|
16
17
|
'<%= config.bin %> projects delete <project-id> --space <space> --yes',
|
|
18
|
+
'<%= config.bin %> projects delete <project-id> --space <space> --dry-run --json',
|
|
17
19
|
];
|
|
18
20
|
static args = {
|
|
19
21
|
id: core_1.Args.string({
|
|
@@ -27,6 +29,9 @@ class ProjectsDelete extends base_command_1.BaseCommand {
|
|
|
27
29
|
space: core_1.Flags.string({
|
|
28
30
|
description: 'Owning space — id, ref, or name. Needed only for a bare ref (OSK-P-12); an id or a qualified ref `<space>/<project>` resolves on its own.',
|
|
29
31
|
}),
|
|
32
|
+
'dry-run': core_1.Flags.boolean({
|
|
33
|
+
description: 'Read the project and print what a delete would remove and detach, without deleting or prompting',
|
|
34
|
+
}),
|
|
30
35
|
yes: core_1.Flags.boolean({
|
|
31
36
|
char: 'y',
|
|
32
37
|
aliases: ['force'],
|
|
@@ -37,6 +42,24 @@ class ProjectsDelete extends base_command_1.BaseCommand {
|
|
|
37
42
|
this.requireAuth();
|
|
38
43
|
const { args, flags } = await this.parse(ProjectsDelete);
|
|
39
44
|
const { projectRef, spaceId } = await this.resolveProjectReference(args.id, flags.space);
|
|
45
|
+
if (flags['dry-run']) {
|
|
46
|
+
let project;
|
|
47
|
+
try {
|
|
48
|
+
project = (await data_provider_1.dataService.getSpaceProject(spaceId, projectRef));
|
|
49
|
+
}
|
|
50
|
+
catch (err) {
|
|
51
|
+
this.handleApiError(err, { subject: `project ${projectRef}` });
|
|
52
|
+
}
|
|
53
|
+
const plan = (0, dry_run_plans_1.planProjectChange)('delete', project, projectRef);
|
|
54
|
+
if (flags.json)
|
|
55
|
+
this.log(JSON.stringify(plan, null, 2));
|
|
56
|
+
else {
|
|
57
|
+
const detached = plan.changes
|
|
58
|
+
.detachedTasksEstimate;
|
|
59
|
+
this.log(`Dry run: would permanently delete project ${projectRef} and detach ${detached ?? 'its'} task(s). Nothing was changed.`);
|
|
60
|
+
}
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
40
63
|
let confirmed;
|
|
41
64
|
try {
|
|
42
65
|
confirmed = await (0, prompt_1.confirmDestructive)(`Delete project ${projectRef}? Member tasks and goals are detached, not deleted. This cannot be undone.`, flags.yes);
|
|
@@ -16,6 +16,9 @@ export default class ProjectsList extends BaseCommand {
|
|
|
16
16
|
space: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
17
17
|
};
|
|
18
18
|
static flags: {
|
|
19
|
+
fields: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
20
|
+
compact: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
21
|
+
ndjson: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
19
22
|
space: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
20
23
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
21
24
|
'include-archived': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
@@ -5,6 +5,7 @@ const data_provider_1 = require("@skrr-ai/data-provider");
|
|
|
5
5
|
const base_command_1 = require("../../base-command");
|
|
6
6
|
const space_argument_1 = require("../../lib/space-argument");
|
|
7
7
|
const format_1 = require("../../lib/format");
|
|
8
|
+
const list_output_1 = require("../../lib/list-output");
|
|
8
9
|
const projects_1 = require("../../lib/projects");
|
|
9
10
|
/**
|
|
10
11
|
* `skrr projects list [space]` — the projects in a space, or across every space
|
|
@@ -23,6 +24,7 @@ class ProjectsList extends base_command_1.BaseCommand {
|
|
|
23
24
|
'<%= config.bin %> projects list --q "billing"',
|
|
24
25
|
'<%= config.bin %> projects list <space> --include-archived',
|
|
25
26
|
'<%= config.bin %> projects list --q billing --json',
|
|
27
|
+
'<%= config.bin %> projects list <space> --compact --json',
|
|
26
28
|
];
|
|
27
29
|
static args = {
|
|
28
30
|
space: core_1.Args.string({
|
|
@@ -41,6 +43,7 @@ class ProjectsList extends base_command_1.BaseCommand {
|
|
|
41
43
|
description: 'Case-insensitive match on title, description, or ref. Searches every visible space unless one is named.',
|
|
42
44
|
}),
|
|
43
45
|
limit: core_1.Flags.integer({ description: 'Max results when searching (1-200)', default: 50 }),
|
|
46
|
+
...list_output_1.listOutputFlags,
|
|
44
47
|
};
|
|
45
48
|
async run() {
|
|
46
49
|
this.requireAuth();
|
|
@@ -73,8 +76,15 @@ class ProjectsList extends base_command_1.BaseCommand {
|
|
|
73
76
|
catch (err) {
|
|
74
77
|
this.handleApiError(err, { subject: spaceId ? `space ${spaceId}` : 'projects' });
|
|
75
78
|
}
|
|
76
|
-
if (flags.json) {
|
|
77
|
-
|
|
79
|
+
if (flags.json || flags.ndjson) {
|
|
80
|
+
// P3: the in-space list answered a bare `{data}` while the cross-space
|
|
81
|
+
// search answered a full envelope. One shape for both; `data` stays.
|
|
82
|
+
this.printList((0, list_output_1.shapeListResponse)(response, {
|
|
83
|
+
resource: 'project',
|
|
84
|
+
fields: flags.fields,
|
|
85
|
+
compact: flags.compact,
|
|
86
|
+
requestedLimit: crossSpace ? flags.limit : undefined,
|
|
87
|
+
}), Boolean(flags.ndjson));
|
|
78
88
|
return;
|
|
79
89
|
}
|
|
80
90
|
// Qualify the ref only when rows can come from more than one space —
|
|
@@ -25,6 +25,7 @@ class SpacesActionsAdd extends base_command_1.BaseCommand {
|
|
|
25
25
|
async run() {
|
|
26
26
|
this.requireAuth();
|
|
27
27
|
const { args, flags } = await this.parse(SpacesActionsAdd);
|
|
28
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
28
29
|
let body = {};
|
|
29
30
|
try {
|
|
30
31
|
body = await (0, prompt_1.readJsonBody)(flags['from-json']);
|
|
@@ -52,7 +53,7 @@ class SpacesActionsAdd extends base_command_1.BaseCommand {
|
|
|
52
53
|
let result;
|
|
53
54
|
try {
|
|
54
55
|
result = await data_provider_1.dataService.addSpaceCustomAction({
|
|
55
|
-
spaceId:
|
|
56
|
+
spaceId: spaceRef,
|
|
56
57
|
action: payload,
|
|
57
58
|
});
|
|
58
59
|
}
|
|
@@ -65,12 +66,12 @@ class SpacesActionsAdd extends base_command_1.BaseCommand {
|
|
|
65
66
|
// returns just the action. A create returns the thing it created.
|
|
66
67
|
const stored = (result?.customActions ?? []).find((action) => action.id === payload.id) ?? payload;
|
|
67
68
|
if (flags.json)
|
|
68
|
-
this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL,
|
|
69
|
+
this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL, spaceRef, 'actions', stored, ['id']), null, 2));
|
|
69
70
|
else
|
|
70
71
|
this.log(`Added custom action ${String(payload.id)}.`);
|
|
71
72
|
// On stderr, so `--json` stays parseable: the action was saved, and still
|
|
72
73
|
// cannot run until the space has a Leader (OSK-9641).
|
|
73
|
-
const unrunnable = (0, space_custom_actions_1.spaceActionsNotRunnableReason)({ id:
|
|
74
|
+
const unrunnable = (0, space_custom_actions_1.spaceActionsNotRunnableReason)({ id: spaceRef, leadAgentId: result?.leadAgentId }, this.config.bin);
|
|
74
75
|
if (unrunnable)
|
|
75
76
|
this.warn(unrunnable);
|
|
76
77
|
}
|
|
@@ -25,9 +25,10 @@ class SpacesActionsAvailable extends base_command_1.BaseCommand {
|
|
|
25
25
|
async run() {
|
|
26
26
|
this.requireAuth();
|
|
27
27
|
const { args, flags } = await this.parse(SpacesActionsAvailable);
|
|
28
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
28
29
|
let response;
|
|
29
30
|
try {
|
|
30
|
-
response = await data_provider_1.dataService.listSpaceAvailableActions(
|
|
31
|
+
response = await data_provider_1.dataService.listSpaceAvailableActions(spaceRef);
|
|
31
32
|
}
|
|
32
33
|
catch (err) {
|
|
33
34
|
this.handleApiError(err);
|
|
@@ -54,7 +55,7 @@ class SpacesActionsAvailable extends base_command_1.BaseCommand {
|
|
|
54
55
|
// The REF is for two commands, and they need different rights: attaching
|
|
55
56
|
// works for any space member, running needs VIEW on the agent (OSK-9663).
|
|
56
57
|
this.log('Attach to a task: skrr tasks actions attach <task-id> <agentId>:<actionId>');
|
|
57
|
-
this.log(`Run one in this space: skrr spaces actions run ${
|
|
58
|
+
this.log(`Run one in this space: skrr spaces actions run ${spaceRef} <agentId>:<actionId> (needs access to the agent; see what you can run with: skrr spaces actions list ${spaceRef} --all)`);
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
61
|
exports.default = SpacesActionsAvailable;
|
|
@@ -24,9 +24,10 @@ class SpacesActionsList extends base_command_1.BaseCommand {
|
|
|
24
24
|
async run() {
|
|
25
25
|
this.requireAuth();
|
|
26
26
|
const { args, flags } = await this.parse(SpacesActionsList);
|
|
27
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
27
28
|
let space;
|
|
28
29
|
try {
|
|
29
|
-
space = await data_provider_1.dataService.getSpace(
|
|
30
|
+
space = await data_provider_1.dataService.getSpace(spaceRef);
|
|
30
31
|
}
|
|
31
32
|
catch (err) {
|
|
32
33
|
this.handleApiError(err);
|
|
@@ -35,12 +36,12 @@ class SpacesActionsList extends base_command_1.BaseCommand {
|
|
|
35
36
|
if (flags.all)
|
|
36
37
|
return this.listAll(space, flags.json);
|
|
37
38
|
if (flags.json)
|
|
38
|
-
return void this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL,
|
|
39
|
+
return void this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL, spaceRef, 'actions', { data: actions }, [
|
|
39
40
|
'id',
|
|
40
41
|
]), null, 2));
|
|
41
42
|
if (!actions.length) {
|
|
42
43
|
this.log('No custom actions.');
|
|
43
|
-
this.log(`Agent actions offered here: ${this.config.bin} spaces actions list ${
|
|
44
|
+
this.log(`Agent actions offered here: ${this.config.bin} spaces actions list ${spaceRef} --all`);
|
|
44
45
|
return;
|
|
45
46
|
}
|
|
46
47
|
(0, format_1.renderTable)(actions.map((a) => ({
|
|
@@ -57,7 +58,7 @@ class SpacesActionsList extends base_command_1.BaseCommand {
|
|
|
57
58
|
{ key: 'id', header: 'ID' },
|
|
58
59
|
], (line) => this.log(line));
|
|
59
60
|
this.noteUnrunnable(space);
|
|
60
|
-
this.log(`Agent actions offered here too: ${this.config.bin} spaces actions list ${
|
|
61
|
+
this.log(`Agent actions offered here too: ${this.config.bin} spaces actions list ${spaceRef} --all`);
|
|
61
62
|
}
|
|
62
63
|
/** Say, on stderr, when none of the listed space actions can run. */
|
|
63
64
|
noteUnrunnable(space) {
|
|
@@ -24,6 +24,7 @@ class SpacesActionsReplace extends base_command_1.BaseCommand {
|
|
|
24
24
|
async run() {
|
|
25
25
|
this.requireAuth();
|
|
26
26
|
const { args, flags } = await this.parse(SpacesActionsReplace);
|
|
27
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
27
28
|
let raw;
|
|
28
29
|
try {
|
|
29
30
|
raw = await (0, prompt_1.readJsonValue)(flags['from-json']);
|
|
@@ -37,19 +38,19 @@ class SpacesActionsReplace extends base_command_1.BaseCommand {
|
|
|
37
38
|
if (flags['dry-run']) {
|
|
38
39
|
const output = {
|
|
39
40
|
dryRun: true,
|
|
40
|
-
spaceId:
|
|
41
|
+
spaceId: spaceRef,
|
|
41
42
|
actions,
|
|
42
43
|
expectedActionIds: flags['expected-id'] ?? [],
|
|
43
44
|
};
|
|
44
45
|
this.log(flags.json
|
|
45
46
|
? JSON.stringify(output, null, 2)
|
|
46
|
-
: `Dry run: would replace custom actions for space ${
|
|
47
|
+
: `Dry run: would replace custom actions for space ${spaceRef}.`);
|
|
47
48
|
return;
|
|
48
49
|
}
|
|
49
50
|
let result;
|
|
50
51
|
try {
|
|
51
52
|
result = await data_provider_1.dataService.replaceSpaceCustomActions({
|
|
52
|
-
spaceId:
|
|
53
|
+
spaceId: spaceRef,
|
|
53
54
|
actions: actions,
|
|
54
55
|
expectedActionIds: flags['expected-id'],
|
|
55
56
|
});
|
|
@@ -58,9 +59,9 @@ class SpacesActionsReplace extends base_command_1.BaseCommand {
|
|
|
58
59
|
this.handleApiError(err);
|
|
59
60
|
}
|
|
60
61
|
if (flags.json)
|
|
61
|
-
this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL,
|
|
62
|
+
this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL, spaceRef, 'actions', result, ['id']), null, 2));
|
|
62
63
|
else
|
|
63
|
-
this.log(`Replaced custom actions for space ${
|
|
64
|
+
this.log(`Replaced custom actions for space ${spaceRef}.`);
|
|
64
65
|
}
|
|
65
66
|
}
|
|
66
67
|
exports.default = SpacesActionsReplace;
|
|
@@ -16,9 +16,10 @@ class SpacesArchive extends base_command_1.BaseCommand {
|
|
|
16
16
|
async run() {
|
|
17
17
|
this.requireAuth();
|
|
18
18
|
const { args, flags } = await this.parse(SpacesArchive);
|
|
19
|
+
const spaceId = await this.resolveEntityRef('space', args.id);
|
|
19
20
|
let updated;
|
|
20
21
|
try {
|
|
21
|
-
updated = await data_provider_1.dataService.archiveSpace(
|
|
22
|
+
updated = await data_provider_1.dataService.archiveSpace(spaceId);
|
|
22
23
|
}
|
|
23
24
|
catch (err) {
|
|
24
25
|
this.handleApiError(err);
|
|
@@ -28,7 +29,7 @@ class SpacesArchive extends base_command_1.BaseCommand {
|
|
|
28
29
|
return;
|
|
29
30
|
}
|
|
30
31
|
const s = updated;
|
|
31
|
-
this.log(`Archived space ${s.id ?? s._id ??
|
|
32
|
+
this.log(`Archived space ${s.id ?? s._id ?? spaceId} - ${s.title ?? '(no title)'}`);
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
35
|
exports.default = SpacesArchive;
|
|
@@ -21,15 +21,16 @@ class SpacesAutoExecutorPreview extends base_command_1.BaseCommand {
|
|
|
21
21
|
// ignored, and raw JSON printed unconditionally. There was no readable
|
|
22
22
|
// rendering of a preview anywhere in the CLI.
|
|
23
23
|
const { args, flags } = await this.parse(SpacesAutoExecutorPreview);
|
|
24
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
24
25
|
let result;
|
|
25
26
|
try {
|
|
26
|
-
result = (await data_provider_1.dataService.previewSpaceAutoExecutor(
|
|
27
|
+
result = (await data_provider_1.dataService.previewSpaceAutoExecutor(spaceRef));
|
|
27
28
|
}
|
|
28
29
|
catch (err) {
|
|
29
30
|
this.handleApiError(err);
|
|
30
31
|
}
|
|
31
32
|
if (flags.json) {
|
|
32
|
-
this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL,
|
|
33
|
+
this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'execution', { result }), null, 2));
|
|
33
34
|
return;
|
|
34
35
|
}
|
|
35
36
|
const { space, plan } = result;
|
|
@@ -37,7 +38,7 @@ class SpacesAutoExecutorPreview extends base_command_1.BaseCommand {
|
|
|
37
38
|
this.log('No plan was returned for this space.');
|
|
38
39
|
return;
|
|
39
40
|
}
|
|
40
|
-
this.log(`Space: ${space.title ??
|
|
41
|
+
this.log(`Space: ${space.title ?? spaceRef}`);
|
|
41
42
|
this.log(`Autopilot: ${space.autoExecuteEnabled ? 'enabled' : 'disabled'}` +
|
|
42
43
|
(space.autoExecuteLifecycleState === 'sleeping'
|
|
43
44
|
? ` (sleeping${space.autoExecuteSuspensionReason ? `: ${String(space.autoExecuteSuspensionReason).replace(/_/g, ' ')}` : ''})`
|