@xanots/sdk 0.0.10 → 0.0.11

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 (53) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +38 -0
  3. package/dist/.build-fingerprint +1 -1
  4. package/dist/bin.js +7 -6
  5. package/dist/bundle.d.ts +218 -0
  6. package/dist/bundle.js +143 -0
  7. package/dist/{chunk-5YCQ2QHH.js → chunk-22TKBSDV.js} +2 -2
  8. package/dist/{chunk-YYFXVYPX.js → chunk-4IF54NU5.js} +3 -3
  9. package/dist/{chunk-W24FJHPD.js → chunk-4Q7ZOHH7.js} +2 -2
  10. package/dist/{chunk-4BXJGVZ3.js → chunk-BC2C5GVI.js} +2 -69
  11. package/dist/chunk-BSK7ELHU.js +70 -0
  12. package/dist/chunk-EHP3WPEG.js +21 -0
  13. package/dist/{chunk-75Z74TA7.js → chunk-G4EJMQLD.js} +2 -2
  14. package/dist/{chunk-I7DQDJAM.js → chunk-HYBN4H3F.js} +38 -46
  15. package/dist/chunk-OHX6MIUZ.js +184 -0
  16. package/dist/{chunk-VKSOTZK3.js → chunk-OWGCOGKK.js} +155 -3
  17. package/dist/{chunk-LBYWGMOA.js → chunk-QK7ZQJLP.js} +140 -20
  18. package/dist/{chunk-5R73LFWK.js → chunk-QYMAZRAU.js} +7 -7
  19. package/dist/{chunk-ACCBOMCB.js → chunk-RCT7UX7B.js} +12 -12
  20. package/dist/{chunk-P6TAVLOX.js → chunk-UOZMSF4C.js} +15 -8
  21. package/dist/{chunk-7JDT4PBU.js → chunk-VAF6A3YD.js} +5 -179
  22. package/dist/{chunk-OYMR5AMJ.js → chunk-XEOX6AM7.js} +2 -2
  23. package/dist/cli.js +6 -5
  24. package/dist/{codegen-command-GB3H2KQ7.js → codegen-command-FUT2KJB6.js} +15 -12
  25. package/dist/codegen.d.ts +2 -1
  26. package/dist/{deploy-command-QTIVA22A.js → deploy-command-IP7V7GT4.js} +8 -7
  27. package/dist/index.d.ts +6 -4
  28. package/dist/index.js +10 -9
  29. package/dist/{init-command-MAXULNAD.js → init-command-NPVL32L6.js} +8 -7
  30. package/dist/internal.d.ts +4 -4
  31. package/dist/internal.js +62 -40
  32. package/dist/io-P2H75UV2.js +12 -0
  33. package/dist/{lock-GFXD6G2E.js → lock-46FWYE4D.js} +3 -2
  34. package/dist/{lock-commands-DQ7CUMIV.js → lock-commands-ZZKZ4LZJ.js} +8 -7
  35. package/dist/node.d.ts +5 -4
  36. package/dist/node.js +12 -11
  37. package/dist/{preflight-command-GZ2GE5RN.js → preflight-command-K346GPTY.js} +8 -7
  38. package/dist/{release-command-YUBTNHVX.js → release-command-IMNTIVWK.js} +14 -13
  39. package/dist/response-BQVQ24l1.d.ts +844 -0
  40. package/dist/{store-BG1UPZ3Z.d.ts → store-BLyNeQ8S.d.ts} +16 -3
  41. package/dist/{upgrade-command-FB5QJ363.js → upgrade-command-BN3EHAOI.js} +8 -7
  42. package/dist/{workspace-command-43P42FBP.js → workspace-command-MNK7Y7MQ.js} +15 -12
  43. package/dist/{response-CVAE2kMj.d.ts → xdo-BjJj5W_E.d.ts} +1 -837
  44. package/guides/typed-frontend.md +1 -1
  45. package/llms/filters.md +11 -10
  46. package/llms/kinds-core.md +1 -1
  47. package/llms/statements-data.md +3 -1
  48. package/llms/values.md +1 -1
  49. package/llms-full.txt +41 -30
  50. package/llms.txt +25 -17
  51. package/manifest.json +2 -2
  52. package/package.json +7 -2
  53. package/dist/io-M7XZEMK7.js +0 -11
package/CHANGELOG.md CHANGED
@@ -11,6 +11,23 @@ listed here.
11
11
 
12
12
  ---
13
13
 
14
+ ## 0.0.10 — The CLI surface pass
15
+
16
+ _2026-08-31_ · [release notes](https://github.com/xanots/sdk/releases/tag/v0.0.10)
17
+
18
+ This release is a CLI surface pass, and it is breaking throughout. Six ways to start a project collapse to `init` plus two flags, the sandbox environment is gone with every surface that named it, and a run of commands and flags were renamed to say what they actually do — including three that each carried two or three unrelated meanings. One command is new: `xanots status` answers where you stand in a single read.
19
+
20
+ - ⚠️ Project creation is one command: `init`, with `--from` and `--web`
21
+ - ⚠️ The sandbox environment is gone
22
+ - ⚠️ `deploy` takes no environment flag
23
+ - `xanots status` — who, where, and which environment
24
+ - ⚠️ `validate` is now `preflight`, and `lock adopt` is now `lock import`
25
+ - ⚠️ `--dest` is now `--env`, and names environments the way `--from` does
26
+ - ⚠️ Flags that carried several meanings were split apart
27
+ - `routes` and `whoami` are the canonical spellings
28
+
29
+ ---
30
+
14
31
  ## 0.0.9 — Eight reports from real use
15
32
 
16
33
  _2026-08-31_ · [release notes](https://github.com/xanots/sdk/releases/tag/v0.0.9)
package/README.md CHANGED
@@ -414,6 +414,44 @@ reference, the guides carry the shape of a project and the behavior that will bi
414
414
  | [Pulling an existing workspace](https://github.com/xanots/sdk/blob/main/guides/codegen.md) | What `xanots init --from` writes, how faithful it is, and how to read its report |
415
415
  | [Coverage & agent grounding](https://github.com/xanots/sdk/blob/main/guides/coverage.md) | What is covered, what is out of scope, and the files agents read |
416
416
 
417
+ ### Reading a compiled bundle
418
+
419
+ `@xanots/sdk` writes a bundle; `@xanots/sdk/bundle` reads one back. It is the surface for
420
+ tools that take compiled JSON as input — a graph view, a diff, a linter, a docs generator —
421
+ so none of them has to reverse-engineer the storage shape and then go quietly wrong when the
422
+ engine grows a new one.
423
+
424
+ ```ts
425
+ import { statementCatalog, walk } from "@xanots/sdk/bundle";
426
+
427
+ const bundle = JSON.parse(await readFile("bundle.json", "utf8"));
428
+ const catalog = statementCatalog();
429
+
430
+ for (const { raw, path, depth } of walk(bundle.payload.query[0].run)) {
431
+ console.log(`${" ".repeat(depth)}${path} ${catalog.get(raw.name)?.sPath ?? raw.name}`);
432
+ }
433
+ // 0 db.query
434
+ // 1 conditional
435
+ // 1.if.0 db.add
436
+ ```
437
+
438
+ - **`walk(run)`** → every statement in the tree, each with a `path` and a `depth`. The path
439
+ format (`2.if.0`) is the shared address: a lint finding, a review comment and a runtime
440
+ error written by three different tools all name the same node.
441
+ - **`subStacks(raw)`** → the nested stacks a statement carries, keyed by where they are
442
+ stored and labelled by what they mean — a try/catch and a conditional share the same three
443
+ storage keys. Found by shape, so a nesting form added later is still walked.
444
+ - **`statementCatalog()`** → the stored `mvp:*` name to its authoring path (`s.db.query`).
445
+ - **`structuralHash(raw)`** → a diff key for a statement and everything under it, with
446
+ engine-filled operands excluded. Without that exclusion, adding one column to a table
447
+ reports every statement that writes it as changed.
448
+ - **`tableRefOf(column)` / `linkedTableOf(column)`** → the table a column points at.
449
+ - **`normalize(value)`** → the normalizer `xanots preflight` compares with, for diffing a
450
+ stored workspace against a compiled one.
451
+
452
+ Everything on the entry is pure — no filesystem, no network, no Node built-ins — so it runs
453
+ in a browser or a worker.
454
+
417
455
  The package also ships two machine-readable descriptions of the same surface, generated from
418
456
  the SDK's own sources so they cannot drift from it: `llms.txt` (the router — the mental model
419
457
  and the gotchas, plus a map of the `llms/*.md` topic files) and `manifest.json` (per-entry
@@ -1 +1 @@
1
- d72e74909376b02042f7e65298a7158f3c3646928e959af4a14a7409667d070d
1
+ 6e6a4444f6fc73ee75afa9e72fb57b1ac2592d33d6b9a99205023fcbaccf8ed8
package/dist/bin.js CHANGED
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  maybeNotifyUpdate
4
- } from "./chunk-5YCQ2QHH.js";
4
+ } from "./chunk-22TKBSDV.js";
5
5
  import {
6
6
  readVersion,
7
7
  run
8
- } from "./chunk-ACCBOMCB.js";
8
+ } from "./chunk-RCT7UX7B.js";
9
9
  import "./chunk-CTD5ZCV6.js";
10
- import "./chunk-OYMR5AMJ.js";
10
+ import "./chunk-XEOX6AM7.js";
11
11
  import {
12
12
  exitCodeOf,
13
13
  reportFailure
@@ -17,12 +17,13 @@ import {
17
17
  clearProgress,
18
18
  error
19
19
  } from "./chunk-EZG76F7R.js";
20
- import "./chunk-VKSOTZK3.js";
20
+ import "./chunk-OWGCOGKK.js";
21
21
  import "./chunk-DIA7CT7J.js";
22
- import "./chunk-LBYWGMOA.js";
22
+ import "./chunk-QK7ZQJLP.js";
23
23
  import "./chunk-WHOJWOSV.js";
24
+ import "./chunk-VAF6A3YD.js";
24
25
  import "./chunk-5XZ744TS.js";
25
- import "./chunk-7JDT4PBU.js";
26
+ import "./chunk-OHX6MIUZ.js";
26
27
 
27
28
  // src/emit/interrupt.ts
28
29
  var EXIT_SIGINT = 130;
@@ -0,0 +1,218 @@
1
+ import { S as StackItemXdo, g as FieldXdo } from './xdo-BjJj5W_E.js';
2
+ export { b as ConditionalContext, c as ConditionalElifContext, E as ExprGroup, d as ExprNode, e as ExprOperand, f as ExprStatement, h as FilterXdo, I as InputXdo, M as MethodXdo, k as ResultItemXdo, l as StatementInputXdo, o as TaggedValue } from './xdo-BjJj5W_E.js';
3
+
4
+ /**
5
+ * The statement catalog, keyed the way a bundle reader needs it.
6
+ *
7
+ * A compiled statement identifies itself by its STORED name (`mvp:dbo_view`);
8
+ * everything a person reads — a docs link, a lint message, a graph node label —
9
+ * wants the authoring path (`s.db.query`). The mapping is SDK metadata, so a
10
+ * third-party tool must not have to keep its own copy: a new statement kind
11
+ * would then need a release in every tool before it stopped rendering as an
12
+ * unknown node.
13
+ */
14
+ /** One stored statement name and the authoring surface(s) that compile to it. */
15
+ interface StatementCatalogEntry {
16
+ /** The stored `mvp:` name, as it appears on a compiled statement's `name`. */
17
+ readonly storedName: string;
18
+ /** The primary surface key — the engine's own schema name, e.g. `db.query`. */
19
+ readonly surface: string;
20
+ /** The dotted accessor under `s.`, e.g. `db.query` is reachable as `s.db.query`. */
21
+ readonly sPath: string;
22
+ /**
23
+ * Every surface key stored under this name, in catalog order. Almost always
24
+ * one; the mapping is NOT injective (`util.get_raw_input` and `util.get_input`
25
+ * both store `mvp:get_input`), so a reader that must not lose a surface reads
26
+ * this rather than {@link StatementCatalogEntry.surface}.
27
+ */
28
+ readonly surfaces: readonly string[];
29
+ }
30
+ /**
31
+ * Every stored statement name the SDK knows, mapped to its authoring surface.
32
+ *
33
+ * Built once and shared — the returned map is frozen in the sense that it is the
34
+ * same instance on every call, so a caller must not mutate it.
35
+ *
36
+ * `raw()` is deliberately absent: it is the passthrough for stored statements
37
+ * the catalog cannot model, so a `name` that misses here is exactly the set a
38
+ * tool should render as opaque.
39
+ */
40
+ declare function statementCatalog(): ReadonlyMap<string, StatementCatalogEntry>;
41
+
42
+ /**
43
+ * Statement-tree traversal for a compiled bundle.
44
+ *
45
+ * A stack is a `run[]` of {@link StackItemXdo} envelopes, and a statement that
46
+ * nests carries its children under `context` — never under a single key. A
47
+ * conditional stores `if.run` / `elif.run` / `else.run`, a try/catch reuses the
48
+ * same three keys for `try` / `catch` / `finally`, a switch stores its cases
49
+ * under `elif.run` and its default under `else.run`, and every loop, group and
50
+ * transaction stores a bare `context.run`.
51
+ *
52
+ * A tool that hardcodes that key set drops a subtree silently the day the engine
53
+ * adds a nesting shape, so {@link subStacks} does not hardcode it: it finds a
54
+ * sub-stack by SHAPE — any `context` member that is a `{run: [...]}` object,
55
+ * plus `context.run` itself. {@link SUB_STACK_KEYS} is exported as the set known
56
+ * today, and it fixes the ORDER discovery reports; a key outside it is still
57
+ * found, reported after the known ones, in `context` order.
58
+ */
59
+
60
+ /**
61
+ * The `context` keys that hold a nested stack today, in the order
62
+ * {@link subStacks} reports them. The order is the authoring order for every
63
+ * statement that nests: `if` before `elif` before `else` for a conditional,
64
+ * try before catch before finally for a try/catch, cases before default for a
65
+ * switch.
66
+ *
67
+ * This is a reference set, not a filter — see the module note.
68
+ */
69
+ declare const SUB_STACK_KEYS: readonly string[];
70
+ /** One nested stack hanging off a statement's `context`. */
71
+ interface SubStack {
72
+ /** The `context` key the stack is stored under (`if`, `elif`, `else`, `then`, `run`). */
73
+ readonly key: string;
74
+ /**
75
+ * What the branch means at the authoring surface — `try`/`catch`/`finally` for
76
+ * a try/catch, `cases`/`default` for a switch, `body` for a loop. Falls back
77
+ * to the key for a statement with no recorded mapping.
78
+ */
79
+ readonly label: string;
80
+ /** The nested statements, in run order. */
81
+ readonly run: readonly StackItemXdo[];
82
+ }
83
+ /** A statement reached by {@link walk}, with its address and nesting depth. */
84
+ interface WalkedStatement {
85
+ /** The statement envelope, by reference — not a copy. */
86
+ readonly raw: StackItemXdo;
87
+ /**
88
+ * The statement's address within the stack it was walked from — see
89
+ * {@link statementPath}. `"2"` is the third top-level statement; `"2.if.0"` is
90
+ * the first statement of its `if` branch.
91
+ */
92
+ readonly path: string;
93
+ /** Nesting depth: `0` for a top-level statement, `1` inside one sub-stack, and so on. */
94
+ readonly depth: number;
95
+ }
96
+ /**
97
+ * Every nested stack a statement carries, in canonical order.
98
+ *
99
+ * Returns an empty array for a leaf statement. A sub-stack stored empty
100
+ * (`elif: {run: []}`, which the engine always persists on a conditional) is
101
+ * REPORTED with an empty `run` rather than skipped — the branch exists in the
102
+ * bytes, and a tool that renders branches wants to know the difference between
103
+ * "no elif" and "an elif that does nothing".
104
+ */
105
+ declare function subStacks(raw: StackItemXdo): SubStack[];
106
+ /**
107
+ * Join path segments into a statement path.
108
+ *
109
+ * The format is dot-separated, alternating an index with the `context` key that
110
+ * contains the next level: `2` is the third top-level statement, `2.if.0` is the
111
+ * first statement of its `if` branch, `2.elif.0.if.1` is the second statement of
112
+ * its first elif branch. The KEY is used, not the label, so the path addresses
113
+ * the stored bytes and stays stable if an authoring name changes.
114
+ *
115
+ * One shared address is the point: a lint finding, a review comment and a
116
+ * runtime error written by three different tools all name the same node.
117
+ */
118
+ declare function statementPath(segments: readonly (string | number)[]): string;
119
+ /**
120
+ * Walk a stack depth-first in pre-order — every statement, then its sub-stacks
121
+ * in {@link subStacks} order.
122
+ *
123
+ * A statement that is itself a branch carrier (`mvp:conditional_elif`,
124
+ * `mvp:switch_case`) is a stack item like any other, so it is VISITED and then
125
+ * descended into. A tool counting statements should filter those out; a tool
126
+ * addressing nodes wants them present.
127
+ *
128
+ * Iterative rather than recursive: a generated stack can nest deep enough to
129
+ * blow the call stack, and a bundle reader must not be the thing that crashes.
130
+ */
131
+ declare function walk(run: readonly StackItemXdo[]): WalkedStatement[];
132
+
133
+ /**
134
+ * A structural fingerprint for a compiled statement — the thing a diff, a cache
135
+ * key or a "did this change" check wants, and the thing a byte comparison is
136
+ * not.
137
+ *
138
+ * Two reductions run before the hash:
139
+ *
140
+ * 1. {@link normalize}, the same normalizer the SDK uses for fixture comparison
141
+ * and for the `xanots preflight` round-trip diff. It strips server-assigned
142
+ * identity (`_xsid`, `id`, timestamps, `market_item`) and canonicalizes the
143
+ * spellings the engine persists two ways.
144
+ * 2. Engine-filled `input[]` slots — the entries carrying `ignore: true`.
145
+ *
146
+ * The second one is the whole reason this is not just `sha1(normalize(x))`. A
147
+ * "full" statement (`db.add`, `db.edit`, `api.request`) persists one `input[]`
148
+ * entry per column of the table it writes, and the ones the author did not set
149
+ * carry `ignore: true`. Add a column to a table and EVERY statement that writes
150
+ * it gains an entry — so an unfiltered diff reports that every one of them
151
+ * changed, when what changed was the table. Filtered, the same diff reports the
152
+ * one object that actually changed.
153
+ *
154
+ * The normalizer deliberately KEEPS `ignore: true` (it is meaningful bytes on a
155
+ * system column, and the normalizer's job is byte fidelity — it must not drop
156
+ * what it cannot prove inert). That is not a contradiction: byte fidelity and
157
+ * structural identity are different questions, so they get different reductions.
158
+ * If you need the byte-level answer, hash `normalize()` yourself.
159
+ */
160
+
161
+ /**
162
+ * JSON with every object's keys sorted — so two statements that differ only in
163
+ * the order the engine happened to serialize their members hash the same.
164
+ */
165
+ declare function canonicalJson(value: unknown): string;
166
+ /**
167
+ * A stable hex fingerprint of a statement AND everything nested under it.
168
+ *
169
+ * Equal hashes mean the two statements do the same thing; different hashes mean
170
+ * something an author wrote differs. The value is stable across SDK versions
171
+ * only as far as the normalizer is — treat it as a comparison key computed in
172
+ * one pass over both sides, not as a value to persist and compare next year.
173
+ */
174
+ declare function structuralHash(raw: StackItemXdo): string;
175
+
176
+ /**
177
+ * Reading table relationships out of a stored column.
178
+ *
179
+ * Both are storage details a schema view needs and nothing else states, so they
180
+ * have been reverse-engineered once per tool up to now.
181
+ */
182
+
183
+ /**
184
+ * The table a foreign-key column points at, as a guid — or `null` if the column
185
+ * is not a reference.
186
+ *
187
+ * A reference is an `int` or `uuid` column whose LAST method is `@` with a
188
+ * single `dbo=<guid>` argument. The position matters: `@` is an annotation the
189
+ * engine appends, and reading any `@` in the list would misread a column that
190
+ * carries one for another reason.
191
+ *
192
+ * A bare `dbo=` returns `null`. That is what the editor writes when a reference
193
+ * is CLEARED — an FK annotation pointing at nothing, which is not a reference.
194
+ */
195
+ declare function tableRefOf(column: FieldXdo): string | null;
196
+ /**
197
+ * The table a db-link column expands, as a guid — or `null` if the column is not
198
+ * one.
199
+ *
200
+ * The other table relationship, and a different shape entirely: the column's
201
+ * TYPE is the table's identity with `_mvpschema` appended, and the engine
202
+ * expands the link into one input per column of the named table. A schema view
203
+ * that only reads {@link tableRefOf} misses these edges.
204
+ */
205
+ declare function linkedTableOf(column: FieldXdo): string | null;
206
+
207
+ /**
208
+ * Structural deep-equal for comparing an engine-default subtree to a frozen
209
+ * default — and, exported, for comparing two normalized objects.
210
+ *
211
+ * Exported so a caller that has already normalized both sides does not carry its
212
+ * own copy of the same walk; a second implementation is a second set of rules
213
+ * about what "equal" means.
214
+ */
215
+ declare function deepEqual(a: unknown, b: unknown): boolean;
216
+ declare function normalize<T>(value: T): T;
217
+
218
+ export { FieldXdo, SUB_STACK_KEYS, StackItemXdo, type StatementCatalogEntry, type SubStack, type WalkedStatement, canonicalJson, deepEqual, linkedTableOf, normalize, statementCatalog, statementPath, structuralHash, subStacks, tableRefOf, walk };
package/dist/bundle.js ADDED
@@ -0,0 +1,143 @@
1
+ import {
2
+ linkedTableOf,
3
+ tableRefOf
4
+ } from "./chunk-EHP3WPEG.js";
5
+ import {
6
+ deepEqual,
7
+ normalize
8
+ } from "./chunk-3INK4Y4E.js";
9
+ import {
10
+ STATEMENT_SURFACES,
11
+ sPathOf
12
+ } from "./chunk-BC2C5GVI.js";
13
+ import {
14
+ sha1Bytes
15
+ } from "./chunk-OHX6MIUZ.js";
16
+
17
+ // src/bundle/catalog.ts
18
+ var cached;
19
+ function statementCatalog() {
20
+ if (cached) return cached;
21
+ const map = /* @__PURE__ */ new Map();
22
+ for (const [surface, storedName] of STATEMENT_SURFACES) {
23
+ const existing = map.get(storedName);
24
+ if (existing) {
25
+ map.set(storedName, { ...existing, surfaces: [...existing.surfaces, surface] });
26
+ continue;
27
+ }
28
+ map.set(storedName, {
29
+ storedName,
30
+ surface,
31
+ sPath: sPathOf(surface),
32
+ surfaces: [surface]
33
+ });
34
+ }
35
+ cached = map;
36
+ return map;
37
+ }
38
+
39
+ // src/bundle/walk.ts
40
+ var SUB_STACK_KEYS = ["if", "elif", "else", "then", "run"];
41
+ var SUB_STACK_LABELS = {
42
+ "mvp:conditional": { if: "then", elif: "elif", else: "else" },
43
+ "mvp:conditional_elif": { if: "then" },
44
+ "mvp:switch": { elif: "cases", else: "default" },
45
+ "mvp:switch_case": { if: "body" },
46
+ "mvp:try_catch": { if: "try", else: "catch", then: "finally" }
47
+ };
48
+ var isRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
49
+ function runOf(value) {
50
+ if (!isRecord(value)) return null;
51
+ const run = value.run;
52
+ return Array.isArray(run) ? run : null;
53
+ }
54
+ function subStacks(raw) {
55
+ const context = raw?.context;
56
+ if (!isRecord(context)) return [];
57
+ const labels = SUB_STACK_LABELS[raw.name] ?? {};
58
+ const found = [];
59
+ const push = (key, value) => {
60
+ const run = key === "run" ? Array.isArray(value) ? value : null : runOf(value);
61
+ if (!run) return;
62
+ found.push({ key, label: labels[key] ?? (key === "run" ? "body" : key), run });
63
+ };
64
+ for (const key of SUB_STACK_KEYS) {
65
+ if (Object.hasOwn(context, key)) push(key, context[key]);
66
+ }
67
+ for (const key of Object.keys(context)) {
68
+ if (!SUB_STACK_KEYS.includes(key)) push(key, context[key]);
69
+ }
70
+ return found;
71
+ }
72
+ function statementPath(segments) {
73
+ return segments.join(".");
74
+ }
75
+ function walk(run) {
76
+ const out = [];
77
+ const pending = [];
78
+ for (let i = run.length - 1; i >= 0; i--) {
79
+ pending.push({ raw: run[i], path: statementPath([i]), depth: 0 });
80
+ }
81
+ while (pending.length > 0) {
82
+ const frame = pending.pop();
83
+ out.push(frame);
84
+ const children = [];
85
+ for (const sub of subStacks(frame.raw)) {
86
+ for (let i = 0; i < sub.run.length; i++) {
87
+ children.push({
88
+ raw: sub.run[i],
89
+ path: statementPath([frame.path, sub.key, i]),
90
+ depth: frame.depth + 1
91
+ });
92
+ }
93
+ }
94
+ for (let i = children.length - 1; i >= 0; i--) pending.push(children[i]);
95
+ }
96
+ return out;
97
+ }
98
+
99
+ // src/bundle/hash.ts
100
+ var isRecord2 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
101
+ function withoutIgnoredInputs(value) {
102
+ if (Array.isArray(value)) return value.map(withoutIgnoredInputs);
103
+ if (!isRecord2(value)) return value;
104
+ const out = {};
105
+ for (const [key, member] of Object.entries(value)) {
106
+ if (key === "input" && Array.isArray(member)) {
107
+ out[key] = member.filter((entry) => !(isRecord2(entry) && entry.ignore === true)).map(withoutIgnoredInputs);
108
+ continue;
109
+ }
110
+ out[key] = withoutIgnoredInputs(member);
111
+ }
112
+ return out;
113
+ }
114
+ function canonicalJson(value) {
115
+ if (Array.isArray(value)) return `[${value.map(canonicalJson).join(",")}]`;
116
+ if (isRecord2(value)) {
117
+ const parts = Object.keys(value).sort().map((key) => `${JSON.stringify(key)}:${canonicalJson(value[key])}`);
118
+ return `{${parts.join(",")}}`;
119
+ }
120
+ return value === void 0 ? "null" : JSON.stringify(value);
121
+ }
122
+ var HEX = "0123456789abcdef";
123
+ function structuralHash(raw) {
124
+ const reduced = withoutIgnoredInputs(normalize(raw));
125
+ const bytes = sha1Bytes(canonicalJson(reduced));
126
+ let hex = "";
127
+ for (const byte of bytes) hex += HEX[byte >> 4] + HEX[byte & 15];
128
+ return hex;
129
+ }
130
+ export {
131
+ SUB_STACK_KEYS,
132
+ canonicalJson,
133
+ deepEqual,
134
+ linkedTableOf,
135
+ normalize,
136
+ statementCatalog,
137
+ statementPath,
138
+ structuralHash,
139
+ subStacks,
140
+ tableRefOf,
141
+ walk
142
+ };
143
+ //# sourceMappingURL=bundle.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  readVersion
3
- } from "./chunk-ACCBOMCB.js";
3
+ } from "./chunk-RCT7UX7B.js";
4
4
  import {
5
5
  atomicWrite
6
6
  } from "./chunk-GNPVYOPB.js";
@@ -170,4 +170,4 @@ export {
170
170
  upgradeCommand,
171
171
  maybeNotifyUpdate
172
172
  };
173
- //# sourceMappingURL=chunk-5YCQ2QHH.js.map
173
+ //# sourceMappingURL=chunk-22TKBSDV.js.map
@@ -41,7 +41,7 @@ import {
41
41
  } from "./chunk-Q77KNEUL.js";
42
42
  import {
43
43
  readVersion
44
- } from "./chunk-ACCBOMCB.js";
44
+ } from "./chunk-RCT7UX7B.js";
45
45
  import {
46
46
  ENV_SPELLINGS,
47
47
  parseEnvSelector
@@ -420,7 +420,7 @@ function rejectPullOnlyFlags(args) {
420
420
  async function runInitCommand(args) {
421
421
  if (args.from !== void 0) {
422
422
  const source = resolveFromSource(args.from);
423
- const { runInitFromCommand } = await import("./codegen-command-GB3H2KQ7.js");
423
+ const { runInitFromCommand } = await import("./codegen-command-FUT2KJB6.js");
424
424
  return runInitFromCommand(args, source);
425
425
  }
426
426
  rejectPullOnlyFlags(args);
@@ -501,4 +501,4 @@ export {
501
501
  resolveFromSource,
502
502
  runInitCommand
503
503
  };
504
- //# sourceMappingURL=chunk-YYFXVYPX.js.map
504
+ //# sourceMappingURL=chunk-4IF54NU5.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  compileBundle
3
- } from "./chunk-ACCBOMCB.js";
3
+ } from "./chunk-RCT7UX7B.js";
4
4
  import {
5
5
  missingArgument
6
6
  } from "./chunk-F6CYJ7TN.js";
@@ -34,4 +34,4 @@ export {
34
34
  assertBundleInput,
35
35
  loadBundleText
36
36
  };
37
- //# sourceMappingURL=chunk-W24FJHPD.js.map
37
+ //# sourceMappingURL=chunk-4Q7ZOHH7.js.map
@@ -1,49 +1,3 @@
1
- // src/fields/generated/field-methods.generated.ts
2
- var FIELD_METHODS = {
3
- "decimal": {
4
- "max": "int",
5
- "min": "int"
6
- },
7
- "email": {
8
- "lower": "bool",
9
- "trim": "bool"
10
- },
11
- "int": {
12
- "max": "int",
13
- "min": "int"
14
- },
15
- "password": {
16
- "max": "int",
17
- "min": "int",
18
- "minAlpha": "int",
19
- "minDigit": "int",
20
- "minLowerAlpha": "int",
21
- "minSymbol": "int",
22
- "minUpperAlpha": "int",
23
- "salt": "text"
24
- },
25
- "tableRef": {
26
- "max": "int",
27
- "min": "int"
28
- },
29
- "text": {
30
- "alphaOk": "bool",
31
- "digitOk": "bool",
32
- "lower": "bool",
33
- "max": "int",
34
- "min": "int",
35
- "ok": "text",
36
- "pattern": "text",
37
- "startsWith": "text",
38
- "trim": "bool",
39
- "upper": "bool"
40
- },
41
- "vector": {
42
- "max": "int",
43
- "min": "int"
44
- }
45
- };
46
-
47
1
  // src/statements/surfaces.ts
48
2
  var STATEMENT_SURFACES = [
49
3
  ["action.call", "mvp:action"],
@@ -288,31 +242,10 @@ function sPathOf(surfaceKey) {
288
242
  return SPATH_OVERRIDES[surfaceKey] ?? surfaceKey.replace(/^stack\|/, "");
289
243
  }
290
244
 
291
- // src/statements/superseded.ts
292
- var SUPERSEDED_STATEMENTS = /* @__PURE__ */ new Map([
293
- // Four crypto families, each phased forward with breaking changes between
294
- // versions. The engine still registers a class for every one of them.
295
- ["mvp:crypto_jwe_decode", "mvp:crypto_jwe_decode2"],
296
- ["mvp:crypto_jwe_encode", "mvp:crypto_jwe_encode3"],
297
- ["mvp:crypto_jwe_encode2", "mvp:crypto_jwe_encode3"],
298
- ["mvp:crypto_jws_decode", "mvp:crypto_jws_decode2"],
299
- ["mvp:crypto_jws_encode", "mvp:crypto_jws_encode2"],
300
- // Retired outright — an old third-party log connector with no successor.
301
- ["mvp:connect_ncscale_send_log", ""]
302
- ]);
303
- function supersededBy(storedName, surfaceOf) {
304
- const successor = SUPERSEDED_STATEMENTS.get(storedName);
305
- if (successor === void 0 || successor === "") return null;
306
- return surfaceOf(successor) ?? successor;
307
- }
308
-
309
245
  export {
310
- FIELD_METHODS,
311
246
  STATEMENT_SURFACES,
312
247
  TOTAL_STATEMENTS,
313
248
  IMPLEMENTED_STATEMENTS,
314
- sPathOf,
315
- SUPERSEDED_STATEMENTS,
316
- supersededBy
249
+ sPathOf
317
250
  };
318
- //# sourceMappingURL=chunk-4BXJGVZ3.js.map
251
+ //# sourceMappingURL=chunk-BC2C5GVI.js.map
@@ -0,0 +1,70 @@
1
+ // src/fields/generated/field-methods.generated.ts
2
+ var FIELD_METHODS = {
3
+ "decimal": {
4
+ "max": "int",
5
+ "min": "int"
6
+ },
7
+ "email": {
8
+ "lower": "bool",
9
+ "trim": "bool"
10
+ },
11
+ "int": {
12
+ "max": "int",
13
+ "min": "int"
14
+ },
15
+ "password": {
16
+ "max": "int",
17
+ "min": "int",
18
+ "minAlpha": "int",
19
+ "minDigit": "int",
20
+ "minLowerAlpha": "int",
21
+ "minSymbol": "int",
22
+ "minUpperAlpha": "int",
23
+ "salt": "text"
24
+ },
25
+ "tableRef": {
26
+ "max": "int",
27
+ "min": "int"
28
+ },
29
+ "text": {
30
+ "alphaOk": "bool",
31
+ "digitOk": "bool",
32
+ "lower": "bool",
33
+ "max": "int",
34
+ "min": "int",
35
+ "ok": "text",
36
+ "pattern": "text",
37
+ "startsWith": "text",
38
+ "trim": "bool",
39
+ "upper": "bool"
40
+ },
41
+ "vector": {
42
+ "max": "int",
43
+ "min": "int"
44
+ }
45
+ };
46
+
47
+ // src/statements/superseded.ts
48
+ var SUPERSEDED_STATEMENTS = /* @__PURE__ */ new Map([
49
+ // Four crypto families, each phased forward with breaking changes between
50
+ // versions. The engine still registers a class for every one of them.
51
+ ["mvp:crypto_jwe_decode", "mvp:crypto_jwe_decode2"],
52
+ ["mvp:crypto_jwe_encode", "mvp:crypto_jwe_encode3"],
53
+ ["mvp:crypto_jwe_encode2", "mvp:crypto_jwe_encode3"],
54
+ ["mvp:crypto_jws_decode", "mvp:crypto_jws_decode2"],
55
+ ["mvp:crypto_jws_encode", "mvp:crypto_jws_encode2"],
56
+ // Retired outright — an old third-party log connector with no successor.
57
+ ["mvp:connect_ncscale_send_log", ""]
58
+ ]);
59
+ function supersededBy(storedName, surfaceOf) {
60
+ const successor = SUPERSEDED_STATEMENTS.get(storedName);
61
+ if (successor === void 0 || successor === "") return null;
62
+ return surfaceOf(successor) ?? successor;
63
+ }
64
+
65
+ export {
66
+ FIELD_METHODS,
67
+ SUPERSEDED_STATEMENTS,
68
+ supersededBy
69
+ };
70
+ //# sourceMappingURL=chunk-BSK7ELHU.js.map