deepline 0.3.325 → 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.
- package/dist/bundling-sources/sdk/src/client.ts +23 -25
- package/dist/bundling-sources/sdk/src/compat.ts +11 -6
- package/dist/bundling-sources/sdk/src/db/query.ts +172 -0
- package/dist/bundling-sources/sdk/src/errors.ts +35 -0
- package/dist/bundling-sources/sdk/src/index.ts +13 -0
- package/dist/bundling-sources/sdk/src/play.ts +34 -31
- package/dist/bundling-sources/sdk/src/plays/authoring-graph-path.ts +13 -0
- package/dist/bundling-sources/sdk/src/plays/bundle-play-file.ts +2 -1
- package/dist/bundling-sources/sdk/src/plays/local-play-execution.ts +189 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/tool-calls.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +84 -10
- package/dist/cli/auth-6STWK6UK.js +31 -0
- package/dist/cli/{auth-PIZESRPC.mjs → auth-VON5FFUK.mjs} +4 -4
- package/dist/cli/{billing-HSL6VTCM.mjs → billing-X6JUEFRE.mjs} +4 -4
- package/dist/cli/{billing-DQKFCQV5.js → billing-YI4RZI2O.js} +70 -70
- package/dist/cli/{chunk-UYFWTIKF.js → chunk-3NGWGFVL.js} +26 -26
- package/dist/cli/{chunk-PWV2M4LW.mjs → chunk-4AB4Y6FF.mjs} +1 -1
- package/dist/cli/{chunk-DLW7X2UK.js → chunk-4LNBSQM4.js} +5928 -5730
- package/dist/cli/{chunk-OOPSX57I.js → chunk-5NXHSRRE.js} +6 -6
- package/dist/cli/{chunk-XNL3SEMC.js → chunk-AFNEQ43J.js} +8 -3
- package/dist/cli/{chunk-XSEMQ4II.js → chunk-AGH6YP2T.js} +2 -1
- package/dist/cli/chunk-AID3OYVJ.js +8 -0
- package/dist/cli/{chunk-NWBARG3F.mjs → chunk-BQJVMKWL.mjs} +1 -1
- package/dist/cli/{chunk-YE3O2UHM.mjs → chunk-BR7GGTAE.mjs} +24 -1
- package/dist/cli/{chunk-K7FC5IUU.js → chunk-BUYZEUY4.js} +1 -1
- package/dist/cli/{chunk-QQ2FG5W3.js → chunk-CUUHQ3AO.js} +6 -6
- package/dist/cli/{chunk-H5TJBRSC.mjs → chunk-DFDXKOLR.mjs} +98 -113
- package/dist/cli/{chunk-HPTQEWCF.js → chunk-EMZ7Y5SW.js} +70 -67
- package/dist/cli/chunk-GVESPYSY.mjs +234 -0
- package/dist/cli/{chunk-MNKDSR2J.js → chunk-GVYKY6T6.js} +344 -254
- package/dist/cli/{chunk-6RMKHN7S.mjs → chunk-IQCCGOQH.mjs} +4 -20
- package/dist/cli/{chunk-76VKBPOC.mjs → chunk-JOA6IKDE.mjs} +7 -2
- package/dist/cli/{chunk-XIVUB36F.mjs → chunk-KLWBAQ5A.mjs} +104 -14
- package/dist/cli/{chunk-CV5GDCKN.js → chunk-KZ4PCK4O.js} +29 -45
- package/dist/cli/chunk-LVEDPCLJ.js +234 -0
- package/dist/cli/{chunk-AQUNQJ5Y.mjs → chunk-M7CPVMDB.mjs} +1 -1
- package/dist/cli/{chunk-HUKWYHBG.js → chunk-MDQZQ3NY.js} +2 -2
- package/dist/cli/{chunk-PBNZXZCW.js → chunk-MKHSZA2X.js} +48 -48
- package/dist/cli/{chunk-5TYU3UIS.mjs → chunk-MOBZS4F3.mjs} +1 -1
- package/dist/cli/chunk-OVDNJAJN.mjs +8 -0
- package/dist/cli/{chunk-KZNFYOHX.js → chunk-T33W6JUJ.js} +6 -6
- package/dist/cli/{chunk-6VZDSBK6.mjs → chunk-TDSNAC3C.mjs} +2 -2
- package/dist/cli/{chunk-PVDQ55PS.js → chunk-TXVOB5J2.js} +29 -6
- package/dist/cli/{chunk-YXRPWMGN.js → chunk-TZQMFWLF.js} +147 -162
- package/dist/cli/{chunk-OPERWJR6.mjs → chunk-VGKVLADU.mjs} +3 -3
- package/dist/cli/{chunk-7MD453WV.mjs → chunk-VKXGOQG5.mjs} +5674 -5476
- package/dist/cli/{chunk-WW4XZIVM.mjs → chunk-W74E5ETE.mjs} +12 -9
- package/dist/cli/{chunk-7PZFGB7L.mjs → chunk-YIY74KUF.mjs} +2 -1
- package/dist/cli/{chunk-5FHU7TV4.mjs → chunk-ZRN6YOF2.mjs} +2 -2
- package/dist/cli/client-TEBW2P24.js +20 -0
- package/dist/cli/{client-57SR4KVM.mjs → client-ZMOKUNL2.mjs} +3 -3
- package/dist/cli/{csv-5DJSC6BD.js → csv-HZRKEI7J.js} +12 -12
- package/dist/cli/{csv-G2FRMOXL.mjs → csv-IICJHJZ4.mjs} +3 -3
- package/dist/cli/{db-NVO7P4VO.js → db-TM5NZF73.js} +226 -149
- package/dist/cli/{db-WWZEXM3N.mjs → db-X4B7YFNY.mjs} +214 -137
- package/dist/cli/{describe-M26LHDBQ.js → describe-BDBARWZJ.js} +28 -27
- package/dist/cli/{describe-26OMF3A4.mjs → describe-GMVS3LFC.mjs} +12 -11
- package/dist/cli/{executions-2LLHY3IL.mjs → executions-447ZJMN4.mjs} +4 -4
- package/dist/cli/{executions-KI47LPKE.js → executions-QX25UOQM.js} +6 -6
- package/dist/cli/{feedback-2Y26C2BZ.js → feedback-4IXUTBX7.js} +6 -6
- package/dist/cli/{feedback-O26VL2OF.mjs → feedback-JB7HHIC6.mjs} +3 -3
- package/dist/cli/git-C7C7DTEH.js +23 -0
- package/dist/cli/{git-UVPGZN3K.mjs → git-VID6KGAA.mjs} +4 -4
- package/dist/cli/index.js +105 -87
- package/dist/cli/index.mjs +65 -47
- package/dist/cli/{legacy-noops-H6Y3SEVB.js → legacy-noops-3FYTCOZO.js} +7 -7
- package/dist/cli/{legacy-noops-IK5CH72U.mjs → legacy-noops-SGR3G5WS.mjs} +4 -4
- package/dist/cli/{monitors-SFVVMAJT.mjs → monitors-SH4FOMBM.mjs} +4 -4
- package/dist/cli/{monitors-JL6TTQCI.js → monitors-SP52UHS4.js} +85 -85
- package/dist/cli/{org-SSDONL57.mjs → org-B32MMIQT.mjs} +4 -4
- package/dist/cli/{org-OVMAZCQS.js → org-UQMX7JOR.js} +60 -60
- package/dist/cli/play-UCIWBN7U.js +153 -0
- package/dist/cli/{play-X6NPACUO.mjs → play-XTE4LUP7.mjs} +11 -10
- package/dist/cli/{providers-E24JDWSR.js → providers-JNMJJ2OH.js} +7 -7
- package/dist/cli/{providers-ONUBYYY4.mjs → providers-RWLN6FUR.mjs} +4 -4
- package/dist/cli/{quickstart-TB7C3DLG.js → quickstart-HK6WZ342.js} +5 -5
- package/dist/cli/{quickstart-B7NIXACV.mjs → quickstart-IDB3Y375.mjs} +3 -3
- package/dist/cli/{search-N3QUIATW.mjs → search-6D3IFNPT.mjs} +5 -5
- package/dist/cli/search-LUZ2S7DH.js +26 -0
- package/dist/cli/{secrets-CPCVFDYB.js → secrets-JOQB57IE.js} +13 -13
- package/dist/cli/{secrets-V7Z4M67T.mjs → secrets-TZ53CQ3D.mjs} +4 -4
- package/dist/cli/{sessions-PDOBKAKO.mjs → sessions-4MBDC4EK.mjs} +4 -4
- package/dist/cli/{sessions-E4FIZLQP.js → sessions-QSAICDXX.js} +5 -5
- package/dist/cli/{settings-UVM2WDE4.js → settings-OTOCW7L7.js} +74 -74
- package/dist/cli/{settings-QYHYHZDI.mjs → settings-RKQFMLDU.mjs} +7 -7
- package/dist/cli/{setup-4RLAETDW.mjs → setup-2S5TNTUB.mjs} +6 -6
- package/dist/cli/{setup-3JFAXQLJ.js → setup-AKZUDVYY.js} +41 -41
- package/dist/cli/skills-26LASHZF.js +28 -0
- package/dist/cli/{skills-ZX2JSWOZ.mjs → skills-AGZXDLSA.mjs} +4 -4
- package/dist/cli/{tools-EGXCVIPJ.mjs → tools-7Y6RD6FY.mjs} +8 -7
- package/dist/cli/tools-L5VIJQWX.js +39 -0
- package/dist/cli/{update-7FEKRQFE.mjs → update-M7YGF67I.mjs} +6 -6
- package/dist/cli/update-MNHF6M2F.js +28 -0
- package/dist/cli/{workflow-7V7TTTKK.mjs → workflow-CTVE7S7W.mjs} +5 -5
- package/dist/cli/{workflow-54VCKIG2.js → workflow-NGMY425T.js} +15 -15
- package/dist/{client-Bb4Jjzmj.d.ts → client-DHq8dJ56.d.ts} +39 -11
- package/dist/{client-COa-3GHK.d.mts → client-wiWPZhnI.d.mts} +39 -11
- package/dist/{compiler-manifest-CsnWj-AK.d.mts → compiler-manifest-9TkZ_ykI.d.mts} +711 -711
- package/dist/{compiler-manifest-CsnWj-AK.d.ts → compiler-manifest-9TkZ_ykI.d.ts} +711 -711
- package/dist/index-B-5_Xhud.d.mts +75 -0
- package/dist/index-ykksoEyR.d.ts +75 -0
- package/dist/index.d.mts +52 -13
- package/dist/index.d.ts +52 -13
- package/dist/index.js +92 -28
- package/dist/index.mjs +91 -27
- package/dist/install-integrity.json +91 -84
- package/dist/plays/bundle-play-file.d.mts +7 -75
- package/dist/plays/bundle-play-file.d.ts +7 -75
- package/dist/plays/bundle-play-file.mjs +1 -1
- package/dist/plays/run-request.d.mts +2 -2
- package/dist/plays/run-request.d.ts +2 -2
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/package.json +1 -1
- package/dist/cli/auth-RXCD4GOV.js +0 -31
- package/dist/cli/chunk-OWJZUE3Y.mjs +0 -103
- package/dist/cli/chunk-SDK3ZA2C.js +0 -103
- package/dist/cli/client-562MULXK.js +0 -20
- package/dist/cli/git-KGPX5YPD.js +0 -23
- package/dist/cli/play-3DB4MSHN.js +0 -152
- package/dist/cli/search-NJ637YGQ.js +0 -26
- package/dist/cli/skills-BYRYG64R.js +0 -28
- package/dist/cli/tools-TAWOAY5X.js +0 -38
- package/dist/cli/update-H24GEBXM.js +0 -28
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
npmSupportsAllowScripts,
|
|
3
3
|
readNpmVersion
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4AB4Y6FF.mjs";
|
|
5
5
|
import {
|
|
6
6
|
resolveShellSpawn,
|
|
7
7
|
runSkillsCommand
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-W74E5ETE.mjs";
|
|
9
9
|
import {
|
|
10
10
|
printCommandEnvelope
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-M7CPVMDB.mjs";
|
|
12
12
|
import {
|
|
13
13
|
autoDetectBaseUrl
|
|
14
|
-
} from "./chunk-
|
|
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
|
|
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
|
|
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-
|
|
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
|
-
|
|
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
|
|
4
|
+
var _chunkMDQZQ3NYjs = require('./chunk-MDQZQ3NY.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkEMZ7Y5SWjs = require('./chunk-EMZ7Y5SW.js');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkCUUHQ3AOjs = require('./chunk-CUUHQ3AO.js');
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
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 (
|
|
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 (
|
|
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 (
|
|
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 (
|
|
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 (
|
|
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 =
|
|
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 (
|
|
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 (
|
|
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 ?
|
|
564
|
-
const npmGlobalInstallFlags =
|
|
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()]) ||
|
|
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 (
|
|
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 (
|
|
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 (
|
|
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 (
|
|
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 =
|
|
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 (
|
|
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 (
|
|
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, () => (
|
|
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
|
|
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
|
-
|
|
1160
|
+
_chunkCUUHQ3AOjs.printCommandEnvelope.call(void 0, { ...plan, render }, { json: true });
|
|
1176
1161
|
return 0;
|
|
1177
1162
|
}
|
|
1178
1163
|
if (options.printCommand) {
|
|
1179
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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;
|