toolsplice 0.0.0-stage → 0.0.2

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 (172) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +104 -2
  3. package/dist/abortable.d.ts +6 -0
  4. package/dist/abortable.js +50 -0
  5. package/dist/adaptive-read.d.ts +50 -0
  6. package/dist/adaptive-read.js +780 -0
  7. package/dist/answer-wait.d.ts +7 -0
  8. package/dist/answer-wait.js +45 -0
  9. package/dist/cache-reads.d.ts +18 -0
  10. package/dist/cache-reads.js +89 -0
  11. package/dist/calibration-ledger.d.ts +37 -0
  12. package/dist/calibration-ledger.js +148 -0
  13. package/dist/calibration-marker.d.ts +4 -0
  14. package/dist/calibration-marker.js +77 -0
  15. package/dist/catalog-setup.d.ts +33 -0
  16. package/dist/catalog-setup.js +89 -0
  17. package/dist/catalog.d.ts +10 -0
  18. package/dist/catalog.js +42 -0
  19. package/dist/checkpoint-files.d.ts +15 -0
  20. package/dist/checkpoint-files.js +99 -0
  21. package/dist/cli.d.ts +2 -0
  22. package/dist/cli.js +1454 -0
  23. package/dist/coalesce-reads.d.ts +6 -0
  24. package/dist/coalesce-reads.js +33 -0
  25. package/dist/codegen.d.ts +44 -0
  26. package/dist/codegen.js +479 -0
  27. package/dist/contract-caller.d.ts +23 -0
  28. package/dist/contract-caller.js +326 -0
  29. package/dist/contract-corrections.d.ts +35 -0
  30. package/dist/contract-corrections.js +159 -0
  31. package/dist/contract-schema.d.ts +7 -0
  32. package/dist/contract-schema.js +156 -0
  33. package/dist/contracts.d.ts +72 -0
  34. package/dist/contracts.js +370 -0
  35. package/dist/core.d.ts +44 -0
  36. package/dist/core.js +43 -0
  37. package/dist/db-final-answer.d.ts +9 -0
  38. package/dist/db-final-answer.js +62 -0
  39. package/dist/define.d.ts +78 -0
  40. package/dist/define.js +14 -0
  41. package/dist/doctor.d.ts +22 -0
  42. package/dist/doctor.js +91 -0
  43. package/dist/drift.d.ts +23 -0
  44. package/dist/drift.js +111 -0
  45. package/dist/execution.d.ts +38 -0
  46. package/dist/execution.js +66 -0
  47. package/dist/extract.d.ts +34 -0
  48. package/dist/extract.js +73 -0
  49. package/dist/final-answer-stores.d.ts +71 -0
  50. package/dist/final-answer-stores.js +72 -0
  51. package/dist/final-answer.d.ts +32 -0
  52. package/dist/final-answer.js +104 -0
  53. package/dist/impact.d.ts +48 -0
  54. package/dist/impact.js +71 -0
  55. package/dist/index.d.ts +51 -0
  56. package/dist/index.js +47 -0
  57. package/dist/local-tool.d.ts +18 -0
  58. package/dist/local-tool.js +32 -0
  59. package/dist/mcp-apps.d.ts +53 -0
  60. package/dist/mcp-apps.js +32 -0
  61. package/dist/mcp-event-delivery.d.ts +98 -0
  62. package/dist/mcp-event-delivery.js +211 -0
  63. package/dist/mcp-extensions.d.ts +46 -0
  64. package/dist/mcp-extensions.js +200 -0
  65. package/dist/mcp-peer.d.ts +45 -0
  66. package/dist/mcp-peer.js +207 -0
  67. package/dist/mcp-server-card.d.ts +21 -0
  68. package/dist/mcp-server-card.js +54 -0
  69. package/dist/ordered-transport.d.ts +12 -0
  70. package/dist/ordered-transport.js +106 -0
  71. package/dist/page-checkpoint.d.ts +71 -0
  72. package/dist/page-checkpoint.js +286 -0
  73. package/dist/page-read-gate.d.ts +15 -0
  74. package/dist/page-read-gate.js +48 -0
  75. package/dist/pattern.d.ts +3 -0
  76. package/dist/pattern.js +54 -0
  77. package/dist/postgres.d.ts +41 -0
  78. package/dist/postgres.js +264 -0
  79. package/dist/probe.d.ts +29 -0
  80. package/dist/probe.js +121 -0
  81. package/dist/proxy.d.ts +40 -0
  82. package/dist/proxy.js +436 -0
  83. package/dist/read-pages.d.ts +25 -0
  84. package/dist/read-pages.js +85 -0
  85. package/dist/read-policy.d.ts +6 -0
  86. package/dist/read-policy.js +16 -0
  87. package/dist/read-steps.d.ts +12 -0
  88. package/dist/read-steps.js +36 -0
  89. package/dist/result-session.d.ts +109 -0
  90. package/dist/result-session.js +620 -0
  91. package/dist/route-checkpoint.d.ts +3 -0
  92. package/dist/route-checkpoint.js +80 -0
  93. package/dist/route-driver-cli.d.ts +3 -0
  94. package/dist/route-driver-cli.js +43 -0
  95. package/dist/route-evaluation.d.ts +141 -0
  96. package/dist/route-evaluation.js +329 -0
  97. package/dist/row-groups.d.ts +17 -0
  98. package/dist/row-groups.js +79 -0
  99. package/dist/row-query.d.ts +62 -0
  100. package/dist/row-query.js +172 -0
  101. package/dist/rules.d.ts +30 -0
  102. package/dist/rules.js +72 -0
  103. package/dist/run-diagnostics.d.ts +75 -0
  104. package/dist/run-diagnostics.js +212 -0
  105. package/dist/runtime.d.ts +6 -0
  106. package/dist/runtime.js +26 -0
  107. package/dist/schema.d.ts +17 -0
  108. package/dist/schema.js +299 -0
  109. package/dist/search-fetch.d.ts +50 -0
  110. package/dist/search-fetch.js +264 -0
  111. package/dist/shape.d.ts +91 -0
  112. package/dist/shape.js +499 -0
  113. package/dist/skill-files.d.ts +9 -0
  114. package/dist/skill-files.js +49 -0
  115. package/dist/splice-diagnostics.d.ts +44 -0
  116. package/dist/splice-diagnostics.js +88 -0
  117. package/dist/splice-measure.d.ts +33 -0
  118. package/dist/splice-measure.js +55 -0
  119. package/dist/splice-project.d.ts +125 -0
  120. package/dist/splice-project.js +348 -0
  121. package/dist/splice-recording.d.ts +132 -0
  122. package/dist/splice-recording.js +481 -0
  123. package/dist/splice.d.ts +181 -0
  124. package/dist/splice.js +1263 -0
  125. package/dist/sqlite-checkpoint-store.d.ts +5 -0
  126. package/dist/sqlite-checkpoint-store.js +91 -0
  127. package/dist/sqlite-checkpoint-worker.d.ts +1 -0
  128. package/dist/sqlite-checkpoint-worker.js +115 -0
  129. package/dist/storage.d.ts +17 -0
  130. package/dist/storage.js +1 -0
  131. package/dist/store.d.ts +151 -0
  132. package/dist/store.js +735 -0
  133. package/dist/test-difference.d.ts +13 -0
  134. package/dist/test-difference.js +42 -0
  135. package/dist/testing.d.ts +122 -0
  136. package/dist/testing.js +261 -0
  137. package/dist/text-pages.d.ts +24 -0
  138. package/dist/text-pages.js +36 -0
  139. package/dist/tool-discovery.d.ts +59 -0
  140. package/dist/tool-discovery.js +136 -0
  141. package/dist/unevaluated.d.ts +7 -0
  142. package/dist/unevaluated.js +156 -0
  143. package/dist/v2.d.ts +49 -0
  144. package/dist/v2.js +413 -0
  145. package/dist/validate-output.d.ts +3 -0
  146. package/dist/validate-output.js +73 -0
  147. package/dist/version.d.ts +1 -0
  148. package/dist/version.js +1 -0
  149. package/dist/workflow-json.d.ts +8 -0
  150. package/dist/workflow-json.js +74 -0
  151. package/docs/AGENT-FRAMEWORKS.md +431 -0
  152. package/docs/BENCHMARKS.md +43 -0
  153. package/docs/INTEGRATION-QUICKSTART.md +859 -0
  154. package/docs/LEARNING-AND-STORAGE.md +393 -0
  155. package/docs/MCP.md +204 -0
  156. package/docs/PROJECTS-AND-UPGRADES.md +173 -0
  157. package/docs/PYTHON-REFERENCE.md +348 -0
  158. package/docs/PYTHON.md +120 -0
  159. package/docs/RECORDING-AND-CORRECTIONS.md +205 -0
  160. package/docs/TESTING.md +259 -0
  161. package/examples/mcp-app/build.mjs +11 -0
  162. package/examples/mcp-app/view.mjs +22 -0
  163. package/examples/quickstart.mjs +43 -0
  164. package/examples/route-driver.mjs +67 -0
  165. package/integrations/ai.d.mts +36 -0
  166. package/integrations/ai.mjs +178 -0
  167. package/integrations/call-options.mjs +9 -0
  168. package/integrations/langchain.d.mts +31 -0
  169. package/integrations/langchain.mjs +114 -0
  170. package/integrations/managed.mjs +154 -0
  171. package/integrations/types.d.mts +13 -0
  172. package/package.json +139 -4
@@ -0,0 +1,264 @@
1
+ import { currentDiagnostics, recordReadResult } from "./run-diagnostics.js";
2
+ import { markdownPageFacts } from "./adaptive-read.js";
3
+ import { abortable, withCallDeadline, isReadDeadline } from "./abortable.js";
4
+ import { readSplicePath } from "./splice.js";
5
+ import { copyJson, jsonObject, pointerParts } from "./workflow-json.js";
6
+ function positiveRank(rank) {
7
+ return typeof rank === "number" && Number.isSafeInteger(rank) && rank >= 1;
8
+ }
9
+ function canonicalOrigin(authority) {
10
+ const match = /^(https?):\/\/(\[[a-f0-9:.]+\]|[a-z0-9.-]+)(?::\d{1,5})?$/i.exec(authority);
11
+ if (!match)
12
+ return;
13
+ try {
14
+ const url = new URL(authority);
15
+ // Reject ambiguous legacy IPv4 spellings in a source-provided location.
16
+ if (!match[2].startsWith("[") && url.hostname !== match[2].toLowerCase())
17
+ return;
18
+ return url.origin;
19
+ }
20
+ catch {
21
+ return;
22
+ }
23
+ }
24
+ function trustedOrigins(origins) {
25
+ if (!Array.isArray(origins) || !origins.length)
26
+ throw new TypeError("Specify allowed HTTP(S) origins.");
27
+ return new Set(origins.map((s) => {
28
+ const origin = typeof s === "string" && canonicalOrigin(s.replace(/\/$/, ""));
29
+ if (!origin)
30
+ throw new TypeError("Expected an HTTP(S) origin without credentials or a path.");
31
+ return origin;
32
+ }));
33
+ }
34
+ // Local JSON Pointer references keep pointing into the search schema after nesting.
35
+ // Visit only schema positions so example payloads and const values stay literal.
36
+ function nestSearchSchema(root) {
37
+ function visit(value, top = false) {
38
+ if (!jsonObject(value) || (!top && Object.hasOwn(value, "$id")))
39
+ return;
40
+ if (typeof value.$ref === "string" &&
41
+ (value.$ref === "#" || value.$ref.startsWith("#/")))
42
+ value.$ref = "#/properties/search" + value.$ref.slice(1);
43
+ for (const key of [
44
+ "properties",
45
+ "patternProperties",
46
+ "$defs",
47
+ "definitions",
48
+ "dependentSchemas",
49
+ "dependencies",
50
+ ]) {
51
+ const schemas = value[key];
52
+ if (jsonObject(schemas))
53
+ Object.values(schemas).forEach((s) => visit(s));
54
+ }
55
+ for (const key of [
56
+ "items",
57
+ "prefixItems",
58
+ "allOf",
59
+ "anyOf",
60
+ "oneOf",
61
+ "not",
62
+ "if",
63
+ "then",
64
+ "else",
65
+ "contains",
66
+ "additionalItems",
67
+ "additionalProperties",
68
+ "propertyNames",
69
+ "unevaluatedProperties",
70
+ "unevaluatedItems",
71
+ "contentSchema",
72
+ ]) {
73
+ const sub = value[key];
74
+ if (Array.isArray(sub))
75
+ sub.forEach((s) => visit(s));
76
+ else
77
+ visit(sub);
78
+ }
79
+ }
80
+ const metadata = {};
81
+ for (const k of ["$schema", "$id"])
82
+ if (Object.hasOwn(root, k)) {
83
+ metadata[k] = root[k];
84
+ delete root[k];
85
+ }
86
+ visit(root, true);
87
+ return metadata;
88
+ }
89
+ export class SearchFetchTool {
90
+ search;
91
+ fetchPage;
92
+ definition;
93
+ #origins;
94
+ #rank;
95
+ #flat;
96
+ #extras;
97
+ #markdown;
98
+ #headingLevel;
99
+ #results;
100
+ #url;
101
+ #argument;
102
+ #retryFetchIf;
103
+ constructor(search, fetchPage, options) {
104
+ this.search = search;
105
+ this.fetchPage = fetchPage;
106
+ this.#origins = trustedOrigins(options.origins);
107
+ if (options.retryFetchIf !== undefined &&
108
+ typeof options.retryFetchIf !== "function")
109
+ throw new TypeError("retryFetchIf must be a function.");
110
+ this.#retryFetchIf = options.retryFetchIf;
111
+ this.#rank = options.rank ?? 1;
112
+ if (this.#rank !== "input" && !positiveRank(this.#rank))
113
+ throw new RangeError("Expected a positive result rank.");
114
+ this.#results = options.resultsPath ?? "/results";
115
+ this.#url = options.urlPath ?? "/contentUrl";
116
+ this.#argument = options.urlArgument ?? "url";
117
+ if ([this.#results, this.#url].some((p) => pointerParts(p).length > 32))
118
+ throw new Error("Handoff paths allow at most 32 segments.");
119
+ const input = copyJson(search.definition.inputSchema);
120
+ const dynamic = this.#rank === "input";
121
+ const properties = input.properties ?? {};
122
+ this.#markdown = options.pageView === "markdown";
123
+ if (options.headingLevel !== undefined && (!this.#markdown || !Number.isInteger(options.headingLevel) || options.headingLevel < 1 || options.headingLevel > 6))
124
+ throw new RangeError("headingLevel requires a Markdown view and an integer from 1 to 6.");
125
+ this.#headingLevel = options.headingLevel ?? 1;
126
+ if (options.pageView !== undefined &&
127
+ !["page", "markdown"].includes(options.pageView))
128
+ throw new TypeError("Unknown page view.");
129
+ const extras = {};
130
+ if (dynamic)
131
+ extras.rank = {
132
+ type: "integer",
133
+ minimum: 1,
134
+ description: "One-based result position. Use 1 for first, 2 for second.",
135
+ };
136
+ if (this.#markdown)
137
+ extras.countLiteral = {
138
+ type: "string",
139
+ minLength: 1,
140
+ maxLength: 256,
141
+ description: "To count exact case-sensitive occurrences in the full Markdown page, supply the requested literal.",
142
+ };
143
+ this.#extras = new Set(Object.keys(extras));
144
+ this.#flat =
145
+ input.type === "object" &&
146
+ !JSON.stringify(input).includes('"$ref":') &&
147
+ jsonObject(properties) &&
148
+ Object.keys(extras).every((k) => !Object.hasOwn(properties, k)) &&
149
+ Object.keys(input).every((k) => [
150
+ "type",
151
+ "properties",
152
+ "required",
153
+ "additionalProperties",
154
+ "title",
155
+ "description",
156
+ "$comment",
157
+ "$schema",
158
+ "$defs",
159
+ "definitions",
160
+ ].includes(k));
161
+ const flat = this.#flat && jsonObject(properties);
162
+ const wrapped = flat
163
+ ? { ...input }
164
+ : {
165
+ ...(this.#extras.size ? nestSearchSchema(input) : {}),
166
+ type: "object",
167
+ additionalProperties: false,
168
+ };
169
+ wrapped.properties = {
170
+ ...(flat ? properties : { search: input }),
171
+ ...extras,
172
+ };
173
+ wrapped.required = [
174
+ ...(flat
175
+ ? Array.isArray(input.required)
176
+ ? input.required
177
+ : []
178
+ : ["search"]),
179
+ ...(dynamic ? ["rank"] : []),
180
+ ];
181
+ const result = this.#markdown
182
+ ? `Returns the exact requestedUrl and first Markdown H${this.#headingLevel} heading. Supply countLiteral when the request asks for a literal count. The returned count covers the full page.`
183
+ : "A successful call has already fetched the page. Use the returned page evidence to answer.";
184
+ this.definition = {
185
+ name: options.name ?? "search_then_fetch",
186
+ description: `Search and fetch ${dynamic ? "the selected result (one-based rank)" : "result number " + this.#rank} in one call. Preserve the supplied search arguments exactly. ${result} If the rank is absent it returns no_match.`,
187
+ inputSchema: this.#extras.size ? wrapped : input,
188
+ };
189
+ }
190
+ execute(args, options) {
191
+ const trace = currentDiagnostics();
192
+ const result = withCallDeadline(options, "Search-to-fetch handoff timed out.", (bounded) => this.#run(args, bounded));
193
+ return trace ? result.catch(error => {
194
+ const type = options?.signal?.aborted ? "cancel" : isReadDeadline(error) ? "deadline" : error?.name === "AbortError" ? "cancel" : "handoff-error";
195
+ trace.record({ type });
196
+ throw error;
197
+ }) : result;
198
+ }
199
+ async #run(args, options) {
200
+ options?.signal?.throwIfAborted();
201
+ const dynamic = this.#rank === "input";
202
+ const rank = dynamic ? args.rank : this.#rank;
203
+ const nested = this.#extras.size > 0 && !this.#flat;
204
+ const searchArgs = nested
205
+ ? args.search
206
+ : this.#extras.size
207
+ ? Object.fromEntries(Object.entries(args).filter(([k]) => !this.#extras.has(k)))
208
+ : args;
209
+ const literal = this.#markdown ? args.countLiteral : undefined;
210
+ if (literal !== undefined &&
211
+ (typeof literal !== "string" ||
212
+ !literal.length ||
213
+ Array.from(literal).length > 256))
214
+ throw new TypeError("countLiteral must contain 1 to 256 characters.");
215
+ if (!positiveRank(rank) ||
216
+ !jsonObject(searchArgs) ||
217
+ (nested &&
218
+ Object.keys(args).some((k) => k !== "search" && !this.#extras.has(k))))
219
+ throw new TypeError("Invalid search arguments or result rank.");
220
+ const trace = currentDiagnostics();
221
+ trace?.record({ type: "read", operation: "search" });
222
+ const hits = readSplicePath(recordReadResult(await this.search.execute(copyJson(searchArgs), options)), this.#results).value;
223
+ options?.signal?.throwIfAborted();
224
+ if (!Array.isArray(hits))
225
+ throw new Error("The search result collection must be an array.");
226
+ if (rank > hits.length)
227
+ return { status: "no_match", rank, totalResults: hits.length };
228
+ const url = readSplicePath(hits[rank - 1], this.#url).value;
229
+ const authority = typeof url === "string" &&
230
+ !/[\s\\\x00-\x1f\x7f]/u.test(url) &&
231
+ /^(https?:\/\/[^/?#]+)(?:[/?#]|$)/i.exec(url)?.[1];
232
+ const origin = authority && canonicalOrigin(authority);
233
+ if (!origin || !this.#origins.has(origin))
234
+ throw new Error("The selected result has no permitted fetch URL.");
235
+ options?.signal?.throwIfAborted();
236
+ const fetch = () => {
237
+ trace?.record({ type: "read", operation: "fetch" });
238
+ return this.fetchPage.execute({ [this.#argument]: url }, options);
239
+ };
240
+ let page;
241
+ try {
242
+ page = await fetch();
243
+ }
244
+ catch (error) {
245
+ options?.signal?.throwIfAborted();
246
+ const decide = this.#retryFetchIf;
247
+ if (!decide || (error instanceof Error && error.name === "AbortError"))
248
+ throw error;
249
+ if ((await abortable(() => decide(error), options?.signal)) !== true)
250
+ throw error;
251
+ options?.signal?.throwIfAborted();
252
+ trace?.record({ type: "retry" });
253
+ page = await fetch();
254
+ }
255
+ options?.signal?.throwIfAborted();
256
+ recordReadResult(page);
257
+ return this.#markdown
258
+ ? { requestedUrl: url, ...markdownPageFacts(page, literal, this.#headingLevel) }
259
+ : { requestedUrl: url, page };
260
+ }
261
+ }
262
+ export function searchThenFetch(search, fetchPage, options) {
263
+ return new SearchFetchTool(search, fetchPage, options);
264
+ }
@@ -0,0 +1,91 @@
1
+ export type StringFormat = "date-time" | "date" | "email" | "uri" | "uuid";
2
+ export interface StringStats {
3
+ count: number;
4
+ /** Distinct values and how often each was seen; null once there were too many to track. */
5
+ values: Record<string, number> | null;
6
+ formats: Partial<Record<StringFormat, number>>;
7
+ minLength: number;
8
+ maxLength: number;
9
+ examples: string[];
10
+ /** Values were not recorded because the key looked like a secret. */
11
+ redacted?: boolean;
12
+ /** How many of the strings were themselves JSON objects or arrays. */
13
+ jsonCount?: number;
14
+ /** Shape of the JSON found inside the strings. */
15
+ json?: Shape;
16
+ }
17
+ export interface NumberStats {
18
+ count: number;
19
+ integers: number;
20
+ min: number;
21
+ max: number;
22
+ examples: number[];
23
+ /** Numeric values under sensitive keys must not survive in bounds or examples. */
24
+ redacted?: boolean;
25
+ }
26
+ export interface ArrayStats {
27
+ count: number;
28
+ items: Shape;
29
+ minItems: number;
30
+ maxItems: number;
31
+ /** Some elements were not observed; their types are unknown. */
32
+ truncated?: boolean;
33
+ /** Known-sensitive containers retain no child structure. */
34
+ redacted?: boolean;
35
+ }
36
+ export interface ObjectStats {
37
+ count: number;
38
+ props: Record<string, Shape>;
39
+ /** Stopped tracking new keys after hitting the limit; the object is probably a map. */
40
+ truncated?: boolean;
41
+ /** Known-sensitive containers retain no child structure. */
42
+ redacted?: boolean;
43
+ }
44
+ export interface Shape {
45
+ count: number;
46
+ null: number;
47
+ boolean: number;
48
+ number?: NumberStats;
49
+ string?: StringStats;
50
+ array?: ArrayStats;
51
+ object?: ObjectStats;
52
+ }
53
+ /**
54
+ * Which real values may be stored as examples, and strings as enum candidates.
55
+ * safe: a heuristic for short token-like values (statuses, kinds, dates); it cannot guarantee privacy.
56
+ * all: anything short enough. none: no examples or enum candidates.
57
+ * Keys and statistics (including numeric bounds) remain; this is not anonymization.
58
+ */
59
+ export type ExamplePolicy = "safe" | "all" | "none";
60
+ export interface ObserveOptions {
61
+ examples: ExamplePolicy;
62
+ maxDistinct: number;
63
+ maxExamples: number;
64
+ maxExampleLength: number;
65
+ maxArraySample: number;
66
+ maxDepth: number;
67
+ maxProps: number;
68
+ /** Per-observation node budget, defaults to 10,000 (hard ceiling 100,000). */
69
+ maxNodes?: number;
70
+ /** Maximum retained Shape nodes across calls/merges, including the root (minimum 1). */
71
+ maxRetainedNodes?: number;
72
+ /** Largest string we'll try to parse as embedded JSON. */
73
+ maxJsonStringLength: number;
74
+ }
75
+ export declare const DEFAULT_OPTIONS: ObserveOptions;
76
+ /** Short values that look like enum members or dates rather than personal data, paths or secrets. */
77
+ export declare function isSafeValue(value: string): boolean;
78
+ /** Keys like `apiKey`, `access_token`, `X-Authorization` suppress examples and enum candidates. */
79
+ export declare function isSensitiveKey(key: string): boolean;
80
+ export declare function emptyShape(): Shape;
81
+ export declare function observe(shape: Shape, value: unknown, options?: ObserveOptions): Shape;
82
+ /** Combines two shapes as if every value behind `source` had been observed into `target`. */
83
+ export declare function mergeInto(target: Shape, source: Shape, o?: ObserveOptions): Shape;
84
+ /** True if some string field consistently holds a JSON document (every value seen there was JSON). */
85
+ export declare function hasEmbeddedJson(shape: Shape): boolean;
86
+ export declare function shapeFromValues(values: unknown[], options?: ObserveOptions): Shape;
87
+ /**
88
+ * Reapply an examples policy in place to a persisted shape, without observing values or
89
+ * changing counts. Field names and nonsensitive numeric bounds remain; this is not PII removal.
90
+ */
91
+ export declare function applyShapePolicy(shape: Shape, options?: ObserveOptions): Shape;