@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
@@ -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;
@@ -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
@@ -269,12 +269,21 @@ class TasksDeliverableAdd extends base_command_1.BaseCommand {
269
269
  this.handleApiError(err);
270
270
  return false;
271
271
  }
272
+ const { resourceReceipt, ...archived } = asset;
273
+ if (!resourceReceipt?.link.id) {
274
+ this.warn('The file was archived, but this server did not return its Deliverable link. ' +
275
+ `Run skrr tasks deliverable list ${opts.taskId} --json to find the exact version before submitting a Result.`);
276
+ }
272
277
  if (opts.json) {
273
- this.log(JSON.stringify({ archived: asset, identity: opts.identity }, null, 2));
278
+ this.log(JSON.stringify({ ...resourceReceipt, archived, identity: opts.identity }, null, 2));
274
279
  return true;
275
280
  }
276
- this.log(`Recorded Deliverable ${opts.identity} — archived copy ${asset.id} ` +
277
- `(sha256 pinned; observed available; self reported).`);
281
+ const recorded = resourceReceipt?.link.id
282
+ ? `Recorded Deliverable ${resourceReceipt.link.id}: ${opts.identity}`
283
+ : `Archived ${opts.identity}`;
284
+ const version = resourceReceipt?.version.id ? `version ${resourceReceipt.version.id}; ` : '';
285
+ this.log(`${recorded} — archived copy ${asset.id} ` +
286
+ `(${version}sha256 pinned; observed available; self reported).`);
278
287
  if (opts.requestedStatus && opts.requestedStatus !== 'available') {
279
288
  // Not silent: the platform WATCHED these bytes land, which is a stronger
280
289
  // and verified statement than the one that was asked for. Who vouched
@@ -0,0 +1,15 @@
1
+ import { BaseCommand } from '../../base-command';
2
+ export default class TasksEconomicsCompare extends BaseCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static args: {
6
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
7
+ };
8
+ static flags: {
9
+ measure: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ fire: import("@oclif/core/lib/interfaces").OptionFlag<string[], import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ revision: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
12
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
13
+ };
14
+ run(): Promise<void>;
15
+ }
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const data_provider_1 = require("@skrr-ai/data-provider");
5
+ const base_command_1 = require("../../base-command");
6
+ class TasksEconomicsCompare extends base_command_1.BaseCommand {
7
+ static description = 'Show a Task economics estimate beside retained platform readings (no measurement binding is created)';
8
+ static examples = [
9
+ '<%= config.bin %> tasks economics-compare <task-id> --measure <id> --fire <fire-id> --revision 3',
10
+ ];
11
+ static args = {
12
+ id: core_1.Args.string({ description: 'Task ID', required: true, ignoreStdin: true }),
13
+ };
14
+ static flags = {
15
+ measure: core_1.Flags.string({ description: 'Measure ID', required: true }),
16
+ fire: core_1.Flags.string({
17
+ description: 'Exact retained trigger fire ID (repeat once for a second reading)',
18
+ required: true,
19
+ multiple: true,
20
+ }),
21
+ revision: core_1.Flags.integer({
22
+ description: 'Task economics revision being compared',
23
+ required: true,
24
+ min: 1,
25
+ }),
26
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
27
+ };
28
+ async run() {
29
+ this.requireAuth();
30
+ const { args, flags } = await this.parse(TasksEconomicsCompare);
31
+ const taskRef = await this.resolveEntityRef('task', args.id);
32
+ let response;
33
+ try {
34
+ response = await data_provider_1.dataService.getTaskEconomicsComparison(taskRef, {
35
+ measureId: flags.measure,
36
+ fireIds: flags.fire,
37
+ economicsRevision: flags.revision,
38
+ });
39
+ }
40
+ catch (err) {
41
+ this.handleApiError(err);
42
+ }
43
+ if (flags.json) {
44
+ this.log(JSON.stringify(response, null, 2));
45
+ return;
46
+ }
47
+ const readings = response.platformReadings;
48
+ this.log(`Estimate (revision ${response.economicsRevision}): ${JSON.stringify(response.economics)}`);
49
+ if (readings.status === 'unavailable') {
50
+ this.log(`Platform readings unavailable: ${readings.reason}`);
51
+ }
52
+ else {
53
+ const unit = readings.customUnit ?? readings.declaredUnit;
54
+ for (const r of readings.readings)
55
+ this.log(`${r.triggerFireId}: ${r.value} ${unit} at ${r.observedAt}`);
56
+ }
57
+ this.log(`Measurement: ${response.measurement.reason}`);
58
+ }
59
+ }
60
+ exports.default = TasksEconomicsCompare;
@@ -0,0 +1,13 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ export default class TasksExpectationsEvaluate extends BaseCommand {
3
+ static description: string;
4
+ static args: {
5
+ task: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
6
+ };
7
+ static flags: {
8
+ task: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
9
+ 'spec-version': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
+ };
12
+ run(): Promise<void>;
13
+ }
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const data_provider_1 = require("@skrr-ai/data-provider");
5
+ const base_command_1 = require("../../../base-command");
6
+ const task_resolver_1 = require("../../../lib/task-resolver");
7
+ class TasksExpectationsEvaluate extends base_command_1.BaseCommand {
8
+ static description = 'Observe authorized Task/Goal states and record met-only facts; never close the Task';
9
+ static args = {
10
+ task: core_1.Args.string({ required: false, ignoreStdin: true, description: 'Task id or ref' }),
11
+ };
12
+ static flags = {
13
+ task: core_1.Flags.string({ description: 'Task id; overrides runtime context' }),
14
+ 'spec-version': core_1.Flags.integer({
15
+ min: 1,
16
+ description: 'Expected current specification version',
17
+ }),
18
+ json: core_1.Flags.boolean({ description: 'Output JSON' }),
19
+ };
20
+ async run() {
21
+ this.requireAuth();
22
+ const { args, flags } = await this.parse(TasksExpectationsEvaluate);
23
+ const task = (0, task_resolver_1.resolveTaskIdentity)({ positionalId: args.task, flagTask: flags.task });
24
+ try {
25
+ const result = await data_provider_1.dataService.evaluateTaskExpectations({
26
+ taskId: task.id,
27
+ data: { expectedSpecVersion: flags['spec-version'] },
28
+ });
29
+ if (flags.json) {
30
+ this.log(JSON.stringify(result, null, 2));
31
+ return;
32
+ }
33
+ this.log(`Task specification v${result.specVersion}; platform-state snapshot only.`);
34
+ for (const row of result.outcomes) {
35
+ this.log(`${row.expectationId}: ${row.state}${row.reason ? ` (${row.reason})` : ''}`);
36
+ }
37
+ }
38
+ catch (error) {
39
+ this.handleApiError(error);
40
+ }
41
+ }
42
+ }
43
+ exports.default = TasksExpectationsEvaluate;
@@ -74,6 +74,7 @@ export default class TasksList extends BaseCommand {
74
74
  'actionable-by': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
75
75
  'actionable-for-agent': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
76
76
  'needs-me': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
77
+ rank: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
77
78
  sort: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
78
79
  order: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
79
80
  'due-before': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;