@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
@@ -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 { toCallable } from '../../runtime/core/callable.js';
10
11
  import { rillTypeToTypeValue, } from '../../runtime/core/values.js';
11
12
  import { resolvePath, matchesGlob, initializeMount, } from './sandbox.js';
12
13
  export const configSchema = {
@@ -22,7 +23,7 @@ export const configSchema = {
22
23
  * Returns 12 functions: read, write, append, list, find, exists, remove, stat, mkdir, copy, move, mounts.
23
24
  *
24
25
  * @param config - Mount configuration and defaults
25
- * @returns ExtensionResult with 12 filesystem functions
26
+ * @returns ExtensionFactoryResult with 12 filesystem functions
26
27
  * @throws RuntimeError if mount initialization fails
27
28
  *
28
29
  * @example
@@ -75,8 +76,8 @@ export function createFsExtension(config) {
75
76
  // ctx and location not used but required by CallableFn signature
76
77
  ) => {
77
78
  await ensureInitialized();
78
- const mountName = args[0];
79
- const filePath = args[1];
79
+ const mountName = args['mount'];
80
+ const filePath = args['path'];
80
81
  // EC-5: Catch file not found from resolvePath
81
82
  let resolvedPath;
82
83
  try {
@@ -101,9 +102,9 @@ export function createFsExtension(config) {
101
102
  */
102
103
  const write = async (args) => {
103
104
  await ensureInitialized();
104
- const mountName = args[0];
105
- const filePath = args[1];
106
- const content = args[2];
105
+ const mountName = args['mount'];
106
+ const filePath = args['path'];
107
+ const content = args['content'];
107
108
  const resolvedPath = await resolvePath(mountName, filePath, mounts, 'write', true // createMode: resolve parent directory
108
109
  );
109
110
  // Check content size before writing
@@ -120,9 +121,9 @@ export function createFsExtension(config) {
120
121
  */
121
122
  const append = async (args) => {
122
123
  await ensureInitialized();
123
- const mountName = args[0];
124
- const filePath = args[1];
125
- const content = args[2];
124
+ const mountName = args['mount'];
125
+ const filePath = args['path'];
126
+ const content = args['content'];
126
127
  const resolvedPath = await resolvePath(mountName, filePath, mounts, 'write', true // createMode: allow new files
127
128
  );
128
129
  // Check content size before appending
@@ -157,8 +158,8 @@ export function createFsExtension(config) {
157
158
  */
158
159
  const list = async (args) => {
159
160
  await ensureInitialized();
160
- const mountName = args[0];
161
- const dirPath = args[1] ?? '';
161
+ const mountName = args['mount'];
162
+ const dirPath = args['path'] ?? '';
162
163
  const resolvedPath = await resolvePath(mountName, dirPath, mounts, 'read');
163
164
  const entries = await fs.readdir(resolvedPath, { withFileTypes: true });
164
165
  const result = [];
@@ -179,8 +180,8 @@ export function createFsExtension(config) {
179
180
  */
180
181
  const find = async (args) => {
181
182
  await ensureInitialized();
182
- const mountName = args[0];
183
- const pattern = args[1] ?? '*';
183
+ const mountName = args['mount'];
184
+ const pattern = args['pattern'] ?? '*';
184
185
  const mount = mounts[mountName];
185
186
  if (!mount || !mount.resolvedPath) {
186
187
  throw new RuntimeError('RILL-R004', `mount "${mountName}" not configured`, undefined, { mountName });
@@ -211,8 +212,8 @@ export function createFsExtension(config) {
211
212
  */
212
213
  const exists = async (args) => {
213
214
  await ensureInitialized();
214
- const mountName = args[0];
215
- const filePath = args[1];
215
+ const mountName = args['mount'];
216
+ const filePath = args['path'];
216
217
  try {
217
218
  await resolvePath(mountName, filePath, mounts, 'read');
218
219
  return true;
@@ -231,8 +232,8 @@ export function createFsExtension(config) {
231
232
  */
232
233
  const remove = async (args) => {
233
234
  await ensureInitialized();
234
- const mountName = args[0];
235
- const filePath = args[1];
235
+ const mountName = args['mount'];
236
+ const filePath = args['path'];
236
237
  // Catch file not found from resolvePath
237
238
  let resolvedPath;
238
239
  try {
@@ -264,8 +265,8 @@ export function createFsExtension(config) {
264
265
  */
265
266
  const stat = async (args) => {
266
267
  await ensureInitialized();
267
- const mountName = args[0];
268
- const filePath = args[1];
268
+ const mountName = args['mount'];
269
+ const filePath = args['path'];
269
270
  // Catch file not found from resolvePath
270
271
  let resolvedPath;
271
272
  try {
@@ -294,8 +295,8 @@ export function createFsExtension(config) {
294
295
  */
295
296
  const mkdir = async (args) => {
296
297
  await ensureInitialized();
297
- const mountName = args[0];
298
- const dirPath = args[1];
298
+ const mountName = args['mount'];
299
+ const dirPath = args['path'];
299
300
  const mount = mounts[mountName];
300
301
  if (!mount || !mount.resolvedPath) {
301
302
  throw new RuntimeError('RILL-R004', `mount "${mountName}" not configured`, undefined, { mountName });
@@ -344,9 +345,9 @@ export function createFsExtension(config) {
344
345
  */
345
346
  const copy = async (args) => {
346
347
  await ensureInitialized();
347
- const mountName = args[0];
348
- const srcPath = args[1];
349
- const destPath = args[2];
348
+ const mountName = args['mount'];
349
+ const srcPath = args['src'];
350
+ const destPath = args['dest'];
350
351
  const resolvedSrc = await resolvePath(mountName, srcPath, mounts, 'read');
351
352
  const resolvedDest = await resolvePath(mountName, destPath, mounts, 'write', true // createMode
352
353
  );
@@ -373,9 +374,9 @@ export function createFsExtension(config) {
373
374
  */
374
375
  const move = async (args) => {
375
376
  await ensureInitialized();
376
- const mountName = args[0];
377
- const srcPath = args[1];
378
- const destPath = args[2];
377
+ const mountName = args['mount'];
378
+ const srcPath = args['src'];
379
+ const destPath = args['dest'];
379
380
  const resolvedSrc = await resolvePath(mountName, srcPath, mounts, 'read');
380
381
  const resolvedDest = await resolvePath(mountName, destPath, mounts, 'write', true // createMode
381
382
  );
@@ -412,244 +413,246 @@ export function createFsExtension(config) {
412
413
  // EXTENSION RESULT
413
414
  // ============================================================
414
415
  return {
415
- read: {
416
- params: [
417
- {
418
- name: 'mount',
419
- type: { type: 'string' },
420
- defaultValue: undefined,
421
- annotations: { description: 'Mount name' },
422
- },
423
- {
424
- name: 'path',
425
- type: { type: 'string' },
426
- defaultValue: undefined,
427
- annotations: { description: 'File path relative to mount' },
428
- },
429
- ],
430
- fn: read,
431
- annotations: { description: 'Read file contents' },
432
- returnType: rillTypeToTypeValue({ type: 'string' }),
433
- },
434
- write: {
435
- params: [
436
- {
437
- name: 'mount',
438
- type: { type: 'string' },
439
- defaultValue: undefined,
440
- annotations: { description: 'Mount name' },
441
- },
442
- {
443
- name: 'path',
444
- type: { type: 'string' },
445
- defaultValue: undefined,
446
- annotations: { description: 'File path relative to mount' },
447
- },
448
- {
449
- name: 'content',
450
- type: { type: 'string' },
451
- defaultValue: undefined,
452
- annotations: { description: 'Content to write' },
453
- },
454
- ],
455
- fn: write,
456
- annotations: { description: 'Write file, replacing if exists' },
457
- returnType: rillTypeToTypeValue({ type: 'string' }),
458
- },
459
- append: {
460
- params: [
461
- {
462
- name: 'mount',
463
- type: { type: 'string' },
464
- defaultValue: undefined,
465
- annotations: { description: 'Mount name' },
466
- },
467
- {
468
- name: 'path',
469
- type: { type: 'string' },
470
- defaultValue: undefined,
471
- annotations: { description: 'File path relative to mount' },
472
- },
473
- {
474
- name: 'content',
475
- type: { type: 'string' },
476
- defaultValue: undefined,
477
- annotations: { description: 'Content to append' },
478
- },
479
- ],
480
- fn: append,
481
- annotations: { description: 'Append content to file' },
482
- returnType: rillTypeToTypeValue({ type: 'string' }),
483
- },
484
- list: {
485
- params: [
486
- {
487
- name: 'mount',
488
- type: { type: 'string' },
489
- defaultValue: undefined,
490
- annotations: { description: 'Mount name' },
491
- },
492
- {
493
- name: 'path',
494
- type: { type: 'string' },
495
- defaultValue: '',
496
- annotations: { description: 'Directory path relative to mount' },
497
- },
498
- ],
499
- fn: list,
500
- annotations: { description: 'List directory contents' },
501
- returnType: rillTypeToTypeValue({ type: 'list' }),
502
- },
503
- find: {
504
- params: [
505
- {
506
- name: 'mount',
507
- type: { type: 'string' },
508
- defaultValue: undefined,
509
- annotations: { description: 'Mount name' },
510
- },
511
- {
512
- name: 'pattern',
513
- type: { type: 'string' },
514
- defaultValue: '*',
515
- annotations: { description: 'Glob pattern for filtering' },
516
- },
517
- ],
518
- fn: find,
519
- annotations: { description: 'Recursive file search' },
520
- returnType: rillTypeToTypeValue({ type: 'list' }),
521
- },
522
- exists: {
523
- params: [
524
- {
525
- name: 'mount',
526
- type: { type: 'string' },
527
- defaultValue: undefined,
528
- annotations: { description: 'Mount name' },
529
- },
530
- {
531
- name: 'path',
532
- type: { type: 'string' },
533
- defaultValue: undefined,
534
- annotations: { description: 'File path relative to mount' },
535
- },
536
- ],
537
- fn: exists,
538
- annotations: { description: 'Check file existence' },
539
- returnType: rillTypeToTypeValue({ type: 'bool' }),
540
- },
541
- remove: {
542
- params: [
543
- {
544
- name: 'mount',
545
- type: { type: 'string' },
546
- defaultValue: undefined,
547
- annotations: { description: 'Mount name' },
548
- },
549
- {
550
- name: 'path',
551
- type: { type: 'string' },
552
- defaultValue: undefined,
553
- annotations: { description: 'File path relative to mount' },
554
- },
555
- ],
556
- fn: remove,
557
- annotations: { description: 'Delete file' },
558
- returnType: rillTypeToTypeValue({ type: 'bool' }),
559
- },
560
- stat: {
561
- params: [
562
- {
563
- name: 'mount',
564
- type: { type: 'string' },
565
- defaultValue: undefined,
566
- annotations: { description: 'Mount name' },
567
- },
568
- {
569
- name: 'path',
570
- type: { type: 'string' },
571
- defaultValue: undefined,
572
- annotations: { description: 'File path relative to mount' },
573
- },
574
- ],
575
- fn: stat,
576
- annotations: { description: 'Get file metadata' },
577
- returnType: rillTypeToTypeValue({ type: 'dict' }),
578
- },
579
- mkdir: {
580
- params: [
581
- {
582
- name: 'mount',
583
- type: { type: 'string' },
584
- defaultValue: undefined,
585
- annotations: { description: 'Mount name' },
586
- },
587
- {
588
- name: 'path',
589
- type: { type: 'string' },
590
- defaultValue: undefined,
591
- annotations: { description: 'Directory path relative to mount' },
592
- },
593
- ],
594
- fn: mkdir,
595
- annotations: { description: 'Create directory' },
596
- returnType: rillTypeToTypeValue({ type: 'bool' }),
597
- },
598
- copy: {
599
- params: [
600
- {
601
- name: 'mount',
602
- type: { type: 'string' },
603
- defaultValue: undefined,
604
- annotations: { description: 'Mount name' },
605
- },
606
- {
607
- name: 'src',
608
- type: { type: 'string' },
609
- defaultValue: undefined,
610
- annotations: { description: 'Source file path' },
611
- },
612
- {
613
- name: 'dest',
614
- type: { type: 'string' },
615
- defaultValue: undefined,
616
- annotations: { description: 'Destination file path' },
617
- },
618
- ],
619
- fn: copy,
620
- annotations: { description: 'Copy file within mount' },
621
- returnType: rillTypeToTypeValue({ type: 'bool' }),
622
- },
623
- move: {
624
- params: [
625
- {
626
- name: 'mount',
627
- type: { type: 'string' },
628
- defaultValue: undefined,
629
- annotations: { description: 'Mount name' },
630
- },
631
- {
632
- name: 'src',
633
- type: { type: 'string' },
634
- defaultValue: undefined,
635
- annotations: { description: 'Source file path' },
636
- },
637
- {
638
- name: 'dest',
639
- type: { type: 'string' },
640
- defaultValue: undefined,
641
- annotations: { description: 'Destination file path' },
642
- },
643
- ],
644
- fn: move,
645
- annotations: { description: 'Move file within mount' },
646
- returnType: rillTypeToTypeValue({ type: 'bool' }),
647
- },
648
- mounts: {
649
- params: [],
650
- fn: mountsList,
651
- annotations: { description: 'List configured mounts' },
652
- returnType: rillTypeToTypeValue({ type: 'list' }),
416
+ value: {
417
+ read: toCallable({
418
+ params: [
419
+ {
420
+ name: 'mount',
421
+ type: { kind: 'string' },
422
+ defaultValue: undefined,
423
+ annotations: { description: 'Mount name' },
424
+ },
425
+ {
426
+ name: 'path',
427
+ type: { kind: 'string' },
428
+ defaultValue: undefined,
429
+ annotations: { description: 'File path relative to mount' },
430
+ },
431
+ ],
432
+ fn: read,
433
+ annotations: { description: 'Read file contents' },
434
+ returnType: rillTypeToTypeValue({ kind: 'string' }),
435
+ }),
436
+ write: toCallable({
437
+ params: [
438
+ {
439
+ name: 'mount',
440
+ type: { kind: 'string' },
441
+ defaultValue: undefined,
442
+ annotations: { description: 'Mount name' },
443
+ },
444
+ {
445
+ name: 'path',
446
+ type: { kind: 'string' },
447
+ defaultValue: undefined,
448
+ annotations: { description: 'File path relative to mount' },
449
+ },
450
+ {
451
+ name: 'content',
452
+ type: { kind: 'string' },
453
+ defaultValue: undefined,
454
+ annotations: { description: 'Content to write' },
455
+ },
456
+ ],
457
+ fn: write,
458
+ annotations: { description: 'Write file, replacing if exists' },
459
+ returnType: rillTypeToTypeValue({ kind: 'string' }),
460
+ }),
461
+ append: toCallable({
462
+ params: [
463
+ {
464
+ name: 'mount',
465
+ type: { kind: 'string' },
466
+ defaultValue: undefined,
467
+ annotations: { description: 'Mount name' },
468
+ },
469
+ {
470
+ name: 'path',
471
+ type: { kind: 'string' },
472
+ defaultValue: undefined,
473
+ annotations: { description: 'File path relative to mount' },
474
+ },
475
+ {
476
+ name: 'content',
477
+ type: { kind: 'string' },
478
+ defaultValue: undefined,
479
+ annotations: { description: 'Content to append' },
480
+ },
481
+ ],
482
+ fn: append,
483
+ annotations: { description: 'Append content to file' },
484
+ returnType: rillTypeToTypeValue({ kind: 'string' }),
485
+ }),
486
+ list: toCallable({
487
+ params: [
488
+ {
489
+ name: 'mount',
490
+ type: { kind: 'string' },
491
+ defaultValue: undefined,
492
+ annotations: { description: 'Mount name' },
493
+ },
494
+ {
495
+ name: 'path',
496
+ type: { kind: 'string' },
497
+ defaultValue: '',
498
+ annotations: { description: 'Directory path relative to mount' },
499
+ },
500
+ ],
501
+ fn: list,
502
+ annotations: { description: 'List directory contents' },
503
+ returnType: rillTypeToTypeValue({ kind: 'list' }),
504
+ }),
505
+ find: toCallable({
506
+ params: [
507
+ {
508
+ name: 'mount',
509
+ type: { kind: 'string' },
510
+ defaultValue: undefined,
511
+ annotations: { description: 'Mount name' },
512
+ },
513
+ {
514
+ name: 'pattern',
515
+ type: { kind: 'string' },
516
+ defaultValue: '*',
517
+ annotations: { description: 'Glob pattern for filtering' },
518
+ },
519
+ ],
520
+ fn: find,
521
+ annotations: { description: 'Recursive file search' },
522
+ returnType: rillTypeToTypeValue({ kind: 'list' }),
523
+ }),
524
+ exists: toCallable({
525
+ params: [
526
+ {
527
+ name: 'mount',
528
+ type: { kind: 'string' },
529
+ defaultValue: undefined,
530
+ annotations: { description: 'Mount name' },
531
+ },
532
+ {
533
+ name: 'path',
534
+ type: { kind: 'string' },
535
+ defaultValue: undefined,
536
+ annotations: { description: 'File path relative to mount' },
537
+ },
538
+ ],
539
+ fn: exists,
540
+ annotations: { description: 'Check file existence' },
541
+ returnType: rillTypeToTypeValue({ kind: 'bool' }),
542
+ }),
543
+ remove: toCallable({
544
+ params: [
545
+ {
546
+ name: 'mount',
547
+ type: { kind: 'string' },
548
+ defaultValue: undefined,
549
+ annotations: { description: 'Mount name' },
550
+ },
551
+ {
552
+ name: 'path',
553
+ type: { kind: 'string' },
554
+ defaultValue: undefined,
555
+ annotations: { description: 'File path relative to mount' },
556
+ },
557
+ ],
558
+ fn: remove,
559
+ annotations: { description: 'Delete file' },
560
+ returnType: rillTypeToTypeValue({ kind: 'bool' }),
561
+ }),
562
+ stat: toCallable({
563
+ params: [
564
+ {
565
+ name: 'mount',
566
+ type: { kind: 'string' },
567
+ defaultValue: undefined,
568
+ annotations: { description: 'Mount name' },
569
+ },
570
+ {
571
+ name: 'path',
572
+ type: { kind: 'string' },
573
+ defaultValue: undefined,
574
+ annotations: { description: 'File path relative to mount' },
575
+ },
576
+ ],
577
+ fn: stat,
578
+ annotations: { description: 'Get file metadata' },
579
+ returnType: rillTypeToTypeValue({ kind: 'dict' }),
580
+ }),
581
+ mkdir: toCallable({
582
+ params: [
583
+ {
584
+ name: 'mount',
585
+ type: { kind: 'string' },
586
+ defaultValue: undefined,
587
+ annotations: { description: 'Mount name' },
588
+ },
589
+ {
590
+ name: 'path',
591
+ type: { kind: 'string' },
592
+ defaultValue: undefined,
593
+ annotations: { description: 'Directory path relative to mount' },
594
+ },
595
+ ],
596
+ fn: mkdir,
597
+ annotations: { description: 'Create directory' },
598
+ returnType: rillTypeToTypeValue({ kind: 'bool' }),
599
+ }),
600
+ copy: toCallable({
601
+ params: [
602
+ {
603
+ name: 'mount',
604
+ type: { kind: 'string' },
605
+ defaultValue: undefined,
606
+ annotations: { description: 'Mount name' },
607
+ },
608
+ {
609
+ name: 'src',
610
+ type: { kind: 'string' },
611
+ defaultValue: undefined,
612
+ annotations: { description: 'Source file path' },
613
+ },
614
+ {
615
+ name: 'dest',
616
+ type: { kind: 'string' },
617
+ defaultValue: undefined,
618
+ annotations: { description: 'Destination file path' },
619
+ },
620
+ ],
621
+ fn: copy,
622
+ annotations: { description: 'Copy file within mount' },
623
+ returnType: rillTypeToTypeValue({ kind: 'bool' }),
624
+ }),
625
+ move: toCallable({
626
+ params: [
627
+ {
628
+ name: 'mount',
629
+ type: { kind: 'string' },
630
+ defaultValue: undefined,
631
+ annotations: { description: 'Mount name' },
632
+ },
633
+ {
634
+ name: 'src',
635
+ type: { kind: 'string' },
636
+ defaultValue: undefined,
637
+ annotations: { description: 'Source file path' },
638
+ },
639
+ {
640
+ name: 'dest',
641
+ type: { kind: 'string' },
642
+ defaultValue: undefined,
643
+ annotations: { description: 'Destination file path' },
644
+ },
645
+ ],
646
+ fn: move,
647
+ annotations: { description: 'Move file within mount' },
648
+ returnType: rillTypeToTypeValue({ kind: 'bool' }),
649
+ }),
650
+ mounts: toCallable({
651
+ params: [],
652
+ fn: mountsList,
653
+ annotations: { description: 'List configured mounts' },
654
+ returnType: rillTypeToTypeValue({ kind: 'list' }),
655
+ }),
653
656
  },
654
657
  };
655
658
  }
@@ -660,4 +663,3 @@ export const extensionManifest = {
660
663
  factory: createFsExtension,
661
664
  configSchema,
662
665
  };
663
- //# sourceMappingURL=index.js.map
@@ -75,4 +75,3 @@ export declare function checkMode(mode: 'read' | 'write' | 'read-write', operati
75
75
  * @throws RuntimeError - If mount path invalid or inaccessible
76
76
  */
77
77
  export declare function initializeMount(mount: MountConfig): Promise<void>;
78
- //# sourceMappingURL=sandbox.d.ts.map
@@ -205,4 +205,3 @@ export async function initializeMount(mount) {
205
205
  throw error;
206
206
  }
207
207
  }
208
- //# sourceMappingURL=sandbox.js.map