deepline 0.3.293 → 0.3.295
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/compat.ts +35 -7
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-pool.ts +269 -267
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +3 -4
- package/dist/bundling-sources/shared_libs/play-runtime/tool-http-errors.ts +14 -1
- package/dist/cli/auth-EDTRERZP.mjs +31 -0
- package/dist/cli/auth-TDHKB277.js +31 -0
- package/dist/cli/billing-ELIDPILY.js +1749 -0
- package/dist/cli/billing-EXGXJVAU.mjs +1749 -0
- package/dist/cli/chunk-2S5Y3TZP.js +5688 -0
- package/dist/cli/chunk-3KC45UVF.js +150 -0
- package/dist/cli/chunk-3XX5TEA4.js +15 -0
- package/dist/cli/chunk-4MBOJQPL.mjs +0 -0
- package/dist/cli/chunk-4NEFYBF7.js +2240 -0
- package/dist/cli/chunk-5JLQPVNX.js +3056 -0
- package/dist/cli/chunk-5KDKFHZI.js +1269 -0
- package/dist/cli/chunk-6A3TJUWC.js +76 -0
- package/dist/cli/chunk-6O5YZOVN.mjs +890 -0
- package/dist/cli/chunk-7P5AA3SN.js +344 -0
- package/dist/cli/chunk-AYHLUHE5.js +52 -0
- package/dist/cli/chunk-CBVIJSHF.mjs +560 -0
- package/dist/cli/chunk-CFVVCN4A.js +735 -0
- package/dist/cli/chunk-COGTRVWW.js +30 -0
- package/dist/cli/chunk-D4AZUZO4.js +190 -0
- package/dist/cli/chunk-DLIRSHV6.mjs +28 -0
- package/dist/cli/chunk-EACVZI6N.mjs +1995 -0
- package/dist/cli/chunk-EDWJY6T4.mjs +3056 -0
- package/dist/cli/chunk-EXMLR72R.mjs +0 -0
- package/dist/cli/chunk-F35VOIQL.js +890 -0
- package/dist/cli/chunk-GAMFK2ZP.mjs +148 -0
- package/dist/cli/chunk-GHRQQPW2.mjs +2240 -0
- package/dist/cli/chunk-GONRLVV3.js +3440 -0
- package/dist/cli/chunk-GVUJJJ5G.mjs +76 -0
- package/dist/cli/chunk-H7HIDGZ7.mjs +150 -0
- package/dist/cli/chunk-HUZXWOSK.mjs +503 -0
- package/dist/cli/chunk-I5YZLGMG.js +1 -0
- package/dist/cli/chunk-ITOFSXIU.mjs +15 -0
- package/dist/cli/chunk-J5NA2TTX.js +503 -0
- package/dist/cli/chunk-JCS5TPNY.mjs +3440 -0
- package/dist/cli/chunk-JNNOCMQY.js +47 -0
- package/dist/cli/chunk-KRD6H754.mjs +30 -0
- package/dist/cli/chunk-LA46MMTL.js +560 -0
- package/dist/cli/chunk-LDWT7RJK.mjs +190 -0
- package/dist/cli/chunk-M2V26OR5.js +499 -0
- package/dist/cli/chunk-MIMASXO4.mjs +389 -0
- package/dist/cli/chunk-MROPCKW2.mjs +190 -0
- package/dist/cli/chunk-NXDRDJ4K.js +389 -0
- package/dist/cli/chunk-NXGCO4JB.mjs +344 -0
- package/dist/cli/chunk-OG64RBAC.js +6 -0
- package/dist/cli/chunk-OQYEC4GL.mjs +34 -0
- package/dist/cli/chunk-OWJZUE3Y.mjs +103 -0
- package/dist/cli/chunk-SDK3ZA2C.js +103 -0
- package/dist/cli/chunk-SFLARO4Y.mjs +47 -0
- package/dist/cli/chunk-SVIIIYIQ.js +923 -0
- package/dist/cli/chunk-TAC3JIFE.mjs +354 -0
- package/dist/cli/chunk-U3PI7HBM.js +34 -0
- package/dist/cli/chunk-UFS752TU.mjs +52 -0
- package/dist/cli/chunk-UI37DQE7.mjs +499 -0
- package/dist/cli/chunk-UNEMDKXN.js +1 -0
- package/dist/cli/chunk-WB6Z2Q44.mjs +1622 -0
- package/dist/cli/chunk-WJYPBHTE.js +148 -0
- package/dist/cli/chunk-WOHBA5PV.js +354 -0
- package/dist/cli/chunk-WQICC2B3.js +190 -0
- package/dist/cli/chunk-WZYKRD7T.mjs +6 -0
- package/dist/cli/chunk-XL2FO6CW.mjs +5688 -0
- package/dist/cli/chunk-XNYIZMNQ.js +28 -0
- package/dist/cli/chunk-XRK2TZT5.js +1995 -0
- package/dist/cli/chunk-YJYPL5OK.mjs +1269 -0
- package/dist/cli/chunk-YWNDYCXR.mjs +735 -0
- package/dist/cli/chunk-YWWAF7KZ.mjs +923 -0
- package/dist/cli/chunk-ZDO3TO3M.js +1622 -0
- package/dist/cli/client-4JVOYVC5.js +20 -0
- package/dist/cli/client-EEN2IJN2.mjs +20 -0
- package/dist/cli/csv-BOHBEP2I.mjs +585 -0
- package/dist/cli/csv-S5NYRUEX.js +585 -0
- package/dist/cli/db-CLODWCOB.mjs +486 -0
- package/dist/cli/db-F6PKFOOV.js +486 -0
- package/dist/cli/executions-5TQAKLJU.js +28 -0
- package/dist/cli/executions-MAKW6QOY.mjs +28 -0
- package/dist/cli/feedback-GV4QJFEN.js +107 -0
- package/dist/cli/feedback-XY24TW7H.mjs +107 -0
- package/dist/cli/getting-started.js +18 -76
- package/dist/cli/getting-started.mjs +10 -37
- package/dist/cli/git-6S2C22T5.js +23 -0
- package/dist/cli/git-OZLBD5HH.mjs +23 -0
- package/dist/cli/index.js +291 -54294
- package/dist/cli/index.mjs +209 -54352
- package/dist/cli/legacy-noops-LLCGDPQE.js +157 -0
- package/dist/cli/legacy-noops-TYH3TW2D.mjs +157 -0
- package/dist/cli/monitors-CABMB4DW.js +3251 -0
- package/dist/cli/monitors-TTD55HMK.mjs +3251 -0
- package/dist/cli/org-MSF3RG76.js +849 -0
- package/dist/cli/org-SFJ77MWY.mjs +849 -0
- package/dist/cli/play-NXHJSCKL.mjs +18439 -0
- package/dist/cli/play-OKSFNNO4.js +18439 -0
- package/dist/cli/providers-QC2ERERL.js +95 -0
- package/dist/cli/providers-TIIAZEUA.mjs +95 -0
- package/dist/cli/proxy-env-EBANZHPV.js +161 -0
- package/dist/cli/proxy-env-M4ZHXHRL.mjs +161 -0
- package/dist/cli/quickstart-ICANHLMI.js +69 -0
- package/dist/cli/quickstart-KWUOP3FI.mjs +69 -0
- package/dist/cli/search-U5H2FDOO.mjs +18 -0
- package/dist/cli/search-XQRQOLWS.js +18 -0
- package/dist/cli/secrets-3J6YTWFA.mjs +400 -0
- package/dist/cli/secrets-YNMNZNOM.js +400 -0
- package/dist/cli/sessions-CLEES4L6.mjs +15 -0
- package/dist/cli/sessions-J6VR47FG.js +15 -0
- package/dist/cli/settings-EEKZMTY4.js +846 -0
- package/dist/cli/settings-UVLOQZRH.mjs +846 -0
- package/dist/cli/setup-DLMDXPGJ.mjs +1257 -0
- package/dist/cli/setup-HC4Q7QM4.js +1257 -0
- package/dist/cli/skills-33PHFBSB.mjs +28 -0
- package/dist/cli/skills-LFRY3KPX.js +28 -0
- package/dist/cli/tools-3COEPKML.mjs +2955 -0
- package/dist/cli/tools-QXEVCN45.js +2955 -0
- package/dist/cli/update-LSAC4FF5.mjs +28 -0
- package/dist/cli/update-NXHSPYXA.js +28 -0
- package/dist/cli/workflow-7S44OECF.mjs +1936 -0
- package/dist/cli/workflow-QPZWYSZE.js +1936 -0
- package/dist/helpers.js +6 -32
- package/dist/helpers.mjs +2 -0
- package/dist/index.js +1972 -12825
- package/dist/index.mjs +1910 -12672
- package/dist/install-integrity.json +110 -0
- package/dist/monitor-fleet-contract.js +31 -730
- package/dist/monitor-fleet-contract.mjs +18 -667
- package/dist/monitor-input-contract.js +10 -390
- package/dist/monitor-input-contract.mjs +7 -348
- package/dist/plays/bundle-play-file.mjs +13 -5178
- package/dist/plays/csv-data-input.js +5 -3132
- package/dist/plays/csv-data-input.mjs +5 -3105
- package/dist/plays/run-request.js +56 -664
- package/dist/plays/run-request.mjs +30 -588
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +5 -212
- package/dist/release.mjs +5 -185
- package/package.json +1 -1
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// ../plays/artifact-types.ts
|
|
2
|
+
var PLAY_ARTIFACT_KINDS = {
|
|
3
|
+
cjsNode20: "cjs_node20"
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
// ../play-runtime/backend.ts
|
|
7
|
+
var PLAY_RUNTIME_BACKENDS = {
|
|
8
|
+
localProcess: "local_process",
|
|
9
|
+
daytona: "daytona",
|
|
10
|
+
modal: "modal"
|
|
11
|
+
};
|
|
12
|
+
var PLAY_BACKEND_DESCRIPTORS = {
|
|
13
|
+
[PLAY_RUNTIME_BACKENDS.localProcess]: {
|
|
14
|
+
id: PLAY_RUNTIME_BACKENDS.localProcess,
|
|
15
|
+
artifactKind: PLAY_ARTIFACT_KINDS.cjsNode20,
|
|
16
|
+
label: "Local node subprocess"
|
|
17
|
+
},
|
|
18
|
+
[PLAY_RUNTIME_BACKENDS.daytona]: {
|
|
19
|
+
id: PLAY_RUNTIME_BACKENDS.daytona,
|
|
20
|
+
artifactKind: PLAY_ARTIFACT_KINDS.cjsNode20,
|
|
21
|
+
label: "Daytona sandbox"
|
|
22
|
+
},
|
|
23
|
+
[PLAY_RUNTIME_BACKENDS.modal]: {
|
|
24
|
+
id: PLAY_RUNTIME_BACKENDS.modal,
|
|
25
|
+
artifactKind: PLAY_ARTIFACT_KINDS.cjsNode20,
|
|
26
|
+
label: "Modal sandbox"
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// ../plays/tool-response-contract.ts
|
|
31
|
+
var RAW_V2_TOOL_RESPONSE_CONTRACT = "raw-v2";
|
|
32
|
+
var RAW_V2_TOOL_RESPONSE_RECEIPT_REVISION = "raw-v2-receipt-v1";
|
|
33
|
+
var TOOL_RESPONSE_RECEIPT_REVISION_PATTERN = /^[A-Za-z0-9](?:[A-Za-z0-9._-]{0,63})$/;
|
|
34
|
+
var InvalidToolResponseReceiptRevisionError = class extends Error {
|
|
35
|
+
constructor(value) {
|
|
36
|
+
super(
|
|
37
|
+
`Tool response receipt revision must be a non-empty static identifier (letters, numbers, '.', '_', or '-'); received ${String(value)}.`
|
|
38
|
+
);
|
|
39
|
+
this.name = "InvalidToolResponseReceiptRevisionError";
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
function normalizeToolResponseReceiptRevision(value) {
|
|
43
|
+
if (value == null) return void 0;
|
|
44
|
+
if (typeof value === "string" && TOOL_RESPONSE_RECEIPT_REVISION_PATTERN.test(value)) {
|
|
45
|
+
return value;
|
|
46
|
+
}
|
|
47
|
+
throw new InvalidToolResponseReceiptRevisionError(value);
|
|
48
|
+
}
|
|
49
|
+
function legacyRawFromToolResponseRawV2(rawV2, view, responseMeta) {
|
|
50
|
+
const legacyRaw = view === "data" && rawV2 && typeof rawV2 === "object" && !Array.isArray(rawV2) ? rawV2.data : rawV2;
|
|
51
|
+
const deeplineBilling = responseMeta?.deepline_billing;
|
|
52
|
+
if (view === "rawV2" && deeplineBilling !== void 0 && legacyRaw && typeof legacyRaw === "object" && !Array.isArray(legacyRaw)) {
|
|
53
|
+
return {
|
|
54
|
+
...legacyRaw,
|
|
55
|
+
deepline_billing: deeplineBilling
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
return legacyRaw;
|
|
59
|
+
}
|
|
60
|
+
function providerMetaFromToolResponseRawV2(rawV2, view) {
|
|
61
|
+
if (view !== "data" || !rawV2 || typeof rawV2 !== "object" || Array.isArray(rawV2)) {
|
|
62
|
+
return void 0;
|
|
63
|
+
}
|
|
64
|
+
const meta = rawV2.meta;
|
|
65
|
+
return meta && typeof meta === "object" && !Array.isArray(meta) ? meta : void 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export {
|
|
69
|
+
RAW_V2_TOOL_RESPONSE_CONTRACT,
|
|
70
|
+
RAW_V2_TOOL_RESPONSE_RECEIPT_REVISION,
|
|
71
|
+
normalizeToolResponseReceiptRevision,
|
|
72
|
+
legacyRawFromToolResponseRawV2,
|
|
73
|
+
providerMetaFromToolResponseRawV2,
|
|
74
|
+
PLAY_ARTIFACT_KINDS,
|
|
75
|
+
PLAY_RUNTIME_BACKENDS
|
|
76
|
+
};
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
// ../plays/secret-guardrails.ts
|
|
2
|
+
var SECRET_ENV_PATTERN = /\bprocess(?:\.env|\[['"]env['"]\])(?:\.|\[['"])([A-Z0-9_]*(?:API[_-]?KEY|TOKEN|SECRET|PASSWORD|PRIVATE[_-]?KEY|ACCESS[_-]?KEY)[A-Z0-9_]*)(?:['"]\])?/g;
|
|
3
|
+
var PRIVATE_KEY_PATTERN = /-----BEGIN (?:RSA |EC |OPENSSH |PGP )?PRIVATE KEY-----/;
|
|
4
|
+
var BEARER_LITERAL_PATTERN = /\bBearer\s+[A-Za-z0-9._~+/=-]{16,}/i;
|
|
5
|
+
var ASSIGNMENT_SECRET_LITERAL_PATTERN = /\b(?:api[_-]?key|token|secret|password)\b\s*[:=]\s*['"][^'"]{12,}['"]/i;
|
|
6
|
+
var SECRET_AUTH_LITERAL_FINDING = "literal credential passed to ctx.secrets auth helper";
|
|
7
|
+
function skipQuoted(source, start) {
|
|
8
|
+
const quote = source[start];
|
|
9
|
+
let index = start + 1;
|
|
10
|
+
while (index < source.length) {
|
|
11
|
+
if (source[index] === "\\") {
|
|
12
|
+
index += 2;
|
|
13
|
+
} else if (source[index] === quote) {
|
|
14
|
+
return index + 1;
|
|
15
|
+
} else {
|
|
16
|
+
index += 1;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return source.length;
|
|
20
|
+
}
|
|
21
|
+
function skipTrivia(source, start) {
|
|
22
|
+
let index = start;
|
|
23
|
+
while (index < source.length) {
|
|
24
|
+
if (/\s/.test(source[index])) {
|
|
25
|
+
index += 1;
|
|
26
|
+
} else if (source.startsWith("//", index)) {
|
|
27
|
+
index = source.indexOf("\n", index + 2);
|
|
28
|
+
if (index === -1) return source.length;
|
|
29
|
+
} else if (source.startsWith("/*", index)) {
|
|
30
|
+
index = source.indexOf("*/", index + 2);
|
|
31
|
+
if (index === -1) return source.length;
|
|
32
|
+
index += 2;
|
|
33
|
+
} else {
|
|
34
|
+
return index;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return index;
|
|
38
|
+
}
|
|
39
|
+
function consumeIdentifier(source, start, expected) {
|
|
40
|
+
return source.startsWith(expected, start) && !/[A-Za-z0-9_$]/.test(source[start - 1] ?? "") && !/[A-Za-z0-9_$]/.test(source[start + expected.length] ?? "") ? start + expected.length : void 0;
|
|
41
|
+
}
|
|
42
|
+
function consumeMember(source, start, expected) {
|
|
43
|
+
let index = skipTrivia(source, start);
|
|
44
|
+
if (source[index] === ".") {
|
|
45
|
+
return consumeIdentifier(source, skipTrivia(source, index + 1), expected);
|
|
46
|
+
}
|
|
47
|
+
if (source[index] !== "[") return void 0;
|
|
48
|
+
index = skipTrivia(source, index + 1);
|
|
49
|
+
if (source[index] !== "'" && source[index] !== '"') return void 0;
|
|
50
|
+
const end = skipQuoted(source, index);
|
|
51
|
+
if (source.slice(index + 1, end - 1) !== expected) return void 0;
|
|
52
|
+
index = skipTrivia(source, end);
|
|
53
|
+
return source[index] === "]" ? index + 1 : void 0;
|
|
54
|
+
}
|
|
55
|
+
function skipExpression(source, start) {
|
|
56
|
+
let index = start;
|
|
57
|
+
let depth = 0;
|
|
58
|
+
while (index < source.length) {
|
|
59
|
+
const char = source[index];
|
|
60
|
+
if (char === "'" || char === '"' || char === "`") {
|
|
61
|
+
index = skipQuoted(source, index);
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
if (source.startsWith("//", index) || source.startsWith("/*", index)) {
|
|
65
|
+
index = skipTrivia(source, index);
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
if (char === "(" || char === "[" || char === "{") {
|
|
69
|
+
depth += 1;
|
|
70
|
+
} else if (char === ")" || char === "]" || char === "}") {
|
|
71
|
+
if (depth === 0) return index;
|
|
72
|
+
depth -= 1;
|
|
73
|
+
} else if (char === "," && depth === 0) {
|
|
74
|
+
return index;
|
|
75
|
+
}
|
|
76
|
+
index += 1;
|
|
77
|
+
}
|
|
78
|
+
return index;
|
|
79
|
+
}
|
|
80
|
+
function isDirectStringLiteral(source, start) {
|
|
81
|
+
const quote = source[start];
|
|
82
|
+
if (quote !== "'" && quote !== '"' && quote !== "`") return false;
|
|
83
|
+
const end = skipQuoted(source, start);
|
|
84
|
+
return quote !== "`" || !source.slice(start, end).includes("${");
|
|
85
|
+
}
|
|
86
|
+
function hasLiteralSecretAuthCredential(source) {
|
|
87
|
+
for (let index = 0; index < source.length; index += 1) {
|
|
88
|
+
const char = source[index];
|
|
89
|
+
if (char === "'" || char === '"' || char === "`") {
|
|
90
|
+
index = skipQuoted(source, index) - 1;
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
if (source.startsWith("//", index) || source.startsWith("/*", index)) {
|
|
94
|
+
index = skipTrivia(source, index) - 1;
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
const afterCtx = consumeIdentifier(source, index, "ctx");
|
|
98
|
+
if (!afterCtx) continue;
|
|
99
|
+
const afterSecrets = consumeMember(source, afterCtx, "secrets");
|
|
100
|
+
if (!afterSecrets) continue;
|
|
101
|
+
const afterHeader = consumeMember(source, afterSecrets, "header");
|
|
102
|
+
const helper = afterHeader ? "header" : "bearer";
|
|
103
|
+
const afterHelper = afterHeader ?? consumeMember(source, afterSecrets, "bearer");
|
|
104
|
+
if (!afterHelper) continue;
|
|
105
|
+
const afterOpen = skipTrivia(source, afterHelper);
|
|
106
|
+
if (source[afterOpen] !== "(") continue;
|
|
107
|
+
const firstArgument = skipTrivia(source, afterOpen + 1);
|
|
108
|
+
const credential = helper === "header" ? skipTrivia(source, skipExpression(source, firstArgument) + 1) : firstArgument;
|
|
109
|
+
if (isDirectStringLiteral(source, credential)) return true;
|
|
110
|
+
}
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
function collectInlineSecretFindings(sourceCode) {
|
|
114
|
+
const findings = [];
|
|
115
|
+
for (const match of sourceCode.matchAll(SECRET_ENV_PATTERN)) {
|
|
116
|
+
findings.push(`process.env.${match[1]}`);
|
|
117
|
+
}
|
|
118
|
+
if (PRIVATE_KEY_PATTERN.test(sourceCode)) findings.push("private key block");
|
|
119
|
+
if (BEARER_LITERAL_PATTERN.test(sourceCode))
|
|
120
|
+
findings.push("bearer token literal");
|
|
121
|
+
if (ASSIGNMENT_SECRET_LITERAL_PATTERN.test(sourceCode)) {
|
|
122
|
+
findings.push("secret-looking assignment literal");
|
|
123
|
+
}
|
|
124
|
+
if (hasLiteralSecretAuthCredential(sourceCode)) {
|
|
125
|
+
findings.push(SECRET_AUTH_LITERAL_FINDING);
|
|
126
|
+
}
|
|
127
|
+
return [...new Set(findings)];
|
|
128
|
+
}
|
|
129
|
+
function validatePlaySourceHasNoInlineSecrets(input) {
|
|
130
|
+
const findings = collectInlineSecretFindings(input.sourceCode);
|
|
131
|
+
if (!findings.length) return;
|
|
132
|
+
throw new Error(
|
|
133
|
+
[
|
|
134
|
+
`Play source ${input.filePath} appears to contain inline secret material: ${[
|
|
135
|
+
...new Set(findings)
|
|
136
|
+
].join(", ")}.`,
|
|
137
|
+
`Author secrets in the dashboard, declare them in the Play's top-level secrets option, and read them at runtime with await ctx.secrets.get("NAME").`
|
|
138
|
+
].join(" ")
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
function validatePlaySourceFilesHaveNoInlineSecrets(sourceFiles) {
|
|
142
|
+
for (const [filePath, sourceCode] of Object.entries(sourceFiles)) {
|
|
143
|
+
validatePlaySourceHasNoInlineSecrets({ filePath, sourceCode });
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export {
|
|
148
|
+
collectInlineSecretFindings,
|
|
149
|
+
validatePlaySourceFilesHaveNoInlineSecrets
|
|
150
|
+
};
|