@skrr-ai/cli 0.1.126 → 0.1.128

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 (123) hide show
  1. package/dist/base-command.d.ts +23 -0
  2. package/dist/base-command.js +72 -0
  3. package/dist/commands/agents/chat.js +7 -0
  4. package/dist/commands/agents/goals/list.d.ts +2 -2
  5. package/dist/commands/agents/goals/list.js +2 -2
  6. package/dist/commands/commitments/action-history.js +1 -1
  7. package/dist/commands/commitments/cases.js +3 -3
  8. package/dist/commands/commitments/check-now.d.ts +10 -2
  9. package/dist/commands/commitments/check-now.js +53 -3
  10. package/dist/commands/commitments/create.d.ts +6 -14
  11. package/dist/commands/commitments/create.js +61 -6
  12. package/dist/commands/commitments/doctor.js +3 -1
  13. package/dist/commands/commitments/effective-policy.d.ts +11 -1
  14. package/dist/commands/commitments/effective-policy.js +84 -4
  15. package/dist/commands/commitments/hypotheses.js +12 -12
  16. package/dist/commands/commitments/next-tick.js +5 -0
  17. package/dist/commands/commitments/observations.js +18 -17
  18. package/dist/commands/commitments/pack/list.js +2 -1
  19. package/dist/commands/commitments/pack/plan.d.ts +6 -0
  20. package/dist/commands/commitments/pack/plan.js +19 -0
  21. package/dist/commands/commitments/preflight.d.ts +19 -0
  22. package/dist/commands/commitments/preflight.js +108 -10
  23. package/dist/commands/commitments/trigger-status.js +8 -0
  24. package/dist/commands/commitments/update.d.ts +1 -0
  25. package/dist/commands/commitments/update.js +45 -4
  26. package/dist/commands/commitments/wake-capabilities.js +13 -0
  27. package/dist/commands/compass/archive.js +4 -0
  28. package/dist/commands/compass/commitments.js +15 -1
  29. package/dist/commands/compass/create.js +11 -3
  30. package/dist/commands/compass/effective-policy.d.ts +1 -0
  31. package/dist/commands/compass/effective-policy.js +8 -7
  32. package/dist/commands/compass/revert.d.ts +8 -0
  33. package/dist/commands/compass/revert.js +25 -1
  34. package/dist/commands/compass/revisions.d.ts +2 -0
  35. package/dist/commands/compass/revisions.js +18 -2
  36. package/dist/commands/compass/tactic.d.ts +5 -3
  37. package/dist/commands/compass/tactic.js +8 -7
  38. package/dist/commands/compass/update.js +19 -3
  39. package/dist/commands/followups/act.js +1 -1
  40. package/dist/commands/followups/cancel.js +13 -0
  41. package/dist/commands/followups/observability.js +20 -1
  42. package/dist/commands/followups/plans/create.js +12 -1
  43. package/dist/commands/followups/show.js +13 -0
  44. package/dist/commands/followups/watch.js +1 -1
  45. package/dist/commands/goals/create.d.ts +1 -0
  46. package/dist/commands/goals/create.js +4 -1
  47. package/dist/commands/goals/planner-config.d.ts +11 -0
  48. package/dist/commands/goals/planner-config.js +16 -0
  49. package/dist/commands/goals/revisions.js +3 -19
  50. package/dist/commands/machines/update.d.ts +5 -3
  51. package/dist/commands/machines/update.js +70 -9
  52. package/dist/commands/northstars/create.js +3 -1
  53. package/dist/commands/northstars/governance/configure.d.ts +4 -0
  54. package/dist/commands/northstars/governance/configure.js +75 -9
  55. package/dist/commands/northstars/intents/decide.d.ts +6 -0
  56. package/dist/commands/northstars/intents/decide.js +69 -15
  57. package/dist/commands/northstars/intents/list.d.ts +2 -1
  58. package/dist/commands/northstars/intents/list.js +15 -5
  59. package/dist/commands/northstars/intents.d.ts +26 -0
  60. package/dist/commands/northstars/intents.js +49 -0
  61. package/dist/commands/northstars/list.d.ts +1 -0
  62. package/dist/commands/northstars/list.js +24 -3
  63. package/dist/commands/northstars/recommendations/list.d.ts +1 -1
  64. package/dist/commands/northstars/recommendations/list.js +3 -3
  65. package/dist/commands/northstars/recommendations.d.ts +19 -0
  66. package/dist/commands/northstars/recommendations.js +42 -0
  67. package/dist/commands/northstars/review-now.d.ts +1 -0
  68. package/dist/commands/northstars/review-now.js +10 -4
  69. package/dist/commands/northstars/reviews.d.ts +1 -0
  70. package/dist/commands/northstars/reviews.js +19 -3
  71. package/dist/commands/northstars/update.js +8 -1
  72. package/dist/commands/proposals/list.js +11 -2
  73. package/dist/commands/proposals/show.js +9 -1
  74. package/dist/commands/spaces/auto-executor/preview.d.ts +14 -1
  75. package/dist/commands/spaces/auto-executor/preview.js +35 -1
  76. package/dist/commands/spaces/auto-executor/run.d.ts +17 -0
  77. package/dist/commands/spaces/auto-executor/run.js +60 -2
  78. package/dist/commands/spaces/files/upload.js +1 -2
  79. package/dist/commands/spaces/index.js +23 -0
  80. package/dist/commands/spaces/revisions.js +3 -2
  81. package/dist/commands/tasks/revisions.js +3 -2
  82. package/dist/commands/triggers/fire-detail.js +2 -0
  83. package/dist/generated/agent-guides.json +69 -69
  84. package/dist/lib/agentic-stream.d.ts +9 -0
  85. package/dist/lib/agentic-stream.js +14 -0
  86. package/dist/lib/command-miss.js +11 -2
  87. package/dist/lib/commitment-attention-copy.d.ts +96 -0
  88. package/dist/lib/commitment-attention-copy.js +209 -0
  89. package/dist/lib/commitment-loop-status.d.ts +6 -0
  90. package/dist/lib/commitment-loop-status.js +16 -6
  91. package/dist/lib/commitments.d.ts +88 -0
  92. package/dist/lib/commitments.js +188 -0
  93. package/dist/lib/compass-body-help.d.ts +20 -0
  94. package/dist/lib/compass-body-help.js +61 -0
  95. package/dist/lib/compass-refusals.d.ts +35 -0
  96. package/dist/lib/compass-refusals.js +50 -0
  97. package/dist/lib/compasses.d.ts +80 -4
  98. package/dist/lib/compasses.js +232 -12
  99. package/dist/lib/followups.d.ts +22 -1
  100. package/dist/lib/followups.js +21 -1
  101. package/dist/lib/format.d.ts +11 -0
  102. package/dist/lib/format.js +29 -0
  103. package/dist/lib/initiatives.d.ts +9 -2
  104. package/dist/lib/initiatives.js +13 -2
  105. package/dist/lib/machines.d.ts +14 -1
  106. package/dist/lib/machines.js +24 -0
  107. package/dist/lib/northstars.d.ts +158 -24
  108. package/dist/lib/northstars.js +538 -26
  109. package/dist/lib/proposal-decision-command.js +21 -1
  110. package/dist/lib/proposals.d.ts +26 -1
  111. package/dist/lib/proposals.js +163 -0
  112. package/dist/lib/rate-limit-retry.d.ts +5 -0
  113. package/dist/lib/rate-limit-retry.js +19 -0
  114. package/dist/lib/revision-actor.d.ts +2 -0
  115. package/dist/lib/revision-actor.js +16 -0
  116. package/dist/lib/roles.d.ts +1 -1
  117. package/dist/lib/space-charter.js +9 -0
  118. package/dist/lib/task-asset-upload.js +1 -2
  119. package/dist/lib/triggers.d.ts +33 -1
  120. package/dist/lib/triggers.js +77 -3
  121. package/dist/node_modules/@skrr-ai/data-provider/index.js +7537 -7474
  122. package/oclif.manifest.json +357 -34
  123. package/package.json +4 -4
@@ -1,10 +1,41 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.canStartLine = canStartLine;
4
+ exports.principalLine = principalLine;
3
5
  exports.refillLines = refillLines;
4
6
  const core_1 = require("@oclif/core");
5
7
  const data_provider_1 = require("@skrr-ai/data-provider");
6
8
  const base_command_1 = require("../../../base-command");
7
9
  const space_output_1 = require("../../../lib/space-output");
10
+ /**
11
+ * "Can start" is a capacity figure, not a forecast. Printed bare next to a disabled autopilot
12
+ * it read as "one task will start now" (dogfooded: `Autopilot: disabled` / `Can start: 1 now`).
13
+ */
14
+ function canStartLine(space, startsAvailable) {
15
+ const capacity = (0, data_provider_1.formatLimit)(startsAvailable);
16
+ return space.autoExecuteEnabled
17
+ ? `Can start: ${capacity} now`
18
+ : `Can start: nothing — autopilot is off (capacity ${capacity})`;
19
+ }
20
+ /**
21
+ * Whether unattended work may run in the Space at all. Turning the board off does not revoke the
22
+ * principal and a revoked one keeps a disabled board silent, so the two have to be told apart.
23
+ * Returns null for a server that predates the field, so an old API prints no claim.
24
+ */
25
+ function principalLine(space, spaceRef) {
26
+ const principal = space.executionPrincipal;
27
+ if (principal === undefined)
28
+ return null;
29
+ if (principal === null) {
30
+ return ('Principal: none — nothing may run unattended here. A Space owner sets one with ' +
31
+ `\`skrr spaces auto-executor update ${spaceRef} --enabled\`.`);
32
+ }
33
+ if (principal.status === 'active')
34
+ return `Principal: active (version ${principal.version})`;
35
+ return (`Principal: revoked${principal.revokeReason ? ` (${principal.revokeReason.replace(/_/g, ' ')})` : ''} — ` +
36
+ `nothing may run unattended here until a Space owner sets it again with ` +
37
+ `\`skrr spaces auto-executor update ${spaceRef} --enabled\`.`);
38
+ }
8
39
  class SpacesAutoExecutorPreview extends base_command_1.BaseCommand {
9
40
  static description = 'Preview what a space auto-executor run would do';
10
41
  static examples = [
@@ -47,7 +78,10 @@ class SpacesAutoExecutorPreview extends base_command_1.BaseCommand {
47
78
  const { capacity } = plan;
48
79
  this.log(`Running: ${(0, data_provider_1.formatRunningCapacity)(capacity.activeCount, capacity.maxActiveTasks)}` +
49
80
  (capacity.maxActiveTasks === null ? ' (no concurrency cap)' : ''));
50
- this.log(`Can start: ${(0, data_provider_1.formatLimit)(capacity.startsAvailable)} now`);
81
+ this.log(canStartLine(space, capacity.startsAvailable));
82
+ const principal = principalLine(space, spaceRef);
83
+ if (principal)
84
+ this.log(principal);
51
85
  if (capacity.budget && !capacity.budget.unlimited) {
52
86
  this.log(`Budget: ${capacity.budget.consumedStarts}/${capacity.budget.maxStarts} starts used this round`);
53
87
  }
@@ -1,4 +1,20 @@
1
1
  import { BaseCommand } from '../../../base-command';
2
+ /** What `auto-execute-now` answered: `fired: false` carries the reason nothing started. */
3
+ type RunNowAnswer = {
4
+ fired?: boolean;
5
+ reason?: string;
6
+ runId?: string;
7
+ };
8
+ /**
9
+ * Why a manual run did not start, in words, and whether that is a refusal or just "already busy".
10
+ * The route answers 200 with `fired: false` and a `reason`; printing "Triggered" for it told an
11
+ * owner a run had started when nothing had (a Space with no execution principal never runs).
12
+ * `busy` is the normal "one is already in flight" answer, not a failure.
13
+ */
14
+ export declare function describeRunNotStarted(answer: RunNowAnswer, spaceRef: string): {
15
+ message: string;
16
+ busy: boolean;
17
+ };
2
18
  export default class SpacesAutoExecutorRun extends BaseCommand {
3
19
  static description: string;
4
20
  static args: {
@@ -9,3 +25,4 @@ export default class SpacesAutoExecutorRun extends BaseCommand {
9
25
  };
10
26
  run(): Promise<void>;
11
27
  }
28
+ export {};
@@ -1,9 +1,52 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.describeRunNotStarted = describeRunNotStarted;
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");
6
7
  const space_output_1 = require("../../../lib/space-output");
8
+ /**
9
+ * Why a manual run did not start, in words, and whether that is a refusal or just "already busy".
10
+ * The route answers 200 with `fired: false` and a `reason`; printing "Triggered" for it told an
11
+ * owner a run had started when nothing had (a Space with no execution principal never runs).
12
+ * `busy` is the normal "one is already in flight" answer, not a failure.
13
+ */
14
+ function describeRunNotStarted(answer, spaceRef) {
15
+ switch (answer.reason) {
16
+ case 'principal_missing_or_revoked':
17
+ return {
18
+ busy: false,
19
+ message: `Nothing ran: this Space has no active execution principal, so nothing may run unattended in it. ` +
20
+ `A Space owner sets one with \`skrr spaces auto-executor update ${spaceRef} --enabled\`.`,
21
+ };
22
+ case 'no_lead_agent':
23
+ return {
24
+ busy: false,
25
+ message: `Nothing ran: this Space has no lead agent to run its board. ` +
26
+ `Set one with \`skrr spaces update ${spaceRef} --lead-agent <agent-id>\`.`,
27
+ };
28
+ case 'space_not_found':
29
+ return { busy: false, message: `Nothing ran: Space ${spaceRef} was not found.` };
30
+ case 'disabled':
31
+ return {
32
+ busy: false,
33
+ message: `Nothing ran: auto-execution is turned off for this Space. ` +
34
+ `Turn it on with \`skrr spaces auto-executor update ${spaceRef} --enabled\`.`,
35
+ };
36
+ case 'active_orchestration':
37
+ case 'lock_held':
38
+ return {
39
+ busy: true,
40
+ message: `A run is already in flight for this Space${answer.runId ? ` (${answer.runId})` : ''}; ` +
41
+ `it carries this request, so no second one was started.`,
42
+ };
43
+ default:
44
+ return {
45
+ busy: false,
46
+ message: `Nothing ran${answer.reason ? ` (${answer.reason})` : ''}: the server did not start a run.`,
47
+ };
48
+ }
49
+ }
7
50
  class SpacesAutoExecutorRun extends base_command_1.BaseCommand {
8
51
  static description = 'Run a space auto-executor immediately';
9
52
  static args = {
@@ -21,10 +64,25 @@ class SpacesAutoExecutorRun extends base_command_1.BaseCommand {
21
64
  catch (err) {
22
65
  this.handleApiError(err);
23
66
  }
24
- if (flags.json)
67
+ const answer = (result ?? {});
68
+ const notStarted = answer.fired === false ? describeRunNotStarted(answer, spaceRef) : undefined;
69
+ if (flags.json) {
25
70
  this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'execution', { result }), null, 2));
26
- else
71
+ // The payload above already says `fired: false`; the exit status says it too, so a
72
+ // script that only checks `$?` is not told a refusal succeeded.
73
+ if (notStarted && !notStarted.busy)
74
+ this.exit(1);
75
+ return;
76
+ }
77
+ if (!notStarted) {
27
78
  this.log(`Triggered auto-executor for space ${spaceRef}.`);
79
+ return;
80
+ }
81
+ if (notStarted.busy) {
82
+ this.log(notStarted.message);
83
+ return;
84
+ }
85
+ this.error(notStarted.message, { exit: 1 });
28
86
  }
29
87
  }
30
88
  exports.default = SpacesAutoExecutorRun;
@@ -35,7 +35,6 @@ var __importStar = (this && this.__importStar) || (function () {
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  const fs = __importStar(require("node:fs"));
37
37
  const path = __importStar(require("node:path"));
38
- const node_buffer_1 = require("node:buffer");
39
38
  const node_crypto_1 = require("node:crypto");
40
39
  const core_1 = require("@oclif/core");
41
40
  const data_provider_1 = require("@skrr-ai/data-provider");
@@ -86,7 +85,7 @@ class SpacesFilesUpload extends base_command_1.BaseCommand {
86
85
  formData.append('spaceId', spaceRef);
87
86
  if (flags.folder)
88
87
  formData.append('folder_id', flags.folder);
89
- formData.append('file', new node_buffer_1.Blob([bytes], { type: (0, file_mime_1.mimeTypeForFilename)(filename) }), filename);
88
+ formData.append('file', new Blob([bytes], { type: (0, file_mime_1.mimeTypeForFilename)(filename) }), filename);
90
89
  let uploaded;
91
90
  try {
92
91
  uploaded = await data_provider_1.dataService.uploadFile(formData);
@@ -46,6 +46,29 @@ const PERSPECTIVES = [
46
46
  ],
47
47
  url: '/spaces/<space-id>/schedule',
48
48
  },
49
+ {
50
+ perspective: 'loops',
51
+ purpose: "The Space's standing loops (weekly review, curator, goal advance). No command lists them: read their cycles from the notebook",
52
+ commands: [
53
+ 'spaces notebook <space-id> --kinds loop_cycle',
54
+ 'commitments pack plan --pack space_review --space <space-id>',
55
+ 'spaces loops migrate <space-id> --from heartbeats',
56
+ 'spaces loops release <space-id> --commitment <id>',
57
+ ],
58
+ url: '/spaces/<space-id>/loops',
59
+ },
60
+ {
61
+ perspective: 'notebook',
62
+ purpose: 'Task results, loop cycles, hypothesis verdicts, journal entries and reports, newest first',
63
+ commands: ['spaces notebook <space-id>'],
64
+ url: '/spaces/<space-id>/notebook',
65
+ },
66
+ {
67
+ perspective: 'proposals',
68
+ purpose: 'Writes held for approval, loop action bundles and Memory proposals; how unattended writes are governed',
69
+ commands: ['spaces proposals list <space-id>', 'spaces write-policy show <space-id>'],
70
+ url: '/spaces/<space-id>/proposals',
71
+ },
49
72
  {
50
73
  perspective: 'actions',
51
74
  purpose: 'Agent actions and space custom actions',
@@ -5,6 +5,7 @@ const data_provider_1 = require("@skrr-ai/data-provider");
5
5
  const base_command_1 = require("../../base-command");
6
6
  const format_1 = require("../../lib/format");
7
7
  const space_output_1 = require("../../lib/space-output");
8
+ const revision_actor_1 = require("../../lib/revision-actor");
8
9
  class SpacesRevisions extends base_command_1.BaseCommand {
9
10
  static description = 'List revisions for a space';
10
11
  static examples = [
@@ -40,14 +41,14 @@ class SpacesRevisions extends base_command_1.BaseCommand {
40
41
  const rows = items.map((rev) => ({
41
42
  version: String(rev.revisionNumber ?? '-'),
42
43
  changeType: String(rev.changeType ?? '-'),
43
- user: String(rev.userId ?? '-'),
44
+ user: (0, revision_actor_1.revisionActorLabel)(rev),
44
45
  changes: String(Array.isArray(rev.changes) ? rev.changes.length : 0),
45
46
  when: rev.createdAt ? String(rev.createdAt).slice(0, 19).replace('T', ' ') : '-',
46
47
  }));
47
48
  (0, format_1.renderTable)(rows, [
48
49
  { key: 'version', header: 'REV' },
49
50
  { key: 'changeType', header: 'CHANGE' },
50
- { key: 'user', header: 'USER' },
51
+ { key: 'user', header: 'ACTOR' },
51
52
  { key: 'changes', header: 'FIELDS' },
52
53
  { key: 'when', header: 'AT' },
53
54
  ], (line) => this.log(line));
@@ -5,6 +5,7 @@ const core_1 = require("@oclif/core");
5
5
  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
+ const revision_actor_1 = require("../../lib/revision-actor");
8
9
  /** " (via CLI credential)" when the revision recorded its credential channel. */
9
10
  function revisionChannelSuffix(rev) {
10
11
  const via = rev.metadata?.via;
@@ -46,14 +47,14 @@ class TasksRevisions extends base_command_1.BaseCommand {
46
47
  version: String(rev.revisionNumber ?? '-'),
47
48
  changeType: String(rev.changeType ?? '-'),
48
49
  // The channel the person's credential came through, when recorded (OSK-16621).
49
- user: `${String(rev.userId ?? '-')}${revisionChannelSuffix(rev)}`,
50
+ user: `${(0, revision_actor_1.revisionActorLabel)(rev)}${rev.userId != null ? revisionChannelSuffix(rev) : ''}`,
50
51
  changes: String(Array.isArray(rev.changes) ? rev.changes.length : 0),
51
52
  when: rev.createdAt ? String(rev.createdAt).slice(0, 19).replace('T', ' ') : '-',
52
53
  }));
53
54
  (0, format_1.renderTable)(rows, [
54
55
  { key: 'version', header: 'REV' },
55
56
  { key: 'changeType', header: 'CHANGE' },
56
- { key: 'user', header: 'USER' },
57
+ { key: 'user', header: 'ACTOR' },
57
58
  { key: 'changes', header: 'FIELDS' },
58
59
  { key: 'when', header: 'AT' },
59
60
  ], (line) => this.log(line));
@@ -29,6 +29,8 @@ function describeFireAuditDetail(detail, fireId, triggerId) {
29
29
  lines.push(`Duration: ${String(detail.durationMs)}ms`);
30
30
  if (detail.conversationId)
31
31
  lines.push(`Conversation: ${String(detail.conversationId)}`);
32
+ // Tool calls refused during a turn that was delivered: `triggers show` points here for the facts.
33
+ lines.push(...(0, triggers_1.fireRefusalLines)(detail.metadata));
32
34
  return lines;
33
35
  }
34
36
  class TriggersFireDetail extends base_command_1.BaseCommand {