deepline 0.3.324 → 0.3.326

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 (133) hide show
  1. package/dist/bundling-sources/sdk/src/client.ts +23 -25
  2. package/dist/bundling-sources/sdk/src/compat.ts +11 -6
  3. package/dist/bundling-sources/sdk/src/db/query.ts +172 -0
  4. package/dist/bundling-sources/sdk/src/errors.ts +35 -0
  5. package/dist/bundling-sources/sdk/src/index.ts +13 -0
  6. package/dist/bundling-sources/sdk/src/play.ts +34 -31
  7. package/dist/bundling-sources/sdk/src/plays/authoring-graph-path.ts +13 -0
  8. package/dist/bundling-sources/sdk/src/plays/bundle-play-file.ts +2 -1
  9. package/dist/bundling-sources/sdk/src/plays/local-play-execution.ts +189 -0
  10. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  11. package/dist/bundling-sources/sdk/src/tool-calls.ts +1 -1
  12. package/dist/bundling-sources/sdk/src/types.ts +6 -0
  13. package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +2 -0
  14. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +7 -1
  15. package/dist/bundling-sources/shared_libs/play-runtime/runtime-actions.ts +1 -0
  16. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +5 -0
  17. package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +84 -10
  18. package/dist/bundling-sources/shared_libs/plays/artifact-types.ts +9 -0
  19. package/dist/cli/auth-6STWK6UK.js +31 -0
  20. package/dist/cli/{auth-6KWNR6AI.mjs → auth-VON5FFUK.mjs} +4 -4
  21. package/dist/cli/{billing-VQ2NUJLB.mjs → billing-X6JUEFRE.mjs} +4 -4
  22. package/dist/cli/{billing-CLLWHIAT.js → billing-YI4RZI2O.js} +70 -70
  23. package/dist/cli/{chunk-NC2ZXG2Y.js → chunk-3NGWGFVL.js} +26 -26
  24. package/dist/cli/{chunk-5CQ554BM.mjs → chunk-4AB4Y6FF.mjs} +1 -1
  25. package/dist/cli/{chunk-EXKRHZRG.js → chunk-4LNBSQM4.js} +5928 -5730
  26. package/dist/cli/{chunk-G4F2AIQ5.js → chunk-5NXHSRRE.js} +6 -6
  27. package/dist/cli/{chunk-XNL3SEMC.js → chunk-AFNEQ43J.js} +8 -3
  28. package/dist/cli/{chunk-XSEMQ4II.js → chunk-AGH6YP2T.js} +2 -1
  29. package/dist/cli/chunk-AID3OYVJ.js +8 -0
  30. package/dist/cli/{chunk-HHZDWBSQ.mjs → chunk-BQJVMKWL.mjs} +1 -1
  31. package/dist/cli/{chunk-TJGJTB5T.mjs → chunk-BR7GGTAE.mjs} +24 -1
  32. package/dist/cli/{chunk-IXYR65PW.js → chunk-BUYZEUY4.js} +1 -1
  33. package/dist/cli/{chunk-GROXVGGW.js → chunk-CUUHQ3AO.js} +6 -6
  34. package/dist/cli/{chunk-NIOFMRYW.mjs → chunk-DFDXKOLR.mjs} +98 -113
  35. package/dist/cli/{chunk-GMO3NBE2.js → chunk-EMZ7Y5SW.js} +70 -67
  36. package/dist/cli/chunk-GVESPYSY.mjs +234 -0
  37. package/dist/cli/{chunk-N5E66DP3.js → chunk-GVYKY6T6.js} +344 -254
  38. package/dist/cli/{chunk-EHSI2DMO.mjs → chunk-IQCCGOQH.mjs} +4 -20
  39. package/dist/cli/{chunk-76VKBPOC.mjs → chunk-JOA6IKDE.mjs} +7 -2
  40. package/dist/cli/{chunk-3ZKAKQYC.mjs → chunk-KLWBAQ5A.mjs} +104 -14
  41. package/dist/cli/{chunk-PAA4FYCF.js → chunk-KZ4PCK4O.js} +29 -45
  42. package/dist/cli/chunk-LVEDPCLJ.js +234 -0
  43. package/dist/cli/{chunk-I7RLL7LN.mjs → chunk-M7CPVMDB.mjs} +1 -1
  44. package/dist/cli/{chunk-2UQUOUAW.js → chunk-MDQZQ3NY.js} +2 -2
  45. package/dist/cli/{chunk-V5PA6TCT.js → chunk-MKHSZA2X.js} +48 -48
  46. package/dist/cli/{chunk-LHJKYMTS.mjs → chunk-MOBZS4F3.mjs} +1 -1
  47. package/dist/cli/chunk-OVDNJAJN.mjs +8 -0
  48. package/dist/cli/{chunk-QM2Z4FQF.js → chunk-T33W6JUJ.js} +6 -6
  49. package/dist/cli/{chunk-DO2VA5UP.mjs → chunk-TDSNAC3C.mjs} +2 -2
  50. package/dist/cli/{chunk-D5YJHGST.js → chunk-TXVOB5J2.js} +29 -6
  51. package/dist/cli/{chunk-TZZNI2A4.js → chunk-TZQMFWLF.js} +147 -162
  52. package/dist/cli/{chunk-NQJQ3CLX.mjs → chunk-VGKVLADU.mjs} +3 -3
  53. package/dist/cli/{chunk-U2RPP53P.mjs → chunk-VKXGOQG5.mjs} +5674 -5476
  54. package/dist/cli/{chunk-AKM5JVPG.mjs → chunk-W74E5ETE.mjs} +12 -9
  55. package/dist/cli/{chunk-7PZFGB7L.mjs → chunk-YIY74KUF.mjs} +2 -1
  56. package/dist/cli/{chunk-5QZFWY7C.mjs → chunk-ZRN6YOF2.mjs} +2 -2
  57. package/dist/cli/client-TEBW2P24.js +20 -0
  58. package/dist/cli/{client-VHUKTDAZ.mjs → client-ZMOKUNL2.mjs} +3 -3
  59. package/dist/cli/{csv-5MZY7HU5.js → csv-HZRKEI7J.js} +12 -12
  60. package/dist/cli/{csv-7DA4APB6.mjs → csv-IICJHJZ4.mjs} +3 -3
  61. package/dist/cli/{db-ICG3FUVE.js → db-TM5NZF73.js} +226 -149
  62. package/dist/cli/{db-7UPW3N5U.mjs → db-X4B7YFNY.mjs} +214 -137
  63. package/dist/cli/{describe-VDRY2JCE.js → describe-BDBARWZJ.js} +28 -27
  64. package/dist/cli/{describe-ZAPGM5ND.mjs → describe-GMVS3LFC.mjs} +12 -11
  65. package/dist/cli/{executions-TK3C2FAQ.mjs → executions-447ZJMN4.mjs} +4 -4
  66. package/dist/cli/{executions-D5GYCY3A.js → executions-QX25UOQM.js} +6 -6
  67. package/dist/cli/{feedback-PZAZZUXF.js → feedback-4IXUTBX7.js} +6 -6
  68. package/dist/cli/{feedback-T4EIP5QR.mjs → feedback-JB7HHIC6.mjs} +3 -3
  69. package/dist/cli/git-C7C7DTEH.js +23 -0
  70. package/dist/cli/{git-WBFWIVO5.mjs → git-VID6KGAA.mjs} +4 -4
  71. package/dist/cli/index.js +105 -87
  72. package/dist/cli/index.mjs +65 -47
  73. package/dist/cli/{legacy-noops-LRBJWXRK.js → legacy-noops-3FYTCOZO.js} +7 -7
  74. package/dist/cli/{legacy-noops-DUCK7OKN.mjs → legacy-noops-SGR3G5WS.mjs} +4 -4
  75. package/dist/cli/{monitors-WYH5AQIO.mjs → monitors-SH4FOMBM.mjs} +4 -4
  76. package/dist/cli/{monitors-7S2SL62G.js → monitors-SP52UHS4.js} +85 -85
  77. package/dist/cli/{org-XCSMLTUW.mjs → org-B32MMIQT.mjs} +4 -4
  78. package/dist/cli/{org-EQNGGHPV.js → org-UQMX7JOR.js} +60 -60
  79. package/dist/cli/play-UCIWBN7U.js +153 -0
  80. package/dist/cli/{play-A5ISFBJM.mjs → play-XTE4LUP7.mjs} +11 -10
  81. package/dist/cli/{providers-DR2CLD3N.js → providers-JNMJJ2OH.js} +7 -7
  82. package/dist/cli/{providers-KHTZFQ5I.mjs → providers-RWLN6FUR.mjs} +4 -4
  83. package/dist/cli/{quickstart-NIRWI6YU.js → quickstart-HK6WZ342.js} +5 -5
  84. package/dist/cli/{quickstart-KT4LKORA.mjs → quickstart-IDB3Y375.mjs} +3 -3
  85. package/dist/cli/{search-WCEXPBAT.mjs → search-6D3IFNPT.mjs} +5 -5
  86. package/dist/cli/search-LUZ2S7DH.js +26 -0
  87. package/dist/cli/{secrets-QSFEZGVE.js → secrets-JOQB57IE.js} +13 -13
  88. package/dist/cli/{secrets-TN7DW3QR.mjs → secrets-TZ53CQ3D.mjs} +4 -4
  89. package/dist/cli/{sessions-WSE5FN4H.mjs → sessions-4MBDC4EK.mjs} +4 -4
  90. package/dist/cli/{sessions-LJS6W67T.js → sessions-QSAICDXX.js} +5 -5
  91. package/dist/cli/{settings-FGS3VYJN.js → settings-OTOCW7L7.js} +74 -74
  92. package/dist/cli/{settings-Z3V53A6J.mjs → settings-RKQFMLDU.mjs} +7 -7
  93. package/dist/cli/{setup-GMH4VJS3.mjs → setup-2S5TNTUB.mjs} +6 -6
  94. package/dist/cli/{setup-ZA234HEY.js → setup-AKZUDVYY.js} +41 -41
  95. package/dist/cli/skills-26LASHZF.js +28 -0
  96. package/dist/cli/{skills-7G2RZMYH.mjs → skills-AGZXDLSA.mjs} +4 -4
  97. package/dist/cli/{tools-7EE4BGXO.mjs → tools-7Y6RD6FY.mjs} +8 -7
  98. package/dist/cli/tools-L5VIJQWX.js +39 -0
  99. package/dist/cli/{update-O5QEWS7K.mjs → update-M7YGF67I.mjs} +6 -6
  100. package/dist/cli/update-MNHF6M2F.js +28 -0
  101. package/dist/cli/{workflow-KE54RUTR.mjs → workflow-CTVE7S7W.mjs} +5 -5
  102. package/dist/cli/{workflow-M5PAAW3O.js → workflow-NGMY425T.js} +15 -15
  103. package/dist/{client-BV68GMPo.d.ts → client-DHq8dJ56.d.ts} +45 -11
  104. package/dist/{client-D9ACjiRC.d.mts → client-wiWPZhnI.d.mts} +45 -11
  105. package/dist/{compiler-manifest-BXcZ4P4W.d.mts → compiler-manifest-9TkZ_ykI.d.mts} +717 -711
  106. package/dist/{compiler-manifest-BXcZ4P4W.d.ts → compiler-manifest-9TkZ_ykI.d.ts} +717 -711
  107. package/dist/index-B-5_Xhud.d.mts +75 -0
  108. package/dist/index-ykksoEyR.d.ts +75 -0
  109. package/dist/index.d.mts +52 -13
  110. package/dist/index.d.ts +52 -13
  111. package/dist/index.js +92 -28
  112. package/dist/index.mjs +91 -27
  113. package/dist/install-integrity.json +91 -84
  114. package/dist/plays/bundle-play-file.d.mts +7 -75
  115. package/dist/plays/bundle-play-file.d.ts +7 -75
  116. package/dist/plays/bundle-play-file.mjs +1 -1
  117. package/dist/plays/run-request.d.mts +2 -2
  118. package/dist/plays/run-request.d.ts +2 -2
  119. package/dist/release.d.mts +1 -1
  120. package/dist/release.d.ts +1 -1
  121. package/dist/release.js +2 -2
  122. package/dist/release.mjs +1 -1
  123. package/package.json +1 -1
  124. package/dist/cli/auth-LKSTC3YV.js +0 -31
  125. package/dist/cli/chunk-OWJZUE3Y.mjs +0 -103
  126. package/dist/cli/chunk-SDK3ZA2C.js +0 -103
  127. package/dist/cli/client-WMSTRUGP.js +0 -20
  128. package/dist/cli/git-73N6EUZ3.js +0 -23
  129. package/dist/cli/play-CLC2Z5SO.js +0 -152
  130. package/dist/cli/search-DM7IQS5F.js +0 -26
  131. package/dist/cli/skills-6APAQV6W.js +0 -28
  132. package/dist/cli/tools-EPYUFWPB.js +0 -38
  133. package/dist/cli/update-FPVX3XJC.js +0 -28
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  npmSupportsAllowScripts,
3
3
  readNpmVersion
4
- } from "./chunk-5CQ554BM.mjs";
4
+ } from "./chunk-4AB4Y6FF.mjs";
5
5
  import {
6
6
  resolveShellSpawn,
7
7
  runSkillsCommand
8
- } from "./chunk-AKM5JVPG.mjs";
8
+ } from "./chunk-W74E5ETE.mjs";
9
9
  import {
10
10
  printCommandEnvelope
11
- } from "./chunk-I7RLL7LN.mjs";
11
+ } from "./chunk-M7CPVMDB.mjs";
12
12
  import {
13
13
  autoDetectBaseUrl
14
- } from "./chunk-TJGJTB5T.mjs";
14
+ } from "./chunk-BR7GGTAE.mjs";
15
15
 
16
16
  // src/cli/commands/update.ts
17
17
  import { spawn, spawnSync } from "child_process";
@@ -306,21 +306,6 @@ function shouldRunCliAutoUpdate(homeDir = homedir()) {
306
306
  const preferences = readCliUpdatePreferences(homeDir);
307
307
  return preferences.autoUpdateEnabled && preferences.pinnedVersion === null;
308
308
  }
309
- function consumePendingCliUpdateMessages(homeDir = homedir()) {
310
- const preferences = readCliUpdatePreferences(homeDir);
311
- const acknowledged = new Set(preferences.acknowledgedMessages);
312
- const pending = CLI_UPDATE_MESSAGES.filter(({ id }) => !acknowledged.has(id));
313
- if (pending.length === 0) return [];
314
- for (const { id } of pending) acknowledged.add(id);
315
- try {
316
- writeCliUpdatePreferences(
317
- { ...preferences, acknowledgedMessages: [...acknowledged] },
318
- homeDir
319
- );
320
- } catch {
321
- }
322
- return pending.map(({ message }) => message);
323
- }
324
309
 
325
310
  // src/cli/commands/update.ts
326
311
  function canAutomaticallyApplyUpdatePlan(plan) {
@@ -1258,7 +1243,6 @@ export {
1258
1243
  readCliUpdatePreferences,
1259
1244
  setCliAutoUpdateEnabled,
1260
1245
  shouldRunCliAutoUpdate,
1261
- consumePendingCliUpdateMessages,
1262
1246
  canAutomaticallyApplyUpdatePlan,
1263
1247
  resolveUpdatePlan,
1264
1248
  runAutomaticUpdatePlan,
@@ -1,3 +1,7 @@
1
+ import {
2
+ shellQuote
3
+ } from "./chunk-OVDNJAJN.mjs";
4
+
1
5
  // src/cli/described.ts
2
6
  var SHAPE = "{}";
3
7
  var SCHEMA_LINE_LIMIT = 100;
@@ -288,9 +292,10 @@ function examples(described, options) {
288
292
  if (runner.via === "monitor") return { cli: runner.deploy, play: null };
289
293
  if (runner.via === "tool") {
290
294
  return {
291
- cli: `deepline tools execute ${runner.toolId} --input '${input}'`,
295
+ cli: `deepline tools execute ${runner.toolId} --input ${shellQuote(input)}`,
292
296
  play: [
293
297
  "const result = await ctx.tools.execute({",
298
+ " staleAfterSeconds: 0,",
294
299
  ` id: '${safeIdentifier(runner.toolId)}',`,
295
300
  ` tool: '${runner.toolId}',`,
296
301
  ` input: ${input},`,
@@ -300,7 +305,7 @@ function examples(described, options) {
300
305
  };
301
306
  }
302
307
  return {
303
- cli: runner.cli ?? `deepline plays run ${runner.reference} --input '${input}'`,
308
+ cli: runner.cli ?? `deepline plays run ${runner.reference} --input ${shellQuote(input)}`,
304
309
  play: [
305
310
  `const output = await ctx.runPlay('${safeIdentifier(runner.reference.replace(/^.*\//, ""))}', '${runner.reference}', ${input});`,
306
311
  ...reads((field) => `output.${field.name}`)
@@ -10,11 +10,12 @@ import {
10
10
  } from "./chunk-CBVIJSHF.mjs";
11
11
  import {
12
12
  COORDINATOR_INTERNAL_TOKEN_HEADER,
13
+ CustomerDbQueryOutcomeUnknownError,
13
14
  HttpClient,
14
15
  RETAINED_PIPELINE_RECEIVERS_HEADER,
15
16
  RUNTIME_ENVIRONMENT_TOKEN_HEADER,
16
17
  resolveConfig
17
- } from "./chunk-TJGJTB5T.mjs";
18
+ } from "./chunk-BR7GGTAE.mjs";
18
19
  import {
19
20
  PLAY_RUNTIME_BACKENDS,
20
21
  RAW_V2_TOOL_RESPONSE_CONTRACT,
@@ -81,6 +82,102 @@ function playInputExampleArgs(schema) {
81
82
  return " --input '@<input.json>'";
82
83
  }
83
84
 
85
+ // src/db/query.ts
86
+ function planCustomerDbQuery(input) {
87
+ if (typeof input.sql !== "string" || !input.sql.trim())
88
+ throw new DeeplineError("sql must not be empty.", 400, "INVALID_SQL");
89
+ if (input.operationKey !== void 0 && typeof input.operationKey !== "string")
90
+ throw new DeeplineError(
91
+ "operationKey must be a string containing 1\u2013512 characters.",
92
+ 400,
93
+ "INVALID_OPERATION_KEY"
94
+ );
95
+ const operationKey = input.operationKey;
96
+ if (operationKey !== void 0 && (!operationKey.trim() || operationKey.length > 512)) {
97
+ throw new DeeplineError(
98
+ "operationKey must contain 1\u2013512 characters.",
99
+ 400,
100
+ "INVALID_OPERATION_KEY"
101
+ );
102
+ }
103
+ if (input.maxRows !== void 0 && (!Number.isSafeInteger(input.maxRows) || input.maxRows < 1 || input.maxRows > 1e3)) {
104
+ throw new DeeplineError(
105
+ "maxRows must be a whole number from 1 to 1000.",
106
+ 400,
107
+ "INVALID_MAX_ROWS"
108
+ );
109
+ }
110
+ return {
111
+ request: {
112
+ method: "POST",
113
+ path: "/api/v2/db/query",
114
+ body: {
115
+ sql: input.sql,
116
+ ...input.maxRows !== void 0 ? { max_rows: input.maxRows } : {},
117
+ ...operationKey !== void 0 ? { operation_key: operationKey } : {}
118
+ }
119
+ },
120
+ effects: {
121
+ cloudMutations: "statement_dependent",
122
+ localWrites: "none",
123
+ creditSpending: "none",
124
+ recovery: operationKey === void 0 ? "unkeyed_unknown_outcome" : "original_operation_key"
125
+ },
126
+ transport: {
127
+ maxRetries: 0,
128
+ urlFailover: "disabled"
129
+ }
130
+ };
131
+ }
132
+ async function queryCustomerDatabase(http, input) {
133
+ const plan = planCustomerDbQuery(input);
134
+ let result;
135
+ try {
136
+ result = await http.post(
137
+ plan.request.path,
138
+ plan.request.body,
139
+ void 0,
140
+ {
141
+ maxRetries: plan.transport.maxRetries,
142
+ exactUrlOnly: plan.transport.urlFailover === "disabled"
143
+ }
144
+ );
145
+ } catch (error) {
146
+ if (error instanceof DeeplineError && (error.code?.startsWith("NETWORK_") || // Older API readers return PostgreSQL errors as HTTP 400, including
147
+ // lost connections and explicitly unknown transaction resolution.
148
+ /^08[A-Z0-9]{3}$/.test(error.code ?? "") || ["57P01", "57P02", "57P03"].includes(error.code ?? "") || error.statusCode === 408 || (error.statusCode ?? 0) >= 500)) {
149
+ throw new CustomerDbQueryOutcomeUnknownError(
150
+ error,
151
+ plan.request.body.operation_key
152
+ );
153
+ }
154
+ throw error;
155
+ }
156
+ if (!result || typeof result !== "object" || Array.isArray(result) || typeof result.command !== "string" || !Array.isArray(result.columns) || !Array.isArray(result.rows) || typeof result.truncated !== "boolean" || result.row_count !== null && (!Number.isSafeInteger(result.row_count) || result.row_count < 0) || !Number.isSafeInteger(result.row_count_returned) || result.row_count_returned < 0) {
157
+ throw new CustomerDbQueryOutcomeUnknownError(
158
+ new DeeplineError(
159
+ "The SQL response did not contain a valid result.",
160
+ 200,
161
+ "CUSTOMER_DB_QUERY_RESPONSE_INVALID"
162
+ ),
163
+ plan.request.body.operation_key
164
+ );
165
+ }
166
+ const operation = result.operation;
167
+ if (input.operationKey !== void 0 && (!operation || operation.operation_key !== input.operationKey || !Number.isSafeInteger(operation.completed_at_ms) || operation.completed_at_ms < 0 || !["executed", "operation_recovery"].includes(operation.source))) {
168
+ throw new CustomerDbQueryOutcomeUnknownError(
169
+ new DeeplineError(
170
+ "The server did not confirm the original atomic SQL operation.",
171
+ 200,
172
+ "CUSTOMER_DB_OPERATION_ACK_INVALID"
173
+ ),
174
+ input.operationKey,
175
+ { recoveryAvailable: false }
176
+ );
177
+ }
178
+ return { ...result, scope: { kind: "database", mutability: "current" } };
179
+ }
180
+
84
181
  // ../integration-contracts/opensosdata/execution-policy.ts
85
182
  var OPENSOSDATA_LOOKUP_REQUEST_TIMEOUT_MS = 12e4;
86
183
  var OPENSOSDATA_POLL_INTERVAL_MS = 3e3;
@@ -3115,7 +3212,8 @@ var DeeplineClient = class _DeeplineClient {
3115
3212
  stopAll: ((options2) => this.stopAllRuns(options2))
3116
3213
  };
3117
3214
  this.db = {
3118
- query: (input) => this.queryDb(input)
3215
+ query: (input) => this.queryDb(input),
3216
+ planQuery: (input) => planCustomerDbQuery(input)
3119
3217
  };
3120
3218
  this.billing = {
3121
3219
  topUp: (options2) => this.topUpBillingBalance(options2),
@@ -3527,17 +3625,7 @@ var DeeplineClient = class _DeeplineClient {
3527
3625
  return this.executeTool(toolId, input, options);
3528
3626
  }
3529
3627
  async queryDb(input) {
3530
- const result = await this.http.post(
3531
- "/api/v2/db/query",
3532
- {
3533
- sql: input.sql,
3534
- ...input.maxRows ? { max_rows: input.maxRows } : {}
3535
- }
3536
- );
3537
- return {
3538
- ...result,
3539
- scope: { kind: "database", mutability: "current" }
3540
- };
3628
+ return queryCustomerDatabase(this.http, input);
3541
3629
  }
3542
3630
  /**
3543
3631
  * Run a bounded SQL query against the current mutable customer database.
@@ -3651,7 +3739,7 @@ var DeeplineClient = class _DeeplineClient {
3651
3739
  artifact: input.artifact
3652
3740
  });
3653
3741
  return this.http.post(
3654
- "/api/v2/plays/artifacts",
3742
+ input.artifactOnly === true ? "/api/v2/plays/artifacts/immutable" : "/api/v2/plays/artifacts",
3655
3743
  {
3656
3744
  ...input,
3657
3745
  compilerManifest
@@ -6384,6 +6472,8 @@ export {
6384
6472
  CSV_HEADER_MATCHING_NOTE,
6385
6473
  iterateCursorPages,
6386
6474
  playInputExampleArgs,
6475
+ planCustomerDbQuery,
6476
+ validateExecutionIdempotencyKey,
6387
6477
  PRODUCT_NOTIFICATION_EVENT_CATALOG,
6388
6478
  resolveLegacySlackNotification,
6389
6479
  RUN_EVENT_SEARCH_KIND_VALUES,
@@ -1,17 +1,17 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
3
 
4
- var _chunk2UQUOUAWjs = require('./chunk-2UQUOUAW.js');
4
+ var _chunkMDQZQ3NYjs = require('./chunk-MDQZQ3NY.js');
5
5
 
6
6
 
7
7
 
8
- var _chunkGMO3NBE2js = require('./chunk-GMO3NBE2.js');
8
+ var _chunkEMZ7Y5SWjs = require('./chunk-EMZ7Y5SW.js');
9
9
 
10
10
 
11
- var _chunkGROXVGGWjs = require('./chunk-GROXVGGW.js');
11
+ var _chunkCUUHQ3AOjs = require('./chunk-CUUHQ3AO.js');
12
12
 
13
13
 
14
- var _chunkD5YJHGSTjs = require('./chunk-D5YJHGST.js');
14
+ var _chunkTXVOB5J2js = require('./chunk-TXVOB5J2.js');
15
15
 
16
16
  // src/cli/commands/update.ts
17
17
  var _child_process = require('child_process');
@@ -306,21 +306,6 @@ function shouldRunCliAutoUpdate(homeDir = _os.homedir.call(void 0, )) {
306
306
  const preferences = readCliUpdatePreferences(homeDir);
307
307
  return preferences.autoUpdateEnabled && preferences.pinnedVersion === null;
308
308
  }
309
- function consumePendingCliUpdateMessages(homeDir = _os.homedir.call(void 0, )) {
310
- const preferences = readCliUpdatePreferences(homeDir);
311
- const acknowledged = new Set(preferences.acknowledgedMessages);
312
- const pending = CLI_UPDATE_MESSAGES.filter(({ id }) => !acknowledged.has(id));
313
- if (pending.length === 0) return [];
314
- for (const { id } of pending) acknowledged.add(id);
315
- try {
316
- writeCliUpdatePreferences(
317
- { ...preferences, acknowledgedMessages: [...acknowledged] },
318
- homeDir
319
- );
320
- } catch (e2) {
321
- }
322
- return pending.map(({ message }) => message);
323
- }
324
309
 
325
310
  // src/cli/commands/update.ts
326
311
  function canAutomaticallyApplyUpdatePlan(plan) {
@@ -380,7 +365,7 @@ function sidecarRegistryUrl(hostUrl) {
380
365
  let url;
381
366
  try {
382
367
  url = new URL(hostUrl);
383
- } catch (e3) {
368
+ } catch (e2) {
384
369
  throw new Error(
385
370
  "The Python-managed SDK sidecar is missing a valid Deepline host URL for its npm registry."
386
371
  );
@@ -395,14 +380,14 @@ function sidecarRegistryUrl(hostUrl) {
395
380
  function publicNpmFallbackRegistryUrl(hostUrl) {
396
381
  try {
397
382
  return sidecarRegistryUrl(hostUrl);
398
- } catch (e4) {
383
+ } catch (e3) {
399
384
  return void 0;
400
385
  }
401
386
  }
402
387
  function readOptionalText(path) {
403
388
  try {
404
389
  return _fs.readFileSync.call(void 0, path, "utf8").trim();
405
- } catch (e5) {
390
+ } catch (e4) {
406
391
  return "";
407
392
  }
408
393
  }
@@ -463,7 +448,7 @@ function inferNpmGlobalPrefixFromEntrypoint(entrypoint, env) {
463
448
  const normalized = (() => {
464
449
  try {
465
450
  return _fs.realpathSync.call(void 0, entrypoint);
466
- } catch (e6) {
451
+ } catch (e5) {
467
452
  return _path.resolve.call(void 0, entrypoint);
468
453
  }
469
454
  })();
@@ -496,7 +481,7 @@ function normalizedNpmPrefix(value) {
496
481
  const normalized = (() => {
497
482
  try {
498
483
  return _fs.realpathSync.call(void 0, _path.resolve.call(void 0, trimmed));
499
- } catch (e7) {
484
+ } catch (e6) {
500
485
  return _path.resolve.call(void 0, trimmed);
501
486
  }
502
487
  })().replace(/\\/g, "/");
@@ -504,7 +489,7 @@ function normalizedNpmPrefix(value) {
504
489
  }
505
490
  function resolveNpmGlobalPrefix(env) {
506
491
  try {
507
- const plan = _chunkGMO3NBE2js.resolveShellSpawn.call(void 0, "npm", ["prefix", "-g"], process.platform, env);
492
+ const plan = _chunkEMZ7Y5SWjs.resolveShellSpawn.call(void 0, "npm", ["prefix", "-g"], process.platform, env);
508
493
  const result = _child_process.spawnSync.call(void 0, plan.command, plan.args, {
509
494
  encoding: "utf8",
510
495
  env,
@@ -513,7 +498,7 @@ function resolveNpmGlobalPrefix(env) {
513
498
  });
514
499
  if (result.status !== 0) return null;
515
500
  return String(_nullishCoalesce(result.stdout, () => ( ""))).trim() || null;
516
- } catch (e8) {
501
+ } catch (e7) {
517
502
  return null;
518
503
  }
519
504
  }
@@ -521,7 +506,7 @@ function isHomebrewFormulaEntrypoint(entrypoint) {
521
506
  const normalized = (() => {
522
507
  try {
523
508
  return _fs.realpathSync.call(void 0, entrypoint);
524
- } catch (e9) {
509
+ } catch (e8) {
525
510
  return _path.resolve.call(void 0, entrypoint);
526
511
  }
527
512
  })();
@@ -560,8 +545,8 @@ function resolveUpdatePlan(options = {}) {
560
545
  const npmGlobalPrefix = options.npmGlobalPrefix !== void 0 ? options.npmGlobalPrefix : resolveNpmGlobalPrefix(env);
561
546
  const hasVerifiedNpmOwnership = inferredInstallPrefix !== null && normalizedNpmPrefix(inferredInstallPrefix) === normalizedNpmPrefix(npmGlobalPrefix);
562
547
  const installPrefix = options.requireVerifiedNpmOwnership ? hasVerifiedNpmOwnership ? inferredInstallPrefix : null : inferredInstallPrefix;
563
- const npmVersion = options.npmVersion === void 0 ? _chunk2UQUOUAWjs.readNpmVersion.call(void 0, env) : options.npmVersion;
564
- const npmGlobalInstallFlags = _chunk2UQUOUAWjs.npmSupportsAllowScripts.call(void 0, npmVersion) ? [...NPM_SDK_INSTALL_COMMON_FLAGS, "--allow-scripts=esbuild"] : NPM_SDK_INSTALL_COMMON_FLAGS;
548
+ const npmVersion = options.npmVersion === void 0 ? _chunkMDQZQ3NYjs.readNpmVersion.call(void 0, env) : options.npmVersion;
549
+ const npmGlobalInstallFlags = _chunkMDQZQ3NYjs.npmSupportsAllowScripts.call(void 0, npmVersion) ? [...NPM_SDK_INSTALL_COMMON_FLAGS, "--allow-scripts=esbuild"] : NPM_SDK_INSTALL_COMMON_FLAGS;
565
550
  const args = installPrefix ? [
566
551
  "install",
567
552
  "-g",
@@ -571,7 +556,7 @@ function resolveUpdatePlan(options = {}) {
571
556
  packageSpec
572
557
  ] : ["install", "-g", ...npmGlobalInstallFlags, packageSpec];
573
558
  const fallbackRegistryUrl = options.npmFallbackRegistryUrl !== void 0 ? options.npmFallbackRegistryUrl : publicNpmFallbackRegistryUrl(
574
- _optionalChain([env, 'access', _18 => _18.DEEPLINE_HOST_URL, 'optionalAccess', _19 => _19.trim, 'call', _20 => _20()]) || _chunkD5YJHGSTjs.autoDetectBaseUrl.call(void 0, )
559
+ _optionalChain([env, 'access', _18 => _18.DEEPLINE_HOST_URL, 'optionalAccess', _19 => _19.trim, 'call', _20 => _20()]) || _chunkTXVOB5J2js.autoDetectBaseUrl.call(void 0, )
575
560
  );
576
561
  return {
577
562
  kind: "npm-global",
@@ -611,7 +596,7 @@ function readAutoUpdateFailure(plan) {
611
596
  if ((parsed.kind === "npm-global" || parsed.kind === "python-sidecar") && typeof parsed.packageSpec === "string" && typeof parsed.failedAt === "string" && typeof parsed.exitCode === "number" && typeof parsed.manualCommand === "string") {
612
597
  return parsed;
613
598
  }
614
- } catch (e10) {
599
+ } catch (e9) {
615
600
  return null;
616
601
  }
617
602
  return null;
@@ -630,7 +615,7 @@ function writeAutoUpdateFailure(plan, exitCode) {
630
615
  _fs.mkdirSync.call(void 0, _path.dirname.call(void 0, path), { recursive: true });
631
616
  _fs.writeFileSync.call(void 0, path, `${JSON.stringify(marker, null, 2)}
632
617
  `, "utf8");
633
- } catch (e11) {
618
+ } catch (e10) {
634
619
  }
635
620
  }
636
621
  function clearAutoUpdateFailure(plan) {
@@ -638,7 +623,7 @@ function clearAutoUpdateFailure(plan) {
638
623
  if (!path) return;
639
624
  try {
640
625
  _fs.unlinkSync.call(void 0, path);
641
- } catch (e12) {
626
+ } catch (e11) {
642
627
  }
643
628
  }
644
629
  function matchingAutoUpdateFailure(plan) {
@@ -694,7 +679,7 @@ function installedPackageVersion(versionDir) {
694
679
  try {
695
680
  const parsed = JSON.parse(_fs.readFileSync.call(void 0, packageJsonPath, "utf8"));
696
681
  return typeof parsed.version === "string" ? safeVersionSegment(parsed.version) : "";
697
- } catch (e13) {
682
+ } catch (e12) {
698
683
  return "";
699
684
  }
700
685
  }
@@ -718,7 +703,7 @@ function sidecarInstallFailure(versionDir) {
718
703
  function runCommand(command, args, env = process.env) {
719
704
  return new Promise((resolveResult) => {
720
705
  let output = "";
721
- const plan = _chunkGMO3NBE2js.resolveShellSpawn.call(void 0, command, args, process.platform, env);
706
+ const plan = _chunkEMZ7Y5SWjs.resolveShellSpawn.call(void 0, command, args, process.platform, env);
722
707
  const child = _child_process.spawn.call(void 0, plan.command, plan.args, {
723
708
  stdio: ["inherit", "pipe", "pipe"],
724
709
  shell: plan.shell,
@@ -748,7 +733,7 @@ function isRegistryAccessFailure(output, registryUrl) {
748
733
  let registryHost = "";
749
734
  try {
750
735
  registryHost = new URL(registryUrl).hostname;
751
- } catch (e14) {
736
+ } catch (e13) {
752
737
  return false;
753
738
  }
754
739
  if (!registryHost || !output.toLowerCase().includes(registryHost.toLowerCase())) {
@@ -983,7 +968,7 @@ async function runPythonSidecarUpdatePlan(plan) {
983
968
  try {
984
969
  _fs.renameSync.call(void 0, backupDir, finalDir);
985
970
  backupDir = null;
986
- } catch (e15) {
971
+ } catch (e14) {
987
972
  }
988
973
  }
989
974
  process.stderr.write(
@@ -1094,14 +1079,14 @@ async function publishedVersionSupportsPin(version, fallbackRegistryUrl) {
1094
1079
  throw _nullishCoalesce(lastError, () => ( new Error("No npm registry was available")));
1095
1080
  }
1096
1081
  async function runUpdateCommand(options, dependencies = {}) {
1097
- const detectBaseUrl = _nullishCoalesce(dependencies.detectBaseUrl, () => ( _chunkD5YJHGSTjs.autoDetectBaseUrl));
1082
+ const detectBaseUrl = _nullishCoalesce(dependencies.detectBaseUrl, () => ( _chunkTXVOB5J2js.autoDetectBaseUrl));
1098
1083
  const resolvePlan = _nullishCoalesce(dependencies.resolvePlan, () => ( resolveUpdatePlan));
1099
1084
  const runPlan = _nullishCoalesce(dependencies.runPlan, () => ( runUpdatePlan));
1100
1085
  const syncSkills = _nullishCoalesce(dependencies.syncSkillsIfNeeded, () => ( (async () => {
1101
1086
  const originalWrite = process.stdout.write.bind(process.stdout);
1102
1087
  process.stdout.write = (() => true);
1103
1088
  try {
1104
- const exitCode = await _chunkGMO3NBE2js.runSkillsCommand.call(void 0, { json: true });
1089
+ const exitCode = await _chunkEMZ7Y5SWjs.runSkillsCommand.call(void 0, { json: true });
1105
1090
  if (exitCode !== 0) {
1106
1091
  throw new Error(
1107
1092
  `Deepline skills update failed with exit ${exitCode}.`
@@ -1172,11 +1157,11 @@ async function runUpdateCommand(options, dependencies = {}) {
1172
1157
  ]
1173
1158
  };
1174
1159
  if (options.json && !options.executeWithJson) {
1175
- _chunkGROXVGGWjs.printCommandEnvelope.call(void 0, { ...plan, render }, { json: true });
1160
+ _chunkCUUHQ3AOjs.printCommandEnvelope.call(void 0, { ...plan, render }, { json: true });
1176
1161
  return 0;
1177
1162
  }
1178
1163
  if (options.printCommand) {
1179
- _chunkGROXVGGWjs.printCommandEnvelope.call(void 0,
1164
+ _chunkCUUHQ3AOjs.printCommandEnvelope.call(void 0,
1180
1165
  {
1181
1166
  ...plan,
1182
1167
  render: {
@@ -1189,7 +1174,7 @@ async function runUpdateCommand(options, dependencies = {}) {
1189
1174
  return 0;
1190
1175
  }
1191
1176
  if (plan.kind === "source" || plan.kind === "homebrew") {
1192
- _chunkGROXVGGWjs.printCommandEnvelope.call(void 0, { ...plan, render }, { json: false });
1177
+ _chunkCUUHQ3AOjs.printCommandEnvelope.call(void 0, { ...plan, render }, { json: false });
1193
1178
  return 0;
1194
1179
  }
1195
1180
  stderr.write(`Updating Deepline SDK/CLI with: ${plan.manualCommand}
@@ -1219,7 +1204,7 @@ To retry with full installer output, run: deepline skills --json
1219
1204
  );
1220
1205
  }
1221
1206
  if (options.executeWithJson && options.json) {
1222
- _chunkGROXVGGWjs.printCommandEnvelope.call(void 0,
1207
+ _chunkCUUHQ3AOjs.printCommandEnvelope.call(void 0,
1223
1208
  {
1224
1209
  ok: true,
1225
1210
  pinnedVersion
@@ -1265,5 +1250,4 @@ Examples:
1265
1250
 
1266
1251
 
1267
1252
 
1268
-
1269
- exports.readCliUpdatePreferences = readCliUpdatePreferences; exports.setCliAutoUpdateEnabled = setCliAutoUpdateEnabled; exports.shouldRunCliAutoUpdate = shouldRunCliAutoUpdate; exports.consumePendingCliUpdateMessages = consumePendingCliUpdateMessages; exports.canAutomaticallyApplyUpdatePlan = canAutomaticallyApplyUpdatePlan; exports.resolveUpdatePlan = resolveUpdatePlan; exports.runAutomaticUpdatePlan = runAutomaticUpdatePlan; exports.runUpdatePlan = runUpdatePlan; exports.publishedVersionSupportsPin = publishedVersionSupportsPin; exports.runUpdateCommand = runUpdateCommand; exports.registerUpdateCommand = registerUpdateCommand;
1253
+ exports.readCliUpdatePreferences = readCliUpdatePreferences; exports.setCliAutoUpdateEnabled = setCliAutoUpdateEnabled; exports.shouldRunCliAutoUpdate = shouldRunCliAutoUpdate; exports.canAutomaticallyApplyUpdatePlan = canAutomaticallyApplyUpdatePlan; exports.resolveUpdatePlan = resolveUpdatePlan; exports.runAutomaticUpdatePlan = runAutomaticUpdatePlan; exports.runUpdatePlan = runUpdatePlan; exports.publishedVersionSupportsPin = publishedVersionSupportsPin; exports.runUpdateCommand = runUpdateCommand; exports.registerUpdateCommand = registerUpdateCommand;