@skrr-ai/cli 0.1.206 → 0.1.207
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/commands/agents/models.d.ts +11 -0
- package/dist/commands/agents/models.js +51 -0
- package/dist/commands/balance/route-premiums.d.ts +9 -0
- package/dist/commands/balance/route-premiums.js +33 -0
- package/dist/commands/convos/transcript.d.ts +0 -1
- package/dist/commands/convos/transcript.js +0 -1
- package/dist/commands/goals/create.d.ts +1 -0
- package/dist/commands/goals/create.js +8 -0
- package/dist/commands/goals/creation-receipt.d.ts +10 -0
- package/dist/commands/goals/creation-receipt.js +43 -0
- package/dist/commands/goals/key-results/create.d.ts +2 -0
- package/dist/commands/goals/key-results/create.js +14 -0
- package/dist/commands/goals/key-results/creation-receipt.d.ts +13 -0
- package/dist/commands/goals/key-results/creation-receipt.js +51 -0
- package/dist/commands/harnesses/forget.d.ts +2 -0
- package/dist/commands/harnesses/forget.js +31 -0
- package/dist/commands/harnesses/removal-receipt.d.ts +11 -0
- package/dist/commands/harnesses/removal-receipt.js +32 -0
- package/dist/commands/harnesses/removal-review.d.ts +11 -0
- package/dist/commands/harnesses/removal-review.js +28 -0
- package/dist/commands/spaces/loops/release-receipt.d.ts +14 -0
- package/dist/commands/spaces/loops/release-receipt.js +48 -0
- package/dist/commands/spaces/loops/release.js +1 -1
- package/dist/commands/spaces/workflow-templates/archive.d.ts +1 -0
- package/dist/commands/spaces/workflow-templates/archive.js +9 -1
- package/dist/commands/spaces/workflow-templates/show.js +2 -0
- package/dist/commands/spaces/workflow-templates/update.d.ts +1 -0
- package/dist/commands/spaces/workflow-templates/update.js +12 -1
- package/dist/commands/spaces/workflows/publish.d.ts +1 -0
- package/dist/commands/spaces/workflows/publish.js +41 -2
- package/dist/commands/tasks/create.d.ts +2 -0
- package/dist/commands/tasks/create.js +19 -6
- package/dist/commands/tasks/creation-receipt.d.ts +12 -0
- package/dist/commands/tasks/creation-receipt.js +53 -0
- package/dist/commands/tasks/delete.d.ts +1 -0
- package/dist/commands/tasks/delete.js +22 -4
- package/dist/commands/tasks/deletion-receipt.d.ts +12 -0
- package/dist/commands/tasks/deletion-receipt.js +37 -0
- package/dist/lib/execution-target.d.ts +1 -1
- package/dist/lib/execution-target.js +4 -0
- package/dist/lib/harnesses.d.ts +25 -0
- package/dist/lib/harnesses.js +15 -0
- package/dist/lib/request-uuid.d.ts +2 -0
- package/dist/lib/request-uuid.js +10 -0
- package/dist/node_modules/@skrr-ai/data-provider/index.js +10415 -10390
- package/oclif.manifest.json +906 -105
- package/package.json +2 -2
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command';
|
|
2
|
+
export default class AgentsModels extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
purpose: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
placement: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
};
|
|
10
|
+
run(): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
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 placements = ['cloud-worker', 'machine'];
|
|
7
|
+
class AgentsModels extends base_command_1.BaseCommand {
|
|
8
|
+
static description = 'Show managed Agent models, capability admission, and price status';
|
|
9
|
+
static examples = [
|
|
10
|
+
'<%= config.bin %> agents models',
|
|
11
|
+
'<%= config.bin %> agents models --purpose agent.turn --placement machine --json',
|
|
12
|
+
];
|
|
13
|
+
static flags = {
|
|
14
|
+
purpose: core_1.Flags.string({ description: 'Model purpose', default: 'agent.turn' }),
|
|
15
|
+
placement: core_1.Flags.string({
|
|
16
|
+
description: 'Execution placement',
|
|
17
|
+
options: placements,
|
|
18
|
+
default: 'cloud-worker',
|
|
19
|
+
}),
|
|
20
|
+
json: core_1.Flags.boolean({ description: 'Output the model catalog as JSON' }),
|
|
21
|
+
};
|
|
22
|
+
async run() {
|
|
23
|
+
this.requireAuth();
|
|
24
|
+
const { flags } = await this.parse(AgentsModels);
|
|
25
|
+
let catalog;
|
|
26
|
+
try {
|
|
27
|
+
catalog = await data_provider_1.dataService.getAgentModelOptions(flags.purpose, flags.placement);
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
this.handleApiError(error, { subject: 'Managed Agent model catalog' });
|
|
31
|
+
}
|
|
32
|
+
if (flags.json)
|
|
33
|
+
return this.printJsonResult(catalog);
|
|
34
|
+
this.log(`Managed Agent models for ${catalog.purpose} (${flags.placement})`);
|
|
35
|
+
this.log(`Price book ${catalog.priceBookVersion ?? 'not reported'}`);
|
|
36
|
+
if (catalog.options.length === 0)
|
|
37
|
+
this.log('No models listed for this purpose and placement.');
|
|
38
|
+
for (const { alias, admitted, availability, decisions, price } of catalog.options) {
|
|
39
|
+
this.log(` ${alias} ${admitted ? 'admitted' : 'refused'}`);
|
|
40
|
+
if (availability?.message)
|
|
41
|
+
this.log(` ${availability.message}`);
|
|
42
|
+
for (const [capability, decision] of Object.entries(decisions)) {
|
|
43
|
+
this.log(` ${capability} ${decision.admitted ? 'admitted' : 'refused'} (${decision.reason})`);
|
|
44
|
+
}
|
|
45
|
+
this.log(price.status === 'priced'
|
|
46
|
+
? ` priced ${price.currency} ${price.inputPerMTok} input / ${price.outputPerMTok} output per 1M tokens`
|
|
47
|
+
: ` price ${price.status}`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.default = AgentsModels;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command';
|
|
2
|
+
export default class BalanceRoutePremiums extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
class BalanceRoutePremiums extends base_command_1.BaseCommand {
|
|
7
|
+
static description = 'Show model routing premiums currently in effect and when they expire';
|
|
8
|
+
static examples = [
|
|
9
|
+
'<%= config.bin %> balance route-premiums',
|
|
10
|
+
'<%= config.bin %> balance route-premiums --json',
|
|
11
|
+
];
|
|
12
|
+
static flags = { json: core_1.Flags.boolean({ description: 'Output route premiums as JSON' }) };
|
|
13
|
+
async run() {
|
|
14
|
+
this.requireAuth();
|
|
15
|
+
const { flags } = await this.parse(BalanceRoutePremiums);
|
|
16
|
+
let report;
|
|
17
|
+
try {
|
|
18
|
+
report = await data_provider_1.dataService.getRoutePremiums();
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
this.handleApiError(error, { subject: 'Current route premiums' });
|
|
22
|
+
}
|
|
23
|
+
if (flags.json)
|
|
24
|
+
return this.printJsonResult(report);
|
|
25
|
+
this.log(`Route premiums as of ${report.asOf}`);
|
|
26
|
+
if (report.premiums.length === 0)
|
|
27
|
+
this.log('No active route premiums.');
|
|
28
|
+
for (const { alias, multiplier, reason, until } of report.premiums) {
|
|
29
|
+
this.log(` ${alias} up to ${multiplier}x list price (${reason}), until ${until}`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.default = BalanceRoutePremiums;
|
|
@@ -9,7 +9,6 @@ export declare const CONTEXT_BREAK_WORDS: Record<ContextBreakReason, string>;
|
|
|
9
9
|
export declare const TRANSCRIPT_SOURCE_WORDS: Record<TurnTranscriptSource, string>;
|
|
10
10
|
/**
|
|
11
11
|
* Where a continuation sent to an imported session is, as its receipt says. Exhaustive by type.
|
|
12
|
-
* (An imported session is read only with a first-party app's session; a CLI token is refused.)
|
|
13
12
|
*/
|
|
14
13
|
export declare const CONTINUATION_STATE_WORDS: Record<LocalSessionContinuationState, string>;
|
|
15
14
|
/** Whether the harness context continued into this turn, in words. Never guesses "continued". */
|
|
@@ -39,7 +39,6 @@ exports.TRANSCRIPT_SOURCE_WORDS = {
|
|
|
39
39
|
};
|
|
40
40
|
/**
|
|
41
41
|
* Where a continuation sent to an imported session is, as its receipt says. Exhaustive by type.
|
|
42
|
-
* (An imported session is read only with a first-party app's session; a CLI token is refused.)
|
|
43
42
|
*/
|
|
44
43
|
exports.CONTINUATION_STATE_WORDS = {
|
|
45
44
|
preparing: 'sent from here, still being prepared',
|
|
@@ -4,6 +4,7 @@ export default class GoalsCreate extends BaseCommand {
|
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
6
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
'dry-run': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
8
|
'from-json': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
9
|
title: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
'idempotency-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -20,6 +20,9 @@ class GoalsCreate extends base_command_1.BaseCommand {
|
|
|
20
20
|
];
|
|
21
21
|
static flags = {
|
|
22
22
|
json: core_1.Flags.boolean({ description: 'Output the created goal as JSON' }),
|
|
23
|
+
'dry-run': core_1.Flags.boolean({
|
|
24
|
+
description: 'Print the resolved create payload without creating a Goal',
|
|
25
|
+
}),
|
|
23
26
|
'from-json': core_1.Flags.string({
|
|
24
27
|
description: 'Path to a JSON file (or "-" for stdin) to use as the request body',
|
|
25
28
|
}),
|
|
@@ -127,6 +130,11 @@ class GoalsCreate extends base_command_1.BaseCommand {
|
|
|
127
130
|
}
|
|
128
131
|
if (resolvedLabelIds)
|
|
129
132
|
payload.labelIds = resolvedLabelIds;
|
|
133
|
+
if (flags['dry-run']) {
|
|
134
|
+
const result = { object: 'goal_create_dry_run', payload };
|
|
135
|
+
this.printJsonOperation(result, { mode: 'dry_run' });
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
130
138
|
let created;
|
|
131
139
|
try {
|
|
132
140
|
created = await data_provider_1.dataService.createGoal(payload, flags['idempotency-key'] ? { idempotencyKey: flags['idempotency-key'] } : undefined);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command';
|
|
2
|
+
export default class GoalsCreationReceipt extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
'idempotency-key': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
|
+
'from-json': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
};
|
|
9
|
+
run(): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
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 prompt_1 = require("../../lib/prompt");
|
|
7
|
+
class GoalsCreationReceipt extends base_command_1.BaseCommand {
|
|
8
|
+
static description = 'Check whether the original Goal creation request committed';
|
|
9
|
+
static flags = {
|
|
10
|
+
'idempotency-key': core_1.Flags.string({ description: 'Key used by the original `goals create`', required: true }),
|
|
11
|
+
'from-json': core_1.Flags.string({
|
|
12
|
+
description: 'Original request body, such as .payload from `goals create --dry-run --json` ("-" for stdin)',
|
|
13
|
+
required: true,
|
|
14
|
+
}),
|
|
15
|
+
json: core_1.Flags.boolean({ description: 'Output the receipt as JSON' }),
|
|
16
|
+
};
|
|
17
|
+
async run() {
|
|
18
|
+
this.requireAuth();
|
|
19
|
+
const { flags } = await this.parse(GoalsCreationReceipt);
|
|
20
|
+
let payload;
|
|
21
|
+
try {
|
|
22
|
+
payload = await (0, prompt_1.readJsonBody)(flags['from-json']);
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
this.error(error.message, { exit: 2 });
|
|
26
|
+
}
|
|
27
|
+
try {
|
|
28
|
+
const receipt = await data_provider_1.dataService.getGoalCreationReceipt(payload, flags['idempotency-key']);
|
|
29
|
+
if (flags.json)
|
|
30
|
+
return this.printJsonResult(receipt);
|
|
31
|
+
const messages = {
|
|
32
|
+
committed: 'The original Goal creation committed.',
|
|
33
|
+
gone: 'The Goal from that request is no longer available.',
|
|
34
|
+
unknown: 'The server could not confirm that Goal creation.',
|
|
35
|
+
};
|
|
36
|
+
this.log(messages[receipt.state]);
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
this.handleApiError(error, { subject: 'Goal creation receipt' });
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.default = GoalsCreationReceipt;
|
|
@@ -14,9 +14,11 @@ export default class GoalsKeyResultsCreate extends BaseCommand {
|
|
|
14
14
|
};
|
|
15
15
|
static flags: {
|
|
16
16
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
17
|
+
'dry-run': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
17
18
|
'from-json': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
19
|
title: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
20
|
description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
21
|
+
'request-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
20
22
|
progress: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
21
23
|
'progress-mode': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
22
24
|
status: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -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 request_uuid_1 = require("../../../lib/request-uuid");
|
|
7
8
|
/**
|
|
8
9
|
* `skrr goals key-results create <goal-id> --title "..."` — add a key result to a
|
|
9
10
|
* goal. Wraps `POST /api/goals/:goalId/key-results` (data-provider
|
|
@@ -23,11 +24,18 @@ class GoalsKeyResultsCreate extends base_command_1.BaseCommand {
|
|
|
23
24
|
};
|
|
24
25
|
static flags = {
|
|
25
26
|
json: core_1.Flags.boolean({ description: 'Output the created key result as JSON' }),
|
|
27
|
+
'dry-run': core_1.Flags.boolean({
|
|
28
|
+
description: 'Print the resolved create payload without creating a Key Result',
|
|
29
|
+
}),
|
|
26
30
|
'from-json': core_1.Flags.string({
|
|
27
31
|
description: 'Path to a JSON file (or "-" for stdin) to use as the request body',
|
|
28
32
|
}),
|
|
29
33
|
title: core_1.Flags.string({ description: 'Key result title (required unless set via --from-json)' }),
|
|
30
34
|
description: core_1.Flags.string({ description: 'Key result description' }),
|
|
35
|
+
'request-id': core_1.Flags.string({
|
|
36
|
+
description: 'UUID for this exact create payload, recoverable with `goals key-results creation-receipt`',
|
|
37
|
+
parse: request_uuid_1.parseRequestUuid,
|
|
38
|
+
}),
|
|
31
39
|
// The bound is declared, not just described. `--progress 150` and
|
|
32
40
|
// `--progress -5` both came back as a bare `Invalid request data /
|
|
33
41
|
// HTTP_400` from the server — byte-identical for two different mistakes,
|
|
@@ -65,6 +73,7 @@ class GoalsKeyResultsCreate extends base_command_1.BaseCommand {
|
|
|
65
73
|
const data = (0, prompt_1.mergeDefined)(body, {
|
|
66
74
|
title: flags.title,
|
|
67
75
|
description: flags.description,
|
|
76
|
+
creationRequestId: flags['request-id'],
|
|
68
77
|
progress: flags.progress,
|
|
69
78
|
progressMode: flags['progress-mode'],
|
|
70
79
|
status: flags.status,
|
|
@@ -75,6 +84,11 @@ class GoalsKeyResultsCreate extends base_command_1.BaseCommand {
|
|
|
75
84
|
exit: 1,
|
|
76
85
|
});
|
|
77
86
|
}
|
|
87
|
+
if (flags['dry-run']) {
|
|
88
|
+
const result = { object: 'key_result_create_dry_run', payload: data };
|
|
89
|
+
this.printJsonOperation(result, { mode: 'dry_run' });
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
78
92
|
let created;
|
|
79
93
|
try {
|
|
80
94
|
created = await data_provider_1.dataService.createKeyResult({
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
export default class GoalsKeyResultsCreationReceipt extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
goalId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
static flags: {
|
|
8
|
+
'request-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
'from-json': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
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 prompt_1 = require("../../../lib/prompt");
|
|
7
|
+
const request_uuid_1 = require("../../../lib/request-uuid");
|
|
8
|
+
class GoalsKeyResultsCreationReceipt extends base_command_1.BaseCommand {
|
|
9
|
+
static description = 'Check whether the original Key Result creation request completed';
|
|
10
|
+
static args = {
|
|
11
|
+
goalId: core_1.Args.string({ description: 'Goal ID', required: true, ignoreStdin: true }),
|
|
12
|
+
};
|
|
13
|
+
static flags = {
|
|
14
|
+
'request-id': core_1.Flags.string({
|
|
15
|
+
description: 'UUID used for the original Key Result create', required: true, parse: request_uuid_1.parseRequestUuid,
|
|
16
|
+
}),
|
|
17
|
+
'from-json': core_1.Flags.string({
|
|
18
|
+
description: 'Original request body, such as .payload from `goals key-results create --dry-run --json` ("-" for stdin)',
|
|
19
|
+
required: true,
|
|
20
|
+
}),
|
|
21
|
+
json: core_1.Flags.boolean({ description: 'Output the receipt as JSON' }),
|
|
22
|
+
};
|
|
23
|
+
async run() {
|
|
24
|
+
this.requireAuth();
|
|
25
|
+
const { args, flags } = await this.parse(GoalsKeyResultsCreationReceipt);
|
|
26
|
+
const requestId = flags['request-id'];
|
|
27
|
+
let body;
|
|
28
|
+
try {
|
|
29
|
+
body = await (0, prompt_1.readJsonBody)(flags['from-json']);
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
this.error(error.message, { exit: 2 });
|
|
33
|
+
}
|
|
34
|
+
const { creationRequestId, ...payload } = body;
|
|
35
|
+
if (creationRequestId !== undefined && creationRequestId !== requestId) {
|
|
36
|
+
this.error('The original body contains a different creationRequestId.', { exit: 2 });
|
|
37
|
+
}
|
|
38
|
+
try {
|
|
39
|
+
const receipt = await data_provider_1.dataService.getKeyResultCreationReceipt(args.goalId, { requestId, payload });
|
|
40
|
+
if (flags.json)
|
|
41
|
+
return this.printJsonResult(receipt);
|
|
42
|
+
this.log(receipt.state === 'created'
|
|
43
|
+
? `Created Key Result ${receipt.keyResultId}.`
|
|
44
|
+
: 'The server could not confirm that Key Result creation.');
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
this.handleApiError(error, { subject: `Goal ${args.goalId} Key Result creation receipt` });
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.default = GoalsKeyResultsCreationReceipt;
|
|
@@ -15,6 +15,8 @@ export default class HarnessesForget extends BaseCommand {
|
|
|
15
15
|
static flags: {
|
|
16
16
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
17
17
|
yes: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
18
|
+
'review-ref': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
|
+
'operation-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
20
|
};
|
|
19
21
|
run(): Promise<void>;
|
|
20
22
|
}
|
|
@@ -5,6 +5,7 @@ const base_command_1 = require("../../base-command");
|
|
|
5
5
|
const harnesses_1 = require("../../lib/harnesses");
|
|
6
6
|
const api_fetch_1 = require("../../lib/api-fetch");
|
|
7
7
|
const show_1 = require("./show");
|
|
8
|
+
const request_uuid_1 = require("../../lib/request-uuid");
|
|
8
9
|
const RUN_RE = /^[0-9a-f]{24}$/i;
|
|
9
10
|
/**
|
|
10
11
|
* Forget an harness — `forget`, not `delete`.
|
|
@@ -18,6 +19,7 @@ class HarnessesForget extends base_command_1.BaseCommand {
|
|
|
18
19
|
static examples = [
|
|
19
20
|
'<%= config.bin %> harnesses forget <harness-id>',
|
|
20
21
|
'<%= config.bin %> harnesses forget <harness-id> --yes',
|
|
22
|
+
'<%= config.bin %> harnesses forget <harness-id> --review-ref <review-ref> --operation-id <uuid>',
|
|
21
23
|
];
|
|
22
24
|
static args = {
|
|
23
25
|
harness: core_1.Args.string({ ignoreStdin: true, description: 'Harness ID', required: true }),
|
|
@@ -25,10 +27,21 @@ class HarnessesForget extends base_command_1.BaseCommand {
|
|
|
25
27
|
static flags = {
|
|
26
28
|
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
27
29
|
yes: core_1.Flags.boolean({ description: 'Skip the confirmation' }),
|
|
30
|
+
'review-ref': core_1.Flags.string({
|
|
31
|
+
description: 'Exact token from `harnesses removal-review` for a personal local registration',
|
|
32
|
+
dependsOn: ['operation-id'],
|
|
33
|
+
}),
|
|
34
|
+
'operation-id': core_1.Flags.string({
|
|
35
|
+
description: 'Stable UUID for the reviewed removal, recoverable with `harnesses removal-receipt`',
|
|
36
|
+
dependsOn: ['review-ref'],
|
|
37
|
+
parse: request_uuid_1.parseRequestUuid,
|
|
38
|
+
}),
|
|
28
39
|
};
|
|
29
40
|
async run() {
|
|
30
41
|
this.requireAuth();
|
|
31
42
|
const { args, flags } = await this.parse(HarnessesForget);
|
|
43
|
+
const reviewRef = flags['review-ref'];
|
|
44
|
+
const operationId = flags['operation-id'];
|
|
32
45
|
// Refuse a reference that cannot name a harness BEFORE asking anything.
|
|
33
46
|
//
|
|
34
47
|
// The confirmation used to run first, so `harnesses forget notanid` asked
|
|
@@ -47,6 +60,24 @@ class HarnessesForget extends base_command_1.BaseCommand {
|
|
|
47
60
|
});
|
|
48
61
|
return;
|
|
49
62
|
}
|
|
63
|
+
if (reviewRef !== undefined || operationId !== undefined) {
|
|
64
|
+
if (!reviewRef?.trim() || !operationId) {
|
|
65
|
+
return this.error('Reviewed removal requires both a review ref and an operation UUID.', { exit: 2 });
|
|
66
|
+
}
|
|
67
|
+
if (!flags.yes && !(await this.confirm(`Remove reviewed personal registration ${args.harness}?`))) {
|
|
68
|
+
return this.error('Cancelled. The registration was kept.', { exit: 1 });
|
|
69
|
+
}
|
|
70
|
+
try {
|
|
71
|
+
const receipt = await (0, harnesses_1.forgetReviewedHarness)(args.harness, reviewRef, operationId);
|
|
72
|
+
if (flags.json)
|
|
73
|
+
return this.printJsonResult(receipt);
|
|
74
|
+
this.log(`Removed registration ${receipt.harnessId}. Operation ${receipt.operationId}.`);
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
this.handleApiError(error, { subject: `reviewed removal of harness ${args.harness}` });
|
|
78
|
+
}
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
50
81
|
// Name it before removing it. An id alone does not tell the operator which
|
|
51
82
|
// of their machines they are about to drop from the fleet.
|
|
52
83
|
if (!flags.yes) {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command';
|
|
2
|
+
export default class HarnessesRemovalReceipt extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
operationId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
static flags: {
|
|
8
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
};
|
|
10
|
+
run(): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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 harnesses_1 = require("../../lib/harnesses");
|
|
6
|
+
const request_uuid_1 = require("../../lib/request-uuid");
|
|
7
|
+
class HarnessesRemovalReceipt extends base_command_1.BaseCommand {
|
|
8
|
+
static description = 'Check the result of one reviewed Harness registration removal';
|
|
9
|
+
static args = {
|
|
10
|
+
operationId: core_1.Args.string({
|
|
11
|
+
description: 'UUID used with `harnesses forget`', required: true, ignoreStdin: true,
|
|
12
|
+
parse: request_uuid_1.parseRequestUuid,
|
|
13
|
+
}),
|
|
14
|
+
};
|
|
15
|
+
static flags = { json: core_1.Flags.boolean({ description: 'Output the receipt as JSON' }) };
|
|
16
|
+
async run() {
|
|
17
|
+
this.requireAuth();
|
|
18
|
+
const { args, flags } = await this.parse(HarnessesRemovalReceipt);
|
|
19
|
+
try {
|
|
20
|
+
const result = await (0, harnesses_1.getHarnessRemovalOperation)(args.operationId);
|
|
21
|
+
if (flags.json)
|
|
22
|
+
return this.printJsonResult(result);
|
|
23
|
+
this.log(result.state === 'committed'
|
|
24
|
+
? `Registration ${result.receipt.harnessId} was removed at ${result.receipt.removedAt}.`
|
|
25
|
+
: 'The server could not confirm that registration removal.');
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
this.handleApiError(error, { subject: `Harness removal operation ${args.operationId}` });
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.default = HarnessesRemovalReceipt;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command';
|
|
2
|
+
export default class HarnessesRemovalReview extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
static flags: {
|
|
8
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
};
|
|
10
|
+
run(): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
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 harnesses_1 = require("../../lib/harnesses");
|
|
6
|
+
class HarnessesRemovalReview extends base_command_1.BaseCommand {
|
|
7
|
+
static description = 'Review removal of an unreferenced offline personal Harness registration';
|
|
8
|
+
static args = {
|
|
9
|
+
id: core_1.Args.string({ description: 'Harness ID', required: true, ignoreStdin: true }),
|
|
10
|
+
};
|
|
11
|
+
static flags = { json: core_1.Flags.boolean({ description: 'Output the review as JSON' }) };
|
|
12
|
+
async run() {
|
|
13
|
+
this.requireAuth();
|
|
14
|
+
const { args, flags } = await this.parse(HarnessesRemovalReview);
|
|
15
|
+
try {
|
|
16
|
+
const review = await (0, harnesses_1.getHarnessRemovalReview)(args.id);
|
|
17
|
+
if (flags.json)
|
|
18
|
+
return this.printJsonResult(review);
|
|
19
|
+
this.log(`Registration ${review.harnessId} passed the review. The review expires at ${review.expiresAt}.`);
|
|
20
|
+
this.log(`Review ref: ${review.reviewRef}`);
|
|
21
|
+
this.log(`Confirm with ${this.config.bin} harnesses forget ${review.harnessId} --review-ref <review-ref> --operation-id <uuid>.`);
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
this.handleApiError(error, { subject: `Harness ${args.id} removal review` });
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.default = HarnessesRemovalReview;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
export default class SpacesLoopsReleaseReceipt extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
duty: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
link: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
};
|
|
13
|
+
run(): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
class SpacesLoopsReleaseReceipt extends base_command_1.BaseCommand {
|
|
7
|
+
static description = 'Read your recent Space Loop releases or check one exact home link';
|
|
8
|
+
static examples = [
|
|
9
|
+
'<%= config.bin %> spaces loops release-receipt <space-id>',
|
|
10
|
+
'<%= config.bin %> spaces loops release-receipt <space-id> --duty <duty-id> --link <home-link-id> --json',
|
|
11
|
+
];
|
|
12
|
+
static args = {
|
|
13
|
+
id: core_1.Args.string({ description: 'Space ID or title', required: true, ignoreStdin: true }),
|
|
14
|
+
};
|
|
15
|
+
static flags = {
|
|
16
|
+
duty: core_1.Flags.string({ description: 'Duty ID from the original release', dependsOn: ['link'] }),
|
|
17
|
+
link: core_1.Flags.string({ description: 'Home link ID from the original release', dependsOn: ['duty'] }),
|
|
18
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
19
|
+
};
|
|
20
|
+
async run() {
|
|
21
|
+
this.requireAuth();
|
|
22
|
+
const { args, flags } = await this.parse(SpacesLoopsReleaseReceipt);
|
|
23
|
+
const spaceId = await this.resolveSpaceReference(args.id);
|
|
24
|
+
try {
|
|
25
|
+
if (flags.duty && flags.link) {
|
|
26
|
+
const receipt = await data_provider_1.dataService.getSpaceLoopReleaseReceipt(spaceId, flags.duty, flags.link);
|
|
27
|
+
if (flags.json)
|
|
28
|
+
return this.printJsonResult(receipt);
|
|
29
|
+
this.log(receipt.state === 'released'
|
|
30
|
+
? `Recorded release for Duty ${receipt.dutyId} and home link ${receipt.linkId}.`
|
|
31
|
+
: 'The server could not confirm that release.');
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const history = await data_provider_1.dataService.listSpaceLoopReleaseReceipts(spaceId);
|
|
35
|
+
if (flags.json)
|
|
36
|
+
return this.printJsonResult(history);
|
|
37
|
+
if (history.receipts.length === 0)
|
|
38
|
+
this.log('No recent releases found for your account.');
|
|
39
|
+
for (const receipt of history.receipts) {
|
|
40
|
+
this.log(`${receipt.releasedAt} ${receipt.dutyId} ${receipt.linkId} cleanup ${receipt.cleanup}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
this.handleApiError(error, { subject: `Space ${spaceId} Loop release receipt` });
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.default = SpacesLoopsReleaseReceipt;
|
|
@@ -28,7 +28,7 @@ class SpacesLoopsRelease extends base_command_1.BaseCommand {
|
|
|
28
28
|
const links = await data_provider_1.dataService.listDutyWorkLinksForTarget({ targetType: 'space', targetId: spaceId });
|
|
29
29
|
const homes = links.data.filter((link) => link.dutyId === flags.duty && link.status === 'active' && link.roles.includes('home'));
|
|
30
30
|
if (homes.length !== 1) {
|
|
31
|
-
this.error('No unique active home link found. Supply --link <home-link-id> to release a reviewed link or
|
|
31
|
+
this.error('No unique active home link found. Supply --link <home-link-id> to release a reviewed link, or use `spaces loops release-receipt` to check prior releases.', { exit: 2 });
|
|
32
32
|
}
|
|
33
33
|
linkId = homes[0].id;
|
|
34
34
|
}
|
|
@@ -11,6 +11,7 @@ export default class SpacesWorkflowTemplatesArchive extends BaseCommand {
|
|
|
11
11
|
static flags: {
|
|
12
12
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
13
|
yes: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
'expected-revision': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
15
|
};
|
|
15
16
|
run(): Promise<void>;
|
|
16
17
|
}
|
|
@@ -19,6 +19,11 @@ class SpacesWorkflowTemplatesArchive extends base_command_1.BaseCommand {
|
|
|
19
19
|
static flags = {
|
|
20
20
|
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
21
21
|
yes: core_1.Flags.boolean({ char: 'y', description: 'Skip the confirmation prompt' }),
|
|
22
|
+
'expected-revision': core_1.Flags.integer({
|
|
23
|
+
min: 0,
|
|
24
|
+
max: Number.MAX_SAFE_INTEGER,
|
|
25
|
+
description: 'Archive only if the reviewed revision from `workflow-templates show` still matches',
|
|
26
|
+
}),
|
|
22
27
|
};
|
|
23
28
|
async run() {
|
|
24
29
|
this.requireAuth();
|
|
@@ -39,7 +44,10 @@ class SpacesWorkflowTemplatesArchive extends base_command_1.BaseCommand {
|
|
|
39
44
|
return this.log('Cancelled.');
|
|
40
45
|
let result;
|
|
41
46
|
try {
|
|
42
|
-
|
|
47
|
+
const revision = flags['expected-revision'];
|
|
48
|
+
result = revision === undefined
|
|
49
|
+
? await data_provider_1.dataService.archiveSpaceWorkflowTemplate(args.spaceId, args.templateId)
|
|
50
|
+
: await data_provider_1.dataService.archiveReviewedSpaceWorkflowTemplate(args.spaceId, args.templateId, revision);
|
|
43
51
|
}
|
|
44
52
|
catch (error) {
|
|
45
53
|
this.handleApiError(error, { subject: `workflow template ${args.templateId}` });
|
|
@@ -70,6 +70,8 @@ class SpacesWorkflowTemplatesShow extends base_command_1.BaseCommand {
|
|
|
70
70
|
this.log(`Title: ${template.title}`);
|
|
71
71
|
this.log(`Scope: ${template.scope}${template.readOnly ? ' (read-only)' : ''}`);
|
|
72
72
|
this.log(`Published version: ${template.currentVersion || 'not published'}`);
|
|
73
|
+
if (template.revision !== undefined)
|
|
74
|
+
this.log(`Authoring revision: ${template.revision}`);
|
|
73
75
|
this.log(`Nodes / edges: ${template.nodeCount} / ${template.edgeCount}`);
|
|
74
76
|
this.log(`Node types: ${template.nodeTypes.join(', ') || '-'}`);
|
|
75
77
|
this.log(`Entry ports: ${template.ports.entry.join(', ') || '-'}`);
|
|
@@ -15,6 +15,7 @@ export default class SpacesWorkflowTemplatesUpdate extends BaseCommand {
|
|
|
15
15
|
tags: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
16
|
scope: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
17
|
body: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
'expected-revision': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
19
|
};
|
|
19
20
|
run(): Promise<void>;
|
|
20
21
|
}
|