deepline 0.3.311 → 0.3.312

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 (113) hide show
  1. package/dist/bundling-sources/sdk/src/play.ts +7 -1
  2. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  3. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +100 -25
  4. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +23 -1
  5. package/dist/bundling-sources/shared_libs/plays/core.ts +7 -1
  6. package/dist/bundling-sources/shared_libs/plays/settings-contract.ts +29 -3
  7. package/dist/cli/{auth-2A7OYHFJ.mjs → auth-ACDTPM3M.mjs} +4 -4
  8. package/dist/cli/auth-TFDGA24W.js +31 -0
  9. package/dist/cli/{billing-P7GIAP3U.mjs → billing-FVBBJ77L.mjs} +5 -5
  10. package/dist/cli/{billing-2PQ4VDRR.js → billing-YTJFHEGU.js} +71 -71
  11. package/dist/cli/{chunk-5IBHISKA.js → chunk-6KKETQSI.js} +6 -6
  12. package/dist/cli/{chunk-XDUQQTIS.js → chunk-6LLJWMYH.js} +6 -6
  13. package/dist/cli/{chunk-HOCPOTDX.mjs → chunk-6OGNRAS7.mjs} +2 -2
  14. package/dist/cli/chunk-76VKBPOC.mjs +406 -0
  15. package/dist/cli/{chunk-7TT4LZIR.js → chunk-7SW43OAX.js} +60 -60
  16. package/dist/cli/{chunk-SGTSJCOA.mjs → chunk-AA66YTS7.mjs} +1 -1
  17. package/dist/cli/{chunk-QO3GH6UP.js → chunk-BRJOVSTH.js} +2 -2
  18. package/dist/cli/{chunk-4WFNAWVO.mjs → chunk-EHVJ7XXD.mjs} +2 -2
  19. package/dist/cli/{chunk-G3QP2WYR.mjs → chunk-ENSDO4SG.mjs} +4 -4
  20. package/dist/cli/{chunk-VODJJUKE.js → chunk-FQVTHBEH.js} +15 -15
  21. package/dist/cli/{chunk-DUEHAEPM.mjs → chunk-GTEDCRKC.mjs} +1 -1
  22. package/dist/cli/{play-SOG5Q2GE.mjs → chunk-I25C4KL7.mjs} +166 -90
  23. package/dist/cli/{chunk-W7INSYJS.js → chunk-IALPYID6.js} +3 -3
  24. package/dist/cli/{chunk-ICZB4GTY.mjs → chunk-MK4K5MQU.mjs} +23 -3
  25. package/dist/cli/{chunk-WB6Z2Q44.mjs → chunk-N5V2SBB2.mjs} +19 -1
  26. package/dist/cli/{chunk-TBX7AA7Y.mjs → chunk-NJNYWVEF.mjs} +2 -2
  27. package/dist/cli/{chunk-QJA6SJHA.mjs → chunk-NMZPK7LM.mjs} +1 -1
  28. package/dist/cli/{chunk-5OVNL6LS.mjs → chunk-NWFE4PGX.mjs} +1 -1
  29. package/dist/cli/{chunk-ZDO3TO3M.js → chunk-OJ243ZA5.js} +19 -1
  30. package/dist/cli/{tools-G4HGCHNQ.mjs → chunk-OV6IFAXH.mjs} +180 -36
  31. package/dist/cli/{play-BCMGFYTF.js → chunk-QFSLMI42.js} +342 -266
  32. package/dist/cli/{chunk-LRI2FQF2.js → chunk-T4IJQKRE.js} +26 -26
  33. package/dist/cli/{chunk-RNJ74JDH.js → chunk-TID5XLTZ.js} +4 -4
  34. package/dist/cli/{chunk-QYL5ZV4U.js → chunk-ULI6UVV6.js} +6 -6
  35. package/dist/cli/{chunk-4NIQA6S7.mjs → chunk-US4S3E4Y.mjs} +1 -1
  36. package/dist/cli/{tools-WN7T25LW.js → chunk-V7N6BJQD.js} +231 -87
  37. package/dist/cli/{chunk-IB7OGQGH.js → chunk-VJDKV5RU.js} +29 -9
  38. package/dist/cli/{chunk-Q3LYQTSO.mjs → chunk-WPTUKXIF.mjs} +1 -1
  39. package/dist/cli/chunk-XNL3SEMC.js +406 -0
  40. package/dist/cli/{chunk-GCX3343L.js → chunk-YYU3PYVK.js} +48 -48
  41. package/dist/cli/{chunk-SPUTBCUR.mjs → chunk-ZH7KTVAB.mjs} +1 -1
  42. package/dist/cli/{chunk-FYPZ43Y4.js → chunk-ZQJDRSR5.js} +1 -1
  43. package/dist/cli/{client-PNLDT2M3.mjs → client-ENGOMTTU.mjs} +3 -3
  44. package/dist/cli/client-T6YGH6TT.js +20 -0
  45. package/dist/cli/{csv-L5DN7F45.js → csv-6WOJC6NZ.js} +12 -12
  46. package/dist/cli/{csv-KUAATBZQ.mjs → csv-ENKTPYAJ.mjs} +3 -3
  47. package/dist/cli/{db-6NIH4KTZ.js → db-BAEVP4QK.js} +20 -20
  48. package/dist/cli/{db-WZOD6NP5.mjs → db-DSCJZYJU.mjs} +4 -4
  49. package/dist/cli/describe-PAUHJF7H.mjs +236 -0
  50. package/dist/cli/describe-X2AFAC4B.js +236 -0
  51. package/dist/cli/{executions-TQ5WRHDS.js → executions-LXS6NLCV.js} +6 -6
  52. package/dist/cli/{executions-RDDXGT2Y.mjs → executions-R6JOR67D.mjs} +4 -4
  53. package/dist/cli/{feedback-ZB4WKBSS.mjs → feedback-CYRVNCGT.mjs} +3 -3
  54. package/dist/cli/{feedback-NYKLEQB6.js → feedback-HXP2D7K6.js} +6 -6
  55. package/dist/cli/git-JOE2RM3Q.js +23 -0
  56. package/dist/cli/{git-E6DKAX3X.mjs → git-XBYBZB4R.mjs} +4 -4
  57. package/dist/cli/index.js +82 -78
  58. package/dist/cli/index.mjs +45 -41
  59. package/dist/cli/{legacy-noops-26Y5NSU6.js → legacy-noops-AUNAFEZP.js} +7 -7
  60. package/dist/cli/{legacy-noops-25B7JCOZ.mjs → legacy-noops-OQP6VZKE.mjs} +4 -4
  61. package/dist/cli/{monitors-WRTHO7DT.mjs → monitors-L2HAAPAL.mjs} +7 -7
  62. package/dist/cli/{monitors-L3GFT4MG.js → monitors-QSIZG3CJ.js} +88 -88
  63. package/dist/cli/{org-BNCTGPWF.js → org-JUHQGBQE.js} +60 -60
  64. package/dist/cli/{org-ZTHOFVEO.mjs → org-UCSN5XRC.mjs} +4 -4
  65. package/dist/cli/play-2SNMTZGK.js +152 -0
  66. package/dist/cli/play-5AT2RB3M.mjs +152 -0
  67. package/dist/cli/{providers-MLOKTD6O.js → providers-CVG4L3VR.js} +7 -7
  68. package/dist/cli/{providers-SLAPPVMU.mjs → providers-GVPAPZ4L.mjs} +4 -4
  69. package/dist/cli/{quickstart-IWJLGET3.js → quickstart-7OIFIQG3.js} +5 -5
  70. package/dist/cli/{quickstart-LZRKZLNQ.mjs → quickstart-Y6ZU27LE.mjs} +3 -3
  71. package/dist/cli/{search-RCDGSNWW.mjs → search-4I2Y2NKK.mjs} +13 -5
  72. package/dist/cli/search-DS36UHOX.js +26 -0
  73. package/dist/cli/{secrets-GDPYV6OC.mjs → secrets-3Z4IUEBA.mjs} +4 -4
  74. package/dist/cli/{secrets-24KEMSCU.js → secrets-O2UFLU52.js} +13 -13
  75. package/dist/cli/{sessions-ST5XQQZN.mjs → sessions-OMAXRY5I.mjs} +4 -4
  76. package/dist/cli/{sessions-QOUUGVP3.js → sessions-T6MWWQRH.js} +5 -5
  77. package/dist/cli/{settings-V6Z775TO.mjs → settings-C47WXZY5.mjs} +7 -7
  78. package/dist/cli/{settings-4XWDMAA2.js → settings-R4LO5NMY.js} +74 -74
  79. package/dist/cli/{setup-W7SPZTUL.js → setup-FIUTV4DD.js} +41 -41
  80. package/dist/cli/{setup-QPZLP25U.mjs → setup-JPJVTIQ6.mjs} +6 -6
  81. package/dist/cli/{skills-QG22R2EI.mjs → skills-6WVTMKP5.mjs} +4 -4
  82. package/dist/cli/skills-GLPKPF7R.js +28 -0
  83. package/dist/cli/tools-L3YLQ7BR.js +38 -0
  84. package/dist/cli/tools-TKS77TNU.mjs +38 -0
  85. package/dist/cli/{update-5PSYBGVU.mjs → update-GD754XMA.mjs} +6 -6
  86. package/dist/cli/update-HXI35NME.js +28 -0
  87. package/dist/cli/{workflow-ZEQ46MGG.js → workflow-OCUQCNXA.js} +16 -16
  88. package/dist/cli/{workflow-EK7DV4AQ.mjs → workflow-YKQSPXQZ.mjs} +6 -6
  89. package/dist/{client-DpnkGBn-.d.mts → client-CtVdLZux.d.mts} +21 -4
  90. package/dist/{client-ypdBvf1o.d.ts → client-OBwghxPC.d.ts} +21 -4
  91. package/dist/{compiler-manifest-qtTNYvBl.d.ts → compiler-manifest-wOKNiXpa.d.mts} +21 -0
  92. package/dist/{compiler-manifest-qtTNYvBl.d.mts → compiler-manifest-wOKNiXpa.d.ts} +21 -0
  93. package/dist/index.d.mts +4 -4
  94. package/dist/index.d.ts +4 -4
  95. package/dist/index.js +13 -10
  96. package/dist/index.mjs +16 -13
  97. package/dist/install-integrity.json +84 -76
  98. package/dist/plays/bundle-play-file.d.mts +2 -2
  99. package/dist/plays/bundle-play-file.d.ts +2 -2
  100. package/dist/plays/bundle-play-file.mjs +2 -2
  101. package/dist/plays/run-request.d.mts +2 -2
  102. package/dist/plays/run-request.d.ts +2 -2
  103. package/dist/release.d.mts +1 -1
  104. package/dist/release.d.ts +1 -1
  105. package/dist/release.js +2 -2
  106. package/dist/release.mjs +1 -1
  107. package/package.json +1 -1
  108. package/dist/cli/auth-66JFXP6C.js +0 -31
  109. package/dist/cli/client-ADWRS22F.js +0 -20
  110. package/dist/cli/git-E56KOYJR.js +0 -23
  111. package/dist/cli/search-6FBDSA3K.js +0 -18
  112. package/dist/cli/skills-WKOQBJY7.js +0 -28
  113. package/dist/cli/update-WKVCWGYY.js +0 -28
@@ -1748,7 +1748,13 @@ export function definePlay<TInput, TOutput extends PlayReturnObject>(
1748
1748
  : {
1749
1749
  name: nameOrConfig.id,
1750
1750
  fn: nameOrConfig.run,
1751
- bindings: nameOrConfig.bindings,
1751
+ bindings:
1752
+ nameOrConfig.displayName !== undefined
1753
+ ? {
1754
+ ...nameOrConfig.bindings,
1755
+ displayName: nameOrConfig.displayName,
1756
+ }
1757
+ : nameOrConfig.bindings,
1752
1758
  description: nameOrConfig.description,
1753
1759
  inputSchema: nameOrConfig.input.schema,
1754
1760
  billing: nameOrConfig.billing,
@@ -200,7 +200,7 @@ export const SDK_RELEASE = {
200
200
  // getters keep their established compatibility behavior.
201
201
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
202
202
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
203
- version: '0.3.311',
203
+ version: '0.3.312',
204
204
  updateSummary:
205
205
  'Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.',
206
206
  packageCapabilities: {
@@ -18060,6 +18060,8 @@ export async function readPendingPostgresSchedulerOutboxEvents(
18060
18060
  extendOwnedHead?: string;
18061
18061
  /** The dispatcher owns a short, exclusive claim transaction. */
18062
18062
  inTransaction?: boolean;
18063
+ /** The owner rolls back and restarts the whole claim on the old-schema adapter. */
18064
+ restartTransactionOnMissingMarker?: boolean;
18063
18065
  } = {},
18064
18066
  options?: Pick<PostgresSchedulerOptions, 'schema'>,
18065
18067
  ): Promise<PostgresSchedulerOutboxEvent[]> {
@@ -18100,6 +18102,11 @@ async function claimPostgresSchedulerOutboxPrefix(
18100
18102
  `${alias}.delivered_at IS NULL${
18101
18103
  acknowledgement ? ` AND NOT (${alias}.event_id = ANY($5::text[]))` : ''
18102
18104
  }`;
18105
+ // The dispatcher already chose this run. Seek its oldest pending fact
18106
+ // before eligibility checks; comparing every candidate with every earlier
18107
+ // fact makes a single run's burst quadratic. Failed/delayed heads must
18108
+ // remain in this seek so they still block their causal successors.
18109
+ const seekRunHead = runId !== null && !input.extendOwnedHead;
18103
18110
  const claim = async (supportsTerminalBatchMarker: boolean) => {
18104
18111
  const urgentLifecyclePendingSql = (alias: string) =>
18105
18112
  input.searchOnly === true
@@ -18137,6 +18144,18 @@ async function claimPostgresSchedulerOutboxPrefix(
18137
18144
  : `waiting_runs AS MATERIALIZED (
18138
18145
  ${runLedgerWaitingRunsSql(options, '$2')}
18139
18146
  ), `
18147
+ }${
18148
+ seekRunHead
18149
+ ? `pending_head AS MATERIALIZED (
18150
+ SELECT pending.event_id
18151
+ FROM ${tableName('outbox', options)} AS pending
18152
+ WHERE pending.run_id = $2
18153
+ AND ${pending('pending')}
18154
+ AND ${searchLaneSql('pending')} = ${input.searchOnly === true ? 'true' : 'false'}
18155
+ ORDER BY ${runLedgerOrderSql('pending')}
18156
+ LIMIT 1
18157
+ ),`
18158
+ : ''
18140
18159
  }${
18141
18160
  input.extendOwnedHead
18142
18161
  ? `owned_run AS MATERIALIZED (
@@ -18152,6 +18171,7 @@ async function claimPostgresSchedulerOutboxPrefix(
18152
18171
  SELECT candidate.event_id, candidate.run_id, candidate.event_type,
18153
18172
  ${supportsTerminalBatchMarker ? 'candidate.delivery_batch_started_at' : 'NULL::timestamptz'} AS delivery_batch_started_at
18154
18173
  FROM ${tableName('outbox', options)} AS candidate
18174
+ ${seekRunHead ? 'JOIN pending_head ON pending_head.event_id = candidate.event_id' : ''}
18155
18175
  ${input.extendOwnedHead ? 'JOIN owned_run ON owned_run.run_id = candidate.run_id' : ''}
18156
18176
  WHERE ${pending('candidate')}
18157
18177
  AND ${searchLaneSql('candidate')} = ${input.searchOnly === true ? 'true' : 'false'}
@@ -18195,13 +18215,17 @@ async function claimPostgresSchedulerOutboxPrefix(
18195
18215
  -- Competing projectors acquire one run through its oldest event.
18196
18216
  -- Locking this head prevents another projector from splitting the
18197
18217
  -- run while still letting it skip to unrelated runs.
18198
- AND NOT EXISTS (
18218
+ ${
18219
+ seekRunHead
18220
+ ? ''
18221
+ : `AND NOT EXISTS (
18199
18222
  SELECT 1
18200
18223
  FROM ${tableName('outbox', options)} AS predecessor
18201
18224
  WHERE predecessor.run_id = candidate.run_id
18202
18225
  AND ${pending('predecessor')}
18203
18226
  AND ${runLedgerPrecedesSql('predecessor', 'candidate')}
18204
- )
18227
+ )`
18228
+ }
18205
18229
  -- A new durable admission has no causal dependency on unrelated
18206
18230
  -- terminal facts. Project it first so a lifecycle backlog cannot make
18207
18231
  -- an accepted run invisible; per-run predecessor checks above retain
@@ -18383,7 +18407,9 @@ async function claimPostgresSchedulerOutboxPrefix(
18383
18407
  );
18384
18408
  };
18385
18409
  let result;
18386
- if (input.inTransaction) await client.query('SAVEPOINT run_ledger_claim');
18410
+ const useSavepoint =
18411
+ input.inTransaction && !input.restartTransactionOnMissingMarker;
18412
+ if (useSavepoint) await client.query('SAVEPOINT run_ledger_claim');
18387
18413
  if (supportsOutboxDeliveryBatchMarker(options)) {
18388
18414
  try {
18389
18415
  result = await claim(true);
@@ -18393,16 +18419,16 @@ async function claimPostgresSchedulerOutboxPrefix(
18393
18419
  // The ACK caller owns the whole short transaction. Roll it back and
18394
18420
  // repeat only this missing-column adapter, avoiding two SAVEPOINT round
18395
18421
  // trips on every successful acknowledgement.
18396
- if (acknowledgement) throw error;
18397
- if (input.inTransaction)
18422
+ if (acknowledgement || input.restartTransactionOnMissingMarker)
18423
+ throw error;
18424
+ if (useSavepoint)
18398
18425
  await client.query('ROLLBACK TO SAVEPOINT run_ledger_claim');
18399
18426
  result = await claim(false);
18400
18427
  }
18401
18428
  } else {
18402
18429
  result = await claim(false);
18403
18430
  }
18404
- if (input.inTransaction)
18405
- await client.query('RELEASE SAVEPOINT run_ledger_claim');
18431
+ if (useSavepoint) await client.query('RELEASE SAVEPOINT run_ledger_claim');
18406
18432
  const events = result.rows
18407
18433
  .filter((row) => row.row_kind === 'claimed')
18408
18434
  .map((row) => {
@@ -19871,7 +19897,7 @@ export async function dispatchRunLedgerOutboxToLedgerBatchOnceWithClientScope(
19871
19897
  }
19872
19898
 
19873
19899
  async function dispatchRunLedgerOutboxBatchWithScope(
19874
- withClient: RunLedgerOutboxWithClient,
19900
+ acquireClient: RunLedgerOutboxWithClient,
19875
19901
  input: RunLedgerOutboxDispatchInput & { waitForRunLock?: boolean },
19876
19902
  options?: Pick<PostgresSchedulerOptions, 'schema'>,
19877
19903
  scope?: RunLedgerOutboxDrainScope,
@@ -19879,6 +19905,25 @@ async function dispatchRunLedgerOutboxBatchWithScope(
19879
19905
  remainingEvents: number | null = null,
19880
19906
  ): Promise<PostgresSchedulerOutboxProjectionResult> {
19881
19907
  const dispatchStartedAtMs = Date.now();
19908
+ // A committed terminal is running-work control traffic. Use the existing
19909
+ // alternating critical admission lane so its short lease operations do not
19910
+ // sit behind a full ordinary-work backlog; capacity is unchanged.
19911
+ const terminalRunId =
19912
+ scope && scope.targetEventId === `run-terminal:${scope.runId}`
19913
+ ? scope.runId
19914
+ : null;
19915
+ const withClient: RunLedgerOutboxWithClient = (operation, trace) =>
19916
+ acquireClient(
19917
+ operation,
19918
+ trace ??
19919
+ (terminalRunId
19920
+ ? {
19921
+ runId: terminalRunId,
19922
+ phase: 'run_ledger_outbox_terminal_delivery',
19923
+ priority: 'critical',
19924
+ }
19925
+ : undefined),
19926
+ );
19882
19927
  const tokenAuthority = input.tokenAuthority ?? 'local_mint';
19883
19928
  const leaseOwner =
19884
19929
  input.leaseOwner?.trim() || `run-ledger-outbox-dispatch:${randomUUID()}`;
@@ -19930,6 +19975,9 @@ async function dispatchRunLedgerOutboxBatchWithScope(
19930
19975
  await client.query('BEGIN');
19931
19976
  try {
19932
19977
  const targetRunId = input.runId?.trim() || null;
19978
+ let lockedRun: {
19979
+ rows: { run_id: string; dispatch_launch_json: unknown }[];
19980
+ } | null = null;
19933
19981
  if (input.waitForRunLock && targetRunId) {
19934
19982
  // A synchronous drain must not mistake a busy run for an empty
19935
19983
  // outbox. In particular, cancellation owns its pending prefix lease,
@@ -19945,8 +19993,14 @@ async function dispatchRunLedgerOutboxBatchWithScope(
19945
19993
  `${RUNTIME_SCHEDULER_CANCEL_STATEMENT_TIMEOUT_MS}ms`,
19946
19994
  ],
19947
19995
  );
19948
- await client.query(
19949
- `SELECT run_id FROM ${tableName('runs', options)} WHERE run_id = $1 FOR UPDATE`,
19996
+ lockedRun = await client.query<{
19997
+ run_id: string;
19998
+ dispatch_launch_json: unknown;
19999
+ }>(
20000
+ `SELECT runs.run_id,
20001
+ ${needsLaunch ? runLedgerDispatchLaunchSql('runs') : 'NULL::jsonb'} AS dispatch_launch_json
20002
+ FROM ${tableName('runs', options)} AS runs
20003
+ WHERE runs.run_id = $1 FOR UPDATE`,
19950
20004
  [targetRunId],
19951
20005
  );
19952
20006
  }
@@ -19955,12 +20009,14 @@ async function dispatchRunLedgerOutboxBatchWithScope(
19955
20009
  // nullable predicate made PostgreSQL materialize every pending run head
19956
20010
  // for each lifecycle transition. Only the two dedicated projectors may
19957
20011
  // perform the global distinct-head scan below.
19958
- const selected = targetRunId
19959
- ? await client.query<{
19960
- run_id: string;
19961
- dispatch_launch_json: unknown;
19962
- }>(
19963
- `
20012
+ const selected =
20013
+ (input.headEventId ? null : lockedRun) ??
20014
+ (targetRunId
20015
+ ? await client.query<{
20016
+ run_id: string;
20017
+ dispatch_launch_json: unknown;
20018
+ }>(
20019
+ `
19964
20020
  WITH head AS MATERIALIZED (
19965
20021
  SELECT pending.run_id,
19966
20022
  pending.event_id,
@@ -19993,12 +20049,12 @@ async function dispatchRunLedgerOutboxBatchWithScope(
19993
20049
  )
19994
20050
  FOR UPDATE OF runs SKIP LOCKED
19995
20051
  `,
19996
- [targetRunId, leaseOwner, input.headEventId?.trim() || null],
19997
- )
19998
- : await client.query<{
19999
- run_id: string;
20000
- dispatch_launch_json: unknown;
20001
- }>(`
20052
+ [targetRunId, leaseOwner, input.headEventId?.trim() || null],
20053
+ )
20054
+ : await client.query<{
20055
+ run_id: string;
20056
+ dispatch_launch_json: unknown;
20057
+ }>(`
20002
20058
  WITH ${
20003
20059
  input.searchOnly === true
20004
20060
  ? ''
@@ -20048,7 +20104,7 @@ async function dispatchRunLedgerOutboxBatchWithScope(
20048
20104
  }
20049
20105
  head.created_at, runs.run_id
20050
20106
  FOR UPDATE OF runs SKIP LOCKED LIMIT 1
20051
- `);
20107
+ `));
20052
20108
  const runId = selected.rows[0]?.run_id;
20053
20109
  const claimed = runId
20054
20110
  ? await readPendingPostgresSchedulerOutboxEvents(
@@ -20059,6 +20115,7 @@ async function dispatchRunLedgerOutboxBatchWithScope(
20059
20115
  leaseOwner,
20060
20116
  leaseSeconds: input.leaseSeconds ?? 120,
20061
20117
  inTransaction: true,
20118
+ restartTransactionOnMissingMarker: true,
20062
20119
  searchOnly: input.searchOnly,
20063
20120
  },
20064
20121
  options,
@@ -20083,7 +20140,16 @@ async function dispatchRunLedgerOutboxBatchWithScope(
20083
20140
  : null;
20084
20141
  const claimed = preclaimed
20085
20142
  ? { events: preclaimed, launchJson: null }
20086
- : await withClient(claimEvents);
20143
+ : await withClient(async (client) => {
20144
+ try {
20145
+ return await claimEvents(client);
20146
+ } catch (error) {
20147
+ if (!isMissingOutboxDeliveryBatchMarker(error)) throw error;
20148
+ // claimEvents rolled back. Reacquire the run fence and its fresh
20149
+ // snapshot using only the named missing-column compatibility path.
20150
+ return claimEvents(client);
20151
+ }
20152
+ });
20087
20153
  const { launchJson } = claimed;
20088
20154
  let events = claimed.events;
20089
20155
  if (events.length === 0) {
@@ -20391,7 +20457,7 @@ async function dispatchRunLedgerOutboxBatchWithScope(
20391
20457
  events.length === 1 &&
20392
20458
  first.eventType === RUN_SCHEDULER_OUTBOX_EVENT_TYPE.runEvents
20393
20459
  ) {
20394
- const widened = await withClient(async (client) => {
20460
+ const widen = async (client: PostgresSchedulerQueryClient) => {
20395
20461
  await client.query('BEGIN');
20396
20462
  try {
20397
20463
  await client.query(
@@ -20422,6 +20488,7 @@ async function dispatchRunLedgerOutboxBatchWithScope(
20422
20488
  allowIngressPrefix: true,
20423
20489
  extendOwnedHead: first.eventId,
20424
20490
  inTransaction: true,
20491
+ restartTransactionOnMissingMarker: true,
20425
20492
  },
20426
20493
  options,
20427
20494
  );
@@ -20431,6 +20498,14 @@ async function dispatchRunLedgerOutboxBatchWithScope(
20431
20498
  await client.query('ROLLBACK');
20432
20499
  throw error;
20433
20500
  }
20501
+ };
20502
+ const widened = await withClient(async (client) => {
20503
+ try {
20504
+ return await widen(client);
20505
+ } catch (error) {
20506
+ if (!isMissingOutboxDeliveryBatchMarker(error)) throw error;
20507
+ return widen(client);
20508
+ }
20434
20509
  });
20435
20510
  if (widened[0]?.eventId !== first.eventId) {
20436
20511
  throw new RunLedgerProjectionLeaseLostError(
@@ -717,6 +717,7 @@ export type PlayAuthoringAstSqlListenerDeclaration = {
717
717
  operations: string[];
718
718
  };
719
719
  export type PlayAuthoringAstBindings = {
720
+ displayName?: string;
720
721
  webhook?: {
721
722
  hmac?: {
722
723
  algorithm?: 'sha256';
@@ -745,6 +746,7 @@ export type PlayAuthoringAstBindings = {
745
746
  */
746
747
  export const PLAY_AUTHORING_BINDING_FIELDS = {
747
748
  root: [
749
+ 'displayName',
748
750
  'billing',
749
751
  'compatibility',
750
752
  'cron',
@@ -792,6 +794,7 @@ export type PlayAuthoringCronInput<TInput> = TInput extends readonly unknown[]
792
794
 
793
795
  /** The one public type for options accepted by definePlay. */
794
796
  export type PlayAuthoringBindings<TInput = Record<string, unknown>> = {
797
+ displayName?: string;
795
798
  description?: string;
796
799
  compatibility?: {
797
800
  toolErrorSchemaVersion?: ToolExecutionErrorSchemaVersion;
@@ -929,6 +932,7 @@ export type PlayAuthoringDefineConfig<
929
932
  > = {
930
933
  id: string;
931
934
  description?: string;
935
+ displayName?: string;
932
936
  input: PlayAuthoringInputContract<TInput>;
933
937
  run: (ctx: TContext, input: TInput) => Promise<TOutput>;
934
938
  bindings?: PlayAuthoringBindings<TInput>;
@@ -1644,6 +1648,23 @@ const SqlListenerFilterScalarSchema = Type.Union([
1644
1648
  ]);
1645
1649
 
1646
1650
  export const PLAY_AUTHORING_FIELD_REGISTRY = {
1651
+ displayName: {
1652
+ schema: Type.String(),
1653
+ fixtures: {
1654
+ valid: 'Find verified emails',
1655
+ invalid: 42,
1656
+ absent: undefined,
1657
+ unresolved: { expression: 'displayName' },
1658
+ edition1: 'Legacy play',
1659
+ },
1660
+ referenceType: 'string',
1661
+ required: false,
1662
+ resolution: 'static-required',
1663
+ issueCode: 'play_authoring_binding_invalid',
1664
+ description:
1665
+ 'Optional human-readable Play name; empty uses the derived identifier.',
1666
+ errorMessage: 'displayName must be a static string.',
1667
+ },
1647
1668
  description: {
1648
1669
  schema: Type.String({ minLength: 1 }),
1649
1670
  fixtures: {
@@ -3198,6 +3219,7 @@ export const PLAY_AUTHORING_CLOUD_TYPE_DECLARATIONS = [
3198
3219
  '};',
3199
3220
  'export type PlayCronInput<TInput> = TInput extends readonly unknown[] ? never : TInput extends object ? TInput : never;',
3200
3221
  'export type PlayBindings<TInput = Record<string, unknown>> = {',
3222
+ ` displayName?: ${cloudReferenceType('displayName')};`,
3201
3223
  ` description?: ${cloudReferenceType('description')};`,
3202
3224
  ` compatibility?: { toolErrorSchemaVersion?: ${cloudReferenceType('compatibility.toolErrorSchemaVersion')}; toolResponseReceiptRevision?: ${cloudReferenceType('compatibility.toolResponseReceiptRevision')} };`,
3203
3225
  ` inline?: ${cloudReferenceType('inline')};`,
@@ -3276,7 +3298,7 @@ export const PLAY_AUTHORING_CLOUD_TYPE_DECLARATIONS = [
3276
3298
  " log(message: string, options?: { level?: 'debug' | 'info' | 'warn' | 'error'; context?: Readonly<Record<string, string | number | boolean>> }): void;",
3277
3299
  ` sleep(ms: ${cloudReferenceType('ctx.sleep.ms')}): Promise<void>;`,
3278
3300
  '}',
3279
- "export type DefinePlayConfig<TInput, TOutput extends PlayReturnObject> = { id: string; description?: string; input: PlayInputContract<TInput>; run: (ctx: DeeplinePlayRuntimeContext, input: TInput) => Promise<TOutput>; bindings?: PlayBindings<TInput>; billing?: PlayBindings<TInput>['billing']; runtime?: PlayBindings<TInput>['runtime']; compatibility?: PlayBindings<TInput>['compatibility'] };",
3301
+ "export type DefinePlayConfig<TInput, TOutput extends PlayReturnObject> = { id: string; displayName?: string; description?: string; input: PlayInputContract<TInput>; run: (ctx: DeeplinePlayRuntimeContext, input: TInput) => Promise<TOutput>; bindings?: PlayBindings<TInput>; billing?: PlayBindings<TInput>['billing']; runtime?: PlayBindings<TInput>['runtime']; compatibility?: PlayBindings<TInput>['compatibility'] };",
3280
3302
  "export type DefinedPlay<TInput, TOutput extends PlayReturnObject> = ((ctx: DeeplinePlayRuntimeContext, input: TInput) => Promise<TOutput>) & { readonly name: string; readonly __inputType?: TInput; readonly __outputType?: TOutput; readonly bindings?: PlayBindings<TInput>; readonly runtime?: PlayBindings<TInput>['runtime']; readonly compatibility?: PlayBindings<TInput>['compatibility'] };",
3281
3303
  'export type PlayHandlerInput<THandler> = THandler extends (context: DeeplinePlayRuntimeContext, input: infer TInput) => Promise<PlayReturnObject> ? TInput : never;',
3282
3304
  'export type PlayHandlerOutput<THandler> = THandler extends (context: DeeplinePlayRuntimeContext, input: unknown) => Promise<infer TOutput extends PlayReturnObject> ? TOutput : never;',
@@ -358,7 +358,13 @@ export function createDefinedPlay<
358
358
  : {
359
359
  name: nameOrConfig.id,
360
360
  fn: nameOrConfig.run,
361
- bindings: nameOrConfig.bindings,
361
+ bindings:
362
+ nameOrConfig.displayName !== undefined
363
+ ? {
364
+ ...nameOrConfig.bindings,
365
+ displayName: nameOrConfig.displayName,
366
+ }
367
+ : nameOrConfig.bindings,
362
368
  description: nameOrConfig.description,
363
369
  inputSchema: nameOrConfig.input.schema,
364
370
  billing: nameOrConfig.billing,
@@ -89,6 +89,12 @@ export function publishedPlayPath(path: PlayPath): PlayPath {
89
89
  return { root: 'team', folders: path?.folders ?? [] };
90
90
  }
91
91
 
92
+ export const playDisplayNameSchema = z
93
+ .string()
94
+ .trim()
95
+ .nullable()
96
+ .transform((value) => value || null);
97
+
92
98
  /** One registry drives validation, defaults, CLI keys/help and settings controls. */
93
99
  export const PLAY_SETTING_FIELDS = {
94
100
  path: {
@@ -114,10 +120,30 @@ export const PLAY_SETTING_FIELDS = {
114
120
  ],
115
121
  parse: (value: string) =>
116
122
  value === 'null' ? null : parsePlayPath(value),
117
- format: formatPlayPath,
123
+ format: (value: unknown) => formatPlayPath(playPathSchema.parse(value)),
118
124
  },
119
125
  ui: { control: 'play-location-picker' as const },
120
126
  },
127
+ displayName: {
128
+ schema: playDisplayNameSchema
129
+ .default(null)
130
+ .describe(
131
+ 'Optional human-readable Play name. Null uses the name derived from the identifier.',
132
+ ),
133
+ label: 'Display name',
134
+ description:
135
+ 'Optional name shown in the UI. Leave empty to use the name derived from the Play identifier.',
136
+ get defaultValue(): string | null {
137
+ return this.schema.parse(undefined);
138
+ },
139
+ cli: {
140
+ valueSyntax: 'text | null',
141
+ examples: ['Find verified emails', 'null'],
142
+ parse: (value: string) => (value === 'null' ? null : value),
143
+ format: (value: unknown) => playDisplayNameSchema.parse(value) ?? 'null',
144
+ },
145
+ ui: { control: 'text' as const },
146
+ },
121
147
  } as const;
122
148
  export const playSettingsSchema = z
123
149
  .object(
@@ -150,10 +176,10 @@ export const playSettingsPatchSchema = z
150
176
  'Supply at least one setting.',
151
177
  );
152
178
  export type PlaySettings = {
153
- [K in keyof typeof PLAY_SETTING_FIELDS]: z.output<
179
+ [K in Exclude<keyof typeof PLAY_SETTING_FIELDS, 'displayName'>]: z.output<
154
180
  (typeof PLAY_SETTING_FIELDS)[K]['schema']
155
181
  >;
156
- };
182
+ } & { displayName?: string | null };
157
183
  export type PlaySettingsPatch = z.output<typeof playSettingsPatchSchema>;
158
184
  /** Validate registered keys while preserving future keys in stored objects. */
159
185
  export function parsePlaySettings(value: unknown): PlaySettings {
@@ -9,11 +9,11 @@ import {
9
9
  registerAuthCommands,
10
10
  reportSetupCompleted,
11
11
  resolvePendingAuthClaimForResume
12
- } from "./chunk-HOCPOTDX.mjs";
13
- import "./chunk-SPUTBCUR.mjs";
14
- import "./chunk-Q3LYQTSO.mjs";
12
+ } from "./chunk-6OGNRAS7.mjs";
13
+ import "./chunk-ZH7KTVAB.mjs";
14
+ import "./chunk-WPTUKXIF.mjs";
15
15
  import "./chunk-DLIRSHV6.mjs";
16
- import "./chunk-SGTSJCOA.mjs";
16
+ import "./chunk-AA66YTS7.mjs";
17
17
  import "./chunk-NXGCO4JB.mjs";
18
18
  import "./chunk-WZYKRD7T.mjs";
19
19
  import "./chunk-KRD6H754.mjs";
@@ -0,0 +1,31 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+ var _chunkYYU3PYVKjs = require('./chunk-YYU3PYVK.js');
13
+ require('./chunk-6LLJWMYH.js');
14
+ require('./chunk-TID5XLTZ.js');
15
+ require('./chunk-XNYIZMNQ.js');
16
+ require('./chunk-ZQJDRSR5.js');
17
+ require('./chunk-7P5AA3SN.js');
18
+ require('./chunk-OG64RBAC.js');
19
+ require('./chunk-COGTRVWW.js');
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+ exports.EXIT_WORKSPACE_MISMATCH = _chunkYYU3PYVKjs.EXIT_WORKSPACE_MISMATCH; exports.clearPendingClaim = _chunkYYU3PYVKjs.clearPendingClaim; exports.clearSatisfiedPendingClaim = _chunkYYU3PYVKjs.clearSatisfiedPendingClaim; exports.handleRegister = _chunkYYU3PYVKjs.handleRegister; exports.handleStatus = _chunkYYU3PYVKjs.handleStatus; exports.handleWait = _chunkYYU3PYVKjs.handleWait; exports.readPendingAuthClaim = _chunkYYU3PYVKjs.readPendingAuthClaim; exports.registerAuthCommands = _chunkYYU3PYVKjs.registerAuthCommands; exports.reportSetupCompleted = _chunkYYU3PYVKjs.reportSetupCompleted; exports.resolvePendingAuthClaimForResume = _chunkYYU3PYVKjs.resolvePendingAuthClaimForResume;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  DeeplineClient,
3
3
  iterateCursorPages
4
- } from "./chunk-5OVNL6LS.mjs";
4
+ } from "./chunk-NWFE4PGX.mjs";
5
5
  import "./chunk-CBVIJSHF.mjs";
6
6
  import {
7
7
  createTimestampedName,
@@ -9,13 +9,13 @@ import {
9
9
  openInBrowser,
10
10
  printCommandEnvelope,
11
11
  shouldEmitJson
12
- } from "./chunk-SPUTBCUR.mjs";
12
+ } from "./chunk-ZH7KTVAB.mjs";
13
13
  import {
14
14
  AuthError,
15
15
  ConfigError
16
- } from "./chunk-Q3LYQTSO.mjs";
16
+ } from "./chunk-WPTUKXIF.mjs";
17
17
  import "./chunk-DLIRSHV6.mjs";
18
- import "./chunk-SGTSJCOA.mjs";
18
+ import "./chunk-AA66YTS7.mjs";
19
19
  import "./chunk-6IKARAYD.mjs";
20
20
  import {
21
21
  DeeplineError
@@ -1383,7 +1383,7 @@ Examples:
1383
1383
  deepline billing subscription status --json
1384
1384
 
1385
1385
  # Price a tool before execution; look up its exact charge afterward
1386
- deepline tools describe <tool-id> --pricing-only
1386
+ deepline describe <tool-id>
1387
1387
  deepline billing usage --request-id <job_id> --json
1388
1388
 
1389
1389
  # Buy credits or a plan