deepline 0.3.89 → 0.3.90

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 (211) hide show
  1. package/contracts/install-commands.json +29 -0
  2. package/dist/bundling-sources/sdk/src/client.ts +120 -37
  3. package/dist/bundling-sources/sdk/src/index.ts +4 -0
  4. package/dist/bundling-sources/sdk/src/pagination.ts +25 -0
  5. package/dist/bundling-sources/sdk/src/plays/bundle-play-file.ts +1 -1
  6. package/dist/bundling-sources/sdk/src/release.ts +16 -9
  7. package/dist/bundling-sources/sdk/src/types.ts +23 -0
  8. package/dist/bundling-sources/shared_libs/monitors/analytics-public.ts +10 -0
  9. package/dist/bundling-sources/shared_libs/monitors/http-error-response.ts +3 -0
  10. package/dist/bundling-sources/shared_libs/monitors/inbound-queue.ts +4 -4
  11. package/dist/bundling-sources/shared_libs/monitors/inventory-reconciliation.ts +59 -0
  12. package/dist/bundling-sources/shared_libs/monitors/lifecycle-notifications.ts +7 -9
  13. package/dist/bundling-sources/shared_libs/monitors/package.json +7 -0
  14. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-batch-operation.ts +44 -2
  15. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-consumer-health.ts +2 -2
  16. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-identity-claims.ts +2 -2
  17. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-public-aliases.ts +1 -1
  18. package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-dead-letter.ts +245 -0
  19. package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-message.ts +38 -0
  20. package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-queue-ack-probe.ts +94 -0
  21. package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-queue-delivery.ts +60 -0
  22. package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-queue.ts +60 -0
  23. package/dist/bundling-sources/shared_libs/monitors/snitcher-install-validation.ts +1 -1
  24. package/dist/bundling-sources/shared_libs/monitors/snitcher-ip2company.ts +2 -2
  25. package/dist/bundling-sources/shared_libs/monitors/snitcher-radar.ts +1 -1
  26. package/dist/bundling-sources/shared_libs/monitors/tracking-provider-integrations.ts +1 -1
  27. package/dist/bundling-sources/shared_libs/observability/build-context.ts +13 -0
  28. package/dist/bundling-sources/shared_libs/observability/log-metadata.ts +160 -0
  29. package/dist/bundling-sources/shared_libs/observability/request-context.ts +68 -0
  30. package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +654 -0
  31. package/dist/bundling-sources/shared_libs/observability/scheduled-work-manual.ts +35 -0
  32. package/dist/bundling-sources/shared_libs/observability/scheduled-work.ts +5 -0
  33. package/dist/bundling-sources/shared_libs/play-data-plane/neon-constants.ts +9 -0
  34. package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +272 -0
  35. package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +45 -0
  36. package/dist/bundling-sources/shared_libs/play-runtime/async-operation.ts +66 -1
  37. package/dist/bundling-sources/shared_libs/play-runtime/async-play-invocation.ts +0 -1
  38. package/dist/bundling-sources/shared_libs/play-runtime/bounceban-batching.ts +137 -0
  39. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +779 -140
  40. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +46 -0
  41. package/dist/bundling-sources/shared_libs/play-runtime/daytona-payload-contract.ts +68 -0
  42. package/dist/bundling-sources/shared_libs/play-runtime/daytona-sandbox-janitor.ts +103 -0
  43. package/dist/bundling-sources/shared_libs/play-runtime/daytona-sandbox-reaper.ts +725 -0
  44. package/dist/bundling-sources/shared_libs/play-runtime/durable-call-cache.ts +29 -0
  45. package/dist/bundling-sources/shared_libs/play-runtime/execution-capabilities.ts +23 -0
  46. package/dist/bundling-sources/shared_libs/play-runtime/execution-gateway-invocation-fence.ts +442 -0
  47. package/dist/bundling-sources/shared_libs/play-runtime/execution-protocol.ts +3 -3
  48. package/dist/bundling-sources/shared_libs/play-runtime/fixture-behavior.ts +18 -0
  49. package/dist/bundling-sources/shared_libs/play-runtime/governor/app-runtime-rate-state-backend.ts +9 -0
  50. package/dist/bundling-sources/shared_libs/play-runtime/governor/policy.ts +1 -1
  51. package/dist/bundling-sources/shared_libs/play-runtime/governor/rate-state-backend.ts +1 -1
  52. package/dist/bundling-sources/shared_libs/play-runtime/integration-operation-reader-fence/contracts.ts +66 -0
  53. package/dist/bundling-sources/shared_libs/play-runtime/integration-operation-reader-fence/job.ts +145 -0
  54. package/dist/bundling-sources/shared_libs/play-runtime/integration-operation-reader-fence/ports.ts +21 -0
  55. package/dist/bundling-sources/shared_libs/play-runtime/integration-operation-reader-fence/postgres-store.ts +170 -0
  56. package/dist/bundling-sources/shared_libs/play-runtime/internal-bootstrap-token.ts +1322 -0
  57. package/dist/bundling-sources/shared_libs/play-runtime/internal-step-ids.ts +2 -2
  58. package/dist/bundling-sources/shared_libs/play-runtime/lane-retirement-gate.ts +1 -1
  59. package/dist/bundling-sources/shared_libs/play-runtime/launch-source-policy.ts +112 -0
  60. package/dist/bundling-sources/shared_libs/play-runtime/map-execution-frame.ts +8 -0
  61. package/dist/bundling-sources/shared_libs/play-runtime/perf-trace.ts +127 -0
  62. package/dist/bundling-sources/shared_libs/play-runtime/play-artifact-runtime-contract.ts +5 -0
  63. package/dist/bundling-sources/shared_libs/play-runtime/play-run-recovery-policy.ts +24 -1
  64. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/contracts.ts +56 -0
  65. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/index.ts +13 -0
  66. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/job.ts +41 -0
  67. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/ports.ts +17 -0
  68. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/postgres-adapter.ts +54 -0
  69. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/contracts.ts +114 -0
  70. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/engine-suspension.ts +108 -0
  71. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/index.ts +36 -0
  72. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/job.ts +97 -0
  73. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/ports.ts +104 -0
  74. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/postgres-fence-adapter.ts +263 -0
  75. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/worker-terminal-projection.ts +64 -0
  76. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/contracts.ts +29 -0
  77. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/gateway-adapter.ts +56 -0
  78. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/index.ts +15 -0
  79. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/job.ts +65 -0
  80. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/ports.ts +17 -0
  81. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/contracts.ts +42 -0
  82. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/index.ts +17 -0
  83. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/job.ts +142 -0
  84. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/ports.ts +42 -0
  85. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/postgres-adapter.ts +102 -0
  86. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/contracts.ts +60 -0
  87. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/index.ts +16 -0
  88. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/job.ts +78 -0
  89. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/ports.ts +54 -0
  90. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/postgres-adapter.ts +71 -0
  91. package/dist/bundling-sources/shared_libs/play-runtime/play-runtime-batching-registry.ts +4 -0
  92. package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +2 -0
  93. package/dist/bundling-sources/shared_libs/play-runtime/receipt-status.ts +5 -8
  94. package/dist/bundling-sources/shared_libs/play-runtime/run-failure.ts +3 -5
  95. package/dist/bundling-sources/shared_libs/play-runtime/run-identity.ts +168 -0
  96. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +72 -9
  97. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +6 -12
  98. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +19 -0
  99. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/bundle.ts +0 -1
  100. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/runtime-sandbox-reconciliation.ts +14 -44
  101. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +57 -205
  102. package/dist/bundling-sources/shared_libs/play-runtime/runtime-authority.ts +201 -0
  103. package/dist/bundling-sources/shared_libs/play-runtime/runtime-env.ts +6 -0
  104. package/dist/bundling-sources/shared_libs/play-runtime/runtime-operation-contract.ts +67 -0
  105. package/dist/bundling-sources/shared_libs/play-runtime/runtime-release-environment.ts +2 -0
  106. package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-contract.ts +68 -0
  107. package/dist/bundling-sources/shared_libs/play-runtime/runtime-scheduler-topology.ts +14 -2
  108. package/dist/bundling-sources/shared_libs/play-runtime/runtime-telemetry.ts +108 -0
  109. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/contract.ts +4 -0
  110. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/runner-backend-adapter.ts +3 -0
  111. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +7 -0
  112. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-deadline-reconciliation.ts +88 -0
  113. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-play-deploy-task.ts +124 -0
  114. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-play-run-task.ts +68 -0
  115. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-pool.ts +193 -0
  116. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-queue-lifecycle.ts +269 -0
  117. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-queue-suffix.ts +73 -0
  118. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +6642 -0
  119. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-shared.ts +897 -0
  120. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-worker-metrics.ts +120 -0
  121. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-worker-required-env.ts +76 -0
  122. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd.ts +476 -0
  123. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/gateway-heavy-request-admission.ts +47 -0
  124. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/gateway-progress-registry.ts +147 -0
  125. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/index.ts +27 -0
  126. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/lazy.ts +50 -0
  127. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/play-run-recovery.ts +98 -0
  128. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-budget-state.ts +260 -0
  129. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-pool.ts +1416 -0
  130. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts +1255 -0
  131. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-state.ts +942 -0
  132. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +14636 -0
  133. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/receipt-gateway.ts +888 -0
  134. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +355 -0
  135. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-terminal-transition.ts +46 -0
  136. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runner-push.ts +60 -0
  137. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-api-origin.ts +33 -0
  138. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-receipt-gateway-health.ts +64 -0
  139. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +835 -0
  140. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-ledger-reconciliation.ts +1218 -0
  141. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-operation.ts +207 -0
  142. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-scheduler-schema.ts +10 -0
  143. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/scheduler-capacity.ts +123 -0
  144. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/scheduler-launch-read-observability.ts +78 -0
  145. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/submit-admission.ts +169 -0
  146. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/terminal-contract.ts +20 -0
  147. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/worker-queue-metrics.ts +34 -0
  148. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/worker-resource-metrics.ts +249 -0
  149. package/dist/bundling-sources/shared_libs/play-runtime/sheet-attempt-sql.ts +7 -0
  150. package/dist/bundling-sources/shared_libs/play-runtime/step-progress.ts +296 -0
  151. package/dist/bundling-sources/shared_libs/play-runtime/tool-call/native-batch.ts +3 -3
  152. package/dist/bundling-sources/shared_libs/play-runtime/tool-call/runtime-step-receipts-adapter.ts +20 -1
  153. package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +60 -15
  154. package/dist/bundling-sources/shared_libs/play-runtime/tool-execution-outcome.ts +20 -0
  155. package/dist/bundling-sources/shared_libs/play-runtime/transient-service-error.ts +12 -0
  156. package/dist/bundling-sources/shared_libs/play-runtime/vercel-protection.ts +14 -1
  157. package/dist/bundling-sources/shared_libs/play-runtime/work-receipt-storage-contract.ts +165 -0
  158. package/dist/bundling-sources/shared_libs/play-runtime/work-receipts.ts +15 -23
  159. package/dist/bundling-sources/shared_libs/play-runtime/workflow-executor-auth.ts +169 -0
  160. package/dist/bundling-sources/shared_libs/play-runtime/zerobounce-batching.ts +122 -0
  161. package/dist/bundling-sources/shared_libs/plays/artifact-types.ts +2 -0
  162. package/dist/bundling-sources/shared_libs/plays/contracts.ts +2 -0
  163. package/dist/bundling-sources/shared_libs/plays/deployment-status.ts +1 -1
  164. package/dist/bundling-sources/shared_libs/plays/docflow.ts +1 -1
  165. package/dist/bundling-sources/shared_libs/plays/play-grep-search.ts +39 -0
  166. package/dist/bundling-sources/shared_libs/plays/share/copy.ts +271 -0
  167. package/dist/bundling-sources/shared_libs/plays/share/metrics.ts +140 -0
  168. package/dist/bundling-sources/shared_libs/plays/share/public-read-model.ts +86 -0
  169. package/dist/bundling-sources/shared_libs/plays/share/seo-quality.ts +181 -0
  170. package/dist/bundling-sources/shared_libs/plays/share/static-pipeline-summary.ts +658 -0
  171. package/dist/bundling-sources/shared_libs/plays/share/types.ts +197 -0
  172. package/dist/bundling-sources/shared_libs/plays/slack-hitl-timeout-error.ts +37 -0
  173. package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +6 -1
  174. package/dist/bundling-sources/shared_libs/plays/tool-result-types.ts +1 -1
  175. package/dist/bundling-sources/shared_libs/product-notifications/configuration.ts +7 -1
  176. package/dist/bundling-sources/shared_libs/product-notifications/default-policy.ts +3 -2
  177. package/dist/bundling-sources/shared_libs/product-notifications/overflow.ts +18 -0
  178. package/dist/bundling-sources/shared_libs/product-notifications/rolling-limit.ts +24 -0
  179. package/dist/bundling-sources/shared_libs/product-notifications/slack-delivery.ts +624 -0
  180. package/dist/bundling-sources/shared_libs/product-notifications/slack-payload.ts +140 -0
  181. package/dist/bundling-sources/shared_libs/product-notifications/slack-transport.ts +75 -0
  182. package/dist/bundling-sources/shared_libs/runtime-env.ts +6 -0
  183. package/dist/bundling-sources/shared_libs/security/email-blacklist.ts +42 -0
  184. package/dist/bundling-sources/shared_libs/security/header-safe-env.ts +10 -3
  185. package/dist/bundling-sources/shared_libs/security/slack-sanitize.ts +133 -0
  186. package/dist/cli/getting-started.d.mts +52 -0
  187. package/dist/cli/getting-started.d.ts +52 -0
  188. package/dist/cli/getting-started.js +65 -0
  189. package/dist/cli/getting-started.mjs +36 -0
  190. package/dist/cli/index.d.mts +9 -0
  191. package/dist/cli/index.d.ts +9 -0
  192. package/dist/cli/index.js +545 -264
  193. package/dist/cli/index.mjs +543 -271
  194. package/dist/{compiler-manifest-DsLbQaew.d.mts → compiler-manifest-BaJfE-5H.d.mts} +5 -3
  195. package/dist/{compiler-manifest-DsLbQaew.d.ts → compiler-manifest-BaJfE-5H.d.ts} +5 -3
  196. package/dist/index.d.mts +81 -148
  197. package/dist/index.d.ts +81 -148
  198. package/dist/index.js +83 -26
  199. package/dist/index.mjs +83 -26
  200. package/dist/install-integrity.json +130 -2
  201. package/dist/monitor-fleet-contract.d.mts +138 -0
  202. package/dist/monitor-fleet-contract.d.ts +138 -0
  203. package/dist/monitor-fleet-contract.js +404 -0
  204. package/dist/monitor-fleet-contract.mjs +367 -0
  205. package/dist/plays/bundle-play-file.d.mts +2 -2
  206. package/dist/plays/bundle-play-file.d.ts +2 -2
  207. package/dist/release.d.mts +255 -0
  208. package/dist/release.d.ts +255 -0
  209. package/dist/release.js +215 -0
  210. package/dist/release.mjs +188 -0
  211. package/package.json +21 -4
package/dist/cli/index.js CHANGED
@@ -6,6 +6,10 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
7
  var __getProtoOf = Object.getPrototypeOf;
8
8
  var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
9
13
  var __copyProps = (to, from, except, desc) => {
10
14
  if (from && typeof from === "object" || typeof from === "function") {
11
15
  for (let key of __getOwnPropNames(from))
@@ -22,6 +26,14 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
22
26
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
23
27
  mod
24
28
  ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+
31
+ // src/cli/index.ts
32
+ var cli_exports = {};
33
+ __export(cli_exports, {
34
+ main: () => main
35
+ });
36
+ module.exports = __toCommonJS(cli_exports);
25
37
 
26
38
  // src/cli/proxy-env.ts
27
39
  var import_undici = require("undici");
@@ -186,6 +198,26 @@ var import_node_path29 = require("path");
186
198
  var import_node_os18 = require("os");
187
199
  var import_commander5 = require("commander");
188
200
 
201
+ // src/pagination.ts
202
+ async function* iterateCursorPages(fetchPage) {
203
+ let cursor = null;
204
+ const seen = /* @__PURE__ */ new Set();
205
+ for (; ; ) {
206
+ const page = await fetchPage(cursor);
207
+ if (page.hasMore) {
208
+ if (!page.cursor || seen.has(page.cursor)) {
209
+ throw new Error(
210
+ "Pagination reported more results without an advancing cursor"
211
+ );
212
+ }
213
+ seen.add(page.cursor);
214
+ }
215
+ yield page.items;
216
+ if (!page.hasMore) return;
217
+ cursor = page.cursor;
218
+ }
219
+ }
220
+
189
221
  // src/config.ts
190
222
  var import_node_fs = require("fs");
191
223
  var import_node_os = require("os");
@@ -1265,20 +1297,27 @@ var SDK_RELEASE = {
1265
1297
  // available at toolResponse.rawV2 while toolResponse.raw and all declared
1266
1298
  // getters keep their established compatibility behavior.
1267
1299
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
1268
- version: "0.3.89",
1269
- updateSummary: "Automatic CLI updates are now enabled by default. To opt out, run `deepline settings autoupdate off`; use `deepline settings autoupdate on` to re-enable updates or `deepline settings autoupdate pin <version>` to hold an exact release. This release also adds raw-v2 tool responses at toolResponse.rawV2 while preserving existing toolResponse.raw and declared getters.",
1300
+ // 0.3.90 is the first deliberately versioned SDK release for API v3. Play
1301
+ // grep hard-cuts to the single Convex full-text index; it does not retain a
1302
+ // registry/scanner reader for any SDK/API major.
1303
+ version: "0.3.90",
1304
+ updateSummary: "Play grep now uses one source-only Convex full-text index. It no longer scans the registry, pages through the complete indexed match set, and rejects retired grep modes. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.",
1270
1305
  packageCapabilities: {
1271
1306
  updatePreferences: 1
1272
1307
  },
1273
1308
  contracts: {
1274
1309
  api: {
1275
1310
  name: "sdk-http-api",
1276
- // API v2 is append-only. A breaking public request/response change needs
1277
- // v3 and an explicit v2 support-window decision, never a patch release.
1278
- currentMajor: 2,
1279
- supportedMajors: [2],
1280
- // Accepted only to bridge SDKs released before X-Deepline-API-Major.
1311
+ // API v3 hard-cuts Play grep to the canonical Convex index. API v2 stays
1312
+ // admitted for the explicit SDK support window, but it selects neither a
1313
+ // registry scanner nor another grep reader: every accepted grep request
1314
+ // uses the same indexed query and retired flags fail at the API boundary.
1315
+ currentMajor: 3,
1316
+ supportedMajors: [3, 2],
1317
+ // The first wire id is emitted by the current SDK. Remaining ids are
1318
+ // accepted only while the API v2 support window is open.
1281
1319
  legacyWireIds: [
1320
+ "2026-09-play-grep-convex-index-hard-cutover",
1282
1321
  "2026-07-admin-cli-local-cutover",
1283
1322
  "2026-07-native-monitor-launch-hard-cutover"
1284
1323
  ]
@@ -2527,6 +2566,10 @@ function normalizeProductNotificationEmail(value) {
2527
2566
  const email = typeof value === "string" ? value.trim().toLowerCase() : "";
2528
2567
  return email && email.length <= 320 && PRODUCT_NOTIFICATION_EMAIL_PATTERN.test(email) ? email : null;
2529
2568
  }
2569
+ var DEFAULT_PRODUCT_NOTIFICATION_DELIVERY_TIMING = {
2570
+ mode: "rolling_limit",
2571
+ windowMs: 36e5
2572
+ };
2530
2573
 
2531
2574
  // src/stream-reconnect.ts
2532
2575
  var STREAM_RECONNECT_BASE_DELAY_MS = 500;
@@ -5120,6 +5163,7 @@ var DeeplineClient = class {
5120
5163
  this.runs = {
5121
5164
  get: (runId, options2) => this.getRunStatus(runId, options2),
5122
5165
  list: (options2) => this.listRuns(options2),
5166
+ listPage: (options2) => this.listRunsPage(options2),
5123
5167
  tail: (runId, options2) => this.tailRun(runId, options2),
5124
5168
  logs: (runId, options2) => this.getRunLogs(runId, options2),
5125
5169
  input: (runId) => this.getRunInput(runId),
@@ -6333,6 +6377,10 @@ var DeeplineClient = class {
6333
6377
  * ```
6334
6378
  */
6335
6379
  async listRuns(options) {
6380
+ return (await this.listRunsPage(options)).runs;
6381
+ }
6382
+ /** Read one run page without discarding server pagination metadata. */
6383
+ async listRunsPage(options) {
6336
6384
  const playName = options.play?.trim();
6337
6385
  const params = new URLSearchParams();
6338
6386
  if (playName) {
@@ -6363,7 +6411,7 @@ var DeeplineClient = class {
6363
6411
  const response = await this.http.get(
6364
6412
  `/api/v2/runs?${params.toString()}`
6365
6413
  );
6366
- return response.runs ?? [];
6414
+ return { ...response, runs: response.runs ?? [] };
6367
6415
  }
6368
6416
  /**
6369
6417
  * Observe one run's live events. Uses the Convex Run Snapshot subscription
@@ -6758,13 +6806,33 @@ var DeeplineClient = class {
6758
6806
  );
6759
6807
  }
6760
6808
  /**
6761
- * List callable plays visible to the workspace.
6809
+ * List one page of callable plays; grep retains exhaustive matching results.
6810
+ * Use listPlaysPage to retain pagination metadata.
6762
6811
  *
6763
6812
  * Pass `origin: "prebuilt"` for Deepline-managed prebuilts or
6764
6813
  * `origin: "owned"` for org-owned plays.
6765
6814
  */
6766
6815
  async listPlays(options) {
6816
+ if (!options?.grep?.trim()) {
6817
+ return (await this.requestPlaysPage(options, false)).plays;
6818
+ }
6819
+ const plays = [];
6820
+ for await (const items of iterateCursorPages(async (cursor) => {
6821
+ const page = await this.listPlaysPage({ ...options, cursor });
6822
+ return { items: page.plays, cursor: page.cursor, hasMore: page.hasMore };
6823
+ })) {
6824
+ plays.push(...items);
6825
+ }
6826
+ return plays;
6827
+ }
6828
+ /** Read one bounded inventory page; cursor continues the same filters. */
6829
+ async listPlaysPage(options) {
6830
+ return this.requestPlaysPage(options);
6831
+ }
6832
+ async requestPlaysPage(options, paginateInventory = true) {
6767
6833
  const params = new URLSearchParams();
6834
+ if (paginateInventory && !options?.grep?.trim())
6835
+ params.set("inventory_paginated", "1");
6768
6836
  if (options?.origin) params.set("origin", options.origin);
6769
6837
  if (options?.categories) {
6770
6838
  params.set(
@@ -6776,26 +6844,27 @@ var DeeplineClient = class {
6776
6844
  params.set("include_tool_categories", "1");
6777
6845
  }
6778
6846
  if (options?.includeArchived) params.set("include_archived", "1");
6847
+ if (options?.includeCostEstimates) {
6848
+ params.set("include_cost_estimates", "1");
6849
+ }
6779
6850
  if (options?.grep?.trim()) {
6780
6851
  params.set("grep", options.grep.trim());
6781
- params.set("grep_mode", options.grepMode ?? "all");
6782
- params.set("grep_paginated", "1");
6783
6852
  params.set("limit", "60");
6784
6853
  }
6785
- const plays = [];
6786
- let cursor = null;
6787
- let hasMore = true;
6788
- do {
6789
- if (cursor) params.set("cursor", cursor);
6790
- const suffix = params.toString() ? `?${params.toString()}` : "";
6791
- const response = await this.http.get(
6792
- `/api/v2/plays${suffix}`
6793
- );
6794
- plays.push(...response.plays ?? []);
6795
- cursor = response.pagination?.cursor ?? response.cursor ?? null;
6796
- hasMore = Boolean(response.pagination?.hasMore ?? response.hasMore);
6797
- } while (Boolean(options?.grep?.trim()) && hasMore && cursor);
6798
- return plays;
6854
+ if (options?.limit !== void 0) {
6855
+ if (!Number.isSafeInteger(options.limit) || options.limit < 1) {
6856
+ throw new Error("Play page limit must be a positive integer");
6857
+ }
6858
+ params.set("limit", String(options.limit));
6859
+ }
6860
+ if (options?.cursor) params.set("cursor", options.cursor);
6861
+ const suffix = params.size ? `?${params.toString()}` : "";
6862
+ const response = await this.http.get(`/api/v2/plays${suffix}`);
6863
+ return {
6864
+ plays: response.plays ?? [],
6865
+ cursor: response.pagination?.cursor ?? response.cursor ?? null,
6866
+ hasMore: Boolean(response.pagination?.hasMore ?? response.hasMore)
6867
+ };
6799
6868
  }
6800
6869
  /** Set whether an org-owned Play sorts before unpinned Plays. */
6801
6870
  async setPlayPinned(playName, pinned) {
@@ -6929,7 +6998,7 @@ var DeeplineClient = class {
6929
6998
  groupKey,
6930
6999
  name,
6931
7000
  enabled: true,
6932
- deliveryTiming: { mode: "immediate" },
7001
+ deliveryTiming: DEFAULT_PRODUCT_NOTIFICATION_DELIVERY_TIMING,
6933
7002
  source: "workspace",
6934
7003
  configMode: "custom",
6935
7004
  version: 0
@@ -8145,13 +8214,6 @@ function getAuthedHttpClient() {
8145
8214
  const config = resolveConfig();
8146
8215
  return { config, http: new HttpClient(config) };
8147
8216
  }
8148
- async function writeOutputFile(filename, content) {
8149
- const outputDir = (0, import_node_path4.resolve)(process.cwd(), "deepline", "data");
8150
- await (0, import_promises.mkdir)(outputDir, { recursive: true });
8151
- const fullPath = (0, import_node_path4.join)(outputDir, filename);
8152
- await (0, import_promises.writeFile)(fullPath, content, "utf-8");
8153
- return fullPath;
8154
- }
8155
8217
  function stableOsUserId() {
8156
8218
  try {
8157
8219
  const info = (0, import_node_os4.userInfo)();
@@ -8794,13 +8856,6 @@ function createTimestampedName(prefix, extension) {
8794
8856
  const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
8795
8857
  return `${prefix}-${timestamp}.${extension}`;
8796
8858
  }
8797
- async function writeCsvRowsFile(prefix, rows) {
8798
- const path = await writeOutputFile(
8799
- createTimestampedName(prefix, "csv"),
8800
- csvStringFromRows(rows)
8801
- );
8802
- return path;
8803
- }
8804
8859
  function clip(value, maxLength) {
8805
8860
  return value.length > maxLength ? `${value.slice(0, maxLength - 1)}\u2026` : value;
8806
8861
  }
@@ -9585,7 +9640,7 @@ Notes:
9585
9640
  workspace. To switch, use deepline org list and deepline org set <org-id>.
9586
9641
  `
9587
9642
  );
9588
- auth.command("workspaces").description("Deprecated. Use deepline org list to see workspaces.").action(() => {
9643
+ auth.command("workspaces", { hidden: true }).description("Deprecated. Use deepline org list to see workspaces.").action(() => {
9589
9644
  console.error(
9590
9645
  "Workspaces live under `deepline org`.\n List: deepline org list\n Switch: deepline org set <org-id>\n`deepline auth register` re-approves this device; it does not change the active workspace."
9591
9646
  );
@@ -9682,7 +9737,6 @@ var SUBSCRIPTION_STATUS_NEXT_COMMAND = "deepline billing subscription status --j
9682
9737
  var SUBSCRIPTION_CANCEL_PATH = "/api/v2/billing/subscription/cancel";
9683
9738
  var BILLING_TOP_UP_PATH = "/api/v2/billing/top-up";
9684
9739
  var DEFAULT_BALANCE_RECOVERY_CREDITS = 100;
9685
- var BILLING_HISTORY_EXPORT_LIMIT = 5e3;
9686
9740
  function billingFailureFromError(error, options) {
9687
9741
  if (error instanceof AuthError) {
9688
9742
  return {
@@ -9973,6 +10027,9 @@ async function handleBalance(options) {
9973
10027
  );
9974
10028
  return;
9975
10029
  }
10030
+ function quoteShellArgument(value) {
10031
+ return `'${value.replace(/'/g, `'\\''`)}'`;
10032
+ }
9976
10033
  async function handleUsage(options) {
9977
10034
  const { http } = getAuthedHttpClient();
9978
10035
  const params = new URLSearchParams();
@@ -9989,6 +10046,7 @@ async function handleUsage(options) {
9989
10046
  const recent = payload.recent ?? {};
9990
10047
  const last30Usage = usage.last_30_days_usage_credits ?? usage.month_spent_credits;
9991
10048
  const temporaryHolds = Number(usage.temporary_hold_credits ?? 0);
10049
+ const nextPage = typeof recent.next_cursor === "string" && recent.next_cursor.length > 0 ? `deepline billing usage --cursor ${quoteShellArgument(recent.next_cursor)}${options.limit ? ` --limit ${options.limit}` : ""}${options.runId ? ` --run-id ${quoteShellArgument(options.runId)}` : ""} --json` : null;
9992
10050
  const lines = [
9993
10051
  `Balance: ${payload.balance ?? "(unknown)"}`,
9994
10052
  `Last 30 days usage: ${last30Usage ?? "(unknown)"}`,
@@ -10000,13 +10058,20 @@ async function handleUsage(options) {
10000
10058
  ...recentUsageLines(
10001
10059
  Array.isArray(recent.entries) ? recent.entries : []
10002
10060
  ),
10003
- ...typeof recent.next_cursor === "string" && recent.next_cursor.length > 0 ? [
10004
- `Next page: deepline billing usage --cursor ${recent.next_cursor}${options.limit ? ` --limit ${options.limit}` : ""}${options.runId ? ` --run-id ${options.runId}` : ""}`
10061
+ ...recent.has_more === true || recent.incomplete === true ? ["List truncated \u2014 more recent calls match this query."] : [],
10062
+ ...nextPage ? [`Next page: ${nextPage}`] : [],
10063
+ ...!nextPage && (recent.has_more === true || recent.incomplete === true) ? [
10064
+ "No continuation is available for this view. Use deepline billing ledger export all --json for the full ledger."
10005
10065
  ] : []
10006
10066
  ];
10007
10067
  printCommandEnvelope(
10008
10068
  {
10009
10069
  ...payload,
10070
+ recent: {
10071
+ ...recent,
10072
+ is_truncated: recent.has_more === true || recent.incomplete === true
10073
+ },
10074
+ next: { page: nextPage },
10010
10075
  render: { sections: [{ title: "billing usage", lines }] }
10011
10076
  },
10012
10077
  { json: options.json }
@@ -10070,6 +10135,39 @@ async function handleLimitOff(options) {
10070
10135
  { json: options.json }
10071
10136
  );
10072
10137
  }
10138
+ async function exportLedger(http, outputPath, options) {
10139
+ let summary = { row_count: 0, net_delta_credits: 0 };
10140
+ let initialized = false;
10141
+ for await (const entries of iterateCursorPages(async (cursor) => {
10142
+ const params = new URLSearchParams({ limit: "5000" });
10143
+ if (cursor) params.set("cursor", cursor);
10144
+ if (options.sinceAt !== null)
10145
+ params.set("since_at", String(options.sinceAt));
10146
+ if (options.runId) params.set("run_id", options.runId);
10147
+ if (options.operation) params.set("operation", options.operation);
10148
+ const payload = await http.get(
10149
+ `/api/v2/billing/ledger?${params.toString()}`
10150
+ );
10151
+ if (!Array.isArray(payload.entries) || typeof payload.has_more !== "boolean") {
10152
+ throw new Error("Billing ledger response is missing entries");
10153
+ }
10154
+ return {
10155
+ items: payload.entries,
10156
+ hasMore: payload.has_more === true,
10157
+ cursor: typeof payload.next_cursor === "string" ? payload.next_cursor : null
10158
+ };
10159
+ })) {
10160
+ if (!initialized) {
10161
+ await (0, import_promises2.mkdir)((0, import_node_path6.dirname)(outputPath), { recursive: true });
10162
+ await (0, import_promises2.writeFile)(outputPath, ledgerRowsToCsv([], true), "utf-8");
10163
+ initialized = true;
10164
+ }
10165
+ const rows = entries.map(ledgerApiEntryToRow);
10166
+ await (0, import_promises2.appendFile)(outputPath, ledgerRowsToCsv(rows, false), "utf-8");
10167
+ summary = summarizeLedgerRows(summary, rows);
10168
+ }
10169
+ return summary;
10170
+ }
10073
10171
  async function handleHistory(options) {
10074
10172
  const { http } = getAuthedHttpClient();
10075
10173
  const windows = {
@@ -10079,41 +10177,20 @@ async function handleHistory(options) {
10079
10177
  "1y": 31536e3
10080
10178
  };
10081
10179
  const sinceAt = Math.max(0, Math.floor(Date.now() / 1e3) - windows[options.time]) * 1e3;
10082
- const entries = [];
10083
- let cursor = null;
10084
- while (entries.length < BILLING_HISTORY_EXPORT_LIMIT) {
10085
- const params = new URLSearchParams({
10086
- since_at: String(sinceAt),
10087
- limit: String(BILLING_HISTORY_EXPORT_LIMIT - entries.length)
10088
- });
10089
- if (cursor !== null) params.set("cursor", cursor);
10090
- const payload = await http.get(
10091
- `/api/v2/billing/ledger?${params.toString()}`
10092
- );
10093
- if (Array.isArray(payload.entries)) {
10094
- entries.push(
10095
- ...payload.entries.slice(
10096
- 0,
10097
- BILLING_HISTORY_EXPORT_LIMIT - entries.length
10098
- )
10099
- );
10100
- }
10101
- const nextCursor = typeof payload.next_cursor === "string" && payload.next_cursor.length > 0 ? payload.next_cursor : null;
10102
- if (payload.has_more !== true || nextCursor === null) break;
10103
- if (nextCursor === cursor) {
10104
- throw new Error("Billing history pagination cursor did not advance");
10105
- }
10106
- cursor = nextCursor;
10107
- }
10108
- const rows = entries.map(ledgerApiEntryToRow);
10109
- const outputPath = await writeCsvRowsFile(
10110
- `billing-history-${options.time}`,
10111
- rows
10180
+ const outputPath = (0, import_node_path6.resolve)(
10181
+ process.cwd(),
10182
+ "deepline",
10183
+ "data",
10184
+ createTimestampedName(`billing-history-${options.time}`, "csv")
10112
10185
  );
10186
+ const summary = await exportLedger(http, outputPath, { sinceAt });
10113
10187
  printCommandEnvelope(
10114
10188
  {
10115
10189
  output_path: outputPath,
10116
- row_count: rows.length,
10190
+ row_count: summary.row_count,
10191
+ has_more: false,
10192
+ is_truncated: false,
10193
+ next_cursor: null,
10117
10194
  time_window: options.time,
10118
10195
  render: {
10119
10196
  sections: [
@@ -10121,7 +10198,7 @@ async function handleHistory(options) {
10121
10198
  title: "billing history",
10122
10199
  lines: [
10123
10200
  `Billing history written to ${outputPath}`,
10124
- `${rows.length} row(s) exported.`
10201
+ `${summary.row_count} row(s) exported.`
10125
10202
  ]
10126
10203
  }
10127
10204
  ]
@@ -10146,40 +10223,18 @@ async function handleLedgerExportAll(options) {
10146
10223
  }
10147
10224
  const { http } = getAuthedHttpClient();
10148
10225
  const outputPath = options.output ? (0, import_node_path6.resolve)(String(options.output)) : defaultLedgerExportPath();
10149
- let summary = { row_count: 0, net_delta_credits: 0 };
10150
- let cursor = null;
10151
- let initializedOutput = false;
10152
- for (; ; ) {
10153
- const params = new URLSearchParams({ limit: "5000" });
10154
- if (cursor !== null) params.set("cursor", cursor);
10155
- if (options.runId) params.set("run_id", options.runId);
10156
- if (options.operation) params.set("operation", options.operation);
10157
- if (sinceAt !== null) params.set("since_at", String(sinceAt));
10158
- const payload = await http.get(
10159
- `/api/v2/billing/ledger?${params.toString()}`
10160
- );
10161
- const entries = Array.isArray(payload.entries) ? payload.entries : [];
10162
- const rows = entries.map(ledgerApiEntryToRow);
10163
- if (!initializedOutput) {
10164
- await (0, import_promises2.mkdir)((0, import_node_path6.dirname)(outputPath), { recursive: true });
10165
- await (0, import_promises2.writeFile)(outputPath, ledgerRowsToCsv([], true), "utf-8");
10166
- initializedOutput = true;
10167
- }
10168
- if (rows.length > 0) {
10169
- await (0, import_promises2.appendFile)(outputPath, ledgerRowsToCsv(rows, false), "utf-8");
10170
- summary = summarizeLedgerRows(summary, rows);
10171
- }
10172
- const nextCursor = typeof payload.next_cursor === "string" && payload.next_cursor.length > 0 ? payload.next_cursor : null;
10173
- if (payload.has_more !== true || nextCursor === null) {
10174
- break;
10175
- }
10176
- if (nextCursor === cursor) break;
10177
- cursor = nextCursor;
10178
- }
10226
+ const summary = await exportLedger(http, outputPath, {
10227
+ sinceAt,
10228
+ runId: options.runId,
10229
+ operation: options.operation
10230
+ });
10179
10231
  printCommandEnvelope(
10180
10232
  {
10181
10233
  output_path: outputPath,
10182
10234
  row_count: summary.row_count,
10235
+ has_more: false,
10236
+ is_truncated: false,
10237
+ next_cursor: null,
10183
10238
  net_delta_credits: summary.net_delta_credits,
10184
10239
  scope: "workspace",
10185
10240
  ...options.runId ? { run_id: options.runId } : {},
@@ -10924,7 +10979,9 @@ Examples:
10924
10979
  `
10925
10980
  Notes:
10926
10981
  Read-only server query that writes a local CSV file. With --json, stdout is a
10927
- summary containing the output path and row count.
10982
+ summary containing the output path, row count, and completeness metadata.
10983
+ Exports the complete window using bounded pages. For an exact start timestamp:
10984
+ deepline billing ledger export all --since <ISO-8601> --json
10928
10985
 
10929
10986
  Examples:
10930
10987
  deepline billing history --time 1m
@@ -10992,7 +11049,10 @@ Examples:
10992
11049
  "Disable automatic recharge without clearing saved amounts."
10993
11050
  ).option("--idempotency-key <key>", "Stable retry key").option("--dry-run", "Print the planned update without applying it").option("--json", "Emit JSON output").action(handleAutoRechargeOff)
10994
11051
  );
10995
- billing.command("change-plan").description("Start or change the target billing plan.").argument("<plan_sku>", "payg-v1, builder-v1, growth-v1, growth-canary-v1, or team-v1").option("--idempotency-key <key>", "Stable retry key").option("--json", "Emit JSON output").action(handleTargetPlan);
11052
+ billing.command("change-plan").description("Start or change the target billing plan.").argument(
11053
+ "<plan_sku>",
11054
+ "payg-v1, builder-v1, growth-v1, growth-canary-v1, or team-v1"
11055
+ ).option("--idempotency-key <key>", "Stable retry key").option("--json", "Emit JSON output").action(handleTargetPlan);
10996
11056
  billing.command("cancel-plan").description("Cancel a target subscription at period end, or undo it.").option("--undo", "Undo a pending period-end cancellation").option("--idempotency-key <key>", "Stable retry key").option("--json", "Emit JSON output").action(handleTargetPlanCancellation);
10997
11057
  billing.command("portal").description("Open the Stripe-hosted billing recovery portal.").option("--no-open", "Print the URL without opening a browser").option("--json", "Emit JSON output").action(handleTargetPortal);
10998
11058
  billing.command("plans").description("Show published plans and the plan you are on.").addHelpText(
@@ -19777,6 +19837,7 @@ async function startAndWaitForPlayCompletionByStreamOnce(input2) {
19777
19837
  runId: workflowId,
19778
19838
  playName: input2.playName,
19779
19839
  dashboardUrl,
19840
+ inputFieldCount: Object.keys(input2.request.input ?? {}).length,
19780
19841
  jsonOutput: false,
19781
19842
  progress: input2.progress
19782
19843
  });
@@ -23420,12 +23481,13 @@ async function handleRunsList(args) {
23420
23481
  return 1;
23421
23482
  }
23422
23483
  const client2 = new DeeplineClient();
23423
- const runs = (await client2.runs.list({
23484
+ const page = await client2.runs.listPage({
23424
23485
  ...playName ? { play: playName } : {},
23425
23486
  ...statusFilter ? { status: statusFilter } : {},
23426
23487
  ...limit !== void 0 ? { limit } : {},
23427
23488
  ...offset !== void 0 ? { offset } : {}
23428
- })).map((run) => ({
23489
+ });
23490
+ const runs = page.runs.map((run) => ({
23429
23491
  runId: run.workflowId,
23430
23492
  // `workflowId` is the legacy SDK name for the same public Deepline run
23431
23493
  // identity. Keep it during the compatibility window, but never label the
@@ -23463,11 +23525,24 @@ async function handleRunsList(args) {
23463
23525
  if (run.rootRunId) lines2.push(` root: ${run.rootRunId}`);
23464
23526
  return lines2.join("\n");
23465
23527
  });
23528
+ const nextOffset = (page.offset ?? offset ?? 0) + runs.length;
23529
+ const nextPage = page.hasMore && playName ? `deepline runs list --play ${shellQuote2(playName)}${statusFilter ? ` --status ${shellQuote2(statusFilter)}` : ""} --limit ${page.limit ?? limit ?? 20} --offset ${nextOffset} --json` : null;
23530
+ if (page.hasMore) {
23531
+ lines.push("List truncated \u2014 more runs match this filter.");
23532
+ lines.push(
23533
+ nextPage ? `Next page: ${nextPage}` : "Narrow with --play <play-name> to page through runs."
23534
+ );
23535
+ }
23466
23536
  printCommandEnvelope(
23467
23537
  {
23468
23538
  runs,
23469
23539
  count: runs.length,
23540
+ ...page.total !== void 0 ? { total: page.total } : {},
23541
+ offset: page.offset ?? offset ?? 0,
23542
+ limit: page.limit ?? limit ?? (playName ? 20 : 100),
23543
+ ...page.hasMore !== void 0 ? { has_more: page.hasMore, is_truncated: page.hasMore } : {},
23470
23544
  next: {
23545
+ page: nextPage,
23471
23546
  get: runs[0]?.runId ? `deepline runs get ${runs[0].runId} --json` : null
23472
23547
  },
23473
23548
  render: { sections: [{ title: "runs", lines }] }
@@ -24115,23 +24190,47 @@ async function handlePlayVersions(args) {
24115
24190
  }
24116
24191
  return 0;
24117
24192
  }
24193
+ function formatPlayCostEstimate(estimate) {
24194
+ if (!estimate || estimate.status === "unavailable") {
24195
+ return `unavailable${estimate ? `: ${estimate.message}` : ""}`;
24196
+ }
24197
+ const formatCredits = (value) => value.toLocaleString("en-US", {
24198
+ maximumFractionDigits: value < 1 ? 4 : 2
24199
+ });
24200
+ const credits = estimate.lowCredits === estimate.highCredits ? `${estimate.source === "observed" ? "~" : ""}${formatCredits(estimate.lowCredits)}` : `${formatCredits(estimate.lowCredits)}\u2013${formatCredits(estimate.highCredits)}`;
24201
+ const unit = estimate.unit === "row" ? "output row" : "run";
24202
+ const source = estimate.source === "observed" ? `observed from ${estimate.sampleRunCount} ${estimate.sampleRunCount === 1 ? "run" : "runs"}` : "static estimate";
24203
+ return `${credits} Deepline credits per ${unit} (${source})`;
24204
+ }
24118
24205
  async function handlePlayList(args) {
24119
24206
  const jsonOutput = argsWantJson(args);
24207
+ const showCost = args.includes("--show-cost");
24120
24208
  const client2 = new DeeplineClient();
24121
24209
  const categoriesIndex = args.indexOf("--categories");
24122
24210
  const categories = categoriesIndex >= 0 ? args[categoriesIndex + 1]?.trim() : void 0;
24123
- const plays = await client2.listPlays({
24211
+ const limitIndex = args.indexOf("--limit");
24212
+ const cursorIndex = args.indexOf("--cursor");
24213
+ const limit = limitIndex >= 0 ? Number(args[limitIndex + 1]) : void 0;
24214
+ const cursor = cursorIndex >= 0 ? args[cursorIndex + 1] : void 0;
24215
+ if (limitIndex >= 0 && (!Number.isSafeInteger(limit) || limit < 1) || cursorIndex >= 0 && !cursor?.trim()) {
24216
+ console.error("Pass a positive --limit and a non-empty --cursor.");
24217
+ return 2;
24218
+ }
24219
+ const page = await client2.listPlaysPage({
24124
24220
  categories,
24125
- includeToolCategories: true
24126
- });
24127
- if (jsonOutput) {
24128
- process.stdout.write(`${JSON.stringify(plays)}
24129
- `);
24130
- return 0;
24221
+ includeToolCategories: true,
24222
+ ...showCost ? { includeCostEstimates: true } : {},
24223
+ limit,
24224
+ cursor
24225
+ });
24226
+ const plays = page.plays;
24227
+ const nextPage = page.hasMore && page.cursor ? `deepline plays list${categories ? ` --categories ${shellQuote2(categories)}` : ""}${limit ? ` --limit ${limit}` : ""}${showCost ? " --show-cost" : ""} --cursor ${shellQuote2(page.cursor)} --json` : null;
24228
+ if (page.hasMore && !nextPage) {
24229
+ throw new Error(
24230
+ "Play list reported more results without a continuation cursor"
24231
+ );
24131
24232
  }
24132
- process.stdout.write(`${plays.length} plays available:
24133
-
24134
- `);
24233
+ const lines = [`${plays.length} plays in this page:`];
24135
24234
  for (const play of plays) {
24136
24235
  const flags = [
24137
24236
  play.pinned ? "pinned" : null,
@@ -24141,32 +24240,48 @@ async function handlePlayList(args) {
24141
24240
  play.isDraftDirty ? "draft-dirty" : null
24142
24241
  ].filter(Boolean).join(", ");
24143
24242
  const reference = formatPlayListReference(play);
24144
- process.stdout.write(` ${reference}${flags ? ` [${flags}]` : ""}
24145
- `);
24243
+ lines.push(` ${reference}${flags ? ` [${flags}]` : ""}`);
24146
24244
  if (play.inputSchema || play.hasInputSchema) {
24147
- process.stdout.write(" inputSchema: yes\n");
24245
+ lines.push(" inputSchema: yes");
24148
24246
  }
24149
24247
  if (play.triggerStatus?.cron) {
24150
- process.stdout.write(
24151
- ` scheduled execution: ${cronExecutionLabel(play.triggerStatus.cron)}
24152
- `
24248
+ lines.push(
24249
+ ` scheduled execution: ${cronExecutionLabel(play.triggerStatus.cron)}`
24153
24250
  );
24154
24251
  if (play.triggerStatus.blockedReason) {
24155
- process.stdout.write(
24156
- ` schedule issue: ${play.triggerStatus.blockedReason}
24157
- `
24158
- );
24252
+ lines.push(` schedule issue: ${play.triggerStatus.blockedReason}`);
24159
24253
  }
24160
24254
  } else {
24161
- process.stdout.write(" scheduled execution: not configured\n");
24255
+ lines.push(" scheduled execution: not configured");
24162
24256
  }
24163
24257
  if (play.triggerStatus?.webhook) {
24164
- process.stdout.write(` webhook: ${play.triggerStatus.webhook}
24165
- `);
24258
+ lines.push(` webhook: ${play.triggerStatus.webhook}`);
24166
24259
  }
24167
- process.stdout.write(` run: deepline plays run ${reference} --watch
24168
- `);
24260
+ if (showCost) {
24261
+ lines.push(
24262
+ ` cost estimate: ${formatPlayCostEstimate(play.costEstimate)}`
24263
+ );
24264
+ }
24265
+ lines.push(` run: deepline plays run ${reference} --watch`);
24266
+ }
24267
+ if (page.hasMore) {
24268
+ lines.push("List truncated \u2014 more plays are available.");
24269
+ lines.push(`Next page: ${nextPage}`);
24169
24270
  }
24271
+ printCommandEnvelope(
24272
+ {
24273
+ plays,
24274
+ count: plays.length,
24275
+ has_more: page.hasMore,
24276
+ is_truncated: page.hasMore,
24277
+ next_cursor: page.cursor,
24278
+ next: { page: nextPage },
24279
+ render: {
24280
+ sections: [{ title: "plays", lines }]
24281
+ }
24282
+ },
24283
+ { json: jsonOutput }
24284
+ );
24170
24285
  return 0;
24171
24286
  }
24172
24287
  async function handlePlayPin(args, pinned) {
@@ -24430,76 +24545,23 @@ async function handlePlaySearch(args) {
24430
24545
  }
24431
24546
  return 0;
24432
24547
  }
24433
- function normalizePlayGrepText(value) {
24434
- if (value === null || value === void 0) return "";
24435
- if (typeof value === "string") return value.toLowerCase();
24436
- if (typeof value === "number" || typeof value === "boolean") {
24437
- return String(value).toLowerCase();
24438
- }
24439
- if (Array.isArray(value)) return value.map(normalizePlayGrepText).join(" ");
24440
- if (typeof value === "object") {
24441
- return Object.values(value).map(normalizePlayGrepText).join(" ");
24442
- }
24443
- return "";
24444
- }
24445
- function parsePlayGrepTerms(query, mode) {
24446
- const trimmed = query.trim().toLowerCase();
24447
- if (!trimmed) return [];
24448
- if (mode === "phrase") return [trimmed];
24449
- const matches = trimmed.match(/"([^"]+)"|'([^']+)'|\S+/g) ?? [];
24450
- return matches.map((term) => term.replace(/^["']|["']$/g, "").trim()).filter(Boolean);
24451
- }
24452
- function matchesPlayGrepQuery(value, query, mode) {
24453
- const terms = parsePlayGrepTerms(query, mode);
24454
- if (terms.length === 0) return true;
24455
- const haystack = normalizePlayGrepText(value);
24456
- if (mode === "any") return terms.some((term) => haystack.includes(term));
24457
- return terms.every((term) => haystack.includes(term));
24458
- }
24459
24548
  async function handlePlayGrep(args) {
24460
24549
  const query = args[0]?.trim();
24461
24550
  if (!query) {
24462
- console.error(
24463
- "Usage: deepline plays grep <query> [--mode all|any|phrase] [--compact] [--json]"
24464
- );
24551
+ console.error("Usage: deepline plays grep <query> [--compact] [--json]");
24465
24552
  return 1;
24466
24553
  }
24467
- let mode = "all";
24468
- for (let index = 1; index < args.length; index += 1) {
24469
- const arg = args[index];
24470
- if (arg === "--mode" && args[index + 1]) {
24471
- const rawMode = args[++index].trim().toLowerCase();
24472
- mode = rawMode === "any" || rawMode === "phrase" ? rawMode : "all";
24473
- }
24474
- }
24475
24554
  const compact = args.includes("--compact");
24476
24555
  const client2 = new DeeplineClient();
24477
- const plays = (await client2.listPlays({
24478
- grep: query,
24479
- grepMode: mode
24480
- })).filter(
24481
- (play) => matchesPlayGrepQuery(
24482
- {
24483
- name: play.name,
24484
- reference: play.reference,
24485
- displayName: play.displayName,
24486
- origin: play.origin,
24487
- ownerType: play.ownerType,
24488
- aliases: play.aliases,
24489
- toolCategories: play.toolCategories,
24490
- inputSchema: play.inputSchema,
24491
- outputSchema: play.outputSchema
24492
- },
24493
- query,
24494
- mode
24495
- )
24496
- ).map((play) => summarizePlayListItemForCli(play, { compact }));
24556
+ const plays = (await client2.listPlays({ grep: query })).map(
24557
+ (play) => summarizePlayListItemForCli(play, { compact })
24558
+ );
24497
24559
  if (argsWantJson(args)) {
24498
24560
  printCompactJson({
24499
24561
  plays,
24500
24562
  count: plays.length,
24501
24563
  query,
24502
- grep: { mode, terms: parsePlayGrepTerms(query, mode) }
24564
+ grep: { engine: "convex_full_text" }
24503
24565
  });
24504
24566
  return 0;
24505
24567
  }
@@ -25207,7 +25269,7 @@ Pass-through input flags:
25207
25269
  if (effectiveTarget && passthroughArgs[0] === effectiveTarget) {
25208
25270
  passthroughArgs.shift();
25209
25271
  }
25210
- process.exitCode = await handlePlayRun([
25272
+ const exitCode = await handlePlayRun([
25211
25273
  ...effectiveTarget ? [effectiveTarget] : [],
25212
25274
  ...options.file ? ["--file", options.file] : [],
25213
25275
  ...options.name ? ["--name", options.name] : [],
@@ -25237,6 +25299,11 @@ Pass-through input flags:
25237
25299
  ...options.full ? ["--full"] : [],
25238
25300
  ...passthroughArgs
25239
25301
  ]);
25302
+ recordCliTrace({
25303
+ phase: "cli.play_command_exit",
25304
+ exitCode
25305
+ });
25306
+ process.exitCode = exitCode;
25240
25307
  });
25241
25308
  registerPlayBootstrapCommand(play);
25242
25309
  play.command("get <target>").description(
@@ -25278,17 +25345,22 @@ Examples:
25278
25345
  `
25279
25346
  Notes:
25280
25347
  Inventory command for saved org plays and prebuilt plays. Use search for
25281
- ranked discovery by task or schema.
25348
+ ranked discovery by task or schema. Returns one bounded page with has_more,
25349
+ is_truncated, next_cursor, and a next-page command. Use --limit to choose
25350
+ the page size and --cursor to continue with the same filters.
25282
25351
 
25283
25352
  Examples:
25284
25353
  deepline plays list
25285
25354
  deepline plays search email --json
25286
25355
  `
25287
- ).option("--json", "Emit JSON output. Also automatic when stdout is piped").option(
25356
+ ).option("--limit <count>", "Page size").option("--cursor <cursor>", "Continue a previous page").option("--show-cost", "Include the per-row or per-run cost estimate").option("--json", "Emit JSON output. Also automatic when stdout is piped").option(
25288
25357
  "--categories <categories>",
25289
25358
  "Filter by comma-separated canonical tool categories"
25290
25359
  ).action(async (options) => {
25291
25360
  process.exitCode = await handlePlayList([
25361
+ ...options.limit ? ["--limit", options.limit] : [],
25362
+ ...options.cursor ? ["--cursor", options.cursor] : [],
25363
+ ...options.showCost ? ["--show-cost"] : [],
25292
25364
  ...options.categories ? ["--categories", options.categories] : [],
25293
25365
  ...options.json ? ["--json"] : []
25294
25366
  ]);
@@ -25327,8 +25399,8 @@ Notes:
25327
25399
  because they are trusted, robust plays with maintained contracts. Use describe
25328
25400
  on a result before running it.
25329
25401
  Add --all only when you are specifically looking for a play you created.
25330
- The grep alias is the same ranked retrieval surface with a more literal name
25331
- for agents that are filtering the play registry.
25402
+ Use plays grep to search active org-owned Plays through Convex's indexed
25403
+ authored corpus. It does not search prebuilt or archived Plays.
25332
25404
 
25333
25405
  Examples:
25334
25406
  deepline plays search email
@@ -25346,25 +25418,24 @@ Examples:
25346
25418
  ]);
25347
25419
  });
25348
25420
  addPlaySearchCommand(play.command("search <query>"));
25349
- play.command("grep <query>").description("Literal grep over play names, schemas, and descriptions.").addHelpText(
25421
+ play.command("grep <query>").description(
25422
+ "Search active org-owned Plays through Convex full-text search."
25423
+ ).addHelpText(
25350
25424
  "after",
25351
25425
  `
25352
25426
  Notes:
25353
- Literal registry filtering. Terms are matched case-insensitively against play
25354
- names, references, display names, ownership, and schemas. Use
25355
- --mode phrase for exact phrase matching, --mode any for OR, and the default
25356
- --mode all for AND.
25427
+ Queries use Convex token semantics over the indexed authored Play corpus.
25428
+ Prebuilt and archived Plays are not part of this index.
25357
25429
 
25358
25430
  Examples:
25359
25431
  deepline plays grep email --json
25360
- deepline plays grep "company contact" --mode all --json
25432
+ deepline plays grep "company contact" --compact --json
25361
25433
  deepline plays describe prebuilt/company-to-contact --json
25362
25434
  `
25363
- ).option("--compact", "Emit compact schemas").option("--mode <mode>", "Grep matching mode: all, any, or phrase").option("--json", "Emit JSON output. Also automatic when stdout is piped").action(async (query, options) => {
25435
+ ).option("--compact", "Emit compact schemas").option("--json", "Emit JSON output. Also automatic when stdout is piped").action(async (query, options) => {
25364
25436
  process.exitCode = await handlePlayGrep([
25365
25437
  query,
25366
25438
  ...options.compact ? ["--compact"] : [],
25367
- ...options.mode ? ["--mode", options.mode] : [],
25368
25439
  ...options.json ? ["--json"] : []
25369
25440
  ]);
25370
25441
  });
@@ -30962,7 +31033,7 @@ async function compileConfig(input2) {
30962
31033
  })).config;
30963
31034
  }
30964
31035
  function registerEnrichCommand(program) {
30965
- program.command("enrich").allowUnknownOption(true).description("Run v1-style CSV enrichment through the V2 play runner.").configureHelp({
31036
+ program.command("enrich", { hidden: true }).allowUnknownOption(true).description("Run v1-style CSV enrichment through the V2 play runner.").configureHelp({
30966
31037
  optionTerm(option) {
30967
31038
  return option.long === "--timeout" ? "--timeout SECONDS" : option.flags;
30968
31039
  }
@@ -32018,7 +32089,7 @@ function loadViewerAssets() {
32018
32089
  "viewer"
32019
32090
  )
32020
32091
  ] : [],
32021
- (0, import_node_path16.join)(process.cwd(), "src", "lib", "cli", "viewer")
32092
+ (0, import_node_path16.join)(process.cwd(), "apps", "deepline-api", "src", "lib", "cli", "viewer")
32022
32093
  ];
32023
32094
  for (const root of candidateRoots2) {
32024
32095
  try {
@@ -32235,7 +32306,7 @@ function addDeprecatedSubcommand(parent, family, subcommand, description) {
32235
32306
  });
32236
32307
  }
32237
32308
  function registerDeprecatedCommands(program) {
32238
- const session = program.command("session").description("Deprecated legacy session command namespace.").allowUnknownOption(true).allowExcessArguments(true).option("--json", "Emit JSON output").argument("[args...]").addHelpText(
32309
+ const session = program.command("session", { hidden: true }).description("Deprecated legacy session command namespace.").allowUnknownOption(true).allowExcessArguments(true).option("--json", "Emit JSON output").argument("[args...]").addHelpText(
32239
32310
  "after",
32240
32311
  `
32241
32312
  Notes:
@@ -32267,7 +32338,7 @@ Examples:
32267
32338
  `Deprecated legacy "deepline session ${subcommand}" command.`
32268
32339
  );
32269
32340
  }
32270
- const backend = program.command("backend").description("Deprecated legacy local backend command namespace.").allowUnknownOption(true).allowExcessArguments(true).option("--json", "Emit JSON output").argument("[args...]").addHelpText(
32341
+ const backend = program.command("backend", { hidden: true }).description("Deprecated legacy local backend command namespace.").allowUnknownOption(true).allowExcessArguments(true).option("--json", "Emit JSON output").argument("[args...]").addHelpText(
32271
32342
  "after",
32272
32343
  `
32273
32344
  Notes:
@@ -34278,11 +34349,13 @@ function monitorHealthLine(health) {
34278
34349
  if (health.refresh?.state === "running") {
34279
34350
  return `refreshing whole scope \xB7 scanned ${health.scanned} so far`;
34280
34351
  }
34352
+ const alignmentRequired = health.alignment_required ?? 0;
34281
34353
  return [
34282
34354
  `converged ${health.converged}/${health.scanned}`,
34283
34355
  `needs_repair ${health.needs_repair}`,
34284
34356
  `missing ${health.observed.missing}`,
34285
34357
  `unaudited ${health.observed.unknown + health.observed.unset}`,
34358
+ ...alignmentRequired > 0 ? [`needs_alignment ${alignmentRequired}`] : [],
34286
34359
  `silent ${health.silent}`
34287
34360
  ].join(" \xB7 ");
34288
34361
  }
@@ -34316,7 +34389,9 @@ async function watchMonitorHealth(input2) {
34316
34389
  let last = await input2.client.monitors.health(scope);
34317
34390
  input2.onProgress(last);
34318
34391
  while (Date.now() < deadlineAt) {
34319
- if (last.refresh?.state !== "running" && last.needs_repair === 0 && last.observed.unknown === 0) {
34392
+ const unresolved = last.observed.unknown + last.observed.unset;
34393
+ const alignmentRequired = last.alignment_required ?? 0;
34394
+ if (last.refresh?.state !== "running" && !last.truncated && last.needs_repair === 0 && (unresolved === 0 || alignmentRequired === unresolved)) {
34320
34395
  return last;
34321
34396
  }
34322
34397
  await new Promise(
@@ -34329,6 +34404,7 @@ async function watchMonitorHealth(input2) {
34329
34404
  }
34330
34405
  function monitorHealthText(health) {
34331
34406
  const partial = health.refresh?.state === "running" ? " (refreshing \u2014 counts below are not final)" : health.truncated ? " (partial \u2014 scope larger than one read)" : "";
34407
+ const unauditedMonitors = health.unaudited_monitors ?? [];
34332
34408
  const lines = [
34333
34409
  `scope: ${health.scope.fleet_id ?? "workspace"}${partial}`,
34334
34410
  monitorHealthLine(health)
@@ -34351,6 +34427,29 @@ function monitorHealthText(health) {
34351
34427
  lines.push(` ${entry.reason} (${entry.count})${how}`);
34352
34428
  }
34353
34429
  }
34430
+ if (unauditedMonitors.length > 0) {
34431
+ const reason = {
34432
+ not_yet_audited: "has not been observed yet",
34433
+ missing_provider_resource_id: "has no stored upstream resource id",
34434
+ provider_observation_unknown: "the provider observation is still unknown"
34435
+ };
34436
+ lines.push("");
34437
+ lines.push("unresolved monitor observations:");
34438
+ for (const entry of unauditedMonitors) {
34439
+ lines.push(
34440
+ ` ${entry.monitor_key} ${entry.tool} \u2014 ${reason[entry.reason]}`
34441
+ );
34442
+ }
34443
+ }
34444
+ if ((health.alignment_required ?? 0) > 0) {
34445
+ lines.push("");
34446
+ lines.push(
34447
+ `${health.alignment_required} monitor(s) need provider identity alignment; normal repair intentionally will not guess or create a paid replacement.`
34448
+ );
34449
+ lines.push(
34450
+ `Run the exact inventory audit, then review one safe adoption candidate: deepline-admin monitors reconcile ${health.scope.org_id} --monitor <monitor-key> --environment production --json`
34451
+ );
34452
+ }
34354
34453
  if (health.worst_offenders.length > 0) {
34355
34454
  lines.push("");
34356
34455
  lines.push(
@@ -34575,9 +34674,8 @@ Exit codes:
34575
34674
 
34576
34675
  Examples:
34577
34676
  deepline monitors status --json
34578
- deepline monitors available --json # compact list by default
34579
- deepline monitors available --full --json # complete catalog
34580
- deepline monitors available deepline_native.company_radar --json
34677
+ deepline tools list --categories monitors --json
34678
+ deepline tools get deepline_native.company_radar --json
34581
34679
  deepline monitors check '{"key":"job-openings","tool":"deepline_native.company_radar","payload":{"domain":"stripe.com","radar_type":"company_job_openings"}}'
34582
34680
  deepline monitors deploy --dry-run --file monitor.json
34583
34681
  deepline monitors deploy --file monitor.json
@@ -34747,7 +34845,7 @@ Examples:
34747
34845
  )
34748
34846
  ).action(monitorsAction(handleMonitorsStatus));
34749
34847
  withJsonOption(
34750
- monitors.command("available [tool-id]").alias("tools").description(
34848
+ monitors.command("available [tool-id]", { hidden: true }).alias("tools").description(
34751
34849
  "List the monitor types you can deploy, or describe one by tool id."
34752
34850
  ).addHelpText(
34753
34851
  "after",
@@ -34864,7 +34962,7 @@ Notes:
34864
34962
  Play delivery. The JSON response reports this validation scope explicitly.
34865
34963
  Provider-specific grammar, precedence, enum applicability, examples, and
34866
34964
  update semantics are returned by the live monitor contract. Inspect it with
34867
- \`deepline monitors available deepline_native.company_radar --json\`.
34965
+ \`deepline tools get deepline_native.company_radar --json\`.
34868
34966
  For a bounded urgent Deepline Native preview, use
34869
34967
  controls.execution_type="priority". Deepline injects the upstream marker;
34870
34968
  do not author custom_fields yourself. Priority is capped at ten upstream or
@@ -34902,6 +35000,10 @@ Notes:
34902
35000
  no separate repair command or retry queue: rerun the same deploy/update.
34903
35001
  Scheduled reconciliation can also finish that exact saved cleanup; it never
34904
35002
  creates another monitor.
35003
+ For TamRadar, deliberately changing payload.updates_since is an explicit
35004
+ historical replay request, including when redeploying a disabled monitor.
35005
+ Deepline preserves that selected boundary; filter-only deploys and ordinary
35006
+ reactivation start from a fresh future-only source boundary instead.
34905
35007
  For a bounded urgent Deepline Native preview, set
34906
35008
  controls.execution_type="priority". Deepline injects the provider custom
34907
35009
  field and enforces a ten-slot per-org cap; do not use it for regular or bulk
@@ -34931,6 +35033,11 @@ positionally, via --file <path>, or from stdin with --file -.
34931
35033
  When <patch> includes payload, its top-level fields are merged with the stored
34932
35034
  payload before validation. This lets you change one filter without resending
34933
35035
  domain or radar_type; nested values and arrays replace atomically.
35036
+ For TamRadar, changing payload.updates_since is an explicit historical replay
35037
+ request. Deepline passes that requested boundary upstream, but previously
35038
+ delivered canonical findings are deduplicated before dispatch and billing; only
35039
+ previously unseen historical findings are chargeable. Filter-only updates,
35040
+ repair, and reactivation instead use a fresh future-only source boundary.
34934
35041
  Use {"controls":{"execution_type":"priority"}} only for a bounded urgent
34935
35042
  Deepline Native preview. The ten-radar priority cap applies on update too.
34936
35043
  Use {"controls":{"execution_type":null}} to release priority without
@@ -35017,7 +35124,7 @@ ${MONITOR_FLEET_HELP_EPILOG}`
35017
35124
  Creates a ready-to-review JSON definition. Fleets always sync ${MONITOR_FLEET_DOCUMENTATION.fixedPolicy.cadence} and retain
35018
35125
  a missing member for ${MONITOR_FLEET_DOCUMENTATION.fixedPolicy.removalGrace} before it is ${MONITOR_FLEET_DOCUMENTATION.fixedPolicy.onRemoved}d; those
35019
35126
  policies are not authored in the file. ${MONITOR_FLEET_DOCUMENTATION.stickyMembership} The payload remains the actual monitor payload for the chosen tool, so use
35020
- \`deepline monitors available\` to discover a tool first.
35127
+ \`deepline tools list --categories monitors\` to discover a tool first.
35021
35128
 
35022
35129
  Example:
35023
35130
  deepline monitors fleets init account-job-openings \\
@@ -36004,7 +36111,7 @@ Examples:
36004
36111
  )
36005
36112
  ).action(handleOrgSwitch);
36006
36113
  addOrgSetOptions(
36007
- org.command("switch [selection]").description(
36114
+ org.command("switch [selection]", { hidden: true }).description(
36008
36115
  "Deprecated alias for org set. Set the organization for the selected auth scope."
36009
36116
  ).addHelpText(
36010
36117
  "after",
@@ -36031,6 +36138,9 @@ Examples:
36031
36138
 
36032
36139
  // src/cli/commands/git.ts
36033
36140
  var GIT_DEPLOY_FEATURE = "github-deploy";
36141
+ function shellQuote3(value) {
36142
+ return `'${value.replace(/'/g, `'\\''`)}'`;
36143
+ }
36034
36144
  function renderProject(project) {
36035
36145
  const root = project.rootDirectory ? ` (${project.rootDirectory})` : "";
36036
36146
  const flags = [
@@ -36069,6 +36179,98 @@ async function handleList(options) {
36069
36179
  { json: options.json }
36070
36180
  );
36071
36181
  }
36182
+ function describeInstallationStatus(installation) {
36183
+ switch (installation.status) {
36184
+ case "active":
36185
+ return [
36186
+ `Connected to ${installation.accountLogin} (installation ${installation.installationId}).`
36187
+ ];
36188
+ case "uninstalled":
36189
+ return [
36190
+ `The Deepline GitHub App was uninstalled from ${installation.accountLogin}${installation.uninstalledAt ? ` at ${new Date(installation.uninstalledAt).toISOString()}` : ""}.`,
36191
+ "Deploys are paused for every linked repository. Run `deepline git connect`, then `deepline git link <owner/repo>` again for each repository; links from the old installation cannot be resumed."
36192
+ ];
36193
+ case "suspended":
36194
+ return [
36195
+ `GitHub suspended the Deepline App on ${installation.accountLogin}${installation.suspendedAt ? ` at ${new Date(installation.suspendedAt).toISOString()}` : ""}.`,
36196
+ "Pushes are not delivered while it is suspended; unsuspend it in GitHub settings."
36197
+ ];
36198
+ }
36199
+ }
36200
+ async function handleStatus2(options) {
36201
+ const { http } = getAuthedHttpClient();
36202
+ const payload = await http.get("/api/v2/github/installation");
36203
+ const installation = payload.installation;
36204
+ const others = (payload.installations ?? []).filter(
36205
+ (row) => row.installationId !== installation?.installationId
36206
+ );
36207
+ const lines = installation ? describeInstallationStatus(installation) : [
36208
+ "No GitHub installation is connected to this workspace. Run `deepline git connect`."
36209
+ ];
36210
+ for (const other of others) {
36211
+ lines.push(
36212
+ `Also: ${other.accountLogin} (installation ${other.installationId}) is ${other.status}.`
36213
+ );
36214
+ }
36215
+ const byId = new Map(
36216
+ (payload.installations ?? []).map((row) => [row.installationId, row])
36217
+ );
36218
+ const { projects } = await http.get(
36219
+ "/api/v2/play-projects?includeDisabled=1"
36220
+ );
36221
+ const affected_links = projects.map((project) => {
36222
+ const own = byId.get(project.installationId);
36223
+ const verdict = !own ? "unknown" : own.status === "active" ? null : own.status;
36224
+ return verdict ? {
36225
+ id: project.id,
36226
+ repoId: project.repoId,
36227
+ repoFullName: project.repoFullName,
36228
+ rootDirectory: project.rootDirectory,
36229
+ productionBranch: project.productionBranch,
36230
+ manifestPath: project.manifestPath,
36231
+ checkOnPullRequest: project.checkOnPullRequest,
36232
+ disabled: project.disabled,
36233
+ installationId: project.installationId,
36234
+ installationStatus: verdict
36235
+ } : null;
36236
+ }).filter((row) => row !== null);
36237
+ const activeInstallations = (payload.installations ?? []).filter(
36238
+ (row) => row.status === "active"
36239
+ );
36240
+ const relinkCommand = (link2) => [
36241
+ // The numeric repo id, not the name: a repository renamed while the
36242
+ // App was gone keeps a stale name here, and `git link` accepts the id.
36243
+ `deepline git link ${link2.repoId}`,
36244
+ // Stored values are admin-controlled text and this line is
36245
+ // copy-pasted into a shell by whoever reads it, so every
36246
+ // interpolated value below is quoted.
36247
+ `--branch ${shellQuote3(link2.productionBranch)}`,
36248
+ link2.rootDirectory ? `--root-dir ${shellQuote3(link2.rootDirectory)}` : "",
36249
+ link2.manifestPath && link2.manifestPath !== "deepline.json" ? `--manifest ${shellQuote3(link2.manifestPath)}` : "",
36250
+ link2.checkOnPullRequest ? "" : "--no-pr-checks",
36251
+ // With several active installations no id is guessed: the reader picks.
36252
+ activeInstallations.length > 1 ? "--installation <id>" : ""
36253
+ ].filter(Boolean).join(" ");
36254
+ for (const link2 of affected_links) {
36255
+ const label = `${link2.repoFullName}${link2.rootDirectory ? ` (${link2.rootDirectory})` : ""}`;
36256
+ lines.push(
36257
+ link2.installationStatus !== "suspended" ? `Link again: ${label} \u2014 its installation ${link2.installationId} is ${link2.installationStatus}; run \`${relinkCommand(link2)}\`${activeInstallations.length > 1 ? ` with <id> being the installation that reaches this repo: ${activeInstallations.map((row) => `${row.installationId} (${row.accountLogin})`).join(", ")}` : ""}.` : (
36258
+ // A link disabled during the suspension stays disabled; only an
36259
+ // enabled one picks up again on its own when GitHub unsuspends.
36260
+ link2.disabled ? `Paused and disabled: ${label} \u2014 its installation is suspended, and the link stays disabled after GitHub unsuspends it until you run \`deepline git set ${link2.id} --enabled\`.` : `Paused: ${label} \u2014 its installation is suspended; pushes resume when GitHub unsuspends it.`
36261
+ )
36262
+ );
36263
+ }
36264
+ printCommandEnvelope(
36265
+ {
36266
+ installation,
36267
+ installations: payload.installations ?? [],
36268
+ affected_links,
36269
+ render: { sections: [{ title: "github installation", lines }] }
36270
+ },
36271
+ { json: options.json }
36272
+ );
36273
+ }
36072
36274
  async function handleRepos(options) {
36073
36275
  const { http } = getAuthedHttpClient();
36074
36276
  const query = options.installation ? `?installationId=${encodeURIComponent(options.installation)}` : "";
@@ -36299,6 +36501,9 @@ Examples:
36299
36501
  `
36300
36502
  );
36301
36503
  git.command("connect").description("Connect a GitHub installation (browser step).").option("--json", "Emit JSON output").action(async (options) => handleConnect(options));
36504
+ git.command("status").description(
36505
+ "Show the workspace's GitHub installation and whether it is still usable."
36506
+ ).option("--json", "Emit JSON output").action(async (options) => handleStatus2(options));
36302
36507
  git.command("repos").description("List repos the workspace's GitHub installation can reach.").option(
36303
36508
  "--installation <id>",
36304
36509
  "GitHub installation id (required when several are connected)"
@@ -36409,7 +36614,7 @@ async function handleQuickstart(options) {
36409
36614
  return 0;
36410
36615
  }
36411
36616
  function registerQuickstartCommands(program) {
36412
- program.command("quickstart").description(
36617
+ program.command("quickstart", { hidden: true }).description(
36413
36618
  "Deprecated compatibility command. Use /deepline-gtm in your agent."
36414
36619
  ).addHelpText(
36415
36620
  "after",
@@ -36843,7 +37048,7 @@ var import_node_fs19 = require("fs");
36843
37048
  var import_node_os12 = require("os");
36844
37049
  var import_node_path21 = require("path");
36845
37050
 
36846
- // ../../shared_libs/cli/install-commands.json
37051
+ // contracts/install-commands.json
36847
37052
  var install_commands_default = {
36848
37053
  skills: {
36849
37054
  index_path: "/.well-known/skills/index.json",
@@ -36951,6 +37156,7 @@ function buildSkillsAddArgs(baseUrl, skillName, options = {}) {
36951
37156
 
36952
37157
  // src/cli/skills-sync.ts
36953
37158
  var import_node_child_process2 = require("child_process");
37159
+ var import_node_crypto10 = require("crypto");
36954
37160
  var import_node_fs18 = require("fs");
36955
37161
  var import_node_path20 = require("path");
36956
37162
 
@@ -37307,6 +37513,7 @@ async function maybeReportSdkCliFailure(input2) {
37307
37513
 
37308
37514
  // src/cli/skills-sync.ts
37309
37515
  var CHECK_TIMEOUT_MS2 = 3e3;
37516
+ var SKILLS_SYNC_CLAIM_MAX_AGE_MS = 60 * 60 * 1e3;
37310
37517
  function shouldSkipSkillsSync() {
37311
37518
  if (detectAgentRuntime() === "claude_cowork") {
37312
37519
  return true;
@@ -37323,6 +37530,60 @@ function failedSkillsSyncPath(baseUrl, agents) {
37323
37530
  `skills-sync-failed-${agents.join("-")}-version`
37324
37531
  );
37325
37532
  }
37533
+ function inProgressSkillsSyncPath(baseUrl, agents) {
37534
+ return (0, import_node_path20.join)(
37535
+ sdkCliStateDirPath(baseUrl),
37536
+ `skills-sync-in-progress-${agents.join("-")}`
37537
+ );
37538
+ }
37539
+ function removeSkillsSyncClaim(path, token) {
37540
+ try {
37541
+ (0, import_node_fs18.unlinkSync)((0, import_node_path20.join)(path, token));
37542
+ (0, import_node_fs18.rmdirSync)(path);
37543
+ } catch {
37544
+ }
37545
+ }
37546
+ function claimSkillsSync(baseUrl, agents) {
37547
+ const path = inProgressSkillsSyncPath(baseUrl, agents);
37548
+ try {
37549
+ (0, import_node_fs18.mkdirSync)((0, import_node_path20.dirname)(path), { recursive: true });
37550
+ } catch {
37551
+ return { status: "unavailable" };
37552
+ }
37553
+ const token = (0, import_node_crypto10.randomUUID)();
37554
+ for (let attempt = 0; attempt < 2; attempt += 1) {
37555
+ const pendingPath = `${path}-pending-${token}`;
37556
+ try {
37557
+ (0, import_node_fs18.mkdirSync)(pendingPath);
37558
+ (0, import_node_fs18.writeFileSync)((0, import_node_path20.join)(pendingPath, token), "", { flag: "wx" });
37559
+ (0, import_node_fs18.renameSync)(pendingPath, path);
37560
+ return { status: "claimed", token };
37561
+ } catch {
37562
+ removeSkillsSyncClaim(pendingPath, token);
37563
+ if (!(0, import_node_fs18.existsSync)(path)) continue;
37564
+ }
37565
+ if (attempt > 0) return { status: "held" };
37566
+ try {
37567
+ if (Date.now() - (0, import_node_fs18.statSync)(path).mtimeMs <= SKILLS_SYNC_CLAIM_MAX_AGE_MS) {
37568
+ return { status: "held" };
37569
+ }
37570
+ const owners = (0, import_node_fs18.readdirSync)(path);
37571
+ if (owners.length === 0) {
37572
+ (0, import_node_fs18.rmdirSync)(path);
37573
+ continue;
37574
+ }
37575
+ if (owners.length !== 1) return { status: "held" };
37576
+ (0, import_node_fs18.renameSync)(path, `${path}-stale-${owners[0]}`);
37577
+ } catch {
37578
+ return { status: "held" };
37579
+ }
37580
+ }
37581
+ return { status: "held" };
37582
+ }
37583
+ function clearSkillsSyncClaim(baseUrl, agents, token) {
37584
+ const path = inProgressSkillsSyncPath(baseUrl, agents);
37585
+ removeSkillsSyncClaim(path, token);
37586
+ }
37326
37587
  function hasMarkedSkillsSyncVersion(path, version) {
37327
37588
  return Boolean(version) && readMarkedSkillsSyncVersion(path) === version;
37328
37589
  }
@@ -37458,7 +37719,7 @@ function hasCommand(command) {
37458
37719
  });
37459
37720
  return result.status === 0;
37460
37721
  }
37461
- function shellQuote3(arg) {
37722
+ function shellQuote4(arg) {
37462
37723
  return `'${arg.replace(/'/g, `'\\''`)}'`;
37463
37724
  }
37464
37725
  function temporarySkillsSyncSkipCommand() {
@@ -37477,7 +37738,7 @@ function resolveSkillsInstallCommands(baseUrl, skillNames = DEFAULT_SDK_SKILL_NA
37477
37738
  commands.push({
37478
37739
  command: "bunx",
37479
37740
  args: bunxArgs,
37480
- manualCommand: `bunx ${bunxArgs.map(shellQuote3).join(" ")}`
37741
+ manualCommand: `bunx ${bunxArgs.map(shellQuote4).join(" ")}`
37481
37742
  });
37482
37743
  }
37483
37744
  if (hasCommand("npx")) {
@@ -37485,7 +37746,7 @@ function resolveSkillsInstallCommands(baseUrl, skillNames = DEFAULT_SDK_SKILL_NA
37485
37746
  commands.push({
37486
37747
  command: "npx",
37487
37748
  args: npxArgs,
37488
- manualCommand: `npx ${npxArgs.map(shellQuote3).join(" ")}`
37749
+ manualCommand: `npx ${npxArgs.map(shellQuote4).join(" ")}`
37489
37750
  });
37490
37751
  }
37491
37752
  return commands;
@@ -37652,30 +37913,43 @@ async function syncSdkSkillsIfNeeded(baseUrl, options = {}) {
37652
37913
  writeUnavailableSkillsNotice(baseUrl, update.remoteVersion, skillNames);
37653
37914
  return;
37654
37915
  }
37655
- writeSdkSkillsStatusLine("Deepline skills changed; syncing agent skills...");
37656
- const installResult = await runSkillsInstall(installs, agents);
37657
- if (!installResult.installed) {
37658
- const markerWritten = markFailedSkillsSync(
37659
- baseUrl,
37660
- update.remoteVersion,
37661
- agents
37916
+ const claim = claimSkillsSync(baseUrl, agents);
37917
+ if (claim.status === "held") return;
37918
+ try {
37919
+ if (hasFailedSkillsSync(baseUrl, update.remoteVersion, agents) || readSdkSkillsLocalVersion(baseUrl) === update.remoteVersion) {
37920
+ return;
37921
+ }
37922
+ writeSdkSkillsStatusLine(
37923
+ "Deepline skills changed; syncing agent skills..."
37662
37924
  );
37663
- void maybeReportAutomaticSkillsSyncFailure({
37664
- baseUrl,
37665
- remoteSkillsVersion: update.remoteVersion,
37666
- agents,
37667
- skillsPackage: SKILLS_NPX_PACKAGE,
37668
- targetSkillCount: skillNames.length,
37669
- markerWritten,
37670
- attempts: installResult.attempts
37671
- });
37672
- return;
37925
+ const installResult = await runSkillsInstall(installs, agents);
37926
+ if (!installResult.installed) {
37927
+ const markerWritten = markFailedSkillsSync(
37928
+ baseUrl,
37929
+ update.remoteVersion,
37930
+ agents
37931
+ );
37932
+ void maybeReportAutomaticSkillsSyncFailure({
37933
+ baseUrl,
37934
+ remoteSkillsVersion: update.remoteVersion,
37935
+ agents,
37936
+ skillsPackage: SKILLS_NPX_PACKAGE,
37937
+ targetSkillCount: skillNames.length,
37938
+ markerWritten,
37939
+ attempts: installResult.attempts
37940
+ });
37941
+ return;
37942
+ }
37943
+ runLegacySkillsCleanup(agents);
37944
+ writeSdkSkillsLocalVersion(baseUrl, update.remoteVersion, agents);
37945
+ clearUnavailableSkillsNotice(baseUrl);
37946
+ clearFailedSkillsSync(baseUrl, agents);
37947
+ writeSdkSkillsStatusLine("Deepline agent skills are up to date.");
37948
+ } finally {
37949
+ if (claim.status === "claimed") {
37950
+ clearSkillsSyncClaim(baseUrl, agents, claim.token);
37951
+ }
37673
37952
  }
37674
- runLegacySkillsCleanup(agents);
37675
- writeSdkSkillsLocalVersion(baseUrl, update.remoteVersion, agents);
37676
- clearUnavailableSkillsNotice(baseUrl);
37677
- clearFailedSkillsSync(baseUrl, agents);
37678
- writeSdkSkillsStatusLine("Deepline agent skills are up to date.");
37679
37953
  }
37680
37954
 
37681
37955
  // src/cli/commands/skills.ts
@@ -39299,14 +39573,14 @@ function posixShellQuote(value) {
39299
39573
  function windowsCmdQuote(value) {
39300
39574
  return `"${value.replace(/"/g, '""')}"`;
39301
39575
  }
39302
- function shellQuote4(value) {
39576
+ function shellQuote5(value) {
39303
39577
  if (process.platform === "win32") {
39304
39578
  return /^[A-Za-z0-9_./:@%+=,-]+$/.test(value) ? value : windowsCmdQuote(value);
39305
39579
  }
39306
39580
  return posixShellQuote(value);
39307
39581
  }
39308
39582
  function buildSourceUpdateCommand(sourceRoot) {
39309
- const quotedRoot = shellQuote4(sourceRoot);
39583
+ const quotedRoot = shellQuote5(sourceRoot);
39310
39584
  const cdCommand = process.platform === "win32" ? `cd /d ${quotedRoot}` : `cd ${quotedRoot}`;
39311
39585
  return `${cdCommand} && git fetch origin main --tags && git merge --ff-only origin/main`;
39312
39586
  }
@@ -39318,7 +39592,7 @@ function buildSidecarProjectConfigCommand(versionDir, nodeBin) {
39318
39592
  "fs.mkdirSync(dir,{recursive:true});",
39319
39593
  `fs.writeFileSync(path.join(dir,'package.json'),${JSON.stringify(NPM_SDK_SIDECAR_PACKAGE_JSON)});`
39320
39594
  ].join("");
39321
- return `${shellQuote4(nodeBin)} -e ${shellQuote4(script)} ${shellQuote4(versionDir)}`;
39595
+ return `${shellQuote5(nodeBin)} -e ${shellQuote5(script)} ${shellQuote5(versionDir)}`;
39322
39596
  }
39323
39597
  function sidecarStateDir(input2) {
39324
39598
  const scope = input2.env.DEEPLINE_CONFIG_SCOPE?.trim();
@@ -39381,7 +39655,7 @@ function resolvePythonSidecarUpdatePlan(options) {
39381
39655
  const npmCommand = "npm";
39382
39656
  const registryUrl = sidecarRegistryUrl(hostUrl);
39383
39657
  const versionDir = (0, import_node_path25.join)(stateDir, "versions", "<version>");
39384
- const manualCommand = `${buildSidecarProjectConfigCommand(versionDir, nodeBin)} && ${npmCommand} install --prefix ${shellQuote4(versionDir)} --registry ${shellQuote4(registryUrl)} ${NPM_SDK_INSTALL_COMMON_FLAGS.map(shellQuote4).join(" ")} ${shellQuote4(packageSpec)}`;
39658
+ const manualCommand = `${buildSidecarProjectConfigCommand(versionDir, nodeBin)} && ${npmCommand} install --prefix ${shellQuote5(versionDir)} --registry ${shellQuote5(registryUrl)} ${NPM_SDK_INSTALL_COMMON_FLAGS.map(shellQuote5).join(" ")} ${shellQuote5(packageSpec)}`;
39385
39659
  return {
39386
39660
  kind: "python-sidecar",
39387
39661
  stateDir,
@@ -39528,7 +39802,7 @@ function resolveUpdatePlan(options = {}) {
39528
39802
  args,
39529
39803
  ...installPrefix ? { installPrefix } : {},
39530
39804
  ...fallbackRegistryUrl ? { fallbackRegistryUrl } : {},
39531
- manualCommand: `${command} ${args.map(shellQuote4).join(" ")}`
39805
+ manualCommand: `${command} ${args.map(shellQuote5).join(" ")}`
39532
39806
  };
39533
39807
  }
39534
39808
  var AUTO_UPDATE_FAILURE_FILE = ".auto-update-failure.json";
@@ -39796,23 +40070,23 @@ function writeSidecarLauncher(input2) {
39796
40070
  input2.path,
39797
40071
  [
39798
40072
  "#!/usr/bin/env sh",
39799
- `export DEEPLINE_HOST_URL=${shellQuote4(input2.hostUrl)}`,
39800
- `export DEEPLINE_CONFIG_SCOPE=${shellQuote4(input2.scope)}`,
39801
- `if ${criticalPaths.map((path) => `[ ! -f ${shellQuote4(path)} ]`).join(" || ")}; then`,
40073
+ `export DEEPLINE_HOST_URL=${shellQuote5(input2.hostUrl)}`,
40074
+ `export DEEPLINE_CONFIG_SCOPE=${shellQuote5(input2.scope)}`,
40075
+ `if ${criticalPaths.map((path) => `[ ! -f ${shellQuote5(path)} ]`).join(" || ")}; then`,
39802
40076
  ' if [ -n "${DEEPLINE_REAL_BINARY:-}" ] && [ -x "$DEEPLINE_REAL_BINARY" ]; then',
39803
40077
  ' exec "$DEEPLINE_REAL_BINARY" --version=v2 "$@"',
39804
40078
  " fi",
39805
40079
  ' printf "%s\\n" "Deepline SDK CLI install is incomplete. Run \\`deepline update\\` to repair it." >&2',
39806
40080
  " exit 1",
39807
40081
  "fi",
39808
- `if ! ${shellQuote4(input2.nodeBin)} -e ${shellQuote4(esbuildProbe)} ${shellQuote4(versionDir)} >/dev/null 2>&1; then`,
40082
+ `if ! ${shellQuote5(input2.nodeBin)} -e ${shellQuote5(esbuildProbe)} ${shellQuote5(versionDir)} >/dev/null 2>&1; then`,
39809
40083
  ' if [ -n "${DEEPLINE_REAL_BINARY:-}" ] && [ -x "$DEEPLINE_REAL_BINARY" ]; then',
39810
40084
  ' exec "$DEEPLINE_REAL_BINARY" --version=v2 "$@"',
39811
40085
  " fi",
39812
40086
  ' printf "%s\\n" "Deepline SDK CLI install is incomplete. Run \\`deepline update\\` to repair it." >&2',
39813
40087
  " exit 1",
39814
40088
  "fi",
39815
- `exec ${shellQuote4(input2.nodeBin)} ${shellQuote4(input2.entryPath)} "$@"`,
40089
+ `exec ${shellQuote5(input2.nodeBin)} ${shellQuote5(input2.entryPath)} "$@"`,
39816
40090
  ""
39817
40091
  ].join("\n"),
39818
40092
  { encoding: "utf8", mode: 493 }
@@ -43070,9 +43344,9 @@ function apifySyncRecoveryNext(rawResponse) {
43070
43344
  const getDatasetItemsTool = stringField2(getDatasetItems, "tool");
43071
43345
  const getDatasetItemsPayload = recordField2(getDatasetItems, "payload");
43072
43346
  return {
43073
- getActorRun: `deepline tools execute ${getActorRunTool} --input ${shellQuote5(JSON.stringify(getActorRunPayload))} --json`,
43347
+ getActorRun: `deepline tools execute ${getActorRunTool} --input ${shellQuote6(JSON.stringify(getActorRunPayload))} --json`,
43074
43348
  ...getDatasetItemsTool && Object.keys(getDatasetItemsPayload).length > 0 ? {
43075
- getDatasetItems: `deepline tools execute ${getDatasetItemsTool} --input ${shellQuote5(JSON.stringify(getDatasetItemsPayload))} --json`
43349
+ getDatasetItems: `deepline tools execute ${getDatasetItemsTool} --input ${shellQuote6(JSON.stringify(getDatasetItemsPayload))} --json`
43076
43350
  } : {}
43077
43351
  };
43078
43352
  }
@@ -43245,7 +43519,7 @@ function parseExecuteOptions(args) {
43245
43519
  function safeFileStem(value) {
43246
43520
  return value.trim().replace(/[^a-zA-Z0-9_-]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 64) || "tool";
43247
43521
  }
43248
- function shellQuote5(value) {
43522
+ function shellQuote6(value) {
43249
43523
  return `'${value.replace(/'/g, `'\\''`)}'`;
43250
43524
  }
43251
43525
  function powerShellQuote(value) {
@@ -43315,7 +43589,7 @@ export default definePlay(${JSON.stringify(playName)}, async (ctx) => {
43315
43589
  path: scriptPath,
43316
43590
  sourceCode: script,
43317
43591
  projectDir,
43318
- macCopyCommand: `mkdir -p ${shellQuote5(projectDir)} && cp ${shellQuote5(scriptPath)} ${shellQuote5(`${projectDir}/${fileName}`)}`,
43592
+ macCopyCommand: `mkdir -p ${shellQuote6(projectDir)} && cp ${shellQuote6(scriptPath)} ${shellQuote6(`${projectDir}/${fileName}`)}`,
43319
43593
  windowsCopyCommand: `New-Item -ItemType Directory -Force -Path ${powerShellQuote(projectDir.replace(/\//g, "\\"))} | Out-Null; Copy-Item -LiteralPath ${powerShellQuote(scriptPath)} -Destination ${powerShellQuote(`${projectDir.replace(/\//g, "\\")}\\${fileName}`)}`
43320
43594
  };
43321
43595
  }
@@ -43342,7 +43616,7 @@ function buildToolExecuteBaseEnvelope(input2) {
43342
43616
  envelope,
43343
43617
  "output"
43344
43618
  );
43345
- const inspectCommand = `deepline tools execute ${input2.toolId} --input ${shellQuote5(JSON.stringify(input2.params))} --json`;
43619
+ const inspectCommand = `deepline tools execute ${input2.toolId} --input ${shellQuote6(JSON.stringify(input2.params))} --json`;
43346
43620
  const actions = input2.listConversion ? [
43347
43621
  {
43348
43622
  label: "next",
@@ -43738,7 +44012,7 @@ var import_promises10 = require("fs/promises");
43738
44012
  var import_node_path28 = require("path");
43739
44013
 
43740
44014
  // src/cli/workflow-to-play.ts
43741
- var import_node_crypto10 = require("crypto");
44015
+ var import_node_crypto11 = require("crypto");
43742
44016
  var HITL_WAIT_FOR_SIGNAL_TOOL = "deepline_workflow_wait_for_signal";
43743
44017
  var HITL_SLACK_TOOL = "slack_message_with_hitl";
43744
44018
  var SUB_WORKFLOW_TOOL_PREFIX = "deepline_workflow_";
@@ -43844,7 +44118,7 @@ function sanitizePlayNameSegment(value) {
43844
44118
  }
43845
44119
  function deriveWorkflowPlayName(workflowName) {
43846
44120
  const base = sanitizePlayNameSegment(workflowName) || "workflow";
43847
- const suffix = (0, import_node_crypto10.createHash)("sha256").update(workflowName).digest("hex").slice(0, 8);
44121
+ const suffix = (0, import_node_crypto11.createHash)("sha256").update(workflowName).digest("hex").slice(0, 8);
43848
44122
  const reserved = suffix.length + 1;
43849
44123
  const allowedBase = Math.max(1, MAX_PLAY_NAME_LENGTH - reserved);
43850
44124
  let name = `${base.slice(0, allowedBase)}_${suffix}`;
@@ -44162,7 +44436,7 @@ async function handleTail(id, runId, options) {
44162
44436
  }
44163
44437
  }
44164
44438
  function registerWorkflowCommands(program) {
44165
- const workflows = program.command("workflows").description(
44439
+ const workflows = program.command("workflows", { hidden: true }).description(
44166
44440
  "Legacy cloud workflows (now becoming plays). Commands still work; use `workflows transform` to migrate one to a play. " + TRIGGER_REDIRECT
44167
44441
  ).addHelpText(
44168
44442
  "after",
@@ -44982,4 +45256,11 @@ Examples:
44982
45256
  }
44983
45257
  process.exitCode = process.exitCode ?? 0;
44984
45258
  }
44985
- main();
45259
+ var DEV_CLI_AWAIT_MAIN = Symbol.for("@deepline/sdk/dev-cli-await-main");
45260
+ if (globalThis[DEV_CLI_AWAIT_MAIN] !== true) {
45261
+ void main();
45262
+ }
45263
+ // Annotate the CommonJS export names for ESM import in node:
45264
+ 0 && (module.exports = {
45265
+ main
45266
+ });