@rcrsr/rill 0.15.0 → 0.17.0

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 (316) hide show
  1. package/README.md +37 -21
  2. package/dist/ast-nodes.d.ts +2 -13
  3. package/dist/ast-nodes.js +0 -1
  4. package/dist/ast-unions.d.ts +0 -1
  5. package/dist/ast-unions.js +0 -1
  6. package/dist/constants.d.ts +0 -1
  7. package/dist/constants.js +0 -1
  8. package/dist/error-classes.d.ts +0 -1
  9. package/dist/error-classes.js +0 -1
  10. package/dist/error-formatter.d.ts +0 -1
  11. package/dist/error-formatter.js +0 -1
  12. package/dist/error-registry.d.ts +0 -1
  13. package/dist/error-registry.js +32 -1
  14. package/dist/ext/crypto/index.d.ts +3 -4
  15. package/dist/ext/crypto/index.js +66 -64
  16. package/dist/ext/exec/index.d.ts +3 -4
  17. package/dist/ext/exec/index.js +17 -12
  18. package/dist/ext/exec/runner.d.ts +0 -1
  19. package/dist/ext/exec/runner.js +0 -1
  20. package/dist/ext/fetch/index.d.ts +3 -4
  21. package/dist/ext/fetch/index.js +23 -49
  22. package/dist/ext/fetch/request.d.ts +0 -1
  23. package/dist/ext/fetch/request.js +0 -1
  24. package/dist/ext/fs/index.d.ts +3 -4
  25. package/dist/ext/fs/index.js +268 -266
  26. package/dist/ext/fs/sandbox.d.ts +0 -1
  27. package/dist/ext/fs/sandbox.js +0 -1
  28. package/dist/ext/kv/index.d.ts +3 -4
  29. package/dist/ext/kv/index.js +216 -215
  30. package/dist/ext/kv/store.d.ts +0 -1
  31. package/dist/ext/kv/store.js +2 -2
  32. package/dist/ext-parse-bridge.d.ts +10 -0
  33. package/dist/ext-parse-bridge.js +10 -0
  34. package/dist/generated/introspection-data.d.ts +1 -2
  35. package/dist/generated/introspection-data.js +385 -297
  36. package/dist/generated/version-data.d.ts +1 -2
  37. package/dist/generated/version-data.js +2 -3
  38. package/dist/highlight-map.d.ts +0 -1
  39. package/dist/highlight-map.js +0 -1
  40. package/dist/index.d.ts +15 -5
  41. package/dist/index.js +14 -6
  42. package/dist/lexer/errors.d.ts +0 -1
  43. package/dist/lexer/errors.js +0 -1
  44. package/dist/lexer/helpers.d.ts +0 -1
  45. package/dist/lexer/helpers.js +0 -1
  46. package/dist/lexer/index.d.ts +0 -1
  47. package/dist/lexer/index.js +0 -1
  48. package/dist/lexer/operators.d.ts +0 -1
  49. package/dist/lexer/operators.js +0 -1
  50. package/dist/lexer/readers.d.ts +0 -1
  51. package/dist/lexer/readers.js +0 -1
  52. package/dist/lexer/state.d.ts +0 -1
  53. package/dist/lexer/state.js +0 -1
  54. package/dist/lexer/tokenizer.d.ts +0 -1
  55. package/dist/lexer/tokenizer.js +0 -1
  56. package/dist/parser/helpers.d.ts +0 -1
  57. package/dist/parser/helpers.js +0 -1
  58. package/dist/parser/index.d.ts +0 -1
  59. package/dist/parser/index.js +0 -1
  60. package/dist/parser/parser-collect.d.ts +0 -1
  61. package/dist/parser/parser-collect.js +0 -1
  62. package/dist/parser/parser-control.d.ts +0 -1
  63. package/dist/parser/parser-control.js +0 -1
  64. package/dist/parser/parser-expr.d.ts +0 -1
  65. package/dist/parser/parser-expr.js +0 -1
  66. package/dist/parser/parser-extract.d.ts +0 -1
  67. package/dist/parser/parser-extract.js +0 -1
  68. package/dist/parser/parser-functions.d.ts +0 -1
  69. package/dist/parser/parser-functions.js +0 -1
  70. package/dist/parser/parser-literals.d.ts +0 -1
  71. package/dist/parser/parser-literals.js +4 -2
  72. package/dist/parser/parser-script.d.ts +0 -1
  73. package/dist/parser/parser-script.js +0 -1
  74. package/dist/parser/parser-shape.d.ts +2 -3
  75. package/dist/parser/parser-shape.js +8 -52
  76. package/dist/parser/parser-types.d.ts +28 -2
  77. package/dist/parser/parser-types.js +76 -13
  78. package/dist/parser/parser-use.d.ts +0 -1
  79. package/dist/parser/parser-use.js +7 -2
  80. package/dist/parser/parser-variables.d.ts +0 -1
  81. package/dist/parser/parser-variables.js +0 -1
  82. package/dist/parser/parser.d.ts +0 -1
  83. package/dist/parser/parser.js +0 -1
  84. package/dist/parser/state.d.ts +0 -1
  85. package/dist/parser/state.js +0 -1
  86. package/dist/runtime/core/callable.d.ts +59 -20
  87. package/dist/runtime/core/callable.js +188 -39
  88. package/dist/runtime/core/context.d.ts +0 -12
  89. package/dist/runtime/core/context.js +77 -77
  90. package/dist/runtime/core/equals.d.ts +0 -1
  91. package/dist/runtime/core/equals.js +35 -3
  92. package/dist/runtime/core/eval/base.d.ts +0 -1
  93. package/dist/runtime/core/eval/base.js +0 -1
  94. package/dist/runtime/core/eval/evaluator.d.ts +0 -1
  95. package/dist/runtime/core/eval/evaluator.js +0 -1
  96. package/dist/runtime/core/eval/index.d.ts +2 -3
  97. package/dist/runtime/core/eval/index.js +11 -1
  98. package/dist/runtime/core/eval/mixins/annotations.d.ts +0 -1
  99. package/dist/runtime/core/eval/mixins/annotations.js +0 -1
  100. package/dist/runtime/core/eval/mixins/closures.d.ts +0 -1
  101. package/dist/runtime/core/eval/mixins/closures.js +92 -70
  102. package/dist/runtime/core/eval/mixins/collections.d.ts +0 -1
  103. package/dist/runtime/core/eval/mixins/collections.js +9 -4
  104. package/dist/runtime/core/eval/mixins/control-flow.d.ts +0 -1
  105. package/dist/runtime/core/eval/mixins/control-flow.js +0 -1
  106. package/dist/runtime/core/eval/mixins/conversion.d.ts +0 -1
  107. package/dist/runtime/core/eval/mixins/conversion.js +196 -188
  108. package/dist/runtime/core/eval/mixins/core.d.ts +0 -1
  109. package/dist/runtime/core/eval/mixins/core.js +2 -3
  110. package/dist/runtime/core/eval/mixins/expressions.d.ts +0 -1
  111. package/dist/runtime/core/eval/mixins/expressions.js +35 -28
  112. package/dist/runtime/core/eval/mixins/extraction.d.ts +0 -1
  113. package/dist/runtime/core/eval/mixins/extraction.js +8 -9
  114. package/dist/runtime/core/eval/mixins/list-dispatch.d.ts +0 -1
  115. package/dist/runtime/core/eval/mixins/list-dispatch.js +0 -1
  116. package/dist/runtime/core/eval/mixins/literals.d.ts +0 -1
  117. package/dist/runtime/core/eval/mixins/literals.js +6 -10
  118. package/dist/runtime/core/eval/mixins/types.d.ts +2 -1
  119. package/dist/runtime/core/eval/mixins/types.js +231 -261
  120. package/dist/runtime/core/eval/mixins/use.d.ts +0 -1
  121. package/dist/runtime/core/eval/mixins/use.js +0 -1
  122. package/dist/runtime/core/eval/mixins/variables.d.ts +0 -1
  123. package/dist/runtime/core/eval/mixins/variables.js +16 -15
  124. package/dist/runtime/core/eval/types.d.ts +0 -1
  125. package/dist/runtime/core/eval/types.js +0 -1
  126. package/dist/runtime/core/execute.d.ts +0 -1
  127. package/dist/runtime/core/execute.js +0 -1
  128. package/dist/runtime/core/field-descriptor.d.ts +4 -5
  129. package/dist/runtime/core/field-descriptor.js +2 -2
  130. package/dist/runtime/core/introspection.d.ts +0 -1
  131. package/dist/runtime/core/introspection.js +6 -7
  132. package/dist/runtime/core/markers.d.ts +12 -0
  133. package/dist/runtime/core/markers.js +7 -0
  134. package/dist/runtime/core/resolvers.d.ts +0 -1
  135. package/dist/runtime/core/resolvers.js +0 -1
  136. package/dist/runtime/core/signals.d.ts +0 -1
  137. package/dist/runtime/core/signals.js +0 -1
  138. package/dist/runtime/core/type-registrations.d.ts +136 -0
  139. package/dist/runtime/core/type-registrations.js +749 -0
  140. package/dist/runtime/core/type-structures.d.ts +128 -0
  141. package/dist/runtime/core/type-structures.js +12 -0
  142. package/dist/runtime/core/types.d.ts +15 -4
  143. package/dist/runtime/core/types.js +0 -1
  144. package/dist/runtime/core/values.d.ts +88 -146
  145. package/dist/runtime/core/values.js +466 -470
  146. package/dist/runtime/ext/builtins.d.ts +0 -1
  147. package/dist/runtime/ext/builtins.js +125 -80
  148. package/dist/runtime/ext/extensions.d.ts +30 -125
  149. package/dist/runtime/ext/extensions.js +0 -94
  150. package/dist/runtime/ext/test-context.d.ts +28 -0
  151. package/dist/runtime/ext/test-context.js +154 -0
  152. package/dist/runtime/index.d.ts +22 -9
  153. package/dist/runtime/index.js +18 -5
  154. package/dist/signature-parser.d.ts +2 -3
  155. package/dist/signature-parser.js +19 -17
  156. package/dist/source-location.d.ts +0 -1
  157. package/dist/source-location.js +0 -1
  158. package/dist/token-types.d.ts +0 -1
  159. package/dist/token-types.js +0 -1
  160. package/dist/types.d.ts +0 -1
  161. package/dist/types.js +0 -1
  162. package/dist/value-types.d.ts +15 -12
  163. package/dist/value-types.js +0 -1
  164. package/package.json +2 -1
  165. package/dist/ast-nodes.d.ts.map +0 -1
  166. package/dist/ast-nodes.js.map +0 -1
  167. package/dist/ast-unions.d.ts.map +0 -1
  168. package/dist/ast-unions.js.map +0 -1
  169. package/dist/constants.d.ts.map +0 -1
  170. package/dist/constants.js.map +0 -1
  171. package/dist/error-classes.d.ts.map +0 -1
  172. package/dist/error-classes.js.map +0 -1
  173. package/dist/error-formatter.d.ts.map +0 -1
  174. package/dist/error-formatter.js.map +0 -1
  175. package/dist/error-registry.d.ts.map +0 -1
  176. package/dist/error-registry.js.map +0 -1
  177. package/dist/ext/crypto/index.d.ts.map +0 -1
  178. package/dist/ext/crypto/index.js.map +0 -1
  179. package/dist/ext/exec/index.d.ts.map +0 -1
  180. package/dist/ext/exec/index.js.map +0 -1
  181. package/dist/ext/exec/runner.d.ts.map +0 -1
  182. package/dist/ext/exec/runner.js.map +0 -1
  183. package/dist/ext/fetch/index.d.ts.map +0 -1
  184. package/dist/ext/fetch/index.js.map +0 -1
  185. package/dist/ext/fetch/request.d.ts.map +0 -1
  186. package/dist/ext/fetch/request.js.map +0 -1
  187. package/dist/ext/fs/index.d.ts.map +0 -1
  188. package/dist/ext/fs/index.js.map +0 -1
  189. package/dist/ext/fs/sandbox.d.ts.map +0 -1
  190. package/dist/ext/fs/sandbox.js.map +0 -1
  191. package/dist/ext/kv/index.d.ts.map +0 -1
  192. package/dist/ext/kv/index.js.map +0 -1
  193. package/dist/ext/kv/store.d.ts.map +0 -1
  194. package/dist/ext/kv/store.js.map +0 -1
  195. package/dist/generated/introspection-data.d.ts.map +0 -1
  196. package/dist/generated/introspection-data.js.map +0 -1
  197. package/dist/generated/version-data.d.ts.map +0 -1
  198. package/dist/generated/version-data.js.map +0 -1
  199. package/dist/highlight-map.d.ts.map +0 -1
  200. package/dist/highlight-map.js.map +0 -1
  201. package/dist/index.d.ts.map +0 -1
  202. package/dist/index.js.map +0 -1
  203. package/dist/lexer/errors.d.ts.map +0 -1
  204. package/dist/lexer/errors.js.map +0 -1
  205. package/dist/lexer/helpers.d.ts.map +0 -1
  206. package/dist/lexer/helpers.js.map +0 -1
  207. package/dist/lexer/index.d.ts.map +0 -1
  208. package/dist/lexer/index.js.map +0 -1
  209. package/dist/lexer/operators.d.ts.map +0 -1
  210. package/dist/lexer/operators.js.map +0 -1
  211. package/dist/lexer/readers.d.ts.map +0 -1
  212. package/dist/lexer/readers.js.map +0 -1
  213. package/dist/lexer/state.d.ts.map +0 -1
  214. package/dist/lexer/state.js.map +0 -1
  215. package/dist/lexer/tokenizer.d.ts.map +0 -1
  216. package/dist/lexer/tokenizer.js.map +0 -1
  217. package/dist/parser/helpers.d.ts.map +0 -1
  218. package/dist/parser/helpers.js.map +0 -1
  219. package/dist/parser/index.d.ts.map +0 -1
  220. package/dist/parser/index.js.map +0 -1
  221. package/dist/parser/parser-collect.d.ts.map +0 -1
  222. package/dist/parser/parser-collect.js.map +0 -1
  223. package/dist/parser/parser-control.d.ts.map +0 -1
  224. package/dist/parser/parser-control.js.map +0 -1
  225. package/dist/parser/parser-expr.d.ts.map +0 -1
  226. package/dist/parser/parser-expr.js.map +0 -1
  227. package/dist/parser/parser-extract.d.ts.map +0 -1
  228. package/dist/parser/parser-extract.js.map +0 -1
  229. package/dist/parser/parser-functions.d.ts.map +0 -1
  230. package/dist/parser/parser-functions.js.map +0 -1
  231. package/dist/parser/parser-literals.d.ts.map +0 -1
  232. package/dist/parser/parser-literals.js.map +0 -1
  233. package/dist/parser/parser-script.d.ts.map +0 -1
  234. package/dist/parser/parser-script.js.map +0 -1
  235. package/dist/parser/parser-shape.d.ts.map +0 -1
  236. package/dist/parser/parser-shape.js.map +0 -1
  237. package/dist/parser/parser-types.d.ts.map +0 -1
  238. package/dist/parser/parser-types.js.map +0 -1
  239. package/dist/parser/parser-use.d.ts.map +0 -1
  240. package/dist/parser/parser-use.js.map +0 -1
  241. package/dist/parser/parser-variables.d.ts.map +0 -1
  242. package/dist/parser/parser-variables.js.map +0 -1
  243. package/dist/parser/parser.d.ts.map +0 -1
  244. package/dist/parser/parser.js.map +0 -1
  245. package/dist/parser/state.d.ts.map +0 -1
  246. package/dist/parser/state.js.map +0 -1
  247. package/dist/runtime/core/callable.d.ts.map +0 -1
  248. package/dist/runtime/core/callable.js.map +0 -1
  249. package/dist/runtime/core/context.d.ts.map +0 -1
  250. package/dist/runtime/core/context.js.map +0 -1
  251. package/dist/runtime/core/equals.d.ts.map +0 -1
  252. package/dist/runtime/core/equals.js.map +0 -1
  253. package/dist/runtime/core/eval/base.d.ts.map +0 -1
  254. package/dist/runtime/core/eval/base.js.map +0 -1
  255. package/dist/runtime/core/eval/evaluator.d.ts.map +0 -1
  256. package/dist/runtime/core/eval/evaluator.js.map +0 -1
  257. package/dist/runtime/core/eval/index.d.ts.map +0 -1
  258. package/dist/runtime/core/eval/index.js.map +0 -1
  259. package/dist/runtime/core/eval/mixins/annotations.d.ts.map +0 -1
  260. package/dist/runtime/core/eval/mixins/annotations.js.map +0 -1
  261. package/dist/runtime/core/eval/mixins/closures.d.ts.map +0 -1
  262. package/dist/runtime/core/eval/mixins/closures.js.map +0 -1
  263. package/dist/runtime/core/eval/mixins/collections.d.ts.map +0 -1
  264. package/dist/runtime/core/eval/mixins/collections.js.map +0 -1
  265. package/dist/runtime/core/eval/mixins/control-flow.d.ts.map +0 -1
  266. package/dist/runtime/core/eval/mixins/control-flow.js.map +0 -1
  267. package/dist/runtime/core/eval/mixins/conversion.d.ts.map +0 -1
  268. package/dist/runtime/core/eval/mixins/conversion.js.map +0 -1
  269. package/dist/runtime/core/eval/mixins/core.d.ts.map +0 -1
  270. package/dist/runtime/core/eval/mixins/core.js.map +0 -1
  271. package/dist/runtime/core/eval/mixins/expressions.d.ts.map +0 -1
  272. package/dist/runtime/core/eval/mixins/expressions.js.map +0 -1
  273. package/dist/runtime/core/eval/mixins/extraction.d.ts.map +0 -1
  274. package/dist/runtime/core/eval/mixins/extraction.js.map +0 -1
  275. package/dist/runtime/core/eval/mixins/list-dispatch.d.ts.map +0 -1
  276. package/dist/runtime/core/eval/mixins/list-dispatch.js.map +0 -1
  277. package/dist/runtime/core/eval/mixins/literals.d.ts.map +0 -1
  278. package/dist/runtime/core/eval/mixins/literals.js.map +0 -1
  279. package/dist/runtime/core/eval/mixins/types.d.ts.map +0 -1
  280. package/dist/runtime/core/eval/mixins/types.js.map +0 -1
  281. package/dist/runtime/core/eval/mixins/use.d.ts.map +0 -1
  282. package/dist/runtime/core/eval/mixins/use.js.map +0 -1
  283. package/dist/runtime/core/eval/mixins/variables.d.ts.map +0 -1
  284. package/dist/runtime/core/eval/mixins/variables.js.map +0 -1
  285. package/dist/runtime/core/eval/types.d.ts.map +0 -1
  286. package/dist/runtime/core/eval/types.js.map +0 -1
  287. package/dist/runtime/core/execute.d.ts.map +0 -1
  288. package/dist/runtime/core/execute.js.map +0 -1
  289. package/dist/runtime/core/field-descriptor.d.ts.map +0 -1
  290. package/dist/runtime/core/field-descriptor.js.map +0 -1
  291. package/dist/runtime/core/introspection.d.ts.map +0 -1
  292. package/dist/runtime/core/introspection.js.map +0 -1
  293. package/dist/runtime/core/resolvers.d.ts.map +0 -1
  294. package/dist/runtime/core/resolvers.js.map +0 -1
  295. package/dist/runtime/core/signals.d.ts.map +0 -1
  296. package/dist/runtime/core/signals.js.map +0 -1
  297. package/dist/runtime/core/types.d.ts.map +0 -1
  298. package/dist/runtime/core/types.js.map +0 -1
  299. package/dist/runtime/core/values.d.ts.map +0 -1
  300. package/dist/runtime/core/values.js.map +0 -1
  301. package/dist/runtime/ext/builtins.d.ts.map +0 -1
  302. package/dist/runtime/ext/builtins.js.map +0 -1
  303. package/dist/runtime/ext/extensions.d.ts.map +0 -1
  304. package/dist/runtime/ext/extensions.js.map +0 -1
  305. package/dist/runtime/index.d.ts.map +0 -1
  306. package/dist/runtime/index.js.map +0 -1
  307. package/dist/signature-parser.d.ts.map +0 -1
  308. package/dist/signature-parser.js.map +0 -1
  309. package/dist/source-location.d.ts.map +0 -1
  310. package/dist/source-location.js.map +0 -1
  311. package/dist/token-types.d.ts.map +0 -1
  312. package/dist/token-types.js.map +0 -1
  313. package/dist/types.d.ts.map +0 -1
  314. package/dist/types.js.map +0 -1
  315. package/dist/value-types.d.ts.map +0 -1
  316. package/dist/value-types.js.map +0 -1
@@ -4,7 +4,7 @@
4
4
  * Provides key-value store operations with JSON persistence and schema validation.
5
5
  * Supports both open mode (any key/value) and declared mode (schema-defined keys only).
6
6
  */
7
- import type { ExtensionResult, ExtensionConfigSchema, ExtensionManifest } from '../../runtime/ext/extensions.js';
7
+ import type { ExtensionFactoryResult, ExtensionConfigSchema, ExtensionManifest } from '../../runtime/ext/extensions.js';
8
8
  import { type SchemaEntry } from './store.js';
9
9
  /** Configuration for a single KV mount */
10
10
  export interface KvMountConfig {
@@ -51,7 +51,7 @@ export declare const configSchema: ExtensionConfigSchema;
51
51
  * Returns 11 functions: get, get_or, set, merge, delete, keys, has, clear, getAll, schema, mounts.
52
52
  *
53
53
  * @param config - Store configuration (mount-based or single-store)
54
- * @returns ExtensionResult with 11 KV functions and dispose handler
54
+ * @returns ExtensionFactoryResult with 11 KV functions and dispose handler
55
55
  * @throws RuntimeError if store file is corrupt (EC-25)
56
56
  *
57
57
  * @example
@@ -78,6 +78,5 @@ export declare const configSchema: ExtensionConfigSchema;
78
78
  * });
79
79
  * ```
80
80
  */
81
- export declare function createKvExtension(config: KvConfig): ExtensionResult;
81
+ export declare function createKvExtension(config: KvConfig): ExtensionFactoryResult;
82
82
  export declare const extensionManifest: ExtensionManifest;
83
- //# sourceMappingURL=index.d.ts.map
@@ -5,6 +5,7 @@
5
5
  * Supports both open mode (any key/value) and declared mode (schema-defined keys only).
6
6
  */
7
7
  import { RuntimeError } from '../../error-classes.js';
8
+ import { toCallable } from '../../runtime/core/callable.js';
8
9
  import { isDict } from '../../runtime/core/callable.js';
9
10
  import { createStore } from './store.js';
10
11
  import { rillTypeToTypeValue, } from '../../runtime/core/values.js';
@@ -22,7 +23,7 @@ export const configSchema = {
22
23
  * Returns 11 functions: get, get_or, set, merge, delete, keys, has, clear, getAll, schema, mounts.
23
24
  *
24
25
  * @param config - Store configuration (mount-based or single-store)
25
- * @returns ExtensionResult with 11 KV functions and dispose handler
26
+ * @returns ExtensionFactoryResult with 11 KV functions and dispose handler
26
27
  * @throws RuntimeError if store file is corrupt (EC-25)
27
28
  *
28
29
  * @example
@@ -112,8 +113,8 @@ export function createKvExtension(config) {
112
113
  * Returns empty string for missing keys in open mode.
113
114
  */
114
115
  const get = async (args) => {
115
- const mountName = args[0];
116
- const key = args[1];
116
+ const mountName = args['mount'];
117
+ const key = args['key'];
117
118
  const store = await getStore(mountName);
118
119
  const value = store.get(key);
119
120
  // In rill, functions cannot return undefined - return empty string for missing keys in open mode
@@ -125,9 +126,9 @@ export function createKvExtension(config) {
125
126
  * Never throws for missing keys (unlike get in declared mode).
126
127
  */
127
128
  const get_or = async (args) => {
128
- const mountName = args[0];
129
- const key = args[1];
130
- const fallback = args[2];
129
+ const mountName = args['mount'];
130
+ const key = args['key'];
131
+ const fallback = args['fallback'];
131
132
  const store = await getStore(mountName);
132
133
  // Check if key exists using has() to avoid schema validation errors
133
134
  if (store.has(key)) {
@@ -141,9 +142,9 @@ export function createKvExtension(config) {
141
142
  * IR-16, EC-20-24
142
143
  */
143
144
  const set = async (args) => {
144
- const mountName = args[0];
145
- const key = args[1];
146
- const value = args[2];
145
+ const mountName = args['mount'];
146
+ const key = args['key'];
147
+ const value = args['value'];
147
148
  const store = await getStore(mountName);
148
149
  await store.set(key, value);
149
150
  return true;
@@ -153,9 +154,9 @@ export function createKvExtension(config) {
153
154
  * IR-4, EC-5, EC-6
154
155
  */
155
156
  const merge = async (args) => {
156
- const mountName = args[0];
157
- const key = args[1];
158
- const partial = args[2];
157
+ const mountName = args['mount'];
158
+ const key = args['key'];
159
+ const partial = args['partial'];
159
160
  const store = await getStore(mountName);
160
161
  // Get current value
161
162
  const currentValue = store.get(key);
@@ -177,8 +178,8 @@ export function createKvExtension(config) {
177
178
  * IR-17
178
179
  */
179
180
  const deleteKey = async (args) => {
180
- const mountName = args[0];
181
- const key = args[1];
181
+ const mountName = args['mount'];
182
+ const key = args['key'];
182
183
  const store = await getStore(mountName);
183
184
  return store.delete(key);
184
185
  };
@@ -187,7 +188,7 @@ export function createKvExtension(config) {
187
188
  * IR-6
188
189
  */
189
190
  const keys = async (args) => {
190
- const mountName = args[0];
191
+ const mountName = args['mount'];
191
192
  const store = await getStore(mountName);
192
193
  return store.keys();
193
194
  };
@@ -196,8 +197,8 @@ export function createKvExtension(config) {
196
197
  * IR-7
197
198
  */
198
199
  const has = async (args) => {
199
- const mountName = args[0];
200
- const key = args[1];
200
+ const mountName = args['mount'];
201
+ const key = args['key'];
201
202
  const store = await getStore(mountName);
202
203
  return store.has(key);
203
204
  };
@@ -206,7 +207,7 @@ export function createKvExtension(config) {
206
207
  * IR-8
207
208
  */
208
209
  const clear = async (args) => {
209
- const mountName = args[0];
210
+ const mountName = args['mount'];
210
211
  const store = await getStore(mountName);
211
212
  store.clear();
212
213
  return true;
@@ -216,7 +217,7 @@ export function createKvExtension(config) {
216
217
  * IR-9
217
218
  */
218
219
  const getAll = async (args) => {
219
- const mountName = args[0];
220
+ const mountName = args['mount'];
220
221
  const store = await getStore(mountName);
221
222
  return store.getAll();
222
223
  };
@@ -225,7 +226,7 @@ export function createKvExtension(config) {
225
226
  * IR-10
226
227
  */
227
228
  const schema = async (args) => {
228
- const mountName = args[0];
229
+ const mountName = args['mount'];
229
230
  const mountConfig = mounts[mountName];
230
231
  if (!mountConfig) {
231
232
  throw new RuntimeError('RILL-R004', `Mount '${mountName}' not found`, undefined, { mountName, availableMounts: Object.keys(mounts) });
@@ -279,204 +280,205 @@ export function createKvExtension(config) {
279
280
  // ============================================================
280
281
  // EXTENSION RESULT
281
282
  // ============================================================
282
- const result = {
283
- get: {
284
- params: [
285
- {
286
- name: 'mount',
287
- type: { type: 'string' },
288
- defaultValue: undefined,
289
- annotations: { description: 'Mount name' },
283
+ return {
284
+ value: {
285
+ get: toCallable({
286
+ params: [
287
+ {
288
+ name: 'mount',
289
+ type: { kind: 'string' },
290
+ defaultValue: undefined,
291
+ annotations: { description: 'Mount name' },
292
+ },
293
+ {
294
+ name: 'key',
295
+ type: { kind: 'string' },
296
+ defaultValue: undefined,
297
+ annotations: { description: 'Key to retrieve' },
298
+ },
299
+ ],
300
+ fn: get,
301
+ annotations: { description: 'Get value or schema default' },
302
+ returnType: rillTypeToTypeValue({ kind: 'any' }),
303
+ }),
304
+ get_or: toCallable({
305
+ params: [
306
+ {
307
+ name: 'mount',
308
+ type: { kind: 'string' },
309
+ defaultValue: undefined,
310
+ annotations: { description: 'Mount name' },
311
+ },
312
+ {
313
+ name: 'key',
314
+ type: { kind: 'string' },
315
+ defaultValue: undefined,
316
+ annotations: { description: 'Key to retrieve' },
317
+ },
318
+ {
319
+ name: 'fallback',
320
+ type: { kind: 'any' },
321
+ defaultValue: undefined,
322
+ annotations: { description: 'Fallback value if key missing' },
323
+ },
324
+ ],
325
+ fn: get_or,
326
+ annotations: {
327
+ description: 'Get value or return fallback if key missing',
290
328
  },
291
- {
292
- name: 'key',
293
- type: { type: 'string' },
294
- defaultValue: undefined,
295
- annotations: { description: 'Key to retrieve' },
329
+ returnType: rillTypeToTypeValue({ kind: 'any' }),
330
+ }),
331
+ set: toCallable({
332
+ params: [
333
+ {
334
+ name: 'mount',
335
+ type: { kind: 'string' },
336
+ defaultValue: undefined,
337
+ annotations: { description: 'Mount name' },
338
+ },
339
+ {
340
+ name: 'key',
341
+ type: { kind: 'string' },
342
+ defaultValue: undefined,
343
+ annotations: { description: 'Key to set' },
344
+ },
345
+ {
346
+ name: 'value',
347
+ type: { kind: 'any' },
348
+ defaultValue: undefined,
349
+ annotations: { description: 'Value to store' },
350
+ },
351
+ ],
352
+ fn: set,
353
+ annotations: { description: 'Set value with validation' },
354
+ returnType: rillTypeToTypeValue({ kind: 'bool' }),
355
+ }),
356
+ merge: toCallable({
357
+ params: [
358
+ {
359
+ name: 'mount',
360
+ type: { kind: 'string' },
361
+ defaultValue: undefined,
362
+ annotations: { description: 'Mount name' },
363
+ },
364
+ {
365
+ name: 'key',
366
+ type: { kind: 'string' },
367
+ defaultValue: undefined,
368
+ annotations: { description: 'Key to merge into' },
369
+ },
370
+ {
371
+ name: 'partial',
372
+ type: { kind: 'dict' },
373
+ defaultValue: undefined,
374
+ annotations: { description: 'Partial dict to merge' },
375
+ },
376
+ ],
377
+ fn: merge,
378
+ annotations: {
379
+ description: 'Merge partial dict into existing dict value',
296
380
  },
297
- ],
298
- fn: get,
299
- annotations: { description: 'Get value or schema default' },
300
- returnType: rillTypeToTypeValue({ type: 'any' }),
301
- },
302
- get_or: {
303
- params: [
304
- {
305
- name: 'mount',
306
- type: { type: 'string' },
307
- defaultValue: undefined,
308
- annotations: { description: 'Mount name' },
309
- },
310
- {
311
- name: 'key',
312
- type: { type: 'string' },
313
- defaultValue: undefined,
314
- annotations: { description: 'Key to retrieve' },
315
- },
316
- {
317
- name: 'fallback',
318
- type: { type: 'any' },
319
- defaultValue: undefined,
320
- annotations: { description: 'Fallback value if key missing' },
321
- },
322
- ],
323
- fn: get_or,
324
- annotations: {
325
- description: 'Get value or return fallback if key missing',
326
- },
327
- returnType: rillTypeToTypeValue({ type: 'any' }),
328
- },
329
- set: {
330
- params: [
331
- {
332
- name: 'mount',
333
- type: { type: 'string' },
334
- defaultValue: undefined,
335
- annotations: { description: 'Mount name' },
336
- },
337
- {
338
- name: 'key',
339
- type: { type: 'string' },
340
- defaultValue: undefined,
341
- annotations: { description: 'Key to set' },
342
- },
343
- {
344
- name: 'value',
345
- type: { type: 'any' },
346
- defaultValue: undefined,
347
- annotations: { description: 'Value to store' },
348
- },
349
- ],
350
- fn: set,
351
- annotations: { description: 'Set value with validation' },
352
- returnType: rillTypeToTypeValue({ type: 'bool' }),
353
- },
354
- merge: {
355
- params: [
356
- {
357
- name: 'mount',
358
- type: { type: 'string' },
359
- defaultValue: undefined,
360
- annotations: { description: 'Mount name' },
361
- },
362
- {
363
- name: 'key',
364
- type: { type: 'string' },
365
- defaultValue: undefined,
366
- annotations: { description: 'Key to merge into' },
367
- },
368
- {
369
- name: 'partial',
370
- type: { type: 'dict' },
371
- defaultValue: undefined,
372
- annotations: { description: 'Partial dict to merge' },
373
- },
374
- ],
375
- fn: merge,
376
- annotations: {
377
- description: 'Merge partial dict into existing dict value',
378
- },
379
- returnType: rillTypeToTypeValue({ type: 'bool' }),
380
- },
381
- delete: {
382
- params: [
383
- {
384
- name: 'mount',
385
- type: { type: 'string' },
386
- defaultValue: undefined,
387
- annotations: { description: 'Mount name' },
388
- },
389
- {
390
- name: 'key',
391
- type: { type: 'string' },
392
- defaultValue: undefined,
393
- annotations: { description: 'Key to delete' },
394
- },
395
- ],
396
- fn: deleteKey,
397
- annotations: { description: 'Delete key' },
398
- returnType: rillTypeToTypeValue({ type: 'bool' }),
399
- },
400
- keys: {
401
- params: [
402
- {
403
- name: 'mount',
404
- type: { type: 'string' },
405
- defaultValue: undefined,
406
- annotations: { description: 'Mount name' },
407
- },
408
- ],
409
- fn: keys,
410
- annotations: { description: 'Get all keys in mount' },
411
- returnType: rillTypeToTypeValue({ type: 'list' }),
412
- },
413
- has: {
414
- params: [
415
- {
416
- name: 'mount',
417
- type: { type: 'string' },
418
- defaultValue: undefined,
419
- annotations: { description: 'Mount name' },
420
- },
421
- {
422
- name: 'key',
423
- type: { type: 'string' },
424
- defaultValue: undefined,
425
- annotations: { description: 'Key to check' },
426
- },
427
- ],
428
- fn: has,
429
- annotations: { description: 'Check key existence' },
430
- returnType: rillTypeToTypeValue({ type: 'bool' }),
431
- },
432
- clear: {
433
- params: [
434
- {
435
- name: 'mount',
436
- type: { type: 'string' },
437
- defaultValue: undefined,
438
- annotations: { description: 'Mount name' },
439
- },
440
- ],
441
- fn: clear,
442
- annotations: { description: 'Clear all keys in mount' },
443
- returnType: rillTypeToTypeValue({ type: 'bool' }),
444
- },
445
- getAll: {
446
- params: [
447
- {
448
- name: 'mount',
449
- type: { type: 'string' },
450
- defaultValue: undefined,
451
- annotations: { description: 'Mount name' },
452
- },
453
- ],
454
- fn: getAll,
455
- annotations: { description: 'Get all entries as dict' },
456
- returnType: rillTypeToTypeValue({ type: 'dict' }),
457
- },
458
- schema: {
459
- params: [
460
- {
461
- name: 'mount',
462
- type: { type: 'string' },
463
- defaultValue: undefined,
464
- annotations: { description: 'Mount name' },
465
- },
466
- ],
467
- fn: schema,
468
- annotations: { description: 'Get schema information' },
469
- returnType: rillTypeToTypeValue({ type: 'list' }),
470
- },
471
- mounts: {
472
- params: [],
473
- fn: mountsList,
474
- annotations: { description: 'Get list of mount metadata' },
475
- returnType: rillTypeToTypeValue({ type: 'list' }),
381
+ returnType: rillTypeToTypeValue({ kind: 'bool' }),
382
+ }),
383
+ delete: toCallable({
384
+ params: [
385
+ {
386
+ name: 'mount',
387
+ type: { kind: 'string' },
388
+ defaultValue: undefined,
389
+ annotations: { description: 'Mount name' },
390
+ },
391
+ {
392
+ name: 'key',
393
+ type: { kind: 'string' },
394
+ defaultValue: undefined,
395
+ annotations: { description: 'Key to delete' },
396
+ },
397
+ ],
398
+ fn: deleteKey,
399
+ annotations: { description: 'Delete key' },
400
+ returnType: rillTypeToTypeValue({ kind: 'bool' }),
401
+ }),
402
+ keys: toCallable({
403
+ params: [
404
+ {
405
+ name: 'mount',
406
+ type: { kind: 'string' },
407
+ defaultValue: undefined,
408
+ annotations: { description: 'Mount name' },
409
+ },
410
+ ],
411
+ fn: keys,
412
+ annotations: { description: 'Get all keys in mount' },
413
+ returnType: rillTypeToTypeValue({ kind: 'list' }),
414
+ }),
415
+ has: toCallable({
416
+ params: [
417
+ {
418
+ name: 'mount',
419
+ type: { kind: 'string' },
420
+ defaultValue: undefined,
421
+ annotations: { description: 'Mount name' },
422
+ },
423
+ {
424
+ name: 'key',
425
+ type: { kind: 'string' },
426
+ defaultValue: undefined,
427
+ annotations: { description: 'Key to check' },
428
+ },
429
+ ],
430
+ fn: has,
431
+ annotations: { description: 'Check key existence' },
432
+ returnType: rillTypeToTypeValue({ kind: 'bool' }),
433
+ }),
434
+ clear: toCallable({
435
+ params: [
436
+ {
437
+ name: 'mount',
438
+ type: { kind: 'string' },
439
+ defaultValue: undefined,
440
+ annotations: { description: 'Mount name' },
441
+ },
442
+ ],
443
+ fn: clear,
444
+ annotations: { description: 'Clear all keys in mount' },
445
+ returnType: rillTypeToTypeValue({ kind: 'bool' }),
446
+ }),
447
+ getAll: toCallable({
448
+ params: [
449
+ {
450
+ name: 'mount',
451
+ type: { kind: 'string' },
452
+ defaultValue: undefined,
453
+ annotations: { description: 'Mount name' },
454
+ },
455
+ ],
456
+ fn: getAll,
457
+ annotations: { description: 'Get all entries as dict' },
458
+ returnType: rillTypeToTypeValue({ kind: 'dict' }),
459
+ }),
460
+ schema: toCallable({
461
+ params: [
462
+ {
463
+ name: 'mount',
464
+ type: { kind: 'string' },
465
+ defaultValue: undefined,
466
+ annotations: { description: 'Mount name' },
467
+ },
468
+ ],
469
+ fn: schema,
470
+ annotations: { description: 'Get schema information' },
471
+ returnType: rillTypeToTypeValue({ kind: 'list' }),
472
+ }),
473
+ mounts: toCallable({
474
+ params: [],
475
+ fn: mountsList,
476
+ annotations: { description: 'Get list of mount metadata' },
477
+ returnType: rillTypeToTypeValue({ kind: 'list' }),
478
+ }),
476
479
  },
480
+ dispose,
477
481
  };
478
- result.dispose = dispose;
479
- return result;
480
482
  }
481
483
  // ============================================================
482
484
  // MANIFEST
@@ -485,4 +487,3 @@ export const extensionManifest = {
485
487
  factory: createKvExtension,
486
488
  configSchema,
487
489
  };
488
- //# sourceMappingURL=index.js.map
@@ -47,4 +47,3 @@ export declare function createStore(config: StoreConfig): Promise<{
47
47
  getAll: () => Record<string, RillValue>;
48
48
  flush: () => Promise<void>;
49
49
  }>;
50
- //# sourceMappingURL=store.d.ts.map
@@ -7,6 +7,7 @@
7
7
  import fs from 'node:fs/promises';
8
8
  import path from 'node:path';
9
9
  import { RuntimeError } from '../../error-classes.js';
10
+ import { deserializeValue } from '../../runtime/core/type-registrations.js';
10
11
  // ============================================================
11
12
  // STORE IMPLEMENTATION
12
13
  // ============================================================
@@ -52,7 +53,7 @@ export async function createStore(config) {
52
53
  // Load declared keys with defaults, validate existing values
53
54
  for (const [key, schemaEntry] of Object.entries(schema)) {
54
55
  if (key in parsed) {
55
- const value = parsed[key];
56
+ const value = deserializeValue(parsed[key], schemaEntry.type);
56
57
  validateType(key, value, schemaEntry.type, storePath);
57
58
  data.set(key, value);
58
59
  }
@@ -267,4 +268,3 @@ export async function createStore(config) {
267
268
  flush,
268
269
  };
269
270
  }
270
- //# sourceMappingURL=store.js.map
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Bridge for runtime/ext modules that need parse().
3
+ *
4
+ * Import boundary note (§NOD.2.1):
5
+ * - This file lives at src/ level (not in runtime/), so it may import
6
+ * from the parser barrel.
7
+ * - runtime/ext/test-context.ts imports from this file
8
+ * (../../ext-parse-bridge.js), which is NOT in parser/* — boundary preserved.
9
+ */
10
+ export { parse as parseSource } from './parser/index.js';
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Bridge for runtime/ext modules that need parse().
3
+ *
4
+ * Import boundary note (§NOD.2.1):
5
+ * - This file lives at src/ level (not in runtime/), so it may import
6
+ * from the parser barrel.
7
+ * - runtime/ext/test-context.ts imports from this file
8
+ * (../../ext-parse-bridge.js), which is NOT in parser/* — boundary preserved.
9
+ */
10
+ export { parse as parseSource } from './parser/index.js';