deepline 0.3.575 → 0.3.576
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 +13 -1
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +145 -0
- package/dist/bundling-sources/shared_libs/play-runtime/durable-runs-rollout.ts +17 -0
- package/dist/bundling-sources/shared_libs/play-runtime/experiment-switches.ts +8 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +153 -10
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-speed-profile.ts +41 -5
- package/dist/cli/{agents-ULGDKUTM.mjs → agents-BLJR2Y3X.mjs} +35 -4
- package/dist/cli/{agents-BCLO3KQJ.js → agents-CJQ7KBFT.js} +61 -30
- package/dist/cli/auth-GSDYP4ZN.js +44 -0
- package/dist/cli/{auth-4WCL7A6W.mjs → auth-SLZIRCPE.mjs} +5 -5
- package/dist/cli/{billing-7JQ6EUQU.mjs → billing-6Q4SK5KF.mjs} +9 -9
- package/dist/cli/{billing-BF5LVXOM.js → billing-IECMVARO.js} +102 -102
- package/dist/cli/{chunk-2T7XOKVL.mjs → chunk-2UHEJPSS.mjs} +5 -5
- package/dist/cli/{chunk-AO56MZ7D.js → chunk-36254433.js} +3 -3
- package/dist/cli/{chunk-EZIXKNKM.js → chunk-45POZK3F.js} +3 -3
- package/dist/cli/{chunk-5H6254MJ.js → chunk-4KIIXV5Z.js} +16 -16
- package/dist/cli/{chunk-GQZFZG6R.mjs → chunk-5VABOJ4M.mjs} +2 -2
- package/dist/cli/{chunk-TTBZ7QXX.mjs → chunk-66K7F7LR.mjs} +1 -1
- package/dist/cli/{chunk-HEOM3FAC.js → chunk-6JQZC6HX.js} +20 -20
- package/dist/cli/{chunk-XFV353R2.js → chunk-6RY5COUY.js} +23 -23
- package/dist/cli/{chunk-RHRRY2BX.mjs → chunk-7DI34I73.mjs} +3 -3
- package/dist/cli/{chunk-ZYSJND73.js → chunk-ANPHEXTT.js} +9 -9
- package/dist/cli/{chunk-JGLCK2XF.mjs → chunk-AUR24RQB.mjs} +2 -2
- package/dist/cli/{chunk-FDCU3VAJ.mjs → chunk-AZFSCPYK.mjs} +18 -1
- package/dist/cli/{chunk-YNAXKA23.js → chunk-BRPUB6UA.js} +5 -5
- package/dist/cli/{chunk-BM536WWR.mjs → chunk-CUIFDMNP.mjs} +11 -1
- package/dist/cli/{chunk-SYQTBHRX.mjs → chunk-D5LWYP2H.mjs} +3 -3
- package/dist/cli/{chunk-ZQXJYO5P.js → chunk-DGY4EYIX.js} +5 -5
- package/dist/cli/{chunk-2UM3I2MY.js → chunk-E4M4QZBP.js} +11 -1
- package/dist/cli/{chunk-V5XLENWK.js → chunk-EQO77FQZ.js} +5 -5
- package/dist/cli/{chunk-H6JMRLAZ.js → chunk-F4H26PP6.js} +100 -100
- package/dist/cli/{chunk-MN7JLH2T.mjs → chunk-GI57Q7JU.mjs} +2 -2
- package/dist/cli/{chunk-ZS6DT4LD.js → chunk-GZ7KYGYE.js} +15 -15
- package/dist/cli/{chunk-TMFR2B45.mjs → chunk-HE53AI2E.mjs} +3 -3
- package/dist/cli/{chunk-6IKLITVH.js → chunk-HHMO3CON.js} +6 -6
- package/dist/cli/{chunk-X47J55ZJ.mjs → chunk-JPFAD6G6.mjs} +2 -2
- package/dist/cli/{chunk-EV3OPDHF.js → chunk-JSIOLCTK.js} +20 -20
- package/dist/cli/{chunk-QKP3WYSZ.mjs → chunk-KQTZO6NT.mjs} +2 -2
- package/dist/cli/{chunk-636GD4IR.js → chunk-L6H72AIX.js} +2 -2
- package/dist/cli/{chunk-IAJ65IDZ.mjs → chunk-LKC7PHDX.mjs} +4 -4
- package/dist/cli/{chunk-HO76C7AE.js → chunk-M23G33MH.js} +2 -2
- package/dist/cli/{chunk-KNCNFL76.js → chunk-MDJ4LPQ5.js} +4 -4
- package/dist/cli/{chunk-DMPGJCNZ.js → chunk-MXPCTF57.js} +18 -1
- package/dist/cli/{chunk-FXXERR52.js → chunk-NQFZ7FYN.js} +10 -10
- package/dist/cli/{chunk-MWLOBURN.mjs → chunk-OMVBBAQP.mjs} +2 -2
- package/dist/cli/{chunk-737Y7QGT.js → chunk-OXRG325T.js} +41 -41
- package/dist/cli/{chunk-CVY4MBXH.mjs → chunk-PU5VCDCJ.mjs} +5 -5
- package/dist/cli/{chunk-5VSHQG5E.js → chunk-PYFMNPTA.js} +8 -8
- package/dist/cli/{chunk-IOWLFWWG.mjs → chunk-QCD7BQ5Z.mjs} +2 -2
- package/dist/cli/{chunk-QEDRUURT.mjs → chunk-R5NKLZL2.mjs} +1 -1
- package/dist/cli/{chunk-E4RYSSXX.mjs → chunk-S4IW4NAI.mjs} +1 -1
- package/dist/cli/{chunk-7DLAJ6JJ.js → chunk-SBZSJQEI.js} +53 -53
- package/dist/cli/{chunk-BQUAE6LQ.mjs → chunk-SY3OKOI5.mjs} +1 -1
- package/dist/cli/{chunk-NF722E6C.mjs → chunk-TZHS2W5Z.mjs} +1 -1
- package/dist/cli/{chunk-AS5XGOZY.js → chunk-UD6M2ZTY.js} +2 -2
- package/dist/cli/{chunk-56N3XAT6.mjs → chunk-UGIH4462.mjs} +5 -5
- package/dist/cli/{chunk-PQYDO72W.js → chunk-V25CXBR2.js} +26 -26
- package/dist/cli/{chunk-GB4IZ5TV.js → chunk-WDWV77SJ.js} +13 -13
- package/dist/cli/{chunk-G4WPDCXA.js → chunk-WPGZ6V36.js} +48 -48
- package/dist/cli/{chunk-UQZP7XBQ.mjs → chunk-X5V6S5KI.mjs} +5 -5
- package/dist/cli/{chunk-IBYMGR5Y.mjs → chunk-XJNJ3BWU.mjs} +1 -1
- package/dist/cli/{chunk-G2H6SQQY.js → chunk-Y4A6Y5EY.js} +7 -7
- package/dist/cli/{chunk-5D7OJY4W.mjs → chunk-YHM64N5C.mjs} +1 -1
- package/dist/cli/{chunk-H3CG72RZ.mjs → chunk-ZIGMC2X4.mjs} +11 -11
- package/dist/cli/{chunk-3PVKXUSJ.mjs → chunk-ZRC52APB.mjs} +1 -1
- package/dist/cli/{chunk-BONMEBWZ.mjs → chunk-ZYN6S6G2.mjs} +4 -4
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/{concurrent-runs-help-HITK6EOO.mjs → concurrent-runs-help-H3SA7J6H.mjs} +6 -6
- package/dist/cli/concurrent-runs-help-PB7GT6F2.js +22 -0
- package/dist/cli/{csv-RS7XHQ4P.js → csv-6DEKR3QQ.js} +13 -13
- package/dist/cli/{csv-V2T23MXT.mjs → csv-ICXI7JAS.mjs} +4 -4
- package/dist/cli/{db-WFIVRPKY.js → db-AG7INMLP.js} +27 -27
- package/dist/cli/{db-OQ4RNTGE.mjs → db-VI7T5E6O.mjs} +6 -6
- package/dist/cli/describe-LMHIG3DP.js +50 -0
- package/dist/cli/{describe-AXV2EEX3.mjs → describe-S6NFWWGK.mjs} +18 -18
- package/dist/cli/{executions-5H2RIWZ3.js → executions-M5R5QHIA.js} +8 -8
- package/dist/cli/{executions-THP5ZDBQ.mjs → executions-MK7H4Q2H.mjs} +6 -6
- package/dist/cli/{feedback-UOI6UEGA.js → feedback-L3L4FEQL.js} +14 -14
- package/dist/cli/{feedback-2EJPILGE.mjs → feedback-ZHATL2XF.mjs} +6 -6
- package/dist/cli/{git-DI3LJIAT.mjs → git-W5DHNH2Q.mjs} +5 -5
- package/dist/cli/git-WYNCLDHD.js +26 -0
- package/dist/cli/index.js +148 -148
- package/dist/cli/index.mjs +47 -47
- package/dist/cli/{integrations-DJYS5VRK.mjs → integrations-73YSN2LI.mjs} +7 -7
- package/dist/cli/{integrations-TYN2BSQ6.js → integrations-IBWNO3YP.js} +29 -29
- package/dist/cli/{legacy-noops-Z457BB6O.mjs → legacy-noops-4LFZJTDX.mjs} +6 -6
- package/dist/cli/{legacy-noops-GXQHNLGJ.js → legacy-noops-AE6DBYJM.js} +9 -9
- package/dist/cli/{mcp-WMBOOTQL.js → mcp-BKL6M6OI.js} +24 -24
- package/dist/cli/{mcp-NAW3GFNN.mjs → mcp-E6PTSNDE.mjs} +4 -4
- package/dist/cli/{monitors-A7NYAXSJ.mjs → monitors-MXJ27KQK.mjs} +7 -7
- package/dist/cli/{monitors-OOQVE7XR.js → monitors-SW7ZCPPT.js} +100 -100
- package/dist/cli/{org-7YCDUSZE.mjs → org-HYAJ2MIK.mjs} +6 -6
- package/dist/cli/{org-D2AMIVBS.js → org-XJ44KZ5I.js} +121 -121
- package/dist/cli/{outcomes-2FKZDJSQ.js → outcomes-PTXGG4BZ.js} +14 -14
- package/dist/cli/{outcomes-TNTKCUEO.mjs → outcomes-PUMAXRGD.mjs} +6 -6
- package/dist/cli/{play-NWKHCHVZ.js → play-EPDZ3GDV.js} +336 -336
- package/dist/cli/{play-L6CVHSN4.mjs → play-QN3X6IAE.mjs} +19 -19
- package/dist/cli/{providers-PZGOI5CN.js → providers-GNJFGNDH.js} +9 -9
- package/dist/cli/{providers-22LO747B.mjs → providers-JIN5UQ7Z.mjs} +6 -6
- package/dist/cli/{quickstart-3ZRVKGMH.mjs → quickstart-4EBFHGB7.mjs} +4 -4
- package/dist/cli/{quickstart-LLWOC2GR.js → quickstart-YH6NNC5I.js} +6 -6
- package/dist/cli/{run-SNF23STR.js → run-4DRF7KQJ.js} +44 -44
- package/dist/cli/{run-D46W2GUA.mjs → run-5467KBCP.mjs} +23 -23
- package/dist/cli/search-B2KCWPUV.js +32 -0
- package/dist/cli/{search-XWVCICIX.mjs → search-ZERTOGH6.mjs} +7 -7
- package/dist/cli/{search-output-YM5QXFQQ.mjs → search-output-OAVJXRFO.mjs} +4 -4
- package/dist/cli/{search-output-36GHD67U.js → search-output-OMNZN2LP.js} +6 -6
- package/dist/cli/{secrets-UXCIHG5I.js → secrets-7XK2BGYX.js} +15 -15
- package/dist/cli/{secrets-7PTZEFRC.mjs → secrets-KAVDYB4P.mjs} +6 -6
- package/dist/cli/sessions-PUQURPPC.js +23 -0
- package/dist/cli/{sessions-DTXJKRP4.mjs → sessions-TNPI6XWB.mjs} +6 -6
- package/dist/cli/{settings-74B6UOS4.mjs → settings-KUABXRAJ.mjs} +12 -12
- package/dist/cli/{settings-EYSDZE37.js → settings-RQ3Z3JCM.js} +85 -85
- package/dist/cli/{setup-2QRZ36CH.mjs → setup-6IX6BSS7.mjs} +9 -9
- package/dist/cli/{setup-E7PVXBPL.js → setup-TDOWNKYN.js} +49 -49
- package/dist/cli/skills-AACRY2TV.js +37 -0
- package/dist/cli/{skills-2WZ7N3UW.mjs → skills-Z6NBJ4KP.mjs} +7 -7
- package/dist/cli/{tools-YK5SCUZD.mjs → tools-LQKFWK7J.mjs} +17 -17
- package/dist/cli/tools-OTYA4722.js +57 -0
- package/dist/cli/update-JTGMI6OJ.js +37 -0
- package/dist/cli/{update-563YQK53.mjs → update-RUB4EIKW.mjs} +9 -9
- package/dist/cli/{views-ISNCRZUP.mjs → views-D7WY5QPR.mjs} +6 -6
- package/dist/cli/{views-OLPS6TPG.js → views-FFLXLAGC.js} +21 -21
- package/dist/cli/{workflow-B3ZKU3OR.mjs → workflow-BV2OTEQD.mjs} +7 -7
- package/dist/cli/{workflow-CUSCTYMW.js → workflow-QW7QVODA.js} +17 -17
- package/dist/index.js +9 -9
- package/dist/index.mjs +6 -6
- package/dist/install-integrity.json +116 -116
- package/dist/release.d.mts +9 -1
- package/dist/release.d.ts +9 -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-DXUHEL5I.js +0 -44
- package/dist/cli/concurrent-runs-help-JLWY54WL.js +0 -22
- package/dist/cli/describe-33PBWO5O.js +0 -50
- package/dist/cli/git-2OPYEPYW.js +0 -26
- package/dist/cli/search-H57MZPLF.js +0 -32
- package/dist/cli/sessions-JJZMQSH4.js +0 -23
- package/dist/cli/skills-RIF2DCZI.js +0 -37
- package/dist/cli/tools-7VRQ4GSI.js +0 -57
- package/dist/cli/update-CMZAIAES.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.576',
|
|
209
209
|
updateSummary: {
|
|
210
210
|
introducedIn: '0.3.90',
|
|
211
211
|
summary:
|
|
@@ -262,6 +262,18 @@ export const SDK_RELEASE = {
|
|
|
262
262
|
reason:
|
|
263
263
|
'deepline search was added in SDK CLI 0.3.287 as the one search across tools, monitors, plays, and docs. On an older version run deepline tools search or deepline plays search, or update.',
|
|
264
264
|
},
|
|
265
|
+
{
|
|
266
|
+
command: 'integrations',
|
|
267
|
+
introducedIn: '0.3.543',
|
|
268
|
+
reason:
|
|
269
|
+
'deepline integrations was added in SDK CLI 0.3.543 to connect providers and manage named org authorizations. Older versions cannot print a provider setup link, so update before connecting a provider from the CLI.',
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
command: 'outcomes',
|
|
273
|
+
introducedIn: '0.3.553',
|
|
274
|
+
reason:
|
|
275
|
+
'deepline outcomes was added in SDK CLI 0.3.553. Older versions cannot read or write an outcome, so update before setting one up or checking in on it.',
|
|
276
|
+
},
|
|
265
277
|
{
|
|
266
278
|
command: 'notifications',
|
|
267
279
|
introducedIn: '0.2.40',
|
|
@@ -442,6 +442,7 @@ import {
|
|
|
442
442
|
assertCustomerOutputObjectWithinLimit,
|
|
443
443
|
RUNTIME_RECEIPT_COMPLETION_BUFFER_MAX_ITEMS,
|
|
444
444
|
assertRuntimeReceiptOutputWithinLimit,
|
|
445
|
+
OutputTooLargeError,
|
|
445
446
|
RUNTIME_RECEIPT_COMPLETION_BUFFER_MAX_BYTES,
|
|
446
447
|
RUNTIME_RECEIPT_COMPLETION_DEBOUNCE_MS,
|
|
447
448
|
RUNTIME_RECEIPT_COMPLETION_MAX_IN_FLIGHT_BATCHES,
|
|
@@ -3567,6 +3568,8 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
3567
3568
|
private readonly stepCallIndexByKey = new Map<string, number>();
|
|
3568
3569
|
private readonly toolCallIndexByKey = new Map<string, number>();
|
|
3569
3570
|
private readonly freshnessCallIndexByKey = new Map<string, number>();
|
|
3571
|
+
/** Occurrence of each identical forced legacy fetch in this run. */
|
|
3572
|
+
private readonly legacyFetchRecoveryIndexByKey = new Map<string, number>();
|
|
3570
3573
|
/**
|
|
3571
3574
|
* Call-order artifacts only: the exact-request operation slot of each
|
|
3572
3575
|
* call-order invocation id, consumed when the call reaches the freshness
|
|
@@ -8294,6 +8297,25 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
8294
8297
|
? 'ctx.fetch.staleAfterSeconds'
|
|
8295
8298
|
: 'ctx.tools.execute.staleAfterSeconds',
|
|
8296
8299
|
);
|
|
8300
|
+
if (
|
|
8301
|
+
operation === 'fetch' &&
|
|
8302
|
+
stalePolicy.forceRefresh &&
|
|
8303
|
+
opts.force !== true &&
|
|
8304
|
+
!opts.receiptKey?.trim() &&
|
|
8305
|
+
DURABLE_RUNS_ROLLOUT.legacyFetchOwnRunRecovery
|
|
8306
|
+
) {
|
|
8307
|
+
try {
|
|
8308
|
+
return await this.executeLegacyForcedFetchWithOwnRunRecovery<T>({
|
|
8309
|
+
id,
|
|
8310
|
+
semanticKey: opts.semanticKey ?? null,
|
|
8311
|
+
onRecovered: opts.onRecovered,
|
|
8312
|
+
execute: () => execute(null),
|
|
8313
|
+
});
|
|
8314
|
+
} finally {
|
|
8315
|
+
const release = releaseExternalCallSlot as (() => void) | null;
|
|
8316
|
+
release?.();
|
|
8317
|
+
}
|
|
8318
|
+
}
|
|
8297
8319
|
const receiptKey =
|
|
8298
8320
|
opts.receiptKey?.trim() ||
|
|
8299
8321
|
durableCtxKey({
|
|
@@ -8347,6 +8369,129 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
8347
8369
|
}
|
|
8348
8370
|
}
|
|
8349
8371
|
|
|
8372
|
+
/**
|
|
8373
|
+
* A forced `ctx.fetch` on an artifact before edition 11 (see
|
|
8374
|
+
* `DURABLE_RUNS_ROLLOUT.legacyFetchOwnRunRecovery`). Same run, same exact
|
|
8375
|
+
* request, successful response only; anything else sends as before.
|
|
8376
|
+
*/
|
|
8377
|
+
private async executeLegacyForcedFetchWithOwnRunRecovery<T>(input: {
|
|
8378
|
+
id: string;
|
|
8379
|
+
semanticKey: string | null;
|
|
8380
|
+
onRecovered?: (
|
|
8381
|
+
output: T,
|
|
8382
|
+
receipt: RuntimeStepReceipt,
|
|
8383
|
+
source: DurableReceiptRecoverySource,
|
|
8384
|
+
) => T;
|
|
8385
|
+
execute: () => Promise<T>;
|
|
8386
|
+
}): Promise<T> {
|
|
8387
|
+
const orgId = this.#options.orgId?.trim();
|
|
8388
|
+
const store = this.durableReceiptExecutionStore();
|
|
8389
|
+
if (!orgId || !store.enabled) return await input.execute();
|
|
8390
|
+
// The semantic key already holds the method, URL, body, safe headers
|
|
8391
|
+
// (an Idempotency-Key included) and row scope, so identical requests
|
|
8392
|
+
// share a scope and only identical requests share an occurrence count.
|
|
8393
|
+
// The authored step is part of the scope, as in edition 11, so a call
|
|
8394
|
+
// inside a recovered step never shifts the count of one after it.
|
|
8395
|
+
const step = authoredStepContext.getStore();
|
|
8396
|
+
const scope = sha256Hex(
|
|
8397
|
+
stableStringify({
|
|
8398
|
+
namespace: this.currentExecutionScope.receipt.namespace,
|
|
8399
|
+
id: input.id,
|
|
8400
|
+
step:
|
|
8401
|
+
step?.context === this ? (step.invocationId ?? step.stepId) : null,
|
|
8402
|
+
semanticKey: input.semanticKey,
|
|
8403
|
+
}),
|
|
8404
|
+
);
|
|
8405
|
+
const freshIndex = this.legacyFetchRecoveryIndexByKey.get(scope) ?? 0;
|
|
8406
|
+
this.legacyFetchRecoveryIndexByKey.set(scope, freshIndex + 1);
|
|
8407
|
+
const occurrence = nextReplayableCallIndex(
|
|
8408
|
+
`legacy-fetch-recovery:${scope}`,
|
|
8409
|
+
freshIndex,
|
|
8410
|
+
);
|
|
8411
|
+
const receiptKey = `ctx:${orgId}:fetch-run-recovery:v1:${sha256Hex(
|
|
8412
|
+
stableStringify({
|
|
8413
|
+
runId: this.currentReceiptOwnerRunId,
|
|
8414
|
+
scope,
|
|
8415
|
+
occurrence,
|
|
8416
|
+
}),
|
|
8417
|
+
)}`;
|
|
8418
|
+
// The lookup is best-effort: before this switch a forced legacy fetch
|
|
8419
|
+
// never read the store, so a failed read sends as it always did.
|
|
8420
|
+
let recorded: RuntimeStepReceipt | null = null;
|
|
8421
|
+
try {
|
|
8422
|
+
recorded = await this.withRuntimeReceiptHydrationTurn(
|
|
8423
|
+
async (turn) => {
|
|
8424
|
+
const receipt = await store.get(receiptKey);
|
|
8425
|
+
turn.settleBytes(runtimeStepReceiptPayloadBytes([receipt]));
|
|
8426
|
+
return receipt;
|
|
8427
|
+
},
|
|
8428
|
+
{ source: 'durable_operation' },
|
|
8429
|
+
);
|
|
8430
|
+
} catch (error) {
|
|
8431
|
+
if (isAbortLikeError(error)) throw error;
|
|
8432
|
+
this.runtimeLog(
|
|
8433
|
+
JSON.stringify({
|
|
8434
|
+
event: 'legacy_fetch_own_run_lookup_skipped',
|
|
8435
|
+
call_key: input.id,
|
|
8436
|
+
}),
|
|
8437
|
+
{ level: 'warn' },
|
|
8438
|
+
);
|
|
8439
|
+
}
|
|
8440
|
+
if (
|
|
8441
|
+
recorded &&
|
|
8442
|
+
recorded.status === 'completed' &&
|
|
8443
|
+
recorded.output !== undefined
|
|
8444
|
+
) {
|
|
8445
|
+
this.runtimeLog(
|
|
8446
|
+
JSON.stringify({
|
|
8447
|
+
event: 'legacy_fetch_own_run_recovered',
|
|
8448
|
+
call_key: input.id,
|
|
8449
|
+
occurrence,
|
|
8450
|
+
}),
|
|
8451
|
+
);
|
|
8452
|
+
const output = recorded.output as T;
|
|
8453
|
+
const recovered = input.onRecovered
|
|
8454
|
+
? input.onRecovered(output, recorded, 'cache')
|
|
8455
|
+
: output;
|
|
8456
|
+
this.assertNoPendingDurableSuspension();
|
|
8457
|
+
return recovered;
|
|
8458
|
+
}
|
|
8459
|
+
const output = await input.execute();
|
|
8460
|
+
this.assertNoPendingDurableSuspension();
|
|
8461
|
+
assertNoSecretTaint(output, 'ctx.fetch result');
|
|
8462
|
+
if (
|
|
8463
|
+
output &&
|
|
8464
|
+
typeof output === 'object' &&
|
|
8465
|
+
(output as { ok?: unknown }).ok === true
|
|
8466
|
+
) {
|
|
8467
|
+
try {
|
|
8468
|
+
await store.complete(
|
|
8469
|
+
receiptKey,
|
|
8470
|
+
this.currentReceiptOwnerRunId,
|
|
8471
|
+
output,
|
|
8472
|
+
COMPLETED_RECEIPT_CACHE_INSERT_LEASE_ID,
|
|
8473
|
+
);
|
|
8474
|
+
} catch (error) {
|
|
8475
|
+
if (isAbortLikeError(error)) throw error;
|
|
8476
|
+
// The request already succeeded; a lost record only means a replay
|
|
8477
|
+
// sends it again, which is today's behavior. Never fail the call.
|
|
8478
|
+
this.runtimeLog(
|
|
8479
|
+
JSON.stringify({
|
|
8480
|
+
event: 'legacy_fetch_own_run_record_skipped',
|
|
8481
|
+
call_key: input.id,
|
|
8482
|
+
reason:
|
|
8483
|
+
error instanceof RuntimeReceiptWriterBufferLimitError ||
|
|
8484
|
+
error instanceof OutputTooLargeError
|
|
8485
|
+
? 'too_large'
|
|
8486
|
+
: 'error',
|
|
8487
|
+
}),
|
|
8488
|
+
{ level: 'warn' },
|
|
8489
|
+
);
|
|
8490
|
+
}
|
|
8491
|
+
}
|
|
8492
|
+
return output;
|
|
8493
|
+
}
|
|
8494
|
+
|
|
8350
8495
|
private get currentRunId(): string {
|
|
8351
8496
|
return this.currentExecutionScope.logical.runId;
|
|
8352
8497
|
}
|
|
@@ -45,6 +45,23 @@ export const DURABLE_RUNS_ROLLOUT = {
|
|
|
45
45
|
* `staleAfterSeconds`.
|
|
46
46
|
*/
|
|
47
47
|
sharedReadCacheWrites: true,
|
|
48
|
+
/**
|
|
49
|
+
* Own-run recovery for a forced `ctx.fetch` on artifacts before edition 11,
|
|
50
|
+
* where `staleAfterSeconds: 0` means force and kept no record, so a resumed
|
|
51
|
+
* run sent a finished request again. A successful (2xx) response is
|
|
52
|
+
* recorded under a key of the executing run, the authored call and its
|
|
53
|
+
* exact request, numbered among identical requests; a replay of that same
|
|
54
|
+
* request in that same run returns it instead of sending. A new run, a
|
|
55
|
+
* different request, a non-2xx response, a thrown failure and
|
|
56
|
+
* `{ transient: true }` behave exactly as before. As in edition 11, a 2xx
|
|
57
|
+
* whose body made the Play throw is returned again to a later attempt of
|
|
58
|
+
* the same run rather than read fresh. A failed lookup or record write
|
|
59
|
+
* sends and returns as before.
|
|
60
|
+
*
|
|
61
|
+
* Off restores the old behavior: nothing reads the records, which age out
|
|
62
|
+
* with the run's other receipts.
|
|
63
|
+
*/
|
|
64
|
+
legacyFetchOwnRunRecovery: true,
|
|
48
65
|
/**
|
|
49
66
|
* Finish-in-execute: a direct tool call sends its planned finishing receipt
|
|
50
67
|
* keys on the execute request, and the execution relay commits them before
|
|
@@ -220,6 +220,14 @@ export const EXPERIMENT_SWITCHES = {
|
|
|
220
220
|
"With E2 and no sidecar, the early sandbox carries a narrowed allowlist (each gateway IPv4 as /32, contained in the deployment's and stable 30 min); only a launch whose own fresh derivation gives the same list adopts it, and every fallback create keeps the deployment's allowlist (worker).",
|
|
221
221
|
constants: [{ file: MODAL, name: 'NARROW_EARLY_SANDBOX_EGRESS' }],
|
|
222
222
|
},
|
|
223
|
+
EW: {
|
|
224
|
+
perRun: true,
|
|
225
|
+
summary:
|
|
226
|
+
"With EN, once a launch wins the fence for an adopted narrowed early sandbox and before anything is delivered, widen its outbound policy to exactly the launch's own create allowlist, so ctx.fetch connects directly; a failed or slow widen defers the run to a fresh attempt (worker).",
|
|
227
|
+
constants: [
|
|
228
|
+
{ file: MODAL, name: 'WIDEN_EARLY_SANDBOX_EGRESS_ON_ADOPTION' },
|
|
229
|
+
],
|
|
230
|
+
},
|
|
223
231
|
V3: {
|
|
224
232
|
perRun: true,
|
|
225
233
|
summary:
|
|
@@ -2187,6 +2187,125 @@ export function earlyModalEgressNarrowWanted(
|
|
|
2187
2187
|
);
|
|
2188
2188
|
}
|
|
2189
2189
|
|
|
2190
|
+
/**
|
|
2191
|
+
* EW (per-run): after a launch wins the fence for an adopted EN sandbox, and
|
|
2192
|
+
* before any payload, envelope or customer code reaches it, widen the
|
|
2193
|
+
* sandbox's outbound policy to exactly the allowlist this launch's own fresh
|
|
2194
|
+
* create would carry (`modalSandboxCreateParams`). The run then has the same
|
|
2195
|
+
* egress as a non-early run, so ctx.fetch connects directly (no broker caps,
|
|
2196
|
+
* no extra hop). Until the fence is won the sandbox stays narrowed, so the
|
|
2197
|
+
* pre-admission abuse bound is unchanged. A failed or slow widen defers the
|
|
2198
|
+
* run to a fresh attempt; nothing is delivered first.
|
|
2199
|
+
*/
|
|
2200
|
+
export const WIDEN_EARLY_SANDBOX_EGRESS_ON_ADOPTION = false;
|
|
2201
|
+
|
|
2202
|
+
/** Whether this run widens an adopted EN sandbox's egress (EW). */
|
|
2203
|
+
export function earlyModalEgressWidenWanted(
|
|
2204
|
+
overrides: EarlySandboxStartRequest['experimentSwitchOverrides'],
|
|
2205
|
+
): boolean {
|
|
2206
|
+
return resolveExperimentSwitch(
|
|
2207
|
+
'EW',
|
|
2208
|
+
overrides,
|
|
2209
|
+
WIDEN_EARLY_SANDBOX_EGRESS_ON_ADOPTION,
|
|
2210
|
+
);
|
|
2211
|
+
}
|
|
2212
|
+
|
|
2213
|
+
/** Upper bound on the EW policy update on the launch's critical path. */
|
|
2214
|
+
export const EARLY_EGRESS_WIDEN_TIMEOUT_MS = 5_000;
|
|
2215
|
+
|
|
2216
|
+
/**
|
|
2217
|
+
* EW: replace an adopted EN sandbox's outbound policy with the launch's own
|
|
2218
|
+
* create allowlist. Returns null (nothing changed) when that allowlist is not
|
|
2219
|
+
* a non-empty CIDR list: Modal's update is always an allowlist, so it cannot
|
|
2220
|
+
* express OPEN egress, and an empty list would block everything; such a run
|
|
2221
|
+
* keeps its narrowed egress. The domain dimension is [] because a create with
|
|
2222
|
+
* only a CIDR list sends exactly that (an empty domain allowlist), so the
|
|
2223
|
+
* widened policy equals a fresh create's. Any failure or timeout throws the
|
|
2224
|
+
* not-live recovery, so the scheduler retries on a fresh attempt and this
|
|
2225
|
+
* launch's cleanup terminates the sandbox it won.
|
|
2226
|
+
*/
|
|
2227
|
+
export async function widenAdoptedEarlyModalEgress(input: {
|
|
2228
|
+
sandbox: Pick<ModalSandbox, 'sandboxId' | 'updateNetworkPolicy'>;
|
|
2229
|
+
createParams: Pick<ModalSandboxCreateParams, 'outboundCidrAllowlist'>;
|
|
2230
|
+
/** The launch's cancellation: a cancel ends the wait and stays a cancel. */
|
|
2231
|
+
cancellation?: Promise<never>;
|
|
2232
|
+
isCancelled?: () => boolean;
|
|
2233
|
+
timeoutMs?: number;
|
|
2234
|
+
nowMs?: () => number;
|
|
2235
|
+
}): Promise<{ elapsedMs: number; entries: number } | null> {
|
|
2236
|
+
const allowlist = input.createParams.outboundCidrAllowlist;
|
|
2237
|
+
if (!Array.isArray(allowlist) || allowlist.length === 0) return null;
|
|
2238
|
+
const nowMs = input.nowMs ?? Date.now;
|
|
2239
|
+
const startedAt = nowMs();
|
|
2240
|
+
const timeoutMs = input.timeoutMs ?? EARLY_EGRESS_WIDEN_TIMEOUT_MS;
|
|
2241
|
+
let timer: ReturnType<typeof setTimeout> | undefined;
|
|
2242
|
+
try {
|
|
2243
|
+
await Promise.race([
|
|
2244
|
+
// The signal cancels the RPC itself (Modal's call middleware), so a
|
|
2245
|
+
// timed-out update does not keep running after the run moved on.
|
|
2246
|
+
withModalCallSignal(AbortSignal.timeout(timeoutMs), () =>
|
|
2247
|
+
input.sandbox.updateNetworkPolicy({
|
|
2248
|
+
outboundCidrAllowlist: [...allowlist],
|
|
2249
|
+
outboundDomainAllowlist: [],
|
|
2250
|
+
}),
|
|
2251
|
+
),
|
|
2252
|
+
...(input.cancellation ? [input.cancellation] : []),
|
|
2253
|
+
new Promise<never>((_, reject) => {
|
|
2254
|
+
timer = setTimeout(
|
|
2255
|
+
() =>
|
|
2256
|
+
reject(
|
|
2257
|
+
new Error(
|
|
2258
|
+
`Early sandbox ${input.sandbox.sandboxId} egress widen did not finish within ${timeoutMs} ms.`,
|
|
2259
|
+
),
|
|
2260
|
+
),
|
|
2261
|
+
timeoutMs,
|
|
2262
|
+
);
|
|
2263
|
+
}),
|
|
2264
|
+
]);
|
|
2265
|
+
} catch (error) {
|
|
2266
|
+
// A cancelled run stays cancelled; only a failed or slow update defers.
|
|
2267
|
+
if (input.isCancelled?.()) throw error;
|
|
2268
|
+
throw recoveryForRunnerStartupNotLive(error);
|
|
2269
|
+
} finally {
|
|
2270
|
+
if (timer) clearTimeout(timer);
|
|
2271
|
+
}
|
|
2272
|
+
return { elapsedMs: nowMs() - startedAt, entries: allowlist.length };
|
|
2273
|
+
}
|
|
2274
|
+
|
|
2275
|
+
/**
|
|
2276
|
+
* The post-fence step of a launch that may have adopted an early sandbox, in
|
|
2277
|
+
* its required order: re-tag (leave the early tags and the reaper), then EW's
|
|
2278
|
+
* widen, before the caller stages anything. Called only after this launch's
|
|
2279
|
+
* resource record won the fence. Returns whether the sandbox is still
|
|
2280
|
+
* narrowed (so ctx.fetch must use the broker).
|
|
2281
|
+
*/
|
|
2282
|
+
export async function finishEarlyModalAdoptionAfterFence(input: {
|
|
2283
|
+
sandbox: Pick<ModalSandbox, 'sandboxId' | 'setTags' | 'updateNetworkPolicy'>;
|
|
2284
|
+
adoptedNarrowedEgress: boolean;
|
|
2285
|
+
widenWanted: boolean;
|
|
2286
|
+
createEgress: Pick<ModalSandboxCreateParams, 'outboundCidrAllowlist'>;
|
|
2287
|
+
cancellation?: Promise<never>;
|
|
2288
|
+
isCancelled?: () => boolean;
|
|
2289
|
+
emit: (stage: string, extra: Record<string, unknown>) => void;
|
|
2290
|
+
}): Promise<{ adoptedNarrowedEgress: boolean }> {
|
|
2291
|
+
await applyEarlyModalRetagAfterFence(input.sandbox);
|
|
2292
|
+
if (!input.adoptedNarrowedEgress || !input.widenWanted)
|
|
2293
|
+
return { adoptedNarrowedEgress: input.adoptedNarrowedEgress };
|
|
2294
|
+
const widened = await widenAdoptedEarlyModalEgress({
|
|
2295
|
+
sandbox: input.sandbox,
|
|
2296
|
+
createParams: input.createEgress,
|
|
2297
|
+
...(input.cancellation ? { cancellation: input.cancellation } : {}),
|
|
2298
|
+
...(input.isCancelled ? { isCancelled: input.isCancelled } : {}),
|
|
2299
|
+
});
|
|
2300
|
+
if (!widened) return { adoptedNarrowedEgress: true };
|
|
2301
|
+
input.emit('early:egress_widened', {
|
|
2302
|
+
sandboxId: input.sandbox.sandboxId,
|
|
2303
|
+
entries: widened.entries,
|
|
2304
|
+
elapsedMs: widened.elapsedMs,
|
|
2305
|
+
});
|
|
2306
|
+
return { adoptedNarrowedEgress: false };
|
|
2307
|
+
}
|
|
2308
|
+
|
|
2190
2309
|
/**
|
|
2191
2310
|
* The allowlist an early create carries: EN's narrowed list when it can be
|
|
2192
2311
|
* derived now, otherwise the deployment's (exactly today's). The gate, the
|
|
@@ -2945,10 +3064,15 @@ export const modalPlayRunnerBackend: PlayRunnerBackend = {
|
|
|
2945
3064
|
PREBOOT_RUNNER_IN_EARLY_SANDBOX,
|
|
2946
3065
|
);
|
|
2947
3066
|
let sandbox: ModalSandbox;
|
|
2948
|
-
// An adopted EN sandbox reaches only the
|
|
2949
|
-
//
|
|
2950
|
-
// fetch to any other host cannot connect.
|
|
3067
|
+
// An adopted EN sandbox reaches only the gateways until EW widens it;
|
|
3068
|
+
// while narrowed, the runner sends ctx.fetch through the gateway's
|
|
3069
|
+
// egress broker (a direct fetch to any other host cannot connect).
|
|
2951
3070
|
let adoptedNarrowedEgress = false;
|
|
3071
|
+
// This launch's own create egress: what EW widens an adopted sandbox to.
|
|
3072
|
+
let launchCreateEgress: Pick<
|
|
3073
|
+
ModalSandboxCreateParams,
|
|
3074
|
+
'outboundCidrAllowlist'
|
|
3075
|
+
> = {};
|
|
2952
3076
|
let createSent = false;
|
|
2953
3077
|
try {
|
|
2954
3078
|
// This is deliberately adjacent to the real provider boundary. The
|
|
@@ -3000,6 +3124,9 @@ export const modalPlayRunnerBackend: PlayRunnerBackend = {
|
|
|
3000
3124
|
outboundCidrAllowlist: modalConfig.outboundCidrAllowlist,
|
|
3001
3125
|
supervisorSidecar: supervisorPlan !== null,
|
|
3002
3126
|
});
|
|
3127
|
+
launchCreateEgress = {
|
|
3128
|
+
outboundCidrAllowlist: sandboxParams.outboundCidrAllowlist,
|
|
3129
|
+
};
|
|
3003
3130
|
const createParams = { ...sandboxParams, tags: createTags };
|
|
3004
3131
|
const createSandbox = () =>
|
|
3005
3132
|
modalConfig.client.sandboxes.create(app, image, createParams);
|
|
@@ -3128,11 +3255,6 @@ export const modalPlayRunnerBackend: PlayRunnerBackend = {
|
|
|
3128
3255
|
sandboxId: sandbox.sandboxId,
|
|
3129
3256
|
elapsedMs: Date.now() - startedAt,
|
|
3130
3257
|
});
|
|
3131
|
-
if (adoptedNarrowedEgress) {
|
|
3132
|
-
emitModalStage(config.context, 'early:egress_broker', {
|
|
3133
|
-
sandboxId: sandbox.sandboxId,
|
|
3134
|
-
});
|
|
3135
|
-
}
|
|
3136
3258
|
logSandboxCreateOutcome({
|
|
3137
3259
|
provider: 'modal',
|
|
3138
3260
|
outcome: 'succeeded',
|
|
@@ -3348,8 +3470,29 @@ export const modalPlayRunnerBackend: PlayRunnerBackend = {
|
|
|
3348
3470
|
throw error;
|
|
3349
3471
|
}
|
|
3350
3472
|
// This launch's record won the durable sandbox fence; only now does
|
|
3351
|
-
// an adopted early sandbox leave the early tags (and its reaper)
|
|
3352
|
-
|
|
3473
|
+
// an adopted early sandbox leave the early tags (and its reaper), and
|
|
3474
|
+
// only then (EW) may it get this launch's own create egress.
|
|
3475
|
+
const afterFence = await finishEarlyModalAdoptionAfterFence({
|
|
3476
|
+
sandbox,
|
|
3477
|
+
adoptedNarrowedEgress,
|
|
3478
|
+
widenWanted: earlyModalEgressWidenWanted(
|
|
3479
|
+
config.context.experimentSwitchOverrides,
|
|
3480
|
+
),
|
|
3481
|
+
createEgress: launchCreateEgress,
|
|
3482
|
+
cancellation: cancellationPromise,
|
|
3483
|
+
isCancelled: () => callbacks?.cancellationSignal?.aborted === true,
|
|
3484
|
+
emit: (stage, extra) =>
|
|
3485
|
+
emitModalStage(config.context, stage, extra),
|
|
3486
|
+
});
|
|
3487
|
+
adoptedNarrowedEgress = afterFence.adoptedNarrowedEgress;
|
|
3488
|
+
// Still narrowed after the post-fence step (EW off, or nothing to
|
|
3489
|
+
// widen to): the runner's ctx.fetch goes through the egress broker.
|
|
3490
|
+
// A widened run logs only early:egress_widened.
|
|
3491
|
+
if (adoptedNarrowedEgress) {
|
|
3492
|
+
emitModalStage(config.context, 'early:egress_broker', {
|
|
3493
|
+
sandboxId: sandbox.sandboxId,
|
|
3494
|
+
});
|
|
3495
|
+
}
|
|
3353
3496
|
emitModalStage(config.context, 'resource:recorded', {
|
|
3354
3497
|
sandboxId: sandbox.sandboxId,
|
|
3355
3498
|
elapsedMs: Date.now() - startedAt,
|
|
@@ -282,13 +282,48 @@ export const RUNTIME_SPEED_PROFILES = {
|
|
|
282
282
|
PWV: false,
|
|
283
283
|
},
|
|
284
284
|
},
|
|
285
|
+
'fast_launch@9': {
|
|
286
|
+
summary:
|
|
287
|
+
"fast_launch@8 plus EW: once a launch has won the fence for an adopted EN-narrowed early sandbox, and before any envelope or customer code is delivered, the sandbox's outbound allowlist is widened to exactly the allowlist a fresh create for that launch would get. ctx.fetch then behaves as on a non-early run (no egress broker caps, rate limits or source-IP change); if widening fails the run defers to a fresh attempt. Registered before any grant.",
|
|
288
|
+
switches: {
|
|
289
|
+
B: true,
|
|
290
|
+
H1: true,
|
|
291
|
+
P1: true,
|
|
292
|
+
P2: true,
|
|
293
|
+
V3: true,
|
|
294
|
+
C3: true,
|
|
295
|
+
C4: true,
|
|
296
|
+
C5: true,
|
|
297
|
+
PI: true,
|
|
298
|
+
E2: true,
|
|
299
|
+
PB: true,
|
|
300
|
+
LH: true,
|
|
301
|
+
EN: true,
|
|
302
|
+
CA: true,
|
|
303
|
+
PX: true,
|
|
304
|
+
EW: true,
|
|
305
|
+
A1: false,
|
|
306
|
+
N1: false,
|
|
307
|
+
F3: false,
|
|
308
|
+
S1: false,
|
|
309
|
+
PWM: false,
|
|
310
|
+
PWT: false,
|
|
311
|
+
PWV: false,
|
|
312
|
+
},
|
|
313
|
+
},
|
|
285
314
|
} as const satisfies Record<string, RuntimeSpeedProfileDefinition>;
|
|
286
315
|
|
|
287
316
|
export type RuntimeSpeedProfileId = keyof typeof RUNTIME_SPEED_PROFILES;
|
|
288
317
|
|
|
289
|
-
/**
|
|
318
|
+
/**
|
|
319
|
+
* The profile the `runtime-fast-launch` rollout grants. fast_launch@9 became
|
|
320
|
+
* the default once its registration served everywhere; the rollout percentage
|
|
321
|
+
* still decides which organizations get it (0% plus the internal workspace's
|
|
322
|
+
* override when this shipped). Rollback: this constant back to 'fast_launch@6',
|
|
323
|
+
* or the rollout back to 0%.
|
|
324
|
+
*/
|
|
290
325
|
export const RUNTIME_FAST_LAUNCH_PROFILE: RuntimeSpeedProfileId =
|
|
291
|
-
'fast_launch@
|
|
326
|
+
'fast_launch@9';
|
|
292
327
|
|
|
293
328
|
/**
|
|
294
329
|
* Per-organization exceptions to `RUNTIME_FAST_LAUNCH_PROFILE`, for
|
|
@@ -302,9 +337,10 @@ export const RUNTIME_FAST_LAUNCH_ORGANIZATION_PROFILES: Readonly<
|
|
|
302
337
|
Record<string, RuntimeSpeedProfileId>
|
|
303
338
|
> = {
|
|
304
339
|
// Internal Deepline workspace: the one org granted early start (EN, then
|
|
305
|
-
// PX + CA) for its Production measurement. Rollback is this entry
|
|
306
|
-
// 'fast_launch@
|
|
307
|
-
|
|
340
|
+
// PX + CA, then EW) for its Production measurement. Rollback is this entry
|
|
341
|
+
// back to 'fast_launch@8' (its previous Production pin: broker ctx.fetch),
|
|
342
|
+
// or 'fast_launch@4', or removal.
|
|
343
|
+
jh772jvn83r6be5kpcjn6rcqj182tgre: 'fast_launch@9',
|
|
308
344
|
};
|
|
309
345
|
|
|
310
346
|
/** The profile the rollout grants to this organization. */
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getAuthedHttpClient,
|
|
3
3
|
printCommandEnvelope
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-JPFAD6G6.mjs";
|
|
5
5
|
import {
|
|
6
6
|
cliFeatureEnabled
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-ZRC52APB.mjs";
|
|
8
|
+
import "./chunk-XJNJ3BWU.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-CUIFDMNP.mjs";
|
|
16
16
|
import "./chunk-WZYKRD7T.mjs";
|
|
17
17
|
import "./chunk-KRD6H754.mjs";
|
|
18
18
|
|
|
@@ -31,6 +31,17 @@ var MODEL_PROVIDER_NAMES = {
|
|
|
31
31
|
openai: "OpenAI",
|
|
32
32
|
anthropic: "Anthropic"
|
|
33
33
|
};
|
|
34
|
+
var WAKE_STATUS_WORDS = {
|
|
35
|
+
woken: "started a turn",
|
|
36
|
+
nothing_waiting: "found nothing waiting",
|
|
37
|
+
throttled: "was held back: the hourly turn limit was reached",
|
|
38
|
+
not_woken: "started nothing: the agent was not available"
|
|
39
|
+
};
|
|
40
|
+
function describeOwnedOutcome(owned) {
|
|
41
|
+
const watch = owned.watch ? `watch ${owned.watch.key} (ring ${owned.watch.ringState}${owned.watch.lastRingError ? `, last error: ${owned.watch.lastRingError}` : ""})` : `no watch${owned.refusal ? `: ${owned.refusal}` : ""}`;
|
|
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
|
+
return `${owned.outcome} \u2014 as ${owned.agent}; ${watch}; ${last}; ${owned.turnsInWindow} of ${owned.turnLimit} turns this hour`;
|
|
44
|
+
}
|
|
34
45
|
var REPLIES_MAX_LIMIT = 100;
|
|
35
46
|
var REPLIES_INVALID_CURSOR = "DEEPLINE_AGENT_REPLIES_INVALID_CURSOR";
|
|
36
47
|
var FEEDBACK_MAX_LIMIT = 100;
|
|
@@ -432,6 +443,26 @@ function registerWorkspaceCommands(agents, readKey) {
|
|
|
432
443
|
options
|
|
433
444
|
);
|
|
434
445
|
});
|
|
446
|
+
agents.command("outcomes").description(
|
|
447
|
+
"List the outcomes Bot by Deepline owns by default (those with no home channel), with what woke it last on each."
|
|
448
|
+
).option("--json", "Emit JSON output").action(async (options) => {
|
|
449
|
+
const { http } = getAuthedHttpClient();
|
|
450
|
+
const result = await http.get(
|
|
451
|
+
`${AGENT_PATH}/outcomes`
|
|
452
|
+
);
|
|
453
|
+
print(
|
|
454
|
+
result,
|
|
455
|
+
"outcomes Bot by Deepline owns",
|
|
456
|
+
result.owners.length === 0 ? [
|
|
457
|
+
"None. Bot by Deepline owns every outcome with no home channel while agents are on (deepline agents enable) and this deployment can be rung."
|
|
458
|
+
] : [
|
|
459
|
+
...result.owners.map(describeOwnedOutcome),
|
|
460
|
+
...result.more ? ["More outcomes than are listed here."] : [],
|
|
461
|
+
"The watch and what waits for it: deepline outcomes watches list <outcome>"
|
|
462
|
+
],
|
|
463
|
+
options
|
|
464
|
+
);
|
|
465
|
+
});
|
|
435
466
|
}
|
|
436
467
|
function registerAgentCommands(agents) {
|
|
437
468
|
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) => {
|