@skrr-ai/cli 0.1.22 → 0.1.24

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 (281) hide show
  1. package/README.md +83 -73
  2. package/bin/dev-fallback.js +221 -0
  3. package/bin/run.js +96 -0
  4. package/dist/base-command.d.ts +15 -0
  5. package/dist/base-command.js +145 -11
  6. package/dist/commands/agents/attach-harness.d.ts +37 -0
  7. package/dist/commands/agents/attach-harness.js +102 -3
  8. package/dist/commands/agents/chat.d.ts +69 -1
  9. package/dist/commands/agents/chat.js +202 -22
  10. package/dist/commands/agents/create.d.ts +38 -0
  11. package/dist/commands/agents/create.js +95 -2
  12. package/dist/commands/agents/schedule-trace.js +11 -0
  13. package/dist/commands/agents/show.js +29 -1
  14. package/dist/commands/api-keys/create.d.ts +24 -0
  15. package/dist/commands/api-keys/create.js +80 -0
  16. package/dist/commands/api-keys/list.d.ts +11 -0
  17. package/dist/commands/api-keys/list.js +42 -0
  18. package/dist/commands/api-keys/revoke.d.ts +14 -0
  19. package/dist/commands/api-keys/revoke.js +33 -0
  20. package/dist/commands/api-keys/rotate.d.ts +19 -0
  21. package/dist/commands/api-keys/rotate.js +42 -0
  22. package/dist/commands/balance/index.d.ts +18 -0
  23. package/dist/commands/balance/index.js +29 -0
  24. package/dist/commands/balance/show.d.ts +25 -0
  25. package/dist/commands/balance/show.js +60 -0
  26. package/dist/commands/balance/statement.d.ts +19 -0
  27. package/dist/commands/balance/statement.js +52 -0
  28. package/dist/commands/browser/doctor.d.ts +11 -0
  29. package/dist/commands/browser/doctor.js +11 -0
  30. package/dist/commands/code/jobs/approve.d.ts +25 -0
  31. package/dist/commands/code/jobs/approve.js +52 -0
  32. package/dist/commands/code/jobs/cancel.d.ts +12 -0
  33. package/dist/commands/code/jobs/cancel.js +39 -0
  34. package/dist/commands/code/jobs/index.d.ts +19 -0
  35. package/dist/commands/code/jobs/index.js +38 -0
  36. package/dist/commands/code/jobs/list.d.ts +12 -0
  37. package/dist/commands/code/jobs/list.js +87 -0
  38. package/dist/commands/code/jobs/run.d.ts +32 -0
  39. package/dist/commands/code/jobs/run.js +151 -0
  40. package/dist/commands/code/jobs/show.d.ts +12 -0
  41. package/dist/commands/code/jobs/show.js +86 -0
  42. package/dist/commands/commitments/preflight.js +18 -4
  43. package/dist/commands/commitments/receipt-metrics.d.ts +39 -0
  44. package/dist/commands/commitments/receipt-metrics.js +78 -0
  45. package/dist/commands/convos/search.js +5 -5
  46. package/dist/commands/harnesses/leases/list.d.ts +3 -0
  47. package/dist/commands/harnesses/leases/list.js +59 -12
  48. package/dist/commands/harnesses/leases/show.js +36 -0
  49. package/dist/commands/harnesses/list.d.ts +18 -0
  50. package/dist/commands/harnesses/list.js +30 -0
  51. package/dist/commands/harnesses/products.js +49 -3
  52. package/dist/commands/harnesses/quota.d.ts +16 -0
  53. package/dist/commands/harnesses/quota.js +26 -1
  54. package/dist/commands/harnesses/usage.js +17 -0
  55. package/dist/commands/inbox/index.d.ts +2 -1
  56. package/dist/commands/inbox/index.js +27 -4
  57. package/dist/commands/login.js +4 -1
  58. package/dist/commands/machines/dedicated/create.d.ts +18 -0
  59. package/dist/commands/machines/dedicated/create.js +90 -0
  60. package/dist/commands/machines/dedicated/destroy.d.ts +14 -0
  61. package/dist/commands/machines/dedicated/destroy.js +56 -0
  62. package/dist/commands/machines/dedicated/grow.d.ts +13 -0
  63. package/dist/commands/machines/dedicated/grow.js +46 -0
  64. package/dist/commands/machines/dedicated/health-check.d.ts +12 -0
  65. package/dist/commands/machines/dedicated/health-check.js +42 -0
  66. package/dist/commands/machines/dedicated/incident-close.d.ts +12 -0
  67. package/dist/commands/machines/dedicated/incident-close.js +42 -0
  68. package/dist/commands/machines/dedicated/index.d.ts +6 -0
  69. package/dist/commands/machines/dedicated/index.js +39 -0
  70. package/dist/commands/machines/dedicated/list.d.ts +11 -0
  71. package/dist/commands/machines/dedicated/list.js +58 -0
  72. package/dist/commands/machines/dedicated/restart.d.ts +12 -0
  73. package/dist/commands/machines/dedicated/restart.js +42 -0
  74. package/dist/commands/machines/dedicated/show.d.ts +12 -0
  75. package/dist/commands/machines/dedicated/show.js +58 -0
  76. package/dist/commands/machines/dedicated/snapshot.d.ts +12 -0
  77. package/dist/commands/machines/dedicated/snapshot.js +42 -0
  78. package/dist/commands/machines/dedicated/start.d.ts +12 -0
  79. package/dist/commands/machines/dedicated/start.js +42 -0
  80. package/dist/commands/machines/dedicated/stop.d.ts +12 -0
  81. package/dist/commands/machines/dedicated/stop.js +42 -0
  82. package/dist/commands/machines/hosted/index.js +4 -1
  83. package/dist/commands/machines/list.d.ts +1 -0
  84. package/dist/commands/machines/list.js +33 -5
  85. package/dist/commands/memory/approvals/issue.d.ts +18 -0
  86. package/dist/commands/memory/approvals/issue.js +63 -0
  87. package/dist/commands/memory/commit.js +5 -2
  88. package/dist/commands/memory/context.d.ts +3 -2
  89. package/dist/commands/memory/context.js +9 -11
  90. package/dist/commands/memory/delete.d.ts +1 -1
  91. package/dist/commands/memory/list.d.ts +1 -1
  92. package/dist/commands/memory/list.js +1 -1
  93. package/dist/commands/memory/mounts/resolve.d.ts +10 -0
  94. package/dist/commands/memory/mounts/resolve.js +27 -0
  95. package/dist/commands/memory/proposals/commit.d.ts +18 -0
  96. package/dist/commands/memory/proposals/commit.js +32 -0
  97. package/dist/commands/memory/proposals/create.d.ts +18 -0
  98. package/dist/commands/memory/proposals/create.js +56 -0
  99. package/dist/commands/memory/proposals/list.d.ts +13 -0
  100. package/dist/commands/memory/proposals/list.js +31 -0
  101. package/dist/commands/memory/proposals/promote.d.ts +22 -0
  102. package/dist/commands/memory/proposals/promote.js +33 -0
  103. package/dist/commands/memory/proposals/reject.d.ts +16 -0
  104. package/dist/commands/memory/proposals/reject.js +28 -0
  105. package/dist/commands/memory/rebuild-index.d.ts +20 -0
  106. package/dist/commands/memory/rebuild-index.js +25 -0
  107. package/dist/commands/memory/save.d.ts +1 -1
  108. package/dist/commands/memory/save.js +1 -1
  109. package/dist/commands/memory/search.d.ts +6 -3
  110. package/dist/commands/memory/search.js +27 -3
  111. package/dist/commands/memory/show.d.ts +1 -1
  112. package/dist/commands/memory/stores/archive.d.ts +14 -0
  113. package/dist/commands/memory/stores/archive.js +31 -0
  114. package/dist/commands/memory/stores/create.d.ts +12 -0
  115. package/dist/commands/memory/stores/create.js +30 -0
  116. package/dist/commands/memory/stores/delete.d.ts +15 -0
  117. package/dist/commands/memory/stores/delete.js +38 -0
  118. package/dist/commands/memory/stores/list.d.ts +10 -0
  119. package/dist/commands/memory/stores/list.js +29 -0
  120. package/dist/commands/memory/stores/show.d.ts +12 -0
  121. package/dist/commands/memory/stores/show.js +14 -0
  122. package/dist/commands/memory/stores/update.d.ts +15 -0
  123. package/dist/commands/memory/stores/update.js +39 -0
  124. package/dist/commands/memory/sync/delete.d.ts +13 -0
  125. package/dist/commands/memory/sync/delete.js +35 -0
  126. package/dist/commands/memory/sync/pull.d.ts +19 -0
  127. package/dist/commands/memory/sync/pull.js +52 -0
  128. package/dist/commands/memory/sync/push.d.ts +18 -0
  129. package/dist/commands/memory/sync/push.js +115 -0
  130. package/dist/commands/memory/sync/resolve.d.ts +23 -0
  131. package/dist/commands/memory/sync/resolve.js +27 -0
  132. package/dist/commands/memory/sync/status.d.ts +9 -0
  133. package/dist/commands/memory/sync/status.js +22 -0
  134. package/dist/commands/memory/topics/archive.d.ts +20 -0
  135. package/dist/commands/memory/topics/archive.js +29 -0
  136. package/dist/commands/memory/topics/create.d.ts +23 -0
  137. package/dist/commands/memory/topics/create.js +46 -0
  138. package/dist/commands/memory/topics/delete.d.ts +22 -0
  139. package/dist/commands/memory/topics/delete.js +30 -0
  140. package/dist/commands/memory/topics/forget.d.ts +22 -0
  141. package/dist/commands/memory/topics/forget.js +29 -0
  142. package/dist/commands/memory/topics/list.d.ts +13 -0
  143. package/dist/commands/memory/topics/list.js +22 -0
  144. package/dist/commands/memory/topics/move.d.ts +22 -0
  145. package/dist/commands/memory/topics/move.js +26 -0
  146. package/dist/commands/memory/topics/show.d.ts +17 -0
  147. package/dist/commands/memory/topics/show.js +21 -0
  148. package/dist/commands/memory/topics/update.d.ts +23 -0
  149. package/dist/commands/memory/topics/update.js +27 -0
  150. package/dist/commands/memory/tree.d.ts +5 -2
  151. package/dist/commands/memory/tree.js +20 -2
  152. package/dist/commands/memory/update.d.ts +1 -1
  153. package/dist/commands/memory/versions/list.d.ts +16 -0
  154. package/dist/commands/memory/versions/list.js +22 -0
  155. package/dist/commands/memory/versions/redact.d.ts +21 -0
  156. package/dist/commands/memory/versions/redact.js +22 -0
  157. package/dist/commands/memory/versions/restore.d.ts +20 -0
  158. package/dist/commands/memory/versions/restore.js +16 -0
  159. package/dist/commands/memory/versions/show.d.ts +15 -0
  160. package/dist/commands/memory/versions/show.js +17 -0
  161. package/dist/commands/messages/list.js +25 -8
  162. package/dist/commands/messages/show.js +10 -0
  163. package/dist/commands/spaces/update.js +16 -12
  164. package/dist/commands/spaces/work-sync/reconcile.d.ts +38 -0
  165. package/dist/commands/spaces/work-sync/reconcile.js +90 -0
  166. package/dist/commands/spaces/work-sync/telemetry.d.ts +29 -0
  167. package/dist/commands/spaces/work-sync/telemetry.js +96 -0
  168. package/dist/commands/store/install.js +5 -1
  169. package/dist/commands/store/releases.js +1 -1
  170. package/dist/commands/store/update.js +5 -1
  171. package/dist/commands/subscriptions/cancel.js +5 -1
  172. package/dist/commands/subscriptions/health.js +5 -1
  173. package/dist/commands/subscriptions/status.js +5 -1
  174. package/dist/commands/subscriptions/subscribe.js +5 -1
  175. package/dist/commands/tasks/activity.d.ts +2 -3
  176. package/dist/commands/tasks/activity.js +20 -6
  177. package/dist/commands/tasks/complete.d.ts +22 -150
  178. package/dist/commands/tasks/complete.js +174 -599
  179. package/dist/commands/tasks/create.d.ts +6 -0
  180. package/dist/commands/tasks/create.js +114 -4
  181. package/dist/commands/tasks/deliverable/add.d.ts +8 -0
  182. package/dist/commands/tasks/deliverable/add.js +62 -11
  183. package/dist/commands/tasks/deliverable/confirm.d.ts +5 -5
  184. package/dist/commands/tasks/deliverable/confirm.js +9 -18
  185. package/dist/commands/tasks/deliverable/list.d.ts +12 -0
  186. package/dist/commands/tasks/deliverable/list.js +58 -0
  187. package/dist/commands/tasks/events/append.d.ts +2 -0
  188. package/dist/commands/tasks/events/append.js +41 -6
  189. package/dist/commands/tasks/events/list.d.ts +1 -0
  190. package/dist/commands/tasks/events/list.js +1 -0
  191. package/dist/commands/tasks/events/tail.d.ts +1 -0
  192. package/dist/commands/tasks/events/tail.js +1 -0
  193. package/dist/commands/tasks/expectations/assess.d.ts +21 -0
  194. package/dist/commands/tasks/expectations/assess.js +103 -0
  195. package/dist/commands/tasks/expectations.js +121 -25
  196. package/dist/commands/tasks/judge.d.ts +1 -0
  197. package/dist/commands/tasks/judge.js +2 -1
  198. package/dist/commands/tasks/output.d.ts +1 -11
  199. package/dist/commands/tasks/output.js +80 -141
  200. package/dist/commands/tasks/report.d.ts +3 -3
  201. package/dist/commands/tasks/report.js +66 -41
  202. package/dist/commands/tasks/resource/add.d.ts +23 -0
  203. package/dist/commands/tasks/resource/add.js +76 -0
  204. package/dist/commands/tasks/resource/list.d.ts +13 -0
  205. package/dist/commands/tasks/resource/list.js +41 -0
  206. package/dist/commands/tasks/result/show.d.ts +13 -0
  207. package/dist/commands/tasks/result/show.js +64 -0
  208. package/dist/commands/tasks/result/submit.d.ts +26 -0
  209. package/dist/commands/tasks/result/submit.js +134 -0
  210. package/dist/commands/tasks/resume/save.d.ts +16 -0
  211. package/dist/commands/tasks/resume/save.js +69 -0
  212. package/dist/commands/tasks/resume/show.d.ts +13 -0
  213. package/dist/commands/tasks/resume/show.js +35 -0
  214. package/dist/commands/tasks/review.d.ts +17 -0
  215. package/dist/commands/tasks/review.js +54 -0
  216. package/dist/commands/tasks/runs.js +5 -0
  217. package/dist/commands/tasks/self-schedule.js +7 -4
  218. package/dist/commands/tasks/show.js +19 -0
  219. package/dist/commands/tasks/timeline.d.ts +2 -2
  220. package/dist/commands/tasks/timeline.js +19 -24
  221. package/dist/commands/tasks/updates/add.d.ts +22 -0
  222. package/dist/commands/tasks/updates/add.js +122 -0
  223. package/dist/commands/tasks/updates/list.d.ts +15 -0
  224. package/dist/commands/tasks/updates/list.js +57 -0
  225. package/dist/commands/tasks/waive.d.ts +1 -0
  226. package/dist/commands/tasks/waive.js +2 -1
  227. package/dist/lib/agentic-stream.d.ts +257 -0
  228. package/dist/lib/agentic-stream.js +490 -33
  229. package/dist/lib/balance.d.ts +8 -0
  230. package/dist/lib/commitment-product.d.ts +10 -1
  231. package/dist/lib/commitment-product.js +66 -2
  232. package/dist/lib/commitments.d.ts +2 -1
  233. package/dist/lib/commitments.js +1 -0
  234. package/dist/lib/conversation-search.d.ts +3 -0
  235. package/dist/lib/conversation-search.js +75 -0
  236. package/dist/lib/dedicated-machines.d.ts +66 -0
  237. package/dist/lib/dedicated-machines.js +161 -0
  238. package/dist/lib/execution-target.d.ts +21 -0
  239. package/dist/lib/execution-target.js +22 -6
  240. package/dist/lib/harnesses.d.ts +87 -6
  241. package/dist/lib/harnesses.js +32 -1
  242. package/dist/lib/hosted-machines.js +9 -0
  243. package/dist/lib/inbox.d.ts +2 -1
  244. package/dist/lib/machines.d.ts +17 -0
  245. package/dist/lib/machines.js +29 -0
  246. package/dist/lib/managed-agent-keys.d.ts +104 -0
  247. package/dist/lib/managed-agent-keys.js +50 -0
  248. package/dist/lib/memory-scope.d.ts +4 -3
  249. package/dist/lib/memory-scope.js +9 -9
  250. package/dist/lib/memory-sync.d.ts +114 -0
  251. package/dist/lib/memory-sync.js +730 -0
  252. package/dist/lib/message-provenance.d.ts +42 -0
  253. package/dist/lib/message-provenance.js +89 -0
  254. package/dist/lib/scoped-memory-command.d.ts +68 -0
  255. package/dist/lib/scoped-memory-command.js +183 -0
  256. package/dist/lib/session-task-endpoints.d.ts +1 -1
  257. package/dist/lib/session-task-endpoints.js +7 -0
  258. package/dist/lib/sky-code-broker.d.ts +47 -0
  259. package/dist/lib/sky-code-broker.js +50 -0
  260. package/dist/lib/sky-code-doctor.js +10 -1
  261. package/dist/lib/task-artifact-flags.d.ts +2 -0
  262. package/dist/lib/task-artifact-flags.js +7 -0
  263. package/dist/lib/task-execution.d.ts +4 -5
  264. package/dist/lib/task-execution.js +4 -5
  265. package/dist/lib/task-extras.d.ts +1 -5
  266. package/dist/lib/task-extras.js +1 -5
  267. package/dist/lib/task-legacy.d.ts +24 -0
  268. package/dist/lib/task-legacy.js +48 -0
  269. package/dist/lib/task-transcript.d.ts +5 -7
  270. package/dist/lib/task-transcript.js +8 -16
  271. package/dist/lib/tasks.d.ts +39 -21
  272. package/dist/lib/tasks.js +64 -21
  273. package/dist/lib/triggers.d.ts +39 -1
  274. package/dist/lib/triggers.js +70 -2
  275. package/dist/lib/usage-discovery.d.ts +17 -1
  276. package/dist/lib/usage-discovery.js +17 -1
  277. package/dist/lib/work-sync.d.ts +70 -0
  278. package/dist/lib/work-sync.js +29 -0
  279. package/dist/node_modules/@skrr-ai/data-provider/index.js +3760 -3621
  280. package/oclif.manifest.json +14653 -7813
  281. package/package.json +26 -5
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const scoped_memory_command_1 = require("../../../lib/scoped-memory-command");
5
+ class MemoryTopicsShow extends scoped_memory_command_1.ScopedMemoryCommand {
6
+ static description = 'Show one semantic Memory topic';
7
+ static args = { id: core_1.Args.string({ required: true, ignoreStdin: true }) };
8
+ static flags = {
9
+ ...scoped_memory_command_1.scopedMemoryFlags,
10
+ level: core_1.Flags.string({ options: ['L0', 'L1', 'L2'], default: 'L1' }),
11
+ facts: core_1.Flags.boolean(),
12
+ };
13
+ async run() {
14
+ this.requireAuth();
15
+ const { args, flags } = await this.parse(MemoryTopicsShow);
16
+ const store = await this.resolveStore(flags);
17
+ const result = await this.memoryApi(flags.agent, `/stores/${store.id}/topics/${encodeURIComponent(args.id)}${this.query(flags, { level: flags.level, includeFacts: flags.facts })}`);
18
+ this.print(result, flags.json, `${result.node.path}\n${result.representation?.content || '(no projection)'}`);
19
+ }
20
+ }
21
+ exports.default = MemoryTopicsShow;
@@ -0,0 +1,23 @@
1
+ import { ScopedMemoryCommand } from '../../../lib/scoped-memory-command';
2
+ export default class MemoryTopicsUpdate extends ScopedMemoryCommand {
3
+ static description: string;
4
+ static args: {
5
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static flags: {
8
+ content: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
9
+ confidence: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ source: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ 'expected-version': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
12
+ 'authorization-generation': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
13
+ 'idempotency-key': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
14
+ 'privacy-approval': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
15
+ 'dry-run': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
16
+ agent: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
17
+ space: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
18
+ store: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
19
+ scope: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
20
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
21
+ };
22
+ run(): Promise<void>;
23
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const scoped_memory_command_1 = require("../../../lib/scoped-memory-command");
5
+ class MemoryTopicsUpdate extends scoped_memory_command_1.ScopedMemoryCommand {
6
+ static description = 'Reconsolidate a Memory topic using optimistic version CAS';
7
+ static args = { id: core_1.Args.string({ required: true, ignoreStdin: true }) };
8
+ static flags = {
9
+ ...scoped_memory_command_1.versionedMutationFlags,
10
+ content: core_1.Flags.string({ required: true }),
11
+ confidence: core_1.Flags.string(),
12
+ source: core_1.Flags.string(),
13
+ };
14
+ async run() {
15
+ this.requireAuth();
16
+ const { args, flags } = await this.parse(MemoryTopicsUpdate);
17
+ const result = await this.mutation('reconsolidate', flags, {
18
+ memoryId: args.id,
19
+ content: flags.content,
20
+ confidence: flags.confidence === undefined ? undefined : Number(flags.confidence),
21
+ source: flags.source,
22
+ episode: null,
23
+ });
24
+ this.print(result, flags.json, flags['dry-run'] ? 'Dry run: no topic updated.' : `Updated Memory topic ${args.id}.`);
25
+ }
26
+ }
27
+ exports.default = MemoryTopicsUpdate;
@@ -1,10 +1,13 @@
1
- import { BaseCommand } from '../../base-command';
2
- export default class MemoryTree extends BaseCommand {
1
+ import { ScopedMemoryCommand } from '../../lib/scoped-memory-command';
2
+ export default class MemoryTree extends ScopedMemoryCommand {
3
3
  static description: string;
4
4
  static flags: {
5
5
  agent: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
6
6
  archived: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
7
7
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
+ store: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
9
+ scope: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ space: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
8
11
  };
9
12
  run(): Promise<void>;
10
13
  }
@@ -2,17 +2,33 @@
2
2
  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
- const base_command_1 = require("../../base-command");
6
- class MemoryTree extends base_command_1.BaseCommand {
5
+ const scoped_memory_command_1 = require("../../lib/scoped-memory-command");
6
+ class MemoryTree extends scoped_memory_command_1.ScopedMemoryCommand {
7
7
  static description = 'Browse an agent-maintained semantic memory tree and its L0 summaries';
8
8
  static flags = {
9
9
  agent: core_1.Flags.string({ description: 'Agent ID', required: true }),
10
10
  archived: core_1.Flags.boolean({ description: 'Include archived nodes', default: false }),
11
11
  json: core_1.Flags.boolean({ description: 'Output as JSON' }),
12
+ store: core_1.Flags.string({ description: 'Canonical Memory Store ID' }),
13
+ scope: core_1.Flags.string({ description: 'Canonical owner scope: agent:<id> or space:<id>' }),
14
+ space: core_1.Flags.string({ description: 'Current Space context' }),
12
15
  };
13
16
  async run() {
14
17
  this.requireAuth();
15
18
  const { flags } = await this.parse(MemoryTree);
19
+ if (flags.store || flags.scope) {
20
+ const store = await this.resolveStore(flags);
21
+ const result = await this.memoryApi(flags.agent, `/stores/${store.id}/tree${this.query(flags, { includeArchived: flags.archived })}`);
22
+ if (flags.json)
23
+ return this.log(JSON.stringify({ storeId: store.id, ...result }, null, 2));
24
+ for (const node of result.nodes) {
25
+ const depth = node.path === '/' ? 0 : node.path.split('/').filter(Boolean).length;
26
+ this.log(`${' '.repeat(depth)}${node.nodeKind === 'folder' ? '▸' : '•'} ${node.title} ${node.path}`);
27
+ }
28
+ if (!result.nodes.length)
29
+ this.log('No Memory nodes.');
30
+ return;
31
+ }
16
32
  let response;
17
33
  try {
18
34
  response = await data_provider_1.dataService.getAgentMemoryWorkspaceTree(flags.agent, {
@@ -34,6 +50,8 @@ class MemoryTree extends base_command_1.BaseCommand {
34
50
  if (abstract)
35
51
  this.log(`${' '.repeat(depth + 1)}${abstract}`);
36
52
  }
53
+ if (!response.nodes.length)
54
+ this.log('No Memory nodes.');
37
55
  this.printAgentUrl(flags.agent);
38
56
  }
39
57
  }
@@ -8,7 +8,7 @@ export default class MemoryUpdate extends BaseCommand {
8
8
  static flags: {
9
9
  agent: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
10
  tier: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
- workspace: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ 'pool-workspace': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
12
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
13
13
  value: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
14
14
  rename: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
@@ -0,0 +1,16 @@
1
+ import { ScopedMemoryCommand } from '../../../lib/scoped-memory-command';
2
+ export default class MemoryVersionsList extends ScopedMemoryCommand {
3
+ static description: string;
4
+ static args: {
5
+ memory: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static flags: {
8
+ limit: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
9
+ agent: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ space: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ store: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
+ scope: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
13
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
14
+ };
15
+ run(): Promise<void>;
16
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const scoped_memory_command_1 = require("../../../lib/scoped-memory-command");
5
+ class MemoryVersionsList extends scoped_memory_command_1.ScopedMemoryCommand {
6
+ static description = 'List immutable versions for one Memory topic';
7
+ static args = { memory: core_1.Args.string({ required: true, ignoreStdin: true }) };
8
+ static flags = { ...scoped_memory_command_1.scopedMemoryFlags, limit: core_1.Flags.integer({ default: 100 }) };
9
+ async run() {
10
+ this.requireAuth();
11
+ const { args, flags } = await this.parse(MemoryVersionsList);
12
+ const store = await this.resolveStore(flags);
13
+ const result = await this.memoryApi(flags.agent, `/stores/${store.id}/versions${this.query(flags, { memoryId: args.memory, limit: flags.limit })}`);
14
+ if (flags.json)
15
+ return this.log(JSON.stringify(result, null, 2));
16
+ for (const version of result.versions)
17
+ this.log(`${version.id} ${version.operation} ${version.createdAt} ${version.contentHash || '[redacted]'}`);
18
+ if (!result.versions.length)
19
+ this.log('No Memory versions.');
20
+ }
21
+ }
22
+ exports.default = MemoryVersionsList;
@@ -0,0 +1,21 @@
1
+ import { ScopedMemoryCommand } from '../../../lib/scoped-memory-command';
2
+ export default class MemoryVersionsRedact extends ScopedMemoryCommand {
3
+ static description: string;
4
+ static args: {
5
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static flags: {
8
+ yes: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
+ 'authorization-generation': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ 'expected-version': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ 'idempotency-key': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
+ 'privacy-approval': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
13
+ 'dry-run': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
14
+ agent: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
15
+ space: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
16
+ store: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
17
+ scope: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
18
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
19
+ };
20
+ run(): Promise<void>;
21
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const prompt_1 = require("../../../lib/prompt");
5
+ const scoped_memory_command_1 = require("../../../lib/scoped-memory-command");
6
+ class MemoryVersionsRedact extends scoped_memory_command_1.ScopedMemoryCommand {
7
+ static description = 'Irreversibly redact the content of an exact historical MemoryVersion';
8
+ static args = { id: core_1.Args.string({ required: true, ignoreStdin: true }) };
9
+ static flags = { ...scoped_memory_command_1.mutationFlags, yes: core_1.Flags.boolean({ char: 'y' }) };
10
+ async run() {
11
+ this.requireAuth();
12
+ const { args, flags } = await this.parse(MemoryVersionsRedact);
13
+ if (!flags['dry-run']) {
14
+ const ok = await (0, prompt_1.confirmDestructive)(`Irreversibly redact MemoryVersion ${args.id}?`, flags.yes).catch((error) => this.error(error.message, { exit: error.exit || 7 }));
15
+ if (!ok)
16
+ return this.log('Cancelled.');
17
+ }
18
+ const result = await this.mutation('redact', flags, { versionId: args.id });
19
+ this.print(result, flags.json, flags['dry-run'] ? 'Dry run: no version redacted.' : `Redacted MemoryVersion ${args.id}.`);
20
+ }
21
+ }
22
+ exports.default = MemoryVersionsRedact;
@@ -0,0 +1,20 @@
1
+ import { ScopedMemoryCommand } from '../../../lib/scoped-memory-command';
2
+ export default class MemoryVersionsRestore extends ScopedMemoryCommand {
3
+ static description: string;
4
+ static args: {
5
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static flags: {
8
+ 'expected-version': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
9
+ 'authorization-generation': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ 'idempotency-key': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ 'privacy-approval': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
+ 'dry-run': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
13
+ agent: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
14
+ space: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
15
+ store: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
16
+ scope: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
17
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
18
+ };
19
+ run(): Promise<void>;
20
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const scoped_memory_command_1 = require("../../../lib/scoped-memory-command");
5
+ class MemoryVersionsRestore extends scoped_memory_command_1.ScopedMemoryCommand {
6
+ static description = 'Restore an old version by appending a new current version';
7
+ static args = { id: core_1.Args.string({ required: true, ignoreStdin: true }) };
8
+ static flags = scoped_memory_command_1.versionedMutationFlags;
9
+ async run() {
10
+ this.requireAuth();
11
+ const { args, flags } = await this.parse(MemoryVersionsRestore);
12
+ const result = await this.mutation('restore', flags, { versionId: args.id });
13
+ this.print(result, flags.json, flags['dry-run'] ? 'Dry run: no version restored.' : `Restored MemoryVersion ${args.id}.`);
14
+ }
15
+ }
16
+ exports.default = MemoryVersionsRestore;
@@ -0,0 +1,15 @@
1
+ import { ScopedMemoryCommand } from '../../../lib/scoped-memory-command';
2
+ export default class MemoryVersionsShow extends ScopedMemoryCommand {
3
+ static description: string;
4
+ static args: {
5
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static flags: {
8
+ agent: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
9
+ space: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ store: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ scope: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
13
+ };
14
+ run(): Promise<void>;
15
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const scoped_memory_command_1 = require("../../../lib/scoped-memory-command");
5
+ class MemoryVersionsShow extends scoped_memory_command_1.ScopedMemoryCommand {
6
+ static description = 'Show one immutable MemoryVersion';
7
+ static args = { id: core_1.Args.string({ required: true, ignoreStdin: true }) };
8
+ static flags = scoped_memory_command_1.scopedMemoryFlags;
9
+ async run() {
10
+ this.requireAuth();
11
+ const { args, flags } = await this.parse(MemoryVersionsShow);
12
+ const store = await this.resolveStore(flags);
13
+ const result = await this.memoryApi(flags.agent, `/stores/${store.id}/versions/${encodeURIComponent(args.id)}${this.query(flags)}`);
14
+ this.print(result, flags.json, `${result.id} ${result.operation}\n${JSON.stringify(result.payloadSnapshot, null, 2)}`);
15
+ }
16
+ }
17
+ exports.default = MemoryVersionsShow;
@@ -6,6 +6,7 @@ const data_provider_1 = require("@skrr-ai/data-provider");
6
6
  const base_command_1 = require("../../base-command");
7
7
  const format_1 = require("../../lib/format");
8
8
  const task_transcript_1 = require("../../lib/task-transcript");
9
+ const message_provenance_1 = require("../../lib/message-provenance");
9
10
  /**
10
11
  * OSK-2058 — resolve the conversation id from either calling convention.
11
12
  *
@@ -114,20 +115,36 @@ class MessagesList extends base_command_1.BaseCommand {
114
115
  }
115
116
  // TMessage has historically varied its shape across versions — accept
116
117
  // multiple field names and coerce to strings.
117
- const rows = selected.map((m) => ({
118
- when: m.createdAt ? new Date(String(m.createdAt)).toISOString().slice(11, 19) : '-',
119
- role: String(m.sender ?? m.role ?? (m.isCreatedByUser ? 'user' : 'assistant')),
120
- text: String(m.text ?? m.content ?? '')
121
- .replace(/\s+/g, ' ')
122
- .trim(),
123
- id: String(m.messageId ?? m._id ?? m.id ?? '-'),
124
- }));
118
+ // OSK-7708 an unattended run's answer arrives with no question above it,
119
+ // so the row itself has to say what caused it. Without this a scheduled
120
+ // thread reads as an agent volunteering five answers to nothing.
121
+ let unattended = 0;
122
+ const rows = selected.map((m) => {
123
+ const provenance = (0, message_provenance_1.messageProvenance)(m);
124
+ if (provenance)
125
+ unattended += 1;
126
+ return {
127
+ when: m.createdAt ? new Date(String(m.createdAt)).toISOString().slice(11, 19) : '-',
128
+ role: String(m.sender ?? m.role ?? (m.isCreatedByUser ? 'user' : 'assistant')),
129
+ via: provenance ? (0, message_provenance_1.provenanceLabel)(provenance) : '-',
130
+ text: String(m.text ?? m.content ?? '')
131
+ .replace(/\s+/g, ' ')
132
+ .trim(),
133
+ id: String(m.messageId ?? m._id ?? m.id ?? '-'),
134
+ };
135
+ });
125
136
  (0, format_1.renderTable)(rows, [
126
137
  { key: 'when', header: 'TIME' },
127
138
  { key: 'role', header: 'ROLE', maxWidth: 12 },
139
+ { key: 'via', header: 'VIA', maxWidth: 10 },
128
140
  { key: 'text', header: 'TEXT', maxWidth: 80 },
129
141
  { key: 'id', header: 'ID' },
130
142
  ], (line) => this.log(line));
143
+ if (unattended > 0) {
144
+ this.log('');
145
+ this.log(`${unattended} message${unattended === 1 ? '' : 's'} came from an unattended run, so no prompt precedes ${unattended === 1 ? 'it' : 'them'} here.`);
146
+ this.log(` skrr messages show ${convoId} <message-id> # what the run was asked`);
147
+ }
131
148
  // Never let a cap read as "this is the whole transcript".
132
149
  if (truncated) {
133
150
  this.log('');
@@ -4,6 +4,7 @@ exports.firstMessageFromDetailResponse = firstMessageFromDetailResponse;
4
4
  const core_1 = require("@oclif/core");
5
5
  const data_provider_1 = require("@skrr-ai/data-provider");
6
6
  const base_command_1 = require("../../base-command");
7
+ const message_provenance_1 = require("../../lib/message-provenance");
7
8
  /** The detail endpoint preserves the legacy raw-array response while the list
8
9
  * endpoint returns an envelope. Accept both so an ID emitted by messages list
9
10
  * is always usable by messages show. */
@@ -63,6 +64,15 @@ class MessagesShow extends base_command_1.BaseCommand {
63
64
  this.log(`Updated: ${formatTime(msg.updatedAt)}`);
64
65
  if (msg.tokenCount !== undefined)
65
66
  this.log(`Tokens: ${msg.tokenCount}`);
67
+ // OSK-7682 — an unattended run persists no user message, so this row is the
68
+ // only place its instruction can be read. Print the question before the
69
+ // answer, which is the order a reader needs them in.
70
+ const provenance = (0, message_provenance_1.messageProvenance)(msg);
71
+ if (provenance) {
72
+ for (const line of (0, message_provenance_1.provenanceLines)(provenance)) {
73
+ this.log(line);
74
+ }
75
+ }
66
76
  this.log('');
67
77
  this.log('Text:');
68
78
  this.log(String(msg.text ?? msg.content ?? ''));
@@ -76,7 +76,9 @@ class SpacesUpdate extends base_command_1.BaseCommand {
76
76
  description: tasks_1.EXPECT_FLAG_HELP +
77
77
  ' This is the space DEFAULT, and it is where the contract actually gets set: nobody ' +
78
78
  'declares one per task, but a space default is configured once and then holds. A ' +
79
- 'per-task --expect wins. Merged into deliveryPolicy without clobbering its other fields.',
79
+ 'per-task --expect wins. Merged into deliveryPolicy without clobbering its other ' +
80
+ 'fields. Replaces the whole list; pass "clear" to remove the default so new tasks ' +
81
+ 'inherit nothing.',
80
82
  }),
81
83
  'delivery-mode': core_1.Flags.string({
82
84
  options: ['none', 'branch', 'pr', 'pr_automerge', 'direct'],
@@ -132,21 +134,23 @@ class SpacesUpdate extends base_command_1.BaseCommand {
132
134
  // Parse before any write: a bad spec must fail here, not reach the server
133
135
  // as a silently-dropped field. A space default nobody is enforcing is worse
134
136
  // than none, because every task under it then shows a contract that isn't real.
135
- let defaultExpectations;
136
- if (flags['default-expect'] !== undefined && flags['default-expect'].length > 0) {
137
- const parsed = (0, tasks_1.parseExpectations)(flags['default-expect']);
138
- if (!parsed.ok) {
139
- this.error(parsed.error, { exit: 1 });
140
- }
141
- else {
142
- defaultExpectations = parsed.value;
143
- }
137
+ const resolvedDefaults = (0, tasks_1.resolveDefaultExpectations)(flags['default-expect']);
138
+ if (!resolvedDefaults.ok) {
139
+ this.error(resolvedDefaults.error, { exit: 1 });
144
140
  }
141
+ const defaultExpectations = resolvedDefaults.ok ? resolvedDefaults.value : undefined;
145
142
  const isolation = flags['worktree-isolation'];
146
143
  const deliveryMode = flags['delivery-mode'];
147
144
  const integrationBranch = flags['integration-branch'];
148
145
  const autoMergeTier = flags['auto-merge-tier'];
149
- if (isolation || defaultExpectations || deliveryMode || integrationBranch || autoMergeTier) {
146
+ // `defaultExpectations === null` is a real instruction (remove the default), so
147
+ // it must reach the policy merge — a truthiness test dropped it silently and
148
+ // made `clear` a no-op that printed success.
149
+ if (isolation ||
150
+ defaultExpectations !== undefined ||
151
+ deliveryMode ||
152
+ integrationBranch ||
153
+ autoMergeTier) {
150
154
  let basePolicy = {};
151
155
  if (payload.deliveryPolicy && typeof payload.deliveryPolicy === 'object') {
152
156
  basePolicy = { ...payload.deliveryPolicy };
@@ -169,7 +173,7 @@ class SpacesUpdate extends base_command_1.BaseCommand {
169
173
  ...(deliveryMode ? { mode: deliveryMode } : {}),
170
174
  ...(integrationBranch ? { integrationBranch } : {}),
171
175
  ...(autoMergeTier ? { autoMergeTrustTier: autoMergeTier } : {}),
172
- ...(defaultExpectations ? { defaultExpectations } : {}),
176
+ ...(defaultExpectations !== undefined ? { defaultExpectations } : {}),
173
177
  };
174
178
  }
175
179
  // Goal links are NOT part of the PATCH body — the server rejects a PATCH
@@ -0,0 +1,38 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ /**
3
+ * `skrr spaces work-sync reconcile <space>` — answer the divergence question
4
+ * without a browser, and repair what it finds.
5
+ *
6
+ * Root `CLAUDE.md` records that two Work Sync exit criteria were knowingly
7
+ * overridden, and that "an unexplained board divergence is a live hypothesis, not
8
+ * an impossibility, and is the first thing to suspect." `work-sync telemetry`
9
+ * reports whether the browser's convergence detector has ever RUN. This answers
10
+ * the underlying question directly: it compares every published projection entry
11
+ * against authoritative task truth server-side, and `upserts` is the count that
12
+ * disagreed.
13
+ *
14
+ * That matters because the detector only runs where a board is open. A Space
15
+ * nobody has visited since the detector shipped reports zero comparisons forever,
16
+ * which is indistinguishable from health in the telemetry and is not health. This
17
+ * command needs no board, no browser, and no visitor.
18
+ *
19
+ * IT WRITES, and the help says so plainly rather than burying it. The endpoint is
20
+ * editor-gated because it republishes projection rows that clients will see. It
21
+ * never mutates task truth — the projection is derived, and a republished card is
22
+ * a corrected copy of a Task nobody touched — and on a healthy scope it finds
23
+ * nothing and changes nothing, so the verification and the repair are the same
24
+ * call. There is deliberately no dry-run flag to add: a read-only variant would be
25
+ * a second implementation of the comparison, which is how the two answers start
26
+ * disagreeing.
27
+ */
28
+ export default class SpacesWorkSyncReconcile extends BaseCommand {
29
+ static description: string;
30
+ static examples: string[];
31
+ static args: {
32
+ space: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
33
+ };
34
+ static flags: {
35
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
36
+ };
37
+ run(): Promise<void>;
38
+ }
@@ -0,0 +1,90 @@
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 work_sync_1 = require("../../../lib/work-sync");
6
+ /**
7
+ * `skrr spaces work-sync reconcile <space>` — answer the divergence question
8
+ * without a browser, and repair what it finds.
9
+ *
10
+ * Root `CLAUDE.md` records that two Work Sync exit criteria were knowingly
11
+ * overridden, and that "an unexplained board divergence is a live hypothesis, not
12
+ * an impossibility, and is the first thing to suspect." `work-sync telemetry`
13
+ * reports whether the browser's convergence detector has ever RUN. This answers
14
+ * the underlying question directly: it compares every published projection entry
15
+ * against authoritative task truth server-side, and `upserts` is the count that
16
+ * disagreed.
17
+ *
18
+ * That matters because the detector only runs where a board is open. A Space
19
+ * nobody has visited since the detector shipped reports zero comparisons forever,
20
+ * which is indistinguishable from health in the telemetry and is not health. This
21
+ * command needs no board, no browser, and no visitor.
22
+ *
23
+ * IT WRITES, and the help says so plainly rather than burying it. The endpoint is
24
+ * editor-gated because it republishes projection rows that clients will see. It
25
+ * never mutates task truth — the projection is derived, and a republished card is
26
+ * a corrected copy of a Task nobody touched — and on a healthy scope it finds
27
+ * nothing and changes nothing, so the verification and the repair are the same
28
+ * call. There is deliberately no dry-run flag to add: a read-only variant would be
29
+ * a second implementation of the comparison, which is how the two answers start
30
+ * disagreeing.
31
+ */
32
+ class SpacesWorkSyncReconcile extends base_command_1.BaseCommand {
33
+ static description = 'Compare a Space Work Sync projection against task truth and repair what diverged (writes)';
34
+ static examples = [
35
+ '<%= config.bin %> spaces work-sync reconcile <space-id>',
36
+ '<%= config.bin %> spaces work-sync reconcile <space-id> --json',
37
+ ];
38
+ static args = {
39
+ space: core_1.Args.string({ description: 'Space ID', required: true, ignoreStdin: true }),
40
+ };
41
+ static flags = {
42
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
43
+ };
44
+ async run() {
45
+ this.requireAuth();
46
+ const { args, flags } = await this.parse(SpacesWorkSyncReconcile);
47
+ let result;
48
+ try {
49
+ result = await (0, work_sync_1.reconcileWorkSyncScope)(args.space);
50
+ }
51
+ catch (err) {
52
+ this.handleApiError(err);
53
+ return;
54
+ }
55
+ if (flags.json) {
56
+ this.log(JSON.stringify(result, null, 2));
57
+ return;
58
+ }
59
+ const diverged = (result.upserts || 0) +
60
+ (result.removes || 0) +
61
+ (result.summaryUpserts || 0) +
62
+ (result.summaryRemoves || 0);
63
+ // Lead with the verdict, because it is the whole reason to run this. A table
64
+ // of four zeros under no summary line makes the reader do the addition.
65
+ if (diverged === 0) {
66
+ this.log('No divergence: every published projection entry matches task truth.');
67
+ }
68
+ else {
69
+ this.log(`Divergence found and repaired: ${diverged} ${diverged === 1 ? 'entry' : 'entries'}.`);
70
+ this.log('');
71
+ this.log(` stale task cards republished ${result.upserts || 0}`);
72
+ this.log(` task cards removed ${result.removes || 0}`);
73
+ this.log(` stale summaries republished ${result.summaryUpserts || 0}`);
74
+ this.log(` summaries removed ${result.summaryRemoves || 0}`);
75
+ }
76
+ if (result.backlog > 0) {
77
+ this.log('');
78
+ this.log(`${result.backlog} repair ${result.backlog === 1 ? 'row was' : 'rows were'} already queued ` +
79
+ 'by earlier publish failures. A successful run settles them; one that failed again is kept.');
80
+ }
81
+ if (result.truncated) {
82
+ this.log('');
83
+ // Never let a partial pass read as a clean one. The scope read is capped at
84
+ // 1000 rows, so a larger Space was only checked as far as the cap.
85
+ this.log('PARTIAL: this Space is larger than the 1000-row reconciliation cap, so the ' +
86
+ 'verdict above covers a prefix of it and not the whole Space.');
87
+ }
88
+ }
89
+ }
90
+ exports.default = SpacesWorkSyncReconcile;
@@ -0,0 +1,29 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ /**
3
+ * `skrr spaces work-sync telemetry <space>` — Work Sync's own exit criteria.
4
+ *
5
+ * Work Sync v1 is ON at 100% (owner decision, 2026-09-08) with two criteria
6
+ * knowingly overridden rather than satisfied. The server has computed the verdict
7
+ * the whole time, and nothing outside the API could read it — so checking the
8
+ * criteria meant querying the production database by hand, which is why nobody
9
+ * did. An exit criterion that can only be read by hand is one that does not get
10
+ * read.
11
+ *
12
+ * The verdict is printed as the server decided it. This command does not
13
+ * re-derive it: the same rule that keeps `tasks expectations` reading the server's
14
+ * judgement rather than computing its own applies here, and for the same reason —
15
+ * a CLI that reached a different conclusion from the service would leave the
16
+ * reader unable to tell which was lying.
17
+ */
18
+ export default class SpacesWorkSyncTelemetry extends BaseCommand {
19
+ static description: string;
20
+ static examples: string[];
21
+ static args: {
22
+ space: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
23
+ };
24
+ static flags: {
25
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
26
+ limit: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
27
+ };
28
+ run(): Promise<void>;
29
+ }