@skrr-ai/cli 0.1.92 → 0.1.94
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base-command.d.ts +44 -0
- package/dist/base-command.js +96 -0
- package/dist/commands/agents/badge.d.ts +41 -0
- package/dist/commands/agents/badge.js +158 -0
- package/dist/commands/agents/create.d.ts +24 -0
- package/dist/commands/agents/create.js +212 -0
- package/dist/commands/agents/embed.d.ts +20 -0
- package/dist/commands/agents/embed.js +61 -0
- package/dist/commands/agents/operating-plan.d.ts +11 -0
- package/dist/commands/agents/operating-plan.js +54 -0
- package/dist/commands/agents/roles/example.d.ts +11 -0
- package/dist/commands/agents/roles/example.js +30 -0
- package/dist/commands/{commitments/mode.d.ts → agents/roles/export.d.ts} +5 -5
- package/dist/commands/agents/roles/export.js +81 -0
- package/dist/commands/agents/roles/install.d.ts +12 -0
- package/dist/commands/agents/roles/install.js +48 -0
- package/dist/commands/agents/roles/list.d.ts +11 -0
- package/dist/commands/agents/roles/list.js +36 -0
- package/dist/commands/agents/roles/preview.d.ts +14 -0
- package/dist/commands/agents/roles/preview.js +49 -0
- package/dist/commands/agents/roles/withdraw.d.ts +13 -0
- package/dist/commands/agents/roles/withdraw.js +43 -0
- package/dist/commands/agents/share.d.ts +27 -0
- package/dist/commands/agents/share.js +100 -0
- package/dist/commands/agents/vanity.d.ts +21 -0
- package/dist/commands/agents/vanity.js +77 -0
- package/dist/commands/agents/visibility.d.ts +21 -1
- package/dist/commands/agents/visibility.js +112 -0
- package/dist/commands/commands.d.ts +1 -0
- package/dist/commands/commands.js +22 -9
- package/dist/commands/commitments/{autonomy-requests → cadence-requests}/decide.d.ts +5 -7
- package/dist/commands/commitments/{autonomy-requests → cadence-requests}/decide.js +13 -15
- package/dist/commands/commitments/cost.d.ts +1 -1
- package/dist/commands/commitments/cost.js +1 -1
- package/dist/commands/commitments/create.d.ts +0 -7
- package/dist/commands/commitments/create.js +9 -98
- package/dist/commands/commitments/delivery.js +3 -21
- package/dist/commands/commitments/doctor.js +28 -27
- package/dist/commands/commitments/effective-policy.js +5 -36
- package/dist/commands/commitments/evaluations.d.ts +15 -0
- package/dist/commands/commitments/evaluations.js +54 -0
- package/dist/commands/commitments/pack/activate.d.ts +11 -0
- package/dist/commands/commitments/pack/activate.js +22 -0
- package/dist/commands/commitments/pack/bind.js +1 -1
- package/dist/commands/commitments/remediate.js +2 -5
- package/dist/commands/commitments/show.js +1 -1
- package/dist/commands/commitments/update.js +9 -9
- package/dist/commands/commitments/wake-capabilities.d.ts +1 -3
- package/dist/commands/commitments/wake-capabilities.js +5 -21
- package/dist/commands/earnings/attributions.d.ts +17 -0
- package/dist/commands/earnings/attributions.js +82 -0
- package/dist/commands/earnings/index.js +2 -1
- package/dist/commands/generate-recovery-code.js +4 -3
- package/dist/commands/github/allow-tools.d.ts +1 -0
- package/dist/commands/github/app/install.d.ts +1 -0
- package/dist/commands/github/app/status.d.ts +1 -0
- package/dist/commands/github/connect.d.ts +1 -0
- package/dist/commands/github/connections.d.ts +1 -0
- package/dist/commands/github/disconnect.d.ts +1 -0
- package/dist/commands/github/finalize.d.ts +1 -0
- package/dist/commands/github/reconnect.d.ts +1 -0
- package/dist/commands/github/run.d.ts +1 -0
- package/dist/commands/github/tools.d.ts +1 -0
- package/dist/commands/integrations/connections/connect.d.ts +1 -0
- package/dist/commands/integrations/connections/disconnect.d.ts +1 -0
- package/dist/commands/integrations/connections/finalize.d.ts +1 -0
- package/dist/commands/integrations/connections/list.d.ts +1 -0
- package/dist/commands/integrations/connections/reconnect.d.ts +1 -0
- package/dist/commands/integrations/execute.d.ts +1 -0
- package/dist/commands/integrations/search.d.ts +1 -0
- package/dist/commands/integrations/toolkits.d.ts +1 -0
- package/dist/commands/integrations/tools/allow.d.ts +1 -0
- package/dist/commands/integrations/tools/list.d.ts +1 -0
- package/dist/commands/login.js +12 -0
- package/dist/commands/machines/dedicated/logs.d.ts +19 -0
- package/dist/commands/machines/dedicated/logs.js +103 -0
- package/dist/commands/machines/dedicated/power/set.js +1 -1
- package/dist/commands/open.d.ts +24 -0
- package/dist/commands/open.js +74 -0
- package/dist/commands/projects/archive.d.ts +1 -0
- package/dist/commands/projects/archive.js +23 -0
- package/dist/commands/projects/delete.d.ts +1 -0
- package/dist/commands/projects/delete.js +23 -0
- package/dist/commands/projects/list.d.ts +3 -0
- package/dist/commands/projects/list.js +12 -2
- package/dist/commands/spaces/actions/add.js +4 -3
- package/dist/commands/spaces/actions/available.js +3 -2
- package/dist/commands/spaces/actions/list.js +5 -4
- package/dist/commands/spaces/actions/replace.js +6 -5
- package/dist/commands/spaces/archive.js +3 -2
- package/dist/commands/spaces/auto-executor/preview.js +4 -3
- package/dist/commands/spaces/auto-executor/run.js +4 -3
- package/dist/commands/spaces/auto-executor/runs.js +3 -2
- package/dist/commands/spaces/auto-executor/update.js +4 -3
- package/dist/commands/spaces/bootstrap.js +3 -2
- package/dist/commands/spaces/briefs/delete.js +3 -2
- package/dist/commands/spaces/briefs/get.js +3 -2
- package/dist/commands/spaces/briefs/list.js +3 -2
- package/dist/commands/spaces/briefs/set.js +5 -4
- package/dist/commands/spaces/capacity.js +5 -4
- package/dist/commands/spaces/conversations.js +3 -2
- package/dist/commands/spaces/cycles/create.js +3 -2
- package/dist/commands/spaces/cycles/graph.js +2 -1
- package/dist/commands/spaces/cycles/list.js +3 -2
- package/dist/commands/spaces/cycles/settings.js +4 -3
- package/dist/commands/spaces/cycles/show.js +3 -2
- package/dist/commands/spaces/cycles/update.js +3 -2
- package/dist/commands/spaces/delete.js +4 -3
- package/dist/commands/spaces/expertise-suggestions.js +4 -3
- package/dist/commands/spaces/files/delete.js +3 -2
- package/dist/commands/spaces/files/folders/create.js +3 -2
- package/dist/commands/spaces/files/folders/delete.js +3 -2
- package/dist/commands/spaces/files/folders/list.js +3 -2
- package/dist/commands/spaces/files/folders/update.js +3 -2
- package/dist/commands/spaces/files/list.js +3 -2
- package/dist/commands/spaces/files/move.js +3 -2
- package/dist/commands/spaces/files/rename.js +3 -2
- package/dist/commands/spaces/files/upload.js +6 -5
- package/dist/commands/spaces/github-automations/set.js +3 -2
- package/dist/commands/spaces/github-automations/show.js +3 -2
- package/dist/commands/spaces/goals.js +2 -1
- package/dist/commands/spaces/heartbeats/create.js +4 -3
- package/dist/commands/spaces/heartbeats/delete.js +4 -3
- package/dist/commands/spaces/heartbeats/list.js +4 -3
- package/dist/commands/spaces/heartbeats/status.js +3 -2
- package/dist/commands/spaces/heartbeats/update.js +4 -3
- package/dist/commands/spaces/insights.js +5 -4
- package/dist/commands/spaces/labels/add.js +4 -3
- package/dist/commands/spaces/labels/list.js +2 -1
- package/dist/commands/spaces/labels/remove.js +4 -3
- package/dist/commands/spaces/list.d.ts +3 -0
- package/dist/commands/spaces/list.js +11 -2
- package/dist/commands/spaces/live/cards/create.js +3 -2
- package/dist/commands/spaces/live/cards/list.js +3 -2
- package/dist/commands/spaces/live/cards/reorder.js +7 -2
- package/dist/commands/spaces/live/scene.js +4 -3
- package/dist/commands/spaces/members/add.js +7 -6
- package/dist/commands/spaces/members/list.js +4 -3
- package/dist/commands/spaces/members/remove.js +7 -6
- package/dist/commands/spaces/move.js +3 -2
- package/dist/commands/spaces/pin.js +5 -4
- package/dist/commands/spaces/preferences/show.js +4 -3
- package/dist/commands/spaces/preferences/tabs.js +4 -3
- package/dist/commands/spaces/revisions.js +3 -2
- package/dist/commands/spaces/room/ensure.js +5 -4
- package/dist/commands/spaces/room/messages.js +3 -2
- package/dist/commands/spaces/room/show.js +5 -4
- package/dist/commands/spaces/skills/add.js +4 -3
- package/dist/commands/spaces/skills/list.js +3 -2
- package/dist/commands/spaces/skills/pin.js +4 -3
- package/dist/commands/spaces/skills/remove.js +4 -3
- package/dist/commands/spaces/snapshot.js +3 -2
- package/dist/commands/spaces/states/archive.js +3 -2
- package/dist/commands/spaces/states/create.js +3 -2
- package/dist/commands/spaces/states/list.js +3 -2
- package/dist/commands/spaces/states/reorder.js +2 -1
- package/dist/commands/spaces/states/update.js +3 -2
- package/dist/commands/spaces/summary.js +4 -3
- package/dist/commands/spaces/tasks.d.ts +3 -0
- package/dist/commands/spaces/tasks.js +14 -3
- package/dist/commands/spaces/triggers/delete.js +5 -4
- package/dist/commands/spaces/triggers/set.js +4 -3
- package/dist/commands/spaces/triggers/show.js +4 -3
- package/dist/commands/spaces/unarchive.js +3 -2
- package/dist/commands/spaces/update.js +5 -4
- package/dist/commands/spaces/views/create.js +3 -2
- package/dist/commands/spaces/views/list.js +3 -2
- package/dist/commands/spaces/views/reorder.js +6 -3
- package/dist/commands/spaces/views/subscribe.js +2 -1
- package/dist/commands/spaces/views/subscriptions.js +1 -0
- package/dist/commands/spaces/views/unsubscribe.js +2 -1
- package/dist/commands/spaces/widgets/add.js +4 -3
- package/dist/commands/spaces/widgets/list.js +3 -2
- package/dist/commands/spaces/widgets/remove.js +5 -4
- package/dist/commands/spaces/work-graph.js +2 -1
- package/dist/commands/store/install.d.ts +1 -1
- package/dist/commands/store/install.js +24 -8
- package/dist/commands/store/show.d.ts +25 -0
- package/dist/commands/store/show.js +203 -0
- package/dist/commands/store/stats.d.ts +33 -0
- package/dist/commands/store/stats.js +258 -0
- package/dist/commands/tasks/actions/attach.js +1 -1
- package/dist/commands/tasks/actions/detach.js +4 -3
- package/dist/commands/tasks/activity.js +3 -2
- package/dist/commands/tasks/ancestors.js +2 -1
- package/dist/commands/tasks/approvals/create.js +2 -1
- package/dist/commands/tasks/approvals/delete.js +3 -2
- package/dist/commands/tasks/approvals/list.js +5 -4
- package/dist/commands/tasks/approvals/resolve.js +2 -1
- package/dist/commands/tasks/archive.js +3 -2
- package/dist/commands/tasks/assign.js +4 -3
- package/dist/commands/tasks/attachments/delete.js +3 -2
- package/dist/commands/tasks/attachments/download.d.ts +1 -0
- package/dist/commands/tasks/attachments/download.js +20 -1
- package/dist/commands/tasks/attachments/list.js +2 -1
- package/dist/commands/tasks/attachments/set-role.js +2 -1
- package/dist/commands/tasks/attachments/upload.js +2 -1
- package/dist/commands/tasks/bulk-update.d.ts +1 -0
- package/dist/commands/tasks/bulk-update.js +106 -15
- package/dist/commands/tasks/cancel-cascade.d.ts +1 -0
- package/dist/commands/tasks/cancel-cascade.js +13 -3
- package/dist/commands/tasks/cascade-status.js +2 -1
- package/dist/commands/tasks/checkout.js +3 -2
- package/dist/commands/tasks/children.js +2 -1
- package/dist/commands/tasks/comments/add.js +7 -6
- package/dist/commands/tasks/comments/anchor.js +8 -7
- package/dist/commands/tasks/comments/delete.js +3 -2
- package/dist/commands/tasks/comments/list.js +2 -1
- package/dist/commands/tasks/comments/reopen.js +3 -2
- package/dist/commands/tasks/comments/resolve.js +3 -2
- package/dist/commands/tasks/create-tree.d.ts +63 -0
- package/dist/commands/tasks/create-tree.js +197 -4
- package/dist/commands/tasks/delete.js +5 -4
- package/dist/commands/tasks/descendants.js +2 -1
- package/dist/commands/tasks/dri-plan.js +3 -2
- package/dist/commands/tasks/dri-run.js +3 -2
- package/dist/commands/tasks/dri-status.js +2 -1
- package/dist/commands/tasks/duplicate-pipeline.js +2 -1
- package/dist/commands/tasks/execution-summary.js +2 -1
- package/dist/commands/tasks/execution-timeline.js +2 -1
- package/dist/commands/tasks/fork.js +1 -0
- package/dist/commands/tasks/forward.js +4 -3
- package/dist/commands/tasks/handover.js +1 -0
- package/dist/commands/tasks/interrupt.js +3 -2
- package/dist/commands/tasks/labels/attach.js +4 -3
- package/dist/commands/tasks/labels/detach.js +4 -3
- package/dist/commands/tasks/labels/suggest.js +5 -4
- package/dist/commands/tasks/list.d.ts +27 -1
- package/dist/commands/tasks/list.js +101 -3
- package/dist/commands/tasks/move.js +4 -3
- package/dist/commands/tasks/output.js +6 -5
- package/dist/commands/tasks/pause-schedule.js +3 -2
- package/dist/commands/tasks/promote.js +1 -0
- package/dist/commands/tasks/prompt-log.js +2 -1
- package/dist/commands/tasks/release.js +5 -4
- package/dist/commands/tasks/remind.js +2 -1
- package/dist/commands/tasks/replay.js +3 -2
- package/dist/commands/tasks/report.js +1 -0
- package/dist/commands/tasks/resume-schedule.js +3 -2
- package/dist/commands/tasks/retry-schedule.js +3 -2
- package/dist/commands/tasks/retry.js +10 -9
- package/dist/commands/tasks/revisions.js +2 -1
- package/dist/commands/tasks/runs.js +6 -5
- package/dist/commands/tasks/schedule.js +3 -2
- package/dist/commands/tasks/self-schedule.js +6 -5
- package/dist/commands/tasks/skills/pin.js +3 -2
- package/dist/commands/tasks/skills/unpin.js +3 -2
- package/dist/commands/tasks/snooze.js +6 -5
- package/dist/commands/tasks/start-all.js +5 -4
- package/dist/commands/tasks/subscribe.js +1 -0
- package/dist/commands/tasks/tags/add.js +4 -3
- package/dist/commands/tasks/tags/remove.js +4 -3
- package/dist/commands/tasks/timeline.js +3 -2
- package/dist/commands/tasks/today.d.ts +4 -1
- package/dist/commands/tasks/today.js +12 -2
- package/dist/commands/tasks/transcript.js +6 -5
- package/dist/commands/tasks/unschedule.js +3 -2
- package/dist/commands/tasks/unsnooze.js +3 -2
- package/dist/commands/tasks/unsubscribe.js +2 -1
- package/dist/commands/tasks/update.js +5 -4
- package/dist/commands/tasks/wait.js +5 -4
- package/dist/lib/agent-distribution.d.ts +37 -0
- package/dist/lib/agent-distribution.js +63 -0
- package/dist/lib/agent-ref.d.ts +69 -0
- package/dist/lib/agent-ref.js +168 -0
- package/dist/lib/api-fetch.d.ts +2 -0
- package/dist/lib/api-fetch.js +14 -3
- package/dist/lib/command-hygiene.d.ts +13 -0
- package/dist/lib/command-hygiene.js +62 -2
- package/dist/lib/commitment-product.d.ts +0 -6
- package/dist/lib/commitment-product.js +1 -30
- package/dist/lib/commitments.d.ts +9 -45
- package/dist/lib/commitments.js +24 -95
- package/dist/lib/dedicated-power.d.ts +5 -0
- package/dist/lib/dedicated-power.js +30 -2
- package/dist/lib/dry-run-plans.d.ts +50 -0
- package/dist/lib/dry-run-plans.js +85 -0
- package/dist/lib/json-output.d.ts +31 -0
- package/dist/lib/json-output.js +78 -0
- package/dist/lib/list-output.d.ts +75 -0
- package/dist/lib/list-output.js +266 -0
- package/dist/lib/machine-daemon-log.d.ts +36 -0
- package/dist/lib/machine-daemon-log.js +78 -0
- package/dist/lib/node-adapter.js +10 -1
- package/dist/lib/northstars.js +1 -1
- package/dist/lib/open-target.d.ts +12 -0
- package/dist/lib/open-target.js +108 -0
- package/dist/lib/rate-limit-retry.d.ts +45 -0
- package/dist/lib/rate-limit-retry.js +88 -0
- package/dist/lib/roles.d.ts +98 -0
- package/dist/lib/roles.js +45 -0
- package/dist/lib/store-listing.d.ts +45 -0
- package/dist/lib/store-listing.js +186 -0
- package/dist/lib/task-batch.d.ts +67 -0
- package/dist/lib/task-batch.js +227 -0
- package/dist/lib/terminal-qr.d.ts +55 -0
- package/dist/lib/terminal-qr.js +119 -0
- package/dist/lib/web-url.d.ts +11 -0
- package/dist/lib/web-url.js +24 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/commitmentExecutionContract.d.ts +45 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/commitmentExecutionContract.js +550 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.d.ts +68 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.js +47 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/sessionPermissionAuthority.d.ts +7 -44
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/sessionPermissionAuthority.js +8 -47
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/commitmentExecutionContract.d.ts +45 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/commitmentExecutionContract.js +545 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.d.ts +68 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.js +46 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/sessionPermissionAuthority.d.ts +7 -44
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/sessionPermissionAuthority.js +8 -47
- package/dist/node_modules/@skrr-ai/auth-core/package.json +11 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +7285 -6673
- package/dist/node_modules/@skrr-ai/data-provider/package.json +2 -2
- package/oclif.manifest.json +35937 -26820
- package/package.json +6 -2
- package/dist/commands/commitments/autonomy.d.ts +0 -30
- package/dist/commands/commitments/autonomy.js +0 -67
- package/dist/commands/commitments/mode.js +0 -58
- package/dist/commands/commitments/pack/promote.d.ts +0 -19
- package/dist/commands/commitments/pack/promote.js +0 -46
- package/dist/commands/commitments/pack/shadow.d.ts +0 -20
- package/dist/commands/commitments/pack/shadow.js +0 -42
|
@@ -4,44 +4,42 @@ 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
|
/**
|
|
7
|
-
* `skrr commitments
|
|
7
|
+
* `skrr commitments cadence-requests decide <id> <request-id> --approve`
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* wake through the same resolver a bypass-mode agent would have used; rejecting
|
|
13
|
-
* records the no and leaves the cadence alone.
|
|
9
|
+
* The server records concrete cadence proposals requiring an owner decision.
|
|
10
|
+
* Approval changes only the check schedule; it grants no execution permissions.
|
|
11
|
+
* Rejection records the decision and leaves the schedule unchanged.
|
|
14
12
|
*
|
|
15
13
|
* List the pending ones with `skrr commitments show <id>`.
|
|
16
14
|
*/
|
|
17
|
-
class
|
|
15
|
+
class CommitmentsCadenceRequestsDecide extends base_command_1.BaseCommand {
|
|
18
16
|
static description = 'Approve or reject an agent-proposed commitment cadence change';
|
|
19
17
|
static examples = [
|
|
20
|
-
'<%= config.bin %> commitments
|
|
21
|
-
'<%= config.bin %> commitments
|
|
18
|
+
'<%= config.bin %> commitments cadence-requests decide obj_abc123 req_xyz --approve',
|
|
19
|
+
'<%= config.bin %> commitments cadence-requests decide obj_abc123 req_xyz --reject',
|
|
22
20
|
];
|
|
23
21
|
static args = {
|
|
24
22
|
commitmentId: core_1.Args.string({ ignoreStdin: true, description: 'Commitment ID', required: true }),
|
|
25
23
|
requestId: core_1.Args.string({
|
|
26
24
|
ignoreStdin: true,
|
|
27
|
-
description: 'Pending
|
|
25
|
+
description: 'Pending cadence request ID',
|
|
28
26
|
required: true,
|
|
29
27
|
}),
|
|
30
28
|
};
|
|
31
29
|
static flags = {
|
|
32
30
|
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
33
|
-
approve: core_1.Flags.boolean({ description: 'Approve
|
|
31
|
+
approve: core_1.Flags.boolean({ description: 'Approve the cadence change', exclusive: ['reject'] }),
|
|
34
32
|
reject: core_1.Flags.boolean({ description: 'Reject the proposal', exclusive: ['approve'] }),
|
|
35
33
|
};
|
|
36
34
|
async run() {
|
|
37
35
|
this.requireAuth();
|
|
38
|
-
const { args, flags } = await this.parse(
|
|
36
|
+
const { args, flags } = await this.parse(CommitmentsCadenceRequestsDecide);
|
|
39
37
|
if (!flags.approve && !flags.reject) {
|
|
40
38
|
this.error('Pass --approve or --reject.');
|
|
41
39
|
}
|
|
42
40
|
let result;
|
|
43
41
|
try {
|
|
44
|
-
result = await commitments_1.commitmentApi.
|
|
42
|
+
result = await commitments_1.commitmentApi.decideCadenceRequest(args.commitmentId, args.requestId, Boolean(flags.approve));
|
|
45
43
|
}
|
|
46
44
|
catch (err) {
|
|
47
45
|
this.handleApiError(err);
|
|
@@ -51,8 +49,8 @@ class CommitmentsAutonomyRequestsDecide extends base_command_1.BaseCommand {
|
|
|
51
49
|
return;
|
|
52
50
|
}
|
|
53
51
|
this.log(flags.approve
|
|
54
|
-
? `Approved ${args.requestId} — the proposed
|
|
52
|
+
? `Approved ${args.requestId} — the proposed cadence was applied.`
|
|
55
53
|
: `Rejected ${args.requestId} — the cadence is unchanged.`);
|
|
56
54
|
}
|
|
57
55
|
}
|
|
58
|
-
exports.default =
|
|
56
|
+
exports.default = CommitmentsCadenceRequestsDecide;
|
|
@@ -32,7 +32,7 @@ export declare function resolveCostWindow(input?: {
|
|
|
32
32
|
* Money on this path has no other bound the operator can read: a Commitment's
|
|
33
33
|
* agent turns are `AgentOutcome` rows carrying no cost fields, so
|
|
34
34
|
* `spendLimitDailyUsd` cannot see them and `maxRunsPerDay` IS the spend control
|
|
35
|
-
* (see `
|
|
35
|
+
* (see `executionBudget.maxRunsPerDay` in the API's own schema note). This is
|
|
36
36
|
* the read that says what those runs actually cost.
|
|
37
37
|
*
|
|
38
38
|
* `metrics` shows the daily rows; this sums the closed ones over a window and,
|
|
@@ -50,7 +50,7 @@ function resolveCostWindow(input = {}, now = new Date()) {
|
|
|
50
50
|
* Money on this path has no other bound the operator can read: a Commitment's
|
|
51
51
|
* agent turns are `AgentOutcome` rows carrying no cost fields, so
|
|
52
52
|
* `spendLimitDailyUsd` cannot see them and `maxRunsPerDay` IS the spend control
|
|
53
|
-
* (see `
|
|
53
|
+
* (see `executionBudget.maxRunsPerDay` in the API's own schema note). This is
|
|
54
54
|
* the read that says what those runs actually cost.
|
|
55
55
|
*
|
|
56
56
|
* `metrics` shows the daily rows; this sums the closed ones over a window and,
|
|
@@ -26,11 +26,6 @@ export declare function createCadenceFromFlags({ eventDriven, cadence: cadenceIn
|
|
|
26
26
|
* be said out loud at the CLI boundary; otherwise a successful create response
|
|
27
27
|
* reads like the requested autonomy is live when something else is running.
|
|
28
28
|
*/
|
|
29
|
-
export declare function autonomyStagingNotice({ payload, commitment, bin, }: {
|
|
30
|
-
payload: Record<string, unknown>;
|
|
31
|
-
commitment: Record<string, unknown>;
|
|
32
|
-
bin: string;
|
|
33
|
-
}): string | undefined;
|
|
34
29
|
/**
|
|
35
30
|
* `skrr commitments create` — author a durable commitment contract.
|
|
36
31
|
*
|
|
@@ -70,11 +65,9 @@ export default class CommitmentsCreate extends BaseCommand {
|
|
|
70
65
|
'event-driven': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
71
66
|
'cadence-mode': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
72
67
|
timezone: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
73
|
-
mode: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
74
68
|
delivery: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
75
69
|
repo: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
76
70
|
base: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
77
|
-
autonomy: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
78
71
|
isolation: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
79
72
|
'max-nudges': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
80
73
|
'max-concurrent-runs': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.hasEventCapableWatchedSource = hasEventCapableWatchedSource;
|
|
4
4
|
exports.assertEventDrivenWatchedSource = assertEventDrivenWatchedSource;
|
|
5
5
|
exports.createCadenceFromFlags = createCadenceFromFlags;
|
|
6
|
-
exports.autonomyStagingNotice = autonomyStagingNotice;
|
|
7
6
|
const core_1 = require("@oclif/core");
|
|
8
7
|
const base_command_1 = require("../../base-command");
|
|
9
8
|
const web_url_1 = require("../../lib/web-url");
|
|
@@ -145,30 +144,6 @@ function createCadenceFromFlags({ eventDriven, cadence: cadenceInput, cadenceMod
|
|
|
145
144
|
* be said out loud at the CLI boundary; otherwise a successful create response
|
|
146
145
|
* reads like the requested autonomy is live when something else is running.
|
|
147
146
|
*/
|
|
148
|
-
function autonomyStagingNotice({ payload, commitment, bin, }) {
|
|
149
|
-
const requestedPolicy = payload.policy && typeof payload.policy === 'object' && !Array.isArray(payload.policy)
|
|
150
|
-
? payload.policy
|
|
151
|
-
: {};
|
|
152
|
-
const returnedPolicy = commitment.policy && typeof commitment.policy === 'object' && !Array.isArray(commitment.policy)
|
|
153
|
-
? commitment.policy
|
|
154
|
-
: {};
|
|
155
|
-
const requested = typeof payload.mode === 'string'
|
|
156
|
-
? payload.mode
|
|
157
|
-
: typeof requestedPolicy.autonomyMode === 'string'
|
|
158
|
-
? requestedPolicy.autonomyMode
|
|
159
|
-
: '';
|
|
160
|
-
const admitted = typeof returnedPolicy.autonomyMode === 'string' ? returnedPolicy.autonomyMode : '';
|
|
161
|
-
if (!requested ||
|
|
162
|
-
(0, commitment_product_1.productMode)(requested) === (0, commitment_product_1.productMode)(admitted || 'suggestions_only') ||
|
|
163
|
-
requested === 'off') {
|
|
164
|
-
return undefined;
|
|
165
|
-
}
|
|
166
|
-
const id = typeof commitment.id === 'string' ? commitment.id : '<commitment-id>';
|
|
167
|
-
return [
|
|
168
|
-
`Requested mode ${(0, commitment_product_1.productModeLabel)(requested)} was not applied; this commitment is running as ${(0, commitment_product_1.productModeLabel)(admitted || 'suggestions_only')}.`,
|
|
169
|
-
`To set it explicitly: ${bin} commitments mode ${id} ${(0, commitment_product_1.productMode)(requested)}`,
|
|
170
|
-
].join('\n');
|
|
171
|
-
}
|
|
172
147
|
/**
|
|
173
148
|
* `skrr commitments create` — author a durable commitment contract.
|
|
174
149
|
*
|
|
@@ -187,7 +162,7 @@ class CommitmentsCreate extends base_command_1.BaseCommand {
|
|
|
187
162
|
'<%= config.bin %> commitments create --agent <agent-id> --title "SLA" --outcome "p95 under 200ms" --criterion "p95 latency confirmed" --evaluator metric --measure <measure-id>',
|
|
188
163
|
'<%= config.bin %> commitments create --agent <agent-id> --title "AWS cost watch" --outcome "Cost regressions are investigated" --agent-directive-file ./aws-cost-policy.md',
|
|
189
164
|
'<%= config.bin %> commitments create --from-json commitment.json --json',
|
|
190
|
-
'<%= config.bin %> commitments create --agent <agent-id> --title "Keep CI healthy" --outcome "Failed checks are repaired" --watch github --github-event check_run_failed --event-driven --
|
|
165
|
+
'<%= config.bin %> commitments create --agent <agent-id> --title "Keep CI healthy" --outcome "Failed checks are repaired" --watch github --github-event check_run_failed --event-driven --delivery draft-pr --repo owner/repo --base main --status draft',
|
|
191
166
|
];
|
|
192
167
|
static flags = {
|
|
193
168
|
json: core_1.Flags.boolean({ description: 'Output the created commitment as JSON' }),
|
|
@@ -269,25 +244,12 @@ class CommitmentsCreate extends base_command_1.BaseCommand {
|
|
|
269
244
|
options: [...commitments_1.COMMITMENT_AUTHORABLE_CADENCE_MODES],
|
|
270
245
|
}),
|
|
271
246
|
timezone: core_1.Flags.string({ description: 'IANA timezone for the cadence' }),
|
|
272
|
-
mode: core_1.Flags.string({
|
|
273
|
-
description: 'How the commitment progresses (default Monitor)',
|
|
274
|
-
options: [...commitment_product_1.COMMITMENT_PRODUCT_MODES],
|
|
275
|
-
}),
|
|
276
247
|
delivery: core_1.Flags.string({
|
|
277
|
-
description: '
|
|
248
|
+
description: 'Requested delivery artifact or destination',
|
|
278
249
|
options: [...commitment_product_1.COMMITMENT_DELIVERY_CHOICES],
|
|
279
250
|
}),
|
|
280
251
|
repo: core_1.Flags.string({ description: 'Delivery repository, owner/repo' }),
|
|
281
252
|
base: core_1.Flags.string({ description: 'Delivery target branch' }),
|
|
282
|
-
autonomy: core_1.Flags.string({
|
|
283
|
-
// `--help` is where someone decides what to type, so the ceiling that can
|
|
284
|
-
// still bind has to be stated HERE and not only in the notice that
|
|
285
|
-
// corrects them afterwards. `commitments autonomy --mode` learned the
|
|
286
|
-
// same lesson: what it must not keep is the silence.
|
|
287
|
-
description: 'Compatibility flag. Prefer --mode monitor|prepare|execute. Workspace administrator rules remain binding.',
|
|
288
|
-
options: [...commitments_1.COMMITMENT_AUTONOMY_MODES],
|
|
289
|
-
hidden: true,
|
|
290
|
-
}),
|
|
291
253
|
isolation: core_1.Flags.string({
|
|
292
254
|
// Omitting this is not the same as passing `shared`: an omitted value
|
|
293
255
|
// leaves the daemon's own isolation heuristic in force, while `shared` is
|
|
@@ -311,7 +273,6 @@ class CommitmentsCreate extends base_command_1.BaseCommand {
|
|
|
311
273
|
this.requireAuth();
|
|
312
274
|
const { flags } = await this.parse(CommitmentsCreate);
|
|
313
275
|
let payload;
|
|
314
|
-
let deliveryNormalizedForMonitor = false;
|
|
315
276
|
try {
|
|
316
277
|
// `createBodySchema` is a z.strictObject, so unwrap a `plan --json`
|
|
317
278
|
// envelope and drop any key it does not declare (a contract dumped from
|
|
@@ -392,12 +353,6 @@ class CommitmentsCreate extends base_command_1.BaseCommand {
|
|
|
392
353
|
? payload.policy
|
|
393
354
|
: {};
|
|
394
355
|
const policy = { ...existingPolicy };
|
|
395
|
-
if (flags.autonomy)
|
|
396
|
-
policy.autonomyMode = flags.autonomy;
|
|
397
|
-
if (flags.mode && flags.autonomy)
|
|
398
|
-
throw new Error('Use --mode or the compatibility --autonomy flag, not both.');
|
|
399
|
-
if (flags.mode)
|
|
400
|
-
payload.mode = (0, commitment_product_1.productMode)(flags.mode);
|
|
401
356
|
if (flags.delivery)
|
|
402
357
|
payload.delivery = (0, commitment_product_1.deliveryInput)(flags.delivery, flags);
|
|
403
358
|
else if (flags.repo || flags.base)
|
|
@@ -411,45 +366,28 @@ class CommitmentsCreate extends base_command_1.BaseCommand {
|
|
|
411
366
|
reason: flags['concurrency-reason'],
|
|
412
367
|
});
|
|
413
368
|
if (concurrencyPatch) {
|
|
414
|
-
const existingEnvelope = policy.
|
|
415
|
-
typeof policy.
|
|
416
|
-
!Array.isArray(policy.
|
|
417
|
-
? policy.
|
|
369
|
+
const existingEnvelope = policy.executionBudget &&
|
|
370
|
+
typeof policy.executionBudget === 'object' &&
|
|
371
|
+
!Array.isArray(policy.executionBudget)
|
|
372
|
+
? policy.executionBudget
|
|
418
373
|
: {};
|
|
419
|
-
policy.
|
|
374
|
+
policy.executionBudget = { ...existingEnvelope, ...concurrencyPatch };
|
|
420
375
|
}
|
|
421
376
|
if (Object.keys(policy).length)
|
|
422
377
|
payload.policy = policy;
|
|
423
|
-
const payloadPolicy = payload.policy && typeof payload.policy === 'object' && !Array.isArray(payload.policy)
|
|
424
|
-
? payload.policy
|
|
425
|
-
: {};
|
|
426
|
-
const selectedMode = typeof payload.mode === 'string'
|
|
427
|
-
? payload.mode
|
|
428
|
-
: typeof payloadPolicy.autonomyMode === 'string'
|
|
429
|
-
? payloadPolicy.autonomyMode
|
|
430
|
-
: 'monitor';
|
|
431
|
-
if (payload.delivery &&
|
|
432
|
-
typeof payload.delivery === 'object' &&
|
|
433
|
-
!Array.isArray(payload.delivery)) {
|
|
434
|
-
const declared = payload.delivery;
|
|
435
|
-
const coherent = (0, commitment_product_1.deliveryForProductMode)(selectedMode, declared);
|
|
436
|
-
deliveryNormalizedForMonitor =
|
|
437
|
-
(0, commitment_product_1.productMode)(selectedMode) === 'monitor' && declared.mode !== 'report_only';
|
|
438
|
-
payload.delivery = coherent;
|
|
439
|
-
}
|
|
440
378
|
if (payload.createdVia === undefined) {
|
|
441
379
|
payload.createdVia = process.env.OVERSKY_AUTONOMOUS_SESSION === '1' ? 'agent_cli' : 'cli';
|
|
442
380
|
}
|
|
443
381
|
// `--from-json` is intentionally powerful, but it must not be an escape
|
|
444
382
|
// hatch around the same authoring decision the explicit flag enforces.
|
|
445
|
-
const envelope = policy.
|
|
383
|
+
const envelope = policy.executionBudget;
|
|
446
384
|
if (envelope && Object.prototype.hasOwnProperty.call(envelope, 'maxConcurrentRuns')) {
|
|
447
385
|
const value = envelope.maxConcurrentRuns;
|
|
448
386
|
if (process.env.OVERSKY_AUTONOMOUS_SESSION === '1' && value != null) {
|
|
449
387
|
throw new Error('An autonomous Agent cannot activate a finite Commitment concurrency cap from --from-json. Omit it or set it to null; an owner may set it later.');
|
|
450
388
|
}
|
|
451
389
|
if (value != null && !String(envelope.maxConcurrentRunsReason || '').trim()) {
|
|
452
|
-
throw new Error('A finite policy.
|
|
390
|
+
throw new Error('A finite policy.executionBudget.maxConcurrentRuns in --from-json requires maxConcurrentRunsReason.');
|
|
453
391
|
}
|
|
454
392
|
}
|
|
455
393
|
}
|
|
@@ -478,37 +416,10 @@ class CommitmentsCreate extends base_command_1.BaseCommand {
|
|
|
478
416
|
}
|
|
479
417
|
if (flags.json) {
|
|
480
418
|
this.log(JSON.stringify((0, web_url_1.withCommitmentUrl)(this.cliConfig.baseURL, commitment), null, 2));
|
|
481
|
-
const notice = autonomyStagingNotice({
|
|
482
|
-
payload,
|
|
483
|
-
commitment: commitment,
|
|
484
|
-
bin: this.config.bin,
|
|
485
|
-
});
|
|
486
|
-
if (notice)
|
|
487
|
-
this.warn(notice);
|
|
488
|
-
if (deliveryNormalizedForMonitor) {
|
|
489
|
-
this.warn('Monitor is report-only, so the requested code-delivery destination was not stored. Use --mode prepare or --mode execute to deliver code.');
|
|
490
|
-
}
|
|
491
419
|
return;
|
|
492
420
|
}
|
|
493
421
|
this.log('Created commitment:');
|
|
494
422
|
(0, commitments_1.renderCommitmentSummary)(commitment, (line) => this.log(line));
|
|
495
|
-
const notice = autonomyStagingNotice({
|
|
496
|
-
payload,
|
|
497
|
-
commitment: commitment,
|
|
498
|
-
bin: this.config.bin,
|
|
499
|
-
});
|
|
500
|
-
if (notice) {
|
|
501
|
-
this.log('');
|
|
502
|
-
this.log(notice);
|
|
503
|
-
}
|
|
504
|
-
if (deliveryNormalizedForMonitor) {
|
|
505
|
-
this.log('');
|
|
506
|
-
this.log('Monitor is report-only, so delivery was set to Report only. Choose Prepare or Execute to deliver code.');
|
|
507
|
-
}
|
|
508
|
-
if (commitment.status === 'draft') {
|
|
509
|
-
this.log('');
|
|
510
|
-
this.log(`Activate it with: ${this.config.bin} commitments resume ${commitment.id}`);
|
|
511
|
-
}
|
|
512
423
|
}
|
|
513
424
|
}
|
|
514
425
|
exports.default = CommitmentsCreate;
|
|
@@ -6,7 +6,7 @@ const commitments_1 = require("../../lib/commitments");
|
|
|
6
6
|
const commitment_product_1 = require("../../lib/commitment-product");
|
|
7
7
|
const web_url_1 = require("../../lib/web-url");
|
|
8
8
|
class CommitmentsDelivery extends base_command_1.BaseCommand {
|
|
9
|
-
static description = 'Declare
|
|
9
|
+
static description = 'Declare the destination for Commitment work';
|
|
10
10
|
static examples = [
|
|
11
11
|
'<%= config.bin %> commitments delivery <id> draft-pr --repo owner/repo --base main',
|
|
12
12
|
];
|
|
@@ -15,7 +15,7 @@ class CommitmentsDelivery extends base_command_1.BaseCommand {
|
|
|
15
15
|
mode: core_1.Args.string({
|
|
16
16
|
required: true,
|
|
17
17
|
ignoreStdin: true,
|
|
18
|
-
description: 'Delivery destination.
|
|
18
|
+
description: 'Delivery destination.',
|
|
19
19
|
options: [
|
|
20
20
|
...commitment_product_1.COMMITMENT_DELIVERY_CHOICES,
|
|
21
21
|
...commitment_product_1.COMMITMENT_DELIVERY_CHOICES.map((mode) => mode.replace(/-/g, '_')),
|
|
@@ -34,18 +34,6 @@ class CommitmentsDelivery extends base_command_1.BaseCommand {
|
|
|
34
34
|
try {
|
|
35
35
|
const current = (await commitments_1.commitmentApi.get(args.id)).commitment;
|
|
36
36
|
const requested = (0, commitment_product_1.deliveryInput)(args.mode, flags);
|
|
37
|
-
const stagingForPromotion = current.pack?.phase === 'shadow';
|
|
38
|
-
const targetPolicy = stagingForPromotion
|
|
39
|
-
? current.pack?.policyBeforeShadow || current.policy
|
|
40
|
-
: current.policy;
|
|
41
|
-
const productContract = targetPolicy?.workPromotionModel === 'monitor_prepare_execute_v1';
|
|
42
|
-
if (productContract &&
|
|
43
|
-
(0, commitment_product_1.productMode)(targetPolicy?.autonomyMode) === 'monitor' &&
|
|
44
|
-
requested.mode !== 'report_only') {
|
|
45
|
-
throw new Error(stagingForPromotion
|
|
46
|
-
? 'This Pack promotion target is Monitor, so its delivery must be report-only. Set the commitment mode to Prepare or Execute before staging code delivery.'
|
|
47
|
-
: 'Monitor is report-only. Set the commitment mode to Prepare or Execute before selecting code delivery.');
|
|
48
|
-
}
|
|
49
37
|
const delivery = { ...current.delivery, ...requested };
|
|
50
38
|
const result = await commitments_1.commitmentApi.delivery(args.id, {
|
|
51
39
|
delivery,
|
|
@@ -55,13 +43,7 @@ class CommitmentsDelivery extends base_command_1.BaseCommand {
|
|
|
55
43
|
const linked = (0, web_url_1.withCommitmentUrl)(this.cliConfig.baseURL, result);
|
|
56
44
|
if (flags.json)
|
|
57
45
|
return this.log(JSON.stringify(linked, null, 2));
|
|
58
|
-
|
|
59
|
-
? result.pack?.deliveryBeforeShadow || delivery
|
|
60
|
-
: result.delivery;
|
|
61
|
-
this.log(`${stagingForPromotion ? 'Promotion delivery staged' : 'Delivery'}: ${(0, commitment_product_1.deliveryLabel)(renderedDelivery?.mode)}${renderedDelivery?.repo ? ` · ${renderedDelivery.repo}` : ''}${renderedDelivery?.baseBranch ? ` → ${renderedDelivery.baseBranch}` : ''}`);
|
|
62
|
-
if (stagingForPromotion) {
|
|
63
|
-
this.log('Live Shadow delivery remains Report only until explicit promotion.');
|
|
64
|
-
}
|
|
46
|
+
this.log(`Delivery: ${(0, commitment_product_1.deliveryLabel)(result.delivery?.mode)}${result.delivery?.repo ? ` · ${result.delivery.repo}` : ''}${result.delivery?.baseBranch ? ` → ${result.delivery.baseBranch}` : ''}`);
|
|
65
47
|
this.log(`URL: ${linked.url}`);
|
|
66
48
|
}
|
|
67
49
|
catch (error) {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.doctorVerdict = doctorVerdict;
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
6
|
const base_command_1 = require("../../base-command");
|
|
6
7
|
const commitments_1 = require("../../lib/commitments");
|
|
7
8
|
function doctorVerdict(input) {
|
|
@@ -22,7 +23,7 @@ function doctorVerdict(input) {
|
|
|
22
23
|
next: 'Retry doctor; one or more operating-state projections are unavailable',
|
|
23
24
|
};
|
|
24
25
|
}
|
|
25
|
-
const autonomy = operatingState.
|
|
26
|
+
const autonomy = operatingState.execution;
|
|
26
27
|
const budget = autonomy?.budget;
|
|
27
28
|
const concurrentRuns = budget?.concurrentRuns;
|
|
28
29
|
const decision = concurrentRuns?.decision;
|
|
@@ -32,30 +33,34 @@ function doctorVerdict(input) {
|
|
|
32
33
|
next: 'Confirm the cap with --max-concurrent-runs <n> --concurrency-reason "...", or remove it with --max-concurrent-runs unlimited',
|
|
33
34
|
};
|
|
34
35
|
}
|
|
35
|
-
if (
|
|
36
|
-
const status = String(operatingState.status);
|
|
37
|
-
const healthy = ['on_track', 'healthy'].includes(status);
|
|
38
|
-
// Where the latest cycle stopped, as the server words it. "Read the raw
|
|
39
|
-
// trace" was the only next step an unhealthy Commitment was ever given,
|
|
40
|
-
// even when the stop already named the fix (OSK-12120).
|
|
41
|
-
const latestCheck = operatingState.latestCheck;
|
|
42
|
-
const stop = latestCheck?.stop;
|
|
43
|
-
const fix = typeof stop?.fix === 'string' && stop.fix ? stop.fix : undefined;
|
|
44
|
-
const why = typeof stop?.detail === 'string' && stop.detail ? stop.detail : undefined;
|
|
36
|
+
if (commitment.status !== 'active')
|
|
45
37
|
return {
|
|
46
|
-
verdict:
|
|
47
|
-
next:
|
|
48
|
-
...(!healthy && why ? { why } : {}),
|
|
38
|
+
verdict: 'inactive',
|
|
39
|
+
next: 'Inspect the lifecycle before resuming this responsibility',
|
|
49
40
|
};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
41
|
+
const raw = (operatingState.assessment || commitment.assessment);
|
|
42
|
+
const assessment = raw ? (0, data_provider_1.readCommitmentAssessment)(raw) : undefined;
|
|
43
|
+
if (!assessment)
|
|
44
|
+
return { verdict: 'unknown', next: 'Run a Check to evaluate current criterion evidence' };
|
|
45
|
+
const verified = assessment.outcome === 'satisfied' &&
|
|
46
|
+
assessment.evidence === 'fresh' &&
|
|
47
|
+
assessment.operation === 'ready';
|
|
48
|
+
if (verified)
|
|
49
|
+
return {
|
|
50
|
+
verdict: 'active_healthy',
|
|
51
|
+
next: 'No work is needed while the criterion evidence remains fresh',
|
|
52
|
+
};
|
|
53
|
+
const latestCheck = operatingState.latestCheck;
|
|
54
|
+
const stop = latestCheck?.stop;
|
|
55
|
+
return {
|
|
56
|
+
verdict: assessment.operation === 'blocked' || assessment.operation === 'failed'
|
|
57
|
+
? assessment.operation
|
|
58
|
+
: assessment.outcome,
|
|
59
|
+
next: typeof stop?.fix === 'string' && stop.fix
|
|
60
|
+
? stop.fix
|
|
61
|
+
: 'Review current criterion evidence and the pending operation',
|
|
62
|
+
...(typeof stop?.detail === 'string' && stop.detail ? { why: stop.detail } : {}),
|
|
63
|
+
};
|
|
59
64
|
}
|
|
60
65
|
class CommitmentsDoctor extends base_command_1.BaseCommand {
|
|
61
66
|
static description = 'Summarize commitment readiness and the next operator action';
|
|
@@ -97,10 +102,6 @@ class CommitmentsDoctor extends base_command_1.BaseCommand {
|
|
|
97
102
|
if (diagnosis.why)
|
|
98
103
|
this.log(`Why: ${diagnosis.why}`);
|
|
99
104
|
this.log(`Next: ${diagnosis.next.replace('<id>', args.id)}`);
|
|
100
|
-
const autonomy = operatingState.autonomy;
|
|
101
|
-
if (autonomy) {
|
|
102
|
-
this.log(`Mode: ${(0, commitments_1.commitmentAutonomyLabel)(String(autonomy.declaredMode || ''))} → ${(0, commitments_1.commitmentAutonomyLabel)(String(autonomy.effectiveMode || ''))}`);
|
|
103
|
-
}
|
|
104
105
|
this.log(`Concurrency: ${(0, commitments_1.describeCommitmentConcurrency)(commitment)}`);
|
|
105
106
|
const approvals = operatingState.approvals;
|
|
106
107
|
if (approvals?.pendingCount)
|
|
@@ -14,7 +14,7 @@ const RUN_LIMIT_BINDING_LABELS = {
|
|
|
14
14
|
function effectivePolicyLines(policy) {
|
|
15
15
|
const governance = policy.governance || {};
|
|
16
16
|
const owner = policy.owner || {};
|
|
17
|
-
const lines = [
|
|
17
|
+
const lines = [];
|
|
18
18
|
// Whose permissions a run uses (OSK-11975), directly under the mode it can
|
|
19
19
|
// contradict — an Execute Commitment on a plan-mode Agent (OSK-12065).
|
|
20
20
|
lines.push(...(0, commitments_1.permissionLines)(policy.permissions));
|
|
@@ -24,16 +24,6 @@ function effectivePolicyLines(policy) {
|
|
|
24
24
|
else {
|
|
25
25
|
lines.push('Workspace status: allowed');
|
|
26
26
|
}
|
|
27
|
-
if (governance.workspaceMaxMode) {
|
|
28
|
-
lines.push(`Workspace Mode ceiling: ${(0, commitment_product_1.productModeLabel)(governance.workspaceMaxMode)}`);
|
|
29
|
-
}
|
|
30
|
-
if (Array.isArray(governance.workspaceModeOverrides)) {
|
|
31
|
-
for (const override of governance.workspaceModeOverrides) {
|
|
32
|
-
if (override?.effectiveMode) {
|
|
33
|
-
lines.push(`Workspace override: ${(0, commitment_product_1.productModeLabel)(override.effectiveMode)} — ${override.policy || 'configured administrator rule'}${override.configuredValue ? ` (${override.configuredValue})` : ''}`);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
27
|
if (Array.isArray(governance.allowedCommitmentDeliveryModes)) {
|
|
38
28
|
lines.push(`Workspace delivery allowlist: ${governance.allowedCommitmentDeliveryModes.length ? governance.allowedCommitmentDeliveryModes.map(commitment_product_1.deliveryLabel).join(', ') : 'none'}`);
|
|
39
29
|
}
|
|
@@ -55,29 +45,8 @@ function effectivePolicyLines(policy) {
|
|
|
55
45
|
if (cost?.effectiveCostLimitUsd != null) {
|
|
56
46
|
lines.push(`Effective daily cost limit: $${Number(cost.effectiveCostLimitUsd).toFixed(2)}`);
|
|
57
47
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
// it has to see.
|
|
61
|
-
const observation = policy.observation;
|
|
62
|
-
if (observation?.sensing && observation.retired) {
|
|
63
|
-
// OSK-11975 retired the sensing fence: printing "granted — read-only" for
|
|
64
|
-
// a grant that no longer fences anything is the claim this must not make.
|
|
65
|
-
const recorded = [
|
|
66
|
-
observation.shell?.granted ? 'shell' : null,
|
|
67
|
-
observation.browser?.granted ? 'browser' : null,
|
|
68
|
-
].filter(Boolean);
|
|
69
|
-
lines.push(`Sensing runs: the Agent's own permissions${recorded.length
|
|
70
|
-
? ` (recorded ${recorded.join(' and ')} grant is retired and has no effect)`
|
|
71
|
-
: ''}`);
|
|
72
|
-
}
|
|
73
|
-
else if (observation?.sensing) {
|
|
74
|
-
lines.push(`Sensing shell: ${observation.shell?.granted
|
|
75
|
-
? 'granted — read-only filesystem on the Hosted Machine; network NOT fenced (a command can still change remote state); withheld on your own machine'
|
|
76
|
-
: 'not granted'}`);
|
|
77
|
-
lines.push(`Sensing browser: ${observation.browser?.granted
|
|
78
|
-
? 'granted — read-only, enforced by your machine'
|
|
79
|
-
: 'not granted'}`);
|
|
80
|
-
}
|
|
48
|
+
if (policy.observation?.sensing)
|
|
49
|
+
lines.push("Sensing runs: the Agent's own permissions");
|
|
81
50
|
return lines;
|
|
82
51
|
}
|
|
83
52
|
/** Show the policy actually governing a Commitment without changing it. */
|
|
@@ -92,7 +61,7 @@ class CommitmentsEffectivePolicy extends base_command_1.BaseCommand {
|
|
|
92
61
|
};
|
|
93
62
|
static flags = {
|
|
94
63
|
json: core_1.Flags.boolean({ description: 'Output the complete effective policy as JSON' }),
|
|
95
|
-
verbose: core_1.Flags.boolean({ description: 'Append
|
|
64
|
+
verbose: core_1.Flags.boolean({ description: 'Append diagnostic policy JSON' }),
|
|
96
65
|
};
|
|
97
66
|
async run() {
|
|
98
67
|
this.requireAuth();
|
|
@@ -113,7 +82,7 @@ class CommitmentsEffectivePolicy extends base_command_1.BaseCommand {
|
|
|
113
82
|
for (const line of effectivePolicyLines(policy))
|
|
114
83
|
this.log(` ${line}`);
|
|
115
84
|
if (flags.verbose) {
|
|
116
|
-
this.log('\nRaw
|
|
85
|
+
this.log('\nRaw policy diagnostics:');
|
|
117
86
|
this.log(JSON.stringify(policy, null, 2));
|
|
118
87
|
}
|
|
119
88
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command';
|
|
2
|
+
/** One domain surface for prospective evaluations and durable learning retries. */
|
|
3
|
+
export default class CommitmentEvaluations extends BaseCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static args: {
|
|
6
|
+
commitmentId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
file: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
'retry-learning': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
limit: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
};
|
|
14
|
+
run(): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const node_fs_1 = require("node:fs");
|
|
5
|
+
const base_command_1 = require("../../base-command");
|
|
6
|
+
const commitments_1 = require("../../lib/commitments");
|
|
7
|
+
/** One domain surface for prospective evaluations and durable learning retries. */
|
|
8
|
+
class CommitmentEvaluations extends base_command_1.BaseCommand {
|
|
9
|
+
static description = 'List or register forward evaluations of actions and judgments';
|
|
10
|
+
static args = { commitmentId: core_1.Args.string({ required: true, ignoreStdin: true }) };
|
|
11
|
+
static flags = {
|
|
12
|
+
json: core_1.Flags.boolean({ description: 'Output the complete evaluation records as JSON' }),
|
|
13
|
+
file: core_1.Flags.string({
|
|
14
|
+
description: 'Register an evaluation from a JSON contract',
|
|
15
|
+
exclusive: ['retry-learning'],
|
|
16
|
+
}),
|
|
17
|
+
'retry-learning': core_1.Flags.string({
|
|
18
|
+
description: 'Retry the learning handoff for a schedule ID',
|
|
19
|
+
exclusive: ['file'],
|
|
20
|
+
}),
|
|
21
|
+
limit: core_1.Flags.integer({ min: 1, max: 100, description: 'Maximum schedules to list' }),
|
|
22
|
+
};
|
|
23
|
+
async run() {
|
|
24
|
+
this.requireAuth();
|
|
25
|
+
const { args, flags } = await this.parse(CommitmentEvaluations);
|
|
26
|
+
try {
|
|
27
|
+
if (flags.file) {
|
|
28
|
+
const body = JSON.parse((0, node_fs_1.readFileSync)(flags.file, 'utf8'));
|
|
29
|
+
const result = await commitments_1.commitmentApi.createEvaluation(args.commitmentId, body);
|
|
30
|
+
this.log(JSON.stringify(result, null, 2));
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (flags['retry-learning']) {
|
|
34
|
+
this.log(JSON.stringify(await commitments_1.commitmentApi.retryEvaluationLearning(args.commitmentId, flags['retry-learning']), null, 2));
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const response = await commitments_1.commitmentApi.evaluations(args.commitmentId, { limit: flags.limit });
|
|
38
|
+
if (flags.json) {
|
|
39
|
+
this.log(JSON.stringify(response, null, 2));
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
for (const row of response.data) {
|
|
43
|
+
const learning = row.learning;
|
|
44
|
+
this.log(`${row.id} ${row.status} next: ${row.nextCheckAt || 'settled'}${learning?.status === 'pending' ? ' learning pending' : ''}`);
|
|
45
|
+
}
|
|
46
|
+
if (!response.data.length)
|
|
47
|
+
this.log('No evaluations registered.');
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
this.handleApiError(error);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.default = CommitmentEvaluations;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
export default class CommitmentPackActivate 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,22 @@
|
|
|
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 CommitmentPackActivate extends base_command_1.BaseCommand {
|
|
7
|
+
static description = 'Activate a prepared Pack with the Agent permissions';
|
|
8
|
+
static args = { id: core_1.Args.string({ required: true, ignoreStdin: true }) };
|
|
9
|
+
static flags = { json: core_1.Flags.boolean() };
|
|
10
|
+
async run() {
|
|
11
|
+
this.requireAuth();
|
|
12
|
+
const { args, flags } = await this.parse(CommitmentPackActivate);
|
|
13
|
+
try {
|
|
14
|
+
const result = await commitments_1.commitmentPackApi.activate(args.id);
|
|
15
|
+
this.log(flags.json ? JSON.stringify(result, null, 2) : `Pack active: ${result.commitment.id}`);
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
this.handleApiError(error);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.default = CommitmentPackActivate;
|
|
@@ -82,7 +82,7 @@ class CommitmentsPackBind extends base_command_1.BaseCommand {
|
|
|
82
82
|
});
|
|
83
83
|
if (url)
|
|
84
84
|
this.log(`URL: ${url}`);
|
|
85
|
-
this.log('\nNext: `skrr commitments pack preflight <id>`, then `pack
|
|
85
|
+
this.log('\nNext: `skrr commitments pack preflight <id>`, then `pack activate`.');
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
exports.default = CommitmentsPackBind;
|