@skrr-ai/cli 0.1.145 → 0.1.147

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 (296) hide show
  1. package/dist/base-command.js +38 -21
  2. package/dist/commands/agenda/plan.d.ts +14 -0
  3. package/dist/commands/agenda/plan.js +29 -0
  4. package/dist/commands/agent/message/approve.js +5 -1
  5. package/dist/commands/agent/message/decline.js +5 -1
  6. package/dist/commands/agent/message/send.d.ts +11 -0
  7. package/dist/commands/agent/message/send.js +34 -8
  8. package/dist/commands/agent-worker.js +2 -1
  9. package/dist/commands/agents/activity.js +2 -1
  10. package/dist/commands/agents/always-on/enable.js +1 -1
  11. package/dist/commands/agents/badge.js +10 -5
  12. package/dist/commands/agents/categories/index.js +2 -1
  13. package/dist/commands/agents/chat.d.ts +1 -0
  14. package/dist/commands/agents/chat.js +29 -1
  15. package/dist/commands/agents/create.js +4 -1
  16. package/dist/commands/agents/overview.js +2 -1
  17. package/dist/commands/agents/releases/create.js +2 -1
  18. package/dist/commands/agents/schedule-overview.js +12 -11
  19. package/dist/commands/agents/schedule.js +2 -1
  20. package/dist/commands/agents/spawn.d.ts +38 -1
  21. package/dist/commands/agents/spawn.js +112 -9
  22. package/dist/commands/agents/tools/auth.js +2 -1
  23. package/dist/commands/agents/tools/calls.js +2 -1
  24. package/dist/commands/agents/triggers/fire.js +20 -0
  25. package/dist/commands/agents/visibility.js +2 -1
  26. package/dist/commands/balance/show.js +17 -2
  27. package/dist/commands/balance/statement.js +2 -1
  28. package/dist/commands/commands.js +2 -1
  29. package/dist/commands/commitments/create.js +2 -1
  30. package/dist/commands/commitments/delivery.js +2 -1
  31. package/dist/commands/commitments/doctor.js +2 -1
  32. package/dist/commands/commitments/observations.js +2 -2
  33. package/dist/commands/commitments/operating-review.js +2 -1
  34. package/dist/commands/commitments/pack/preflight.js +2 -1
  35. package/dist/commands/commitments/trigger-status.js +2 -1
  36. package/dist/commands/convos/messages.js +2 -1
  37. package/dist/commands/daemon/logs.js +18 -9
  38. package/dist/commands/daemon/usage.js +2 -1
  39. package/dist/commands/dm/messages.js +2 -1
  40. package/dist/commands/dm/thread/messages.js +2 -1
  41. package/dist/commands/dm/threads.js +2 -1
  42. package/dist/commands/doctor.js +2 -1
  43. package/dist/commands/goals/key-results/assess.js +2 -1
  44. package/dist/commands/goals/key-results/history.js +2 -1
  45. package/dist/commands/harnesses/forget.js +2 -1
  46. package/dist/commands/harnesses/show.js +12 -6
  47. package/dist/commands/inbox/index.js +4 -3
  48. package/dist/commands/initiatives/decide.js +2 -1
  49. package/dist/commands/instructions/diff.js +2 -1
  50. package/dist/commands/instructions/show.js +2 -1
  51. package/dist/commands/login.js +4 -2
  52. package/dist/commands/machines/dedicated/cp.js +2 -1
  53. package/dist/commands/machines/dedicated/power/set.js +2 -1
  54. package/dist/commands/machines/show.js +2 -1
  55. package/dist/commands/memory/maintain.js +2 -1
  56. package/dist/commands/memory/read.js +2 -1
  57. package/dist/commands/memory/rebuild-index.js +2 -1
  58. package/dist/commands/memory/rebuild.js +2 -1
  59. package/dist/commands/memory/search.js +2 -1
  60. package/dist/commands/messages/list.js +2 -1
  61. package/dist/commands/revoke-daemon.js +2 -1
  62. package/dist/commands/revoke-token.js +2 -1
  63. package/dist/commands/search/all.js +14 -7
  64. package/dist/commands/search/workspace.js +2 -1
  65. package/dist/commands/set-capabilities.js +2 -1
  66. package/dist/commands/skills/browse.js +8 -2
  67. package/dist/commands/spaces/auto-executor/preview.js +3 -2
  68. package/dist/commands/spaces/auto-executor/runs.js +4 -1
  69. package/dist/commands/spaces/workflow-templates/extract.d.ts +1 -0
  70. package/dist/commands/spaces/workflow-templates/extract.js +9 -1
  71. package/dist/commands/spaces/workflows/events.js +6 -3
  72. package/dist/commands/spaces/workflows/run.js +5 -3
  73. package/dist/commands/spaces/workflows/update.js +2 -1
  74. package/dist/commands/store/gallery-admissions/preview.js +2 -1
  75. package/dist/commands/store/publishers/profile/handle.js +2 -1
  76. package/dist/commands/tasks/comments/anchor.js +23 -9
  77. package/dist/commands/tasks/complete.js +4 -2
  78. package/dist/commands/tasks/create-tree.js +7 -3
  79. package/dist/commands/tasks/create.js +2 -1
  80. package/dist/commands/tasks/deliverable/add.js +2 -1
  81. package/dist/commands/tasks/deliverable/archive.js +2 -1
  82. package/dist/commands/tasks/deliverable/list.js +2 -1
  83. package/dist/commands/tasks/expectations/assess.js +2 -1
  84. package/dist/commands/tasks/labels/create.js +2 -1
  85. package/dist/commands/tasks/preflight.js +4 -2
  86. package/dist/commands/tasks/ready.js +2 -1
  87. package/dist/commands/tasks/result/submit.js +2 -1
  88. package/dist/commands/tasks/updates/add.js +2 -1
  89. package/dist/commands/tasks/wait.js +2 -1
  90. package/dist/commands/token/list.js +2 -1
  91. package/dist/commands/token/mint.js +2 -1
  92. package/dist/commands/triggers/audit.js +1 -1
  93. package/dist/commands/triggers/fire.js +19 -0
  94. package/dist/commands/wiki/write.js +14 -7
  95. package/dist/hooks/command-not-found.js +2 -1
  96. package/dist/lib/agent-chat-start.d.ts +77 -0
  97. package/dist/lib/agent-chat-start.js +169 -0
  98. package/dist/lib/agent-config.js +2 -1
  99. package/dist/lib/agent-endpoints.js +4 -2
  100. package/dist/lib/agent-evals.js +2 -1
  101. package/dist/lib/agent-guide-reference-gate.js +22 -11
  102. package/dist/lib/agent-guides.js +4 -1
  103. package/dist/lib/agent-instructions.js +5 -1
  104. package/dist/lib/agent-ref.js +8 -4
  105. package/dist/lib/agent-trigger-listing.js +2 -1
  106. package/dist/lib/agentic-stream.d.ts +21 -0
  107. package/dist/lib/agentic-stream.js +75 -6
  108. package/dist/lib/api-error-reason.js +2 -1
  109. package/dist/lib/api-fetch.js +5 -3
  110. package/dist/lib/appData.js +6 -6
  111. package/dist/lib/appInstallations.js +10 -5
  112. package/dist/lib/appsCheck.js +2 -1
  113. package/dist/lib/auth-failure.js +2 -1
  114. package/dist/lib/auth-storage.js +2 -1
  115. package/dist/lib/balance.js +6 -3
  116. package/dist/lib/capability-matrix.js +4 -2
  117. package/dist/lib/cli-runtime.js +2 -1
  118. package/dist/lib/code-handover.js +8 -3
  119. package/dist/lib/command-hygiene.js +28 -12
  120. package/dist/lib/command-manifest.js +6 -3
  121. package/dist/lib/commitment-attention-copy.js +2 -1
  122. package/dist/lib/commitment-event-wakes.js +9 -0
  123. package/dist/lib/commitment-product.js +5 -3
  124. package/dist/lib/commitment-terms.js +2 -1
  125. package/dist/lib/commitments.d.ts +8 -0
  126. package/dist/lib/commitments.js +8 -4
  127. package/dist/lib/compasses.js +2 -1
  128. package/dist/lib/completion-index.js +2 -1
  129. package/dist/lib/computer-files.js +8 -6
  130. package/dist/lib/config.js +11 -5
  131. package/dist/lib/conversation-search.js +4 -2
  132. package/dist/lib/daemon-installer.js +6 -2
  133. package/dist/lib/daemon-maintenance.js +2 -1
  134. package/dist/lib/daemon-ref.js +2 -1
  135. package/dist/lib/daemonBroker.js +6 -3
  136. package/dist/lib/daemonBrokerRefusal.js +4 -2
  137. package/dist/lib/daemonHandoff.js +14 -7
  138. package/dist/lib/daemonIslandProfile.js +2 -1
  139. package/dist/lib/dedicated-copy.js +9 -3
  140. package/dist/lib/dedicated-exec.js +2 -1
  141. package/dist/lib/dedicated-keep-awake.js +2 -1
  142. package/dist/lib/dedicated-machines.js +9 -5
  143. package/dist/lib/dedicated-service.js +2 -1
  144. package/dist/lib/dedicated-ssh.js +5 -3
  145. package/dist/lib/deployed-build.js +2 -1
  146. package/dist/lib/device-code.js +4 -3
  147. package/dist/lib/dpop-auth.js +2 -1
  148. package/dist/lib/earnings.js +2 -1
  149. package/dist/lib/exec-runtime-binary.js +5 -3
  150. package/dist/lib/first-party-harness-broker.js +4 -3
  151. package/dist/lib/first-party-harness-managed.js +2 -1
  152. package/dist/lib/first-party-harness-startup-update.js +8 -4
  153. package/dist/lib/first-party-harness-update.js +2 -1
  154. package/dist/lib/first-party-harness.js +2 -1
  155. package/dist/lib/format.d.ts +5 -0
  156. package/dist/lib/format.js +24 -4
  157. package/dist/lib/git-task.js +10 -5
  158. package/dist/lib/github-tools.js +6 -3
  159. package/dist/lib/harnesses.js +4 -2
  160. package/dist/lib/hosted-machines.js +2 -1
  161. package/dist/lib/html-text.js +33 -16
  162. package/dist/lib/instruction-blocks.js +2 -1
  163. package/dist/lib/iso-instant.js +5 -3
  164. package/dist/lib/keychain.js +15 -5
  165. package/dist/lib/label-scope.js +2 -1
  166. package/dist/lib/live-runtime-binary.js +10 -7
  167. package/dist/lib/local-skills.js +10 -6
  168. package/dist/lib/login.js +3 -2
  169. package/dist/lib/machine-audit.js +2 -1
  170. package/dist/lib/machine-daemon-log.js +2 -1
  171. package/dist/lib/machine-services.js +2 -1
  172. package/dist/lib/memory-history-session.js +2 -1
  173. package/dist/lib/memory-sync.js +6 -2
  174. package/dist/lib/message-intent.d.ts +10 -0
  175. package/dist/lib/node-adapter.js +4 -2
  176. package/dist/lib/northstars.js +4 -2
  177. package/dist/lib/oauthLogin.js +16 -7
  178. package/dist/lib/open-target.js +8 -4
  179. package/dist/lib/option-hint.js +2 -4
  180. package/dist/lib/outbox.js +2 -1
  181. package/dist/lib/planOutcome.d.ts +5 -3
  182. package/dist/lib/planOutcome.js +7 -4
  183. package/dist/lib/platform-update-local.js +2 -3
  184. package/dist/lib/proactiveApi.d.ts +38 -1
  185. package/dist/lib/proactiveApi.js +17 -1
  186. package/dist/lib/rate-limit-retry.js +2 -1
  187. package/dist/lib/reflection.js +2 -1
  188. package/dist/lib/request-field-flags.js +2 -1
  189. package/dist/lib/runtime-start-verification.js +2 -1
  190. package/dist/lib/schedule.d.ts +15 -0
  191. package/dist/lib/schedule.js +16 -1
  192. package/dist/lib/scoped-memory-command.js +7 -3
  193. package/dist/lib/search-display.js +11 -4
  194. package/dist/lib/skill-store-pagination.js +2 -1
  195. package/dist/lib/space-notebook.js +5 -3
  196. package/dist/lib/store-listing.js +2 -1
  197. package/dist/lib/task-agent-context-capabilities.js +2 -1
  198. package/dist/lib/task-asset-upload.js +7 -3
  199. package/dist/lib/task-closure.js +2 -1
  200. package/dist/lib/task-economics.js +2 -1
  201. package/dist/lib/task-execution.js +16 -8
  202. package/dist/lib/task-extras.js +4 -2
  203. package/dist/lib/task-operation-watch.js +2 -1
  204. package/dist/lib/task-preflight.js +3 -2
  205. package/dist/lib/task-recurrence-summary.js +4 -2
  206. package/dist/lib/task-runtime-headers.js +10 -5
  207. package/dist/lib/task-transcript.js +3 -2
  208. package/dist/lib/task-transfer.js +9 -5
  209. package/dist/lib/tasks.js +2 -1
  210. package/dist/lib/triggers.d.ts +144 -3
  211. package/dist/lib/triggers.js +280 -23
  212. package/dist/lib/update-check.js +12 -7
  213. package/dist/lib/usage-discovery.js +2 -1
  214. package/dist/lib/usd-micros.js +2 -1
  215. package/dist/lib/web-url.js +2 -1
  216. package/dist/lib/widgetCheck.js +15 -9
  217. package/dist/lib/widgetStaticScan.js +26 -14
  218. package/dist/lib/workflow-run-view.js +5 -3
  219. package/dist/lib/workflow-templates.d.ts +10 -0
  220. package/dist/lib/workflow-templates.js +47 -0
  221. package/dist/lib/write-target.js +4 -5
  222. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/authHelper.js +2 -1
  223. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/commitmentExecutionContract.js +22 -12
  224. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerUse.js +4 -1
  225. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/credentialEnvelope.js +7 -2
  226. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/credentialEnvelopeBridge.js +6 -3
  227. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonConsentProof.js +2 -1
  228. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonPair.js +16 -7
  229. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonWire.js +4 -1
  230. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/desktopDaemonProof.js +4 -3
  231. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/desktopWire.js +2 -1
  232. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/deviceIdentityBridge.js +11 -7
  233. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/deviceKey.js +7 -2
  234. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/dpop.js +8 -3
  235. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarness.js +2 -1
  236. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessChannels.js +4 -3
  237. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessUpdater.js +2 -1
  238. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/githubPushRefusal.js +4 -3
  239. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/guidedUpdate.js +2 -1
  240. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/independentMachineReservation.js +8 -3
  241. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/kek/macos.js +4 -2
  242. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/liveState.js +4 -2
  243. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/loginWithLocalhost.js +2 -1
  244. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/loopbackHttp.js +2 -1
  245. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/machineUuid.js +4 -2
  246. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/profileStateDir.js +2 -1
  247. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/recoveryCode.js +2 -1
  248. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.js +3 -2
  249. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releasePolicy.js +2 -1
  250. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releaseVersions.js +6 -4
  251. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/restartArtifact.js +2 -1
  252. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/spawnEnv.js +2 -1
  253. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/telemetryRedaction.js +7 -4
  254. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/toolApprovalSignature.js +2 -1
  255. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/authHelper.js +2 -1
  256. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/commitmentExecutionContract.js +27 -18
  257. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerUse.js +6 -3
  258. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/credentialEnvelope.js +11 -2
  259. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/credentialEnvelopeBridge.js +6 -3
  260. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonConsentProof.js +2 -1
  261. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonPair.js +20 -8
  262. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonWire.js +5 -4
  263. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/desktopDaemonProof.js +4 -3
  264. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/desktopWire.js +2 -1
  265. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/deviceIdentityBridge.js +11 -7
  266. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/deviceKey.js +11 -2
  267. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/dpop.js +12 -3
  268. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarness.js +2 -1
  269. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessChannels.js +4 -3
  270. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessUpdater.js +2 -1
  271. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/githubPushRefusal.js +4 -3
  272. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/guidedUpdate.js +5 -1
  273. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/independentMachineReservation.js +10 -5
  274. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/kek/macos.js +4 -2
  275. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/liveState.js +4 -2
  276. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/loginWithLocalhost.js +2 -1
  277. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/loopbackHttp.js +2 -1
  278. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/machineUuid.js +4 -2
  279. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/profileStateDir.js +2 -1
  280. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/recoveryCode.js +2 -1
  281. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.js +3 -2
  282. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releasePolicy.js +2 -1
  283. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releaseVersions.js +6 -4
  284. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/restartArtifact.js +2 -1
  285. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/spawnEnv.js +2 -1
  286. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/telemetryRedaction.js +11 -5
  287. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/toolApprovalSignature.js +2 -1
  288. package/dist/node_modules/@skrr-ai/auth-core/package.json +1 -1
  289. package/dist/node_modules/@skrr-ai/data-provider/index.js +20520 -20130
  290. package/dist/node_modules/@skrr-ai/inference-broker/dist/cjs/loopback-server.js +4 -2
  291. package/dist/node_modules/@skrr-ai/inference-broker/dist/cjs/managed-inference-broker.js +10 -6
  292. package/dist/node_modules/@skrr-ai/inference-broker/dist/esm/loopback-server.js +4 -2
  293. package/dist/node_modules/@skrr-ai/inference-broker/dist/esm/managed-inference-broker.js +10 -6
  294. package/dist/node_modules/@skrr-ai/inference-broker/package.json +1 -1
  295. package/oclif.manifest.json +24 -2
  296. package/package.json +1 -1
@@ -2,6 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.withTaskRuntimeHeaders = withTaskRuntimeHeaders;
4
4
  exports.taskRuntimeRedirectOptions = taskRuntimeRedirectOptions;
5
+ const WITH_TASK_RUNTIME_HEADERS_RE = /^\/api\/tasks(?:\/|$)/;
6
+ const WITH_TASK_RUNTIME_HEADERS_RE_2 = /^\/api\/agents\/[^/]+\/agent-actions\/[^/]+\/run\/?$/;
7
+ const WITH_TASK_RUNTIME_HEADERS_RE_3 = /^\/api\/(?:shortcuts|task-templates)\/[^/]+\/(?:instantiate|trigger)\/?$/;
8
+ const WITH_TASK_RUNTIME_HEADERS_RE_4 = /^\/api\/templates\/[^/]+\/(?:instantiate|fork)\/?$/;
9
+ const WITH_TASK_RUNTIME_HEADERS_RE_5 = /^\/api\/store\/services\/[^/]+\/install\/?$/;
5
10
  /**
6
11
  * Account Authorization decides access; a separate server-issued session
7
12
  * credential proves Agent authorship. Environment ids are selectors only.
@@ -34,12 +39,12 @@ function withTaskRuntimeHeaders(headers, requestUrl, method, env = process.env)
34
39
  // Some platform operations materialize Tasks outside the Task router. Keep
35
40
  // their exact POST routes here; action/library edits, picker reads and other
36
41
  // integration routes must never receive the companion credential.
37
- const taskMutation = /^\/api\/tasks(?:\/|$)/.test(target.pathname);
42
+ const taskMutation = WITH_TASK_RUNTIME_HEADERS_RE.test(target.pathname);
38
43
  const taskCreation = method.toUpperCase() === 'POST' && [
39
- /^\/api\/agents\/[^/]+\/agent-actions\/[^/]+\/run\/?$/,
40
- /^\/api\/(?:shortcuts|task-templates)\/[^/]+\/(?:instantiate|trigger)\/?$/,
41
- /^\/api\/templates\/[^/]+\/(?:instantiate|fork)\/?$/,
42
- /^\/api\/store\/services\/[^/]+\/install\/?$/,
44
+ WITH_TASK_RUNTIME_HEADERS_RE_2,
45
+ WITH_TASK_RUNTIME_HEADERS_RE_3,
46
+ WITH_TASK_RUNTIME_HEADERS_RE_4,
47
+ WITH_TASK_RUNTIME_HEADERS_RE_5,
43
48
  ].some((route) => route.test(target.pathname));
44
49
  if (!taskMutation && !taskCreation)
45
50
  return sent;
@@ -20,6 +20,7 @@ exports.unverifiedOutcomeNote = unverifiedOutcomeNote;
20
20
  * functions below.
21
21
  */
22
22
  const data_provider_1 = require("@skrr-ai/data-provider");
23
+ const PARSE_TASK_OUTPUT_BLOCK_RE = /---TASK_OUTPUT---\s*([\s\S]*?)\s*---END_OUTPUT---/;
23
24
  const TASK_OUTPUT_FIELDS = ['status', 'summary', 'artifacts', 'verdict'];
24
25
  /**
25
26
  * Mirror of `api/server/services/taskCompletionFormatting.js:parseTaskOutputBlock`.
@@ -36,7 +37,7 @@ const TASK_OUTPUT_FIELDS = ['status', 'summary', 'artifacts', 'verdict'];
36
37
  function parseTaskOutputBlock(body) {
37
38
  if (!body)
38
39
  return null;
39
- const match = body.match(/---TASK_OUTPUT---\s*([\s\S]*?)\s*---END_OUTPUT---/);
40
+ const match = body.match(PARSE_TASK_OUTPUT_BLOCK_RE);
40
41
  if (!match)
41
42
  return null;
42
43
  const block = match[1];
@@ -60,7 +61,7 @@ function parseTaskOutputBlock(body) {
60
61
  function unattributedBlockLines(body) {
61
62
  if (!body)
62
63
  return [];
63
- const match = body.match(/---TASK_OUTPUT---\s*([\s\S]*?)\s*---END_OUTPUT---/);
64
+ const match = body.match(PARSE_TASK_OUTPUT_BLOCK_RE);
64
65
  if (!match)
65
66
  return [];
66
67
  const known = new RegExp(`^(?:${TASK_OUTPUT_FIELDS.join('|')}):`, 'i');
@@ -9,6 +9,10 @@ exports.parsePortableTaskExport = parsePortableTaskExport;
9
9
  exports.importExternalKey = importExternalKey;
10
10
  exports.importableTaskNode = importableTaskNode;
11
11
  const node_crypto_1 = require("node:crypto");
12
+ const CSV_CELL_RE = /[",\r\n]/;
13
+ const CSV_CELL_RE_2 = /"/g;
14
+ const PARSE_CSV_RE = /\r$/;
15
+ const IMPORT_EXTERNAL_KEY_RE = /\/+$/;
12
16
  const PORTABLE_FIELDS = [
13
17
  'identifier',
14
18
  'externalKey',
@@ -98,7 +102,7 @@ function csvCell(value) {
98
102
  let raw = '';
99
103
  if (value !== undefined && value !== null)
100
104
  raw = typeof value === 'string' ? value : JSON.stringify(value);
101
- return /[",\r\n]/.test(raw) ? `"${raw.replace(/"/g, '""')}"` : raw;
105
+ return CSV_CELL_RE.test(raw) ? `"${raw.replace(CSV_CELL_RE_2, '""')}"` : raw;
102
106
  }
103
107
  /** CSV intentionally keeps arrays as JSON cells: commas in tags and comments round-trip safely. */
104
108
  function portableTaskExportToCsv(exported) {
@@ -141,7 +145,7 @@ function parseCsv(text) {
141
145
  cell = '';
142
146
  }
143
147
  else if (char === '\n') {
144
- row.push(cell.replace(/\r$/, ''));
148
+ row.push(cell.replace(PARSE_CSV_RE, ''));
145
149
  rows.push(row);
146
150
  row = [];
147
151
  cell = '';
@@ -152,7 +156,7 @@ function parseCsv(text) {
152
156
  if (quoted)
153
157
  throw new Error('CSV has an unterminated quoted field');
154
158
  if (cell || row.length) {
155
- row.push(cell.replace(/\r$/, ''));
159
+ row.push(cell.replace(PARSE_CSV_RE, ''));
156
160
  rows.push(row);
157
161
  }
158
162
  return rows.filter((value) => value.some((cellValue) => cellValue.length > 0));
@@ -269,11 +273,11 @@ function importExternalKey(prefix, node) {
269
273
  : node.tempId;
270
274
  if (!prefix)
271
275
  return current === node.tempId && !node.externalKey ? undefined : current;
272
- const base = `${prefix.replace(/\/+$/, '')}/${current}`;
276
+ const base = `${prefix.replace(IMPORT_EXTERNAL_KEY_RE, '')}/${current}`;
273
277
  if (base.length <= 300)
274
278
  return base;
275
279
  const hash = (0, node_crypto_1.createHash)('sha256').update(current).digest('hex').slice(0, 16);
276
- const shortPrefix = prefix.replace(/\/+$/, '').slice(0, 280 - hash.length);
280
+ const shortPrefix = prefix.replace(IMPORT_EXTERNAL_KEY_RE, '').slice(0, 280 - hash.length);
277
281
  return `${shortPrefix}/${hash}`;
278
282
  }
279
283
  /** Remove unsupported/sensitive fields before passing a portable row to create-tree's planner. */
package/dist/lib/tasks.js CHANGED
@@ -46,6 +46,7 @@ const data_provider_1 = require("@skrr-ai/data-provider");
46
46
  const prompt_1 = require("./prompt");
47
47
  const projects_1 = require("./projects");
48
48
  const node_path_1 = require("node:path");
49
+ const NORMALIZE_VERDICT_RE = /[\s-]+/g;
49
50
  /**
50
51
  * `--goal` on `tasks update`. `none`, `null` and `clear` detach the goal: PATCH
51
52
  * sends `goalId: null`. Anything else names a goal. `clear` is accepted because
@@ -1228,7 +1229,7 @@ function normalizeVerdict(value) {
1228
1229
  return String(value ?? '')
1229
1230
  .trim()
1230
1231
  .toLowerCase()
1231
- .replace(/[\s-]+/g, '_');
1232
+ .replace(NORMALIZE_VERDICT_RE, '_');
1232
1233
  }
1233
1234
  /**
1234
1235
  * Does this verdict mean anything to the server?
@@ -82,6 +82,25 @@ export declare function validateEventFilter(input: {
82
82
  filterField?: string;
83
83
  filterValues?: string[];
84
84
  }): void;
85
+ /**
86
+ * What the trigger's own working / quiet window does to the occurrences it has coming (OSK-22529),
87
+ * the server's reading on `GET /api/triggers/:id` for a trigger that has a window. `windows` are in the
88
+ * shape a skipped fire's record keeps (`SkippedWindowRecord`). Absent means UNKNOWN, never "clear".
89
+ */
90
+ export interface WindowVerdict {
91
+ windows: Array<{
92
+ kind?: string;
93
+ start?: string;
94
+ end?: string;
95
+ timezone?: string;
96
+ timezoneDefaulted?: boolean;
97
+ }>;
98
+ state: 'clear' | 'blocks_next' | 'blocks_all' | 'no_next_run';
99
+ checked?: number;
100
+ next?: string;
101
+ reason?: string;
102
+ firstClear?: string | null;
103
+ }
85
104
  export interface SchedulerLimits {
86
105
  state: 'ok' | 'reached';
87
106
  reason?: string;
@@ -92,6 +111,13 @@ export interface SchedulerLimits {
92
111
  triggerFireCount?: number;
93
112
  triggerFiresToday?: number;
94
113
  note?: string;
114
+ /** Slots the scheduler claimed whose trigger has not started yet (OSK-22638); a single-trigger read only. */
115
+ awaitingStart?: {
116
+ awaitingStart: number;
117
+ running: number;
118
+ oldestDueAt?: string;
119
+ oldestAgeMs?: number;
120
+ };
95
121
  }
96
122
  export interface TriggerDefinition {
97
123
  id?: string;
@@ -172,6 +198,8 @@ export interface TriggerDefinition {
172
198
  * limit, a read that failed), never "fine".
173
199
  */
174
200
  schedulerLimits?: SchedulerLimits;
201
+ /** The server's reading of what the trigger's window does to its next occurrences (OSK-22529). */
202
+ windowVerdict?: WindowVerdict;
175
203
  createdAt?: string;
176
204
  updatedAt?: string;
177
205
  }
@@ -247,6 +275,14 @@ export interface TriggerListResponse {
247
275
  export interface TriggerAuditResponse {
248
276
  fires: TriggerFireRecord[];
249
277
  nextCursor?: string | null;
278
+ /**
279
+ * Present on a per-trigger audit of a one-shot that is armed and more than a minute past its
280
+ * `runAt`: it has no fire record because the scheduler has not fired it yet (OSK-22619).
281
+ */
282
+ waiting?: {
283
+ bySeconds: number;
284
+ message: string;
285
+ };
250
286
  }
251
287
  export interface TriggerParseIntentResponse {
252
288
  message?: string;
@@ -423,6 +459,69 @@ export declare function assertModeRequiredFlags(mode: unknown, flags: Record<str
423
459
  * by itself (OSK-15492). Absent when the server reported nothing to say.
424
460
  */
425
461
  export declare function describeScheduledFire(result: Record<string, unknown>): string | undefined;
462
+ /**
463
+ * The `202` a `Prefer: respond-async` fire-now answers when the fire outlived the server's short wait:
464
+ * the fire is running and was not cut short. NOT a result.
465
+ */
466
+ export interface FireAccepted {
467
+ accepted: true;
468
+ outcome: 'running';
469
+ occurrenceId: string | null;
470
+ message?: string;
471
+ }
472
+ export declare function isFireAccepted(value: unknown): value is FireAccepted;
473
+ /** A fire record still being worked: `pending` is the claim before the outcome is written. */
474
+ export declare function fireRecordIsSettled(record: {
475
+ outcome?: unknown;
476
+ } | null | undefined): boolean;
477
+ export declare const FIRE_FOLLOW_POLL_MS = 3000;
478
+ /** Long enough for the slowest fire seen (215 s) with room; then the poll command is printed instead. */
479
+ export declare const FIRE_FOLLOW_MAX_WAIT_MS: number;
480
+ export type FollowedFire = {
481
+ settled: true;
482
+ result: Record<string, unknown>;
483
+ } | {
484
+ settled: false;
485
+ occurrenceId: string | null;
486
+ };
487
+ /**
488
+ * Follow a fire the server answered 202 for, by reading its record until the outcome is written.
489
+ * `result` is the record shaped like a synchronous fire answer (`outcome`, `reason`, ...), so the same
490
+ * strict check and detail lines apply. A record that does not exist yet is waited for: the claim is
491
+ * written a moment after the 202. Gives up after `maxWaitMs`, saying so rather than guessing.
492
+ */
493
+ export declare function followAcceptedFire(options: {
494
+ triggerId: string;
495
+ accepted: FireAccepted;
496
+ fetchFire?: (triggerId: string, fireId: string) => Promise<Record<string, unknown> | null>;
497
+ sleep?: (ms: number) => Promise<void>;
498
+ now?: () => number;
499
+ pollMs?: number;
500
+ maxWaitMs?: number;
501
+ onWaiting?: (elapsedMs: number) => void;
502
+ }): Promise<FollowedFire>;
503
+ /**
504
+ * A fire answer in hand: a result passes through; a `202` is followed until its record settles. Says
505
+ * (on stderr, once) that it is waiting, because a fire that took 215 s looks like a hang otherwise.
506
+ * `running` is a fire still going when the CLI stopped waiting, with the command that reads it later.
507
+ */
508
+ export declare function settleFireAnswer(options: {
509
+ triggerId: string;
510
+ agentId?: string;
511
+ bin: string;
512
+ answer: Record<string, unknown>;
513
+ follow?: typeof followAcceptedFire;
514
+ note?: (line: string) => void;
515
+ }): Promise<{
516
+ running: false;
517
+ result: Record<string, unknown>;
518
+ } | {
519
+ running: true;
520
+ answer: FireAccepted;
521
+ command: string;
522
+ }>;
523
+ /** The command that reads a fire later, for a fire still running when the CLI stopped waiting. */
524
+ export declare function fireFollowCommand(bin: string, agentId: string | undefined, triggerId: string, occurrenceId: string | null): string;
426
525
  /**
427
526
  * Was the fire admitted? `in_progress` and `awaiting_runtime` are admissions whose terminal arrives
428
527
  * later (every agent-turn fire answers `in_progress`), and a repeat of a fire that was admitted is
@@ -597,6 +696,14 @@ export declare const TRIGGER_WINDOW_FLAG_HELP = "JSON object {\"enabled\":true,\
597
696
  * the limit is reached it drops every later slot without running or recording it (OSK-22526).
598
697
  */
599
698
  export declare function schedulerLimitSentence(limits: SchedulerLimits): string;
699
+ /**
700
+ * Slots the scheduler has claimed and charged to the run limit whose trigger has not started, once they
701
+ * are late enough to matter. The audit has no row for such a slot and `claimed` runs ahead of the fires
702
+ * counted, which reads like a lost claim; it is a durable outbox row the dispatcher keeps retrying
703
+ * (a rollout, a held admission gate or a dead dispatcher's lease makes it late). Undefined when there
704
+ * is nothing late to say, so a healthy trigger prints nothing.
705
+ */
706
+ export declare function claimsAwaitingStartLine(limits?: SchedulerLimits | null): string | undefined;
600
707
  /**
601
708
  * Human phrasing for a trigger's enabled state (OSK-4886).
602
709
  *
@@ -605,13 +712,20 @@ export declare function schedulerLimitSentence(limits: SchedulerLimits): string;
605
712
  * trigger did not plainly confirm it is live.
606
713
  */
607
714
  export declare function armedStateLabel(enabled: boolean | undefined, lastResult?: string | null,
608
- /** Pass for a `once` trigger: how often its single fire ran. A spent one-shot is not waiting to be enabled (OSK-21509). */
715
+ /**
716
+ * Pass for a `once` trigger: how often its single fire ran, whether it has been consumed (`firedAt`, which a
717
+ * skip sets too), and its id for the re-arm command. A spent one-shot is not waiting to be enabled (OSK-21509).
718
+ */
609
719
  oneShot?: {
610
720
  fires?: number;
611
721
  failures?: number;
722
+ firedAt?: unknown;
723
+ id?: string;
612
724
  } | null,
613
725
  /** The server's reading of the scheduler's run limits: a reached limit means no slot will run (OSK-22526). */
614
- schedulerLimits?: SchedulerLimits | null): string;
726
+ schedulerLimits?: SchedulerLimits | null,
727
+ /** The server's reading of what the trigger's window does to its next runs (OSK-22529). */
728
+ windowVerdict?: WindowVerdict | null): string;
615
729
  /**
616
730
  * Human phrasing for an effect trigger's write mode (OSK-4886).
617
731
  *
@@ -680,6 +794,18 @@ export declare function renderTriggerSummary(trigger: TriggerDefinition, log: (l
680
794
  baseURL?: string;
681
795
  }): void;
682
796
  export declare function renderLegacyRuns(runs: LegacyTriggerRun[], log: (line: string) => void): void;
797
+ /**
798
+ * The window lines `triggers show` prints (OSK-22529): each enabled window with its zone, then what it does
799
+ * to the next occurrences, in the server's reading. Empty for a trigger with no window, or when the server
800
+ * did not send one (an older server): unknown is not printed as clear.
801
+ */
802
+ export declare function windowVerdictLines(trigger: TriggerDefinition): string[];
803
+ /**
804
+ * `Fires: ..., last <this>`. A window skip is recorded as `outcome:reason` with the same code on both sides,
805
+ * so the line read `last outside_working_hours:outside_working_hours`; it says the sentence the audit says
806
+ * (`clockSkipAuditExplanation`), and any other result is printed as recorded.
807
+ */
808
+ export declare function lastResultLabel(trigger: TriggerDefinition): string | undefined;
683
809
  /**
684
810
  * Why a fire was skipped by a working or quiet window, in words. Both trigger-level windows (Gate 5)
685
811
  * consume the occurrence: a one-shot is spent, a recurring schedule carries on to its next slot, and
@@ -700,10 +826,16 @@ export declare function clockSkipAuditExplanation(fire: {
700
826
  * (gate 7) finding an earlier fire still holding it: this occurrence was dropped, not queued, and an
701
827
  * occurrence that was dropped is consumed, so it is not retried (OSK-22509). The raw code alone read
702
828
  * as a fire that was still in progress.
829
+ *
830
+ * The server records who held the lane and when its lease lapses (`metadata.lane`, OSK-22625). A lane
831
+ * is held by a lease its holder renews every minute, so `holdsUntil` is the latest the lane stays
832
+ * busy if the holder has died; a live holder keeps extending it. A fire from before the server wrote
833
+ * this keeps the general sentence.
703
834
  */
704
835
  export declare function coalescedAuditExplanation(fire: {
705
836
  outcome?: unknown;
706
837
  reason?: unknown;
838
+ metadata?: unknown;
707
839
  }): {
708
840
  summary: string;
709
841
  detail: string;
@@ -718,7 +850,16 @@ export declare function policyAuditExplanation(fire: {
718
850
  summary: string;
719
851
  detail: string;
720
852
  } | null;
721
- export declare function renderFireAudit(fires: TriggerFireRecord[], log: (line: string) => void): void;
853
+ /**
854
+ * The words for the few fire reasons that are only ever a code (OSK-22643). A reason a person can act on
855
+ * already has its own explanation above; these two are what the scheduler records when it finishes
856
+ * normally or runs out of runs, and read as an error when printed bare. Anything else is left as the
857
+ * server wrote it.
858
+ */
859
+ export declare function fireReasonText(reason: string): string;
860
+ export declare function renderFireAudit(fires: TriggerFireRecord[], log: (line: string) => void, waiting?: TriggerAuditResponse['waiting'], options?: {
861
+ timeZone?: string;
862
+ }): void;
722
863
  /**
723
864
  * Trigger budget for one scope. `active` counts only ENABLED rows — a disabled
724
865
  * trigger holds no scheduler resources — while `reclaimable` counts the