@skrr-ai/cli 0.1.15 → 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.
Files changed (64) hide show
  1. package/README.md +10 -4
  2. package/dist/commands/commitments/action-proposals/decide.d.ts +13 -0
  3. package/dist/commands/commitments/action-proposals/decide.js +41 -0
  4. package/dist/commands/commitments/action-proposals/execute.d.ts +12 -0
  5. package/dist/commands/commitments/action-proposals/execute.js +29 -0
  6. package/dist/commands/commitments/action-proposals.d.ts +13 -0
  7. package/dist/commands/commitments/action-proposals.js +56 -0
  8. package/dist/commands/commitments/autonomy.d.ts +7 -11
  9. package/dist/commands/commitments/autonomy.js +16 -17
  10. package/dist/commands/commitments/bundle.d.ts +14 -0
  11. package/dist/commands/commitments/bundle.js +49 -0
  12. package/dist/commands/commitments/create.d.ts +33 -5
  13. package/dist/commands/commitments/create.js +234 -27
  14. package/dist/commands/commitments/delivery.d.ts +16 -0
  15. package/dist/commands/commitments/delivery.js +71 -0
  16. package/dist/commands/commitments/doctor.d.ts +20 -0
  17. package/dist/commands/commitments/doctor.js +88 -0
  18. package/dist/commands/commitments/effective-policy.d.ts +2 -0
  19. package/dist/commands/commitments/effective-policy.js +50 -5
  20. package/dist/commands/commitments/endpoints/connect.d.ts +3 -10
  21. package/dist/commands/commitments/endpoints/connect.js +6 -37
  22. package/dist/commands/commitments/endpoints/create.d.ts +2 -9
  23. package/dist/commands/commitments/endpoints/create.js +10 -23
  24. package/dist/commands/commitments/mode.d.ts +15 -0
  25. package/dist/commands/commitments/mode.js +57 -0
  26. package/dist/commands/commitments/pack/promote.d.ts +1 -1
  27. package/dist/commands/commitments/pack/promote.js +7 -3
  28. package/dist/commands/commitments/pack/shadow.d.ts +3 -2
  29. package/dist/commands/commitments/pack/shadow.js +6 -4
  30. package/dist/commands/commitments/patch.d.ts +14 -0
  31. package/dist/commands/commitments/patch.js +51 -0
  32. package/dist/commands/commitments/preflight.d.ts +5 -2
  33. package/dist/commands/commitments/preflight.js +47 -6
  34. package/dist/commands/commitments/receipt.d.ts +15 -0
  35. package/dist/commands/commitments/receipt.js +34 -0
  36. package/dist/commands/commitments/remediate.d.ts +0 -1
  37. package/dist/commands/commitments/remediate.js +5 -3
  38. package/dist/commands/commitments/reports.js +27 -5
  39. package/dist/commands/commitments/show.d.ts +1 -0
  40. package/dist/commands/commitments/show.js +22 -1
  41. package/dist/commands/commitments/update.d.ts +9 -2
  42. package/dist/commands/commitments/update.js +40 -4
  43. package/dist/commands/commitments/wake-capabilities.d.ts +5 -0
  44. package/dist/commands/commitments/wake-capabilities.js +23 -7
  45. package/dist/commands/spaces/bootstrap.js +1 -1
  46. package/dist/commands/tasks/complete.js +57 -0
  47. package/dist/commands/tasks/create.js +2 -1
  48. package/dist/commands/tasks/deliverable/confirm.d.ts +35 -0
  49. package/dist/commands/tasks/deliverable/confirm.js +77 -0
  50. package/dist/commands/tasks/expectations.js +20 -1
  51. package/dist/commands/tasks/report.js +24 -0
  52. package/dist/commands/tasks/trust.d.ts +35 -0
  53. package/dist/commands/tasks/trust.js +75 -0
  54. package/dist/commands/tasks/waive.js +1 -1
  55. package/dist/lib/commitment-endpoints.d.ts +3 -2
  56. package/dist/lib/commitment-endpoints.js +12 -9
  57. package/dist/lib/commitment-product.d.ts +14 -0
  58. package/dist/lib/commitment-product.js +78 -0
  59. package/dist/lib/commitments.d.ts +67 -20
  60. package/dist/lib/commitments.js +89 -39
  61. package/dist/lib/tasks.js +27 -1
  62. package/dist/node_modules/@skrr-ai/data-provider/index.js +3733 -3570
  63. package/oclif.manifest.json +9291 -8306
  64. package/package.json +1 -1
package/README.md CHANGED
@@ -43,7 +43,7 @@ observability), and shared links.
43
43
  | **dm** | `list`, `show`, `messages`, `threads`, `thread show/messages/follow/mute/share`, `send` (agent 1:1 main chat and Slack-style Thread controls) |
44
44
  | **diagnostics** | `context`, `doctor`, `usage`, `commands` (agent-friendly runtime identity, readiness, progressive token-budgeted discovery, and complete machine-readable schemas) |
45
45
  | **goals** | `list`, `show`, `create`, `update`, `delete`, `descendants`, `tasks`, `archive`, `revisions` |
46
- | **commitments** | `list`, `show`, `create`, `plan`, `preflight`, `update`, `checks`, `check-now`, `autonomy`, `pause`, `resume`, `complete`, `subject`, `attach`, `detach`, `reports`, `export`, `import`, `fork` (durable agent commitment contracts) |
46
+ | **commitments** | `list`, `show`, `create`, `plan`, `preflight`, `update`, `checks`, `check-now`, `action-proposals`, `autonomy`, `pause`, `resume`, `complete`, `subject`, `attach`, `detach`, `reports`, `export`, `import`, `fork` (durable agent commitment contracts) |
47
47
  | **goals briefing** | `enable`, `disable`, `preview` |
48
48
  | **tasks** | `list`, `show`, `create`, `upsert`, `create-tree`, `bulk-update`, `tree`, `update`, `delete`, `actionability`, `ready`, `start`, `active`, `monitor`, `watch`, `wait`, `continue-ready`, `move`, `complete`, `children`, `ancestors`, `descendants`, `activity`, `runs`, `execution-summary`, `execution-timeline`, `replay`, `checkout`, `release`, `start-all`, `cancel-cascade`, `cascade-status`, `dri-status`, `duplicate-pipeline`, `archive`, `today`, `prompt-log`, `revisions`, `transcript`, `output` |
49
49
  | **tasks input** | `show`, `answer`, `dismiss` (durable Human-input handoff) |
@@ -753,6 +753,12 @@ sky commitments preflight <commitment-id> # explain gates bef
753
753
  sky commitments create --agent <agent-id> \
754
754
  --title "Hiring loop" --outcome "Every candidate hears back within 48h" \
755
755
  --watch tasks --watch email --cadence 12h
756
+ sky commitments create --agent <agent-id> --title "AWS cost watch" \
757
+ --outcome "Cost regressions are investigated" \
758
+ --agent-directive-file ./aws-cost-policy.md
759
+ sky commitments create --agent <agent-id> --title "Keep CI healthy" \
760
+ --outcome "Failed checks are repaired" --watch github --event-driven \
761
+ --mode execute --delivery draft-pr --repo owner/repo --base main --status active
756
762
  sky commitments resume <commitment-id> # activate
757
763
 
758
764
  # Or draft it from a sentence (read-only proposal)
@@ -760,14 +766,14 @@ sky commitments plan --agent <agent-id> --sentence "Make sure every candidate he
760
766
 
761
767
  # Steer it
762
768
  sky commitments update <commitment-id> --cadence 6h # retune how often it checks
763
- sky commitments autonomy <commitment-id> --mode ask_first # how much it may act alone
769
+ sky commitments autonomy <commitment-id> --mode prepare # reason and wait for approval
764
770
  sky commitments checks <commitment-id> # what it has been deciding
765
771
  sky commitments check-now <commitment-id> # run one iteration now
766
772
  sky commitments pause <commitment-id> # kill-switch
767
773
  ```
768
774
 
769
- Autonomy ladder: `off` → `suggestions_only` (default) `ask_first`
770
- `auto_run_limited` `auto_run`. Full reference:
775
+ Autonomy modes: `monitor` (default), `prepare`, and `execute`. Pause/resume is
776
+ the lifecycle control; approval classes live in execution policy. Full reference:
771
777
  [docs/cli/SKRR_COMMITMENTS.md](../docs/cli/SKRR_COMMITMENTS.md).
772
778
 
773
779
  ### `sky spaces` — perspective guide
@@ -0,0 +1,13 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ export default class CommitmentsActionProposalsDecide extends BaseCommand {
3
+ static description: string;
4
+ static args: {
5
+ commitmentId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
6
+ proposalId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
7
+ };
8
+ static flags: {
9
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
+ decision: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ };
12
+ run(): Promise<void>;
13
+ }
@@ -0,0 +1,41 @@
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 CommitmentsActionProposalsDecide extends base_command_1.BaseCommand {
7
+ static description = 'Approve & run, or reject, one frozen prepared action';
8
+ static args = {
9
+ commitmentId: core_1.Args.string({ description: 'Commitment ID', required: true, ignoreStdin: true }),
10
+ proposalId: core_1.Args.string({ description: 'Action Proposal ID', required: true, ignoreStdin: true }),
11
+ };
12
+ static flags = {
13
+ json: core_1.Flags.boolean({ description: 'Output the decision and execution receipts as JSON' }),
14
+ decision: core_1.Flags.string({ options: ['approve', 'reject'], required: true }),
15
+ };
16
+ async run() {
17
+ this.requireAuth();
18
+ const { args, flags } = await this.parse(CommitmentsActionProposalsDecide);
19
+ const decision = flags.decision;
20
+ let result;
21
+ try {
22
+ const decided = await commitments_1.commitmentApi.decideActionProposal(args.commitmentId, args.proposalId, decision);
23
+ const execution = decision === 'approve' && decided.status === 'approved'
24
+ ? await commitments_1.commitmentApi.executeActionProposal(args.commitmentId, args.proposalId)
25
+ : undefined;
26
+ result = { decision: decided, ...(execution ? { execution } : {}) };
27
+ }
28
+ catch (error) {
29
+ this.handleApiError(error);
30
+ }
31
+ if (flags.json)
32
+ this.log(JSON.stringify(result, null, 2));
33
+ else if (decision === 'approve') {
34
+ this.log('Prepared action approved and handed to the durable executor.');
35
+ }
36
+ else {
37
+ this.log('Prepared action rejected.');
38
+ }
39
+ }
40
+ }
41
+ exports.default = CommitmentsActionProposalsDecide;
@@ -0,0 +1,12 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ export default class CommitmentsActionProposalsExecute extends BaseCommand {
3
+ static description: string;
4
+ static args: {
5
+ commitmentId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
6
+ proposalId: 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
+ class CommitmentsActionProposalsExecute extends base_command_1.BaseCommand {
7
+ static description = 'Nudge an approved action now (recovery continues automatically)';
8
+ static args = {
9
+ commitmentId: core_1.Args.string({ description: 'Commitment ID', required: true, ignoreStdin: true }),
10
+ proposalId: core_1.Args.string({ description: 'Action Proposal ID', required: true, ignoreStdin: true }),
11
+ };
12
+ static flags = { json: core_1.Flags.boolean({ description: 'Output as JSON' }) };
13
+ async run() {
14
+ this.requireAuth();
15
+ const { args, flags } = await this.parse(CommitmentsActionProposalsExecute);
16
+ let result;
17
+ try {
18
+ result = await commitments_1.commitmentApi.executeActionProposal(args.commitmentId, args.proposalId);
19
+ }
20
+ catch (error) {
21
+ this.handleApiError(error);
22
+ }
23
+ if (flags.json)
24
+ this.log(JSON.stringify(result, null, 2));
25
+ else
26
+ this.log(`Prepared action is ${String(result.status || 'queued')}.`);
27
+ }
28
+ }
29
+ exports.default = CommitmentsActionProposalsExecute;
@@ -0,0 +1,13 @@
1
+ import { BaseCommand } from '../../base-command';
2
+ export default class CommitmentsActionProposals 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
+ status: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ limit: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ };
12
+ run(): Promise<void>;
13
+ }
@@ -0,0 +1,56 @@
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 format_1 = require("../../lib/format");
7
+ class CommitmentsActionProposals extends base_command_1.BaseCommand {
8
+ static description = 'List frozen prepared actions and their recovery state';
9
+ static args = {
10
+ id: core_1.Args.string({ description: 'Commitment ID', required: true, ignoreStdin: true }),
11
+ };
12
+ static flags = {
13
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
14
+ status: core_1.Flags.string({
15
+ description: 'Filter by proposal status',
16
+ options: ['proposed', 'approved', 'rejected', 'executing', 'succeeded', 'failed', 'expired'],
17
+ }),
18
+ limit: core_1.Flags.integer({ description: 'Maximum rows', default: 50, min: 1, max: 200 }),
19
+ };
20
+ async run() {
21
+ this.requireAuth();
22
+ const { args, flags } = await this.parse(CommitmentsActionProposals);
23
+ let response;
24
+ try {
25
+ response = await commitments_1.commitmentApi.actionProposals(args.id, {
26
+ status: flags.status,
27
+ limit: flags.limit,
28
+ });
29
+ }
30
+ catch (error) {
31
+ this.handleApiError(error);
32
+ }
33
+ if (flags.json) {
34
+ this.log(JSON.stringify(response, null, 2));
35
+ return;
36
+ }
37
+ if (!response.data.length) {
38
+ this.log('No prepared actions.');
39
+ return;
40
+ }
41
+ (0, format_1.renderTable)(response.data.map((proposal) => ({
42
+ id: proposal.id,
43
+ action: String(proposal.actionSnapshot?.type || 'action').replace(/_/g, ' '),
44
+ status: proposal.status,
45
+ attempt: `${proposal.attempt || 0}/${proposal.maxAttempts || 3}`,
46
+ expires: proposal.expiresAt || '—',
47
+ })), [
48
+ { key: 'id', header: 'PROPOSAL', verbatim: true },
49
+ { key: 'action', header: 'ACTION', maxWidth: 28 },
50
+ { key: 'status', header: 'STATUS' },
51
+ { key: 'attempt', header: 'ATTEMPT' },
52
+ { key: 'expires', header: 'EXPIRES', maxWidth: 28 },
53
+ ], (line) => this.log(line));
54
+ }
55
+ }
56
+ exports.default = CommitmentsActionProposals;
@@ -3,23 +3,19 @@ import { BaseCommand } from '../../base-command';
3
3
  * `skrr commitments autonomy <id> --mode <mode>` — grant or withdraw how much the
4
4
  * commitment may do on its own.
5
5
  *
6
- * The ladder, least to most autonomous:
7
- * off the loop does not run
8
- * suggestions_onlyrecords findings; never acts, never interrupts
9
- * ask_first proposes an action and waits for approval
10
- * auto_run_limited — acts on low-risk actions; escalates the rest
11
- * auto_run — acts within its policy without asking
6
+ * The one public autonomy axis:
7
+ * monitor observe and report; never execute external work
8
+ * preparereason and freeze a plan for approval
9
+ * execute act within the explicit execution policy
12
10
  *
13
11
  * Use this rather than `commitments update`: the API replaces `policy` wholesale,
14
12
  * whereas this endpoint merges the change into the existing policy.
15
13
  *
16
- * Caveat: the merge is field-by-field over the set `normalizePolicy` enumerates
17
- * (autonomyMode, inheritCompass, maxUserNudgesPerDay, minUserNudgeIntervalMs,
18
- * quietHours, requiresApprovalFor). `policy.delivery` is not among them — it is
19
- * accepted by the API but never persisted, and the delivery policy that actually
20
- * takes effect lives on the agent (`agent.deliveryPolicy.commitment`).
14
+ * The merge is field-by-field over the policy fields the Commitment Store owns;
15
+ * report destinations remain the separate `reports[]` contract.
21
16
  */
22
17
  export default class CommitmentsAutonomy extends BaseCommand {
18
+ static hidden: boolean;
23
19
  static description: string;
24
20
  static examples: string[];
25
21
  static args: {
@@ -8,27 +8,25 @@ const commitments_1 = require("../../lib/commitments");
8
8
  * `skrr commitments autonomy <id> --mode <mode>` — grant or withdraw how much the
9
9
  * commitment may do on its own.
10
10
  *
11
- * The ladder, least to most autonomous:
12
- * off the loop does not run
13
- * suggestions_onlyrecords findings; never acts, never interrupts
14
- * ask_first proposes an action and waits for approval
15
- * auto_run_limited — acts on low-risk actions; escalates the rest
16
- * auto_run — acts within its policy without asking
11
+ * The one public autonomy axis:
12
+ * monitor observe and report; never execute external work
13
+ * preparereason and freeze a plan for approval
14
+ * execute act within the explicit execution policy
17
15
  *
18
16
  * Use this rather than `commitments update`: the API replaces `policy` wholesale,
19
17
  * whereas this endpoint merges the change into the existing policy.
20
18
  *
21
- * Caveat: the merge is field-by-field over the set `normalizePolicy` enumerates
22
- * (autonomyMode, inheritCompass, maxUserNudgesPerDay, minUserNudgeIntervalMs,
23
- * quietHours, requiresApprovalFor). `policy.delivery` is not among them — it is
24
- * accepted by the API but never persisted, and the delivery policy that actually
25
- * takes effect lives on the agent (`agent.deliveryPolicy.commitment`).
19
+ * The merge is field-by-field over the policy fields the Commitment Store owns;
20
+ * report destinations remain the separate `reports[]` contract.
26
21
  */
27
22
  class CommitmentsAutonomy extends base_command_1.BaseCommand {
23
+ // Kept callable for existing scripts, but omitted from command discovery so
24
+ // new users see one product vocabulary: Monitor, Prepare, Execute.
25
+ static hidden = true;
28
26
  static description = "Set a commitment's autonomy mode (how much it may act unattended)";
29
27
  static examples = [
30
- '<%= config.bin %> commitments autonomy <commitment-id> --mode ask_first',
31
- '<%= config.bin %> commitments autonomy <commitment-id> --mode auto_run_limited --reason "trusted after 2 weeks"',
28
+ '<%= config.bin %> commitments mode <commitment-id> prepare',
29
+ '<%= config.bin %> commitments mode <commitment-id> execute',
32
30
  ];
33
31
  static args = {
34
32
  id: core_1.Args.string({ description: 'Commitment ID', required: true, ignoreStdin: true }),
@@ -36,8 +34,8 @@ class CommitmentsAutonomy extends base_command_1.BaseCommand {
36
34
  static flags = {
37
35
  json: core_1.Flags.boolean({ description: 'Output as JSON' }),
38
36
  mode: core_1.Flags.string({
39
- description: 'Autonomy mode',
40
- options: [...commitments_1.COMMITMENT_AUTONOMY_MODES],
37
+ description: 'Compatibility command. Prefer commitments mode <id> monitor|prepare|execute; use commitments pause to stop wakes.',
38
+ options: [...commitments_1.COMMITMENT_AUTHORABLE_AUTONOMY_MODES],
41
39
  required: true,
42
40
  }),
43
41
  reason: core_1.Flags.string({
@@ -48,9 +46,10 @@ class CommitmentsAutonomy extends base_command_1.BaseCommand {
48
46
  this.requireAuth();
49
47
  const { args, flags } = await this.parse(CommitmentsAutonomy);
50
48
  let commitment;
49
+ const storedMode = (0, commitments_1.storedAutonomyModeForAuthoring)(flags.mode);
51
50
  try {
52
51
  commitment = await commitments_1.commitmentApi.autonomy(args.id, {
53
- autonomyMode: flags.mode,
52
+ autonomyMode: storedMode,
54
53
  ...(flags.reason ? { reason: flags.reason } : {}),
55
54
  });
56
55
  }
@@ -61,7 +60,7 @@ class CommitmentsAutonomy extends base_command_1.BaseCommand {
61
60
  this.log(JSON.stringify((0, web_url_1.withCommitmentUrl)(this.cliConfig.baseURL, commitment), null, 2));
62
61
  return;
63
62
  }
64
- this.log(`Autonomy for ${args.id} set to ${flags.mode}.`);
63
+ this.log('Compatibility command accepted. Use commitments mode <id> monitor|prepare|execute for new workflows.');
65
64
  (0, commitments_1.renderCommitmentSummary)(commitment, (line) => this.log(line));
66
65
  }
67
66
  }
@@ -0,0 +1,14 @@
1
+ import { BaseCommand } from '../../base-command';
2
+ export default class CommitmentsBundle 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
+ task: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ output: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
12
+ };
13
+ run(): Promise<void>;
14
+ }
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const node_crypto_1 = require("node:crypto");
5
+ const node_fs_1 = require("node:fs");
6
+ const node_path_1 = require("node:path");
7
+ const base_command_1 = require("../../base-command");
8
+ const commitments_1 = require("../../lib/commitments");
9
+ class CommitmentsBundle extends base_command_1.BaseCommand {
10
+ static description = 'Download the retained Git bundle for a Commitment delivery Task';
11
+ static examples = [
12
+ '<%= config.bin %> commitments bundle <id> --task <task-id> --output remediation.bundle',
13
+ ];
14
+ static args = { id: core_1.Args.string({ required: true, ignoreStdin: true }) };
15
+ static flags = {
16
+ task: core_1.Flags.string({
17
+ required: true,
18
+ description: 'Delivery Task ID from the execution receipt',
19
+ }),
20
+ output: core_1.Flags.string({
21
+ required: true,
22
+ description: 'Save a new Git bundle file (existing files are not overwritten)',
23
+ }),
24
+ json: core_1.Flags.boolean({ description: 'Output the saved path and integrity metadata as JSON' }),
25
+ };
26
+ async run() {
27
+ this.requireAuth();
28
+ const { args, flags } = await this.parse(CommitmentsBundle);
29
+ try {
30
+ const { bundle } = await commitments_1.commitmentApi.deliveryBundle(args.id, flags.task);
31
+ if (bundle.encoding !== 'base64')
32
+ this.error('Unsupported Git bundle encoding.');
33
+ const content = Buffer.from(bundle.content, 'base64');
34
+ if ((0, node_crypto_1.createHash)('sha256').update(content).digest('hex') !== bundle.sha256 ||
35
+ content.length !== bundle.bytes)
36
+ this.error('Git bundle integrity check failed. The downloaded content was not saved.');
37
+ const output = (0, node_path_1.resolve)(flags.output);
38
+ (0, node_fs_1.writeFileSync)(output, content, { flag: 'wx', mode: 0o600 });
39
+ if (flags.json)
40
+ this.log(JSON.stringify({ path: output, sha256: bundle.sha256, bytes: bundle.bytes }, null, 2));
41
+ else
42
+ this.log(`Git bundle saved: ${output}\nSHA-256: ${bundle.sha256}`);
43
+ }
44
+ catch (error) {
45
+ this.handleApiError(error);
46
+ }
47
+ }
48
+ }
49
+ exports.default = CommitmentsBundle;
@@ -1,10 +1,30 @@
1
1
  import { BaseCommand } from '../../base-command';
2
2
  /**
3
- * Public commitment creation is intentionally trust-first: an action-capable
4
- * mode requested in the create payload is staged as suggestions_only until an
5
- * owner explicitly grants it. That safety boundary must be visible at the CLI
6
- * boundary; otherwise a successful create response reads like the requested
7
- * autonomy is live when it is not.
3
+ * True only when the authored create body can materialize at least one event
4
+ * binding. A polling-only source must not make `--event-driven` look successful
5
+ * while the resulting Commitment still wakes exclusively on its backstop.
6
+ */
7
+ export declare function hasEventCapableWatchedSource(payload: Record<string, unknown>): boolean;
8
+ export declare function assertEventDrivenWatchedSource(payload: Record<string, unknown>): void;
9
+ /**
10
+ * Resolve the create-time cadence flags into the API payload.
11
+ *
12
+ * `--event-driven` is deliberately a complete shortcut rather than an alias
13
+ * for the mode string: event delivery is an accelerator, so the contract must
14
+ * always retain a timed safety net even when the author omits `--cadence`.
15
+ */
16
+ export declare function createCadenceFromFlags({ eventDriven, cadence: cadenceInput, cadenceMode, timezone, }: {
17
+ eventDriven?: boolean;
18
+ cadence?: string;
19
+ cadenceMode?: string;
20
+ timezone?: string;
21
+ }): Record<string, unknown> | undefined;
22
+ /**
23
+ * Creation preserves the policy its author wrote, so the mode that comes back
24
+ * is normally the mode that was asked for. When it is not — normalization
25
+ * rejected the value, or a governance layer sits lower — the difference has to
26
+ * be said out loud at the CLI boundary; otherwise a successful create response
27
+ * reads like the requested autonomy is live when something else is running.
8
28
  */
9
29
  export declare function autonomyStagingNotice({ payload, commitment, bin, }: {
10
30
  payload: Record<string, unknown>;
@@ -32,6 +52,8 @@ export default class CommitmentsCreate extends BaseCommand {
32
52
  title: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
33
53
  outcome: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
34
54
  description: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
55
+ 'agent-directive': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
56
+ 'agent-directive-file': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
35
57
  goal: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
36
58
  status: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
37
59
  deadline: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
@@ -44,9 +66,15 @@ export default class CommitmentsCreate extends BaseCommand {
44
66
  'watch-space': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
45
67
  'watch-monitor': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
46
68
  cadence: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
69
+ 'event-driven': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
47
70
  'cadence-mode': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
48
71
  timezone: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
72
+ mode: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
73
+ delivery: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
74
+ repo: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
75
+ base: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
49
76
  autonomy: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
77
+ isolation: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
50
78
  'max-nudges': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
51
79
  };
52
80
  run(): Promise<void>;