deepline 0.3.575 → 0.3.577

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.
Files changed (145) hide show
  1. package/dist/bundling-sources/sdk/src/release.ts +13 -1
  2. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +145 -0
  3. package/dist/bundling-sources/shared_libs/play-runtime/durable-runs-rollout.ts +17 -0
  4. package/dist/bundling-sources/shared_libs/play-runtime/experiment-switches.ts +8 -0
  5. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +153 -10
  6. package/dist/bundling-sources/shared_libs/play-runtime/runtime-speed-profile.ts +41 -5
  7. package/dist/cli/{agents-ULGDKUTM.mjs → agents-SUJRATC2.mjs} +58 -10
  8. package/dist/cli/{agents-BCLO3KQJ.js → agents-ZIGK3FQ2.js} +84 -36
  9. package/dist/cli/auth-A5U6GVCF.js +44 -0
  10. package/dist/cli/{auth-4WCL7A6W.mjs → auth-TRKPRZK6.mjs} +5 -5
  11. package/dist/cli/{billing-BF5LVXOM.js → billing-6RAF4DQY.js} +102 -102
  12. package/dist/cli/{billing-7JQ6EUQU.mjs → billing-WPQT3QRS.mjs} +9 -9
  13. package/dist/cli/{chunk-636GD4IR.js → chunk-2NFDB6CL.js} +2 -2
  14. package/dist/cli/{chunk-UQZP7XBQ.mjs → chunk-425SUSDJ.mjs} +5 -5
  15. package/dist/cli/{chunk-TTBZ7QXX.mjs → chunk-4ANO4DM5.mjs} +1 -1
  16. package/dist/cli/{chunk-V5XLENWK.js → chunk-772IV64Y.js} +5 -5
  17. package/dist/cli/{chunk-NF722E6C.mjs → chunk-APJ6YIYW.mjs} +1 -1
  18. package/dist/cli/{chunk-XFV353R2.js → chunk-APOWCBO7.js} +23 -23
  19. package/dist/cli/{chunk-IOWLFWWG.mjs → chunk-ATW77ZBL.mjs} +2 -2
  20. package/dist/cli/{chunk-RHRRY2BX.mjs → chunk-CCGFSELM.mjs} +3 -3
  21. package/dist/cli/{chunk-3PVKXUSJ.mjs → chunk-CWHXE6HJ.mjs} +1 -1
  22. package/dist/cli/{chunk-5H6254MJ.js → chunk-CZF2LKIT.js} +16 -16
  23. package/dist/cli/{chunk-GQZFZG6R.mjs → chunk-DA5C5WOI.mjs} +2 -2
  24. package/dist/cli/{chunk-EZIXKNKM.js → chunk-DJP7CJQC.js} +3 -3
  25. package/dist/cli/{chunk-G4WPDCXA.js → chunk-EJN43WGD.js} +48 -48
  26. package/dist/cli/{chunk-ZYSJND73.js → chunk-EKZ6JD6K.js} +9 -9
  27. package/dist/cli/{chunk-737Y7QGT.js → chunk-EV47DV25.js} +41 -41
  28. package/dist/cli/{chunk-IBYMGR5Y.mjs → chunk-FHYNK7GL.mjs} +1 -1
  29. package/dist/cli/{chunk-7DLAJ6JJ.js → chunk-FRYLXDNP.js} +53 -53
  30. package/dist/cli/{chunk-EV3OPDHF.js → chunk-FXN5WSTY.js} +20 -20
  31. package/dist/cli/{chunk-MN7JLH2T.mjs → chunk-GFWVBXAK.mjs} +2 -2
  32. package/dist/cli/{chunk-MWLOBURN.mjs → chunk-H6NF5SNY.mjs} +2 -2
  33. package/dist/cli/{chunk-E4RYSSXX.mjs → chunk-I44Y4MPK.mjs} +1 -1
  34. package/dist/cli/{chunk-BM536WWR.mjs → chunk-ID5WQZ2H.mjs} +11 -1
  35. package/dist/cli/{chunk-ZS6DT4LD.js → chunk-ITK5TGQ7.js} +15 -15
  36. package/dist/cli/{chunk-AO56MZ7D.js → chunk-JHQ7FORY.js} +3 -3
  37. package/dist/cli/{chunk-G2H6SQQY.js → chunk-JWLV3XRF.js} +7 -7
  38. package/dist/cli/{chunk-DMPGJCNZ.js → chunk-KVDIN2YW.js} +29 -1
  39. package/dist/cli/{chunk-5D7OJY4W.mjs → chunk-LUQMTNFB.mjs} +1 -1
  40. package/dist/cli/{chunk-H3CG72RZ.mjs → chunk-LXM36EXW.mjs} +11 -11
  41. package/dist/cli/{chunk-QKP3WYSZ.mjs → chunk-MDP3CNDM.mjs} +2 -2
  42. package/dist/cli/{chunk-H6JMRLAZ.js → chunk-MOWABWHT.js} +100 -100
  43. package/dist/cli/{chunk-ZQXJYO5P.js → chunk-MTHAVEQN.js} +5 -5
  44. package/dist/cli/{chunk-IAJ65IDZ.mjs → chunk-MTM6WNPP.mjs} +4 -4
  45. package/dist/cli/{chunk-CVY4MBXH.mjs → chunk-MVCKEPWF.mjs} +5 -5
  46. package/dist/cli/{chunk-JGLCK2XF.mjs → chunk-N6EU2FRF.mjs} +2 -2
  47. package/dist/cli/{chunk-TMFR2B45.mjs → chunk-NDMKFA6W.mjs} +3 -3
  48. package/dist/cli/{chunk-HO76C7AE.js → chunk-NMSDMXYS.js} +2 -2
  49. package/dist/cli/{chunk-FXXERR52.js → chunk-NRBIYZUG.js} +10 -10
  50. package/dist/cli/{chunk-YNAXKA23.js → chunk-NVJGVNEN.js} +5 -5
  51. package/dist/cli/{chunk-X47J55ZJ.mjs → chunk-O35BHZLQ.mjs} +2 -2
  52. package/dist/cli/{chunk-2UM3I2MY.js → chunk-OBZB4J7B.js} +11 -1
  53. package/dist/cli/{chunk-2T7XOKVL.mjs → chunk-OQQDNJ2D.mjs} +5 -5
  54. package/dist/cli/{chunk-FDCU3VAJ.mjs → chunk-ORLJIJVX.mjs} +29 -1
  55. package/dist/cli/{chunk-BQUAE6LQ.mjs → chunk-Q3WDT3YA.mjs} +1 -1
  56. package/dist/cli/{chunk-GB4IZ5TV.js → chunk-QXAPAHIG.js} +13 -13
  57. package/dist/cli/{chunk-KNCNFL76.js → chunk-RSZSKTRC.js} +4 -4
  58. package/dist/cli/{chunk-HEOM3FAC.js → chunk-RVICQWXU.js} +20 -20
  59. package/dist/cli/{chunk-SYQTBHRX.mjs → chunk-U6Y4HX6J.mjs} +3 -3
  60. package/dist/cli/{chunk-AS5XGOZY.js → chunk-V5SF5CJ7.js} +2 -2
  61. package/dist/cli/{chunk-BONMEBWZ.mjs → chunk-WP4Q5PTK.mjs} +4 -4
  62. package/dist/cli/{chunk-5VSHQG5E.js → chunk-X5ZE7K4J.js} +8 -8
  63. package/dist/cli/{chunk-56N3XAT6.mjs → chunk-X7Y4T7CV.mjs} +5 -5
  64. package/dist/cli/{chunk-QEDRUURT.mjs → chunk-XQTJET2Y.mjs} +1 -1
  65. package/dist/cli/{chunk-6IKLITVH.js → chunk-Y37JQZBP.js} +6 -6
  66. package/dist/cli/{chunk-PQYDO72W.js → chunk-ZHJIDDYR.js} +26 -26
  67. package/dist/cli/command-docs.js +2 -2
  68. package/dist/cli/command-docs.mjs +1 -1
  69. package/dist/cli/{concurrent-runs-help-HITK6EOO.mjs → concurrent-runs-help-6CGXMTFQ.mjs} +6 -6
  70. package/dist/cli/concurrent-runs-help-VJDPVGXM.js +22 -0
  71. package/dist/cli/{csv-RS7XHQ4P.js → csv-7UZT2LGE.js} +13 -13
  72. package/dist/cli/{csv-V2T23MXT.mjs → csv-L7P6PC6I.mjs} +4 -4
  73. package/dist/cli/{db-OQ4RNTGE.mjs → db-4OOEC5KV.mjs} +6 -6
  74. package/dist/cli/{db-WFIVRPKY.js → db-7KETOIZY.js} +27 -27
  75. package/dist/cli/{describe-AXV2EEX3.mjs → describe-M6HEFS46.mjs} +18 -18
  76. package/dist/cli/describe-RLWJYZIR.js +50 -0
  77. package/dist/cli/{executions-THP5ZDBQ.mjs → executions-U27R2LY4.mjs} +6 -6
  78. package/dist/cli/{executions-5H2RIWZ3.js → executions-UIR6RQFM.js} +8 -8
  79. package/dist/cli/{feedback-UOI6UEGA.js → feedback-CQ5FUE4T.js} +14 -14
  80. package/dist/cli/{feedback-2EJPILGE.mjs → feedback-UUUISTGQ.mjs} +6 -6
  81. package/dist/cli/{git-DI3LJIAT.mjs → git-DTILSRIQ.mjs} +5 -5
  82. package/dist/cli/git-ZGDD3BVX.js +26 -0
  83. package/dist/cli/index.js +148 -148
  84. package/dist/cli/index.mjs +47 -47
  85. package/dist/cli/{integrations-TYN2BSQ6.js → integrations-ABBLLEJH.js} +29 -29
  86. package/dist/cli/{integrations-DJYS5VRK.mjs → integrations-NNACG3HD.mjs} +7 -7
  87. package/dist/cli/{legacy-noops-GXQHNLGJ.js → legacy-noops-3JLS5OD7.js} +9 -9
  88. package/dist/cli/{legacy-noops-Z457BB6O.mjs → legacy-noops-KQW7AIYU.mjs} +6 -6
  89. package/dist/cli/{mcp-NAW3GFNN.mjs → mcp-7NHGPYZH.mjs} +4 -4
  90. package/dist/cli/{mcp-WMBOOTQL.js → mcp-JPBFKR26.js} +24 -24
  91. package/dist/cli/{monitors-OOQVE7XR.js → monitors-J6HK5KCN.js} +100 -100
  92. package/dist/cli/{monitors-A7NYAXSJ.mjs → monitors-JOE2DALW.mjs} +7 -7
  93. package/dist/cli/{org-7YCDUSZE.mjs → org-VZZ4LN4O.mjs} +6 -6
  94. package/dist/cli/{org-D2AMIVBS.js → org-WFZFQIXQ.js} +121 -121
  95. package/dist/cli/{outcomes-TNTKCUEO.mjs → outcomes-H2WEZYNT.mjs} +6 -6
  96. package/dist/cli/{outcomes-2FKZDJSQ.js → outcomes-RZWL47BJ.js} +14 -14
  97. package/dist/cli/{play-NWKHCHVZ.js → play-2ZEBUF5T.js} +336 -336
  98. package/dist/cli/{play-L6CVHSN4.mjs → play-KMWA7GVN.mjs} +19 -19
  99. package/dist/cli/{providers-22LO747B.mjs → providers-2BIA3OWA.mjs} +6 -6
  100. package/dist/cli/{providers-PZGOI5CN.js → providers-57AZWFSW.js} +9 -9
  101. package/dist/cli/{quickstart-LLWOC2GR.js → quickstart-EYJFERQO.js} +6 -6
  102. package/dist/cli/{quickstart-3ZRVKGMH.mjs → quickstart-NSDM2RXV.mjs} +4 -4
  103. package/dist/cli/{run-SNF23STR.js → run-BW62DZGQ.js} +44 -44
  104. package/dist/cli/{run-D46W2GUA.mjs → run-X6H5SCEE.mjs} +23 -23
  105. package/dist/cli/{search-XWVCICIX.mjs → search-2VN74P5N.mjs} +7 -7
  106. package/dist/cli/search-HYRDZVPQ.js +32 -0
  107. package/dist/cli/{search-output-36GHD67U.js → search-output-SFWQVBYU.js} +6 -6
  108. package/dist/cli/{search-output-YM5QXFQQ.mjs → search-output-VN7XOZEQ.mjs} +4 -4
  109. package/dist/cli/{secrets-7PTZEFRC.mjs → secrets-4M26N436.mjs} +6 -6
  110. package/dist/cli/{secrets-UXCIHG5I.js → secrets-OIPKG2H7.js} +15 -15
  111. package/dist/cli/sessions-5P2KZOQE.js +23 -0
  112. package/dist/cli/{sessions-DTXJKRP4.mjs → sessions-SYFH23L3.mjs} +6 -6
  113. package/dist/cli/{settings-74B6UOS4.mjs → settings-4HPF3T4P.mjs} +12 -12
  114. package/dist/cli/{settings-EYSDZE37.js → settings-5NB4HZYL.js} +85 -85
  115. package/dist/cli/{setup-2QRZ36CH.mjs → setup-CI74F6CL.mjs} +9 -9
  116. package/dist/cli/{setup-E7PVXBPL.js → setup-JV3F5C7P.js} +49 -49
  117. package/dist/cli/{skills-2WZ7N3UW.mjs → skills-76CM4GHO.mjs} +7 -7
  118. package/dist/cli/skills-PJ5EL32L.js +37 -0
  119. package/dist/cli/{tools-YK5SCUZD.mjs → tools-SVGLDWOC.mjs} +17 -17
  120. package/dist/cli/tools-Y5ID2SPK.js +57 -0
  121. package/dist/cli/update-FSUMCMNZ.js +37 -0
  122. package/dist/cli/{update-563YQK53.mjs → update-KPMDOZRX.mjs} +9 -9
  123. package/dist/cli/{views-ISNCRZUP.mjs → views-KW54SAES.mjs} +6 -6
  124. package/dist/cli/{views-OLPS6TPG.js → views-R37NWN6J.js} +21 -21
  125. package/dist/cli/{workflow-B3ZKU3OR.mjs → workflow-3MIRQV4Q.mjs} +7 -7
  126. package/dist/cli/{workflow-CUSCTYMW.js → workflow-BKRKUNYS.js} +17 -17
  127. package/dist/index.js +9 -9
  128. package/dist/index.mjs +6 -6
  129. package/dist/install-integrity.json +116 -116
  130. package/dist/release.d.mts +9 -1
  131. package/dist/release.d.ts +9 -1
  132. package/dist/release.js +2 -2
  133. package/dist/release.mjs +1 -1
  134. package/dist/server.js +5 -5
  135. package/dist/server.mjs +3 -3
  136. package/package.json +1 -1
  137. package/dist/cli/auth-DXUHEL5I.js +0 -44
  138. package/dist/cli/concurrent-runs-help-JLWY54WL.js +0 -22
  139. package/dist/cli/describe-33PBWO5O.js +0 -50
  140. package/dist/cli/git-2OPYEPYW.js +0 -26
  141. package/dist/cli/search-H57MZPLF.js +0 -32
  142. package/dist/cli/sessions-JJZMQSH4.js +0 -23
  143. package/dist/cli/skills-RIF2DCZI.js +0 -37
  144. package/dist/cli/tools-7VRQ4GSI.js +0 -57
  145. 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.575',
208
+ version: '0.3.577',
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 two gateways, so the runner
2949
- // must send ctx.fetch through the gateway's egress broker; a direct
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
- await applyEarlyModalRetagAfterFence(sandbox);
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
- /** The profile the `runtime-fast-launch` rollout grants. */
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@6';
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 back to
306
- // 'fast_launch@7' (its previous Production pin), or 'fast_launch@4', or removal.
307
- jh772jvn83r6be5kpcjn6rcqj182tgre: 'fast_launch@8',
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-X47J55ZJ.mjs";
4
+ } from "./chunk-O35BHZLQ.mjs";
5
5
  import {
6
6
  cliFeatureEnabled
7
- } from "./chunk-3PVKXUSJ.mjs";
8
- import "./chunk-IBYMGR5Y.mjs";
7
+ } from "./chunk-CWHXE6HJ.mjs";
8
+ import "./chunk-FHYNK7GL.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-BM536WWR.mjs";
15
+ import "./chunk-ID5WQZ2H.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;
@@ -82,6 +93,11 @@ function parseModel(value) {
82
93
  const model = value.trim();
83
94
  return model === "" || model.toLowerCase() === "default" ? null : model;
84
95
  }
96
+ function parseDisplayName(value) {
97
+ if (value === void 0) return void 0;
98
+ const displayName = value.trim();
99
+ return displayName === "" ? null : displayName;
100
+ }
85
101
  function describeOutcomeChange(change) {
86
102
  const { conversation } = change;
87
103
  const where = `#${conversation.conversationName}`;
@@ -100,7 +116,8 @@ function describeOutcomeChange(change) {
100
116
  function describeAgentLine(agent) {
101
117
  const channels = agent.conversations.length ? agent.conversations.map(describeConversation).join(", ") : "no channels";
102
118
  const skills = agent.skillNames.length ? `skills: ${agent.skillNames.join(", ")}` : "no skills";
103
- return `${agent.name} \u2014 ${firstLine(agent.instructions, 60)} [${skills}; ${channels}]`;
119
+ const slackName = agent.displayName ? ` (\u201C${agent.displayName}\u201D in Slack)` : "";
120
+ return `${agent.name}${slackName} \u2014 ${firstLine(agent.instructions, 60)} [${skills}; ${channels}]`;
104
121
  }
105
122
  function describeAgent(agent) {
106
123
  return [
@@ -109,6 +126,7 @@ function describeAgent(agent) {
109
126
  ...agent.instructions.split("\n").map((line) => ` ${line}`),
110
127
  `Skills: ${agent.skillNames.length ? agent.skillNames.join(", ") : "none"}`,
111
128
  `Model: ${agent.model ?? "the default (see deepline agents models)"}`,
129
+ ...agent.displayName !== void 0 ? [`Name in Slack: ${agent.displayName ?? "the Slack app\u2019s own name"}`] : [],
112
130
  agent.conversations.length ? `Channels: ${agent.conversations.map(describeConversation).join(", ")}` : `Channels: none. Bind one with: deepline agents channels add ${agent.name} <channel-id>`
113
131
  ];
114
132
  }
@@ -432,6 +450,26 @@ function registerWorkspaceCommands(agents, readKey) {
432
450
  options
433
451
  );
434
452
  });
453
+ agents.command("outcomes").description(
454
+ "List the outcomes Bot by Deepline owns by default (those with no home channel), with what woke it last on each."
455
+ ).option("--json", "Emit JSON output").action(async (options) => {
456
+ const { http } = getAuthedHttpClient();
457
+ const result = await http.get(
458
+ `${AGENT_PATH}/outcomes`
459
+ );
460
+ print(
461
+ result,
462
+ "outcomes Bot by Deepline owns",
463
+ result.owners.length === 0 ? [
464
+ "None. Bot by Deepline owns every outcome with no home channel while agents are on (deepline agents enable) and this deployment can be rung."
465
+ ] : [
466
+ ...result.owners.map(describeOwnedOutcome),
467
+ ...result.more ? ["More outcomes than are listed here."] : [],
468
+ "The watch and what waits for it: deepline outcomes watches list <outcome>"
469
+ ],
470
+ options
471
+ );
472
+ });
435
473
  }
436
474
  function registerAgentCommands(agents) {
437
475
  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) => {
@@ -446,10 +484,14 @@ function registerAgentCommands(agents) {
446
484
  ).argument("<name>", "Agent name: lower-case letters, digits and dashes").option("--instructions <text>", "What the agent does and never does").option("--instructions-file <path>", "Read the instructions from a file").option("--skills <names>", "Comma-separated library skill names").option(
447
485
  "--model <model>",
448
486
  "The model it runs on, from deepline agents models (for example sonnet)"
487
+ ).option(
488
+ "--display-name <name>",
489
+ "The name it posts under in Slack, at most 80 characters (default: the Slack app\u2019s own name)"
449
490
  ).option("--dry-run", "Print the request without sending it").option("--json", "Emit JSON output").action(
450
491
  async (name, options) => {
451
492
  const instructions = readInstructions(options);
452
493
  const model = parseModel(options.model);
494
+ const displayName = parseDisplayName(options.displayName);
453
495
  if (instructions === void 0) {
454
496
  throw new AgentUsageError(
455
497
  'Pass --instructions "<what the agent does>" or --instructions-file <path>.'
@@ -459,7 +501,8 @@ function registerAgentCommands(agents) {
459
501
  name: requireArgument(name, "an agent name"),
460
502
  instructions,
461
503
  skills: parseSkills(options.skills) ?? [],
462
- ...typeof model === "string" ? { model } : {}
504
+ ...typeof model === "string" ? { model } : {},
505
+ ...typeof displayName === "string" ? { displayName } : {}
463
506
  };
464
507
  if (options.dryRun) {
465
508
  printDryRun("POST", `${AGENT_PATH}/agents`, body, options);
@@ -482,28 +525,33 @@ function registerAgentCommands(agents) {
482
525
  }
483
526
  );
484
527
  agents.command("update").description(
485
- "Replace an agent\u2019s instructions, skills or model (its creator or an admin)."
528
+ "Replace an agent\u2019s instructions, skills, model or name in Slack (its creator or an admin)."
486
529
  ).argument("<name>", "Agent name").option("--instructions <text>", "New instructions").option("--instructions-file <path>", "Read new instructions from a file").option(
487
530
  "--skills <names>",
488
531
  'Comma-separated library skill names; replaces the list ("" clears it)'
489
532
  ).option(
490
533
  "--model <model>",
491
534
  'The model it runs on, from deepline agents models ("default" returns it to the default)'
535
+ ).option(
536
+ "--display-name <name>",
537
+ 'The name it posts under in Slack, at most 80 characters ("" returns it to the Slack app\u2019s own name)'
492
538
  ).option("--dry-run", "Print the request without sending it").option("--json", "Emit JSON output").action(
493
539
  async (name, options) => {
494
540
  const instructions = readInstructions(options);
495
541
  const skills = parseSkills(options.skills);
496
542
  const model = parseModel(options.model);
497
- if (instructions === void 0 && skills === void 0 && model === void 0) {
543
+ const displayName = parseDisplayName(options.displayName);
544
+ if (instructions === void 0 && skills === void 0 && model === void 0 && displayName === void 0) {
498
545
  throw new AgentUsageError(
499
- "Pass --instructions, --instructions-file, --skills or --model."
546
+ "Pass --instructions, --instructions-file, --skills, --model or --display-name."
500
547
  );
501
548
  }
502
549
  const path = `${AGENT_PATH}/agents/${encodeURIComponent(requireArgument(name, "an agent name"))}`;
503
550
  const body = {
504
551
  ...instructions !== void 0 ? { instructions } : {},
505
552
  ...skills !== void 0 ? { skills } : {},
506
- ...model !== void 0 ? { model } : {}
553
+ ...model !== void 0 ? { model } : {},
554
+ ...displayName !== void 0 ? { displayName } : {}
507
555
  };
508
556
  if (options.dryRun) {
509
557
  printDryRun("PATCH", path, body, options);