@algomotion/spec 0.0.0-stage → 1.0.0-alpha.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 (97) hide show
  1. package/LICENSE +675 -0
  2. package/dist/.tsbuildinfo +1 -0
  3. package/dist/common.d.ts +136 -0
  4. package/dist/common.d.ts.map +1 -0
  5. package/dist/common.js +181 -0
  6. package/dist/common.js.map +1 -0
  7. package/dist/errors.d.ts +71 -0
  8. package/dist/errors.d.ts.map +1 -0
  9. package/dist/errors.js +43 -0
  10. package/dist/errors.js.map +1 -0
  11. package/dist/index.d.ts +10 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +10 -0
  14. package/dist/index.js.map +1 -0
  15. package/dist/json-schema.d.ts +3 -0
  16. package/dist/json-schema.d.ts.map +1 -0
  17. package/dist/json-schema.js +16 -0
  18. package/dist/json-schema.js.map +1 -0
  19. package/dist/kinds/array.d.ts +171 -0
  20. package/dist/kinds/array.d.ts.map +1 -0
  21. package/dist/kinds/array.js +179 -0
  22. package/dist/kinds/array.js.map +1 -0
  23. package/dist/kinds/btree.d.ts +190 -0
  24. package/dist/kinds/btree.d.ts.map +1 -0
  25. package/dist/kinds/btree.js +274 -0
  26. package/dist/kinds/btree.js.map +1 -0
  27. package/dist/kinds/graph.d.ts +227 -0
  28. package/dist/kinds/graph.d.ts.map +1 -0
  29. package/dist/kinds/graph.js +229 -0
  30. package/dist/kinds/graph.js.map +1 -0
  31. package/dist/kinds/hash-table.d.ts +108 -0
  32. package/dist/kinds/hash-table.d.ts.map +1 -0
  33. package/dist/kinds/hash-table.js +133 -0
  34. package/dist/kinds/hash-table.js.map +1 -0
  35. package/dist/kinds/index.d.ts +98 -0
  36. package/dist/kinds/index.d.ts.map +1 -0
  37. package/dist/kinds/index.js +53 -0
  38. package/dist/kinds/index.js.map +1 -0
  39. package/dist/kinds/kind.d.ts +73 -0
  40. package/dist/kinds/kind.d.ts.map +1 -0
  41. package/dist/kinds/kind.js +4 -0
  42. package/dist/kinds/kind.js.map +1 -0
  43. package/dist/kinds/linear.d.ts +24 -0
  44. package/dist/kinds/linear.d.ts.map +1 -0
  45. package/dist/kinds/linear.js +26 -0
  46. package/dist/kinds/linear.js.map +1 -0
  47. package/dist/kinds/linked-list.d.ts +132 -0
  48. package/dist/kinds/linked-list.d.ts.map +1 -0
  49. package/dist/kinds/linked-list.js +95 -0
  50. package/dist/kinds/linked-list.js.map +1 -0
  51. package/dist/kinds/plane.d.ts +190 -0
  52. package/dist/kinds/plane.d.ts.map +1 -0
  53. package/dist/kinds/plane.js +206 -0
  54. package/dist/kinds/plane.js.map +1 -0
  55. package/dist/kinds/priority-queue.d.ts +120 -0
  56. package/dist/kinds/priority-queue.d.ts.map +1 -0
  57. package/dist/kinds/priority-queue.js +108 -0
  58. package/dist/kinds/priority-queue.js.map +1 -0
  59. package/dist/kinds/queue.d.ts +94 -0
  60. package/dist/kinds/queue.d.ts.map +1 -0
  61. package/dist/kinds/queue.js +59 -0
  62. package/dist/kinds/queue.js.map +1 -0
  63. package/dist/kinds/stack.d.ts +70 -0
  64. package/dist/kinds/stack.d.ts.map +1 -0
  65. package/dist/kinds/stack.js +50 -0
  66. package/dist/kinds/stack.js.map +1 -0
  67. package/dist/kinds/table.d.ts +65 -0
  68. package/dist/kinds/table.d.ts.map +1 -0
  69. package/dist/kinds/table.js +116 -0
  70. package/dist/kinds/table.js.map +1 -0
  71. package/dist/kinds/tree.d.ts +272 -0
  72. package/dist/kinds/tree.d.ts.map +1 -0
  73. package/dist/kinds/tree.js +380 -0
  74. package/dist/kinds/tree.js.map +1 -0
  75. package/dist/parse.d.ts +26 -0
  76. package/dist/parse.d.ts.map +1 -0
  77. package/dist/parse.js +380 -0
  78. package/dist/parse.js.map +1 -0
  79. package/dist/result.d.ts +16 -0
  80. package/dist/result.d.ts.map +1 -0
  81. package/dist/result.js +3 -0
  82. package/dist/result.js.map +1 -0
  83. package/dist/share.d.ts +68 -0
  84. package/dist/share.d.ts.map +1 -0
  85. package/dist/share.js +319 -0
  86. package/dist/share.js.map +1 -0
  87. package/dist/version.d.ts +108 -0
  88. package/dist/version.d.ts.map +1 -0
  89. package/dist/version.js +167 -0
  90. package/dist/version.js.map +1 -0
  91. package/dist/visualization.d.ts +3591 -0
  92. package/dist/visualization.d.ts.map +1 -0
  93. package/dist/visualization.js +131 -0
  94. package/dist/visualization.js.map +1 -0
  95. package/package.json +45 -4
  96. package/schema/visualization.schema.json +5717 -0
  97. package/README.md +0 -3
@@ -0,0 +1 @@
1
+ {"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../node_modules/zod/v4/core/json-schema.d.cts","../../../node_modules/zod/v4/core/standard-schema.d.cts","../../../node_modules/zod/v4/core/registries.d.cts","../../../node_modules/zod/v4/core/to-json-schema.d.cts","../../../node_modules/zod/v4/core/util.d.cts","../../../node_modules/zod/v4/core/versions.d.cts","../../../node_modules/zod/v4/core/schemas.d.cts","../../../node_modules/zod/v4/core/checks.d.cts","../../../node_modules/zod/v4/core/errors.d.cts","../../../node_modules/zod/v4/core/core.d.cts","../../../node_modules/zod/v4/core/parse.d.cts","../../../node_modules/zod/v4/core/memoizer.d.cts","../../../node_modules/zod/v4/core/regexes.d.cts","../../../node_modules/zod/v4/locales/ar.d.cts","../../../node_modules/zod/v4/locales/az.d.cts","../../../node_modules/zod/v4/locales/be.d.cts","../../../node_modules/zod/v4/locales/bg.d.cts","../../../node_modules/zod/v4/locales/bn.d.cts","../../../node_modules/zod/v4/locales/ca.d.cts","../../../node_modules/zod/v4/locales/ckb.d.cts","../../../node_modules/zod/v4/locales/cs.d.cts","../../../node_modules/zod/v4/locales/da.d.cts","../../../node_modules/zod/v4/locales/de.d.cts","../../../node_modules/zod/v4/locales/el.d.cts","../../../node_modules/zod/v4/locales/en.d.cts","../../../node_modules/zod/v4/locales/eo.d.cts","../../../node_modules/zod/v4/locales/es.d.cts","../../../node_modules/zod/v4/locales/fa.d.cts","../../../node_modules/zod/v4/locales/fi.d.cts","../../../node_modules/zod/v4/locales/fr.d.cts","../../../node_modules/zod/v4/locales/fr-ca.d.cts","../../../node_modules/zod/v4/locales/gu.d.cts","../../../node_modules/zod/v4/locales/he.d.cts","../../../node_modules/zod/v4/locales/hi.d.cts","../../../node_modules/zod/v4/locales/hr.d.cts","../../../node_modules/zod/v4/locales/hu.d.cts","../../../node_modules/zod/v4/locales/hy.d.cts","../../../node_modules/zod/v4/locales/id.d.cts","../../../node_modules/zod/v4/locales/is.d.cts","../../../node_modules/zod/v4/locales/it.d.cts","../../../node_modules/zod/v4/locales/ja.d.cts","../../../node_modules/zod/v4/locales/ka.d.cts","../../../node_modules/zod/v4/locales/kh.d.cts","../../../node_modules/zod/v4/locales/km.d.cts","../../../node_modules/zod/v4/locales/kn.d.cts","../../../node_modules/zod/v4/locales/ko.d.cts","../../../node_modules/zod/v4/locales/lt.d.cts","../../../node_modules/zod/v4/locales/mk.d.cts","../../../node_modules/zod/v4/locales/ms.d.cts","../../../node_modules/zod/v4/locales/ne.d.cts","../../../node_modules/zod/v4/locales/nl.d.cts","../../../node_modules/zod/v4/locales/nn.d.cts","../../../node_modules/zod/v4/locales/no.d.cts","../../../node_modules/zod/v4/locales/ota.d.cts","../../../node_modules/zod/v4/locales/ps.d.cts","../../../node_modules/zod/v4/locales/pl.d.cts","../../../node_modules/zod/v4/locales/pt.d.cts","../../../node_modules/zod/v4/locales/pt-br.d.cts","../../../node_modules/zod/v4/locales/ro.d.cts","../../../node_modules/zod/v4/locales/ru.d.cts","../../../node_modules/zod/v4/locales/sk.d.cts","../../../node_modules/zod/v4/locales/sl.d.cts","../../../node_modules/zod/v4/locales/sv.d.cts","../../../node_modules/zod/v4/locales/ta.d.cts","../../../node_modules/zod/v4/locales/tg.d.cts","../../../node_modules/zod/v4/locales/th.d.cts","../../../node_modules/zod/v4/locales/tk.d.cts","../../../node_modules/zod/v4/locales/tr.d.cts","../../../node_modules/zod/v4/locales/ua.d.cts","../../../node_modules/zod/v4/locales/uk.d.cts","../../../node_modules/zod/v4/locales/ur.d.cts","../../../node_modules/zod/v4/locales/uz.d.cts","../../../node_modules/zod/v4/locales/vi.d.cts","../../../node_modules/zod/v4/locales/zh-cn.d.cts","../../../node_modules/zod/v4/locales/zh-tw.d.cts","../../../node_modules/zod/v4/locales/yo.d.cts","../../../node_modules/zod/v4/locales/index.d.cts","../../../node_modules/zod/v4/core/doc.d.cts","../../../node_modules/zod/v4/core/compile.d.cts","../../../node_modules/zod/v4/core/api.d.cts","../../../node_modules/zod/v4/core/json-schema-processors.d.cts","../../../node_modules/zod/v4/core/json-schema-generator.d.cts","../../../node_modules/zod/v4/core/index.d.cts","../../../node_modules/zod/v4/classic/errors.d.cts","../../../node_modules/zod/v4/classic/parse.d.cts","../../../node_modules/zod/v4/classic/schemas.d.cts","../../../node_modules/zod/v4/classic/checks.d.cts","../../../node_modules/zod/v4/classic/compat.d.cts","../../../node_modules/zod/v4/classic/from-json-schema.d.cts","../../../node_modules/zod/v4/classic/deep-partial.d.cts","../../../node_modules/zod/v4/classic/in-out.d.cts","../../../node_modules/zod/v4/classic/iso.d.cts","../../../node_modules/zod/v4/classic/coerce.d.cts","../../../node_modules/zod/v4/classic/external.d.cts","../../../node_modules/zod/index.d.cts","../src/common.ts","../src/errors.ts","../src/kinds/kind.ts","../src/kinds/array.ts","../src/kinds/btree.ts","../src/kinds/graph.ts","../src/kinds/hash-table.ts","../src/kinds/linear.ts","../src/kinds/linked-list.ts","../src/kinds/plane.ts","../src/kinds/priority-queue.ts","../src/kinds/queue.ts","../src/kinds/stack.ts","../src/kinds/table.ts","../src/kinds/tree.ts","../src/kinds/index.ts","../src/visualization.ts","../src/version.ts","../src/json-schema.ts","../src/result.ts","../src/parse.ts","../src/share.ts","../src/index.ts"],"fileIdsList":[[151],[140],[140,143],[62,134,138,140,141,142,143,144,145,146,147,148,149,150],[58,60,143],[140,141],[59,65,140,142],[60,62,64,65,66,67],[62,64,66,67],[64,67],[62,64,66],[59,62,64,65,67],[58,60,61,62,63,64,65,66,67,68,69,70,134,135,136,137,138,139],[58,60,61,64],[60,61,64],[64],[58,59,61,62,63,65,66,67],[58,59,60,64,140],[64,65,66,67],[66],[71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133],[152],[152,153],[153,154,168,169,170,171,172,173,174],[152,169,170],[152,153,155],[155,156,157,158,159,161,162,163,164,165,166,167],[152,153,155,160],[153,154,168,169,170,172],[154,172],[154,169],[152,153,168,170]],"fileInfos":[{"version":"bcd24271a113971ba9eb71ff8cb01bc6b0f872a85c23fdbe5d93065b375933cd","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f88bedbeb09c6f5a6645cb24c7c55f1aa22d19ae96c8e6959cbd8b85a707bc6","impliedFormat":1},{"version":"7fe93b39b810eadd916be8db880dd7f0f7012a5cc6ffb62de8f62a2117fa6f1f","impliedFormat":1},{"version":"bb0074cc08b84a2374af33d8bf044b80851ccc9e719a5e202eacf40db2c31600","impliedFormat":1},{"version":"1a7daebe4f45fb03d9ec53d60008fbf9ac45a697fdc89e4ce218bc94b94f94d6","impliedFormat":1},{"version":"f94b133a3cb14a288803be545ac2683e0d0ff6661bcd37e31aaaec54fc382aed","impliedFormat":1},{"version":"f59d0650799f8782fd74cf73c19223730c6d1b9198671b1c5b3a38e1188b5953","impliedFormat":1},{"version":"8a15b4607d9a499e2dbeed9ec0d3c0d7372c850b2d5f1fb259e8f6d41d468a84","impliedFormat":1},{"version":"26e0fe14baee4e127f4365d1ae0b276f400562e45e19e35fd2d4c296684715e6","impliedFormat":1},{"version":"eadcffda2aa84802c73938e589b9e58248d74c59cb7fcbca6474e3435ac15504","affectsGlobalScope":true,"impliedFormat":1},{"version":"105ba8ff7ba746404fe1a2e189d1d3d2e0eb29a08c18dded791af02f29fb4711","affectsGlobalScope":true,"impliedFormat":1},{"version":"00343ca5b2e3d48fa5df1db6e32ea2a59afab09590274a6cccb1dbae82e60c7c","affectsGlobalScope":true,"impliedFormat":1},{"version":"ebd9f816d4002697cb2864bea1f0b70a103124e18a8cd9645eeccc09bdf80ab4","affectsGlobalScope":true,"impliedFormat":1},{"version":"2c1afac30a01772cd2a9a298a7ce7706b5892e447bb46bdbeef720f7b5da77ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"7b0225f483e4fa685625ebe43dd584bb7973bbd84e66a6ba7bbe175ee1048b4f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c0a4b8ac6ce74679c1da2b3795296f5896e31c38e888469a8e0f99dc3305de60","affectsGlobalScope":true,"impliedFormat":1},{"version":"3084a7b5f569088e0146533a00830e206565de65cae2239509168b11434cd84f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c5079c53f0f141a0698faa903e76cb41cd664e3efb01cc17a5c46ec2eb0bef42","affectsGlobalScope":true,"impliedFormat":1},{"version":"32cafbc484dea6b0ab62cf8473182bbcb23020d70845b406f80b7526f38ae862","affectsGlobalScope":true,"impliedFormat":1},{"version":"fca4cdcb6d6c5ef18a869003d02c9f0fd95df8cfaf6eb431cd3376bc034cad36","affectsGlobalScope":true,"impliedFormat":1},{"version":"b93ec88115de9a9dc1b602291b85baf825c85666bf25985cc5f698073892b467","affectsGlobalScope":true,"impliedFormat":1},{"version":"f5c06dcc3fe849fcb297c247865a161f995cc29de7aa823afdd75aaaddc1419b","affectsGlobalScope":true,"impliedFormat":1},{"version":"b77e16112127a4b169ef0b8c3a4d730edf459c5f25fe52d5e436a6919206c4d7","affectsGlobalScope":true,"impliedFormat":1},{"version":"fbffd9337146eff822c7c00acbb78b01ea7ea23987f6c961eba689349e744f8c","affectsGlobalScope":true,"impliedFormat":1},{"version":"a995c0e49b721312f74fdfb89e4ba29bd9824c770bbb4021d74d2bf560e4c6bd","affectsGlobalScope":true,"impliedFormat":1},{"version":"c7b3542146734342e440a84b213384bfa188835537ddbda50d30766f0593aff9","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce6180fa19b1cccd07ee7f7dbb9a367ac19c0ed160573e4686425060b6df7f57","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f02e2476bccb9dbe21280d6090f0df17d2f66b74711489415a8aa4df73c9675","affectsGlobalScope":true,"impliedFormat":1},{"version":"45e3ab34c1c013c8ab2dc1ba4c80c780744b13b5676800ae2e3be27ae862c40c","affectsGlobalScope":true,"impliedFormat":1},{"version":"805c86f6cca8d7702a62a844856dbaa2a3fd2abef0536e65d48732441dde5b5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"e42e397f1a5a77994f0185fd1466520691456c772d06bf843e5084ceb879a0ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"f4c2b41f90c95b1c532ecc874bd3c111865793b23aebcc1c3cbbabcd5d76ffb0","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab26191cfad5b66afa11b8bf935ef1cd88fabfcb28d30b2dfa6fad877d050332","affectsGlobalScope":true,"impliedFormat":1},{"version":"2088bc26531e38fb05eedac2951480db5309f6be3fa4a08d2221abb0f5b4200d","affectsGlobalScope":true,"impliedFormat":1},{"version":"cb9d366c425fea79716a8fb3af0d78e6b22ebbab3bd64d25063b42dc9f531c1e","affectsGlobalScope":true,"impliedFormat":1},{"version":"500934a8089c26d57ebdb688fc9757389bb6207a3c8f0674d68efa900d2abb34","affectsGlobalScope":true,"impliedFormat":1},{"version":"689da16f46e647cef0d64b0def88910e818a5877ca5379ede156ca3afb780ac3","affectsGlobalScope":true,"impliedFormat":1},{"version":"bc21cc8b6fee4f4c2440d08035b7ea3c06b3511314c8bab6bef7a92de58a2593","affectsGlobalScope":true,"impliedFormat":1},{"version":"7ca53d13d2957003abb47922a71866ba7cb2068f8d154877c596d63c359fed25","affectsGlobalScope":true,"impliedFormat":1},{"version":"54725f8c4df3d900cb4dac84b64689ce29548da0b4e9b7c2de61d41c79293611","affectsGlobalScope":true,"impliedFormat":1},{"version":"e5594bc3076ac29e6c1ebda77939bc4c8833de72f654b6e376862c0473199323","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f3eb332c2d73e729f3364fcc0c2b375e72a121e8157d25a82d67a138c83a95c","affectsGlobalScope":true,"impliedFormat":1},{"version":"6f4427f9642ce8d500970e4e69d1397f64072ab73b97e476b4002a646ac743b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"48915f327cd1dea4d7bd358d9dc7732f58f9e1626a29cc0c05c8c692419d9bb7","affectsGlobalScope":true,"impliedFormat":1},{"version":"b7bf9377723203b5a6a4b920164df22d56a43f593269ba6ae1fdc97774b68855","affectsGlobalScope":true,"impliedFormat":1},{"version":"db9709688f82c9e5f65a119c64d835f906efe5f559d08b11642d56eb85b79357","affectsGlobalScope":true,"impliedFormat":1},{"version":"4b25b8c874acd1a4cf8444c3617e037d444d19080ac9f634b405583fd10ce1f7","affectsGlobalScope":true,"impliedFormat":1},{"version":"37be57d7c90cf1f8112ee2636a068d8fd181289f82b744160ec56a7dc158a9f5","affectsGlobalScope":true,"impliedFormat":1},{"version":"a917a49ac94cd26b754ab84e113369a75d1a47a710661d7cd25e961cc797065f","affectsGlobalScope":true,"impliedFormat":1},{"version":"6d3261badeb7843d157ef3e6f5d1427d0eeb0af0cf9df84a62cfd29fd47ac86e","affectsGlobalScope":true,"impliedFormat":1},{"version":"195daca651dde22f2167ac0d0a05e215308119a3100f5e6268e8317d05a92526","affectsGlobalScope":true,"impliedFormat":1},{"version":"8b11e4285cd2bb164a4dc09248bdec69e9842517db4ca47c1ba913011e44ff2f","affectsGlobalScope":true,"impliedFormat":1},{"version":"0508571a52475e245b02bc50fa1394065a0a3d05277fbf5120c3784b85651799","affectsGlobalScope":true,"impliedFormat":1},{"version":"8f9af488f510c3015af3cc8c267a9e9d96c4dd38a1fdff0e11dc5a544711415b","affectsGlobalScope":true,"impliedFormat":1},{"version":"fc611fea8d30ea72c6bbfb599c9b4d393ce22e2f5bfef2172534781e7d138104","affectsGlobalScope":true,"impliedFormat":1},{"version":"1ce14b81c5cc821994aa8ec1d42b220dd41b27fcc06373bce3958af7421b77d4","affectsGlobalScope":true,"impliedFormat":1},{"version":"b3a048b3e9302ef9a34ef4ebb9aecfb28b66abb3bce577206a79fee559c230da","affectsGlobalScope":true,"impliedFormat":1},{"version":"d1fc2d317157b161af800631bb01668bf08307bf2a0ff053f743aeca3a368465","impliedFormat":1},{"version":"835fb2909ce458740fb4a49fc61709896c6864f5ce3db7f0a88f06c720d74d02","impliedFormat":1},{"version":"6e5857f38aa297a859cab4ec891408659218a5a2610cd317b6dcbef9979459cc","impliedFormat":1},{"version":"2ef8ffe86811721c62038c3de3c2cb27e5555f252b9c71ae1a877f1335485aea","impliedFormat":1},{"version":"404660f2aeed19fc2af51f287dad86556beeeff2075768b01832092de4397c38","impliedFormat":1},{"version":"204b47598070c8d2b26921cdd7cb5b55804bd73ad1a60428750ef95b35c97ec4","impliedFormat":1},{"version":"85605c7095abac45fb2be5b15d1a0a806586113321eb923c28ad7fd0764ed7db","impliedFormat":1},{"version":"c7d7e274be439bd604580d994bdfb305221e471e061d3178f430c09d417f9536","impliedFormat":1},{"version":"c140211fba71b3a847b15da4a70776ed904198e7e4dc8c32df22742235072c4c","impliedFormat":1},{"version":"ce51a3572f75b0f8fc07a11828876ac28cf606a780a2d4c6b3bbcee79e48a90b","impliedFormat":1},{"version":"a8fed1298e1a1aeb2b689c56fe4200c6bf48491cabe47f54a1caa22fa9ebcc6e","impliedFormat":1},{"version":"c7d1e897d7751e2f2f7e41ee6db87a567418a0e9d307c580029e8565a76cb1f8","impliedFormat":1},{"version":"bae85faf965874160673777542d5def87f22c71125d3b71267b1384b0532a4c4","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"e0bfe601a9fdf6defe94ed62dc60ac71597566001a1f86e705c95e431a9c816d","impliedFormat":1},{"version":"8fdac54b93a59a6627b74c680e2df92f8f66b0b7d2699c9dd2a10484066a1c22","impliedFormat":1},{"version":"55fadfc733db7198f557af11bf55ae955db6257e17262351a9cdb8a98af4a9f9","impliedFormat":1},{"version":"ff49687860a57d46828bccbedd739e192ead2421a59bb04024529e8e80c6264e","impliedFormat":1},{"version":"d5063dd2ce061414ebb1ec3608295d6681d3153a427b715bd515813c621b3cf1","impliedFormat":1},{"version":"b147d5d4e973ea9725631a6bd49d3dffd0c28c521b20b7bf44456daa86723395","impliedFormat":1},{"version":"14e1da8984e72f3837de4aec8bc6d29e9ecce4dc260ac6ef4ca4e5e4f93add01","impliedFormat":1},{"version":"99003dbd8309d6cfda98e4bacb264ad40bfc197ede6af95370b0f3177076eb6a","impliedFormat":1},{"version":"be7e9393805753e479746c81dcfe4287063d83ffa30e0284f7a016775af2c1d2","impliedFormat":1},{"version":"f49bf9fcde399132c5760eefb0714cee3f8e96cd30fcec8c535e2cee57870d63","impliedFormat":1},{"version":"9943ae429279a7a4bab6bacc828f9416ee0eed92a370d4c22d5b4235b0c9bd66","impliedFormat":1},{"version":"5490cbcd192227f9a1f61bdf7000da8b47635fc0cdec9e1879b932586b6d2e8e","impliedFormat":1},{"version":"487178767be2789fa2f765d0e77fc5abad8212f7d5dfbe255011dd8e8bb5306c","impliedFormat":1},{"version":"2316301dd223d31962d917999acf8e543e0119c5d24ec984c9f22cb23247160c","impliedFormat":1},{"version":"a3eb5de45edf334745bb6347979b6f9eb44bab235910afb551d44eb05a84a233","impliedFormat":1},{"version":"bfa8e3563e561377191b49bcfb4cea149286a2b843058c1236dce8c3b541564d","impliedFormat":1},{"version":"b8495ee8dbff077d31e9365c73f170709106d7bc6e17a163c7568bb485c8368c","impliedFormat":1},{"version":"e818471014c77c103330aee11f00a7a00b37b35500b53ea6f337aefacd6174c9","impliedFormat":1},{"version":"88c4f1da1a1a6f8ca005fa1a4241897da754b7120fdb731b51a4434232bbcb42","impliedFormat":1},{"version":"31506fd6e72c0d09e082b2f0b3741e6bbe90670361c9560ef998bdb1e56edc3e","impliedFormat":1},{"version":"bb71a499032d1cae039fe7e192bd318f19e052e39d77f9b52ff35b958350033b","signature":"d48562602f305f70008cf896b3a9887ecd4f775cd8da0da9576bb97b14d339bd","impliedFormat":99},{"version":"1e0d21b6f553e76cb033a13bd2fd6d3d369cd7872f48af5b7e287cecbb1aa435","signature":"90b8578b205007bd83f63f96af778f93462c612a903aa106bba7ee67ba0eb3fe","impliedFormat":99},{"version":"0b314ec45dec0315cb2c3b6b1020d03b56ebd8eeca7e50e739e141a169aca05e","signature":"047fb5fe6a32e60592581da28b693fc73aebd61b048d9d0db234b6480a2d9020","impliedFormat":99},{"version":"f13fa96e623f62b1b2edce747db32ccc602da68ab3d039981a706d69691644fb","signature":"75ef3d6cc2474caa1b61579ea9ddbe444bfacebc77628811f2d320f9e0b1b6fc","impliedFormat":99},{"version":"aa7a8f493461c62f26000928cb0a1e02f167aaaf817be4397160796533f78d81","signature":"4cfdbf0544c0f6fa737d21072a37e36a4e79c532eeedf44739c63cdb43ffb2de","impliedFormat":99},{"version":"378214baa256a4ff557ca2c89f7451ec90e828cc315ea20ed809b8a8fb40325a","signature":"297ee030d25a36bfcde917cae36f9713a51f045127a30311a386d019a08019bc","impliedFormat":99},{"version":"cd66b833ba1d240561c4dd5cfe99fcb4894ae3188c864b9a66255a0eabeb3d27","signature":"43ecaa94c2f50133394f57ec467cb48eeb2a2a57f8060007e074db92412f7ce2","impliedFormat":99},{"version":"b4b2d74163e721036557555e46884a5b6d360b547928a8f093fd34d1ce6f26a4","signature":"edd321f0747595d3085bf42fd284bedc075e101ba808c4bbdef14644737073a1","impliedFormat":99},{"version":"5404b33b348372c268849e85f5d75ea17abef7f57db9fa4ce059667be5361d82","signature":"a8af96c50c2b274d65e775f8331f08009db329377651260011455fb22c06cfa0","impliedFormat":99},{"version":"0f2d81da827fffce8f8f92fcb8fa18aa50694a54f243b3124635fb54f35aacdc","signature":"9ef61a3642f6c147d448b84777949e318c13a7e270eb95c6731836a22eeb185b","impliedFormat":99},{"version":"ab7364accaddb4511a8d680b5fe1e97c8c9144254b016bf6bf25180b47a1626f","signature":"71e2a69f4c96226af4298a8d78f6fe516c081f327cb7d6376bc4f4a8da37b483","impliedFormat":99},{"version":"e59cd18ce56c2e41f2baba985c652d3890c35ba761c065644a1353db9c84d8cf","signature":"6cea8cd992a30ea86c9769995f88d298ff795aa3fd96de4a4f3cc068f7538ca9","impliedFormat":99},{"version":"59c193dfde188cf95085b2466c05489d6caa83f19c78626b569c461d1c934ee6","signature":"c0ef27b426b2d6b655bd8fa16321dad6374d9191a575884263c6a345e9f9633b","impliedFormat":99},{"version":"099da1c09f8c418f2393148815ea4e2f4c162427780e1f937c23fc10ded13fe5","signature":"2d6a03447108db619f4e289c69664071108dedb68ab2c5477d781af7d9309c57","impliedFormat":99},{"version":"320ca9483b5d85decf8363cf83c3cb3557d0405984f206cef53298bd5ba9270d","signature":"b6384eb4d482f99adf7a582c1ce8ffe3800d2dbde33f40588ef19f618a92063f","impliedFormat":99},{"version":"2344a8cf797196fedc212e64c63f6447d668a671bc7708422114b5470a52fd59","signature":"e0367f3f100b3bdda1d2651c13e00a4d35ddf2dbb1ba796e73ffe0c6446967fa","impliedFormat":99},{"version":"ad01d47101670e9acb741476013ddc6bb2eec3f1b5590e0acedf05f7318a0fc0","signature":"2c17fc520b28a1c3a67d3c650042f1061d5d223ff6a6251347cb7861bbb7dacf","impliedFormat":99},{"version":"558e1cf25d3fa944c2826f4dc3fb10d11087d0dd143a122e02962a4716c086b2","signature":"f660240e341acc18701646b999bba6929d5e643c9331c4bb815c9e2d9250b7fb","impliedFormat":99},{"version":"555937a5e7c313e5d8c9b242a478541940d79e40ac5d298486ecc2dab281f531","signature":"39ac3b7122748a8272e0d06fa31771172f60dd168765b266411536d65a3c2193","impliedFormat":99},{"version":"e88fc32c814b6b862961fe7e926e4a16beb70ab92c7c1bc168a6a076c166cde8","signature":"0c410faa30e5253fdb4c308609b7763eac1a05bbc2e964bc5e7d0f3fbc28275a","impliedFormat":99},{"version":"833fa6db8692f7f6acfce21d3356c133411d92439896ab952b24985cfbeb5c3e","signature":"97d28157863987b6058c9ab65eeaed0cff20ba18890b24805f910bc6e2bd65a6","impliedFormat":99},{"version":"6425e484bb00008378b09698366932f340dec898287008328bb6b696fc5ed988","signature":"eed7b2131bbeadbb26d1f856e8430d9aed615c5ba7f690cb73df57252508ddad","impliedFormat":99},{"version":"8dffc45f1c525bb14528cef4ae95856bbb247405d5cd6546cc14aee7d4ffdd34","signature":"a0c23e47fb3acfc3eb8a01b172361832a1fffd8453b4ef486fb89419c1e8713f","impliedFormat":99}],"root":[[153,175]],"options":{"composite":true,"declaration":true,"declarationMap":true,"erasableSyntaxOnly":true,"exactOptionalPropertyTypes":true,"module":199,"noFallthroughCasesInSwitch":true,"noImplicitOverride":true,"noImplicitReturns":true,"noPropertyAccessFromIndexSignature":true,"noUncheckedIndexedAccess":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rewriteRelativeImportExtensions":true,"rootDir":"../src","skipLibCheck":true,"sourceMap":true,"strict":true,"target":9,"tsBuildInfoFile":"./.tsbuildinfo","verbatimModuleSyntax":true},"referencedMap":[[152,1],[144,2],[150,3],[145,3],[147,3],[141,2],[151,4],[146,5],[148,3],[149,3],[142,6],[143,7],[137,8],[65,9],[136,10],[67,11],[66,12],[140,13],[139,14],[138,15],[69,16],[68,9],[60,10],[64,17],[61,18],[62,19],[71,20],[72,20],[73,20],[74,20],[75,20],[76,20],[77,20],[78,20],[79,20],[80,20],[81,20],[82,20],[83,20],[84,20],[85,20],[86,20],[88,20],[87,20],[89,20],[90,20],[91,20],[92,20],[93,20],[94,20],[95,20],[134,21],[96,20],[97,20],[98,20],[99,20],[100,20],[101,20],[102,20],[103,20],[104,20],[105,20],[106,20],[107,20],[108,20],[109,20],[110,20],[111,20],[113,20],[112,20],[115,20],[114,20],[116,20],[117,20],[118,20],[119,20],[120,20],[121,20],[122,20],[123,20],[124,20],[125,20],[126,20],[127,20],[128,20],[129,20],[130,20],[133,20],[131,20],[132,20],[153,22],[154,23],[175,24],[171,25],[156,26],[157,26],[158,26],[159,26],[168,27],[155,22],[160,26],[161,28],[162,26],[163,28],[164,28],[165,28],[166,26],[167,26],[173,29],[174,30],[170,31],[169,32]],"latestChangedDtsFile":"./index.d.ts","version":"6.0.3"}
@@ -0,0 +1,136 @@
1
+ /**
2
+ * Primitive schemas shared by every structure kind.
3
+ */
4
+ import { z } from 'zod';
5
+ /** Upper bounds that keep a single document cheap to validate and render. */
6
+ export declare const LIMITS: {
7
+ readonly structures: 16;
8
+ readonly elementsPerStructure: 1000;
9
+ readonly edgesPerStructure: 4000;
10
+ readonly tableRows: 100;
11
+ readonly tableColumns: 100;
12
+ readonly steps: 10000;
13
+ readonly actionsPerStep: 100;
14
+ readonly textLength: 2000;
15
+ readonly sourceLength: 20000;
16
+ readonly sections: 1000;
17
+ /** Longest step name, section id or anchor name (ADR 0020, 0017). */
18
+ readonly nameLength: 40;
19
+ /** Languages in `sources` (ADR 0017). */
20
+ readonly sources: 8;
21
+ /** Anchors in one source. */
22
+ readonly anchors: 1000;
23
+ };
24
+ /**
25
+ * Whether a name can be used as an object key without colliding with
26
+ * properties every JavaScript object inherits, such as `constructor` or
27
+ * `__proto__`. Names that collide could resolve to inherited values or
28
+ * change an object's prototype.
29
+ */
30
+ export declare const isSafeKey: (name: string) => boolean;
31
+ /** Name of a structure in a visualization; actions refer to it as `target`. */
32
+ export declare const StructureName: z.ZodString;
33
+ export type StructureName = z.infer<typeof StructureName>;
34
+ /** Stable identity of an element within one structure (ADR 0007). */
35
+ export declare const ElementId: z.ZodString;
36
+ export type ElementId = z.infer<typeof ElementId>;
37
+ /** Zero-based position. */
38
+ export declare const Index: z.ZodInt;
39
+ export type Index = z.infer<typeof Index>;
40
+ /** A value that can be displayed inside a cell or node. */
41
+ export declare const Scalar: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodNull]>;
42
+ export type Scalar = z.infer<typeof Scalar>;
43
+ /**
44
+ * Name of a step, saying what kind of step it is, such as `compare` or
45
+ * `relax`. Names repeat: every relaxation in Dijkstra is named `relax`.
46
+ */
47
+ export declare const StepName: z.ZodString;
48
+ export type StepName = z.infer<typeof StepName>;
49
+ /**
50
+ * Name of a point in an algorithm's code, such as `swap`, that every
51
+ * language of `sources` maps to its own line (ADR 0017). Anchors are keys
52
+ * of an object, so a name that every object inherits, such as
53
+ * `constructor`, is not allowed.
54
+ */
55
+ export declare const AnchorName: z.ZodString;
56
+ export type AnchorName = z.infer<typeof AnchorName>;
57
+ /** Id of a section, unique within a document. */
58
+ export declare const SectionId: z.ZodString;
59
+ export type SectionId = z.infer<typeof SectionId>;
60
+ /**
61
+ * A run of consecutive steps with a title, such as one operation of a
62
+ * sequence. It lasts until the next section starts, or to the end.
63
+ */
64
+ export declare const Section: z.ZodObject<{
65
+ id: z.ZodString;
66
+ title: z.ZodString;
67
+ start: z.ZodInt;
68
+ }, z.core.$strict>;
69
+ export type Section = z.infer<typeof Section>;
70
+ /** Teaching metadata attached to a step; it never affects structure state. */
71
+ export declare const StepMeta: z.ZodObject<{
72
+ id: z.ZodOptional<z.ZodString>;
73
+ at: z.ZodOptional<z.ZodString>;
74
+ line: z.ZodOptional<z.ZodInt>;
75
+ narration: z.ZodOptional<z.ZodString>;
76
+ vars: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
77
+ }, z.core.$strict>;
78
+ export type StepMeta = z.infer<typeof StepMeta>;
79
+ /** Source code shown next to the visualization; steps refer to its lines. */
80
+ export declare const Source: z.ZodObject<{
81
+ language: z.ZodOptional<z.ZodString>;
82
+ code: z.ZodString;
83
+ }, z.core.$strict>;
84
+ export type Source = z.infer<typeof Source>;
85
+ /**
86
+ * The code of the algorithm in one language of `sources` (ADR 0017), with
87
+ * the line of each anchor that steps name in `meta.at`.
88
+ */
89
+ export declare const AnchoredSource: z.ZodObject<{
90
+ language: z.ZodString;
91
+ code: z.ZodString;
92
+ anchors: z.ZodRecord<z.ZodString, z.ZodInt>;
93
+ }, z.core.$strict>;
94
+ export type AnchoredSource = z.infer<typeof AnchoredSource>;
95
+ /**
96
+ * Where a structure goes in a figure (ADR 0029). The output's layout
97
+ * decides what "side" means: right of the main structures in a wide
98
+ * figure, below them in a narrow one.
99
+ */
100
+ export declare const Place: z.ZodEnum<{
101
+ main: "main";
102
+ side: "side";
103
+ }>;
104
+ export type Place = z.infer<typeof Place>;
105
+ /** An element with an explicit id: a cell, a stack entry, a list node, … */
106
+ export declare const Element: z.ZodObject<{
107
+ id: z.ZodString;
108
+ value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodNull]>;
109
+ }, z.core.$strict>;
110
+ export type Element = z.infer<typeof Element>;
111
+ /**
112
+ * Authoring form of an element: either explicit, or a bare value that the
113
+ * parser gives a generated id.
114
+ */
115
+ export declare const ElementInput: z.ZodUnion<readonly [z.ZodObject<{
116
+ id: z.ZodString;
117
+ value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodNull]>;
118
+ }, z.core.$strict>, z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodNull]>]>;
119
+ export type ElementInput = z.infer<typeof ElementInput>;
120
+ export declare const isElement: (x: ElementInput) => x is Element;
121
+ /** Name of a pointer or cursor, e.g. "i", "lo", "head". */
122
+ export declare const PointerName: z.ZodString;
123
+ /**
124
+ * Categorical group of an element (0–5), e.g. a connected component or a
125
+ * colour class in graph colouring. Painters map groups to distinct tones.
126
+ * null removes the group.
127
+ */
128
+ export declare const Group: z.ZodNullable<z.ZodLiteral<0 | 1 | 4 | 2 | 3 | 5>>;
129
+ /** A group index 0–5. */
130
+ export type GroupIndexValue = 0 | 1 | 2 | 3 | 4 | 5;
131
+ /**
132
+ * Custom issue parameter used to tag Zod issues with a protocol error code.
133
+ * See `errors.ts`.
134
+ */
135
+ export declare const PROTOCOL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M,MAAM,eAAe,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEpD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,iBAAiB,CAAC"}
package/dist/common.js ADDED
@@ -0,0 +1,181 @@
1
+ /**
2
+ * Primitive schemas shared by every structure kind.
3
+ */
4
+ import { z } from 'zod';
5
+ /** Upper bounds that keep a single document cheap to validate and render. */
6
+ export const LIMITS = {
7
+ structures: 16,
8
+ elementsPerStructure: 1_000,
9
+ edgesPerStructure: 4_000,
10
+ tableRows: 100,
11
+ tableColumns: 100,
12
+ steps: 10_000,
13
+ actionsPerStep: 100,
14
+ textLength: 2_000,
15
+ sourceLength: 20_000,
16
+ sections: 1_000,
17
+ /** Longest step name, section id or anchor name (ADR 0020, 0017). */
18
+ nameLength: 40,
19
+ /** Languages in `sources` (ADR 0017). */
20
+ sources: 8,
21
+ /** Anchors in one source. */
22
+ anchors: 1_000,
23
+ };
24
+ /**
25
+ * Whether a name can be used as an object key without colliding with
26
+ * properties every JavaScript object inherits, such as `constructor` or
27
+ * `__proto__`. Names that collide could resolve to inherited values or
28
+ * change an object's prototype.
29
+ */
30
+ export const isSafeKey = (name) => !(name in Object.prototype);
31
+ const RESERVED = 'must not be a built-in JavaScript property name such as "constructor" or "__proto__"';
32
+ /** Name of a structure in a visualization; actions refer to it as `target`. */
33
+ export const StructureName = z
34
+ .string()
35
+ .regex(/^[A-Za-z_][A-Za-z0-9_]{0,63}$/)
36
+ .refine(isSafeKey, { message: `Structure names ${RESERVED}` })
37
+ .describe(`Identifier of a structure, e.g. "arr" or "dist". Letters, digits and underscores; must not start with a digit; ${RESERVED}.`);
38
+ /** Stable identity of an element within one structure (ADR 0007). */
39
+ export const ElementId = z
40
+ .string()
41
+ .regex(/^[A-Za-z0-9_.:-]{1,64}$/)
42
+ .describe('Identifier of an element, unique within its structure and stable for the whole trace.');
43
+ /** Zero-based position. */
44
+ export const Index = z.int().nonnegative().describe('Zero-based position.');
45
+ /** A value that can be displayed inside a cell or node. */
46
+ export const Scalar = z
47
+ .union([z.number(), z.string().max(LIMITS.textLength), z.boolean(), z.null()])
48
+ .describe('A displayable value: number, string, boolean or null.');
49
+ /**
50
+ * Lower-case kebab-case that starts with a letter, so that a selector can
51
+ * tell a name from a frame number (ADR 0020).
52
+ */
53
+ const kebabName = (what) => z
54
+ .string()
55
+ .max(LIMITS.nameLength)
56
+ .regex(/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/, {
57
+ message: `${what} must be lower-case kebab-case that starts with a letter, e.g. "fixup-case-3"`,
58
+ });
59
+ /**
60
+ * Name of a step, saying what kind of step it is, such as `compare` or
61
+ * `relax`. Names repeat: every relaxation in Dijkstra is named `relax`.
62
+ */
63
+ export const StepName = kebabName('A step name').describe(`Name of the kind of step, e.g. "compare", "relax" or "fixup-case-3": lower-case kebab-case starting with a letter, at most ${LIMITS.nameLength} characters. Names repeat; selectors such as "relax#3" refer to them.`);
64
+ /**
65
+ * Name of a point in an algorithm's code, such as `swap`, that every
66
+ * language of `sources` maps to its own line (ADR 0017). Anchors are keys
67
+ * of an object, so a name that every object inherits, such as
68
+ * `constructor`, is not allowed.
69
+ */
70
+ export const AnchorName = kebabName('An anchor name')
71
+ .refine(isSafeKey, { message: `Anchor names ${RESERVED}` })
72
+ .describe(`Name of a point in the code, e.g. "swap" or "relax": lower-case kebab-case starting with a letter, at most ${LIMITS.nameLength} characters.`);
73
+ /** Id of a section, unique within a document. */
74
+ export const SectionId = kebabName('A section id').describe(`Id of a section, unique within the document, e.g. "insert-5": lower-case kebab-case starting with a letter, at most ${LIMITS.nameLength} characters.`);
75
+ /**
76
+ * A run of consecutive steps with a title, such as one operation of a
77
+ * sequence. It lasts until the next section starts, or to the end.
78
+ */
79
+ export const Section = z
80
+ .strictObject({
81
+ id: SectionId,
82
+ title: z
83
+ .string()
84
+ .min(1)
85
+ .max(LIMITS.textLength)
86
+ .describe('Title shown to learners, e.g. "Insert 5".'),
87
+ start: z
88
+ .int()
89
+ .nonnegative()
90
+ .describe("0-based index of the section's first step. Each section starts after the one before."),
91
+ })
92
+ .describe('A titled run of consecutive steps, such as one operation of a sequence. It lasts until the next section starts, or to the end of the document.');
93
+ /** Teaching metadata attached to a step; it never affects structure state. */
94
+ export const StepMeta = z
95
+ .strictObject({
96
+ id: StepName.optional(),
97
+ at: AnchorName.optional().describe('With `sources`: the anchor of the code this step corresponds to, which every source maps to a line.'),
98
+ line: z
99
+ .int()
100
+ .positive()
101
+ .optional()
102
+ .describe('With `source`: the 1-based line this step corresponds to. With `sources`, use `at`.'),
103
+ narration: z
104
+ .string()
105
+ .max(LIMITS.textLength)
106
+ .optional()
107
+ .describe('One or two sentences explaining the step to a learner.'),
108
+ vars: z
109
+ .record(z.string().refine(isSafeKey, { message: `Variable names ${RESERVED}` }), z.json())
110
+ .optional()
111
+ .describe('Variable values to display, e.g. { "i": 0, "j": 1 }.'),
112
+ })
113
+ .describe('Teaching metadata for a step.');
114
+ const Language = z
115
+ .string()
116
+ .regex(/^[a-z0-9+#-]{1,32}$/)
117
+ .describe('Language of the code, for highlighting and the language switcher, e.g. "pseudocode" or "python".');
118
+ const Code = z.string().max(LIMITS.sourceLength).describe('The source code.');
119
+ /** Source code shown next to the visualization; steps refer to its lines. */
120
+ export const Source = z
121
+ .strictObject({
122
+ language: Language.optional(),
123
+ code: Code,
124
+ })
125
+ .describe("Source code of the algorithm in one language. When present, each step's `meta.line` must be a line of this code.");
126
+ /**
127
+ * The code of the algorithm in one language of `sources` (ADR 0017), with
128
+ * the line of each anchor that steps name in `meta.at`.
129
+ */
130
+ export const AnchoredSource = z
131
+ .strictObject({
132
+ language: Language,
133
+ code: Code,
134
+ anchors: z
135
+ .record(AnchorName, z.int().positive())
136
+ .refine((a) => Object.keys(a).length <= LIMITS.anchors, {
137
+ message: `Give at most ${LIMITS.anchors} anchors`,
138
+ })
139
+ .describe('The 1-based line of each anchor in this code, e.g. { "swap": 6 }. Every anchor a step names must be here.')
140
+ // The refinement above is invisible to JSON Schema; state it there too.
141
+ .meta({ maxProperties: LIMITS.anchors }),
142
+ })
143
+ .describe('The code of the algorithm in one language, with its anchors.');
144
+ /**
145
+ * Where a structure goes in a figure (ADR 0029). The output's layout
146
+ * decides what "side" means: right of the main structures in a wide
147
+ * figure, below them in a narrow one.
148
+ */
149
+ export const Place = z
150
+ .enum(['main', 'side'])
151
+ .describe('Where the structure goes: "main" (default) with the main picture, or "side" for an auxiliary structure such as a queue, a call stack or a table of results. Side structures go right of the main ones in wide figures (slides, the player) and below them in narrow ones (notes).');
152
+ /** An element with an explicit id: a cell, a stack entry, a list node, … */
153
+ export const Element = z
154
+ .strictObject({ id: ElementId, value: Scalar })
155
+ .describe('An element with an explicit id.');
156
+ /**
157
+ * Authoring form of an element: either explicit, or a bare value that the
158
+ * parser gives a generated id.
159
+ */
160
+ export const ElementInput = z
161
+ .union([Element, Scalar])
162
+ .describe('An element `{ "id", "value" }`, or a bare value to get a generated id.');
163
+ export const isElement = (x) => typeof x === 'object' && x !== null;
164
+ /** Name of a pointer or cursor, e.g. "i", "lo", "head". */
165
+ export const PointerName = z
166
+ .string()
167
+ .regex(/^[A-Za-z_][A-Za-z0-9_]{0,15}$/)
168
+ .refine(isSafeKey, { message: `Pointer names ${RESERVED}` })
169
+ .describe('Pointer name, e.g. "i", "lo" or "head".');
170
+ /**
171
+ * Categorical group of an element (0–5), e.g. a connected component or a
172
+ * colour class in graph colouring. Painters map groups to distinct tones.
173
+ * null removes the group.
174
+ */
175
+ export const Group = z.literal([0, 1, 2, 3, 4, 5]).nullable();
176
+ /**
177
+ * Custom issue parameter used to tag Zod issues with a protocol error code.
178
+ * See `errors.ts`.
179
+ */
180
+ export const PROTOCOL_CODE_PARAM = 'protocolCode';
181
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,E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AAC3D,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC;KACzB,MAAM,EAAE;KACR,KAAK,CAAC,+BAA+B,CAAC;KACtC,MAAM,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,iBAAiB,QAAQ,EAAE,EAAE,CAAC;KAC3D,QAAQ,CAAC,yCAAyC,CAAC,CAAC;AAEvD;;;;GAIG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;AAK9D;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,cAAc,CAAC"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Validation errors in a form that both people and LLMs can act on: a stable
3
+ * code, a JSONPath-like location, a message, and an optional fix hint.
4
+ */
5
+ import type { z } from 'zod';
6
+ export type ProtocolErrorCode =
7
+ /** The document does not match the protocol's shape. */
8
+ 'INVALID_SHAPE'
9
+ /** `version` names a protocol version this package cannot read. */
10
+ | 'UNSUPPORTED_VERSION'
11
+ /** An action's `target` names no declared structure. */
12
+ | 'UNKNOWN_TARGET'
13
+ /** An action's `type` is not defined for its target's kind. */
14
+ | 'UNKNOWN_ACTION'
15
+ /** An action's fields are missing or invalid. */
16
+ | 'INVALID_ACTION'
17
+ /** Two elements of one structure share an id. */
18
+ | 'DUPLICATE_ID'
19
+ /** A declaration breaks a structural rule, e.g. a tree with a cycle. */
20
+ | 'INVALID_STRUCTURE'
21
+ /**
22
+ * A step's `meta.line`, or an anchor of `sources`, is not a line of its
23
+ * source code.
24
+ */
25
+ | 'LINE_OUT_OF_RANGE'
26
+ /**
27
+ * The document mixes the two forms of source code: `source` and
28
+ * `sources` together, `meta.line` with `sources`, or `meta.at` with
29
+ * `source` (ADR 0017).
30
+ */
31
+ | 'MIXED_SOURCES'
32
+ /** Two entries of `sources` have the same language. */
33
+ | 'DUPLICATE_LANGUAGE'
34
+ /** A step's `meta.at` is not an anchor of every source. */
35
+ | 'UNKNOWN_ANCHOR'
36
+ /** The document uses a feature added after its `version`. */
37
+ | 'VERSION_TOO_OLD'
38
+ /** A section starts past the last step. */
39
+ | 'SECTION_OUT_OF_RANGE'
40
+ /** A section does not start after the section before it. */
41
+ | 'SECTION_OUT_OF_ORDER'
42
+ /** Two sections share an id. */
43
+ | 'DUPLICATE_SECTION';
44
+ /**
45
+ * A located, actionable problem in a document. Generic over its code so that
46
+ * later stages (for example the core engine) can report their own codes in
47
+ * the same format.
48
+ */
49
+ export interface Diagnostic<Code extends string = string> {
50
+ readonly code: Code;
51
+ /** Location in the input, e.g. `$.steps[3].actions[0].j`. */
52
+ readonly path: string;
53
+ readonly message: string;
54
+ readonly hint?: string;
55
+ }
56
+ export type ProtocolError = Diagnostic<ProtocolErrorCode>;
57
+ /** Formats a property path as `$.a.b[0].c`. */
58
+ export declare function formatPath(path: readonly PropertyKey[]): string;
59
+ /**
60
+ * Converts Zod issues into protocol errors, prefixing each issue path with
61
+ * `basePath` (the issue paths are relative to the value that was parsed).
62
+ */
63
+ export declare function fromZodIssues(issues: readonly z.core.$ZodIssue[], basePath: readonly PropertyKey[], fallbackCode: ProtocolErrorCode): ProtocolError[];
64
+ /**
65
+ * Renders errors as plain text, one per line, for showing to a person or
66
+ * returning to an LLM so it can correct its output.
67
+ */
68
+ export declare function formatErrors(errors: readonly Diagnostic[], { max }?: {
69
+ max?: number;
70
+ }): string;
71
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAI7B,MAAM,MAAM,iBAAiB;AAC3B,wDAAwD;AACtD,eAAe;AACjB,mEAAmE;GACjE,qBAAqB;AACvB,wDAAwD;GACtD,gBAAg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].c`. */
3
+ export function formatPath(path) {
4
+ let out = '$';
5
+ for (const key of path) {
6
+ if (typeof key === 'number')
7
+ out += `[${key}]`;
8
+ else if (typeof key === 'string' && /^[A-Za-z_][A-Za-z0-9_]*$/.test(key))
9
+ out += `.${key}`;
10
+ else
11
+ out += `[${JSON.stringify(String(key))}]`;
12
+ }
13
+ return out;
14
+ }
15
+ /**
16
+ * Converts Zod issues into protocol errors, prefixing each issue path with
17
+ * `basePath` (the issue paths are relative to the value that was parsed).
18
+ */
19
+ export function fromZodIssues(issues, basePath, fallbackCode) {
20
+ return issues.map((issue) => {
21
+ const tagged = issue.code === 'custom'
22
+ ? issue.params?.[PROTOCOL_CODE_PARAM]
23
+ : undefined;
24
+ return {
25
+ code: tagged ?? fallbackCode,
26
+ path: formatPath([...basePath, ...issue.path]),
27
+ message: issue.message,
28
+ };
29
+ });
30
+ }
31
+ /**
32
+ * Renders errors as plain text, one per line, for showing to a person or
33
+ * returning to an LLM so it can correct its output.
34
+ */
35
+ export function formatErrors(errors, { max = 20 } = {}) {
36
+ const lines = errors
37
+ .slice(0, max)
38
+ .map((e) => `${e.code} at ${e.path}: ${e.message}${e.hint ? ` (hint: ${e.hint})` : ''}`);
39
+ if (errors.length > max)
40
+ lines.push(`…and ${errors.length - max} more`);
41
+ return lines.join('\n');
42
+ }
43
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAwDlD,+CAA+C;AAC/C,MAAM,UAAU,UAAU,CAAC,IAA4B;IACrD,IAAI,GAAG,GAAG,GAAG,CAAC;IACd,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,OAAO,GAAG,KAAK,QAAQ;YAAE,GAAG,IAAI,IAAI,GAAG,GAAG,CAAC;aAC1C,IAAI,OAAO,GAAG,KAAK,QAAQ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M,GAAG,GAAG,OAAO,CAAC,CAAC;IACxE,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,10 @@
1
+ export * from './common.ts';
2
+ export * from './errors.ts';
3
+ export * from './json-schema.ts';
4
+ export * from './kinds/index.ts';
5
+ export * from './parse.ts';
6
+ export * from './result.ts';
7
+ export { checkFeatures, minimumVersion, PROTOCOL_FEATURES, PROTOCOL_VERSION, PROTOCOL_VERSIONS, UPGRADED_VERSIONS, upgradeDocument, type ProtocolFeature, type ProtocolVersion, type Upgraded, } from './version.ts';
8
+ export { StructureDecl, StructureDeclInput, TargetedAction, Visualization, VisualizationInput, type Step, } from './visualization.ts';
9
+ export * from './share.ts';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,OAAO,EACL,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,QAAQ,GACd,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,KAAK,IAAI,GACV,MAAM,oBAAoB,CAAC;AAC5B,cAAc,YAAY,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,10 @@
1
+ export * from "./common.js";
2
+ export * from "./errors.js";
3
+ export * from "./json-schema.js";
4
+ export * from "./kinds/index.js";
5
+ export * from "./parse.js";
6
+ export * from "./result.js";
7
+ export { checkFeatures, minimumVersion, PROTOCOL_FEATURES, PROTOCOL_VERSION, PROTOCOL_VERSIONS, UPGRADED_VERSIONS, upgradeDocument, } from "./version.js";
8
+ export { StructureDecl, StructureDeclInput, TargetedAction, Visualization, VisualizationInput, } from "./visualization.js";
9
+ export * from "./share.js";
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,OAAO,EACL,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,GAIhB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,kBAAkB,GAEnB,MAAM,oBAAoB,CAAC;AAC5B,cAAc,YAAY,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const SCHEMA_ID: string;
2
+ export declare function visualizationJsonSchema(): Record<string, unknown>;
3
+ //# sourceMappingURL=json-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-schema.d.ts","sourceRoot":"","sources":["../src/json-schema.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,SAAS,QAA4D,CAAC;AAEnF,wBAAgB,uBAAuB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAMjE"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * JSON Schema for the authoring form, for LLM prompts, MCP tool definitions
3
+ * and editor validation.
4
+ */
5
+ import { z } from 'zod';
6
+ import { PROTOCOL_VERSION } from "./version.js";
7
+ import { VisualizationInput } from "./visualization.js";
8
+ export const SCHEMA_ID = `urn:algomotion:schema:visualization:${PROTOCOL_VERSION}`;
9
+ export function visualizationJsonSchema() {
10
+ return {
11
+ ...z.toJSONSchema(VisualizationInput, { target: 'draft-2020-12' }),
12
+ $id: SCHEMA_ID,
13
+ title: 'Visualization',
14
+ };
15
+ }
16
+ //# sourceMappingURL=json-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-schema.js","sourceRoot":"","sources":["../src/json-schema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,CAAC,MAAM,SAAS,GAAG,uCAAuC,gBAAgB,EAAE,CAAC;AAEnF,MAAM,UAAU,uBAAuB;IACrC,OAAO;QACL,GAAG,CAAC,CAAC,YAAY,CAAC,kBAAkB,EAAE,EAAE,MAAM,EAAE,eAAe,EAAE,CAAC;QAClE,GAAG,EAAE,SAAS;QACd,KAAK,EAAE,eAAe;KACvB,CAAC;AACJ,CAAC"}