deepline 0.3.501 → 0.3.503
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 +26 -0
- package/dist/bundling-sources/sdk/src/index.ts +1 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/types.ts +9 -0
- package/dist/bundling-sources/shared_libs/monitors/starter-templates.ts +0 -8
- package/dist/bundling-sources/shared_libs/observability/dlq.ts +174 -0
- package/dist/bundling-sources/shared_libs/observability/queue-health.ts +9 -0
- package/dist/bundling-sources/shared_libs/observability/queue-item-connectors.ts +1 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +20 -2
- package/dist/bundling-sources/shared_libs/play-runtime/activity-observation.ts +20 -0
- package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +62 -2
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +667 -62
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +55 -0
- package/dist/bundling-sources/shared_libs/play-runtime/deployment/vercel-fly-rollback-alignment.ts +29 -14
- package/dist/bundling-sources/shared_libs/play-runtime/durable-receipt-execution.ts +20 -2
- package/dist/bundling-sources/shared_libs/play-runtime/durable-runs-rollout.ts +46 -0
- package/dist/bundling-sources/shared_libs/play-runtime/execution-gateway-invocation-fence.ts +80 -4
- package/dist/bundling-sources/shared_libs/play-runtime/fixture-egress-fetch.ts +95 -0
- package/dist/bundling-sources/shared_libs/play-runtime/freshness-receipt-execution.ts +292 -45
- package/dist/bundling-sources/shared_libs/play-runtime/internal-bootstrap-token.ts +15 -0
- package/dist/bundling-sources/shared_libs/play-runtime/launch-identity.ts +3 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-http-request.ts +7 -3
- package/dist/bundling-sources/shared_libs/play-runtime/play-runtime-semantics.ts +31 -1
- package/dist/bundling-sources/shared_libs/play-runtime/post-code-recovery-policy.ts +231 -0
- package/dist/bundling-sources/shared_libs/play-runtime/prebuilt-result-quality.ts +264 -0
- package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +9 -0
- package/dist/bundling-sources/shared_libs/play-runtime/run-ending-event.ts +55 -0
- package/dist/bundling-sources/shared_libs/play-runtime/run-ledger.ts +126 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +70 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-launch-transport.ts +2 -9
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +51 -19
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/local-process.ts +9 -4
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/runtime-sandbox-reconciliation.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-actions.ts +12 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-authority.ts +3 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-gateway-oidc.ts +30 -8
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-incident-drills.ts +42 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-operation-contract.ts +7 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-receipt-store-adapter.ts +26 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +13 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-deadline-reconciliation.ts +53 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +631 -19
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/durable-run-inventory.ts +719 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/durable-run-sql.ts +206 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/latest-cache-result.ts +83 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +1453 -160
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/receipt-gateway.ts +61 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +29 -8
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-queue-health.ts +27 -2
- package/dist/bundling-sources/shared_libs/play-runtime/test-runtime-seams.ts +45 -0
- package/dist/bundling-sources/shared_libs/play-runtime/tool-cache-policy.ts +18 -0
- package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +129 -14
- package/dist/bundling-sources/shared_libs/play-runtime/workflow-executor-auth.ts +2 -0
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +10 -1
- package/dist/bundling-sources/shared_libs/product-notifications/slack-delivery.ts +2 -0
- package/dist/cli/{auth-6ECHXOI4.mjs → auth-IC4WLSE3.mjs} +5 -5
- package/dist/cli/auth-ZCMSXZO4.js +43 -0
- package/dist/cli/{billing-75NZYRXA.mjs → billing-2VOV64SD.mjs} +6 -6
- package/dist/cli/{billing-QRR7O6BD.js → billing-LWQOII22.js} +79 -79
- package/dist/cli/{chunk-N2TJJNCW.js → chunk-2626LTU3.js} +291 -273
- package/dist/cli/{chunk-VL72UKNW.js → chunk-26RSSTCF.js} +26 -26
- package/dist/cli/{chunk-HDKXSHGA.js → chunk-2K2QBLYO.js} +53 -53
- package/dist/cli/{chunk-463ZOO2L.js → chunk-33JUK73X.js} +7 -7
- package/dist/cli/{chunk-KTOAJP4N.js → chunk-3CXHK4TW.js} +10 -10
- package/dist/cli/{chunk-YPTZJ7LO.js → chunk-4IIYSBEP.js} +70 -13
- package/dist/cli/{chunk-VTDAJZIJ.mjs → chunk-5GI6NKOE.mjs} +20 -1
- package/dist/cli/{chunk-TFFJ2PRN.mjs → chunk-5M5WSFRZ.mjs} +70 -13
- package/dist/cli/{chunk-5S7MLAI7.mjs → chunk-6XTE6C3W.mjs} +41 -23
- package/dist/cli/{chunk-7L6QNHUL.mjs → chunk-7HEDCIR3.mjs} +1 -1
- package/dist/cli/{chunk-C5R3UH5V.mjs → chunk-7MJYZ33I.mjs} +2 -6
- package/dist/cli/{chunk-TOE7LHEA.js → chunk-A2C6ONWA.js} +6 -6
- package/dist/cli/{chunk-QQ3JJYE2.js → chunk-AARF4SOW.js} +17 -13
- package/dist/cli/{chunk-APAHMCGR.js → chunk-B3X4YWQ6.js} +53 -53
- package/dist/cli/{chunk-J74N375S.mjs → chunk-BI2Q45SY.mjs} +4 -4
- package/dist/cli/{chunk-GBICEYUA.js → chunk-BN5VKY4X.js} +141 -20
- package/dist/cli/{chunk-UR7JOSLT.js → chunk-C5RQTTLP.js} +26 -7
- package/dist/cli/{chunk-ZUOKIBLJ.mjs → chunk-D27HP3HS.mjs} +2 -2
- package/dist/cli/{chunk-UJRN6YP6.mjs → chunk-DPI5OYVU.mjs} +10 -6
- package/dist/cli/{chunk-MSLXAVVK.mjs → chunk-EDMV4JT5.mjs} +2 -2
- package/dist/cli/{chunk-ZUQHQGC5.mjs → chunk-EQ3WMKFY.mjs} +5 -5
- package/dist/cli/{chunk-5X4AUFYW.js → chunk-F73PD2XD.js} +7 -7
- package/dist/cli/{chunk-O3DDVP7Z.mjs → chunk-FHJ54BHH.mjs} +2 -2
- package/dist/cli/{chunk-SV2TEZ2M.js → chunk-FIUTDSJX.js} +5 -4
- package/dist/cli/{chunk-W6JTHVPF.js → chunk-FVDTERO2.js} +21 -21
- package/dist/cli/{chunk-CJJ7JBM2.js → chunk-FZHOWPSN.js} +23 -21
- package/dist/cli/{chunk-WJUDAHIQ.mjs → chunk-GIHNEYBG.mjs} +1 -1
- package/dist/cli/{chunk-V5NHEYU7.mjs → chunk-GLZBFBJS.mjs} +5 -5
- package/dist/cli/{chunk-VVEMPC2I.js → chunk-HRTDCXHI.js} +2 -2
- package/dist/cli/{chunk-BOFCF4L7.js → chunk-HS63YBT5.js} +3 -3
- package/dist/cli/{chunk-4OXHLTCP.js → chunk-IIP46RVC.js} +1 -1
- package/dist/cli/{chunk-SAW3FBCA.mjs → chunk-ITJ7NB2D.mjs} +6 -0
- package/dist/cli/{chunk-NA3J3F2Z.mjs → chunk-J6RBOLK7.mjs} +1 -1
- package/dist/cli/{chunk-PXIF74UJ.mjs → chunk-JJVN7OIX.mjs} +4 -4
- package/dist/cli/{chunk-T7E3XEPG.mjs → chunk-JPDD4Y53.mjs} +10 -8
- package/dist/cli/{chunk-OKOXB3LY.mjs → chunk-K7NFFQFU.mjs} +2 -2
- package/dist/cli/{chunk-66XDYH5T.mjs → chunk-KGLVATEB.mjs} +2 -2
- package/dist/cli/{chunk-EHVFBD36.mjs → chunk-KPBBT6OS.mjs} +2 -1
- package/dist/cli/{chunk-MADTHS56.mjs → chunk-L3TZV625.mjs} +1 -1
- package/dist/cli/{chunk-FS7XYDOF.js → chunk-MJQOG4TZ.js} +16 -16
- package/dist/cli/{chunk-JO5FFSR7.js → chunk-NTLBZUHD.js} +6 -0
- package/dist/cli/{chunk-EKZQ5LQO.js → chunk-PVA3MWCO.js} +3 -3
- package/dist/cli/{chunk-PNF2ZU4R.js → chunk-QIEYEY6Z.js} +8 -8
- package/dist/cli/{chunk-KSHAFYYG.mjs → chunk-R2VZVHJP.mjs} +127 -6
- package/dist/cli/{chunk-XEBFJ2PH.js → chunk-RVOBFO7C.js} +41 -41
- package/dist/cli/{chunk-RU5ROUFO.js → chunk-TCQYWZFS.js} +5 -5
- package/dist/cli/{chunk-I42EOZKQ.js → chunk-TMQUMILM.js} +19 -23
- package/dist/cli/{chunk-EOO7OSS4.mjs → chunk-URZNSJE2.mjs} +4 -4
- package/dist/cli/{chunk-Z6AUOV7D.mjs → chunk-VC5B462T.mjs} +2 -2
- package/dist/cli/{chunk-EKF4DKUA.js → chunk-WHP3FJ7T.js} +5 -5
- package/dist/cli/{chunk-VD2374K7.mjs → chunk-WS274KID.mjs} +1 -1
- package/dist/cli/{chunk-T4U245E4.mjs → chunk-XYZZZLN6.mjs} +2 -2
- package/dist/cli/{chunk-J6SVNKRP.js → chunk-YXGPMTAK.js} +2 -2
- package/dist/cli/{chunk-RFV7PPLS.mjs → chunk-ZEQPCEV4.mjs} +3 -3
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/{csv-RZJ4SOIL.mjs → csv-2TXOI3UE.mjs} +4 -4
- package/dist/cli/{csv-JXX2LXK5.js → csv-NEWCNOSZ.js} +13 -13
- package/dist/cli/{db-T2KJNONM.js → db-J3IJS4OG.js} +27 -27
- package/dist/cli/{db-MUTT2NWI.mjs → db-PX7EQEIG.mjs} +6 -6
- package/dist/cli/{describe-K3UMAAVO.mjs → describe-GQHGTZSL.mjs} +20 -21
- package/dist/cli/describe-LE7EZCL4.js +49 -0
- package/dist/cli/describe-core.d.mts +8 -4
- package/dist/cli/describe-core.d.ts +8 -4
- package/dist/cli/describe-core.js +4 -5
- package/dist/cli/describe-core.mjs +3 -4
- package/dist/cli/{executions-PHS4R2OX.mjs → executions-FFKK24RY.mjs} +6 -6
- package/dist/cli/{executions-7HSLDRHR.js → executions-RO3TJUXL.js} +8 -8
- package/dist/cli/{feedback-BJZRM637.js → feedback-XRR4HIS6.js} +8 -8
- package/dist/cli/{feedback-RWMDCIDF.mjs → feedback-ZTO56SRL.mjs} +4 -4
- package/dist/cli/git-26AH4XIO.js +25 -0
- package/dist/cli/{git-YW6VHYZG.mjs → git-FIPBVFYZ.mjs} +5 -5
- package/dist/cli/index.js +142 -142
- package/dist/cli/index.mjs +42 -42
- package/dist/cli/{legacy-noops-5UBSUPGG.mjs → legacy-noops-AMD2NWHF.mjs} +5 -5
- package/dist/cli/{legacy-noops-2WUV2XD7.js → legacy-noops-MTBBGM27.js} +8 -8
- package/dist/cli/{monitors-HWOQO3OK.mjs → monitors-24LDKDJX.mjs} +7 -7
- package/dist/cli/{monitors-YZZRKSTG.js → monitors-42PIGLBF.js} +95 -95
- package/dist/cli/{org-NCXT6RB4.mjs → org-4B7SCFRL.mjs} +6 -6
- package/dist/cli/{org-JY7HLHBA.js → org-GQMCA3MN.js} +72 -72
- package/dist/cli/{pages-QJO53QAT.mjs → pages-PD5EGL2R.mjs} +6 -6
- package/dist/cli/{pages-6ZOHXL6X.js → pages-RL2M62GJ.js} +18 -18
- package/dist/cli/{play-SQRS7JN3.mjs → play-5V54VTUR.mjs} +132 -26
- package/dist/cli/{play-TAYGSR35.js → play-FST6ZAHW.js} +447 -341
- package/dist/cli/{providers-4Q5LOIQ5.js → providers-HBUUPN7J.js} +9 -9
- package/dist/cli/{providers-3IR3N5DT.mjs → providers-N5YVCKPL.mjs} +6 -6
- package/dist/cli/{quickstart-ITNUZENY.js → quickstart-4QIQNSHG.js} +6 -6
- package/dist/cli/{quickstart-KCZCYO6B.mjs → quickstart-NJDDVTQR.mjs} +4 -4
- package/dist/cli/{run-YQ57LMKN.js → run-FGOKCG4J.js} +44 -45
- package/dist/cli/{run-JCWRWDSK.mjs → run-JHI5MTHD.mjs} +25 -26
- package/dist/cli/search-CTKSEVSO.js +32 -0
- package/dist/cli/{search-FUM27HQP.mjs → search-EWIZBIY2.mjs} +7 -7
- package/dist/cli/{search-output-EWEYT34M.mjs → search-output-NAK3MWBH.mjs} +53 -75
- package/dist/cli/{search-output-XAMWKRJH.js → search-output-TMQTRC2W.js} +58 -80
- package/dist/cli/{secrets-2IRRRZBL.js → secrets-5TSUEOJB.js} +15 -15
- package/dist/cli/{secrets-YTI4IAKR.mjs → secrets-ONQVW5SR.mjs} +6 -6
- package/dist/cli/{sessions-EFS4KUPF.mjs → sessions-B7F5O3ZR.mjs} +5 -5
- package/dist/cli/{sessions-HWTRDXBQ.js → sessions-BSGE5EET.js} +6 -6
- package/dist/cli/{settings-FRVEIOKR.js → settings-47LARBRU.js} +78 -78
- package/dist/cli/{settings-NTOO42DY.mjs → settings-SGGFQV5R.mjs} +11 -11
- package/dist/cli/{setup-PAVQPALX.mjs → setup-ATGNXQUK.mjs} +9 -9
- package/dist/cli/{setup-6ZIOAE2V.js → setup-BNFZFXO6.js} +49 -49
- package/dist/cli/skills-6RD25MVM.js +36 -0
- package/dist/cli/{skills-3O3XTPUM.mjs → skills-CIMBRM5R.mjs} +7 -7
- package/dist/cli/{tools-7QSB65UL.mjs → tools-DTDXAULX.mjs} +18 -19
- package/dist/cli/tools-TDZH4XHS.js +56 -0
- package/dist/cli/{update-T6CYS5ZT.mjs → update-EOIJBJCO.mjs} +9 -9
- package/dist/cli/update-Y32VT4VL.js +34 -0
- package/dist/cli/{workflow-OMSXZ73T.mjs → workflow-IWXUJPWY.mjs} +7 -7
- package/dist/cli/{workflow-4KMJBMGX.js → workflow-V5VKPICQ.js} +17 -17
- package/dist/{client-Bn8FwKGO.d.ts → client-CIwenMFS.d.ts} +1 -1
- package/dist/{client-CfNRmjLK.d.mts → client-DYAfJpaN.d.mts} +1 -1
- package/dist/{client-core-B91EV0WS.d.ts → client-core-CRjtyMAI.d.ts} +25 -2
- package/dist/{client-core-BG8Cgrmk.d.mts → client-core-DlzP8vEs.d.mts} +25 -2
- package/dist/{compiler-manifest-DlXDyndN.d.ts → compiler-manifest-DaJrA2KV.d.mts} +1 -1
- package/dist/{compiler-manifest-DlXDyndN.d.mts → compiler-manifest-DaJrA2KV.d.ts} +1 -1
- package/dist/{errors-BtriA2ld.d.mts → errors-BKnSYueU.d.mts} +1 -1
- package/dist/{errors-DmcLykM7.d.ts → errors-KLga4bLr.d.ts} +1 -1
- package/dist/{index-DI0sR_fX.d.mts → index-C-8AFpWy.d.mts} +1 -1
- package/dist/{index--Jw-slHY.d.ts → index-C5nAZ-VS.d.ts} +1 -1
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +9 -9
- package/dist/index.mjs +6 -6
- package/dist/install-integrity.json +124 -118
- package/dist/plays/bundle-play-file.d.mts +3 -3
- package/dist/plays/bundle-play-file.d.ts +3 -3
- package/dist/plays/bundle-play-file.mjs +8 -1
- package/dist/plays/play-description.d.mts +2 -2
- package/dist/plays/play-description.d.ts +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/dist/server.d.mts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +5 -5
- package/dist/server.mjs +3 -3
- package/package.json +1 -1
- package/dist/cli/auth-VP7PMXKQ.js +0 -43
- package/dist/cli/chunk-XK5DMLZE.js +0 -111
- package/dist/cli/chunk-XRDXNAAY.mjs +0 -111
- package/dist/cli/describe-SEXUJLE4.js +0 -50
- package/dist/cli/git-VNS7UQWN.js +0 -25
- package/dist/cli/search-I425FRTK.js +0 -32
- package/dist/cli/skills-6ZNMO2PR.js +0 -36
- package/dist/cli/tools-DPV2JES6.js +0 -57
- package/dist/cli/update-Q5GUDEAW.js +0 -34
|
@@ -143,6 +143,7 @@ import type {
|
|
|
143
143
|
StopAllPlayRunsStopResult,
|
|
144
144
|
RerunOptions,
|
|
145
145
|
RerunPlayRunResult,
|
|
146
|
+
ResumePlayRunResult,
|
|
146
147
|
ClearPlayHistoryRequest,
|
|
147
148
|
ClearPlayHistoryResult,
|
|
148
149
|
PublishPlayVersionRequest,
|
|
@@ -1042,6 +1043,8 @@ export type RunsNamespace = {
|
|
|
1042
1043
|
}>;
|
|
1043
1044
|
/** Start a fresh run from a prior run's retained input and pinned revision. */
|
|
1044
1045
|
rerun: (runId: string, options?: RerunOptions) => Promise<RerunPlayRunResult>;
|
|
1046
|
+
/** Continue a failed or cancelled run as the same run, reusing its completed work. */
|
|
1047
|
+
resume: (runId: string) => Promise<ResumePlayRunResult>;
|
|
1045
1048
|
/** List runs for one play, optionally filtered by status. */
|
|
1046
1049
|
list: (options: RunsListOptions) => Promise<PlayRunListItem[]>;
|
|
1047
1050
|
/** Read one run page with total, offset, limit and completeness metadata. */
|
|
@@ -2972,6 +2975,7 @@ export class DeeplineClient {
|
|
|
2972
2975
|
searchEvents: (options) => this.searchRunEvents(options),
|
|
2973
2976
|
input: (runId) => this.getRunInput(runId),
|
|
2974
2977
|
rerun: (runId, options) => this.rerun(runId, options),
|
|
2978
|
+
resume: (runId) => this.resumeRun(runId),
|
|
2975
2979
|
exportDatasetRows: (input) => this.getPlaySheetRows(input),
|
|
2976
2980
|
rowHistory: (input) => this.getPlayRunRowHistory(input),
|
|
2977
2981
|
stop: (runId, options) => this.stopRun(runId, options),
|
|
@@ -4976,6 +4980,20 @@ export class DeeplineClient {
|
|
|
4976
4980
|
);
|
|
4977
4981
|
}
|
|
4978
4982
|
|
|
4983
|
+
/**
|
|
4984
|
+
* Continue a failed or cancelled run as the same run. Completed calls are
|
|
4985
|
+
* reused; only work the run had not finished runs. A run can be resumed for
|
|
4986
|
+
* 14 days after it stops. Refusals (still active, last attempt still
|
|
4987
|
+
* finishing, sandbox cleanup pending, window expired) throw a
|
|
4988
|
+
* {@link DeeplineError} with the server's code.
|
|
4989
|
+
*/
|
|
4990
|
+
async resumeRun(runId: string): Promise<ResumePlayRunResult> {
|
|
4991
|
+
return this.http.post<ResumePlayRunResult>(
|
|
4992
|
+
`/api/v2/runs/${encodeURIComponent(runId)}/resume`,
|
|
4993
|
+
{},
|
|
4994
|
+
);
|
|
4995
|
+
}
|
|
4996
|
+
|
|
4979
4997
|
/**
|
|
4980
4998
|
* Read a run's retained text tail (default 200), full retained stream (`all`), or terminal failure window (`failed`, at most 20). These are existing reads; sampling and retention loss cannot be recovered. See [run logs and events](run-events.md) for structured search and payload retrieval.
|
|
4981
4999
|
*
|
|
@@ -5609,6 +5627,14 @@ export class DeeplineClient {
|
|
|
5609
5627
|
return this.http.get('/api/v2/settings/notifications');
|
|
5610
5628
|
}
|
|
5611
5629
|
|
|
5630
|
+
/** Get the dashboard link where a workspace owner or admin can connect a provider. */
|
|
5631
|
+
async getIntegrationConnectLink(
|
|
5632
|
+
provider: string,
|
|
5633
|
+
): Promise<{ provider: string; connect_url: string }> {
|
|
5634
|
+
const params = new URLSearchParams({ provider });
|
|
5635
|
+
return this.http.get(`/api/v2/integrations/connect?${params}`);
|
|
5636
|
+
}
|
|
5637
|
+
|
|
5612
5638
|
/** Save provider-owned credential fields without starting an OAuth browser flow. */
|
|
5613
5639
|
async setIntegrationCredentials(
|
|
5614
5640
|
provider: string,
|
|
@@ -205,7 +205,7 @@ export const SDK_RELEASE = {
|
|
|
205
205
|
// getters keep their established compatibility behavior.
|
|
206
206
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
207
207
|
// 0.3.90 is the first deliberately versioned SDK release for API v3.
|
|
208
|
-
version: '0.3.
|
|
208
|
+
version: '0.3.503',
|
|
209
209
|
updateSummary: {
|
|
210
210
|
introducedIn: '0.3.90',
|
|
211
211
|
summary:
|
|
@@ -1303,6 +1303,15 @@ export interface RerunPlayRunResult {
|
|
|
1303
1303
|
next: { inspect: string; input: string };
|
|
1304
1304
|
}
|
|
1305
1305
|
|
|
1306
|
+
/** Result of {@link DeeplineClient.resumeRun} / `runs.resume`. */
|
|
1307
|
+
export interface ResumePlayRunResult {
|
|
1308
|
+
/** The same run id: a resume continues the run in place. */
|
|
1309
|
+
runId: string;
|
|
1310
|
+
resumed: true;
|
|
1311
|
+
/** How many times this run has been resumed, including this one. */
|
|
1312
|
+
epoch: number;
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1306
1315
|
/** One active run that a workspace stop-all would target. */
|
|
1307
1316
|
export interface StopAllCandidate {
|
|
1308
1317
|
/** Public play-run id. */
|
|
@@ -48,12 +48,4 @@ export const MONITOR_STARTER_TEMPLATES: MonitorStarterTemplate[] = [
|
|
|
48
48
|
prompt:
|
|
49
49
|
'/deepline-gtm Monitor my target accounts for news like launches, expansions, and leadership changes.',
|
|
50
50
|
},
|
|
51
|
-
{
|
|
52
|
-
id: 'website-visitor-intent',
|
|
53
|
-
title: 'Website visitor intent',
|
|
54
|
-
description:
|
|
55
|
-
'Find target accounts showing buying intent through visits to your website.',
|
|
56
|
-
prompt:
|
|
57
|
-
'/deepline-gtm Monitor my target accounts for high-intent visits to my website.',
|
|
58
|
-
},
|
|
59
51
|
];
|
|
@@ -301,6 +301,164 @@ export type QueueItemMonitorEvent = {
|
|
|
301
301
|
readonly lastRedriveStatus: string | null;
|
|
302
302
|
};
|
|
303
303
|
|
|
304
|
+
/**
|
|
305
|
+
* Why `runs resume` would refuse a stopped run, exactly as the resume API
|
|
306
|
+
* reports it. `run_not_resumable`: a child run, which continues only with its
|
|
307
|
+
* parent. `resume_unavailable`: the `runsResume` switch is off here.
|
|
308
|
+
*/
|
|
309
|
+
export const DURABLE_RUN_RESUME_REFUSALS = [
|
|
310
|
+
'run_not_stopped',
|
|
311
|
+
'attempt_not_settled',
|
|
312
|
+
'sandbox_cleanup_pending',
|
|
313
|
+
'resume_window_expired',
|
|
314
|
+
'not_replay_safe',
|
|
315
|
+
'play_revision_changed',
|
|
316
|
+
'staged_input_retired',
|
|
317
|
+
'run_not_resumable',
|
|
318
|
+
'resume_unavailable',
|
|
319
|
+
] as const;
|
|
320
|
+
export type DurableRunResumeRefusal =
|
|
321
|
+
(typeof DURABLE_RUN_RESUME_REFUSALS)[number];
|
|
322
|
+
|
|
323
|
+
/** Refusals that clear by themselves once the run's ending settles. */
|
|
324
|
+
export const DURABLE_RUN_TRANSIENT_RESUME_REFUSALS: readonly DurableRunResumeRefusal[] =
|
|
325
|
+
['attempt_not_settled', 'sandbox_cleanup_pending'];
|
|
326
|
+
|
|
327
|
+
export type DurableRunNextActionKind =
|
|
328
|
+
/** Continue the stopped run in place (admin queue action `resume`). */
|
|
329
|
+
| 'resume'
|
|
330
|
+
/** Stop an in-flight run (admin queue action `cancel`). */
|
|
331
|
+
| 'cancel'
|
|
332
|
+
/** Bring a deferred recovery retry forward. Never available: see reason. */
|
|
333
|
+
| 'wake_now'
|
|
334
|
+
/** Start a new run from this one's input; runs as a workspace member. */
|
|
335
|
+
| 'rerun_from_run'
|
|
336
|
+
/** Nothing to do yet: the owner is still settling or retrying. */
|
|
337
|
+
| 'wait';
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* Why a stopped durable run stopped. `play_error`: the Play's own error (the
|
|
341
|
+
* customer's). `platform_recovery_exhausted`: Deepline's automatic recovery
|
|
342
|
+
* ran out (resume it). `platform_failure`: another platform failure the
|
|
343
|
+
* runtime recognizes. `cancelled`: cancelled (code names a platform cancel).
|
|
344
|
+
* `unknown`: no stored terminal error.
|
|
345
|
+
*/
|
|
346
|
+
export const DURABLE_RUN_FAILURE_CLASSES = [
|
|
347
|
+
'play_error',
|
|
348
|
+
'platform_recovery_exhausted',
|
|
349
|
+
'platform_failure',
|
|
350
|
+
'cancelled',
|
|
351
|
+
'unknown',
|
|
352
|
+
] as const;
|
|
353
|
+
export type DurableRunFailureClass =
|
|
354
|
+
(typeof DURABLE_RUN_FAILURE_CLASSES)[number];
|
|
355
|
+
|
|
356
|
+
/** `failureCause` list filter of the `durable-play-runs` quarantined listing. */
|
|
357
|
+
export const DURABLE_RUN_FAILURE_CAUSE_FILTERS = ['platform', 'play'] as const;
|
|
358
|
+
export type DurableRunFailureCauseFilter =
|
|
359
|
+
(typeof DURABLE_RUN_FAILURE_CAUSE_FILTERS)[number];
|
|
360
|
+
|
|
361
|
+
export function isDurableRunFailureCauseFilter(
|
|
362
|
+
value: unknown,
|
|
363
|
+
): value is DurableRunFailureCauseFilter {
|
|
364
|
+
return (
|
|
365
|
+
typeof value === 'string' &&
|
|
366
|
+
(DURABLE_RUN_FAILURE_CAUSE_FILTERS as readonly string[]).includes(value)
|
|
367
|
+
);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Fixed-size, admin-only summary of one durable Play run. Never carries the
|
|
372
|
+
* run's input, output, logs, sandbox identity or provider circuits. Safe for a
|
|
373
|
+
* dashboard: its size never grows with the run's rows, calls or attempts.
|
|
374
|
+
*/
|
|
375
|
+
export type QueueItemDurableRun = {
|
|
376
|
+
readonly version: 1;
|
|
377
|
+
readonly runId: string;
|
|
378
|
+
readonly orgId: string;
|
|
379
|
+
readonly playName: string;
|
|
380
|
+
/** Scheduler status: queued, running, waiting, failed, cancelled, completed. */
|
|
381
|
+
readonly status: string;
|
|
382
|
+
/** queued, running, waiting, recovering, failed, cancelled or completed. */
|
|
383
|
+
readonly phase: string;
|
|
384
|
+
readonly createdAt: string | null;
|
|
385
|
+
readonly startedAt: string | null;
|
|
386
|
+
readonly finishedAt: string | null;
|
|
387
|
+
readonly updatedAt: string | null;
|
|
388
|
+
readonly resumeEpoch: number;
|
|
389
|
+
readonly attemptsThisEpoch: number;
|
|
390
|
+
readonly latestAttempt: {
|
|
391
|
+
readonly attempt: number;
|
|
392
|
+
readonly status: string;
|
|
393
|
+
readonly heartbeatAt: string | null;
|
|
394
|
+
readonly leaseExpiresAt: string | null;
|
|
395
|
+
readonly errorKind: string | null;
|
|
396
|
+
} | null;
|
|
397
|
+
/** Admin-only release lane the run is pinned to. */
|
|
398
|
+
readonly releaseId: string | null;
|
|
399
|
+
readonly parentRunId: string | null;
|
|
400
|
+
readonly recovery: {
|
|
401
|
+
readonly kind: 'post_code' | 'pre_code';
|
|
402
|
+
/** True while the run waits out this recovery's retry delay. */
|
|
403
|
+
readonly active: boolean;
|
|
404
|
+
readonly reason: string | null;
|
|
405
|
+
readonly dependency: string | null;
|
|
406
|
+
readonly deferCount: number | null;
|
|
407
|
+
/** Cap on deferrals for this kind, as this app build configures it. */
|
|
408
|
+
readonly maxDefers: number;
|
|
409
|
+
/** Post-code only: consecutive attempts that recorded no new history. */
|
|
410
|
+
readonly unproductiveAttempts: number | null;
|
|
411
|
+
readonly maxUnproductiveAttempts: number | null;
|
|
412
|
+
readonly nextRetryAt: string | null;
|
|
413
|
+
/** True when the next retry time has passed and no attempt has started. */
|
|
414
|
+
readonly nextRetryDue: boolean;
|
|
415
|
+
/** Recovery horizon: no retry is scheduled after this time. */
|
|
416
|
+
readonly deadlineAt: string | null;
|
|
417
|
+
readonly exhaustedAt: string | null;
|
|
418
|
+
readonly updatedAt: string | null;
|
|
419
|
+
} | null;
|
|
420
|
+
readonly resume: {
|
|
421
|
+
/** `not_applicable` for in-flight and completed runs. */
|
|
422
|
+
readonly state: 'resumable' | 'refused' | 'not_applicable';
|
|
423
|
+
readonly reason: DurableRunResumeRefusal | null;
|
|
424
|
+
/** The refusal clears by itself once the ending settles. */
|
|
425
|
+
readonly transient: boolean;
|
|
426
|
+
/** When the resume window closes (finishedAt + 14 days). */
|
|
427
|
+
readonly windowExpiresAt: string | null;
|
|
428
|
+
};
|
|
429
|
+
/** At most one entry per kind, in recommended order. */
|
|
430
|
+
readonly nextActions: readonly {
|
|
431
|
+
readonly action: DurableRunNextActionKind;
|
|
432
|
+
readonly available: boolean;
|
|
433
|
+
readonly reason: string | null;
|
|
434
|
+
}[];
|
|
435
|
+
/**
|
|
436
|
+
* Additive; failed and cancelled runs only (null otherwise; absent from
|
|
437
|
+
* older servers). `code` is a short machine token; `message` is only
|
|
438
|
+
* Deepline's fixed exhausted-recovery text, never the Play's error text.
|
|
439
|
+
*/
|
|
440
|
+
readonly failure?: {
|
|
441
|
+
readonly class: DurableRunFailureClass;
|
|
442
|
+
readonly code: string | null;
|
|
443
|
+
readonly message: string | null;
|
|
444
|
+
/** When recovery was exhausted, else when the run stopped. */
|
|
445
|
+
readonly at: string | null;
|
|
446
|
+
} | null;
|
|
447
|
+
};
|
|
448
|
+
|
|
449
|
+
/** Fixed-size schedule of one cron trigger binding. */
|
|
450
|
+
export type QueueItemSchedule = {
|
|
451
|
+
readonly version: 1;
|
|
452
|
+
readonly orgId: string | null;
|
|
453
|
+
readonly playDefinitionId: string | null;
|
|
454
|
+
readonly triggerName: string | null;
|
|
455
|
+
readonly cron: string | null;
|
|
456
|
+
readonly timezone: string | null;
|
|
457
|
+
/** Null until the scheduler initializes the binding's first slot. */
|
|
458
|
+
readonly nextScheduledAt: string | null;
|
|
459
|
+
readonly lastScheduledAt: string | null;
|
|
460
|
+
};
|
|
461
|
+
|
|
304
462
|
export type QueueItem = {
|
|
305
463
|
readonly queueId: string;
|
|
306
464
|
readonly id: string;
|
|
@@ -323,6 +481,10 @@ export type QueueItem = {
|
|
|
323
481
|
readonly diagnosis?: QueueItemDiagnosis;
|
|
324
482
|
/** Additive; only monitor inbound dead letters carry it. */
|
|
325
483
|
readonly monitorEvent?: QueueItemMonitorEvent;
|
|
484
|
+
/** Additive; only `durable-play-runs` items carry it. */
|
|
485
|
+
readonly durableRun?: QueueItemDurableRun;
|
|
486
|
+
/** Additive; only `play-cron-bindings` items carry it. */
|
|
487
|
+
readonly schedule?: QueueItemSchedule;
|
|
326
488
|
readonly retiredAt?: string;
|
|
327
489
|
readonly retirementReason?: string;
|
|
328
490
|
};
|
|
@@ -551,10 +713,20 @@ export type QueueItemConnectorContext = {
|
|
|
551
713
|
readonly limit: number;
|
|
552
714
|
readonly cursor?: string;
|
|
553
715
|
readonly state?: QueueItemState;
|
|
716
|
+
/**
|
|
717
|
+
* Keep only quarantined items with this failure cause. Only connectors that
|
|
718
|
+
* declare `supportsFailureCause` receive it.
|
|
719
|
+
*/
|
|
720
|
+
readonly failureCause?: DurableRunFailureCauseFilter;
|
|
554
721
|
/** Explicit tenant scope for owner sources stored in a Customer DB. */
|
|
555
722
|
readonly orgId?: string;
|
|
556
723
|
readonly actorId?: string;
|
|
557
724
|
readonly operationId?: string;
|
|
725
|
+
/**
|
|
726
|
+
* The app origin serving this admin request. Owners whose action launches
|
|
727
|
+
* runtime work (durable-run resume) need it as the run's callback origin.
|
|
728
|
+
*/
|
|
729
|
+
readonly runtimeApiBaseUrl?: string;
|
|
558
730
|
};
|
|
559
731
|
|
|
560
732
|
/**
|
|
@@ -570,6 +742,8 @@ export type QueueItemConnector = {
|
|
|
570
742
|
/** The owner can record revision-fenced operator retirement overlays for
|
|
571
743
|
* terminal or quarantined source items without mutating its native row. */
|
|
572
744
|
readonly supportsRetirement?: true;
|
|
745
|
+
/** The owner filters its quarantined listing by `failureCause`. */
|
|
746
|
+
readonly supportsFailureCause?: true;
|
|
573
747
|
/** Stable reason surfaced when this registration is an unavailable shell. */
|
|
574
748
|
readonly unavailableReason?: string;
|
|
575
749
|
/** True only when the owner explicitly declares that no item reader exists. */
|
|
@@ -361,6 +361,15 @@ export const OPERATIONS_QUEUE_CATALOG = [
|
|
|
361
361
|
300_000,
|
|
362
362
|
900_000,
|
|
363
363
|
),
|
|
364
|
+
queue(
|
|
365
|
+
'durable-play-runs',
|
|
366
|
+
'Durable Play runs',
|
|
367
|
+
'leased_workset',
|
|
368
|
+
'runtime',
|
|
369
|
+
'Show in-flight, automatically recovering, and resumable Play runs with the command that moves each one along',
|
|
370
|
+
300_000,
|
|
371
|
+
900_000,
|
|
372
|
+
),
|
|
364
373
|
] as const satisfies readonly QueueCatalogEntry[];
|
|
365
374
|
|
|
366
375
|
export type OperationsQueueId = (typeof OPERATIONS_QUEUE_CATALOG)[number]['id'];
|
|
@@ -723,8 +723,8 @@
|
|
|
723
723
|
"owner": "product",
|
|
724
724
|
"criticality": "reporting",
|
|
725
725
|
"purpose": "Count the previous UTC day's customer prebuilt Play output rows and rows with a result, per Play and workspace, before the cost stats refresh folds them into the hit rate search shows.",
|
|
726
|
-
"successDefinition": "
|
|
727
|
-
"failureDefinition": "Run listing
|
|
726
|
+
"successDefinition": "Completion counts from the previous UTC day are saved to prebuiltPlayResultDays. Unmeasured runs are reported as skipped.",
|
|
727
|
+
"failureDefinition": "Run listing or the Convex write fails, leaving the day's counts missing or partial.",
|
|
728
728
|
"startGraceMs": 300000,
|
|
729
729
|
"runTimeoutMs": 600000,
|
|
730
730
|
"failureAlert": "vercel_route_wrapper",
|
|
@@ -1845,5 +1845,23 @@
|
|
|
1845
1845
|
"runTimeoutMs": 12000,
|
|
1846
1846
|
"failureAlert": "fly_scaler_lifecycle_metric",
|
|
1847
1847
|
"domainReportRequired": true
|
|
1848
|
+
},
|
|
1849
|
+
{
|
|
1850
|
+
"id": "vercel.staged-input-expiry",
|
|
1851
|
+
"name": "Staged input expiry",
|
|
1852
|
+
"scheduler": "vercel_cron",
|
|
1853
|
+
"cadence": "23 * * * *",
|
|
1854
|
+
"timezone": "UTC",
|
|
1855
|
+
"source": "apps/deepline-api/src/app/api/v2/cron/staged-input-expiry/route.ts",
|
|
1856
|
+
"locator": "/api/v2/cron/staged-input-expiry",
|
|
1857
|
+
"owner": "runtime",
|
|
1858
|
+
"criticality": "maintenance",
|
|
1859
|
+
"purpose": "Retire the staged array input of failed and cancelled Play runs once their 14-day runs resume window has passed.",
|
|
1860
|
+
"successDefinition": "Every selected run's staged input is deleted from its Customer DB and the run is marked retired, so no later pass selects it again.",
|
|
1861
|
+
"failureDefinition": "Listing expired runs fails, or any selected run's input cannot be retired or marked; that run is selected again on the next pass.",
|
|
1862
|
+
"startGraceMs": 1800000,
|
|
1863
|
+
"runTimeoutMs": 800000,
|
|
1864
|
+
"failureAlert": "vercel_route_wrapper",
|
|
1865
|
+
"domainReportRequired": true
|
|
1848
1866
|
}
|
|
1849
1867
|
]
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { RUN_EVENT_KIND } from './run-event-catalog';
|
|
2
|
+
|
|
3
|
+
/** One current activity across bounded platform-recovery attempts. */
|
|
4
|
+
export const PLATFORM_RECOVERY_ACTIVITY_ID = 'run:platform-recovery';
|
|
5
|
+
export const CANCELLATION_CLEANUP_ACTIVITY_ID = 'run:cancellation-cleanup';
|
|
2
6
|
/**
|
|
3
7
|
* Canonical, producer-facing description of what a play is doing.
|
|
4
8
|
*
|
|
@@ -242,6 +246,8 @@ export function derivePlayActivityVisibility(input: {
|
|
|
242
246
|
}
|
|
243
247
|
if (state.kind === 'queued' || state.kind === 'scheduled') return 'headline';
|
|
244
248
|
if (state.kind === 'retrying') {
|
|
249
|
+
if (input.observation.activityId === PLATFORM_RECOVERY_ACTIVITY_ID)
|
|
250
|
+
return 'headline';
|
|
245
251
|
if (
|
|
246
252
|
state.reason === 'rate_limit' &&
|
|
247
253
|
input.observation.target.kind === 'capacity'
|
|
@@ -307,6 +313,11 @@ export function summarizePlayActivity(
|
|
|
307
313
|
): string {
|
|
308
314
|
const label = targetLabel(observation.target);
|
|
309
315
|
const { state } = observation;
|
|
316
|
+
if (
|
|
317
|
+
observation.activityId === CANCELLATION_CLEANUP_ACTIVITY_ID &&
|
|
318
|
+
state.kind === 'active'
|
|
319
|
+
)
|
|
320
|
+
return 'Cancelling Play: waiting for cleanup to finish.';
|
|
310
321
|
switch (state.kind) {
|
|
311
322
|
case 'active': {
|
|
312
323
|
const progress = state.progress;
|
|
@@ -447,6 +458,15 @@ export function projectPlayRunActivity(input: {
|
|
|
447
458
|
return null;
|
|
448
459
|
}
|
|
449
460
|
|
|
461
|
+
// A cancellation remains the active intent while its durable cleanup is
|
|
462
|
+
// pending, even if an already-running attempt emits later progress.
|
|
463
|
+
const pendingCancellation = input.explicit?.find(
|
|
464
|
+
(candidate) =>
|
|
465
|
+
candidate.activityId === CANCELLATION_CLEANUP_ACTIVITY_ID &&
|
|
466
|
+
candidate.state.kind === 'active',
|
|
467
|
+
);
|
|
468
|
+
if (pendingCancellation) return projection(pendingCancellation, now);
|
|
469
|
+
|
|
450
470
|
const latestExplicit = [...(input.explicit ?? [])]
|
|
451
471
|
.filter((candidate) => !isTerminalActivityState(candidate.state))
|
|
452
472
|
.sort((left, right) => right.observedAt - left.observedAt)[0];
|
|
@@ -39,7 +39,10 @@ import type {
|
|
|
39
39
|
PlayStagedFileRef,
|
|
40
40
|
PlayVisualNodeProgressMap,
|
|
41
41
|
} from './/worker-api-types';
|
|
42
|
-
import type {
|
|
42
|
+
import type {
|
|
43
|
+
PublishLatestCacheResultOutcome,
|
|
44
|
+
RuntimeStepReceipt,
|
|
45
|
+
} from './/ctx-types';
|
|
43
46
|
import type {
|
|
44
47
|
CreateDbSessionRequest,
|
|
45
48
|
CreateDbSessionResponse,
|
|
@@ -1099,6 +1102,7 @@ function isRetryableAppRuntimeAction(
|
|
|
1099
1102
|
action === 'release_runtime_step_receipt' ||
|
|
1100
1103
|
action === 'save_results' ||
|
|
1101
1104
|
action === 'skip_runtime_step_receipt' ||
|
|
1105
|
+
action === 'publish_latest_cache_result' ||
|
|
1102
1106
|
action === 'start_run' ||
|
|
1103
1107
|
action === 'launch_play_async'
|
|
1104
1108
|
);
|
|
@@ -1123,7 +1127,8 @@ function isRuntimeStepReceiptAction(
|
|
|
1123
1127
|
action === 'fail_runtime_step_receipt' ||
|
|
1124
1128
|
action === 'fail_runtime_step_receipts' ||
|
|
1125
1129
|
action === 'release_runtime_step_receipt' ||
|
|
1126
|
-
action === 'skip_runtime_step_receipt'
|
|
1130
|
+
action === 'skip_runtime_step_receipt' ||
|
|
1131
|
+
action === 'publish_latest_cache_result'
|
|
1127
1132
|
);
|
|
1128
1133
|
}
|
|
1129
1134
|
|
|
@@ -3470,6 +3475,61 @@ export async function skipRuntimeStepReceiptViaAppRuntime(
|
|
|
3470
3475
|
});
|
|
3471
3476
|
}
|
|
3472
3477
|
|
|
3478
|
+
/**
|
|
3479
|
+
* Newest-wins publish of a shared read result. Only these exact older-receiver
|
|
3480
|
+
* answers mean "this receiver has no shared read cache": an older app route
|
|
3481
|
+
* (reached through an older gateway's proxy) rejects the unknown action before
|
|
3482
|
+
* capability evaluation, and a newer app route declines it explicitly. Both
|
|
3483
|
+
* write nothing, so the publish is a no-op. Every other failure throws.
|
|
3484
|
+
*/
|
|
3485
|
+
export async function publishLatestCacheResultViaAppRuntime(
|
|
3486
|
+
context: WorkerRuntimeApiContext,
|
|
3487
|
+
input: Omit<
|
|
3488
|
+
Extract<RuntimeApiRequest, { action: 'publish_latest_cache_result' }>,
|
|
3489
|
+
'action'
|
|
3490
|
+
>,
|
|
3491
|
+
): Promise<PublishLatestCacheResultOutcome> {
|
|
3492
|
+
let response: unknown;
|
|
3493
|
+
try {
|
|
3494
|
+
response = await postAppRuntimeApi<unknown>(context, {
|
|
3495
|
+
action: 'publish_latest_cache_result',
|
|
3496
|
+
...input,
|
|
3497
|
+
});
|
|
3498
|
+
} catch (error) {
|
|
3499
|
+
if (
|
|
3500
|
+
error instanceof AppRuntimeApiResponseError &&
|
|
3501
|
+
((error.status === 403 &&
|
|
3502
|
+
error.code === null &&
|
|
3503
|
+
error.detail === 'Unsupported runtime action capability scope.') ||
|
|
3504
|
+
error.code === 'SHARED_READ_CACHE_UNAVAILABLE')
|
|
3505
|
+
) {
|
|
3506
|
+
return { published: false, reason: 'unavailable' };
|
|
3507
|
+
}
|
|
3508
|
+
throw error;
|
|
3509
|
+
}
|
|
3510
|
+
const outcome = response as Partial<{
|
|
3511
|
+
published: unknown;
|
|
3512
|
+
recordedAtMs: unknown;
|
|
3513
|
+
reason: unknown;
|
|
3514
|
+
}> | null;
|
|
3515
|
+
if (
|
|
3516
|
+
outcome?.published === true &&
|
|
3517
|
+
typeof outcome.recordedAtMs === 'number' &&
|
|
3518
|
+
Number.isSafeInteger(outcome.recordedAtMs)
|
|
3519
|
+
) {
|
|
3520
|
+
return { published: true, recordedAtMs: outcome.recordedAtMs };
|
|
3521
|
+
}
|
|
3522
|
+
if (
|
|
3523
|
+
outcome?.published === false &&
|
|
3524
|
+
(outcome.reason === 'older' || outcome.reason === 'value_too_large')
|
|
3525
|
+
) {
|
|
3526
|
+
return { published: false, reason: outcome.reason };
|
|
3527
|
+
}
|
|
3528
|
+
throw new Error(
|
|
3529
|
+
'Receipt gateway returned an invalid shared read cache publish response.',
|
|
3530
|
+
);
|
|
3531
|
+
}
|
|
3532
|
+
|
|
3473
3533
|
/**
|
|
3474
3534
|
* Post one durable docflow observation to the receipt gateway (ADR 0016 rule
|
|
3475
3535
|
* 2). Callers invoke this fire-and-forget; it resolves on the gateway ack and
|