deepline 0.3.314 → 0.3.315

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 (103) hide show
  1. package/dist/bundling-sources/sdk/src/client.ts +12 -0
  2. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  3. package/dist/bundling-sources/sdk/src/types.ts +10 -0
  4. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +28 -0
  5. package/dist/bundling-sources/shared_libs/plays/docflow-binding-owner.ts +61 -11
  6. package/dist/cli/{auth-GWF55S3N.mjs → auth-OVWOO5NP.mjs} +4 -4
  7. package/dist/cli/auth-P2TTZU36.js +31 -0
  8. package/dist/cli/{billing-2YU6E2IF.js → billing-SRZL7UOH.js} +70 -70
  9. package/dist/cli/{billing-WWOJN7GV.mjs → billing-W3OXKWNE.mjs} +4 -4
  10. package/dist/cli/{chunk-VFRZG4OW.js → chunk-6BJACIVK.js} +1 -1
  11. package/dist/cli/{chunk-CPN2N6EZ.mjs → chunk-AO4IWPP7.mjs} +32 -8
  12. package/dist/cli/{chunk-25SPKKF2.mjs → chunk-AZWQJAQF.mjs} +1 -1
  13. package/dist/cli/{chunk-3CKNUJVZ.mjs → chunk-B473QUQU.mjs} +4 -4
  14. package/dist/cli/{chunk-ENQZV7NR.js → chunk-C5WSTXUB.js} +246 -222
  15. package/dist/cli/{chunk-YVMJTXEG.js → chunk-FGAK6FET.js} +26 -26
  16. package/dist/cli/{chunk-DR3S76BG.mjs → chunk-FTJQO757.mjs} +1 -1
  17. package/dist/cli/{chunk-JZZT4GAY.mjs → chunk-GK67FYMS.mjs} +5 -5
  18. package/dist/cli/{chunk-QB5MAFCU.mjs → chunk-HNKHMHJ7.mjs} +1 -1
  19. package/dist/cli/{chunk-IZTIBG7A.mjs → chunk-IGE7EJJY.mjs} +11 -1
  20. package/dist/cli/{chunk-3K6QD7Z3.mjs → chunk-JF4O5OMH.mjs} +1 -1
  21. package/dist/cli/{chunk-WTO3ITBC.mjs → chunk-L5TSFCJ6.mjs} +2 -2
  22. package/dist/cli/{chunk-JNUHGWB2.js → chunk-LOWURQMF.js} +50 -50
  23. package/dist/cli/{chunk-WDPRE6DU.js → chunk-OJP4FCCX.js} +48 -48
  24. package/dist/cli/{chunk-HTXZLCSP.mjs → chunk-OUIIYFG3.mjs} +2 -2
  25. package/dist/cli/{chunk-GSRDZD7R.js → chunk-OYJCNCUW.js} +2 -2
  26. package/dist/cli/{chunk-VBRO5QCI.js → chunk-PPONZ6IE.js} +15 -15
  27. package/dist/cli/{chunk-3A4LJUX6.mjs → chunk-R3IFZDJL.mjs} +2 -2
  28. package/dist/cli/{chunk-NG4WDOGN.js → chunk-SNFSO2AN.js} +6 -6
  29. package/dist/cli/{chunk-2Q2IKUL5.mjs → chunk-TQ3F77AC.mjs} +3 -3
  30. package/dist/cli/{chunk-VWW6VHQX.js → chunk-TQK662WG.js} +60 -60
  31. package/dist/cli/{chunk-OUHCJL5B.mjs → chunk-TZ5KUDPP.mjs} +1 -1
  32. package/dist/cli/{chunk-B5LUKLKH.js → chunk-URVZGYGG.js} +4 -4
  33. package/dist/cli/{chunk-MLEJ2FYH.js → chunk-VYK23G2C.js} +119 -109
  34. package/dist/cli/{chunk-ODEWOXWW.js → chunk-Y42UERUY.js} +6 -6
  35. package/dist/cli/{chunk-UZTTPEG2.js → chunk-YL42TF53.js} +6 -6
  36. package/dist/cli/client-CXFPFCIG.js +20 -0
  37. package/dist/cli/{client-EYGNDORT.mjs → client-WQ3J5BSH.mjs} +3 -3
  38. package/dist/cli/{csv-NZCN7SVV.mjs → csv-36ARCBNQ.mjs} +3 -3
  39. package/dist/cli/{csv-YOW5JMOH.js → csv-CENMEWDH.js} +12 -12
  40. package/dist/cli/{db-6BIYLZ6F.js → db-6DQZG6NB.js} +20 -20
  41. package/dist/cli/{db-HALJV3KY.mjs → db-JU7XLKQM.mjs} +4 -4
  42. package/dist/cli/{describe-KY2ZYGBR.mjs → describe-34ALEEFO.mjs} +8 -8
  43. package/dist/cli/{describe-WA6R2JSH.js → describe-VUD4AFBY.js} +15 -15
  44. package/dist/cli/{executions-NMCTN7XM.js → executions-H2UXS6FP.js} +6 -6
  45. package/dist/cli/{executions-CBOAN6KI.mjs → executions-H66BMN6N.mjs} +4 -4
  46. package/dist/cli/{feedback-FOMPE3DJ.mjs → feedback-Q7LXXLSH.mjs} +3 -3
  47. package/dist/cli/{feedback-ZZFDSCWS.js → feedback-YSYFQSAB.js} +6 -6
  48. package/dist/cli/git-SYFCYIFP.js +23 -0
  49. package/dist/cli/{git-YQR2NBCO.mjs → git-XV43NSWN.mjs} +4 -4
  50. package/dist/cli/index.js +74 -74
  51. package/dist/cli/index.mjs +31 -31
  52. package/dist/cli/{legacy-noops-XH2TFFI6.js → legacy-noops-RGDW6SCA.js} +7 -7
  53. package/dist/cli/{legacy-noops-KMU6P3K4.mjs → legacy-noops-Z2DTZQN3.mjs} +4 -4
  54. package/dist/cli/{monitors-5M3BZ5OR.js → monitors-I75KZ2BP.js} +85 -85
  55. package/dist/cli/{monitors-2ONK5L3I.mjs → monitors-OFQ56O4S.mjs} +4 -4
  56. package/dist/cli/{org-6MKULUZI.js → org-75AH6RIB.js} +60 -60
  57. package/dist/cli/{org-LR5BMCGL.mjs → org-ZYMCU6XO.mjs} +4 -4
  58. package/dist/cli/{play-4NOSD7DW.mjs → play-BKXM76DV.mjs} +7 -7
  59. package/dist/cli/play-OKXUWPMO.js +152 -0
  60. package/dist/cli/{providers-UBGIKGCA.mjs → providers-GWG2WFIY.mjs} +4 -4
  61. package/dist/cli/{providers-UFJD3VKF.js → providers-Z77MM7ID.js} +7 -7
  62. package/dist/cli/{quickstart-KDUKQRUH.mjs → quickstart-BGVIV374.mjs} +3 -3
  63. package/dist/cli/{quickstart-KQZHZE6C.js → quickstart-I4RECIQC.js} +5 -5
  64. package/dist/cli/search-3KISUDDT.js +26 -0
  65. package/dist/cli/{search-4BVOOS5Q.mjs → search-TIKBP3RE.mjs} +5 -5
  66. package/dist/cli/{secrets-TVXZ3WJ3.js → secrets-SNGRI4KS.js} +13 -13
  67. package/dist/cli/{secrets-YGV23N3N.mjs → secrets-YCHKLWKC.mjs} +4 -4
  68. package/dist/cli/{sessions-G7ROUW35.mjs → sessions-IRDG6ZRX.mjs} +4 -4
  69. package/dist/cli/{sessions-RWIQWDFD.js → sessions-WXLADGDX.js} +5 -5
  70. package/dist/cli/{settings-TG3E2NR7.js → settings-72J4BVF6.js} +74 -74
  71. package/dist/cli/{settings-QZEVGCXE.mjs → settings-KZALJDXW.mjs} +7 -7
  72. package/dist/cli/{setup-HUXINKOH.mjs → setup-4KCA7ESV.mjs} +6 -6
  73. package/dist/cli/{setup-3KDUNEEE.js → setup-FFB3KLFD.js} +41 -41
  74. package/dist/cli/{skills-LHU3DB7J.mjs → skills-MQZPYUQ3.mjs} +4 -4
  75. package/dist/cli/skills-XGOK4GRW.js +28 -0
  76. package/dist/cli/tools-LEAJ7EPW.js +38 -0
  77. package/dist/cli/{tools-J5WQ33BB.mjs → tools-M3WKRZ5T.mjs} +6 -6
  78. package/dist/cli/{update-T6744RM7.mjs → update-QJMNYGNF.mjs} +6 -6
  79. package/dist/cli/update-ZN6LDUHS.js +28 -0
  80. package/dist/cli/{workflow-YF5SQJLG.js → workflow-35UUOZ5E.js} +15 -15
  81. package/dist/cli/{workflow-CG2B65HD.mjs → workflow-6T2EUFCN.mjs} +5 -5
  82. package/dist/{client-CtVdLZux.d.mts → client-CvpZsBqt.d.mts} +12 -0
  83. package/dist/{client-OBwghxPC.d.ts → client-Dh_4Ph1R.d.ts} +12 -0
  84. package/dist/index.d.mts +2 -2
  85. package/dist/index.d.ts +2 -2
  86. package/dist/index.js +6 -6
  87. package/dist/index.mjs +3 -3
  88. package/dist/install-integrity.json +76 -76
  89. package/dist/plays/run-request.d.mts +1 -1
  90. package/dist/plays/run-request.d.ts +1 -1
  91. package/dist/release.d.mts +1 -1
  92. package/dist/release.d.ts +1 -1
  93. package/dist/release.js +2 -2
  94. package/dist/release.mjs +1 -1
  95. package/package.json +1 -1
  96. package/dist/cli/auth-QX2L4LPM.js +0 -31
  97. package/dist/cli/client-Z4VFNTUB.js +0 -20
  98. package/dist/cli/git-AC2ATBDK.js +0 -23
  99. package/dist/cli/play-U3CZ4F2W.js +0 -152
  100. package/dist/cli/search-Y7OTFRCI.js +0 -26
  101. package/dist/cli/skills-CO5YUWBK.js +0 -28
  102. package/dist/cli/tools-MWPT5X47.js +0 -38
  103. package/dist/cli/update-VVIJW7ZJ.js +0 -28
@@ -654,6 +654,8 @@ function searchParams(options: ToolSearchOptions): URLSearchParams {
654
654
  export type RunsListOptions = {
655
655
  play?: string;
656
656
  status?: string;
657
+ /** Mermaid node id; returns that node's latest settled input/output per run. Requires play. */
658
+ node?: string;
657
659
  limit?: number;
658
660
  /** Zero-based page offset. Requires `play` because status-only inventory is not paginated. */
659
661
  offset?: number;
@@ -4599,6 +4601,16 @@ export class DeeplineClient {
4599
4601
  if (status) {
4600
4602
  params.set('status', status);
4601
4603
  }
4604
+ const node = options.node?.trim();
4605
+ if (node) {
4606
+ if (!playName)
4607
+ throw new Error('runs.list options.node requires options.play.');
4608
+ if (node.length > 300)
4609
+ throw new Error(
4610
+ 'runs.list options.node must be at most 300 characters.',
4611
+ );
4612
+ params.set('node', node);
4613
+ }
4602
4614
  if (typeof options.limit === 'number' && Number.isFinite(options.limit)) {
4603
4615
  params.set('limit', String(Math.max(1, Math.floor(options.limit))));
4604
4616
  }
@@ -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.314',
203
+ version: '0.3.315',
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: {
@@ -1314,6 +1314,16 @@ export interface PlayRunListItem {
1314
1314
  billingTotalCredits?: number;
1315
1315
  /** Configured per-run Deepline credit cap, when available. */
1316
1316
  billingMaxCreditsPerRun?: number | null;
1317
+ /** Latest settled Mermaid-node invocation when `runs.list` is filtered by `node`. */
1318
+ nodeObservation?: {
1319
+ attempt: number;
1320
+ status: 'completed' | 'failed';
1321
+ inputs: Record<string, unknown> | null;
1322
+ outputs: Record<string, unknown> | null;
1323
+ error: string | null;
1324
+ inputsTruncated: boolean;
1325
+ outputsTruncated: boolean;
1326
+ } | null;
1317
1327
  /** Metadata attached to the workflow. */
1318
1328
  memo: {
1319
1329
  /** Organization that owns this run. */
@@ -15682,6 +15682,34 @@ export async function getPostgresSchedulerObservations(
15682
15682
  return result.rows.map(mapObservationRow);
15683
15683
  }
15684
15684
 
15685
+ /** Read the newest settled observation for one node across a bounded page of runs. */
15686
+ export async function getPostgresSchedulerObservationsForRuns(
15687
+ client: PostgresSchedulerQueryClient,
15688
+ input: { runIds: readonly string[]; nodeId: string },
15689
+ options: PostgresSchedulerReceiptOptions,
15690
+ ): Promise<DocflowObservationRecord[]> {
15691
+ const runIds = [
15692
+ ...new Set(input.runIds.map((runId) => runId.trim()).filter(Boolean)),
15693
+ ];
15694
+ if (runIds.length === 0) return [];
15695
+ const result = await client.query<ObservationRow>(
15696
+ `
15697
+ SELECT DISTINCT ON (run_id)
15698
+ run_id, attempt, node_id, invocation_seq, invocation_id, status,
15699
+ inputs_json, outputs_json, inputs_truncated, outputs_truncated,
15700
+ error, started_at, settled_at
15701
+ FROM ${tableName('observations', options)}
15702
+ WHERE org_id = $1
15703
+ AND run_id = ANY($2::text[])
15704
+ AND node_id = $3
15705
+ AND status IN ('completed', 'failed')
15706
+ ORDER BY run_id, attempt DESC, invocation_seq DESC
15707
+ `,
15708
+ [receiptOrgId(options), runIds, input.nodeId],
15709
+ );
15710
+ return result.rows.map(mapObservationRow);
15711
+ }
15712
+
15685
15713
  export async function countPostgresSchedulerReceipts(
15686
15714
  client: PostgresSchedulerQueryClient,
15687
15715
  input: {
@@ -239,9 +239,9 @@ function callSiteExtent(substep: PlayStaticSubstep): DocflowLineExtent | null {
239
239
  * An annotation written in the ENTRY file keeps the existing behavior exactly:
240
240
  * whatever the resolver prefers, no path check. An annotation written in an
241
241
  * imported module is only comparable to a range from that same module — two
242
- * files both have a line 42 — so it picks the substep's own range or its call
243
- * site, whichever was recorded in the annotation's file, and matches nothing
244
- * when neither was.
242
+ * files both have a line 42. Owner extents union only the children in that
243
+ * file, while own-call extents stay local. A call reached through another
244
+ * function remains bounded by its matching caller range.
245
245
  */
246
246
  function extentForBinding(
247
247
  substep: PlayStaticSubstep,
@@ -249,11 +249,34 @@ function extentForBinding(
249
249
  extentOf: DocflowExtentResolver,
250
250
  ): DocflowLineExtent | null {
251
251
  if (!binding.sourcePath) return extentOf(substep);
252
- for (const range of [substep.sourceRange, substep.callSiteRange]) {
253
- if (range?.sourcePath !== binding.sourcePath) continue;
254
- return { startLine: range.startLine, endLine: range.endLine };
252
+ const sourcePath = binding.sourcePath;
253
+ const caller = substep.callSiteRange;
254
+ if (caller?.sourcePath === sourcePath)
255
+ return { startLine: caller.startLine, endLine: caller.endLine };
256
+ if (extentOf !== substepSourceExtent) {
257
+ const own = substep.sourceRange;
258
+ return own?.sourcePath === sourcePath
259
+ ? { startLine: own.startLine, endLine: own.endLine }
260
+ : null;
255
261
  }
256
- return null;
262
+ const ranges: PlayStaticSourceRange[] = [];
263
+ const collect = (candidate: PlayStaticSubstep) => {
264
+ if (candidate.callSiteRange?.sourcePath === sourcePath) {
265
+ ranges.push(candidate.callSiteRange);
266
+ return;
267
+ }
268
+ if (candidate.sourceRange?.sourcePath === sourcePath)
269
+ ranges.push(candidate.sourceRange);
270
+ const nested = (candidate as { steps?: PlayStaticSubstep[] }).steps;
271
+ if (Array.isArray(nested)) for (const step of nested) collect(step);
272
+ };
273
+ collect(substep);
274
+ return ranges.length > 0
275
+ ? {
276
+ startLine: Math.min(...ranges.map((range) => range.startLine)),
277
+ endLine: Math.max(...ranges.map((range) => range.endLine)),
278
+ }
279
+ : null;
257
280
  }
258
281
 
259
282
  function extentContainsLine(
@@ -268,7 +291,10 @@ function extentContainsLine(
268
291
  : null;
269
292
  }
270
293
 
271
- /** Smallest containing extent wins, so a nested construct beats its parent. */
294
+ /**
295
+ * Smallest containing extent wins, so a nested construct beats its parent.
296
+ * Equal extents in a named file cannot distinguish two imported callers.
297
+ */
272
298
  function smallestContaining<TSubstep extends PlayStaticSubstep>(
273
299
  candidates: readonly TSubstep[],
274
300
  binding: PlayDocflowBinding,
@@ -276,6 +302,7 @@ function smallestContaining<TSubstep extends PlayStaticSubstep>(
276
302
  ): TSubstep | null {
277
303
  let best: TSubstep | null = null;
278
304
  let bestSpan = Number.POSITIVE_INFINITY;
305
+ let tied = false;
279
306
  for (const candidate of candidates) {
280
307
  const extent = extentContainsLine(candidate, binding, extentOf);
281
308
  if (!extent) continue;
@@ -283,9 +310,17 @@ function smallestContaining<TSubstep extends PlayStaticSubstep>(
283
310
  if (span < bestSpan) {
284
311
  best = candidate;
285
312
  bestSpan = span;
313
+ tied = false;
314
+ } else if (
315
+ binding.sourcePath &&
316
+ span === bestSpan &&
317
+ best &&
318
+ substepIdentity(candidate) !== substepIdentity(best)
319
+ ) {
320
+ tied = true;
286
321
  }
287
322
  }
288
- return best;
323
+ return tied ? null : best;
289
324
  }
290
325
 
291
326
  /**
@@ -416,7 +451,7 @@ export function docflowBoundToolSubsteps(
416
451
  const roots = docflowOutputRoots(binding);
417
452
  if (roots.length === 0) return [];
418
453
  const matched: DocflowToolSubstep[] = [];
419
- const seen = new Set<string>();
454
+ const seen = new Set<string | DocflowToolSubstep>();
420
455
  // Callers hand over whatever shape they hold — the config model passes the
421
456
  // top-level stages, whose tools sit several levels down inside step suites
422
457
  // and control flow. Flatten here so the answer never depends on that.
@@ -430,7 +465,7 @@ export function docflowBoundToolSubsteps(
430
465
  );
431
466
  if (!paths.includes(binding.sourcePath)) continue;
432
467
  }
433
- const identity = `${substep.toolId}::${substep.paramsSource ?? ''}`;
468
+ const identity = docflowToolCallIdentity(substep) ?? substep;
434
469
  if (seen.has(identity)) continue;
435
470
  seen.add(identity);
436
471
  matched.push(substep);
@@ -438,6 +473,21 @@ export function docflowBoundToolSubsteps(
438
473
  return matched;
439
474
  }
440
475
 
476
+ /** A retained call site, including its imported declaration and caller. */
477
+ export function docflowToolCallIdentity(
478
+ substep: DocflowToolSubstep,
479
+ ): string | null {
480
+ if (!substep.sourceRange && !substep.callSiteRange) return null;
481
+ return JSON.stringify([
482
+ substep.field,
483
+ substep.sourceRange,
484
+ substep.callSiteRange,
485
+ substep.toolId,
486
+ substep.paramsSource,
487
+ substep.inputPrelude,
488
+ ]);
489
+ }
490
+
441
491
  /**
442
492
  * The `ctx.runPlay` or `ctx.runPlayAsync` call a `type:"play"` docflow node
443
493
  * names. Same join as every other binding — symbol first, extent as the fallback
@@ -9,11 +9,11 @@ import {
9
9
  registerAuthCommands,
10
10
  reportSetupCompleted,
11
11
  resolvePendingAuthClaimForResume
12
- } from "./chunk-HTXZLCSP.mjs";
13
- import "./chunk-QB5MAFCU.mjs";
14
- import "./chunk-25SPKKF2.mjs";
12
+ } from "./chunk-OUIIYFG3.mjs";
13
+ import "./chunk-HNKHMHJ7.mjs";
14
+ import "./chunk-AZWQJAQF.mjs";
15
15
  import "./chunk-DLIRSHV6.mjs";
16
- import "./chunk-3K6QD7Z3.mjs";
16
+ import "./chunk-JF4O5OMH.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 _chunkOJP4FCCXjs = require('./chunk-OJP4FCCX.js');
13
+ require('./chunk-Y42UERUY.js');
14
+ require('./chunk-URVZGYGG.js');
15
+ require('./chunk-XNYIZMNQ.js');
16
+ require('./chunk-6BJACIVK.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 = _chunkOJP4FCCXjs.EXIT_WORKSPACE_MISMATCH; exports.clearPendingClaim = _chunkOJP4FCCXjs.clearPendingClaim; exports.clearSatisfiedPendingClaim = _chunkOJP4FCCXjs.clearSatisfiedPendingClaim; exports.handleRegister = _chunkOJP4FCCXjs.handleRegister; exports.handleStatus = _chunkOJP4FCCXjs.handleStatus; exports.handleWait = _chunkOJP4FCCXjs.handleWait; exports.readPendingAuthClaim = _chunkOJP4FCCXjs.readPendingAuthClaim; exports.registerAuthCommands = _chunkOJP4FCCXjs.registerAuthCommands; exports.reportSetupCompleted = _chunkOJP4FCCXjs.reportSetupCompleted; exports.resolvePendingAuthClaimForResume = _chunkOJP4FCCXjs.resolvePendingAuthClaimForResume;