@skrr-ai/cli 0.1.100 → 0.1.102
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/commitments/analytics/detail.d.ts +2 -3
- package/dist/commands/commitments/analytics/detail.js +4 -5
- package/dist/commands/commitments/control/apply.d.ts +15 -0
- package/dist/commands/commitments/control/apply.js +36 -0
- package/dist/commands/commitments/control/preview.d.ts +17 -0
- package/dist/commands/commitments/control/preview.js +43 -0
- package/dist/commands/commitments/control/show.d.ts +12 -0
- package/dist/commands/commitments/control/show.js +29 -0
- package/dist/commands/commitments/create.js +5 -2
- package/dist/commands/commitments/observation/probe.d.ts +15 -0
- package/dist/commands/commitments/observation/probe.js +46 -0
- package/dist/commands/commitments/observation/summary.d.ts +9 -0
- package/dist/commands/commitments/observation/summary.js +31 -0
- package/dist/commands/commitments/readiness/show.d.ts +12 -0
- package/dist/commands/commitments/readiness/show.js +29 -0
- package/dist/commands/commitments/readiness/verify.d.ts +13 -0
- package/dist/commands/commitments/readiness/verify.js +33 -0
- package/dist/commands/commitments/update.js +11 -9
- package/dist/commands/commitments/work-plan.d.ts +11 -0
- package/dist/commands/commitments/work-plan.js +36 -0
- package/dist/commands/compass/effective-policy.d.ts +12 -0
- package/dist/commands/compass/effective-policy.js +34 -0
- package/dist/commands/compass/update.d.ts +12 -0
- package/dist/commands/compass/update.js +27 -0
- package/dist/commands/machines/dedicated/exec.js +3 -1
- package/dist/commands/proposals/discard.d.ts +4 -0
- package/dist/commands/proposals/discard.js +3 -0
- package/dist/commands/proposals/keep.d.ts +4 -0
- package/dist/commands/proposals/keep.js +3 -0
- package/dist/commands/proposals/snooze.d.ts +4 -0
- package/dist/commands/proposals/snooze.js +3 -0
- package/dist/commands/signals/monitors/validate.js +1 -1
- package/dist/commands/spaces/workflows/cancel-node.d.ts +16 -0
- package/dist/commands/spaces/workflows/cancel-node.js +44 -0
- package/dist/commands/spaces/workflows/cancel.d.ts +40 -0
- package/dist/commands/spaces/workflows/cancel.js +109 -3
- package/dist/commands/spaces/workflows/run.d.ts +9 -0
- package/dist/commands/spaces/workflows/run.js +38 -0
- package/dist/commands/spaces/workflows/update.js +1 -1
- package/dist/commands/tasks/schedule.js +1 -1
- package/dist/commands/triggers/capabilities.js +7 -0
- package/dist/commands/triggers/create.js +4 -1
- package/dist/lib/commitments.d.ts +19 -0
- package/dist/lib/commitments.js +36 -3
- package/dist/lib/compasses.d.ts +3 -0
- package/dist/lib/compasses.js +1 -0
- package/dist/lib/responsibility-controls.d.ts +11 -0
- package/dist/lib/responsibility-controls.js +119 -0
- package/dist/lib/stewardship-output.js +13 -2
- package/dist/lib/workflow-node-control.d.ts +10 -0
- package/dist/lib/workflow-node-control.js +76 -0
- package/dist/lib/workspaces.d.ts +2 -0
- package/dist/node_modules/@skrr-ai/auth-core/package.json +1 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +6369 -6355
- package/oclif.manifest.json +1037 -159
- package/package.json +11 -2
|
@@ -3,9 +3,8 @@ import { BaseCommand } from '../../../base-command';
|
|
|
3
3
|
* `skrr commitments analytics detail <id>` — per-commitment analytics.
|
|
4
4
|
*
|
|
5
5
|
* Distinct from `skrr commitments show` (the contract) and from
|
|
6
|
-
* `skrr commitments ledger` (the raw durable runs):
|
|
7
|
-
*
|
|
8
|
-
* window.
|
|
6
|
+
* `skrr commitments ledger` (the raw durable runs): the default rolls up daily
|
|
7
|
+
* Check/outcome metrics. Only --ledger joins checks, native Runs and deliveries.
|
|
9
8
|
*/
|
|
10
9
|
export default class CommitmentsAnalyticsDetail extends BaseCommand {
|
|
11
10
|
static description: string;
|
|
@@ -7,12 +7,11 @@ const commitment_analytics_1 = require("../../../lib/commitment-analytics");
|
|
|
7
7
|
* `skrr commitments analytics detail <id>` — per-commitment analytics.
|
|
8
8
|
*
|
|
9
9
|
* Distinct from `skrr commitments show` (the contract) and from
|
|
10
|
-
* `skrr commitments ledger` (the raw durable runs):
|
|
11
|
-
*
|
|
12
|
-
* window.
|
|
10
|
+
* `skrr commitments ledger` (the raw durable runs): the default rolls up daily
|
|
11
|
+
* Check/outcome metrics. Only --ledger joins checks, native Runs and deliveries.
|
|
13
12
|
*/
|
|
14
13
|
class CommitmentsAnalyticsDetail extends base_command_1.BaseCommand {
|
|
15
|
-
static description = '
|
|
14
|
+
static description = 'Daily Check/outcome analytics; use --ledger for joined native Runs. Legacy totals.autoRuns is not a native Run count';
|
|
16
15
|
static examples = [
|
|
17
16
|
'<%= config.bin %> commitments analytics detail obj_abc123',
|
|
18
17
|
'<%= config.bin %> commitments analytics detail obj_abc123 --days 30',
|
|
@@ -24,7 +23,7 @@ class CommitmentsAnalyticsDetail extends base_command_1.BaseCommand {
|
|
|
24
23
|
static flags = {
|
|
25
24
|
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
26
25
|
days: core_1.Flags.integer({ description: 'Lookback window in days', min: 1, max: 365 }),
|
|
27
|
-
ledger: core_1.Flags.boolean({ description: 'Show
|
|
26
|
+
ledger: core_1.Flags.boolean({ description: 'Show joined checks, native Runs and deliveries instead of daily Check/outcome metrics' }),
|
|
28
27
|
limit: core_1.Flags.integer({ description: 'Max rows (ledger)', min: 1, max: 200 }),
|
|
29
28
|
'check-limit': core_1.Flags.integer({ description: 'Max checks (ledger)', min: 1, max: 200 }),
|
|
30
29
|
'run-limit': core_1.Flags.integer({ description: 'Max runs (ledger)', min: 1, max: 200 }),
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
export default class CommitmentsControlApply extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
'from-json': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
'idempotency-key': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
reason: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
};
|
|
14
|
+
run(): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
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 commitments_1 = require("../../../lib/commitments");
|
|
6
|
+
const prompt_1 = require("../../../lib/prompt");
|
|
7
|
+
const responsibility_controls_1 = require("../../../lib/responsibility-controls");
|
|
8
|
+
class CommitmentsControlApply extends base_command_1.BaseCommand {
|
|
9
|
+
static description = 'Apply the exact scope, version and execution targets from a saved control preview';
|
|
10
|
+
static examples = ['<%= config.bin %> commitments control apply <id> --from-json control.json --idempotency-key <key>'];
|
|
11
|
+
static args = {
|
|
12
|
+
id: core_1.Args.string({ description: 'Commitment ID', required: true, ignoreStdin: true }),
|
|
13
|
+
};
|
|
14
|
+
static flags = {
|
|
15
|
+
'from-json': core_1.Flags.string({ description: 'Reviewed control preview file, or - for stdin', required: true }),
|
|
16
|
+
'idempotency-key': core_1.Flags.string({ description: 'Stable key for retries of this exact control request', required: true }),
|
|
17
|
+
reason: core_1.Flags.string({ description: 'Reason for this control (at most 1000 characters)' }),
|
|
18
|
+
json: core_1.Flags.boolean({ description: 'Output the actual control receipt as JSON' }),
|
|
19
|
+
};
|
|
20
|
+
async run() {
|
|
21
|
+
this.requireAuth();
|
|
22
|
+
const { args, flags } = await this.parse(CommitmentsControlApply);
|
|
23
|
+
try {
|
|
24
|
+
const body = (0, responsibility_controls_1.controlFromPreview)(args.id, await (0, prompt_1.readJsonBody)(flags['from-json']), flags['idempotency-key'], flags.reason);
|
|
25
|
+
const receipt = await commitments_1.commitmentApi.applyControl(args.id, body);
|
|
26
|
+
if (flags.json)
|
|
27
|
+
this.log(JSON.stringify(receipt, null, 2));
|
|
28
|
+
else
|
|
29
|
+
(0, responsibility_controls_1.renderControl)(receipt, (line) => this.log(line));
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
this.handleApiError(error);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.default = CommitmentsControlApply;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
export default class CommitmentsControlPreview extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
scope: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
8
|
+
};
|
|
9
|
+
static flags: {
|
|
10
|
+
target: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
assignment: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
'workflow-run': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
node: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
};
|
|
16
|
+
run(): Promise<void>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
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 commitments_1 = require("../../../lib/commitments");
|
|
6
|
+
const responsibility_controls_1 = require("../../../lib/responsibility-controls");
|
|
7
|
+
class CommitmentsControlPreview extends base_command_1.BaseCommand {
|
|
8
|
+
static description = 'Review a responsibility control and its exact affected execution attempts';
|
|
9
|
+
static examples = [
|
|
10
|
+
'<%= config.bin %> commitments control preview <id> cancel_worker --assignment <id> --json > control.json',
|
|
11
|
+
'<%= config.bin %> commitments control preview <id> pause_observation --json > control.json',
|
|
12
|
+
];
|
|
13
|
+
static args = {
|
|
14
|
+
id: core_1.Args.string({ description: 'Commitment ID', required: true, ignoreStdin: true }),
|
|
15
|
+
scope: core_1.Args.string({ description: 'Control scope', options: [...responsibility_controls_1.RESPONSIBILITY_CONTROL_SCOPES], required: true, ignoreStdin: true }),
|
|
16
|
+
};
|
|
17
|
+
static flags = {
|
|
18
|
+
target: core_1.Flags.string({ description: 'Exact target ID (repeat for multiple targets)', multiple: true }),
|
|
19
|
+
assignment: core_1.Flags.string({ description: 'Assignment ID to inspect' }),
|
|
20
|
+
'workflow-run': core_1.Flags.string({ description: 'Workflow episode ID to inspect' }),
|
|
21
|
+
node: core_1.Flags.string({ description: 'Node key in the selected workflow episode', dependsOn: ['workflow-run'] }),
|
|
22
|
+
json: core_1.Flags.boolean({ description: 'Output the complete frozen preview for control apply' }),
|
|
23
|
+
};
|
|
24
|
+
async run() {
|
|
25
|
+
this.requireAuth();
|
|
26
|
+
const { args, flags } = await this.parse(CommitmentsControlPreview);
|
|
27
|
+
try {
|
|
28
|
+
const preview = await commitments_1.commitmentApi.controlPreview(args.id, {
|
|
29
|
+
scope: args.scope,
|
|
30
|
+
...(flags.target?.length ? { targetIds: flags.target.join(',') } : {}),
|
|
31
|
+
assignmentId: flags.assignment, workflowRunId: flags['workflow-run'], nodeKey: flags.node,
|
|
32
|
+
});
|
|
33
|
+
if (flags.json)
|
|
34
|
+
this.log(JSON.stringify(preview, null, 2));
|
|
35
|
+
else
|
|
36
|
+
(0, responsibility_controls_1.renderControl)(preview, (line) => this.log(line));
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
this.handleApiError(error);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.default = CommitmentsControlPreview;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
export default class CommitmentsControlShow extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
|
+
controlId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
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 commitments_1 = require("../../../lib/commitments");
|
|
6
|
+
const responsibility_controls_1 = require("../../../lib/responsibility-controls");
|
|
7
|
+
class CommitmentsControlShow extends base_command_1.BaseCommand {
|
|
8
|
+
static description = 'Read an exact responsibility control receipt and its current acknowledgement state';
|
|
9
|
+
static args = {
|
|
10
|
+
id: core_1.Args.string({ description: 'Commitment ID', required: true, ignoreStdin: true }),
|
|
11
|
+
controlId: core_1.Args.string({ description: 'Control receipt ID', required: true, ignoreStdin: true }),
|
|
12
|
+
};
|
|
13
|
+
static flags = { json: core_1.Flags.boolean({ description: 'Output the control receipt as JSON' }) };
|
|
14
|
+
async run() {
|
|
15
|
+
this.requireAuth();
|
|
16
|
+
const { args, flags } = await this.parse(CommitmentsControlShow);
|
|
17
|
+
try {
|
|
18
|
+
const receipt = await commitments_1.commitmentApi.controlReceipt(args.id, args.controlId);
|
|
19
|
+
if (flags.json)
|
|
20
|
+
this.log(JSON.stringify(receipt, null, 2));
|
|
21
|
+
else
|
|
22
|
+
(0, responsibility_controls_1.renderControl)(receipt, (line) => this.log(line));
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
this.handleApiError(error);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.default = CommitmentsControlShow;
|
|
@@ -251,11 +251,11 @@ JSON
|
|
|
251
251
|
// companion flag implicitly opts the source in — mirroring how
|
|
252
252
|
// `--metric-key` works — so the enum and its config never disagree.
|
|
253
253
|
'watch-space': core_1.Flags.string({
|
|
254
|
-
description: 'Space to watch
|
|
254
|
+
description: 'One Space to watch. Accepts a space id, ref, or unique title. Implies --watch space.',
|
|
255
255
|
multiple: true,
|
|
256
256
|
}),
|
|
257
257
|
'watch-monitor': core_1.Flags.string({
|
|
258
|
-
description: 'Signal Monitor id to watch
|
|
258
|
+
description: 'One Signal Monitor id to watch. Implies --watch monitor.',
|
|
259
259
|
multiple: true,
|
|
260
260
|
}),
|
|
261
261
|
cadence: core_1.Flags.string({
|
|
@@ -427,6 +427,9 @@ JSON
|
|
|
427
427
|
throw new Error('A finite policy.executionBudget.maxConcurrentRuns in --from-json requires maxConcurrentRunsReason.');
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
|
+
if (Array.isArray(payload.watchedSources)) {
|
|
431
|
+
payload.watchedSources = (0, commitments_1.normalizeWatchedSourceDeclarations)(payload.watchedSources);
|
|
432
|
+
}
|
|
430
433
|
}
|
|
431
434
|
catch (err) {
|
|
432
435
|
this.error(err.message, { exit: 1 });
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
export default class CommitmentsObservationProbe extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
'from-json': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
'expected-version': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
'timeout-ms': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
};
|
|
14
|
+
run(): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
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 commitments_1 = require("../../../lib/commitments");
|
|
6
|
+
const prompt_1 = require("../../../lib/prompt");
|
|
7
|
+
const responsibility_controls_1 = require("../../../lib/responsibility-controls");
|
|
8
|
+
class CommitmentsObservationProbe extends base_command_1.BaseCommand {
|
|
9
|
+
static description = 'Perform a bounded source-read probe for a saved responsibility or unsaved draft';
|
|
10
|
+
static examples = [
|
|
11
|
+
'<%= config.bin %> commitments observation probe <id> --expected-version 7 --timeout-ms 5000',
|
|
12
|
+
'<%= config.bin %> commitments observation probe --from-json draft.json --json',
|
|
13
|
+
];
|
|
14
|
+
static args = { id: core_1.Args.string({ description: 'Saved Commitment ID; omit for an unsaved draft', ignoreStdin: true }) };
|
|
15
|
+
static flags = {
|
|
16
|
+
'from-json': core_1.Flags.string({ description: 'Unsaved draft JSON file, or - for stdin' }),
|
|
17
|
+
'expected-version': core_1.Flags.integer({ description: 'Exact saved Commitment version', min: 1 }),
|
|
18
|
+
'timeout-ms': core_1.Flags.integer({ description: 'Saved source-probe timeout (1..15000ms)', min: 1, max: 15000 }),
|
|
19
|
+
json: core_1.Flags.boolean({ description: 'Output source evidence as JSON' }),
|
|
20
|
+
};
|
|
21
|
+
async run() {
|
|
22
|
+
this.requireAuth();
|
|
23
|
+
const { args, flags } = await this.parse(CommitmentsObservationProbe);
|
|
24
|
+
try {
|
|
25
|
+
if (Boolean(args.id) === Boolean(flags['from-json']))
|
|
26
|
+
throw new Error('Provide either a saved Commitment ID or --from-json for an unsaved draft.');
|
|
27
|
+
if (!args.id && (flags['expected-version'] !== undefined || flags['timeout-ms'] !== undefined)) {
|
|
28
|
+
throw new Error('--expected-version and --timeout-ms apply only to a saved Commitment.');
|
|
29
|
+
}
|
|
30
|
+
const probe = args.id
|
|
31
|
+
? await commitments_1.commitmentApi.observationProbe(args.id, {
|
|
32
|
+
...(flags['expected-version'] !== undefined ? { expectedVersion: flags['expected-version'] } : {}),
|
|
33
|
+
...(flags['timeout-ms'] !== undefined ? { timeoutMs: flags['timeout-ms'] } : {}),
|
|
34
|
+
})
|
|
35
|
+
: await commitments_1.commitmentApi.draftObservationProbe((0, commitments_1.normalizeCreateBody)(await (0, prompt_1.readJsonBody)(flags['from-json'])));
|
|
36
|
+
if (flags.json)
|
|
37
|
+
this.log(JSON.stringify(probe, null, 2));
|
|
38
|
+
else
|
|
39
|
+
(0, responsibility_controls_1.renderProbe)(probe, (line) => this.log(line));
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
this.handleApiError(error);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.default = CommitmentsObservationProbe;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
export default class CommitmentsObservationSummary extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
agent: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
6
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
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 commitments_1 = require("../../../lib/commitments");
|
|
6
|
+
class CommitmentsObservationSummary extends base_command_1.BaseCommand {
|
|
7
|
+
static description = 'Read the bounded portfolio observation projection without performing new source checks';
|
|
8
|
+
static flags = {
|
|
9
|
+
agent: core_1.Flags.string({ description: 'Filter the authenticated portfolio by Agent ID' }),
|
|
10
|
+
json: core_1.Flags.boolean({ description: 'Output the complete observation projection as JSON' }),
|
|
11
|
+
};
|
|
12
|
+
async run() {
|
|
13
|
+
this.requireAuth();
|
|
14
|
+
const { flags } = await this.parse(CommitmentsObservationSummary);
|
|
15
|
+
try {
|
|
16
|
+
const summary = await commitments_1.commitmentApi.observationSummary({ agentId: flags.agent });
|
|
17
|
+
if (flags.json) {
|
|
18
|
+
this.log(JSON.stringify(summary, null, 2));
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
this.log(`Portfolio observation: ${summary.state ?? 'unknown'}`);
|
|
22
|
+
this.log(`Checked at: ${summary.checkedAt ?? 'unavailable'}`);
|
|
23
|
+
this.log(`Coverage: ${JSON.stringify(summary.coverage ?? {})}`);
|
|
24
|
+
this.log(`Next wake: ${JSON.stringify(summary.nextWake ?? {})}`);
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
this.handleApiError(error);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.default = CommitmentsObservationSummary;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
export default class CommitmentsReadinessShow extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
|
+
receiptId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
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 commitments_1 = require("../../../lib/commitments");
|
|
6
|
+
const responsibility_controls_1 = require("../../../lib/responsibility-controls");
|
|
7
|
+
class CommitmentsReadinessShow extends base_command_1.BaseCommand {
|
|
8
|
+
static description = 'Read one exact historical admission or activation receipt without refreshing its evidence';
|
|
9
|
+
static args = {
|
|
10
|
+
id: core_1.Args.string({ description: 'Commitment ID', required: true, ignoreStdin: true }),
|
|
11
|
+
receiptId: core_1.Args.string({ description: 'Readiness or activation receipt ID', required: true, ignoreStdin: true }),
|
|
12
|
+
};
|
|
13
|
+
static flags = { json: core_1.Flags.boolean({ description: 'Output the exact receipt as JSON' }) };
|
|
14
|
+
async run() {
|
|
15
|
+
this.requireAuth();
|
|
16
|
+
const { args, flags } = await this.parse(CommitmentsReadinessShow);
|
|
17
|
+
try {
|
|
18
|
+
const receipt = await commitments_1.commitmentApi.readinessReceipt(args.id, args.receiptId);
|
|
19
|
+
if (flags.json)
|
|
20
|
+
this.log(JSON.stringify(receipt, null, 2));
|
|
21
|
+
else
|
|
22
|
+
(0, responsibility_controls_1.renderReadiness)(receipt, (line) => this.log(line));
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
this.handleApiError(error);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.default = CommitmentsReadinessShow;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
export default class CommitmentsReadinessVerify extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
static flags: {
|
|
8
|
+
'expected-version': import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
'timeout-ms': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
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 commitments_1 = require("../../../lib/commitments");
|
|
6
|
+
const responsibility_controls_1 = require("../../../lib/responsibility-controls");
|
|
7
|
+
class CommitmentsReadinessVerify extends base_command_1.BaseCommand {
|
|
8
|
+
static description = 'Verify one exact saved responsibility version and record canonical readiness evidence';
|
|
9
|
+
static args = { id: core_1.Args.string({ description: 'Commitment ID', required: true, ignoreStdin: true }) };
|
|
10
|
+
static flags = {
|
|
11
|
+
'expected-version': core_1.Flags.integer({ description: 'Reviewed Commitment version', required: true, min: 1 }),
|
|
12
|
+
'timeout-ms': core_1.Flags.integer({ description: 'Source-probe timeout (1..15000ms)', min: 1, max: 15000 }),
|
|
13
|
+
json: core_1.Flags.boolean({ description: 'Output the recorded readiness receipt as JSON' }),
|
|
14
|
+
};
|
|
15
|
+
async run() {
|
|
16
|
+
this.requireAuth();
|
|
17
|
+
const { args, flags } = await this.parse(CommitmentsReadinessVerify);
|
|
18
|
+
try {
|
|
19
|
+
const receipt = await commitments_1.commitmentApi.verifyReadiness(args.id, {
|
|
20
|
+
expectedVersion: flags['expected-version'],
|
|
21
|
+
...(flags['timeout-ms'] !== undefined ? { timeoutMs: flags['timeout-ms'] } : {}),
|
|
22
|
+
});
|
|
23
|
+
if (flags.json)
|
|
24
|
+
this.log(JSON.stringify(receipt, null, 2));
|
|
25
|
+
else
|
|
26
|
+
(0, responsibility_controls_1.renderReadiness)(receipt, (line) => this.log(line));
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
this.handleApiError(error);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.default = CommitmentsReadinessVerify;
|
|
@@ -103,11 +103,11 @@ JSON
|
|
|
103
103
|
options: [...commitments_1.COMMITMENT_WATCHED_SOURCES],
|
|
104
104
|
}),
|
|
105
105
|
'watch-space': core_1.Flags.string({
|
|
106
|
-
description: 'Space to watch
|
|
106
|
+
description: 'One Space to watch. Accepts a space id, ref, or unique title. Implies --watch space.',
|
|
107
107
|
multiple: true,
|
|
108
108
|
}),
|
|
109
109
|
'watch-monitor': core_1.Flags.string({
|
|
110
|
-
description: 'Signal Monitor id to watch
|
|
110
|
+
description: 'One Signal Monitor id to watch. Implies --watch monitor.',
|
|
111
111
|
multiple: true,
|
|
112
112
|
}),
|
|
113
113
|
cadence: core_1.Flags.string({
|
|
@@ -187,7 +187,8 @@ JSON
|
|
|
187
187
|
? { reviewPolicy: (0, commitment_product_1.normalizeTaskReviewPolicy)(flags['task-review-policy']) }
|
|
188
188
|
: {}),
|
|
189
189
|
};
|
|
190
|
-
payload.expectedVersion
|
|
190
|
+
if (payload.expectedVersion === undefined)
|
|
191
|
+
payload.expectedVersion = current?.version;
|
|
191
192
|
}
|
|
192
193
|
const declaredDelivery = payload.delivery;
|
|
193
194
|
if (declaredDelivery?.reviewPolicy !== undefined)
|
|
@@ -270,15 +271,13 @@ JSON
|
|
|
270
271
|
monitorIds: (0, triggers_1.splitRepeated)(flags['watch-monitor']),
|
|
271
272
|
});
|
|
272
273
|
if (built) {
|
|
273
|
-
//
|
|
274
|
-
//
|
|
275
|
-
// authored; rebuilding a bare source silently erased them (OSK-15110).
|
|
274
|
+
// A flag edit selects the full replacement set. Keep sensing declarations
|
|
275
|
+
// only for a binding it still names; explicit JSON is the authored base.
|
|
276
276
|
const declarations = Array.isArray(payload.watchedSources)
|
|
277
|
-
? payload.watchedSources
|
|
277
|
+
? (0, commitments_1.normalizeWatchedSourceDeclarations)(payload.watchedSources)
|
|
278
278
|
: current?.watchedSources ?? [];
|
|
279
279
|
payload.watchedSources = built.map((next) => {
|
|
280
|
-
const scopeKey = next.source === 'space' ? 'spaceId'
|
|
281
|
-
: next.source === 'monitor' ? 'monitorId' : undefined;
|
|
280
|
+
const scopeKey = next.source === 'space' ? 'spaceId' : next.source === 'monitor' ? 'monitorId' : undefined;
|
|
282
281
|
const nextConfig = next.config;
|
|
283
282
|
const prior = declarations.find((binding) => binding?.source === next.source &&
|
|
284
283
|
(!scopeKey || binding.config?.[scopeKey] === nextConfig?.[scopeKey]));
|
|
@@ -371,6 +370,9 @@ JSON
|
|
|
371
370
|
Object.prototype.hasOwnProperty.call(finalEnvelope, 'maxConcurrentRuns')) {
|
|
372
371
|
throw new Error('An autonomous Agent cannot change owner Commitment concurrency policy. Ask the owner to run this update outside the Agent session.');
|
|
373
372
|
}
|
|
373
|
+
if (Array.isArray(payload.watchedSources)) {
|
|
374
|
+
payload.watchedSources = (0, commitments_1.normalizeWatchedSourceDeclarations)(payload.watchedSources);
|
|
375
|
+
}
|
|
374
376
|
}
|
|
375
377
|
catch (err) {
|
|
376
378
|
this.error(err.message, { exit: 1 });
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command';
|
|
2
|
+
export default class CommitmentsWorkPlan extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
static flags: {
|
|
8
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
};
|
|
10
|
+
run(): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
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 commitments_1 = require("../../lib/commitments");
|
|
6
|
+
class CommitmentsWorkPlan extends base_command_1.BaseCommand {
|
|
7
|
+
static description = 'Read permission-filtered delegated assignments and workflow episodes for a responsibility';
|
|
8
|
+
static args = { id: core_1.Args.string({ description: 'Commitment ID', required: true, ignoreStdin: true }) };
|
|
9
|
+
static flags = { json: core_1.Flags.boolean({ description: 'Output the complete public work-plan projection as JSON' }) };
|
|
10
|
+
async run() {
|
|
11
|
+
this.requireAuth();
|
|
12
|
+
const { args, flags } = await this.parse(CommitmentsWorkPlan);
|
|
13
|
+
try {
|
|
14
|
+
const plan = await commitments_1.commitmentApi.workPlan(args.id);
|
|
15
|
+
if (flags.json) {
|
|
16
|
+
this.log(JSON.stringify(plan, null, 2));
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
for (const key of ['assignments', 'episodes']) {
|
|
20
|
+
const rows = plan[key];
|
|
21
|
+
this.log(`${key}: ${Array.isArray(rows) ? rows.length : 'unavailable'}`);
|
|
22
|
+
if (Array.isArray(rows))
|
|
23
|
+
for (const row of rows) {
|
|
24
|
+
if (typeof row === 'object' && row !== null)
|
|
25
|
+
this.log(` ${JSON.stringify(row)}`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
this.log(`Coverage: ${JSON.stringify(plan.coverage ?? {})}`);
|
|
29
|
+
this.log(`Coordinator: ${JSON.stringify(plan.coordinatorState ?? {})}`);
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
this.handleApiError(error);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.default = CommitmentsWorkPlan;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command';
|
|
2
|
+
export default class CompassEffectivePolicy extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
compassId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
static flags: {
|
|
8
|
+
agent: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
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 compasses_1 = require("../../lib/compasses");
|
|
6
|
+
class CompassEffectivePolicy extends base_command_1.BaseCommand {
|
|
7
|
+
static description = 'Read a Compass policy revision, effective defaults and field provenance';
|
|
8
|
+
static args = { compassId: core_1.Args.string({ description: 'Compass ID', required: true, ignoreStdin: true }) };
|
|
9
|
+
static flags = {
|
|
10
|
+
agent: core_1.Flags.string({ description: 'Agent ID that owns the Compass', required: true }),
|
|
11
|
+
json: core_1.Flags.boolean({ description: 'Output the complete policy and provenance as JSON' }),
|
|
12
|
+
};
|
|
13
|
+
async run() {
|
|
14
|
+
this.requireAuth();
|
|
15
|
+
const { args, flags } = await this.parse(CompassEffectivePolicy);
|
|
16
|
+
try {
|
|
17
|
+
const policy = await compasses_1.compassApi.effectivePolicy(args.compassId, { agentId: flags.agent });
|
|
18
|
+
if (flags.json) {
|
|
19
|
+
this.log(JSON.stringify(policy, null, 2));
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
this.log(`Compass ${policy.compassId}, revision ${policy.compassVersion}: ${policy.status}`);
|
|
23
|
+
this.log(`Applies to runtime: ${policy.appliesToRuntime === true ? 'yes' : 'no'}`);
|
|
24
|
+
this.log(`Autonomy defaults: ${JSON.stringify(policy.autonomy ?? {})}`);
|
|
25
|
+
this.log(`Communication defaults: ${JSON.stringify(policy.communication ?? {})}`);
|
|
26
|
+
this.log(`Authority: ${policy.authority ?? 'unknown'}`);
|
|
27
|
+
this.log(`Field provenance: ${JSON.stringify(policy.fieldProvenance ?? {})}`);
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
this.handleApiError(error);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.default = CompassEffectivePolicy;
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import { BaseCommand } from '../../base-command';
|
|
2
|
+
/**
|
|
3
|
+
* The server fences every compass write on the version the caller last saw
|
|
4
|
+
* (`expectedVersion`, required), so a stale writer gets a conflict instead of
|
|
5
|
+
* silently overwriting a newer revision. Precedence: an explicit flag, then a
|
|
6
|
+
* value the caller put in `--json-body` (passed through untouched, so an invalid
|
|
7
|
+
* one is the server's to refuse), then the current version read just now.
|
|
8
|
+
*/
|
|
9
|
+
export declare function resolveExpectedVersion(explicit: number | undefined, fileBody: Record<string, unknown>, fetchCurrentVersion: () => Promise<number>): Promise<{
|
|
10
|
+
version: unknown;
|
|
11
|
+
source: 'flag' | 'json-body' | 'current';
|
|
12
|
+
}>;
|
|
2
13
|
/**
|
|
3
14
|
* `skrr compass update <compass-id> --agent <id>`
|
|
4
15
|
*
|
|
@@ -24,6 +35,7 @@ export default class CompassUpdate extends BaseCommand {
|
|
|
24
35
|
status: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
25
36
|
invariant: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
26
37
|
reason: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
38
|
+
'expected-version': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
27
39
|
'json-body': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
28
40
|
};
|
|
29
41
|
run(): Promise<void>;
|