@skrr-ai/cli 0.1.118 → 0.1.120

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 (285) hide show
  1. package/dist/base-command.d.ts +32 -0
  2. package/dist/base-command.js +113 -5
  3. package/dist/commands/commands.js +11 -0
  4. package/dist/commands/commitments/action-proposal.d.ts +13 -0
  5. package/dist/commands/commitments/action-proposal.js +39 -0
  6. package/dist/commands/commitments/action-proposals/decide.js +8 -1
  7. package/dist/commands/commitments/action-proposals/execute.js +11 -1
  8. package/dist/commands/commitments/create.js +2 -2
  9. package/dist/commands/commitments/doctor.d.ts +8 -0
  10. package/dist/commands/commitments/doctor.js +22 -0
  11. package/dist/commands/commitments/execute-remediation.js +12 -1
  12. package/dist/commands/commitments/observations.js +2 -2
  13. package/dist/commands/commitments/pack/bind.d.ts +18 -1
  14. package/dist/commands/commitments/pack/bind.js +66 -8
  15. package/dist/commands/commitments/pack/plan.d.ts +4 -1
  16. package/dist/commands/commitments/pack/plan.js +30 -2
  17. package/dist/commands/commitments/update.js +8 -2
  18. package/dist/commands/completion/index.js +1 -1
  19. package/dist/commands/completion/values.js +1 -1
  20. package/dist/commands/computer-use/audio.d.ts +1 -0
  21. package/dist/commands/computer-use/audio.js +1 -0
  22. package/dist/commands/computer-use/browser.d.ts +1 -0
  23. package/dist/commands/computer-use/browser.js +1 -0
  24. package/dist/commands/computer-use/disable.d.ts +1 -0
  25. package/dist/commands/computer-use/disable.js +1 -0
  26. package/dist/commands/computer-use/enable.d.ts +1 -0
  27. package/dist/commands/computer-use/enable.js +1 -0
  28. package/dist/commands/computer-use/index.d.ts +1 -0
  29. package/dist/commands/computer-use/index.js +1 -0
  30. package/dist/commands/computer-use/install.d.ts +1 -0
  31. package/dist/commands/computer-use/install.js +1 -0
  32. package/dist/commands/computer-use/recover.d.ts +1 -0
  33. package/dist/commands/computer-use/recover.js +1 -0
  34. package/dist/commands/computer-use/status.d.ts +1 -0
  35. package/dist/commands/computer-use/status.js +1 -0
  36. package/dist/commands/computer-use/stop.d.ts +1 -0
  37. package/dist/commands/computer-use/stop.js +1 -0
  38. package/dist/commands/context.js +16 -11
  39. package/dist/commands/convos/recovery.js +1 -1
  40. package/dist/commands/daemon/diagnostics.d.ts +9 -0
  41. package/dist/commands/daemon/diagnostics.js +53 -0
  42. package/dist/commands/daemon/index.js +2 -0
  43. package/dist/commands/daemon/maintenance/attest.d.ts +15 -0
  44. package/dist/commands/daemon/maintenance/attest.js +52 -0
  45. package/dist/commands/daemon/maintenance/hold.d.ts +17 -0
  46. package/dist/commands/daemon/maintenance/hold.js +70 -0
  47. package/dist/commands/daemon/maintenance/index.d.ts +12 -0
  48. package/dist/commands/daemon/maintenance/index.js +30 -0
  49. package/dist/commands/daemon/maintenance/resume.d.ts +13 -0
  50. package/dist/commands/daemon/maintenance/resume.js +36 -0
  51. package/dist/commands/daemon/maintenance/status.d.ts +13 -0
  52. package/dist/commands/daemon/maintenance/status.js +36 -0
  53. package/dist/commands/doctor.d.ts +4 -1
  54. package/dist/commands/doctor.js +50 -6
  55. package/dist/commands/followups/plans/cancel-batch.js +6 -3
  56. package/dist/commands/followups/plans/capacity.js +7 -3
  57. package/dist/commands/followups/plans/observability.js +11 -3
  58. package/dist/commands/followups/plans/preferences/set.js +26 -8
  59. package/dist/commands/followups/plans/preferences.js +1 -1
  60. package/dist/commands/followups/plans/show.js +1 -1
  61. package/dist/commands/goals/key-results/assess.d.ts +36 -0
  62. package/dist/commands/goals/key-results/assess.js +110 -0
  63. package/dist/commands/goals/key-results/history.d.ts +30 -0
  64. package/dist/commands/goals/key-results/history.js +104 -0
  65. package/dist/commands/goals/key-results/list.d.ts +5 -4
  66. package/dist/commands/goals/key-results/list.js +12 -6
  67. package/dist/commands/goals/key-results/show.d.ts +4 -2
  68. package/dist/commands/goals/key-results/show.js +25 -4
  69. package/dist/commands/goals/key-results/update.d.ts +4 -0
  70. package/dist/commands/goals/key-results/update.js +18 -24
  71. package/dist/commands/goals/plan-now.js +12 -1
  72. package/dist/commands/goals/planner-compare.d.ts +30 -0
  73. package/dist/commands/goals/planner-compare.js +136 -0
  74. package/dist/commands/machines/dedicated/service/exec.d.ts +3 -0
  75. package/dist/commands/machines/dedicated/service/exec.js +70 -11
  76. package/dist/commands/machines/hosted/destroy.d.ts +1 -0
  77. package/dist/commands/machines/hosted/destroy.js +11 -1
  78. package/dist/commands/machines/hosted/exec.d.ts +1 -0
  79. package/dist/commands/machines/hosted/exec.js +12 -1
  80. package/dist/commands/machines/hosted/index.js +1 -0
  81. package/dist/commands/machines/hosted/operation.d.ts +14 -0
  82. package/dist/commands/machines/hosted/operation.js +51 -0
  83. package/dist/commands/machines/hosted/pull.js +1 -1
  84. package/dist/commands/machines/hosted/start.js +6 -2
  85. package/dist/commands/memory/versions/list.d.ts +2 -0
  86. package/dist/commands/memory/versions/list.js +3 -2
  87. package/dist/commands/memory/versions/show.d.ts +2 -0
  88. package/dist/commands/memory/versions/show.js +3 -2
  89. package/dist/commands/spaces/auto-executor/compare.d.ts +18 -0
  90. package/dist/commands/spaces/auto-executor/compare.js +139 -0
  91. package/dist/commands/spaces/auto-executor/runs.d.ts +3 -0
  92. package/dist/commands/spaces/auto-executor/runs.js +13 -1
  93. package/dist/commands/spaces/charter/create-from-description.d.ts +21 -0
  94. package/dist/commands/spaces/charter/create-from-description.js +77 -0
  95. package/dist/commands/spaces/charter/show.d.ts +22 -0
  96. package/dist/commands/spaces/charter/show.js +61 -0
  97. package/dist/commands/spaces/heartbeats/list.d.ts +1 -16
  98. package/dist/commands/spaces/heartbeats/list.js +13 -0
  99. package/dist/commands/spaces/install-template.js +3 -0
  100. package/dist/commands/spaces/loops/migrate.d.ts +32 -0
  101. package/dist/commands/spaces/loops/migrate.js +103 -0
  102. package/dist/commands/spaces/loops/release.d.ts +14 -0
  103. package/dist/commands/spaces/loops/release.js +59 -0
  104. package/dist/commands/spaces/notebook.d.ts +25 -0
  105. package/dist/commands/spaces/notebook.js +75 -0
  106. package/dist/commands/spaces/proposals/discard.d.ts +17 -0
  107. package/dist/commands/spaces/proposals/discard.js +17 -0
  108. package/dist/commands/spaces/proposals/keep.d.ts +17 -0
  109. package/dist/commands/spaces/proposals/keep.js +17 -0
  110. package/dist/commands/spaces/proposals/list.d.ts +24 -0
  111. package/dist/commands/spaces/proposals/list.js +89 -0
  112. package/dist/commands/spaces/skills/propose.d.ts +29 -0
  113. package/dist/commands/spaces/skills/propose.js +82 -0
  114. package/dist/commands/spaces/templates/fork.js +3 -0
  115. package/dist/commands/spaces/triggers/show.js +6 -0
  116. package/dist/commands/spaces/workflows/retry.d.ts +1 -0
  117. package/dist/commands/spaces/workflows/retry.js +8 -1
  118. package/dist/commands/spaces/workflows/triggers/create.js +3 -2
  119. package/dist/commands/spaces/workflows/triggers/fire.js +4 -0
  120. package/dist/commands/spaces/workflows/triggers/update.js +2 -1
  121. package/dist/commands/spaces/write-policy/set.d.ts +22 -0
  122. package/dist/commands/spaces/write-policy/set.js +82 -0
  123. package/dist/commands/spaces/write-policy/show.d.ts +19 -0
  124. package/dist/commands/spaces/write-policy/show.js +49 -0
  125. package/dist/commands/store/artifacts/receipt.d.ts +14 -0
  126. package/dist/commands/store/artifacts/receipt.js +34 -0
  127. package/dist/commands/store/artifacts/release.d.ts +2 -0
  128. package/dist/commands/store/artifacts/release.js +11 -0
  129. package/dist/commands/store/governance/publish-release.d.ts +2 -0
  130. package/dist/commands/store/governance/publish-release.js +30 -1
  131. package/dist/commands/store/governance/release-receipt.d.ts +12 -0
  132. package/dist/commands/store/governance/release-receipt.js +32 -0
  133. package/dist/commands/tasks/approvals/list.d.ts +11 -5
  134. package/dist/commands/tasks/approvals/list.js +13 -6
  135. package/dist/commands/tasks/attachments/facts.d.ts +12 -0
  136. package/dist/commands/tasks/attachments/facts.js +29 -0
  137. package/dist/commands/tasks/attachments/upload.d.ts +1 -0
  138. package/dist/commands/tasks/attachments/upload.js +16 -0
  139. package/dist/commands/tasks/bulk-update.js +35 -1
  140. package/dist/commands/tasks/context.d.ts +15 -0
  141. package/dist/commands/tasks/context.js +69 -0
  142. package/dist/commands/tasks/copy.d.ts +18 -0
  143. package/dist/commands/tasks/copy.js +85 -0
  144. package/dist/commands/tasks/create-tree.js +97 -23
  145. package/dist/commands/tasks/create.js +9 -1
  146. package/dist/commands/tasks/deliverable/add.js +20 -10
  147. package/dist/commands/tasks/move.js +8 -1
  148. package/dist/commands/tasks/operations/show.d.ts +16 -0
  149. package/dist/commands/tasks/operations/show.js +98 -0
  150. package/dist/commands/tasks/operations/wait.d.ts +22 -0
  151. package/dist/commands/tasks/operations/wait.js +114 -0
  152. package/dist/commands/tasks/preflight.d.ts +1 -0
  153. package/dist/commands/tasks/preflight.js +11 -1
  154. package/dist/commands/tasks/rearm-recurrence.js +4 -0
  155. package/dist/commands/tasks/result/show.js +22 -0
  156. package/dist/commands/tasks/result/submit.d.ts +1 -0
  157. package/dist/commands/tasks/result/submit.js +3 -0
  158. package/dist/commands/tasks/retry-receipt.d.ts +15 -0
  159. package/dist/commands/tasks/retry-receipt.js +89 -0
  160. package/dist/commands/tasks/retry-review.d.ts +16 -0
  161. package/dist/commands/tasks/retry-review.js +66 -0
  162. package/dist/commands/tasks/retry.d.ts +4 -8
  163. package/dist/commands/tasks/retry.js +34 -68
  164. package/dist/commands/tasks/runs.d.ts +21 -0
  165. package/dist/commands/tasks/runs.js +95 -0
  166. package/dist/commands/tasks/show.d.ts +2 -0
  167. package/dist/commands/tasks/show.js +15 -1
  168. package/dist/commands/tasks/start-receipt.d.ts +15 -0
  169. package/dist/commands/tasks/start-receipt.js +95 -0
  170. package/dist/commands/tasks/start.d.ts +4 -0
  171. package/dist/commands/tasks/start.js +49 -3
  172. package/dist/commands/tasks/update.js +3 -0
  173. package/dist/commands/tasks/upsert.js +17 -3
  174. package/dist/commands/tasks/watch.d.ts +3 -0
  175. package/dist/commands/tasks/watch.js +85 -20
  176. package/dist/commands/wiki/history.d.ts +33 -0
  177. package/dist/commands/wiki/history.js +134 -0
  178. package/dist/commands/wiki/ls.d.ts +2 -0
  179. package/dist/commands/wiki/ls.js +8 -0
  180. package/dist/commands/wiki/update.d.ts +3 -1
  181. package/dist/commands/wiki/update.js +24 -2
  182. package/dist/commands/wiki/write.d.ts +22 -0
  183. package/dist/commands/wiki/write.js +144 -6
  184. package/dist/generated/agent-guides.json +81 -81
  185. package/dist/generated/managed-instruction-guides.json +1 -1
  186. package/dist/lib/agent-guides.d.ts +9 -0
  187. package/dist/lib/agent-guides.js +23 -1
  188. package/dist/lib/agentic-stream.d.ts +5 -0
  189. package/dist/lib/agentic-stream.js +122 -3
  190. package/dist/lib/api-fetch.d.ts +4 -0
  191. package/dist/lib/api-fetch.js +25 -7
  192. package/dist/lib/auth-diagnostics.d.ts +39 -0
  193. package/dist/lib/auth-diagnostics.js +71 -0
  194. package/dist/lib/cli-client-identity.d.ts +6 -0
  195. package/dist/lib/cli-client-identity.js +16 -0
  196. package/dist/lib/cli-installation-diagnostics.d.ts +52 -0
  197. package/dist/lib/cli-installation-diagnostics.js +254 -0
  198. package/dist/lib/command-hygiene.d.ts +45 -0
  199. package/dist/lib/command-hygiene.js +413 -0
  200. package/dist/lib/commitments.d.ts +64 -3
  201. package/dist/lib/commitments.js +34 -6
  202. package/dist/lib/completion-index.d.ts +16 -4
  203. package/dist/lib/completion-index.js +50 -14
  204. package/dist/lib/config.js +7 -1
  205. package/dist/lib/daemon-maintenance-command.d.ts +22 -0
  206. package/dist/lib/daemon-maintenance-command.js +39 -0
  207. package/dist/lib/daemon-maintenance.d.ts +275 -0
  208. package/dist/lib/daemon-maintenance.js +1035 -0
  209. package/dist/lib/dedicated-service.d.ts +3 -2
  210. package/dist/lib/dedicated-service.js +11 -3
  211. package/dist/lib/governed-store.d.ts +8 -0
  212. package/dist/lib/governed-store.js +5 -0
  213. package/dist/lib/hosted-machines.d.ts +33 -2
  214. package/dist/lib/hosted-machines.js +19 -1
  215. package/dist/lib/json-output.d.ts +1 -1
  216. package/dist/lib/machines.d.ts +9 -1
  217. package/dist/lib/machines.js +15 -1
  218. package/dist/lib/memory-history-session.d.ts +14 -0
  219. package/dist/lib/memory-history-session.js +60 -0
  220. package/dist/lib/node-adapter.js +13 -0
  221. package/dist/lib/record-output.d.ts +22 -0
  222. package/dist/lib/record-output.js +78 -0
  223. package/dist/lib/roles.d.ts +3 -3
  224. package/dist/lib/scoped-memory-command.d.ts +24 -0
  225. package/dist/lib/scoped-memory-command.js +87 -5
  226. package/dist/lib/space-charter.d.ts +49 -0
  227. package/dist/lib/space-charter.js +78 -0
  228. package/dist/lib/space-loop-migration.d.ts +18 -0
  229. package/dist/lib/space-loop-migration.js +128 -0
  230. package/dist/lib/space-notebook.d.ts +22 -0
  231. package/dist/lib/space-notebook.js +140 -0
  232. package/dist/lib/space-proposal-decision-command.d.ts +36 -0
  233. package/dist/lib/space-proposal-decision-command.js +108 -0
  234. package/dist/lib/space-proposals.d.ts +44 -0
  235. package/dist/lib/space-proposals.js +186 -0
  236. package/dist/lib/space-templates.d.ts +8 -0
  237. package/dist/lib/space-templates.js +17 -0
  238. package/dist/lib/space-write-policy.d.ts +24 -0
  239. package/dist/lib/space-write-policy.js +103 -0
  240. package/dist/lib/task-agent-context-capabilities.d.ts +10 -0
  241. package/dist/lib/task-agent-context-capabilities.js +22 -0
  242. package/dist/lib/task-agent-context-compatibility.d.ts +9 -0
  243. package/dist/lib/task-agent-context-compatibility.js +30 -0
  244. package/dist/lib/task-asset-upload.d.ts +22 -0
  245. package/dist/lib/task-asset-upload.js +257 -29
  246. package/dist/lib/task-batch.d.ts +15 -1
  247. package/dist/lib/task-batch.js +35 -2
  248. package/dist/lib/task-operation-watch.d.ts +66 -0
  249. package/dist/lib/task-operation-watch.js +159 -0
  250. package/dist/lib/task-resolver.d.ts +1 -1
  251. package/dist/lib/task-resolver.js +4 -3
  252. package/dist/lib/task-runtime-headers.js +13 -3
  253. package/dist/lib/task-work.d.ts +1 -1
  254. package/dist/lib/task-work.js +35 -1
  255. package/dist/lib/task-write-attribution.d.ts +14 -0
  256. package/dist/lib/task-write-attribution.js +35 -2
  257. package/dist/lib/triggers.d.ts +11 -0
  258. package/dist/lib/triggers.js +7 -0
  259. package/dist/lib/wiki-update.d.ts +1 -0
  260. package/dist/lib/wiki-update.js +10 -1
  261. package/dist/lib/wiki.js +4 -1
  262. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.d.ts +9 -1
  263. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.js +31 -15
  264. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonToolApproval.js +1 -0
  265. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonWire.js +13 -7
  266. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/guidedUpdate.d.ts +370 -0
  267. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/guidedUpdate.js +315 -0
  268. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/maintenanceReportWire.d.ts +178 -0
  269. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/maintenanceReportWire.js +262 -0
  270. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/toolApprovalSignature.d.ts +51 -0
  271. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/toolApprovalSignature.js +106 -0
  272. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.d.ts +9 -1
  273. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.js +32 -5
  274. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonToolApproval.js +1 -0
  275. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonWire.js +33 -14
  276. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/guidedUpdate.d.ts +370 -0
  277. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/guidedUpdate.js +404 -0
  278. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/maintenanceReportWire.d.ts +178 -0
  279. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/maintenanceReportWire.js +342 -0
  280. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/toolApprovalSignature.d.ts +51 -0
  281. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/toolApprovalSignature.js +138 -0
  282. package/dist/node_modules/@skrr-ai/auth-core/package.json +20 -0
  283. package/dist/node_modules/@skrr-ai/data-provider/index.js +27085 -20250
  284. package/oclif.manifest.json +10570 -7247
  285. package/package.json +20 -2
@@ -5,6 +5,8 @@ import { dataService } from '@skrr-ai/data-provider';
5
5
  import { type WriteTarget } from './lib/write-target';
6
6
  import { type AssigneeResolution, type MemberKind, type SpaceMember } from './lib/assignee-resolver';
7
7
  import { type CliConfig } from './lib/config';
8
+ import { type AuthResolutionDiagnostic } from './lib/auth-diagnostics';
9
+ import { type CompletionCacheScope } from './lib/completion-index';
8
10
  import { type OutboxMethod } from './lib/outbox';
9
11
  import { type CredentialProvenance, type ResolvedCredential } from './lib/credential-resolver';
10
12
  import { type BrokerRefusalDescription } from './lib/daemonBrokerRefusal';
@@ -32,6 +34,7 @@ export declare abstract class BaseCommand extends Command {
32
34
  * acquiring unrelated account authority. Human invocations are unaffected.
33
35
  */
34
36
  static autonomousCredentialPolicy: 'delegated' | 'bound-session';
37
+ static sessionReadPolicy?: 'memory-history-v1';
35
38
  /** Add the owning agent's web detail link without overwriting resource URLs. */
36
39
  protected withAgentContext<T>(agentId: string, value: T): T & {
37
40
  agentUrl: string | null;
@@ -81,6 +84,15 @@ export declare abstract class BaseCommand extends Command {
81
84
  protected printJsonResult(value: unknown, options?: {
82
85
  ok?: boolean;
83
86
  }): void;
87
+ /**
88
+ * A task write the Space write policy HELD for approval (OSK-17988): the
89
+ * server answered `202 { status: 'pending_approval' }` and wrote nothing.
90
+ * Prints it as that, never as a created or updated task, and returns true so
91
+ * the command stops there (exit 0: the request was accepted, not refused).
92
+ */
93
+ protected reportHeldSpaceWrite(result: unknown, { json }?: {
94
+ json?: boolean;
95
+ }): boolean;
84
96
  private jsonOperationContext?;
85
97
  /** Opt in at the command boundary, including its existing structured errors. */
86
98
  protected setJsonOperation(options: Partial<CliOperationOptions>): void;
@@ -96,6 +108,8 @@ export declare abstract class BaseCommand extends Command {
96
108
  * from here.
97
109
  */
98
110
  protected resolvedCredential: ResolvedCredential;
111
+ /** Completion references follow the same principal and workspace as requests. */
112
+ protected completionCacheScope(): CompletionCacheScope | null;
99
113
  /** Re-authorize a long-lived transport using this command's credential
100
114
  * source. A daemon handoff is redeemed again; its refresh family is never
101
115
  * borrowed or written into the CLI's own login. */
@@ -108,6 +122,8 @@ export declare abstract class BaseCommand extends Command {
108
122
  */
109
123
  protected credentialProvenance: CredentialProvenance | null;
110
124
  protected bareMode: boolean;
125
+ /** Managed runtimes must never suggest a human's local credential store. */
126
+ private authManagedRuntime;
111
127
  /**
112
128
  * Set when the auto-broker reached a live daemon and it REFUSED the hand-off.
113
129
  * `requireAuth()` reports it instead of a bare "Not signed in", because the
@@ -350,6 +366,11 @@ export declare abstract class BaseCommand extends Command {
350
366
  * Returns `null` when not signed in.
351
367
  */
352
368
  protected credentialSourceLabel(): string | null;
369
+ /**
370
+ * A machine-readable explanation of credential resolution. This carries
371
+ * source metadata only; neither token material nor raw URLs may escape.
372
+ */
373
+ protected authResolution(): AuthResolutionDiagnostic;
353
374
  protected catch(err: Error & {
354
375
  code?: string;
355
376
  exitCode?: number;
@@ -635,6 +656,10 @@ type UnsupportedFlagRemedy = {
635
656
  fix: string;
636
657
  targets: readonly UnsupportedFlagRemedyTarget[];
637
658
  };
659
+ type MissingFlagRemedy = {
660
+ fix: string;
661
+ targets: readonly UnsupportedFlagRemedyTarget[];
662
+ };
638
663
  /**
639
664
  * Specific corrections for habitual flags that look plausible but do not belong
640
665
  * to the command that received them. Keep the replacement command and every
@@ -642,6 +667,13 @@ type UnsupportedFlagRemedy = {
642
667
  * manifest, so a useful refusal cannot slowly point at a removed form.
643
668
  */
644
669
  export declare const UNSUPPORTED_FLAG_REMEDIES: Readonly<Record<string, Readonly<Record<string, UnsupportedFlagRemedy>>>>;
670
+ /**
671
+ * Required flags normally share a generic repair. A few have a meaningful
672
+ * choice that cannot be recovered from `<value>` alone; keep those remedies
673
+ * declarative and validate their referenced command flags alongside the
674
+ * habitual unsupported-flag corrections.
675
+ */
676
+ export declare const MISSING_FLAG_REMEDIES: Readonly<Record<string, Readonly<Record<string, MissingFlagRemedy>>>>;
645
677
  /**
646
678
  * The hint for a `Nonexistent flags:` refusal, or null. Two cases:
647
679
  * - a flag retired from THIS command, which this command does not define again: where it went;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Flags = exports.UNSUPPORTED_FLAG_REMEDIES = exports.BaseCommand = exports.resolveProfileFromArgv = void 0;
3
+ exports.Flags = exports.MISSING_FLAG_REMEDIES = exports.UNSUPPORTED_FLAG_REMEDIES = exports.BaseCommand = exports.resolveProfileFromArgv = void 0;
4
4
  exports.assigneePayloadNeedsResolution = assigneePayloadNeedsResolution;
5
5
  exports.parseGlobalFlags = parseGlobalFlags;
6
6
  exports.refusalCodeOf = refusalCodeOf;
@@ -22,6 +22,7 @@ exports.errorBodyMessage = errorBodyMessage;
22
22
  exports.envelopeDetails = envelopeDetails;
23
23
  exports.retiredFlagHint = retiredFlagHint;
24
24
  exports.parseErrorRemedy = parseErrorRemedy;
25
+ const space_write_policy_1 = require("./lib/space-write-policy");
25
26
  const node_fs_1 = require("node:fs");
26
27
  const core_1 = require("@oclif/core");
27
28
  Object.defineProperty(exports, "Flags", { enumerable: true, get: function () { return core_1.Flags; } });
@@ -40,6 +41,7 @@ const guide_pointer_1 = require("./lib/guide-pointer");
40
41
  var keychain_1 = require("./lib/keychain");
41
42
  Object.defineProperty(exports, "resolveProfileFromArgv", { enumerable: true, get: function () { return keychain_1.resolveProfileFromArgv; } });
42
43
  const data_provider_1 = require("@skrr-ai/data-provider");
44
+ const cli_client_identity_1 = require("./lib/cli-client-identity");
43
45
  const auth_core_1 = require("@skrr-ai/auth-core");
44
46
  const auth_failure_1 = require("./lib/auth-failure");
45
47
  const list_output_1 = require("./lib/list-output");
@@ -49,10 +51,14 @@ const task_ref_resolver_1 = require("./lib/task-ref-resolver");
49
51
  const space_resolver_1 = require("./lib/space-resolver");
50
52
  const projects_1 = require("./lib/projects");
51
53
  const config_1 = require("./lib/config");
54
+ const auth_diagnostics_1 = require("./lib/auth-diagnostics");
55
+ const completion_index_1 = require("./lib/completion-index");
56
+ const workspace_header_1 = require("./lib/workspace-header");
52
57
  const cli_id_1 = require("./lib/cli-id");
53
58
  const keychain_2 = require("./lib/keychain");
54
59
  const outbox_1 = require("./lib/outbox");
55
60
  const node_adapter_1 = require("./lib/node-adapter");
61
+ const memory_history_session_1 = require("./lib/memory-history-session");
56
62
  const migrate_1 = require("./lib/migrate");
57
63
  const auth_core_init_1 = require("./lib/auth-core-init");
58
64
  const credential_resolver_1 = require("./lib/credential-resolver");
@@ -125,6 +131,7 @@ class BaseCommand extends core_1.Command {
125
131
  * acquiring unrelated account authority. Human invocations are unaffected.
126
132
  */
127
133
  static autonomousCredentialPolicy = 'delegated';
134
+ static sessionReadPolicy;
128
135
  /** Add the owning agent's web detail link without overwriting resource URLs. */
129
136
  withAgentContext(agentId, value) {
130
137
  const agentUrl = (0, web_url_1.agentUrlFrom)(this.cliConfig.baseURL, { id: agentId });
@@ -203,6 +210,25 @@ class BaseCommand extends core_1.Command {
203
210
  printJsonResult(value, options = {}) {
204
211
  this.log(JSON.stringify((0, json_output_1.withOk)(value, options.ok ?? true), null, 2));
205
212
  }
213
+ /**
214
+ * A task write the Space write policy HELD for approval (OSK-17988): the
215
+ * server answered `202 { status: 'pending_approval' }` and wrote nothing.
216
+ * Prints it as that, never as a created or updated task, and returns true so
217
+ * the command stops there (exit 0: the request was accepted, not refused).
218
+ */
219
+ reportHeldSpaceWrite(result, { json } = {}) {
220
+ if (!(0, space_write_policy_1.isSpaceWritePendingResponse)(result))
221
+ return false;
222
+ if (json) {
223
+ this.printJsonOperation(result, { writeState: 'not_attempted' });
224
+ }
225
+ else {
226
+ for (const line of (0, space_write_policy_1.spaceWritePendingLines)(result, { binName: this.config.bin })) {
227
+ this.log(line);
228
+ }
229
+ }
230
+ return true;
231
+ }
206
232
  jsonOperationContext;
207
233
  /** Opt in at the command boundary, including its existing structured errors. */
208
234
  setJsonOperation(options) {
@@ -234,6 +260,16 @@ class BaseCommand extends core_1.Command {
234
260
  * from here.
235
261
  */
236
262
  resolvedCredential;
263
+ /** Completion references follow the same principal and workspace as requests. */
264
+ completionCacheScope() {
265
+ return (0, completion_index_1.createCompletionCacheScope)({
266
+ configRoot: (0, config_1.configRoot)(),
267
+ profile: (0, keychain_2.getActiveProfile)(),
268
+ baseURL: this.cliConfig.baseURL,
269
+ workspaceId: (0, workspace_header_1.withWorkspaceHeader)({})['X-Workspace-Id'],
270
+ token: this.resolvedCredential?.token,
271
+ });
272
+ }
237
273
  /** Re-authorize a long-lived transport using this command's credential
238
274
  * source. A daemon handoff is redeemed again; its refresh family is never
239
275
  * borrowed or written into the CLI's own login. */
@@ -266,6 +302,8 @@ class BaseCommand extends core_1.Command {
266
302
  */
267
303
  credentialProvenance = null;
268
304
  bareMode = false;
305
+ /** Managed runtimes must never suggest a human's local credential store. */
306
+ authManagedRuntime = false;
269
307
  /**
270
308
  * Set when the auto-broker reached a live daemon and it REFUSED the hand-off.
271
309
  * `requireAuth()` reports it instead of a bare "Not signed in", because the
@@ -274,6 +312,11 @@ class BaseCommand extends core_1.Command {
274
312
  brokerRefusal = null;
275
313
  async init() {
276
314
  await super.init();
315
+ // Task Agent Context compatibility is meaningful only when the API can
316
+ // distinguish a real CLI build from a generic HTTP caller. This is still
317
+ // telemetry/presentation metadata: the server must never treat it as an
318
+ // execution or authorization claim.
319
+ (0, cli_client_identity_1.configureCliClientIdentity)(this.config.pjson?.version);
277
320
  // The profile is resolved from raw argv, BEFORE oclif parses anything.
278
321
  //
279
322
  // It has to be. `parseBaseFlags()` runs far below, after migration and
@@ -292,7 +335,11 @@ class BaseCommand extends core_1.Command {
292
335
  // touching migration, Keychain/file auth, refresh, or daemon auto-broker
293
336
  // state. The restricted session token (or a null credential when it is
294
337
  // missing) is the only adapter authority exposed to the command.
295
- let autonomousCredential = (0, credential_resolver_1.resolveTrustedAutonomousCredential)();
338
+ const historySession = this.constructor.sessionReadPolicy === 'memory-history-v1' &&
339
+ (0, memory_history_session_1.hasMemoryHistoryRuntime)() ? (0, memory_history_session_1.memoryHistorySession)() : null;
340
+ let autonomousCredential = historySession
341
+ ? { token: historySession.token, source: 'env-token', kind: (0, auth_core_1.classifyTokenKind)(historySession.token) }
342
+ : (0, credential_resolver_1.resolveTrustedAutonomousCredential)();
296
343
  const boundSessionCommand = Boolean(autonomousCredential &&
297
344
  this.constructor.autonomousCredentialPolicy === 'bound-session');
298
345
  if ((0, delegated_cli_1.isDelegatedCliSession)() && !boundSessionCommand) {
@@ -386,6 +433,7 @@ class BaseCommand extends core_1.Command {
386
433
  // from the daemon and never owns the person's stored session, so the
387
434
  // commands that create, replace or end that session are not its to run.
388
435
  const harnessContext = (0, harness_context_1.isHarnessCliContext)();
436
+ this.authManagedRuntime = harnessContext;
389
437
  if (harnessContext && this.id && harness_context_1.HARNESS_REFUSED_AUTH_COMMANDS.has(this.id)) {
390
438
  this.failWithCliError({
391
439
  message: `\`${this.config.bin} ${this.id}\` is not available here: this process was started by the skrr ` +
@@ -418,7 +466,12 @@ class BaseCommand extends core_1.Command {
418
466
  // us `bare` and `token` without each subclass having to re-plumb
419
467
  // them.
420
468
  const parsed = await this.parseBaseFlags();
421
- this.bareMode = parsed.bare;
469
+ // Keep the orchestration path aligned with credential-resolver: an
470
+ // environment-enabled bare invocation skips stored credentials just as an
471
+ // explicit `--bare` invocation does, so its diagnostic and broker policy
472
+ // must say the same thing.
473
+ this.bareMode =
474
+ parsed.bare || ['1', 'true', 'TRUE', 'yes'].includes(process.env.OVERSKY_BARE_MODE ?? '');
422
475
  if (parsed.workspace)
423
476
  process.env.OVERSKY_WORKSPACE_ID = parsed.workspace;
424
477
  this.cliConfig = (0, config_1.loadConfig)();
@@ -991,6 +1044,7 @@ class BaseCommand extends core_1.Command {
991
1044
  /** Abort the command with a helpful message if the user isn't signed in. */
992
1045
  requireAuth() {
993
1046
  if (!this.resolvedCredential?.token) {
1047
+ const diagnostic = this.authResolution();
994
1048
  const refusal = this.brokerRefusal;
995
1049
  if (refusal) {
996
1050
  // Same code as the plain case — scripts branch on NOT_SIGNED_IN — with
@@ -1004,14 +1058,24 @@ class BaseCommand extends core_1.Command {
1004
1058
  code: 'NOT_SIGNED_IN',
1005
1059
  exit: 2,
1006
1060
  retryable: refusal.transient,
1007
- details: { broker: refusal.broker, suggestion: refusal.remedy },
1061
+ details: {
1062
+ broker: refusal.broker,
1063
+ auth: diagnostic,
1064
+ server: diagnostic.server,
1065
+ suggestion: refusal.remedy,
1066
+ },
1008
1067
  });
1009
1068
  }
1010
1069
  this.failWithCliError({
1011
- message: `Not signed in. Run \`${this.config.bin} login\` first.`,
1070
+ message: (0, auth_diagnostics_1.describeMissingCredential)(diagnostic, this.config.bin),
1012
1071
  code: 'NOT_SIGNED_IN',
1013
1072
  exit: 2,
1014
1073
  retryable: false,
1074
+ details: {
1075
+ auth: diagnostic,
1076
+ server: diagnostic.server,
1077
+ suggestion: diagnostic.suggestion,
1078
+ },
1015
1079
  });
1016
1080
  }
1017
1081
  const incompatibleScope = incompatibleCliCredentialScope(this.resolvedCredential.token);
@@ -1269,6 +1333,19 @@ class BaseCommand extends core_1.Command {
1269
1333
  return null;
1270
1334
  return (0, credential_resolver_1.describeCredentialSource)(this.resolvedCredential.source, this.credentialProvenance);
1271
1335
  }
1336
+ /**
1337
+ * A machine-readable explanation of credential resolution. This carries
1338
+ * source metadata only; neither token material nor raw URLs may escape.
1339
+ */
1340
+ authResolution() {
1341
+ return (0, auth_diagnostics_1.authResolutionDiagnostic)({
1342
+ credential: this.resolvedCredential,
1343
+ bareMode: this.bareMode,
1344
+ managedRuntime: this.authManagedRuntime,
1345
+ baseURL: this.cliConfig?.baseURL,
1346
+ bin: this.config?.bin ?? 'skrr',
1347
+ });
1348
+ }
1272
1349
  async catch(err) {
1273
1350
  if (isOclifExitError(err)) {
1274
1351
  return super.catch(err);
@@ -1285,6 +1362,10 @@ class BaseCommand extends core_1.Command {
1285
1362
  if (unsupportedFlagHint && !err.message.includes(unsupportedFlagHint.fix)) {
1286
1363
  err.message = `${err.message}\n\n${unsupportedFlagHint.fix}`;
1287
1364
  }
1365
+ const missingFlagHint = missingFlagRemedyForMessage(err.message || '', this.id);
1366
+ if (missingFlagHint && !err.message.includes(missingFlagHint.fix)) {
1367
+ err.message = `${err.message}\n\n${missingFlagHint.fix}`;
1368
+ }
1288
1369
  // Sibling domains spell one lifecycle differently (`in_progress` for a
1289
1370
  // space, `active` for a goal), and oclif's enum refusal named neither the
1290
1371
  // difference nor the value to use (OSK-9735).
@@ -1550,11 +1631,14 @@ class BaseCommand extends core_1.Command {
1550
1631
  const renewal = refreshRefusal
1551
1632
  ? refreshRefusal.message.replace(/\s*Run `[^`]+` to sign in again\.$/, '')
1552
1633
  : "This CLI's own sign-in could not be renewed.";
1634
+ const authDiagnostic = this.authResolution();
1553
1635
  const details = {
1554
1636
  ...(refreshRefusal && bodyCode ? { accessTokenCode: bodyCode } : {}),
1555
1637
  ...(brokerRefusal
1556
1638
  ? { broker: brokerRefusal.broker, suggestion: brokerRefusal.remedy }
1557
1639
  : {}),
1640
+ auth: authDiagnostic,
1641
+ server: authDiagnostic.server,
1558
1642
  };
1559
1643
  let authMessage;
1560
1644
  if (presentedCiToken) {
@@ -2671,13 +2755,35 @@ exports.UNSUPPORTED_FLAG_REMEDIES = {
2671
2755
  },
2672
2756
  },
2673
2757
  };
2758
+ /**
2759
+ * Required flags normally share a generic repair. A few have a meaningful
2760
+ * choice that cannot be recovered from `<value>` alone; keep those remedies
2761
+ * declarative and validate their referenced command flags alongside the
2762
+ * habitual unsupported-flag corrections.
2763
+ */
2764
+ exports.MISSING_FLAG_REMEDIES = {
2765
+ 'tasks:ready': {
2766
+ for: {
2767
+ fix: 'Choose who can move the work: pass `--for agent` or `--for human`. ' +
2768
+ 'For a Space, run `skrr tasks ready --for agent --space <space-id>`.',
2769
+ targets: [{ command: 'tasks:ready', flags: ['for', 'space'] }],
2770
+ },
2771
+ },
2772
+ };
2674
2773
  function unsupportedFlagRemedy(commandId, flag) {
2675
2774
  return commandId ? exports.UNSUPPORTED_FLAG_REMEDIES[commandId]?.[flag] : undefined;
2676
2775
  }
2776
+ function missingFlagRemedy(commandId, flag) {
2777
+ return commandId ? exports.MISSING_FLAG_REMEDIES[commandId]?.[flag] : undefined;
2778
+ }
2677
2779
  function unsupportedFlagRemedyForMessage(message, commandId) {
2678
2780
  const match = /Nonexistent flag[s]?:?\s*(-{1,2}[\w-]+)/i.exec(message);
2679
2781
  return match ? unsupportedFlagRemedy(commandId, match[1].replace(/^-+/, '')) : undefined;
2680
2782
  }
2783
+ function missingFlagRemedyForMessage(message, commandId) {
2784
+ const match = /Missing required flag[s]?:?\s*(?:\n\s*)?-{0,2}([a-z][\w-]*)/i.exec(message);
2785
+ return match ? missingFlagRemedy(commandId, match[1]) : undefined;
2786
+ }
2681
2787
  /**
2682
2788
  * The hint for a `Nonexistent flags:` refusal, or null. Two cases:
2683
2789
  * - a flag retired from THIS command, which this command does not define again: where it went;
@@ -2722,9 +2828,11 @@ function parseErrorRemedy(err, commandId, bin = 'skrr') {
2722
2828
  const missingFlag = /Missing required flag[s]?:?\s*(?:\n\s*)?-{0,2}([a-z][\w-]*)/i.exec(message);
2723
2829
  if (missingFlag) {
2724
2830
  const flag = missingFlag[1];
2831
+ const missingFlagHint = missingFlagRemedy(commandId, flag);
2725
2832
  return {
2726
2833
  flag,
2727
2834
  fix: suggestion ??
2835
+ missingFlagHint?.fix ??
2728
2836
  `Pass --${flag} <value>. Run \`${helpCommand}\` for its description and accepted values.`,
2729
2837
  };
2730
2838
  }
@@ -60,6 +60,17 @@ class Commands extends base_command_1.BaseCommand {
60
60
  else {
61
61
  this.log(`Command hygiene: ${report.ok ? 'OK' : 'FAILED'} ` +
62
62
  `(${report.counts.errors} error(s), ${report.counts.warnings} warning(s))`);
63
+ this.log('Execution contracts: ' +
64
+ report.execution.classified +
65
+ '/' +
66
+ report.execution.candidates +
67
+ ' classified, ' +
68
+ report.execution.humanOnlyExemptions +
69
+ ' human-only exemption(s), ' +
70
+ report.execution.missingReceipts +
71
+ ' receipt gap(s), ' +
72
+ report.execution.missingRecoveryGuidance +
73
+ ' recovery gap(s).');
63
74
  for (const issue of report.issues) {
64
75
  const location = issue.command ? ` ${issue.command}` : '';
65
76
  this.log(`[${issue.severity}] ${issue.code}${location}: ${issue.message}`);
@@ -0,0 +1,13 @@
1
+ import { BaseCommand } from '../../base-command';
2
+ /** Read the exact Action Bundle execution receipt before any retry. */
3
+ export default class CommitmentsActionProposal extends BaseCommand {
4
+ static description: string;
5
+ static args: {
6
+ commitmentId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
7
+ proposalId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
8
+ };
9
+ static flags: {
10
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
+ };
12
+ run(): Promise<void>;
13
+ }
@@ -0,0 +1,39 @@
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 commitments_1 = require("../../lib/commitments");
6
+ /** Read the exact Action Bundle execution receipt before any retry. */
7
+ class CommitmentsActionProposal extends base_command_1.BaseCommand {
8
+ static description = 'Show one frozen Action Bundle and its execution receipt';
9
+ static args = {
10
+ commitmentId: core_1.Args.string({ ignoreStdin: true, description: 'Commitment ID', required: true }),
11
+ proposalId: core_1.Args.string({
12
+ ignoreStdin: true,
13
+ description: 'Action Proposal ID',
14
+ required: true,
15
+ }),
16
+ };
17
+ static flags = { json: core_1.Flags.boolean({ description: 'Output as JSON' }) };
18
+ async run() {
19
+ this.requireAuth();
20
+ const { args, flags } = await this.parse(CommitmentsActionProposal);
21
+ try {
22
+ const result = await commitments_1.commitmentApi.actionProposal(args.commitmentId, args.proposalId);
23
+ if (flags.json)
24
+ this.printJsonResult(result);
25
+ else {
26
+ const proposal = result.proposal;
27
+ const execution = result.execution;
28
+ this.log(`Action Bundle: ${String(proposal?.status || 'unknown')}`);
29
+ this.log(`Operation: ${String(execution?.operationId || 'unavailable')}`);
30
+ const receipt = execution?.receipt;
31
+ this.log(`Receipt: ${String(receipt?.state || 'unknown')}`);
32
+ }
33
+ }
34
+ catch (error) {
35
+ this.handleApiError(error);
36
+ }
37
+ }
38
+ }
39
+ exports.default = CommitmentsActionProposal;
@@ -50,7 +50,14 @@ class CommitmentsActionProposalsDecide extends base_command_1.BaseCommand {
50
50
  : {}),
51
51
  });
52
52
  const execution = decision === 'approve' && decided.status === 'approved'
53
- ? await commitments_1.commitmentApi.executeActionProposal(args.commitmentId, args.proposalId)
53
+ ? await commitments_1.commitmentApi.executeActionProposal(args.commitmentId, args.proposalId, proposal.snapshotDigest && Number.isInteger(proposal.bundleVersion)
54
+ ? {
55
+ // Keep the automatic hand-off fenced to the same Action
56
+ // Bundle the human decision just approved.
57
+ expectedBundleVersion: proposal.bundleVersion,
58
+ expectedSnapshotDigest: proposal.snapshotDigest,
59
+ }
60
+ : {})
54
61
  : undefined;
55
62
  result = { decision: decided, ...(execution ? { execution } : {}) };
56
63
  }
@@ -19,7 +19,17 @@ class CommitmentsActionProposalsExecute extends base_command_1.BaseCommand {
19
19
  const { args, flags } = await this.parse(CommitmentsActionProposalsExecute);
20
20
  let result;
21
21
  try {
22
- result = await commitments_1.commitmentApi.executeActionProposal(args.commitmentId, args.proposalId);
22
+ // Read the frozen bundle first. The server compares both coordinates in
23
+ // its claim CAS, so a re-proposed bundle cannot inherit this nudge.
24
+ const inspected = await commitments_1.commitmentApi.actionProposal(args.commitmentId, args.proposalId);
25
+ const proposal = inspected.proposal;
26
+ if (!proposal || typeof proposal.bundleVersion !== 'number' || typeof proposal.snapshotDigest !== 'string') {
27
+ throw new Error('The Action Bundle inspection did not include its reviewed revision.');
28
+ }
29
+ result = await commitments_1.commitmentApi.executeActionProposal(args.commitmentId, args.proposalId, {
30
+ expectedBundleVersion: proposal.bundleVersion,
31
+ expectedSnapshotDigest: proposal.snapshotDigest,
32
+ });
23
33
  }
24
34
  catch (error) {
25
35
  this.handleApiError(error);
@@ -183,7 +183,7 @@ function commitmentActivationRefusal(err, { id, bin }) {
183
183
  */
184
184
  class CommitmentsCreate extends base_command_1.BaseCommand {
185
185
  static description = 'Create a commitment (a durable agent contract). Its cadence is manual, an interval or daily clock times; ' +
186
- 'it has no weekday, holiday, business-day or trading-calendar fields';
186
+ 'activeHours and daysOfWeek in --from-json select hours and weekdays. No holiday, business-day or trading-calendar fields';
187
187
  static examples = [
188
188
  '<%= config.bin %> commitments create --agent <agent-id> --title "Ship v2" --outcome "v2 is live for all users" --cadence 6h --activate',
189
189
  '<%= config.bin %> commitments create --agent <agent-id> --title "Hiring loop" --outcome "Every candidate hears back in 48h" --watch tasks --watch email --cadence 12h',
@@ -199,7 +199,7 @@ cat > commitment.json <<'JSON'
199
199
  "title": "Daily queue review",
200
200
  "status": "draft",
201
201
  "target": { "outcome": "Queue changes are reviewed" },
202
- "cadence": { "mode": "daily", "times": ["09:15", "17:45"], "timezone": "Asia/Shanghai" },
202
+ "cadence": { "mode": "interval", "intervalMs": 3600000, "activeHours": { "start": "09:00", "end": "22:00" }, "daysOfWeek": ["mon", "tue", "wed", "thu", "fri"], "timezone": "Asia/Shanghai" },
203
203
  "watchedSources": [{
204
204
  "source": "agent_run",
205
205
  "config": { "keys": [
@@ -8,6 +8,14 @@ export declare function doctorVerdict(input: {
8
8
  next: string;
9
9
  why?: string;
10
10
  };
11
+ /**
12
+ * The Space loop line (OSK-17989): a Commitment homed in a Space runs only while
13
+ * that Space's execution principal admits it. Empty for a Commitment that is not
14
+ * a loop. A refused loop is also the operating state's first blocker, so the
15
+ * verdict and next step above already say what to do; this line says which
16
+ * Space and why.
17
+ */
18
+ export declare function spaceLoopLine(value: unknown): string;
11
19
  export default class CommitmentsDoctor extends BaseCommand {
12
20
  static description: string;
13
21
  static args: {
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.doctorVerdict = doctorVerdict;
4
+ exports.spaceLoopLine = spaceLoopLine;
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");
@@ -69,6 +70,24 @@ function doctorVerdict(input) {
69
70
  ...(typeof stop?.detail === 'string' && stop.detail ? { why: stop.detail } : {}),
70
71
  };
71
72
  }
73
+ /**
74
+ * The Space loop line (OSK-17989): a Commitment homed in a Space runs only while
75
+ * that Space's execution principal admits it. Empty for a Commitment that is not
76
+ * a loop. A refused loop is also the operating state's first blocker, so the
77
+ * verdict and next step above already say what to do; this line says which
78
+ * Space and why.
79
+ */
80
+ function spaceLoopLine(value) {
81
+ if (!value || typeof value !== 'object')
82
+ return '';
83
+ const loop = value;
84
+ const status = loop.status || 'unreadable';
85
+ let detail = loop.reason ? ` (${loop.reason})` : '';
86
+ if (status === 'admitted') {
87
+ detail = loop.principalVersion ? ` (principal v${loop.principalVersion})` : '';
88
+ }
89
+ return `Space loop: ${status}${loop.spaceId ? ` · ${loop.spaceId}` : ''}${detail}`;
90
+ }
72
91
  class CommitmentsDoctor extends base_command_1.BaseCommand {
73
92
  static description = 'Summarize commitment readiness and the next operator action';
74
93
  static args = {
@@ -106,6 +125,9 @@ class CommitmentsDoctor extends base_command_1.BaseCommand {
106
125
  const knowledge = operatingState.knowledge;
107
126
  this.log(`Space knowledge: ${knowledge.status || 'unavailable'}${knowledge.spaceId ? ` · ${knowledge.spaceId}` : ''}${knowledge.source ? ` (${knowledge.source})` : ''}; prospective scope, not a completed memory mount`);
108
127
  }
128
+ const loopLine = spaceLoopLine(operatingState.spaceLoop);
129
+ if (!flags.json && loopLine)
130
+ this.log(loopLine);
109
131
  if (flags.json)
110
132
  this.log(JSON.stringify(report, null, 2));
111
133
  else {
@@ -18,7 +18,18 @@ class CommitmentsExecuteRemediation extends base_command_1.BaseCommand {
18
18
  const { args, flags } = await this.parse(CommitmentsExecuteRemediation);
19
19
  let result;
20
20
  try {
21
- result = await commitments_1.commitmentApi.executeRemediationProposal(args.commitmentId, args.proposalId, flags['retry-executing'] === true);
21
+ const inspected = await commitments_1.commitmentApi.remediationProposal(args.commitmentId, args.proposalId);
22
+ const proposal = inspected.proposal;
23
+ if (!proposal || typeof proposal.proposalVersion !== 'number') {
24
+ throw new Error('The remediation proposal inspection did not include its reviewed revision.');
25
+ }
26
+ result = await commitments_1.commitmentApi.executeRemediationProposal(args.commitmentId, args.proposalId, {
27
+ retryExecuting: flags['retry-executing'] === true,
28
+ expectedRevision: proposal.proposalVersion,
29
+ ...(typeof proposal.updatedAt === 'string'
30
+ ? { expectedUpdatedAt: proposal.updatedAt }
31
+ : {}),
32
+ });
22
33
  }
23
34
  catch (error) {
24
35
  this.handleApiError(error);
@@ -131,7 +131,7 @@ class CommitmentsObservations extends base_command_1.BaseCommand {
131
131
  this.handleApiError(err);
132
132
  }
133
133
  if (flags.json)
134
- this.log(JSON.stringify(response, null, 2));
134
+ this.printJsonResult(response);
135
135
  else
136
136
  renderObservationWindow(response, (line) => this.log(line));
137
137
  return;
@@ -152,7 +152,7 @@ class CommitmentsObservations extends base_command_1.BaseCommand {
152
152
  this.handleApiError(err);
153
153
  }
154
154
  if (flags.json) {
155
- this.log(JSON.stringify(response, null, 2));
155
+ this.printJsonResult(response);
156
156
  }
157
157
  else {
158
158
  // "The commitment has none" and "your filter matched none" are different
@@ -5,6 +5,11 @@ import { BaseCommand } from '../../../base-command';
5
5
  * Binding is idempotent by design — the API answers 200 with `reused: true`
6
6
  * rather than minting a second draft, because a retried bind used to leave
7
7
  * duplicate Commitments behind (OSK-5763).
8
+ *
9
+ * `--space` binds the Pack into a Space as that Space's loop: held by the
10
+ * Space's lead unless `--agent` names another member, owned by the person
11
+ * binding, who must be the Space's execution-principal user and hold SHARE on
12
+ * it. The server refuses, and writes nothing, when the Space cannot take it.
8
13
  */
9
14
  export default class CommitmentsPackBind extends BaseCommand {
10
15
  static description: string;
@@ -13,7 +18,10 @@ export default class CommitmentsPackBind extends BaseCommand {
13
18
  json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
19
  pack: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
15
20
  'pack-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
- agent: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
21
+ agent: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
22
+ space: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
23
+ goal: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
24
+ 'interval-minutes': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
25
  repository: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
26
  'required-check': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
19
27
  'installation-id': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
@@ -22,3 +30,12 @@ export default class CommitmentsPackBind extends BaseCommand {
22
30
  };
23
31
  run(): Promise<void>;
24
32
  }
33
+ /**
34
+ * The Space knowledge default a loop's home link reports
35
+ * (`CommitmentSpaceLoop.KNOWLEDGE_DEFAULT_OUTCOMES`), in words. Empty for an
36
+ * outcome this CLI does not know, rather than a guess.
37
+ */
38
+ export declare function describeKnowledgeDefault(scope: {
39
+ default?: string;
40
+ enabled?: boolean;
41
+ } | undefined): string;