deepline 0.3.579 → 0.3.580

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 (169) hide show
  1. package/dist/bundling-sources/sdk/src/client-core.ts +13 -2
  2. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  3. package/dist/bundling-sources/shared_libs/monitors/billing/public-pricing.ts +470 -15
  4. package/dist/bundling-sources/shared_libs/monitors/billing/tamradar.ts +12 -0
  5. package/dist/bundling-sources/shared_libs/monitors/billing/types.ts +59 -0
  6. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-capability.ts +5 -3
  7. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +139 -16
  8. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +39 -2
  9. package/dist/cli/{agents-D5RZEVXQ.js → agents-BF5VX5ZB.js} +31 -31
  10. package/dist/cli/{agents-FJTRTYCL.mjs → agents-JRFTZE7G.mjs} +4 -4
  11. package/dist/cli/auth-25MVD7TK.js +44 -0
  12. package/dist/cli/{auth-OMYIDVXZ.mjs → auth-XJXZ64R4.mjs} +5 -5
  13. package/dist/cli/{billing-XK3LBNYS.mjs → billing-TXJBGP2I.mjs} +67 -64
  14. package/dist/cli/{billing-EWFUDLQ7.js → billing-VGMTJI7W.js} +156 -153
  15. package/dist/cli/{chunk-TVAFWAOQ.js → chunk-2ZCFAUCV.js} +3 -3
  16. package/dist/cli/{chunk-HEZW2IDK.js → chunk-3OSNEWGR.js} +279 -276
  17. package/dist/cli/{chunk-TFNDOH4W.mjs → chunk-3P4QZIJ5.mjs} +1 -1
  18. package/dist/cli/{chunk-QA55PGJH.js → chunk-3S5KFHQH.js} +7 -7
  19. package/dist/cli/{chunk-6DMGKAWO.mjs → chunk-3ZBPXNSW.mjs} +2 -2
  20. package/dist/cli/{chunk-27ZYRIQC.mjs → chunk-5BPJW6X5.mjs} +5 -5
  21. package/dist/cli/{chunk-6MIEJJSO.js → chunk-6VSUP4WN.js} +4 -4
  22. package/dist/cli/{chunk-6GON36H3.mjs → chunk-7HOG3JZE.mjs} +17 -14
  23. package/dist/cli/{chunk-JFS4KHA3.mjs → chunk-7ORX33JX.mjs} +5 -5
  24. package/dist/cli/{chunk-NWZU6HL4.js → chunk-ANX3PYLT.js} +13 -13
  25. package/dist/cli/{chunk-FKXSIIR4.js → chunk-APJ7IPRT.js} +15 -15
  26. package/dist/cli/{chunk-44NTNNKC.js → chunk-AZTQJJH7.js} +6 -0
  27. package/dist/cli/{chunk-WQQQP3FH.mjs → chunk-BAXLPQTM.mjs} +4 -4
  28. package/dist/cli/{chunk-M4YWN5BT.mjs → chunk-BK4Z62CF.mjs} +4 -4
  29. package/dist/cli/{chunk-KQAEXBVQ.mjs → chunk-C6YXUGX2.mjs} +3 -3
  30. package/dist/cli/{chunk-PLWZ3NB7.js → chunk-COAAKSFX.js} +5 -5
  31. package/dist/cli/{chunk-LCPJR3IY.js → chunk-D6I7QWOZ.js} +2 -2
  32. package/dist/cli/{chunk-LQ45LCH7.js → chunk-DQEHBAHL.js} +9 -9
  33. package/dist/cli/{chunk-6EVVUVU3.mjs → chunk-EI7KTESB.mjs} +2 -2
  34. package/dist/cli/{chunk-F57NDSKT.mjs → chunk-FCJJPEKN.mjs} +5 -5
  35. package/dist/cli/{chunk-7JMCRYXU.js → chunk-GDBNH57Z.js} +10 -10
  36. package/dist/cli/{chunk-NONMY5CY.mjs → chunk-GE4ZEMMA.mjs} +2 -2
  37. package/dist/cli/{chunk-6NYHMXC7.mjs → chunk-GIZIWNL5.mjs} +1 -1
  38. package/dist/cli/{chunk-SZIWFQI2.mjs → chunk-H3B6QM6V.mjs} +3 -3
  39. package/dist/cli/{chunk-NKUXW4WB.js → chunk-HEZ24K5F.js} +2 -2
  40. package/dist/cli/{chunk-LV2LGW2Q.mjs → chunk-HLMF53HZ.mjs} +1 -1
  41. package/dist/cli/{chunk-S2OXA7QS.mjs → chunk-IERWFFDB.mjs} +7 -7
  42. package/dist/cli/{chunk-I2TSRLOI.mjs → chunk-IG3CXIJY.mjs} +1 -1
  43. package/dist/cli/{chunk-OSRATALX.mjs → chunk-IM322G7M.mjs} +1 -1
  44. package/dist/cli/{chunk-VFIIRK7S.mjs → chunk-KLBIHDZB.mjs} +2 -2
  45. package/dist/cli/{chunk-N6X2UKYQ.mjs → chunk-LC4ETCOA.mjs} +2 -2
  46. package/dist/cli/{chunk-G5CZDRY3.js → chunk-LHV3HPAY.js} +26 -26
  47. package/dist/cli/{chunk-NOMO5GPI.js → chunk-MBOPKQJF.js} +1 -1
  48. package/dist/cli/{chunk-BLEYV4BJ.js → chunk-MCYZO3RB.js} +21 -21
  49. package/dist/cli/{chunk-X6LPC3SU.mjs → chunk-MEDA3STC.mjs} +1 -1
  50. package/dist/cli/{chunk-PGRRMVQ5.js → chunk-MOZDEYQC.js} +2 -1
  51. package/dist/cli/{chunk-XQYBBCFI.mjs → chunk-MP6XUVAJ.mjs} +2 -2
  52. package/dist/cli/{chunk-OOGP737I.js → chunk-NNWEQDZR.js} +20 -20
  53. package/dist/cli/{chunk-HGUFTSB5.mjs → chunk-NV5IJ3NY.mjs} +6 -0
  54. package/dist/cli/{chunk-LYBZLA6F.mjs → chunk-O7AWGIDD.mjs} +2 -2
  55. package/dist/cli/{chunk-WWSGXX6U.js → chunk-PFNYLTCZ.js} +5 -5
  56. package/dist/cli/{chunk-BZ4M7OFO.mjs → chunk-QXQBTTRD.mjs} +1 -1
  57. package/dist/cli/{chunk-XTM6NOJ6.js → chunk-R77IVVEZ.js} +53 -53
  58. package/dist/cli/{chunk-Q4VKMF3B.js → chunk-S2YKIWCD.js} +17 -17
  59. package/dist/cli/{chunk-DTQBQSUU.mjs → chunk-SECFDB27.mjs} +1 -0
  60. package/dist/cli/{chunk-KIIOKQFY.mjs → chunk-SQBSK74D.mjs} +7 -3
  61. package/dist/cli/{chunk-AP7PIGL5.js → chunk-TSOXJZSW.js} +41 -41
  62. package/dist/cli/{chunk-YCWRKSLB.mjs → chunk-U4VCAECC.mjs} +2 -2
  63. package/dist/cli/{chunk-KWQHQG53.js → chunk-URZPR54R.js} +6 -6
  64. package/dist/cli/{chunk-ABH6PUDZ.js → chunk-V5NDHTBB.js} +23 -23
  65. package/dist/cli/{chunk-SUHCW7U5.mjs → chunk-VF3EGTHU.mjs} +3 -3
  66. package/dist/cli/{chunk-DH736ASH.js → chunk-VOQWPUIF.js} +20 -20
  67. package/dist/cli/{chunk-7HOYKXVY.js → chunk-WJUAVMQC.js} +217 -213
  68. package/dist/cli/{chunk-3Z4TVZE7.mjs → chunk-X5RXG6VS.mjs} +1 -1
  69. package/dist/cli/{chunk-UYCBG75H.js → chunk-XFVJ3JNA.js} +5 -5
  70. package/dist/cli/{chunk-LYJ2NSHD.js → chunk-XQUVLYOL.js} +13 -13
  71. package/dist/cli/{chunk-K2BU67UC.js → chunk-YY6EB252.js} +2 -2
  72. package/dist/cli/{chunk-Y2ND6PPW.js → chunk-Z6DERGHY.js} +48 -48
  73. package/dist/cli/{chunk-72TWLORR.js → chunk-ZADJC22U.js} +3 -3
  74. package/dist/cli/{chunk-7SZCJC4R.mjs → chunk-ZR7PDXIA.mjs} +2 -2
  75. package/dist/cli/command-docs.js +2 -2
  76. package/dist/cli/command-docs.mjs +1 -1
  77. package/dist/cli/concurrent-runs-help-DEN63DUM.js +22 -0
  78. package/dist/cli/{concurrent-runs-help-IQBZBTD5.mjs → concurrent-runs-help-DSUQRWZQ.mjs} +6 -6
  79. package/dist/cli/{csv-T7TWLIGD.js → csv-HSHF6JYZ.js} +13 -13
  80. package/dist/cli/{csv-6BEOWTGM.mjs → csv-QNXJBT5T.mjs} +4 -4
  81. package/dist/cli/{db-FA5QGXZ7.mjs → db-RAWY3SWS.mjs} +6 -6
  82. package/dist/cli/{db-MFTUN3DF.js → db-VHYWVLLU.js} +27 -27
  83. package/dist/cli/{describe-TITEQNVE.mjs → describe-WZOVHWAM.mjs} +21 -21
  84. package/dist/cli/describe-YHZ2EGBQ.js +50 -0
  85. package/dist/cli/describe-core.d.mts +2 -2
  86. package/dist/cli/describe-core.d.ts +2 -2
  87. package/dist/cli/describe-core.js +4 -4
  88. package/dist/cli/describe-core.mjs +3 -3
  89. package/dist/cli/{executions-QW3L7G7J.js → executions-DQIFH4Z6.js} +8 -8
  90. package/dist/cli/{executions-DMYJJIRB.mjs → executions-QABOXV4K.mjs} +6 -6
  91. package/dist/cli/{feedback-6JZGE7OQ.js → feedback-6IER2W4G.js} +14 -14
  92. package/dist/cli/{feedback-WPSNSFRC.mjs → feedback-DW4O63DG.mjs} +6 -6
  93. package/dist/cli/{git-GO65XRM3.mjs → git-3NAPGZGR.mjs} +5 -5
  94. package/dist/cli/git-SQ2MAKAH.js +26 -0
  95. package/dist/cli/index.js +148 -148
  96. package/dist/cli/index.mjs +47 -47
  97. package/dist/cli/{integrations-T5JPSZXN.js → integrations-5LHIBBXB.js} +29 -29
  98. package/dist/cli/{integrations-EEBPETH2.mjs → integrations-TSRUTENK.mjs} +7 -7
  99. package/dist/cli/{legacy-noops-XDNZ46IR.mjs → legacy-noops-4N63A6H7.mjs} +6 -6
  100. package/dist/cli/{legacy-noops-B55OMNH7.js → legacy-noops-S22XGYGN.js} +9 -9
  101. package/dist/cli/{mcp-4QIUAAWS.mjs → mcp-4EJHRRFV.mjs} +4 -4
  102. package/dist/cli/{mcp-3YA333TQ.js → mcp-JERBGJYE.js} +24 -24
  103. package/dist/cli/{monitors-BVUPS4CE.mjs → monitors-7BTLBD6S.mjs} +16 -11
  104. package/dist/cli/{monitors-FOS7MWZO.js → monitors-FF35CGC4.js} +109 -104
  105. package/dist/cli/{org-CYM7HFLN.js → org-ADCDO7KU.js} +121 -121
  106. package/dist/cli/{org-TCMRRVFC.mjs → org-QYIIBKA2.mjs} +6 -6
  107. package/dist/cli/{outcomes-VDJVP5YC.js → outcomes-2LW4GK2L.js} +14 -14
  108. package/dist/cli/{outcomes-2JSWXWQ3.mjs → outcomes-C5DIBG4Q.mjs} +6 -6
  109. package/dist/cli/{play-CPP4EBYF.mjs → play-DTTDTISL.mjs} +20 -20
  110. package/dist/cli/{play-U3G73VIR.js → play-S5MZ2GRA.js} +349 -349
  111. package/dist/cli/{providers-RVMIX5ED.mjs → providers-AXOEFQ6Q.mjs} +6 -6
  112. package/dist/cli/{providers-2ZB67TK7.js → providers-N2IWEJBW.js} +9 -9
  113. package/dist/cli/{quickstart-L3YO3OWZ.mjs → quickstart-ADWSZBV6.mjs} +4 -4
  114. package/dist/cli/{quickstart-V3Y7XZ47.js → quickstart-UC5AJZWU.js} +6 -6
  115. package/dist/cli/{run-M2CADJ6E.js → run-6TDYUL7L.js} +48 -48
  116. package/dist/cli/{run-PQ3Z2GOF.mjs → run-R2FVH3K6.mjs} +26 -26
  117. package/dist/cli/{search-QVLGI7SZ.mjs → search-GRHUFSLY.mjs} +7 -7
  118. package/dist/cli/search-V7ANBX3J.js +32 -0
  119. package/dist/cli/{search-output-IUANVHWU.js → search-output-O7NY3VMD.js} +8 -8
  120. package/dist/cli/{search-output-PN3V7MSO.mjs → search-output-UPQNAFAF.mjs} +5 -5
  121. package/dist/cli/{secrets-AOW6F67J.js → secrets-72GJHFER.js} +15 -15
  122. package/dist/cli/{secrets-HK25G4K2.mjs → secrets-NKAEJLIQ.mjs} +6 -6
  123. package/dist/cli/sessions-EO6RTMUC.js +23 -0
  124. package/dist/cli/{sessions-YN2OIAGR.mjs → sessions-VIMF3UF5.mjs} +6 -6
  125. package/dist/cli/{settings-6EV2FPGF.js → settings-HFAW5HIF.js} +85 -85
  126. package/dist/cli/{settings-7UW5TWSM.mjs → settings-KCQHBFNZ.mjs} +12 -12
  127. package/dist/cli/{setup-ZQPD2R5K.js → setup-2MHWGEAD.js} +49 -49
  128. package/dist/cli/{setup-BG56SHKH.mjs → setup-2ZD5ZIUH.mjs} +9 -9
  129. package/dist/cli/skills-ID6KKDLH.js +37 -0
  130. package/dist/cli/{skills-MQV2TNUZ.mjs → skills-X2DZZG5P.mjs} +7 -7
  131. package/dist/cli/tools-7UY7GERW.js +57 -0
  132. package/dist/cli/{tools-RGI4OE5T.mjs → tools-KPTOWKD4.mjs} +19 -19
  133. package/dist/cli/{update-SQKGHQKF.mjs → update-6PMQCEUP.mjs} +9 -9
  134. package/dist/cli/update-T2RDLLSY.js +37 -0
  135. package/dist/cli/{views-BUKVHCRD.js → views-MNBHNO6C.js} +37 -24
  136. package/dist/cli/{views-734T2CXF.mjs → views-VRZ5CTFL.mjs} +21 -8
  137. package/dist/cli/{workflow-JNRRBMEK.mjs → workflow-7JUJWA5S.mjs} +7 -7
  138. package/dist/cli/{workflow-LPJC6RHP.js → workflow-SSMFO7YE.js} +17 -17
  139. package/dist/{client-CNYctEBh.d.mts → client-CmG8MT0x.d.mts} +1 -1
  140. package/dist/{client-C1AubrWJ.d.ts → client-QznpkWrk.d.ts} +1 -1
  141. package/dist/{client-core-D6zAE46g.d.ts → client-core-CXDqfeiB.d.ts} +5 -1
  142. package/dist/{client-core-Bb06TCx5.d.mts → client-core-CY0jNW0e.d.mts} +5 -1
  143. package/dist/index.d.mts +3 -3
  144. package/dist/index.d.ts +3 -3
  145. package/dist/index.js +9 -9
  146. package/dist/index.mjs +6 -6
  147. package/dist/install-integrity.json +126 -126
  148. package/dist/plays/play-description.d.mts +1 -1
  149. package/dist/plays/play-description.d.ts +1 -1
  150. package/dist/plays/run-request.d.mts +1 -1
  151. package/dist/plays/run-request.d.ts +1 -1
  152. package/dist/release.d.mts +1 -1
  153. package/dist/release.d.ts +1 -1
  154. package/dist/release.js +2 -2
  155. package/dist/release.mjs +1 -1
  156. package/dist/server.d.mts +2 -2
  157. package/dist/server.d.ts +2 -2
  158. package/dist/server.js +5 -5
  159. package/dist/server.mjs +3 -3
  160. package/package.json +1 -1
  161. package/dist/cli/auth-Q4O7MJU4.js +0 -44
  162. package/dist/cli/concurrent-runs-help-D6XH3FY5.js +0 -22
  163. package/dist/cli/describe-TYZ5YH3V.js +0 -50
  164. package/dist/cli/git-UGGRLGTQ.js +0 -26
  165. package/dist/cli/search-RHPPZZFG.js +0 -32
  166. package/dist/cli/sessions-AEGGTZ3K.js +0 -23
  167. package/dist/cli/skills-C6ZEZWBE.js +0 -37
  168. package/dist/cli/tools-PM3MC3RR.js +0 -57
  169. package/dist/cli/update-ZHUPF2HT.js +0 -37
@@ -23953,15 +23953,15 @@ function runLedgerDiscoveryHeadsSql(
23953
23953
  )`;
23954
23954
  }
23955
23955
 
23956
- function runLedgerReadyHeadSql(
23956
+ /** Whether another delivery currently leases this run's lane. */
23957
+ function runLedgerRunLeasedSql(
23958
+ runIdSql: string,
23957
23959
  options: Pick<PostgresSchedulerOptions, 'schema'> | undefined,
23958
23960
  searchOnly: boolean,
23959
23961
  ): string {
23960
- return `head.failed_at IS NULL
23961
- AND coalesce(head.next_attempt_at, head.created_at) <= now()
23962
- AND NOT EXISTS (
23962
+ return `EXISTS (
23963
23963
  SELECT 1 FROM ${tableName('outbox', options)} AS active
23964
- WHERE active.run_id = runs.run_id
23964
+ WHERE active.run_id = ${runIdSql}
23965
23965
  AND ${searchLaneSql('active')} = ${String(searchOnly)}
23966
23966
  AND active.delivered_at IS NULL
23967
23967
  AND active.lease_owner IS NOT NULL
@@ -23969,7 +23969,52 @@ function runLedgerReadyHeadSql(
23969
23969
  )`;
23970
23970
  }
23971
23971
 
23972
- function runLedgerAdmissionOrderSql(
23972
+ function runLedgerReadyHeadSql(
23973
+ options: Pick<PostgresSchedulerOptions, 'schema'> | undefined,
23974
+ searchOnly: boolean,
23975
+ /** A lease already computed for this head (`head_workspace_share.leased`). */
23976
+ leasedSql?: string,
23977
+ ): string {
23978
+ return `head.failed_at IS NULL
23979
+ AND coalesce(head.next_attempt_at, head.created_at) <= now()
23980
+ AND NOT ${leasedSql ?? runLedgerRunLeasedSql('runs.run_id', options, searchOnly)}`;
23981
+ }
23982
+
23983
+ /**
23984
+ * Workspace fair share for global claims and admission hints. Each discovered
23985
+ * head belongs to a run; a run leased by an in-flight delivery still has its
23986
+ * head pending. The count of such leased heads per workspace is that
23987
+ * workspace's current share of the drain. Ordering ready heads by it gives
23988
+ * the next free slot to the workspace with the fewest deliveries in flight,
23989
+ * so one workspace's backlog cannot delay every other workspace's projection
23990
+ * (Production 2026-12-01 06:09-06:51Z). It is work-conserving: a lone
23991
+ * backlogged workspace still receives every free slot. Admission class still
23992
+ * comes first and age orders heads within an equal share. Each head's lease
23993
+ * is read once here and reused by the ready filter. Window functions cannot
23994
+ * share a query level with FOR UPDATE, so the share is materialized beside
23995
+ * the heads.
23996
+ */
23997
+ function runLedgerWorkspaceShareSql(
23998
+ options: Pick<PostgresSchedulerOptions, 'schema'> | undefined,
23999
+ searchOnly: boolean,
24000
+ ): string {
24001
+ return `head_workspace_share AS MATERIALIZED (
24002
+ SELECT leased_head.run_id,
24003
+ leased_head.leased,
24004
+ count(*) FILTER (WHERE leased_head.leased)
24005
+ OVER (PARTITION BY leased_head.org_id) AS workspace_in_flight
24006
+ FROM (
24007
+ SELECT head.run_id,
24008
+ share_run.org_id,
24009
+ ${runLedgerRunLeasedSql('head.run_id', options, searchOnly)} AS leased
24010
+ FROM heads AS head
24011
+ JOIN ${tableName('runs', options)} AS share_run
24012
+ ON share_run.run_id = head.run_id
24013
+ ) AS leased_head
24014
+ )`;
24015
+ }
24016
+
24017
+ function runLedgerAdmissionClassSql(
23973
24018
  options: Pick<PostgresSchedulerOptions, 'schema'> | undefined,
23974
24019
  searchOnly: boolean,
23975
24020
  ): string {
@@ -23978,7 +24023,14 @@ function runLedgerAdmissionOrderSql(
23978
24023
  WHEN ${runLedgerTerminalPendingSql('head', options)} THEN 1
23979
24024
  ${searchOnly ? '' : `WHEN ${runLedgerWaitingPendingSql('head', options)} THEN 2`}
23980
24025
  ELSE 3
23981
- END,`;
24026
+ END`;
24027
+ }
24028
+
24029
+ function runLedgerAdmissionOrderSql(
24030
+ options: Pick<PostgresSchedulerOptions, 'schema'> | undefined,
24031
+ searchOnly: boolean,
24032
+ ): string {
24033
+ return `${runLedgerAdmissionClassSql(options, searchOnly)},`;
23982
24034
  }
23983
24035
 
23984
24036
  export type RunLedgerOutboxAdmissionHint = {
@@ -24009,13 +24061,23 @@ export async function readPostgresSchedulerOutboxAdmissionHints(
24009
24061
  );
24010
24062
  const result = await client.query<{ run_id: string }>(
24011
24063
  `
24012
- ${runLedgerDiscoveryHeadsSql(options, false)}
24064
+ ${runLedgerDiscoveryHeadsSql(options, false)},
24065
+ ${runLedgerWorkspaceShareSql(options, false)}
24013
24066
  SELECT runs.run_id
24014
24067
  FROM heads AS head
24068
+ JOIN head_workspace_share AS share ON share.run_id = head.run_id
24015
24069
  JOIN ${tableName('runs', options)} AS runs ON runs.run_id = head.run_id
24016
- WHERE ${runLedgerReadyHeadSql(options, false)}
24070
+ WHERE ${runLedgerReadyHeadSql(options, false, 'share.leased')}
24017
24071
  AND NOT (runs.run_id = ANY($2::text[]))
24018
- ORDER BY ${runLedgerAdmissionOrderSql(options, false)} head.created_at, runs.run_id
24072
+ -- These hints fill up to three slots before any is claimed. A head's
24073
+ -- rank within its workspace and class counts as in flight, so one batch
24074
+ -- interleaves workspaces instead of taking one workspace's oldest heads.
24075
+ ORDER BY ${runLedgerAdmissionOrderSql(options, false)}
24076
+ share.workspace_in_flight + row_number() OVER (
24077
+ PARTITION BY runs.org_id, ${runLedgerAdmissionClassSql(options, false)}
24078
+ ORDER BY head.created_at, runs.run_id
24079
+ ),
24080
+ head.created_at, runs.run_id
24019
24081
  LIMIT $1
24020
24082
  `,
24021
24083
  [input.limit, input.excludeRunIds],
@@ -25573,6 +25635,63 @@ export async function readPostgresSchedulerOutboxOldestPendingSeconds(
25573
25635
  return Number.isFinite(value) ? Math.max(0, Math.floor(value)) : 0;
25574
25636
  }
25575
25637
 
25638
+ export type PostgresSchedulerOutboxBacklogOwner = {
25639
+ orgId: string;
25640
+ /** Runs with an undelivered lifecycle head. */
25641
+ pendingRuns: number;
25642
+ /** Of those, runs a delivery currently leases: the workspace's drain share. */
25643
+ inFlightRuns: number;
25644
+ oldestHeadSeconds: number;
25645
+ };
25646
+
25647
+ /**
25648
+ * Name the workspaces holding a lifecycle backlog, largest first. This reuses
25649
+ * the global claim's own head discovery (one indexed seek per pending run), so
25650
+ * it costs one claim's discovery. The projector reads it only from its periodic
25651
+ * drain probe while the oldest pending fact is already old, never per scrape.
25652
+ */
25653
+ export async function readPostgresSchedulerOutboxBacklogOwners(
25654
+ client: PostgresSchedulerQueryClient,
25655
+ input: { limit: number },
25656
+ options?: Pick<PostgresSchedulerOptions, 'schema'>,
25657
+ ): Promise<PostgresSchedulerOutboxBacklogOwner[]> {
25658
+ const limit = Math.max(1, Math.min(10, Math.floor(input.limit)));
25659
+ if (!(await runLedgerOutboxLaneHasPending(client, options, false))) return [];
25660
+ const result = await client.query<{
25661
+ org_id: string;
25662
+ pending_runs: number | string;
25663
+ in_flight_runs: number | string;
25664
+ oldest_head_seconds: number | string | null;
25665
+ }>(
25666
+ `
25667
+ ${runLedgerDiscoveryHeadsSql(options, false)}
25668
+ SELECT owner_run.org_id,
25669
+ count(*) AS pending_runs,
25670
+ count(*) FILTER (
25671
+ WHERE ${runLedgerRunLeasedSql('head.run_id', options, false)}
25672
+ ) AS in_flight_runs,
25673
+ extract(epoch FROM greatest(now() - min(head.created_at), interval '0 seconds')) AS oldest_head_seconds
25674
+ FROM heads AS head
25675
+ JOIN ${tableName('runs', options)} AS owner_run
25676
+ ON owner_run.run_id = head.run_id
25677
+ WHERE head.failed_at IS NULL
25678
+ GROUP BY owner_run.org_id
25679
+ ORDER BY count(*) DESC, min(head.created_at), owner_run.org_id
25680
+ LIMIT $1
25681
+ `,
25682
+ [limit],
25683
+ );
25684
+ return result.rows.map((row) => ({
25685
+ orgId: row.org_id,
25686
+ pendingRuns: Number(row.pending_runs),
25687
+ inFlightRuns: Number(row.in_flight_runs),
25688
+ oldestHeadSeconds: Math.max(
25689
+ 0,
25690
+ Math.floor(Number(row.oldest_head_seconds ?? 0)),
25691
+ ),
25692
+ }));
25693
+ }
25694
+
25576
25695
  /**
25577
25696
  * Read failed projection work separately from the retryable pending head.
25578
25697
  * This is intentionally a bounded operator signal: failed facts require an
@@ -27562,21 +27681,25 @@ async function dispatchRunLedgerOutboxBatchWithScope(
27562
27681
  dispatch_launch_json: unknown;
27563
27682
  transport_head?: RunLedgerTransportCandidate | null;
27564
27683
  }>(`
27565
- ${runLedgerDiscoveryHeadsSql(options, input.searchOnly === true, needsLaunch)}
27684
+ ${runLedgerDiscoveryHeadsSql(options, input.searchOnly === true, needsLaunch)},
27685
+ ${runLedgerWorkspaceShareSql(options, input.searchOnly === true)}
27566
27686
  SELECT runs.run_id, ${launchSelection} AS dispatch_launch_json, ${transportHeadSelection} AS transport_head
27567
27687
  FROM heads AS head
27688
+ JOIN head_workspace_share AS share ON share.run_id = head.run_id
27568
27689
  JOIN ${tableName('runs', options)} AS runs ON runs.run_id = head.run_id
27569
- WHERE ${runLedgerReadyHeadSql(options, input.searchOnly === true)}
27690
+ WHERE ${runLedgerReadyHeadSql(options, input.searchOnly === true, 'share.leased')}
27570
27691
  -- admission_first: admission, then the causal head of a run with
27571
- -- a pending terminal or public wait, then FIFO progress. oldest_ready keeps its
27572
- -- pure age order so continuous admissions/terminals cannot starve
27573
- -- ordinary progress.
27692
+ -- a pending terminal or public wait, then FIFO progress.
27693
+ -- oldest_ready ignores admission class so continuous
27694
+ -- admissions/terminals cannot starve ordinary progress. Within
27695
+ -- either order, the workspace with the fewest in-flight
27696
+ -- deliveries claims first, then the oldest head.
27574
27697
  ORDER BY ${
27575
27698
  input.headPriority === 'oldest_ready'
27576
27699
  ? ''
27577
27700
  : runLedgerAdmissionOrderSql(options, input.searchOnly === true)
27578
27701
  }
27579
- head.created_at, runs.run_id
27702
+ share.workspace_in_flight, head.created_at, runs.run_id
27580
27703
  FOR UPDATE OF runs SKIP LOCKED LIMIT 1
27581
27704
  `)));
27582
27705
  };
@@ -90,8 +90,9 @@ const RUN_LEDGER_OUTBOX_RECOVERY_PREVIEW_IN_FLIGHT = 16;
90
90
  // it the same total bounded search-index capacity.
91
91
  const RUN_LEDGER_OUTBOX_RECOVERY_PRODUCTION_INDEX_IN_FLIGHT = 4;
92
92
  const RUN_LEDGER_OUTBOX_RECOVERY_PREVIEW_INDEX_IN_FLIGHT = 8;
93
- // Admissions retain three of four claim opportunities. The fourth selects
94
- // the oldest eligible causal head across all runs, preventing terminal work
93
+ // Admissions retain three of four claim opportunities. The fourth ignores
94
+ // admission class and selects the oldest eligible causal head of the
95
+ // workspace with the fewest in-flight deliveries, preventing terminal work
95
96
  // from starving behind continuous new admissions. An empty class never costs
96
97
  // another query: either order can select any eligible run.
97
98
  const ADMISSION_TURNS_PER_OLDEST_READY_TURN = 3;
@@ -181,11 +182,23 @@ export type RunLedgerOutboxRecoveryController = {
181
182
  close: () => Promise<void>;
182
183
  };
183
184
 
185
+ export type RunLedgerOutboxDrainSlots = {
186
+ inFlight: number;
187
+ /** This replica's fixed delivery budget for the lane. */
188
+ parallelism: number;
189
+ };
190
+
184
191
  export type RunLedgerOutboxDrainHealth = {
185
192
  inFlightDispatches: number;
186
193
  /** Start of the oldest dispatch still in flight, or null when idle. */
187
194
  oldestInFlightStartedAt: number | null;
188
195
  lastDispatchSettledAt: number | null;
196
+ /** In-flight deliveries against each lane's budget: a full lane is a
197
+ * saturated drain, distinguishing a capacity backlog from slow delivery. */
198
+ slots: {
199
+ lifecycle: RunLedgerOutboxDrainSlots;
200
+ observability: RunLedgerOutboxDrainSlots;
201
+ };
189
202
  };
190
203
 
191
204
  function boundedFailureDelayMs(failures: number): number {
@@ -309,6 +322,7 @@ export function startRunLedgerOutboxRecovery(
309
322
  return runId;
310
323
  };
311
324
  const inFlightStartedAt = new Map<number, number>();
325
+ const inFlightByLane = { lifecycle: 0, observability: 0 };
312
326
  let nextDispatchId = 0;
313
327
  let lastDispatchSettledAt: number | null = null;
314
328
  let admissionTurns = 0;
@@ -329,7 +343,9 @@ export function startRunLedgerOutboxRecovery(
329
343
  if (!observability && origin !== 'producer_hint')
330
344
  admissionTurns = oldestReady ? 0 : admissionTurns + 1;
331
345
  const id = nextDispatchId++;
346
+ const lane = observability ? 'observability' : 'lifecycle';
332
347
  inFlightStartedAt.set(id, now());
348
+ inFlightByLane[lane] += 1;
333
349
  try {
334
350
  if (observability)
335
351
  return await (runId === undefined
@@ -341,6 +357,7 @@ export function startRunLedgerOutboxRecovery(
341
357
  : deps.dispatchOnce(headPriority, runId));
342
358
  } finally {
343
359
  inFlightStartedAt.delete(id);
360
+ inFlightByLane[lane] -= 1;
344
361
  lastDispatchSettledAt = now();
345
362
  }
346
363
  };
@@ -935,6 +952,16 @@ export function startRunLedgerOutboxRecovery(
935
952
  inFlightDispatches: inFlightStartedAt.size,
936
953
  oldestInFlightStartedAt: oldest,
937
954
  lastDispatchSettledAt,
955
+ slots: {
956
+ lifecycle: {
957
+ inFlight: inFlightByLane.lifecycle,
958
+ parallelism: lifecycleParallelism,
959
+ },
960
+ observability: {
961
+ inFlight: inFlightByLane.observability,
962
+ parallelism: observabilityParallelism,
963
+ },
964
+ },
938
965
  };
939
966
  },
940
967
  close: async () => {
@@ -1388,6 +1415,16 @@ export function startBoundedRunLedgerOutboxRecovery(
1388
1415
  inFlightDispatches: inFlightStartedAt.size,
1389
1416
  oldestInFlightStartedAt: oldest,
1390
1417
  lastDispatchSettledAt,
1418
+ slots: {
1419
+ lifecycle: {
1420
+ inFlight: inFlight.lifecycle,
1421
+ parallelism: lifecycleParallelism,
1422
+ },
1423
+ observability: {
1424
+ inFlight: inFlight.observability,
1425
+ parallelism: observabilityParallelism,
1426
+ },
1427
+ },
1391
1428
  };
1392
1429
  },
1393
1430
  close: async () => {
@@ -1,18 +1,18 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2;
2
2
 
3
3
 
4
- var _chunkOOGP737Ijs = require('./chunk-OOGP737I.js');
4
+ var _chunkNNWEQDZRjs = require('./chunk-NNWEQDZR.js');
5
5
 
6
6
 
7
- var _chunkTVAFWAOQjs = require('./chunk-TVAFWAOQ.js');
8
- require('./chunk-6MIEJJSO.js');
7
+ var _chunk2ZCFAUCVjs = require('./chunk-2ZCFAUCV.js');
8
+ require('./chunk-6VSUP4WN.js');
9
9
  require('./chunk-6VLFQZK6.js');
10
10
  require('./chunk-XNYIZMNQ.js');
11
11
 
12
12
 
13
13
  var _chunkLFQJW4S2js = require('./chunk-LFQJW4S2.js');
14
14
  require('./chunk-CFJFUVX2.js');
15
- require('./chunk-NOMO5GPI.js');
15
+ require('./chunk-MBOPKQJF.js');
16
16
  require('./chunk-OG64RBAC.js');
17
17
  require('./chunk-COGTRVWW.js');
18
18
 
@@ -150,7 +150,7 @@ function describeOverview(overview) {
150
150
  ];
151
151
  }
152
152
  function print(payload, title, lines, options) {
153
- _chunkOOGP737Ijs.printCommandEnvelope.call(void 0,
153
+ _chunkNNWEQDZRjs.printCommandEnvelope.call(void 0,
154
154
  { ...payload, render: { sections: [{ title, lines }] } },
155
155
  { json: options.json }
156
156
  );
@@ -244,7 +244,7 @@ async function readModelKey() {
244
244
  return Buffer.concat(chunks).toString("utf8").trim();
245
245
  }
246
246
  async function sendTestMessage(input2) {
247
- const { http } = _chunkOOGP737Ijs.getAuthedHttpClient.call(void 0, );
247
+ const { http } = _chunkNNWEQDZRjs.getAuthedHttpClient.call(void 0, );
248
248
  return http.post(
249
249
  `${AGENT_PATH}/test`,
250
250
  {
@@ -335,7 +335,7 @@ async function handleChat(channelId, options) {
335
335
  threadId = reply.threadId;
336
336
  const text = describeReply(channelId, reply, true).map((line2) => `agent> ${line2}
337
337
  `).join("");
338
- _chunkOOGP737Ijs.printCommandEnvelope.call(void 0, reply, { json: false, text });
338
+ _chunkNNWEQDZRjs.printCommandEnvelope.call(void 0, reply, { json: false, text });
339
339
  }
340
340
  } finally {
341
341
  rl.close();
@@ -345,7 +345,7 @@ function registerWorkspaceCommands(agents, readKey) {
345
345
  agents.command("list").description(
346
346
  "Show whether agents are on, their model billing, every agent with its channels, and the skill library."
347
347
  ).option("--json", "Emit JSON output").action(async (options) => {
348
- const { http } = _chunkOOGP737Ijs.getAuthedHttpClient.call(void 0, );
348
+ const { http } = _chunkNNWEQDZRjs.getAuthedHttpClient.call(void 0, );
349
349
  const overview = await http.get(AGENT_PATH);
350
350
  print(overview, "deepline agents", describeOverview(overview), options);
351
351
  });
@@ -356,7 +356,7 @@ function registerWorkspaceCommands(agents, readKey) {
356
356
  printDryRun("POST", `${AGENT_PATH}/enable`, {}, options);
357
357
  return;
358
358
  }
359
- const { http } = _chunkOOGP737Ijs.getAuthedHttpClient.call(void 0, );
359
+ const { http } = _chunkNNWEQDZRjs.getAuthedHttpClient.call(void 0, );
360
360
  const result = await http.post(
361
361
  `${AGENT_PATH}/enable`,
362
362
  {}
@@ -378,7 +378,7 @@ function registerWorkspaceCommands(agents, readKey) {
378
378
  printDryRun("POST", `${AGENT_PATH}/disable`, {}, options);
379
379
  return;
380
380
  }
381
- const { http } = _chunkOOGP737Ijs.getAuthedHttpClient.call(void 0, );
381
+ const { http } = _chunkNNWEQDZRjs.getAuthedHttpClient.call(void 0, );
382
382
  const result = await http.post(
383
383
  `${AGENT_PATH}/disable`,
384
384
  {}
@@ -410,7 +410,7 @@ function registerWorkspaceCommands(agents, readKey) {
410
410
  }
411
411
  const apiKey = await readKey();
412
412
  if (!apiKey) throw new AgentUsageError("No key was given.");
413
- const { http } = _chunkOOGP737Ijs.getAuthedHttpClient.call(void 0, );
413
+ const { http } = _chunkNNWEQDZRjs.getAuthedHttpClient.call(void 0, );
414
414
  const overview = await http.put(`${AGENT_PATH}/billing`, {
415
415
  mode: "own_key",
416
416
  provider: _nullishCoalesce(options.provider, () => ( keyProvider(apiKey))),
@@ -422,7 +422,7 @@ function registerWorkspaceCommands(agents, readKey) {
422
422
  agents.command("models").description(
423
423
  "List the models an agent or one of its channels can run on, and which your workspace\u2019s key can run."
424
424
  ).option("--json", "Emit JSON output").action(async (options) => {
425
- const { http } = _chunkOOGP737Ijs.getAuthedHttpClient.call(void 0, );
425
+ const { http } = _chunkNNWEQDZRjs.getAuthedHttpClient.call(void 0, );
426
426
  const result = await http.get(
427
427
  `${AGENT_PATH}/models`
428
428
  );
@@ -446,7 +446,7 @@ function registerWorkspaceCommands(agents, readKey) {
446
446
  agents.command("outcomes").description(
447
447
  "List the outcomes Bot by Deepline owns by default (those with no home channel), with what woke it last on each."
448
448
  ).option("--json", "Emit JSON output").action(async (options) => {
449
- const { http } = _chunkOOGP737Ijs.getAuthedHttpClient.call(void 0, );
449
+ const { http } = _chunkNNWEQDZRjs.getAuthedHttpClient.call(void 0, );
450
450
  const result = await http.get(
451
451
  `${AGENT_PATH}/outcomes`
452
452
  );
@@ -466,7 +466,7 @@ function registerWorkspaceCommands(agents, readKey) {
466
466
  }
467
467
  function registerAgentCommands(agents) {
468
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) => {
469
- const { http } = _chunkOOGP737Ijs.getAuthedHttpClient.call(void 0, );
469
+ const { http } = _chunkNNWEQDZRjs.getAuthedHttpClient.call(void 0, );
470
470
  const result = await http.get(
471
471
  `${AGENT_PATH}/agents/${encodeURIComponent(requireArgument(name, "an agent name"))}`
472
472
  );
@@ -496,7 +496,7 @@ function registerAgentCommands(agents) {
496
496
  printDryRun("POST", `${AGENT_PATH}/agents`, body, options);
497
497
  return;
498
498
  }
499
- const { http } = _chunkOOGP737Ijs.getAuthedHttpClient.call(void 0, );
499
+ const { http } = _chunkNNWEQDZRjs.getAuthedHttpClient.call(void 0, );
500
500
  const result = await http.post(
501
501
  `${AGENT_PATH}/agents`,
502
502
  body
@@ -540,7 +540,7 @@ function registerAgentCommands(agents) {
540
540
  printDryRun("PATCH", path, body, options);
541
541
  return;
542
542
  }
543
- const { http } = _chunkOOGP737Ijs.getAuthedHttpClient.call(void 0, );
543
+ const { http } = _chunkNNWEQDZRjs.getAuthedHttpClient.call(void 0, );
544
544
  const result = await http.patch(path, body);
545
545
  print(result, "agent updated", describeAgent(result.agent), options);
546
546
  }
@@ -553,7 +553,7 @@ function registerAgentCommands(agents) {
553
553
  printDryRun("DELETE", path, null, options);
554
554
  return;
555
555
  }
556
- const { http } = _chunkOOGP737Ijs.getAuthedHttpClient.call(void 0, );
556
+ const { http } = _chunkNNWEQDZRjs.getAuthedHttpClient.call(void 0, );
557
557
  const result = await http.delete(path);
558
558
  print(
559
559
  result,
@@ -596,7 +596,7 @@ function registerChannelCommands(agents) {
596
596
  printDryRun("POST", `${AGENT_PATH}/channels`, body, options);
597
597
  return;
598
598
  }
599
- const { http } = _chunkOOGP737Ijs.getAuthedHttpClient.call(void 0, );
599
+ const { http } = _chunkNNWEQDZRjs.getAuthedHttpClient.call(void 0, );
600
600
  const result = await http.post(`${AGENT_PATH}/channels`, body);
601
601
  print(
602
602
  result,
@@ -648,7 +648,7 @@ function registerChannelCommands(agents) {
648
648
  printDryRun("PATCH", path, body, options);
649
649
  return;
650
650
  }
651
- const { http } = _chunkOOGP737Ijs.getAuthedHttpClient.call(void 0, );
651
+ const { http } = _chunkNNWEQDZRjs.getAuthedHttpClient.call(void 0, );
652
652
  const result = await http.patch(path, body);
653
653
  print(
654
654
  result,
@@ -676,7 +676,7 @@ function registerChannelCommands(agents) {
676
676
  printDryRun("DELETE", path, null, options);
677
677
  return;
678
678
  }
679
- const { http } = _chunkOOGP737Ijs.getAuthedHttpClient.call(void 0, );
679
+ const { http } = _chunkNNWEQDZRjs.getAuthedHttpClient.call(void 0, );
680
680
  const result = await http.delete(path);
681
681
  print(
682
682
  result,
@@ -712,7 +712,7 @@ function registerSlackCommands(agents) {
712
712
  slack.command("install").description(
713
713
  "Print a link that adds the agent to a Slack workspace (owners and admins). Open it, pick the Slack workspace and approve."
714
714
  ).option("--json", "Emit JSON output").action(async (options) => {
715
- const { http } = _chunkOOGP737Ijs.getAuthedHttpClient.call(void 0, );
715
+ const { http } = _chunkNNWEQDZRjs.getAuthedHttpClient.call(void 0, );
716
716
  const result = await http.post(
717
717
  `${AGENT_PATH}/slack/install`,
718
718
  {}
@@ -731,7 +731,7 @@ function registerSlackCommands(agents) {
731
731
  slack.command("link").description(
732
732
  "Say which Slack user you are, with the code from the link the agent showed you in Slack. Your clicks there (answering an ask, connecting a channel) are then made as you."
733
733
  ).argument("<code>", "The code from the link, or the whole link").option("--json", "Emit JSON output").action(async (code, options) => {
734
- const { http } = _chunkOOGP737Ijs.getAuthedHttpClient.call(void 0, );
734
+ const { http } = _chunkNNWEQDZRjs.getAuthedHttpClient.call(void 0, );
735
735
  const result = await http.post(`${AGENT_PATH}/slack/link`, { code: slackLinkCode(code) });
736
736
  print(
737
737
  result,
@@ -745,7 +745,7 @@ function registerSlackCommands(agents) {
745
745
  slack.command("unlink").description(
746
746
  "Forget which Slack user you are in this workspace. Your clicks in Slack decide nothing until you link again."
747
747
  ).option("--json", "Emit JSON output").action(async (options) => {
748
- const { http } = _chunkOOGP737Ijs.getAuthedHttpClient.call(void 0, );
748
+ const { http } = _chunkNNWEQDZRjs.getAuthedHttpClient.call(void 0, );
749
749
  const result = await http.delete(
750
750
  `${AGENT_PATH}/slack/link`
751
751
  );
@@ -761,7 +761,7 @@ function registerSlackCommands(agents) {
761
761
  slack.command("status").description(
762
762
  "List the Slack workspaces this workspace installed the agent in."
763
763
  ).option("--json", "Emit JSON output").action(async (options) => {
764
- const { http } = _chunkOOGP737Ijs.getAuthedHttpClient.call(void 0, );
764
+ const { http } = _chunkNNWEQDZRjs.getAuthedHttpClient.call(void 0, );
765
765
  const result = await http.get(
766
766
  `${AGENT_PATH}/slack/installations`
767
767
  );
@@ -780,7 +780,7 @@ function registerSkillCommands(agents) {
780
780
  "The workspace\u2019s skill library: markdown an agent loads when its description matches the task."
781
781
  );
782
782
  skills.command("get").description("Show one library skill with its markdown.").argument("<name>", "Skill name").option("--json", "Emit JSON output").action(async (name, options) => {
783
- const { http } = _chunkOOGP737Ijs.getAuthedHttpClient.call(void 0, );
783
+ const { http } = _chunkNNWEQDZRjs.getAuthedHttpClient.call(void 0, );
784
784
  const result = await http.get(
785
785
  `${AGENT_PATH}/skills/${encodeURIComponent(requireArgument(name, "a skill name"))}`
786
786
  );
@@ -818,7 +818,7 @@ function registerSkillCommands(agents) {
818
818
  printDryRun("PUT", path, body, options);
819
819
  return;
820
820
  }
821
- const { http } = _chunkOOGP737Ijs.getAuthedHttpClient.call(void 0, );
821
+ const { http } = _chunkNNWEQDZRjs.getAuthedHttpClient.call(void 0, );
822
822
  const result = await http.put(path, body);
823
823
  print(
824
824
  result,
@@ -841,7 +841,7 @@ function registerSkillCommands(agents) {
841
841
  printDryRun("DELETE", path, null, options);
842
842
  return;
843
843
  }
844
- const { http } = _chunkOOGP737Ijs.getAuthedHttpClient.call(void 0, );
844
+ const { http } = _chunkNNWEQDZRjs.getAuthedHttpClient.call(void 0, );
845
845
  const result = await http.delete(path);
846
846
  print(
847
847
  result,
@@ -895,7 +895,7 @@ function registerFeedbackCommand(agents) {
895
895
  params.set("cursor", requireArgument(options.cursor, "--cursor"));
896
896
  }
897
897
  const query = params.toString();
898
- const { http } = _chunkOOGP737Ijs.getAuthedHttpClient.call(void 0, );
898
+ const { http } = _chunkNNWEQDZRjs.getAuthedHttpClient.call(void 0, );
899
899
  const page = await http.get(
900
900
  `${AGENT_PATH}/feedback${query ? `?${query}` : ""}`
901
901
  ).catch((error) => {
@@ -958,7 +958,7 @@ function registerRepliesCommand(agents) {
958
958
  params.set("cursor", requireArgument(options.cursor, "--cursor"));
959
959
  }
960
960
  const query = params.toString();
961
- const { http } = _chunkOOGP737Ijs.getAuthedHttpClient.call(void 0, );
961
+ const { http } = _chunkNNWEQDZRjs.getAuthedHttpClient.call(void 0, );
962
962
  const page = await http.get(`${AGENT_PATH}/replies${query ? `?${query}` : ""}`).catch((error) => {
963
963
  if (error instanceof _chunkLFQJW4S2js.DeeplineError && error.code === REPLIES_INVALID_CURSOR) {
964
964
  throw new AgentUsageError(`--cursor: ${error.message}`);
@@ -984,13 +984,13 @@ function registerActivityCommand(agents) {
984
984
  agents.command("activity").description(
985
985
  "Sum each agent's replies over the last 7 days: how many, how they ended, median time, tokens and the last reply."
986
986
  ).option("--json", "Emit JSON output").action(async (options) => {
987
- const { http } = _chunkOOGP737Ijs.getAuthedHttpClient.call(void 0, );
987
+ const { http } = _chunkNNWEQDZRjs.getAuthedHttpClient.call(void 0, );
988
988
  const activity = await http.get(`${AGENT_PATH}/activity`);
989
989
  print(activity, "agent activity", describeActivity(activity), options);
990
990
  });
991
991
  }
992
992
  function registerAgentsCommands(program, readKey = readModelKey) {
993
- const agents = program.command("agents", { hidden: !_chunkTVAFWAOQjs.cliFeatureEnabled.call(void 0, AGENT_FEATURE) }).description(
993
+ const agents = program.command("agents", { hidden: !_chunk2ZCFAUCVjs.cliFeatureEnabled.call(void 0, AGENT_FEATURE) }).description(
994
994
  "Deepline agents in Slack: create agents with instructions and skills, bind channels to them, and talk to them."
995
995
  );
996
996
  registerWorkspaceCommands(agents, readKey);
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  getAuthedHttpClient,
3
3
  printCommandEnvelope
4
- } from "./chunk-6DMGKAWO.mjs";
4
+ } from "./chunk-3ZBPXNSW.mjs";
5
5
  import {
6
6
  cliFeatureEnabled
7
- } from "./chunk-3Z4TVZE7.mjs";
8
- import "./chunk-I2TSRLOI.mjs";
7
+ } from "./chunk-X5RXG6VS.mjs";
8
+ import "./chunk-IG3CXIJY.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-6NYHMXC7.mjs";
15
+ import "./chunk-GIZIWNL5.mjs";
16
16
  import "./chunk-WZYKRD7T.mjs";
17
17
  import "./chunk-KRD6H754.mjs";
18
18
 
@@ -0,0 +1,44 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+ var _chunkR77IVVEZjs = require('./chunk-R77IVVEZ.js');
18
+ require('./chunk-NNWEQDZR.js');
19
+ require('./chunk-2ZCFAUCV.js');
20
+ require('./chunk-6VSUP4WN.js');
21
+ require('./chunk-6VLFQZK6.js');
22
+ require('./chunk-XNYIZMNQ.js');
23
+ require('./chunk-LFQJW4S2.js');
24
+ require('./chunk-CFJFUVX2.js');
25
+ require('./chunk-MBOPKQJF.js');
26
+ require('./chunk-OG64RBAC.js');
27
+ require('./chunk-COGTRVWW.js');
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+ exports.EXIT_WORKSPACE_MISMATCH = _chunkR77IVVEZjs.EXIT_WORKSPACE_MISMATCH; exports.authStatusLine = _chunkR77IVVEZjs.authStatusLine; exports.clearPendingClaim = _chunkR77IVVEZjs.clearPendingClaim; exports.clearSatisfiedPendingClaim = _chunkR77IVVEZjs.clearSatisfiedPendingClaim; exports.handleRegister = _chunkR77IVVEZjs.handleRegister; exports.handleStatus = _chunkR77IVVEZjs.handleStatus; exports.handleWait = _chunkR77IVVEZjs.handleWait; exports.httpJson = _chunkR77IVVEZjs.httpJson; exports.readPendingAuthClaim = _chunkR77IVVEZjs.readPendingAuthClaim; exports.readStatusBanner = _chunkR77IVVEZjs.readStatusBanner; exports.registerAuthCommands = _chunkR77IVVEZjs.registerAuthCommands; exports.reportApprovalLinkShown = _chunkR77IVVEZjs.reportApprovalLinkShown; exports.reportSetupCompleted = _chunkR77IVVEZjs.reportSetupCompleted; exports.resolvePendingAuthClaimForResume = _chunkR77IVVEZjs.resolvePendingAuthClaimForResume; exports.statusBannerLine = _chunkR77IVVEZjs.statusBannerLine;
@@ -14,15 +14,15 @@ import {
14
14
  reportSetupCompleted,
15
15
  resolvePendingAuthClaimForResume,
16
16
  statusBannerLine
17
- } from "./chunk-SUHCW7U5.mjs";
18
- import "./chunk-6DMGKAWO.mjs";
19
- import "./chunk-3Z4TVZE7.mjs";
20
- import "./chunk-I2TSRLOI.mjs";
17
+ } from "./chunk-VF3EGTHU.mjs";
18
+ import "./chunk-3ZBPXNSW.mjs";
19
+ import "./chunk-X5RXG6VS.mjs";
20
+ import "./chunk-IG3CXIJY.mjs";
21
21
  import "./chunk-ASB47RXJ.mjs";
22
22
  import "./chunk-DLIRSHV6.mjs";
23
23
  import "./chunk-Z3A2S3QM.mjs";
24
24
  import "./chunk-2MGZAI54.mjs";
25
- import "./chunk-6NYHMXC7.mjs";
25
+ import "./chunk-GIZIWNL5.mjs";
26
26
  import "./chunk-WZYKRD7T.mjs";
27
27
  import "./chunk-KRD6H754.mjs";
28
28
  export {