deepline 0.3.325 → 0.3.326

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 (127) hide show
  1. package/dist/bundling-sources/sdk/src/client.ts +23 -25
  2. package/dist/bundling-sources/sdk/src/compat.ts +11 -6
  3. package/dist/bundling-sources/sdk/src/db/query.ts +172 -0
  4. package/dist/bundling-sources/sdk/src/errors.ts +35 -0
  5. package/dist/bundling-sources/sdk/src/index.ts +13 -0
  6. package/dist/bundling-sources/sdk/src/play.ts +34 -31
  7. package/dist/bundling-sources/sdk/src/plays/authoring-graph-path.ts +13 -0
  8. package/dist/bundling-sources/sdk/src/plays/bundle-play-file.ts +2 -1
  9. package/dist/bundling-sources/sdk/src/plays/local-play-execution.ts +189 -0
  10. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  11. package/dist/bundling-sources/sdk/src/tool-calls.ts +1 -1
  12. package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +84 -10
  13. package/dist/cli/auth-6STWK6UK.js +31 -0
  14. package/dist/cli/{auth-PIZESRPC.mjs → auth-VON5FFUK.mjs} +4 -4
  15. package/dist/cli/{billing-HSL6VTCM.mjs → billing-X6JUEFRE.mjs} +4 -4
  16. package/dist/cli/{billing-DQKFCQV5.js → billing-YI4RZI2O.js} +70 -70
  17. package/dist/cli/{chunk-UYFWTIKF.js → chunk-3NGWGFVL.js} +26 -26
  18. package/dist/cli/{chunk-PWV2M4LW.mjs → chunk-4AB4Y6FF.mjs} +1 -1
  19. package/dist/cli/{chunk-DLW7X2UK.js → chunk-4LNBSQM4.js} +5928 -5730
  20. package/dist/cli/{chunk-OOPSX57I.js → chunk-5NXHSRRE.js} +6 -6
  21. package/dist/cli/{chunk-XNL3SEMC.js → chunk-AFNEQ43J.js} +8 -3
  22. package/dist/cli/{chunk-XSEMQ4II.js → chunk-AGH6YP2T.js} +2 -1
  23. package/dist/cli/chunk-AID3OYVJ.js +8 -0
  24. package/dist/cli/{chunk-NWBARG3F.mjs → chunk-BQJVMKWL.mjs} +1 -1
  25. package/dist/cli/{chunk-YE3O2UHM.mjs → chunk-BR7GGTAE.mjs} +24 -1
  26. package/dist/cli/{chunk-K7FC5IUU.js → chunk-BUYZEUY4.js} +1 -1
  27. package/dist/cli/{chunk-QQ2FG5W3.js → chunk-CUUHQ3AO.js} +6 -6
  28. package/dist/cli/{chunk-H5TJBRSC.mjs → chunk-DFDXKOLR.mjs} +98 -113
  29. package/dist/cli/{chunk-HPTQEWCF.js → chunk-EMZ7Y5SW.js} +70 -67
  30. package/dist/cli/chunk-GVESPYSY.mjs +234 -0
  31. package/dist/cli/{chunk-MNKDSR2J.js → chunk-GVYKY6T6.js} +344 -254
  32. package/dist/cli/{chunk-6RMKHN7S.mjs → chunk-IQCCGOQH.mjs} +4 -20
  33. package/dist/cli/{chunk-76VKBPOC.mjs → chunk-JOA6IKDE.mjs} +7 -2
  34. package/dist/cli/{chunk-XIVUB36F.mjs → chunk-KLWBAQ5A.mjs} +104 -14
  35. package/dist/cli/{chunk-CV5GDCKN.js → chunk-KZ4PCK4O.js} +29 -45
  36. package/dist/cli/chunk-LVEDPCLJ.js +234 -0
  37. package/dist/cli/{chunk-AQUNQJ5Y.mjs → chunk-M7CPVMDB.mjs} +1 -1
  38. package/dist/cli/{chunk-HUKWYHBG.js → chunk-MDQZQ3NY.js} +2 -2
  39. package/dist/cli/{chunk-PBNZXZCW.js → chunk-MKHSZA2X.js} +48 -48
  40. package/dist/cli/{chunk-5TYU3UIS.mjs → chunk-MOBZS4F3.mjs} +1 -1
  41. package/dist/cli/chunk-OVDNJAJN.mjs +8 -0
  42. package/dist/cli/{chunk-KZNFYOHX.js → chunk-T33W6JUJ.js} +6 -6
  43. package/dist/cli/{chunk-6VZDSBK6.mjs → chunk-TDSNAC3C.mjs} +2 -2
  44. package/dist/cli/{chunk-PVDQ55PS.js → chunk-TXVOB5J2.js} +29 -6
  45. package/dist/cli/{chunk-YXRPWMGN.js → chunk-TZQMFWLF.js} +147 -162
  46. package/dist/cli/{chunk-OPERWJR6.mjs → chunk-VGKVLADU.mjs} +3 -3
  47. package/dist/cli/{chunk-7MD453WV.mjs → chunk-VKXGOQG5.mjs} +5674 -5476
  48. package/dist/cli/{chunk-WW4XZIVM.mjs → chunk-W74E5ETE.mjs} +12 -9
  49. package/dist/cli/{chunk-7PZFGB7L.mjs → chunk-YIY74KUF.mjs} +2 -1
  50. package/dist/cli/{chunk-5FHU7TV4.mjs → chunk-ZRN6YOF2.mjs} +2 -2
  51. package/dist/cli/client-TEBW2P24.js +20 -0
  52. package/dist/cli/{client-57SR4KVM.mjs → client-ZMOKUNL2.mjs} +3 -3
  53. package/dist/cli/{csv-5DJSC6BD.js → csv-HZRKEI7J.js} +12 -12
  54. package/dist/cli/{csv-G2FRMOXL.mjs → csv-IICJHJZ4.mjs} +3 -3
  55. package/dist/cli/{db-NVO7P4VO.js → db-TM5NZF73.js} +226 -149
  56. package/dist/cli/{db-WWZEXM3N.mjs → db-X4B7YFNY.mjs} +214 -137
  57. package/dist/cli/{describe-M26LHDBQ.js → describe-BDBARWZJ.js} +28 -27
  58. package/dist/cli/{describe-26OMF3A4.mjs → describe-GMVS3LFC.mjs} +12 -11
  59. package/dist/cli/{executions-2LLHY3IL.mjs → executions-447ZJMN4.mjs} +4 -4
  60. package/dist/cli/{executions-KI47LPKE.js → executions-QX25UOQM.js} +6 -6
  61. package/dist/cli/{feedback-2Y26C2BZ.js → feedback-4IXUTBX7.js} +6 -6
  62. package/dist/cli/{feedback-O26VL2OF.mjs → feedback-JB7HHIC6.mjs} +3 -3
  63. package/dist/cli/git-C7C7DTEH.js +23 -0
  64. package/dist/cli/{git-UVPGZN3K.mjs → git-VID6KGAA.mjs} +4 -4
  65. package/dist/cli/index.js +105 -87
  66. package/dist/cli/index.mjs +65 -47
  67. package/dist/cli/{legacy-noops-H6Y3SEVB.js → legacy-noops-3FYTCOZO.js} +7 -7
  68. package/dist/cli/{legacy-noops-IK5CH72U.mjs → legacy-noops-SGR3G5WS.mjs} +4 -4
  69. package/dist/cli/{monitors-SFVVMAJT.mjs → monitors-SH4FOMBM.mjs} +4 -4
  70. package/dist/cli/{monitors-JL6TTQCI.js → monitors-SP52UHS4.js} +85 -85
  71. package/dist/cli/{org-SSDONL57.mjs → org-B32MMIQT.mjs} +4 -4
  72. package/dist/cli/{org-OVMAZCQS.js → org-UQMX7JOR.js} +60 -60
  73. package/dist/cli/play-UCIWBN7U.js +153 -0
  74. package/dist/cli/{play-X6NPACUO.mjs → play-XTE4LUP7.mjs} +11 -10
  75. package/dist/cli/{providers-E24JDWSR.js → providers-JNMJJ2OH.js} +7 -7
  76. package/dist/cli/{providers-ONUBYYY4.mjs → providers-RWLN6FUR.mjs} +4 -4
  77. package/dist/cli/{quickstart-TB7C3DLG.js → quickstart-HK6WZ342.js} +5 -5
  78. package/dist/cli/{quickstart-B7NIXACV.mjs → quickstart-IDB3Y375.mjs} +3 -3
  79. package/dist/cli/{search-N3QUIATW.mjs → search-6D3IFNPT.mjs} +5 -5
  80. package/dist/cli/search-LUZ2S7DH.js +26 -0
  81. package/dist/cli/{secrets-CPCVFDYB.js → secrets-JOQB57IE.js} +13 -13
  82. package/dist/cli/{secrets-V7Z4M67T.mjs → secrets-TZ53CQ3D.mjs} +4 -4
  83. package/dist/cli/{sessions-PDOBKAKO.mjs → sessions-4MBDC4EK.mjs} +4 -4
  84. package/dist/cli/{sessions-E4FIZLQP.js → sessions-QSAICDXX.js} +5 -5
  85. package/dist/cli/{settings-UVM2WDE4.js → settings-OTOCW7L7.js} +74 -74
  86. package/dist/cli/{settings-QYHYHZDI.mjs → settings-RKQFMLDU.mjs} +7 -7
  87. package/dist/cli/{setup-4RLAETDW.mjs → setup-2S5TNTUB.mjs} +6 -6
  88. package/dist/cli/{setup-3JFAXQLJ.js → setup-AKZUDVYY.js} +41 -41
  89. package/dist/cli/skills-26LASHZF.js +28 -0
  90. package/dist/cli/{skills-ZX2JSWOZ.mjs → skills-AGZXDLSA.mjs} +4 -4
  91. package/dist/cli/{tools-EGXCVIPJ.mjs → tools-7Y6RD6FY.mjs} +8 -7
  92. package/dist/cli/tools-L5VIJQWX.js +39 -0
  93. package/dist/cli/{update-7FEKRQFE.mjs → update-M7YGF67I.mjs} +6 -6
  94. package/dist/cli/update-MNHF6M2F.js +28 -0
  95. package/dist/cli/{workflow-7V7TTTKK.mjs → workflow-CTVE7S7W.mjs} +5 -5
  96. package/dist/cli/{workflow-54VCKIG2.js → workflow-NGMY425T.js} +15 -15
  97. package/dist/{client-Bb4Jjzmj.d.ts → client-DHq8dJ56.d.ts} +39 -11
  98. package/dist/{client-COa-3GHK.d.mts → client-wiWPZhnI.d.mts} +39 -11
  99. package/dist/{compiler-manifest-CsnWj-AK.d.mts → compiler-manifest-9TkZ_ykI.d.mts} +711 -711
  100. package/dist/{compiler-manifest-CsnWj-AK.d.ts → compiler-manifest-9TkZ_ykI.d.ts} +711 -711
  101. package/dist/index-B-5_Xhud.d.mts +75 -0
  102. package/dist/index-ykksoEyR.d.ts +75 -0
  103. package/dist/index.d.mts +52 -13
  104. package/dist/index.d.ts +52 -13
  105. package/dist/index.js +92 -28
  106. package/dist/index.mjs +91 -27
  107. package/dist/install-integrity.json +91 -84
  108. package/dist/plays/bundle-play-file.d.mts +7 -75
  109. package/dist/plays/bundle-play-file.d.ts +7 -75
  110. package/dist/plays/bundle-play-file.mjs +1 -1
  111. package/dist/plays/run-request.d.mts +2 -2
  112. package/dist/plays/run-request.d.ts +2 -2
  113. package/dist/release.d.mts +1 -1
  114. package/dist/release.d.ts +1 -1
  115. package/dist/release.js +2 -2
  116. package/dist/release.mjs +1 -1
  117. package/package.json +1 -1
  118. package/dist/cli/auth-RXCD4GOV.js +0 -31
  119. package/dist/cli/chunk-OWJZUE3Y.mjs +0 -103
  120. package/dist/cli/chunk-SDK3ZA2C.js +0 -103
  121. package/dist/cli/client-562MULXK.js +0 -20
  122. package/dist/cli/git-KGPX5YPD.js +0 -23
  123. package/dist/cli/play-3DB4MSHN.js +0 -152
  124. package/dist/cli/search-NJ637YGQ.js +0 -26
  125. package/dist/cli/skills-BYRYG64R.js +0 -28
  126. package/dist/cli/tools-TAWOAY5X.js +0 -38
  127. package/dist/cli/update-H24GEBXM.js +0 -28
@@ -0,0 +1,234 @@
1
+ // src/plays/local-play-execution.ts
2
+ function importedNodes(graph) {
3
+ const visited = /* @__PURE__ */ new Set();
4
+ const visiting = /* @__PURE__ */ new Set();
5
+ const ordered = [];
6
+ const names = /* @__PURE__ */ new Map();
7
+ const visit = (node) => {
8
+ if (visiting.has(node.filePath))
9
+ throw new Error(`Recursive imported Play graph at ${node.filePath}.`);
10
+ if (visited.has(node.filePath)) return;
11
+ visiting.add(node.filePath);
12
+ for (const dependency of node.importedPlayDependencies) {
13
+ const child = graph.nodes.get(dependency.filePath);
14
+ if (!child)
15
+ throw new Error(
16
+ `Missing bundled Play dependency ${dependency.filePath}.`
17
+ );
18
+ visit(child);
19
+ }
20
+ visiting.delete(node.filePath);
21
+ visited.add(node.filePath);
22
+ if (node === graph.root) return;
23
+ if (!node.playName)
24
+ throw new Error(
25
+ `Imported Play ${node.filePath} must export definePlay(...).`
26
+ );
27
+ const existing = names.get(node.playName);
28
+ if (existing !== void 0 && existing !== node.filePath)
29
+ throw new Error(
30
+ `Imported Play name ${node.playName} belongs to more than one source file.`
31
+ );
32
+ names.set(node.playName, node.filePath);
33
+ ordered.push(node);
34
+ };
35
+ visit(graph.root);
36
+ return ordered;
37
+ }
38
+ function planLocalPlayExecution(graph, input = {}) {
39
+ const imports = importedNodes(graph).map((node) => ({
40
+ name: node.playName,
41
+ artifactHash: node.artifact.artifactHash,
42
+ graphHash: node.artifact.graphHash
43
+ }));
44
+ return {
45
+ command: "plays run",
46
+ root: {
47
+ name: graph.root.playName,
48
+ artifactHash: graph.root.artifact.artifactHash,
49
+ publication: "unpublished"
50
+ },
51
+ importedPlays: imports.map((node) => ({
52
+ ...node,
53
+ publication: "pinned"
54
+ })),
55
+ effects: {
56
+ cloudMutations: imports.length ? [
57
+ "store_imported_execution_artifacts",
58
+ "stage_files_if_present",
59
+ "register_unpublished_root_revision",
60
+ "start_run"
61
+ ] : [
62
+ "stage_files_if_present",
63
+ "register_unpublished_root_revision",
64
+ "start_run"
65
+ ],
66
+ localWrites: input.runIdFile ? ["bundle_cache", "run_identity_file"] : ["bundle_cache"],
67
+ creditSpending: "tool_calls_may_spend",
68
+ recovery: "inspect_or_resume_original_run_id"
69
+ }
70
+ };
71
+ }
72
+ async function pinLocalPlayImports(client, graph) {
73
+ const imports = importedNodes(graph);
74
+ if (imports.length === 0) return graph;
75
+ for (const node of [...imports, graph.root]) {
76
+ if (!node.compilerManifest)
77
+ throw new Error(`Missing compiler manifest for ${node.filePath}.`);
78
+ }
79
+ const nodes = new Map(graph.nodes);
80
+ const stored = /* @__PURE__ */ new Map();
81
+ const withPins = (node) => {
82
+ const closure = /* @__PURE__ */ new Map();
83
+ for (const dependency of node.importedPlayDependencies) {
84
+ const child = nodes.get(dependency.filePath);
85
+ const pointer = stored.get(dependency.filePath);
86
+ if (!pointer)
87
+ throw new Error(`Imported Play ${dependency.filePath} was not stored.`);
88
+ for (const [name, pin] of Object.entries(
89
+ child.artifact.importedPlayArtifacts ?? {}
90
+ ))
91
+ closure.set(name, pin);
92
+ closure.set(child.playName, pointer);
93
+ }
94
+ return {
95
+ ...node,
96
+ artifact: {
97
+ ...node.artifact,
98
+ ...closure.size ? { importedPlayArtifacts: Object.fromEntries(closure) } : {}
99
+ }
100
+ };
101
+ };
102
+ for (const original of imports) {
103
+ const node = withPins(original);
104
+ const result = await client.registerPlayArtifact({
105
+ name: node.playName,
106
+ sourceCode: node.sourceCode,
107
+ sourceFiles: node.sourceFiles,
108
+ description: node.playDescription ?? void 0,
109
+ artifact: node.artifact,
110
+ compilerManifest: node.compilerManifest,
111
+ publish: false,
112
+ artifactOnly: true
113
+ });
114
+ if (typeof result.artifactStorageKey !== "string" || !result.artifactStorageKey.trim())
115
+ throw new Error(
116
+ `No immutable artifact identity was returned for ${node.playName}.`
117
+ );
118
+ stored.set(node.filePath, {
119
+ artifactStorageKey: result.artifactStorageKey,
120
+ artifactHash: node.artifact.artifactHash,
121
+ graphHash: node.artifact.graphHash
122
+ });
123
+ nodes.set(node.filePath, node);
124
+ }
125
+ const root = withPins(graph.root);
126
+ nodes.set(root.filePath, root);
127
+ return { root, nodes };
128
+ }
129
+
130
+ // ../plays/bootstrap-routes.ts
131
+ var DEEPLINE_TOOL_CATEGORIES = [
132
+ "company_search",
133
+ "people_search",
134
+ "people_enrich",
135
+ "email_finder",
136
+ "email_verify",
137
+ "phone_finder",
138
+ "phone_verify",
139
+ "identity_resolution",
140
+ "reverse_lookup",
141
+ "enrichment",
142
+ "batch",
143
+ "premium",
144
+ "free"
145
+ ];
146
+ var PLAY_BOOTSTRAP_TEMPLATES = [
147
+ "people-list",
148
+ "company-list",
149
+ "people-email",
150
+ "people-phone",
151
+ "company-people",
152
+ "company-people-email",
153
+ "company-people-phone"
154
+ ];
155
+ var PLAY_BOOTSTRAP_SOURCE_KINDS = [
156
+ "csv",
157
+ "play",
158
+ "provider",
159
+ "providers"
160
+ ];
161
+ var PLAY_BOOTSTRAP_STAGE_KINDS = [
162
+ "play",
163
+ "provider",
164
+ "providers"
165
+ ];
166
+ var PLAY_BOOTSTRAP_FINDER_KINDS = [
167
+ "email_finder",
168
+ "phone_finder"
169
+ ];
170
+ var PLAY_BOOTSTRAP_COMPANY_PROVIDER_CATEGORY = "company_search";
171
+ var PLAY_BOOTSTRAP_PEOPLE_PROVIDER_CATEGORY = "people_search";
172
+ var PLAY_BOOTSTRAP_PROVIDER_CATEGORY_BY_FINDER = {
173
+ email_finder: "email_finder",
174
+ phone_finder: "phone_finder"
175
+ };
176
+ var PLAY_BOOTSTRAP_OUTPUT_FIELD_BY_FINDER = {
177
+ email_finder: "email",
178
+ phone_finder: "phone"
179
+ };
180
+ var PLAY_BOOTSTRAP_CONTACT_FIELDS = [
181
+ "first_name",
182
+ "last_name",
183
+ "domain",
184
+ "company_name",
185
+ "linkedin_url",
186
+ "title",
187
+ "email",
188
+ "phone"
189
+ ];
190
+ var PLAY_BOOTSTRAP_COMPANY_FIELDS = [
191
+ "domain",
192
+ "company_domain",
193
+ "company_name",
194
+ "linkedin_url",
195
+ "website"
196
+ ];
197
+ function isPlayBootstrapFinderKind(value) {
198
+ return PLAY_BOOTSTRAP_FINDER_KINDS.includes(value);
199
+ }
200
+ function isPlayBootstrapTemplate(value) {
201
+ return PLAY_BOOTSTRAP_TEMPLATES.includes(value);
202
+ }
203
+ function formatPlayBootstrapFinderKinds() {
204
+ return PLAY_BOOTSTRAP_FINDER_KINDS.join("|");
205
+ }
206
+ function formatPlayBootstrapTemplates() {
207
+ return PLAY_BOOTSTRAP_TEMPLATES.join("|");
208
+ }
209
+ function formatPlayBootstrapFinderKindsForSentence() {
210
+ const allButLast = PLAY_BOOTSTRAP_FINDER_KINDS.slice(0, -1);
211
+ const last = PLAY_BOOTSTRAP_FINDER_KINDS.at(-1);
212
+ return `${allButLast.join(", ")} or ${last}`;
213
+ }
214
+
215
+ export {
216
+ planLocalPlayExecution,
217
+ pinLocalPlayImports,
218
+ DEEPLINE_TOOL_CATEGORIES,
219
+ PLAY_BOOTSTRAP_TEMPLATES,
220
+ PLAY_BOOTSTRAP_SOURCE_KINDS,
221
+ PLAY_BOOTSTRAP_STAGE_KINDS,
222
+ PLAY_BOOTSTRAP_FINDER_KINDS,
223
+ PLAY_BOOTSTRAP_COMPANY_PROVIDER_CATEGORY,
224
+ PLAY_BOOTSTRAP_PEOPLE_PROVIDER_CATEGORY,
225
+ PLAY_BOOTSTRAP_PROVIDER_CATEGORY_BY_FINDER,
226
+ PLAY_BOOTSTRAP_OUTPUT_FIELD_BY_FINDER,
227
+ PLAY_BOOTSTRAP_CONTACT_FIELDS,
228
+ PLAY_BOOTSTRAP_COMPANY_FIELDS,
229
+ isPlayBootstrapFinderKind,
230
+ isPlayBootstrapTemplate,
231
+ formatPlayBootstrapFinderKinds,
232
+ formatPlayBootstrapTemplates,
233
+ formatPlayBootstrapFinderKindsForSentence
234
+ };