@artblocks/abx-sdk 0.1.0-alpha.2 → 0.1.0-alpha.21

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 (144) hide show
  1. package/CHANGELOG.md +2203 -0
  2. package/README.md +131 -0
  3. package/dist/abi/generated.d.ts +8502 -129
  4. package/dist/abi/generated.d.ts.map +1 -1
  5. package/dist/abi/generated.js +40 -22
  6. package/dist/abi/generated.js.map +1 -1
  7. package/dist/abi/index.d.ts +2645 -168
  8. package/dist/abi/index.d.ts.map +1 -1
  9. package/dist/abi/index.js +34 -7
  10. package/dist/abi/index.js.map +1 -1
  11. package/dist/anchors.d.ts +319 -0
  12. package/dist/anchors.d.ts.map +1 -0
  13. package/dist/anchors.js +703 -0
  14. package/dist/anchors.js.map +1 -0
  15. package/dist/chains.d.ts +15 -9
  16. package/dist/chains.d.ts.map +1 -1
  17. package/dist/chains.js +19 -15
  18. package/dist/chains.js.map +1 -1
  19. package/dist/chunks.d.ts +53 -23
  20. package/dist/chunks.d.ts.map +1 -1
  21. package/dist/chunks.js +68 -6
  22. package/dist/chunks.js.map +1 -1
  23. package/dist/clients.d.ts +23 -11
  24. package/dist/clients.d.ts.map +1 -1
  25. package/dist/clients.js +17 -18
  26. package/dist/clients.js.map +1 -1
  27. package/dist/create2.d.ts +85 -1
  28. package/dist/create2.d.ts.map +1 -1
  29. package/dist/create2.js +159 -2
  30. package/dist/create2.js.map +1 -1
  31. package/dist/creator-token.d.ts +132 -0
  32. package/dist/creator-token.d.ts.map +1 -0
  33. package/dist/creator-token.js +183 -0
  34. package/dist/creator-token.js.map +1 -0
  35. package/dist/deploy.d.ts +234 -14
  36. package/dist/deploy.d.ts.map +1 -1
  37. package/dist/deploy.js +289 -111
  38. package/dist/deploy.js.map +1 -1
  39. package/dist/deployments.d.ts +63 -0
  40. package/dist/deployments.d.ts.map +1 -1
  41. package/dist/deployments.js +202 -28
  42. package/dist/deployments.js.map +1 -1
  43. package/dist/deps.d.ts +122 -5
  44. package/dist/deps.d.ts.map +1 -1
  45. package/dist/deps.js +248 -6
  46. package/dist/deps.js.map +1 -1
  47. package/dist/env.d.ts.map +1 -1
  48. package/dist/env.js +8 -0
  49. package/dist/env.js.map +1 -1
  50. package/dist/errors.d.ts +94 -0
  51. package/dist/errors.d.ts.map +1 -0
  52. package/dist/errors.js +126 -0
  53. package/dist/errors.js.map +1 -0
  54. package/dist/execute.d.ts +115 -0
  55. package/dist/execute.d.ts.map +1 -0
  56. package/dist/execute.js +142 -0
  57. package/dist/execute.js.map +1 -0
  58. package/dist/gateways.d.ts +79 -0
  59. package/dist/gateways.d.ts.map +1 -0
  60. package/dist/gateways.js +156 -0
  61. package/dist/gateways.js.map +1 -0
  62. package/dist/generator-document.d.ts +58 -0
  63. package/dist/generator-document.d.ts.map +1 -0
  64. package/dist/generator-document.js +124 -0
  65. package/dist/generator-document.js.map +1 -0
  66. package/dist/generator.d.ts +43 -1
  67. package/dist/generator.d.ts.map +1 -1
  68. package/dist/generator.js +29 -0
  69. package/dist/generator.js.map +1 -1
  70. package/dist/index.d.ts +18 -3
  71. package/dist/index.d.ts.map +1 -1
  72. package/dist/index.js +18 -3
  73. package/dist/index.js.map +1 -1
  74. package/dist/inspect.d.ts +48 -0
  75. package/dist/inspect.d.ts.map +1 -0
  76. package/dist/inspect.js +295 -0
  77. package/dist/inspect.js.map +1 -0
  78. package/dist/migrate.d.ts +41 -0
  79. package/dist/migrate.d.ts.map +1 -0
  80. package/dist/migrate.js +142 -0
  81. package/dist/migrate.js.map +1 -0
  82. package/dist/mime.d.ts +11 -0
  83. package/dist/mime.d.ts.map +1 -0
  84. package/dist/mime.js +40 -0
  85. package/dist/mime.js.map +1 -0
  86. package/dist/node.d.ts +10 -0
  87. package/dist/node.d.ts.map +1 -0
  88. package/dist/node.js +24 -0
  89. package/dist/node.js.map +1 -0
  90. package/dist/onchain-uri.d.ts +110 -0
  91. package/dist/onchain-uri.d.ts.map +1 -0
  92. package/dist/onchain-uri.js +277 -0
  93. package/dist/onchain-uri.js.map +1 -0
  94. package/dist/ops.d.ts +507 -14
  95. package/dist/ops.d.ts.map +1 -1
  96. package/dist/ops.js +848 -32
  97. package/dist/ops.js.map +1 -1
  98. package/dist/policy.d.ts +58 -0
  99. package/dist/policy.d.ts.map +1 -0
  100. package/dist/policy.js +36 -0
  101. package/dist/policy.js.map +1 -0
  102. package/dist/probe.d.ts +29 -0
  103. package/dist/probe.d.ts.map +1 -1
  104. package/dist/probe.js +104 -9
  105. package/dist/probe.js.map +1 -1
  106. package/dist/reconstruct.d.ts +94 -2
  107. package/dist/reconstruct.d.ts.map +1 -1
  108. package/dist/reconstruct.js +432 -97
  109. package/dist/reconstruct.js.map +1 -1
  110. package/dist/resume.d.ts +96 -0
  111. package/dist/resume.d.ts.map +1 -0
  112. package/dist/resume.js +95 -0
  113. package/dist/resume.js.map +1 -0
  114. package/dist/script-chunks.d.ts +24 -0
  115. package/dist/script-chunks.d.ts.map +1 -0
  116. package/dist/script-chunks.js +63 -0
  117. package/dist/script-chunks.js.map +1 -0
  118. package/dist/service.d.ts +206 -9
  119. package/dist/service.d.ts.map +1 -1
  120. package/dist/service.js +228 -18
  121. package/dist/service.js.map +1 -1
  122. package/dist/spine.d.ts +47 -4
  123. package/dist/spine.d.ts.map +1 -1
  124. package/dist/spine.js +0 -0
  125. package/dist/spine.js.map +1 -1
  126. package/dist/staging.d.ts +124 -0
  127. package/dist/staging.d.ts.map +1 -0
  128. package/dist/staging.js +134 -0
  129. package/dist/staging.js.map +1 -0
  130. package/dist/tokendata.d.ts +62 -2
  131. package/dist/tokendata.d.ts.map +1 -1
  132. package/dist/tokendata.js +79 -17
  133. package/dist/tokendata.js.map +1 -1
  134. package/dist/tokens.d.ts +120 -0
  135. package/dist/tokens.d.ts.map +1 -0
  136. package/dist/tokens.js +317 -0
  137. package/dist/tokens.js.map +1 -0
  138. package/dist/types.d.ts +108 -4
  139. package/dist/types.d.ts.map +1 -1
  140. package/dist/util.d.ts +74 -0
  141. package/dist/util.d.ts.map +1 -0
  142. package/dist/util.js +106 -0
  143. package/dist/util.js.map +1 -0
  144. package/package.json +11 -2
@@ -0,0 +1,124 @@
1
+ /**
2
+ * The generator-document family — the template-mode runtime companion, the inline-safety
3
+ * escapes, and the pure document-shape builders. Hoisted from `@artblocks/abx-token-api`
4
+ * (the abx-services integrator ask): every piece here is a pure string operation with no chain
5
+ * access and no Node dependency, so it belongs in the neutral layer a resolver, a CLI preview,
6
+ * and any third-party provider all consume identically — one definition of the runtime surface
7
+ * and the document shape, so none of them can quietly drift from what the others emit.
8
+ */
9
+ /**
10
+ * `abx.js` — the runtime companion (the hl-gen.js analog), served at `/abx.js` and
11
+ * inlined into template-mode documents. Convention, not protocol: a directory build
12
+ * includes it; the generator injects the same surface.
13
+ *
14
+ * tokenData resolution order (the durability chain): the injected `window.abxTokenData`
15
+ * global (template mode) → the `?abx=` query param (base64url canonical JSON — the
16
+ * live-view route) → the `?chainId&contract&tokenId` coordinate floor (a build opened
17
+ * bare from a gateway still knows which token it is; full param reads from RPC are the
18
+ * render-node's job, not this shim's).
19
+ */
20
+ export const ABX_JS = `(function () {
21
+ var abx = (window.abx = window.abx || {});
22
+ function fromQuery() {
23
+ try {
24
+ var q = new URLSearchParams(location.search);
25
+ var packed = q.get('abx');
26
+ if (packed) {
27
+ var b64 = packed.replace(/-/g, '+').replace(/_/g, '/');
28
+ return JSON.parse(new TextDecoder().decode(Uint8Array.from(atob(b64), function (c) { return c.charCodeAt(0); })));
29
+ }
30
+ // coordinate floor: enough for a deterministic piece opened bare from a gateway
31
+ if (q.get('contract') && q.get('tokenId')) {
32
+ return {
33
+ chainId: Number(q.get('chainId') || 1),
34
+ contractAddress: String(q.get('contract')).toLowerCase(),
35
+ tokenId: String(q.get('tokenId')),
36
+ };
37
+ }
38
+ } catch (e) {}
39
+ return null;
40
+ }
41
+ abx.tokenData = window.abxTokenData || fromQuery();
42
+ abx.__traits = null;
43
+ abx.__done = false;
44
+ /** The script reports its computed traits (script-defined features; captured at render). */
45
+ abx.traits = function (t) {
46
+ abx.__traits = t;
47
+ try { document.dispatchEvent(new CustomEvent('abx:traits', {detail: t})); } catch (e) {}
48
+ return t;
49
+ };
50
+ /** Output-complete — the capture point for the render effect. Optional (timeout fallback). */
51
+ abx.done = function () {
52
+ abx.__done = true;
53
+ try { document.dispatchEvent(new CustomEvent('abx:done')); } catch (e) {}
54
+ };
55
+ })();
56
+ `;
57
+ /**
58
+ * Inline-document safety — the one HTML parsing rule that matters when embedding
59
+ * content inside <script> elements: the parser ends the element at the first
60
+ * `</script`, regardless of JS string/comment context. Two content shapes, two
61
+ * semantics-preserving escapes:
62
+ *
63
+ * - JS source (libraries, creator scripts): `</script` → `<\/script`. In valid JS the
64
+ * sequence can only occur inside a string, template, regex, or comment — contexts
65
+ * where `\/` is identical to `/` — so the transform never changes behavior.
66
+ * - JSON (the injected `window.abxTokenData`): every `<` → `\u003c`. `<` only occurs
67
+ * inside JSON strings (never in the syntax), and `\u003c` parses to the same
68
+ * character — the canonical (hashed) serialization is untouched; only the delivery
69
+ * form differs.
70
+ */
71
+ /** JS source safe to inline inside a <script> element. Case-insensitive because HTML end tags
72
+ * are; the on-chain generator matches this (see `AbxGenerator._escapedScript`). */
73
+ export function escapeInlineScript(src) {
74
+ return src.replace(/<\/(script)/gi, '<\\/$1');
75
+ }
76
+ /** A JSON payload safe to inline inside a <script> element (parse-identical). */
77
+ export function escapeInlineJson(json) {
78
+ return json.replace(/</g, '\\u003c');
79
+ }
80
+ /**
81
+ * Inject `window.abxTokenData` (and, when the document doesn't already carry one, a
82
+ * `<base href="{code root}/">` so relative asset paths keep riding the gateway) at the
83
+ * very top of `<head>` — before any build script can execute; abx.js resolves the global
84
+ * first. String-level and deliberately robust rather than a full HTML parse: no `<head>`
85
+ * → inject right after `<html …>`; neither → prepend. First `<base>` wins in HTML, so an
86
+ * existing one is never doubled.
87
+ */
88
+ export function injectTokenDataIntoHtml(html, tokenDataJson, codeRoot) {
89
+ const baseTag = /<base[\s/>]/i.test(html) ? '' : `<base href="${codeRoot}">`;
90
+ const injection = `${baseTag}<script>window.abxTokenData=${escapeInlineJson(tokenDataJson)};</script>`;
91
+ const head = /<head(\s[^>]*)?>/i.exec(html);
92
+ if (head) {
93
+ const at = head.index + head[0].length;
94
+ return html.slice(0, at) + injection + html.slice(at);
95
+ }
96
+ const htmlTag = /<html(\s[^>]*)?>/i.exec(html);
97
+ if (htmlTag) {
98
+ const at = htmlTag.index + htmlTag[0].length;
99
+ return html.slice(0, at) + injection + html.slice(at);
100
+ }
101
+ return injection + html;
102
+ }
103
+ /**
104
+ * The template-mode document shape, pure — no chain access, so a caller that already has a
105
+ * script + dep tags in hand (the resolver's own chain-fetched assembly; `abx preview`'s offline
106
+ * studio, local-file + CDN-resolved) can build the byte-identical document. Exported for exactly
107
+ * that reason: **one** definition of the shape, so a caller can never quietly drift from what the
108
+ * generator actually serves — the failure mode a hand-maintained duplicate (with a "keep these in
109
+ * sync" comment and nothing enforcing it) invites.
110
+ */
111
+ export function buildGeneratorDocument(script, tokenDataJson, depTags) {
112
+ return [
113
+ '<!doctype html>',
114
+ '<html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">',
115
+ '<style>html,body{margin:0;padding:0;overflow:hidden}canvas{display:block}</style>',
116
+ `<script>window.abxTokenData=${escapeInlineJson(tokenDataJson)};</script>`,
117
+ `<script>${ABX_JS}</script>`,
118
+ ...depTags,
119
+ '</head><body>',
120
+ `<script>\n${escapeInlineScript(script)}\n</script>`,
121
+ '</body></html>',
122
+ ].join('\n');
123
+ }
124
+ //# sourceMappingURL=generator-document.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generator-document.js","sourceRoot":"","sources":["../src/generator-document.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;C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xD,CAAC;IACD,OAAO,SAAS,GAAG,IAAI,CAAC;AAC1B,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAAc,EAAE,aAAqB,EAAE,OAAiB;IAC7F,OAAO;QACL,iBAAiB;QACjB,uGAAuG;QACvG,mFAAmF;QACnF,+BAA+B,gBAAgB,CAAC,aAAa,CAAC,YAAY;QAC1E,WAAW,MAAM,WAAW;QAC5B,GAAG,OAAO;QACV,eAAe;QACf,aAAa,kBAAkB,CAAC,MAAM,CAAC,aAAa;QACpD,gBAAgB;KACjB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
@@ -98,6 +98,42 @@ export declare const abxGeneratorAbi: readonly [{
98
98
  readonly name: "";
99
99
  readonly type: "string";
100
100
  }];
101
+ }, {
102
+ readonly type: "function";
103
+ readonly name: "abxJs";
104
+ readonly stateMutability: "view";
105
+ readonly inputs: readonly [];
106
+ readonly outputs: readonly [{
107
+ readonly name: "";
108
+ readonly type: "string";
109
+ }];
110
+ }, {
111
+ readonly type: "function";
112
+ readonly name: "gunzipScript";
113
+ readonly stateMutability: "view";
114
+ readonly inputs: readonly [];
115
+ readonly outputs: readonly [{
116
+ readonly name: "";
117
+ readonly type: "string";
118
+ }];
119
+ }, {
120
+ readonly type: "function";
121
+ readonly name: "registryScriptChunk";
122
+ readonly stateMutability: "view";
123
+ readonly inputs: readonly [{
124
+ readonly name: "registry";
125
+ readonly type: "address";
126
+ }, {
127
+ readonly name: "ref";
128
+ readonly type: "bytes32";
129
+ }, {
130
+ readonly name: "index";
131
+ readonly type: "uint256";
132
+ }];
133
+ readonly outputs: readonly [{
134
+ readonly name: "";
135
+ readonly type: "string";
136
+ }];
101
137
  }];
102
138
  /** `AbxGenerator`'s branch constants, by index: 0 = none, 1 = template, 2 = directory. */
103
139
  export declare const GENERATOR_BRANCHES: readonly ["none", "template", "directory"];
@@ -108,7 +144,13 @@ export declare const GENERATOR_URL_BUDGET_BYTES = 8192;
108
144
  export interface GeneratorStatus {
109
145
  branch: number;
110
146
  branchName: GeneratorBranch;
111
- /** Template branch with EVERY dependency resolved to proven on-chain bytes. Always false off it. */
147
+ /** Template branch with EVERY dependency resolved to on-chain bytes — no server, gateway, or CDN
148
+ * in the graph. Always false off it.
149
+ *
150
+ * A claim about WHERE the bytes come from, never about whether they are frozen: a `Registry`
151
+ * dependency is re-fetched from the registry contract on every read, so its bytes can change while
152
+ * this stays `true` — including after `lockDependencies` (which freezes the ref and the registry
153
+ * pointer, not another contract's storage). Don't render this as "immutable" in a UI. */
112
154
  chainComplete: boolean;
113
155
  /** Refs that emit `<!-- abx:unresolved … -->` markers, decoded to their readable tags. */
114
156
  unresolvedRefs: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../src/generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAC,OAAO,EAAM,MAAM,MAAM,CAAC;AAGvC,sFAAsF;AACtF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyDlB,CAAC;AAEX,0FAA0F;AAC1F,eAAO,MAAM,kBAAkB,4CAA6C,CAAC;AAC7E,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE,2FAA2F;AAC3F,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAE/C,yFAAyF;AACzF,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,eAAe,CAAC;IAC5B,oGAAoG;IACpG,aAAa,EAAE,OAAO,CAAC;IACvB,0FAA0F;IAC1F,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,qFAAqF;IACrF,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,uGAAuG;AACvG,MAAM,WAA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AC,IAAI,EAAE;QACjB,OAAO,EAAE,OAAO,CAAC;QACjB,GAAG,EAAE,SAAS,OAAO,EAAE,CAAC;QACxB,YAAY,EAAE,MAAM,CAAC;QACrB,IAAI,EAAE,SAAS,OAAO,EAAE,CAAC;KAC1B,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACtB;AAED,6FAA6F;AAC7F,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,mBAAmB,EAC3B,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,OAAO,GACb,OAAO,CAAC,eAAe,CAAC,CAc1B"}
package/dist/generator.js CHANGED
@@ -57,6 +57,35 @@ export const abxGeneratorAbi = [
57
57
  ],
58
58
  outputs: [{ name: '', type: 'string' }],
59
59
  },
60
+ // The rest of the piecewise set. `document` on a large project can exceed a node's eth_call gas cap
61
+ // (tokenURI assembly measures ~360-405k gas per KB, climbing with size), and these are how a client assembles the same
62
+ // document from pieces instead: the two baked runtime blobs, plus a registry dependency's chunks
63
+ // one at a time. Every read here is an OFF-CHAIN view call by design — no contract calls them.
64
+ {
65
+ type: 'function',
66
+ name: 'abxJs',
67
+ stateMutability: 'view',
68
+ inputs: [],
69
+ outputs: [{ name: '', type: 'string' }],
70
+ },
71
+ {
72
+ type: 'function',
73
+ name: 'gunzipScript',
74
+ stateMutability: 'view',
75
+ inputs: [],
76
+ outputs: [{ name: '', type: 'string' }],
77
+ },
78
+ {
79
+ type: 'function',
80
+ name: 'registryScriptChunk',
81
+ stateMutability: 'view',
82
+ inputs: [
83
+ { name: 'registry', type: 'address' },
84
+ { name: 'ref', type: 'bytes32' },
85
+ { name: 'index', type: 'uint256' },
86
+ ],
87
+ outputs: [{ name: '', type: 'string' }],
88
+ },
60
89
  ];
61
90
  /** `AbxGenerator`'s branch constants, by index: 0 = none, 1 = template, 2 = directory. */
62
91
  export const GENERATOR_BRANCHES = ['none', 'template', 'directory'];
@@ -1 +1 @@
1
- {"version":3,"file":"generator.js","sourceRoot":"","sources":["../src/generator.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C,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAC3D,aAAa;KACd,CAAC;AACJ,CAAC"}
package/dist/index.d.ts CHANGED
@@ -13,20 +13,35 @@ export * from './types.js';
13
13
  export * from './spine.js';
14
14
  export * from './chains.js';
15
15
  export * from './clients.js';
16
- export * from './deploy.js';
17
16
  export * from './ops.js';
17
+ export * from './execute.js';
18
+ export * from './errors.js';
19
+ export * from './deploy.js';
20
+ export * from './anchors.js';
18
21
  export * from './reconstruct.js';
22
+ export * from './resume.js';
19
23
  export * from './tokendata.js';
20
24
  export * from './probe.js';
21
25
  export * from './token.js';
26
+ export * from './tokens.js';
22
27
  export * from './traits.js';
23
28
  export * from './fastlz.js';
24
29
  export * from './chunks.js';
25
30
  export * from './create2.js';
31
+ export * from './creator-token.js';
26
32
  export * from './deployments.js';
27
33
  export * from './deps.js';
34
+ export * from './gateways.js';
28
35
  export * from './generator.js';
36
+ export * from './generator-document.js';
37
+ export * from './inspect.js';
38
+ export * from './script-chunks.js';
39
+ export * from './migrate.js';
40
+ export * from './mime.js';
41
+ export * from './onchain-uri.js';
42
+ export * from './policy.js';
29
43
  export * from './service.js';
30
- export { loadDotEnv, parseEnvContent } from './env.js';
31
- export { oneOfOneImageAbi, oneOfOneImageFactoryAbi, seriesImageAbi, seriesImageFactoryAbi, seriesCodeAbi, seriesCodeFactoryAbi, abxSeedSourceAbi, abxMetadataRendererAbi, abxChunkStoreAbi, abxFixedPriceMinterAbi, spineEventAbi, } from './abi/index.js';
44
+ export * from './staging.js';
45
+ export * from './util.js';
46
+ export { oneOfOneImageAbi, oneOfOneImageFactoryAbi, seriesImageAbi, seriesImageFactoryAbi, seriesCodeAbi, seriesCodeFactoryAbi, oneOfOneEditionAbi, oneOfOneEditionFactoryAbi, editionImageAbi, editionImageFactoryAbi, editionCodeAbi, editionCodeFactoryAbi, abxSeedSourceAbi, abxMetadataRendererAbi, abxChunkStoreAbi, abxFixedPriceMinterAbi, abxFixedPriceMinter1155Abi, spineEventAbi, } from './abi/index.js';
32
47
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,YAAY,EAAC,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,YAAY,EAAE,OAAO,EAAC,MAAM,MAAM,CAAC;AAE5E,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAC,UAAU,EAAE,eAAe,EAAC,MAAM,UAAU,CAAC;AACrD,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,cAAc,EACd,qBAAqB,EACrB,aAAa,EACb,oBAAoB,EACpB,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,sBAAsB,EACtB,aAAa,GACd,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,YAAY,EAAC,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,YAAY,EAAE,OAAO,EAAC,MAAM,MAAM,CAAC;AAE5E,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,cAAc,EACd,qBAAqB,EACrB,aAAa,EACb,oBAAoB,EACpB,kBAAkB,EAClB,yBAAyB,EACzB,eAAe,EACf,sBAAsB,EACtB,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,sBAAsB,EACtB,0BAA0B,EAC1B,aAAa,GACd,MAAM,gBAAgB,CAAC"}
package/dist/index.js CHANGED
@@ -2,20 +2,35 @@ export * from './types.js';
2
2
  export * from './spine.js';
3
3
  export * from './chains.js';
4
4
  export * from './clients.js';
5
- export * from './deploy.js';
6
5
  export * from './ops.js';
6
+ export * from './execute.js';
7
+ export * from './errors.js';
8
+ export * from './deploy.js';
9
+ export * from './anchors.js';
7
10
  export * from './reconstruct.js';
11
+ export * from './resume.js';
8
12
  export * from './tokendata.js';
9
13
  export * from './probe.js';
10
14
  export * from './token.js';
15
+ export * from './tokens.js';
11
16
  export * from './traits.js';
12
17
  export * from './fastlz.js';
13
18
  export * from './chunks.js';
14
19
  export * from './create2.js';
20
+ export * from './creator-token.js';
15
21
  export * from './deployments.js';
16
22
  export * from './deps.js';
23
+ export * from './gateways.js';
17
24
  export * from './generator.js';
25
+ export * from './generator-document.js';
26
+ export * from './inspect.js';
27
+ export * from './script-chunks.js';
28
+ export * from './migrate.js';
29
+ export * from './mime.js';
30
+ export * from './onchain-uri.js';
31
+ export * from './policy.js';
18
32
  export * from './service.js';
19
- export { loadDotEnv, parseEnvContent } from './env.js';
20
- export { oneOfOneImageAbi, oneOfOneImageFactoryAbi, seriesImageAbi, seriesImageFactoryAbi, seriesCodeAbi, seriesCodeFactoryAbi, abxSeedSourceAbi, abxMetadataRendererAbi, abxChunkStoreAbi, abxFixedPriceMinterAbi, spineEventAbi, } from './abi/index.js';
33
+ export * from './staging.js';
34
+ export * from './util.js';
35
+ export { oneOfOneImageAbi, oneOfOneImageFactoryAbi, seriesImageAbi, seriesImageFactoryAbi, seriesCodeAbi, seriesCodeFactoryAbi, oneOfOneEditionAbi, oneOfOneEditionFactoryAbi, editionImageAbi, editionImageFactoryAbi, editionCodeAbi, editionCodeFactoryAbi, abxSeedSourceAbi, abxMetadataRendererAbi, abxChunkStoreAbi, abxFixedPriceMinterAbi, abxFixedPriceMinter1155Abi, spineEventAbi, } from './abi/index.js';
21
36
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,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Ac,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,cAAc,EACd,qBAAqB,EACrB,aAAa,EACb,oBAAoB,EACpB,kBAAkB,EAClB,yBAAyB,EACzB,eAAe,EACf,sBAAsB,EACtB,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,sBAAsB,EACtB,0BAA0B,EAC1B,aAAa,GACd,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * `abx inspect <script.js>` — static analysis of a generative script, BEFORE picking a lane.
3
+ *
4
+ * The membrane fix behind this: an agent (or creator) should DERIVE the deployment lane from what
5
+ * the script actually needs — are there traits? are they reproducible on-chain? how big is the
6
+ * assembled document (does a single `tokenURI` eth_call even fit)? — instead of guessing "fully
7
+ * on-chain!" and walking it back. This module is the pure analysis; `cmdInspect` formats it.
8
+ *
9
+ * Static only — it never executes the script (that's the resolver/runner's job, and executing
10
+ * untrusted code in the CLI would be a footgun). Everything here is regex/heuristic over the source.
11
+ */
12
+ export type TraitFeasibility = 'none' | 'exact-likely' | 'careful' | 'infeasible' | 'unknown';
13
+ export interface ScriptAnalysis {
14
+ bytes: number;
15
+ estChunks: number;
16
+ traits: {
17
+ present: boolean;
18
+ keys: string[];
19
+ };
20
+ paramHints: string[];
21
+ prng: {
22
+ seeded: boolean;
23
+ usesBareRandom: boolean;
24
+ usesMathRandom: boolean;
25
+ usesNoise: boolean;
26
+ };
27
+ depHints: string[];
28
+ looksP5: boolean;
29
+ feasibility: {
30
+ verdict: TraitFeasibility;
31
+ reason: string;
32
+ };
33
+ doc: {
34
+ estBytes: number;
35
+ deps: string[];
36
+ fitsSingleCall: boolean;
37
+ unknownDepSizes: boolean;
38
+ };
39
+ runtime: {
40
+ readsTokenData: boolean;
41
+ reportsTraits: boolean;
42
+ wrongGlobal: string | null;
43
+ };
44
+ }
45
+ export declare function analyzeScript(source: string, declaredDeps?: string[]): ScriptAnalysis;
46
+ /** A one-line lane recommendation derived from the analysis (the decision-tree output). */
47
+ export declare function recommendLane(a: ScriptAnalysis): string;
48
+ //# sourceMappingURL=inspect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../src/inspect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAgBH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,cAAc,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,CAAC;AAE9F,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE;QAAC,OAAO,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAC,CAAC;IAC3C,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,IAAI,EAAE;QAAC,MAAM,EAAE,OAAO,CAAC;QAAC,cAAc,EAAE,OAAO,CAAC;QAAC,cAAc,EAAE,OAAO,CAAC;QAAC,SAAS,EAAE,OAAO,CAAA;KAAC,CAAC;IAC9F,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE;QAAC,OAAO,EAAE,gBAAgB,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,CAAC;IACzD,GAAG,EAAE;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,EAA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