@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
@@ -4,12 +4,15 @@ const core_1 = require("@oclif/core");
4
4
  const base_command_1 = require("../../base-command");
5
5
  const format_1 = require("../../lib/format");
6
6
  const task_execution_1 = require("../../lib/task-execution");
7
+ const task_operation_watch_1 = require("../../lib/task-operation-watch");
8
+ const data_provider_1 = require("@skrr-ai/data-provider");
7
9
  class TasksWatch extends base_command_1.BaseCommand {
8
- static description = 'Watch task execution status until completion or failure';
10
+ static description = 'Watch task execution status, or one immutable Task Operation, without dispatching work';
9
11
  static examples = [
10
12
  '<%= config.bin %> tasks watch <task-id>',
11
13
  '<%= config.bin %> tasks watch <root-task-id> --descendants',
12
14
  '<%= config.bin %> tasks watch <root-task-id> --descendants --json',
15
+ '<%= config.bin %> tasks watch <task-id> --operation <operation-id> --timeout 10m',
13
16
  ];
14
17
  static args = {
15
18
  id: core_1.Args.string({ description: 'Task or root task ID', required: true, ignoreStdin: true }),
@@ -27,14 +30,27 @@ class TasksWatch extends base_command_1.BaseCommand {
27
30
  interval: core_1.Flags.integer({ description: 'Polling interval in seconds', default: 5 }),
28
31
  timeout: core_1.Flags.string({ description: 'Timeout such as 30s, 10m, 2h' }),
29
32
  limit: core_1.Flags.integer({ description: 'Max descendants to inspect', default: 500 }),
33
+ operation: core_1.Flags.string({
34
+ description: 'Watch this immutable Task Operation rather than inferring completion from Task workflow status',
35
+ }),
30
36
  };
31
37
  async run() {
32
38
  this.requireAuth();
33
39
  const { args, flags } = await this.parse(TasksWatch);
40
+ if (flags.operation) {
41
+ if (flags.descendants ||
42
+ flags['children-only'] ||
43
+ (flags['fail-on'] !== undefined && flags['fail-on'] !== task_execution_1.DEFAULT_FAIL_STATUSES_FLAG) ||
44
+ (flags.limit !== undefined && flags.limit !== 500)) {
45
+ this.error('--operation cannot be combined with --descendants, --children-only, --fail-on, or --limit. It watches one immutable operation, not a Task tree.', { exit: 2 });
46
+ }
47
+ await this.watchOperation(args.id, flags.operation, flags);
48
+ return;
49
+ }
34
50
  const failOn = (0, task_execution_1.parseStatusSet)(flags['fail-on'], task_execution_1.DEFAULT_FAIL_STATUSES);
35
51
  let timeoutMs = null;
36
52
  try {
37
- timeoutMs = parseDurationMs(flags.timeout);
53
+ timeoutMs = (0, task_operation_watch_1.parseTaskOperationWatchDuration)(flags.timeout);
38
54
  }
39
55
  catch (err) {
40
56
  this.error(err.message, { exit: 1 });
@@ -76,6 +92,73 @@ class TasksWatch extends base_command_1.BaseCommand {
76
92
  await (0, task_execution_1.sleep)(intervalMs);
77
93
  }
78
94
  }
95
+ async watchOperation(taskRef, operationId, flags) {
96
+ const taskId = await this.resolveTaskReference(taskRef);
97
+ const canonicalOperationId = operationId.trim();
98
+ if (!canonicalOperationId || canonicalOperationId.length > 200) {
99
+ this.error('--operation must be a non-empty operation ID of at most 200 characters.', { exit: 2 });
100
+ return;
101
+ }
102
+ let timeoutMs;
103
+ try {
104
+ timeoutMs = (0, task_operation_watch_1.parseTaskOperationWatchDuration)(flags.timeout);
105
+ }
106
+ catch (error) {
107
+ this.error(error.message, { exit: 2 });
108
+ return;
109
+ }
110
+ const intervalMs = Math.max(1, flags.interval) * 1000;
111
+ const getTaskOperation = data_provider_1.dataService.getTaskOperation;
112
+ if (!getTaskOperation) {
113
+ this.failWithCliError({
114
+ code: 'TASK_OPERATION_READER_UNAVAILABLE',
115
+ message: 'This CLI build cannot read Task Operations. Update skrr before waiting on this operation.',
116
+ exit: 2,
117
+ retryable: false,
118
+ });
119
+ }
120
+ try {
121
+ const result = await (0, task_operation_watch_1.watchTaskOperation)({
122
+ taskId,
123
+ operationId: canonicalOperationId,
124
+ intervalMs,
125
+ timeoutMs,
126
+ read: getTaskOperation,
127
+ onCheckpoint: (checkpoint) => this.printOperationCheckpoint(checkpoint, Boolean(flags.json)),
128
+ });
129
+ if (result.result === 'failed')
130
+ this.exit(1);
131
+ }
132
+ catch (error) {
133
+ const candidate = error;
134
+ if (candidate?.code === 'TASK_OPERATION_WAIT_TIMEOUT') {
135
+ this.exit(124);
136
+ return;
137
+ }
138
+ if (candidate?.code === 'TASK_OPERATION_TERMINAL_UNKNOWN') {
139
+ this.failWithCliError({
140
+ code: 'TASK_OPERATION_TERMINAL_UNKNOWN',
141
+ message: 'The Task Operation is terminal but does not report a recognized outcome. Inspect it; do not issue a fresh operation by guesswork.',
142
+ exit: 2,
143
+ retryable: false,
144
+ details: { operationId: canonicalOperationId, taskId },
145
+ });
146
+ return;
147
+ }
148
+ this.handleApiError(error, { subject: `Task operation ${canonicalOperationId}` });
149
+ }
150
+ }
151
+ printOperationCheckpoint(checkpoint, json) {
152
+ if (json) {
153
+ this.log(JSON.stringify(checkpoint));
154
+ return;
155
+ }
156
+ // A text stream stays calm between changes; JSON preserves every polling
157
+ // checkpoint so automation can distinguish a live wait from silence.
158
+ if (checkpoint.changed || checkpoint.terminal || checkpoint.observation === 'timeout') {
159
+ this.log((0, task_operation_watch_1.taskOperationCheckpointLine)(checkpoint));
160
+ }
161
+ }
79
162
  printSnapshot(snapshot) {
80
163
  this.log('');
81
164
  this.log(`[${snapshot.generatedAt}] tasks=${snapshot.taskCount} active=${snapshot.activeCount} recovered=${snapshot.recoveredCount} terminal=${snapshot.terminalCount} pending=${snapshot.pendingCount}`);
@@ -101,21 +184,3 @@ class TasksWatch extends base_command_1.BaseCommand {
101
184
  }
102
185
  }
103
186
  exports.default = TasksWatch;
104
- function parseDurationMs(value) {
105
- if (!value)
106
- return null;
107
- const match = value.trim().match(/^(\d+)(ms|s|m|h)?$/i);
108
- if (!match)
109
- throw new Error(`Invalid --timeout value: ${value}`);
110
- const amount = Number(match[1]);
111
- const unit = (match[2] || 's').toLowerCase();
112
- if (unit === 'ms')
113
- return amount;
114
- if (unit === 's')
115
- return amount * 1000;
116
- if (unit === 'm')
117
- return amount * 60 * 1000;
118
- if (unit === 'h')
119
- return amount * 60 * 60 * 1000;
120
- return amount * 1000;
121
- }
@@ -0,0 +1,33 @@
1
+ import type { WikiPageAuthor, WikiPageRevision } from '@skrr-ai/data-provider';
2
+ import { BaseCommand } from '../../base-command';
3
+ /**
4
+ * `agent <id>` for a write a verified Run proved; otherwise the person whose
5
+ * credential wrote it, with the channel it came through — so an agent working
6
+ * through a delegated CLI credential without Run proof reads as
7
+ * "person <id> (via delegated agent CLI credential)", never as a bare person.
8
+ */
9
+ export declare function formatAuthor(author: WikiPageAuthor | undefined): string;
10
+ export declare function buildHistoryRows(revisions: WikiPageRevision[]): {
11
+ rev: string;
12
+ when: string;
13
+ author: string;
14
+ also: string;
15
+ source: string;
16
+ chars: string;
17
+ }[];
18
+ export default class WikiHistory extends BaseCommand {
19
+ static description: string;
20
+ static examples: string[];
21
+ static args: {
22
+ space: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
23
+ path: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
24
+ };
25
+ static flags: {
26
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
27
+ 'page-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
28
+ limit: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
29
+ cursor: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
30
+ revision: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
31
+ };
32
+ run(): Promise<void>;
33
+ }
@@ -0,0 +1,134 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatAuthor = formatAuthor;
4
+ exports.buildHistoryRows = buildHistoryRows;
5
+ const core_1 = require("@oclif/core");
6
+ const data_provider_1 = require("@skrr-ai/data-provider");
7
+ const base_command_1 = require("../../base-command");
8
+ const format_1 = require("../../lib/format");
9
+ /**
10
+ * `agent <id>` for a write a verified Run proved; otherwise the person whose
11
+ * credential wrote it, with the channel it came through — so an agent working
12
+ * through a delegated CLI credential without Run proof reads as
13
+ * "person <id> (via delegated agent CLI credential)", never as a bare person.
14
+ */
15
+ function formatAuthor(author) {
16
+ if (!author)
17
+ return 'unknown';
18
+ if (author.kind === 'agent')
19
+ return `agent ${author.agentId ?? '?'}`;
20
+ const channel = author.via
21
+ ? (data_provider_1.CREDENTIAL_CHANNEL_LABELS[author.via] ?? author.via)
22
+ : null;
23
+ return channel ? `person ${author.userId} (via ${channel})` : `person ${author.userId}`;
24
+ }
25
+ function sameAuthor(a, b) {
26
+ return (a.kind === b.kind &&
27
+ a.userId === b.userId &&
28
+ a.agentId === b.agentId &&
29
+ a.runId === b.runId &&
30
+ a.via === b.via);
31
+ }
32
+ function buildHistoryRows(revisions) {
33
+ return revisions.map((revision) => {
34
+ const others = (revision.contributors ?? []).filter((contributor) => !revision.author || !sameAuthor(contributor, revision.author));
35
+ const source = revision.source === 'write'
36
+ ? `write${revision.mode ? `/${revision.mode}` : ''}`
37
+ : `editor${revision.open ? ' (open)' : ''}`;
38
+ return {
39
+ rev: String(revision.revisionNumber),
40
+ when: revision.capturedAt ?? revision.createdAt ?? '',
41
+ author: formatAuthor(revision.author),
42
+ also: others.map(formatAuthor).join(', '),
43
+ source,
44
+ chars: String(revision.chars ?? 0),
45
+ };
46
+ });
47
+ }
48
+ class WikiHistory extends base_command_1.BaseCommand {
49
+ static description = "Show a wiki page's revision history: each version, and whether a person or an agent wrote it";
50
+ static examples = [
51
+ '<%= config.bin %> wiki history <space-id> Engineering/Runbooks/deploy',
52
+ '<%= config.bin %> wiki history <space-id> Engineering/Runbooks/deploy --revision 3 > v3.md',
53
+ '<%= config.bin %> wiki history <space-id> --page-id <page-id> --json',
54
+ ];
55
+ static args = {
56
+ space: core_1.Args.string({ description: 'Space ID', required: true, ignoreStdin: true }),
57
+ path: core_1.Args.string({ description: 'Page path', required: false, ignoreStdin: true }),
58
+ };
59
+ static flags = {
60
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
61
+ 'page-id': core_1.Flags.string({ description: 'Address the page by id instead of path' }),
62
+ limit: core_1.Flags.integer({ description: 'Revisions per page (max 100)', default: 20 }),
63
+ cursor: core_1.Flags.string({ description: 'Continue from a previous listing (its next_cursor)' }),
64
+ revision: core_1.Flags.integer({
65
+ description: 'Print one revision as Markdown instead of listing them',
66
+ min: 1,
67
+ }),
68
+ };
69
+ async run() {
70
+ this.requireAuth();
71
+ const { args, flags } = await this.parse(WikiHistory);
72
+ if (!args.path && !flags['page-id']) {
73
+ this.failWithCliError({
74
+ message: 'Provide a page path or --page-id.',
75
+ code: 'WIKI_PAGE_ADDRESS_REQUIRED',
76
+ exit: 1,
77
+ retryable: false,
78
+ });
79
+ }
80
+ const pageId = flags['page-id'];
81
+ const path = args.path;
82
+ if (flags.revision !== undefined) {
83
+ let revision;
84
+ try {
85
+ revision = pageId
86
+ ? await data_provider_1.dataService.getSpaceWikiPageRevision(args.space, pageId, flags.revision)
87
+ : await data_provider_1.dataService.getSpaceWikiRevisionByPath(args.space, path, flags.revision);
88
+ }
89
+ catch (err) {
90
+ this.handleApiError(err);
91
+ }
92
+ if (flags.json) {
93
+ this.printJsonResult(revision);
94
+ return;
95
+ }
96
+ // Body only, like `wiki cat`, so `> v3.md` produces a clean file.
97
+ this.log(revision.content ?? '');
98
+ return;
99
+ }
100
+ let response;
101
+ const paging = { limit: flags.limit, cursor: flags.cursor };
102
+ try {
103
+ response = pageId
104
+ ? await data_provider_1.dataService.getSpaceWikiPageHistory(args.space, pageId, paging)
105
+ : await data_provider_1.dataService.getSpaceWikiHistoryByPath(args.space, path, paging);
106
+ }
107
+ catch (err) {
108
+ this.handleApiError(err);
109
+ }
110
+ if (flags.json) {
111
+ this.printJsonResult(response);
112
+ return;
113
+ }
114
+ const revisions = response.data ?? [];
115
+ if (revisions.length === 0) {
116
+ // History starts with the first write recorded after it shipped; an
117
+ // older page has none until it is next edited.
118
+ this.log('No recorded revisions yet.');
119
+ return;
120
+ }
121
+ (0, format_1.renderTable)(buildHistoryRows(revisions), [
122
+ { key: 'rev', header: 'REV' },
123
+ { key: 'when', header: 'WHEN', maxWidth: 24 },
124
+ { key: 'author', header: 'AUTHOR', maxWidth: 60 },
125
+ { key: 'also', header: 'ALSO', maxWidth: 60 },
126
+ { key: 'source', header: 'SOURCE' },
127
+ { key: 'chars', header: 'CHARS' },
128
+ ], (line) => this.log(line));
129
+ if (response.has_more && response.next_cursor) {
130
+ this.log(`More: --cursor ${response.next_cursor}`);
131
+ }
132
+ }
133
+ }
134
+ exports.default = WikiHistory;
@@ -5,6 +5,8 @@ export type WikiLsRow = {
5
5
  kind: string;
6
6
  name: string;
7
7
  title: string;
8
+ /** A page's kind when it is not an ordinary `doc` page (`charter`, ...); '' otherwise. */
9
+ pageKind: string;
8
10
  updated: string;
9
11
  id: string;
10
12
  };
@@ -20,6 +20,7 @@ function buildRows(listing) {
20
20
  // title would just repeat it. The listing carries no folder timestamp, so
21
21
  // it has no date to show either.
22
22
  title: '',
23
+ pageKind: '',
23
24
  updated: '',
24
25
  id: f.folder_id,
25
26
  })),
@@ -32,6 +33,9 @@ function buildRows(listing) {
32
33
  // `tree` has always rendered `slug [title]`; `ls` simply had no column
33
34
  // for it, though `--json` carried it all along.
34
35
  title: p.title && p.title !== p.slug ? p.title : '',
36
+ // Only a page that is not an ordinary doc names its kind (OSK-17985).
37
+ // A server that predates kinds sends none, which reads as `doc`.
38
+ pageKind: p.kind && p.kind !== 'doc' ? p.kind : '',
35
39
  updated: (0, format_1.localStamp)(p.lastEditedAt ?? p.updatedAt) || '',
36
40
  id: p.pageId,
37
41
  })),
@@ -39,6 +43,7 @@ function buildRows(listing) {
39
43
  kind: 'file',
40
44
  name: f.filename,
41
45
  title: '',
46
+ pageKind: '',
42
47
  updated: '',
43
48
  id: f.file_id,
44
49
  })),
@@ -58,6 +63,9 @@ function columnsFor(rows) {
58
63
  ];
59
64
  if (rows.some((r) => r.title))
60
65
  columns.push({ key: 'title', header: 'TITLE', maxWidth: 48 });
66
+ // Elided like TITLE: a wiki of ordinary pages prints exactly what it did.
67
+ if (rows.some((r) => r.pageKind))
68
+ columns.push({ key: 'pageKind', header: 'KIND' });
61
69
  // The thing most worth knowing from a listing is what moved recently, and
62
70
  // `ls` gave a UUID nobody asked for and no date at all.
63
71
  if (rows.some((r) => r.updated))
@@ -1,6 +1,7 @@
1
1
  import { BaseCommand } from '../../base-command';
2
2
  /**
3
- * `skrr wiki update <space> <path>` — a page's METADATA: title, icon, order.
3
+ * `skrr wiki update <space> <path>` — a page's METADATA: title, icon, order,
4
+ * kind.
4
5
  *
5
6
  * Distinct from `mv`, which owns the page's PATH, and from `write`, which owns
6
7
  * its body. That split follows the server: retitling deliberately keeps the
@@ -21,6 +22,7 @@ export default class WikiUpdate extends BaseCommand {
21
22
  icon: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
22
23
  'clear-icon': import("@oclif/core/interfaces").BooleanFlag<boolean>;
23
24
  order: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
25
+ kind: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
24
26
  json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
25
27
  };
26
28
  run(): Promise<void>;
@@ -3,10 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
4
  const data_provider_1 = require("@skrr-ai/data-provider");
5
5
  const base_command_1 = require("../../base-command");
6
+ const space_charter_1 = require("../../lib/space-charter");
6
7
  const wiki_1 = require("../../lib/wiki");
7
8
  const wiki_update_1 = require("../../lib/wiki-update");
8
9
  /**
9
- * `skrr wiki update <space> <path>` — a page's METADATA: title, icon, order.
10
+ * `skrr wiki update <space> <path>` — a page's METADATA: title, icon, order,
11
+ * kind.
10
12
  *
11
13
  * Distinct from `mv`, which owns the page's PATH, and from `write`, which owns
12
14
  * its body. That split follows the server: retitling deliberately keeps the
@@ -16,12 +18,16 @@ const wiki_update_1 = require("../../lib/wiki-update");
16
18
  * `mv` is for, and two commands that both rewrite a slug is how they drift.
17
19
  */
18
20
  class WikiUpdate extends base_command_1.BaseCommand {
19
- static description = "Update a wiki page's title, icon, or sort order";
21
+ static description = "Update a wiki page's title, icon, sort order, or kind. A Space holds at most one " +
22
+ 'live charter page: making a second page the charter is refused until the first ' +
23
+ 'is changed to another kind or archived.';
20
24
  static examples = [
21
25
  '<%= config.bin %> wiki update <space-id> Engineering/deploy --title "Deploy Runbook"',
22
26
  '<%= config.bin %> wiki update <space-id> Engineering/deploy --icon 🚀',
23
27
  '<%= config.bin %> wiki update <space-id> Engineering/deploy --clear-icon',
24
28
  '<%= config.bin %> wiki update <space-id> Engineering/deploy --order 0 --json',
29
+ '<%= config.bin %> wiki update <space-id> charter --kind charter',
30
+ '<%= config.bin %> wiki update <space-id> journal/2026-10-22 --kind journal_entry',
25
31
  ];
26
32
  static args = {
27
33
  space: core_1.Args.string({ description: 'Space ID', required: true, ignoreStdin: true }),
@@ -37,6 +43,11 @@ class WikiUpdate extends base_command_1.BaseCommand {
37
43
  exclusive: ['icon'],
38
44
  }),
39
45
  order: core_1.Flags.integer({ description: 'Sort position within its folder (0-based)' }),
46
+ kind: core_1.Flags.string({
47
+ description: "What the page is for. `charter` is the Space's one charter (its lead section, " +
48
+ 'before the first ## heading, is read by every agent in the Space).',
49
+ options: [...data_provider_1.WIKI_PAGE_KINDS],
50
+ }),
40
51
  json: core_1.Flags.boolean({ description: 'Output as JSON' }),
41
52
  };
42
53
  async run() {
@@ -56,6 +67,7 @@ class WikiUpdate extends base_command_1.BaseCommand {
56
67
  icon: flags.icon,
57
68
  clearIcon: flags['clear-icon'],
58
69
  order: flags.order,
70
+ kind: flags.kind,
59
71
  });
60
72
  if (!built.ok) {
61
73
  this.failWithCliError({
@@ -82,6 +94,16 @@ class WikiUpdate extends base_command_1.BaseCommand {
82
94
  });
83
95
  }
84
96
  catch (err) {
97
+ const hint = (0, space_charter_1.charterConflictHint)(err, { binName: this.config.bin, spaceId: args.space });
98
+ if (hint) {
99
+ this.failWithCliError({
100
+ message: hint.message,
101
+ code: 'WIKI_CHARTER_EXISTS',
102
+ exit: 1,
103
+ retryable: false,
104
+ details: hint.details,
105
+ });
106
+ }
85
107
  this.handleApiError(err, { subject: `wiki page ${path}` });
86
108
  }
87
109
  if (flags.json) {
@@ -35,6 +35,23 @@ export declare function slugifyLikeServer(input: string): string;
35
35
  * later reads as "no collision" rather than as a fresh false positive.
36
36
  */
37
37
  export declare function createdSlugCollided(requestedSlug: string, createdSlug?: string): boolean;
38
+ /**
39
+ * The warning for `--kind` on a write that landed in a page that already
40
+ * existed, or `null` when there is nothing to say.
41
+ *
42
+ * `--kind`, like `--title`, describes a page this command CREATES: `write` owns
43
+ * the body, `update` owns metadata. A write into an existing page of another
44
+ * kind therefore changes the body and not the kind, and saying so is the
45
+ * difference between that and a silent no-op. A page an older server returns
46
+ * without a kind reads as `doc`.
47
+ */
48
+ export declare function kindIgnoredWarning(opts: {
49
+ requested?: string;
50
+ existingKind?: string;
51
+ binName: string;
52
+ spaceId: string;
53
+ path: string;
54
+ }): string | null;
38
55
  export default class WikiWrite extends BaseCommand {
39
56
  static description: string;
40
57
  static examples: string[];
@@ -49,7 +66,12 @@ export default class WikiWrite extends BaseCommand {
49
66
  stdin: import("@oclif/core/interfaces").BooleanFlag<boolean>;
50
67
  html: import("@oclif/core/interfaces").BooleanFlag<boolean>;
51
68
  append: import("@oclif/core/interfaces").BooleanFlag<boolean>;
69
+ 'create-only': import("@oclif/core/interfaces").BooleanFlag<boolean>;
52
70
  title: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
71
+ kind: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
72
+ section: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
73
+ lead: import("@oclif/core/interfaces").BooleanFlag<boolean>;
74
+ note: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
53
75
  };
54
76
  run(): Promise<void>;
55
77
  }