@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
@@ -25,6 +25,8 @@ var import_node_http = require("node:http");
25
25
  var import_node_crypto = require("node:crypto");
26
26
  var import_node_fs = require("node:fs");
27
27
  var import_contract = require("./contract.js");
28
+ const AUTHORIZE_RE = /^Bearer\s+/i;
29
+ const ORIGIN_FORM_PATH_RE = /^[a-z][a-z0-9+.-]*:\/\//i;
28
30
  class RequestBodyTooLargeError extends Error {
29
31
  maxBodyBytes;
30
32
  constructor(maxBodyBytes) {
@@ -157,7 +159,7 @@ class ModelProxyLoopbackServer {
157
159
  const presented = Array.isArray(header) ? header[0] : header;
158
160
  if (!presented)
159
161
  return false;
160
- const token = presented.replace(/^Bearer\s+/i, "");
162
+ const token = presented.replace(AUTHORIZE_RE, "");
161
163
  return constantTimeEqual(token, this.opts.relayToken);
162
164
  }
163
165
  }
@@ -169,7 +171,7 @@ function constantTimeEqual(a, b) {
169
171
  return (0, import_node_crypto.timingSafeEqual)(bufA, bufB);
170
172
  }
171
173
  function originFormPath(rawTarget, ownOrigin) {
172
- if (!/^[a-z][a-z0-9+.-]*:\/\//i.test(rawTarget))
174
+ if (!ORIGIN_FORM_PATH_RE.test(rawTarget))
173
175
  return rawTarget;
174
176
  let target;
175
177
  try {
@@ -39,6 +39,10 @@ var import_node_path = require("node:path");
39
39
  var import_loopback_server = require("./loopback-server.js");
40
40
  var import_contract = require("./contract.js");
41
41
  var import_managed_inference_renewal = require("./managed-inference-renewal.js");
42
+ const WITH_INFERENCE_BROKER_HOST_RE = /[\s,]+$/;
43
+ const BUILD_MANAGED_INFERENCE_RELAY_CREDENTIAL_RE = /\/$/;
44
+ const START_MANAGED_INFERENCE_BROKER_RE = /\/+$/;
45
+ const SUPPORTS_MANAGED_PROMPT_CACHING_RE = /^openai\//;
42
46
  const MANAGED_STATUS_PATH = "/oversky/managed-status";
43
47
  const INFERENCE_BROKER_ORIGIN = "http://oversky-inference-broker.invalid";
44
48
  const INFERENCE_BROKER_HOST = new URL(INFERENCE_BROKER_ORIGIN).hostname;
@@ -55,7 +59,7 @@ function withInferenceBrokerHost(list) {
55
59
  const entries = list.split(",").map((entry) => entry.trim().toLowerCase());
56
60
  if (entries.includes("*") || entries.includes(INFERENCE_BROKER_HOST))
57
61
  return list;
58
- const kept = list.replace(/[\s,]+$/, "");
62
+ const kept = list.replace(WITH_INFERENCE_BROKER_HOST_RE, "");
59
63
  return kept ? `${kept},${INFERENCE_BROKER_HOST}` : INFERENCE_BROKER_HOST;
60
64
  }
61
65
  const MANAGED_SESSION_ENV = "OVERSKY_MANAGED_SESSION";
@@ -131,7 +135,7 @@ function buildManagedInferenceRelayCredential(credential, options) {
131
135
  return {
132
136
  source: "gateway-relay",
133
137
  ...credential.modelScope ? { modelScope: credential.modelScope } : {},
134
- baseUrl: base.toString().replace(/\/$/, ""),
138
+ baseUrl: base.toString().replace(BUILD_MANAGED_INFERENCE_RELAY_CREDENTIAL_RE, ""),
135
139
  authToken: sessionToken
136
140
  };
137
141
  }
@@ -283,7 +287,7 @@ async function startManagedInferenceBroker(options) {
283
287
  }
284
288
  let stopped = false;
285
289
  if (options.leaseExpiresInMs && options.leaseExpiresInMs > 0) {
286
- const renewUrl = `${gatewayBase.replace(/\/+$/, "")}/renew`;
290
+ const renewUrl = `${gatewayBase.replace(START_MANAGED_INFERENCE_BROKER_RE, "")}/renew`;
287
291
  const renewModel = modelScope?.gatewayModelAlias ?? legacyModel;
288
292
  const refreshCapability = options.refreshCapability;
289
293
  renewal = (0, import_managed_inference_renewal.startRenewalLoop)({
@@ -434,7 +438,7 @@ function resolveGatewayUrl(base, allowedOrigin, path) {
434
438
  try {
435
439
  const parsedBase = new URL(base);
436
440
  const canonicalPath = path.startsWith("/v1/") ? path : `/v1${path}`;
437
- const basePath = parsedBase.pathname.replace(/\/$/, "");
441
+ const basePath = parsedBase.pathname.replace(BUILD_MANAGED_INFERENCE_RELAY_CREDENTIAL_RE, "");
438
442
  const suffix = basePath.endsWith("/v1") ? canonicalPath.slice(3) : canonicalPath;
439
443
  parsedBase.pathname = `${basePath}${suffix}`;
440
444
  parsedBase.search = "";
@@ -616,11 +620,11 @@ function isPlainObject(value) {
616
620
  }
617
621
  const MAX_OPENAI_CACHE_BREAKPOINTS = 50;
618
622
  function supportsManagedPromptCaching(modelScope) {
619
- const model = nonEmpty(modelScope.wireModel)?.replace(/^openai\//, "").toLowerCase();
623
+ const model = nonEmpty(modelScope.wireModel)?.replace(SUPPORTS_MANAGED_PROMPT_CACHING_RE, "").toLowerCase();
620
624
  return modelScope.upstreamProvider === "openai" && Boolean(model?.startsWith("gpt-5.6"));
621
625
  }
622
626
  function enforcePromptCacheEnvelope(payload, envelope, modelScope) {
623
- const model = nonEmpty(modelScope.wireModel)?.replace(/^openai\//, "").toLowerCase();
627
+ const model = nonEmpty(modelScope.wireModel)?.replace(SUPPORTS_MANAGED_PROMPT_CACHING_RE, "").toLowerCase();
624
628
  const claudeCacheControlFamily = ["anthropic", "openrouter", "bedrock"].includes(modelScope.upstreamProvider) && model?.includes("claude");
625
629
  if (claudeCacheControlFamily) {
626
630
  if (envelope.allowPromptCaching) {
@@ -17,6 +17,8 @@ import { createServer } from 'node:http';
17
17
  import { timingSafeEqual } from 'node:crypto';
18
18
  import { chmodSync, chownSync, unlinkSync } from 'node:fs';
19
19
  import { MODEL_PROXY_ERROR, MODEL_PROXY_MAX_BODY_BYTES, ModelProxyError, } from './contract.js';
20
+ const AUTHORIZE_RE = /^Bearer\s+/i;
21
+ const ORIGIN_FORM_PATH_RE = /^[a-z][a-z0-9+.-]*:\/\//i;
20
22
  class RequestBodyTooLargeError extends Error {
21
23
  maxBodyBytes;
22
24
  constructor(maxBodyBytes) {
@@ -174,7 +176,7 @@ export class ModelProxyLoopbackServer {
174
176
  const presented = Array.isArray(header) ? header[0] : header;
175
177
  if (!presented)
176
178
  return false;
177
- const token = presented.replace(/^Bearer\s+/i, '');
179
+ const token = presented.replace(AUTHORIZE_RE, '');
178
180
  return constantTimeEqual(token, this.opts.relayToken);
179
181
  }
180
182
  }
@@ -222,7 +224,7 @@ function constantTimeEqual(a, b) {
222
224
  * untouched, exactly as before, for the forwarder to judge.
223
225
  */
224
226
  function originFormPath(rawTarget, ownOrigin) {
225
- if (!/^[a-z][a-z0-9+.-]*:\/\//i.test(rawTarget))
227
+ if (!ORIGIN_FORM_PATH_RE.test(rawTarget))
226
228
  return rawTarget;
227
229
  let target;
228
230
  try {
@@ -15,6 +15,10 @@ import { join } from 'node:path';
15
15
  import { ModelProxyLoopbackServer } from './loopback-server.js';
16
16
  import { MODEL_PROXY_ERROR, ModelProxyError } from './contract.js';
17
17
  import { startRenewalLoop, } from './managed-inference-renewal.js';
18
+ const WITH_INFERENCE_BROKER_HOST_RE = /[\s,]+$/;
19
+ const BUILD_MANAGED_INFERENCE_RELAY_CREDENTIAL_RE = /\/$/;
20
+ const START_MANAGED_INFERENCE_BROKER_RE = /\/+$/;
21
+ const SUPPORTS_MANAGED_PROMPT_CACHING_RE = /^openai\//;
18
22
  // A synthetic origin is required by URL-oriented provider SDKs. skrr Code pairs
19
23
  // it with OVERSKY_INFERENCE_BROKER_SOCKET and Bun's `fetch({ unix })`; it is
20
24
  // never resolved through DNS or connected over TCP.
@@ -67,7 +71,7 @@ function withInferenceBrokerHost(list) {
67
71
  const entries = list.split(',').map((entry) => entry.trim().toLowerCase());
68
72
  if (entries.includes('*') || entries.includes(INFERENCE_BROKER_HOST))
69
73
  return list;
70
- const kept = list.replace(/[\s,]+$/, '');
74
+ const kept = list.replace(WITH_INFERENCE_BROKER_HOST_RE, '');
71
75
  return kept ? `${kept},${INFERENCE_BROKER_HOST}` : INFERENCE_BROKER_HOST;
72
76
  }
73
77
  export const MANAGED_SESSION_ENV = 'OVERSKY_MANAGED_SESSION';
@@ -171,7 +175,7 @@ export function buildManagedInferenceRelayCredential(credential, options) {
171
175
  return {
172
176
  source: 'gateway-relay',
173
177
  ...(credential.modelScope ? { modelScope: credential.modelScope } : {}),
174
- baseUrl: base.toString().replace(/\/$/, ''),
178
+ baseUrl: base.toString().replace(BUILD_MANAGED_INFERENCE_RELAY_CREDENTIAL_RE, ''),
175
179
  authToken: sessionToken,
176
180
  };
177
181
  }
@@ -400,7 +404,7 @@ export async function startManagedInferenceBroker(options) {
400
404
  // uses (`upstreamKey`, an `agst_` token) against `<relay base>/renew` — so no
401
405
  // second credential and no new daemon-to-worker message are involved.
402
406
  if (options.leaseExpiresInMs && options.leaseExpiresInMs > 0) {
403
- const renewUrl = `${gatewayBase.replace(/\/+$/, '')}/renew`;
407
+ const renewUrl = `${gatewayBase.replace(START_MANAGED_INFERENCE_BROKER_RE, '')}/renew`;
404
408
  const renewModel = modelScope?.gatewayModelAlias ?? legacyModel;
405
409
  const refreshCapability = options.refreshCapability;
406
410
  renewal = startRenewalLoop({
@@ -654,7 +658,7 @@ function resolveGatewayUrl(base, allowedOrigin, path) {
654
658
  try {
655
659
  const parsedBase = new URL(base);
656
660
  const canonicalPath = path.startsWith('/v1/') ? path : `/v1${path}`;
657
- const basePath = parsedBase.pathname.replace(/\/$/, '');
661
+ const basePath = parsedBase.pathname.replace(BUILD_MANAGED_INFERENCE_RELAY_CREDENTIAL_RE, '');
658
662
  const suffix = basePath.endsWith('/v1') ? canonicalPath.slice(3) : canonicalPath;
659
663
  parsedBase.pathname = `${basePath}${suffix}`;
660
664
  parsedBase.search = '';
@@ -927,7 +931,7 @@ function isPlainObject(value) {
927
931
  const MAX_OPENAI_CACHE_BREAKPOINTS = 50;
928
932
  function supportsManagedPromptCaching(modelScope) {
929
933
  const model = nonEmpty(modelScope.wireModel)
930
- ?.replace(/^openai\//, '')
934
+ ?.replace(SUPPORTS_MANAGED_PROMPT_CACHING_RE, '')
931
935
  .toLowerCase();
932
936
  return modelScope.upstreamProvider === 'openai' && Boolean(model?.startsWith('gpt-5.6'));
933
937
  }
@@ -941,7 +945,7 @@ function supportsManagedPromptCaching(modelScope) {
941
945
  */
942
946
  function enforcePromptCacheEnvelope(payload, envelope, modelScope) {
943
947
  const model = nonEmpty(modelScope.wireModel)
944
- ?.replace(/^openai\//, '')
948
+ ?.replace(SUPPORTS_MANAGED_PROMPT_CACHING_RE, '')
945
949
  .toLowerCase();
946
950
  const claudeCacheControlFamily = ['anthropic', 'openrouter', 'bedrock'].includes(modelScope.upstreamProvider) &&
947
951
  model?.includes('claude');
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skrr-ai/inference-broker",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "main": "dist/cjs/index.js",
5
5
  "types": "dist/cjs/index.d.ts",
6
6
  "exports": {
@@ -7498,6 +7498,13 @@
7498
7498
  "allowNo": false,
7499
7499
  "type": "boolean"
7500
7500
  },
7501
+ "idempotency-key": {
7502
+ "description": "Name this start (1-128 characters: letters, numbers, dot, underscore, colon, hyphen). The CLI already names every start and, when the server does not confirm one (a 502, 503 or 504, or a dropped connection), sends the same request again so the server returns the turn it accepted instead of starting a second one. Pass your own key to re-attach to a start from another process: the same key and prompt return the original turn; a different prompt under it is refused.",
7503
+ "name": "idempotency-key",
7504
+ "hasDynamicHelp": false,
7505
+ "multiple": false,
7506
+ "type": "option"
7507
+ },
7501
7508
  "repair-wait": {
7502
7509
  "description": "Seconds to keep waiting when a platform update restarts the server relaying a turn your machine is still running. The server repairs the reply onto the conversation when the machine finishes, and the CLI prints it and exits 0; if the wait runs out the original failure is reported. 0 ends at the failure immediately. At most the server's own hold for such a turn (2100s).",
7503
7510
  "name": "repair-wait",
@@ -16141,6 +16148,13 @@
16141
16148
  "multiple": false,
16142
16149
  "type": "option"
16143
16150
  },
16151
+ "follow": {
16152
+ "description": "Read the receipt of an install that outlived its request, by the operation id the 202 named, and exit",
16153
+ "name": "follow",
16154
+ "hasDynamicHelp": false,
16155
+ "multiple": false,
16156
+ "type": "option"
16157
+ },
16144
16158
  "print-spec-template": {
16145
16159
  "description": "Print a valid spec JSON to edit and pass to --from-spec, and exit (creates nothing)",
16146
16160
  "name": "print-spec-template",
@@ -102753,7 +102767,8 @@
102753
102767
  "examples": [
102754
102768
  "<%= config.bin %> spaces workflow-templates extract <space-id> <workflow-id> --nodes task_1,approval_1 --title \"Task with review\"",
102755
102769
  "<%= config.bin %> spaces workflow-templates extract <space-id> <workflow-id> --nodes task_1,approval_1 --title Review --scope space --json",
102756
- "<%= config.bin %> spaces workflow-templates extract <space-id> <workflow-id> --nodes task_1 --title Draft --no-publish"
102770
+ "<%= config.bin %> spaces workflow-templates extract <space-id> <workflow-id> --nodes task_1 --title Draft --no-publish",
102771
+ "<%= config.bin %> spaces workflow-templates extract <space-id> <workflow-id> --nodes call_1 --title \"Nightly sync\" --keep-concrete call_1.definitionId"
102757
102772
  ],
102758
102773
  "flags": {
102759
102774
  "bare": {
@@ -102832,6 +102847,13 @@
102832
102847
  "multiple": false,
102833
102848
  "type": "option"
102834
102849
  },
102850
+ "keep-concrete": {
102851
+ "description": "Keep one value concrete instead of turning it into a slot: nodeKey.configPath (for example call_1.definitionId). Repeat for more. The node must be in --nodes. The template then only works where that value resolves, and publishing it checks that a workflow_call target is published in this space.",
102852
+ "name": "keep-concrete",
102853
+ "hasDynamicHelp": false,
102854
+ "multiple": true,
102855
+ "type": "option"
102856
+ },
102835
102857
  "publish": {
102836
102858
  "description": "Publish v1 immediately (default: true; --no-publish leaves it a draft)",
102837
102859
  "name": "publish",
@@ -144359,5 +144381,5 @@
144359
144381
  ]
144360
144382
  }
144361
144383
  },
144362
- "version": "0.1.145"
144384
+ "version": "0.1.147"
144363
144385
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skrr-ai/cli",
3
- "version": "0.1.145",
3
+ "version": "0.1.147",
4
4
  "description": "Command-line interface for skrr",
5
5
  "license": "ISC",
6
6
  "author": "skrr",