@typed-sql/core 2.0.0-rc.1 → 2.1.0-rc.1

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 (36) hide show
  1. package/CHANGELOG.md +170 -0
  2. package/dist/packages/core/src/artifact-compatibility.d.ts +46 -0
  3. package/dist/packages/core/src/artifact-compatibility.d.ts.map +1 -0
  4. package/dist/packages/core/src/artifact-compatibility.js +168 -0
  5. package/dist/packages/core/src/artifact-compatibility.js.map +1 -0
  6. package/dist/packages/core/src/debug.d.ts +39 -0
  7. package/dist/packages/core/src/debug.d.ts.map +1 -0
  8. package/dist/packages/core/src/debug.js +87 -0
  9. package/dist/packages/core/src/debug.js.map +1 -0
  10. package/dist/packages/core/src/diagnostics.d.ts +112 -0
  11. package/dist/packages/core/src/diagnostics.d.ts.map +1 -1
  12. package/dist/packages/core/src/diagnostics.js +28 -0
  13. package/dist/packages/core/src/diagnostics.js.map +1 -1
  14. package/dist/packages/core/src/dialect-capabilities.d.ts +63 -0
  15. package/dist/packages/core/src/dialect-capabilities.d.ts.map +1 -0
  16. package/dist/packages/core/src/dialect-capabilities.js +287 -0
  17. package/dist/packages/core/src/dialect-capabilities.js.map +1 -0
  18. package/dist/packages/core/src/index.d.ts +10 -4
  19. package/dist/packages/core/src/index.d.ts.map +1 -1
  20. package/dist/packages/core/src/index.js +4 -1
  21. package/dist/packages/core/src/index.js.map +1 -1
  22. package/dist/packages/core/src/query.d.ts +43 -5
  23. package/dist/packages/core/src/query.d.ts.map +1 -1
  24. package/dist/packages/core/src/query.js +182 -9
  25. package/dist/packages/core/src/query.js.map +1 -1
  26. package/dist/packages/core/src/resolver.d.ts +10 -3
  27. package/dist/packages/core/src/resolver.d.ts.map +1 -1
  28. package/dist/packages/core/src/resolver.js +95 -3
  29. package/dist/packages/core/src/resolver.js.map +1 -1
  30. package/dist/packages/core/src/result-validation.d.ts +2 -2
  31. package/dist/packages/core/src/result-validation.d.ts.map +1 -1
  32. package/dist/packages/core/src/types.d.ts +89 -1
  33. package/dist/packages/core/src/types.d.ts.map +1 -1
  34. package/dist/packages/core/src/types.js +9 -0
  35. package/dist/packages/core/src/types.js.map +1 -1
  36. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,175 @@
1
1
  # @typed-sql/core
2
2
 
3
+ ## 2.1.0-rc.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Publish the coherent 2.1.0-rc.1 release-candidate train.
8
+
9
+ ## 2.1.0-rc.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 58bd4d1: Add the versioned, serializable source-analysis service shared by batch checks and editor tooling.
14
+ Results carry deterministic source, project, schema, type-policy, grammar, and capability identities;
15
+ cancellation and source, query-count, structural-variant, and generated-declaration limits fail closed.
16
+ - 58aa9ef: Add a grammar-neutral serialized artifact compatibility identity and deterministic compatibility outcomes, and use the shared identity contract for query-manifest cache reuse.
17
+ - 65b662f: Add structured opt-in debug events and confirmed support-bundle generation with privacy-safe default redaction.
18
+ - e433feb: Allow non-empty arrays of typed SQL fragments to be interpolated directly as homogeneous,
19
+ comma-separated structure. Add fail-closed compiler analysis for direct map callbacks and fragment
20
+ literals, cardinality-independent artifacts, bounded prepared-cardinality caches, shared grammar
21
+ conformance, and runtime limits while preserving ordinary arrays as single bound values.
22
+ - 0efc90c: Add neutral column charset and collation evidence, generated versioned MySQL built-in catalogs,
23
+ catalog-backed type and function availability, MySQL collation coercibility, and signed/unsigned
24
+ numeric expression resolution.
25
+ Conformance v2 now compares grammar analysis against the neutral resolved-column contract while
26
+ allowing grammar-owned result evidence.
27
+ - 6f5b977: Resolve PostgreSQL operators and snapshot v2 routines through a grammar-owned candidate selector
28
+ that uses canonical types, cast contexts, preferred categories, unknown-literal rules, domains,
29
+ arrays, ranges, enums, and the `anyelement` and `anycompatible` polymorphic families.
30
+ Named, defaulted, expanded-variadic, and explicit-variadic routine calls now select against snapshot
31
+ argument evidence, while known invalid explicit casts produce a stable diagnostic.
32
+ The versioned core catalog now recognizes PostgreSQL temporal, bit-string, network, geometric,
33
+ full-text, XML, range, multirange, object-identifier, and related scalar types. Unary numeric and
34
+ bitwise operators, plus binary integer and bit-string operators, now resolve through typed
35
+ candidates and reject invalid operands. Date, timestamp, time, and interval arithmetic now uses
36
+ asymmetric PostgreSQL signatures, with parameter inference deferred until candidate selection.
37
+ Built-in range/multirange containment and arithmetic, network containment and address arithmetic,
38
+ full-text search composition, JSON-path predicates and deletion, and their multi-character tokens
39
+ now use exact grammar-owned signatures.
40
+ Geometric transformation, position, intersection, distance, containment, and relationship operators
41
+ now resolve through their exact operand and result signatures, including prefix forms.
42
+ Numeric promotion, mathematical prefix, bit-string shift, binary/JSON/text concatenation, money,
43
+ `pg_lsn`, and tuple-identifier operators now use catalog-derived signatures and coercions.
44
+ Array subscripts infer nullable element types, slices preserve the array type, omitted bounds are
45
+ represented explicitly, index parameters infer `integer`, and nested array mappings retain every dimension.
46
+ `ANY`, `SOME`, and `ALL` comparisons now resolve array elements or single-column subqueries through
47
+ the operator catalog, while row comparisons validate arity and select an operator for each field pair.
48
+ Parenthesized composite field selection now uses snapshot v2 field evidence for its database type,
49
+ TypeScript type, nullability, parameter context, and unknown-field diagnostics.
50
+ `COLLATE` now preserves collatable expression types, and `AT TIME ZONE` resolves PostgreSQL's exact
51
+ timestamp, timestamp-with-time-zone, and time-with-time-zone conversions with text or interval zones.
52
+ PostgreSQL 17 and newer also resolve and version-gate the corresponding `AT LOCAL` forms.
53
+ Scalar and row-valued `IN` lists and subqueries now validate equality candidates, numeric literals,
54
+ row arity, composite field comparability, nullability, and per-position parameter contexts.
55
+ The versioned cast catalogs now include every direct `pg_cast` conversion among shipped core types
56
+ for PostgreSQL 14 through 18, including the PostgreSQL 15 geometric removal and PostgreSQL 18
57
+ integer/bytea additions. Automatic assignment-to-string and explicit string I/O casts follow the
58
+ server's fallback conversion rules.
59
+ PostgreSQL interval literals now parse prefix precision, every valid field and field-range qualifier,
60
+ suffix second precision, and qualified interval cast types while retaining typed-literal source spans.
61
+ All forms resolve through the canonical `interval` type, and invalid field ranges fail during parsing.
62
+ JSON, JSONB, and JSONPATH typed literals now preserve their grammar-owned cast form. The core catalog
63
+ and resolver cover `jsonb_path_exists`, `jsonb_path_match`, query-array, query-first, and set-returning
64
+ query variants, including timezone-aware forms, optional variables/silent arguments, and nullability.
65
+ Database parameter identities are now retained even when their configured TypeScript mapping is
66
+ `unknown`, so JSON and other deliberately opaque codecs still produce typed prepared parameters.
67
+ PostgreSQL 17 and newer now parse and resolve the grammar-owned `JSON_EXISTS` SQL/JSON expression,
68
+ including formatted inputs, `PASSING` variables, error behavior, parameter identities, nullability,
69
+ and server-version diagnostics.
70
+ The grammar-owned PostgreSQL 17 `JSON_QUERY` form also resolves returning types, JSON output formats,
71
+ wrapper and quote behavior, constant `ON EMPTY` and `ON ERROR` defaults, and exact output nullability.
72
+ PostgreSQL 17 `JSON_VALUE` now resolves scalar return types and behaviors while preserving its
73
+ always-possible SQL null result for JSON null and rejecting unsupported collection or format clauses.
74
+ PostgreSQL 16 and newer now parse and resolve the standard `JSON_OBJECT` and `JSON_ARRAY`
75
+ constructors, including key/value and query forms, null handling, unique-key declarations, formatted
76
+ inputs, encoded returns, parameter identities, non-null output types, and server-version diagnostics.
77
+ Legacy and quoted `json_object(...)` calls remain ordinary catalog-backed routine calls.
78
+ PostgreSQL 17 and newer also own `JSON`, `JSON_SCALAR`, and `JSON_SERIALIZE`, including JSON-compatible
79
+ inputs, uniqueness declarations, scalar and composite conversion, string or binary returns, UTF-8
80
+ encoding, parameter inference, null propagation, and version diagnostics. The overlapping pre-17
81
+ functional `json(...)` cast keeps its earlier cast semantics.
82
+ PostgreSQL 16 and newer now own `IS JSON` and `IS NOT JSON` predicates across value, scalar,
83
+ array, object, and unique-key constraints, with JSON-compatible input validation, text parameter
84
+ inference, SQL-null propagation, and server-version diagnostics.
85
+ PostgreSQL 16 and newer now also own the standard `JSON_OBJECTAGG` and `JSON_ARRAYAGG` grammar,
86
+ including null and uniqueness clauses, aggregate-local ordering, `FILTER`, `OVER`, formatted inputs,
87
+ encoded returns, grouping validation, parameter inference, nullable empty-input results, and
88
+ server-version diagnostics.
89
+ PostgreSQL 17 `JSON_TABLE` now owns its table-reference grammar and resolves root, ordinality,
90
+ scalar, formatted, `EXISTS`, and nested columns with implicit lateral scope, alias lists, declared
91
+ types, behavior validation, nested null-padding, and server-version diagnostics.
92
+
93
+ Expose optional routine argument names and default evidence through the neutral resolver bridge so
94
+ grammar packages can implement named, defaulted, and variadic call selection.
95
+ - 1c64475: Complete PostgreSQL DML parsing and analysis for identity overriding, `ON CONFLICT` targets and the
96
+ `excluded` namespace, row assignments, source-aware update/delete returning, versioned `MERGE`, and
97
+ PostgreSQL 18 old/new `RETURNING` aliases. Version-dependent forms now use server-major evidence and
98
+ fail closed when that evidence is absent or outside the feature's supported range. Snapshot v2 index
99
+ evidence now verifies expression, operator-class, collation, and partial-predicate conflict targets,
100
+ while insert/select, update, and merge writes propagate parameter types and reject known-incompatible
101
+ source types.
102
+
103
+ The neutral resolver snapshot bridge now exposes optional index and constraint-deferrability evidence
104
+ so grammar packages can consume schema v2 conflict-target metadata without importing schema internals.
105
+ - 1c64475: Add canonical schema snapshot format 2 with isolated v1/v2 codecs, conservative v1 upgrades,
106
+ neutral relation/constraint/index/type/routine evidence, and complete provider introspection.
107
+ Resolvers now consume structural write and routine evidence, while drift, compatibility, manifests,
108
+ verification proofs, and plan artifacts bind to the schema format and canonical hash.
109
+ - 1c64475: Add deterministic versioned dialect capability states backed by normalized server versions,
110
+ settings, extensions, and compile options. Query manifests now invalidate on capability changes and
111
+ record evidence for capabilities each query uses, while the CLI exposes a human-readable capability
112
+ report. The boolean capability map remains available as an additive migration bridge.
113
+
114
+ ### Patch Changes
115
+
116
+ - ff0e3bb: Harden PostgreSQL execution with policy-owned scalar and array codecs, runtime extension codec OID
117
+ resolution, generated-snapshot compatibility checks, bounded per-connection prepared-statement
118
+ caches with schema and search-path invalidation, and structured driver failure classifications.
119
+ Keep the shared `TSQ230` diagnostic registry text grammar-neutral.
120
+ - 1c64475: Resolve SQLite core built-ins, operators, coercions, arities, nullability, and in-band function
121
+ release boundaries from SQLite-owned catalog data. Add a stable diagnostic for invalid SQLite
122
+ built-in invocations and fail closed when version-gated functions lack usable server evidence.
123
+
124
+ ## 2.0.0
125
+
126
+ ### Major Changes
127
+
128
+ - 29afc3d: Add conservative semantic primary/replica routing over application-owned databases, scoped
129
+ read-after-write pinning, explicit role requirements, stable unsafe-route errors, dialect runtime
130
+ semantic resolvers, and bounded abortable transaction retry policies with native PostgreSQL and
131
+ MySQL error classifiers. Parse and classify dialect locking reads so uncertain or affine work
132
+ always fails closed to primary.
133
+ - 3f063f6: Add deterministic, secret-free query manifests with bounded structural variants, inferred result
134
+ and parameter descriptions, semantic evidence, runtime-correlatable fingerprints, unresolved
135
+ entries, compatible parsing, canonical serialization, incremental per-file reuse, tsconfig project
136
+ discovery, and a dedicated CLI command.
137
+ - 6a7ae58: Add opt-in live query verification through grammar-owned PostgreSQL PREPARE and MySQL
138
+ COM_STMT_PREPARE adapters, bounded neutral comparison, deterministic secret-free proof artifacts,
139
+ offline cache validation, explicit unsupported classifications, CLI workflows, real database E2E,
140
+ and performance budgets.
141
+ - b06fd0a: Add grammar-neutral optional adapter capability discovery, typed PostgreSQL COPY import and export
142
+ through application-owned `pg-copy-streams`, and typed MySQL LOAD DATA import through mysql2's
143
+ application-owned infile stream. Bulk transfers preserve ordinary `INSERT` parameter evidence,
144
+ enforce structural row stability, apply bounded backpressure, support cancellation and progress,
145
+ and integrate with transaction ownership and conservative connection cleanup.
146
+ - 3050209: Add the dialect contract v4 semantic query evidence foundation. PostgreSQL and MySQL now report operation, dependencies, cardinality, volatility, locking, connection affinity, and required capabilities; compiler results add deterministic query and structural-variant fingerprints and conservatively merged source-mapped semantics. Schema snapshots can record function volatility, and the AST package exposes a neutral statement walker for grammar implementations.
147
+ - 1b054b6: Add an adapter-neutral, redacted database observation lifecycle for queries, cardinality contracts,
148
+ batches, PostgreSQL pipelines, streams, cancellation, and nested transactions. Runtime fingerprints
149
+ correlate with compiler structural variants while SQL, parameter values, connection configuration,
150
+ and driver causes remain excluded by default. Publish the optional OpenTelemetry bridge with current
151
+ database semantic conventions and explicit high-cardinality or exception-capture opt-ins.
152
+ - b4f1b6e: Add deterministic migration compatibility analysis across before/after schema snapshots and query
153
+ manifests. Reports classify both rolling-deployment directions, retain exact source and dependency
154
+ evidence, fail closed for unknown semantics, redact defaults and paths, and support configurable CI
155
+ severity through `typed-sql compat`.
156
+ - 87189c3: Add grammar-neutral `all`, `one`, and `maybeOne` execution with exact row types, stable cardinality
157
+ and cancellation errors, explicit adapter capabilities, AbortSignal support, and absolute deadlines.
158
+ The pg and mysql2 adapters conservatively discard interrupted connections, including transaction
159
+ leases, while the existing uncontrolled `execute` path remains unchanged.
160
+ - e654fae: Add opt-in Standard Schema V1 result validation with compile-time output compatibility, immutable
161
+ query attachment, sync and async validators, redacted fingerprinted errors, and consistent decoded-row
162
+ handling across buffered cardinality methods, batches, PostgreSQL pipelines, streams, and transactions.
163
+ - b2ec119: Add opt-in, grammar-neutral query-plan governance with PostgreSQL and MySQL structured EXPLAIN
164
+ adapters, transient application-owned samples, redacted fingerprint-keyed artifacts, absolute and
165
+ comparable regression budgets, explicit uncertainty, CLI capture and review, documentation, and
166
+ performance coverage.
167
+
168
+ ### Patch Changes
169
+
170
+ - 7ea5d2f: Match the Standard Schema V1 optional-property contract under `exactOptionalPropertyTypes` so
171
+ unwrapped Zod, Valibot, and other conforming validators are accepted directly.
172
+
3
173
  ## 2.0.0-rc.1
4
174
 
5
175
  ### Patch Changes
@@ -0,0 +1,46 @@
1
+ export declare const ARTIFACT_COMPATIBILITY_IDENTITY_FORMAT_VERSION: 1;
2
+ export declare const CORE_ARTIFACT_COMPATIBILITY_VERSION: "typed-sql-core-v1";
3
+ export type ArtifactCompatibilityOutcome = "compatible" | "requires-reanalysis" | "requires-reintrospection" | "unsupported-target" | "corrupt-artifact";
4
+ export interface ArtifactCompatibilityIdentity {
5
+ readonly formatVersion: typeof ARTIFACT_COMPATIBILITY_IDENTITY_FORMAT_VERSION;
6
+ readonly artifact: {
7
+ readonly kind: string;
8
+ readonly version: string;
9
+ readonly algorithm?: string;
10
+ };
11
+ readonly producer: {
12
+ readonly core: string;
13
+ readonly compiler?: string;
14
+ };
15
+ readonly grammar: {
16
+ readonly id: string;
17
+ readonly version: string;
18
+ readonly catalogRevision?: string;
19
+ readonly capabilityFingerprint: string;
20
+ };
21
+ readonly server?: {
22
+ readonly product: string;
23
+ readonly version: string;
24
+ readonly capabilityFingerprint: string;
25
+ };
26
+ readonly schema: {
27
+ readonly formatVersion: 1 | 2;
28
+ readonly hash: string;
29
+ };
30
+ readonly typePolicyHash: string;
31
+ readonly runtimeSettingsHash?: string;
32
+ readonly source?: {
33
+ readonly hash: string;
34
+ readonly query?: string;
35
+ };
36
+ readonly extensions?: Readonly<Record<string, unknown>>;
37
+ }
38
+ export interface ArtifactCompatibilityAssessment {
39
+ readonly outcome: ArtifactCompatibilityOutcome;
40
+ readonly reasons: readonly string[];
41
+ readonly candidate?: ArtifactCompatibilityIdentity;
42
+ }
43
+ export declare function parseArtifactCompatibilityIdentity(value: unknown): ArtifactCompatibilityIdentity;
44
+ export declare function serializeArtifactCompatibilityIdentity(identity: ArtifactCompatibilityIdentity): string;
45
+ export declare function assessArtifactCompatibility(referenceValue: ArtifactCompatibilityIdentity, candidateValue: unknown): ArtifactCompatibilityAssessment;
46
+ //# sourceMappingURL=artifact-compatibility.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact-compatibility.d.ts","sourceRoot":"","sources":["../../../../src/artifact-compatibility.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,8CAA8C,EAAG,CAAU,CAAC;AACzE,eAAO,MAAM,mCAAmC,EAAG,mBAA4B,CAAC;AAEhF,MAAM,MAAM,4BAA4B,GACpC,YAAY,GACZ,qBAAqB,GACrB,0BAA0B,G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AC,UAAU,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACzD;AAED,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,OAAO,EAAE,4BAA4B,CAAC;IAC/C,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,SAAS,CAAC,EAAE,6BAA6B,CAAC;CACpD;AAoCD,wBAAgB,kCAAkC,CAAC,KAAK,EAAE,OAAO,GAAG,6BAA6B,CA0FhG;AAED,wBAAgB,sCAAsC,CAAC,QAAQ,EAAE,6BAA6B,GAAG,MAAM,CAEtG;AAED,wBAAgB,2BAA2B,CACzC,cAAc,EAAE,6BAA6B,EAC7C,cAAc,EAAE,OAAO,GACtB,+BAA+B,CAwDjC"}
@@ -0,0 +1,168 @@
1
+ export const ARTIFACT_COMPATIBILITY_IDENTITY_FORMAT_VERSION = 1;
2
+ export const CORE_ARTIFACT_COMPATIBILITY_VERSION = "typed-sql-core-v1";
3
+ const record = (value) => typeof value === "object" && value !== null;
4
+ function keys(value, allowed, path) {
5
+ const unknown = Object.keys(value).filter((key) => !allowed.includes(key));
6
+ if (unknown.length > 0)
7
+ throw new TypeError(`${path} contains unknown fields: ${unknown.sort().join(", ")}`);
8
+ }
9
+ function text(value, path) {
10
+ if (typeof value !== "string" || value.length === 0 || value.includes("\0")) {
11
+ throw new TypeError(`${path} must be a non-empty string without null bytes`);
12
+ }
13
+ return value;
14
+ }
15
+ function object(value, path) {
16
+ if (!record(value) || Array.isArray(value))
17
+ throw new TypeError(`${path} must be an object`);
18
+ return value;
19
+ }
20
+ function jsonValue(value, path) {
21
+ if (value === null || typeof value === "string" || typeof value === "boolean")
22
+ return value;
23
+ if (typeof value === "number") {
24
+ if (!Number.isFinite(value))
25
+ throw new TypeError(`${path} must contain finite JSON numbers`);
26
+ return value;
27
+ }
28
+ if (Array.isArray(value))
29
+ return value.map((item, index) => jsonValue(item, `${path}[${index}]`));
30
+ const source = object(value, path);
31
+ return Object.fromEntries(Object.keys(source)
32
+ .sort()
33
+ .map((key) => [key, jsonValue(source[key], `${path}.${key}`)]));
34
+ }
35
+ export function parseArtifactCompatibilityIdentity(value) {
36
+ const root = object(value, "artifact compatibility identity");
37
+ keys(root, [
38
+ "formatVersion",
39
+ "artifact",
40
+ "producer",
41
+ "grammar",
42
+ "server",
43
+ "schema",
44
+ "typePolicyHash",
45
+ "runtimeSettingsHash",
46
+ "source",
47
+ "extensions",
48
+ ], "artifact compatibility identity");
49
+ if (root.formatVersion !== ARTIFACT_COMPATIBILITY_IDENTITY_FORMAT_VERSION) {
50
+ throw new TypeError(`Unsupported artifact compatibility identity format ${String(root.formatVersion)}`);
51
+ }
52
+ const artifact = object(root.artifact, "identity.artifact");
53
+ keys(artifact, ["kind", "version", "algorithm"], "identity.artifact");
54
+ const producer = object(root.producer, "identity.producer");
55
+ keys(producer, ["core", "compiler"], "identity.producer");
56
+ const grammar = object(root.grammar, "identity.grammar");
57
+ keys(grammar, ["id", "version", "catalogRevision", "capabilityFingerprint"], "identity.grammar");
58
+ const schema = object(root.schema, "identity.schema");
59
+ keys(schema, ["formatVersion", "hash"], "identity.schema");
60
+ if (schema.formatVersion !== 1 && schema.formatVersion !== 2) {
61
+ throw new TypeError("identity.schema.formatVersion must be 1 or 2");
62
+ }
63
+ const server = root.server === undefined ? undefined : object(root.server, "identity.server");
64
+ if (server !== undefined)
65
+ keys(server, ["product", "version", "capabilityFingerprint"], "identity.server");
66
+ const source = root.source === undefined ? undefined : object(root.source, "identity.source");
67
+ if (source !== undefined)
68
+ keys(source, ["hash", "query"], "identity.source");
69
+ const extensions = root.extensions === undefined
70
+ ? undefined
71
+ : jsonValue(object(root.extensions, "identity.extensions"), "identity.extensions");
72
+ return Object.freeze({
73
+ formatVersion: ARTIFACT_COMPATIBILITY_IDENTITY_FORMAT_VERSION,
74
+ artifact: Object.freeze({
75
+ kind: text(artifact.kind, "identity.artifact.kind"),
76
+ version: text(artifact.version, "identity.artifact.version"),
77
+ ...(artifact.algorithm === undefined
78
+ ? {}
79
+ : { algorithm: text(artifact.algorithm, "identity.artifact.algorithm") }),
80
+ }),
81
+ producer: Object.freeze({
82
+ core: text(producer.core, "identity.producer.core"),
83
+ ...(producer.compiler === undefined ? {} : { compiler: text(producer.compiler, "identity.producer.compiler") }),
84
+ }),
85
+ grammar: Object.freeze({
86
+ id: text(grammar.id, "identity.grammar.id"),
87
+ version: text(grammar.version, "identity.grammar.version"),
88
+ ...(grammar.catalogRevision === undefined
89
+ ? {}
90
+ : { catalogRevision: text(grammar.catalogRevision, "identity.grammar.catalogRevision") }),
91
+ capabilityFingerprint: text(grammar.capabilityFingerprint, "identity.grammar.capabilityFingerprint"),
92
+ }),
93
+ ...(server === undefined
94
+ ? {}
95
+ : {
96
+ server: Object.freeze({
97
+ product: text(server.product, "identity.server.product"),
98
+ version: text(server.version, "identity.server.version"),
99
+ capabilityFingerprint: text(server.capabilityFingerprint, "identity.server.capabilityFingerprint"),
100
+ }),
101
+ }),
102
+ schema: Object.freeze({
103
+ formatVersion: schema.formatVersion,
104
+ hash: text(schema.hash, "identity.schema.hash"),
105
+ }),
106
+ typePolicyHash: text(root.typePolicyHash, "identity.typePolicyHash"),
107
+ ...(root.runtimeSettingsHash === undefined
108
+ ? {}
109
+ : { runtimeSettingsHash: text(root.runtimeSettingsHash, "identity.runtimeSettingsHash") }),
110
+ ...(source === undefined
111
+ ? {}
112
+ : {
113
+ source: Object.freeze({
114
+ hash: text(source.hash, "identity.source.hash"),
115
+ ...(source.query === undefined ? {} : { query: text(source.query, "identity.source.query") }),
116
+ }),
117
+ }),
118
+ ...(extensions === undefined ? {} : { extensions: Object.freeze(extensions) }),
119
+ });
120
+ }
121
+ export function serializeArtifactCompatibilityIdentity(identity) {
122
+ return `${JSON.stringify(parseArtifactCompatibilityIdentity(identity), null, 2)}\n`;
123
+ }
124
+ export function assessArtifactCompatibility(referenceValue, candidateValue) {
125
+ const reference = parseArtifactCompatibilityIdentity(referenceValue);
126
+ let candidate;
127
+ try {
128
+ candidate = parseArtifactCompatibilityIdentity(candidateValue);
129
+ }
130
+ catch {
131
+ return Object.freeze({ outcome: "corrupt-artifact", reasons: Object.freeze(["identity-invalid"]) });
132
+ }
133
+ const unsupported = [];
134
+ const reintrospection = [];
135
+ const reanalysis = [];
136
+ const compare = (left, right, reason, target) => {
137
+ if (left !== undefined && left !== right)
138
+ target.push(reason);
139
+ };
140
+ compare(reference.artifact.kind, candidate.artifact.kind, "artifact-kind-changed", unsupported);
141
+ compare(reference.artifact.version, candidate.artifact.version, "artifact-version-changed", unsupported);
142
+ compare(reference.artifact.algorithm, candidate.artifact.algorithm, "artifact-algorithm-changed", unsupported);
143
+ compare(reference.producer.core, candidate.producer.core, "core-compatibility-changed", unsupported);
144
+ compare(reference.producer.compiler, candidate.producer.compiler, "compiler-compatibility-changed", reanalysis);
145
+ compare(reference.grammar.id, candidate.grammar.id, "grammar-changed", unsupported);
146
+ compare(reference.grammar.version, candidate.grammar.version, "grammar-version-changed", reintrospection);
147
+ compare(reference.grammar.catalogRevision, candidate.grammar.catalogRevision, "catalog-revision-changed", reintrospection);
148
+ compare(reference.grammar.capabilityFingerprint, candidate.grammar.capabilityFingerprint, "grammar-capabilities-changed", reintrospection);
149
+ compare(reference.server?.product, candidate.server?.product, "server-product-changed", reintrospection);
150
+ compare(reference.server?.version, candidate.server?.version, "server-version-changed", reintrospection);
151
+ compare(reference.server?.capabilityFingerprint, candidate.server?.capabilityFingerprint, "server-capabilities-changed", reintrospection);
152
+ if (reference.schema.formatVersion !== candidate.schema.formatVersion)
153
+ reintrospection.push("schema-format-changed");
154
+ compare(reference.schema.hash, candidate.schema.hash, "schema-changed", reanalysis);
155
+ compare(reference.typePolicyHash, candidate.typePolicyHash, "type-policy-changed", reanalysis);
156
+ compare(reference.runtimeSettingsHash, candidate.runtimeSettingsHash, "runtime-settings-changed", reintrospection);
157
+ compare(reference.source?.hash, candidate.source?.hash, "source-changed", reanalysis);
158
+ compare(reference.source?.query, candidate.source?.query, "query-changed", reanalysis);
159
+ const [outcome, reasons] = unsupported.length > 0
160
+ ? ["unsupported-target", unsupported]
161
+ : reintrospection.length > 0
162
+ ? ["requires-reintrospection", reintrospection]
163
+ : reanalysis.length > 0
164
+ ? ["requires-reanalysis", reanalysis]
165
+ : ["compatible", []];
166
+ return Object.freeze({ outcome, reasons: Object.freeze(reasons), candidate });
167
+ }
168
+ //# sourceMappingURL=artifact-compatibility.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact-compatibility.js","sourceRoot":"","sources":["../../../../src/artifact-compatibility.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,8CAA8C,GAAG,CAAU,CAAC;AACzE,MAAM,CAAC,MAAM,mCAAmC,GAAG,mBAA4B,CAAC;AAkDhF,MAAM,MAAM,GAAG,CAAC,KAAc,EAAoC,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AAEjH,SAAS,IAAI,CAAC,KAA8B,EAAE,OAA0B,EAAE,IAAY;IACpF,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3E,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,GAAG,IAAI,6BAA6B,OAAO,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC/G,CAAC;AAED,SAAS,IAAI,CAAC,KAAc,EAAE,IAAY;IACxC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5E,MAAM,IAAI,SAAS,CAAC,G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EAAE,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,UAAU,CAAC,CAAC;IACtF,OAAO,CAAC,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE,UAAU,CAAC,CAAC;IACvF,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,GACtB,WAAW,CAAC,MAAM,GAAG,CAAC;QACpB,CAAC,CAAE,CAAC,oBAAoB,EAAE,WAAW,CAAW;QAChD,CAAC,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC;YAC1B,CAAC,CAAE,CAAC,0BAA0B,EAAE,eAAe,CAAW;YAC1D,CAAC,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC;gBACrB,CAAC,CAAE,CAAC,qBAAqB,EAAE,UAAU,CAAW;gBAChD,CAAC,CAAE,CAAC,YAAY,EAAE,EAAE,CAAW,CAAC;IACxC,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC;AAChF,CAAC"}
@@ -0,0 +1,39 @@
1
+ export declare const SUPPORT_BUNDLE_FORMAT_VERSION: 1;
2
+ export interface DebugRedactionOptions {
3
+ readonly includeSql?: boolean;
4
+ readonly includeIdentifiers?: boolean;
5
+ readonly includePaths?: boolean;
6
+ readonly includeDebugText?: boolean;
7
+ }
8
+ export interface DebugEventInput {
9
+ readonly phase: string;
10
+ readonly event: string;
11
+ readonly durationMilliseconds?: number;
12
+ readonly cache?: Readonly<Record<string, number>>;
13
+ readonly capability?: string;
14
+ readonly failure?: {
15
+ readonly code: string;
16
+ readonly classification: string;
17
+ };
18
+ readonly context?: unknown;
19
+ }
20
+ export interface DebugEvent extends Omit<DebugEventInput, "context"> {
21
+ readonly context?: unknown;
22
+ }
23
+ export interface SupportBundle {
24
+ readonly formatVersion: typeof SUPPORT_BUNDLE_FORMAT_VERSION;
25
+ readonly redaction: "default";
26
+ readonly inventory: {
27
+ readonly eventCount: number;
28
+ readonly phases: readonly string[];
29
+ readonly events: readonly string[];
30
+ readonly contextIncluded: boolean;
31
+ };
32
+ readonly environment: unknown;
33
+ readonly events: readonly DebugEvent[];
34
+ }
35
+ export declare function redactDebugContext(value: unknown, options?: DebugRedactionOptions): unknown;
36
+ export declare function createDebugEvent(input: DebugEventInput, options?: DebugRedactionOptions): DebugEvent;
37
+ export declare function createSupportBundle(events: readonly DebugEventInput[], environment?: unknown): SupportBundle;
38
+ export declare function serializeSupportBundle(bundle: SupportBundle): string;
39
+ //# sourceMappingURL=debug.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../../../src/debug.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B,EAAG,CAAU,CAAC;AAExD,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IACtC,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IACvC,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAClD,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9E,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC;IAClE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,aAAa,EAAE,OAAO,6BAA6B,CAAC;IAC7D,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE;QAClB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;QAC5B,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;QACnC,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;QACnC,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;KACnC,CAAC;IACF,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,CAAC;CACxC;AAsCD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,GAAE,qBAA0B,GAAG,OAAO,CAE/F;AAOD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,eAAe,EAAE,OAAO,GAAE,qBAA0B,GAAG,UAAU,CA2BxG;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,EAAE,WAAW,GAAE,OAAY,GAAG,aAAa,CAchH;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAEpE"}
@@ -0,0 +1,87 @@
1
+ export const SUPPORT_BUNDLE_FORMAT_VERSION = 1;
2
+ const sensitiveKey = /(?:authorization|cookie|credential|password|secret|token|connection|string|dsn|parameter|params|values?)/iu;
3
+ const sqlKey = /(?:sql|query|source|statement|text)/iu;
4
+ const identifierKey = /(?:identifier|table|column|schema|relation|namespace)/iu;
5
+ const pathKey = /(?:file|path|cwd|root|uri|directory)/iu;
6
+ const safeTextKey = /^(?:backend|capability|category|classification|code|event|kind|operation|phase|releaseTrack|status|support|version)$/u;
7
+ function redact(value, options, key, seen, depth) {
8
+ if (depth > 8)
9
+ return "[redacted:depth-limit]";
10
+ if (sensitiveKey.test(key))
11
+ return "[redacted:sensitive]";
12
+ if (sqlKey.test(key) && options.includeSql !== true)
13
+ return "[redacted:sql]";
14
+ if (identifierKey.test(key) && options.includeIdentifiers !== true)
15
+ return "[redacted:identifier]";
16
+ if (pathKey.test(key) && options.includePaths !== true)
17
+ return "[redacted:path]";
18
+ if (value === null || typeof value === "boolean" || typeof value === "number")
19
+ return typeof value === "number" && !Number.isFinite(value) ? "[redacted:non-json-number]" : value;
20
+ if (typeof value === "string")
21
+ return options.includeDebugText === true || safeTextKey.test(key) ? value : "[redacted:text]";
22
+ if (typeof value !== "object")
23
+ return `[redacted:${typeof value}]`;
24
+ if (seen.has(value))
25
+ return "[redacted:cycle]";
26
+ seen.add(value);
27
+ if (Array.isArray(value))
28
+ return Object.freeze(value.slice(0, 256).map((item) => redact(item, options, key, seen, depth + 1)));
29
+ const entries = Object.entries(value)
30
+ .sort(([left], [right]) => left.localeCompare(right))
31
+ .slice(0, 256)
32
+ .map(([name, item]) => [name, redact(item, options, name, seen, depth + 1)]);
33
+ return Object.freeze(Object.fromEntries(entries));
34
+ }
35
+ export function redactDebugContext(value, options = {}) {
36
+ return redact(value, options, "context", new WeakSet(), 0);
37
+ }
38
+ function requiredText(value, path) {
39
+ if (typeof value !== "string" || value.length === 0)
40
+ throw new TypeError(`${path} must be a non-empty string`);
41
+ return value;
42
+ }
43
+ export function createDebugEvent(input, options = {}) {
44
+ const phase = requiredText(input.phase, "Debug event phase");
45
+ const event = requiredText(input.event, "Debug event name");
46
+ if (input.durationMilliseconds !== undefined &&
47
+ (!Number.isFinite(input.durationMilliseconds) || input.durationMilliseconds < 0)) {
48
+ throw new TypeError("Debug event durationMilliseconds must be a non-negative finite number");
49
+ }
50
+ return Object.freeze({
51
+ phase,
52
+ event,
53
+ ...(input.durationMilliseconds === undefined ? {} : { durationMilliseconds: input.durationMilliseconds }),
54
+ ...(input.cache === undefined
55
+ ? {}
56
+ : { cache: redactDebugContext(input.cache) }),
57
+ ...(input.capability === undefined ? {} : { capability: requiredText(input.capability, "Debug event capability") }),
58
+ ...(input.failure === undefined
59
+ ? {}
60
+ : {
61
+ failure: Object.freeze({
62
+ code: requiredText(input.failure.code, "Debug event failure code"),
63
+ classification: requiredText(input.failure.classification, "Debug event failure classification"),
64
+ }),
65
+ }),
66
+ ...(input.context === undefined ? {} : { context: redactDebugContext(input.context, options) }),
67
+ });
68
+ }
69
+ export function createSupportBundle(events, environment = {}) {
70
+ const redactedEvents = Object.freeze(events.map((event) => createDebugEvent(event)));
71
+ return Object.freeze({
72
+ formatVersion: SUPPORT_BUNDLE_FORMAT_VERSION,
73
+ redaction: "default",
74
+ inventory: Object.freeze({
75
+ eventCount: redactedEvents.length,
76
+ phases: Object.freeze([...new Set(redactedEvents.map(({ phase }) => phase))].sort()),
77
+ events: Object.freeze([...new Set(redactedEvents.map(({ event }) => event))].sort()),
78
+ contextIncluded: redactedEvents.some(({ context }) => context !== undefined),
79
+ }),
80
+ environment: redactDebugContext(environment),
81
+ events: redactedEvents,
82
+ });
83
+ }
84
+ export function serializeSupportBundle(bundle) {
85
+ return `${JSON.stringify(bundle, null, 2)}\n`;
86
+ }
87
+ //# sourceMappingURL=debug.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug.js","sourceRoot":"","sources":["../../../../src/debug.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAU,CAAC;AAoCxD,MAAM,YAAY,GAChB,4GAA4G,CAAC;AAC/G,MAAM,MAAM,GAAG,uCAAuC,CAAC;AACvD,MAAM,aAAa,GAAG,yDAAyD,CAAC;AAChF,MAAM,OAAO,GAAG,wCAAwC,CAAC;AACzD,MAAM,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