@skrr-ai/cli 0.1.95 → 0.1.96

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 (185) hide show
  1. package/README.md +22 -0
  2. package/dist/commands/agent/message/send.d.ts +2 -0
  3. package/dist/commands/agent/message/send.js +75 -5
  4. package/dist/commands/agents/chat.js +1 -1
  5. package/dist/commands/agents/create.d.ts +0 -3
  6. package/dist/commands/agents/create.js +0 -26
  7. package/dist/commands/agents/egress.d.ts +17 -0
  8. package/dist/commands/agents/egress.js +84 -0
  9. package/dist/commands/agents/mailbox/messages.d.ts +14 -0
  10. package/dist/commands/agents/mailbox/messages.js +52 -0
  11. package/dist/commands/agents/mailbox/show.d.ts +13 -0
  12. package/dist/commands/agents/mailbox/show.js +52 -0
  13. package/dist/commands/agents/operating-plan.js +8 -0
  14. package/dist/commands/agents/roles/capture.d.ts +16 -0
  15. package/dist/commands/agents/roles/capture.js +53 -0
  16. package/dist/commands/agents/roles/install.d.ts +1 -0
  17. package/dist/commands/agents/roles/install.js +8 -1
  18. package/dist/commands/agents/roles/preview.d.ts +2 -0
  19. package/dist/commands/agents/roles/preview.js +27 -3
  20. package/dist/commands/agents/update.d.ts +0 -3
  21. package/dist/commands/agents/update.js +1 -31
  22. package/dist/commands/agents/usage-cap.d.ts +4 -1
  23. package/dist/commands/agents/usage-cap.js +49 -10
  24. package/dist/commands/code/jobs/show.js +12 -0
  25. package/dist/commands/commitments/action-proposals/decide.d.ts +2 -0
  26. package/dist/commands/commitments/action-proposals/decide.js +12 -0
  27. package/dist/commands/commitments/action-proposals.js +7 -0
  28. package/dist/commands/commitments/create.d.ts +1 -0
  29. package/dist/commands/commitments/create.js +17 -1
  30. package/dist/commands/commitments/delivery.d.ts +1 -0
  31. package/dist/commands/commitments/delivery.js +11 -1
  32. package/dist/commands/commitments/doctor.js +4 -0
  33. package/dist/commands/commitments/effective-policy.js +26 -0
  34. package/dist/commands/commitments/endpoints/create.js +5 -2
  35. package/dist/commands/commitments/observations.d.ts +10 -0
  36. package/dist/commands/commitments/observations.js +88 -0
  37. package/dist/commands/commitments/pause.d.ts +1 -1
  38. package/dist/commands/commitments/pause.js +4 -3
  39. package/dist/commands/commitments/preflight.js +2 -1
  40. package/dist/commands/commitments/reports.d.ts +2 -0
  41. package/dist/commands/commitments/reports.js +22 -4
  42. package/dist/commands/commitments/update.d.ts +1 -0
  43. package/dist/commands/commitments/update.js +35 -5
  44. package/dist/commands/grants/create.d.ts +1 -0
  45. package/dist/commands/grants/create.js +8 -0
  46. package/dist/commands/grants/rotate.d.ts +5 -0
  47. package/dist/commands/grants/rotate.js +13 -1
  48. package/dist/commands/grants/update.d.ts +12 -0
  49. package/dist/commands/grants/update.js +27 -0
  50. package/dist/commands/machines/hosted/start.js +7 -1
  51. package/dist/commands/machines/list.js +4 -4
  52. package/dist/commands/measures/confirm.d.ts +1 -7
  53. package/dist/commands/measures/confirm.js +15 -14
  54. package/dist/commands/measures/list.d.ts +1 -7
  55. package/dist/commands/measures/list.js +1 -7
  56. package/dist/commands/measures/record.js +4 -4
  57. package/dist/commands/measures/show.d.ts +11 -0
  58. package/dist/commands/measures/show.js +26 -0
  59. package/dist/commands/northstars/governance/configure.d.ts +1 -0
  60. package/dist/commands/northstars/governance/configure.js +8 -1
  61. package/dist/commands/proposals/discard.d.ts +5 -0
  62. package/dist/commands/proposals/discard.js +8 -0
  63. package/dist/commands/proposals/keep.d.ts +5 -0
  64. package/dist/commands/proposals/keep.js +8 -0
  65. package/dist/commands/proposals/list.d.ts +15 -0
  66. package/dist/commands/proposals/list.js +74 -0
  67. package/dist/commands/proposals/show.d.ts +12 -0
  68. package/dist/commands/proposals/show.js +27 -0
  69. package/dist/commands/proposals/snooze.d.ts +5 -0
  70. package/dist/commands/proposals/snooze.js +8 -0
  71. package/dist/commands/signals/monitors/create.d.ts +9 -0
  72. package/dist/commands/signals/monitors/create.js +29 -0
  73. package/dist/commands/signals/monitors/list.d.ts +8 -0
  74. package/dist/commands/signals/monitors/list.js +16 -0
  75. package/dist/commands/signals/monitors/pause.d.ts +11 -0
  76. package/dist/commands/signals/monitors/pause.js +17 -0
  77. package/dist/commands/signals/monitors/resume.d.ts +11 -0
  78. package/dist/commands/signals/monitors/resume.js +17 -0
  79. package/dist/commands/signals/monitors/revise.d.ts +12 -0
  80. package/dist/commands/signals/monitors/revise.js +25 -0
  81. package/dist/commands/signals/monitors/show.d.ts +11 -0
  82. package/dist/commands/signals/monitors/show.js +17 -0
  83. package/dist/commands/signals/monitors/test.d.ts +12 -0
  84. package/dist/commands/signals/monitors/test.js +25 -0
  85. package/dist/commands/signals/monitors/transitions.d.ts +11 -0
  86. package/dist/commands/signals/monitors/transitions.js +17 -0
  87. package/dist/commands/signals/monitors/validate.d.ts +9 -0
  88. package/dist/commands/signals/monitors/validate.js +24 -0
  89. package/dist/commands/signals/schemas/list.d.ts +8 -0
  90. package/dist/commands/signals/schemas/list.js +16 -0
  91. package/dist/commands/signals/schemas/show.d.ts +11 -0
  92. package/dist/commands/signals/schemas/show.js +17 -0
  93. package/dist/commands/signals/sources/list.d.ts +8 -0
  94. package/dist/commands/signals/sources/list.js +16 -0
  95. package/dist/commands/signals/sources/receipts.d.ts +11 -0
  96. package/dist/commands/signals/sources/receipts.js +17 -0
  97. package/dist/commands/signals/sources/show.d.ts +11 -0
  98. package/dist/commands/signals/sources/show.js +17 -0
  99. package/dist/commands/spaces/usage.d.ts +12 -0
  100. package/dist/commands/spaces/usage.js +28 -0
  101. package/dist/commands/spaces/workflows/run.js +3 -0
  102. package/dist/commands/spaces/workflows/runs.js +2 -1
  103. package/dist/commands/spaces/workflows/update.d.ts +6 -1
  104. package/dist/commands/spaces/workflows/update.js +34 -2
  105. package/dist/commands/tasks/cascade-status.d.ts +2 -0
  106. package/dist/commands/tasks/cascade-status.js +27 -1
  107. package/dist/commands/tasks/create.d.ts +4 -0
  108. package/dist/commands/tasks/create.js +16 -0
  109. package/dist/commands/tasks/deliverable/add.js +12 -3
  110. package/dist/commands/tasks/economics-compare.d.ts +15 -0
  111. package/dist/commands/tasks/economics-compare.js +60 -0
  112. package/dist/commands/tasks/expectations/evaluate.d.ts +13 -0
  113. package/dist/commands/tasks/expectations/evaluate.js +43 -0
  114. package/dist/commands/tasks/list.d.ts +1 -0
  115. package/dist/commands/tasks/list.js +44 -1
  116. package/dist/commands/tasks/show.d.ts +5 -0
  117. package/dist/commands/tasks/show.js +17 -0
  118. package/dist/commands/tasks/update.d.ts +4 -0
  119. package/dist/commands/tasks/update.js +9 -0
  120. package/dist/commands/tasks/workflow-findings.js +2 -2
  121. package/dist/commands/triggers/create.d.ts +2 -0
  122. package/dist/commands/triggers/create.js +15 -0
  123. package/dist/commands/workspaces/grants.d.ts +12 -0
  124. package/dist/commands/workspaces/grants.js +31 -0
  125. package/dist/commands/workspaces/stewardship.d.ts +13 -0
  126. package/dist/commands/workspaces/stewardship.js +34 -0
  127. package/dist/lib/agent-config.d.ts +0 -12
  128. package/dist/lib/agent-config.js +1 -27
  129. package/dist/lib/agent-mailbox.d.ts +35 -0
  130. package/dist/lib/agent-mailbox.js +55 -0
  131. package/dist/lib/commitment-endpoints.d.ts +2 -1
  132. package/dist/lib/commitment-endpoints.js +2 -5
  133. package/dist/lib/commitment-product.d.ts +3 -1
  134. package/dist/lib/commitment-product.js +10 -0
  135. package/dist/lib/commitment-terms.js +1 -1
  136. package/dist/lib/commitments.d.ts +17 -7
  137. package/dist/lib/commitments.js +173 -85
  138. package/dist/lib/compasses.d.ts +14 -0
  139. package/dist/lib/compasses.js +25 -11
  140. package/dist/lib/grants.d.ts +5 -1
  141. package/dist/lib/grants.js +9 -1
  142. package/dist/lib/hosted-machines.d.ts +7 -0
  143. package/dist/lib/mailbox-human-command.d.ts +11 -0
  144. package/dist/lib/mailbox-human-command.js +41 -0
  145. package/dist/lib/measures.d.ts +28 -2
  146. package/dist/lib/measures.js +38 -14
  147. package/dist/lib/message-intent.d.ts +6 -2
  148. package/dist/lib/message-intent.js +1 -0
  149. package/dist/lib/northstars.js +2 -1
  150. package/dist/lib/proposal-decision-command.d.ts +19 -0
  151. package/dist/lib/proposal-decision-command.js +64 -0
  152. package/dist/lib/proposals.d.ts +8 -0
  153. package/dist/lib/proposals.js +22 -0
  154. package/dist/lib/roles.d.ts +141 -6
  155. package/dist/lib/roles.js +8 -2
  156. package/dist/lib/signals.d.ts +20 -0
  157. package/dist/lib/signals.js +24 -0
  158. package/dist/lib/space-usage.d.ts +3 -0
  159. package/dist/lib/space-usage.js +17 -0
  160. package/dist/lib/stewardship-output.d.ts +4 -0
  161. package/dist/lib/stewardship-output.js +82 -0
  162. package/dist/lib/task-asset-upload.d.ts +3 -1
  163. package/dist/lib/task-asset-upload.js +1 -0
  164. package/dist/lib/task-economics.d.ts +16 -0
  165. package/dist/lib/task-economics.js +22 -0
  166. package/dist/lib/triggers.d.ts +11 -3
  167. package/dist/lib/triggers.js +58 -1
  168. package/dist/lib/usage-discovery.d.ts +10 -0
  169. package/dist/lib/usage-discovery.js +24 -3
  170. package/dist/lib/workflow-run-budget.d.ts +12 -0
  171. package/dist/lib/workflow-run-budget.js +37 -0
  172. package/dist/lib/workspaces.d.ts +48 -0
  173. package/dist/lib/workspaces.js +8 -0
  174. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/cliHandoffWire.d.ts +4 -0
  175. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/cliHandoffWire.js +14 -1
  176. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/githubPushRefusal.d.ts +9 -0
  177. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/githubPushRefusal.js +49 -0
  178. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/cliHandoffWire.d.ts +4 -0
  179. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/cliHandoffWire.js +12 -0
  180. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/githubPushRefusal.d.ts +9 -0
  181. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/githubPushRefusal.js +44 -0
  182. package/dist/node_modules/@skrr-ai/auth-core/package.json +10 -0
  183. package/dist/node_modules/@skrr-ai/data-provider/index.js +8017 -7086
  184. package/oclif.manifest.json +3872 -1167
  185. package/package.json +22 -1
@@ -11,7 +11,11 @@ class RolesPreview extends base_command_1.BaseCommand {
11
11
  };
12
12
  static flags = {
13
13
  file: core_1.Flags.string({ required: true, description: 'Role operating spec JSON file' }),
14
- bindings: core_1.Flags.string({ description: 'JSON context slot → accessible target ID map' }),
14
+ params: core_1.Flags.string({ description: 'JSON file of typed parameter values' }),
15
+ endpoints: core_1.Flags.string({
16
+ description: 'JSON file of endpoint slot → owned endpoint ID bindings',
17
+ }),
18
+ bindings: core_1.Flags.string({ description: 'JSON file of context slot → accessible target ID bindings' }),
15
19
  output: core_1.Flags.string({ description: 'Save the server preview for review and installation' }),
16
20
  json: core_1.Flags.boolean({ description: 'Output the complete preview as JSON' }),
17
21
  };
@@ -19,7 +23,7 @@ class RolesPreview extends base_command_1.BaseCommand {
19
23
  this.requireAuth();
20
24
  const { args, flags } = await this.parse(RolesPreview);
21
25
  try {
22
- const result = await roles_1.roleApi.preview(args.id, (0, roles_1.readRoleJson)(flags.file), flags.bindings ? (0, roles_1.readRoleJson)(flags.bindings) : {});
26
+ const result = await roles_1.roleApi.preview(args.id, (0, roles_1.readRoleJson)(flags.file), flags.bindings ? (0, roles_1.readRoleJson)(flags.bindings) : {}, flags.params ? (0, roles_1.readRoleJson)(flags.params) : {}, flags.endpoints ? (0, roles_1.readRoleJson)(flags.endpoints) : {});
23
27
  if (flags.output)
24
28
  (0, node_fs_1.writeFileSync)(flags.output, `${JSON.stringify(result, null, 2)}\n`, { mode: 0o600 });
25
29
  if (flags.json) {
@@ -28,8 +32,28 @@ class RolesPreview extends base_command_1.BaseCommand {
28
32
  }
29
33
  this.log(`${result.spec.title} — revision ${result.spec.revision}`);
30
34
  this.log(`Compass ${result.compass.id}: archived; expected version ${result.expectedCompassVersion}`);
31
- for (const change of result.changes)
35
+ for (const change of result.changes) {
32
36
  this.log(` ${change.title}: ${change.change}`);
37
+ // Governance is ratified by installing this reviewed preview, so each
38
+ // owned leaf is shown with what it replaces and whether it loosens.
39
+ for (const field of change.governance || [])
40
+ this.log(` ${field.path}: ${field.change}${field.ownerModified ? '; owner modified' : ''} — ${JSON.stringify(field.current)} → ${JSON.stringify(field.next)}`);
41
+ }
42
+ for (const responsibility of (result.resolvedSpec || result.spec).responsibilities)
43
+ this.log(` directive ${responsibility.key}: ${responsibility.directive || '(none)'}`);
44
+ for (const endpoint of result.endpoints || [])
45
+ this.log(` endpoint ${endpoint.label}: ${endpoint.status}`);
46
+ // Enforced rules the role owns: anything the owner has touched is called out.
47
+ const ruleAdvice = (rule) => {
48
+ if (rule.change === 'conflicts_with_owner_edit')
49
+ return ` — you edited it and this revision changes it; install with --confirm-rule-conflict ${rule.id} to overwrite your edit`;
50
+ if (rule.change === 'removed_owner_edited')
51
+ return ` — you edited it and this revision removes it; install with --confirm-rule-conflict ${rule.id} to delete it`;
52
+ return '';
53
+ };
54
+ for (const rule of result.ruleChanges || [])
55
+ if (rule.change !== 'unchanged')
56
+ this.log(` rule ${rule.id}: ${rule.change}${rule.ownerStatus ? ` (owner status: ${rule.ownerStatus})` : ''}${ruleAdvice(rule)}`);
33
57
  for (const removed of result.removedResponsibilities)
34
58
  this.log(` ${removed.key}: pause removed responsibility`);
35
59
  for (const ctx of result.contexts)
@@ -45,9 +45,6 @@ export default class AgentsUpdate extends BaseCommand {
45
45
  avatar: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
46
46
  'conversation-starter': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
47
47
  'todo-working-hours': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
48
- 'reasoning-tool-escape': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
49
- 'commitment-responsibility': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
50
- 'commitment-responsibility-ceiling': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
51
48
  'max-turns': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
52
49
  'tool-resources': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
53
50
  'install-channel': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
@@ -116,32 +116,6 @@ class AgentsUpdate extends base_command_1.BaseCommand {
116
116
  description: 'When this agent schedules its own work: HH:MM-HH:MM[@<IANA timezone>], e.g. ' +
117
117
  '09:00-18:00@America/Los_Angeles',
118
118
  }),
119
- // Retired (OSK-11975): a Commitment turn works under the Agent's own
120
- // permissions. Hidden, warned on use, and never sent (OSK-12068) — see
121
- // `mergeAgentConfigFlags`. Kept parseable so an old script still runs.
122
- 'reasoning-tool-escape': core_1.Flags.string({
123
- description: "Retired — has no effect and is not sent. Commitment runs use the agent's own permissions.",
124
- options: [...agent_config_1.REASONING_TOOL_ESCAPES],
125
- multiple: true,
126
- deprecated: { message: (0, agent_config_1.retiredCommitmentPermissionFlagMessage)('reasoning-tool-escape') },
127
- hidden: true,
128
- }),
129
- 'commitment-responsibility': core_1.Flags.string({
130
- description: "Retired — has no effect and is not sent. Commitment runs use the agent's own permissions.",
131
- options: [...agent_config_1.COMMITMENT_RESPONSIBILITY_LEVELS],
132
- deprecated: {
133
- message: (0, agent_config_1.retiredCommitmentPermissionFlagMessage)('commitment-responsibility'),
134
- },
135
- hidden: true,
136
- }),
137
- 'commitment-responsibility-ceiling': core_1.Flags.string({
138
- description: "Retired — has no effect and is not sent. Commitment runs use the agent's own permissions.",
139
- options: [...agent_config_1.COMMITMENT_RESPONSIBILITY_LEVELS],
140
- deprecated: {
141
- message: (0, agent_config_1.retiredCommitmentPermissionFlagMessage)('commitment-responsibility-ceiling'),
142
- },
143
- hidden: true,
144
- }),
145
119
  'max-turns': core_1.Flags.integer({ description: 'Maximum turns in one agent run (1-500)' }),
146
120
  'tool-resources': core_1.Flags.string({
147
121
  description: 'Tool resources JSON object (file_search / context / image_edit bindings)',
@@ -210,11 +184,7 @@ class AgentsUpdate extends base_command_1.BaseCommand {
210
184
  this.error(err.message, { exit: 1 });
211
185
  }
212
186
  if (Object.keys(payload).length === 0) {
213
- const retired = agent_config_1.RETIRED_COMMITMENT_PERMISSION_FLAGS.filter((flag) => flags[flag] !== undefined);
214
- this.error(retired.length > 0
215
- ? `Nothing to update: ${retired.map((flag) => `--${flag}`).join(', ')} ` +
216
- `${retired.length === 1 ? 'is' : 'are'} retired and not sent. ${agent_config_1.COMMITMENT_PERMISSION_FLAG_RETIRED}`
217
- : 'Nothing to update. Pass at least one flag (e.g. --name) or --from-json.', { exit: 1 });
187
+ this.error('Nothing to update. Pass at least one flag (e.g. --name) or --from-json.', { exit: 1 });
218
188
  }
219
189
  let updated;
220
190
  try {
@@ -1,6 +1,6 @@
1
1
  import { BaseCommand } from '../../base-command';
2
2
  /**
3
- * YOUR monthly cap on ONE agent's hosted spend (C11), enforced where each of
3
+ * YOUR daily and/or monthly cap on ONE agent's hosted spend (C11), enforced where each of
4
4
  * your hosted Agent SDK runs of it starts. It counts and bounds only the runs
5
5
  * billed to you. For a Store agent, pass your installed copy's id — the cap is
6
6
  * on the agent that runs, not on the publisher's listing.
@@ -13,7 +13,10 @@ export default class AgentsUsageCap extends BaseCommand {
13
13
  };
14
14
  static flags: {
15
15
  set: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
16
+ daily: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
16
17
  clear: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
18
+ 'clear-daily': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
19
+ 'clear-monthly': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
17
20
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
18
21
  };
19
22
  run(): Promise<void>;
@@ -4,16 +4,18 @@ const core_1 = require("@oclif/core");
4
4
  const data_provider_1 = require("@skrr-ai/data-provider");
5
5
  const base_command_1 = require("../../base-command");
6
6
  /**
7
- * YOUR monthly cap on ONE agent's hosted spend (C11), enforced where each of
7
+ * YOUR daily and/or monthly cap on ONE agent's hosted spend (C11), enforced where each of
8
8
  * your hosted Agent SDK runs of it starts. It counts and bounds only the runs
9
9
  * billed to you. For a Store agent, pass your installed copy's id — the cap is
10
10
  * on the agent that runs, not on the publisher's listing.
11
11
  */
12
12
  class AgentsUsageCap extends base_command_1.BaseCommand {
13
- static description = 'Show, set or remove your monthly hosted-spend cap on an agent';
13
+ static description = 'Show, set or remove your daily or monthly hosted-spend cap on an agent';
14
14
  static examples = [
15
15
  '<%= config.bin %> agents usage-cap <agent-id>',
16
16
  '<%= config.bin %> agents usage-cap <agent-id> --set 20',
17
+ '<%= config.bin %> agents usage-cap <agent-id> --daily 2 --set 20',
18
+ '<%= config.bin %> agents usage-cap <agent-id> --clear-daily',
17
19
  '<%= config.bin %> agents usage-cap <agent-id> --clear --json',
18
20
  ];
19
21
  static args = {
@@ -26,9 +28,24 @@ class AgentsUsageCap extends base_command_1.BaseCommand {
26
28
  static flags = {
27
29
  set: core_1.Flags.string({
28
30
  description: 'Monthly cap in dollars of usage, e.g. 20 or 12.50',
29
- exclusive: ['clear'],
31
+ exclusive: ['clear', 'clear-monthly'],
32
+ }),
33
+ daily: core_1.Flags.string({
34
+ description: 'Daily hosted cap in dollars (UTC day)',
35
+ exclusive: ['clear', 'clear-daily'],
36
+ }),
37
+ clear: core_1.Flags.boolean({
38
+ description: 'Remove both caps',
39
+ exclusive: ['set', 'daily', 'clear-daily', 'clear-monthly'],
40
+ }),
41
+ 'clear-daily': core_1.Flags.boolean({
42
+ description: 'Remove only the daily cap (the monthly cap is kept)',
43
+ exclusive: ['clear', 'daily'],
44
+ }),
45
+ 'clear-monthly': core_1.Flags.boolean({
46
+ description: 'Remove only the monthly cap (the daily cap is kept)',
47
+ exclusive: ['clear', 'set'],
30
48
  }),
31
- clear: core_1.Flags.boolean({ description: 'Remove the cap', exclusive: ['set'] }),
32
49
  json: core_1.Flags.boolean({ description: 'Output as JSON' }),
33
50
  };
34
51
  async run() {
@@ -43,13 +60,30 @@ class AgentsUsageCap extends base_command_1.BaseCommand {
43
60
  });
44
61
  }
45
62
  }
63
+ let dailyMicros = null;
64
+ if (flags.daily !== undefined) {
65
+ dailyMicros = (0, data_provider_1.parseAgentUsageCapDollars)(flags.daily);
66
+ if (dailyMicros === null)
67
+ this.error('--daily takes a positive amount in dollars, like 20 or 12.50', { exit: 2 });
68
+ }
46
69
  let cap;
47
70
  try {
48
- cap = flags.clear
49
- ? await data_provider_1.dataService.clearAgentUsageCap(args.id)
50
- : micros !== null
51
- ? await data_provider_1.dataService.setAgentUsageCap(args.id, { monthlyLimitMicros: micros })
52
- : await data_provider_1.dataService.getAgentUsageCap(args.id);
71
+ const clearDaily = flags['clear-daily'] === true;
72
+ const clearMonthly = flags['clear-monthly'] === true;
73
+ // `null` removes one window on the server; a window not named is untouched.
74
+ const windows = {
75
+ ...(micros !== null ? { monthlyLimitMicros: micros } : {}),
76
+ ...(clearMonthly ? { monthlyLimitMicros: null } : {}),
77
+ ...(dailyMicros !== null ? { dailyLimitMicros: dailyMicros } : {}),
78
+ ...(clearDaily ? { dailyLimitMicros: null } : {}),
79
+ };
80
+ if (flags.clear)
81
+ cap = await data_provider_1.dataService.clearAgentUsageCap(args.id);
82
+ else if (Object.keys(windows).length) {
83
+ cap = await data_provider_1.dataService.setAgentUsageCap(args.id, windows);
84
+ }
85
+ else
86
+ cap = await data_provider_1.dataService.getAgentUsageCap(args.id);
53
87
  }
54
88
  catch (err) {
55
89
  this.handleApiError(err);
@@ -62,7 +96,10 @@ class AgentsUsageCap extends base_command_1.BaseCommand {
62
96
  }
63
97
  const resets = String(cap.periodEnd).slice(0, 10);
64
98
  if (cap.monthlyLimitMicros === null) {
65
- this.log(`Agent ${args.id}: no cap set · ${(0, data_provider_1.formatAgentUsageMicros)(cap.usedMicros)} used by you this month`);
99
+ // "No cap set" is only true when NEITHER window has one; a daily-only cap
100
+ // is a cap, and the line below it must not contradict this one.
101
+ const dailyCapSet = cap.daily?.limitMicros != null;
102
+ this.log(`Agent ${args.id}: ${dailyCapSet ? 'no monthly cap' : 'no cap set'} · ${(0, data_provider_1.formatAgentUsageMicros)(cap.usedMicros)} used by you this month`);
66
103
  }
67
104
  else {
68
105
  // Figures unclamped: usage past the cap is shown as it is. "Reached" is
@@ -70,6 +107,8 @@ class AgentsUsageCap extends base_command_1.BaseCommand {
70
107
  // left can already be too little to start a run.
71
108
  this.log(`Agent ${args.id}: ${(0, data_provider_1.formatAgentUsageMicros)(cap.usedMicros)} of ${(0, data_provider_1.formatAgentUsageMicros)(cap.monthlyLimitMicros)} used by you this month (resets ${resets})${cap.exhausted ? ' — cap reached, your new runs are refused' : ''}`);
72
109
  }
110
+ if (cap.daily)
111
+ this.log(`Today (UTC): ${(0, data_provider_1.formatAgentUsageMicros)(cap.daily.usedMicros)}${cap.daily.limitMicros === null ? ' · no daily cap' : ` of ${(0, data_provider_1.formatAgentUsageMicros)(cap.daily.limitMicros)}`}${cap.daily.exhausted ? ' — daily cap reached, your new runs are refused' : ''} (resets ${cap.daily.periodEnd})`);
73
112
  this.log(data_provider_1.AGENT_USAGE_CAP_EXPLANATION);
74
113
  }
75
114
  }
@@ -52,7 +52,19 @@ class CodeJobsShow extends base_command_1.BaseCommand {
52
52
  if (typeof task.costUsd === 'number')
53
53
  line('Cost:', `$${task.costUsd.toFixed(2)}`);
54
54
  line('PR:', task.prUrl);
55
+ line('Parent Task:', task.lineage?.taskId);
56
+ line('Task run:', task.lineage?.taskExecutionRunId);
57
+ line('Commitment:', task.lineage?.commitmentId);
58
+ line('Parent run:', task.lineage?.autonomousRunId);
55
59
  line('Preview:', task.previewUrl);
60
+ // Same sentence `machines hosted start` prints, from the snapshot the job
61
+ // started with, so a declared network is visible on the job it governed.
62
+ if (task.egressPolicy) {
63
+ line('Network:', `${task.egressPolicy} (${task.egressSource || 'source unknown'}; ${task.egressAllowHosts?.length || 0} hosts)`);
64
+ }
65
+ if (task.egressDroppedHosts?.length) {
66
+ line('Policy dropped:', task.egressDroppedHosts.join(', '));
67
+ }
56
68
  line('Created:', (0, format_1.localStamp)(task.createdAt));
57
69
  const error = task.error;
58
70
  if (error?.code || error?.message) {
@@ -8,6 +8,8 @@ export default class CommitmentsActionProposalsDecide extends BaseCommand {
8
8
  static flags: {
9
9
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
10
  decision: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ reason: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
+ 'reason-code': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
13
  };
12
14
  run(): Promise<void>;
13
15
  }
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
+ const data_provider_1 = require("@skrr-ai/data-provider");
4
5
  const base_command_1 = require("../../../base-command");
5
6
  const commitments_1 = require("../../../lib/commitments");
6
7
  class CommitmentsActionProposalsDecide extends base_command_1.BaseCommand {
@@ -16,6 +17,13 @@ class CommitmentsActionProposalsDecide extends base_command_1.BaseCommand {
16
17
  static flags = {
17
18
  json: core_1.Flags.boolean({ description: 'Output the decision and execution receipts as JSON' }),
18
19
  decision: core_1.Flags.string({ options: ['approve', 'reject'], required: true }),
20
+ reason: core_1.Flags.string({
21
+ description: 'Why this proposal was kept or discarded (up to 1000 characters)',
22
+ }),
23
+ 'reason-code': core_1.Flags.string({
24
+ options: [...data_provider_1.PROPOSAL_DISCARD_REASON_CODES],
25
+ description: 'Structured discard reason',
26
+ }),
19
27
  };
20
28
  async run() {
21
29
  this.requireAuth();
@@ -36,6 +44,10 @@ class CommitmentsActionProposalsDecide extends base_command_1.BaseCommand {
36
44
  const decided = await commitments_1.commitmentApi.decideActionProposal(args.commitmentId, args.proposalId, decision, {
37
45
  snapshotDigest: proposal.snapshotDigest,
38
46
  bundleVersion: proposal.bundleVersion,
47
+ ...(flags.reason ? { reason: flags.reason } : {}),
48
+ ...(flags['reason-code']
49
+ ? { reasonCode: flags['reason-code'] }
50
+ : {}),
39
51
  });
40
52
  const execution = decision === 'approve' && decided.status === 'approved'
41
53
  ? await commitments_1.commitmentApi.executeActionProposal(args.commitmentId, args.proposalId)
@@ -38,6 +38,13 @@ class CommitmentsActionProposals extends base_command_1.BaseCommand {
38
38
  this.log('No prepared Action Bundles.');
39
39
  return;
40
40
  }
41
+ this.log('Advisory captured overlaps only; an empty list does not prove resources are safe.');
42
+ for (const proposal of response.data) {
43
+ if (proposal.overlapCoverage?.status !== 'available')
44
+ this.log(`${proposal.id}: overlap evidence incomplete or unavailable.`);
45
+ for (const peer of proposal.overlaps || [])
46
+ this.log(`${proposal.id} overlaps ${peer.proposalId} (${peer.agentId}) ${peer.repoFullName}: ${peer.paths.join(', ')}`);
47
+ }
41
48
  (0, format_1.renderTable)(response.data.map((proposal) => ({
42
49
  id: proposal.id,
43
50
  actions: String(proposal.actionSnapshots?.length || 1),
@@ -66,6 +66,7 @@ export default class CommitmentsCreate extends BaseCommand {
66
66
  'cadence-mode': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
67
67
  timezone: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
68
68
  delivery: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
69
+ 'task-review-policy': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
69
70
  repo: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
70
71
  base: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
71
72
  isolation: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.hasEventCapableWatchedSource = hasEventCapableWatchedSource;
4
4
  exports.assertEventDrivenWatchedSource = assertEventDrivenWatchedSource;
5
5
  exports.createCadenceFromFlags = createCadenceFromFlags;
6
+ const data_provider_1 = require("@skrr-ai/data-provider");
6
7
  const core_1 = require("@oclif/core");
7
8
  const base_command_1 = require("../../base-command");
8
9
  const web_url_1 = require("../../lib/web-url");
@@ -248,6 +249,10 @@ class CommitmentsCreate extends base_command_1.BaseCommand {
248
249
  description: 'Requested delivery artifact or destination',
249
250
  options: [...commitment_product_1.COMMITMENT_DELIVERY_CHOICES],
250
251
  }),
252
+ 'task-review-policy': core_1.Flags.string({
253
+ options: [...data_provider_1.TASK_REVIEW_POLICIES],
254
+ description: 'Owner choice for generated Tasks. Required records a blocker; the owner and their Agent can still close.',
255
+ }),
251
256
  repo: core_1.Flags.string({ description: 'Delivery repository, owner/repo' }),
252
257
  base: core_1.Flags.string({ description: 'Delivery target branch' }),
253
258
  isolation: core_1.Flags.string({
@@ -354,9 +359,20 @@ class CommitmentsCreate extends base_command_1.BaseCommand {
354
359
  : {};
355
360
  const policy = { ...existingPolicy };
356
361
  if (flags.delivery)
357
- payload.delivery = (0, commitment_product_1.deliveryInput)(flags.delivery, flags);
362
+ payload.delivery = {
363
+ ...(record(payload.delivery) || {}),
364
+ ...(0, commitment_product_1.deliveryInput)(flags.delivery, flags),
365
+ };
358
366
  else if (flags.repo || flags.base)
359
367
  throw new Error('--repo and --base require --delivery.');
368
+ if (flags['task-review-policy'] !== undefined)
369
+ payload.delivery = {
370
+ ...(record(payload.delivery) || { version: 1, mode: 'report_only' }),
371
+ reviewPolicy: (0, commitment_product_1.normalizeTaskReviewPolicy)(flags['task-review-policy']),
372
+ };
373
+ const declaredDelivery = record(payload.delivery);
374
+ if (declaredDelivery?.reviewPolicy !== undefined)
375
+ (0, commitment_product_1.normalizeTaskReviewPolicy)(declaredDelivery.reviewPolicy);
360
376
  if (flags.isolation)
361
377
  policy.executionIsolation = flags.isolation;
362
378
  if (flags['max-nudges'] !== undefined)
@@ -8,6 +8,7 @@ export default class CommitmentsDelivery extends BaseCommand {
8
8
  };
9
9
  static flags: {
10
10
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
+ 'task-review-policy': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
12
  repo: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
13
  base: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
13
14
  reason: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const data_provider_1 = require("@skrr-ai/data-provider");
3
4
  const core_1 = require("@oclif/core");
4
5
  const base_command_1 = require("../../base-command");
5
6
  const commitments_1 = require("../../lib/commitments");
@@ -24,6 +25,10 @@ class CommitmentsDelivery extends base_command_1.BaseCommand {
24
25
  };
25
26
  static flags = {
26
27
  json: core_1.Flags.boolean({ description: 'Output the complete contract as JSON' }),
28
+ 'task-review-policy': core_1.Flags.string({
29
+ options: [...data_provider_1.TASK_REVIEW_POLICIES],
30
+ description: 'Owner choice for generated Tasks; omission preserves the current declaration.',
31
+ }),
27
32
  repo: core_1.Flags.string({ description: 'GitHub repository, owner/repo' }),
28
33
  base: core_1.Flags.string({ description: 'Delivery target branch, such as main' }),
29
34
  reason: core_1.Flags.string({ description: 'Reason recorded with this contract change' }),
@@ -33,7 +38,12 @@ class CommitmentsDelivery extends base_command_1.BaseCommand {
33
38
  const { args, flags } = await this.parse(CommitmentsDelivery);
34
39
  try {
35
40
  const current = (await commitments_1.commitmentApi.get(args.id)).commitment;
36
- const requested = (0, commitment_product_1.deliveryInput)(args.mode, flags);
41
+ const requested = (0, commitment_product_1.deliveryInput)(args.mode, {
42
+ ...flags,
43
+ ...(flags['task-review-policy'] !== undefined
44
+ ? { taskReviewPolicy: (0, commitment_product_1.normalizeTaskReviewPolicy)(flags['task-review-policy']) }
45
+ : {}),
46
+ });
37
47
  const delivery = { ...current.delivery, ...requested };
38
48
  const result = await commitments_1.commitmentApi.delivery(args.id, {
39
49
  delivery,
@@ -95,6 +95,10 @@ class CommitmentsDoctor extends base_command_1.BaseCommand {
95
95
  operatingState,
96
96
  observedAt: new Date().toISOString(),
97
97
  };
98
+ if (!flags.json && operatingState.knowledge) {
99
+ const knowledge = operatingState.knowledge;
100
+ this.log(`Space knowledge: ${knowledge.status || 'unavailable'}${knowledge.spaceId ? ` · ${knowledge.spaceId}` : ''}${knowledge.source ? ` (${knowledge.source})` : ''}; prospective scope, not a completed memory mount`);
101
+ }
98
102
  if (flags.json)
99
103
  this.log(JSON.stringify(report, null, 2));
100
104
  else {
@@ -11,6 +11,31 @@ const RUN_LIMIT_BINDING_LABELS = {
11
11
  workspace_admin: 'workspace limit',
12
12
  owner: 'owner limit',
13
13
  };
14
+ /** The admission day is UTC and said so; the shared Northstar pools are named apart. */
15
+ function budgetDayLines(policy) {
16
+ const day = policy.budgetDay;
17
+ const shared = policy.portfolio?.sharedBudget;
18
+ const lines = [];
19
+ if (day) {
20
+ lines.push(`Daily budgets reset at ${day.resetsAt ?? '00:00 UTC'}${day.localResetAt ? ` (${day.localResetAt} ${day.localTimeZone})` : ''}`);
21
+ }
22
+ if (shared?.status === 'unavailable') {
23
+ lines.push('Northstar shared run pools: unavailable (could not be read)');
24
+ }
25
+ else if (shared?.status === 'available') {
26
+ // `null` is "no ceiling" only when the server says the state is unset (or
27
+ // an older server says nothing). A stored value that is not a non-negative
28
+ // integer is refused at admission as unreadable; saying "no ceiling" for it
29
+ // would be the reassuring lie.
30
+ const pool = (value, state) => state === 'malformed'
31
+ ? 'malformed (enforced as unreadable)'
32
+ : value == null
33
+ ? 'no ceiling'
34
+ : `${value}/day`;
35
+ lines.push(`Northstar shared pools: action runs ${pool(shared.actionRunsPerDay, shared.actionRunsPerDayState)} · observation runs ${pool(shared.observationRunsPerDay, shared.observationRunsPerDayState)}`);
36
+ }
37
+ return lines;
38
+ }
14
39
  function effectivePolicyLines(policy) {
15
40
  const governance = policy.governance || {};
16
41
  const owner = policy.owner || {};
@@ -47,6 +72,7 @@ function effectivePolicyLines(policy) {
47
72
  }
48
73
  if (policy.observation?.sensing)
49
74
  lines.push("Sensing runs: the Agent's own permissions");
75
+ lines.push(...budgetDayLines(policy));
50
76
  return lines;
51
77
  }
52
78
  /** Show the policy actually governing a Commitment without changing it. */
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
+ const data_provider_1 = require("@skrr-ai/data-provider");
4
5
  const base_command_1 = require("../../../base-command");
5
6
  const commitment_endpoints_1 = require("../../../lib/commitment-endpoints");
6
7
  /**
@@ -19,13 +20,14 @@ class CommitmentsEndpointsCreate extends base_command_1.BaseCommand {
19
20
  static examples = [
20
21
  '<%= config.bin %> commitments endpoints create --agent agent_abc --label "Ops channel" --destination slack_channel --target C123 --capability push --capability reply',
21
22
  '<%= config.bin %> commitments endpoints create --agent agent_abc --label "My DM" --destination slack_owner_dm --capability push',
23
+ '<%= config.bin %> commitments endpoints create --agent agent_abc --label "My Discord" --destination discord_owner_dm --capability push',
22
24
  ];
23
25
  static flags = {
24
26
  json: core_1.Flags.boolean({ description: 'Output as JSON' }),
25
27
  agent: core_1.Flags.string({ description: 'Agent ID', required: true }),
26
28
  label: core_1.Flags.string({ description: 'Human-readable label', required: true }),
27
29
  destination: core_1.Flags.string({
28
- description: 'Implemented destination: slack_channel, slack_owner_dm, or app_owner_dm',
30
+ description: `Implemented destination: ${commitment_endpoints_1.COMMITMENT_ENDPOINT_DESTINATIONS.join(', ')}`,
29
31
  options: [...commitment_endpoints_1.COMMITMENT_ENDPOINT_DESTINATIONS],
30
32
  required: true,
31
33
  }),
@@ -45,7 +47,8 @@ class CommitmentsEndpointsCreate extends base_command_1.BaseCommand {
45
47
  endpoint = await commitment_endpoints_1.commitmentEndpointApi.create({
46
48
  agentId: flags.agent,
47
49
  label: flags.label,
48
- provider: flags.destination.startsWith('slack_') ? 'slack' : 'app',
50
+ provider: data_provider_1.COMMITMENT_DESTINATION_REGISTRY[flags.destination]
51
+ .transport,
49
52
  destination: flags.destination,
50
53
  capabilities: flags.capability,
51
54
  ...(flags.target ? { target: flags.target } : {}),
@@ -1,4 +1,10 @@
1
1
  import { BaseCommand } from '../../base-command';
2
+ /** Explicit ISO FROM/TO intervals avoid local-time or rolling-window ambiguity. */
3
+ export declare function parseObservationWindow(value: string): {
4
+ from: string;
5
+ to: string;
6
+ };
7
+ export declare function renderObservationWindow(response: Record<string, unknown>, log: (line: string) => void): void;
2
8
  /**
3
9
  * `skrr commitments observations <id>` — what this commitment's runs saw.
4
10
  *
@@ -22,6 +28,10 @@ export default class CommitmentsObservations extends BaseCommand {
22
28
  };
23
29
  static flags: {
24
30
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
31
+ latest: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
32
+ key: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
33
+ window: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
34
+ 'compare-to': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
25
35
  limit: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
26
36
  'declared-only': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
27
37
  'changed-only': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;