@skrr-ai/cli 0.1.146 → 0.1.148

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 (289) hide show
  1. package/dist/base-command.js +38 -21
  2. package/dist/commands/agent/message/send.d.ts +11 -0
  3. package/dist/commands/agent/message/send.js +34 -8
  4. package/dist/commands/agent-worker.js +2 -1
  5. package/dist/commands/agents/activity.js +2 -1
  6. package/dist/commands/agents/badge.js +10 -5
  7. package/dist/commands/agents/categories/index.js +2 -1
  8. package/dist/commands/agents/chat.d.ts +1 -0
  9. package/dist/commands/agents/chat.js +29 -1
  10. package/dist/commands/agents/create.js +4 -1
  11. package/dist/commands/agents/overview.js +2 -1
  12. package/dist/commands/agents/releases/create.js +2 -1
  13. package/dist/commands/agents/schedule-overview.js +3 -1
  14. package/dist/commands/agents/schedule.js +2 -1
  15. package/dist/commands/agents/spawn.js +9 -6
  16. package/dist/commands/agents/tools/auth.js +2 -1
  17. package/dist/commands/agents/tools/calls.js +2 -1
  18. package/dist/commands/agents/triggers/policy.js +11 -1
  19. package/dist/commands/agents/visibility.js +2 -1
  20. package/dist/commands/balance/show.js +28 -5
  21. package/dist/commands/balance/statement.js +2 -1
  22. package/dist/commands/commands.js +2 -1
  23. package/dist/commands/commitments/create.js +2 -1
  24. package/dist/commands/commitments/delivery.js +2 -1
  25. package/dist/commands/commitments/doctor.js +2 -1
  26. package/dist/commands/commitments/observations.js +2 -2
  27. package/dist/commands/commitments/operating-review.js +2 -1
  28. package/dist/commands/commitments/pack/preflight.js +2 -1
  29. package/dist/commands/commitments/preflight.js +5 -1
  30. package/dist/commands/commitments/trigger-status.js +2 -1
  31. package/dist/commands/commitments/wake-capabilities.d.ts +2 -0
  32. package/dist/commands/commitments/wake-capabilities.js +16 -0
  33. package/dist/commands/convos/messages.js +2 -1
  34. package/dist/commands/daemon/logs.js +18 -9
  35. package/dist/commands/daemon/usage.js +2 -1
  36. package/dist/commands/dm/messages.js +2 -1
  37. package/dist/commands/dm/thread/messages.js +2 -1
  38. package/dist/commands/dm/threads.js +2 -1
  39. package/dist/commands/doctor.js +2 -1
  40. package/dist/commands/goals/key-results/assess.js +2 -1
  41. package/dist/commands/goals/key-results/history.js +2 -1
  42. package/dist/commands/harnesses/forget.js +2 -1
  43. package/dist/commands/harnesses/show.js +12 -6
  44. package/dist/commands/inbox/index.js +4 -3
  45. package/dist/commands/initiatives/decide.js +2 -1
  46. package/dist/commands/instructions/diff.js +2 -1
  47. package/dist/commands/instructions/show.js +2 -1
  48. package/dist/commands/login.js +4 -2
  49. package/dist/commands/machines/dedicated/cp.js +2 -1
  50. package/dist/commands/machines/dedicated/power/set.js +2 -1
  51. package/dist/commands/machines/show.js +2 -1
  52. package/dist/commands/memory/maintain.js +2 -1
  53. package/dist/commands/memory/read.js +2 -1
  54. package/dist/commands/memory/rebuild-index.js +2 -1
  55. package/dist/commands/memory/rebuild.js +2 -1
  56. package/dist/commands/memory/search.js +2 -1
  57. package/dist/commands/messages/list.js +2 -1
  58. package/dist/commands/revoke-daemon.js +2 -1
  59. package/dist/commands/revoke-token.js +2 -1
  60. package/dist/commands/search/all.js +14 -7
  61. package/dist/commands/search/workspace.js +2 -1
  62. package/dist/commands/set-capabilities.js +2 -1
  63. package/dist/commands/skills/browse.js +8 -2
  64. package/dist/commands/spaces/auto-executor/preview.js +3 -2
  65. package/dist/commands/spaces/auto-executor/runs.js +4 -1
  66. package/dist/commands/spaces/workflow-templates/extract.d.ts +1 -0
  67. package/dist/commands/spaces/workflow-templates/extract.js +9 -1
  68. package/dist/commands/spaces/workflows/events.js +6 -3
  69. package/dist/commands/spaces/workflows/run.js +5 -3
  70. package/dist/commands/spaces/workflows/update.js +2 -1
  71. package/dist/commands/store/gallery-admissions/preview.js +2 -1
  72. package/dist/commands/store/publishers/profile/handle.js +2 -1
  73. package/dist/commands/tasks/comments/anchor.js +23 -9
  74. package/dist/commands/tasks/complete.js +4 -2
  75. package/dist/commands/tasks/create-tree.js +7 -3
  76. package/dist/commands/tasks/create.js +2 -1
  77. package/dist/commands/tasks/deliverable/add.js +2 -1
  78. package/dist/commands/tasks/deliverable/archive.js +2 -1
  79. package/dist/commands/tasks/deliverable/list.js +2 -1
  80. package/dist/commands/tasks/expectations/assess.js +2 -1
  81. package/dist/commands/tasks/labels/create.js +2 -1
  82. package/dist/commands/tasks/preflight.js +4 -2
  83. package/dist/commands/tasks/ready.js +2 -1
  84. package/dist/commands/tasks/result/submit.js +2 -1
  85. package/dist/commands/tasks/updates/add.js +2 -1
  86. package/dist/commands/tasks/wait.js +2 -1
  87. package/dist/commands/token/list.js +2 -1
  88. package/dist/commands/token/mint.js +2 -1
  89. package/dist/commands/wiki/write.js +14 -7
  90. package/dist/hooks/command-not-found.js +2 -1
  91. package/dist/lib/agent-chat-start.d.ts +77 -0
  92. package/dist/lib/agent-chat-start.js +169 -0
  93. package/dist/lib/agent-config.js +2 -1
  94. package/dist/lib/agent-endpoints.js +4 -2
  95. package/dist/lib/agent-evals.js +2 -1
  96. package/dist/lib/agent-guide-reference-gate.js +22 -11
  97. package/dist/lib/agent-guides.js +4 -1
  98. package/dist/lib/agent-instructions.js +5 -1
  99. package/dist/lib/agent-ref.js +8 -4
  100. package/dist/lib/agent-trigger-listing.js +2 -1
  101. package/dist/lib/agentic-stream.js +8 -5
  102. package/dist/lib/api-error-reason.js +2 -1
  103. package/dist/lib/api-fetch.js +5 -3
  104. package/dist/lib/appData.js +6 -6
  105. package/dist/lib/appInstallations.js +10 -5
  106. package/dist/lib/appsCheck.js +2 -1
  107. package/dist/lib/auth-failure.js +2 -1
  108. package/dist/lib/auth-storage.js +2 -1
  109. package/dist/lib/balance.d.ts +33 -3
  110. package/dist/lib/balance.js +39 -7
  111. package/dist/lib/capability-matrix.js +4 -2
  112. package/dist/lib/cli-runtime.js +2 -1
  113. package/dist/lib/code-handover.js +8 -3
  114. package/dist/lib/command-hygiene.js +28 -12
  115. package/dist/lib/command-manifest.js +6 -3
  116. package/dist/lib/commitment-attention-copy.js +2 -1
  117. package/dist/lib/commitment-event-wakes.js +9 -0
  118. package/dist/lib/commitment-product.js +5 -3
  119. package/dist/lib/commitment-terms.js +2 -1
  120. package/dist/lib/commitments.d.ts +13 -0
  121. package/dist/lib/commitments.js +24 -9
  122. package/dist/lib/compasses.js +2 -1
  123. package/dist/lib/completion-index.js +2 -1
  124. package/dist/lib/computer-files.js +8 -6
  125. package/dist/lib/config.js +11 -5
  126. package/dist/lib/conversation-search.js +4 -2
  127. package/dist/lib/daemon-installer.js +6 -2
  128. package/dist/lib/daemon-maintenance.js +2 -1
  129. package/dist/lib/daemon-ref.js +2 -1
  130. package/dist/lib/daemonBroker.js +6 -3
  131. package/dist/lib/daemonBrokerRefusal.js +4 -2
  132. package/dist/lib/daemonHandoff.js +14 -7
  133. package/dist/lib/daemonIslandProfile.js +2 -1
  134. package/dist/lib/dedicated-copy.js +9 -3
  135. package/dist/lib/dedicated-exec.js +2 -1
  136. package/dist/lib/dedicated-keep-awake.js +2 -1
  137. package/dist/lib/dedicated-machines.js +9 -5
  138. package/dist/lib/dedicated-service.js +2 -1
  139. package/dist/lib/dedicated-ssh.js +5 -3
  140. package/dist/lib/deployed-build.js +2 -1
  141. package/dist/lib/device-code.js +4 -3
  142. package/dist/lib/dpop-auth.js +2 -1
  143. package/dist/lib/earnings.js +2 -1
  144. package/dist/lib/exec-runtime-binary.js +5 -3
  145. package/dist/lib/first-party-harness-broker.js +4 -3
  146. package/dist/lib/first-party-harness-managed.js +2 -1
  147. package/dist/lib/first-party-harness-startup-update.js +8 -4
  148. package/dist/lib/first-party-harness-update.js +2 -1
  149. package/dist/lib/first-party-harness.js +2 -1
  150. package/dist/lib/format.js +8 -4
  151. package/dist/lib/git-task.js +10 -5
  152. package/dist/lib/github-tools.js +6 -3
  153. package/dist/lib/harnesses.js +4 -2
  154. package/dist/lib/hosted-machines.js +2 -1
  155. package/dist/lib/html-text.js +33 -16
  156. package/dist/lib/ingress.js +2 -1
  157. package/dist/lib/instruction-blocks.js +2 -1
  158. package/dist/lib/iso-instant.js +5 -3
  159. package/dist/lib/keychain.js +15 -5
  160. package/dist/lib/label-scope.js +2 -1
  161. package/dist/lib/live-runtime-binary.js +10 -7
  162. package/dist/lib/local-skills.js +10 -6
  163. package/dist/lib/login.js +3 -2
  164. package/dist/lib/machine-audit.js +2 -1
  165. package/dist/lib/machine-daemon-log.js +2 -1
  166. package/dist/lib/machine-services.js +2 -1
  167. package/dist/lib/memory-history-session.js +2 -1
  168. package/dist/lib/memory-sync.js +6 -2
  169. package/dist/lib/message-intent.d.ts +10 -0
  170. package/dist/lib/node-adapter.js +4 -2
  171. package/dist/lib/northstars.js +4 -2
  172. package/dist/lib/oauthLogin.js +16 -7
  173. package/dist/lib/open-target.js +8 -4
  174. package/dist/lib/option-hint.js +2 -4
  175. package/dist/lib/outbox.js +2 -1
  176. package/dist/lib/planOutcome.d.ts +5 -3
  177. package/dist/lib/planOutcome.js +7 -4
  178. package/dist/lib/platform-update-local.js +2 -3
  179. package/dist/lib/preflight-copy.js +31 -0
  180. package/dist/lib/rate-limit-retry.js +2 -1
  181. package/dist/lib/reflection.js +2 -1
  182. package/dist/lib/request-field-flags.js +2 -1
  183. package/dist/lib/runtime-start-verification.js +2 -1
  184. package/dist/lib/schedule.js +2 -1
  185. package/dist/lib/scoped-memory-command.js +7 -3
  186. package/dist/lib/search-display.js +11 -4
  187. package/dist/lib/skill-store-pagination.js +2 -1
  188. package/dist/lib/space-notebook.js +5 -3
  189. package/dist/lib/store-listing.js +2 -1
  190. package/dist/lib/task-agent-context-capabilities.js +2 -1
  191. package/dist/lib/task-asset-upload.js +7 -3
  192. package/dist/lib/task-closure.js +2 -1
  193. package/dist/lib/task-economics.js +2 -1
  194. package/dist/lib/task-execution.js +16 -8
  195. package/dist/lib/task-extras.js +4 -2
  196. package/dist/lib/task-operation-watch.js +2 -1
  197. package/dist/lib/task-preflight.js +3 -2
  198. package/dist/lib/task-recurrence-summary.js +4 -2
  199. package/dist/lib/task-runtime-headers.js +10 -5
  200. package/dist/lib/task-transcript.js +3 -2
  201. package/dist/lib/task-transfer.js +9 -5
  202. package/dist/lib/tasks.js +2 -1
  203. package/dist/lib/triggers.d.ts +21 -0
  204. package/dist/lib/triggers.js +41 -3
  205. package/dist/lib/update-check.js +12 -7
  206. package/dist/lib/usage-discovery.js +2 -1
  207. package/dist/lib/usd-micros.js +2 -1
  208. package/dist/lib/web-url.js +2 -1
  209. package/dist/lib/widgetCheck.js +15 -9
  210. package/dist/lib/widgetStaticScan.js +26 -14
  211. package/dist/lib/workflow-run-view.js +5 -3
  212. package/dist/lib/workflow-templates.d.ts +10 -0
  213. package/dist/lib/workflow-templates.js +47 -0
  214. package/dist/lib/write-target.js +4 -5
  215. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/authHelper.js +2 -1
  216. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/commitmentExecutionContract.js +22 -12
  217. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerUse.js +4 -1
  218. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/credentialEnvelope.js +7 -2
  219. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/credentialEnvelopeBridge.js +6 -3
  220. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonConsentProof.js +2 -1
  221. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonPair.js +16 -7
  222. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonWire.js +4 -1
  223. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/desktopDaemonProof.js +4 -3
  224. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/desktopWire.js +2 -1
  225. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/deviceIdentityBridge.js +11 -7
  226. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/deviceKey.js +7 -2
  227. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/dpop.js +8 -3
  228. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarness.js +2 -1
  229. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessChannels.js +4 -3
  230. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessUpdater.js +2 -1
  231. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/githubPushRefusal.js +4 -3
  232. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/guidedUpdate.js +2 -1
  233. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/independentMachineReservation.js +8 -3
  234. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/kek/macos.js +4 -2
  235. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/liveState.js +4 -2
  236. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/loginWithLocalhost.js +2 -1
  237. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/loopbackHttp.js +2 -1
  238. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/machineUuid.js +4 -2
  239. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/profileStateDir.js +2 -1
  240. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/recoveryCode.js +2 -1
  241. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.js +3 -2
  242. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releasePolicy.js +2 -1
  243. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releaseVersions.js +6 -4
  244. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/restartArtifact.js +2 -1
  245. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/spawnEnv.js +2 -1
  246. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/telemetryRedaction.js +7 -4
  247. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/toolApprovalSignature.js +2 -1
  248. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/authHelper.js +2 -1
  249. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/commitmentExecutionContract.js +27 -18
  250. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerUse.js +6 -3
  251. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/credentialEnvelope.js +11 -2
  252. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/credentialEnvelopeBridge.js +6 -3
  253. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonConsentProof.js +2 -1
  254. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonPair.js +20 -8
  255. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonWire.js +5 -4
  256. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/desktopDaemonProof.js +4 -3
  257. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/desktopWire.js +2 -1
  258. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/deviceIdentityBridge.js +11 -7
  259. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/deviceKey.js +11 -2
  260. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/dpop.js +12 -3
  261. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarness.js +2 -1
  262. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessChannels.js +4 -3
  263. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessUpdater.js +2 -1
  264. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/githubPushRefusal.js +4 -3
  265. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/guidedUpdate.js +5 -1
  266. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/independentMachineReservation.js +10 -5
  267. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/kek/macos.js +4 -2
  268. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/liveState.js +4 -2
  269. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/loginWithLocalhost.js +2 -1
  270. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/loopbackHttp.js +2 -1
  271. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/machineUuid.js +4 -2
  272. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/profileStateDir.js +2 -1
  273. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/recoveryCode.js +2 -1
  274. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.js +3 -2
  275. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releasePolicy.js +2 -1
  276. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releaseVersions.js +6 -4
  277. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/restartArtifact.js +2 -1
  278. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/spawnEnv.js +2 -1
  279. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/telemetryRedaction.js +11 -5
  280. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/toolApprovalSignature.js +2 -1
  281. package/dist/node_modules/@skrr-ai/auth-core/package.json +1 -1
  282. package/dist/node_modules/@skrr-ai/data-provider/index.js +20519 -20130
  283. package/dist/node_modules/@skrr-ai/inference-broker/dist/cjs/loopback-server.js +4 -2
  284. package/dist/node_modules/@skrr-ai/inference-broker/dist/cjs/managed-inference-broker.js +10 -6
  285. package/dist/node_modules/@skrr-ai/inference-broker/dist/esm/loopback-server.js +4 -2
  286. package/dist/node_modules/@skrr-ai/inference-broker/dist/esm/managed-inference-broker.js +10 -6
  287. package/dist/node_modules/@skrr-ai/inference-broker/package.json +1 -1
  288. package/oclif.manifest.json +17 -2
  289. package/package.json +1 -1
@@ -126,9 +126,19 @@ class AgentsTriggersPolicy extends base_command_1.BaseCommand {
126
126
  // row seeded at creation. The numbers below then read like a deliberate choice, and for an
127
127
  // Agent with no stored policy they are NOT the seeded ones (24/day, 10/h against 2/day, 1/h)
128
128
  // (OSK-22354).
129
- if (policy.configured === false) {
129
+ // The hard stop is the kill switch: every fire of this Agent's triggers is blocked while it is on. The
130
+ // text view printed the policy's numbers and never said so, beside a note that nobody had set the
131
+ // policy, so an Agent that was stopped read as a default one (OSK-22659). It leads the output, and a
132
+ // stop somebody set means the policy is not 'nobody's choice'.
133
+ const hardStop = policy.hardStop;
134
+ const stopped = hardStop?.enabled === true;
135
+ if (stopped) {
136
+ this.log(`HARD STOP: ON${hardStop?.scope ? ` (${hardStop.scope})` : ''} — every fire of this Agent's triggers is blocked${hardStop?.reason ? `: ${hardStop.reason}` : ''}${hardStop?.activatedAt ? ` (since ${hardStop.activatedAt})` : ''}`);
137
+ }
138
+ if (policy.configured === false && !stopped) {
130
139
  this.log('Note: nobody has set this policy: these are the platform defaults (or the quiet start seeded at creation), not a choice.');
131
140
  }
141
+ this.log(`Hard stop: ${stopped ? 'on' : 'off'}`);
132
142
  this.log(`Mode: ${String(policy.mode ?? '-')}`);
133
143
  this.log(`Allowed kinds: ${Array.isArray(policy.allowedKinds) ? policy.allowedKinds.join(', ') : '-'}`);
134
144
  this.log(`Max fires/day: ${String(policy.maxFiresPerDay ?? '-')}`);
@@ -10,6 +10,7 @@ const node_fs_1 = require("node:fs");
10
10
  const core_1 = require("@oclif/core");
11
11
  const data_provider_1 = require("@skrr-ai/data-provider");
12
12
  const base_command_1 = require("../../base-command");
13
+ const PARSE_RELEASE_DEPENDENCIES_RE = /^(skill|action):([^@]+)@(store_release_[A-Za-z0-9_-]+)$/;
13
14
  /**
14
15
  * `--capability-rationale <permission-key>=<note>` → the publisher notes a
15
16
  * release carries beside its capability manifest. Split on the FIRST `=`, so a
@@ -39,7 +40,7 @@ function parseReleaseDependencies(entries) {
39
40
  return {};
40
41
  const dependencies = [];
41
42
  for (const entry of entries) {
42
- const match = /^(skill|action):([^@]+)@(store_release_[A-Za-z0-9_-]+)$/.exec(entry);
43
+ const match = PARSE_RELEASE_DEPENDENCIES_RE.exec(entry);
43
44
  if (!match) {
44
45
  return {
45
46
  error: `--dependency expects skill:<id>@<store-release-id> or action:<id>@<store-release-id>, got "${entry}".`,
@@ -68,6 +68,16 @@ function renderSessionBillingAccount(target, balance, log, bin = 'skrr') {
68
68
  else {
69
69
  for (const line of (0, balance_1.workspaceBalanceLines)(balance))
70
70
  log(line);
71
+ // The workspace view is the one that decides whether a session can start, and it printed
72
+ // Held with no account of it at all. Held is reservations, not spend: a running agent turn
73
+ // reserves its maximum cost up front, and one that ended unsettled stays held (OSK-22651).
74
+ if (balance.heldMicros > 0) {
75
+ log(' Held is reserved for hosted sessions, including turns that ended without settling; ' +
76
+ `\`${bin} balance statement --workspace ${target.workspaceId}\` lists the \`hold\` and ` +
77
+ '`exception` entries.');
78
+ for (const line of (0, balance_1.heldBreakdownLines)(balance.heldBreakdown))
79
+ log(line);
80
+ }
71
81
  if (balance.availableMicros <= 0) {
72
82
  log(' WARNING: nothing available — managed sessions billed here are refused for credit, ' +
73
83
  'whatever your personal balance below says.');
@@ -170,7 +180,7 @@ class BalanceShow extends base_command_1.BaseCommand {
170
180
  }
171
181
  let balance;
172
182
  try {
173
- balance = await (0, balance_1.getBalance)();
183
+ balance = await (0, balance_1.getBalance)({ holds: 'breakdown' });
174
184
  }
175
185
  catch (err) {
176
186
  this.handleApiError(err);
@@ -181,7 +191,9 @@ class BalanceShow extends base_command_1.BaseCommand {
181
191
  let sessionBalance = null;
182
192
  if (sessionTarget) {
183
193
  try {
184
- sessionBalance = await (0, balance_1.getWorkspaceBalance)(sessionTarget.workspaceId);
194
+ sessionBalance = await (0, balance_1.getWorkspaceBalance)(sessionTarget.workspaceId, {
195
+ holds: 'breakdown',
196
+ });
185
197
  }
186
198
  catch {
187
199
  sessionBalance = null;
@@ -224,8 +236,17 @@ class BalanceShow extends base_command_1.BaseCommand {
224
236
  // printed in dollars only, so it read as a different quantity from the
225
237
  // Credits above it (OSK-4827).
226
238
  this.log(` Held: ${(0, balance_1.formatCreditsWithUsd)(balance.heldMicros)}`);
227
- this.log(' (committed to sessions in flight; each hold is a');
228
- this.log(' `hold` entry in `skrr balance statement`)');
239
+ // Not all of it is "in flight". A running hosted agent turn reserves its maximum cost
240
+ // up front and settles for what it used; one that ends without settling expires into an
241
+ // `exception` and stays held until billing releases it (OSK-22651). Saying "in flight"
242
+ // for all of it made a frozen reservation read as a session that was still running.
243
+ this.log(' (reserved for hosted sessions: a running agent turn reserves');
244
+ this.log(' its maximum cost up front and settles for what it used; one');
245
+ this.log(' that ends without settling stays held until billing releases');
246
+ this.log(' it. See the `hold` and `exception` entries in');
247
+ this.log(' `skrr balance statement`)');
248
+ for (const line of (0, balance_1.heldBreakdownLines)(balance.heldBreakdown))
249
+ this.log(line);
229
250
  }
230
251
  if (balance.balanceSource === 'legacy') {
231
252
  // The unified account is missing for this user, so the figure above is
@@ -381,7 +402,7 @@ class BalanceShow extends base_command_1.BaseCommand {
381
402
  async showWorkspaceBalance(workspaceId, asJson) {
382
403
  let balance;
383
404
  try {
384
- balance = await (0, balance_1.getWorkspaceBalance)(workspaceId);
405
+ balance = await (0, balance_1.getWorkspaceBalance)(workspaceId, { holds: 'breakdown' });
385
406
  }
386
407
  catch (err) {
387
408
  // A 403 here is a real answer, not a glitch: membership is what grants
@@ -421,6 +442,8 @@ class BalanceShow extends base_command_1.BaseCommand {
421
442
  for (const line of (0, balance_1.workspaceBalanceLines)(balance)) {
422
443
  this.log(line);
423
444
  }
445
+ for (const line of (0, balance_1.heldBreakdownLines)(balance.heldBreakdown))
446
+ this.log(line);
424
447
  this.log('');
425
448
  this.log('This is the account a session carrying this workspace bills against —');
426
449
  this.log('the balance named by "this session needs more credit than this');
@@ -11,6 +11,7 @@ const base_command_1 = require("../../base-command");
11
11
  const format_1 = require("../../lib/format");
12
12
  const harness_provider_input_1 = require("../../lib/harness-provider-input");
13
13
  const balance_1 = require("../../lib/balance");
14
+ const IS_OWNER_ONLY_REFUSAL_RE = /owner/i;
14
15
  /**
15
16
  * The canonical stored-value ledger — what a charge was FOR, and what incurred it.
16
17
  *
@@ -289,7 +290,7 @@ function isOwnerOnlyRefusal(err) {
289
290
  return false;
290
291
  try {
291
292
  const body = JSON.parse(e.body ?? '');
292
- return typeof body.error === 'string' && /owner/i.test(body.error);
293
+ return typeof body.error === 'string' && IS_OWNER_ONLY_REFUSAL_RE.test(body.error);
293
294
  }
294
295
  catch {
295
296
  return false;
@@ -4,6 +4,7 @@ const core_1 = require("@oclif/core");
4
4
  const base_command_1 = require("../base-command");
5
5
  const command_manifest_1 = require("../lib/command-manifest");
6
6
  const command_hygiene_1 = require("../lib/command-hygiene");
7
+ const RUN_RE = /:/g;
7
8
  class Commands extends base_command_1.BaseCommand {
8
9
  static description = 'List skrr commands or print a machine-readable command schema';
9
10
  static examples = [
@@ -101,7 +102,7 @@ class Commands extends base_command_1.BaseCommand {
101
102
  }
102
103
  const payload = {
103
104
  id: key,
104
- command: key.replace(/:/g, ' '),
105
+ command: key.replace(RUN_RE, ' '),
105
106
  description: command.description ?? '',
106
107
  aliases: command.aliases ?? [],
107
108
  args: command.args ?? {},
@@ -15,6 +15,7 @@ const commitment_attention_copy_1 = require("../../lib/commitment-attention-copy
15
15
  const triggers_1 = require("../../lib/triggers");
16
16
  const commitment_product_1 = require("../../lib/commitment-product");
17
17
  const commitments_1 = require("../../lib/commitments");
18
+ const COMMITMENT_ACTIVATION_REFUSAL_RE = /^[A-Za-z][A-Za-z0-9_]*$/;
18
19
  const DEFAULT_EVENT_DRIVEN_BACKSTOP_MS = 24 * 60 * 60 * 1000;
19
20
  const DEFAULT_EVENT_SOURCES = new Set(['github', 'slack', 'email', 'calendar']);
20
21
  /**
@@ -212,7 +213,7 @@ function commitmentActivationRefusal(err, { id, bin }) {
212
213
  const blockers = activationBlockers(refusal.body);
213
214
  const errorField = refusal.body?.error;
214
215
  const code = refusal.code ||
215
- (typeof errorField === 'string' && /^[A-Za-z][A-Za-z0-9_]*$/.test(errorField)
216
+ (typeof errorField === 'string' && COMMITMENT_ACTIVATION_REFUSAL_RE.test(errorField)
216
217
  ? errorField
217
218
  : undefined) ||
218
219
  'COMMITMENT_ACTIVATION_REFUSED';
@@ -6,6 +6,7 @@ const base_command_1 = require("../../base-command");
6
6
  const commitments_1 = require("../../lib/commitments");
7
7
  const commitment_product_1 = require("../../lib/commitment-product");
8
8
  const web_url_1 = require("../../lib/web-url");
9
+ const MODULE_RE = /-/g;
9
10
  class CommitmentsDelivery extends base_command_1.BaseCommand {
10
11
  static description = 'Declare the destination for Commitment work';
11
12
  static examples = [
@@ -19,7 +20,7 @@ class CommitmentsDelivery extends base_command_1.BaseCommand {
19
20
  description: 'Delivery destination.',
20
21
  options: [
21
22
  ...commitment_product_1.COMMITMENT_DELIVERY_CHOICES,
22
- ...commitment_product_1.COMMITMENT_DELIVERY_CHOICES.map((mode) => mode.replace(/-/g, '_')),
23
+ ...commitment_product_1.COMMITMENT_DELIVERY_CHOICES.map((mode) => mode.replace(MODULE_RE, '_')),
23
24
  ],
24
25
  }),
25
26
  };
@@ -6,6 +6,7 @@ const core_1 = require("@oclif/core");
6
6
  const data_provider_1 = require("@skrr-ai/data-provider");
7
7
  const base_command_1 = require("../../base-command");
8
8
  const commitments_1 = require("../../lib/commitments");
9
+ const DOCTOR_VERDICT_RE = /^status_([a-z_]+)$/;
9
10
  function doctorVerdict(input) {
10
11
  const commitment = input.commitment || {};
11
12
  const preflight = input.preflight || {};
@@ -14,7 +15,7 @@ function doctorVerdict(input) {
14
15
  if (blocker?.code) {
15
16
  // A lifecycle stop is a state, not a fault: a Commitment its owner paused is `paused`, with the
16
17
  // way back as its next step, not `blocked` (OSK-15423).
17
- const lifecycle = /^status_([a-z_]+)$/.exec(String(blocker.code));
18
+ const lifecycle = DOCTOR_VERDICT_RE.exec(String(blocker.code));
18
19
  return {
19
20
  verdict: lifecycle ? lifecycle[1] : blocker.code === 'deleted' ? 'deleted' : 'blocked',
20
21
  // A typed blocker carries no remedy, only what happened (OSK-16230).
@@ -6,10 +6,10 @@ const core_1 = require("@oclif/core");
6
6
  const data_provider_1 = require("@skrr-ai/data-provider");
7
7
  const base_command_1 = require("../../base-command");
8
8
  const commitments_1 = require("../../lib/commitments");
9
+ const TIMESTAMP_RE = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/;
9
10
  /** Explicit ISO FROM/TO intervals avoid local-time or rolling-window ambiguity. */
10
11
  function parseObservationWindow(value) {
11
12
  const parts = value.split('/');
12
- const timestamp = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/;
13
13
  const [from, to] = parts.map((entry) => new Date(entry).getTime());
14
14
  const realCalendarDay = (part) => {
15
15
  const day = part.slice(0, 10);
@@ -17,7 +17,7 @@ function parseObservationWindow(value) {
17
17
  return Number.isFinite(parsed.getTime()) && parsed.toISOString().slice(0, 10) === day;
18
18
  };
19
19
  if (parts.length !== 2 ||
20
- !parts.every((part) => timestamp.test(part) && realCalendarDay(part)) ||
20
+ !parts.every((part) => TIMESTAMP_RE.test(part) && realCalendarDay(part)) ||
21
21
  !Number.isFinite(from) ||
22
22
  !Number.isFinite(to) ||
23
23
  to <= from ||
@@ -6,6 +6,7 @@ const core_1 = require("@oclif/core");
6
6
  const base_command_1 = require("../../base-command");
7
7
  const commitment_loop_status_1 = require("../../lib/commitment-loop-status");
8
8
  const commitments_1 = require("../../lib/commitments");
9
+ const RUN_RE = /^obj_/;
9
10
  /** What each silent loop is for, in the owner's terms rather than the role key. */
10
11
  const ROLE_PURPOSE = {
11
12
  conversation_continuity: 'remembers what we are working on',
@@ -124,7 +125,7 @@ class CommitmentsOperatingReview extends base_command_1.BaseCommand {
124
125
  this.requireAuth();
125
126
  const { args, flags } = await this.parse(CommitmentsOperatingReview);
126
127
  // A Commitment id here answered "Agent not found" without saying an Agent id was wanted.
127
- if (/^obj_/.test(args.agentId)) {
128
+ if (RUN_RE.test(args.agentId)) {
128
129
  this.error(`${args.agentId} is a Commitment id; operating-review takes an Agent id. ` +
129
130
  `Use \`skrr commitments status ${args.agentId}\` for one Commitment.`, { exit: 1 });
130
131
  }
@@ -4,6 +4,7 @@ const core_1 = require("@oclif/core");
4
4
  const base_command_1 = require("../../../base-command");
5
5
  const commitments_1 = require("../../../lib/commitments");
6
6
  const preflight_1 = require("../preflight");
7
+ const RUN_RE = /_/g;
7
8
  /**
8
9
  * Re-run a bound Pack's readiness probe and REWRITE its stored receipt.
9
10
  *
@@ -52,7 +53,7 @@ class CommitmentsPackPreflight extends base_command_1.BaseCommand {
52
53
  }
53
54
  const receipt = result.preflight;
54
55
  this.log(`Pack: ${result.pack?.id}@${result.pack?.version}`);
55
- this.log(`Preflight: ${String(receipt?.verdict).replace(/_/g, ' ')}`);
56
+ this.log(`Preflight: ${String(receipt?.verdict).replace(RUN_RE, ' ')}`);
56
57
  this.log(`Recorded: ${receipt?.at}`);
57
58
  this.log('\nAdapters:');
58
59
  for (const adapter of receipt?.adapterStatuses || []) {
@@ -116,8 +116,12 @@ function preflightGateLines(gate, verbose = false, refusesActivation = false) {
116
116
  // question.
117
117
  const advisoryBlock = gate.verdict === 'block' && gate.admission === 'advisory' && !refusesActivation;
118
118
  const stopsActivationOnly = gate.verdict === 'block' && gate.admission === 'advisory' && refusesActivation;
119
+ // A deleted Sensor is the one advisory block that must not read lower than a silent one (`warn`):
120
+ // it is the more serious state (OSK-22592).
119
121
  const mark = advisoryBlock
120
- ? 'info'
122
+ ? gate.id === 'sensor_bindings'
123
+ ? 'warn'
124
+ : 'info'
121
125
  : gate.verdict === 'pass'
122
126
  ? 'ok'
123
127
  : gate.verdict === 'block'
@@ -5,6 +5,7 @@ const core_1 = require("@oclif/core");
5
5
  const base_command_1 = require("../../base-command");
6
6
  const commitments_1 = require("../../lib/commitments");
7
7
  const commitment_event_wakes_1 = require("../../lib/commitment-event-wakes");
8
+ const FORMAT_TRIGGER_STATUS_RE = /\s+/g;
8
9
  /**
9
10
  * `skrr commitments trigger-status <id>` — what the SCHEDULER actually has.
10
11
  *
@@ -88,7 +89,7 @@ function formatTriggerStatus(status) {
88
89
  if (wake?.held) {
89
90
  lines.push(`Wakes: HELD — ${wake.reason ?? 'blocked'}`);
90
91
  if (wake.detail)
91
- lines.push(` ${String(wake.detail).replace(/\s+/g, ' ').trim()}`);
92
+ lines.push(` ${String(wake.detail).replace(FORMAT_TRIGGER_STATUS_RE, ' ').trim()}`);
92
93
  }
93
94
  const bindings = Array.isArray(status.bindings) ? status.bindings : [];
94
95
  lines.push('');
@@ -13,6 +13,8 @@ export declare function wakePolicyHeadline(_result?: unknown): string;
13
13
  * on Always-On, the upstream installation and leftover rows, which only the facts carry.
14
14
  */
15
15
  export declare function wakePolicyLines(result?: CommitmentWakeCapabilities): string[];
16
+ /** Why an eligible capability is not offered, in words a person can act on (OSK-22591). */
17
+ export declare function describeUnavailable(reason?: string): string;
16
18
  /**
17
19
  * `skrr commitments wake-capabilities <id>` — which wakes an Agent may pick.
18
20
  *
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.wakePolicyHeadline = wakePolicyHeadline;
4
4
  exports.wakePolicyLines = wakePolicyLines;
5
+ exports.describeUnavailable = describeUnavailable;
5
6
  const core_1 = require("@oclif/core");
6
7
  const base_command_1 = require("../../base-command");
7
8
  const commitments_1 = require("../../lib/commitments");
@@ -44,6 +45,17 @@ function wakePolicyLines(result) {
44
45
  }
45
46
  return lines;
46
47
  }
48
+ /** Why an eligible capability is not offered, in words a person can act on (OSK-22591). */
49
+ function describeUnavailable(reason) {
50
+ switch (reason) {
51
+ case 'sensor_not_found':
52
+ return 'the attached sensor no longer exists. Attach a working sensor or detach this one.';
53
+ case 'sensor_disabled':
54
+ return 'the attached sensor is disabled. Enable it or detach it.';
55
+ default:
56
+ return `the attached sensor cannot deliver (${reason ?? 'unknown reason'}).`;
57
+ }
58
+ }
47
59
  /**
48
60
  * `skrr commitments wake-capabilities <id>` — which wakes an Agent may pick.
49
61
  *
@@ -109,6 +121,10 @@ class CommitmentsWakeCapabilities extends base_command_1.BaseCommand {
109
121
  { key: 'source', header: 'SOURCE' },
110
122
  { key: 'offered', header: 'OFFERED' },
111
123
  ], (line) => this.log(line));
124
+ // A capability can be eligible (still attached) and not offered because what it needs is gone.
125
+ for (const item of result.unavailableCapabilities ?? []) {
126
+ this.log(`Not offered: ${item.id} — ${describeUnavailable(item.reason)}`);
127
+ }
112
128
  }
113
129
  }
114
130
  exports.default = CommitmentsWakeCapabilities;
@@ -5,6 +5,7 @@ const core_1 = require("@oclif/core");
5
5
  const data_provider_1 = require("@skrr-ai/data-provider");
6
6
  const base_command_1 = require("../../base-command");
7
7
  const message_content_1 = require("../../lib/message-content");
8
+ const FORMAT_MESSAGE_LINES_RE = /\s+/g;
8
9
  /**
9
10
  * The lines `skrr convos messages` prints for one message row.
10
11
  *
@@ -24,7 +25,7 @@ function formatMessageLines(m, options = {}) {
24
25
  // (OSK-4911). Whitespace is collapsed WITHIN a block for compactness; the
25
26
  // blank line BETWEEN blocks is what the flattened `text` field dropped.
26
27
  const body = (0, message_content_1.messageTextBlocks)(failure ? { ...m, text: failure.answer } : m)
27
- .map((block) => block.replace(/\s+/g, ' ').trim())
28
+ .map((block) => block.replace(FORMAT_MESSAGE_LINES_RE, ' ').trim())
28
29
  .join('\n\n');
29
30
  const clipped = body.length > 300 ? `${body.slice(0, 300)}…` : body;
30
31
  const lines = [`${when} ${who}${failure ? ' [failed]' : ''}`];
@@ -33,6 +33,15 @@ const node_path_1 = __importDefault(require("node:path"));
33
33
  const node_events_1 = require("node:events");
34
34
  const auth_core_1 = require("@skrr-ai/auth-core");
35
35
  const exec_runtime_binary_1 = require("../../lib/exec-runtime-binary");
36
+ const UNESCAPE_RE = /&lt;/g;
37
+ const UNESCAPE_RE_2 = /&gt;/g;
38
+ const UNESCAPE_RE_3 = /&quot;/g;
39
+ const UNESCAPE_RE_4 = /&apos;/g;
40
+ const UNESCAPE_RE_5 = /&amp;/g;
41
+ const INSTALLED_SERVICE_LOG_DESTINATIONS_RE = /<key>\s*ProgramArguments\s*<\/key>\s*<array>([\s\S]*?)<\/array>/;
42
+ const INSTALLED_SERVICE_LOG_DESTINATIONS_RE_2 = /<string>([\s\S]*?)<\/string>/g;
43
+ const ESCAPE_RE = /[.*+?^${}()|[\]\\]/g;
44
+ const PARSE_RUNTIME_VERSION_RE = /(\d+)\.(\d+)\.(\d+)/;
36
45
  const MAX_FALLBACK_LOG_BYTES = 1024 * 1024;
37
46
  /**
38
47
  * Older daemons already kept logs in this profile-scoped location, even
@@ -137,19 +146,19 @@ function installedServiceLogDestinations(profile, options = {}) {
137
146
  return null;
138
147
  }
139
148
  const unescape = (v) => v
140
- .replace(/&lt;/g, '<')
141
- .replace(/&gt;/g, '>')
142
- .replace(/&quot;/g, '"')
143
- .replace(/&apos;/g, "'")
144
- .replace(/&amp;/g, '&');
149
+ .replace(UNESCAPE_RE, '<')
150
+ .replace(UNESCAPE_RE_2, '>')
151
+ .replace(UNESCAPE_RE_3, '"')
152
+ .replace(UNESCAPE_RE_4, "'")
153
+ .replace(UNESCAPE_RE_5, '&');
145
154
  const stringFor = (key) => {
146
155
  const m = new RegExp(`<key>\\s*${key}\\s*</key>\\s*<string>([\\s\\S]*?)</string>`).exec(xml);
147
156
  return m?.[1]?.trim() ? unescape(m[1].trim()) : null;
148
157
  };
149
158
  let logFile = null;
150
- const array = /<key>\s*ProgramArguments\s*<\/key>\s*<array>([\s\S]*?)<\/array>/.exec(xml);
159
+ const array = INSTALLED_SERVICE_LOG_DESTINATIONS_RE.exec(xml);
151
160
  if (array?.[1]) {
152
- const args = [...array[1].matchAll(/<string>([\s\S]*?)<\/string>/g)].map((m) => unescape(m[1].trim()));
161
+ const args = [...array[1].matchAll(INSTALLED_SERVICE_LOG_DESTINATIONS_RE_2)].map((m) => unescape(m[1].trim()));
153
162
  const at = args.lastIndexOf('--log-file');
154
163
  if (at >= 0 && args[at + 1] && !args[at + 1].startsWith('-'))
155
164
  logFile = args[at + 1];
@@ -260,7 +269,7 @@ function rotatedLogSiblings(filePath, readdir = (dir) => (0, node_fs_1.readdirSy
260
269
  const dir = node_path_1.default.dirname(filePath);
261
270
  const ext = node_path_1.default.extname(filePath);
262
271
  const base = node_path_1.default.basename(filePath, ext);
263
- const escape = (text) => text.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
272
+ const escape = (text) => text.replace(ESCAPE_RE, '\\$&');
264
273
  const pattern = new RegExp(`^${escape(base)}\\.(\\d+)${escape(ext)}$`);
265
274
  let names;
266
275
  try {
@@ -427,7 +436,7 @@ async function streamLogFiles(files, out) {
427
436
  }
428
437
  /** `x.y.z` from a version string, or null. A prerelease suffix is ignored. */
429
438
  function parseRuntimeVersion(text) {
430
- const m = /(\d+)\.(\d+)\.(\d+)/.exec(text);
439
+ const m = PARSE_RUNTIME_VERSION_RE.exec(text);
431
440
  return m ? [Number(m[1]), Number(m[2]), Number(m[3])] : null;
432
441
  }
433
442
  /** Whether `version` is at least `floor`; null when either is not a version. */
@@ -8,9 +8,10 @@ const core_1 = require("@oclif/core");
8
8
  const node_child_process_1 = require("node:child_process");
9
9
  const exec_runtime_binary_1 = require("../../lib/exec-runtime-binary");
10
10
  const index_1 = __importDefault(require("./index"));
11
+ const SUPPORTS_DAEMON_USAGE_RE = /^\s*usage(?:\s|\[|$)/m;
11
12
  /** Whether an `oversky --help` surface actually supports the usage command. */
12
13
  function supportsDaemonUsage(helpText) {
13
- return /^\s*usage(?:\s|\[|$)/m.test(helpText);
14
+ return SUPPORTS_DAEMON_USAGE_RE.test(helpText);
14
15
  }
15
16
  /** Read-only bridge to `oversky usage` for local Claude Code/Codex limits. */
16
17
  class DaemonUsage extends index_1.default {
@@ -5,6 +5,7 @@ const data_provider_1 = require("@skrr-ai/data-provider");
5
5
  const base_command_1 = require("../../base-command");
6
6
  const agent_resolver_1 = require("../../lib/agent-resolver");
7
7
  const format_1 = require("../../lib/format");
8
+ const RUN_RE = /\s+/g;
8
9
  class DmMessages extends base_command_1.BaseCommand {
9
10
  static description = "List messages from an agent's 1:1 DM";
10
11
  static examples = [
@@ -89,7 +90,7 @@ class DmMessages extends base_command_1.BaseCommand {
89
90
  (0, format_1.renderTable)(selected.map((message) => ({
90
91
  when: (0, format_1.localTime)(message.createdAt),
91
92
  role: String(message.sender ?? (message.isCreatedByUser ? 'user' : 'assistant')),
92
- text: textFromMessage(message).replace(/\s+/g, ' ').trim(),
93
+ text: textFromMessage(message).replace(RUN_RE, ' ').trim(),
93
94
  id: String(message.messageId ?? message._id ?? message.id ?? '-'),
94
95
  })), [
95
96
  { key: 'when', header: 'TIME', maxWidth: 20 },
@@ -6,6 +6,7 @@ const base_command_1 = require("../../../base-command");
6
6
  const agent_resolver_1 = require("../../../lib/agent-resolver");
7
7
  const agent_thread_1 = require("../../../lib/agent-thread");
8
8
  const format_1 = require("../../../lib/format");
9
+ const RUN_RE = /\s+/g;
9
10
  /** Read replies in one Thread; root stays separately addressable in main chat. */
10
11
  class DmThreadMessages extends base_command_1.BaseCommand {
11
12
  static description = 'List replies in an Agent DM Thread';
@@ -93,7 +94,7 @@ class DmThreadMessages extends base_command_1.BaseCommand {
93
94
  (0, format_1.renderTable)(page.messages.map((message) => ({
94
95
  when: message.createdAt || '-',
95
96
  role: message.isCreatedByUser ? 'user' : 'agent',
96
- text: String(message.text || '').replace(/\s+/g, ' '),
97
+ text: String(message.text || '').replace(RUN_RE, ' '),
97
98
  id: message.messageId,
98
99
  })), [
99
100
  { key: 'when', header: 'TIME', maxWidth: 26 },
@@ -5,6 +5,7 @@ const data_provider_1 = require("@skrr-ai/data-provider");
5
5
  const base_command_1 = require("../../base-command");
6
6
  const agent_resolver_1 = require("../../lib/agent-resolver");
7
7
  const format_1 = require("../../lib/format");
8
+ const RUN_RE = /\s+/g;
8
9
  /** List the Slack-style Threads the caller follows for one Agent DM. */
9
10
  class DmThreads extends base_command_1.BaseCommand {
10
11
  static description = 'List followed Threads in an agent’s 1:1 DM';
@@ -78,7 +79,7 @@ class DmThreads extends base_command_1.BaseCommand {
78
79
  unread: String(thread.unreadCount || 0),
79
80
  following: thread.isFollowing === false ? 'no' : 'yes',
80
81
  updated: thread.lastReplyAt || '-',
81
- preview: (thread.root.snapshot.text || thread.lastReplyPreview || '').replace(/\s+/g, ' '),
82
+ preview: (thread.root.snapshot.text || thread.lastReplyPreview || '').replace(RUN_RE, ' '),
82
83
  })), [
83
84
  { key: 'root', header: 'ROOT MESSAGE', maxWidth: 38, verbatim: true },
84
85
  { key: 'replies', header: 'REPLIES' },
@@ -53,6 +53,7 @@ const runtime_context_1 = require("../lib/runtime-context");
53
53
  const deployed_build_1 = require("../lib/deployed-build");
54
54
  const cli_installation_diagnostics_1 = require("../lib/cli-installation-diagnostics");
55
55
  const outbox_1 = require("../lib/outbox");
56
+ const RUN_RE = /fetch failed|ECONNREFUSED|ENOTFOUND|ETIMEDOUT|socket hang up/i;
56
57
  /**
57
58
  * What each check actually verifies, in the words a reader thinks in.
58
59
  *
@@ -248,7 +249,7 @@ class Doctor extends base_command_1.BaseCommand {
248
249
  (e.code === 'ECONNREFUSED' ||
249
250
  e.code === 'ENOTFOUND' ||
250
251
  e.code === 'ETIMEDOUT' ||
251
- /fetch failed|ECONNREFUSED|ENOTFOUND|ETIMEDOUT|socket hang up/i.test(e.message || ''));
252
+ RUN_RE.test(e.message || ''));
252
253
  // 5xx and a dead transport are the server's problem. 4xx is ours: a
253
254
  // 401/403 really does mean the credential is bad, and that is the one
254
255
  // case where "re-authenticate" is the right advice.
@@ -5,6 +5,7 @@ const core_1 = require("@oclif/core");
5
5
  const data_provider_1 = require("@skrr-ai/data-provider");
6
6
  const base_command_1 = require("../../../base-command");
7
7
  const history_1 = require("./history");
8
+ const PARSE_EVIDENCE_REF_RE = /^https?:|^file:/;
8
9
  /**
9
10
  * `skrr goals key-results assess <goal-id> <kr-id>` — record a judgment of a
10
11
  * key result (OSK-17987, decision D4). Wraps
@@ -106,5 +107,5 @@ function parseEvidenceRef(raw) {
106
107
  }
107
108
  const kind = raw.slice(0, split);
108
109
  const value = raw.slice(split + 1);
109
- return /^https?:|^file:/.test(value) ? { kind, uri: value } : { kind, id: value };
110
+ return PARSE_EVIDENCE_REF_RE.test(value) ? { kind, uri: value } : { kind, id: value };
110
111
  }
@@ -6,6 +6,7 @@ const core_1 = require("@oclif/core");
6
6
  const data_provider_1 = require("@skrr-ai/data-provider");
7
7
  const base_command_1 = require("../../../base-command");
8
8
  const format_1 = require("../../../lib/format");
9
+ const ONE_LINE_RE = /\s+/g;
9
10
  /**
10
11
  * `skrr goals key-results history <goal-id> <kr-id>` — every judgment of a key
11
12
  * result, newest first (OSK-17987). Wraps
@@ -97,7 +98,7 @@ function describeAssessment(assessment) {
97
98
  return lines;
98
99
  }
99
100
  function oneLine(text) {
100
- return typeof text === 'string' ? text.replace(/\s+/g, ' ').trim() : '';
101
+ return typeof text === 'string' ? text.replace(ONE_LINE_RE, ' ').trim() : '';
101
102
  }
102
103
  function formatAt(at) {
103
104
  return at ? String(at).slice(0, 19).replace('T', ' ') : '-';
@@ -5,6 +5,7 @@ const base_command_1 = require("../../base-command");
5
5
  const harnesses_1 = require("../../lib/harnesses");
6
6
  const api_fetch_1 = require("../../lib/api-fetch");
7
7
  const show_1 = require("./show");
8
+ const RUN_RE = /^[0-9a-f]{24}$/i;
8
9
  /**
9
10
  * Forget an harness — `forget`, not `delete`.
10
11
  *
@@ -40,7 +41,7 @@ class HarnessesForget extends base_command_1.BaseCommand {
40
41
  // (`describeWrongHarnessRef` names which KIND of id you passed and which
41
42
  // command takes it). `forget` is the DESTRUCTIVE one and had the worse
42
43
  // message; it now shares the explanation.
43
- if (!/^[0-9a-f]{24}$/i.test(args.harness.trim())) {
44
+ if (!RUN_RE.test(args.harness.trim())) {
44
45
  this.error(`Not a harness id: ${args.harness}\n${(0, show_1.describeWrongHarnessRef)(args.harness)}`, {
45
46
  exit: 1,
46
47
  });
@@ -13,6 +13,12 @@ const harness_labels_1 = require("../../lib/harness-labels");
13
13
  const cli_installers_1 = require("../../lib/cli-installers");
14
14
  const api_fetch_1 = require("../../lib/api-fetch");
15
15
  const data_provider_1 = require("@skrr-ai/data-provider");
16
+ const DESCRIBE_WRONG_HARNESS_REF_RE = /^daemon_/;
17
+ const DESCRIBE_WRONG_HARNESS_REF_RE_2 = /^(dedicated-runtime-|hosted-machine-|hosted-runtime-)/;
18
+ const DESCRIBE_WRONG_HARNESS_REF_RE_3 = /^sbs_/;
19
+ const DESCRIBE_WRONG_HARNESS_REF_RE_4 = /^machine:/;
20
+ const DESCRIBE_WRONG_HARNESS_REF_RE_5 = /^(lease:|dedicated-runtime:|hosted-machine:)/;
21
+ const DESCRIBE_WRONG_HARNESS_REF_RE_6 = /^[0-9a-f]{24}$/i;
16
22
  class HarnessesShow extends base_command_1.BaseCommand {
17
23
  static description = 'Show one harness — one provider on one machine';
18
24
  static examples = [
@@ -185,25 +191,25 @@ function harnessPermissionLines(harness) {
185
191
  */
186
192
  function describeWrongHarnessRef(ref) {
187
193
  const seeIds = 'Run `skrr harnesses list --all` to see the harness ids on this account.';
188
- if (/^daemon_/.test(ref)) {
194
+ if (DESCRIBE_WRONG_HARNESS_REF_RE.test(ref)) {
189
195
  return `That is a daemon id. \`skrr machines show ${ref}\` takes those. ${seeIds}`;
190
196
  }
191
- if (/^(dedicated-runtime-|hosted-machine-|hosted-runtime-)/.test(ref)) {
197
+ if (DESCRIBE_WRONG_HARNESS_REF_RE_2.test(ref)) {
192
198
  // Printed in the DAEMON ID column for a rented machine, so it is the same
193
199
  // redirect as `daemon_…`, not a malformed harness id (OSK-9313).
194
200
  return `That is a daemon id. \`skrr machines show ${ref}\` takes those. ${seeIds}`;
195
201
  }
196
- if (/^sbs_/.test(ref)) {
202
+ if (DESCRIBE_WRONG_HARNESS_REF_RE_3.test(ref)) {
197
203
  return `That is a hosted machine id. \`skrr machines show ${ref}\` takes those. ${seeIds}`;
198
204
  }
199
- if (/^machine:/.test(ref)) {
205
+ if (DESCRIBE_WRONG_HARNESS_REF_RE_4.test(ref)) {
200
206
  return `That is a machine id. \`skrr machines show ${ref}\` takes those. ${seeIds}`;
201
207
  }
202
- if (/^(lease:|dedicated-runtime:|hosted-machine:)/.test(ref)) {
208
+ if (DESCRIBE_WRONG_HARNESS_REF_RE_5.test(ref)) {
203
209
  return ('That is a machine id for a rented runtime. `skrr machines show` takes it as printed; ' +
204
210
  `\`skrr machines dedicated show\` takes the part after the colon. ${seeIds}`);
205
211
  }
206
- if (/^[0-9a-f]{24}$/i.test(ref)) {
212
+ if (DESCRIBE_WRONG_HARNESS_REF_RE_6.test(ref)) {
207
213
  // Right shape, wrong row — so the id is not the thing to explain.
208
214
  return `No harness on this account has that id. ${seeIds}`;
209
215
  }