@skrr-ai/cli 0.1.127 → 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 (113) 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/commitments/action-history.js +1 -1
  5. package/dist/commands/commitments/cases.js +3 -3
  6. package/dist/commands/commitments/check-now.d.ts +10 -2
  7. package/dist/commands/commitments/check-now.js +53 -3
  8. package/dist/commands/commitments/create.d.ts +6 -14
  9. package/dist/commands/commitments/create.js +61 -6
  10. package/dist/commands/commitments/doctor.js +3 -1
  11. package/dist/commands/commitments/effective-policy.d.ts +11 -1
  12. package/dist/commands/commitments/effective-policy.js +84 -4
  13. package/dist/commands/commitments/hypotheses.js +12 -12
  14. package/dist/commands/commitments/next-tick.js +5 -0
  15. package/dist/commands/commitments/observations.js +18 -17
  16. package/dist/commands/commitments/pack/list.js +2 -1
  17. package/dist/commands/commitments/pack/plan.d.ts +6 -0
  18. package/dist/commands/commitments/pack/plan.js +19 -0
  19. package/dist/commands/commitments/preflight.d.ts +19 -0
  20. package/dist/commands/commitments/preflight.js +108 -10
  21. package/dist/commands/commitments/trigger-status.js +8 -0
  22. package/dist/commands/commitments/update.d.ts +1 -0
  23. package/dist/commands/commitments/update.js +45 -4
  24. package/dist/commands/commitments/wake-capabilities.js +13 -0
  25. package/dist/commands/compass/archive.js +4 -0
  26. package/dist/commands/compass/commitments.js +15 -1
  27. package/dist/commands/compass/create.js +11 -3
  28. package/dist/commands/compass/effective-policy.d.ts +1 -0
  29. package/dist/commands/compass/effective-policy.js +8 -7
  30. package/dist/commands/compass/revert.d.ts +8 -0
  31. package/dist/commands/compass/revert.js +25 -1
  32. package/dist/commands/compass/revisions.d.ts +2 -0
  33. package/dist/commands/compass/revisions.js +18 -2
  34. package/dist/commands/compass/tactic.d.ts +5 -3
  35. package/dist/commands/compass/tactic.js +8 -7
  36. package/dist/commands/compass/update.js +19 -3
  37. package/dist/commands/followups/act.js +1 -1
  38. package/dist/commands/followups/cancel.js +13 -0
  39. package/dist/commands/followups/observability.js +20 -1
  40. package/dist/commands/followups/plans/create.js +12 -1
  41. package/dist/commands/followups/show.js +13 -0
  42. package/dist/commands/followups/watch.js +1 -1
  43. package/dist/commands/goals/planner-config.d.ts +11 -0
  44. package/dist/commands/goals/planner-config.js +16 -0
  45. package/dist/commands/machines/update.d.ts +5 -3
  46. package/dist/commands/machines/update.js +70 -9
  47. package/dist/commands/northstars/create.js +3 -1
  48. package/dist/commands/northstars/governance/configure.d.ts +4 -0
  49. package/dist/commands/northstars/governance/configure.js +75 -9
  50. package/dist/commands/northstars/intents/decide.d.ts +6 -0
  51. package/dist/commands/northstars/intents/decide.js +69 -15
  52. package/dist/commands/northstars/intents/list.d.ts +2 -1
  53. package/dist/commands/northstars/intents/list.js +15 -5
  54. package/dist/commands/northstars/intents.d.ts +26 -0
  55. package/dist/commands/northstars/intents.js +49 -0
  56. package/dist/commands/northstars/list.d.ts +1 -0
  57. package/dist/commands/northstars/list.js +24 -3
  58. package/dist/commands/northstars/recommendations/list.d.ts +1 -1
  59. package/dist/commands/northstars/recommendations/list.js +3 -3
  60. package/dist/commands/northstars/recommendations.d.ts +19 -0
  61. package/dist/commands/northstars/recommendations.js +42 -0
  62. package/dist/commands/northstars/review-now.d.ts +1 -0
  63. package/dist/commands/northstars/review-now.js +10 -4
  64. package/dist/commands/northstars/reviews.d.ts +1 -0
  65. package/dist/commands/northstars/reviews.js +19 -3
  66. package/dist/commands/northstars/update.js +8 -1
  67. package/dist/commands/proposals/list.js +11 -2
  68. package/dist/commands/proposals/show.js +9 -1
  69. package/dist/commands/spaces/auto-executor/preview.d.ts +14 -1
  70. package/dist/commands/spaces/auto-executor/preview.js +35 -1
  71. package/dist/commands/spaces/auto-executor/run.d.ts +17 -0
  72. package/dist/commands/spaces/auto-executor/run.js +60 -2
  73. package/dist/commands/spaces/files/upload.js +1 -2
  74. package/dist/commands/spaces/index.js +23 -0
  75. package/dist/generated/agent-guides.json +69 -69
  76. package/dist/lib/agentic-stream.d.ts +9 -0
  77. package/dist/lib/agentic-stream.js +14 -0
  78. package/dist/lib/command-miss.js +11 -2
  79. package/dist/lib/commitment-attention-copy.d.ts +96 -0
  80. package/dist/lib/commitment-attention-copy.js +209 -0
  81. package/dist/lib/commitment-loop-status.d.ts +6 -0
  82. package/dist/lib/commitment-loop-status.js +16 -6
  83. package/dist/lib/commitments.d.ts +88 -0
  84. package/dist/lib/commitments.js +188 -0
  85. package/dist/lib/compass-body-help.d.ts +20 -0
  86. package/dist/lib/compass-body-help.js +61 -0
  87. package/dist/lib/compass-refusals.d.ts +35 -0
  88. package/dist/lib/compass-refusals.js +50 -0
  89. package/dist/lib/compasses.d.ts +80 -4
  90. package/dist/lib/compasses.js +232 -12
  91. package/dist/lib/followups.d.ts +22 -1
  92. package/dist/lib/followups.js +21 -1
  93. package/dist/lib/format.d.ts +11 -0
  94. package/dist/lib/format.js +29 -0
  95. package/dist/lib/initiatives.d.ts +9 -2
  96. package/dist/lib/initiatives.js +13 -2
  97. package/dist/lib/machines.d.ts +14 -1
  98. package/dist/lib/machines.js +24 -0
  99. package/dist/lib/northstars.d.ts +158 -24
  100. package/dist/lib/northstars.js +538 -26
  101. package/dist/lib/proposal-decision-command.js +21 -1
  102. package/dist/lib/proposals.d.ts +26 -1
  103. package/dist/lib/proposals.js +163 -0
  104. package/dist/lib/rate-limit-retry.d.ts +5 -0
  105. package/dist/lib/rate-limit-retry.js +19 -0
  106. package/dist/lib/roles.d.ts +1 -1
  107. package/dist/lib/space-charter.js +9 -0
  108. package/dist/lib/task-asset-upload.js +1 -2
  109. package/dist/lib/triggers.d.ts +1 -1
  110. package/dist/lib/triggers.js +11 -3
  111. package/dist/node_modules/@skrr-ai/data-provider/index.js +6504 -6493
  112. package/oclif.manifest.json +350 -34
  113. package/package.json +4 -4
@@ -1,25 +1,3 @@
1
- /**
2
- * northstars.ts — request-based client for the Northstar portfolio layer
3
- * (`/api/northstars/*`) and its Portfolio Governor.
4
- *
5
- * A **Northstar** groups and prioritizes many Commitments without owning their
6
- * loop. The **Governor** is a MODE of its periodic review, not a separate
7
- * entity: a review rolls portfolio health up, allocates each Commitment a
8
- * cadence band and run budget, and emits TYPED management intents that a single
9
- * router turns into `CommitmentControl` mutations — advisory, awaiting a human,
10
- * or (narrowly) automatic.
11
- *
12
- * Two dials, deliberately separate:
13
- * - `analysisMode` — does an Agent get to think about this portfolio?
14
- * - `executionMode` — how much write authority does the outcome carry?
15
- *
16
- * Both default to the safe end (`deterministic` / `advisory`), which is exactly
17
- * what a Northstar did before the Governor existed.
18
- *
19
- * Every vocabulary below is RE-EXPORTED from `@skrr-ai/data-provider`, never
20
- * re-declared. The API validates against those exact strings; a second copy here
21
- * is how the CLI silently drifts from the server that rejects it.
22
- */
23
1
  import { NORTHSTAR_ANALYSIS_MODES, NORTHSTAR_APPROVAL_TRIGGERS, NORTHSTAR_EXECUTION_MODES, NORTHSTAR_INTENT_VERDICTS, NORTHSTAR_MANAGEMENT_INTENT_KINDS, NORTHSTAR_REVIEW_STATUSES } from '@skrr-ai/data-provider';
24
2
  import type { Northstar, NorthstarAnalysisMode, NorthstarExecutionMode, NorthstarGovernance, NorthstarGovernanceStatus, NorthstarGovernanceUpdateParams, NorthstarListResponse, NorthstarManagementIntent, NorthstarManagementIntentKind, NorthstarRecommendation, NorthstarReviewRecord, NorthstarStatusResponse } from '@skrr-ai/data-provider';
25
3
  import { withQuery } from './triggers';
@@ -33,6 +11,16 @@ export type { Northstar, NorthstarAnalysisMode, NorthstarExecutionMode, Northsta
33
11
  export declare const NORTHSTAR_STATUSES: readonly ["active", "paused", "achieved", "archived"];
34
12
  export declare const NORTHSTAR_PRIORITY_TIERS: readonly ["critical", "high", "medium", "low"];
35
13
  export declare const NORTHSTAR_RECOMMENDATION_STATUSES: readonly ["open", "applied", "dismissed"];
14
+ /**
15
+ * What a configure that changed the allocation inputs (the run budget, the critical reserve, the
16
+ * cadence band) says it did to the linked commitments. Additive on the server: absent from an
17
+ * older server, `allocationsPending` only when non-zero, `allocationsRefreshFailed` only on failure.
18
+ */
19
+ export type AllocationRefreshFields = {
20
+ allocationsRefreshed?: number;
21
+ allocationsPending?: number;
22
+ allocationsRefreshFailed?: boolean;
23
+ };
36
24
  export declare const northstarApi: {
37
25
  list: (query?: Parameters<typeof withQuery>[1]) => Promise<NorthstarListResponse>;
38
26
  create: (body: Record<string, unknown>) => Promise<Northstar>;
@@ -51,23 +39,169 @@ export declare const northstarApi: {
51
39
  northstarId: string;
52
40
  northstarVersion: number;
53
41
  governance: NorthstarGovernance;
54
- }>;
42
+ } & AllocationRefreshFields>;
55
43
  reviews: (id: string, query?: Parameters<typeof withQuery>[1]) => Promise<{
56
44
  data: NorthstarReviewRecord[];
45
+ has_more?: boolean;
57
46
  }>;
58
47
  review: (id: string, reviewId: string) => Promise<NorthstarReviewRecord>;
59
48
  reviewNow: (id: string) => Promise<Record<string, unknown>>;
60
49
  intents: (id: string, query?: Parameters<typeof withQuery>[1]) => Promise<{
61
50
  data: NorthstarManagementIntent[];
51
+ has_more?: boolean;
62
52
  }>;
63
53
  decideIntent: (id: string, intentId: string, body: Record<string, unknown>) => Promise<Record<string, unknown>>;
64
54
  };
65
55
  /** ms → a short human duration, for a table cell that must stay narrow. */
66
56
  export declare function humanMs(ms?: number): string;
67
57
  export declare function shortDate(value?: string): string;
58
+ export declare const NORTHSTAR_REASON_WORDS: Readonly<Record<string, string>>;
59
+ /** A code in words; an unknown code comes back unchanged, an absent one says so. */
60
+ export declare function describeNorthstarReason(code: string | null | undefined): string;
61
+ export type NorthstarDecisionContext = {
62
+ northstarId: string;
63
+ intentId: string;
64
+ decision: 'approve' | 'reject';
65
+ /** The CLI binary name, for the command a sentence tells the reader to run. */
66
+ bin?: string;
67
+ };
68
+ /**
69
+ * A refused decision, as one sentence with its next step.
70
+ *
71
+ * `body` is the server's refusal (`reason`, plus the context it adds: the two
72
+ * northstar versions, or when and by whom the intent was already decided).
73
+ */
74
+ export declare function describeDecisionRefusal(body: Record<string, unknown>, ctx: NorthstarDecisionContext): {
75
+ code: string;
76
+ text: string;
77
+ };
78
+ export type NorthstarDecisionOutcome = {
79
+ /** The arrow line (`nsi_x → applied`), printed before any explanation. */
80
+ headline: string;
81
+ /** 0 only when the thing asked for now holds. */
82
+ exitCode: 0 | 1;
83
+ /** What to say after the headline. */
84
+ text?: string;
85
+ /** The raw code behind a non-zero exit, for `--json` and `Code:`. */
86
+ code?: string;
87
+ };
88
+ /**
89
+ * What a decision that the server ACCEPTED (HTTP 200) actually did.
90
+ *
91
+ * One exit rule: an approval exits 0 only when the intent is `applied`, and a
92
+ * rejection only when it is `rejected`. An approval the version fence
93
+ * invalidated, or one whose change has not landed, used to print a line shaped
94
+ * like success and exit 0, so a script could not tell it from one that worked.
95
+ */
96
+ export declare function describeDecisionOutcome(result: Record<string, unknown>, ctx: NorthstarDecisionContext): NorthstarDecisionOutcome;
97
+ /** What the server returned before `--limit` existed; sent explicitly so a page is never silently smaller. */
98
+ export declare const NORTHSTAR_LIST_DEFAULT_LIMIT = 50;
99
+ /**
100
+ * The footer under a list that was cut short. `has_more: false` used to be
101
+ * unconditional on these lists, so a page of `--limit` rows read as the whole
102
+ * answer; the server now says when there is more and this says what to do.
103
+ * Empty when the page is complete.
104
+ *
105
+ * `cursor` is true only for a list that can be paged (`northstars list`); the
106
+ * reviews and intents lists have no cursor, so their way on is a larger
107
+ * `--limit`, or a narrower `--status` once `--limit` is at its ceiling.
108
+ */
109
+ export declare function listFooter(input: {
110
+ shown: number;
111
+ hasMore: boolean;
112
+ limit: number;
113
+ max: number;
114
+ nextCursor?: string | null;
115
+ cursor?: boolean;
116
+ }): string;
68
117
  export declare function renderNorthstarList(rows: Northstar[], log: (line: string) => void): void;
118
+ /**
119
+ * The active-commitment cap, in words. `0` is accepted and stored, and a review
120
+ * treats it as "no cap" (it does not flag every commitment over a cap of zero),
121
+ * so the screen says that rather than letting `0` read as a limit.
122
+ */
123
+ export declare function describeMaxActive(value: number | undefined): string;
69
124
  export declare function renderNorthstar(status: NorthstarStatusResponse, log: (line: string) => void): void;
70
125
  export declare function renderRecommendationList(rows: NorthstarRecommendation[], log: (line: string) => void): void;
126
+ /**
127
+ * No reviewer configured, a ready one, and an unreachable one are three
128
+ * different answers — and the third is the one an operator needs spelled out,
129
+ * because a scheduled review trigger says nothing about whether the agent that
130
+ * would run it is online.
131
+ */
132
+ export declare function reviewerReadiness(reviewer: NorthstarGovernanceStatus['reviewer']): string;
133
+ /** The `governance configure` flags that move what a commitment's allocation is computed from. */
134
+ export declare const ALLOCATION_INPUT_FLAGS: readonly ["max-runs-per-day", "clear-max-runs-per-day", "critical-reserve", "min-interval-hours", "max-interval-hours", "max-relative-change"];
135
+ export type AllocationRefresh = {
136
+ refreshed: number;
137
+ pending: number;
138
+ failed: boolean;
139
+ };
140
+ /** The refresh summary a configure response carries, or undefined from a server that sends none. */
141
+ export declare function readAllocationRefresh(response: AllocationRefreshFields | undefined): AllocationRefresh | undefined;
142
+ /**
143
+ * What `governance configure` says about the linked commitments. The server re-applies a changed
144
+ * budget or cadence band to every linked active commitment at once and answers how many it wrote,
145
+ * how many it could not, and whether the refresh itself failed; the command discarded all of it and
146
+ * re-read the status, so "nothing happened" and "applied to three" looked the same (OSK-21245).
147
+ *
148
+ * `inputsSent` is whether this call touched an allocation input: only then is "already up to date" a
149
+ * true statement, since a zero is also what an unrelated change (the analysis mode) answers.
150
+ */
151
+ export declare function describeAllocationRefresh(refresh: AllocationRefresh | undefined, options: {
152
+ northstarId: string;
153
+ inputsSent: boolean;
154
+ bin?: string;
155
+ }): {
156
+ lines: string[];
157
+ warnings: string[];
158
+ };
159
+ /**
160
+ * The `Allocations` line of `review-now`. The count is of commitments WRITTEN, so `0` does not say
161
+ * "nothing happened": it is what a review prints when a configure already applied the budget, or
162
+ * when no active commitment is linked, or when no review row could be opened to write under.
163
+ */
164
+ export declare function describeReviewAllocations(result: {
165
+ review?: unknown;
166
+ allocations?: unknown;
167
+ attention?: unknown;
168
+ }): string;
71
169
  export declare function renderGovernance(status: NorthstarGovernanceStatus, log: (line: string) => void): void;
170
+ /**
171
+ * The automatic-change budget line.
172
+ *
173
+ * `0/day` is a MODE (automatic changes off, everything waits for approval), and `used` can
174
+ * legitimately exceed any cap, because the changes were made before the owner lowered it. A bare
175
+ * `2/0 used today · 0 left` collapses both into a ratio over 100% that says neither (OSK-21233).
176
+ */
177
+ export declare function describeAutoBudget(budget: NorthstarGovernanceStatus['mutationBudget']): string;
178
+ /** One cell of words for what a review did beyond "it ran"; empty when there is nothing to add. */
179
+ export declare function reviewNote(review: NorthstarReviewRecord): string;
180
+ /** `Reason` line of one review: the words, with the raw code kept beside them for grep. */
181
+ export declare function describeReviewReason(reason: string): string;
72
182
  export declare function renderReviewList(reviews: NorthstarReviewRecord[], log: (line: string) => void): void;
73
- export declare function renderIntentList(intents: NorthstarManagementIntent[], log: (line: string) => void): void;
183
+ /** `--wide` on every command that prints the intents table. */
184
+ export declare const northstarWideFlag: import("@oclif/core/interfaces").BooleanFlag<boolean>;
185
+ export type IntentTableOptions = {
186
+ /** Never clip the reason, and keep the machine code beside it as `[code]`. */
187
+ wide?: boolean;
188
+ /** Terminal width to fit the table to; defaults to the real terminal, else 250. */
189
+ columns?: number;
190
+ };
191
+ /**
192
+ * The intents table.
193
+ *
194
+ * WHY is the HUMAN reason the governor wrote (`reason`), not the machine code in
195
+ * `verdictReason`, which says why an intent needed approval (`execution_mode_approval`)
196
+ * and is no reason for the change itself. The code stays in `--json`, and beside
197
+ * the sentence as `[code]` under `--wide`. By default the sentence is cut at a
198
+ * word boundary to what the terminal leaves after the other columns.
199
+ */
200
+ export declare function renderIntentList(intents: NorthstarManagementIntent[], log: (line: string) => void, options?: IntentTableOptions): void;
201
+ /**
202
+ * The line that says a review's intent budget cut something off. A cap of 0
203
+ * records nothing at all, which a screen reading "No management intents." made
204
+ * indistinguishable from a review with nothing to say; the count was only in
205
+ * `--json` (`deterministicSnapshot.truncatedIntents`).
206
+ */
207
+ export declare function intentBudgetNote(truncated: unknown, cap?: unknown): string;