deepline 0.3.547 → 0.3.549
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-core.ts +93 -11
- package/dist/bundling-sources/sdk/src/index.ts +1 -0
- package/dist/bundling-sources/sdk/src/plays/check-local-play-graph.ts +3 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/types.ts +11 -0
- package/dist/bundling-sources/shared_libs/monitors/action-actor.ts +203 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/limits.ts +20 -0
- package/dist/bundling-sources/shared_libs/monitors/package.json +2 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-batch-operation.ts +33 -0
- package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-dead-letter.ts +19 -3
- package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-failure-codes.ts +21 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +83 -6
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +93 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +98 -1
- package/dist/bundling-sources/shared_libs/plays/play-check-compact.ts +636 -0
- package/dist/bundling-sources/shared_libs/security/email-blacklist.ts +3 -0
- package/dist/bundling-sources/shared_libs/security/email-domain.ts +24 -0
- package/dist/cli/auth-UVEZIP3H.js +43 -0
- package/dist/cli/{auth-WJEY4IDX.mjs → auth-YENF525S.mjs} +5 -5
- package/dist/cli/{billing-IJITDDRQ.js → billing-52GAHIDZ.js} +95 -95
- package/dist/cli/{billing-PHJUDYF3.mjs → billing-XPXB27G7.mjs} +9 -9
- package/dist/cli/{chunk-2HPTLBNB.js → chunk-3IUQNHIG.js} +3 -3
- package/dist/cli/{chunk-IKYN6PLO.mjs → chunk-4AUV5QJF.mjs} +5 -5
- package/dist/cli/{chunk-GZFZZQL4.js → chunk-4DJNXAPH.js} +75 -37
- package/dist/cli/{chunk-DZC7LMYM.js → chunk-4HSSPT73.js} +6 -6
- package/dist/cli/{chunk-TNJG4ZPN.mjs → chunk-4QUWXUUJ.mjs} +35 -6
- package/dist/cli/{chunk-SAJWYN4B.js → chunk-5622PYAP.js} +4 -4
- package/dist/cli/{chunk-PBMO36BP.mjs → chunk-5CXE22BI.mjs} +2 -2
- package/dist/cli/{chunk-ESCVHDNY.mjs → chunk-5T37KQNG.mjs} +5 -5
- package/dist/cli/{chunk-YURGAKI3.js → chunk-7FY7AHR6.js} +2 -2
- package/dist/cli/{chunk-PVQCX6KQ.js → chunk-ADWMIZCB.js} +67 -9
- package/dist/cli/{chunk-FMQXAOVE.mjs → chunk-ANOTB6V3.mjs} +4 -4
- package/dist/cli/{chunk-VPF54TXQ.mjs → chunk-AZSVDAXT.mjs} +5 -5
- package/dist/cli/{chunk-G6XTCG3J.mjs → chunk-BDOLPGHD.mjs} +2 -2
- package/dist/cli/{chunk-N63U5CRG.js → chunk-BDUZJX4V.js} +26 -26
- package/dist/cli/{chunk-HFIFKP3A.js → chunk-BPBPY42E.js} +5 -5
- package/dist/cli/{chunk-ECUD4QPD.mjs → chunk-CX4KGWCH.mjs} +3 -3
- package/dist/cli/{chunk-REAFIEV5.js → chunk-CXFOYRI4.js} +99 -99
- package/dist/cli/{chunk-RXRC2COC.mjs → chunk-DCTEH6N5.mjs} +2 -2
- package/dist/cli/{chunk-ABLTVG3J.js → chunk-DIRLEJJX.js} +41 -41
- package/dist/cli/{chunk-VNOQEDVC.js → chunk-ETLEPHLT.js} +7 -7
- package/dist/cli/{chunk-QU3K3IY6.js → chunk-HPSCRVTM.js} +12 -12
- package/dist/cli/{chunk-MBQELFL7.js → chunk-HWCIU3KY.js} +22 -22
- package/dist/cli/{chunk-XMBVHJPR.mjs → chunk-J6FINSAK.mjs} +49 -11
- package/dist/cli/{chunk-K3GMDSUX.js → chunk-KBMBNUUW.js} +5 -5
- package/dist/cli/{chunk-D6OIEH47.js → chunk-KTZ3VU6S.js} +5 -5
- package/dist/cli/{chunk-XNTDTAKC.mjs → chunk-L6UMWAAY.mjs} +1 -1
- package/dist/cli/{chunk-ITLZBDSR.mjs → chunk-LMFTDDAM.mjs} +2 -2
- package/dist/cli/{chunk-56MEAGWA.mjs → chunk-LP2VNGG3.mjs} +2 -2
- package/dist/cli/{chunk-RMCCB3XY.mjs → chunk-MAE3AKDR.mjs} +67 -9
- package/dist/cli/{chunk-L5J6UJ2X.js → chunk-NVALIJQS.js} +15 -15
- package/dist/cli/{chunk-MO7TGNXB.js → chunk-OWX4AAJ4.js} +13 -13
- package/dist/cli/{chunk-DIUNDLSX.mjs → chunk-PLAJ6HPD.mjs} +2 -2
- package/dist/cli/{chunk-G6KW764N.mjs → chunk-PLJCY35C.mjs} +1 -1
- package/dist/cli/{chunk-L6QE2XVM.mjs → chunk-PQX4WTBY.mjs} +1 -1
- package/dist/cli/{chunk-GJOGFWX3.js → chunk-QGKX2WBZ.js} +52 -23
- package/dist/cli/{chunk-AEQ5VWZ5.mjs → chunk-QIZBUY2N.mjs} +4 -4
- package/dist/cli/{chunk-E2OIYPB4.js → chunk-QUELC3B2.js} +10 -10
- package/dist/cli/{chunk-OVYXYTEP.js → chunk-RMKRZJOS.js} +16 -16
- package/dist/cli/{chunk-GIGAYLY6.js → chunk-SVNAP2QI.js} +9 -9
- package/dist/cli/{chunk-2AHY47SI.js → chunk-TYOAOSDL.js} +3 -3
- package/dist/cli/{chunk-GPAWLXW3.mjs → chunk-U6KHWIAO.mjs} +1 -1
- package/dist/cli/{chunk-MOZEAGSR.mjs → chunk-UGVXHT62.mjs} +1 -1
- package/dist/cli/{chunk-QLE3QKJ2.mjs → chunk-V5WPYOAE.mjs} +5 -5
- package/dist/cli/{chunk-FFBXLFKV.js → chunk-V7WMNX4R.js} +1 -1
- package/dist/cli/{chunk-NBYFQZ6O.js → chunk-VLAJGF27.js} +2 -2
- package/dist/cli/{chunk-5SFHPMBY.mjs → chunk-W77LBYF3.mjs} +11 -11
- package/dist/cli/{chunk-DJI5CLLW.mjs → chunk-X4RGDE4J.mjs} +1 -1
- package/dist/cli/{chunk-IVFFCAV2.js → chunk-XPYCNA43.js} +44 -44
- package/dist/cli/{chunk-HARZ4AAX.mjs → chunk-XS72HELO.mjs} +1 -1
- package/dist/cli/{chunk-LMLSOHTU.js → chunk-Y5MDCPWA.js} +53 -53
- package/dist/cli/{chunk-CKIRKYW7.mjs → chunk-Y5SKYU5X.mjs} +3 -3
- package/dist/cli/{chunk-Z2YGQZWV.mjs → chunk-YX7BX2FA.mjs} +2 -2
- package/dist/cli/{chunk-YVKLF7RW.js → chunk-YZTS3XA7.js} +2 -2
- package/dist/cli/{chunk-IGAK22XO.mjs → chunk-Z3DKJOUL.mjs} +1 -1
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/concurrent-runs-help-74AFW3BD.js +21 -0
- package/dist/cli/{concurrent-runs-help-ZNGP563R.mjs → concurrent-runs-help-OYSLW55L.mjs} +6 -6
- package/dist/cli/{csv-X6D4ZELE.js → csv-FRO3UFMQ.js} +13 -13
- package/dist/cli/{csv-VAHQHYYV.mjs → csv-TFCTUYF2.mjs} +4 -4
- package/dist/cli/{db-4G4S2VOV.mjs → db-NHVZBT2H.mjs} +6 -6
- package/dist/cli/{db-YA5ZGVEX.js → db-SNFNRVZJ.js} +27 -27
- package/dist/cli/describe-2JCOC4AK.js +50 -0
- package/dist/cli/{describe-EVXEM2S6.mjs → describe-OVFPRJJL.mjs} +18 -18
- package/dist/cli/describe-core.d.mts +2 -2
- package/dist/cli/describe-core.d.ts +2 -2
- package/dist/cli/{executions-HR6CTN5M.mjs → executions-HWMH2LTC.mjs} +6 -6
- package/dist/cli/{executions-5YC7ABF6.js → executions-RZLKKPZV.js} +8 -8
- package/dist/cli/{feedback-MJHSYLFF.js → feedback-3D5OROCI.js} +14 -14
- package/dist/cli/{feedback-GEU5SPLR.mjs → feedback-WD4JVF77.mjs} +6 -6
- package/dist/cli/git-GCCPCUWJ.js +25 -0
- package/dist/cli/{git-NPFF6QUS.mjs → git-RYUKBCUZ.mjs} +5 -5
- package/dist/cli/index.js +146 -146
- package/dist/cli/index.mjs +45 -45
- package/dist/cli/{integrations-Z7EGVBHF.mjs → integrations-KJPFCEXL.mjs} +7 -7
- package/dist/cli/{integrations-YPHFI77G.js → integrations-Y7OK23DW.js} +15 -15
- package/dist/cli/{legacy-noops-5IYCFWWX.mjs → legacy-noops-2PU2ZVEP.mjs} +6 -6
- package/dist/cli/{legacy-noops-246E3KKG.js → legacy-noops-G7ZY7K3K.js} +9 -9
- package/dist/cli/{mcp-WUYGZXPI.mjs → mcp-D7F2RSOI.mjs} +4 -4
- package/dist/cli/{mcp-YTYTW67G.js → mcp-GILBYX72.js} +24 -24
- package/dist/cli/{monitors-73DQKCU7.mjs → monitors-IK5KXY2H.mjs} +32 -8
- package/dist/cli/{monitors-SA6ILD6Z.js → monitors-OXNHOT3C.js} +125 -101
- package/dist/cli/{org-WVQRB2KX.mjs → org-L5D7EISU.mjs} +6 -6
- package/dist/cli/{org-X7ELDV7B.js → org-OYM3UNTP.js} +88 -88
- package/dist/cli/{play-QI6V2EUQ.mjs → play-PK6QO3WX.mjs} +837 -290
- package/dist/cli/{play-QTYOAJPE.js → play-YK22QPYO.js} +1423 -876
- package/dist/cli/{providers-XXFLVREV.js → providers-5CYP7P4N.js} +9 -9
- package/dist/cli/{providers-DPVMVDS4.mjs → providers-Z6MNJDCG.mjs} +6 -6
- package/dist/cli/{quickstart-YWGNHULM.mjs → quickstart-2I73XQXB.mjs} +4 -4
- package/dist/cli/{quickstart-33ISXQJU.js → quickstart-2YKETYJY.js} +6 -6
- package/dist/cli/{run-J6FCAKQC.mjs → run-KGQ6TUBB.mjs} +23 -23
- package/dist/cli/{run-BWHZXLTD.js → run-YVSEAVE5.js} +43 -43
- package/dist/cli/{search-Z3UU3WBB.mjs → search-V2HPN6FU.mjs} +7 -7
- package/dist/cli/search-YG3UIZ6A.js +32 -0
- package/dist/cli/{search-output-YIPV74ME.js → search-output-BUSANFRN.js} +6 -6
- package/dist/cli/{search-output-OJYY4J7E.mjs → search-output-OCTOSDEO.mjs} +4 -4
- package/dist/cli/{secrets-UXRJCEN4.js → secrets-VDKTHCVB.js} +15 -15
- package/dist/cli/{secrets-YZZN2WST.mjs → secrets-WZGRBWI5.mjs} +6 -6
- package/dist/cli/{sessions-ITCGPD7Z.mjs → sessions-5DTN55DZ.mjs} +6 -6
- package/dist/cli/sessions-NSPT6LHT.js +22 -0
- package/dist/cli/{settings-LAFYMILP.js → settings-A7VSNOLI.js} +85 -85
- package/dist/cli/{settings-ZP2LSVNM.mjs → settings-BK5FPQ3X.mjs} +12 -12
- package/dist/cli/{setup-WEQAQSYC.mjs → setup-LLQVPZTP.mjs} +9 -9
- package/dist/cli/{setup-4AL3XYM5.js → setup-NV27CYQ5.js} +49 -49
- package/dist/cli/{skills-NQH4HFW2.mjs → skills-IV6HK4XA.mjs} +7 -7
- package/dist/cli/skills-UA5E4DA3.js +36 -0
- package/dist/cli/{tools-CXK2GSI4.mjs → tools-4FKPCRD7.mjs} +17 -17
- package/dist/cli/tools-NJVPAG37.js +57 -0
- package/dist/cli/update-DKX27XZB.js +34 -0
- package/dist/cli/{update-3ROF3Z75.mjs → update-MH5M746E.mjs} +9 -9
- package/dist/cli/{views-XJFO5CEH.js → views-JW44TCGL.js} +21 -21
- package/dist/cli/{views-AOUHVGV2.mjs → views-KXC4JDT7.mjs} +6 -6
- package/dist/cli/{workflow-GY3DBHXX.js → workflow-F5AHL2ET.js} +17 -17
- package/dist/cli/{workflow-KBS2QJK6.mjs → workflow-FI4DL7ZI.mjs} +7 -7
- package/dist/{client-D1uWA2Vc.d.mts → client-BEJqhQAj.d.mts} +1 -1
- package/dist/{client-Hz7SsBXs.d.ts → client-Ceo295L2.d.ts} +1 -1
- package/dist/{client-core-D3Ad7Flt.d.ts → client-core-BPYuWfBC.d.ts} +49 -1
- package/dist/{client-core-Db_e63Hb.d.mts → client-core-BqetRxx-.d.mts} +49 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +9 -9
- package/dist/index.mjs +6 -6
- package/dist/install-integrity.json +118 -116
- package/dist/plays/play-description.d.mts +1 -1
- package/dist/plays/play-description.d.ts +1 -1
- package/dist/plays/run-request.d.mts +1 -1
- package/dist/plays/run-request.d.ts +1 -1
- 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/dist/server.d.mts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +5 -5
- package/dist/server.mjs +3 -3
- package/package.json +1 -1
- package/dist/cli/auth-AC5277PI.js +0 -43
- package/dist/cli/concurrent-runs-help-ZYISYOQA.js +0 -21
- package/dist/cli/describe-GYYSLZLV.js +0 -50
- package/dist/cli/git-FZIQZNI4.js +0 -25
- package/dist/cli/search-JCWJX2XD.js +0 -32
- package/dist/cli/sessions-NA4SJH6Q.js +0 -22
- package/dist/cli/skills-XZ4Y6SZ7.js +0 -36
- package/dist/cli/tools-WJQ6Y7E4.js +0 -57
- package/dist/cli/update-ZLRLTBRD.js +0 -34
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
handleDeploymentGet,
|
|
3
3
|
handleDeploymentsList
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-LP2VNGG3.mjs";
|
|
5
5
|
import {
|
|
6
6
|
DEFAULT_MAX_CONCURRENT_EXTERNAL_CALLS,
|
|
7
7
|
MAX_CONFIGURABLE_CONCURRENT_EXTERNAL_CALLS,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
parsePlayRunHeaderFlag,
|
|
10
10
|
parsePlayRunOptions,
|
|
11
11
|
resolvePlayRunCliOptions
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-LMFTDDAM.mjs";
|
|
13
13
|
import {
|
|
14
14
|
ExecutionOutputError,
|
|
15
15
|
TABLE_EXPORT_ERROR_COLUMN,
|
|
@@ -22,10 +22,10 @@ import {
|
|
|
22
22
|
underscoreKeysLast,
|
|
23
23
|
writeExecutionOutput,
|
|
24
24
|
writeRunDatasetCsv
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-UGVXHT62.mjs";
|
|
26
26
|
import {
|
|
27
27
|
registerDeprecatedSearchCommand
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-QIZBUY2N.mjs";
|
|
29
29
|
import "./chunk-5AEDYVB6.mjs";
|
|
30
30
|
import {
|
|
31
31
|
buildPlayDashboardUrl,
|
|
@@ -51,10 +51,10 @@ import {
|
|
|
51
51
|
import {
|
|
52
52
|
pinLocalPlayImports,
|
|
53
53
|
planLocalPlayExecution
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-YX7BX2FA.mjs";
|
|
55
55
|
import {
|
|
56
56
|
DeeplineClient
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-DCTEH6N5.mjs";
|
|
58
58
|
import {
|
|
59
59
|
RUN_EVENT_SEARCH_KIND_VALUES,
|
|
60
60
|
RunEventQueryInputError,
|
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
normalizePlayStatus,
|
|
68
68
|
normalizeRunEventOperationRequest,
|
|
69
69
|
parseLogLevel
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-J6FINSAK.mjs";
|
|
71
71
|
import "./chunk-FZHMNK6F.mjs";
|
|
72
72
|
import {
|
|
73
73
|
CSV_DATA_INPUT_KEY,
|
|
@@ -91,22 +91,23 @@ import "./chunk-UBKA33KY.mjs";
|
|
|
91
91
|
import {
|
|
92
92
|
checkPlayRunCompatibility,
|
|
93
93
|
usesCliPlayAdmission
|
|
94
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-PLAJ6HPD.mjs";
|
|
95
95
|
import {
|
|
96
96
|
isCliTraceEnabled,
|
|
97
97
|
recordCliTrace,
|
|
98
98
|
resolveCliMaintenancePolicy,
|
|
99
99
|
traceCliSpan
|
|
100
|
-
} from "./chunk-
|
|
101
|
-
import "./chunk-
|
|
100
|
+
} from "./chunk-PLJCY35C.mjs";
|
|
101
|
+
import "./chunk-AZSVDAXT.mjs";
|
|
102
102
|
import {
|
|
103
103
|
createCliProgress,
|
|
104
104
|
getActiveCliProgress
|
|
105
|
-
} from "./chunk-
|
|
105
|
+
} from "./chunk-PQX4WTBY.mjs";
|
|
106
106
|
import {
|
|
107
107
|
formatNonStandardSandboxRuntimeWarning
|
|
108
108
|
} from "./chunk-5LUF4LAR.mjs";
|
|
109
109
|
import {
|
|
110
|
+
STANDARD_PLAY_SANDBOX_RUNTIME_LIMITS,
|
|
110
111
|
resolvePlaySandboxRuntimeLimits
|
|
111
112
|
} from "./chunk-7I4B6V2S.mjs";
|
|
112
113
|
import {
|
|
@@ -122,17 +123,17 @@ import {
|
|
|
122
123
|
printJsonError,
|
|
123
124
|
renderCommandEnvelopeText,
|
|
124
125
|
shouldEmitJson
|
|
125
|
-
} from "./chunk-
|
|
126
|
-
import "./chunk-
|
|
126
|
+
} from "./chunk-4QUWXUUJ.mjs";
|
|
127
|
+
import "./chunk-U6KHWIAO.mjs";
|
|
127
128
|
import {
|
|
128
129
|
fetchWithDeploymentProtection
|
|
129
|
-
} from "./chunk-
|
|
130
|
+
} from "./chunk-X4RGDE4J.mjs";
|
|
130
131
|
import "./chunk-NURW5XH4.mjs";
|
|
131
132
|
import "./chunk-DLIRSHV6.mjs";
|
|
132
133
|
import {
|
|
133
134
|
DeeplineError
|
|
134
135
|
} from "./chunk-JL2OTMSG.mjs";
|
|
135
|
-
import "./chunk-
|
|
136
|
+
import "./chunk-L6UMWAAY.mjs";
|
|
136
137
|
import "./chunk-WZYKRD7T.mjs";
|
|
137
138
|
import {
|
|
138
139
|
__commonJS,
|
|
@@ -2772,10 +2773,10 @@ var FILTER_EXAMPLES = [
|
|
|
2772
2773
|
command: `deepline runs logs --kind log.appended --where '$.level == "error" && $.stepId == "company-lookup"' --payloads`
|
|
2773
2774
|
}
|
|
2774
2775
|
];
|
|
2775
|
-
function wrapParagraph(
|
|
2776
|
+
function wrapParagraph(text3) {
|
|
2776
2777
|
const lines = [];
|
|
2777
2778
|
let line = " ";
|
|
2778
|
-
for (const word of
|
|
2779
|
+
for (const word of text3.split(" ")) {
|
|
2779
2780
|
if (line.length + word.length > 80 && line.trim()) {
|
|
2780
2781
|
lines.push(line.trimEnd());
|
|
2781
2782
|
line = " ";
|
|
@@ -3068,9 +3069,9 @@ async function handleRunEventQuery(args, resource = "logs") {
|
|
|
3068
3069
|
return await executeRunEventQuery(args, resource);
|
|
3069
3070
|
} catch (error) {
|
|
3070
3071
|
const failure = error instanceof Error ? error : new Error(String(error));
|
|
3071
|
-
const
|
|
3072
|
-
const status =
|
|
3073
|
-
const exitCode = error instanceof RunEventQueryInputError || status === 400 || status === 422 ||
|
|
3072
|
+
const record5 = failure;
|
|
3073
|
+
const status = record5.statusCode;
|
|
3074
|
+
const exitCode = error instanceof RunEventQueryInputError || status === 400 || status === 422 || record5.code === "INVALID_RUNTIME_SELECTION" ? 2 : status === 401 || status === 403 || record5.code === "CONFIG_ERROR" || record5.code === "RUNTIME_ENVIRONMENT_TOKEN_REQUIRED" ? 3 : status === 404 ? 4 : 5;
|
|
3074
3075
|
const diagnostic = Object.assign(failure, {
|
|
3075
3076
|
exitCode,
|
|
3076
3077
|
retryable: exitCode === 5
|
|
@@ -3592,8 +3593,8 @@ function executionSummary(value, conflictingPopulation) {
|
|
|
3592
3593
|
const totals = /* @__PURE__ */ new Set();
|
|
3593
3594
|
let sum = 0;
|
|
3594
3595
|
let valid = true;
|
|
3595
|
-
for (const [name,
|
|
3596
|
-
const match = typeof
|
|
3596
|
+
for (const [name, text3] of Object.entries(source)) {
|
|
3597
|
+
const match = typeof text3 === "string" && /^(\d+)\/(\d+) \((\d+)%\)$/.exec(text3);
|
|
3597
3598
|
if (!match) {
|
|
3598
3599
|
valid = false;
|
|
3599
3600
|
continue;
|
|
@@ -4009,27 +4010,377 @@ function docflowFlowOrder(docflow) {
|
|
|
4009
4010
|
return result;
|
|
4010
4011
|
}
|
|
4011
4012
|
|
|
4012
|
-
//
|
|
4013
|
+
// ../plays/play-check-compact.ts
|
|
4013
4014
|
var record3 = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4015
|
+
var array = (value) => Array.isArray(value) ? value : [];
|
|
4016
|
+
var text = (value) => typeof value === "string" && value.trim() ? value : void 0;
|
|
4017
|
+
var strings = (value) => array(value).filter((item) => typeof item === "string");
|
|
4018
|
+
var nonEmpty = (items) => items.length ? items : void 0;
|
|
4019
|
+
var PLAY_CHECK_COMPACT_VIEW = "compact";
|
|
4020
|
+
var PLAY_CHECK_ARM_PREFIX = "\u2192 ";
|
|
4021
|
+
var PLAY_CHECK_NEAR_LIMIT_RATIO = 0.8;
|
|
4022
|
+
function isCompactPlayCheckResult(value) {
|
|
4023
|
+
return record3(value)?.view === PLAY_CHECK_COMPACT_VIEW;
|
|
4024
|
+
}
|
|
4025
|
+
function playCheckStaticPipeline(result) {
|
|
4026
|
+
return record3(
|
|
4027
|
+
result.staticPipeline ?? record3(result.authoringContract)?.staticPipeline
|
|
4028
|
+
);
|
|
4029
|
+
}
|
|
4030
|
+
var withoutUndefined = (value) => Object.fromEntries(
|
|
4031
|
+
Object.entries(value).filter(([, item]) => item !== void 0)
|
|
4032
|
+
);
|
|
4033
|
+
function stageLocation(step) {
|
|
4034
|
+
const range = record3(step.sourceRange);
|
|
4035
|
+
const start = range?.startLine;
|
|
4036
|
+
if (typeof start !== "number") return void 0;
|
|
4037
|
+
const end = typeof range?.endLine === "number" ? range.endLine : start;
|
|
4038
|
+
const lines = end === start ? `L${start}` : `L${start}-${end}`;
|
|
4039
|
+
const file = text(range?.sourcePath);
|
|
4040
|
+
const callerFile = text(record3(step.callSiteRange)?.sourcePath);
|
|
4041
|
+
return file && callerFile && file !== callerFile ? `${file}:${lines}` : lines;
|
|
4042
|
+
}
|
|
4043
|
+
var isGeneratedDescription = (description) => /^Lines \d+-\d+$/.test(description) || description === "Conditional code" || description === "Looped code";
|
|
4044
|
+
var isGeneratedId = (id) => /^(?:lines|conditional|loop)_\d+_\d+$/.test(id);
|
|
4045
|
+
var oneLine = (value) => value?.replace(/\s+/g, " ").trim() || void 0;
|
|
4046
|
+
function stageHead(type, id, target) {
|
|
4047
|
+
const named = id && !isGeneratedId(id) ? `${type} ${id}` : type;
|
|
4048
|
+
return target && target !== id ? `${named} (${target})` : named;
|
|
4049
|
+
}
|
|
4050
|
+
function stageLine(step, hasBranches) {
|
|
4051
|
+
const type = text(step.type) ?? "step";
|
|
4052
|
+
const kind = text(step.kind);
|
|
4053
|
+
const id = text(step.field) ?? text(step.alias) ?? text(step.id) ?? text(step.name);
|
|
4054
|
+
const description = text(step.description);
|
|
4055
|
+
return [
|
|
4056
|
+
stageHead(
|
|
4057
|
+
type === "control_flow" && kind ? kind : type,
|
|
4058
|
+
id,
|
|
4059
|
+
text(step.toolId) ?? text(step.tool) ?? text(step.playId)
|
|
4060
|
+
),
|
|
4061
|
+
stageLocation(step),
|
|
4062
|
+
// A conditional's arms each carry their own condition.
|
|
4063
|
+
type === "control_flow" && !hasBranches ? oneLine(text(step.condition)) : void 0,
|
|
4064
|
+
step.inLoop === true ? "in loop" : void 0,
|
|
4065
|
+
description && !isGeneratedDescription(description) ? description : void 0
|
|
4066
|
+
].filter(Boolean).join(" \xB7 ");
|
|
4067
|
+
}
|
|
4068
|
+
function waterfallLeg(leg) {
|
|
4069
|
+
return stageHead(text(leg.kind) ?? "tool", text(leg.id), text(leg.toolId));
|
|
4070
|
+
}
|
|
4071
|
+
function branchLine(branch) {
|
|
4072
|
+
const label = oneLine(text(branch.label));
|
|
4073
|
+
const condition = oneLine(text(branch.condition));
|
|
4074
|
+
if (!condition || label?.endsWith(condition)) return label ?? "branch";
|
|
4075
|
+
return label ? `${label} ${condition}` : condition;
|
|
4076
|
+
}
|
|
4077
|
+
var records = (value) => array(value).map(record3).filter((item) => Boolean(item));
|
|
4078
|
+
function stageLines(step) {
|
|
4079
|
+
const indent = (lines) => lines.map((line) => ` ${line}`);
|
|
4080
|
+
const branches = records(step.branches);
|
|
4081
|
+
if (step.type === "control_flow" && branches.length > 0) {
|
|
4082
|
+
return [
|
|
4083
|
+
stageLine(step, true),
|
|
4084
|
+
...branches.flatMap((branch) => {
|
|
4085
|
+
const steps = stagesLines(branch.steps);
|
|
4086
|
+
return steps.length ? indent([`${PLAY_CHECK_ARM_PREFIX}${branchLine(branch)}`, ...indent(steps)]) : [];
|
|
4087
|
+
})
|
|
4088
|
+
];
|
|
4089
|
+
}
|
|
4090
|
+
const children = records(step.steps);
|
|
4091
|
+
return [
|
|
4092
|
+
stageLine(step, false),
|
|
4093
|
+
...indent(
|
|
4094
|
+
step.type === "waterfall" ? children.map(waterfallLeg) : stagesLines(children)
|
|
4095
|
+
)
|
|
4096
|
+
];
|
|
4097
|
+
}
|
|
4098
|
+
function stagesLines(steps) {
|
|
4099
|
+
const out = [];
|
|
4100
|
+
let previous;
|
|
4101
|
+
let run = 0;
|
|
4102
|
+
let start = 0;
|
|
4103
|
+
for (const step of records(steps)) {
|
|
4104
|
+
const lines = stageLines(step);
|
|
4105
|
+
const key = lines.join("\n");
|
|
4106
|
+
if (key === previous) {
|
|
4107
|
+
run += 1;
|
|
4108
|
+
out[start] = `${lines[0]} \xD7${run}`;
|
|
4109
|
+
continue;
|
|
4110
|
+
}
|
|
4111
|
+
previous = key;
|
|
4112
|
+
run = 1;
|
|
4113
|
+
start = out.length;
|
|
4114
|
+
out.push(...lines);
|
|
4115
|
+
}
|
|
4116
|
+
return out;
|
|
4117
|
+
}
|
|
4118
|
+
function compactStages(pipeline) {
|
|
4119
|
+
const lines = stagesLines(pipeline.stages);
|
|
4120
|
+
const shown = new Set(lines.map((line) => line.trim()));
|
|
4121
|
+
return [
|
|
4122
|
+
...lines,
|
|
4123
|
+
...stagesLines(
|
|
4124
|
+
records(pipeline.substeps).filter(
|
|
4125
|
+
(step) => !shown.has(stageLine(step, false))
|
|
4126
|
+
)
|
|
4127
|
+
)
|
|
4128
|
+
];
|
|
4129
|
+
}
|
|
4130
|
+
function compactDocflow(docflow) {
|
|
4131
|
+
if (!docflow || !Array.isArray(docflow.nodes)) return void 0;
|
|
4132
|
+
const bindings = /* @__PURE__ */ new Map();
|
|
4133
|
+
for (const binding of records(docflow.bindings)) {
|
|
4134
|
+
const nodeId = text(binding.nodeId);
|
|
4135
|
+
if (nodeId && !bindings.has(nodeId)) bindings.set(nodeId, binding);
|
|
4136
|
+
}
|
|
4137
|
+
const nodes = records(docflow.nodes).map((node) => {
|
|
4138
|
+
const id = String(node.id);
|
|
4139
|
+
const binding = bindings.get(id);
|
|
4140
|
+
return withoutUndefined({
|
|
4141
|
+
id,
|
|
4142
|
+
label: text(node.label) ?? id,
|
|
4143
|
+
// A plain box is an action; only other kinds are named.
|
|
4144
|
+
kind: text(node.kind) === "action" ? void 0 : text(node.kind),
|
|
4145
|
+
sketch: node.sketch === true ? true : void 0,
|
|
4146
|
+
line: binding ? typeof binding.line === "number" ? binding.line : 0 : void 0,
|
|
4147
|
+
file: text(binding?.sourcePath),
|
|
4148
|
+
in: nonEmpty(strings(binding?.inputs)),
|
|
4149
|
+
out: nonEmpty(strings(binding?.outputs)),
|
|
4150
|
+
show: nonEmpty(strings(binding?.show)),
|
|
4151
|
+
arm: text(binding?.arm)
|
|
4152
|
+
});
|
|
4153
|
+
});
|
|
4154
|
+
const edges = records(docflow.edges).map(
|
|
4155
|
+
(edge) => withoutUndefined({
|
|
4156
|
+
from: String(edge.from),
|
|
4157
|
+
to: String(edge.to),
|
|
4158
|
+
label: text(edge.label),
|
|
4159
|
+
arm: text(edge.arm)
|
|
4160
|
+
})
|
|
4161
|
+
);
|
|
4162
|
+
const subgraphs = records(docflow.subgraphs).map(
|
|
4163
|
+
(region) => withoutUndefined({
|
|
4164
|
+
id: String(region.id),
|
|
4165
|
+
label: text(region.label) ?? String(region.id),
|
|
4166
|
+
memberIds: strings(region.memberIds),
|
|
4167
|
+
parentId: text(region.parentId)
|
|
4168
|
+
})
|
|
4169
|
+
);
|
|
4170
|
+
return withoutUndefined({ nodes, edges, subgraphs: nonEmpty(subgraphs) });
|
|
4171
|
+
}
|
|
4172
|
+
function nearLimits(limits) {
|
|
4173
|
+
if (!limits) return void 0;
|
|
4174
|
+
const near = Object.entries(limits).filter(([, value]) => {
|
|
4175
|
+
const budget = record3(value);
|
|
4176
|
+
if (!budget) return false;
|
|
4177
|
+
if (budget.withinLimit === false || budget.approachingLimit === true)
|
|
4178
|
+
return true;
|
|
4179
|
+
const used = budget.usedBytes ?? budget.used;
|
|
4180
|
+
const limit = budget.limitBytes ?? budget.limit;
|
|
4181
|
+
return typeof used === "number" && typeof limit === "number" && limit > 0 && used >= limit * PLAY_CHECK_NEAR_LIMIT_RATIO;
|
|
4182
|
+
});
|
|
4183
|
+
return near.length ? Object.fromEntries(near) : void 0;
|
|
4184
|
+
}
|
|
4185
|
+
function distinctIssues(issues) {
|
|
4186
|
+
const seen = /* @__PURE__ */ new Set();
|
|
4187
|
+
return issues.filter((issue) => {
|
|
4188
|
+
const key = JSON.stringify(issue);
|
|
4189
|
+
if (seen.has(key)) return false;
|
|
4190
|
+
seen.add(key);
|
|
4191
|
+
return true;
|
|
4192
|
+
});
|
|
4193
|
+
}
|
|
4194
|
+
function compactPlayCheckResult(result) {
|
|
4195
|
+
if (isCompactPlayCheckResult(result)) return result;
|
|
4196
|
+
const contract = record3(result.authoringContract);
|
|
4197
|
+
const pipeline = playCheckStaticPipeline(result);
|
|
4198
|
+
const admission = record3(result.runAdmission);
|
|
4199
|
+
return withoutUndefined({
|
|
4200
|
+
view: PLAY_CHECK_COMPACT_VIEW,
|
|
4201
|
+
valid: result.valid === true,
|
|
4202
|
+
errors: strings(result.errors),
|
|
4203
|
+
warnings: strings(result.warnings),
|
|
4204
|
+
issues: distinctIssues(array(result.issues)),
|
|
4205
|
+
summary: text(result.summary),
|
|
4206
|
+
recognized: record3(result.recognized),
|
|
4207
|
+
triggers: result.triggers ?? void 0,
|
|
4208
|
+
inputSchema: contract?.inputSchema ?? void 0,
|
|
4209
|
+
returnFields: nonEmpty(array(pipeline?.returnFields)),
|
|
4210
|
+
stages: pipeline ? nonEmpty(compactStages(pipeline)) : void 0,
|
|
4211
|
+
docflow: compactDocflow(record3(pipeline?.docflow)),
|
|
4212
|
+
runtimeLimit: result.runtimeLimit ?? void 0,
|
|
4213
|
+
limits: nearLimits(record3(result.limits)),
|
|
4214
|
+
runAdmission: admission && admission.admitted === false ? admission : void 0,
|
|
4215
|
+
toolGetterHints: nonEmpty(array(result.toolGetterHints)),
|
|
4216
|
+
sourceHash: text(result.sourceHash),
|
|
4217
|
+
artifactHash: text(result.artifactHash),
|
|
4218
|
+
graphHash: text(result.graphHash)
|
|
4219
|
+
});
|
|
4220
|
+
}
|
|
4221
|
+
function playCheckToolIds(result) {
|
|
4222
|
+
const ids = /* @__PURE__ */ new Set();
|
|
4223
|
+
for (const stage of compactPlayCheckResult(result).stages ?? []) {
|
|
4224
|
+
const match = /^tool (\S+)(?: \((\S+)\))?(?: ·|$| ×)/.exec(stage.trim());
|
|
4225
|
+
const tool = match?.[2] ?? match?.[1];
|
|
4226
|
+
if (tool) ids.add(tool);
|
|
4227
|
+
}
|
|
4228
|
+
return [...ids].sort();
|
|
4229
|
+
}
|
|
4230
|
+
function schemaType(schema) {
|
|
4231
|
+
const values = array(schema.enum);
|
|
4232
|
+
if (values.length > 0 && values.length <= 6) {
|
|
4233
|
+
return values.map((value) => JSON.stringify(value)).join("|");
|
|
4234
|
+
}
|
|
4235
|
+
const members = [...records(schema.anyOf), ...records(schema.oneOf)];
|
|
4236
|
+
if (members.length > 0) return members.map(schemaType).join("|");
|
|
4237
|
+
const types = [...strings(schema.type), text(schema.type)].filter(
|
|
4238
|
+
(type) => Boolean(type)
|
|
4239
|
+
);
|
|
4240
|
+
if (types.length === 0) return "unknown";
|
|
4241
|
+
return types.map((type) => {
|
|
4242
|
+
const items = record3(schema.items);
|
|
4243
|
+
return type === "array" && items ? `${schemaType(items)}[]` : type;
|
|
4244
|
+
}).join("|");
|
|
4245
|
+
}
|
|
4246
|
+
function playCheckInputFields(schema) {
|
|
4247
|
+
const root = record3(schema);
|
|
4248
|
+
if (!root) return void 0;
|
|
4249
|
+
const csvField = text(record3(root.csvInput)?.inputField);
|
|
4250
|
+
const fields2 = [];
|
|
4251
|
+
const visit = (node, prefix, required) => {
|
|
4252
|
+
const requiredKeys = new Set(strings(node.required));
|
|
4253
|
+
for (const [key, value] of Object.entries(record3(node.properties) ?? {})) {
|
|
4254
|
+
const name = prefix ? `${prefix}.${key}` : key;
|
|
4255
|
+
const property = record3(value) ?? {};
|
|
4256
|
+
const isRequired = required && requiredKeys.has(key);
|
|
4257
|
+
if (Object.keys(record3(property.properties) ?? {}).length > 0) {
|
|
4258
|
+
visit(property, name, isRequired);
|
|
4259
|
+
continue;
|
|
4260
|
+
}
|
|
4261
|
+
fields2.push({
|
|
4262
|
+
name,
|
|
4263
|
+
type: !prefix && key === csvField ? "csv" : schemaType(property),
|
|
4264
|
+
required: isRequired
|
|
4265
|
+
});
|
|
4266
|
+
}
|
|
4267
|
+
};
|
|
4268
|
+
visit(root, "", true);
|
|
4269
|
+
return fields2;
|
|
4270
|
+
}
|
|
4271
|
+
var isDiagramIssue = (issue) => issue.code.startsWith("docflow_");
|
|
4272
|
+
var isOptionalDiagramNudge = (issue) => issue.code === "docflow_visualization_missing" && issue.message.startsWith("HIGHLY RECOMMENDED");
|
|
4273
|
+
function locateDiagramIssue(issue) {
|
|
4274
|
+
if (!isDiagramIssue(issue) || issue.node) return issue;
|
|
4275
|
+
const node = /^docflow\.(?:nodes|subgraphs)\.([^.[\]]+)/.exec(
|
|
4276
|
+
issue.path ?? ""
|
|
4277
|
+
)?.[1];
|
|
4278
|
+
return node ? { ...issue, node } : issue;
|
|
4279
|
+
}
|
|
4280
|
+
function summarizeDiagram(docflow, issues) {
|
|
4281
|
+
const diagramIssues = issues.filter(
|
|
4282
|
+
(issue) => isDiagramIssue(issue) && !isOptionalDiagramNudge(issue)
|
|
4283
|
+
);
|
|
4284
|
+
if (!docflow && diagramIssues.length === 0) return void 0;
|
|
4285
|
+
const nodes = docflow?.nodes ?? [];
|
|
4286
|
+
return {
|
|
4287
|
+
drawn: Boolean(docflow),
|
|
4288
|
+
boxes: nodes.length,
|
|
4289
|
+
bound: nodes.filter((node) => node.line !== void 0).length,
|
|
4290
|
+
sketched: nodes.filter((node) => node.sketch).length,
|
|
4291
|
+
errors: diagramIssues.filter((issue) => issue.severity === "error").length,
|
|
4292
|
+
warnings: diagramIssues.filter((issue) => issue.severity === "warning").length
|
|
4293
|
+
};
|
|
4294
|
+
}
|
|
4295
|
+
function foldDiagnostics(compact) {
|
|
4296
|
+
const issues = [...compact.issues];
|
|
4021
4297
|
for (const [severity, messages] of [
|
|
4022
|
-
["error",
|
|
4023
|
-
["warning",
|
|
4298
|
+
["error", compact.errors],
|
|
4299
|
+
["warning", compact.warnings]
|
|
4024
4300
|
]) {
|
|
4025
4301
|
for (const message of messages) {
|
|
4026
|
-
|
|
4302
|
+
const mirrored = issues.some(
|
|
4027
4303
|
(issue) => issue.severity === severity && (issue.message.trim() === message.trim() || [issue.message.trim(), issue.hint?.trim()].filter(Boolean).join(" ") === message.trim())
|
|
4028
|
-
)
|
|
4304
|
+
);
|
|
4305
|
+
if (!mirrored)
|
|
4029
4306
|
issues.push({ severity, message, code: "check_diagnostic" });
|
|
4030
|
-
}
|
|
4031
4307
|
}
|
|
4032
4308
|
}
|
|
4309
|
+
return distinctIssues(issues.map(locateDiagramIssue));
|
|
4310
|
+
}
|
|
4311
|
+
function presentDocflow(docflow, issues) {
|
|
4312
|
+
if (!docflow) return void 0;
|
|
4313
|
+
const flagged = new Set(issues.map((issue) => issue.node));
|
|
4314
|
+
return {
|
|
4315
|
+
...docflow,
|
|
4316
|
+
nodes: docflow.nodes.map((node) => {
|
|
4317
|
+
if (flagged.has(node.id)) return node;
|
|
4318
|
+
const { in: _in, out: _out, show: _show, ...box } = node;
|
|
4319
|
+
return box;
|
|
4320
|
+
})
|
|
4321
|
+
};
|
|
4322
|
+
}
|
|
4323
|
+
function nonDefaultRuntimeLimit(value) {
|
|
4324
|
+
const limit = record3(value);
|
|
4325
|
+
if (!limit) return void 0;
|
|
4326
|
+
const standard = STANDARD_PLAY_SANDBOX_RUNTIME_LIMITS;
|
|
4327
|
+
return Object.keys(standard).every((key) => limit[key] === standard[key]) ? void 0 : limit;
|
|
4328
|
+
}
|
|
4329
|
+
function presentRecognized(compact) {
|
|
4330
|
+
const { inputs, outputs, triggers: _triggers, tools, ...rest } = compact.recognized ?? {};
|
|
4331
|
+
const toolNames = strings(tools);
|
|
4332
|
+
const recognized = withoutUndefined({
|
|
4333
|
+
...Object.fromEntries(
|
|
4334
|
+
Object.entries(rest).filter(
|
|
4335
|
+
([, value]) => value !== void 0 && value !== null && !(Array.isArray(value) && value.length === 0)
|
|
4336
|
+
)
|
|
4337
|
+
),
|
|
4338
|
+
rowInputs: nonEmpty(array(inputs)),
|
|
4339
|
+
outputs: compact.returnFields ?? nonEmpty(array(outputs)),
|
|
4340
|
+
tools: toolNames.length ? { names: toolNames } : void 0
|
|
4341
|
+
});
|
|
4342
|
+
return Object.keys(recognized).length ? recognized : void 0;
|
|
4343
|
+
}
|
|
4344
|
+
function presentPlayCheckResult(result) {
|
|
4345
|
+
const compact = compactPlayCheckResult(result);
|
|
4346
|
+
const issues = foldDiagnostics(compact);
|
|
4347
|
+
return withoutUndefined({
|
|
4348
|
+
valid: compact.valid,
|
|
4349
|
+
issues,
|
|
4350
|
+
diagram: summarizeDiagram(compact.docflow, issues),
|
|
4351
|
+
input: playCheckInputFields(compact.inputSchema),
|
|
4352
|
+
recognized: presentRecognized(compact),
|
|
4353
|
+
triggers: compact.triggers ?? record3(compact.recognized)?.triggers,
|
|
4354
|
+
stages: compact.stages,
|
|
4355
|
+
docflow: presentDocflow(compact.docflow, issues),
|
|
4356
|
+
runtimeLimit: nonDefaultRuntimeLimit(compact.runtimeLimit),
|
|
4357
|
+
limits: compact.limits,
|
|
4358
|
+
runAdmission: compact.runAdmission,
|
|
4359
|
+
toolGetterHints: nonEmpty(array(compact.toolGetterHints)),
|
|
4360
|
+
sourceHash: compact.sourceHash,
|
|
4361
|
+
artifactHash: compact.artifactHash,
|
|
4362
|
+
graphHash: compact.graphHash
|
|
4363
|
+
});
|
|
4364
|
+
}
|
|
4365
|
+
|
|
4366
|
+
// src/cli/play-check-output.ts
|
|
4367
|
+
var record4 = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
4368
|
+
var array2 = (value) => Array.isArray(value) ? value : [];
|
|
4369
|
+
var text2 = (value) => typeof value === "string" && value.trim() ? value : void 0;
|
|
4370
|
+
function projectCheckedPlay(outcome, full = false) {
|
|
4371
|
+
const { result } = outcome;
|
|
4372
|
+
const raw = result;
|
|
4373
|
+
return {
|
|
4374
|
+
name: outcome.playName,
|
|
4375
|
+
exportName: outcome.exportName,
|
|
4376
|
+
...outcome.stage ? { stage: outcome.stage } : {},
|
|
4377
|
+
...presentPlayCheckResult(raw),
|
|
4378
|
+
...full && !isCompactPlayCheckResult(raw) ? { diagnostics: checkDiagnostics(raw) } : {}
|
|
4379
|
+
};
|
|
4380
|
+
}
|
|
4381
|
+
function checkDiagnostics(raw) {
|
|
4382
|
+
const contract = record4(raw.authoringContract);
|
|
4383
|
+
const pipeline = playCheckStaticPipeline(raw);
|
|
4033
4384
|
const diagnostics = Object.fromEntries(
|
|
4034
4385
|
Object.entries(raw).filter(
|
|
4035
4386
|
([key]) => ![
|
|
@@ -4037,12 +4388,7 @@ function projectCheckedPlay(outcome, full = false) {
|
|
|
4037
4388
|
"errors",
|
|
4038
4389
|
"warnings",
|
|
4039
4390
|
"issues",
|
|
4040
|
-
"recognized",
|
|
4041
4391
|
"triggers",
|
|
4042
|
-
"summary",
|
|
4043
|
-
"runtimeLimit",
|
|
4044
|
-
"limits",
|
|
4045
|
-
"featureFlags",
|
|
4046
4392
|
"sourceHash",
|
|
4047
4393
|
"artifactHash",
|
|
4048
4394
|
"graphHash",
|
|
@@ -4054,48 +4400,22 @@ function projectCheckedPlay(outcome, full = false) {
|
|
|
4054
4400
|
);
|
|
4055
4401
|
if (contract) {
|
|
4056
4402
|
diagnostics.authoringContract = Object.fromEntries(
|
|
4057
|
-
Object.entries(contract).filter(
|
|
4058
|
-
([key]) => !["staticPipeline", "inputSchema", "runtimeLimit"].includes(key)
|
|
4059
|
-
)
|
|
4403
|
+
Object.entries(contract).filter(([key]) => key !== "staticPipeline")
|
|
4060
4404
|
);
|
|
4061
4405
|
}
|
|
4062
4406
|
if (pipeline) diagnostics.staticPipeline = pipeline;
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
recognized: {
|
|
4074
|
-
...recognized,
|
|
4075
|
-
...inputs ? { rowInputs: inputs } : {},
|
|
4076
|
-
...pipeline?.returnFields ? { outputs: pipeline.returnFields } : outputs ? { outputs } : {},
|
|
4077
|
-
tools: { names: tools ?? [], coverage: "statically_recognized_only" }
|
|
4078
|
-
},
|
|
4079
|
-
...result.triggers ?? triggers ? { triggers: result.triggers ?? triggers } : {},
|
|
4080
|
-
...result.runtimeLimit ? { runtimeLimit: result.runtimeLimit } : {},
|
|
4081
|
-
...result.limits ? { limits: result.limits } : {},
|
|
4082
|
-
...result.featureFlags?.length ? { featureFlags: result.featureFlags } : {},
|
|
4083
|
-
...result.toolGetterHints?.length ? { toolGetterHints: result.toolGetterHints } : {},
|
|
4084
|
-
...result.sourceHash ? { sourceHash: result.sourceHash } : {},
|
|
4085
|
-
...result.artifactHash ? { artifactHash: result.artifactHash } : {},
|
|
4086
|
-
...result.graphHash ? { graphHash: result.graphHash } : {},
|
|
4087
|
-
...full ? { diagnostics } : {}
|
|
4088
|
-
};
|
|
4089
|
-
}
|
|
4090
|
-
function checkedRunExample(plays, target) {
|
|
4091
|
-
const play = plays.find((item) => item.exportName === "default");
|
|
4092
|
-
const schema = record3(play?.inputSchema);
|
|
4093
|
-
if (!play?.valid || !schema) return void 0;
|
|
4094
|
-
const quote = (value) => `'${value.replace(/'/g, `'\\''`)}'`;
|
|
4095
|
-
const base = `deepline run ${quote(target)}`;
|
|
4407
|
+
return diagnostics;
|
|
4408
|
+
}
|
|
4409
|
+
var shellArg = (value) => `'${value.replace(/'/g, `'\\''`)}'`;
|
|
4410
|
+
function checkedRunExample(outcomes, target) {
|
|
4411
|
+
const play = outcomes.find((item) => item.exportName === "default");
|
|
4412
|
+
if (!play?.result.valid) return void 0;
|
|
4413
|
+
const schema = record4(
|
|
4414
|
+
compactPlayCheckResult(play.result).inputSchema
|
|
4415
|
+
);
|
|
4416
|
+
if (!schema) return void 0;
|
|
4096
4417
|
return {
|
|
4097
|
-
command:
|
|
4098
|
-
note: "Runs the local file without publishing and may spend credits. Supply the indicated file; JSON input must match inputSchema."
|
|
4418
|
+
command: `deepline run ${shellArg(target)}${playInputExampleArgs(schema)}`
|
|
4099
4419
|
};
|
|
4100
4420
|
}
|
|
4101
4421
|
function buildPlayCheckOutput(input) {
|
|
@@ -4104,52 +4424,21 @@ function buildPlayCheckOutput(input) {
|
|
|
4104
4424
|
);
|
|
4105
4425
|
if (!plays.length) throw new Error("Play check produced no export results.");
|
|
4106
4426
|
const valid = plays.every((play) => play.valid);
|
|
4107
|
-
const runExample = valid ? checkedRunExample(
|
|
4427
|
+
const runExample = valid ? checkedRunExample(input.outcomes, input.target) : void 0;
|
|
4108
4428
|
return {
|
|
4109
4429
|
kind: "play_check",
|
|
4110
4430
|
target: input.target,
|
|
4111
4431
|
checked: "local_artifact",
|
|
4112
|
-
scope: "Checks every exported Play without running it. Recognized dataset columns are physical SQL names known from static analysis; additional CSV passthrough columns are not included. Does not resolve a sample CSV or prove provider availability. Recognized row fields and tools are not exhaustive runtime coverage.",
|
|
4113
4432
|
...plays.length === 1 ? plays[0] : { exports: plays },
|
|
4114
4433
|
valid,
|
|
4115
4434
|
actions: {
|
|
4116
4435
|
...runExample ? { runExample } : {},
|
|
4117
|
-
getFullCheckCmd: input.detailsCommand,
|
|
4118
|
-
getRunHelpCmd: "deepline run --help",
|
|
4119
4436
|
...valid && input.publishCommand ? { publishCmd: input.publishCommand } : {}
|
|
4120
4437
|
}
|
|
4121
4438
|
};
|
|
4122
4439
|
}
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
return docflow && Array.isArray(docflow.nodes) && Array.isArray(docflow.edges) ? docflow : null;
|
|
4126
|
-
}
|
|
4127
|
-
var isDiagramIssue = (issue) => issue.code.startsWith("docflow_");
|
|
4128
|
-
var isOptionalDiagramNudge = (issue) => issue.code === "docflow_visualization_missing" && issue.message.startsWith("HIGHLY RECOMMENDED");
|
|
4129
|
-
function locateDiagramIssue(issue) {
|
|
4130
|
-
if (!isDiagramIssue(issue) || issue.node) return issue;
|
|
4131
|
-
const node = /^docflow\.(?:nodes|subgraphs)\.([^.[\]]+)/.exec(
|
|
4132
|
-
issue.path ?? ""
|
|
4133
|
-
)?.[1];
|
|
4134
|
-
return node ? { ...issue, node } : issue;
|
|
4135
|
-
}
|
|
4136
|
-
function summarizeDiagram(docflow, issues) {
|
|
4137
|
-
const diagramIssues = issues.filter(
|
|
4138
|
-
(issue) => isDiagramIssue(issue) && !isOptionalDiagramNudge(issue)
|
|
4139
|
-
);
|
|
4140
|
-
if (!docflow && diagramIssues.length === 0) return void 0;
|
|
4141
|
-
const nodes = docflow?.nodes ?? [];
|
|
4142
|
-
const bound = new Set((docflow?.bindings ?? []).map((b) => b.nodeId));
|
|
4143
|
-
return {
|
|
4144
|
-
drawn: Boolean(docflow),
|
|
4145
|
-
boxes: nodes.length,
|
|
4146
|
-
bound: nodes.filter((node) => bound.has(node.id)).length,
|
|
4147
|
-
sketched: nodes.filter((node) => node.sketch).length,
|
|
4148
|
-
errors: diagramIssues.filter((issue) => issue.severity === "error").length,
|
|
4149
|
-
warnings: diagramIssues.filter((issue) => issue.severity === "warning").length
|
|
4150
|
-
};
|
|
4151
|
-
}
|
|
4152
|
-
var count2 = (n2, one, many) => `${n2} ${n2 === 1 ? one : many}`;
|
|
4440
|
+
var isDiagramIssue2 = (issue) => issue.code.startsWith("docflow_");
|
|
4441
|
+
var count2 = (n2, one, many = `${one}s`) => `${n2} ${n2 === 1 ? one : many}`;
|
|
4153
4442
|
function renderDiagramVerdict(summary) {
|
|
4154
4443
|
const shape = !summary.drawn ? "not drawn" : [
|
|
4155
4444
|
count2(summary.boxes, "box", "boxes"),
|
|
@@ -4157,10 +4446,10 @@ function renderDiagramVerdict(summary) {
|
|
|
4157
4446
|
...summary.sketched ? [`${summary.sketched} sketched`] : []
|
|
4158
4447
|
].join(", ");
|
|
4159
4448
|
const found = [
|
|
4160
|
-
...summary.errors ? [count2(summary.errors, "error"
|
|
4161
|
-
...summary.warnings ? [count2(summary.warnings, "warning"
|
|
4449
|
+
...summary.errors ? [count2(summary.errors, "error")] : [],
|
|
4450
|
+
...summary.warnings ? [count2(summary.warnings, "warning")] : []
|
|
4162
4451
|
];
|
|
4163
|
-
return
|
|
4452
|
+
return `${shape} \xB7 ${found.length ? found.join(", ") : "clean"}`;
|
|
4164
4453
|
}
|
|
4165
4454
|
function renderIssueBlock(issue, subject) {
|
|
4166
4455
|
const head = [
|
|
@@ -4175,10 +4464,13 @@ function renderIssueBlock(issue, subject) {
|
|
|
4175
4464
|
else if (hint) lines.push(` Fix: ${hint}`);
|
|
4176
4465
|
return lines;
|
|
4177
4466
|
}
|
|
4467
|
+
var playIssues = (play) => (Array.isArray(play.issues) ? play.issues : []).filter(
|
|
4468
|
+
(issue) => !isOptionalDiagramNudge(issue)
|
|
4469
|
+
);
|
|
4178
4470
|
function renderPlayIssues(play, docflow) {
|
|
4179
|
-
const issues = (
|
|
4471
|
+
const issues = playIssues(play);
|
|
4180
4472
|
const lines = [];
|
|
4181
|
-
for (const issue of issues.filter((issue2) => !
|
|
4473
|
+
for (const issue of issues.filter((issue2) => !isDiagramIssue2(issue2))) {
|
|
4182
4474
|
lines.push(...renderIssueBlock(issue, issue.code), "");
|
|
4183
4475
|
}
|
|
4184
4476
|
const order = docflow ? docflowFlowOrder(docflow) : [];
|
|
@@ -4187,7 +4479,7 @@ function renderPlayIssues(play, docflow) {
|
|
|
4187
4479
|
const index = order.indexOf(issue.node);
|
|
4188
4480
|
return index < 0 ? order.length : index;
|
|
4189
4481
|
};
|
|
4190
|
-
const diagramIssues = issues.filter(
|
|
4482
|
+
const diagramIssues = issues.filter(isDiagramIssue2).map((issue, index) => ({ issue, index })).sort(
|
|
4191
4483
|
(left, right) => rank(left.issue) - rank(right.issue) || left.index - right.index
|
|
4192
4484
|
).map(({ issue }) => issue);
|
|
4193
4485
|
for (const issue of diagramIssues) {
|
|
@@ -4195,46 +4487,309 @@ function renderPlayIssues(play, docflow) {
|
|
|
4195
4487
|
const subject = issue.node ? `${issue.node}${label && label !== issue.node ? ` "${label}"` : ""}` : "diagram";
|
|
4196
4488
|
lines.push(...renderIssueBlock(issue, subject), "");
|
|
4197
4489
|
}
|
|
4198
|
-
const summary = record3(play.diagram);
|
|
4199
|
-
if (summary) lines.push(renderDiagramVerdict(summary));
|
|
4200
|
-
else if (lines.at(-1) === "") lines.pop();
|
|
4201
4490
|
return lines;
|
|
4202
4491
|
}
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
const
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4492
|
+
var LABEL_WIDTH = 10;
|
|
4493
|
+
function section(label, values) {
|
|
4494
|
+
const pad = " ".repeat(LABEL_WIDTH);
|
|
4495
|
+
return values.map(
|
|
4496
|
+
(value, index) => index === 0 ? `${label.padEnd(LABEL_WIDTH)}${value}` : `${pad}${value}`
|
|
4497
|
+
);
|
|
4498
|
+
}
|
|
4499
|
+
function inputLine(fields2) {
|
|
4500
|
+
if (fields2.length === 0) return "none";
|
|
4501
|
+
const name = (field) => field.type === "csv" ? `${field.name} (CSV file)` : field.name;
|
|
4502
|
+
const required = fields2.filter((field) => field.required).map(name);
|
|
4503
|
+
const optional = fields2.filter((field) => !field.required).map(name);
|
|
4504
|
+
return [
|
|
4505
|
+
...required.length ? [`${required.join(", ")} (required)`] : [],
|
|
4506
|
+
...optional.length ? [`${optional.join(", ")} (optional)`] : []
|
|
4507
|
+
].join(" \xB7 ");
|
|
4508
|
+
}
|
|
4509
|
+
var STAGE_NOUNS = {
|
|
4510
|
+
run_javascript: ["code block", "code blocks"],
|
|
4511
|
+
tool: ["tool call", "tool calls"],
|
|
4512
|
+
play_call: ["play call", "play calls"],
|
|
4513
|
+
step_suite: ["step group", "step groups"],
|
|
4514
|
+
switch: ["switch", "switches"]
|
|
4515
|
+
};
|
|
4516
|
+
function stepsLine(stages, tools) {
|
|
4517
|
+
const steps = stages.map((line) => line.trim()).filter((line) => !line.startsWith(PLAY_CHECK_ARM_PREFIX));
|
|
4518
|
+
const counts = /* @__PURE__ */ new Map();
|
|
4519
|
+
for (const step of steps) {
|
|
4520
|
+
const type = step.split(/[\s·]/, 1)[0];
|
|
4521
|
+
counts.set(type, (counts.get(type) ?? 0) + 1);
|
|
4522
|
+
}
|
|
4523
|
+
const kinds = [...counts].map(([type, n2]) => {
|
|
4524
|
+
const [one, many] = STAGE_NOUNS[type] ?? [
|
|
4525
|
+
type.replace(/_/g, " "),
|
|
4526
|
+
`${type.replace(/_/g, " ")}s`
|
|
4527
|
+
];
|
|
4528
|
+
return count2(n2, one, many);
|
|
4529
|
+
});
|
|
4530
|
+
const only = steps.length === 1 ? / · (L\d+(?:-\d+)?)/.exec(steps[0]) : null;
|
|
4531
|
+
if (only && kinds.length === 1) kinds[0] = `${kinds[0]} (${only[1]})`;
|
|
4532
|
+
return [
|
|
4533
|
+
...kinds.length ? kinds : ["none"],
|
|
4534
|
+
`tools: ${tools.length ? tools.join(", ") : "none"}`
|
|
4535
|
+
].join(" \xB7 ");
|
|
4536
|
+
}
|
|
4537
|
+
var boxLines = (node) => [
|
|
4538
|
+
node.in ? `in: ${node.in.join(", ")}` : void 0,
|
|
4539
|
+
node.out ? `out: ${node.out.join(", ")}` : void 0,
|
|
4540
|
+
node.show ? `show: ${node.show.join(", ")}` : void 0
|
|
4541
|
+
].filter(Boolean);
|
|
4542
|
+
function diagramOutline(docflow, options) {
|
|
4543
|
+
const regions = new Map(
|
|
4544
|
+
(docflow.subgraphs ?? []).map((region) => [region.id, region])
|
|
4209
4545
|
);
|
|
4210
|
-
const
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
}
|
|
4215
|
-
const
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4546
|
+
const regionOf = /* @__PURE__ */ new Map();
|
|
4547
|
+
for (const region of regions.values()) {
|
|
4548
|
+
for (const member of region.memberIds) regionOf.set(member, region.id);
|
|
4549
|
+
if (region.parentId) regionOf.set(region.id, region.parentId);
|
|
4550
|
+
}
|
|
4551
|
+
const depth = (id) => {
|
|
4552
|
+
let n2 = 0;
|
|
4553
|
+
for (let at = regionOf.get(id); at; at = regionOf.get(at)) n2 += 1;
|
|
4554
|
+
return n2;
|
|
4555
|
+
};
|
|
4556
|
+
const nodes = new Map(docflow.nodes.map((node) => [node.id, node]));
|
|
4557
|
+
const labelOf = (id) => nodes.get(id)?.label ?? regions.get(id)?.label ?? id;
|
|
4558
|
+
const arms = (id) => {
|
|
4559
|
+
const out = docflow.edges.filter((edge) => edge.from === id);
|
|
4560
|
+
if (out.length < 2) return "";
|
|
4561
|
+
return ` ${out.map(
|
|
4562
|
+
(edge) => edge.label ? `${edge.label} \u2192 ${labelOf(edge.to)}` : `\u2192 ${labelOf(edge.to)}`
|
|
4563
|
+
).join(" \xB7 ")}`;
|
|
4564
|
+
};
|
|
4565
|
+
const lines = [];
|
|
4566
|
+
for (const id of docflowFlowOrder(docflow)) {
|
|
4567
|
+
const indent = " ".repeat(depth(id));
|
|
4568
|
+
const region = regions.get(id);
|
|
4569
|
+
if (region) {
|
|
4570
|
+
lines.push(`${indent}${region.label}:${arms(id)}`);
|
|
4571
|
+
continue;
|
|
4572
|
+
}
|
|
4573
|
+
const node = nodes.get(id);
|
|
4574
|
+
if (!node) continue;
|
|
4575
|
+
const file = node.file && node.file !== options.entryFile ? `${node.file}:` : "";
|
|
4576
|
+
const where = node.sketch ? " (sketch)" : node.line !== void 0 ? ` (${file}L${node.line})` : " (unbound)";
|
|
4577
|
+
lines.push(`${indent}${node.label}${where}${arms(id)}`);
|
|
4578
|
+
if (options.detail) {
|
|
4579
|
+
const io = boxLines(node);
|
|
4580
|
+
if (io.length) lines.push(`${indent} ${io.join(" \xB7 ")}`);
|
|
4581
|
+
}
|
|
4582
|
+
}
|
|
4583
|
+
return lines;
|
|
4584
|
+
}
|
|
4585
|
+
var formatBytes = (bytes) => bytes >= 1e6 ? `${(bytes / 1e6).toFixed(1)} MB` : `${Math.round(bytes / 1e3)} KB`;
|
|
4586
|
+
function formatSeconds(seconds) {
|
|
4587
|
+
if (seconds % 3600 === 0) return `${seconds / 3600}h`;
|
|
4588
|
+
if (seconds % 60 === 0) return `${seconds / 60}m`;
|
|
4589
|
+
return `${seconds}s`;
|
|
4590
|
+
}
|
|
4591
|
+
function limitsLine(play) {
|
|
4592
|
+
const parts = [];
|
|
4593
|
+
const runtime = record4(play.runtimeLimit);
|
|
4594
|
+
const standard = STANDARD_PLAY_SANDBOX_RUNTIME_LIMITS;
|
|
4595
|
+
if (runtime && Object.keys(standard).some((key) => runtime[key] !== standard[key])) {
|
|
4596
|
+
parts.push(
|
|
4597
|
+
[
|
|
4598
|
+
typeof runtime.timeoutSeconds === "number" ? `timeout ${formatSeconds(runtime.timeoutSeconds)}` : void 0,
|
|
4599
|
+
typeof runtime.memoryGiB === "number" ? `${runtime.memoryGiB} GiB memory` : void 0,
|
|
4600
|
+
typeof runtime.cpu === "number" ? `${runtime.cpu} CPU` : void 0,
|
|
4601
|
+
typeof runtime.diskGiB === "number" ? `${runtime.diskGiB} GiB disk` : void 0
|
|
4602
|
+
].filter(Boolean).join(", ")
|
|
4219
4603
|
);
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4604
|
+
}
|
|
4605
|
+
for (const [key, value] of Object.entries(record4(play.limits) ?? {})) {
|
|
4606
|
+
const budget = record4(value) ?? {};
|
|
4607
|
+
const name = key.replace(/([A-Z])/g, " $1").toLowerCase();
|
|
4608
|
+
const used = budget.usedBytes ?? budget.used;
|
|
4609
|
+
const limit = budget.limitBytes ?? budget.limit;
|
|
4610
|
+
const bytes = "usedBytes" in budget;
|
|
4611
|
+
const amount = typeof used === "number" && typeof limit === "number" ? bytes ? `${formatBytes(used)} of ${formatBytes(limit)}` : `${used} of ${limit}` : "near its limit";
|
|
4612
|
+
parts.push(
|
|
4613
|
+
`${name} ${amount}${budget.withinLimit === false ? " (over)" : ""}`
|
|
4614
|
+
);
|
|
4615
|
+
}
|
|
4616
|
+
return parts.length ? parts.join(" \xB7 ") : "ok";
|
|
4617
|
+
}
|
|
4618
|
+
function returnsLine(outputs) {
|
|
4619
|
+
return outputs.map((output) => {
|
|
4620
|
+
const value = record4(output);
|
|
4621
|
+
if (!value) return String(output);
|
|
4622
|
+
const name = String(value.name ?? "?");
|
|
4623
|
+
return value.isDataset && value.datasetName ? `${name} (dataset ${String(value.datasetName)})` : name;
|
|
4624
|
+
}).join(", ");
|
|
4625
|
+
}
|
|
4626
|
+
function triggersLine(triggers) {
|
|
4627
|
+
const items = Array.isArray(triggers) ? triggers : Object.entries(record4(triggers) ?? {}).flatMap(
|
|
4628
|
+
([kind, value]) => Array.isArray(value) ? value.map((item) => ({ kind, ...record4(item) ?? {} })) : value ? [{ kind, ...record4(value) ?? {} }] : []
|
|
4629
|
+
);
|
|
4630
|
+
if (items.length === 0) return void 0;
|
|
4631
|
+
return items.map((item) => {
|
|
4632
|
+
const value = record4(item) ?? {};
|
|
4633
|
+
const kind = text2(value.type) ?? text2(value.kind) ?? "trigger";
|
|
4634
|
+
const detail = text2(value.schedule) ?? text2(value.cron) ?? text2(value.table);
|
|
4635
|
+
return detail ? `${kind} ${detail}` : kind;
|
|
4636
|
+
}).join(" \xB7 ");
|
|
4637
|
+
}
|
|
4638
|
+
function getterLine(hint) {
|
|
4639
|
+
const toolId = String(hint.toolId ?? "tool");
|
|
4640
|
+
const unavailable = text2(hint.unavailable);
|
|
4641
|
+
if (unavailable) return `${toolId}: getters unavailable (${unavailable})`;
|
|
4642
|
+
const named = (key) => array2(hint[key]).map(record4).filter((getter) => Boolean(getter));
|
|
4643
|
+
const lists = named("lists").map((list) => String(list.expression));
|
|
4644
|
+
const values = named("values");
|
|
4645
|
+
const parts = [
|
|
4646
|
+
...lists,
|
|
4647
|
+
...values.length ? [
|
|
4648
|
+
`values ${values.map((value) => String(value.name)).join(", ")} (e.g. ${String(values[0].expression)})`
|
|
4649
|
+
] : [],
|
|
4650
|
+
...text2(hint.raw) ? [`raw ${String(hint.raw)}`] : []
|
|
4651
|
+
];
|
|
4652
|
+
return `${toolId}: ${parts.length ? parts.join(" \xB7 ") : "no declared getters"}`;
|
|
4653
|
+
}
|
|
4654
|
+
function headerLine(play, multiple) {
|
|
4655
|
+
const issues = playIssues(play);
|
|
4656
|
+
const errors = issues.filter((issue) => issue.severity === "error").length;
|
|
4657
|
+
const warnings = issues.filter((issue) => issue.severity === "warning").length;
|
|
4658
|
+
const found = [
|
|
4659
|
+
...errors ? [count2(errors, "error")] : [],
|
|
4660
|
+
...warnings ? [count2(warnings, "warning")] : []
|
|
4661
|
+
].join(", ");
|
|
4662
|
+
const exportName = String(play.exportName ?? "default");
|
|
4663
|
+
const name = `${String(play.name ?? exportName)}${multiple && exportName !== "default" ? ` (export ${exportName})` : ""}`;
|
|
4664
|
+
const verdict = play.valid ? "valid" : play.stage === "bundle" ? "does not bundle" : "invalid";
|
|
4665
|
+
return `${play.valid ? "\u2713" : "\u2717"} ${name} \u2014 ${verdict}${found ? ` \xB7 ${found}` : ""}`;
|
|
4666
|
+
}
|
|
4667
|
+
function renderPlay(play, docflow, options) {
|
|
4668
|
+
const lines = [];
|
|
4669
|
+
const fields2 = play.input ?? playCheckInputFields(play.inputSchema);
|
|
4670
|
+
if (fields2) lines.push(...section("Input", [inputLine(fields2)]));
|
|
4671
|
+
const recognized = record4(play.recognized) ?? {};
|
|
4672
|
+
const datasets = array2(recognized.datasets).map(record4).filter((dataset) => Boolean(dataset));
|
|
4673
|
+
if (datasets.length) {
|
|
4674
|
+
lines.push(
|
|
4675
|
+
...section(
|
|
4676
|
+
"Datasets",
|
|
4677
|
+
datasets.map(
|
|
4678
|
+
(dataset) => `${String(dataset.name)} (${array2(dataset.columns).join(", ")})`
|
|
4679
|
+
)
|
|
4680
|
+
)
|
|
4681
|
+
);
|
|
4682
|
+
}
|
|
4683
|
+
const outputs = array2(recognized.outputs);
|
|
4684
|
+
if (outputs.length) lines.push(...section("Returns", [returnsLine(outputs)]));
|
|
4685
|
+
const outputFields = playCheckInputFields(play.outputSchema);
|
|
4686
|
+
if (outputFields?.length) {
|
|
4687
|
+
lines.push(
|
|
4688
|
+
...section("Returns", [outputFields.map((field) => field.name).join(", ")])
|
|
4689
|
+
);
|
|
4690
|
+
}
|
|
4691
|
+
const triggers = triggersLine(play.triggers);
|
|
4692
|
+
if (triggers) lines.push(...section("Triggers", [triggers]));
|
|
4693
|
+
const stages = array2(play.stages).filter(
|
|
4694
|
+
(stage) => typeof stage === "string"
|
|
4695
|
+
);
|
|
4696
|
+
const compiled = Boolean(text2(play.sourceHash) ?? text2(play.artifactHash));
|
|
4697
|
+
if (stages.length || compiled) {
|
|
4698
|
+
const tools = array2(record4(recognized.tools)?.names).map(String);
|
|
4699
|
+
lines.push(
|
|
4700
|
+
...section("Steps", [
|
|
4701
|
+
stepsLine(stages, tools),
|
|
4702
|
+
...options.full ? stages : []
|
|
4703
|
+
])
|
|
4704
|
+
);
|
|
4705
|
+
}
|
|
4706
|
+
const summary = record4(play.diagram);
|
|
4707
|
+
if (summary) {
|
|
4708
|
+
lines.push(
|
|
4709
|
+
...section("Diagram", [
|
|
4710
|
+
renderDiagramVerdict(summary),
|
|
4711
|
+
...docflow ? diagramOutline(docflow, {
|
|
4712
|
+
detail: options.full,
|
|
4713
|
+
entryFile: options.entryFile
|
|
4714
|
+
}) : []
|
|
4715
|
+
])
|
|
4716
|
+
);
|
|
4717
|
+
}
|
|
4718
|
+
const getters = array2(play.toolGetterHints).map(record4).filter((hint) => Boolean(hint)).map(getterLine);
|
|
4719
|
+
if (getters.length) lines.push(...section("Getters", getters));
|
|
4720
|
+
if (play.checked === "named_contract" && text2(play.scope)) {
|
|
4721
|
+
lines.push(...section("Checked", [String(play.scope)]));
|
|
4722
|
+
}
|
|
4723
|
+
const admission = record4(play.runAdmission);
|
|
4724
|
+
if (admission) {
|
|
4725
|
+
lines.push(
|
|
4726
|
+
...section("Run", [
|
|
4727
|
+
`refused \xB7 ${text2(admission.message) ?? text2(admission.code) ?? "see --full"}`
|
|
4728
|
+
])
|
|
4729
|
+
);
|
|
4730
|
+
}
|
|
4731
|
+
if (compiled || record4(play.runtimeLimit) || record4(play.limits)) {
|
|
4732
|
+
lines.push(...section("Limits", [limitsLine(play)]));
|
|
4733
|
+
}
|
|
4734
|
+
const hashes = [
|
|
4735
|
+
text2(play.sourceHash) ? `source ${String(play.sourceHash).slice(0, 8)}` : "",
|
|
4736
|
+
text2(play.artifactHash) ? `artifact ${String(play.artifactHash).slice(0, 8)}` : ""
|
|
4737
|
+
].filter(Boolean);
|
|
4738
|
+
if (hashes.length) lines.push(...section("Hashes", [hashes.join(" \xB7 ")]));
|
|
4739
|
+
const issues = renderPlayIssues(play, docflow);
|
|
4740
|
+
if (issues.length) lines.push("", ...issues.slice(0, -1));
|
|
4741
|
+
return lines;
|
|
4742
|
+
}
|
|
4743
|
+
function renderPlayCheckOutput(output, docflows = /* @__PURE__ */ new Map(), options = {}) {
|
|
4744
|
+
const full = options.full === true;
|
|
4745
|
+
const target = text2(output.target) ?? "";
|
|
4746
|
+
const plays = Array.isArray(output.exports) ? output.exports : [output];
|
|
4747
|
+
const multiple = plays.length > 1;
|
|
4748
|
+
const entryFile = target.split("/").at(-1);
|
|
4749
|
+
const blocks = plays.map((play) => {
|
|
4750
|
+
const docflow = docflows.get(String(play.exportName ?? "default")) ?? (record4(play.docflow) ?? null);
|
|
4751
|
+
return [
|
|
4752
|
+
headerLine(
|
|
4753
|
+
output.checked === "named_contract" ? { ...play, valid: true } : play,
|
|
4754
|
+
multiple
|
|
4755
|
+
),
|
|
4756
|
+
...renderPlay(
|
|
4757
|
+
{ ...play, checked: output.checked },
|
|
4758
|
+
docflow,
|
|
4759
|
+
{ full, entryFile }
|
|
4760
|
+
)
|
|
4761
|
+
];
|
|
4226
4762
|
});
|
|
4227
|
-
|
|
4763
|
+
const fileLine = section(
|
|
4764
|
+
output.checked === "named_contract" ? "Play" : "File",
|
|
4765
|
+
[target]
|
|
4766
|
+
);
|
|
4767
|
+
const lines = multiple ? [...fileLine, ...blocks.flatMap((block) => ["", ...block])] : [blocks[0][0], ...fileLine, ...blocks[0].slice(1)];
|
|
4768
|
+
const actions2 = record4(output.actions) ?? {};
|
|
4769
|
+
const atFile = (command) => target ? command.split(shellArg(target)).join("<file>").split(target).join("<file>") : command;
|
|
4770
|
+
const next = [
|
|
4771
|
+
...text2(actions2.publishCmd) ? [atFile(String(actions2.publishCmd))] : [],
|
|
4772
|
+
...text2(record4(actions2.runExample)?.command) ? [
|
|
4773
|
+
`${atFile(String(record4(actions2.runExample).command))} (may spend credits)`
|
|
4774
|
+
] : [],
|
|
4775
|
+
...text2(actions2.runCmd) ? [`${String(actions2.runCmd)} (may spend credits)`] : []
|
|
4776
|
+
];
|
|
4777
|
+
if (next.length) lines.push("", ...section("Next", next));
|
|
4778
|
+
if (full && output.checked !== "named_contract") {
|
|
4779
|
+
lines.push(
|
|
4780
|
+
...section(next.length ? "" : "Next", [
|
|
4781
|
+
`deepline plays check <file> --full --json (complete document)`
|
|
4782
|
+
])
|
|
4783
|
+
);
|
|
4784
|
+
}
|
|
4785
|
+
return lines.join("\n");
|
|
4228
4786
|
}
|
|
4229
4787
|
function checkedDocflows(outcomes) {
|
|
4230
4788
|
return new Map(
|
|
4231
|
-
outcomes.map((outcome) =>
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
);
|
|
4236
|
-
return [outcome.exportName, checkedDocflow(pipeline)];
|
|
4237
|
-
})
|
|
4789
|
+
outcomes.map((outcome) => [
|
|
4790
|
+
outcome.exportName,
|
|
4791
|
+
compactPlayCheckResult(outcome.result).docflow ?? null
|
|
4792
|
+
])
|
|
4238
4793
|
);
|
|
4239
4794
|
}
|
|
4240
4795
|
|
|
@@ -4295,13 +4850,13 @@ Existing credential redactions and referenced-list previews remain as stored.
|
|
|
4295
4850
|
async (runId, options) => {
|
|
4296
4851
|
const keys = [...options.key];
|
|
4297
4852
|
if (options.keys) {
|
|
4298
|
-
const
|
|
4299
|
-
let
|
|
4300
|
-
for await (const chunk of process.stdin)
|
|
4301
|
-
return
|
|
4853
|
+
const text3 = options.keys === "-" ? await (async () => {
|
|
4854
|
+
let text4 = "";
|
|
4855
|
+
for await (const chunk of process.stdin) text4 += chunk;
|
|
4856
|
+
return text4;
|
|
4302
4857
|
})() : await readFile(options.keys, "utf8");
|
|
4303
4858
|
keys.push(
|
|
4304
|
-
...
|
|
4859
|
+
...text3.split(/\r?\n/).map((key) => key.trim()).filter(Boolean)
|
|
4305
4860
|
);
|
|
4306
4861
|
}
|
|
4307
4862
|
const response = await new DeeplineClient().runs.getReceipts(runId, {
|
|
@@ -5621,19 +6176,19 @@ var DeployApiClient = class {
|
|
|
5621
6176
|
body: input.body !== void 0 ? JSON.stringify(input.body) : void 0
|
|
5622
6177
|
}
|
|
5623
6178
|
);
|
|
5624
|
-
const
|
|
6179
|
+
const text3 = await response.text();
|
|
5625
6180
|
let parsed = null;
|
|
5626
6181
|
try {
|
|
5627
|
-
parsed =
|
|
6182
|
+
parsed = text3 ? JSON.parse(text3) : null;
|
|
5628
6183
|
} catch {
|
|
5629
|
-
parsed =
|
|
6184
|
+
parsed = text3;
|
|
5630
6185
|
}
|
|
5631
6186
|
if (!response.ok) {
|
|
5632
|
-
const
|
|
6187
|
+
const record5 = parsed ?? {};
|
|
5633
6188
|
throw new DeployApiError({
|
|
5634
|
-
message: typeof
|
|
6189
|
+
message: typeof record5.error === "string" ? record5.error : `Deploy API ${input.path} failed (${response.status}).`,
|
|
5635
6190
|
status: response.status,
|
|
5636
|
-
code: typeof
|
|
6191
|
+
code: typeof record5.code === "string" ? record5.code : null,
|
|
5637
6192
|
body: parsed
|
|
5638
6193
|
});
|
|
5639
6194
|
}
|
|
@@ -5802,10 +6357,10 @@ function parseDeeplineManifest(raw) {
|
|
|
5802
6357
|
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
5803
6358
|
throw new DeeplineManifestError("deepline.json must be a JSON object.");
|
|
5804
6359
|
}
|
|
5805
|
-
const
|
|
5806
|
-
const plays =
|
|
5807
|
-
const monitors =
|
|
5808
|
-
const org = typeof
|
|
6360
|
+
const record5 = parsed;
|
|
6361
|
+
const plays = record5.plays === void 0 ? DEFAULT_PLAY_GLOBS : readGlobs(record5.plays, "plays");
|
|
6362
|
+
const monitors = record5.monitors === void 0 ? DEFAULT_MONITOR_GLOBS : readGlobs(record5.monitors, "monitors");
|
|
6363
|
+
const org = typeof record5.org === "string" && record5.org.trim() ? record5.org.trim() : void 0;
|
|
5809
6364
|
return {
|
|
5810
6365
|
plays,
|
|
5811
6366
|
monitors,
|
|
@@ -7013,7 +7568,8 @@ async function checkLocalPlayGraph(input) {
|
|
|
7013
7568
|
artifact: input.prepareArtifact?.(node.artifact) ?? node.artifact,
|
|
7014
7569
|
...exportName === "default" ? {} : { exportName },
|
|
7015
7570
|
...importedPlays.length ? { importedPlays } : {},
|
|
7016
|
-
...input.integrationMode ? { integrationMode: input.integrationMode } : {}
|
|
7571
|
+
...input.integrationMode ? { integrationMode: input.integrationMode } : {},
|
|
7572
|
+
...input.full === void 0 ? {} : { full: input.full }
|
|
7017
7573
|
});
|
|
7018
7574
|
};
|
|
7019
7575
|
if ([...graph.nodes.values()].some(
|
|
@@ -7703,8 +8259,8 @@ function looksLikeStagedFileRef(value) {
|
|
|
7703
8259
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
7704
8260
|
return false;
|
|
7705
8261
|
}
|
|
7706
|
-
const
|
|
7707
|
-
return typeof
|
|
8262
|
+
const record5 = value;
|
|
8263
|
+
return typeof record5.contentHash === "string" || typeof record5.contentBase64 === "string" || typeof record5.logicalPath === "string" && typeof record5.bytes === "number";
|
|
7708
8264
|
}
|
|
7709
8265
|
function collectLocalFileInputRefs(value, inputPath, key, out) {
|
|
7710
8266
|
if (typeof value === "string") {
|
|
@@ -8150,11 +8706,11 @@ function readLiveRunField(event, field) {
|
|
|
8150
8706
|
}
|
|
8151
8707
|
}
|
|
8152
8708
|
const run = getRunRecordFromPackage(payload);
|
|
8153
|
-
const
|
|
8709
|
+
const records2 = [payload, payload.progress, run, run?.progress].filter(
|
|
8154
8710
|
(value) => Boolean(value && typeof value === "object" && !Array.isArray(value))
|
|
8155
8711
|
);
|
|
8156
|
-
for (const
|
|
8157
|
-
if (
|
|
8712
|
+
for (const record5 of records2) {
|
|
8713
|
+
if (record5[field] !== void 0) return record5[field];
|
|
8158
8714
|
}
|
|
8159
8715
|
return void 0;
|
|
8160
8716
|
}
|
|
@@ -8479,8 +9035,8 @@ function getProgressLinesFromLiveEvent(event) {
|
|
|
8479
9035
|
if (!state || typeof state !== "object" || Array.isArray(state)) {
|
|
8480
9036
|
continue;
|
|
8481
9037
|
}
|
|
8482
|
-
const
|
|
8483
|
-
const progress =
|
|
9038
|
+
const record5 = state;
|
|
9039
|
+
const progress = record5.progress && typeof record5.progress === "object" && !Array.isArray(record5.progress) ? record5.progress : null;
|
|
8484
9040
|
if (!progress) {
|
|
8485
9041
|
continue;
|
|
8486
9042
|
}
|
|
@@ -8497,7 +9053,7 @@ function getProgressLinesFromLiveEvent(event) {
|
|
|
8497
9053
|
completed: progress.completed
|
|
8498
9054
|
});
|
|
8499
9055
|
lines.push(
|
|
8500
|
-
`progress ${formatProgressLabel(
|
|
9056
|
+
`progress ${formatProgressLabel(record5.nodeId ?? progress.artifactTableNamespace)}: ${counts}${messageSuffix}`
|
|
8501
9057
|
);
|
|
8502
9058
|
}
|
|
8503
9059
|
const calls = readRecord(payload.calls);
|
|
@@ -9804,9 +10360,9 @@ function formatProviderCapacityWaitLogLine(line) {
|
|
|
9804
10360
|
let details;
|
|
9805
10361
|
try {
|
|
9806
10362
|
const parsed = JSON.parse(match[2]);
|
|
9807
|
-
const
|
|
9808
|
-
if (!
|
|
9809
|
-
details =
|
|
10363
|
+
const record5 = readRecord(parsed);
|
|
10364
|
+
if (!record5) return null;
|
|
10365
|
+
details = record5;
|
|
9810
10366
|
} catch {
|
|
9811
10367
|
return null;
|
|
9812
10368
|
}
|
|
@@ -9824,9 +10380,9 @@ function formatMapProgressDiagnosticLogLine(line) {
|
|
|
9824
10380
|
let details;
|
|
9825
10381
|
try {
|
|
9826
10382
|
const parsed = JSON.parse(match[2]);
|
|
9827
|
-
const
|
|
9828
|
-
if (!
|
|
9829
|
-
details =
|
|
10383
|
+
const record5 = readRecord(parsed);
|
|
10384
|
+
if (!record5) return null;
|
|
10385
|
+
details = record5;
|
|
9830
10386
|
} catch {
|
|
9831
10387
|
return null;
|
|
9832
10388
|
}
|
|
@@ -9933,17 +10489,17 @@ function collectDatasetHandleLines(value, path = "result") {
|
|
|
9933
10489
|
return [];
|
|
9934
10490
|
}
|
|
9935
10491
|
if (isDatasetHandle(value)) {
|
|
9936
|
-
const
|
|
9937
|
-
const count3 = typeof
|
|
9938
|
-
const preview = Array.isArray(
|
|
10492
|
+
const record5 = value;
|
|
10493
|
+
const count3 = typeof record5.count === "number" ? record5.count : typeof record5.rowCount === "number" ? record5.rowCount : null;
|
|
10494
|
+
const preview = Array.isArray(record5.preview) ? record5.preview : [];
|
|
9939
10495
|
const lines2 = [
|
|
9940
|
-
` dataset ${typeof
|
|
10496
|
+
` dataset ${typeof record5.path === "string" ? record5.path : path}: rows=${count3 === null ? "-" : formatInteger(count3)} preview=${formatInteger(preview.length)}`
|
|
9941
10497
|
];
|
|
9942
|
-
if (typeof
|
|
9943
|
-
lines2.push(` query dataset: ${
|
|
10498
|
+
if (typeof record5.queryDatasetCommand === "string") {
|
|
10499
|
+
lines2.push(` query dataset: ${record5.queryDatasetCommand}`);
|
|
9944
10500
|
}
|
|
9945
|
-
if (typeof
|
|
9946
|
-
lines2.push(` export CSV: ${
|
|
10501
|
+
if (typeof record5.slowExportAsCsvCommand === "string") {
|
|
10502
|
+
lines2.push(` export CSV: ${record5.slowExportAsCsvCommand}`);
|
|
9947
10503
|
}
|
|
9948
10504
|
return lines2;
|
|
9949
10505
|
}
|
|
@@ -10035,16 +10591,16 @@ function formatSupersededRowsNotice(count3) {
|
|
|
10035
10591
|
return `${formatInteger(count3)} row${count3 === 1 ? "" : "s"} skipped because a newer Runtime Sheet write took precedence`;
|
|
10036
10592
|
}
|
|
10037
10593
|
function readRowOutcomeSummary(value) {
|
|
10038
|
-
const
|
|
10039
|
-
if (!
|
|
10040
|
-
const completedRows = getNumericField(
|
|
10041
|
-
const failedRows = getNumericField(
|
|
10042
|
-
const totalRows = getNumericField(
|
|
10594
|
+
const record5 = getRecordField(value, "rowOutcomes");
|
|
10595
|
+
if (!record5) return null;
|
|
10596
|
+
const completedRows = getNumericField(record5, "completedRows");
|
|
10597
|
+
const failedRows = getNumericField(record5, "failedRows");
|
|
10598
|
+
const totalRows = getNumericField(record5, "totalRows");
|
|
10043
10599
|
if (completedRows === null || failedRows === null || totalRows === null) {
|
|
10044
10600
|
return null;
|
|
10045
10601
|
}
|
|
10046
|
-
const explicitHasFailures = getRecordField(
|
|
10047
|
-
const supersededRows = getNumericField(
|
|
10602
|
+
const explicitHasFailures = getRecordField(record5, "hasRowFailures");
|
|
10603
|
+
const supersededRows = getNumericField(record5, "supersededRows");
|
|
10048
10604
|
return {
|
|
10049
10605
|
completedRows,
|
|
10050
10606
|
failedRows,
|
|
@@ -10087,12 +10643,12 @@ function insufficientCreditsRecoveryCommands(billing) {
|
|
|
10087
10643
|
checkout: `deepline billing checkout --credits ${topUpCredits} --no-open`
|
|
10088
10644
|
};
|
|
10089
10645
|
}
|
|
10090
|
-
function extractJsonObjectFromText(
|
|
10091
|
-
const start =
|
|
10646
|
+
function extractJsonObjectFromText(text3) {
|
|
10647
|
+
const start = text3.indexOf("{");
|
|
10092
10648
|
if (start < 0) {
|
|
10093
10649
|
return null;
|
|
10094
10650
|
}
|
|
10095
|
-
const suffix =
|
|
10651
|
+
const suffix = text3.slice(start);
|
|
10096
10652
|
try {
|
|
10097
10653
|
const parsed = JSON.parse(suffix);
|
|
10098
10654
|
return parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : null;
|
|
@@ -10100,8 +10656,8 @@ function extractJsonObjectFromText(text) {
|
|
|
10100
10656
|
let depth = 0;
|
|
10101
10657
|
let inString = false;
|
|
10102
10658
|
let escaped = false;
|
|
10103
|
-
for (let index = start; index <
|
|
10104
|
-
const char =
|
|
10659
|
+
for (let index = start; index < text3.length; index += 1) {
|
|
10660
|
+
const char = text3[index];
|
|
10105
10661
|
if (inString) {
|
|
10106
10662
|
if (escaped) {
|
|
10107
10663
|
escaped = false;
|
|
@@ -10120,7 +10676,7 @@ function extractJsonObjectFromText(text) {
|
|
|
10120
10676
|
depth -= 1;
|
|
10121
10677
|
if (depth === 0) {
|
|
10122
10678
|
try {
|
|
10123
|
-
const parsed = JSON.parse(
|
|
10679
|
+
const parsed = JSON.parse(text3.slice(start, index + 1));
|
|
10124
10680
|
return parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : null;
|
|
10125
10681
|
} catch {
|
|
10126
10682
|
return null;
|
|
@@ -10131,22 +10687,22 @@ function extractJsonObjectFromText(text) {
|
|
|
10131
10687
|
}
|
|
10132
10688
|
return null;
|
|
10133
10689
|
}
|
|
10134
|
-
function extractBillingFromText(
|
|
10135
|
-
if (!
|
|
10690
|
+
function extractBillingFromText(text3) {
|
|
10691
|
+
if (!text3) {
|
|
10136
10692
|
return null;
|
|
10137
10693
|
}
|
|
10138
|
-
const parsed = extractJsonObjectFromText(
|
|
10694
|
+
const parsed = extractJsonObjectFromText(text3);
|
|
10139
10695
|
return getObjectField(parsed, "billing");
|
|
10140
10696
|
}
|
|
10141
|
-
function extractToolIdFromErrorText(
|
|
10142
|
-
if (!
|
|
10697
|
+
function extractToolIdFromErrorText(text3) {
|
|
10698
|
+
if (!text3) {
|
|
10143
10699
|
return null;
|
|
10144
10700
|
}
|
|
10145
|
-
const lowerToolMatch = /\btool\s+([A-Za-z0-9_.:-]+)\s+\d{3}\b/.exec(
|
|
10701
|
+
const lowerToolMatch = /\btool\s+([A-Za-z0-9_.:-]+)\s+\d{3}\b/.exec(text3);
|
|
10146
10702
|
if (lowerToolMatch?.[1]) {
|
|
10147
10703
|
return lowerToolMatch[1];
|
|
10148
10704
|
}
|
|
10149
|
-
const upperToolMatch = /\bTool\s+([A-Za-z0-9_.:-]+)\s+failed\b/.exec(
|
|
10705
|
+
const upperToolMatch = /\bTool\s+([A-Za-z0-9_.:-]+)\s+failed\b/.exec(text3);
|
|
10150
10706
|
return upperToolMatch?.[1] ?? null;
|
|
10151
10707
|
}
|
|
10152
10708
|
function isInsufficientCreditsBilling(billing) {
|
|
@@ -10234,10 +10790,10 @@ function formatPlayErrorForDisplay(status, error) {
|
|
|
10234
10790
|
function structuredErrorsForStatus(status) {
|
|
10235
10791
|
const directErrors = getRecordField(status, "errors");
|
|
10236
10792
|
if (Array.isArray(directErrors)) {
|
|
10237
|
-
const
|
|
10793
|
+
const records2 = directErrors.filter(
|
|
10238
10794
|
(entry) => Boolean(entry) && typeof entry === "object" && !Array.isArray(entry)
|
|
10239
10795
|
);
|
|
10240
|
-
if (
|
|
10796
|
+
if (records2.length > 0) return records2;
|
|
10241
10797
|
}
|
|
10242
10798
|
const resultErrors = getRecordField(
|
|
10243
10799
|
getRecordField(status, "result"),
|
|
@@ -10411,19 +10967,19 @@ function getPlayRunPackage(status) {
|
|
|
10411
10967
|
}
|
|
10412
10968
|
function playStatusRunUrl(status) {
|
|
10413
10969
|
const run = readRecord(getPlayRunPackage(status)?.run);
|
|
10414
|
-
const
|
|
10970
|
+
const text3 = (value) => typeof value === "string" && value ? value : void 0;
|
|
10415
10971
|
return resolvePlayRunUrl({
|
|
10416
|
-
runId:
|
|
10417
|
-
runUrl: status.runUrl ??
|
|
10418
|
-
dashboardUrl: status.dashboardUrl ??
|
|
10972
|
+
runId: text3(run?.id) ?? status.runId,
|
|
10973
|
+
runUrl: status.runUrl ?? text3(run?.runUrl),
|
|
10974
|
+
dashboardUrl: status.dashboardUrl ?? text3(run?.dashboardUrl)
|
|
10419
10975
|
});
|
|
10420
10976
|
}
|
|
10421
10977
|
function withTerminalPlayIdentity(status, playName) {
|
|
10422
10978
|
if (!playName.trim() || getPlayRunPackage(status)) {
|
|
10423
10979
|
return status;
|
|
10424
10980
|
}
|
|
10425
|
-
const
|
|
10426
|
-
const hasIdentity = typeof
|
|
10981
|
+
const record5 = status;
|
|
10982
|
+
const hasIdentity = typeof record5.playName === "string" && record5.playName.trim().length > 0 || typeof record5.name === "string" && record5.name.trim().length > 0 || Boolean(getStringField(record5.run, "playName"));
|
|
10427
10983
|
if (hasIdentity) {
|
|
10428
10984
|
return status;
|
|
10429
10985
|
}
|
|
@@ -10555,9 +11111,9 @@ function formatSummaryScalar(value) {
|
|
|
10555
11111
|
}
|
|
10556
11112
|
return null;
|
|
10557
11113
|
}
|
|
10558
|
-
function formatSummaryScalarParts(
|
|
11114
|
+
function formatSummaryScalarParts(record5, skipKeys = /* @__PURE__ */ new Set()) {
|
|
10559
11115
|
const parts = [];
|
|
10560
|
-
for (const [key, value] of Object.entries(
|
|
11116
|
+
for (const [key, value] of Object.entries(record5)) {
|
|
10561
11117
|
if (skipKeys.has(key)) {
|
|
10562
11118
|
continue;
|
|
10563
11119
|
}
|
|
@@ -10584,13 +11140,13 @@ function formatTopValuesPart(value) {
|
|
|
10584
11140
|
return `top_values=${entries.map(([topValue, count3]) => `${topValue}=${String(count3)}`).join(", ")}`;
|
|
10585
11141
|
}
|
|
10586
11142
|
function formatPackageDatasetSummaryLines(summary, indent = " ") {
|
|
10587
|
-
const
|
|
10588
|
-
const columnStats = readRecord(
|
|
10589
|
-
if (!
|
|
11143
|
+
const record5 = readRecord(summary);
|
|
11144
|
+
const columnStats = readRecord(record5?.columnStats);
|
|
11145
|
+
if (!record5 || !columnStats) {
|
|
10590
11146
|
return [];
|
|
10591
11147
|
}
|
|
10592
11148
|
const lines = [];
|
|
10593
|
-
const rowCounts = readRecord(
|
|
11149
|
+
const rowCounts = readRecord(record5.rowCounts);
|
|
10594
11150
|
if (rowCounts) {
|
|
10595
11151
|
const persisted = readNonNegativeInteger(rowCounts.persisted);
|
|
10596
11152
|
const succeeded = readNonNegativeInteger(rowCounts.succeeded);
|
|
@@ -10606,7 +11162,7 @@ function formatPackageDatasetSummaryLines(summary, indent = " ") {
|
|
|
10606
11162
|
}
|
|
10607
11163
|
}
|
|
10608
11164
|
const parts = formatSummaryScalarParts(
|
|
10609
|
-
|
|
11165
|
+
record5,
|
|
10610
11166
|
/* @__PURE__ */ new Set(["columnStats", "rowCounts"])
|
|
10611
11167
|
);
|
|
10612
11168
|
if (parts.length > 0) {
|
|
@@ -10636,35 +11192,35 @@ function actionToCommand(action) {
|
|
|
10636
11192
|
if (!action || typeof action !== "object" || Array.isArray(action)) {
|
|
10637
11193
|
return null;
|
|
10638
11194
|
}
|
|
10639
|
-
const
|
|
10640
|
-
if (typeof
|
|
10641
|
-
return
|
|
11195
|
+
const record5 = action;
|
|
11196
|
+
if (typeof record5.command === "string" && record5.command.trim()) {
|
|
11197
|
+
return record5.command.trim();
|
|
10642
11198
|
}
|
|
10643
|
-
if (
|
|
10644
|
-
return `deepline runs get ${
|
|
11199
|
+
if (record5.kind === "deepline_run_inspect" && typeof record5.runId === "string") {
|
|
11200
|
+
return `deepline runs get ${record5.runId}`;
|
|
10645
11201
|
}
|
|
10646
|
-
if (
|
|
10647
|
-
return `deepline runs get ${
|
|
11202
|
+
if (record5.kind === "deepline_run_full" && typeof record5.runId === "string") {
|
|
11203
|
+
return `deepline runs get ${record5.runId} --full`;
|
|
10648
11204
|
}
|
|
10649
|
-
if (
|
|
10650
|
-
return `deepline billing usage --run-id ${
|
|
11205
|
+
if (record5.kind === "deepline_run_billing" && typeof record5.runId === "string") {
|
|
11206
|
+
return `deepline billing usage --run-id ${record5.runId}`;
|
|
10651
11207
|
}
|
|
10652
|
-
if (
|
|
10653
|
-
return `deepline runs export ${
|
|
10654
|
-
|
|
10655
|
-
)} --out ${shellQuote(`${
|
|
11208
|
+
if (record5.kind === "deepline_run_export" && typeof record5.runId === "string" && typeof record5.datasetPath === "string") {
|
|
11209
|
+
return `deepline runs export ${record5.runId} --dataset ${shellQuote(
|
|
11210
|
+
record5.datasetPath
|
|
11211
|
+
)} --out ${shellQuote(`${record5.datasetPath.split(".").pop() || "dataset"}.csv`)}`;
|
|
10656
11212
|
}
|
|
10657
|
-
if (
|
|
10658
|
-
if (typeof
|
|
10659
|
-
return
|
|
11213
|
+
if (record5.kind === "deepline_run_logs") {
|
|
11214
|
+
if (typeof record5.command === "string" && record5.command.trim()) {
|
|
11215
|
+
return record5.command;
|
|
10660
11216
|
}
|
|
10661
|
-
if (typeof
|
|
10662
|
-
return
|
|
11217
|
+
if (typeof record5.runId === "string") {
|
|
11218
|
+
return record5.view === "failed" ? `deepline runs logs ${record5.runId} --failed` : `deepline runs logs ${record5.runId}`;
|
|
10663
11219
|
}
|
|
10664
11220
|
}
|
|
10665
|
-
if (
|
|
10666
|
-
const maxRows = typeof
|
|
10667
|
-
return `deepline db query --sql ${shellQuote(
|
|
11221
|
+
if (record5.kind === "deepline_db_query" && typeof record5.sql === "string") {
|
|
11222
|
+
const maxRows = typeof record5.maxRows === "number" && Number.isFinite(record5.maxRows) ? Math.trunc(record5.maxRows) : 20;
|
|
11223
|
+
return `deepline db query --sql ${shellQuote(record5.sql)} --max-rows ${maxRows}`;
|
|
10668
11224
|
}
|
|
10669
11225
|
return null;
|
|
10670
11226
|
}
|
|
@@ -10863,8 +11419,8 @@ function formatPackageValueOutputLines(packaged) {
|
|
|
10863
11419
|
const outputs = packaged.outputs && typeof packaged.outputs === "object" && !Array.isArray(packaged.outputs) ? packaged.outputs : null;
|
|
10864
11420
|
if (!outputs) return [];
|
|
10865
11421
|
const returned = Object.entries(outputs).filter(([, output]) => {
|
|
10866
|
-
const
|
|
10867
|
-
return
|
|
11422
|
+
const record5 = readRecord(output);
|
|
11423
|
+
return record5?.kind === "dataset" || record5?.kind === "value" && Object.prototype.hasOwnProperty.call(record5, "value");
|
|
10868
11424
|
});
|
|
10869
11425
|
if (returned.length === 0) return [];
|
|
10870
11426
|
const datasets = packageDatasetRecords(packaged);
|
|
@@ -11589,12 +12145,12 @@ function exportableSheetRow(row) {
|
|
|
11589
12145
|
if (!row || typeof row !== "object" || Array.isArray(row)) {
|
|
11590
12146
|
return null;
|
|
11591
12147
|
}
|
|
11592
|
-
const
|
|
11593
|
-
const data =
|
|
12148
|
+
const record5 = row;
|
|
12149
|
+
const data = record5.data;
|
|
11594
12150
|
if (data && typeof data === "object" && !Array.isArray(data)) {
|
|
11595
12151
|
return data;
|
|
11596
12152
|
}
|
|
11597
|
-
const fallback = { ...
|
|
12153
|
+
const fallback = { ...record5 };
|
|
11598
12154
|
for (const key of [
|
|
11599
12155
|
"key",
|
|
11600
12156
|
"status",
|
|
@@ -12086,8 +12642,8 @@ var PLAY_SYNTAX_MIGRATION_ERROR_MARKERS = [
|
|
|
12086
12642
|
"ctx.map(...) has been replaced by ctx.dataset(...)",
|
|
12087
12643
|
"Dataset .step(...) has been replaced by .withColumn(...)"
|
|
12088
12644
|
];
|
|
12089
|
-
function stringArrayField(
|
|
12090
|
-
const value =
|
|
12645
|
+
function stringArrayField(record5, key) {
|
|
12646
|
+
const value = record5[key];
|
|
12091
12647
|
if (!Array.isArray(value)) return [];
|
|
12092
12648
|
return value.filter((entry) => typeof entry === "string");
|
|
12093
12649
|
}
|
|
@@ -12167,17 +12723,17 @@ function renderServerResultView(value) {
|
|
|
12167
12723
|
const renderedActions = Array.isArray(view.render?.actions) ? view.render.actions : [];
|
|
12168
12724
|
if (renderedSections.length > 0 || renderedActions.length > 0) {
|
|
12169
12725
|
const lines2 = [];
|
|
12170
|
-
for (const
|
|
12171
|
-
if (typeof
|
|
12726
|
+
for (const section2 of renderedSections) {
|
|
12727
|
+
if (typeof section2.title !== "string") {
|
|
12172
12728
|
continue;
|
|
12173
12729
|
}
|
|
12174
|
-
const sectionLines = Array.isArray(
|
|
12730
|
+
const sectionLines = Array.isArray(section2.lines) ? section2.lines.filter(
|
|
12175
12731
|
(line) => typeof line === "string"
|
|
12176
12732
|
) : [];
|
|
12177
12733
|
if (sectionLines.length === 0) {
|
|
12178
12734
|
continue;
|
|
12179
12735
|
}
|
|
12180
|
-
lines2.push(` ${
|
|
12736
|
+
lines2.push(` ${section2.title}:`);
|
|
12181
12737
|
lines2.push(...sectionLines.map((line) => ` ${line}`));
|
|
12182
12738
|
}
|
|
12183
12739
|
const actions2 = renderedActions.filter(
|
|
@@ -12529,27 +13085,6 @@ function checkHintExpression(value) {
|
|
|
12529
13085
|
function checkHintRawPath(value) {
|
|
12530
13086
|
return value?.startsWith("toolResponse.rawV2") ? value.replace(/^toolResponse\./, "result.toolResponse.") : void 0;
|
|
12531
13087
|
}
|
|
12532
|
-
function collectStaticPipelineToolIds(staticPipeline) {
|
|
12533
|
-
const seen = /* @__PURE__ */ new Set();
|
|
12534
|
-
const visitPipeline = (pipeline) => {
|
|
12535
|
-
if (!isRecord2(pipeline)) return;
|
|
12536
|
-
for (const step of [
|
|
12537
|
-
...asArray(pipeline.stages),
|
|
12538
|
-
...asArray(pipeline.substeps)
|
|
12539
|
-
]) {
|
|
12540
|
-
if (!isRecord2(step)) continue;
|
|
12541
|
-
if (step.type === "tool") {
|
|
12542
|
-
const toolId = stringValue2(step.toolId) || stringValue2(step.tool);
|
|
12543
|
-
if (toolId) seen.add(toolId);
|
|
12544
|
-
}
|
|
12545
|
-
if (step.type === "play_call") {
|
|
12546
|
-
visitPipeline(step.pipeline);
|
|
12547
|
-
}
|
|
12548
|
-
}
|
|
12549
|
-
};
|
|
12550
|
-
visitPipeline(staticPipeline);
|
|
12551
|
-
return [...seen].sort();
|
|
12552
|
-
}
|
|
12553
13088
|
function toolGetterHintFromMetadata(toolId, tool) {
|
|
12554
13089
|
const usageGuidance = isRecord2(tool.usageGuidance) ? tool.usageGuidance : {};
|
|
12555
13090
|
const resultGuidance = isRecord2(usageGuidance.toolExecutionResult) ? usageGuidance.toolExecutionResult : isRecord2(usageGuidance.tool_execution_result) ? usageGuidance.tool_execution_result : {};
|
|
@@ -12575,8 +13110,7 @@ function toolGetterHintFromMetadata(toolId, tool) {
|
|
|
12575
13110
|
raw: checkHintExpression(toolResponse.rawV2) || "result.toolResponse.rawV2"
|
|
12576
13111
|
};
|
|
12577
13112
|
}
|
|
12578
|
-
async function buildToolGetterHints(client,
|
|
12579
|
-
const toolIds = collectStaticPipelineToolIds(staticPipeline);
|
|
13113
|
+
async function buildToolGetterHints(client, toolIds) {
|
|
12580
13114
|
return Promise.all(
|
|
12581
13115
|
toolIds.map(async (toolId) => {
|
|
12582
13116
|
try {
|
|
@@ -12601,8 +13135,8 @@ function cronExecutionLabel(status) {
|
|
|
12601
13135
|
return status;
|
|
12602
13136
|
}
|
|
12603
13137
|
function readLiveCronMetadata(play) {
|
|
12604
|
-
const
|
|
12605
|
-
const metadata = readRecord(
|
|
13138
|
+
const record5 = readRecord(play);
|
|
13139
|
+
const metadata = readRecord(record5?.triggerMetadata);
|
|
12606
13140
|
return {
|
|
12607
13141
|
schedule: typeof metadata?.cronSchedule === "string" ? metadata.cronSchedule : null,
|
|
12608
13142
|
timezone: typeof metadata?.cronTimezone === "string" ? metadata.cronTimezone : null,
|
|
@@ -12744,7 +13278,11 @@ async function handlePlayCheck(args) {
|
|
|
12744
13278
|
}
|
|
12745
13279
|
const absolutePlayPath = resolve3(options.target);
|
|
12746
13280
|
const sourceCode = readFileSync2(absolutePlayPath, "utf-8");
|
|
12747
|
-
const outcomes = await checkPlayFileExports({
|
|
13281
|
+
const outcomes = await checkPlayFileExports({
|
|
13282
|
+
absolutePlayPath,
|
|
13283
|
+
sourceCode,
|
|
13284
|
+
full: options.full
|
|
13285
|
+
});
|
|
12748
13286
|
const primary = outcomes.find(
|
|
12749
13287
|
(outcome) => outcome.exportName === PLAY_DEFAULT_EXPORT
|
|
12750
13288
|
);
|
|
@@ -12752,13 +13290,15 @@ async function handlePlayCheck(args) {
|
|
|
12752
13290
|
outcomes,
|
|
12753
13291
|
target: options.target,
|
|
12754
13292
|
full: options.full,
|
|
12755
|
-
detailsCommand: `deepline plays check ${shellQuote(options.target)} --full`,
|
|
12756
13293
|
publishCommand: primary?.result.artifactHash ? `deepline plays publish ${shellQuote(options.target)} --expected-artifact ${primary.result.artifactHash}` : void 0
|
|
12757
13294
|
});
|
|
12758
13295
|
printCommandEnvelope(output, {
|
|
12759
13296
|
json: options.jsonOutput,
|
|
12760
13297
|
fields: options.jsonFields,
|
|
12761
|
-
|
|
13298
|
+
jsonLayout: "readable",
|
|
13299
|
+
text: renderPlayCheckOutput(output, checkedDocflows(outcomes), {
|
|
13300
|
+
full: options.full
|
|
13301
|
+
}) + "\n"
|
|
12762
13302
|
});
|
|
12763
13303
|
return output.valid ? 0 : 1;
|
|
12764
13304
|
}
|
|
@@ -12798,7 +13338,8 @@ async function checkPlayFileExports(input) {
|
|
|
12798
13338
|
absolutePlayPath: input.absolutePlayPath,
|
|
12799
13339
|
sourceCode: input.sourceCode,
|
|
12800
13340
|
exportName,
|
|
12801
|
-
client: input.client
|
|
13341
|
+
client: input.client,
|
|
13342
|
+
full: input.full
|
|
12802
13343
|
})
|
|
12803
13344
|
);
|
|
12804
13345
|
}
|
|
@@ -12831,7 +13372,8 @@ async function checkOneExportedPlay(input) {
|
|
|
12831
13372
|
rootPlayName: playName,
|
|
12832
13373
|
exportName,
|
|
12833
13374
|
integrationMode,
|
|
12834
|
-
prepareArtifact: artifactForProductionCompatibilityCheck
|
|
13375
|
+
prepareArtifact: artifactForProductionCompatibilityCheck,
|
|
13376
|
+
full: input.full
|
|
12835
13377
|
});
|
|
12836
13378
|
const importedPlayName = checked.failedChild?.playName;
|
|
12837
13379
|
const diagnosticPrefix = importedPlayName ? `Imported Play ${importedPlayName}: ` : "";
|
|
@@ -12857,7 +13399,12 @@ async function checkOneExportedPlay(input) {
|
|
|
12857
13399
|
message: `${diagnosticPrefix}${issue.message}`
|
|
12858
13400
|
}))
|
|
12859
13401
|
} : {},
|
|
12860
|
-
toolGetterHints: checked.result.toolGetterHints ?? (checked.failedChild ? [] : await buildToolGetterHints(
|
|
13402
|
+
toolGetterHints: checked.result.toolGetterHints ?? (checked.failedChild ? [] : await buildToolGetterHints(
|
|
13403
|
+
client,
|
|
13404
|
+
playCheckToolIds(
|
|
13405
|
+
checked.result
|
|
13406
|
+
)
|
|
13407
|
+
))
|
|
12861
13408
|
}
|
|
12862
13409
|
};
|
|
12863
13410
|
}
|
|
@@ -14647,7 +15194,7 @@ async function handleRunLogs(args) {
|
|
|
14647
15194
|
logs: `deepline runs logs ${result.runId} --out run.log --log-level ${logLevel}`
|
|
14648
15195
|
}
|
|
14649
15196
|
};
|
|
14650
|
-
const
|
|
15197
|
+
const text3 = buildRunLogsText(filteredResult);
|
|
14651
15198
|
printCommandEnvelope(
|
|
14652
15199
|
{
|
|
14653
15200
|
runId: result.runId,
|
|
@@ -14673,7 +15220,7 @@ async function handleRunLogs(args) {
|
|
|
14673
15220
|
},
|
|
14674
15221
|
{
|
|
14675
15222
|
json: argsWantJson(args),
|
|
14676
|
-
text
|
|
15223
|
+
text: text3
|
|
14677
15224
|
}
|
|
14678
15225
|
);
|
|
14679
15226
|
return 0;
|
|
@@ -17006,7 +17553,7 @@ Examples:
|
|
|
17006
17553
|
process.exitCode = await ownView();
|
|
17007
17554
|
return;
|
|
17008
17555
|
}
|
|
17009
|
-
const { describeAnything } = await import("./describe-
|
|
17556
|
+
const { describeAnything } = await import("./describe-OVFPRJJL.mjs");
|
|
17010
17557
|
process.exitCode = await describeAnything(
|
|
17011
17558
|
name,
|
|
17012
17559
|
{
|
|
@@ -17349,7 +17896,7 @@ Examples:
|
|
|
17349
17896
|
new Option2("--log-failed", "Attach terminal-failure logs").hideHelp()
|
|
17350
17897
|
).action(async (runId, options) => {
|
|
17351
17898
|
if (TOOL_EXECUTION_ID.test(runId)) {
|
|
17352
|
-
const { getToolExecutionReceipt } = await import("./tools-
|
|
17899
|
+
const { getToolExecutionReceipt } = await import("./tools-4FKPCRD7.mjs");
|
|
17353
17900
|
process.exitCode = await getToolExecutionReceipt(runId, {
|
|
17354
17901
|
receiptJson: options.json !== void 0
|
|
17355
17902
|
});
|