@arkade-os/sdk 0.5.11 → 0.5.13

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 (101) hide show
  1. package/dist/adapters/expo.cjs +7 -7
  2. package/dist/adapters/expo.d.cts +2 -2
  3. package/dist/adapters/expo.d.ts +2 -2
  4. package/dist/adapters/expo.js +4 -4
  5. package/dist/{asyncStorageTaskQueue-C0irgPwJ.d.ts → asyncStorageTaskQueue-Dhbe00Ya.d.ts} +1 -1
  6. package/dist/{asyncStorageTaskQueue-B6rFkXzW.d.cts → asyncStorageTaskQueue-Y4BlVm41.d.cts} +1 -1
  7. package/dist/{chunk-WIZCF5IX.cjs → chunk-6TBTL42M.cjs} +92 -5
  8. package/dist/chunk-6TBTL42M.cjs.map +1 -0
  9. package/dist/{chunk-DMYHAUTA.cjs → chunk-6WPP4UGN.cjs} +9962 -8635
  10. package/dist/chunk-6WPP4UGN.cjs.map +1 -0
  11. package/dist/{chunk-WZ2UHHQ7.cjs → chunk-6XVTGWQK.cjs} +20 -20
  12. package/dist/{chunk-WZ2UHHQ7.cjs.map → chunk-6XVTGWQK.cjs.map} +1 -1
  13. package/dist/{chunk-UPIQZRNJ.cjs → chunk-ACIQZLWL.cjs} +379 -20
  14. package/dist/chunk-ACIQZLWL.cjs.map +1 -0
  15. package/dist/{chunk-KRKREYKT.js → chunk-BA36SQY2.js} +4 -4
  16. package/dist/{chunk-KRKREYKT.js.map → chunk-BA36SQY2.js.map} +1 -1
  17. package/dist/{chunk-VJQMUKPZ.js → chunk-BP4NA7HK.js} +5 -5
  18. package/dist/{chunk-VJQMUKPZ.js.map → chunk-BP4NA7HK.js.map} +1 -1
  19. package/dist/{chunk-LKVVWCIW.js → chunk-D4QH6L54.js} +4 -4
  20. package/dist/{chunk-LKVVWCIW.js.map → chunk-D4QH6L54.js.map} +1 -1
  21. package/dist/{chunk-DPFD5KBK.js → chunk-GB67AGXG.js} +86 -6
  22. package/dist/chunk-GB67AGXG.js.map +1 -0
  23. package/dist/{chunk-5HCDXBBG.cjs → chunk-HS7TKVOZ.cjs} +30 -21
  24. package/dist/chunk-HS7TKVOZ.cjs.map +1 -0
  25. package/dist/{chunk-SS5BPVQL.js → chunk-LHLRG2BE.js} +23 -15
  26. package/dist/chunk-LHLRG2BE.js.map +1 -0
  27. package/dist/{chunk-HRFWODLP.js → chunk-QSERJPTT.js} +628 -23
  28. package/dist/chunk-QSERJPTT.js.map +1 -0
  29. package/dist/{chunk-VLO3JAP3.cjs → chunk-TD4PKK2I.cjs} +680 -68
  30. package/dist/chunk-TD4PKK2I.cjs.map +1 -0
  31. package/dist/{chunk-NC6TEEHZ.cjs → chunk-TYSUFG2K.cjs} +11 -11
  32. package/dist/{chunk-NC6TEEHZ.cjs.map → chunk-TYSUFG2K.cjs.map} +1 -1
  33. package/dist/{chunk-GEK6QBSY.cjs → chunk-WFJPLXOE.cjs} +21 -21
  34. package/dist/{chunk-GEK6QBSY.cjs.map → chunk-WFJPLXOE.cjs.map} +1 -1
  35. package/dist/{chunk-4DUTRRXF.js → chunk-X57WKONW.js} +369 -10
  36. package/dist/chunk-X57WKONW.js.map +1 -0
  37. package/dist/{chunk-W2C3KDQA.js → chunk-Y3AWLHQP.js} +9520 -8196
  38. package/dist/chunk-Y3AWLHQP.js.map +1 -0
  39. package/dist/compiler.cjs +3 -4
  40. package/dist/compiler.cjs.map +1 -1
  41. package/dist/compiler.js +2 -3
  42. package/dist/compiler.js.map +1 -1
  43. package/dist/contracts/handlers/index.cjs +15 -11
  44. package/dist/contracts/handlers/index.d.cts +5 -5
  45. package/dist/contracts/handlers/index.d.ts +5 -5
  46. package/dist/contracts/handlers/index.js +4 -4
  47. package/dist/{index-Bq349_ly.d.cts → index-BQwrHcOh.d.cts} +524 -23
  48. package/dist/{index-D4ahI0W6.d.cts → index-BaTItxPx.d.cts} +1 -1
  49. package/dist/{index-Yh5y9G4E.d.ts → index-BapVvuoI.d.ts} +1 -1
  50. package/dist/{index-Mn2POBPj.d.ts → index-DuXylQrN.d.ts} +524 -23
  51. package/dist/index.cjs +403 -368
  52. package/dist/index.d.cts +82 -71
  53. package/dist/index.d.ts +82 -71
  54. package/dist/index.js +6 -7
  55. package/dist/repositories/realm/index.cjs +39 -40
  56. package/dist/repositories/realm/index.cjs.map +1 -1
  57. package/dist/repositories/realm/index.d.cts +2 -2
  58. package/dist/repositories/realm/index.d.ts +2 -2
  59. package/dist/repositories/realm/index.js +7 -8
  60. package/dist/repositories/realm/index.js.map +1 -1
  61. package/dist/repositories/sqlite/index.cjs +37 -38
  62. package/dist/repositories/sqlite/index.cjs.map +1 -1
  63. package/dist/repositories/sqlite/index.d.cts +2 -2
  64. package/dist/repositories/sqlite/index.d.ts +2 -2
  65. package/dist/repositories/sqlite/index.js +7 -8
  66. package/dist/repositories/sqlite/index.js.map +1 -1
  67. package/dist/{taskRunner-BYxEgwM5.d.ts → taskRunner-BxOmg-O6.d.ts} +1 -1
  68. package/dist/{taskRunner-Z3LnHfgs.d.cts → taskRunner-D2itCXf6.d.cts} +1 -1
  69. package/dist/wallet/expo/background.cjs +16 -17
  70. package/dist/wallet/expo/background.cjs.map +1 -1
  71. package/dist/wallet/expo/background.d.cts +3 -3
  72. package/dist/wallet/expo/background.d.ts +3 -3
  73. package/dist/wallet/expo/background.js +8 -9
  74. package/dist/wallet/expo/background.js.map +1 -1
  75. package/dist/wallet/expo/index.cjs +17 -18
  76. package/dist/wallet/expo/index.cjs.map +1 -1
  77. package/dist/wallet/expo/index.d.cts +2 -2
  78. package/dist/wallet/expo/index.d.ts +2 -2
  79. package/dist/wallet/expo/index.js +7 -8
  80. package/dist/wallet/expo/index.js.map +1 -1
  81. package/dist/worker/expo/index.cjs +11 -12
  82. package/dist/worker/expo/index.cjs.map +1 -1
  83. package/dist/worker/expo/index.d.cts +4 -4
  84. package/dist/worker/expo/index.d.ts +4 -4
  85. package/dist/worker/expo/index.js +7 -8
  86. package/dist/worker/expo/index.js.map +1 -1
  87. package/package.json +1 -1
  88. package/dist/chunk-4DUTRRXF.js.map +0 -1
  89. package/dist/chunk-5HCDXBBG.cjs.map +0 -1
  90. package/dist/chunk-DMYHAUTA.cjs.map +0 -1
  91. package/dist/chunk-DPFD5KBK.js.map +0 -1
  92. package/dist/chunk-HRFWODLP.js.map +0 -1
  93. package/dist/chunk-OMZZQTDM.cjs +0 -376
  94. package/dist/chunk-OMZZQTDM.cjs.map +0 -1
  95. package/dist/chunk-PXEFYEKL.js +0 -373
  96. package/dist/chunk-PXEFYEKL.js.map +0 -1
  97. package/dist/chunk-SS5BPVQL.js.map +0 -1
  98. package/dist/chunk-UPIQZRNJ.cjs.map +0 -1
  99. package/dist/chunk-VLO3JAP3.cjs.map +0 -1
  100. package/dist/chunk-W2C3KDQA.js.map +0 -1
  101. package/dist/chunk-WIZCF5IX.cjs.map +0 -1
package/dist/compiler.cjs CHANGED
@@ -1,8 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkOMZZQTDM_cjs = require('./chunk-OMZZQTDM.cjs');
4
- require('./chunk-UPIQZRNJ.cjs');
5
- require('./chunk-WIZCF5IX.cjs');
3
+ var chunkACIQZLWL_cjs = require('./chunk-ACIQZLWL.cjs');
4
+ require('./chunk-6TBTL42M.cjs');
6
5
 
7
6
  // src/compiler.ts
8
7
  var CompileError = class extends Error {
@@ -37,7 +36,7 @@ async function compile(input, options) {
37
36
  if (result.artifact === null) throw new CompileError(result.diagnostics);
38
37
  const kept = debug ? result.debug : void 0;
39
38
  return {
40
- program: chunkOMZZQTDM_cjs.programFromArtifact(result.artifact, kept),
39
+ program: chunkACIQZLWL_cjs.programFromArtifact(result.artifact, kept),
41
40
  artifact: result.artifact,
42
41
  ...kept ? { debug: kept } : {},
43
42
  diagnostics: result.diagnostics
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/compiler.ts"],"names":["programFromArtifact"],"mappings":";;;;;;;AAoCO,IAAM,YAAA,GAAN,cAA2B,KAAA,CAAM;AAAA,EAEpC,YAAqB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AA,GAAS,MAAM,QAAA,CAAS,OAAA,CAAQ,OAAO,eAAe,CAAA;AAC5D,EAAA,IAAI,OAAO,QAAA,KAAa,IAAA,QAAY,IAAI,YAAA,CAAa,OAAO,WAAW,CAAA;AAGvE,EAAA,MAAM,IAAA,GAAO,KAAA,GAAQ,MAAA,CAAO,KAAA,GAAQ,MAAA;AACpC,EAAA,OAAO;AAAA,IACH,OAAA,EAASA,qCAAA,CAAoB,MAAA,CAAO,QAAA,EAAU,IAAI,CAAA;AAAA,IAClD,UAAU,MAAA,CAAO,QAAA;AAAA,IACjB,GAAI,IAAA,GAAO,EAAE,KAAA,EAAO,IAAA,KAAS,EAAC;AAAA,IAC9B,aAAa,MAAA,CAAO;AAAA,GACxB;AACJ","file":"compiler.cjs","sourcesContent":["/**\n * Compile Arkade source into an SDK {@link Program}. Needs the optional peer\n * `@arkade-os/compiler`, which is loaded on the first {@link compile} call.\n *\n * @module compiler\n */\n\nimport type {\n CompileInput,\n CompileOptions as CompilerOptions,\n CompilerArtifact,\n DebugInfo,\n Diagnostic,\n} from \"@arkade-os/compiler\";\n\nimport { programFromArtifact } from \"./arkade/artifact\";\nimport type { Program } from \"./arkade/program\";\n\nexport type { CompileInput, CompilerArtifact, DebugInfo, Diagnostic };\n\nexport interface CompileOptions extends CompilerOptions {\n /** Return the debug file and put its source maps on `program`. Defaults to `true`. */\n debug?: boolean;\n}\n\nexport interface CompileOutput {\n program: Program;\n /** The compiler's artifact, carrying the source bundle, compiler version and fingerprint. */\n artifact: CompilerArtifact;\n /** The debug file: each covenant's source map. Absent with `debug: false`. */\n debug?: DebugInfo;\n /** Warnings; errors reject with {@link CompileError}. */\n diagnostics: Diagnostic[];\n}\n\n/** The source did not compile. `diagnostics` lists every error and warning. */\nexport class CompileError extends Error {\n override readonly name = \"CompileError\";\n constructor(readonly diagnostics: Diagnostic[]) {\n super(\n diagnostics\n .filter((d) => d.severity === \"error\")\n .map(\n (d) =>\n `${d.file}${d.start ? `:${d.start.line}:${d.start.column}` : \"\"}: ${d.message}`,\n )\n .join(\"\\n\") || \"compilation failed\",\n );\n }\n}\n\nconst PEER = \"@arkade-os/compiler\";\n\n/** Compile `input.entry` and its relative imports from `input.files` into a {@link Program}. */\nexport async function compile(\n input: CompileInput,\n options?: CompileOptions,\n): Promise<CompileOutput> {\n let compiler: typeof import(\"@arkade-os/compiler\");\n try {\n compiler = await import(\"@arkade-os/compiler\");\n } catch (error) {\n // Only a missing peer gets the install hint; anything else keeps its own error.\n const code = (error as { code?: unknown } | null)?.code;\n if (\n (code === \"ERR_MODULE_NOT_FOUND\" || code === \"MODULE_NOT_FOUND\") &&\n String((error as Error).message).includes(`'${PEER}'`)\n ) {\n throw new Error(\n `@arkade-os/sdk/compiler needs the optional peer ${PEER}: npm install --save-exact ${PEER}`,\n { cause: error },\n );\n }\n throw error;\n }\n const { debug = true, ...compilerOptions } = options ?? {};\n const result = await compiler.compile(input, compilerOptions);\n if (result.artifact === null) throw new CompileError(result.diagnostics);\n // ponytail: the compiler always builds the debug file; it will take an option to skip it soon,\n // until then `debug: false` only drops it.\n const kept = debug ? result.debug : undefined;\n return {\n program: programFromArtifact(result.artifact, kept),\n artifact: result.artifact,\n ...(kept ? { debug: kept } : {}),\n diagnostics: result.diagnostics,\n };\n}\n"]}
1
+ {"version":3,"sources":["../src/compiler.ts"],"names":["programFromArtifact"],"mappings":";;;;;;AAoCO,IAAM,YAAA,GAAN,cAA2B,KAAA,CAAM;AAAA,EAEpC,YAAqB,WAAA,EAA2B;AAC5C,IAAA,KAAA;AAAA,MACI,YACK,MAAA,CAAO,CAAC,MAAM,CAAA,CAAE,QAAA,KAAa,OAAO,CAAA,CACpC,GAAA;AAAA,QACG,CAAC,MACG,CAAA,EAAG,CAAA,CAAE,IAAI,CAAA,EAAG,CAAA,CAAE,QAAQ,CAAA,CAAA,EAAI,CAAA,CAAE,MAAM,IAAI,CAAA,CAAA,EAAI,EAAE,KAAA,CAAM,MAAM,KAAK,EAAE,CAAA,EAAA,E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AA,IAClD,UAAU,MAAA,CAAO,QAAA;AAAA,IACjB,GAAI,IAAA,GAAO,EAAE,KAAA,EAAO,IAAA,KAAS,EAAC;AAAA,IAC9B,aAAa,MAAA,CAAO;AAAA,GACxB;AACJ","file":"compiler.cjs","sourcesContent":["/**\n * Compile Arkade source into an SDK {@link Program}. Needs the optional peer\n * `@arkade-os/compiler`, which is loaded on the first {@link compile} call.\n *\n * @module compiler\n */\n\nimport type {\n CompileInput,\n CompileOptions as CompilerOptions,\n CompilerArtifact,\n DebugInfo,\n Diagnostic,\n} from \"@arkade-os/compiler\";\n\nimport { programFromArtifact } from \"./arkade/artifact\";\nimport type { Program } from \"./arkade/program\";\n\nexport type { CompileInput, CompilerArtifact, DebugInfo, Diagnostic };\n\nexport interface CompileOptions extends CompilerOptions {\n /** Return the debug file and put its source maps on `program`. Defaults to `true`. */\n debug?: boolean;\n}\n\nexport interface CompileOutput {\n program: Program;\n /** The compiler's artifact, carrying the source bundle, compiler version and fingerprint. */\n artifact: CompilerArtifact;\n /** The debug file: each covenant's source map. Absent with `debug: false`. */\n debug?: DebugInfo;\n /** Warnings; errors reject with {@link CompileError}. */\n diagnostics: Diagnostic[];\n}\n\n/** The source did not compile. `diagnostics` lists every error and warning. */\nexport class CompileError extends Error {\n override readonly name = \"CompileError\";\n constructor(readonly diagnostics: Diagnostic[]) {\n super(\n diagnostics\n .filter((d) => d.severity === \"error\")\n .map(\n (d) =>\n `${d.file}${d.start ? `:${d.start.line}:${d.start.column}` : \"\"}: ${d.message}`,\n )\n .join(\"\\n\") || \"compilation failed\",\n );\n }\n}\n\nconst PEER = \"@arkade-os/compiler\";\n\n/** Compile `input.entry` and its relative imports from `input.files` into a {@link Program}. */\nexport async function compile(\n input: CompileInput,\n options?: CompileOptions,\n): Promise<CompileOutput> {\n let compiler: typeof import(\"@arkade-os/compiler\");\n try {\n compiler = await import(\"@arkade-os/compiler\");\n } catch (error) {\n // Only a missing peer gets the install hint; anything else keeps its own error.\n const code = (error as { code?: unknown } | null)?.code;\n if (\n (code === \"ERR_MODULE_NOT_FOUND\" || code === \"MODULE_NOT_FOUND\") &&\n String((error as Error).message).includes(`'${PEER}'`)\n ) {\n throw new Error(\n `@arkade-os/sdk/compiler needs the optional peer ${PEER}: npm install --save-exact ${PEER}`,\n { cause: error },\n );\n }\n throw error;\n }\n const { debug = true, ...compilerOptions } = options ?? {};\n const result = await compiler.compile(input, compilerOptions);\n if (result.artifact === null) throw new CompileError(result.diagnostics);\n // ponytail: the compiler always builds the debug file; it will take an option to skip it soon,\n // until then `debug: false` only drops it.\n const kept = debug ? result.debug : undefined;\n return {\n program: programFromArtifact(result.artifact, kept),\n artifact: result.artifact,\n ...(kept ? { debug: kept } : {}),\n diagnostics: result.diagnostics,\n };\n}\n"]}
package/dist/compiler.js CHANGED
@@ -1,6 +1,5 @@
1
- import { programFromArtifact } from './chunk-PXEFYEKL.js';
2
- import './chunk-4DUTRRXF.js';
3
- import './chunk-DPFD5KBK.js';
1
+ import { programFromArtifact } from './chunk-X57WKONW.js';
2
+ import './chunk-GB67AGXG.js';
4
3
 
5
4
  // src/compiler.ts
6
5
  var CompileError = class extends Error {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/compiler.ts"],"names":[],"mappings":";;;;;AAoCO,IAAM,YAAA,GAAN,cAA2B,KAAA,CAAM;AAAA,EAEpC,YAAqB,WAAA,EAA2B;AAC5C,IAAA,KAAA;AAAA,MACI,YACK,MAAA,CAAO,CAAC,MAAM,CAAA,CAAE,QAAA,KAAa,OAAO,CAAA,CACpC,GAAA;AAAA,QACG,CAAC,MACG,CAAA,EAAG,CAAA,CAAE,IAAI,CAAA,EAAG,CAAA,CAAE,QAAQ,CAAA,CAAA,EAAI,CAAA,CAAE,MAAM,IAAI,CAAA,CAAA,EAAI,EAAE,KAAA,CAAM,MAAM,KAAK,EAAE,CAAA,EAAA,EAAK,EAAE,OAAO,CAAA;AAAA,OACrF,CACC,IAAA,CAAK,IAAI,CAAA,IAAK;AAAA,K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AAO,IAAA,KAAS,EAAC;AAAA,IAC9B,aAAa,MAAA,CAAO;AAAA,GACxB;AACJ","file":"compiler.js","sourcesContent":["/**\n * Compile Arkade source into an SDK {@link Program}. Needs the optional peer\n * `@arkade-os/compiler`, which is loaded on the first {@link compile} call.\n *\n * @module compiler\n */\n\nimport type {\n CompileInput,\n CompileOptions as CompilerOptions,\n CompilerArtifact,\n DebugInfo,\n Diagnostic,\n} from \"@arkade-os/compiler\";\n\nimport { programFromArtifact } from \"./arkade/artifact\";\nimport type { Program } from \"./arkade/program\";\n\nexport type { CompileInput, CompilerArtifact, DebugInfo, Diagnostic };\n\nexport interface CompileOptions extends CompilerOptions {\n /** Return the debug file and put its source maps on `program`. Defaults to `true`. */\n debug?: boolean;\n}\n\nexport interface CompileOutput {\n program: Program;\n /** The compiler's artifact, carrying the source bundle, compiler version and fingerprint. */\n artifact: CompilerArtifact;\n /** The debug file: each covenant's source map. Absent with `debug: false`. */\n debug?: DebugInfo;\n /** Warnings; errors reject with {@link CompileError}. */\n diagnostics: Diagnostic[];\n}\n\n/** The source did not compile. `diagnostics` lists every error and warning. */\nexport class CompileError extends Error {\n override readonly name = \"CompileError\";\n constructor(readonly diagnostics: Diagnostic[]) {\n super(\n diagnostics\n .filter((d) => d.severity === \"error\")\n .map(\n (d) =>\n `${d.file}${d.start ? `:${d.start.line}:${d.start.column}` : \"\"}: ${d.message}`,\n )\n .join(\"\\n\") || \"compilation failed\",\n );\n }\n}\n\nconst PEER = \"@arkade-os/compiler\";\n\n/** Compile `input.entry` and its relative imports from `input.files` into a {@link Program}. */\nexport async function compile(\n input: CompileInput,\n options?: CompileOptions,\n): Promise<CompileOutput> {\n let compiler: typeof import(\"@arkade-os/compiler\");\n try {\n compiler = await import(\"@arkade-os/compiler\");\n } catch (error) {\n // Only a missing peer gets the install hint; anything else keeps its own error.\n const code = (error as { code?: unknown } | null)?.code;\n if (\n (code === \"ERR_MODULE_NOT_FOUND\" || code === \"MODULE_NOT_FOUND\") &&\n String((error as Error).message).includes(`'${PEER}'`)\n ) {\n throw new Error(\n `@arkade-os/sdk/compiler needs the optional peer ${PEER}: npm install --save-exact ${PEER}`,\n { cause: error },\n );\n }\n throw error;\n }\n const { debug = true, ...compilerOptions } = options ?? {};\n const result = await compiler.compile(input, compilerOptions);\n if (result.artifact === null) throw new CompileError(result.diagnostics);\n // ponytail: the compiler always builds the debug file; it will take an option to skip it soon,\n // until then `debug: false` only drops it.\n const kept = debug ? result.debug : undefined;\n return {\n program: programFromArtifact(result.artifact, kept),\n artifact: result.artifact,\n ...(kept ? { debug: kept } : {}),\n diagnostics: result.diagnostics,\n };\n}\n"]}
1
+ {"version":3,"sources":["../src/compiler.ts"],"names":[],"mappings":";;;;AAoCO,IAAM,YAAA,GAAN,cAA2B,KAAA,CAAM;AAAA,EAEpC,YAAqB,WAAA,EAA2B;AAC5C,IAAA,KAAA;AAAA,MACI,YACK,MAAA,CAAO,CAAC,MAAM,CAAA,CAAE,QAAA,KAAa,OAAO,CAAA,CACpC,GAAA;AAAA,QACG,CAAC,MACG,CAAA,EAAG,CAAA,CAAE,IAAI,CAAA,EAAG,CAAA,CAAE,QAAQ,CAAA,CAAA,EAAI,CAAA,CAAE,MAAM,IAAI,CAAA,CAAA,EAAI,EAAE,KAAA,CAAM,MAAM,KAAK,EAAE,CAAA,EAAA,EAAK,EAAE,OAAO,CAAA;AAAA,OACrF,CACC,IAAA,CAAK,IAAI,CAAA,IAAK;AAAA,KACvB;AATiB,IAAA,IAAA,CAAA,WAAA,GAAA,WAAA;AAAA,EAUrB;AAAA,EAVqB,WAAA;AAAA,EADH,IAAA,GAAO,cAAA;AAY7B;AAEA,IAAM,IAAA,GAAO,qBAAA;AAGb,eAAsB,OAAA,CAClB,OACA,OAAA,EACsB;AACtB,EAAA,IAAI,QAAA;AACJ,EAAA,IAAI;AACA,IAAA,QAAA,GAAW,MAAM,OAAO,qBAAqB,CAAA;AAAA,EACjD,SAAS,KAAA,EAAO;AAEZ,IAAA,MAAM,OAAQ,KAAA,EAAqC,IAAA;AACnD,IAAA,IAAA,CACK,IAAA,KAAS,sBAAA,IAA0B,IAAA,KAAS,kBAAA,KAC7C,MAAA,CAAQ,KAAA,CAAgB,OAAO,CAAA,CAAE,QAAA,CAAS,CAAA,CAAA,EAAI,IAAI,CAAA,CAAA,CAAG,CAAA,EACvD;AACE,MAAA,MAAM,IAAI,KAAA;AAAA,QACN,CAAA,gDAAA,EAAmD,IAAI,CAAA,2BAAA,EAA8B,IAAI,CAAA,CAAA;AAAA,QACzF,EAAE,OAAO,KAAA;AAAM,OACnB;AAAA,IACJ;AACA,IAAA,MAAM,KAAA;AAAA,EACV;AACA,EAAA,MAAM,EAAE,KAAA,GAAQ,IAAA,EAAM,GAAG,eAAA,EAAgB,GAAI,WAAW,EAAC;AACzD,EAAA,MAAM,MAAA,GAAS,MAAM,QAAA,CAAS,OAAA,CAAQ,OAAO,eAAe,CAAA;AAC5D,EAAA,IAAI,OAAO,QAAA,KAAa,IAAA,QAAY,IAAI,YAAA,CAAa,OAAO,WAAW,CAAA;AAGvE,EAAA,MAAM,IAAA,GAAO,KAAA,GAAQ,MAAA,CAAO,KAAA,GAAQ,MAAA;AACpC,EAAA,OAAO;AAAA,IACH,OAAA,EAAS,mBAAA,CAAoB,MAAA,CAAO,QAAA,EAAU,IAAI,CAAA;AAAA,IAClD,UAAU,MAAA,CAAO,QAAA;AAAA,IACjB,GAAI,IAAA,GAAO,EAAE,KAAA,EAAO,IAAA,KAAS,EAAC;AAAA,IAC9B,aAAa,MAAA,CAAO;AAAA,GACxB;AACJ","file":"compiler.js","sourcesContent":["/**\n * Compile Arkade source into an SDK {@link Program}. Needs the optional peer\n * `@arkade-os/compiler`, which is loaded on the first {@link compile} call.\n *\n * @module compiler\n */\n\nimport type {\n CompileInput,\n CompileOptions as CompilerOptions,\n CompilerArtifact,\n DebugInfo,\n Diagnostic,\n} from \"@arkade-os/compiler\";\n\nimport { programFromArtifact } from \"./arkade/artifact\";\nimport type { Program } from \"./arkade/program\";\n\nexport type { CompileInput, CompilerArtifact, DebugInfo, Diagnostic };\n\nexport interface CompileOptions extends CompilerOptions {\n /** Return the debug file and put its source maps on `program`. Defaults to `true`. */\n debug?: boolean;\n}\n\nexport interface CompileOutput {\n program: Program;\n /** The compiler's artifact, carrying the source bundle, compiler version and fingerprint. */\n artifact: CompilerArtifact;\n /** The debug file: each covenant's source map. Absent with `debug: false`. */\n debug?: DebugInfo;\n /** Warnings; errors reject with {@link CompileError}. */\n diagnostics: Diagnostic[];\n}\n\n/** The source did not compile. `diagnostics` lists every error and warning. */\nexport class CompileError extends Error {\n override readonly name = \"CompileError\";\n constructor(readonly diagnostics: Diagnostic[]) {\n super(\n diagnostics\n .filter((d) => d.severity === \"error\")\n .map(\n (d) =>\n `${d.file}${d.start ? `:${d.start.line}:${d.start.column}` : \"\"}: ${d.message}`,\n )\n .join(\"\\n\") || \"compilation failed\",\n );\n }\n}\n\nconst PEER = \"@arkade-os/compiler\";\n\n/** Compile `input.entry` and its relative imports from `input.files` into a {@link Program}. */\nexport async function compile(\n input: CompileInput,\n options?: CompileOptions,\n): Promise<CompileOutput> {\n let compiler: typeof import(\"@arkade-os/compiler\");\n try {\n compiler = await import(\"@arkade-os/compiler\");\n } catch (error) {\n // Only a missing peer gets the install hint; anything else keeps its own error.\n const code = (error as { code?: unknown } | null)?.code;\n if (\n (code === \"ERR_MODULE_NOT_FOUND\" || code === \"MODULE_NOT_FOUND\") &&\n String((error as Error).message).includes(`'${PEER}'`)\n ) {\n throw new Error(\n `@arkade-os/sdk/compiler needs the optional peer ${PEER}: npm install --save-exact ${PEER}`,\n { cause: error },\n );\n }\n throw error;\n }\n const { debug = true, ...compilerOptions } = options ?? {};\n const result = await compiler.compile(input, compilerOptions);\n if (result.artifact === null) throw new CompileError(result.diagnostics);\n // ponytail: the compiler always builds the debug file; it will take an option to skip it soon,\n // until then `debug: false` only drops it.\n const kept = debug ? result.debug : undefined;\n return {\n program: programFromArtifact(result.artifact, kept),\n artifact: result.artifact,\n ...(kept ? { debug: kept } : {}),\n diagnostics: result.diagnostics,\n };\n}\n"]}
@@ -1,39 +1,43 @@
1
1
  'use strict';
2
2
 
3
- var chunkVLO3JAP3_cjs = require('../../chunk-VLO3JAP3.cjs');
4
- require('../../chunk-UPIQZRNJ.cjs');
5
- require('../../chunk-5HCDXBBG.cjs');
6
- require('../../chunk-WIZCF5IX.cjs');
3
+ var chunkTD4PKK2I_cjs = require('../../chunk-TD4PKK2I.cjs');
4
+ require('../../chunk-ACIQZLWL.cjs');
5
+ require('../../chunk-HS7TKVOZ.cjs');
6
+ require('../../chunk-6TBTL42M.cjs');
7
7
 
8
8
 
9
9
 
10
10
  Object.defineProperty(exports, "ArkadeContractHandler", {
11
11
  enumerable: true,
12
- get: function () { return chunkVLO3JAP3_cjs.ArkadeContractHandler; }
12
+ get: function () { return chunkTD4PKK2I_cjs.ArkadeContractHandler; }
13
13
  });
14
14
  Object.defineProperty(exports, "BoardingContractHandler", {
15
15
  enumerable: true,
16
- get: function () { return chunkVLO3JAP3_cjs.BoardingContractHandler; }
16
+ get: function () { return chunkTD4PKK2I_cjs.BoardingContractHandler; }
17
17
  });
18
18
  Object.defineProperty(exports, "DefaultContractHandler", {
19
19
  enumerable: true,
20
- get: function () { return chunkVLO3JAP3_cjs.DefaultContractHandler; }
20
+ get: function () { return chunkTD4PKK2I_cjs.DefaultContractHandler; }
21
21
  });
22
22
  Object.defineProperty(exports, "DelegateContractHandler", {
23
23
  enumerable: true,
24
- get: function () { return chunkVLO3JAP3_cjs.DelegateContractHandler; }
24
+ get: function () { return chunkTD4PKK2I_cjs.DelegateContractHandler; }
25
+ });
26
+ Object.defineProperty(exports, "ExecutorContractHandler", {
27
+ enumerable: true,
28
+ get: function () { return chunkTD4PKK2I_cjs.ExecutorContractHandler; }
25
29
  });
26
30
  Object.defineProperty(exports, "VHTLCContractHandler", {
27
31
  enumerable: true,
28
- get: function () { return chunkVLO3JAP3_cjs.VHTLCContractHandler; }
32
+ get: function () { return chunkTD4PKK2I_cjs.VHTLCContractHandler; }
29
33
  });
30
34
  Object.defineProperty(exports, "VHTLCV2ContractHandler", {
31
35
  enumerable: true,
32
- get: function () { return chunkVLO3JAP3_cjs.VHTLCV2ContractHandler; }
36
+ get: function () { return chunkTD4PKK2I_cjs.VHTLCV2ContractHandler; }
33
37
  });
34
38
  Object.defineProperty(exports, "contractHandlers", {
35
39
  enumerable: true,
36
- get: function () { return chunkVLO3JAP3_cjs.contractHandlers; }
40
+ get: function () { return chunkTD4PKK2I_cjs.contractHandlers; }
37
41
  });
38
42
  //# sourceMappingURL=index.cjs.map
39
43
  //# sourceMappingURL=index.cjs.map
@@ -1,8 +1,8 @@
1
- export { A as ArkadeContractHandler, B as BoardingContractHandler, a as BoardingContractParams, D as DefaultContractHandler, b as DefaultContractParams, c as DelegateContractHandler, d as DelegateContractParams, e as VHTLCContractHandler, f as VHTLCContractParams, g as VHTLCV2ContractHandler, h as VHTLCV2ContractParams, i as contractHandlers } from '../../index-D4ahI0W6.cjs';
2
- import '../../index-Bq349_ly.cjs';
3
- import '@scure/btc-signer/utils.js';
1
+ export { A as ArkadeContractHandler, B as BoardingContractHandler, a as BoardingContractParams, D as DefaultContractHandler, b as DefaultContractParams, c as DelegateContractHandler, d as DelegateContractParams, e as VHTLCContractHandler, f as VHTLCContractParams, g as VHTLCV2ContractHandler, h as VHTLCV2ContractParams, i as contractHandlers } from '../../index-BaTItxPx.cjs';
2
+ export { cq as ExecutorContractHandler, cs as ExecutorContractParams } from '../../index-BQwrHcOh.cjs';
3
+ import '../../base-C-Y5t_0F.cjs';
4
4
  import '@scure/btc-signer';
5
5
  import '@scure/btc-signer/psbt.js';
6
- import '../../base-C-Y5t_0F.cjs';
7
- import '@scure/btc-signer/transaction.js';
6
+ import '@scure/btc-signer/utils.js';
8
7
  import '../../program-DPzf5qsk.cjs';
8
+ import '@scure/btc-signer/transaction.js';
@@ -1,8 +1,8 @@
1
- export { A as ArkadeContractHandler, B as BoardingContractHandler, a as BoardingContractParams, D as DefaultContractHandler, b as DefaultContractParams, c as DelegateContractHandler, d as DelegateContractParams, e as VHTLCContractHandler, f as VHTLCContractParams, g as VHTLCV2ContractHandler, h as VHTLCV2ContractParams, i as contractHandlers } from '../../index-Yh5y9G4E.js';
2
- import '../../index-Mn2POBPj.js';
3
- import '@scure/btc-signer/utils.js';
1
+ export { A as ArkadeContractHandler, B as BoardingContractHandler, a as BoardingContractParams, D as DefaultContractHandler, b as DefaultContractParams, c as DelegateContractHandler, d as DelegateContractParams, e as VHTLCContractHandler, f as VHTLCContractParams, g as VHTLCV2ContractHandler, h as VHTLCV2ContractParams, i as contractHandlers } from '../../index-BapVvuoI.js';
2
+ export { cq as ExecutorContractHandler, cs as ExecutorContractParams } from '../../index-DuXylQrN.js';
3
+ import '../../base-C-Y5t_0F.js';
4
4
  import '@scure/btc-signer';
5
5
  import '@scure/btc-signer/psbt.js';
6
- import '../../base-C-Y5t_0F.js';
7
- import '@scure/btc-signer/transaction.js';
6
+ import '@scure/btc-signer/utils.js';
8
7
  import '../../program-38A2Twvj.js';
8
+ import '@scure/btc-signer/transaction.js';
@@ -1,6 +1,6 @@
1
- export { ArkadeContractHandler, BoardingContractHandler, DefaultContractHandler, DelegateContractHandler, VHTLCContractHandler, VHTLCV2ContractHandler, contractHandlers } from '../../chunk-HRFWODLP.js';
2
- import '../../chunk-4DUTRRXF.js';
3
- import '../../chunk-SS5BPVQL.js';
4
- import '../../chunk-DPFD5KBK.js';
1
+ export { ArkadeContractHandler, BoardingContractHandler, DefaultContractHandler, DelegateContractHandler, ExecutorContractHandler, VHTLCContractHandler, VHTLCV2ContractHandler, contractHandlers } from '../../chunk-QSERJPTT.js';
2
+ import '../../chunk-X57WKONW.js';
3
+ import '../../chunk-LHLRG2BE.js';
4
+ import '../../chunk-GB67AGXG.js';
5
5
  //# sourceMappingURL=index.js.map
6
6
  //# sourceMappingURL=index.js.map