@skrr-ai/cli 0.1.17 → 0.1.18
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 +7 -4
- package/dist/commands/commitments/action-proposals/decide.d.ts +13 -0
- package/dist/commands/commitments/action-proposals/decide.js +41 -0
- package/dist/commands/commitments/action-proposals/execute.d.ts +12 -0
- package/dist/commands/commitments/action-proposals/execute.js +29 -0
- package/dist/commands/commitments/action-proposals.d.ts +13 -0
- package/dist/commands/commitments/action-proposals.js +56 -0
- package/dist/commands/commitments/autonomy.d.ts +7 -11
- package/dist/commands/commitments/autonomy.js +16 -25
- package/dist/commands/commitments/bundle.d.ts +14 -0
- package/dist/commands/commitments/bundle.js +49 -0
- package/dist/commands/commitments/create.d.ts +25 -0
- package/dist/commands/commitments/create.js +200 -23
- package/dist/commands/commitments/delivery.d.ts +16 -0
- package/dist/commands/commitments/delivery.js +71 -0
- package/dist/commands/commitments/doctor.d.ts +1 -0
- package/dist/commands/commitments/doctor.js +33 -17
- package/dist/commands/commitments/effective-policy.d.ts +2 -0
- package/dist/commands/commitments/effective-policy.js +50 -5
- package/dist/commands/commitments/endpoints/connect.d.ts +3 -10
- package/dist/commands/commitments/endpoints/connect.js +6 -37
- package/dist/commands/commitments/endpoints/create.d.ts +2 -9
- package/dist/commands/commitments/endpoints/create.js +10 -23
- package/dist/commands/commitments/mode.d.ts +15 -0
- package/dist/commands/commitments/mode.js +57 -0
- package/dist/commands/commitments/pack/promote.d.ts +1 -1
- package/dist/commands/commitments/pack/promote.js +7 -3
- package/dist/commands/commitments/pack/shadow.d.ts +3 -2
- package/dist/commands/commitments/pack/shadow.js +6 -4
- package/dist/commands/commitments/patch.d.ts +14 -0
- package/dist/commands/commitments/patch.js +51 -0
- package/dist/commands/commitments/preflight.d.ts +2 -1
- package/dist/commands/commitments/preflight.js +23 -4
- package/dist/commands/commitments/receipt.d.ts +15 -0
- package/dist/commands/commitments/receipt.js +34 -0
- package/dist/commands/commitments/remediate.d.ts +0 -1
- package/dist/commands/commitments/remediate.js +5 -3
- package/dist/commands/commitments/reports.js +12 -3
- package/dist/commands/commitments/show.d.ts +1 -0
- package/dist/commands/commitments/show.js +22 -1
- package/dist/commands/commitments/update.js +4 -2
- package/dist/commands/commitments/wake-capabilities.d.ts +5 -0
- package/dist/commands/commitments/wake-capabilities.js +23 -7
- package/dist/commands/spaces/bootstrap.js +1 -1
- package/dist/lib/commitment-endpoints.d.ts +3 -2
- package/dist/lib/commitment-endpoints.js +12 -9
- package/dist/lib/commitment-product.d.ts +14 -0
- package/dist/lib/commitment-product.js +78 -0
- package/dist/lib/commitments.d.ts +39 -17
- package/dist/lib/commitments.js +70 -29
- package/dist/node_modules/@skrr-ai/data-provider/index.js +3551 -3461
- package/oclif.manifest.json +19993 -19322
- package/package.json +1 -1
|
@@ -4,6 +4,7 @@ const core_1 = require("@oclif/core");
|
|
|
4
4
|
const base_command_1 = require("../../base-command");
|
|
5
5
|
const commitments_1 = require("../../lib/commitments");
|
|
6
6
|
const web_url_1 = require("../../lib/web-url");
|
|
7
|
+
const commitment_product_1 = require("../../lib/commitment-product");
|
|
7
8
|
/**
|
|
8
9
|
* `skrr commitments show <id>` — the commitment's contract + live control-loop
|
|
9
10
|
* state (health, last check, next check, unresolved-check streak), plus the most
|
|
@@ -23,6 +24,9 @@ class CommitmentsShow extends base_command_1.BaseCommand {
|
|
|
23
24
|
};
|
|
24
25
|
static flags = {
|
|
25
26
|
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
27
|
+
verbose: core_1.Flags.boolean({
|
|
28
|
+
description: 'Include raw compatibility policy and check diagnostics',
|
|
29
|
+
}),
|
|
26
30
|
};
|
|
27
31
|
async run() {
|
|
28
32
|
this.requireAuth();
|
|
@@ -46,13 +50,30 @@ class CommitmentsShow extends base_command_1.BaseCommand {
|
|
|
46
50
|
return;
|
|
47
51
|
}
|
|
48
52
|
(0, commitments_1.renderCommitmentSummary)(response.commitment, (line) => this.log(line), response.latestCheck);
|
|
49
|
-
|
|
53
|
+
try {
|
|
54
|
+
const receipts = await commitments_1.commitmentApi.receipts(args.id, 1);
|
|
55
|
+
if (receipts.receipts[0]) {
|
|
56
|
+
this.log('');
|
|
57
|
+
(0, commitment_product_1.renderExecutionReceipt)(receipts.receipts[0], (line) => this.log(line), flags.verbose);
|
|
58
|
+
}
|
|
59
|
+
else
|
|
60
|
+
this.log('No wake has been observed yet.');
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
this.log('Execution receipt is unavailable. Retry with commitments receipt <id> --latest.');
|
|
64
|
+
}
|
|
65
|
+
if (flags.verbose && response.latestCheck) {
|
|
50
66
|
this.log('');
|
|
51
67
|
this.log('Latest check:');
|
|
52
68
|
(0, commitments_1.renderCheckList)([response.latestCheck], (line) => this.log(line));
|
|
53
69
|
this.log('');
|
|
54
70
|
this.log(`Full history: ${this.config.bin} commitments checks ${args.id}`);
|
|
55
71
|
}
|
|
72
|
+
if (flags.verbose)
|
|
73
|
+
this.log(`Compatibility policy: ${JSON.stringify(response.commitment.policy)}`);
|
|
74
|
+
const url = (0, web_url_1.commitmentUrlFrom)(this.cliConfig.baseURL, response.commitment);
|
|
75
|
+
if (url)
|
|
76
|
+
this.log(`URL: ${url}`);
|
|
56
77
|
}
|
|
57
78
|
}
|
|
58
79
|
exports.default = CommitmentsShow;
|
|
@@ -89,10 +89,12 @@ class CommitmentsUpdate extends base_command_1.BaseCommand {
|
|
|
89
89
|
description: 'Signal Monitor id to watch (repeatable). Implies --watch monitor.',
|
|
90
90
|
multiple: true,
|
|
91
91
|
}),
|
|
92
|
-
cadence: core_1.Flags.string({
|
|
92
|
+
cadence: core_1.Flags.string({
|
|
93
|
+
description: 'New check interval, e.g. "15m", "6h", "30d" (1m..365d)',
|
|
94
|
+
}),
|
|
93
95
|
'cadence-mode': core_1.Flags.string({
|
|
94
96
|
description: 'Cadence mode',
|
|
95
|
-
options: [...commitments_1.
|
|
97
|
+
options: [...commitments_1.COMMITMENT_AUTHORABLE_CADENCE_MODES],
|
|
96
98
|
}),
|
|
97
99
|
timezone: core_1.Flags.string({ description: 'IANA timezone for the cadence' }),
|
|
98
100
|
isolation: core_1.Flags.string({
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { BaseCommand } from '../../base-command';
|
|
2
|
+
export declare function wakePolicyHeadline(result: {
|
|
3
|
+
workPromotionModel?: string;
|
|
4
|
+
}): string;
|
|
2
5
|
/**
|
|
3
6
|
* `skrr commitments wake-capabilities <id>` — which wakes an Agent may pick.
|
|
4
7
|
*
|
|
@@ -10,6 +13,7 @@ import { BaseCommand } from '../../base-command';
|
|
|
10
13
|
* misconfiguration. Showing only one list would make those indistinguishable.
|
|
11
14
|
*/
|
|
12
15
|
export default class CommitmentsWakeCapabilities extends BaseCommand {
|
|
16
|
+
static hidden: boolean;
|
|
13
17
|
static description: string;
|
|
14
18
|
static examples: string[];
|
|
15
19
|
static args: {
|
|
@@ -17,6 +21,7 @@ export default class CommitmentsWakeCapabilities extends BaseCommand {
|
|
|
17
21
|
};
|
|
18
22
|
static flags: {
|
|
19
23
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
24
|
+
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
20
25
|
};
|
|
21
26
|
run(): Promise<void>;
|
|
22
27
|
}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.wakePolicyHeadline = wakePolicyHeadline;
|
|
3
4
|
const core_1 = require("@oclif/core");
|
|
4
5
|
const base_command_1 = require("../../base-command");
|
|
5
6
|
const commitments_1 = require("../../lib/commitments");
|
|
6
7
|
const format_1 = require("../../lib/format");
|
|
8
|
+
function wakePolicyHeadline(result) {
|
|
9
|
+
return result.workPromotionModel === 'monitor_prepare_execute_v1'
|
|
10
|
+
? 'Wake behavior: configured Commitment sources may wake it automatically; there is no separate permission level.'
|
|
11
|
+
: 'Compatibility wake policy is in use. Migrate the Commitment by choosing Monitor, Prepare, or Execute.';
|
|
12
|
+
}
|
|
7
13
|
/**
|
|
8
14
|
* `skrr commitments wake-capabilities <id>` — which wakes an Agent may pick.
|
|
9
15
|
*
|
|
@@ -15,7 +21,10 @@ const format_1 = require("../../lib/format");
|
|
|
15
21
|
* misconfiguration. Showing only one list would make those indistinguishable.
|
|
16
22
|
*/
|
|
17
23
|
class CommitmentsWakeCapabilities extends base_command_1.BaseCommand {
|
|
18
|
-
|
|
24
|
+
// Compatibility/operator diagnostic. Product users configure sources and
|
|
25
|
+
// cadence directly; v2 has no separate wake-permission level.
|
|
26
|
+
static hidden = true;
|
|
27
|
+
static description = 'Inspect configured wake-source diagnostics for a commitment';
|
|
19
28
|
static examples = [
|
|
20
29
|
'<%= config.bin %> commitments wake-capabilities obj_abc123',
|
|
21
30
|
'<%= config.bin %> commitments wake-capabilities obj_abc123 --json',
|
|
@@ -23,7 +32,10 @@ class CommitmentsWakeCapabilities extends base_command_1.BaseCommand {
|
|
|
23
32
|
static args = {
|
|
24
33
|
commitmentId: core_1.Args.string({ ignoreStdin: true, description: 'Commitment ID', required: true }),
|
|
25
34
|
};
|
|
26
|
-
static flags = {
|
|
35
|
+
static flags = {
|
|
36
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
37
|
+
verbose: core_1.Flags.boolean({ description: 'Include raw legacy wake-policy values' }),
|
|
38
|
+
};
|
|
27
39
|
async run() {
|
|
28
40
|
this.requireAuth();
|
|
29
41
|
const { args, flags } = await this.parse(CommitmentsWakeCapabilities);
|
|
@@ -38,11 +50,15 @@ class CommitmentsWakeCapabilities extends base_command_1.BaseCommand {
|
|
|
38
50
|
this.log(JSON.stringify(result, null, 2));
|
|
39
51
|
return;
|
|
40
52
|
}
|
|
41
|
-
|
|
53
|
+
const productModel = result.workPromotionModel === 'monitor_prepare_execute_v1';
|
|
54
|
+
this.log(wakePolicyHeadline(result));
|
|
42
55
|
const selected = result.selectedCapabilityIds;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
56
|
+
if (flags.verbose) {
|
|
57
|
+
this.log(`Raw compatibility mode: ${result.mode}`);
|
|
58
|
+
this.log(selected === undefined
|
|
59
|
+
? 'Raw allowlist: not configured'
|
|
60
|
+
: `Raw allowlist: ${selected.length ? selected.join(', ') : '(empty)'}`);
|
|
61
|
+
}
|
|
46
62
|
this.log('');
|
|
47
63
|
const visible = new Set(result.visibleCapabilities.map((item) => item.id));
|
|
48
64
|
(0, format_1.renderTable)(result.eligibleCapabilities.map((item) => ({
|
|
@@ -54,7 +70,7 @@ class CommitmentsWakeCapabilities extends base_command_1.BaseCommand {
|
|
|
54
70
|
{ key: 'id', header: 'CAPABILITY' },
|
|
55
71
|
{ key: 'kind', header: 'KIND' },
|
|
56
72
|
{ key: 'source', header: 'SOURCE' },
|
|
57
|
-
{ key: 'offered', header: 'OFFERED' },
|
|
73
|
+
{ key: 'offered', header: productModel ? 'ACTIVE' : 'OFFERED' },
|
|
58
74
|
], (line) => this.log(line));
|
|
59
75
|
}
|
|
60
76
|
}
|
|
@@ -60,7 +60,7 @@ class SpacesBootstrap extends base_command_1.BaseCommand {
|
|
|
60
60
|
// one. It names the scope now, and the command prints the server's own
|
|
61
61
|
// contract so the boundary is visible at the point of use rather than buried
|
|
62
62
|
// in a route comment.
|
|
63
|
-
static description = 'Fetch the Space first-paint payload (space, summary,
|
|
63
|
+
static description = 'Fetch the Space first-paint payload (space, summary, and permissions). ' +
|
|
64
64
|
'NOT a complete Space export — tasks, members, Room, files and wiki have their own commands; ' +
|
|
65
65
|
'the printed contract names each one.';
|
|
66
66
|
static examples = [
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { withQuery } from './triggers';
|
|
2
2
|
export declare const ENDPOINT_CAPABILITIES: readonly ["push", "reply", "structuredAsk"];
|
|
3
|
+
export declare const COMMITMENT_ENDPOINT_DESTINATIONS: readonly ["slack_channel", "slack_owner_dm", "app_owner_dm"];
|
|
3
4
|
export type EndpointCapability = (typeof ENDPOINT_CAPABILITIES)[number];
|
|
4
5
|
export interface CommitmentEndpoint {
|
|
5
6
|
id: string;
|
|
@@ -21,9 +22,9 @@ export declare const commitmentEndpointApi: {
|
|
|
21
22
|
endpoints: CommitmentEndpoint[];
|
|
22
23
|
}>;
|
|
23
24
|
create: (body: Record<string, unknown>) => Promise<CommitmentEndpoint>;
|
|
24
|
-
/**
|
|
25
|
+
/** Probes the native App/Slack transport and records current health. */
|
|
25
26
|
connect: (id: string, body?: Record<string, unknown>) => Promise<Record<string, unknown>>;
|
|
26
|
-
/**
|
|
27
|
+
/** Legacy compatibility call; new native endpoints do not use OAuth. */
|
|
27
28
|
finalizeConnect: (id: string, body?: Record<string, unknown>) => Promise<Record<string, unknown>>;
|
|
28
29
|
reconnect: (id: string, body?: Record<string, unknown>) => Promise<Record<string, unknown>>;
|
|
29
30
|
health: (id: string, body?: Record<string, unknown>) => Promise<Record<string, unknown>>;
|
|
@@ -1,36 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.commitmentEndpointApi = exports.ENDPOINT_CAPABILITIES = void 0;
|
|
3
|
+
exports.commitmentEndpointApi = exports.COMMITMENT_ENDPOINT_DESTINATIONS = exports.ENDPOINT_CAPABILITIES = void 0;
|
|
4
4
|
exports.renderEndpointList = renderEndpointList;
|
|
5
5
|
/**
|
|
6
6
|
* commitment-endpoints.ts — client for `/api/commitment-endpoints`.
|
|
7
7
|
*
|
|
8
8
|
* A **commitment endpoint** is a channel-neutral DELIVERY TARGET: "this agent
|
|
9
|
-
* can reach me on Slack DM / this channel /
|
|
9
|
+
* can reach me on Slack DM / this channel / App DM", expressed as a connection
|
|
10
10
|
* record with a readiness state. Commitments then declare report targets against
|
|
11
11
|
* these, so a commitment never names a raw Slack channel id or a token.
|
|
12
12
|
*
|
|
13
13
|
* The lifecycle is the interesting part, and it is why this needs a CLI at all:
|
|
14
14
|
*
|
|
15
|
-
* create → connect →
|
|
15
|
+
* create → connect/probe → connected → [health] → reconnect / revoke
|
|
16
16
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* step that used to require a browser — which meant a headless operator could
|
|
20
|
-
* not set up a commitment's reporting at all.
|
|
17
|
+
* OAuth connector metadata is deliberately absent: the delivery router uses
|
|
18
|
+
* the native Agent Slack installation or built-in App transport.
|
|
21
19
|
*/
|
|
22
20
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
23
21
|
const format_1 = require("./format");
|
|
24
22
|
const triggers_1 = require("./triggers");
|
|
25
23
|
exports.ENDPOINT_CAPABILITIES = ['push', 'reply', 'structuredAsk'];
|
|
24
|
+
exports.COMMITMENT_ENDPOINT_DESTINATIONS = [
|
|
25
|
+
'slack_channel',
|
|
26
|
+
'slack_owner_dm',
|
|
27
|
+
'app_owner_dm',
|
|
28
|
+
];
|
|
26
29
|
const MOUNT = '/api/commitment-endpoints';
|
|
27
30
|
const base = (id) => `${MOUNT}/${encodeURIComponent(id)}`;
|
|
28
31
|
exports.commitmentEndpointApi = {
|
|
29
32
|
list: (query = {}) => data_provider_1.request.get((0, triggers_1.withQuery)(MOUNT, query)),
|
|
30
33
|
create: (body) => data_provider_1.request.post(MOUNT, body),
|
|
31
|
-
/**
|
|
34
|
+
/** Probes the native App/Slack transport and records current health. */
|
|
32
35
|
connect: (id, body = {}) => data_provider_1.request.post(`${base(id)}/connect`, body),
|
|
33
|
-
/**
|
|
36
|
+
/** Legacy compatibility call; new native endpoints do not use OAuth. */
|
|
34
37
|
finalizeConnect: (id, body = {}) => data_provider_1.request.post(`${base(id)}/connect/finalize`, body),
|
|
35
38
|
reconnect: (id, body = {}) => data_provider_1.request.post(`${base(id)}/reconnect`, body),
|
|
36
39
|
health: (id, body = {}) => data_provider_1.request.post(`${base(id)}/health`, body),
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CommitmentDeliveryIntent, CommitmentExecutionReceipt } from '@skrr-ai/data-provider';
|
|
2
|
+
export declare const COMMITMENT_PRODUCT_MODES: readonly ["monitor", "prepare", "execute"];
|
|
3
|
+
export declare const COMMITMENT_DELIVERY_CHOICES: readonly ["report-only", "local-patch", "draft-pr", "push-branch", "direct-branch"];
|
|
4
|
+
/** Compatibility is accepted at the input boundary; everyday output uses the product contract. */
|
|
5
|
+
export declare function productMode(value?: string): 'monitor' | 'prepare' | 'execute';
|
|
6
|
+
export declare function productModeLabel(value?: string): string;
|
|
7
|
+
export declare function deliveryLabel(mode?: string): string;
|
|
8
|
+
export declare function deliveryInput(mode: string, options?: {
|
|
9
|
+
repo?: string;
|
|
10
|
+
base?: string;
|
|
11
|
+
}): CommitmentDeliveryIntent;
|
|
12
|
+
/** Monitor is observation-only; retain report expectations, never repo coordinates. */
|
|
13
|
+
export declare function deliveryForProductMode(mode: string | undefined, delivery?: CommitmentDeliveryIntent): CommitmentDeliveryIntent | undefined;
|
|
14
|
+
export declare function renderExecutionReceipt(receipt: CommitmentExecutionReceipt, log: (line: string) => void, verbose?: boolean): void;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.COMMITMENT_DELIVERY_CHOICES = exports.COMMITMENT_PRODUCT_MODES = void 0;
|
|
4
|
+
exports.productMode = productMode;
|
|
5
|
+
exports.productModeLabel = productModeLabel;
|
|
6
|
+
exports.deliveryLabel = deliveryLabel;
|
|
7
|
+
exports.deliveryInput = deliveryInput;
|
|
8
|
+
exports.deliveryForProductMode = deliveryForProductMode;
|
|
9
|
+
exports.renderExecutionReceipt = renderExecutionReceipt;
|
|
10
|
+
exports.COMMITMENT_PRODUCT_MODES = ['monitor', 'prepare', 'execute'];
|
|
11
|
+
exports.COMMITMENT_DELIVERY_CHOICES = [
|
|
12
|
+
'report-only',
|
|
13
|
+
'local-patch',
|
|
14
|
+
'draft-pr',
|
|
15
|
+
'push-branch',
|
|
16
|
+
'direct-branch',
|
|
17
|
+
];
|
|
18
|
+
/** Compatibility is accepted at the input boundary; everyday output uses the product contract. */
|
|
19
|
+
function productMode(value) {
|
|
20
|
+
if (value === 'prepare' || value === 'ask_first')
|
|
21
|
+
return 'prepare';
|
|
22
|
+
if (['execute', 'auto_run', 'auto_run_limited'].includes(value || ''))
|
|
23
|
+
return 'execute';
|
|
24
|
+
return 'monitor';
|
|
25
|
+
}
|
|
26
|
+
function productModeLabel(value) {
|
|
27
|
+
if (value === 'off')
|
|
28
|
+
return 'Not running';
|
|
29
|
+
const mode = productMode(value);
|
|
30
|
+
return mode[0].toUpperCase() + mode.slice(1);
|
|
31
|
+
}
|
|
32
|
+
function deliveryLabel(mode) {
|
|
33
|
+
return ({
|
|
34
|
+
report_only: 'Report only',
|
|
35
|
+
local_patch: 'Local patch',
|
|
36
|
+
draft_pr: 'Draft PR',
|
|
37
|
+
push_branch: 'Push branch',
|
|
38
|
+
direct_branch: 'Direct branch',
|
|
39
|
+
}[mode || ''] || 'Not declared');
|
|
40
|
+
}
|
|
41
|
+
function deliveryInput(mode, options = {}) {
|
|
42
|
+
const normalized = mode.replace(/-/g, '_');
|
|
43
|
+
if (!exports.COMMITMENT_DELIVERY_CHOICES.some((choice) => choice.replace(/-/g, '_') === normalized)) {
|
|
44
|
+
throw new Error(`Unknown delivery. Choose ${exports.COMMITMENT_DELIVERY_CHOICES.join(', ')}.`);
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
version: 1,
|
|
48
|
+
mode: normalized,
|
|
49
|
+
...(options.repo ? { repo: options.repo } : {}),
|
|
50
|
+
...(options.base ? { baseBranch: options.base } : {}),
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/** Monitor is observation-only; retain report expectations, never repo coordinates. */
|
|
54
|
+
function deliveryForProductMode(mode, delivery) {
|
|
55
|
+
if (productMode(mode) !== 'monitor')
|
|
56
|
+
return delivery;
|
|
57
|
+
return {
|
|
58
|
+
version: 1,
|
|
59
|
+
mode: 'report_only',
|
|
60
|
+
...(delivery?.expectations ? { expectations: delivery.expectations } : {}),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
function renderExecutionReceipt(receipt, log, verbose = false) {
|
|
64
|
+
log(receipt.summary);
|
|
65
|
+
log(`Mode: ${productModeLabel(receipt.mode)}`);
|
|
66
|
+
for (const phase of receipt.phases) {
|
|
67
|
+
const mark = { done: '✓', working: '→', waiting: '…', failed: '×', skipped: '–' }[phase.status];
|
|
68
|
+
log(` ${mark} ${phase.phase[0].toUpperCase() + phase.phase.slice(1)}: ${phase.summary}${phase.at ? ` · ${phase.at}` : ''}`);
|
|
69
|
+
for (const evidence of phase.evidence) {
|
|
70
|
+
if (evidence.url)
|
|
71
|
+
log(` ${evidence.label}: ${evidence.url}`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if (receipt.nextActor)
|
|
75
|
+
log(`Next: ${receipt.nextActor.label || receipt.nextActor.kind}${receipt.nextActor.reason ? ` — ${receipt.nextActor.reason}` : ''}`);
|
|
76
|
+
if (verbose)
|
|
77
|
+
log(`Diagnostics:\n${JSON.stringify({ id: receipt.id, revision: receipt.revision, evidence: receipt.evidence, diagnostics: receipt.diagnostics }, null, 2)}`);
|
|
78
|
+
}
|
|
@@ -17,10 +17,13 @@
|
|
|
17
17
|
* "hold this state", derived from a Compass invariant — not authored here).
|
|
18
18
|
*/
|
|
19
19
|
import { COMMITMENT_WATCHED_SOURCES, COMMITMENT_TEMPLATE_IDS, COMMITMENT_CADENCE_MODES, COMMITMENT_CADENCE_TIME_PATTERN, COMMITMENT_CADENCE_MAX_TIMES, COMMITMENT_AUTONOMY_MODES, COMMITMENT_EXECUTION_ISOLATION_MODES } from '@skrr-ai/data-provider';
|
|
20
|
-
import type { CommitmentCheck, CommitmentChecksResponse, Commitment, CommitmentListResponse, CommitmentPlanResponse, CommitmentStatusResponse, CommitmentWorkLink } from '@skrr-ai/data-provider';
|
|
20
|
+
import type { CommitmentCheck, CommitmentChecksResponse, Commitment, CommitmentActionProposal, CommitmentListResponse, CommitmentPlanResponse, CommitmentStatusResponse, CommitmentWorkLink, CommitmentExecutionReceiptListResponse, CommitmentCapabilitySource, CommitmentDeliveryPatchResponse, CommitmentDeliveryBundleResponse } from '@skrr-ai/data-provider';
|
|
21
21
|
import { withQuery } from './triggers';
|
|
22
22
|
export { COMMITMENT_WATCHED_SOURCES, COMMITMENT_TEMPLATE_IDS, COMMITMENT_CADENCE_MODES, COMMITMENT_CADENCE_TIME_PATTERN, COMMITMENT_CADENCE_MAX_TIMES, };
|
|
23
|
-
export type { CommitmentCheck, CommitmentChecksResponse, Commitment, CommitmentListResponse, CommitmentPlanResponse, CommitmentStatusResponse, CommitmentWorkLink, };
|
|
23
|
+
export type { CommitmentCheck, CommitmentChecksResponse, Commitment, CommitmentActionProposal, CommitmentListResponse, CommitmentPlanResponse, CommitmentStatusResponse, CommitmentWorkLink, };
|
|
24
|
+
/** Derived from the installed compatibility vocabulary so the CLI remains
|
|
25
|
+
* safe even while data-provider and CLI packages roll out separately. */
|
|
26
|
+
export declare const COMMITMENT_AUTHORABLE_CADENCE_MODES: ("manual" | "daily" | "interval" | "event_plus_interval")[];
|
|
24
27
|
/**
|
|
25
28
|
* oclif's `options:` needs runtime arrays, but data-provider models these two as
|
|
26
29
|
* union TYPES only. The values live here — and both directions of drift are a
|
|
@@ -36,6 +39,11 @@ export declare const COMMITMENT_STATUSES: readonly ["draft", "active", "paused",
|
|
|
36
39
|
* that rejects its values.
|
|
37
40
|
*/
|
|
38
41
|
export { COMMITMENT_AUTONOMY_MODES };
|
|
42
|
+
export declare const COMMITMENT_AUTHORABLE_AUTONOMY_MODES: readonly ["monitor", "prepare", "execute"];
|
|
43
|
+
export type CommitmentAuthorableAutonomyMode = (typeof COMMITMENT_AUTHORABLE_AUTONOMY_MODES)[number];
|
|
44
|
+
export declare function storedAutonomyModeForAuthoring(mode: CommitmentAuthorableAutonomyMode | string): 'suggestions_only' | 'ask_first' | 'auto_run';
|
|
45
|
+
export declare function authoringAutonomyModeForStored(mode?: string | null): CommitmentAuthorableAutonomyMode;
|
|
46
|
+
export declare function commitmentAutonomyLabel(mode?: string | null): string;
|
|
39
47
|
/**
|
|
40
48
|
* Where a Commitment's autonomous runs do their work. Re-exported for the same
|
|
41
49
|
* reason as the ladder above: the vocabulary is the server's, and a picker that
|
|
@@ -45,11 +53,9 @@ export { COMMITMENT_EXECUTION_ISOLATION_MODES };
|
|
|
45
53
|
/**
|
|
46
54
|
* Interval bounds for `cadence.intervalMs`.
|
|
47
55
|
*
|
|
48
|
-
* The
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
* over 24h yields a commitment whose control loop NEVER fires while every surface
|
|
52
|
-
* reports success. Cap at 24h so that state is unreachable from the CLI.
|
|
56
|
+
* The Trigger schedule and Commitment contract now share the same one-year
|
|
57
|
+
* upper bound. Keep the CLI aligned so a valid long-interval contract does not
|
|
58
|
+
* get rejected only at this surface.
|
|
53
59
|
*/
|
|
54
60
|
export declare const MIN_COMMITMENT_INTERVAL_MS = 60000;
|
|
55
61
|
export declare const MAX_COMMITMENT_INTERVAL_MS: number;
|
|
@@ -62,6 +68,7 @@ export type CommitmentView = Partial<Commitment>;
|
|
|
62
68
|
export type CommitmentCheckView = Partial<CommitmentCheck>;
|
|
63
69
|
export type CommitmentPreflightReport = {
|
|
64
70
|
verdict: 'ready' | 'needs_review' | 'blocked';
|
|
71
|
+
capabilities?: CommitmentCapabilitySource[];
|
|
65
72
|
gates: Array<{
|
|
66
73
|
id: string;
|
|
67
74
|
label: string;
|
|
@@ -171,6 +178,7 @@ export type CommitmentPackLifecycleResponse = {
|
|
|
171
178
|
title?: string;
|
|
172
179
|
status?: string;
|
|
173
180
|
policy?: Record<string, unknown>;
|
|
181
|
+
delivery?: Commitment['delivery'];
|
|
174
182
|
};
|
|
175
183
|
pack: {
|
|
176
184
|
id: string;
|
|
@@ -245,12 +253,26 @@ export declare const commitmentApi: {
|
|
|
245
253
|
actionHistory: (id: string, limit?: number) => Promise<{
|
|
246
254
|
data: unknown[];
|
|
247
255
|
}>;
|
|
256
|
+
actionProposals: (id: string, query?: {
|
|
257
|
+
status?: string;
|
|
258
|
+
limit?: number;
|
|
259
|
+
}) => Promise<{
|
|
260
|
+
object: "commitment_action_proposal_list";
|
|
261
|
+
data: CommitmentActionProposal[];
|
|
262
|
+
}>;
|
|
263
|
+
decideActionProposal: (id: string, proposalId: string, decision: "approve" | "reject") => Promise<Record<string, unknown>>;
|
|
264
|
+
executeActionProposal: (id: string, proposalId: string) => Promise<Record<string, unknown>>;
|
|
248
265
|
preflight: (id: string, nextRunCount?: number) => Promise<CommitmentPreflightReport>;
|
|
249
266
|
effectivePolicy: (id: string) => Promise<Record<string, unknown>>;
|
|
250
267
|
pause: (id: string) => Promise<Commitment>;
|
|
251
268
|
resume: (id: string) => Promise<Commitment>;
|
|
252
269
|
complete: (id: string) => Promise<Commitment>;
|
|
253
270
|
autonomy: (id: string, body: Record<string, unknown>) => Promise<Commitment>;
|
|
271
|
+
mode: (id: string, body: Record<string, unknown>) => Promise<Commitment>;
|
|
272
|
+
delivery: (id: string, body: Record<string, unknown>) => Promise<Commitment>;
|
|
273
|
+
receipts: (id: string, limit?: number) => Promise<CommitmentExecutionReceiptListResponse>;
|
|
274
|
+
deliveryPatch: (id: string, taskId: string) => Promise<CommitmentDeliveryPatchResponse>;
|
|
275
|
+
deliveryBundle: (id: string, taskId: string) => Promise<CommitmentDeliveryBundleResponse>;
|
|
254
276
|
operatingReview: (agentId: string) => Promise<Record<string, unknown>>;
|
|
255
277
|
reflection: (id: string) => Promise<Record<string, unknown>>;
|
|
256
278
|
decideReflectionProposal: (id: string, proposalKey: string, decision: "approve" | "reject") => Promise<Record<string, unknown>>;
|
|
@@ -337,6 +359,7 @@ export declare const commitmentApi: {
|
|
|
337
359
|
};
|
|
338
360
|
/** Shape of `GET /:id/wake-capabilities`. */
|
|
339
361
|
export interface CommitmentWakeCapabilities {
|
|
362
|
+
workPromotionModel?: 'monitor_prepare_execute_v1';
|
|
340
363
|
mode: string;
|
|
341
364
|
selectedCapabilityIds?: string[];
|
|
342
365
|
eligibleCapabilities: Array<{
|
|
@@ -359,7 +382,7 @@ export declare const COMMITMENT_FEEDBACK_KINDS: readonly ["useful", "noisy", "wr
|
|
|
359
382
|
*/
|
|
360
383
|
export declare const COMMITMENT_REMEDIATION_ACTIONS: readonly ["pause_commitment", "mute_user_nudges", "reduce_nudge_frequency", "tighten_policy", "mark_noop"];
|
|
361
384
|
/** The only keys `createBodySchema` (a `z.strictObject`) accepts. */
|
|
362
|
-
export declare const COMMITMENT_CREATE_KEYS: readonly ["agentId", "kind", "compassId", "compassOrigin", "goalId", "title", "description", "agentDirective", "status", "target", "watchedSources", "policy", "cadence", "subject", "sensors", "grants", "reports", "createdVia"];
|
|
385
|
+
export declare const COMMITMENT_CREATE_KEYS: readonly ["mode", "agentId", "kind", "compassId", "compassOrigin", "goalId", "title", "description", "agentDirective", "status", "target", "watchedSources", "policy", "delivery", "cadence", "subject", "sensors", "grants", "reports", "createdVia"];
|
|
363
386
|
/**
|
|
364
387
|
* Read the per-Commitment domain policy from an inline flag or a text file.
|
|
365
388
|
*
|
|
@@ -382,8 +405,9 @@ export declare function readCommitmentAgentDirective({ directive, file, }: {
|
|
|
382
405
|
* contract dumped from `list --json` carries id/version/state/ownerUserId/…
|
|
383
406
|
* — drop everything the schema does not declare.
|
|
384
407
|
*
|
|
385
|
-
* `status` is additionally narrowed: create only permits `draft
|
|
386
|
-
* dumped contract may carry
|
|
408
|
+
* `status` is additionally narrowed: create only permits `draft`; activation
|
|
409
|
+
* is the separate resume + preflight boundary. A dumped contract may carry an
|
|
410
|
+
* active or terminal state, but importing it must still create a draft.
|
|
387
411
|
*/
|
|
388
412
|
export declare function normalizeCreateBody(input: Record<string, unknown>): Record<string, unknown>;
|
|
389
413
|
export declare function parseIntervalToMs(input: string): number;
|
|
@@ -462,13 +486,11 @@ export declare function renderCommitmentList(commitments: CommitmentView[], log:
|
|
|
462
486
|
* The autonomy mode a check ACTUALLY ran at, read from its policy trace
|
|
463
487
|
* (OSK-4881).
|
|
464
488
|
*
|
|
465
|
-
* A
|
|
466
|
-
*
|
|
467
|
-
*
|
|
468
|
-
* `
|
|
469
|
-
*
|
|
470
|
-
* `effectiveAutonomyMode`. Either answers "what governed this run". Returns the
|
|
471
|
-
* effective mode when the trace carries one, else undefined.
|
|
489
|
+
* A check records the Mode it actually used in `decision.policyTrace`. For the
|
|
490
|
+
* v2 product contract, only an explicit Workspace-admin constraint may lower
|
|
491
|
+
* the declared Mode; legacy checks may still carry older effective-mode traces.
|
|
492
|
+
* Either `autonomyMode` or `effectiveAutonomyMode` answers what governed that
|
|
493
|
+
* particular run. Returns undefined when the trace carries neither.
|
|
472
494
|
*
|
|
473
495
|
* Exported for tests.
|
|
474
496
|
*/
|