deepline 0.3.422 → 0.3.424

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 (156) hide show
  1. package/dist/bundling-sources/sdk/src/client.ts +15 -8
  2. package/dist/bundling-sources/sdk/src/index.ts +2 -0
  3. package/dist/bundling-sources/sdk/src/play.ts +227 -184
  4. package/dist/bundling-sources/sdk/src/plays/local-file-discovery.ts +9 -2
  5. package/dist/bundling-sources/sdk/src/plays/local-play-execution.ts +1 -1
  6. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  7. package/dist/bundling-sources/sdk/src/tool-calls.ts +3 -1
  8. package/dist/bundling-sources/sdk/src/types.ts +5 -5
  9. package/dist/bundling-sources/shared_libs/monitors/fleets/verdict.ts +11 -1
  10. package/dist/bundling-sources/shared_libs/monitors/inventory-reconciliation.ts +38 -4
  11. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-batch-operation.ts +12 -0
  12. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-control-plane-capability.ts +25 -0
  13. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-errors.ts +10 -0
  14. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-identity-claims.ts +201 -0
  15. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-state.ts +42 -5
  16. package/dist/bundling-sources/shared_libs/monitors/provider-webhook-monitor-runtime.ts +5 -0
  17. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +37 -36
  18. package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +179 -38
  19. package/dist/bundling-sources/shared_libs/plays/dataset.ts +2 -2
  20. package/dist/bundling-sources/shared_libs/plays/docflow.ts +4 -0
  21. package/dist/bundling-sources/shared_libs/plays/fetch-http-error.ts +1 -1
  22. package/dist/bundling-sources/shared_libs/plays/local-file-discovery.ts +12 -4
  23. package/dist/bundling-sources/shared_libs/plays/play-exports.ts +27 -5
  24. package/dist/bundling-sources/shared_libs/plays/script-entry.ts +992 -0
  25. package/dist/bundling-sources/shared_libs/plays/source-authoring-edition.ts +63 -0
  26. package/dist/bundling-sources/shared_libs/plays/tool-result-types.ts +8 -4
  27. package/dist/bundling-sources/shared_libs/plays/ts-ast.ts +2 -0
  28. package/dist/cli/auth-MN7MWTFR.js +40 -0
  29. package/dist/cli/{auth-DMLBSXLV.mjs → auth-QITAQMHF.mjs} +4 -4
  30. package/dist/cli/{billing-IFGFPGJV.js → billing-N5AOFDSU.js} +73 -73
  31. package/dist/cli/{billing-SEXKROBQ.mjs → billing-UX2GH5L2.mjs} +4 -4
  32. package/dist/cli/{chunk-BL3LY54Y.js → chunk-22XGRO2M.js} +8 -8
  33. package/dist/cli/{chunk-AARWVK4C.mjs → chunk-2BQUML3X.mjs} +792 -69
  34. package/dist/cli/{chunk-ERFN2QY4.mjs → chunk-3DNKFH2G.mjs} +1 -1
  35. package/dist/cli/{chunk-QNBHQM5R.mjs → chunk-3FQUUVN2.mjs} +1 -1
  36. package/dist/cli/{chunk-4CAVSRQH.mjs → chunk-3O7KATMQ.mjs} +1 -1
  37. package/dist/cli/{chunk-S4KGXRCV.js → chunk-3VB5DQ7Y.js} +20 -20
  38. package/dist/cli/{chunk-VT6WJ26Y.mjs → chunk-5MD5I4MM.mjs} +1 -1
  39. package/dist/cli/{chunk-W74RDGRL.mjs → chunk-5OBCPN2C.mjs} +2 -2
  40. package/dist/cli/{chunk-LXRDHISW.js → chunk-5YLEB4CL.js} +8 -8
  41. package/dist/cli/{chunk-2JKQORUX.mjs → chunk-7KNBC4RJ.mjs} +2 -2
  42. package/dist/cli/{chunk-MLP4CAY7.mjs → chunk-7VC7STG5.mjs} +4 -4
  43. package/dist/cli/{chunk-KBJP3UAU.js → chunk-7W4N6VRE.js} +35 -35
  44. package/dist/cli/{chunk-3CE3WGKP.mjs → chunk-7Y5M5YE3.mjs} +2 -2
  45. package/dist/cli/{chunk-V4RAH5D6.js → chunk-CJD5QKYK.js} +26 -26
  46. package/dist/cli/{chunk-AYM2KZN3.js → chunk-DD6MM6WX.js} +6 -6
  47. package/dist/cli/{chunk-63ILLN5H.mjs → chunk-DS7Y7X26.mjs} +2 -2
  48. package/dist/cli/{chunk-CTNA5QY2.mjs → chunk-EER67G2B.mjs} +43 -28
  49. package/dist/cli/{chunk-OZHPZCAU.js → chunk-F3MMA7JY.js} +52 -52
  50. package/dist/cli/{chunk-CO3VMH33.mjs → chunk-FJ5U2IZY.mjs} +28 -27
  51. package/dist/cli/{chunk-27GJKC5Q.js → chunk-GXOQRZXG.js} +2 -2
  52. package/dist/cli/{chunk-AXDEH2AM.mjs → chunk-HBW6PEVG.mjs} +2 -2
  53. package/dist/cli/{chunk-PKBPSMOT.js → chunk-INFLI36H.js} +43 -28
  54. package/dist/cli/{chunk-4PG4ARL2.mjs → chunk-KPKU53YO.mjs} +1 -1
  55. package/dist/cli/{chunk-2LVM22ZU.js → chunk-LSZZVHQP.js} +2 -2
  56. package/dist/cli/{chunk-IMZ56EOH.mjs → chunk-LXTSVUZN.mjs} +2 -2
  57. package/dist/cli/{chunk-WGO2DY4L.js → chunk-M2VXDQI2.js} +11 -11
  58. package/dist/cli/{chunk-7OJEYJ6G.mjs → chunk-M67UCQKW.mjs} +3 -3
  59. package/dist/cli/{chunk-KXPIFC5S.mjs → chunk-MFXQVT7P.mjs} +3 -3
  60. package/dist/cli/{chunk-IHG7UAHD.mjs → chunk-MLJBCS3E.mjs} +32 -13
  61. package/dist/cli/{chunk-4EV2FKBI.js → chunk-OSNDC3VF.js} +16 -16
  62. package/dist/cli/{chunk-PXO253DP.mjs → chunk-OWWFCA7A.mjs} +1 -1
  63. package/dist/cli/{chunk-VRI3ABTK.js → chunk-PNGJIAJ3.js} +50 -50
  64. package/dist/cli/{chunk-HCYNAIHZ.js → chunk-QP5ATTMC.js} +4 -4
  65. package/dist/cli/{chunk-GEJDBXXM.js → chunk-QWRHGGUH.js} +1 -1
  66. package/dist/cli/{chunk-AD47BXN2.js → chunk-R2QWSSAG.js} +8 -8
  67. package/dist/cli/{chunk-QADCFSGH.js → chunk-RDIN3NKA.js} +17 -17
  68. package/dist/cli/{chunk-JRSULUPQ.js → chunk-RISEING7.js} +2 -2
  69. package/dist/cli/{chunk-M6SXXFMT.mjs → chunk-UOZCQPD4.mjs} +2 -2
  70. package/dist/cli/{chunk-TP26TAAF.mjs → chunk-UPH6UNUI.mjs} +1 -1
  71. package/dist/cli/{chunk-UQQRMCOL.js → chunk-UTF57UBW.js} +6 -6
  72. package/dist/cli/{chunk-FEKJENBB.mjs → chunk-VC5NKF4B.mjs} +3 -3
  73. package/dist/cli/{chunk-BQR6UN3C.js → chunk-VUYUI35Q.js} +32 -13
  74. package/dist/cli/{chunk-WP7T4BPE.js → chunk-YA3LMTLU.js} +1 -1
  75. package/dist/cli/{chunk-OQQOXSYA.js → chunk-YHRS6XTB.js} +845 -122
  76. package/dist/cli/{chunk-K4X472AT.js → chunk-YMASNIC5.js} +260 -259
  77. package/dist/cli/{chunk-SDCIROIS.mjs → chunk-ZMU2DDID.mjs} +5 -5
  78. package/dist/cli/command-docs.js +2 -2
  79. package/dist/cli/command-docs.mjs +1 -1
  80. package/dist/cli/{csv-J7UVP4KB.mjs → csv-NM5IHLVM.mjs} +3 -3
  81. package/dist/cli/{csv-Y4YWZSLB.js → csv-RL53NPRV.js} +12 -12
  82. package/dist/cli/{db-CQ6NHMLG.mjs → db-FZTIS4QG.mjs} +5 -5
  83. package/dist/cli/{db-SVFCM6YZ.js → db-RJCFUM2J.js} +26 -26
  84. package/dist/cli/{describe-FSDW6LTN.js → describe-A2MGAI3Y.js} +24 -24
  85. package/dist/cli/{describe-Y65BU7ZY.mjs → describe-T77IEILZ.mjs} +16 -16
  86. package/dist/cli/describe-core.d.mts +2 -2
  87. package/dist/cli/describe-core.d.ts +2 -2
  88. package/dist/cli/describe-core.js +4 -4
  89. package/dist/cli/describe-core.mjs +3 -3
  90. package/dist/cli/{executions-IW762OIJ.mjs → executions-AMQK53QX.mjs} +4 -4
  91. package/dist/cli/{executions-SJIKBRHT.js → executions-R6UPRZ5N.js} +6 -6
  92. package/dist/cli/{feedback-VMJIWAMT.mjs → feedback-BA5ZHVCZ.mjs} +3 -3
  93. package/dist/cli/{feedback-RCYSUOB3.js → feedback-JFT536KI.js} +7 -7
  94. package/dist/cli/{git-Q2WY3K6X.mjs → git-5ONARXFO.mjs} +4 -4
  95. package/dist/cli/git-NHQR3NKF.js +24 -0
  96. package/dist/cli/index.js +135 -135
  97. package/dist/cli/index.mjs +37 -37
  98. package/dist/cli/{legacy-noops-JVEE2VHK.mjs → legacy-noops-7J4K6QUX.mjs} +4 -4
  99. package/dist/cli/{legacy-noops-U4YPPYXU.js → legacy-noops-WT7M7WYD.js} +7 -7
  100. package/dist/cli/{monitors-AY4KQRTC.mjs → monitors-N3WDXW7H.mjs} +19 -13
  101. package/dist/cli/{monitors-BMAOQ37R.js → monitors-YH6PKEIW.js} +99 -93
  102. package/dist/cli/{org-ME4X6HWH.mjs → org-2V5ELSYS.mjs} +4 -4
  103. package/dist/cli/{org-G5IURX74.js → org-KGYHMT5P.js} +64 -64
  104. package/dist/cli/{play-X5GSZOKZ.js → play-2JOQQRZI.js} +606 -567
  105. package/dist/cli/{play-WLYU7WQL.mjs → play-CL2LCBAF.mjs} +113 -74
  106. package/dist/cli/{providers-2LBMNB7B.mjs → providers-I7EEPWNW.mjs} +4 -4
  107. package/dist/cli/{providers-AHEUVD3R.js → providers-VIP6MCWC.js} +7 -7
  108. package/dist/cli/{quickstart-DP2SKLIG.js → quickstart-33WC2KWE.js} +5 -5
  109. package/dist/cli/{quickstart-DBLYGHJP.mjs → quickstart-VRBKQODE.mjs} +3 -3
  110. package/dist/cli/{search-YKJHY3ZJ.mjs → search-7TDSKXOO.mjs} +5 -5
  111. package/dist/cli/search-A6RZZ4LK.js +30 -0
  112. package/dist/cli/{secrets-ECLARBO6.mjs → secrets-DGLCIN7Y.mjs} +4 -4
  113. package/dist/cli/{secrets-2P3I3OEZ.js → secrets-TQH5FXAC.js} +13 -13
  114. package/dist/cli/{sessions-MC4ZCTSN.js → sessions-4D4UDPIS.js} +5 -5
  115. package/dist/cli/{sessions-3GDFID7R.mjs → sessions-D6QGKQ2G.mjs} +4 -4
  116. package/dist/cli/{settings-RTPJXMOA.mjs → settings-6HVXBCVR.mjs} +8 -8
  117. package/dist/cli/{settings-7SVR2OVL.js → settings-V3QRG4AO.js} +75 -75
  118. package/dist/cli/{setup-4WLIJX36.js → setup-6WP7D5I3.js} +42 -42
  119. package/dist/cli/{setup-OKAZZGAW.mjs → setup-CSJ3HSL7.mjs} +7 -7
  120. package/dist/cli/{skills-2CVL6RG5.mjs → skills-2MTWP4PS.mjs} +5 -5
  121. package/dist/cli/skills-QOYOARZT.js +29 -0
  122. package/dist/cli/{tools-KAFHP6J4.mjs → tools-GAR3BWB6.mjs} +15 -15
  123. package/dist/cli/tools-MGEKAIOU.js +44 -0
  124. package/dist/cli/update-HMZCLFLZ.js +31 -0
  125. package/dist/cli/{update-3ZV3W7I4.mjs → update-XV3WV3MU.mjs} +7 -7
  126. package/dist/cli/{workflow-DKSUNZXE.mjs → workflow-DTZAWSB2.mjs} +9 -9
  127. package/dist/cli/{workflow-GULDFFP3.js → workflow-WNE7ORMT.js} +19 -19
  128. package/dist/{client-CCWIUnk7.d.mts → client-BcfFWD4Z.d.mts} +19 -15
  129. package/dist/{client-vHqBm-OL.d.ts → client-DH-fmT69.d.ts} +19 -15
  130. package/dist/{compiler-manifest-lzWpbV3w.d.mts → compiler-manifest-DaFuA1ki.d.mts} +35 -32
  131. package/dist/{compiler-manifest-lzWpbV3w.d.ts → compiler-manifest-DaFuA1ki.d.ts} +35 -32
  132. package/dist/{index-CtNK-0nI.d.mts → index-0yS9ihly.d.mts} +10 -3
  133. package/dist/{index-C8Cy-YTm.d.ts → index-CRAScKPg.d.ts} +10 -3
  134. package/dist/index.d.mts +120 -150
  135. package/dist/index.d.ts +120 -150
  136. package/dist/index.js +77 -12
  137. package/dist/index.mjs +74 -9
  138. package/dist/install-integrity.json +99 -98
  139. package/dist/plays/bundle-play-file.d.mts +3 -3
  140. package/dist/plays/bundle-play-file.d.ts +3 -3
  141. package/dist/plays/bundle-play-file.mjs +1 -1
  142. package/dist/plays/play-description.d.mts +2 -2
  143. package/dist/plays/play-description.d.ts +2 -2
  144. package/dist/plays/run-request.d.mts +2 -2
  145. package/dist/plays/run-request.d.ts +2 -2
  146. package/dist/release.d.mts +1 -1
  147. package/dist/release.d.ts +1 -1
  148. package/dist/release.js +2 -2
  149. package/dist/release.mjs +1 -1
  150. package/package.json +1 -1
  151. package/dist/cli/auth-HD5AM2WM.js +0 -40
  152. package/dist/cli/git-JAW3UEGA.js +0 -24
  153. package/dist/cli/search-4K3VSDS5.js +0 -30
  154. package/dist/cli/skills-ZNSQOXO2.js +0 -29
  155. package/dist/cli/tools-W4U4FT3R.js +0 -44
  156. package/dist/cli/update-IE2FPLB5.js +0 -31
@@ -647,7 +647,19 @@ Writing a play:
647
647
  plays check my.play.ts validate after every edit; free
648
648
  plays run my.play.ts --input '{...}' run the local file
649
649
  plays publish my.play.ts make it live for plays run <name> and triggers
650
- The file is: export default definePlay('name', async (ctx, input) => {...}).
650
+ plays run -e "<code>" run code inline as a play function's body
651
+ (input holds --input), like python -c
652
+ A play is a default-exported async function of its input; the file name
653
+ is its default name:
654
+ import deepline from 'deepline';
655
+ export default async function (input: { domain: string }) {
656
+ const company = await deepline.tools.execute({ id, tool, input, description });
657
+ return { company };
658
+ }
659
+ The parameter's type is the input contract; the returned object is the
660
+ result.
661
+ An optional export const config = { name, description, cron, webhook,
662
+ runtime }; at the top of the file sets the name, triggers and runtime.
651
663
  --help --verbose lists the authoring rules.
652
664
  Auditing plays:
653
665
  plays list every saved play
@@ -672,7 +684,8 @@ Writing a play:
672
684
  deepline_run_inline_play run it without publishing; CSV data files go
673
685
  in files, named by input_file_path
674
686
  deepline_publish_play make it live for deepline_run_play and triggers
675
- The file is: export default definePlay('name', async (ctx, input) => {...}).
687
+ A play default-exports an async function of its input; it calls
688
+ deepline.tools.execute and returns { ... }.
676
689
  deepline_help with command "plays" and detail "verbose" lists the
677
690
  authoring rules.
678
691
  Auditing plays:
@@ -686,58 +699,60 @@ Cost:
686
699
  `,
687
700
  verbose: `
688
701
  Authoring rules:
689
- Reach the outside world only through ctx: ctx.csv, ctx.dataset,
690
- ctx.tools.execute, ctx.runPlay, ctx.step, ctx.fetch, ctx.secrets,
691
- ctx.customerDb, and ctx.log. No fs, raw fetch, or shell commands, also not
692
- inside ctx.step. Local nondeterministic work such as Date.now or
693
- Math.random goes inside ctx.step.
702
+ Reach the outside world only through deepline: deepline.csv,
703
+ deepline.dataset, deepline.tools.execute, deepline.runPlay, deepline.step,
704
+ deepline.fetch, deepline.secrets, deepline.customerDb, and deepline.log.
705
+ No fs, raw fetch, or shell commands, also not inside deepline.step. Local
706
+ nondeterministic work such as Date.now or Math.random goes inside
707
+ deepline.step. Call deepline.* only in the play file; pass it to helpers.
694
708
  A run can be interrupted and replayed from the top; every finished step
695
709
  and tool call then returns its saved result. So the play name, each
696
- ctx.dataset key, ctx.step id, ctx.fetch key, and ctx.tools.execute id is
697
- a fixed string literal, and renaming one pays for that work again.
698
- Rows: ctx.dataset('key', rows).withColumn('name', (row, rowCtx) => ...)
699
- .run({ key: 'domain' }). Use a business identifier as the row key. Put
710
+ dataset key, step id, fetch key, and tools.execute id is a fixed string
711
+ literal, and renaming one pays for that work again.
712
+ Rows: deepline.dataset('key', rows).withColumn('name', (row) => ...)
713
+ .run({ key: 'domain' }); call deepline.* inside the column too. Use a business identifier as the row key. Put
700
714
  one paid call in a column, and shaping, status, and miss_reason in
701
715
  separate plain columns after it. Return the dataset for anything that
702
716
  should export as CSV.
703
717
  Dataset handles are async: await rows.count(), rows.first(),
704
718
  rows.peek(n), rows.materialize(n), or for await. Array methods on a
705
719
  handle fail [[cli:plays check]][[mcp:deepline_check_play]].
706
- Tool calls: rowCtx.tools.execute({ id, tool, input, description,
720
+ Tool calls: deepline.tools.execute({ id, tool, input, description,
707
721
  staleAfterSeconds }). In authoring edition 11, choose freshness explicitly:
708
722
  0 for fresh logical work, a positive integer for the maximum reusable
709
723
  result age in seconds, or null for indefinite result reuse. A matching
710
724
  completed operation receipt can still recover that operation after resume.
711
- Read
712
- results through the getters [[cli:describe]][[mcp:deepline_describe_tool]] lists:
725
+ Read results through the getters [[cli:describe]][[mcp:deepline_describe_tool]] lists:
713
726
  result.extractedValues.<name>.get() and
714
727
  result.extractedLists.<name>.get(). A field with no getter is under
715
728
  result.toolResponse.rawV2 with the provider's nesting kept.
716
- staleAfterSeconds on the call sets how fresh a saved result must be.
717
- Reuse before rebuilding: ctx.runPlay('prebuilt/<name>', input) runs a
729
+ Reuse before rebuilding: deepline.runPlay(key, 'prebuilt/<name>', input,
730
+ { description }) runs a
718
731
  prebuilt as one stage. Independent calls run together with Promise.all;
719
732
  a call that needs another's result waits for it.
720
733
  Failures: catch only ProviderTransientError, and only when another
721
734
  provider can answer the same question. Keep the last provider outside
722
735
  the catch so an exhausted waterfall fails loudly. Never branch on an
723
736
  error message.
724
- External APIs: ctx.fetch with a fixed key, and credentials through
725
- ctx.secrets.bearer(...) or ctx.secrets.header(...)[[cli:, stored with deepline
726
- secrets set]]. res.json is a property, not a method; check res.ok. A play
727
- cannot loop ctx.fetch over pages: fan out over rows with ctx.dataset, or
737
+ External APIs: deepline.fetch with a fixed key, and credentials through
738
+ deepline.secrets.bearer(...) or deepline.secrets.header(...)[[cli:, stored
739
+ with deepline secrets set]]. res.json is a property, not a method; check
740
+ res.ok. A play cannot loop deepline.fetch over pages: fan out over rows
741
+ with deepline.dataset, or
728
742
  call one endpoint that returns the whole result.
729
- Triggers: a cron trigger receives {} unless its binding declares an input
730
- object, written inline and pinned with the published revision.
743
+ Triggers: export const config = { cron: { schedule, timezone, input } };
744
+ or { webhook: {} }. A cron run receives {} unless cron.input is written
745
+ inline; it is pinned with the published revision.
731
746
  Runtime: The default Play runtime is 30 minutes. For a bounded long batch
732
- set the play option runtime: { timeout: '90m', size: 'standard' }, up to
733
- 4h. That is not the CLI wait timeout.
747
+ set export const config = { runtime: { timeout: '90m', size: 'standard' } };
748
+ up to 4h. That is not the CLI wait timeout.
734
749
  Recurring sourcing: .run({ key: 'domain', mode: 'net_new' }) returns only
735
750
  rows the table has not seen before.
736
751
  Results: project each answer into flat columns (the value, its source,
737
752
  whether it was validated, the outcome, the reason) and keep evidence
738
753
  under _dl_meta, including result._metadata.execution.receiptKey. Unknown
739
754
  stays null, not false.
740
- Diagram: a /** @mermaid <name> */ block above the play draws it in the
755
+ Diagram: a /** @mermaid */ block at the top of the play draws it in the
741
756
  dashboard, with // @mermaid-node <id> out:"<identifier>" above the
742
757
  statement each box stands for. [[cli:plays check]][[mcp:deepline_check_play]] validates it.
743
758
  `
@@ -1087,7 +1102,7 @@ Cost:
1087
1102
  core: `
1088
1103
  Purpose:
1089
1104
  Make one version of a play live, so [[plays run <name>]], triggers, and
1090
- ctx.runPlay callers use it.[[cli: A local .play.ts file is bundled, validated,
1105
+ deepline.runPlay callers use it.[[cli: A local .play.ts file is bundled, validated,
1091
1106
  saved as a revision, and promoted in one step; a saved play promotes one
1092
1107
  of its existing revisions.]][[mcp: It promotes one of a saved play's existing
1093
1108
  revisions; deepline_publish_play saves and promotes a new file graph.]]
@@ -1118,7 +1133,7 @@ Avoid:
1118
1133
  core: `
1119
1134
  Purpose:
1120
1135
  Publish [[cli:a local .play.ts file]][[mcp:an inline .play.ts file graph]] or promote a saved revision, so [[plays run
1121
- <name>]], triggers, and ctx.runPlay callers use it. The same operation as
1136
+ <name>]], triggers, and deepline.runPlay callers use it. The same operation as
1122
1137
  [[plays set-live]].
1123
1138
  When:
1124
1139
  Once a play [[cli:run by file path]][[mcp:run inline]] gives the right result. Running [[cli:a local file]][[mcp:a play inline]]
@@ -1255,7 +1270,7 @@ Debugging a run:
1255
1270
  last event, then [[runs logs <run-id>]][[cli: --failed]] for the failure window, then
1256
1271
  [[cli:runs watch <run-id>]][[mcp:deepline_get_run again]] to follow it if it is still active. A run can go quiet
1257
1272
  for minutes while it waits on a slow provider (Apify actors, large company
1258
- searches), an intentional ctx.sleep, or a rate-limit backoff; that is
1273
+ searches), an intentional deepline.sleep, or a rate-limit backoff; that is
1259
1274
  healthy. Stop it only after about ten minutes without progress on a fast
1260
1275
  tool.
1261
1276
  `
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  SCHEMA_LINE_LIMIT
3
- } from "./chunk-IHG7UAHD.mjs";
3
+ } from "./chunk-MLJBCS3E.mjs";
4
4
 
5
5
  // src/cli/describe-options.ts
6
6
  function addDescribeOptions(command, options = {}) {
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
- var _chunkAYM2KZN3js = require('./chunk-AYM2KZN3.js');
3
+ var _chunkDD6MM6WXjs = require('./chunk-DD6MM6WX.js');
4
4
 
5
5
  // src/cli/maintenance-policy.ts
6
6
  var _commander = require('commander');
@@ -33,7 +33,7 @@ function recordCliTrace(event) {
33
33
  sinceStartMs: now - cliTraceStartedAt,
34
34
  ...event
35
35
  };
36
- _chunkAYM2KZN3js.writeRawStderr.call(void 0, `[cli-trace] ${JSON.stringify(payload)}
36
+ _chunkDD6MM6WXjs.writeRawStderr.call(void 0, `[cli-trace] ${JSON.stringify(payload)}
37
37
  `);
38
38
  }
39
39
  async function traceCliSpan(phase, fields, run) {
@@ -2,7 +2,7 @@ import {
2
2
  rateLimitSummary,
3
3
  schemaField,
4
4
  schemaFields
5
- } from "./chunk-IHG7UAHD.mjs";
5
+ } from "./chunk-MLJBCS3E.mjs";
6
6
  import {
7
7
  Capability,
8
8
  observedMaxText
@@ -618,7 +618,7 @@ function usageGuidanceWithAccessDefaults(usageGuidance) {
618
618
  extractedLists: {
619
619
  ...recordField(existingAccess, "extractedLists"),
620
620
  expression: "toolExecutionResult.extractedLists.<name>.get()",
621
- meaning: playToolListGetterMode() === "array" ? "Returns an ordinary array from this response. Use array methods directly or pass it to ctx.dataset to persist row work. Lazy or incomplete lists throw; use readList for an explicit dataset read. It does not fetch provider pages." : "Returns a PlayDataset, not a JavaScript array. Pass the handle to ctx.dataset, use first(), async iteration, or await handle.materialize() for the complete current list within the memory cap. materialize(n) and peek(n) return a prefix; none fetch additional provider pages. A missing getter is not an empty list."
621
+ meaning: playToolListGetterMode() === "array" ? "Returns an ordinary array from this response. Use array methods directly or pass it to deepline.dataset to persist row work. Lazy or incomplete lists throw; use readList for an explicit dataset read. It does not fetch provider pages." : "Returns a PlayDataset, not a JavaScript array. Pass the handle to deepline.dataset, use first(), async iteration, or await handle.materialize() for the complete current list within the memory cap. materialize(n) and peek(n) return a prefix; none fetch additional provider pages. A missing getter is not an empty list."
622
622
  },
623
623
  rawToolResponse: {
624
624
  expression: "toolExecutionResult.toolResponse.rawV2",
@@ -28,7 +28,7 @@ var _chunkKXMNM4AQjs = require('./chunk-KXMNM4AQ.js');
28
28
 
29
29
 
30
30
 
31
- var _chunkHCYNAIHZjs = require('./chunk-HCYNAIHZ.js');
31
+ var _chunkQP5ATTMCjs = require('./chunk-QP5ATTMC.js');
32
32
 
33
33
 
34
34
  var _chunkNPBJI7REjs = require('./chunk-NPBJI7RE.js');
@@ -647,7 +647,7 @@ var ToolCalls = class {
647
647
  idempotencyKey,
648
648
  onResponse: (response2) => {
649
649
  lastResponse = null;
650
- atomicToolsSupported = response2.headers.get(_chunkHCYNAIHZjs.ATOMIC_TOOL_EXECUTE_SUPPORTED_HEADER) === "true";
650
+ atomicToolsSupported = response2.headers.get(_chunkQP5ATTMCjs.ATOMIC_TOOL_EXECUTE_SUPPORTED_HEADER) === "true";
651
651
  recoverySupported = response2.headers.get("X-Deepline-Idempotency-Supported") === "true";
652
652
  if (_optionalChain([options, 'optionalAccess', _29 => _29.onServerTiming])) {
653
653
  try {
@@ -997,8 +997,8 @@ function runtimeSelectionHeaders(runtime, env) {
997
997
  }
998
998
  const receivers = _optionalChain([env, 'access', _51 => _51.DEEPLINE_RUNTIME_RETAINED_PIPELINE_RECEIVERS, 'optionalAccess', _52 => _52.trim, 'call', _53 => _53()]);
999
999
  return {
1000
- [_chunkHCYNAIHZjs.RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
1001
- ...receivers ? { [_chunkHCYNAIHZjs.RETAINED_PIPELINE_RECEIVERS_HEADER]: receivers } : {}
1000
+ [_chunkQP5ATTMCjs.RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
1001
+ ...receivers ? { [_chunkQP5ATTMCjs.RETAINED_PIPELINE_RECEIVERS_HEADER]: receivers } : {}
1002
1002
  };
1003
1003
  }
1004
1004
  function normalizeTestPolicyOverrides(value, source) {
@@ -1069,7 +1069,7 @@ var PlayClient = class {
1069
1069
  return _chunk2H4EY7KHjs.startPlayRun.call(void 0,
1070
1070
  this.http,
1071
1071
  resolved.request,
1072
- _optionalChain([options, 'optionalAccess', _61 => _61.cliAdmission]) ? { ...headers, "X-Deepline-API-Major": String(_chunkHCYNAIHZjs.SDK_API_MAJOR) } : headers,
1072
+ _optionalChain([options, 'optionalAccess', _61 => _61.cliAdmission]) ? { ...headers, "X-Deepline-API-Major": String(_chunkQP5ATTMCjs.SDK_API_MAJOR) } : headers,
1073
1073
  options
1074
1074
  );
1075
1075
  }
@@ -1135,9 +1135,9 @@ var PlayClient = class {
1135
1135
  }
1136
1136
  };
1137
1137
  function createPlayClient(options) {
1138
- const config = _chunkHCYNAIHZjs.resolveConfig.call(void 0, options);
1138
+ const config = _chunkQP5ATTMCjs.resolveConfig.call(void 0, options);
1139
1139
  return new PlayClient(
1140
- new (0, _chunkHCYNAIHZjs.HttpClient)(config),
1140
+ new (0, _chunkQP5ATTMCjs.HttpClient)(config),
1141
1141
  _nullishCoalesce(config.environment, () => ( process.env))
1142
1142
  );
1143
1143
  }
@@ -3151,7 +3151,7 @@ function isolatedCiRuntimeEventReadHeaders(env) {
3151
3151
  "RUNTIME_EVENT_INTERNAL_TOKEN_REQUIRED"
3152
3152
  );
3153
3153
  }
3154
- return { [_chunkHCYNAIHZjs.COORDINATOR_INTERNAL_TOKEN_HEADER]: token };
3154
+ return { [_chunkQP5ATTMCjs.COORDINATOR_INTERNAL_TOKEN_HEADER]: token };
3155
3155
  }
3156
3156
  function sleep(ms) {
3157
3157
  return new Promise((resolve) => setTimeout(resolve, ms));
@@ -3389,9 +3389,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
3389
3389
  * @throws {@link ConfigError} if no API key can be resolved from any source.
3390
3390
  */
3391
3391
  constructor(options) {
3392
- this.config = _chunkHCYNAIHZjs.resolveConfig.call(void 0, options);
3392
+ this.config = _chunkQP5ATTMCjs.resolveConfig.call(void 0, options);
3393
3393
  this.environment = _nullishCoalesce(this.config.environment, () => ( process.env));
3394
- this.http = new (0, _chunkHCYNAIHZjs.HttpClient)(this.config);
3394
+ this.http = new (0, _chunkQP5ATTMCjs.HttpClient)(this.config);
3395
3395
  this.playClient = new PlayClient(this.http, this.environment);
3396
3396
  this.toolCalls = new ToolCalls(
3397
3397
  this.http,
@@ -4968,7 +4968,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4968
4968
  /**
4969
4969
  * Export persisted runtime-sheet rows for a play dataset/table namespace.
4970
4970
  *
4971
- * This is the SDK form of exporting `ctx.dataset(...).run()` output for a
4971
+ * This is the SDK form of exporting `deepline.dataset(...).run()` output for a
4972
4972
  * specific play and optional run id.
4973
4973
  */
4974
4974
  async getPlaySheetRows(input) {
@@ -3,15 +3,15 @@ import {
3
3
  } from "./chunk-LJ5747UC.mjs";
4
4
  import {
5
5
  DeeplineClient
6
- } from "./chunk-2JKQORUX.mjs";
6
+ } from "./chunk-7KNBC4RJ.mjs";
7
7
  import {
8
8
  printCommandEnvelope,
9
9
  renderCommandEnvelopeText
10
- } from "./chunk-4CAVSRQH.mjs";
10
+ } from "./chunk-3O7KATMQ.mjs";
11
11
  import {
12
12
  resolveConfig,
13
13
  sdkCliStateDirPath
14
- } from "./chunk-PXO253DP.mjs";
14
+ } from "./chunk-OWWFCA7A.mjs";
15
15
  import {
16
16
  __commonJS,
17
17
  __toESM
@@ -11,10 +11,10 @@ import {
11
11
  skillsInstallLeasePath,
12
12
  skillsSourceUrl,
13
13
  syncSdkSkillsIfNeeded
14
- } from "./chunk-FEKJENBB.mjs";
14
+ } from "./chunk-VC5NKF4B.mjs";
15
15
  import {
16
16
  printCommandEnvelope
17
- } from "./chunk-4CAVSRQH.mjs";
17
+ } from "./chunk-3O7KATMQ.mjs";
18
18
  import {
19
19
  SDK_VERSION,
20
20
  autoDetectBaseUrl,
@@ -22,7 +22,7 @@ import {
22
22
  ensureProjectPrivatePathsIgnored,
23
23
  resolveProjectPinTarget,
24
24
  sdkCliStateDirPath
25
- } from "./chunk-PXO253DP.mjs";
25
+ } from "./chunk-OWWFCA7A.mjs";
26
26
 
27
27
  // src/cli/commands/skills.ts
28
28
  import { spawn } from "child_process";
@@ -454,27 +454,46 @@ function examples(described, options) {
454
454
  const source = expression(field);
455
455
  return source ? [`const ${safeIdentifier(field.name)} = ${source};`] : [];
456
456
  });
457
+ const playFunction = (body, returned) => [
458
+ "import deepline from 'deepline';",
459
+ "export default async function () {",
460
+ ...[...body, `return { ${returned.join(", ")} };`].map(
461
+ (line) => ` ${line}`
462
+ ),
463
+ "}"
464
+ ].join("\n");
465
+ const returnedNames = (expression) => read.flatMap(
466
+ (field) => expression(field) ? [safeIdentifier(field.name)] : []
467
+ );
457
468
  if (runner.via === "monitor") return { cli: runner.deploy, play: null };
458
469
  if (runner.via === "tool") {
470
+ const readNames = returnedNames((field) => field.read);
459
471
  return {
460
472
  cli: `deepline tools execute ${runner.toolId} --input ${shellQuote(input)}`,
461
- play: [
462
- "const result = await ctx.tools.execute({",
463
- " staleAfterSeconds: 0,",
464
- ` id: '${safeIdentifier(runner.toolId)}',`,
465
- ` tool: '${runner.toolId}',`,
466
- ` input: ${input},`,
467
- "});",
468
- ...reads((field) => field.read)
469
- ].join("\n")
473
+ play: playFunction(
474
+ [
475
+ "const result = await deepline.tools.execute({",
476
+ " staleAfterSeconds: 0,",
477
+ ` id: '${safeIdentifier(runner.toolId)}',`,
478
+ ` tool: '${runner.toolId}',`,
479
+ ` input: ${input},`,
480
+ ` description: ${JSON.stringify(described.displayName ?? runner.toolId)},`,
481
+ "});",
482
+ ...reads((field) => field.read)
483
+ ],
484
+ readNames.length ? readNames : ["response: result.toolResponse"]
485
+ )
470
486
  };
471
487
  }
472
488
  return {
473
489
  cli: runner.cli ?? `deepline plays run ${runner.reference} --input ${shellQuote(input)}`,
474
- play: [
475
- `const output = await ctx.runPlay('${safeIdentifier(runner.reference.replace(/^.*\//, ""))}', '${runner.reference}', ${input});`,
476
- ...reads((field) => `output.${field.name}`)
477
- ].join("\n")
490
+ play: playFunction(
491
+ [
492
+ `const output = await deepline.runPlay('${safeIdentifier(runner.reference.replace(/^.*\//, ""))}', '${runner.reference}', ${input});`,
493
+ ...reads((field) => `output.${field.name}`)
494
+ ],
495
+ read.length ? returnedNames((field) => field.name) : ["output"]
496
+ )
478
497
  };
479
498
  }
480
499
  var EXPLANATIONS = {
@@ -1,19 +1,19 @@
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; }
2
2
 
3
3
 
4
- var _chunkJRSULUPQjs = require('./chunk-JRSULUPQ.js');
4
+ var _chunkRISEING7js = require('./chunk-RISEING7.js');
5
5
 
6
6
 
7
- var _chunkKBJP3UAUjs = require('./chunk-KBJP3UAU.js');
7
+ var _chunk7W4N6VREjs = require('./chunk-7W4N6VRE.js');
8
8
 
9
9
 
10
- var _chunkOZHPZCAUjs = require('./chunk-OZHPZCAU.js');
10
+ var _chunkF3MMA7JYjs = require('./chunk-F3MMA7JY.js');
11
11
 
12
12
 
13
- var _chunkAYM2KZN3js = require('./chunk-AYM2KZN3.js');
13
+ var _chunkDD6MM6WXjs = require('./chunk-DD6MM6WX.js');
14
14
 
15
15
 
16
- var _chunkHCYNAIHZjs = require('./chunk-HCYNAIHZ.js');
16
+ var _chunkQP5ATTMCjs = require('./chunk-QP5ATTMC.js');
17
17
 
18
18
  // src/cli/commands/update.ts
19
19
  var _child_process = require('child_process');
@@ -495,7 +495,7 @@ function normalizedNpmPrefix(value) {
495
495
  }
496
496
  function resolveNpmGlobalPrefix(env) {
497
497
  try {
498
- const plan = _chunkOZHPZCAUjs.resolveShellSpawn.call(void 0,
498
+ const plan = _chunkF3MMA7JYjs.resolveShellSpawn.call(void 0,
499
499
  "npm",
500
500
  ["prefix", "-g"],
501
501
  process.platform,
@@ -556,8 +556,8 @@ function resolveUpdatePlan(options = {}) {
556
556
  const npmGlobalPrefix = options.npmGlobalPrefix !== void 0 ? options.npmGlobalPrefix : resolveNpmGlobalPrefix(env);
557
557
  const hasVerifiedNpmOwnership = inferredInstallPrefix !== null && normalizedNpmPrefix(inferredInstallPrefix) === normalizedNpmPrefix(npmGlobalPrefix);
558
558
  const installPrefix = options.requireVerifiedNpmOwnership ? hasVerifiedNpmOwnership ? inferredInstallPrefix : null : inferredInstallPrefix;
559
- const npmVersion = options.npmVersion === void 0 ? _chunkJRSULUPQjs.readNpmVersion.call(void 0, env) : options.npmVersion;
560
- const npmGlobalInstallFlags = _chunkJRSULUPQjs.npmSupportsAllowScripts.call(void 0, npmVersion) ? [...NPM_SDK_INSTALL_COMMON_FLAGS, "--allow-scripts=esbuild"] : NPM_SDK_INSTALL_COMMON_FLAGS;
559
+ const npmVersion = options.npmVersion === void 0 ? _chunkRISEING7js.readNpmVersion.call(void 0, env) : options.npmVersion;
560
+ const npmGlobalInstallFlags = _chunkRISEING7js.npmSupportsAllowScripts.call(void 0, npmVersion) ? [...NPM_SDK_INSTALL_COMMON_FLAGS, "--allow-scripts=esbuild"] : NPM_SDK_INSTALL_COMMON_FLAGS;
561
561
  const args = installPrefix ? [
562
562
  "install",
563
563
  "-g",
@@ -567,7 +567,7 @@ function resolveUpdatePlan(options = {}) {
567
567
  packageSpec
568
568
  ] : ["install", "-g", ...npmGlobalInstallFlags, packageSpec];
569
569
  const fallbackRegistryUrl = options.npmFallbackRegistryUrl !== void 0 ? options.npmFallbackRegistryUrl : publicNpmFallbackRegistryUrl(
570
- _optionalChain([env, 'access', _22 => _22.DEEPLINE_HOST_URL, 'optionalAccess', _23 => _23.trim, 'call', _24 => _24()]) || _chunkHCYNAIHZjs.autoDetectBaseUrl.call(void 0, )
570
+ _optionalChain([env, 'access', _22 => _22.DEEPLINE_HOST_URL, 'optionalAccess', _23 => _23.trim, 'call', _24 => _24()]) || _chunkQP5ATTMCjs.autoDetectBaseUrl.call(void 0, )
571
571
  );
572
572
  return {
573
573
  kind: "npm-global",
@@ -816,7 +816,7 @@ function sidecarInstallFailure(versionDir) {
816
816
  function runCommand(command, args, env = process.env) {
817
817
  return new Promise((resolveResult) => {
818
818
  let output = "";
819
- const plan = _chunkOZHPZCAUjs.resolveShellSpawn.call(void 0, command, args, process.platform, env);
819
+ const plan = _chunkF3MMA7JYjs.resolveShellSpawn.call(void 0, command, args, process.platform, env);
820
820
  const child = _child_process.spawn.call(void 0, plan.command, plan.args, {
821
821
  stdio: ["inherit", "pipe", "pipe"],
822
822
  shell: plan.shell,
@@ -1199,14 +1199,14 @@ async function publishedVersionSupportsPin(version, fallbackRegistryUrl) {
1199
1199
  throw _nullishCoalesce(lastError, () => ( new Error("No npm registry was available")));
1200
1200
  }
1201
1201
  async function runUpdateCommand(options, dependencies = {}) {
1202
- const detectBaseUrl = _nullishCoalesce(dependencies.detectBaseUrl, () => ( _chunkHCYNAIHZjs.autoDetectBaseUrl));
1202
+ const detectBaseUrl = _nullishCoalesce(dependencies.detectBaseUrl, () => ( _chunkQP5ATTMCjs.autoDetectBaseUrl));
1203
1203
  const resolvePlan = _nullishCoalesce(dependencies.resolvePlan, () => ( resolveUpdatePlan));
1204
1204
  const runPlan = _nullishCoalesce(dependencies.runPlan, () => ( runUpdatePlan));
1205
1205
  const syncSkills = _nullishCoalesce(dependencies.syncSkillsIfNeeded, () => ( (async () => {
1206
1206
  const originalWrite = process.stdout.write.bind(process.stdout);
1207
1207
  process.stdout.write = (() => true);
1208
1208
  try {
1209
- const exitCode = await _chunkKBJP3UAUjs.runSkillsCommand.call(void 0, { json: true });
1209
+ const exitCode = await _chunk7W4N6VREjs.runSkillsCommand.call(void 0, { json: true });
1210
1210
  if (exitCode !== 0) {
1211
1211
  throw new Error(
1212
1212
  `Deepline skills update failed with exit ${exitCode}.`
@@ -1277,11 +1277,11 @@ async function runUpdateCommand(options, dependencies = {}) {
1277
1277
  ]
1278
1278
  };
1279
1279
  if (options.json && !options.executeWithJson) {
1280
- _chunkAYM2KZN3js.printCommandEnvelope.call(void 0, { ...plan, render }, { json: true });
1280
+ _chunkDD6MM6WXjs.printCommandEnvelope.call(void 0, { ...plan, render }, { json: true });
1281
1281
  return 0;
1282
1282
  }
1283
1283
  if (options.printCommand) {
1284
- _chunkAYM2KZN3js.printCommandEnvelope.call(void 0,
1284
+ _chunkDD6MM6WXjs.printCommandEnvelope.call(void 0,
1285
1285
  {
1286
1286
  ...plan,
1287
1287
  render: {
@@ -1294,7 +1294,7 @@ async function runUpdateCommand(options, dependencies = {}) {
1294
1294
  return 0;
1295
1295
  }
1296
1296
  if (plan.kind === "source" || plan.kind === "homebrew") {
1297
- _chunkAYM2KZN3js.printCommandEnvelope.call(void 0, { ...plan, render }, { json: false });
1297
+ _chunkDD6MM6WXjs.printCommandEnvelope.call(void 0, { ...plan, render }, { json: false });
1298
1298
  return 0;
1299
1299
  }
1300
1300
  stderr.write(`Updating Deepline SDK/CLI with: ${plan.manualCommand}
@@ -1324,7 +1324,7 @@ To retry with full installer output, run: deepline skills
1324
1324
  );
1325
1325
  }
1326
1326
  if (options.executeWithJson && options.json) {
1327
- _chunkAYM2KZN3js.printCommandEnvelope.call(void 0,
1327
+ _chunkDD6MM6WXjs.printCommandEnvelope.call(void 0,
1328
1328
  {
1329
1329
  ok: true,
1330
1330
  pinnedVersion
@@ -17,7 +17,7 @@ import {
17
17
  } from "./chunk-E4IXDAZI.mjs";
18
18
  import {
19
19
  SDK_RELEASE
20
- } from "./chunk-VT6WJ26Y.mjs";
20
+ } from "./chunk-5MD5I4MM.mjs";
21
21
 
22
22
  // src/config.ts
23
23
  import {