@skrr-ai/cli 0.1.93 → 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.
Files changed (60) hide show
  1. package/dist/commands/agents/operating-plan.d.ts +11 -0
  2. package/dist/commands/agents/operating-plan.js +54 -0
  3. package/dist/commands/agents/roles/example.d.ts +11 -0
  4. package/dist/commands/agents/roles/example.js +30 -0
  5. package/dist/commands/{commitments/mode.d.ts → agents/roles/export.d.ts} +5 -5
  6. package/dist/commands/agents/roles/export.js +81 -0
  7. package/dist/commands/agents/roles/install.d.ts +12 -0
  8. package/dist/commands/agents/roles/install.js +48 -0
  9. package/dist/commands/agents/roles/list.d.ts +11 -0
  10. package/dist/commands/agents/roles/list.js +36 -0
  11. package/dist/commands/agents/roles/preview.d.ts +14 -0
  12. package/dist/commands/agents/roles/preview.js +49 -0
  13. package/dist/commands/agents/roles/withdraw.d.ts +13 -0
  14. package/dist/commands/agents/roles/withdraw.js +43 -0
  15. package/dist/commands/commitments/{autonomy-requests → cadence-requests}/decide.d.ts +5 -7
  16. package/dist/commands/commitments/{autonomy-requests → cadence-requests}/decide.js +13 -15
  17. package/dist/commands/commitments/cost.d.ts +1 -1
  18. package/dist/commands/commitments/cost.js +1 -1
  19. package/dist/commands/commitments/create.d.ts +0 -7
  20. package/dist/commands/commitments/create.js +9 -98
  21. package/dist/commands/commitments/delivery.js +3 -21
  22. package/dist/commands/commitments/doctor.js +28 -27
  23. package/dist/commands/commitments/effective-policy.js +5 -36
  24. package/dist/commands/commitments/evaluations.d.ts +15 -0
  25. package/dist/commands/commitments/evaluations.js +54 -0
  26. package/dist/commands/commitments/pack/activate.d.ts +11 -0
  27. package/dist/commands/commitments/pack/activate.js +22 -0
  28. package/dist/commands/commitments/pack/bind.js +1 -1
  29. package/dist/commands/commitments/remediate.js +2 -5
  30. package/dist/commands/commitments/show.js +1 -1
  31. package/dist/commands/commitments/update.js +9 -9
  32. package/dist/commands/commitments/wake-capabilities.d.ts +1 -3
  33. package/dist/commands/commitments/wake-capabilities.js +5 -21
  34. package/dist/lib/commitment-product.d.ts +0 -6
  35. package/dist/lib/commitment-product.js +1 -30
  36. package/dist/lib/commitments.d.ts +9 -45
  37. package/dist/lib/commitments.js +24 -95
  38. package/dist/lib/northstars.js +1 -1
  39. package/dist/lib/roles.d.ts +98 -0
  40. package/dist/lib/roles.js +45 -0
  41. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/commitmentExecutionContract.d.ts +45 -0
  42. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/commitmentExecutionContract.js +550 -0
  43. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/sessionPermissionAuthority.d.ts +7 -44
  44. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/sessionPermissionAuthority.js +8 -47
  45. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/commitmentExecutionContract.d.ts +45 -0
  46. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/commitmentExecutionContract.js +545 -0
  47. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/sessionPermissionAuthority.d.ts +7 -44
  48. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/sessionPermissionAuthority.js +8 -47
  49. package/dist/node_modules/@skrr-ai/auth-core/package.json +11 -1
  50. package/dist/node_modules/@skrr-ai/data-provider/index.js +7316 -7203
  51. package/dist/node_modules/@skrr-ai/data-provider/package.json +2 -2
  52. package/oclif.manifest.json +22528 -22170
  53. package/package.json +5 -2
  54. package/dist/commands/commitments/autonomy.d.ts +0 -30
  55. package/dist/commands/commitments/autonomy.js +0 -67
  56. package/dist/commands/commitments/mode.js +0 -58
  57. package/dist/commands/commitments/pack/promote.d.ts +0 -19
  58. package/dist/commands/commitments/pack/promote.js +0 -46
  59. package/dist/commands/commitments/pack/shadow.d.ts +0 -20
  60. package/dist/commands/commitments/pack/shadow.js +0 -42
@@ -1,16 +1,10 @@
1
1
  import type { CommitmentDeliveryIntent, CommitmentExecutionReceipt, CommitmentExecutionReceiptQuarterlyMetricsResponse } from '@skrr-ai/data-provider';
2
- export declare const COMMITMENT_PRODUCT_MODES: readonly ["monitor", "prepare", "execute"];
3
2
  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
3
  export declare function deliveryLabel(mode?: string): string;
8
4
  export declare function deliveryInput(mode: string, options?: {
9
5
  repo?: string;
10
6
  base?: string;
11
7
  }): 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
8
  export declare function renderExecutionReceipt(receipt: CommitmentExecutionReceipt, log: (line: string) => void, verbose?: boolean): void;
15
9
  /**
16
10
  * `skrr commitments receipt-metrics <id>` — the closed-quarter rollup.
@@ -1,14 +1,10 @@
1
1
  "use strict";
2
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;
3
+ exports.COMMITMENT_DELIVERY_CHOICES = void 0;
6
4
  exports.deliveryLabel = deliveryLabel;
7
5
  exports.deliveryInput = deliveryInput;
8
- exports.deliveryForProductMode = deliveryForProductMode;
9
6
  exports.renderExecutionReceipt = renderExecutionReceipt;
10
7
  exports.renderExecutionReceiptQuarterlyMetrics = renderExecutionReceiptQuarterlyMetrics;
11
- exports.COMMITMENT_PRODUCT_MODES = ['monitor', 'prepare', 'execute'];
12
8
  exports.COMMITMENT_DELIVERY_CHOICES = [
13
9
  'report-only',
14
10
  'local-patch',
@@ -16,20 +12,6 @@ exports.COMMITMENT_DELIVERY_CHOICES = [
16
12
  'push-branch',
17
13
  'direct-branch',
18
14
  ];
19
- /** Compatibility is accepted at the input boundary; everyday output uses the product contract. */
20
- function productMode(value) {
21
- if (value === 'prepare' || value === 'ask_first')
22
- return 'prepare';
23
- if (['execute', 'auto_run', 'auto_run_limited'].includes(value || ''))
24
- return 'execute';
25
- return 'monitor';
26
- }
27
- function productModeLabel(value) {
28
- if (value === 'off')
29
- return 'Not running';
30
- const mode = productMode(value);
31
- return mode[0].toUpperCase() + mode.slice(1);
32
- }
33
15
  function deliveryLabel(mode) {
34
16
  return ({
35
17
  report_only: 'Report only',
@@ -51,19 +33,8 @@ function deliveryInput(mode, options = {}) {
51
33
  ...(options.base ? { baseBranch: options.base } : {}),
52
34
  };
53
35
  }
54
- /** Monitor is observation-only; retain report expectations, never repo coordinates. */
55
- function deliveryForProductMode(mode, delivery) {
56
- if (productMode(mode) !== 'monitor')
57
- return delivery;
58
- return {
59
- version: 1,
60
- mode: 'report_only',
61
- ...(delivery?.expectations ? { expectations: delivery.expectations } : {}),
62
- };
63
- }
64
36
  function renderExecutionReceipt(receipt, log, verbose = false) {
65
37
  log(receipt.summary);
66
- log(`Mode: ${productModeLabel(receipt.mode)}`);
67
38
  if (receipt.runtime) {
68
39
  const identity = receipt.runtime.name || receipt.runtime.id || 'the selected runtime';
69
40
  log(`Runtime: ${identity}${receipt.runtime.kind ? ` · ${receipt.runtime.kind}` : ''}${receipt.runtime.provider ? ` · ${receipt.runtime.provider}` : ''}`);
@@ -16,7 +16,7 @@
16
16
  * Two `kind`s: `achieve` (bounded, deadline-bearing) and `maintain` (perpetual
17
17
  * "hold this state", derived from a Compass invariant — not authored here).
18
18
  */
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, COMMITMENT_STATUSES, COMMITMENT_KIND_VALUES } from '@skrr-ai/data-provider';
19
+ import { COMMITMENT_WATCHED_SOURCES, COMMITMENT_TEMPLATE_IDS, COMMITMENT_CADENCE_MODES, COMMITMENT_CADENCE_TIME_PATTERN, COMMITMENT_CADENCE_MAX_TIMES, COMMITMENT_EXECUTION_ISOLATION_MODES, COMMITMENT_STATUSES, COMMITMENT_KIND_VALUES } from '@skrr-ai/data-provider';
20
20
  import type { CommitmentCheck, CommitmentChecksResponse, Commitment, CommitmentActionProposal, CommitmentListResponse, CommitmentPlanResponse, CommitmentStatusResponse, CommitmentWorkLink, CommitmentExecutionReceiptListResponse, CommitmentExecutionReceiptQuarterlyMetricsResponse, CommitmentCapabilitySource, CommitmentDeliveryPatchResponse, CommitmentDeliveryBundleResponse, CommitmentCyclesResponse, CommitmentExplanationResponse, CommitmentRunPermissions } 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, COMMITMENT_STATUSES, COMMITMENT_KIND_VALUES, };
@@ -24,19 +24,6 @@ export type { CommitmentCheck, CommitmentChecksResponse, Commitment, CommitmentA
24
24
  /** Derived from the installed compatibility vocabulary so the CLI remains
25
25
  * safe even while data-provider and CLI packages roll out separately. */
26
26
  export declare const COMMITMENT_AUTHORABLE_CADENCE_MODES: ("manual" | "daily" | "interval" | "event_plus_interval")[];
27
- /**
28
- * Autonomy ladder — how much the commitment may act without asking.
29
- *
30
- * Re-exported, not restated: `@skrr-ai/data-provider` owns the vocabulary, and
31
- * a second literal here is how the CLI would silently drift from the server
32
- * that rejects its values.
33
- */
34
- export { COMMITMENT_AUTONOMY_MODES };
35
- export declare const COMMITMENT_AUTHORABLE_AUTONOMY_MODES: readonly ["monitor", "prepare", "execute"];
36
- export type CommitmentAuthorableAutonomyMode = (typeof COMMITMENT_AUTHORABLE_AUTONOMY_MODES)[number];
37
- export declare function storedAutonomyModeForAuthoring(mode: CommitmentAuthorableAutonomyMode | string): 'suggestions_only' | 'ask_first' | 'auto_run';
38
- export declare function authoringAutonomyModeForStored(mode?: string | null): CommitmentAuthorableAutonomyMode;
39
- export declare function commitmentAutonomyLabel(mode?: string | null): string;
40
27
  /**
41
28
  * Where a Commitment's autonomous runs do their work. Re-exported for the same
42
29
  * reason as the ladder above: the vocabulary is the server's, and a picker that
@@ -212,8 +199,7 @@ export declare const commitmentPackApi: {
212
199
  plan: (body: Record<string, unknown>) => Promise<CommitmentPackPlanResponse>;
213
200
  bind: (body: Record<string, unknown>) => Promise<CommitmentPackBindResponse>;
214
201
  preflight: (id: string, nextRunCount?: number) => Promise<CommitmentPackPreflightResponse>;
215
- shadow: (id: string) => Promise<CommitmentPackLifecycleResponse>;
216
- promote: (id: string) => Promise<CommitmentPackLifecycleResponse>;
202
+ activate: (id: string) => Promise<CommitmentPackLifecycleResponse>;
217
203
  };
218
204
  export declare const commitmentApi: {
219
205
  /**
@@ -320,8 +306,6 @@ export declare const commitmentApi: {
320
306
  pause: (id: string) => Promise<Commitment>;
321
307
  resume: (id: string) => Promise<Commitment>;
322
308
  complete: (id: string) => Promise<Commitment>;
323
- autonomy: (id: string, body: Record<string, unknown>) => Promise<Commitment>;
324
- mode: (id: string, body: Record<string, unknown>) => Promise<Commitment>;
325
309
  delivery: (id: string, body: Record<string, unknown>) => Promise<Commitment>;
326
310
  receipts: (id: string, query?: {
327
311
  limit?: number;
@@ -445,6 +429,11 @@ export declare const commitmentApi: {
445
429
  status?: string;
446
430
  cursor?: string;
447
431
  }) => Promise<CommitmentListPage>;
432
+ evaluations: (id: string, query?: {
433
+ limit?: number;
434
+ }) => Promise<CommitmentListPage>;
435
+ createEvaluation: (id: string, body: Record<string, unknown>) => Promise<Record<string, unknown>>;
436
+ retryEvaluationLearning: (id: string, scheduleId: string) => Promise<Record<string, unknown>>;
448
437
  observations: (id: string, query?: {
449
438
  limit?: number;
450
439
  declaredOnly?: boolean;
@@ -457,7 +446,7 @@ export declare const commitmentApi: {
457
446
  /** Bounded, named corrections — never a free-form contract edit. */
458
447
  remediate: (id: string, body: Record<string, unknown>) => Promise<Record<string, unknown>>;
459
448
  /** Approve/reject an Agent-proposed cadence change the server parked. */
460
- decideAutonomyRequest: (id: string, requestId: string, approved: boolean) => Promise<Record<string, unknown>>;
449
+ decideCadenceRequest: (id: string, requestId: string, approved: boolean) => Promise<Record<string, unknown>>;
461
450
  linkGoal: (id: string, goalId: string) => Promise<Record<string, unknown>>;
462
451
  unlinkGoal: (id: string, goalId: string) => Promise<Record<string, unknown>>;
463
452
  };
@@ -550,9 +539,6 @@ export interface CommitmentCostWindow {
550
539
  }
551
540
  /** Shape of `GET /:id/wake-capabilities`. */
552
541
  export interface CommitmentWakeCapabilities {
553
- workPromotionModel?: 'monitor_prepare_execute_v1';
554
- mode: string;
555
- selectedCapabilityIds?: string[];
556
542
  eligibleCapabilities: Array<{
557
543
  id: string;
558
544
  kind?: string;
@@ -571,7 +557,7 @@ export declare const COMMITMENT_FEEDBACK_KINDS: readonly ["useful", "noisy", "wr
571
557
  * the "this commitment is misbehaving, calm it down" lever, and a free-form
572
558
  * contract edit would defeat the point of having one.
573
559
  */
574
- export declare const COMMITMENT_REMEDIATION_ACTIONS: readonly ["pause_commitment", "mute_user_nudges", "reduce_nudge_frequency", "tighten_policy", "mark_noop"];
560
+ export declare const COMMITMENT_REMEDIATION_ACTIONS: readonly ["pause_commitment", "mute_user_nudges", "reduce_nudge_frequency", "mark_noop"];
575
561
  /** The only keys `createBodySchema` (a `z.strictObject`) accepts. */
576
562
  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"];
577
563
  /**
@@ -690,23 +676,6 @@ export declare function buildSuccessCriteria(labels: string[], opts?: {
690
676
  }): SuccessCriterionInput[];
691
677
  export declare function cadenceLabel(commitment: CommitmentView): string;
692
678
  export declare function renderCommitmentList(commitments: CommitmentView[], log: (line: string) => void): void;
693
- /**
694
- * The autonomy mode a check ACTUALLY ran at, read from its policy trace
695
- * (OSK-4881).
696
- *
697
- * A check records the Mode it actually used in `decision.policyTrace`. For the
698
- * v2 product contract, only an explicit Workspace-admin constraint may lower
699
- * the declared Mode; legacy checks may still carry older effective-mode traces.
700
- * Either `autonomyMode` or `effectiveAutonomyMode` answers what governed that
701
- * particular run. Returns undefined when the trace carries neither.
702
- *
703
- * Exported for tests.
704
- */
705
- export declare function effectiveAutonomyMode(check?: {
706
- decision?: {
707
- policyTrace?: Array<Record<string, unknown>>;
708
- } | null;
709
- } | null): string | undefined;
710
679
  /**
711
680
  * A `commitment_standstill` policyTrace entry, extracted from the latest
712
681
  * check's decision. The arbiter appends it whenever a quiet posture is the
@@ -737,11 +706,6 @@ export declare function extractStandstillFromCheck(check?: {
737
706
  *
738
707
  * Exported for tests.
739
708
  */
740
- export declare function describeAutonomyLine(commitment: CommitmentView, latestCheck?: {
741
- decision?: {
742
- policyTrace?: Array<Record<string, unknown>>;
743
- } | null;
744
- } | null): string;
745
709
  /**
746
710
  * One-line rendering of `commitment.executorBlocked` — the B4/A7 signal that
747
711
  * the executor's targets are all unusable: `{reason:'quota'|'offline'|'waiting_for_machine', until?,
@@ -1,9 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.COMMITMENT_CLI_EVALUATORS = exports.COMMITMENT_CREATE_KEYS = exports.COMMITMENT_REMEDIATION_ACTIONS = exports.COMMITMENT_FEEDBACK_KINDS = exports.commitmentApi = exports.commitmentPackApi = exports.MAX_COMMITMENT_INTERVAL_MS = exports.MIN_COMMITMENT_INTERVAL_MS = exports.COMMITMENT_EXECUTION_ISOLATION_MODES = exports.COMMITMENT_AUTHORABLE_AUTONOMY_MODES = exports.COMMITMENT_AUTONOMY_MODES = exports.COMMITMENT_AUTHORABLE_CADENCE_MODES = exports.COMMITMENT_KIND_VALUES = exports.COMMITMENT_STATUSES = exports.COMMITMENT_CADENCE_MAX_TIMES = exports.COMMITMENT_CADENCE_TIME_PATTERN = exports.COMMITMENT_CADENCE_MODES = exports.COMMITMENT_TEMPLATE_IDS = exports.COMMITMENT_WATCHED_SOURCES = void 0;
4
- exports.storedAutonomyModeForAuthoring = storedAutonomyModeForAuthoring;
5
- exports.authoringAutonomyModeForStored = authoringAutonomyModeForStored;
6
- exports.commitmentAutonomyLabel = commitmentAutonomyLabel;
3
+ exports.COMMITMENT_CLI_EVALUATORS = exports.COMMITMENT_CREATE_KEYS = exports.COMMITMENT_REMEDIATION_ACTIONS = exports.COMMITMENT_FEEDBACK_KINDS = exports.commitmentApi = exports.commitmentPackApi = exports.MAX_COMMITMENT_INTERVAL_MS = exports.MIN_COMMITMENT_INTERVAL_MS = exports.COMMITMENT_EXECUTION_ISOLATION_MODES = exports.COMMITMENT_AUTHORABLE_CADENCE_MODES = exports.COMMITMENT_KIND_VALUES = exports.COMMITMENT_STATUSES = exports.COMMITMENT_CADENCE_MAX_TIMES = exports.COMMITMENT_CADENCE_TIME_PATTERN = exports.COMMITMENT_CADENCE_MODES = exports.COMMITMENT_TEMPLATE_IDS = exports.COMMITMENT_WATCHED_SOURCES = void 0;
7
4
  exports.permissionLines = permissionLines;
8
5
  exports.retiredFieldsLine = retiredFieldsLine;
9
6
  exports.readCommitmentAgentDirective = readCommitmentAgentDirective;
@@ -19,9 +16,7 @@ exports.describeIntervalMs = describeIntervalMs;
19
16
  exports.buildSuccessCriteria = buildSuccessCriteria;
20
17
  exports.cadenceLabel = cadenceLabel;
21
18
  exports.renderCommitmentList = renderCommitmentList;
22
- exports.effectiveAutonomyMode = effectiveAutonomyMode;
23
19
  exports.extractStandstillFromCheck = extractStandstillFromCheck;
24
- exports.describeAutonomyLine = describeAutonomyLine;
25
20
  exports.describeExecutorBlocked = describeExecutorBlocked;
26
21
  exports.renderCommitmentSummary = renderCommitmentSummary;
27
22
  exports.describeWakeDecision = describeWakeDecision;
@@ -63,7 +58,6 @@ Object.defineProperty(exports, "COMMITMENT_TEMPLATE_IDS", { enumerable: true, ge
63
58
  Object.defineProperty(exports, "COMMITMENT_CADENCE_MODES", { enumerable: true, get: function () { return data_provider_1.COMMITMENT_CADENCE_MODES; } });
64
59
  Object.defineProperty(exports, "COMMITMENT_CADENCE_TIME_PATTERN", { enumerable: true, get: function () { return data_provider_1.COMMITMENT_CADENCE_TIME_PATTERN; } });
65
60
  Object.defineProperty(exports, "COMMITMENT_CADENCE_MAX_TIMES", { enumerable: true, get: function () { return data_provider_1.COMMITMENT_CADENCE_MAX_TIMES; } });
66
- Object.defineProperty(exports, "COMMITMENT_AUTONOMY_MODES", { enumerable: true, get: function () { return data_provider_1.COMMITMENT_AUTONOMY_MODES; } });
67
61
  Object.defineProperty(exports, "COMMITMENT_EXECUTION_ISOLATION_MODES", { enumerable: true, get: function () { return data_provider_1.COMMITMENT_EXECUTION_ISOLATION_MODES; } });
68
62
  Object.defineProperty(exports, "COMMITMENT_STATUSES", { enumerable: true, get: function () { return data_provider_1.COMMITMENT_STATUSES; } });
69
63
  Object.defineProperty(exports, "COMMITMENT_KIND_VALUES", { enumerable: true, get: function () { return data_provider_1.COMMITMENT_KIND_VALUES; } });
@@ -74,34 +68,6 @@ const triggers_1 = require("./triggers");
74
68
  /** Derived from the installed compatibility vocabulary so the CLI remains
75
69
  * safe even while data-provider and CLI packages roll out separately. */
76
70
  exports.COMMITMENT_AUTHORABLE_CADENCE_MODES = data_provider_1.COMMITMENT_CADENCE_MODES.filter((mode) => mode !== 'sampled');
77
- exports.COMMITMENT_AUTHORABLE_AUTONOMY_MODES = ['monitor', 'prepare', 'execute'];
78
- function storedAutonomyModeForAuthoring(mode) {
79
- if (mode === 'monitor')
80
- return 'suggestions_only';
81
- if (mode === 'prepare')
82
- return 'ask_first';
83
- if (mode === 'execute')
84
- return 'auto_run';
85
- throw new Error(`Unsupported autonomy mode: ${mode}. Use monitor, prepare, or execute.`);
86
- }
87
- function authoringAutonomyModeForStored(mode) {
88
- if (mode === 'ask_first')
89
- return 'prepare';
90
- if (mode === 'auto_run' || mode === 'auto_run_limited')
91
- return 'execute';
92
- return 'monitor';
93
- }
94
- function commitmentAutonomyLabel(mode) {
95
- if (mode === 'suggestions_only')
96
- return 'Monitor';
97
- if (mode === 'ask_first')
98
- return 'Prepare';
99
- if (mode === 'auto_run' || mode === 'auto_run_limited')
100
- return 'Execute';
101
- if (mode === 'off')
102
- return 'Legacy off (pause the Commitment)';
103
- return mode || '-';
104
- }
105
71
  /**
106
72
  * Interval bounds for `cadence.intervalMs`.
107
73
  *
@@ -151,8 +117,7 @@ exports.commitmentPackApi = {
151
117
  preflight: (id, nextRunCount) => data_provider_1.request.post(`${packBase(id)}/preflight`, {
152
118
  ...(typeof nextRunCount === 'number' ? { nextRunCount } : {}),
153
119
  }),
154
- shadow: (id) => data_provider_1.request.post(`${packBase(id)}/shadow`, {}),
155
- promote: (id) => data_provider_1.request.post(`${packBase(id)}/promote`, {}),
120
+ activate: (id) => data_provider_1.request.post(`${packBase(id)}/activate`, {}),
156
121
  };
157
122
  exports.commitmentApi = {
158
123
  /**
@@ -217,8 +182,6 @@ exports.commitmentApi = {
217
182
  pause: (id) => data_provider_1.request.post(`${base(id)}/pause`, {}),
218
183
  resume: (id) => data_provider_1.request.post(`${base(id)}/resume`, {}),
219
184
  complete: (id) => data_provider_1.request.post(`${base(id)}/complete`, {}),
220
- autonomy: (id, body) => data_provider_1.request.post(`${base(id)}/autonomy`, body),
221
- mode: (id, body) => data_provider_1.request.post(`${base(id)}/mode`, body),
222
185
  delivery: (id, body) => data_provider_1.request.post(`${base(id)}/delivery`, body),
223
186
  receipts: (id, query = 1) => data_provider_1.request.get((0, triggers_1.withQuery)(`${base(id)}/receipts`, typeof query === 'number' ? { limit: query } : query)),
224
187
  receiptQuarterlyMetrics: (id, year, quarter) => data_provider_1.request.get((0, triggers_1.withQuery)(`${base(id)}/receipt-metrics/quarterly`, { year, quarter })),
@@ -325,6 +288,9 @@ exports.commitmentApi = {
325
288
  * investigation of the same drift most needs answered before it starts.
326
289
  */
327
290
  hypotheses: (id, query = {}) => data_provider_1.request.get((0, triggers_1.withQuery)(`${base(id)}/hypotheses`, query)),
291
+ evaluations: (id, query = {}) => data_provider_1.request.get((0, triggers_1.withQuery)(`${base(id)}/evaluations`, query)),
292
+ createEvaluation: (id, body) => data_provider_1.request.post(`${base(id)}/evaluations`, body),
293
+ retryEvaluationLearning: (id, scheduleId) => data_provider_1.request.post(`${base(id)}/evaluations/${encodeURIComponent(scheduleId)}/retry-learning`, {}),
328
294
  observations: (id, query = {}) => data_provider_1.request.get((0, triggers_1.withQuery)(`${base(id)}/observations`, query)),
329
295
  /* ------------------------------------------------------------------------ *
330
296
  * Steering
@@ -334,7 +300,7 @@ exports.commitmentApi = {
334
300
  /** Bounded, named corrections — never a free-form contract edit. */
335
301
  remediate: (id, body) => data_provider_1.request.post(`${base(id)}/remediation`, body),
336
302
  /** Approve/reject an Agent-proposed cadence change the server parked. */
337
- decideAutonomyRequest: (id, requestId, approved) => data_provider_1.request.post(`${base(id)}/autonomy-requests/${encodeURIComponent(requestId)}/decision`, {
303
+ decideCadenceRequest: (id, requestId, approved) => data_provider_1.request.post(`${base(id)}/cadence-requests/${encodeURIComponent(requestId)}/decision`, {
338
304
  approved,
339
305
  }),
340
306
  linkGoal: (id, goalId) => data_provider_1.request.put(`${base(id)}/goals/${encodeURIComponent(goalId)}`, {}),
@@ -351,7 +317,6 @@ exports.COMMITMENT_REMEDIATION_ACTIONS = [
351
317
  'pause_commitment',
352
318
  'mute_user_nudges',
353
319
  'reduce_nudge_frequency',
354
- 'tighten_policy',
355
320
  'mark_noop',
356
321
  ];
357
322
  /** The only keys `createBodySchema` (a `z.strictObject`) accepts. */
@@ -427,8 +392,8 @@ function parseCommitmentConcurrencyLimit(input) {
427
392
  if (['unlimited', 'unbounded', 'none', 'null'].includes(raw))
428
393
  return null;
429
394
  const value = Number(raw);
430
- if (!Number.isSafeInteger(value) || value < 1 || value > 100) {
431
- throw new Error('--max-concurrent-runs must be "unlimited" or an integer from 1 to 100.');
395
+ if (!Number.isSafeInteger(value) || value < 0 || value > 100) {
396
+ throw new Error('--max-concurrent-runs must be "unlimited" or an integer from 0 to 100.');
432
397
  }
433
398
  return value;
434
399
  }
@@ -453,7 +418,7 @@ function commitmentConcurrencyEnvelopePatch({ rawValue, reason, autonomous = pro
453
418
  };
454
419
  }
455
420
  function describeCommitmentConcurrency(commitment) {
456
- const envelope = commitment.policy?.autonomyEnvelope;
421
+ const envelope = commitment.policy?.executionBudget;
457
422
  const limit = envelope?.maxConcurrentRuns;
458
423
  const decision = envelope?.maxConcurrentRunsDecision;
459
424
  if (limit == null) {
@@ -671,7 +636,7 @@ const STALLED_DIAGNOSES = {
671
636
  * no diagnosis to name.
672
637
  */
673
638
  function describeStalledHealth(commitment) {
674
- if (commitment.state?.health !== 'stalled')
639
+ if (!['blocked', 'failed'].includes(commitment.assessment?.operation || ''))
675
640
  return undefined;
676
641
  const liveness = (commitment.state?.liveness || {});
677
642
  const kind = typeof liveness.diagnosisKind === 'string' ? liveness.diagnosisKind : undefined;
@@ -777,16 +742,18 @@ function renderCommitmentList(commitments, log) {
777
742
  id: o.id ?? '-',
778
743
  title: o.title ?? '-',
779
744
  status: o.status ?? '-',
780
- health: o.state?.health ?? '-',
745
+ outcome: o.assessment?.label ?? 'Unknown',
746
+ evidence: o.assessment?.evidence ?? 'unavailable',
747
+ operation: o.assessment?.operation ?? 'blocked',
781
748
  cadence: cadenceLabel(o),
782
- autonomy: (0, commitment_product_1.productModeLabel)(o.policy?.autonomyMode),
783
749
  agent: o.agentId ?? '-',
784
750
  })), [
785
751
  { key: 'title', header: 'TITLE', maxWidth: 34 },
786
752
  { key: 'status', header: 'STATUS', maxWidth: 10 },
787
- { key: 'health', header: 'HEALTH', maxWidth: 16 },
753
+ { key: 'outcome', header: 'OUTCOME', maxWidth: 16 },
754
+ { key: 'evidence', header: 'EVIDENCE', maxWidth: 14 },
755
+ { key: 'operation', header: 'OPERATION', maxWidth: 12 },
788
756
  { key: 'cadence', header: 'CADENCE', maxWidth: 10 },
789
- { key: 'autonomy', header: 'MODE', maxWidth: 18 },
790
757
  { key: 'agent', header: 'AGENT', verbatim: true },
791
758
  // Commitment ids are routinely pasted into `check-now`, so this column
792
759
  // is never clipped. Widening the guess (28 → 44) fixed today's
@@ -794,32 +761,6 @@ function renderCommitmentList(commitments, log) {
794
761
  { key: 'id', header: 'ID', verbatim: true },
795
762
  ], log);
796
763
  }
797
- /**
798
- * The autonomy mode a check ACTUALLY ran at, read from its policy trace
799
- * (OSK-4881).
800
- *
801
- * A check records the Mode it actually used in `decision.policyTrace`. For the
802
- * v2 product contract, only an explicit Workspace-admin constraint may lower
803
- * the declared Mode; legacy checks may still carry older effective-mode traces.
804
- * Either `autonomyMode` or `effectiveAutonomyMode` answers what governed that
805
- * particular run. Returns undefined when the trace carries neither.
806
- *
807
- * Exported for tests.
808
- */
809
- function effectiveAutonomyMode(check) {
810
- const trace = check?.decision?.policyTrace;
811
- if (!Array.isArray(trace))
812
- return undefined;
813
- for (const entry of trace) {
814
- if (!entry || typeof entry !== 'object')
815
- continue;
816
- const e = entry;
817
- const mode = e.autonomyMode ?? e.effectiveAutonomyMode;
818
- if (typeof mode === 'string' && mode.length)
819
- return mode;
820
- }
821
- return undefined;
822
- }
823
764
  /**
824
765
  * A `commitment_standstill` policyTrace entry, extracted from the latest
825
766
  * check's decision. The arbiter appends it whenever a quiet posture is the
@@ -864,14 +805,6 @@ function extractStandstillFromCheck(check) {
864
805
  *
865
806
  * Exported for tests.
866
807
  */
867
- function describeAutonomyLine(commitment, latestCheck) {
868
- const stated = commitment.policy?.autonomyMode ?? '-';
869
- const effective = effectiveAutonomyMode(latestCheck);
870
- if (effective && effective !== stated) {
871
- return `${(0, commitment_product_1.productModeLabel)(stated)} (effective: ${(0, commitment_product_1.productModeLabel)(effective)} — constrained by configured policy)`;
872
- }
873
- return (0, commitment_product_1.productModeLabel)(stated);
874
- }
875
808
  /**
876
809
  * One-line rendering of `commitment.executorBlocked` — the B4/A7 signal that
877
810
  * the executor's targets are all unusable: `{reason:'quota'|'offline'|'waiting_for_machine', until?,
@@ -927,21 +860,17 @@ latestCheck) {
927
860
  if (commitment.target?.deadlineAt)
928
861
  log(`Deadline: ${commitment.target.deadlineAt}`);
929
862
  log(`Cadence: ${cadenceLabel(commitment)}`);
930
- log(`Mode: ${describeAutonomyLine(commitment, latestCheck)}`);
931
863
  log(`Delivery: ${(0, commitment_product_1.deliveryLabel)(commitment.delivery?.mode)}${commitment.delivery?.repo ? ` · ${commitment.delivery.repo}` : ''}${commitment.delivery?.baseBranch ? ` → ${commitment.delivery.baseBranch}` : ''}`);
932
864
  log(`Concurrency: ${describeCommitmentConcurrency(commitment)}`);
933
865
  const criteria = commitment.target?.successCriteria || [];
934
866
  const evidenceHealth = latestCheck?.inputs?.evidenceHealth;
935
867
  const evidenceLine = describeEvidenceHealth(evidenceHealth, criteria.length);
936
- const health = commitment.state?.health ?? 'unknown';
937
- const unevidenceableExplanation = health === 'unknown' && evidenceHealth?.state === 'unevidenceable_criteria'
938
- ? ' — evidence cannot establish a positive health verdict as configured'
939
- : '';
940
- // The two explanations are mutually exclusive by construction: one only fires
941
- // on `unknown`, the other only on `stalled`.
942
- const stalledExplanation = describeStalledHealth(commitment);
943
- const healthExplanation = unevidenceableExplanation || (stalledExplanation ? ` — ${stalledExplanation}` : '');
944
- log(`Health: ${health}${healthExplanation}`);
868
+ const assessment = commitment.assessment
869
+ ? (0, data_provider_1.readCommitmentAssessment)(commitment.assessment)
870
+ : undefined;
871
+ log(`Assessment: ${assessment?.label ?? 'Unknown'}`);
872
+ log(`Evidence: ${assessment?.evidence ?? 'unavailable'}`);
873
+ log(`Operation: ${assessment?.operation ?? 'blocked'}${assessment?.operationReason ? ` — ${assessment.operationReason}` : ''}`);
945
874
  if (commitment.state?.lastCheckedAt)
946
875
  log(`Checked: ${commitment.state.lastCheckedAt}`);
947
876
  if (typeof commitment.state?.consecutiveUnresolvedChecks === 'number') {
@@ -1016,8 +945,8 @@ const INVOCATION_SKIP_REASONS = {
1016
945
  state_watch_intact: 'watch intact',
1017
946
  // NAMES THE ENVELOPE, not "autonomy", because they are different fields.
1018
947
  //
1019
- // The server sets this code from `autonomyEnvelope.enabled !== true`
1020
- // (`WakeIntentResolver.js:35`, `CommitmentAutonomyService.js:12`). It was
948
+ // The server sets this code from `executionBudget.enabled !== true`
949
+ // (`WakeIntentResolver.js:35`, `CommitmentCadenceService.js:12`). It was
1021
950
  // rendered as "autonomy off", which a reader maps onto `policy.autonomyMode`
1022
951
  // — the field the CLI prints as `Autonomy:` and the one `commitments autonomy`
1023
952
  // sets. So a commitment sitting at `suggestions_only` reported "autonomy off",
@@ -148,7 +148,7 @@ function renderNorthstar(status, log) {
148
148
  id: commitment.id,
149
149
  title: String(commitment.title ?? ''),
150
150
  status: String(commitment.status ?? ''),
151
- health: String(commitment.state?.health ?? 'unknown'),
151
+ health: String(commitment.assessment?.label ?? 'Outcome unknown'),
152
152
  tier: String(commitment.priority?.tier ?? '—'),
153
153
  })), [
154
154
  { key: 'id', header: 'COMMITMENT' },
@@ -0,0 +1,98 @@
1
+ import type { InstalledRole, RolePlanPreview, RoleInstallation, AgentOperatingPlan } from '@skrr-ai/data-provider';
2
+ export declare const roleBase: (agentId: string) => string;
3
+ export declare const roleApi: {
4
+ list: (id: string) => Promise<{
5
+ roles: InstalledRole[];
6
+ canInstall: boolean;
7
+ skillInventory?: {
8
+ status: string;
9
+ skills: Array<{
10
+ id: string;
11
+ name: string;
12
+ versions: string[];
13
+ }>;
14
+ };
15
+ }>;
16
+ preview: (id: string, spec: unknown, contextBindings?: unknown) => Promise<RolePlanPreview>;
17
+ install: (id: string, preview: RolePlanPreview) => Promise<RoleInstallation>;
18
+ export: (id: string, key: string) => Promise<{
19
+ kind: "oversky.role-operating-spec";
20
+ schemaVersion: 1;
21
+ key: string;
22
+ revision: number;
23
+ title: string;
24
+ purpose: string;
25
+ scope: {
26
+ allow: string[];
27
+ deny: string[];
28
+ };
29
+ requiredCapabilities: string[];
30
+ skills: {
31
+ id: string;
32
+ version: string;
33
+ kind?: "skill" | "reader" | "evaluator" | undefined;
34
+ }[];
35
+ contextSlots: {
36
+ key: string;
37
+ label: string;
38
+ targetType: "space" | "task" | "project" | "goal";
39
+ }[];
40
+ communication: {
41
+ meaningfulChangesOnly: true;
42
+ interruptionLevel: "all" | "urgent" | "important";
43
+ };
44
+ responsibilities: {
45
+ key: string;
46
+ title: string;
47
+ kind: "achieve" | "maintain";
48
+ outcome: string;
49
+ successCriteria: {
50
+ id: string;
51
+ label: string;
52
+ evaluator?: "manual" | "metric" | "source_state" | "task_state" | "goal_state" | "llm_review" | undefined;
53
+ config?: Record<string, unknown> | undefined;
54
+ }[];
55
+ sources: {
56
+ source: "space" | "tasks" | "email" | "goal" | "files" | "local" | "daemon" | "browser" | "conversations" | "memory" | "slack" | "github" | "messages" | "metrics" | "monitor" | "agent_initiatives" | "docs" | "documents" | "calendar" | "product_metrics" | "business_metrics" | "state_monitor" | "agent_run";
57
+ enabled: boolean;
58
+ config?: Record<string, unknown> | undefined;
59
+ }[];
60
+ evidenceKeys: string[];
61
+ wake: {
62
+ mode: "manual" | "daily" | "interval" | "event_plus_interval";
63
+ timezone: string;
64
+ intervalMs?: number | undefined;
65
+ times?: string[] | undefined;
66
+ };
67
+ priority: "low" | "medium" | "high" | "critical";
68
+ budget: {
69
+ maxRunsPerDay: number;
70
+ maxCostUsdPerDay: number;
71
+ maxObservationRunsPerDay?: number | undefined;
72
+ maxConcurrentRuns?: number | undefined;
73
+ };
74
+ extensions: {
75
+ id: string;
76
+ version: string;
77
+ kind?: "skill" | "reader" | "evaluator" | undefined;
78
+ }[];
79
+ contexts: {
80
+ key: string;
81
+ roles: ("home" | "delivery" | "watch" | "advance")[];
82
+ }[];
83
+ directive?: string | undefined;
84
+ deadlineAt?: string | undefined;
85
+ freshness?: {
86
+ staleAfterMs?: number | undefined;
87
+ blockedAfterMs?: number | undefined;
88
+ noProgressAfterMs?: number | undefined;
89
+ } | undefined;
90
+ evaluationPolicy?: Record<string, unknown> | undefined;
91
+ learningPolicy?: Record<string, unknown> | undefined;
92
+ }[];
93
+ }>;
94
+ withdraw: (id: string, key: string, expectedCompassVersion: number) => Promise<RoleInstallation>;
95
+ plan: (id: string) => Promise<AgentOperatingPlan>;
96
+ };
97
+ export declare function readRoleJson(file: string): unknown;
98
+ export declare function assertRolePreview(value: unknown): asserts value is RolePlanPreview;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.roleApi = exports.roleBase = void 0;
4
+ exports.readRoleJson = readRoleJson;
5
+ exports.assertRolePreview = assertRolePreview;
6
+ const data_provider_1 = require("@skrr-ai/data-provider");
7
+ const node_fs_1 = require("node:fs");
8
+ const roleBase = (agentId) => `/api/agents/${encodeURIComponent(agentId)}`;
9
+ exports.roleBase = roleBase;
10
+ exports.roleApi = {
11
+ list: (id) => data_provider_1.request.get(`${(0, exports.roleBase)(id)}/roles`),
12
+ preview: (id, spec, contextBindings = {}) => data_provider_1.request.post(`${(0, exports.roleBase)(id)}/roles/preview`, {
13
+ spec,
14
+ contextBindings,
15
+ }),
16
+ install: (id, preview) => data_provider_1.request.post(`${(0, exports.roleBase)(id)}/roles/install`, {
17
+ spec: preview.spec,
18
+ fingerprint: preview.fingerprint,
19
+ reviewFingerprint: preview.reviewFingerprint,
20
+ expectedCompassVersion: preview.expectedCompassVersion,
21
+ expectedVersions: preview.expectedVersions,
22
+ contextBindings: preview.contextBindings || {},
23
+ }),
24
+ export: (id, key) => data_provider_1.request.get(`${(0, exports.roleBase)(id)}/roles/${encodeURIComponent(key)}/export`),
25
+ withdraw: (id, key, expectedCompassVersion) => data_provider_1.request.post(`${(0, exports.roleBase)(id)}/roles/${encodeURIComponent(key)}/withdraw`, {
26
+ expectedCompassVersion,
27
+ }),
28
+ plan: (id) => data_provider_1.request.get(`${(0, exports.roleBase)(id)}/operating-plan`),
29
+ };
30
+ function readRoleJson(file) {
31
+ return JSON.parse((0, node_fs_1.readFileSync)(file, 'utf8'));
32
+ }
33
+ function assertRolePreview(value) {
34
+ const v = value;
35
+ if (!v ||
36
+ typeof v.fingerprint !== 'string' ||
37
+ typeof v.reviewFingerprint !== 'string' ||
38
+ !v.agentId ||
39
+ !Number.isInteger(v.expectedCompassVersion) ||
40
+ !v.spec ||
41
+ !v.expectedVersions ||
42
+ !Array.isArray(v.changes)) {
43
+ throw new Error('A server-generated preview is required. Run agents roles preview with --output first.');
44
+ }
45
+ }
@@ -0,0 +1,45 @@
1
+ /** Mode-free responsibility context. Tool permissions belong to the Agent runtime. */
2
+ export declare const COMMITMENT_EXECUTION_CONTRACT_VERSION: 3;
3
+ export declare const COMMITMENT_EXECUTION_CONTRACT_CAPABILITY = "commitment_execution_contract_v3";
4
+ export interface CommitmentExecutionContract {
5
+ version: 3;
6
+ kind: 'commitment' | 'task_delivery';
7
+ responsibilityRef: {
8
+ kind: 'commitment' | 'task';
9
+ id: string;
10
+ version: number;
11
+ };
12
+ responsibility: string;
13
+ event: Record<string, unknown> | null;
14
+ workspace: {
15
+ kind: 'ephemeral';
16
+ base: string;
17
+ fetchBase?: true;
18
+ };
19
+ delivery: {
20
+ version: 1;
21
+ mode: 'report_only' | 'local_patch' | 'draft_pr' | 'push_branch' | 'direct_branch';
22
+ [key: string]: unknown;
23
+ };
24
+ capabilitySources: unknown[];
25
+ evidence?: {
26
+ version: 1;
27
+ ci: unknown[];
28
+ };
29
+ workspacePolicy: Record<string, unknown>;
30
+ deliverySource?: {
31
+ parentTaskId: string;
32
+ branch: string;
33
+ headSha: string;
34
+ baseCommit: string;
35
+ runtime: {
36
+ kind: 'local_daemon' | 'hosted_machine';
37
+ id: string;
38
+ };
39
+ };
40
+ mustNot: string[];
41
+ return: 'commitment_result_v1' | 'task_output';
42
+ }
43
+ export declare function eventRepository(event: Record<string, unknown> | null | undefined): string;
44
+ /** One strict parser used at storage admission and at runtime admission. */
45
+ export declare function normalizeCommitmentExecutionContract(value: unknown): CommitmentExecutionContract | null;