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,189 @@
1
+ import type { DeeplineClient } from '../client.js';
2
+ import type { BundledPlayFileSuccess } from './bundle-play-file.js';
3
+
4
+ export type LocalPlayGraph = {
5
+ root: BundledPlayFileSuccess;
6
+ nodes: Map<string, BundledPlayFileSuccess>;
7
+ };
8
+
9
+ function importedNodes(graph: LocalPlayGraph): BundledPlayFileSuccess[] {
10
+ const visited = new Set<string>();
11
+ const visiting = new Set<string>();
12
+ const ordered: BundledPlayFileSuccess[] = [];
13
+ const names = new Map<string, string>();
14
+ const visit = (node: BundledPlayFileSuccess) => {
15
+ if (visiting.has(node.filePath))
16
+ throw new Error(`Recursive imported Play graph at ${node.filePath}.`);
17
+ if (visited.has(node.filePath)) return;
18
+ visiting.add(node.filePath);
19
+ for (const dependency of node.importedPlayDependencies) {
20
+ const child = graph.nodes.get(dependency.filePath);
21
+ if (!child)
22
+ throw new Error(
23
+ `Missing bundled Play dependency ${dependency.filePath}.`,
24
+ );
25
+ visit(child);
26
+ }
27
+ visiting.delete(node.filePath);
28
+ visited.add(node.filePath);
29
+ if (node === graph.root) return;
30
+ if (!node.playName)
31
+ throw new Error(
32
+ `Imported Play ${node.filePath} must export definePlay(...).`,
33
+ );
34
+ const existing = names.get(node.playName);
35
+ if (existing !== undefined && existing !== node.filePath)
36
+ throw new Error(
37
+ `Imported Play name ${node.playName} belongs to more than one source file.`,
38
+ );
39
+ names.set(node.playName, node.filePath);
40
+ ordered.push(node);
41
+ };
42
+ visit(graph.root);
43
+ return ordered;
44
+ }
45
+
46
+ /** Describe local execution without storing artifacts or starting cloud work. */
47
+ export function planLocalPlayExecution(
48
+ graph: LocalPlayGraph,
49
+ input: { runIdFile?: string | null } = {},
50
+ ) {
51
+ const imports = importedNodes(graph).map((node) => ({
52
+ name: node.playName!,
53
+ artifactHash: node.artifact.artifactHash,
54
+ graphHash: node.artifact.graphHash,
55
+ }));
56
+ return {
57
+ command: 'plays run',
58
+ root: {
59
+ name: graph.root.playName,
60
+ artifactHash: graph.root.artifact.artifactHash,
61
+ publication: 'unpublished' as const,
62
+ },
63
+ importedPlays: imports.map((node) => ({
64
+ ...node,
65
+ publication: 'pinned' as const,
66
+ })),
67
+ effects: {
68
+ cloudMutations: imports.length
69
+ ? [
70
+ 'store_imported_execution_artifacts',
71
+ 'stage_files_if_present',
72
+ 'register_unpublished_root_revision',
73
+ 'start_run',
74
+ ]
75
+ : [
76
+ 'stage_files_if_present',
77
+ 'register_unpublished_root_revision',
78
+ 'start_run',
79
+ ],
80
+ localWrites: input.runIdFile
81
+ ? ['bundle_cache', 'run_identity_file']
82
+ : ['bundle_cache'],
83
+ creditSpending: 'tool_calls_may_spend' as const,
84
+ recovery: 'inspect_or_resume_original_run_id' as const,
85
+ },
86
+ };
87
+ }
88
+
89
+ /** Store immutable imported execution content without changing draft or live revisions. */
90
+ export async function pinLocalPlayImports(
91
+ client: Pick<DeeplineClient, 'registerPlayArtifact'>,
92
+ graph: LocalPlayGraph,
93
+ ): Promise<LocalPlayGraph> {
94
+ const imports = importedNodes(graph);
95
+ if (imports.length === 0) return graph;
96
+ // Validate the entire graph before the first storage request.
97
+ for (const node of [...imports, graph.root]) {
98
+ if (!node.compilerManifest)
99
+ throw new Error(`Missing compiler manifest for ${node.filePath}.`);
100
+ }
101
+ const nodes = new Map(graph.nodes);
102
+ const stored = new Map<
103
+ string,
104
+ NonNullable<
105
+ BundledPlayFileSuccess['artifact']['importedPlayArtifacts']
106
+ >[string]
107
+ >();
108
+ const withPins = (node: BundledPlayFileSuccess): BundledPlayFileSuccess => {
109
+ const closure = new Map<
110
+ string,
111
+ NonNullable<
112
+ BundledPlayFileSuccess['artifact']['importedPlayArtifacts']
113
+ >[string]
114
+ >();
115
+ for (const dependency of node.importedPlayDependencies) {
116
+ const child = nodes.get(dependency.filePath)!;
117
+ const pointer = stored.get(dependency.filePath);
118
+ if (!pointer)
119
+ throw new Error(`Imported Play ${dependency.filePath} was not stored.`);
120
+ for (const [name, pin] of Object.entries(
121
+ child.artifact.importedPlayArtifacts ?? {},
122
+ ))
123
+ closure.set(name, pin);
124
+ closure.set(child.playName!, pointer);
125
+ }
126
+ return {
127
+ ...node,
128
+ artifact: {
129
+ ...node.artifact,
130
+ ...(closure.size
131
+ ? { importedPlayArtifacts: Object.fromEntries(closure) }
132
+ : {}),
133
+ },
134
+ };
135
+ };
136
+ // Children are stored before parents so every pointer refers to immutable content.
137
+ for (const original of imports) {
138
+ const node = withPins(original);
139
+ const result = await client.registerPlayArtifact({
140
+ name: node.playName!,
141
+ sourceCode: node.sourceCode,
142
+ sourceFiles: node.sourceFiles,
143
+ description: node.playDescription ?? undefined,
144
+ artifact: node.artifact,
145
+ compilerManifest: node.compilerManifest!,
146
+ publish: false,
147
+ artifactOnly: true,
148
+ });
149
+ if (
150
+ typeof result.artifactStorageKey !== 'string' ||
151
+ !result.artifactStorageKey.trim()
152
+ )
153
+ throw new Error(
154
+ `No immutable artifact identity was returned for ${node.playName}.`,
155
+ );
156
+ stored.set(node.filePath, {
157
+ artifactStorageKey: result.artifactStorageKey,
158
+ artifactHash: node.artifact.artifactHash,
159
+ graphHash: node.artifact.graphHash,
160
+ });
161
+ nodes.set(node.filePath, node);
162
+ }
163
+ const root = withPins(graph.root);
164
+ nodes.set(root.filePath, root);
165
+ return { root, nodes };
166
+ }
167
+
168
+ /** Publish exactly the reviewed import graph; the root is submitted as an unpublished run. */
169
+ export async function publishLocalPlayImports(
170
+ client: Pick<DeeplineClient, 'registerPlayArtifact'>,
171
+ graph: LocalPlayGraph,
172
+ ): Promise<void> {
173
+ const nodes = importedNodes(graph);
174
+ for (const node of nodes) {
175
+ if (!node.compilerManifest)
176
+ throw new Error(`Missing compiler manifest for ${node.filePath}.`);
177
+ }
178
+ for (const node of nodes) {
179
+ await client.registerPlayArtifact({
180
+ name: node.playName!,
181
+ sourceCode: node.sourceCode,
182
+ sourceFiles: node.sourceFiles,
183
+ description: node.playDescription ?? undefined,
184
+ artifact: node.artifact,
185
+ compilerManifest: node.compilerManifest!,
186
+ publish: true,
187
+ });
188
+ }
189
+ }
@@ -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.325',
203
+ version: '0.3.326',
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: {
@@ -26,7 +26,7 @@ const EXECUTE_RESPONSE_INTENT_HEADER = 'x-deepline-execute-response-intent';
26
26
  const RAW_V2_EXECUTE_RESPONSE_CONTRACT = RAW_V2_TOOL_RESPONSE_CONTRACT;
27
27
  const DEFAULT_EXECUTION_RECOVERY_TIMEOUT_MS = 15 * 60 * 1_000;
28
28
 
29
- function validateExecutionIdempotencyKey(key: string): void {
29
+ export function validateExecutionIdempotencyKey(key: string): void {
30
30
  if (
31
31
  typeof key !== 'string' ||
32
32
  key.length < 1 ||
@@ -614,13 +614,79 @@ function normalizeRelativePath(path: string): string {
614
614
  .replace(/^\./, '');
615
615
  }
616
616
 
617
+ /**
618
+ * Keys that carry the dialable number inside a provider's phone object, in
619
+ * preference order (Apollo `sanitized_number`, Wiza/Lusha/Forager `number`,
620
+ * Enformion `phoneNumber`, Datagma `display_international`, ...).
621
+ */
622
+ const PHONE_OBJECT_VALUE_KEYS = [
623
+ 'sanitized_number',
624
+ 'number',
625
+ 'phone',
626
+ 'phone_number',
627
+ 'phoneNumber',
628
+ 'display_international',
629
+ 'displayInternational',
630
+ 'international',
631
+ 'value',
632
+ 'raw_number',
633
+ 'raw',
634
+ 'sanitized',
635
+ ] as const;
636
+
637
+ /** Shortest real national number; anything shorter is a flag or a mask. */
638
+ const PHONE_TARGET_MIN_DIGITS = 7;
639
+
640
+ /**
641
+ * The `phone` getter is typed as one string. Providers put the number inside
642
+ * objects (`{ number, type }`) and arrays, and put availability flags under
643
+ * the same keys (`mobile_phone: true`, `has_direct_phone: "Yes"`, masked
644
+ * `"120******"`). Resolve to the first dialable string, or null when the
645
+ * value carries no phone number at all.
646
+ */
647
+ function phoneTargetValue(value: unknown): string | null {
648
+ if (typeof value === 'number' && Number.isFinite(value)) {
649
+ return phoneTargetValue(String(value));
650
+ }
651
+ if (typeof value === 'string') {
652
+ const trimmed = value.trim();
653
+ const digits = trimmed.replace(/\D/g, '').length;
654
+ return digits >= PHONE_TARGET_MIN_DIGITS ? trimmed : null;
655
+ }
656
+ if (Array.isArray(value)) {
657
+ for (const entry of value) {
658
+ const phone = phoneTargetValue(entry);
659
+ if (phone) return phone;
660
+ }
661
+ return null;
662
+ }
663
+ if (isRecord(value)) {
664
+ for (const key of PHONE_OBJECT_VALUE_KEYS) {
665
+ const phone = phoneTargetValue(value[key]);
666
+ if (phone) return phone;
667
+ }
668
+ }
669
+ return null;
670
+ }
671
+
672
+ /** The value a target accepts from a candidate, or undefined to keep looking. */
673
+ function acceptedTargetValue(
674
+ target: string | undefined,
675
+ value: unknown,
676
+ ): unknown {
677
+ if (target === 'phone') return phoneTargetValue(value) ?? undefined;
678
+ return isMeaningfulValue(value) ? value : undefined;
679
+ }
680
+
617
681
  function getFirstMeaningfulValueAtPath(
618
682
  root: unknown,
619
683
  path: string,
684
+ target?: string,
620
685
  ): ToolResultTargetMetadata | null {
621
686
  for (const entry of valuesAtSegments(root, parsePath(path))) {
622
- if (isMeaningfulValue(entry.value)) {
623
- return { value: entry.value, path: entry.path };
687
+ const value = acceptedTargetValue(target, entry.value);
688
+ if (value !== undefined) {
689
+ return { value, path: entry.path };
624
690
  }
625
691
  }
626
692
  return null;
@@ -663,10 +729,11 @@ function normalizeRows(value: unknown): Record<string, unknown>[] | null {
663
729
  function findFirstTargetByPath(
664
730
  result: unknown,
665
731
  paths: readonly string[] | undefined,
732
+ target?: string,
666
733
  ): ToolResultTargetMetadata | null {
667
734
  for (const path of paths ?? []) {
668
735
  for (const candidate of candidateResultPaths(path)) {
669
- const match = getFirstMeaningfulValueAtPath(result, candidate);
736
+ const match = getFirstMeaningfulValueAtPath(result, candidate, target);
670
737
  if (match) return match;
671
738
  }
672
739
  }
@@ -756,11 +823,10 @@ function findFirstTargetByKey(
756
823
  };
757
824
  for (const [key, value] of Object.entries(result)) {
758
825
  if (rule.reject?.some((pattern) => pattern.test(key))) continue;
759
- if (
760
- rule.match.some((pattern) => pattern.test(key)) &&
761
- isMeaningfulValue(value)
762
- ) {
763
- return { value, path: pathToString([...path, key]) };
826
+ if (!rule.match.some((pattern) => pattern.test(key))) continue;
827
+ const accepted = acceptedTargetValue(target, value);
828
+ if (accepted !== undefined) {
829
+ return { value: accepted, path: pathToString([...path, key]) };
764
830
  }
765
831
  }
766
832
  for (const [key, value] of Object.entries(result)) {
@@ -1038,7 +1104,11 @@ function buildTargets(
1038
1104
  targets[target] = emailStatusTarget;
1039
1105
  continue;
1040
1106
  }
1041
- const fromExtractor = findFirstTargetByPath(result, descriptor.paths);
1107
+ const fromExtractor = findFirstTargetByPath(
1108
+ result,
1109
+ descriptor.paths,
1110
+ target,
1111
+ );
1042
1112
  if (!fromExtractor) {
1043
1113
  // A declared null is an explicit provider answer, not permission to
1044
1114
  // guess from a similarly named sibling such as `emailDomain`.
@@ -1065,7 +1135,11 @@ function buildTargets(
1065
1135
  target,
1066
1136
  targetGetters?.[target] ?? declaredTargetPaths.get(target) ?? [],
1067
1137
  );
1068
- const fromMetadata = findFirstTargetByPath(result, targetGetters?.[target]);
1138
+ const fromMetadata = findFirstTargetByPath(
1139
+ result,
1140
+ targetGetters?.[target],
1141
+ target,
1142
+ );
1069
1143
  if (fromMetadata) {
1070
1144
  targets[target] = fromMetadata;
1071
1145
  continue;
@@ -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 _chunkMKHSZA2Xjs = require('./chunk-MKHSZA2X.js');
13
+ require('./chunk-CUUHQ3AO.js');
14
+ require('./chunk-TXVOB5J2.js');
15
+ require('./chunk-XNYIZMNQ.js');
16
+ require('./chunk-BUYZEUY4.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 = _chunkMKHSZA2Xjs.EXIT_WORKSPACE_MISMATCH; exports.clearPendingClaim = _chunkMKHSZA2Xjs.clearPendingClaim; exports.clearSatisfiedPendingClaim = _chunkMKHSZA2Xjs.clearSatisfiedPendingClaim; exports.handleRegister = _chunkMKHSZA2Xjs.handleRegister; exports.handleStatus = _chunkMKHSZA2Xjs.handleStatus; exports.handleWait = _chunkMKHSZA2Xjs.handleWait; exports.readPendingAuthClaim = _chunkMKHSZA2Xjs.readPendingAuthClaim; exports.registerAuthCommands = _chunkMKHSZA2Xjs.registerAuthCommands; exports.reportSetupCompleted = _chunkMKHSZA2Xjs.reportSetupCompleted; exports.resolvePendingAuthClaimForResume = _chunkMKHSZA2Xjs.resolvePendingAuthClaimForResume;
@@ -9,11 +9,11 @@ import {
9
9
  registerAuthCommands,
10
10
  reportSetupCompleted,
11
11
  resolvePendingAuthClaimForResume
12
- } from "./chunk-5FHU7TV4.mjs";
13
- import "./chunk-AQUNQJ5Y.mjs";
14
- import "./chunk-YE3O2UHM.mjs";
12
+ } from "./chunk-ZRN6YOF2.mjs";
13
+ import "./chunk-M7CPVMDB.mjs";
14
+ import "./chunk-BR7GGTAE.mjs";
15
15
  import "./chunk-DLIRSHV6.mjs";
16
- import "./chunk-NWBARG3F.mjs";
16
+ import "./chunk-BQJVMKWL.mjs";
17
17
  import "./chunk-NXGCO4JB.mjs";
18
18
  import "./chunk-WZYKRD7T.mjs";
19
19
  import "./chunk-KRD6H754.mjs";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  DeeplineClient,
3
3
  iterateCursorPages
4
- } from "./chunk-XIVUB36F.mjs";
4
+ } from "./chunk-KLWBAQ5A.mjs";
5
5
  import "./chunk-CBVIJSHF.mjs";
6
6
  import {
7
7
  createTimestampedName,
@@ -9,13 +9,13 @@ import {
9
9
  openInBrowser,
10
10
  printCommandEnvelope,
11
11
  shouldEmitJson
12
- } from "./chunk-AQUNQJ5Y.mjs";
12
+ } from "./chunk-M7CPVMDB.mjs";
13
13
  import {
14
14
  AuthError,
15
15
  ConfigError
16
- } from "./chunk-YE3O2UHM.mjs";
16
+ } from "./chunk-BR7GGTAE.mjs";
17
17
  import "./chunk-DLIRSHV6.mjs";
18
- import "./chunk-NWBARG3F.mjs";
18
+ import "./chunk-BQJVMKWL.mjs";
19
19
  import "./chunk-6IKARAYD.mjs";
20
20
  import {
21
21
  DeeplineError