@skrr-ai/cli 0.1.108 → 0.1.110
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/README.md +10 -0
- package/dist/base-command.d.ts +74 -0
- package/dist/base-command.js +182 -24
- package/dist/commands/agents/triggers/create.js +1 -1
- package/dist/commands/agents/triggers/update.js +1 -1
- package/dist/commands/agents/update.d.ts +25 -0
- package/dist/commands/agents/update.js +98 -3
- package/dist/commands/commitments/accounting.js +7 -2
- package/dist/commands/commitments/cost.d.ts +11 -0
- package/dist/commands/commitments/cost.js +26 -3
- package/dist/commands/commitments/create.js +2 -1
- package/dist/commands/commitments/operating-review.d.ts +15 -0
- package/dist/commands/commitments/operating-review.js +103 -50
- package/dist/commands/commitments/update.js +12 -5
- package/dist/commands/daemon/install.js +17 -1
- package/dist/commands/daemon/login.js +14 -0
- package/dist/commands/doctor.js +9 -0
- package/dist/commands/goals/list.js +6 -1
- package/dist/commands/grants/rotate.js +4 -0
- package/dist/commands/harnesses/prune.d.ts +26 -0
- package/dist/commands/harnesses/prune.js +172 -0
- package/dist/commands/login.js +53 -14
- package/dist/commands/machines/list.js +28 -6
- package/dist/commands/projects/show.js +1 -1
- package/dist/commands/revoke-daemon.js +2 -1
- package/dist/commands/spaces/workflows/archive.d.ts +1 -0
- package/dist/commands/spaces/workflows/archive.js +1 -0
- package/dist/commands/spaces/workflows/artifact.d.ts +1 -0
- package/dist/commands/spaces/workflows/artifact.js +1 -0
- package/dist/commands/spaces/workflows/cancel-node.d.ts +1 -0
- package/dist/commands/spaces/workflows/cancel-node.js +1 -0
- package/dist/commands/spaces/workflows/cancel.d.ts +1 -0
- package/dist/commands/spaces/workflows/cancel.js +6 -2
- package/dist/commands/spaces/workflows/create.d.ts +1 -0
- package/dist/commands/spaces/workflows/create.js +7 -1
- package/dist/commands/spaces/workflows/events.d.ts +1 -0
- package/dist/commands/spaces/workflows/events.js +1 -0
- package/dist/commands/spaces/workflows/fixtures/create.d.ts +1 -0
- package/dist/commands/spaces/workflows/fixtures/create.js +1 -0
- package/dist/commands/spaces/workflows/fixtures/list.d.ts +1 -0
- package/dist/commands/spaces/workflows/fixtures/list.js +1 -0
- package/dist/commands/spaces/workflows/lifecycle-diagnostics.d.ts +1 -0
- package/dist/commands/spaces/workflows/lifecycle-diagnostics.js +1 -0
- package/dist/commands/spaces/workflows/list.d.ts +1 -0
- package/dist/commands/spaces/workflows/list.js +1 -0
- package/dist/commands/spaces/workflows/node-types.d.ts +2 -0
- package/dist/commands/spaces/workflows/node-types.js +24 -6
- package/dist/commands/spaces/workflows/pause.d.ts +1 -0
- package/dist/commands/spaces/workflows/pause.js +1 -0
- package/dist/commands/spaces/workflows/plan/show.d.ts +1 -0
- package/dist/commands/spaces/workflows/plan/show.js +1 -0
- package/dist/commands/spaces/workflows/plan/update.d.ts +1 -0
- package/dist/commands/spaces/workflows/plan/update.js +1 -0
- package/dist/commands/spaces/workflows/proposals/apply.d.ts +1 -0
- package/dist/commands/spaces/workflows/proposals/apply.js +1 -0
- package/dist/commands/spaces/workflows/proposals/confirm.d.ts +1 -0
- package/dist/commands/spaces/workflows/proposals/confirm.js +1 -0
- package/dist/commands/spaces/workflows/proposals/create.d.ts +1 -0
- package/dist/commands/spaces/workflows/proposals/create.js +1 -0
- package/dist/commands/spaces/workflows/proposals/dismiss.d.ts +1 -0
- package/dist/commands/spaces/workflows/proposals/dismiss.js +1 -0
- package/dist/commands/spaces/workflows/proposals/list.d.ts +1 -0
- package/dist/commands/spaces/workflows/proposals/list.js +1 -0
- package/dist/commands/spaces/workflows/publish.d.ts +1 -0
- package/dist/commands/spaces/workflows/publish.js +9 -0
- package/dist/commands/spaces/workflows/reconcile.d.ts +1 -0
- package/dist/commands/spaces/workflows/reconcile.js +1 -0
- package/dist/commands/spaces/workflows/resume.d.ts +1 -0
- package/dist/commands/spaces/workflows/resume.js +1 -0
- package/dist/commands/spaces/workflows/retry.d.ts +1 -0
- package/dist/commands/spaces/workflows/retry.js +1 -0
- package/dist/commands/spaces/workflows/run.d.ts +1 -0
- package/dist/commands/spaces/workflows/run.js +14 -7
- package/dist/commands/spaces/workflows/runs.d.ts +1 -0
- package/dist/commands/spaces/workflows/runs.js +1 -0
- package/dist/commands/spaces/workflows/show.d.ts +25 -0
- package/dist/commands/spaces/workflows/show.js +42 -4
- package/dist/commands/spaces/workflows/signal.d.ts +12 -0
- package/dist/commands/spaces/workflows/signal.js +40 -2
- package/dist/commands/spaces/workflows/start.d.ts +1 -0
- package/dist/commands/spaces/workflows/start.js +4 -1
- package/dist/commands/spaces/workflows/task-execution/create.d.ts +1 -0
- package/dist/commands/spaces/workflows/task-execution/create.js +1 -0
- package/dist/commands/spaces/workflows/test.d.ts +1 -0
- package/dist/commands/spaces/workflows/test.js +1 -0
- package/dist/commands/spaces/workflows/triggers/create.d.ts +1 -0
- package/dist/commands/spaces/workflows/triggers/create.js +1 -0
- package/dist/commands/spaces/workflows/triggers/fire.d.ts +1 -0
- package/dist/commands/spaces/workflows/triggers/fire.js +1 -0
- package/dist/commands/spaces/workflows/triggers/list.d.ts +1 -0
- package/dist/commands/spaces/workflows/triggers/list.js +1 -0
- package/dist/commands/spaces/workflows/triggers/update.d.ts +1 -0
- package/dist/commands/spaces/workflows/triggers/update.js +1 -0
- package/dist/commands/spaces/workflows/update.d.ts +1 -0
- package/dist/commands/spaces/workflows/update.js +4 -0
- package/dist/commands/spaces/workflows/validate.d.ts +1 -0
- package/dist/commands/spaces/workflows/validate.js +27 -2
- package/dist/commands/tasks/activity.js +17 -3
- package/dist/commands/tasks/bulk-update.d.ts +1 -0
- package/dist/commands/tasks/bulk-update.js +7 -0
- package/dist/commands/tasks/complete.js +2 -1
- package/dist/commands/tasks/create-tree.d.ts +69 -0
- package/dist/commands/tasks/create-tree.js +413 -47
- package/dist/commands/tasks/list.d.ts +2 -0
- package/dist/commands/tasks/list.js +25 -3
- package/dist/commands/tasks/rearm-recurrence.d.ts +22 -0
- package/dist/commands/tasks/rearm-recurrence.js +87 -0
- package/dist/commands/tasks/show.d.ts +9 -0
- package/dist/commands/tasks/show.js +79 -33
- package/dist/commands/tasks/timeline.js +4 -0
- package/dist/commands/tasks/unschedule.js +5 -1
- package/dist/commands/tasks/update.d.ts +1 -0
- package/dist/commands/tasks/update.js +17 -2
- package/dist/commands/triggers/audit.js +12 -3
- package/dist/commands/triggers/create.js +9 -3
- package/dist/commands/triggers/fire-detail.d.ts +7 -0
- package/dist/commands/triggers/fire-detail.js +30 -12
- package/dist/commands/triggers/fire.js +13 -3
- package/dist/commands/triggers/parse-intent.d.ts +7 -0
- package/dist/commands/triggers/parse-intent.js +31 -9
- package/dist/commands/triggers/update.js +1 -1
- package/dist/commands/workspaces/grants.js +20 -3
- package/dist/commands/workspaces/members.d.ts +20 -0
- package/dist/commands/workspaces/members.js +64 -0
- package/dist/commands/workspaces/stewardship.js +14 -2
- package/dist/help.js +12 -0
- package/dist/hooks/command-not-found.js +27 -1
- package/dist/lib/command-miss.d.ts +52 -2
- package/dist/lib/command-miss.js +187 -18
- package/dist/lib/commitment-loop-status.d.ts +8 -0
- package/dist/lib/commitment-loop-status.js +45 -0
- package/dist/lib/commitment-product.js +5 -2
- package/dist/lib/commitments.d.ts +18 -3
- package/dist/lib/commitments.js +85 -45
- package/dist/lib/daemon-command-hint.d.ts +15 -0
- package/dist/lib/daemon-command-hint.js +21 -0
- package/dist/lib/daemon-machine-identity-copy.d.ts +14 -0
- package/dist/lib/daemon-machine-identity-copy.js +27 -0
- package/dist/lib/daemon-machine-identity.d.ts +27 -0
- package/dist/lib/daemon-machine-identity.js +61 -0
- package/dist/lib/daemon-setup.js +10 -1
- package/dist/lib/daemonBrokerRefusal.js +3 -2
- package/dist/lib/daemonHandoff.d.ts +19 -1
- package/dist/lib/daemonHandoff.js +61 -1
- package/dist/lib/deployed-build.d.ts +43 -0
- package/dist/lib/deployed-build.js +66 -0
- package/dist/lib/grants.d.ts +27 -1
- package/dist/lib/grants.js +39 -21
- package/dist/lib/harnesses.d.ts +71 -0
- package/dist/lib/harnesses.js +70 -0
- package/dist/lib/json-mode.d.ts +11 -0
- package/dist/lib/json-mode.js +19 -0
- package/dist/lib/json-output.d.ts +25 -0
- package/dist/lib/json-output.js +30 -0
- package/dist/lib/list-output.d.ts +10 -1
- package/dist/lib/list-output.js +22 -1
- package/dist/lib/local-daemon-readiness.d.ts +90 -0
- package/dist/lib/local-daemon-readiness.js +143 -0
- package/dist/lib/machines.d.ts +117 -0
- package/dist/lib/machines.js +139 -0
- package/dist/lib/managed-instruction-local.d.ts +2 -0
- package/dist/lib/managed-instruction-local.js +2 -0
- package/dist/lib/profile-machine-identity-guard.d.ts +18 -0
- package/dist/lib/profile-machine-identity-guard.js +39 -0
- package/dist/lib/request-field-flags.d.ts +20 -0
- package/dist/lib/request-field-flags.js +34 -0
- package/dist/lib/stewardship-output.d.ts +1 -1
- package/dist/lib/stewardship-output.js +26 -30
- package/dist/lib/task-batch.d.ts +61 -4
- package/dist/lib/task-batch.js +316 -80
- package/dist/lib/task-economics.d.ts +15 -0
- package/dist/lib/task-economics.js +39 -2
- package/dist/lib/task-recurrence-outcome.d.ts +6 -6
- package/dist/lib/task-recurrence-outcome.js +27 -3
- package/dist/lib/tasks.d.ts +39 -0
- package/dist/lib/tasks.js +132 -0
- package/dist/lib/triggers.d.ts +42 -1
- package/dist/lib/triggers.js +98 -2
- package/dist/lib/workflow-issues.d.ts +14 -0
- package/dist/lib/workflow-issues.js +32 -0
- package/dist/lib/workflow-run-view.d.ts +59 -0
- package/dist/lib/workflow-run-view.js +110 -0
- package/dist/lib/workspaces.d.ts +48 -4
- package/dist/lib/workspaces.js +55 -0
- package/dist/lib/write-target.d.ts +29 -0
- package/dist/lib/write-target.js +72 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +5 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/machineUuid.d.ts +60 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/machineUuid.js +130 -6
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/workspaceIsolationProbeWire.d.ts +51 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/workspaceIsolationProbeWire.js +50 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/machineUuid.d.ts +60 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/machineUuid.js +128 -6
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/workspaceIsolationProbeWire.d.ts +51 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/workspaceIsolationProbeWire.js +46 -0
- package/dist/node_modules/@skrr-ai/auth-core/package.json +11 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +7523 -7140
- package/oclif.manifest.json +473 -59
- package/package.json +28 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command';
|
|
2
|
+
/**
|
|
3
|
+
* Remove harness rows that a later registration of the same machine replaced.
|
|
4
|
+
*
|
|
5
|
+
* `harnesses forget` removes ONE row, and an agent pinned to it loses its pin.
|
|
6
|
+
* One machine had accumulated 93 rows from 15 daemons, 85 of them replaced, and
|
|
7
|
+
* `machines list` could fold them but nothing could remove them. This does, and
|
|
8
|
+
* only the ones that can be proven safe: the server decides, once, and says why
|
|
9
|
+
* it kept everything it kept.
|
|
10
|
+
*
|
|
11
|
+
* DRY RUN BY DEFAULT. `--yes` is the only thing that removes anything.
|
|
12
|
+
*/
|
|
13
|
+
export default class HarnessesPrune extends BaseCommand {
|
|
14
|
+
static summary: string;
|
|
15
|
+
static description: string;
|
|
16
|
+
static examples: string[];
|
|
17
|
+
static flags: {
|
|
18
|
+
yes: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
19
|
+
limit: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
20
|
+
'older-than': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
21
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
22
|
+
};
|
|
23
|
+
run(): Promise<void>;
|
|
24
|
+
private render;
|
|
25
|
+
private removeTable;
|
|
26
|
+
}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const base_command_1 = require("../../base-command");
|
|
5
|
+
const format_1 = require("../../lib/format");
|
|
6
|
+
const harnesses_1 = require("../../lib/harnesses");
|
|
7
|
+
/**
|
|
8
|
+
* Remove harness rows that a later registration of the same machine replaced.
|
|
9
|
+
*
|
|
10
|
+
* `harnesses forget` removes ONE row, and an agent pinned to it loses its pin.
|
|
11
|
+
* One machine had accumulated 93 rows from 15 daemons, 85 of them replaced, and
|
|
12
|
+
* `machines list` could fold them but nothing could remove them. This does, and
|
|
13
|
+
* only the ones that can be proven safe: the server decides, once, and says why
|
|
14
|
+
* it kept everything it kept.
|
|
15
|
+
*
|
|
16
|
+
* DRY RUN BY DEFAULT. `--yes` is the only thing that removes anything.
|
|
17
|
+
*/
|
|
18
|
+
class HarnessesPrune extends base_command_1.BaseCommand {
|
|
19
|
+
static summary = 'Remove harness rows that a newer registration of the same machine replaced (dry run unless --yes)';
|
|
20
|
+
static description = 'A machine registers a fresh row per provider each time its daemon identity changes (a profile, a ' +
|
|
21
|
+
'working directory, a service versus a terminal), and the old rows stay. This removes the ones that ' +
|
|
22
|
+
'are provably stale and shows every one it keeps, with the reason.\n\n' +
|
|
23
|
+
'It is a DRY RUN until you pass --yes. A row is removed only if ALL of these hold: it is yours; it is ' +
|
|
24
|
+
'a daemon you run yourself (never a hosted, dedicated or cloud machine); it is not online and has not ' +
|
|
25
|
+
'been seen within --older-than; a later row of the same provider on the same machine replaced it AND ' +
|
|
26
|
+
"that replacement is online now; and nothing depends on it - no agent (yours or anyone's) is pinned " +
|
|
27
|
+
'to it, no workspace has it lent, it is not your default, and you did not give it a name.\n\n' +
|
|
28
|
+
'An agent pinned to a replaced row keeps running only because the platform adopts the live row ' +
|
|
29
|
+
'beside it, and that adoption starts from the old row; remove the row and the pin is gone. So a ' +
|
|
30
|
+
'pinned row is KEPT, with the agents named. Move the pin (`agents attach-harness`) and run this again.\n\n' +
|
|
31
|
+
'At most --limit rows are removed per run, oldest first; the rest are counted and the next run takes ' +
|
|
32
|
+
'them. Running it again when nothing qualifies removes nothing. A daemon that is still running ' +
|
|
33
|
+
're-registers on its next connection, so removing a row never stops a machine.';
|
|
34
|
+
static examples = [
|
|
35
|
+
'<%= config.bin %> harnesses prune',
|
|
36
|
+
'<%= config.bin %> harnesses prune --yes',
|
|
37
|
+
'<%= config.bin %> harnesses prune --yes --limit 20',
|
|
38
|
+
'<%= config.bin %> harnesses prune --older-than 7d --json',
|
|
39
|
+
];
|
|
40
|
+
static flags = {
|
|
41
|
+
yes: core_1.Flags.boolean({
|
|
42
|
+
description: 'Remove the rows listed. Without it nothing is removed.',
|
|
43
|
+
default: false,
|
|
44
|
+
}),
|
|
45
|
+
limit: core_1.Flags.integer({
|
|
46
|
+
description: 'Remove at most this many rows in one run (1-200, default 50). The rest wait for the next run.',
|
|
47
|
+
min: 1,
|
|
48
|
+
max: 200,
|
|
49
|
+
}),
|
|
50
|
+
'older-than': core_1.Flags.string({
|
|
51
|
+
description: 'Only rows unseen for at least this long: 90m, 36h or 7d (default 24h). The server never goes below its offline window.',
|
|
52
|
+
}),
|
|
53
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
54
|
+
};
|
|
55
|
+
async run() {
|
|
56
|
+
this.requireAuth();
|
|
57
|
+
const { flags } = await this.parse(HarnessesPrune);
|
|
58
|
+
let minUnseenMs;
|
|
59
|
+
if (flags['older-than'] !== undefined) {
|
|
60
|
+
try {
|
|
61
|
+
minUnseenMs = (0, harnesses_1.parseHarnessPruneAge)(flags['older-than']);
|
|
62
|
+
}
|
|
63
|
+
catch (err) {
|
|
64
|
+
this.error(err.message, { exit: 2 });
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
let result;
|
|
69
|
+
try {
|
|
70
|
+
result = await (0, harnesses_1.pruneHarnesses)({
|
|
71
|
+
dryRun: !flags.yes,
|
|
72
|
+
...(flags.limit !== undefined ? { limit: flags.limit } : {}),
|
|
73
|
+
...(minUnseenMs !== undefined ? { minUnseenMs } : {}),
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
catch (err) {
|
|
77
|
+
this.handleApiError(err);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
if (flags.json) {
|
|
81
|
+
this.printJsonResult(result);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
this.render(result);
|
|
85
|
+
}
|
|
86
|
+
render(result) {
|
|
87
|
+
const { dryRun } = result;
|
|
88
|
+
const removing = dryRun ? result.remove.length : result.removedCount;
|
|
89
|
+
const noun = (n) => `${n} superseded harness row${n === 1 ? '' : 's'}`;
|
|
90
|
+
if (dryRun) {
|
|
91
|
+
this.log('Dry run - nothing was removed.');
|
|
92
|
+
}
|
|
93
|
+
if (removing === 0) {
|
|
94
|
+
this.log(dryRun
|
|
95
|
+
? 'Nothing to remove.'
|
|
96
|
+
: 'Nothing was removed - no row qualified (or each one changed while this ran).');
|
|
97
|
+
}
|
|
98
|
+
else if (dryRun) {
|
|
99
|
+
this.log('');
|
|
100
|
+
this.log(`Would remove ${noun(removing)} (oldest first)${result.remaining > 0 ? `; ${result.remaining} more qualify beyond --limit ${result.limit}` : ''}:`);
|
|
101
|
+
this.removeTable(result.remove);
|
|
102
|
+
this.log('');
|
|
103
|
+
this.log('Run again with --yes to remove them.');
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
this.log(`Removed ${noun(removing)}:`);
|
|
107
|
+
this.removeTable(result.remove);
|
|
108
|
+
if (result.remaining > 0) {
|
|
109
|
+
this.log('');
|
|
110
|
+
this.log(`${result.remaining} more qualify beyond --limit ${result.limit}. Run it again to continue.`);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
if (result.kept.length > 0) {
|
|
114
|
+
this.log('');
|
|
115
|
+
this.log(`Kept ${result.kept.length}${result.keptTruncated ? '+' : ''} offline row${result.kept.length === 1 ? '' : 's'}:`);
|
|
116
|
+
const rows = result.kept.map((row) => ({
|
|
117
|
+
id: (0, format_1.formatCell)(row.id),
|
|
118
|
+
provider: (0, format_1.formatCell)(row.provider),
|
|
119
|
+
daemon: (0, format_1.formatCell)(row.daemonId),
|
|
120
|
+
seen: (0, format_1.localStamp)(row.lastSeenAt),
|
|
121
|
+
why: (0, harnesses_1.harnessPruneReasonSentence)(row),
|
|
122
|
+
}));
|
|
123
|
+
(0, format_1.renderTable)(rows, [
|
|
124
|
+
{ key: 'id', header: 'HARNESS ID' },
|
|
125
|
+
{ key: 'provider', header: 'PROVIDER' },
|
|
126
|
+
{ key: 'daemon', header: 'DAEMON ID', verbatim: true },
|
|
127
|
+
{ key: 'seen', header: `LAST SEEN (${(0, format_1.localZone)()})` },
|
|
128
|
+
{ key: 'why', header: 'KEPT BECAUSE' },
|
|
129
|
+
], (line) => this.log(line));
|
|
130
|
+
if (result.keptTruncated) {
|
|
131
|
+
this.log('(The list is cut short; the totals below cover every row.)');
|
|
132
|
+
}
|
|
133
|
+
if (result.kept.some((row) => row.reason === 'pinned')) {
|
|
134
|
+
this.log('(A pinned row stays until its agents point elsewhere: `skrr agents attach-harness <harness> --agent <agent>`.)');
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
const passedOver = [];
|
|
138
|
+
const count = (key) => result.counts?.[key] ?? 0;
|
|
139
|
+
if (count('online') > 0)
|
|
140
|
+
passedOver.push(`${count('online')} online`);
|
|
141
|
+
if (count('not_personal_machine') > 0) {
|
|
142
|
+
passedOver.push(`${count('not_personal_machine')} hosted, dedicated, cloud or of unknown origin`);
|
|
143
|
+
}
|
|
144
|
+
if (count('no_machine_identity') > 0) {
|
|
145
|
+
passedOver.push(`${count('no_machine_identity')} that name no machine`);
|
|
146
|
+
}
|
|
147
|
+
if (passedOver.length > 0) {
|
|
148
|
+
this.log('');
|
|
149
|
+
this.log(`Not considered: ${passedOver.join('; ')}.`);
|
|
150
|
+
}
|
|
151
|
+
if (!result.scan.complete) {
|
|
152
|
+
this.log('');
|
|
153
|
+
this.log(`(This account has more than ${result.scan.rows} harness rows, so the plan cannot be proven complete and --yes will refuse. Use \`harnesses forget\` for individual rows.)`);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
removeTable(rows) {
|
|
157
|
+
(0, format_1.renderTable)(rows.map((row) => ({
|
|
158
|
+
id: (0, format_1.formatCell)(row.id),
|
|
159
|
+
provider: (0, format_1.formatCell)(row.provider),
|
|
160
|
+
daemon: (0, format_1.formatCell)(row.daemonId),
|
|
161
|
+
seen: (0, format_1.localStamp)(row.lastSeenAt),
|
|
162
|
+
replacedBy: (0, format_1.formatCell)(row.supersededBy?.daemonId),
|
|
163
|
+
})), [
|
|
164
|
+
{ key: 'id', header: 'HARNESS ID' },
|
|
165
|
+
{ key: 'provider', header: 'PROVIDER' },
|
|
166
|
+
{ key: 'daemon', header: 'DAEMON ID', verbatim: true },
|
|
167
|
+
{ key: 'seen', header: `LAST SEEN (${(0, format_1.localZone)()})` },
|
|
168
|
+
{ key: 'replacedBy', header: 'REPLACED BY (ONLINE)', verbatim: true },
|
|
169
|
+
], (line) => this.log(line));
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
exports.default = HarnessesPrune;
|
package/dist/commands/login.js
CHANGED
|
@@ -11,6 +11,9 @@ const config_1 = require("../lib/config");
|
|
|
11
11
|
const cli_id_1 = require("../lib/cli-id");
|
|
12
12
|
const keychain_1 = require("../lib/keychain");
|
|
13
13
|
const profile_machine_identity_guard_1 = require("../lib/profile-machine-identity-guard");
|
|
14
|
+
const daemon_command_hint_1 = require("../lib/daemon-command-hint");
|
|
15
|
+
const daemon_machine_identity_copy_1 = require("../lib/daemon-machine-identity-copy");
|
|
16
|
+
const local_daemon_readiness_1 = require("../lib/local-daemon-readiness");
|
|
14
17
|
const login_1 = require("../lib/login");
|
|
15
18
|
const device_code_1 = require("../lib/device-code");
|
|
16
19
|
const api_fetch_1 = require("../lib/api-fetch");
|
|
@@ -121,9 +124,7 @@ class Login extends base_command_1.BaseCommand {
|
|
|
121
124
|
async run() {
|
|
122
125
|
const { flags } = await this.parse(Login);
|
|
123
126
|
if ((0, profile_machine_identity_guard_1.legacyProfileSharesDefaultMachine)()) {
|
|
124
|
-
this.error(
|
|
125
|
-
"Signing in could replace the default machine's device-key pin. " +
|
|
126
|
-
'Create a new profile name and sign in there; the existing profile was not changed.', { exit: 78 });
|
|
127
|
+
this.error((0, profile_machine_identity_guard_1.describeLegacySharedProfile)((0, keychain_1.getActiveProfile)()).join('\n'), { exit: 78 });
|
|
127
128
|
}
|
|
128
129
|
if (flags['base-url'] && flags.server && flags['base-url'] !== flags.server) {
|
|
129
130
|
this.error('--base-url and --server were both provided with different values.', { exit: 2 });
|
|
@@ -272,14 +273,37 @@ class Login extends base_command_1.BaseCommand {
|
|
|
272
273
|
this.log(`This machine is not set up — ${setup.detail}.`);
|
|
273
274
|
}
|
|
274
275
|
}
|
|
276
|
+
// What the daemon is, once the handoff is over: verified connected, or
|
|
277
|
+
// handed a credential it is not using. "Delivered" only means the
|
|
278
|
+
// credential was written; saying "signed in" on that, and discovering on
|
|
279
|
+
// the next line that nobody could verify it, was a login that
|
|
280
|
+
// contradicted itself (OSK-16437).
|
|
281
|
+
let verifiedLocalDaemonId;
|
|
282
|
+
let localDaemonNotReady = false;
|
|
275
283
|
if (handoff.status === 'delivered') {
|
|
276
|
-
|
|
284
|
+
const reported = await (0, local_daemon_readiness_1.reportLocalDaemonAfterHandoff)({
|
|
285
|
+
deliveredDetail: handoff.detail,
|
|
286
|
+
bin: this.config.bin,
|
|
287
|
+
log: (line) => this.log(line),
|
|
288
|
+
});
|
|
289
|
+
verifiedLocalDaemonId = reported.daemonId;
|
|
290
|
+
localDaemonNotReady = reported.notReady;
|
|
277
291
|
}
|
|
278
292
|
else if (handoff.reason === 'platform-managed') {
|
|
279
293
|
// A Dedicated guest: its daemon is the platform's, so there is
|
|
280
294
|
// nothing to install and nothing to hand over (OSK-12296).
|
|
281
295
|
this.log("This machine's daemon is managed by the platform; there is nothing to set up here.");
|
|
282
296
|
}
|
|
297
|
+
else if (handoff.reason === 'machine-identity-skew' && handoff.skew) {
|
|
298
|
+
// The installed daemon would register this profile on the default
|
|
299
|
+
// profile's machine row (OSK-S-440). Nothing was minted or installed;
|
|
300
|
+
// the CLI's own sign-in above stands. The generic "run `daemon login`"
|
|
301
|
+
// line below would send the person to the same binary.
|
|
302
|
+
this.log('');
|
|
303
|
+
for (const line of (0, daemon_machine_identity_copy_1.describeDaemonMachineIdentitySkew)(handoff.skew))
|
|
304
|
+
this.log(line);
|
|
305
|
+
localDaemonNotReady = true;
|
|
306
|
+
}
|
|
283
307
|
else if (handoff.reason === 'foreign-root') {
|
|
284
308
|
// Not a failure and not a hint to re-login anything: the daemon is
|
|
285
309
|
// the default root's, and this is a second root (OSK-12189).
|
|
@@ -291,20 +315,35 @@ class Login extends base_command_1.BaseCommand {
|
|
|
291
315
|
// people to re-login a healthy daemon (OSK-12189).
|
|
292
316
|
this.log(`This login was not handed to the local daemon (${handoff.detail}). ` +
|
|
293
317
|
`The daemon keeps whatever sign-in it already had — check it with ` +
|
|
294
|
-
`\`${
|
|
318
|
+
`\`${(0, daemon_command_hint_1.daemonCommandHint)('status', { bin: this.config.bin })}\`, and run ` +
|
|
319
|
+
`\`${(0, daemon_command_hint_1.daemonCommandHint)('login', { bin: this.config.bin })}\` ` +
|
|
295
320
|
`only if that says it is signed out.`);
|
|
296
321
|
}
|
|
297
|
-
else if (handoff.status === 'failed') {
|
|
322
|
+
else if (handoff.status === 'failed' || handoff.reason === 'unsupported-daemon') {
|
|
323
|
+
// `unsupported-daemon` is a skip, not a failure, and printed nothing: the
|
|
324
|
+
// person was left believing the machine was signed in.
|
|
298
325
|
this.log(`The local daemon was not signed in (${handoff.detail}). ` +
|
|
299
|
-
`Run \`${this.config.bin}
|
|
326
|
+
`Run \`${(0, daemon_command_hint_1.daemonCommandHint)('login', { bin: this.config.bin })}\` to finish.`);
|
|
327
|
+
}
|
|
328
|
+
if (localDaemonNotReady) {
|
|
329
|
+
// The daemon has been described above; asking the same question of it
|
|
330
|
+
// again would print a second, vaguer version of the same answer.
|
|
331
|
+
if (!(0, managed_instruction_setup_1.shouldSkipInstructionPrompt)()) {
|
|
332
|
+
this.log(`Run \`${this.config.bin} instructions setup\` once it is connected.`);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
else {
|
|
336
|
+
// Authentication above is complete. The common onboarding helper verifies
|
|
337
|
+
// the daemon's live account/server/profile and handles failures nonfatally.
|
|
338
|
+
// The wait for a daemon that was just handed a credential has already
|
|
339
|
+
// happened (`confirmLocalDaemonSignedIn`), and its answer is passed on.
|
|
340
|
+
await (0, managed_instruction_setup_1.maybeOfferManagedInstructionSetup)({
|
|
341
|
+
trigger: 'login',
|
|
342
|
+
log: (line) => this.log(line),
|
|
343
|
+
...(verifiedLocalDaemonId ? { daemonId: verifiedLocalDaemonId } : {}),
|
|
344
|
+
waitForLocalReady: false,
|
|
345
|
+
});
|
|
300
346
|
}
|
|
301
|
-
// Authentication above is complete. The common onboarding helper verifies
|
|
302
|
-
// the daemon's live account/server/profile and handles failures nonfatally.
|
|
303
|
-
await (0, managed_instruction_setup_1.maybeOfferManagedInstructionSetup)({
|
|
304
|
-
trigger: 'login',
|
|
305
|
-
log: (line) => this.log(line),
|
|
306
|
-
waitForLocalReady: handoff.status === 'delivered',
|
|
307
|
-
});
|
|
308
347
|
}
|
|
309
348
|
catch (err) {
|
|
310
349
|
// Ctrl-C while waiting for device-code approval: a person's decision,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const core_1 = require("@oclif/core");
|
|
4
|
+
const machine_uuid_1 = require("@skrr-ai/auth-core/machine-uuid");
|
|
4
5
|
const base_command_1 = require("../../base-command");
|
|
6
|
+
const keychain_1 = require("../../lib/keychain");
|
|
5
7
|
const format_1 = require("../../lib/format");
|
|
6
8
|
const machines_1 = require("../../lib/machines");
|
|
7
9
|
/**
|
|
@@ -23,8 +25,10 @@ class MachinesList extends base_command_1.BaseCommand {
|
|
|
23
25
|
// with the one live machine at the top and a wall of dead ones after it
|
|
24
26
|
// (OSK-7639). A list exists so someone can pick a row.
|
|
25
27
|
all: core_1.Flags.boolean({
|
|
26
|
-
description: 'Include
|
|
27
|
-
'
|
|
28
|
+
description: 'Include every machine, including the offline, paused, stopped or terminated hosted ones, ' +
|
|
29
|
+
'and the older harness registrations a machine keeps. Off by default — dead sandboxes and ' +
|
|
30
|
+
'replaced registrations accumulate forever and bury the ones you can use. Your own ' +
|
|
31
|
+
'computers are listed while offline either way, with when they were last seen.',
|
|
28
32
|
}),
|
|
29
33
|
};
|
|
30
34
|
async run() {
|
|
@@ -38,9 +42,18 @@ class MachinesList extends base_command_1.BaseCommand {
|
|
|
38
42
|
this.handleApiError(err);
|
|
39
43
|
}
|
|
40
44
|
const all = machines ?? [];
|
|
41
|
-
const
|
|
45
|
+
const reachable = flags.all ? all : all.filter((m) => (0, machines_1.isListedByDefault)(m));
|
|
46
|
+
// A machine row keeps every harness registration it ever had, so one daemon
|
|
47
|
+
// coming online made a list of four rows read as ninety-eight (OSK-16440).
|
|
48
|
+
// The default shows what still stands; `--all` shows the history.
|
|
49
|
+
const views = reachable.map((m) => (0, machines_1.machineListView)(m, {
|
|
50
|
+
all: flags.all === true,
|
|
51
|
+
hardwareMachineUuid: (0, machine_uuid_1.getHardwareMachineUuid)(),
|
|
52
|
+
activeProfile: (0, keychain_1.getActiveProfile)(),
|
|
53
|
+
}));
|
|
54
|
+
const shown = reachable;
|
|
42
55
|
if (flags.json) {
|
|
43
|
-
this.log(JSON.stringify(
|
|
56
|
+
this.log(JSON.stringify(views, null, 2));
|
|
44
57
|
return;
|
|
45
58
|
}
|
|
46
59
|
if (all.length === 0) {
|
|
@@ -51,14 +64,17 @@ class MachinesList extends base_command_1.BaseCommand {
|
|
|
51
64
|
this.log(`No machine is reachable right now (${(0, machines_1.hiddenMachinesSummary)(all)}) — see them with --all.`);
|
|
52
65
|
return;
|
|
53
66
|
}
|
|
54
|
-
(0, format_1.renderTable)(shown.map((m) => ({
|
|
67
|
+
(0, format_1.renderTable)(shown.map((m, index) => ({
|
|
55
68
|
// Printed in full. A hard 20-character slice with no ellipsis made
|
|
56
69
|
// `machine:03548116-d36` read like a complete id and it is not — and
|
|
57
70
|
// two different hosted machines rendered as byte-identical rows,
|
|
58
71
|
// so the one column a list exists to be picked from could not
|
|
59
72
|
// distinguish them (OSK-7621).
|
|
60
73
|
id: (0, format_1.formatCell)(m.id),
|
|
61
|
-
|
|
74
|
+
// Which row is the computer in front of you, said on the row: two machines
|
|
75
|
+
// can carry the same hostname, and "the one I am on" is what a person is
|
|
76
|
+
// usually picking (OSK-16440).
|
|
77
|
+
name: (0, format_1.formatCell)(`${m.preferences?.name || m.name}${views[index].thisComputer ? ' (this computer)' : ''}`),
|
|
62
78
|
status: (0, format_1.formatCell)((0, machines_1.machineStateLabel)(m)),
|
|
63
79
|
// Both numbers matter: "2/7" is a machine that is up with most of its
|
|
64
80
|
// harnesses signed out, which reads nothing like "7/7". The
|
|
@@ -88,6 +104,12 @@ class MachinesList extends base_command_1.BaseCommand {
|
|
|
88
104
|
this.log(` ${m.preferences?.name || m.name}: ${m.statusReason}`);
|
|
89
105
|
}
|
|
90
106
|
}
|
|
107
|
+
const foldedHistory = views.reduce((sum, view) => sum + (view.hiddenHarnessCount ?? 0), 0);
|
|
108
|
+
if (foldedHistory > 0) {
|
|
109
|
+
this.log('');
|
|
110
|
+
this.log(`${foldedHistory} older harness registration(s) that a newer one replaced are hidden — ` +
|
|
111
|
+
'pass --all to include them, or --json for the daemons each machine has registered.');
|
|
112
|
+
}
|
|
91
113
|
if (shown.length < all.length) {
|
|
92
114
|
const hidden = all.filter((m) => !shown.includes(m));
|
|
93
115
|
this.log('');
|
|
@@ -52,7 +52,7 @@ class ProjectsShow extends base_command_1.BaseCommand {
|
|
|
52
52
|
...project,
|
|
53
53
|
});
|
|
54
54
|
if (flags.json) {
|
|
55
|
-
this.
|
|
55
|
+
this.printJsonResult({ ...project, url });
|
|
56
56
|
return;
|
|
57
57
|
}
|
|
58
58
|
for (const line of (0, projects_1.renderProjectShow)(project)) {
|
|
@@ -4,6 +4,7 @@ const core_1 = require("@oclif/core");
|
|
|
4
4
|
const base_command_1 = require("../base-command");
|
|
5
5
|
const api_fetch_1 = require("../lib/api-fetch");
|
|
6
6
|
const daemon_ref_1 = require("../lib/daemon-ref");
|
|
7
|
+
const daemon_command_hint_1 = require("../lib/daemon-command-hint");
|
|
7
8
|
/**
|
|
8
9
|
* `skrr revoke-daemon <id-or-prefix>`
|
|
9
10
|
*
|
|
@@ -105,7 +106,7 @@ class RevokeDaemon extends base_command_1.BaseCommand {
|
|
|
105
106
|
// Said now, not discovered later as a refresh failure: the sign-in this
|
|
106
107
|
// command used was brokered by that daemon and died with it.
|
|
107
108
|
this.warn(`This also signed out ${this.config.bin} on this machine: its sign-in was brokered ` +
|
|
108
|
-
`by that daemon and was revoked with it. Run \`${this.config.bin}
|
|
109
|
+
`by that daemon and was revoked with it. Run \`${(0, daemon_command_hint_1.daemonCommandHint)('login', { bin: this.config.bin })}\` to ` +
|
|
109
110
|
`re-enroll the daemon, then \`${this.config.bin} login\` to sign the CLI in again.`);
|
|
110
111
|
}
|
|
111
112
|
// exit 0 (default)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseCommand } from '../../../base-command';
|
|
2
2
|
export default class SpacesWorkflowsArchive extends BaseCommand {
|
|
3
|
+
static aliases: string[];
|
|
3
4
|
static description: string;
|
|
4
5
|
static args: {
|
|
5
6
|
spaceId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
@@ -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 prompt_1 = require("../../../lib/prompt");
|
|
7
7
|
class SpacesWorkflowsArchive extends base_command_1.BaseCommand {
|
|
8
|
+
static aliases = ['workflows:archive'];
|
|
8
9
|
static description = 'Archive a workflow while retaining immutable versions and run history';
|
|
9
10
|
static args = {
|
|
10
11
|
spaceId: core_1.Args.string({ required: true, ignoreStdin: true }),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseCommand } from '../../../base-command';
|
|
2
2
|
export default class SpacesWorkflowsArtifact extends BaseCommand {
|
|
3
|
+
static aliases: string[];
|
|
3
4
|
static description: string;
|
|
4
5
|
static args: {
|
|
5
6
|
spaceId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
@@ -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_output_1 = require("../../../lib/space-output");
|
|
7
7
|
class SpacesWorkflowsArtifact extends base_command_1.BaseCommand {
|
|
8
|
+
static aliases = ['workflows:artifact'];
|
|
8
9
|
static description = 'Read a persisted input or output artifact for a workflow node run';
|
|
9
10
|
static args = {
|
|
10
11
|
spaceId: core_1.Args.string({ description: 'Owning Space ID', required: true, ignoreStdin: true }),
|
|
@@ -6,6 +6,7 @@ const base_command_1 = require("../../../base-command");
|
|
|
6
6
|
const prompt_1 = require("../../../lib/prompt");
|
|
7
7
|
const workflow_node_control_1 = require("../../../lib/workflow-node-control");
|
|
8
8
|
class SpacesWorkflowsCancelNode extends base_command_1.BaseCommand {
|
|
9
|
+
static aliases = ['workflows:cancel-node'];
|
|
9
10
|
static description = 'Request cancellation of one exact workflow node attempt and show the returned execution state';
|
|
10
11
|
static examples = [
|
|
11
12
|
'<%= config.bin %> spaces workflows run <space> <run> --json > reviewed-run.json',
|
|
@@ -39,6 +39,7 @@ export declare function describePreservedChildren(spaceId: string, parentRunId:
|
|
|
39
39
|
reviewedScope?: boolean;
|
|
40
40
|
}): string[];
|
|
41
41
|
export default class SpacesWorkflowsCancel extends BaseCommand {
|
|
42
|
+
static aliases: string[];
|
|
42
43
|
static description: string;
|
|
43
44
|
static args: {
|
|
44
45
|
spaceId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
@@ -80,6 +80,7 @@ function describePreservedChildren(spaceId, parentRunId, children, { reviewedSco
|
|
|
80
80
|
return lines;
|
|
81
81
|
}
|
|
82
82
|
class SpacesWorkflowsCancel extends base_command_1.BaseCommand {
|
|
83
|
+
static aliases = ['workflows:cancel'];
|
|
83
84
|
static description = 'Cancel a workflow run and stop further graph coordination';
|
|
84
85
|
static args = {
|
|
85
86
|
spaceId: core_1.Args.string({ description: 'Owning Space ID', required: true, ignoreStdin: true }),
|
|
@@ -87,7 +88,7 @@ class SpacesWorkflowsCancel extends base_command_1.BaseCommand {
|
|
|
87
88
|
};
|
|
88
89
|
static flags = {
|
|
89
90
|
json: core_1.Flags.boolean({
|
|
90
|
-
description: 'Output the cancelled run as JSON (cancellation.scope and the waitingFor.workflowRunId of the cancelled nodes show which child runs were left running)',
|
|
91
|
+
description: 'Output the cancelled run as JSON (cancelReceipt.outcome says whether this request stopped it or found it already cancelled; cancellation.scope and the waitingFor.workflowRunId of the cancelled nodes show which child runs were left running)',
|
|
91
92
|
}),
|
|
92
93
|
scope: core_1.Flags.string({
|
|
93
94
|
description: 'What happens to child workflow runs this run started: preserve_children (default) leaves them running, subtree stops every descendant run too',
|
|
@@ -128,7 +129,10 @@ class SpacesWorkflowsCancel extends base_command_1.BaseCommand {
|
|
|
128
129
|
this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, args.spaceId, 'workflows', run), null, 2));
|
|
129
130
|
return;
|
|
130
131
|
}
|
|
131
|
-
|
|
132
|
+
// The receipt says whether THIS request stopped the run or found it stopped (and why): a
|
|
133
|
+
// repeat used to print "Cancelled" as if new, hiding a stop its deadline made earlier
|
|
134
|
+
// (OSK-15336).
|
|
135
|
+
this.log((0, data_provider_1.describeWorkflowRunCancelReceipt)(run.id, run.cancelReceipt));
|
|
132
136
|
for (const line of describeCancellationProgress(args.spaceId, run))
|
|
133
137
|
this.log(line);
|
|
134
138
|
if ((run.cancellation?.scope ?? run.cancellationScope ?? scope) === 'subtree')
|
|
@@ -3,6 +3,7 @@ import { BaseCommand } from '../../../base-command';
|
|
|
3
3
|
/** A headless-safe first draft: valid on its own, then ready for template insertion or editing. */
|
|
4
4
|
export declare function starterWorkflowGraph(): WorkflowGraph;
|
|
5
5
|
export default class SpacesWorkflowsCreate extends BaseCommand {
|
|
6
|
+
static aliases: string[];
|
|
6
7
|
static description: string;
|
|
7
8
|
static args: {
|
|
8
9
|
spaceId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
@@ -6,6 +6,7 @@ const data_provider_1 = require("@skrr-ai/data-provider");
|
|
|
6
6
|
const base_command_1 = require("../../../base-command");
|
|
7
7
|
const prompt_1 = require("../../../lib/prompt");
|
|
8
8
|
const space_output_1 = require("../../../lib/space-output");
|
|
9
|
+
const workflow_issues_1 = require("../../../lib/workflow-issues");
|
|
9
10
|
/** A headless-safe first draft: valid on its own, then ready for template insertion or editing. */
|
|
10
11
|
function starterWorkflowGraph() {
|
|
11
12
|
return {
|
|
@@ -23,6 +24,7 @@ function starterWorkflowGraph() {
|
|
|
23
24
|
};
|
|
24
25
|
}
|
|
25
26
|
class SpacesWorkflowsCreate extends base_command_1.BaseCommand {
|
|
27
|
+
static aliases = ['workflows:create'];
|
|
26
28
|
static description = 'Create a workflow draft from graph or Canvas draft JSON';
|
|
27
29
|
static args = { spaceId: core_1.Args.string({ required: true, ignoreStdin: true }) };
|
|
28
30
|
static flags = {
|
|
@@ -94,7 +96,11 @@ class SpacesWorkflowsCreate extends base_command_1.BaseCommand {
|
|
|
94
96
|
this.log(`Created draft ${workflow.id}: ${workflow.title}`);
|
|
95
97
|
if (decorated.url)
|
|
96
98
|
this.log(`URL: ${decorated.url}`);
|
|
97
|
-
|
|
99
|
+
for (const line of (0, workflow_issues_1.describeDraftIssues)(workflow.issues))
|
|
100
|
+
this.log(line);
|
|
101
|
+
this.log(workflow.issues?.some((issue) => issue.severity === 'error')
|
|
102
|
+
? `Next: fix the draft, then skrr workflows update ${args.spaceId} ${workflow.id} --graph <file>`
|
|
103
|
+
: `Next: skrr workflows publish ${args.spaceId} ${workflow.id}`);
|
|
98
104
|
}
|
|
99
105
|
}
|
|
100
106
|
exports.default = SpacesWorkflowsCreate;
|
|
@@ -2,6 +2,7 @@ import { BaseCommand } from '../../../base-command';
|
|
|
2
2
|
export declare function workflowEventStreamHeaders(token: string | null | undefined, env?: Record<string, string | undefined>): Record<string, string>;
|
|
3
3
|
/** Follow the server's metadata-only SSE invalidation stream until Ctrl-C. */
|
|
4
4
|
export default class SpacesWorkflowsEvents extends BaseCommand {
|
|
5
|
+
static aliases: string[];
|
|
5
6
|
static description: string;
|
|
6
7
|
static args: {
|
|
7
8
|
spaceId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
@@ -14,6 +14,7 @@ function workflowEventStreamHeaders(token, env = process.env) {
|
|
|
14
14
|
}
|
|
15
15
|
/** Follow the server's metadata-only SSE invalidation stream until Ctrl-C. */
|
|
16
16
|
class SpacesWorkflowsEvents extends base_command_1.BaseCommand {
|
|
17
|
+
static aliases = ['workflows:events'];
|
|
17
18
|
static description = 'Follow durable workflow run events (Ctrl-C to stop; fetch run details for canonical state)';
|
|
18
19
|
static args = {
|
|
19
20
|
spaceId: core_1.Args.string({ required: true, ignoreStdin: true }),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseCommand } from '../../../../base-command';
|
|
2
2
|
export default class SpacesWorkflowsFixturesCreate extends BaseCommand {
|
|
3
|
+
static aliases: string[];
|
|
3
4
|
static description: string;
|
|
4
5
|
static args: {
|
|
5
6
|
spaceId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
@@ -6,6 +6,7 @@ const base_command_1 = require("../../../../base-command");
|
|
|
6
6
|
const prompt_1 = require("../../../../lib/prompt");
|
|
7
7
|
const space_output_1 = require("../../../../lib/space-output");
|
|
8
8
|
class SpacesWorkflowsFixturesCreate extends base_command_1.BaseCommand {
|
|
9
|
+
static aliases = ['workflows:fixtures:create'];
|
|
9
10
|
static description = 'Create a reusable fixture from a node output or an existing workflow run';
|
|
10
11
|
static args = {
|
|
11
12
|
spaceId: core_1.Args.string({ required: true, ignoreStdin: true }),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseCommand } from '../../../../base-command';
|
|
2
2
|
export default class SpacesWorkflowsFixturesList extends BaseCommand {
|
|
3
|
+
static aliases: string[];
|
|
3
4
|
static description: string;
|
|
4
5
|
static args: {
|
|
5
6
|
spaceId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
@@ -6,6 +6,7 @@ const base_command_1 = require("../../../../base-command");
|
|
|
6
6
|
const format_1 = require("../../../../lib/format");
|
|
7
7
|
const space_output_1 = require("../../../../lib/space-output");
|
|
8
8
|
class SpacesWorkflowsFixturesList extends base_command_1.BaseCommand {
|
|
9
|
+
static aliases = ['workflows:fixtures:list'];
|
|
9
10
|
static description = 'List reusable node-output fixtures for a workflow';
|
|
10
11
|
static args = {
|
|
11
12
|
spaceId: core_1.Args.string({ required: true, ignoreStdin: true }),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseCommand } from '../../../base-command';
|
|
2
2
|
export default class SpacesWorkflowsLifecycleDiagnostics extends BaseCommand {
|
|
3
|
+
static aliases: string[];
|
|
3
4
|
static description: string;
|
|
4
5
|
static args: {
|
|
5
6
|
spaceId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
@@ -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
|
class SpacesWorkflowsLifecycleDiagnostics extends base_command_1.BaseCommand {
|
|
7
|
+
static aliases = ['workflows:lifecycle-diagnostics'];
|
|
7
8
|
static description = 'Bounded lifecycle operational counters for a Space — pending effect age, repairs, transition conflicts, orphan stages';
|
|
8
9
|
static args = {
|
|
9
10
|
spaceId: core_1.Args.string({ required: true, ignoreStdin: true, description: 'Owning Space ID' }),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseCommand } from '../../../base-command';
|
|
2
2
|
export default class SpacesWorkflowsList extends BaseCommand {
|
|
3
|
+
static aliases: string[];
|
|
3
4
|
static description: string;
|
|
4
5
|
static args: {
|
|
5
6
|
spaceId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
@@ -6,6 +6,7 @@ const base_command_1 = require("../../../base-command");
|
|
|
6
6
|
const format_1 = require("../../../lib/format");
|
|
7
7
|
const space_output_1 = require("../../../lib/space-output");
|
|
8
8
|
class SpacesWorkflowsList extends base_command_1.BaseCommand {
|
|
9
|
+
static aliases = ['workflows:list'];
|
|
9
10
|
static description = 'List durable workflow definitions in a space';
|
|
10
11
|
static args = { spaceId: core_1.Args.string({ required: true, ignoreStdin: true }) };
|
|
11
12
|
static flags = { json: core_1.Flags.boolean({ description: 'Output JSON' }) };
|