deepline 0.3.324 → 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 (133) 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/sdk/src/types.ts +6 -0
  13. package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +2 -0
  14. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +7 -1
  15. package/dist/bundling-sources/shared_libs/play-runtime/runtime-actions.ts +1 -0
  16. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +5 -0
  17. package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +84 -10
  18. package/dist/bundling-sources/shared_libs/plays/artifact-types.ts +9 -0
  19. package/dist/cli/auth-6STWK6UK.js +31 -0
  20. package/dist/cli/{auth-6KWNR6AI.mjs → auth-VON5FFUK.mjs} +4 -4
  21. package/dist/cli/{billing-VQ2NUJLB.mjs → billing-X6JUEFRE.mjs} +4 -4
  22. package/dist/cli/{billing-CLLWHIAT.js → billing-YI4RZI2O.js} +70 -70
  23. package/dist/cli/{chunk-NC2ZXG2Y.js → chunk-3NGWGFVL.js} +26 -26
  24. package/dist/cli/{chunk-5CQ554BM.mjs → chunk-4AB4Y6FF.mjs} +1 -1
  25. package/dist/cli/{chunk-EXKRHZRG.js → chunk-4LNBSQM4.js} +5928 -5730
  26. package/dist/cli/{chunk-G4F2AIQ5.js → chunk-5NXHSRRE.js} +6 -6
  27. package/dist/cli/{chunk-XNL3SEMC.js → chunk-AFNEQ43J.js} +8 -3
  28. package/dist/cli/{chunk-XSEMQ4II.js → chunk-AGH6YP2T.js} +2 -1
  29. package/dist/cli/chunk-AID3OYVJ.js +8 -0
  30. package/dist/cli/{chunk-HHZDWBSQ.mjs → chunk-BQJVMKWL.mjs} +1 -1
  31. package/dist/cli/{chunk-TJGJTB5T.mjs → chunk-BR7GGTAE.mjs} +24 -1
  32. package/dist/cli/{chunk-IXYR65PW.js → chunk-BUYZEUY4.js} +1 -1
  33. package/dist/cli/{chunk-GROXVGGW.js → chunk-CUUHQ3AO.js} +6 -6
  34. package/dist/cli/{chunk-NIOFMRYW.mjs → chunk-DFDXKOLR.mjs} +98 -113
  35. package/dist/cli/{chunk-GMO3NBE2.js → chunk-EMZ7Y5SW.js} +70 -67
  36. package/dist/cli/chunk-GVESPYSY.mjs +234 -0
  37. package/dist/cli/{chunk-N5E66DP3.js → chunk-GVYKY6T6.js} +344 -254
  38. package/dist/cli/{chunk-EHSI2DMO.mjs → chunk-IQCCGOQH.mjs} +4 -20
  39. package/dist/cli/{chunk-76VKBPOC.mjs → chunk-JOA6IKDE.mjs} +7 -2
  40. package/dist/cli/{chunk-3ZKAKQYC.mjs → chunk-KLWBAQ5A.mjs} +104 -14
  41. package/dist/cli/{chunk-PAA4FYCF.js → chunk-KZ4PCK4O.js} +29 -45
  42. package/dist/cli/chunk-LVEDPCLJ.js +234 -0
  43. package/dist/cli/{chunk-I7RLL7LN.mjs → chunk-M7CPVMDB.mjs} +1 -1
  44. package/dist/cli/{chunk-2UQUOUAW.js → chunk-MDQZQ3NY.js} +2 -2
  45. package/dist/cli/{chunk-V5PA6TCT.js → chunk-MKHSZA2X.js} +48 -48
  46. package/dist/cli/{chunk-LHJKYMTS.mjs → chunk-MOBZS4F3.mjs} +1 -1
  47. package/dist/cli/chunk-OVDNJAJN.mjs +8 -0
  48. package/dist/cli/{chunk-QM2Z4FQF.js → chunk-T33W6JUJ.js} +6 -6
  49. package/dist/cli/{chunk-DO2VA5UP.mjs → chunk-TDSNAC3C.mjs} +2 -2
  50. package/dist/cli/{chunk-D5YJHGST.js → chunk-TXVOB5J2.js} +29 -6
  51. package/dist/cli/{chunk-TZZNI2A4.js → chunk-TZQMFWLF.js} +147 -162
  52. package/dist/cli/{chunk-NQJQ3CLX.mjs → chunk-VGKVLADU.mjs} +3 -3
  53. package/dist/cli/{chunk-U2RPP53P.mjs → chunk-VKXGOQG5.mjs} +5674 -5476
  54. package/dist/cli/{chunk-AKM5JVPG.mjs → chunk-W74E5ETE.mjs} +12 -9
  55. package/dist/cli/{chunk-7PZFGB7L.mjs → chunk-YIY74KUF.mjs} +2 -1
  56. package/dist/cli/{chunk-5QZFWY7C.mjs → chunk-ZRN6YOF2.mjs} +2 -2
  57. package/dist/cli/client-TEBW2P24.js +20 -0
  58. package/dist/cli/{client-VHUKTDAZ.mjs → client-ZMOKUNL2.mjs} +3 -3
  59. package/dist/cli/{csv-5MZY7HU5.js → csv-HZRKEI7J.js} +12 -12
  60. package/dist/cli/{csv-7DA4APB6.mjs → csv-IICJHJZ4.mjs} +3 -3
  61. package/dist/cli/{db-ICG3FUVE.js → db-TM5NZF73.js} +226 -149
  62. package/dist/cli/{db-7UPW3N5U.mjs → db-X4B7YFNY.mjs} +214 -137
  63. package/dist/cli/{describe-VDRY2JCE.js → describe-BDBARWZJ.js} +28 -27
  64. package/dist/cli/{describe-ZAPGM5ND.mjs → describe-GMVS3LFC.mjs} +12 -11
  65. package/dist/cli/{executions-TK3C2FAQ.mjs → executions-447ZJMN4.mjs} +4 -4
  66. package/dist/cli/{executions-D5GYCY3A.js → executions-QX25UOQM.js} +6 -6
  67. package/dist/cli/{feedback-PZAZZUXF.js → feedback-4IXUTBX7.js} +6 -6
  68. package/dist/cli/{feedback-T4EIP5QR.mjs → feedback-JB7HHIC6.mjs} +3 -3
  69. package/dist/cli/git-C7C7DTEH.js +23 -0
  70. package/dist/cli/{git-WBFWIVO5.mjs → git-VID6KGAA.mjs} +4 -4
  71. package/dist/cli/index.js +105 -87
  72. package/dist/cli/index.mjs +65 -47
  73. package/dist/cli/{legacy-noops-LRBJWXRK.js → legacy-noops-3FYTCOZO.js} +7 -7
  74. package/dist/cli/{legacy-noops-DUCK7OKN.mjs → legacy-noops-SGR3G5WS.mjs} +4 -4
  75. package/dist/cli/{monitors-WYH5AQIO.mjs → monitors-SH4FOMBM.mjs} +4 -4
  76. package/dist/cli/{monitors-7S2SL62G.js → monitors-SP52UHS4.js} +85 -85
  77. package/dist/cli/{org-XCSMLTUW.mjs → org-B32MMIQT.mjs} +4 -4
  78. package/dist/cli/{org-EQNGGHPV.js → org-UQMX7JOR.js} +60 -60
  79. package/dist/cli/play-UCIWBN7U.js +153 -0
  80. package/dist/cli/{play-A5ISFBJM.mjs → play-XTE4LUP7.mjs} +11 -10
  81. package/dist/cli/{providers-DR2CLD3N.js → providers-JNMJJ2OH.js} +7 -7
  82. package/dist/cli/{providers-KHTZFQ5I.mjs → providers-RWLN6FUR.mjs} +4 -4
  83. package/dist/cli/{quickstart-NIRWI6YU.js → quickstart-HK6WZ342.js} +5 -5
  84. package/dist/cli/{quickstart-KT4LKORA.mjs → quickstart-IDB3Y375.mjs} +3 -3
  85. package/dist/cli/{search-WCEXPBAT.mjs → search-6D3IFNPT.mjs} +5 -5
  86. package/dist/cli/search-LUZ2S7DH.js +26 -0
  87. package/dist/cli/{secrets-QSFEZGVE.js → secrets-JOQB57IE.js} +13 -13
  88. package/dist/cli/{secrets-TN7DW3QR.mjs → secrets-TZ53CQ3D.mjs} +4 -4
  89. package/dist/cli/{sessions-WSE5FN4H.mjs → sessions-4MBDC4EK.mjs} +4 -4
  90. package/dist/cli/{sessions-LJS6W67T.js → sessions-QSAICDXX.js} +5 -5
  91. package/dist/cli/{settings-FGS3VYJN.js → settings-OTOCW7L7.js} +74 -74
  92. package/dist/cli/{settings-Z3V53A6J.mjs → settings-RKQFMLDU.mjs} +7 -7
  93. package/dist/cli/{setup-GMH4VJS3.mjs → setup-2S5TNTUB.mjs} +6 -6
  94. package/dist/cli/{setup-ZA234HEY.js → setup-AKZUDVYY.js} +41 -41
  95. package/dist/cli/skills-26LASHZF.js +28 -0
  96. package/dist/cli/{skills-7G2RZMYH.mjs → skills-AGZXDLSA.mjs} +4 -4
  97. package/dist/cli/{tools-7EE4BGXO.mjs → tools-7Y6RD6FY.mjs} +8 -7
  98. package/dist/cli/tools-L5VIJQWX.js +39 -0
  99. package/dist/cli/{update-O5QEWS7K.mjs → update-M7YGF67I.mjs} +6 -6
  100. package/dist/cli/update-MNHF6M2F.js +28 -0
  101. package/dist/cli/{workflow-KE54RUTR.mjs → workflow-CTVE7S7W.mjs} +5 -5
  102. package/dist/cli/{workflow-M5PAAW3O.js → workflow-NGMY425T.js} +15 -15
  103. package/dist/{client-BV68GMPo.d.ts → client-DHq8dJ56.d.ts} +45 -11
  104. package/dist/{client-D9ACjiRC.d.mts → client-wiWPZhnI.d.mts} +45 -11
  105. package/dist/{compiler-manifest-BXcZ4P4W.d.mts → compiler-manifest-9TkZ_ykI.d.mts} +717 -711
  106. package/dist/{compiler-manifest-BXcZ4P4W.d.ts → compiler-manifest-9TkZ_ykI.d.ts} +717 -711
  107. package/dist/index-B-5_Xhud.d.mts +75 -0
  108. package/dist/index-ykksoEyR.d.ts +75 -0
  109. package/dist/index.d.mts +52 -13
  110. package/dist/index.d.ts +52 -13
  111. package/dist/index.js +92 -28
  112. package/dist/index.mjs +91 -27
  113. package/dist/install-integrity.json +91 -84
  114. package/dist/plays/bundle-play-file.d.mts +7 -75
  115. package/dist/plays/bundle-play-file.d.ts +7 -75
  116. package/dist/plays/bundle-play-file.mjs +1 -1
  117. package/dist/plays/run-request.d.mts +2 -2
  118. package/dist/plays/run-request.d.ts +2 -2
  119. package/dist/release.d.mts +1 -1
  120. package/dist/release.d.ts +1 -1
  121. package/dist/release.js +2 -2
  122. package/dist/release.mjs +1 -1
  123. package/package.json +1 -1
  124. package/dist/cli/auth-LKSTC3YV.js +0 -31
  125. package/dist/cli/chunk-OWJZUE3Y.mjs +0 -103
  126. package/dist/cli/chunk-SDK3ZA2C.js +0 -103
  127. package/dist/cli/client-WMSTRUGP.js +0 -20
  128. package/dist/cli/git-73N6EUZ3.js +0 -23
  129. package/dist/cli/play-CLC2Z5SO.js +0 -152
  130. package/dist/cli/search-DM7IQS5F.js +0 -26
  131. package/dist/cli/skills-6APAQV6W.js +0 -28
  132. package/dist/cli/tools-EPYUFWPB.js +0 -38
  133. package/dist/cli/update-FPVX3XJC.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
+ };