deepline 0.3.581 → 0.3.583
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/shared_libs/observability/scheduled-jobs.json +4 -4
- package/dist/bundling-sources/shared_libs/observability/scheduled-work-manual.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/internal-bootstrap-token.ts +14 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/early-sandbox.ts +53 -6
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-operation-contract.ts +14 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +69 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/early-sandbox-lane.ts +33 -4
- package/dist/cli/{agents-VDQSVDSM.mjs → agents-G344SPW2.mjs} +68 -4
- package/dist/cli/{agents-UDTRMWPA.js → agents-ZPDXVPEE.js} +95 -31
- package/dist/cli/{auth-SRN5FXUQ.mjs → auth-V66RP2A6.mjs} +5 -5
- package/dist/cli/auth-VU6VIPVY.js +44 -0
- package/dist/cli/{billing-PR2SIEJM.mjs → billing-BTMGZJCR.mjs} +9 -9
- package/dist/cli/{billing-HGHIOFSA.js → billing-ROYUQF67.js} +105 -105
- package/dist/cli/{chunk-7VOSQARZ.js → chunk-23LYXVI4.js} +6 -6
- package/dist/cli/{chunk-JQK42HZQ.js → chunk-2D5YISAL.js} +2 -2
- package/dist/cli/{chunk-RA3BWUTD.mjs → chunk-2QIVGZKS.mjs} +5 -5
- package/dist/cli/{chunk-WS5ZX4RB.mjs → chunk-43MKV6E4.mjs} +3 -3
- package/dist/cli/{chunk-5XVDZVCR.js → chunk-6GYGMWQV.js} +8 -8
- package/dist/cli/{chunk-KDITCSPN.mjs → chunk-6S3OAJCJ.mjs} +19 -0
- package/dist/cli/{chunk-EHTD65FE.mjs → chunk-72MEXMSH.mjs} +1 -1
- package/dist/cli/{chunk-CN4MXBZ3.js → chunk-73IZARR5.js} +13 -13
- package/dist/cli/{chunk-ULU4MEXN.mjs → chunk-7AFTLM74.mjs} +2 -2
- package/dist/cli/{chunk-VTPMBOHZ.mjs → chunk-ACS6BYE5.mjs} +2 -2
- package/dist/cli/{chunk-MSCYYFLY.js → chunk-AHQDUMDM.js} +20 -20
- package/dist/cli/{chunk-CDIMI54H.mjs → chunk-AXKFZIXC.mjs} +2 -2
- package/dist/cli/{chunk-2MIJMDGF.mjs → chunk-AXOQ2FMS.mjs} +1 -1
- package/dist/cli/{chunk-6U3THMRI.js → chunk-BUMCOVBP.js} +5 -5
- package/dist/cli/{chunk-ZTKLJADJ.mjs → chunk-C233ZRNX.mjs} +4 -4
- package/dist/cli/{chunk-INRXX4SX.js → chunk-C7UCDL2K.js} +41 -41
- package/dist/cli/{chunk-ZAKNDIK7.js → chunk-CCC3NIYB.js} +9 -9
- package/dist/cli/{chunk-N5VJVVVV.mjs → chunk-DNYFNOWG.mjs} +5 -5
- package/dist/cli/{chunk-VVENTTSA.mjs → chunk-EHV52KUV.mjs} +1 -1
- package/dist/cli/{chunk-WCNJSZHC.mjs → chunk-GFX6CDAB.mjs} +5 -5
- package/dist/cli/{chunk-J6ITN2X6.js → chunk-GQHZV7EQ.js} +7 -7
- package/dist/cli/{chunk-SNYH4QY2.js → chunk-H4BYWEV5.js} +4 -4
- package/dist/cli/{chunk-DZMQV5FL.mjs → chunk-H7F3ROT3.mjs} +2 -2
- package/dist/cli/{chunk-3FMGBMT3.mjs → chunk-HOGRT5X6.mjs} +1 -1
- package/dist/cli/{chunk-LJZESBNY.js → chunk-HYT5B2NL.js} +2 -2
- package/dist/cli/{chunk-INXRW5AF.mjs → chunk-J54DMFV5.mjs} +2 -2
- package/dist/cli/{chunk-OVJWDFIL.mjs → chunk-JQT3SHXL.mjs} +1 -1
- package/dist/cli/{chunk-46EBSUZF.mjs → chunk-K6GDSCFL.mjs} +3 -3
- package/dist/cli/{chunk-YTPXKG4C.mjs → chunk-KSXBLXLV.mjs} +1 -1
- package/dist/cli/{chunk-Y36SQMSN.js → chunk-LHD3HOYN.js} +19 -0
- package/dist/cli/{chunk-WVFDPC4K.mjs → chunk-LVJAHM2I.mjs} +3 -3
- package/dist/cli/{chunk-CNRPE3AE.js → chunk-MEAWK5G7.js} +53 -53
- package/dist/cli/{chunk-3LP7J63L.js → chunk-MFPHCUHK.js} +5 -5
- package/dist/cli/{chunk-ALXIC5U5.mjs → chunk-N5RCXI3M.mjs} +5 -5
- package/dist/cli/{chunk-E5ITZIWK.js → chunk-N5XRUZRS.js} +16 -16
- package/dist/cli/{chunk-BDNQDWGI.mjs → chunk-P2YNTAGL.mjs} +2 -2
- package/dist/cli/{chunk-E2EGQNOS.js → chunk-PGUK5VPC.js} +2 -2
- package/dist/cli/{chunk-VWPM4OIC.js → chunk-PULU5YGX.js} +20 -20
- package/dist/cli/{chunk-P5ZZY4RM.mjs → chunk-PVDP3AZY.mjs} +4 -4
- package/dist/cli/{chunk-PLGJG5FX.js → chunk-QGOHEJVJ.js} +5 -5
- package/dist/cli/{chunk-BQL34VOQ.js → chunk-QPN662ZP.js} +100 -100
- package/dist/cli/{chunk-KO6OLYSD.js → chunk-RO2LTLJA.js} +48 -48
- package/dist/cli/{chunk-VNW454PP.mjs → chunk-ROWROMXD.mjs} +1 -1
- package/dist/cli/{chunk-Z3MJX3PP.mjs → chunk-U6BTY4WS.mjs} +1 -1
- package/dist/cli/{chunk-FXSDDEAR.js → chunk-VH45GV3T.js} +1 -1
- package/dist/cli/{chunk-2RLMHWXW.js → chunk-VXDKL434.js} +3 -3
- package/dist/cli/{chunk-SZ76UE7C.mjs → chunk-VXEZKZU4.mjs} +11 -11
- package/dist/cli/{chunk-A4IOPFEJ.js → chunk-W3ECB7GC.js} +3 -3
- package/dist/cli/{chunk-E5O4CMHZ.mjs → chunk-W5WLWRKL.mjs} +2 -2
- package/dist/cli/{chunk-O5FIWG2O.js → chunk-WAZR72D5.js} +26 -26
- package/dist/cli/{chunk-VJR4CKYJ.js → chunk-WUVDJSZE.js} +23 -23
- package/dist/cli/{chunk-BULUFFST.js → chunk-YRNWA2IL.js} +15 -15
- package/dist/cli/{chunk-IT3F7P6O.js → chunk-ZFJNIZHI.js} +10 -10
- package/dist/cli/{chunk-3I6GA5QW.mjs → chunk-ZHIJA4MW.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-6WUNDV77.js +22 -0
- package/dist/cli/{concurrent-runs-help-Z27MIIH3.mjs → concurrent-runs-help-A2Y33OQ5.mjs} +6 -6
- package/dist/cli/{csv-4YFTMVWQ.mjs → csv-PS74WVXE.mjs} +4 -4
- package/dist/cli/{csv-4TP36F5O.js → csv-TKSR2LFV.js} +13 -13
- package/dist/cli/{db-U5KR6SYI.mjs → db-EXLBRZ7K.mjs} +6 -6
- package/dist/cli/{db-L5EGGO72.js → db-R6GOM4VC.js} +27 -27
- package/dist/cli/describe-CA2FL2OS.js +50 -0
- package/dist/cli/{describe-LZXXSQ26.mjs → describe-JJBXFPVQ.mjs} +18 -18
- package/dist/cli/{executions-VZKRFDGM.js → executions-474U7R3Y.js} +8 -8
- package/dist/cli/{executions-ZWEC5DDR.mjs → executions-5PEODJQG.mjs} +6 -6
- package/dist/cli/{feedback-HXQTHXEZ.mjs → feedback-QUQVRDBD.mjs} +6 -6
- package/dist/cli/{feedback-BTJIJCQF.js → feedback-URTCAOXP.js} +14 -14
- package/dist/cli/{git-P6A45MMT.mjs → git-AQF23KKU.mjs} +5 -5
- package/dist/cli/git-WJ4V2B4T.js +26 -0
- package/dist/cli/index.js +148 -148
- package/dist/cli/index.mjs +47 -47
- package/dist/cli/{integrations-4POM2CJ3.mjs → integrations-5POBI72U.mjs} +7 -7
- package/dist/cli/{integrations-VSJQBRFS.js → integrations-NMFOOSS4.js} +29 -29
- package/dist/cli/{legacy-noops-I65MIKH2.mjs → legacy-noops-6YVCOSFO.mjs} +6 -6
- package/dist/cli/{legacy-noops-QOJGSGVO.js → legacy-noops-V75T5LHV.js} +9 -9
- package/dist/cli/{mcp-TGY6SRAC.mjs → mcp-7WEYQ5V7.mjs} +4 -4
- package/dist/cli/{mcp-WTKBSLSD.js → mcp-N6GYXCUQ.js} +24 -24
- package/dist/cli/{monitors-TLWVEXW6.js → monitors-HW4H4PE5.js} +100 -100
- package/dist/cli/{monitors-E2ENT4RY.mjs → monitors-TAK4M5Y4.mjs} +7 -7
- package/dist/cli/{org-J2LGW5ZR.mjs → org-3C2RN36N.mjs} +6 -6
- package/dist/cli/{org-PZPJJU7K.js → org-FULXOXNE.js} +121 -121
- package/dist/cli/{outcomes-TMJDASU5.mjs → outcomes-4KRZL6OL.mjs} +6 -6
- package/dist/cli/{outcomes-Z6ZNBJ3U.js → outcomes-O3HDQWGN.js} +14 -14
- package/dist/cli/{play-ZOOC57X4.js → play-HA4RGX7T.js} +336 -336
- package/dist/cli/{play-S3Z24HUS.mjs → play-ZTRWUODW.mjs} +19 -19
- package/dist/cli/{providers-O4Y2YBS7.js → providers-DXMKWBZN.js} +9 -9
- package/dist/cli/{providers-ETD6YLFL.mjs → providers-FAKWWJE2.mjs} +6 -6
- package/dist/cli/{quickstart-NZALIRBP.js → quickstart-MA74UPNI.js} +6 -6
- package/dist/cli/{quickstart-QZX32Y5T.mjs → quickstart-YWGBTW77.mjs} +4 -4
- package/dist/cli/{run-5UXSWJ7N.js → run-4DXSGXRB.js} +44 -44
- package/dist/cli/{run-HCVBRE2P.mjs → run-QHCYMSBP.mjs} +23 -23
- package/dist/cli/{search-Z247K76U.mjs → search-N4ZOK5XX.mjs} +7 -7
- package/dist/cli/search-V765JH2H.js +32 -0
- package/dist/cli/{search-output-XFKEGUJA.js → search-output-D5VAC52B.js} +6 -6
- package/dist/cli/{search-output-XCJI3XRA.mjs → search-output-F2OYLVK2.mjs} +4 -4
- package/dist/cli/{secrets-VUQLTUTM.js → secrets-3KETOTDS.js} +15 -15
- package/dist/cli/{secrets-7JZXHLRU.mjs → secrets-LD4FVAQI.mjs} +6 -6
- package/dist/cli/{sessions-UNGJ342N.mjs → sessions-LPLI4Z4O.mjs} +6 -6
- package/dist/cli/sessions-XC65OMDS.js +23 -0
- package/dist/cli/{settings-67TIT4MZ.mjs → settings-NCGPJG3Z.mjs} +12 -12
- package/dist/cli/{settings-WG5YNHC5.js → settings-NFBTCOMB.js} +85 -85
- package/dist/cli/{setup-IYUNW5ZP.js → setup-ATBSUSH4.js} +49 -49
- package/dist/cli/{setup-KMAAJOZM.mjs → setup-NH6MRYXZ.mjs} +9 -9
- package/dist/cli/skills-4NQBTGOL.js +37 -0
- package/dist/cli/{skills-UVS4DODN.mjs → skills-ITPBPIXD.mjs} +7 -7
- package/dist/cli/{tools-B42JY4BX.mjs → tools-2XZPR65V.mjs} +17 -17
- package/dist/cli/tools-ZVOFATX2.js +57 -0
- package/dist/cli/update-QME3KPOP.js +37 -0
- package/dist/cli/{update-EBYZZ7BW.mjs → update-VFB22FWO.mjs} +9 -9
- package/dist/cli/{views-QK3AFD2D.mjs → views-MRN3HWTG.mjs} +6 -6
- package/dist/cli/{views-DOUEKLEV.js → views-WJUZOQM2.js} +21 -21
- package/dist/cli/{workflow-UBJPGRKF.mjs → workflow-A6P7YV5W.mjs} +42 -18
- package/dist/cli/{workflow-TAKT2T7A.js → workflow-Q4JFBTVH.js} +53 -29
- package/dist/index.js +9 -9
- package/dist/index.mjs +6 -6
- package/dist/install-integrity.json +116 -116
- 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.js +5 -5
- package/dist/server.mjs +3 -3
- package/package.json +1 -1
- package/dist/cli/auth-UYQHRHYR.js +0 -44
- package/dist/cli/concurrent-runs-help-QWDTLZUX.js +0 -22
- package/dist/cli/describe-G3SUS76P.js +0 -50
- package/dist/cli/git-QU673DBV.js +0 -26
- package/dist/cli/search-T3SLR55O.js +0 -32
- package/dist/cli/sessions-GHW2H7N2.js +0 -23
- package/dist/cli/skills-JVLCEUBF.js +0 -37
- package/dist/cli/tools-ETA3BJNM.js +0 -57
- package/dist/cli/update-XZEBQCEY.js +0 -37
|
@@ -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.583',
|
|
209
209
|
updateSummary: {
|
|
210
210
|
introducedIn: '0.3.90',
|
|
211
211
|
summary:
|
|
@@ -1221,11 +1221,11 @@
|
|
|
1221
1221
|
{
|
|
1222
1222
|
"id": "inngest.workflow-cron-tick",
|
|
1223
1223
|
"name": "Workflow cron tick",
|
|
1224
|
-
"scheduler": "
|
|
1224
|
+
"scheduler": "convex_cron",
|
|
1225
1225
|
"cadence": "* * * * *",
|
|
1226
1226
|
"timezone": "UTC",
|
|
1227
|
-
"source": "
|
|
1228
|
-
"locator": "
|
|
1227
|
+
"source": "packages/convex/crons.ts",
|
|
1228
|
+
"locator": "workflow cron tick",
|
|
1229
1229
|
"owner": "workflows",
|
|
1230
1230
|
"criticality": "critical",
|
|
1231
1231
|
"purpose": "Find due workflow cron bindings and enqueue their next workflow runs.",
|
|
@@ -1233,7 +1233,7 @@
|
|
|
1233
1233
|
"failureDefinition": "Scan/enqueue fails or due bindings lack a durable disposition.",
|
|
1234
1234
|
"startGraceMs": 120000,
|
|
1235
1235
|
"runTimeoutMs": 1800000,
|
|
1236
|
-
"failureAlert": "
|
|
1236
|
+
"failureAlert": "convex_action_wrapper",
|
|
1237
1237
|
"domainReportRequired": true
|
|
1238
1238
|
},
|
|
1239
1239
|
{
|
|
@@ -12,6 +12,7 @@ export const MANUALLY_RUNNABLE_CONVEX_CRON_JOB_IDS = [
|
|
|
12
12
|
'github.credit-purchase-readiness-scan',
|
|
13
13
|
'github.credit-purchase-readiness-morning',
|
|
14
14
|
'inngest.play-cron-tick',
|
|
15
|
+
'inngest.workflow-cron-tick',
|
|
15
16
|
'convex.fold-usage-rollups',
|
|
16
17
|
'convex.sweep-closed-day-usage-rollups',
|
|
17
18
|
'convex.cleanup-expired-org-day-usage-shards',
|
|
@@ -372,6 +372,13 @@ export type WorkflowRunExecutionTokenClaims =
|
|
|
372
372
|
* number: a projector uses it only within its own bound.
|
|
373
373
|
*/
|
|
374
374
|
run_ledger_terminal_backlog_prefix_facts?: number;
|
|
375
|
+
/**
|
|
376
|
+
* The issuing build serves `project_run_events_prefixed`. Minted beside
|
|
377
|
+
* `run_ledger_ingress_prefix_origin` by builds that serve that action and
|
|
378
|
+
* never by older ones, so it is the projector's opt-in for multi-fact
|
|
379
|
+
* receipts to a mutable receiver.
|
|
380
|
+
*/
|
|
381
|
+
run_ledger_prefixed_projection?: true;
|
|
375
382
|
};
|
|
376
383
|
|
|
377
384
|
export type RuntimeRateScopeTokenClaims = {
|
|
@@ -698,6 +705,8 @@ function isValidWorkflowClaimsShape(
|
|
|
698
705
|
isValidRuntimeOrigin(claims.run_ledger_ingress_prefix_origin)) &&
|
|
699
706
|
(claims.run_ledger_terminal_backlog_prefix_facts === undefined ||
|
|
700
707
|
typeof claims.run_ledger_terminal_backlog_prefix_facts === 'number') &&
|
|
708
|
+
(claims.run_ledger_prefixed_projection === undefined ||
|
|
709
|
+
claims.run_ledger_prefixed_projection === true) &&
|
|
701
710
|
Array.isArray(claims.capabilities) &&
|
|
702
711
|
claims.capabilities.length > 0 &&
|
|
703
712
|
claims.capabilities.every(isRuntimeExecutionCapability) &&
|
|
@@ -932,6 +941,11 @@ export async function mintWorkflowRunExecutionToken(input: {
|
|
|
932
941
|
// the facts its verifier proves (run-ledger-projection-contract).
|
|
933
942
|
run_ledger_terminal_backlog_prefix_facts:
|
|
934
943
|
RUN_LEDGER_TERMINAL_BACKLOG_PREFIX_MAX_FACTS,
|
|
944
|
+
// This build serves `project_run_events_prefixed`. A projector may
|
|
945
|
+
// send this run's multi-fact receipts to a mutable receiver only on
|
|
946
|
+
// this claim: an older app never mints it, so a runtime deployed
|
|
947
|
+
// first, or an app rolled back past this build, opts no new run in.
|
|
948
|
+
run_ledger_prefixed_projection: true,
|
|
935
949
|
}
|
|
936
950
|
: {}),
|
|
937
951
|
sub: input.subject ?? 'workflow_executor',
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
createHash,
|
|
3
|
+
createHmac,
|
|
4
|
+
randomBytes,
|
|
5
|
+
timingSafeEqual,
|
|
6
|
+
} from 'node:crypto';
|
|
2
7
|
import {
|
|
3
8
|
earlySandboxCapUnits,
|
|
4
9
|
type PlaySandboxRuntimeLimits,
|
|
@@ -164,7 +169,8 @@ export const MODAL_SANDBOX_TAGS_MAX_BYTES = 512;
|
|
|
164
169
|
/** Bytes Modal counts toward that cap: every tag name and value (UTF-8). */
|
|
165
170
|
export function modalSandboxTagsBytes(tags: Record<string, string>): number {
|
|
166
171
|
return Object.entries(tags).reduce(
|
|
167
|
-
(sum, [name, value]) =>
|
|
172
|
+
(sum, [name, value]) =>
|
|
173
|
+
sum + Buffer.byteLength(name) + Buffer.byteLength(value),
|
|
168
174
|
0,
|
|
169
175
|
);
|
|
170
176
|
}
|
|
@@ -252,7 +258,12 @@ export function verifyEarlyPrebootPlan(input: {
|
|
|
252
258
|
nowMs: number;
|
|
253
259
|
}):
|
|
254
260
|
| { plan: EarlyPrebootPlan }
|
|
255
|
-
| {
|
|
261
|
+
| {
|
|
262
|
+
refused:
|
|
263
|
+
| 'preboot_plan_missing'
|
|
264
|
+
| 'preboot_plan_invalid'
|
|
265
|
+
| 'preboot_stale';
|
|
266
|
+
} {
|
|
256
267
|
const value = input.tags[EARLY_PREBOOT_TAG];
|
|
257
268
|
// `1` (the create-time claim) or absent: not published (yet). Any other
|
|
258
269
|
// plan form (an older or newer build's) is refused, never guessed at.
|
|
@@ -668,6 +679,17 @@ export type EarlySandboxAdapter<
|
|
|
668
679
|
}): Promise<EarlySandboxSweepOutcome | { skipped: string }>;
|
|
669
680
|
};
|
|
670
681
|
|
|
682
|
+
/**
|
|
683
|
+
* An advisory check run inside the fire-and-forget create, before any
|
|
684
|
+
* provider call: a skip names why this run would not adopt in time (its
|
|
685
|
+
* org's sandbox capacity is full, so the run will queue past the adoption
|
|
686
|
+
* window). Null, or a rejected check, creates as before.
|
|
687
|
+
*/
|
|
688
|
+
export type EarlySandboxCreateGate = () => Promise<{
|
|
689
|
+
reason: string;
|
|
690
|
+
[detail: string]: unknown;
|
|
691
|
+
} | null>;
|
|
692
|
+
|
|
671
693
|
/**
|
|
672
694
|
* Start (fire and forget) the early sandbox for an admitted run. Idempotent
|
|
673
695
|
* per process; a second hint for the same run is ignored.
|
|
@@ -675,6 +697,7 @@ export type EarlySandboxAdapter<
|
|
|
675
697
|
export function startEarlySandbox<TSandbox extends EarlySandboxHandle>(
|
|
676
698
|
adapter: EarlySandboxAdapter<TSandbox>,
|
|
677
699
|
input: EarlySandboxStartRequest,
|
|
700
|
+
options: { createGate?: EarlySandboxCreateGate } = {},
|
|
678
701
|
): boolean {
|
|
679
702
|
if (
|
|
680
703
|
!resolveExperimentSwitch(
|
|
@@ -700,14 +723,38 @@ export function startEarlySandbox<TSandbox extends EarlySandboxHandle>(
|
|
|
700
723
|
});
|
|
701
724
|
if (adapter.registry.hinted(key)) return false;
|
|
702
725
|
const hintAtMs = Date.now();
|
|
703
|
-
const
|
|
704
|
-
|
|
726
|
+
const createGate = options.createGate;
|
|
727
|
+
const started = (async () => {
|
|
728
|
+
if (createGate) {
|
|
729
|
+
const skip = await createGate().catch((error: unknown) => {
|
|
730
|
+
// Advisory: a failed check creates exactly as before.
|
|
731
|
+
logEarlySandbox(adapter.logScope, 'create_gate_failed', {
|
|
732
|
+
key,
|
|
733
|
+
orgId,
|
|
734
|
+
error: error instanceof Error ? error.message : String(error),
|
|
735
|
+
});
|
|
736
|
+
return null;
|
|
737
|
+
});
|
|
738
|
+
if (skip) {
|
|
739
|
+
// Resolves null like a failed create: the registry releases the
|
|
740
|
+
// entry's units and the launch creates its own sandbox.
|
|
741
|
+
logEarlySandbox(adapter.logScope, 'create_skipped', {
|
|
742
|
+
key,
|
|
743
|
+
orgId,
|
|
744
|
+
workflowId: input.workflowId,
|
|
745
|
+
...skip,
|
|
746
|
+
});
|
|
747
|
+
return null;
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
return await adapter.createEarly({
|
|
705
751
|
...input,
|
|
706
752
|
key,
|
|
707
753
|
orgId,
|
|
708
754
|
hintAtMs,
|
|
709
755
|
scope,
|
|
710
|
-
})
|
|
756
|
+
});
|
|
757
|
+
})().catch((error: unknown) => {
|
|
711
758
|
logEarlySandbox(adapter.logScope, 'create_failed', {
|
|
712
759
|
key,
|
|
713
760
|
orgId,
|
|
@@ -85,6 +85,11 @@ export const RUNTIME_OPERATION_CAPABILITIES = {
|
|
|
85
85
|
repair_runtime_storage_grants: 'sheet.write',
|
|
86
86
|
append_run_events: 'run.progress',
|
|
87
87
|
project_run_events: 'run.progress',
|
|
88
|
+
// A multi-fact Run Ledger receipt for a run.events prefix. Identical to
|
|
89
|
+
// project_run_events at a receiver that proves prefixes; its own name is
|
|
90
|
+
// the capability fence, so an older app refuses it instead of reading a
|
|
91
|
+
// multi-fact receipt with single-fact proof.
|
|
92
|
+
project_run_events_prefixed: 'run.progress',
|
|
88
93
|
save_results: 'run.progress',
|
|
89
94
|
start_run: 'run.progress',
|
|
90
95
|
record_first_claim_latency: 'run.progress',
|
|
@@ -135,6 +140,13 @@ export const RUNTIME_OPERATION_CONTRACT: DeployedOperationContract =
|
|
|
135
140
|
kind: 'equivalent-fallback',
|
|
136
141
|
action: 'append_run_events',
|
|
137
142
|
},
|
|
143
|
+
// Never degrade to project_run_events: that would hand a multi-fact
|
|
144
|
+
// receipt to a receiver without prefix proof. The projector retains
|
|
145
|
+
// the claimed facts and retries after the newer app promotes.
|
|
146
|
+
project_run_events_prefixed: {
|
|
147
|
+
kind: 'feature-unavailable',
|
|
148
|
+
code: 'RUN_LEDGER_PREFIX_RECEIPT_UNAVAILABLE',
|
|
149
|
+
},
|
|
138
150
|
// The runner retains the complete result before attempting this
|
|
139
151
|
// compact completion. An older app receiver reports the action as
|
|
140
152
|
// unsupported, and the adapter retries the established full-payload
|
|
@@ -175,6 +187,7 @@ const BLOCKED_ACCOUNT_COMPLETION_OPERATIONS = new Set<string>([
|
|
|
175
187
|
'heartbeat_runtime_step_receipts',
|
|
176
188
|
'append_run_events',
|
|
177
189
|
'project_run_events',
|
|
190
|
+
'project_run_events_prefixed',
|
|
178
191
|
'save_results',
|
|
179
192
|
'compute_billing_upsert',
|
|
180
193
|
'compute_billing_record_item',
|
|
@@ -241,6 +254,7 @@ export function runtimeOperationCapabilityForRequest(
|
|
|
241
254
|
capabilities.length !== 1 ||
|
|
242
255
|
![
|
|
243
256
|
'project_run_events',
|
|
257
|
+
'project_run_events_prefixed',
|
|
244
258
|
'project_run_created',
|
|
245
259
|
'append_run_events',
|
|
246
260
|
'start_run',
|
package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts
CHANGED
|
@@ -405,6 +405,7 @@ import {
|
|
|
405
405
|
reserveRuntimeSandboxOperation,
|
|
406
406
|
RUNTIME_SANDBOX_CAPACITY_LEASE_MS,
|
|
407
407
|
runtimeSandboxCapacityAdmissionMode,
|
|
408
|
+
type RuntimeSandboxCapacityAdmissionMode,
|
|
408
409
|
RuntimeSandboxCapacityLimitError,
|
|
409
410
|
} from './runtime-sandbox-capacity';
|
|
410
411
|
import {
|
|
@@ -11969,6 +11970,9 @@ export function createAbsurdRuntimeWorkerHostLifecycle(input: {
|
|
|
11969
11970
|
return closing !== null || capacity.draining;
|
|
11970
11971
|
},
|
|
11971
11972
|
hasIdleSlot: () => closing === null && capacity.hasIdleSlot(),
|
|
11973
|
+
...(capacity.orgSandboxCapacity
|
|
11974
|
+
? { orgSandboxCapacity: capacity.orgSandboxCapacity }
|
|
11975
|
+
: {}),
|
|
11972
11976
|
},
|
|
11973
11977
|
}
|
|
11974
11978
|
: {}),
|
|
@@ -12023,6 +12027,46 @@ export function resolveAbsurdRuntimeWorkerReleaseIdentity(
|
|
|
12023
12027
|
};
|
|
12024
12028
|
}
|
|
12025
12029
|
|
|
12030
|
+
/** Bound on the early-sandbox org-capacity read before an early create. */
|
|
12031
|
+
export const EARLY_SANDBOX_ORG_CAPACITY_CHECK_TIMEOUT_MS = 1_000;
|
|
12032
|
+
|
|
12033
|
+
/**
|
|
12034
|
+
* The pool's signal bounds admission only, not the query, so the early create
|
|
12035
|
+
* waits on the read no longer than the bound: past it the check rejects and
|
|
12036
|
+
* the create proceeds as before (`create_gate_failed`).
|
|
12037
|
+
*/
|
|
12038
|
+
export function withEarlySandboxOrgCapacityDeadline<T>(
|
|
12039
|
+
read: Promise<T>,
|
|
12040
|
+
timeoutMs: number = EARLY_SANDBOX_ORG_CAPACITY_CHECK_TIMEOUT_MS,
|
|
12041
|
+
): Promise<T> {
|
|
12042
|
+
let timer: ReturnType<typeof setTimeout> | undefined;
|
|
12043
|
+
const deadline = new Promise<never>((_, reject) => {
|
|
12044
|
+
timer = setTimeout(
|
|
12045
|
+
() =>
|
|
12046
|
+
reject(
|
|
12047
|
+
new Error(
|
|
12048
|
+
`early sandbox org capacity check exceeded ${timeoutMs} ms`,
|
|
12049
|
+
),
|
|
12050
|
+
),
|
|
12051
|
+
timeoutMs,
|
|
12052
|
+
);
|
|
12053
|
+
timer.unref?.();
|
|
12054
|
+
});
|
|
12055
|
+
return Promise.race([read, deadline]).finally(() => clearTimeout(timer));
|
|
12056
|
+
}
|
|
12057
|
+
|
|
12058
|
+
/**
|
|
12059
|
+
* Only `enforce` admission holds a run at its org's sandbox limit. In `observe`
|
|
12060
|
+
* an over-limit org still starts runs immediately, so a "full" read would skip
|
|
12061
|
+
* an early create the run would have adopted; install the check only then.
|
|
12062
|
+
*/
|
|
12063
|
+
export function earlySandboxOrgCapacityCheckForAdmissionMode<T>(
|
|
12064
|
+
mode: RuntimeSandboxCapacityAdmissionMode,
|
|
12065
|
+
check: T,
|
|
12066
|
+
): { orgSandboxCapacity: T } | Record<string, never> {
|
|
12067
|
+
return mode === 'enforce' ? { orgSandboxCapacity: check } : {};
|
|
12068
|
+
}
|
|
12069
|
+
|
|
12026
12070
|
/**
|
|
12027
12071
|
* Start one poll loop and slot pool. Event waits park the task in Postgres and
|
|
12028
12072
|
* release the slot until their own top-level play resumes.
|
|
@@ -12570,6 +12614,31 @@ export async function startRuntimeWorkerHost(
|
|
|
12570
12614
|
earlySandboxCapacity: {
|
|
12571
12615
|
draining: drainExit,
|
|
12572
12616
|
hasIdleSlot: claimLoop.hasIdleSlot,
|
|
12617
|
+
// One bounded read: a slow or failed check creates as before.
|
|
12618
|
+
...earlySandboxOrgCapacityCheckForAdmissionMode(
|
|
12619
|
+
runtimeSandboxCapacityAdmissionMode(),
|
|
12620
|
+
({ orgId, runId }: { orgId: string; runId: string }) =>
|
|
12621
|
+
withEarlySandboxOrgCapacityDeadline(
|
|
12622
|
+
withRuntimeSchedulerClient(
|
|
12623
|
+
poolOptions,
|
|
12624
|
+
(client) =>
|
|
12625
|
+
precheckRuntimeSandboxCapacity(
|
|
12626
|
+
client,
|
|
12627
|
+
{ orgId, runId },
|
|
12628
|
+
schedulerOptions.schema
|
|
12629
|
+
? { schema: schedulerOptions.schema }
|
|
12630
|
+
: {},
|
|
12631
|
+
),
|
|
12632
|
+
{ runId, phase: 'early_sandbox_org_capacity' },
|
|
12633
|
+
{
|
|
12634
|
+
maxAttempts: 1,
|
|
12635
|
+
signal: AbortSignal.timeout(
|
|
12636
|
+
EARLY_SANDBOX_ORG_CAPACITY_CHECK_TIMEOUT_MS,
|
|
12637
|
+
),
|
|
12638
|
+
},
|
|
12639
|
+
),
|
|
12640
|
+
),
|
|
12641
|
+
),
|
|
12573
12642
|
},
|
|
12574
12643
|
// Release LISTEN before joining accepted work, so a replacement can elect
|
|
12575
12644
|
// its listener without exhausting primary scheduler sessions.
|
package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/early-sandbox-lane.ts
CHANGED
|
@@ -113,6 +113,17 @@ export type EarlySandboxWorkerCapacity = {
|
|
|
113
113
|
readonly draining: boolean;
|
|
114
114
|
/** Whether the claim loop has a free slot to claim the hinted run with. */
|
|
115
115
|
hasIdleSlot(): boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Advisory, lock-free read of the hinted org's sandbox capacity
|
|
118
|
+
* (`precheckRuntimeSandboxCapacity`). A full org's run waits for a lease,
|
|
119
|
+
* usually past the adoption window, so its early sandbox would only be
|
|
120
|
+
* reaped (Production 2026-12-01: 73 of 98 capacity-held runs waited 30 s
|
|
121
|
+
* or more). Absent: no check, as before.
|
|
122
|
+
*/
|
|
123
|
+
orgSandboxCapacity?(input: {
|
|
124
|
+
orgId: string;
|
|
125
|
+
runId: string;
|
|
126
|
+
}): Promise<{ full: boolean; limit: number; activeLeases: number }>;
|
|
116
127
|
};
|
|
117
128
|
|
|
118
129
|
/** A hinted run's early-sandbox switches (E2, PB, CA). */
|
|
@@ -269,8 +280,7 @@ export function outstandingEarlySandboxesForOrg(
|
|
|
269
280
|
),
|
|
270
281
|
);
|
|
271
282
|
let total = 0;
|
|
272
|
-
for (const registry of registries)
|
|
273
|
-
total += registry.outstandingForOrg(orgId);
|
|
283
|
+
for (const registry of registries) total += registry.outstandingForOrg(orgId);
|
|
274
284
|
return total;
|
|
275
285
|
}
|
|
276
286
|
|
|
@@ -416,6 +426,25 @@ export function startWorkerLaneEarlySandbox(
|
|
|
416
426
|
? { sandboxRuntimeLimits: input.sandboxRuntimeLimits }
|
|
417
427
|
: {}),
|
|
418
428
|
};
|
|
429
|
+
const orgCapacity = input.capacity?.orgSandboxCapacity;
|
|
430
|
+
const startOptions =
|
|
431
|
+
orgCapacity && hintOrgId
|
|
432
|
+
? {
|
|
433
|
+
createGate: async () => {
|
|
434
|
+
const capacity = await orgCapacity({
|
|
435
|
+
orgId: hintOrgId,
|
|
436
|
+
runId: input.workflowId,
|
|
437
|
+
});
|
|
438
|
+
return capacity.full
|
|
439
|
+
? {
|
|
440
|
+
reason: 'org_sandbox_capacity_full',
|
|
441
|
+
limit: capacity.limit,
|
|
442
|
+
activeLeases: capacity.activeLeases,
|
|
443
|
+
}
|
|
444
|
+
: null;
|
|
445
|
+
},
|
|
446
|
+
}
|
|
447
|
+
: {};
|
|
419
448
|
if (
|
|
420
449
|
!resolveExperimentSwitch(
|
|
421
450
|
'LH',
|
|
@@ -423,7 +452,7 @@ export function startWorkerLaneEarlySandbox(
|
|
|
423
452
|
EARLY_SANDBOX_LISTENER_HINT,
|
|
424
453
|
)
|
|
425
454
|
) {
|
|
426
|
-
return startEarlySandbox(adapter, request);
|
|
455
|
+
return startEarlySandbox(adapter, request, startOptions);
|
|
427
456
|
}
|
|
428
457
|
// LH: admitted only by this worker's desk, bound to the hint's queue,
|
|
429
458
|
// this worker's current listener generation and one free slot.
|
|
@@ -463,7 +492,7 @@ export function startWorkerLaneEarlySandbox(
|
|
|
463
492
|
if (refusal) {
|
|
464
493
|
return refuseEarlySandboxHint({ ...hint, reason: `listener_${refusal}` });
|
|
465
494
|
}
|
|
466
|
-
const started = startEarlySandbox(adapter, request);
|
|
495
|
+
const started = startEarlySandbox(adapter, request, startOptions);
|
|
467
496
|
if (!started) desk.released(key);
|
|
468
497
|
return started;
|
|
469
498
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getAuthedHttpClient,
|
|
3
3
|
printCommandEnvelope
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7AFTLM74.mjs";
|
|
5
5
|
import {
|
|
6
6
|
cliFeatureEnabled
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-U6BTY4WS.mjs";
|
|
8
|
+
import "./chunk-AXOQ2FMS.mjs";
|
|
9
9
|
import "./chunk-ASB47RXJ.mjs";
|
|
10
10
|
import "./chunk-DLIRSHV6.mjs";
|
|
11
11
|
import {
|
|
12
12
|
DeeplineError
|
|
13
13
|
} from "./chunk-Z3A2S3QM.mjs";
|
|
14
14
|
import "./chunk-2MGZAI54.mjs";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-EHV52KUV.mjs";
|
|
16
16
|
import "./chunk-WZYKRD7T.mjs";
|
|
17
17
|
import "./chunk-KRD6H754.mjs";
|
|
18
18
|
|
|
@@ -42,6 +42,10 @@ function describeOwnedOutcome(owned) {
|
|
|
42
42
|
const last = owned.lastWake ? `last ring ${new Date(owned.lastWake.at).toISOString()} ${WAKE_STATUS_WORDS[owned.lastWake.status]}${owned.lastWake.what.length > 0 ? ` (${owned.lastWake.what.join(", ")})` : ""}` : "never rung";
|
|
43
43
|
return `${owned.outcome} \u2014 as ${owned.agent}; ${watch}; ${last}; ${owned.turnsInWindow} of ${owned.turnLimit} turns this hour`;
|
|
44
44
|
}
|
|
45
|
+
function describeHomeWakes(home) {
|
|
46
|
+
const last = home.lastWake ? `last ring ${new Date(home.lastWake.at).toISOString()} ${WAKE_STATUS_WORDS[home.lastWake.status]}${home.lastWake.what.length > 0 ? ` (${home.lastWake.what.join(", ")})` : ""}` : "never rung";
|
|
47
|
+
return `#${home.conversationName} (${home.conversationId}) \u2014 ${home.agent} on ${home.outcome}; ${home.watching ? "woken there" : "not woken (no watch)"}; ${last}; ${home.turnsInWindow} of ${home.turnLimit} turns this hour`;
|
|
48
|
+
}
|
|
45
49
|
var REPLIES_MAX_LIMIT = 100;
|
|
46
50
|
var REPLIES_INVALID_CURSOR = "DEEPLINE_AGENT_REPLIES_INVALID_CURSOR";
|
|
47
51
|
var FEEDBACK_MAX_LIMIT = 100;
|
|
@@ -496,6 +500,66 @@ function registerWorkspaceCommands(agents, readKey) {
|
|
|
496
500
|
options
|
|
497
501
|
);
|
|
498
502
|
});
|
|
503
|
+
agents.command("wakes").description(
|
|
504
|
+
"List outcome home channels with how their agent was last woken and its hourly turn budget."
|
|
505
|
+
).option("--json", "Emit JSON output").action(async (options) => {
|
|
506
|
+
const { http } = getAuthedHttpClient();
|
|
507
|
+
const result = await http.get(
|
|
508
|
+
`${AGENT_PATH}/wakes`
|
|
509
|
+
);
|
|
510
|
+
print(
|
|
511
|
+
result,
|
|
512
|
+
"agent wakes",
|
|
513
|
+
result.homes.length === 0 ? [
|
|
514
|
+
"No channel is an outcome\u2019s home. Make one with: deepline agents channels set <channel-id> --outcome <outcome>"
|
|
515
|
+
] : result.homes.map(describeHomeWakes),
|
|
516
|
+
options
|
|
517
|
+
);
|
|
518
|
+
});
|
|
519
|
+
agents.command("memory").description(
|
|
520
|
+
"Show what the agent remembers about an outcome, in each channel that works toward it, and who said it; --clear forgets it all (both need member access)."
|
|
521
|
+
).argument("<outcome>", "Outcome name, as deepline outcomes list prints it").option(
|
|
522
|
+
"--clear",
|
|
523
|
+
"Forget everything the agent remembers about this outcome (member access)"
|
|
524
|
+
).option("--json", "Emit JSON output").action(
|
|
525
|
+
async (outcome, options) => {
|
|
526
|
+
const name = requireArgument(outcome, "an outcome name");
|
|
527
|
+
const path = `${AGENT_PATH}/memory?outcome=${encodeURIComponent(name)}`;
|
|
528
|
+
const { http } = getAuthedHttpClient();
|
|
529
|
+
if (options.clear) {
|
|
530
|
+
const result2 = await http.delete(path);
|
|
531
|
+
print(
|
|
532
|
+
result2,
|
|
533
|
+
"agent memory",
|
|
534
|
+
[
|
|
535
|
+
result2.cleared === 0 ? `The agent remembered nothing about ${name}.` : `Forgot ${result2.cleared} ${result2.cleared === 1 ? "thing" : "things"} the agent remembered about ${name}.`
|
|
536
|
+
],
|
|
537
|
+
options
|
|
538
|
+
);
|
|
539
|
+
return;
|
|
540
|
+
}
|
|
541
|
+
const result = await http.get(path);
|
|
542
|
+
print(
|
|
543
|
+
result,
|
|
544
|
+
"agent memory",
|
|
545
|
+
result.memories.length === 0 ? [
|
|
546
|
+
`The agent remembers nothing about ${name} yet. It saves what people tell it that will matter later (decisions, deadlines, preferences, who owns what).`
|
|
547
|
+
] : [
|
|
548
|
+
...result.memories.flatMap(describeOutcomeMemory),
|
|
549
|
+
`Forget it all with: deepline agents memory ${name} --clear`
|
|
550
|
+
],
|
|
551
|
+
options
|
|
552
|
+
);
|
|
553
|
+
}
|
|
554
|
+
);
|
|
555
|
+
}
|
|
556
|
+
function describeOutcomeMemory(memory) {
|
|
557
|
+
return [
|
|
558
|
+
memory.owner ? "Bot by Deepline (no channel):" : `#${memory.conversationName}:`,
|
|
559
|
+
...memory.entries.map(
|
|
560
|
+
(entry) => ` ${entry.n}. ${entry.text} (${entry.source})`
|
|
561
|
+
)
|
|
562
|
+
];
|
|
499
563
|
}
|
|
500
564
|
function registerAgentCommands(agents) {
|
|
501
565
|
agents.command("get").description("Show one agent: its instructions, skills and channels.").argument("<name>", "Agent name").option("--json", "Emit JSON output").action(async (name, options) => {
|