deepline 0.3.315 → 0.3.316
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/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/runs/overview.ts +17 -10
- package/dist/bundling-sources/sdk/src/types.ts +6 -5
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +217 -488
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +15 -0
- package/dist/bundling-sources/shared_libs/play-runtime/execution-capabilities.ts +4 -1
- package/dist/bundling-sources/shared_libs/play-runtime/internal-bootstrap-token.ts +13 -4
- package/dist/bundling-sources/shared_libs/play-runtime/launch-identity.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/live-events.ts +31 -0
- package/dist/bundling-sources/shared_libs/play-runtime/map-execution-frame.ts +444 -51
- package/dist/bundling-sources/shared_libs/play-runtime/run-snapshot-stream.ts +22 -43
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +4 -3
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +136 -87
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-authority.ts +24 -6
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-operation-contract.ts +56 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-sheet-errors.ts +94 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-shared.ts +5 -2
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd.ts +20 -11
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts +18 -12
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +112 -9
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-dispatch-authority.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/work-receipt-storage-contract.ts +13 -0
- package/dist/bundling-sources/shared_libs/play-runtime/workflow-executor-auth.ts +2 -0
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +3 -2
- package/dist/cli/{auth-OVWOO5NP.mjs → auth-JP7ZJ4OI.mjs} +4 -4
- package/dist/cli/auth-SPUJ4EXC.js +31 -0
- package/dist/cli/{billing-W3OXKWNE.mjs → billing-KG6MC2BC.mjs} +4 -4
- package/dist/cli/{billing-SRZL7UOH.js → billing-WZGS32ME.js} +70 -70
- package/dist/cli/{chunk-OJ243ZA5.js → chunk-2HKPAZVJ.js} +1 -1
- package/dist/cli/{chunk-FGAK6FET.js → chunk-35YXDTOB.js} +26 -26
- package/dist/cli/{chunk-HNKHMHJ7.mjs → chunk-46ZOD4PQ.mjs} +1 -1
- package/dist/cli/{chunk-AO4IWPP7.mjs → chunk-6R5ACEWN.mjs} +17 -15
- package/dist/cli/{chunk-US4S3E4Y.mjs → chunk-7PZFGB7L.mjs} +1 -1
- package/dist/cli/{chunk-B473QUQU.mjs → chunk-AXAPMVUC.mjs} +4 -4
- package/dist/cli/{chunk-C5WSTXUB.js → chunk-B6OOVO3A.js} +537 -535
- package/dist/cli/{chunk-OJP4FCCX.js → chunk-BOKHMPCZ.js} +48 -48
- package/dist/cli/{chunk-6BJACIVK.js → chunk-C6QGM72M.js} +1 -1
- package/dist/cli/{chunk-IGE7EJJY.mjs → chunk-D3NMIACS.mjs} +19 -15
- package/dist/cli/{chunk-FTJQO757.mjs → chunk-DAFGPNVW.mjs} +1 -1
- package/dist/cli/{chunk-JF4O5OMH.mjs → chunk-F2T5UENG.mjs} +1 -1
- package/dist/cli/{chunk-TQK662WG.js → chunk-G2G67D3L.js} +60 -60
- package/dist/cli/{chunk-Y42UERUY.js → chunk-GHLWDXUB.js} +6 -6
- package/dist/cli/{chunk-AZWQJAQF.mjs → chunk-IDSDRGKF.mjs} +1 -1
- package/dist/cli/{chunk-TZ5KUDPP.mjs → chunk-J3ZPMADG.mjs} +1 -1
- package/dist/cli/{chunk-VYK23G2C.js → chunk-K3BIRBT3.js} +239 -235
- package/dist/cli/{chunk-N5V2SBB2.mjs → chunk-KP7W5NO6.mjs} +1 -1
- package/dist/cli/{chunk-URVZGYGG.js → chunk-MCPHK7AF.js} +4 -4
- package/dist/cli/{chunk-TQ3F77AC.mjs → chunk-OB3SYJGU.mjs} +3 -3
- package/dist/cli/{chunk-YL42TF53.js → chunk-PJERS5VW.js} +6 -6
- package/dist/cli/{chunk-PPONZ6IE.js → chunk-RBBSRB56.js} +15 -15
- package/dist/cli/{chunk-SNFSO2AN.js → chunk-SRUWVQ66.js} +6 -6
- package/dist/cli/{chunk-L5TSFCJ6.mjs → chunk-TYSAKSX7.mjs} +2 -2
- package/dist/cli/{chunk-OUIIYFG3.mjs → chunk-VC25WFXV.mjs} +2 -2
- package/dist/cli/{chunk-R3IFZDJL.mjs → chunk-VDPBQCRQ.mjs} +2 -2
- package/dist/cli/{chunk-IALPYID6.js → chunk-XSEMQ4II.js} +3 -3
- package/dist/cli/{chunk-LOWURQMF.js → chunk-YEMOOWZI.js} +50 -50
- package/dist/cli/{chunk-GK67FYMS.mjs → chunk-YNSAVFWL.mjs} +5 -5
- package/dist/cli/{chunk-OYJCNCUW.js → chunk-ZNHGAWYI.js} +2 -2
- package/dist/cli/client-GMMPQT7B.js +20 -0
- package/dist/cli/{client-WQ3J5BSH.mjs → client-MNPM4ME3.mjs} +3 -3
- package/dist/cli/{csv-CENMEWDH.js → csv-G72FIQWI.js} +12 -12
- package/dist/cli/{csv-36ARCBNQ.mjs → csv-ZME7HAPR.mjs} +3 -3
- package/dist/cli/{db-JU7XLKQM.mjs → db-K2DS4PEY.mjs} +4 -4
- package/dist/cli/{db-6DQZG6NB.js → db-KRBWHSMA.js} +20 -20
- package/dist/cli/{describe-34ALEEFO.mjs → describe-LXBJP6OP.mjs} +10 -10
- package/dist/cli/{describe-VUD4AFBY.js → describe-UKFV376D.js} +17 -17
- package/dist/cli/{executions-H66BMN6N.mjs → executions-2V3AROY6.mjs} +4 -4
- package/dist/cli/{executions-H2UXS6FP.js → executions-E66AM4JU.js} +6 -6
- package/dist/cli/{feedback-YSYFQSAB.js → feedback-7C2N7M37.js} +6 -6
- package/dist/cli/{feedback-Q7LXXLSH.mjs → feedback-IEPZ2XKZ.mjs} +3 -3
- package/dist/cli/{git-XV43NSWN.mjs → git-AR5KGN4O.mjs} +4 -4
- package/dist/cli/git-EXYB66IH.js +23 -0
- package/dist/cli/index.js +171 -98
- package/dist/cli/index.mjs +114 -41
- package/dist/cli/{legacy-noops-RGDW6SCA.js → legacy-noops-A2SH45P4.js} +7 -7
- package/dist/cli/{legacy-noops-Z2DTZQN3.mjs → legacy-noops-LC2EGAZU.mjs} +4 -4
- package/dist/cli/{monitors-OFQ56O4S.mjs → monitors-5YPW3IZQ.mjs} +4 -4
- package/dist/cli/{monitors-I75KZ2BP.js → monitors-IZBUPKPW.js} +85 -85
- package/dist/cli/{org-ZYMCU6XO.mjs → org-2OMYI5KJ.mjs} +4 -4
- package/dist/cli/{org-75AH6RIB.js → org-L42SQ65U.js} +60 -60
- package/dist/cli/play-CQI3IDDN.js +152 -0
- package/dist/cli/{play-BKXM76DV.mjs → play-UPCBLAOH.mjs} +9 -9
- package/dist/cli/{providers-Z77MM7ID.js → providers-GGNDWUKB.js} +7 -7
- package/dist/cli/{providers-GWG2WFIY.mjs → providers-VE2RM56M.mjs} +4 -4
- package/dist/cli/{quickstart-I4RECIQC.js → quickstart-4CZHURUX.js} +5 -5
- package/dist/cli/{quickstart-BGVIV374.mjs → quickstart-HSJ7FU7Z.mjs} +3 -3
- package/dist/cli/{search-TIKBP3RE.mjs → search-MWBM3I2L.mjs} +5 -5
- package/dist/cli/search-PD5FBCUN.js +26 -0
- package/dist/cli/{secrets-SNGRI4KS.js → secrets-CWBPGDZV.js} +13 -13
- package/dist/cli/{secrets-YCHKLWKC.mjs → secrets-W5DQYKGU.mjs} +4 -4
- package/dist/cli/{sessions-WXLADGDX.js → sessions-EDCFU6P2.js} +5 -5
- package/dist/cli/{sessions-IRDG6ZRX.mjs → sessions-Q42GUYTF.mjs} +4 -4
- package/dist/cli/{settings-72J4BVF6.js → settings-OKRENZGX.js} +74 -74
- package/dist/cli/{settings-KZALJDXW.mjs → settings-SO56AJPQ.mjs} +7 -7
- package/dist/cli/{setup-FFB3KLFD.js → setup-7PLHLNLS.js} +41 -41
- package/dist/cli/{setup-4KCA7ESV.mjs → setup-OTYMF5CZ.mjs} +6 -6
- package/dist/cli/{skills-MQZPYUQ3.mjs → skills-4UFS4FXP.mjs} +4 -4
- package/dist/cli/skills-IP7IW7EQ.js +28 -0
- package/dist/cli/{tools-M3WKRZ5T.mjs → tools-6FV543YV.mjs} +6 -6
- package/dist/cli/tools-A2YNR6PI.js +38 -0
- package/dist/cli/{update-QJMNYGNF.mjs → update-6POGDXYW.mjs} +6 -6
- package/dist/cli/update-QXSGKLJG.js +28 -0
- package/dist/cli/{workflow-6T2EUFCN.mjs → workflow-HVZSFWYR.mjs} +5 -5
- package/dist/cli/{workflow-35UUOZ5E.js → workflow-RB4POZP5.js} +15 -15
- package/dist/{client-Dh_4Ph1R.d.ts → client-BV68GMPo.d.ts} +7 -6
- package/dist/{client-CvpZsBqt.d.mts → client-D9ACjiRC.d.mts} +7 -6
- package/dist/{compiler-manifest-wOKNiXpa.d.mts → compiler-manifest-BXcZ4P4W.d.mts} +2 -2
- package/dist/{compiler-manifest-wOKNiXpa.d.ts → compiler-manifest-BXcZ4P4W.d.ts} +2 -2
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +7 -7
- package/dist/index.mjs +4 -4
- package/dist/install-integrity.json +82 -82
- package/dist/plays/bundle-play-file.d.mts +2 -2
- package/dist/plays/bundle-play-file.d.ts +2 -2
- package/dist/plays/bundle-play-file.mjs +2 -2
- package/dist/plays/run-request.d.mts +2 -2
- package/dist/plays/run-request.d.ts +2 -2
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/package.json +1 -1
- package/dist/cli/auth-P2TTZU36.js +0 -31
- package/dist/cli/client-CXFPFCIG.js +0 -20
- package/dist/cli/git-SYFCYIFP.js +0 -23
- package/dist/cli/play-OKXUWPMO.js +0 -152
- package/dist/cli/search-3KISUDDT.js +0 -26
- package/dist/cli/skills-XGOK4GRW.js +0 -28
- package/dist/cli/tools-LEAJ7EPW.js +0 -38
- package/dist/cli/update-ZN6LDUHS.js +0 -28
package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RUN_EVENT_KIND } from '../run-event-catalog';
|
|
2
|
+
import { normalizeTableNamespace } from '../../plays/row-identity';
|
|
2
3
|
/**
|
|
3
4
|
* Live step/progress ledger reporting for Node runtime workers.
|
|
4
5
|
*
|
|
@@ -109,7 +110,7 @@ export function buildOrderedNodeList(
|
|
|
109
110
|
}));
|
|
110
111
|
}
|
|
111
112
|
|
|
112
|
-
/**
|
|
113
|
+
/** Keep authored node identity separate from the normalized Runtime Sheet namespace. */
|
|
113
114
|
type StaticDatasetNodeRef = {
|
|
114
115
|
nodeId: string;
|
|
115
116
|
logicalNamespace: string;
|
|
@@ -129,10 +130,16 @@ function buildMapNodeLookup(
|
|
|
129
130
|
for (let index = 0; index < substeps.length; index += 1) {
|
|
130
131
|
const substep = substeps[index]!;
|
|
131
132
|
if (substep.type !== 'dataset') continue;
|
|
132
|
-
const
|
|
133
|
-
|
|
133
|
+
const staticNamespace = substep.tableNamespace?.trim();
|
|
134
|
+
const logicalNamespace = staticNamespace || substep.field.trim();
|
|
134
135
|
if (!logicalNamespace) continue;
|
|
135
|
-
|
|
136
|
+
// Literal dataset keys share the Runtime Sheet namespace contract. A legacy
|
|
137
|
+
// field-only label can be source-expression text, so retain its existing
|
|
138
|
+
// lookup behavior rather than validating or guessing a physical identity.
|
|
139
|
+
const lookupNamespace = staticNamespace
|
|
140
|
+
? normalizeTableNamespace(staticNamespace)
|
|
141
|
+
: logicalNamespace;
|
|
142
|
+
lookup.set(lookupNamespace, {
|
|
136
143
|
nodeId: getStaticSubstepNodeId(substep, index),
|
|
137
144
|
logicalNamespace,
|
|
138
145
|
});
|
|
@@ -140,6 +147,7 @@ function buildMapNodeLookup(
|
|
|
140
147
|
return lookup;
|
|
141
148
|
}
|
|
142
149
|
|
|
150
|
+
/** Resolve normalized literal dataset namespaces to unchanged authored node IDs. */
|
|
143
151
|
export function buildMapNodeIdLookup(
|
|
144
152
|
contractSnapshot: unknown,
|
|
145
153
|
): Map<string, string> {
|
|
@@ -1219,23 +1227,21 @@ export function createPostgresSchedulerProgressReporter(input: {
|
|
|
1219
1227
|
) {
|
|
1220
1228
|
mapsWithResolverActivity.delete(nodeId);
|
|
1221
1229
|
stepLifecycle.onMapStarted(nodeId);
|
|
1230
|
+
const failedRows = 'failedRows' in event ? (event.failedRows ?? 0) : 0;
|
|
1231
|
+
const startedRows =
|
|
1232
|
+
event.completedRows + failedRows + (event.supersededRows ?? 0);
|
|
1222
1233
|
setNodeProgress(nodeId, {
|
|
1223
1234
|
completed: event.completedRows,
|
|
1224
|
-
failed:
|
|
1235
|
+
failed: failedRows,
|
|
1225
1236
|
total: eventTotalRows,
|
|
1226
1237
|
rowActivitySource: 'map_start',
|
|
1227
1238
|
rowActivityStartedAt: event.at,
|
|
1228
1239
|
rowActivityObservedAt: event.at,
|
|
1229
|
-
startedRows
|
|
1240
|
+
startedRows,
|
|
1230
1241
|
activeRows: 0,
|
|
1231
1242
|
waitingRows:
|
|
1232
1243
|
typeof eventTotalRows === 'number'
|
|
1233
|
-
? Math.max(
|
|
1234
|
-
0,
|
|
1235
|
-
eventTotalRows -
|
|
1236
|
-
event.completedRows -
|
|
1237
|
-
(event.supersededRows ?? 0),
|
|
1238
|
-
)
|
|
1244
|
+
? Math.max(0, eventTotalRows - startedRows)
|
|
1239
1245
|
: undefined,
|
|
1240
1246
|
completedRows: event.completedRows,
|
|
1241
1247
|
...(event.supersededRows !== undefined
|
|
@@ -32,7 +32,10 @@ import type {
|
|
|
32
32
|
PlayRunnerResult,
|
|
33
33
|
PlayRunnerRuntimeTiming,
|
|
34
34
|
} from '../protocol';
|
|
35
|
-
import {
|
|
35
|
+
import {
|
|
36
|
+
normalizeRuntimeSchedulerSchema,
|
|
37
|
+
PROD_DEFAULT_RUNTIME_SCHEDULER_SCHEMA,
|
|
38
|
+
} from '../runtime-scheduler-topology';
|
|
36
39
|
import {
|
|
37
40
|
RUNTIME_EVENT_CANONICAL_RETENTION_INDEX_READY_MARKER,
|
|
38
41
|
RUNTIME_EVENT_DEFERRED_PROJECTION_FIELD,
|
|
@@ -20480,6 +20483,7 @@ async function dispatchRunLedgerOutboxBatchWithScope(
|
|
|
20480
20483
|
tokenAuthority,
|
|
20481
20484
|
options,
|
|
20482
20485
|
input.runtimeApi?.signal,
|
|
20486
|
+
reuseMarginMs,
|
|
20483
20487
|
)
|
|
20484
20488
|
: loadPostgresSchedulerRuntimeApiForRun(
|
|
20485
20489
|
withClient,
|
|
@@ -20490,6 +20494,7 @@ async function dispatchRunLedgerOutboxBatchWithScope(
|
|
|
20490
20494
|
tokenAuthority,
|
|
20491
20495
|
options,
|
|
20492
20496
|
input.runtimeApi?.signal,
|
|
20497
|
+
reuseMarginMs,
|
|
20493
20498
|
);
|
|
20494
20499
|
const gatewayRuntimeApi =
|
|
20495
20500
|
needsRuntimeApi && tokenAuthority === 'gateway'
|
|
@@ -20645,6 +20650,7 @@ async function dispatchRunLedgerOutboxBatchWithScope(
|
|
|
20645
20650
|
tokenAuthority,
|
|
20646
20651
|
options,
|
|
20647
20652
|
runtimeApi.signal,
|
|
20653
|
+
reuseMarginMs,
|
|
20648
20654
|
);
|
|
20649
20655
|
if (refreshed.baseUrl !== runtimeApi.baseUrl) {
|
|
20650
20656
|
throw new Error(
|
|
@@ -21373,6 +21379,7 @@ async function resolvePostgresSchedulerRuntimeApiForRun(
|
|
|
21373
21379
|
tokenAuthority: RunLedgerOutboxTokenAuthority,
|
|
21374
21380
|
options?: Pick<PostgresSchedulerOptions, 'schema'>,
|
|
21375
21381
|
signal?: AbortSignal,
|
|
21382
|
+
tokenReuseMarginMs = 0,
|
|
21376
21383
|
): Promise<
|
|
21377
21384
|
WorkerRuntimeApiContext & {
|
|
21378
21385
|
refreshExecutorToken?: () => Promise<string>;
|
|
@@ -21414,18 +21421,37 @@ async function resolvePostgresSchedulerRuntimeApiForRun(
|
|
|
21414
21421
|
schedulerSchema: options?.schema ?? null,
|
|
21415
21422
|
signal,
|
|
21416
21423
|
};
|
|
21417
|
-
const
|
|
21418
|
-
|
|
21419
|
-
|
|
21420
|
-
|
|
21421
|
-
|
|
21424
|
+
const preMintedToken = usableRunLedgerExecutorToken(
|
|
21425
|
+
launch,
|
|
21426
|
+
tokenReuseMarginMs,
|
|
21427
|
+
options,
|
|
21428
|
+
);
|
|
21429
|
+
if (preMintedToken) {
|
|
21430
|
+
// Admission minted this token with only `run.ledger.project`.
|
|
21431
|
+
// Each projection request still proves its exact outbox lease at the
|
|
21432
|
+
// receiver, and the scheduler ACK remains fenced to that same lease.
|
|
21433
|
+
executorToken = preMintedToken.executorToken;
|
|
21434
|
+
// The issuer advertises its own immutable receiver in the signed token.
|
|
21435
|
+
// Merely targeting an immutable URL never proves receipt support.
|
|
21436
|
+
runLedgerIngressPrefixBatching =
|
|
21437
|
+
preMintedToken.runLedgerIngressPrefixBatching;
|
|
21422
21438
|
refreshExecutorToken = async () =>
|
|
21423
21439
|
(await requestRunLedgerDispatchToken(dispatchRequest, true))
|
|
21424
21440
|
.executorToken;
|
|
21441
|
+
} else {
|
|
21442
|
+
const dispatchAuthority =
|
|
21443
|
+
await requestRunLedgerDispatchToken(dispatchRequest);
|
|
21444
|
+
invalidateExecutorToken = () =>
|
|
21445
|
+
runLedgerDispatchTokens.delete(dispatchAuthority.cacheKey);
|
|
21446
|
+
if (dispatchAuthority.reused) {
|
|
21447
|
+
refreshExecutorToken = async () =>
|
|
21448
|
+
(await requestRunLedgerDispatchToken(dispatchRequest, true))
|
|
21449
|
+
.executorToken;
|
|
21450
|
+
}
|
|
21451
|
+
executorToken = dispatchAuthority.executorToken;
|
|
21452
|
+
runLedgerIngressPrefixBatching =
|
|
21453
|
+
dispatchAuthority.runLedgerIngressPrefixBatching;
|
|
21425
21454
|
}
|
|
21426
|
-
executorToken = dispatchAuthority.executorToken;
|
|
21427
|
-
runLedgerIngressPrefixBatching =
|
|
21428
|
-
dispatchAuthority.runLedgerIngressPrefixBatching;
|
|
21429
21455
|
}
|
|
21430
21456
|
return {
|
|
21431
21457
|
baseUrl: runtimeApiBaseUrlFromLaunch(launch),
|
|
@@ -21448,6 +21474,7 @@ async function loadPostgresSchedulerRuntimeApiForRun(
|
|
|
21448
21474
|
tokenAuthority: RunLedgerOutboxTokenAuthority,
|
|
21449
21475
|
options?: Pick<PostgresSchedulerOptions, 'schema'>,
|
|
21450
21476
|
signal?: AbortSignal,
|
|
21477
|
+
tokenReuseMarginMs = 0,
|
|
21451
21478
|
): ReturnType<typeof resolvePostgresSchedulerRuntimeApiForRun> {
|
|
21452
21479
|
// A continuation already owns its next event lease, so its launch context
|
|
21453
21480
|
// is not part of the preclaim result. Load only the authority fields here.
|
|
@@ -21467,9 +21494,85 @@ async function loadPostgresSchedulerRuntimeApiForRun(
|
|
|
21467
21494
|
tokenAuthority,
|
|
21468
21495
|
options,
|
|
21469
21496
|
signal,
|
|
21497
|
+
tokenReuseMarginMs,
|
|
21470
21498
|
);
|
|
21471
21499
|
}
|
|
21472
21500
|
|
|
21501
|
+
/**
|
|
21502
|
+
* Admission persists an optional, run-scoped `run.ledger.project` token for the
|
|
21503
|
+
* worker's terminal fast path. Treat it as usable only when its decoded claims
|
|
21504
|
+
* match the exact durable launch contract and it has enough time left for a
|
|
21505
|
+
* complete projection. The app runtime still verifies the signature, action
|
|
21506
|
+
* capability, and live outbox lease before writing; a mismatch falls back to
|
|
21507
|
+
* the lease-validated mint endpoint. Prefix grouping additionally requires the
|
|
21508
|
+
* issuer's explicit advertisement to match the launch's immutable receiver;
|
|
21509
|
+
* its absence preserves legacy grouping without discarding the usable token.
|
|
21510
|
+
*/
|
|
21511
|
+
function usableRunLedgerExecutorToken(
|
|
21512
|
+
launch: RunLedgerDispatchLaunch,
|
|
21513
|
+
reuseMarginMs: number,
|
|
21514
|
+
options?: Pick<PostgresSchedulerOptions, 'schema'>,
|
|
21515
|
+
): {
|
|
21516
|
+
executorToken: string;
|
|
21517
|
+
runLedgerIngressPrefixBatching?: true;
|
|
21518
|
+
} | null {
|
|
21519
|
+
const token = launch.runLedgerExecutorToken;
|
|
21520
|
+
if (!token || typeof token !== 'string') return null;
|
|
21521
|
+
|
|
21522
|
+
try {
|
|
21523
|
+
const claims = decodeJwt(token) as Record<string, unknown>;
|
|
21524
|
+
const authority = launch.runtimeAuthority;
|
|
21525
|
+
if (!authority || typeof authority !== 'object') return null;
|
|
21526
|
+
|
|
21527
|
+
const expiresAtMs =
|
|
21528
|
+
typeof claims.exp === 'number' &&
|
|
21529
|
+
Number.isSafeInteger(claims.exp) &&
|
|
21530
|
+
Number.isSafeInteger(claims.exp * 1_000)
|
|
21531
|
+
? claims.exp * 1_000
|
|
21532
|
+
: null;
|
|
21533
|
+
const expectedOrigin = new URL(runtimeTokenOriginFromLaunch(launch)).origin;
|
|
21534
|
+
const expectedSchedulerSchema = normalizeRuntimeSchedulerSchema(
|
|
21535
|
+
authority.schedulerSchema,
|
|
21536
|
+
);
|
|
21537
|
+
const requestedSchedulerSchema = normalizeRuntimeSchedulerSchema(
|
|
21538
|
+
options?.schema,
|
|
21539
|
+
);
|
|
21540
|
+
|
|
21541
|
+
if (
|
|
21542
|
+
expiresAtMs === null ||
|
|
21543
|
+
expiresAtMs <= Date.now() + reuseMarginMs ||
|
|
21544
|
+
claims.iss !== 'deepline.internal' ||
|
|
21545
|
+
claims.aud !== 'deepline.workflow.execution' ||
|
|
21546
|
+
claims.purpose !== 'workflow_run_execution' ||
|
|
21547
|
+
claims.org_id !== launch.orgId ||
|
|
21548
|
+
claims.org_id !== authority.orgId ||
|
|
21549
|
+
claims.run_id !== launch.runId ||
|
|
21550
|
+
claims.run_id !== authority.runId ||
|
|
21551
|
+
claims.workflow_id !== authority.workflowId ||
|
|
21552
|
+
claims.runtime_origin !== expectedOrigin ||
|
|
21553
|
+
normalizeRuntimeSchedulerSchema(claims.scheduler_schema) !==
|
|
21554
|
+
expectedSchedulerSchema ||
|
|
21555
|
+
(requestedSchedulerSchema !== null &&
|
|
21556
|
+
requestedSchedulerSchema !== expectedSchedulerSchema) ||
|
|
21557
|
+
!Array.isArray(claims.capabilities) ||
|
|
21558
|
+
claims.capabilities.length !== 1 ||
|
|
21559
|
+
claims.capabilities[0] !== 'run.ledger.project'
|
|
21560
|
+
) {
|
|
21561
|
+
return null;
|
|
21562
|
+
}
|
|
21563
|
+
const receiverOrigin = new URL(runtimeApiBaseUrlFromLaunch(launch)).origin;
|
|
21564
|
+
return {
|
|
21565
|
+
executorToken: token,
|
|
21566
|
+
...(claims.run_ledger_ingress_prefix_origin === receiverOrigin &&
|
|
21567
|
+
isImmutableRuntimeExecutionRecoveryOrigin(receiverOrigin)
|
|
21568
|
+
? { runLedgerIngressPrefixBatching: true as const }
|
|
21569
|
+
: {}),
|
|
21570
|
+
};
|
|
21571
|
+
} catch {
|
|
21572
|
+
return null;
|
|
21573
|
+
}
|
|
21574
|
+
}
|
|
21575
|
+
|
|
21473
21576
|
// Reuse only gateway-issued run.progress authority. A prefix advertisement
|
|
21474
21577
|
// remains reusable only for the same immutable app build; mutable receivers
|
|
21475
21578
|
// must reacquire their current receipt shape on every drain. Every delivery
|
|
@@ -12,6 +12,7 @@ export type RunLedgerDispatchLaunch = Pick<
|
|
|
12
12
|
| 'playId'
|
|
13
13
|
| 'playName'
|
|
14
14
|
| 'executorToken'
|
|
15
|
+
| 'runLedgerExecutorToken'
|
|
15
16
|
| 'baseUrl'
|
|
16
17
|
| 'runtimeApiBaseUrl'
|
|
17
18
|
| 'runtimeTokenOrigin'
|
|
@@ -27,6 +28,7 @@ export function runLedgerDispatchLaunchSql(alias: string): string {
|
|
|
27
28
|
'playId',
|
|
28
29
|
'playName',
|
|
29
30
|
'executorToken',
|
|
31
|
+
'runLedgerExecutorToken',
|
|
30
32
|
'baseUrl',
|
|
31
33
|
'runtimeApiBaseUrl',
|
|
32
34
|
'runtimeTokenOrigin',
|
|
@@ -13,6 +13,19 @@ export const WORK_RECEIPT_KEY_FORMAT = {
|
|
|
13
13
|
separator: ':',
|
|
14
14
|
} as const;
|
|
15
15
|
|
|
16
|
+
/** Reserved scalar admission fact, distinct from customer-authored work output. */
|
|
17
|
+
export const RUNTIME_SHEET_WRITE_INTENT_RECEIPT_KIND =
|
|
18
|
+
'runtime-sheet-write-intent';
|
|
19
|
+
|
|
20
|
+
/** Keep internal sheet admission facts out of customer work-output projections. */
|
|
21
|
+
export function workReceiptOutputPredicateSql(keyColumn = 'k'): string {
|
|
22
|
+
const keySql = `convert_from(${keyColumn}, 'UTF8')`;
|
|
23
|
+
const intentPrefix = encodeURIComponent(
|
|
24
|
+
`["${RUNTIME_SHEET_WRITE_INTENT_RECEIPT_KIND}",`,
|
|
25
|
+
);
|
|
26
|
+
return `NOT (starts_with(${keySql}, '${WORK_RECEIPT_KEY_FORMAT.prefix}${WORK_RECEIPT_KEY_FORMAT.separator}') AND starts_with(split_part(${keySql}, '${WORK_RECEIPT_KEY_FORMAT.separator}', 4), '${intentPrefix}'))`;
|
|
27
|
+
}
|
|
28
|
+
|
|
16
29
|
export const WORK_RECEIPT_STATUS_CODE = {
|
|
17
30
|
queued: 0,
|
|
18
31
|
pending: 0,
|
|
@@ -117,6 +117,7 @@ export async function mintWorkflowExecutorToken(input: {
|
|
|
117
117
|
terminalContract?: DirectCompletedTerminalContract | null;
|
|
118
118
|
capabilities?: readonly RuntimeExecutionCapability[];
|
|
119
119
|
runtimeOrigin?: string | null;
|
|
120
|
+
runLedgerIngressPrefixOrigin?: string | null;
|
|
120
121
|
}) {
|
|
121
122
|
const playName = input.playName?.trim() || input.workflowId;
|
|
122
123
|
return mintWorkflowRunExecutionToken({
|
|
@@ -138,6 +139,7 @@ export async function mintWorkflowExecutorToken(input: {
|
|
|
138
139
|
terminalContract: input.terminalContract,
|
|
139
140
|
capabilities: input.capabilities,
|
|
140
141
|
runtimeOrigin: input.runtimeOrigin,
|
|
142
|
+
runLedgerIngressPrefixOrigin: input.runLedgerIngressPrefixOrigin,
|
|
141
143
|
});
|
|
142
144
|
}
|
|
143
145
|
|
|
@@ -1548,7 +1548,7 @@ export interface PlayAuthoringRuntimeContext {
|
|
|
1548
1548
|
): Promise<T>;
|
|
1549
1549
|
|
|
1550
1550
|
/**
|
|
1551
|
-
* Execute a guarded HTTP request. By default
|
|
1551
|
+
* Execute a guarded HTTP request. By default, completed responses are durably reused; `staleAfterSeconds` governs only that completed call receipt, never dataset/request identity. Failed requests do not publish completed cache entries. A headers timeout leaves an upstream write's outcome unknown and does not establish whether its body was sent. The transport does not automatically retry that timed-out write, but a later invocation can execute it again. Mutating requests require provider-supported idempotency with the same key retained across retries and replay. Deadlines are platform-controlled; callers may cancel through `init.signal`. Pass `{ transient: true }` for short-lived credential exchanges or other response data that must not be retained in a receipt or checkpoint. Edition 5+ throws `CtxFetchHttpError` for non-2xx; catch it only when the Play intentionally recovers, otherwise let it fail the Play. Editions 1–4 retain their previous response projections.
|
|
1552
1552
|
*
|
|
1553
1553
|
* @sdkReference runtime 170 ctx.fetch(key, url, init)
|
|
1554
1554
|
*/
|
|
@@ -3033,7 +3033,8 @@ export const PLAY_AUTHORING_FIELD_REGISTRY = {
|
|
|
3033
3033
|
required: false,
|
|
3034
3034
|
resolution: 'runtime-allowed',
|
|
3035
3035
|
issueCode: 'play_authoring_fetch_idempotency_required',
|
|
3036
|
-
description:
|
|
3036
|
+
description:
|
|
3037
|
+
'Required for mutating HTTP methods. The provider must support idempotency, and the same key must be retained across retries and replay.',
|
|
3037
3038
|
errorMessage: 'Idempotency-Key must be a non-empty string when provided.',
|
|
3038
3039
|
},
|
|
3039
3040
|
} as const satisfies Record<
|
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
registerAuthCommands,
|
|
10
10
|
reportSetupCompleted,
|
|
11
11
|
resolvePendingAuthClaimForResume
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-VC25WFXV.mjs";
|
|
13
|
+
import "./chunk-46ZOD4PQ.mjs";
|
|
14
|
+
import "./chunk-IDSDRGKF.mjs";
|
|
15
15
|
import "./chunk-DLIRSHV6.mjs";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-F2T5UENG.mjs";
|
|
17
17
|
import "./chunk-NXGCO4JB.mjs";
|
|
18
18
|
import "./chunk-WZYKRD7T.mjs";
|
|
19
19
|
import "./chunk-KRD6H754.mjs";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
var _chunkBOKHMPCZjs = require('./chunk-BOKHMPCZ.js');
|
|
13
|
+
require('./chunk-GHLWDXUB.js');
|
|
14
|
+
require('./chunk-MCPHK7AF.js');
|
|
15
|
+
require('./chunk-XNYIZMNQ.js');
|
|
16
|
+
require('./chunk-C6QGM72M.js');
|
|
17
|
+
require('./chunk-7P5AA3SN.js');
|
|
18
|
+
require('./chunk-OG64RBAC.js');
|
|
19
|
+
require('./chunk-COGTRVWW.js');
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
exports.EXIT_WORKSPACE_MISMATCH = _chunkBOKHMPCZjs.EXIT_WORKSPACE_MISMATCH; exports.clearPendingClaim = _chunkBOKHMPCZjs.clearPendingClaim; exports.clearSatisfiedPendingClaim = _chunkBOKHMPCZjs.clearSatisfiedPendingClaim; exports.handleRegister = _chunkBOKHMPCZjs.handleRegister; exports.handleStatus = _chunkBOKHMPCZjs.handleStatus; exports.handleWait = _chunkBOKHMPCZjs.handleWait; exports.readPendingAuthClaim = _chunkBOKHMPCZjs.readPendingAuthClaim; exports.registerAuthCommands = _chunkBOKHMPCZjs.registerAuthCommands; exports.reportSetupCompleted = _chunkBOKHMPCZjs.reportSetupCompleted; exports.resolvePendingAuthClaimForResume = _chunkBOKHMPCZjs.resolvePendingAuthClaimForResume;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DeeplineClient,
|
|
3
3
|
iterateCursorPages
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-D3NMIACS.mjs";
|
|
5
5
|
import "./chunk-CBVIJSHF.mjs";
|
|
6
6
|
import {
|
|
7
7
|
createTimestampedName,
|
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
openInBrowser,
|
|
10
10
|
printCommandEnvelope,
|
|
11
11
|
shouldEmitJson
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-46ZOD4PQ.mjs";
|
|
13
13
|
import {
|
|
14
14
|
AuthError,
|
|
15
15
|
ConfigError
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-IDSDRGKF.mjs";
|
|
17
17
|
import "./chunk-DLIRSHV6.mjs";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-F2T5UENG.mjs";
|
|
19
19
|
import "./chunk-6IKARAYD.mjs";
|
|
20
20
|
import {
|
|
21
21
|
DeeplineError
|