@skrr-ai/cli 0.1.95 → 0.1.97

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 (200) 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/daemon/install.js +1 -1
  45. package/dist/commands/grants/create.d.ts +1 -0
  46. package/dist/commands/grants/create.js +8 -0
  47. package/dist/commands/grants/rotate.d.ts +5 -0
  48. package/dist/commands/grants/rotate.js +13 -1
  49. package/dist/commands/grants/update.d.ts +12 -0
  50. package/dist/commands/grants/update.js +27 -0
  51. package/dist/commands/machines/hosted/start.js +7 -1
  52. package/dist/commands/machines/list.js +4 -4
  53. package/dist/commands/measures/confirm.d.ts +1 -7
  54. package/dist/commands/measures/confirm.js +15 -14
  55. package/dist/commands/measures/list.d.ts +1 -7
  56. package/dist/commands/measures/list.js +1 -7
  57. package/dist/commands/measures/record.js +4 -4
  58. package/dist/commands/measures/show.d.ts +11 -0
  59. package/dist/commands/measures/show.js +26 -0
  60. package/dist/commands/northstars/governance/configure.d.ts +1 -0
  61. package/dist/commands/northstars/governance/configure.js +8 -1
  62. package/dist/commands/proposals/discard.d.ts +5 -0
  63. package/dist/commands/proposals/discard.js +8 -0
  64. package/dist/commands/proposals/keep.d.ts +5 -0
  65. package/dist/commands/proposals/keep.js +8 -0
  66. package/dist/commands/proposals/list.d.ts +15 -0
  67. package/dist/commands/proposals/list.js +74 -0
  68. package/dist/commands/proposals/show.d.ts +12 -0
  69. package/dist/commands/proposals/show.js +27 -0
  70. package/dist/commands/proposals/snooze.d.ts +5 -0
  71. package/dist/commands/proposals/snooze.js +8 -0
  72. package/dist/commands/signals/monitors/create.d.ts +9 -0
  73. package/dist/commands/signals/monitors/create.js +29 -0
  74. package/dist/commands/signals/monitors/list.d.ts +8 -0
  75. package/dist/commands/signals/monitors/list.js +16 -0
  76. package/dist/commands/signals/monitors/pause.d.ts +11 -0
  77. package/dist/commands/signals/monitors/pause.js +17 -0
  78. package/dist/commands/signals/monitors/resume.d.ts +11 -0
  79. package/dist/commands/signals/monitors/resume.js +17 -0
  80. package/dist/commands/signals/monitors/revise.d.ts +12 -0
  81. package/dist/commands/signals/monitors/revise.js +25 -0
  82. package/dist/commands/signals/monitors/show.d.ts +11 -0
  83. package/dist/commands/signals/monitors/show.js +17 -0
  84. package/dist/commands/signals/monitors/test.d.ts +12 -0
  85. package/dist/commands/signals/monitors/test.js +25 -0
  86. package/dist/commands/signals/monitors/transitions.d.ts +11 -0
  87. package/dist/commands/signals/monitors/transitions.js +17 -0
  88. package/dist/commands/signals/monitors/validate.d.ts +9 -0
  89. package/dist/commands/signals/monitors/validate.js +24 -0
  90. package/dist/commands/signals/schemas/list.d.ts +8 -0
  91. package/dist/commands/signals/schemas/list.js +16 -0
  92. package/dist/commands/signals/schemas/show.d.ts +11 -0
  93. package/dist/commands/signals/schemas/show.js +17 -0
  94. package/dist/commands/signals/sources/list.d.ts +8 -0
  95. package/dist/commands/signals/sources/list.js +16 -0
  96. package/dist/commands/signals/sources/receipts.d.ts +11 -0
  97. package/dist/commands/signals/sources/receipts.js +17 -0
  98. package/dist/commands/signals/sources/show.d.ts +11 -0
  99. package/dist/commands/signals/sources/show.js +17 -0
  100. package/dist/commands/spaces/usage.d.ts +12 -0
  101. package/dist/commands/spaces/usage.js +28 -0
  102. package/dist/commands/spaces/workflows/run.js +3 -0
  103. package/dist/commands/spaces/workflows/runs.js +2 -1
  104. package/dist/commands/spaces/workflows/update.d.ts +6 -1
  105. package/dist/commands/spaces/workflows/update.js +34 -2
  106. package/dist/commands/tasks/cascade-status.d.ts +2 -0
  107. package/dist/commands/tasks/cascade-status.js +27 -1
  108. package/dist/commands/tasks/comments/add.js +29 -20
  109. package/dist/commands/tasks/complete.js +7 -4
  110. package/dist/commands/tasks/create.d.ts +4 -0
  111. package/dist/commands/tasks/create.js +16 -0
  112. package/dist/commands/tasks/deliverable/add.js +17 -7
  113. package/dist/commands/tasks/economics-compare.d.ts +15 -0
  114. package/dist/commands/tasks/economics-compare.js +60 -0
  115. package/dist/commands/tasks/events/append.js +6 -5
  116. package/dist/commands/tasks/expectations/assess.js +4 -4
  117. package/dist/commands/tasks/expectations/evaluate.d.ts +13 -0
  118. package/dist/commands/tasks/expectations/evaluate.js +43 -0
  119. package/dist/commands/tasks/list.d.ts +1 -0
  120. package/dist/commands/tasks/list.js +44 -1
  121. package/dist/commands/tasks/move.js +15 -11
  122. package/dist/commands/tasks/report.js +19 -11
  123. package/dist/commands/tasks/result/submit.js +5 -4
  124. package/dist/commands/tasks/resume/save.js +5 -4
  125. package/dist/commands/tasks/review.js +4 -4
  126. package/dist/commands/tasks/show.d.ts +5 -0
  127. package/dist/commands/tasks/show.js +17 -0
  128. package/dist/commands/tasks/update.d.ts +4 -0
  129. package/dist/commands/tasks/update.js +9 -0
  130. package/dist/commands/tasks/updates/add.js +5 -4
  131. package/dist/commands/tasks/workflow-findings.js +2 -2
  132. package/dist/commands/triggers/create.d.ts +2 -0
  133. package/dist/commands/triggers/create.js +15 -0
  134. package/dist/commands/workspaces/grants.d.ts +12 -0
  135. package/dist/commands/workspaces/grants.js +31 -0
  136. package/dist/commands/workspaces/stewardship.d.ts +13 -0
  137. package/dist/commands/workspaces/stewardship.js +34 -0
  138. package/dist/lib/agent-config.d.ts +0 -12
  139. package/dist/lib/agent-config.js +1 -27
  140. package/dist/lib/agent-mailbox.d.ts +35 -0
  141. package/dist/lib/agent-mailbox.js +55 -0
  142. package/dist/lib/commitment-endpoints.d.ts +2 -1
  143. package/dist/lib/commitment-endpoints.js +2 -5
  144. package/dist/lib/commitment-product.d.ts +3 -1
  145. package/dist/lib/commitment-product.js +10 -0
  146. package/dist/lib/commitment-terms.js +1 -1
  147. package/dist/lib/commitments.d.ts +17 -7
  148. package/dist/lib/commitments.js +173 -85
  149. package/dist/lib/compasses.d.ts +14 -0
  150. package/dist/lib/compasses.js +25 -11
  151. package/dist/lib/grants.d.ts +5 -1
  152. package/dist/lib/grants.js +9 -1
  153. package/dist/lib/hosted-machines.d.ts +7 -0
  154. package/dist/lib/mailbox-human-command.d.ts +11 -0
  155. package/dist/lib/mailbox-human-command.js +41 -0
  156. package/dist/lib/measures.d.ts +28 -2
  157. package/dist/lib/measures.js +38 -14
  158. package/dist/lib/message-intent.d.ts +6 -2
  159. package/dist/lib/message-intent.js +1 -0
  160. package/dist/lib/northstars.js +2 -1
  161. package/dist/lib/proposal-decision-command.d.ts +19 -0
  162. package/dist/lib/proposal-decision-command.js +64 -0
  163. package/dist/lib/proposals.d.ts +8 -0
  164. package/dist/lib/proposals.js +22 -0
  165. package/dist/lib/roles.d.ts +141 -6
  166. package/dist/lib/roles.js +8 -2
  167. package/dist/lib/session-task-write.d.ts +18 -0
  168. package/dist/lib/session-task-write.js +43 -0
  169. package/dist/lib/signals.d.ts +20 -0
  170. package/dist/lib/signals.js +24 -0
  171. package/dist/lib/space-usage.d.ts +3 -0
  172. package/dist/lib/space-usage.js +17 -0
  173. package/dist/lib/stewardship-output.d.ts +4 -0
  174. package/dist/lib/stewardship-output.js +82 -0
  175. package/dist/lib/task-asset-upload.d.ts +3 -1
  176. package/dist/lib/task-asset-upload.js +19 -22
  177. package/dist/lib/task-economics.d.ts +16 -0
  178. package/dist/lib/task-economics.js +22 -0
  179. package/dist/lib/triggers.d.ts +11 -3
  180. package/dist/lib/triggers.js +58 -1
  181. package/dist/lib/unsupported-managed-task-write.d.ts +2 -0
  182. package/dist/lib/unsupported-managed-task-write.js +12 -0
  183. package/dist/lib/usage-discovery.d.ts +10 -0
  184. package/dist/lib/usage-discovery.js +24 -3
  185. package/dist/lib/workflow-run-budget.d.ts +12 -0
  186. package/dist/lib/workflow-run-budget.js +37 -0
  187. package/dist/lib/workspaces.d.ts +48 -0
  188. package/dist/lib/workspaces.js +8 -0
  189. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/cliHandoffWire.d.ts +4 -0
  190. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/cliHandoffWire.js +14 -1
  191. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/githubPushRefusal.d.ts +9 -0
  192. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/githubPushRefusal.js +49 -0
  193. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/cliHandoffWire.d.ts +4 -0
  194. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/cliHandoffWire.js +12 -0
  195. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/githubPushRefusal.d.ts +9 -0
  196. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/githubPushRefusal.js +44 -0
  197. package/dist/node_modules/@skrr-ai/auth-core/package.json +10 -0
  198. package/dist/node_modules/@skrr-ai/data-provider/index.js +8017 -7086
  199. package/oclif.manifest.json +3872 -1167
  200. package/package.json +22 -1
@@ -0,0 +1,17 @@
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 signals_1 = require("../../../lib/signals");
6
+ class MonitorsTransitions extends base_command_1.BaseCommand {
7
+ static description = 'List the recorded state transitions of a Signal Monitor';
8
+ static flags = { json: core_1.Flags.boolean({ description: 'Output as JSON' }) };
9
+ static args = { id: core_1.Args.string({ required: true, ignoreStdin: true }) };
10
+ async run() {
11
+ this.requireAuth();
12
+ const { args } = await this.parse(MonitorsTransitions);
13
+ const result = await signals_1.signalsApi.monitorTransitions(args.id);
14
+ this.log(JSON.stringify(result, null, 2));
15
+ }
16
+ }
17
+ exports.default = MonitorsTransitions;
@@ -0,0 +1,9 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ export default class MonitorsValidate extends BaseCommand {
3
+ static description: string;
4
+ static flags: {
5
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
6
+ 'from-json': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
7
+ };
8
+ run(): Promise<void>;
9
+ }
@@ -0,0 +1,24 @@
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 signals_1 = require("../../../lib/signals");
6
+ const prompt_1 = require("../../../lib/prompt");
7
+ class MonitorsValidate extends base_command_1.BaseCommand {
8
+ static description = 'Compile-only check of a Monitor definition; nothing is persisted';
9
+ static flags = {
10
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
11
+ 'from-json': core_1.Flags.string({
12
+ description: 'JSON file path, or - for stdin (a Monitor definition document)',
13
+ required: true,
14
+ }),
15
+ };
16
+ async run() {
17
+ this.requireAuth();
18
+ const { flags } = await this.parse(MonitorsValidate);
19
+ const body = await (0, prompt_1.readJsonBody)(flags['from-json']);
20
+ const result = await signals_1.signalsApi.validateMonitor(body);
21
+ this.log(JSON.stringify(result, null, 2));
22
+ }
23
+ }
24
+ exports.default = MonitorsValidate;
@@ -0,0 +1,8 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ export default class SchemasList extends BaseCommand {
3
+ static description: string;
4
+ static flags: {
5
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
6
+ };
7
+ run(): Promise<void>;
8
+ }
@@ -0,0 +1,16 @@
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 signals_1 = require("../../../lib/signals");
6
+ class SchemasList extends base_command_1.BaseCommand {
7
+ static description = 'List Signal schemas (read-only)';
8
+ static flags = { json: core_1.Flags.boolean({ description: 'Output as JSON' }) };
9
+ async run() {
10
+ this.requireAuth();
11
+ await this.parse(SchemasList);
12
+ const result = await signals_1.signalsApi.listSchemas();
13
+ this.log(JSON.stringify(result, null, 2));
14
+ }
15
+ }
16
+ exports.default = SchemasList;
@@ -0,0 +1,11 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ export default class SchemasShow extends BaseCommand {
3
+ static description: string;
4
+ static flags: {
5
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
6
+ };
7
+ static args: {
8
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
9
+ };
10
+ run(): Promise<void>;
11
+ }
@@ -0,0 +1,17 @@
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 signals_1 = require("../../../lib/signals");
6
+ class SchemasShow extends base_command_1.BaseCommand {
7
+ static description = 'Show one Signal schema (read-only)';
8
+ static flags = { json: core_1.Flags.boolean({ description: 'Output as JSON' }) };
9
+ static args = { id: core_1.Args.string({ required: true, ignoreStdin: true }) };
10
+ async run() {
11
+ this.requireAuth();
12
+ const { args } = await this.parse(SchemasShow);
13
+ const result = await signals_1.signalsApi.showSchema(args.id);
14
+ this.log(JSON.stringify(result, null, 2));
15
+ }
16
+ }
17
+ exports.default = SchemasShow;
@@ -0,0 +1,8 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ export default class SourcesList extends BaseCommand {
3
+ static description: string;
4
+ static flags: {
5
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
6
+ };
7
+ run(): Promise<void>;
8
+ }
@@ -0,0 +1,16 @@
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 signals_1 = require("../../../lib/signals");
6
+ class SourcesList extends base_command_1.BaseCommand {
7
+ static description = 'List Signal sources (read-only; credentials are never shown)';
8
+ static flags = { json: core_1.Flags.boolean({ description: 'Output as JSON' }) };
9
+ async run() {
10
+ this.requireAuth();
11
+ await this.parse(SourcesList);
12
+ const result = await signals_1.signalsApi.listSources();
13
+ this.log(JSON.stringify(result, null, 2));
14
+ }
15
+ }
16
+ exports.default = SourcesList;
@@ -0,0 +1,11 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ export default class SourcesReceipts extends BaseCommand {
3
+ static description: string;
4
+ static flags: {
5
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
6
+ };
7
+ static args: {
8
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
9
+ };
10
+ run(): Promise<void>;
11
+ }
@@ -0,0 +1,17 @@
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 signals_1 = require("../../../lib/signals");
6
+ class SourcesReceipts extends base_command_1.BaseCommand {
7
+ static description = 'List recent redacted receipts of a Signal source';
8
+ static flags = { json: core_1.Flags.boolean({ description: 'Output as JSON' }) };
9
+ static args = { id: core_1.Args.string({ required: true, ignoreStdin: true }) };
10
+ async run() {
11
+ this.requireAuth();
12
+ const { args } = await this.parse(SourcesReceipts);
13
+ const result = await signals_1.signalsApi.sourceReceipts(args.id);
14
+ this.log(JSON.stringify(result, null, 2));
15
+ }
16
+ }
17
+ exports.default = SourcesReceipts;
@@ -0,0 +1,11 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ export default class SourcesShow extends BaseCommand {
3
+ static description: string;
4
+ static flags: {
5
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
6
+ };
7
+ static args: {
8
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
9
+ };
10
+ run(): Promise<void>;
11
+ }
@@ -0,0 +1,17 @@
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 signals_1 = require("../../../lib/signals");
6
+ class SourcesShow extends base_command_1.BaseCommand {
7
+ static description = 'Show one Signal source (read-only)';
8
+ static flags = { json: core_1.Flags.boolean({ description: 'Output as JSON' }) };
9
+ static args = { id: core_1.Args.string({ required: true, ignoreStdin: true }) };
10
+ async run() {
11
+ this.requireAuth();
12
+ const { args } = await this.parse(SourcesShow);
13
+ const result = await signals_1.signalsApi.showSource(args.id);
14
+ this.log(JSON.stringify(result, null, 2));
15
+ }
16
+ }
17
+ exports.default = SourcesShow;
@@ -0,0 +1,12 @@
1
+ import { BaseCommand } from '../../base-command';
2
+ export default class SpacesUsage 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
+ window: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ };
11
+ run(): Promise<void>;
12
+ }
@@ -0,0 +1,28 @@
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 space_usage_1 = require("../../lib/space-usage");
6
+ class SpacesUsage extends base_command_1.BaseCommand {
7
+ static description = 'Show attributed Space spend and coverage (requires Space owner permissions or workspace administrator)';
8
+ static args = {
9
+ id: core_1.Args.string({ description: 'Space ID', required: true, ignoreStdin: true }),
10
+ };
11
+ static flags = {
12
+ json: core_1.Flags.boolean(),
13
+ window: core_1.Flags.string({ options: ['1d', '7d', '30d', '90d'], default: '30d' }),
14
+ };
15
+ async run() {
16
+ this.requireAuth();
17
+ const { args, flags } = await this.parse(SpacesUsage);
18
+ const space = await this.resolveEntityRef('space', args.id);
19
+ try {
20
+ const result = await (0, space_usage_1.getSpaceUsage)(space, flags.window);
21
+ this.log(flags.json ? JSON.stringify(result, null, 2) : (0, space_usage_1.formatSpaceSpend)(result));
22
+ }
23
+ catch (error) {
24
+ this.handleApiError(error);
25
+ }
26
+ }
27
+ }
28
+ exports.default = SpacesUsage;
@@ -6,6 +6,7 @@ const data_provider_1 = require("@skrr-ai/data-provider");
6
6
  const base_command_1 = require("../../../base-command");
7
7
  const format_1 = require("../../../lib/format");
8
8
  const space_output_1 = require("../../../lib/space-output");
9
+ const workflow_run_budget_1 = require("../../../lib/workflow-run-budget");
9
10
  /**
10
11
  * A run node's human-facing attention note, or '' when nothing is wrong.
11
12
  *
@@ -59,6 +60,8 @@ class SpacesWorkflowsRun extends base_command_1.BaseCommand {
59
60
  }), null, 2));
60
61
  this.log(`Run: ${run.id}`);
61
62
  this.log(`Status: ${run.status}`);
63
+ for (const line of (0, workflow_run_budget_1.describeRunBudget)(run))
64
+ this.log(line);
62
65
  if (runUrl)
63
66
  this.log(`URL: ${runUrl}`);
64
67
  const nodes = (run.nodes || []);
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.WORKFLOW_RUNS_COLUMNS = void 0;
4
+ const workflow_run_budget_1 = require("../../../lib/workflow-run-budget");
4
5
  const core_1 = require("@oclif/core");
5
6
  const data_provider_1 = require("@skrr-ai/data-provider");
6
7
  const base_command_1 = require("../../../base-command");
@@ -75,7 +76,7 @@ class SpacesWorkflowsRuns extends base_command_1.BaseCommand {
75
76
  id: run.id,
76
77
  definition: run.definitionId,
77
78
  version: run.version === undefined ? '-' : `v${run.version}`,
78
- status: run.status,
79
+ status: (0, workflow_run_budget_1.runStatusLabel)(run),
79
80
  updated: String(run.updatedAt ?? '-'),
80
81
  })), exports.WORKFLOW_RUNS_COLUMNS, (line) => this.log(line));
81
82
  }
@@ -1,7 +1,9 @@
1
1
  import { type WorkflowDraft, type WorkflowGraph } from '@skrr-ai/data-provider';
2
2
  import { BaseCommand } from '../../../base-command';
3
3
  type WorkflowPatch = Record<string, unknown>;
4
- export declare function buildWorkflowUpdatePayload({ body, title, description, clearDescription, graph, draft, semanticRevision, presentationRevision, }: {
4
+ /** `90m`, `4h`, `2d` to milliseconds; null when malformed or outside the shared bounds. */
5
+ export declare function parseWorkflowDuration(text: string): number | null;
6
+ export declare function buildWorkflowUpdatePayload({ body, title, description, clearDescription, graph, draft, semanticRevision, presentationRevision, maxDurationMs, }: {
5
7
  body: WorkflowPatch;
6
8
  title?: string;
7
9
  description?: string;
@@ -10,6 +12,7 @@ export declare function buildWorkflowUpdatePayload({ body, title, description, c
10
12
  draft?: Omit<WorkflowDraft, 'semanticRevision' | 'presentationRevision'>;
11
13
  semanticRevision?: number;
12
14
  presentationRevision?: number;
15
+ maxDurationMs?: number | null;
13
16
  }): WorkflowPatch;
14
17
  /** Update metadata or the mutable draft; executable changes use optimistic concurrency. */
15
18
  export default class SpacesWorkflowsUpdate extends BaseCommand {
@@ -28,6 +31,8 @@ export default class SpacesWorkflowsUpdate extends BaseCommand {
28
31
  graph: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
29
32
  draft: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
30
33
  'semantic-revision': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
34
+ 'max-duration': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
35
+ 'clear-max-duration': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
31
36
  'presentation-revision': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
32
37
  };
33
38
  run(): Promise<void>;
@@ -1,12 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseWorkflowDuration = parseWorkflowDuration;
3
4
  exports.buildWorkflowUpdatePayload = buildWorkflowUpdatePayload;
4
5
  const core_1 = require("@oclif/core");
5
6
  const data_provider_1 = require("@skrr-ai/data-provider");
6
7
  const base_command_1 = require("../../../base-command");
7
8
  const prompt_1 = require("../../../lib/prompt");
8
9
  const space_output_1 = require("../../../lib/space-output");
9
- function buildWorkflowUpdatePayload({ body, title, description, clearDescription, graph, draft, semanticRevision, presentationRevision, }) {
10
+ /** `90m`, `4h`, `2d` to milliseconds; null when malformed or outside the shared bounds. */
11
+ function parseWorkflowDuration(text) {
12
+ const match = /^(\d+)\s*([mhd])$/i.exec(text.trim());
13
+ if (!match)
14
+ return null;
15
+ const unit = { m: 60_000, h: 3_600_000, d: 86_400_000 }[match[2].toLowerCase()];
16
+ const ms = Number(match[1]) * unit;
17
+ return (0, data_provider_1.isValidWorkflowMaxDurationMs)(ms) ? ms : null;
18
+ }
19
+ function buildWorkflowUpdatePayload({ body, title, description, clearDescription, graph, draft, semanticRevision, presentationRevision, maxDurationMs, }) {
10
20
  return (0, prompt_1.mergeDefined)(body, {
11
21
  title,
12
22
  description: clearDescription ? null : description,
@@ -14,6 +24,7 @@ function buildWorkflowUpdatePayload({ body, title, description, clearDescription
14
24
  draft,
15
25
  expectedSemanticRevision: semanticRevision,
16
26
  expectedPresentationRevision: presentationRevision,
27
+ maxDurationMs,
17
28
  });
18
29
  }
19
30
  /** Update metadata or the mutable draft; executable changes use optimistic concurrency. */
@@ -23,6 +34,8 @@ class SpacesWorkflowsUpdate extends base_command_1.BaseCommand {
23
34
  '<%= config.bin %> spaces workflows update <space-id> <workflow-id> --title "Release train"',
24
35
  '<%= config.bin %> spaces workflows update <space-id> <workflow-id> --graph workflow.json',
25
36
  '<%= config.bin %> spaces workflows update <space-id> <workflow-id> --draft canvas-draft.json --json',
37
+ '<%= config.bin %> spaces workflows update <space-id> <workflow-id> --max-duration 4h',
38
+ '<%= config.bin %> spaces workflows update <space-id> <workflow-id> --clear-max-duration',
26
39
  ];
27
40
  static args = {
28
41
  spaceId: core_1.Args.string({ description: 'Owning Space ID', required: true, ignoreStdin: true }),
@@ -45,6 +58,10 @@ class SpacesWorkflowsUpdate extends base_command_1.BaseCommand {
45
58
  'semantic-revision': core_1.Flags.integer({
46
59
  description: 'Expected semantic revision; defaults to the latest server value',
47
60
  }),
61
+ 'max-duration': core_1.Flags.string({
62
+ description: 'Run duration limit, e.g. 90m, 4h or 2d. A run still open past it is cancelled with WORKFLOW_RUN_DEADLINE. Applies from the next publish; runs already started keep their deadline',
63
+ }),
64
+ 'clear-max-duration': core_1.Flags.boolean({ description: 'Remove the run duration limit' }),
48
65
  'presentation-revision': core_1.Flags.integer({
49
66
  description: 'Expected presentation revision; defaults to the latest server value',
50
67
  }),
@@ -57,6 +74,20 @@ class SpacesWorkflowsUpdate extends base_command_1.BaseCommand {
57
74
  if (flags.description !== undefined && flags['clear-description']) {
58
75
  this.error('Pass either --description or --clear-description, not both.', { exit: 2 });
59
76
  }
77
+ if (flags['max-duration'] !== undefined && flags['clear-max-duration']) {
78
+ this.error('Pass either --max-duration or --clear-max-duration, not both.', { exit: 2 });
79
+ }
80
+ let maxDurationMs;
81
+ if (flags['clear-max-duration'])
82
+ maxDurationMs = null;
83
+ else if (flags['max-duration'] !== undefined) {
84
+ const parsedDuration = parseWorkflowDuration(flags['max-duration']);
85
+ if (parsedDuration === null) {
86
+ this.error(`--max-duration must look like 90m, 4h or 2d, between ${(0, data_provider_1.describeWorkflowDuration)(data_provider_1.WORKFLOW_MAX_DURATION_MIN_MS)} and ${(0, data_provider_1.describeWorkflowDuration)(data_provider_1.WORKFLOW_MAX_DURATION_MAX_MS)}.`, { exit: 2 });
87
+ return;
88
+ }
89
+ maxDurationMs = parsedDuration;
90
+ }
60
91
  if ((flags['semantic-revision'] === undefined) !==
61
92
  (flags['presentation-revision'] === undefined)) {
62
93
  this.error('Pass both --semantic-revision and --presentation-revision together.', {
@@ -86,9 +117,10 @@ class SpacesWorkflowsUpdate extends base_command_1.BaseCommand {
86
117
  draft,
87
118
  semanticRevision: flags['semantic-revision'],
88
119
  presentationRevision: flags['presentation-revision'],
120
+ maxDurationMs,
89
121
  });
90
122
  if (Object.keys(patch).length === 0) {
91
- this.error('Nothing to update. Pass metadata, --graph, --draft, or --from-json.', {
123
+ this.error('Nothing to update. Pass metadata, --max-duration, --graph, --draft, or --from-json.', {
92
124
  exit: 2,
93
125
  });
94
126
  }
@@ -1,4 +1,6 @@
1
1
  import { BaseCommand } from '../../base-command';
2
+ /** Skip counts, the stall reason and per-task join reasons, as printed lines. */
3
+ export declare function cascadeSkipLines(s: Record<string, unknown>): string[];
2
4
  export default class TasksCascadeStatus extends BaseCommand {
3
5
  static description: string;
4
6
  static examples: string[];
@@ -1,8 +1,33 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.cascadeSkipLines = cascadeSkipLines;
3
4
  const core_1 = require("@oclif/core");
4
5
  const data_provider_1 = require("@skrr-ai/data-provider");
5
6
  const base_command_1 = require("../../base-command");
7
+ /** Skip counts, the stall reason and per-task join reasons, as printed lines. */
8
+ function cascadeSkipLines(s) {
9
+ const lines = [
10
+ `Skipped: ${s.skipped ?? 0}`,
11
+ `Skipped duplicate: ${s.skippedDuplicate ?? 0}`,
12
+ `Waiting for Human: ${s.humanBlocked ?? s.humanWaitingCount ?? s.waitingForHuman ?? '-'}`,
13
+ ];
14
+ if (s.stalledReason)
15
+ lines.push(`Waiting reason: ${s.stalledReason}`);
16
+ if (s.stalledReason === 'waiting_on_timed_out_human')
17
+ lines.push(" a person's task timed out and was never completed; the cascade stopped");
18
+ if (Number(s.unresolvedHumanCount) > 0)
19
+ lines.push(`Unresolved human: ${s.unresolvedHumanCount} (finished without a person completing these tasks)`);
20
+ const tasks = (Array.isArray(s.tasks) ? s.tasks : []);
21
+ for (const task of tasks) {
22
+ if (task.abortUnconfirmed)
23
+ lines.push(`${task.identifier || task.taskId}: cancelled; the task may still be running - check it`);
24
+ else if (task.cancelUnconfirmed)
25
+ lines.push(`${task.identifier || task.taskId}: cancelled (not confirmed in the run record; the stored row may still read otherwise)`);
26
+ else if (task.reason || task.joinNote)
27
+ lines.push(`${task.identifier || task.taskId}: ${task.reason || task.joinNote}`);
28
+ }
29
+ return lines;
30
+ }
6
31
  class TasksCascadeStatus extends base_command_1.BaseCommand {
7
32
  static description = 'Show cascade pipeline status for a task';
8
33
  static examples = [
@@ -36,7 +61,8 @@ class TasksCascadeStatus extends base_command_1.BaseCommand {
36
61
  this.log(`Total Tasks: ${s.totalTasks ?? s.total ?? '-'}`);
37
62
  this.log(`Completed: ${s.completedTasks ?? s.completed ?? '-'}`);
38
63
  this.log(`Failed: ${s.failedTasks ?? s.failed ?? '-'}`);
39
- this.log(`Waiting for Human: ${s.humanWaitingCount ?? s.waitingForHuman ?? '-'}`);
64
+ for (const line of cascadeSkipLines(s))
65
+ this.log(line);
40
66
  }
41
67
  }
42
68
  exports.default = TasksCascadeStatus;
@@ -38,7 +38,9 @@ const core_1 = require("@oclif/core");
38
38
  const base_command_1 = require("../../../base-command");
39
39
  const outbox_1 = require("../../../lib/outbox");
40
40
  const api_fetch_1 = require("../../../lib/api-fetch");
41
- const session_task_endpoints_1 = require("../../../lib/session-task-endpoints");
41
+ const credential_resolver_1 = require("../../../lib/credential-resolver");
42
+ const unsupported_managed_task_write_1 = require("../../../lib/unsupported-managed-task-write");
43
+ const session_task_write_1 = require("../../../lib/session-task-write");
42
44
  const prompt_1 = require("../../../lib/prompt");
43
45
  const task_resolver_1 = require("../../../lib/task-resolver");
44
46
  // Server-side validator on `commentMarkId` (api/server/routes/tasks.js).
@@ -142,6 +144,18 @@ class TasksCommentsAdd extends base_command_1.BaseCommand {
142
144
  // pre-formed `anchor` object and have CLI flags override individual
143
145
  // fields (e.g. only --anchor-quote, keeping the JSON's commentMarkId).
144
146
  const anchor = this.buildAnchor(flags, commentBody);
147
+ if (anchor || flags['parent-comment'] || commentBody.parentCommentId ||
148
+ flags.reopen || commentBody.reopen || flags.interrupt || commentBody.interrupt) {
149
+ // These fields are absent from the scoped comment contract. Refuse
150
+ // before uploads, rather than posting a different comment than asked.
151
+ try {
152
+ (0, unsupported_managed_task_write_1.refuseUnsupportedManagedTaskWrite)('Replies, anchors and comment workflow changes');
153
+ }
154
+ catch (error) {
155
+ this.handleApiError(error);
156
+ return;
157
+ }
158
+ }
145
159
  // Merge the full JSON body with typed flags so --from-json fields like
146
160
  // mentionedAgentIds, reopen, and interrupt are preserved. Boolean flags
147
161
  // default to false; only pass them through when actually set so they
@@ -207,30 +221,18 @@ class TasksCommentsAdd extends base_command_1.BaseCommand {
207
221
  // apiFetch rather than `dataService.addTaskComment`: the shared transport
208
222
  // accepts no per-call headers, so it cannot carry the key.
209
223
  //
210
- // WL-5 Step 1/2 — a session on a NARROWED credential cannot use
211
- // `/api/tasks/:taskId/comments`, whose chain begins with `requireJwtAuth`.
212
- // The session-scoped sibling derives the task from the claim, so it takes
213
- // no taskId, and it is deliberately narrower: `body` and
224
+ // Retain the authenticated Agent even beside a wide delegated credential.
225
+ // The scoped sibling derives its Task and supports `body` and
214
226
  // `mentionedAgentIds` only. `reopen`/`interrupt` are workflow mutations
215
227
  // and are not reachable through the commenting door on that path.
216
- const sessionPath = await (0, session_task_endpoints_1.sessionScopedTaskPath)('comment');
217
- if (sessionPath && (flags.reopen || flags.interrupt)) {
218
- // Say so rather than dropping it. A flag the user passed that silently
219
- // does nothing is worse than a refusal — they would read the 201 as
220
- // "the task reopened" and only find out much later that it did not.
221
- this.warn('This session uses a scoped credential, where --reopen/--interrupt are not available: ' +
222
- 'they are workflow changes, not comments. The comment was posted; the task was not ' +
223
- 'reopened or interrupted.');
224
- }
225
- const mentioned = Array.isArray(mentionedFromFlag) && mentionedFromFlag.length > 0
226
- ? mentionedFromFlag
227
- : undefined;
228
- result = sessionPath
229
- ? await (0, api_fetch_1.apiFetch)(sessionPath, {
228
+ const sessionWrite = await (0, session_task_write_1.sessionTaskWrite)('comment', taskRef);
229
+ result = sessionWrite
230
+ ? await (0, api_fetch_1.apiFetch)(sessionWrite.path, {
230
231
  method: 'POST',
232
+ credential: sessionWrite.credential,
231
233
  body: {
232
234
  body: data.body,
233
- ...(mentioned ? { mentionedAgentIds: mentioned } : {}),
235
+ ...(data.mentionedAgentIds ? { mentionedAgentIds: data.mentionedAgentIds } : {}),
234
236
  },
235
237
  headers: { 'X-Idempotency-Key': idempotencyKey },
236
238
  })
@@ -241,6 +243,13 @@ class TasksCommentsAdd extends base_command_1.BaseCommand {
241
243
  });
242
244
  }
243
245
  catch (err) {
246
+ // Offline replay cannot preserve this live session actor. Never queue
247
+ // an Agent write as an ordinary Human comment. Retry the exact key
248
+ // while this authenticated session remains valid.
249
+ if ((0, credential_resolver_1.resolveTrustedAutonomousCredential)()) {
250
+ this.handleApiError(err);
251
+ return;
252
+ }
244
253
  // A comment body is authored content: losing it to a 503 costs the
245
254
  // writing, not just a retry. Queue it durably instead (OSK-2806). The
246
255
  // key is derived from the task + body so replaying the SAME comment
@@ -40,7 +40,7 @@ const task_closure_1 = require("../../lib/task-closure");
40
40
  const api_fetch_1 = require("../../lib/api-fetch");
41
41
  const outbox_1 = require("../../lib/outbox");
42
42
  const prompt_1 = require("../../lib/prompt");
43
- const session_task_endpoints_1 = require("../../lib/session-task-endpoints");
43
+ const session_task_write_1 = require("../../lib/session-task-write");
44
44
  const task_resolver_1 = require("../../lib/task-resolver");
45
45
  const task_extras_1 = require("../../lib/task-extras");
46
46
  const web_url_1 = require("../../lib/web-url");
@@ -290,9 +290,11 @@ class TasksComplete extends base_command_1.BaseCommand {
290
290
  };
291
291
  const idempotencyKey = optionalString(input.idempotencyKey) ||
292
292
  (0, outbox_1.idempotencyKeyFor)('task-complete', identity.id, JSON.stringify(payload));
293
- const sessionPath = await (0, session_task_endpoints_1.sessionScopedTaskPath)('completion');
293
+ const sessionWrite = await (0, session_task_write_1.sessionTaskWrite)('completion', identity.id);
294
294
  let taskId = identity.id;
295
- if (!sessionPath) {
295
+ if (sessionWrite)
296
+ taskId = sessionWrite.taskId;
297
+ else {
296
298
  try {
297
299
  const resolved = await this.resolveTaskReference(identity.id);
298
300
  taskId = String(resolved);
@@ -303,8 +305,9 @@ class TasksComplete extends base_command_1.BaseCommand {
303
305
  }
304
306
  let result;
305
307
  try {
306
- result = await (0, api_fetch_1.apiFetch)(sessionPath || (0, task_extras_1.taskCompletePath)(taskId), {
308
+ result = await (0, api_fetch_1.apiFetch)(sessionWrite?.path || (0, task_extras_1.taskCompletePath)(taskId), {
307
309
  method: 'POST',
310
+ credential: sessionWrite?.credential,
308
311
  body: { ...payload, idempotencyKey },
309
312
  headers: { 'X-Idempotency-Key': idempotencyKey },
310
313
  });
@@ -67,6 +67,10 @@ export default class TasksCreate extends BaseCommand {
67
67
  'execution-mode': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
68
68
  'start-date': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
69
69
  'due-date': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
70
+ savings: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
71
+ per: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
72
+ effort: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
73
+ risk: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
70
74
  estimate: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
71
75
  tag: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
72
76
  'label-id': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
@@ -5,6 +5,7 @@ exports.droppedEstimateWarning = droppedEstimateWarning;
5
5
  exports.taskCreateMayHaveCommitted = taskCreateMayHaveCommitted;
6
6
  exports.taskMatchesCreateIdentity = taskMatchesCreateIdentity;
7
7
  const core_1 = require("@oclif/core");
8
+ const task_economics_1 = require("../../lib/task-economics");
8
9
  const data_provider_1 = require("@skrr-ai/data-provider");
9
10
  const base_command_1 = require("../../base-command");
10
11
  const label_ref_1 = require("../../lib/label-ref");
@@ -223,6 +224,13 @@ class TasksCreate extends base_command_1.BaseCommand {
223
224
  }),
224
225
  'start-date': core_1.Flags.string({ description: 'Planned start date (ISO string)' }),
225
226
  'due-date': core_1.Flags.string({ description: 'Due date (ISO string)' }),
227
+ savings: core_1.Flags.string({ description: 'Expected USD savings (requires --per)' }),
228
+ per: core_1.Flags.string({
229
+ options: ['month', 'year', 'once'],
230
+ description: 'Savings period (requires --savings)',
231
+ }),
232
+ effort: core_1.Flags.string({ description: 'Expected effort in hours, nonnegative' }),
233
+ risk: core_1.Flags.string({ options: ['low', 'medium', 'high'], description: 'Expected risk' }),
226
234
  estimate: core_1.Flags.integer({
227
235
  // Names the prerequisite AND how to satisfy it. The first version of this
228
236
  // help said the scale was reachable only from the web UI, which was true
@@ -320,6 +328,14 @@ class TasksCreate extends base_command_1.BaseCommand {
320
328
  ? parsedExpectations.value
321
329
  : undefined,
322
330
  });
331
+ try {
332
+ const economics = (0, task_economics_1.economicsFromFlags)(flags, body.economics);
333
+ if (economics)
334
+ payload.economics = economics;
335
+ }
336
+ catch (error) {
337
+ this.error(error instanceof Error ? error.message : 'Invalid economics', { exit: 2 });
338
+ }
323
339
  const isTemplateInstantiation = typeof payload.templateId === 'string' && payload.templateId.length > 0;
324
340
  // Template defaults (including its assigned agents) are part of the saved
325
341
  // resource. Do not let the ordinary "who owns an empty task?" policy