@opencode/codemode 2.0.1 → 2.0.2

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 (61) hide show
  1. package/dist/data.d.ts +6 -5
  2. package/dist/data.js +44 -46
  3. package/dist/index.d.ts +0 -1
  4. package/dist/index.js +0 -1
  5. package/dist/interpreter/errors.d.ts +3 -4
  6. package/dist/interpreter/errors.js +40 -17
  7. package/dist/interpreter/execute.js +5 -3
  8. package/dist/interpreter/generators.d.ts +4 -0
  9. package/dist/interpreter/generators.js +25 -0
  10. package/dist/interpreter/globals.js +67 -46
  11. package/dist/interpreter/intrinsics.d.ts +8 -5
  12. package/dist/interpreter/intrinsics.js +59 -18
  13. package/dist/interpreter/model.d.ts +2 -32
  14. package/dist/interpreter/model.js +4 -38
  15. package/dist/interpreter/native.d.ts +19 -0
  16. package/dist/interpreter/native.js +40 -0
  17. package/dist/interpreter/objects.d.ts +105 -12
  18. package/dist/interpreter/objects.js +190 -66
  19. package/dist/interpreter/promises.d.ts +12 -13
  20. package/dist/interpreter/promises.js +52 -46
  21. package/dist/interpreter/references.d.ts +1 -0
  22. package/dist/interpreter/references.js +20 -33
  23. package/dist/interpreter/runner.d.ts +15 -13
  24. package/dist/interpreter/runner.js +19 -19
  25. package/dist/interpreter/runtime.d.ts +3 -3
  26. package/dist/interpreter/runtime.js +150 -314
  27. package/dist/stdlib/array.d.ts +4 -2
  28. package/dist/stdlib/array.js +423 -31
  29. package/dist/stdlib/collections.d.ts +3 -7
  30. package/dist/stdlib/collections.js +286 -114
  31. package/dist/stdlib/console.d.ts +3 -2
  32. package/dist/stdlib/console.js +35 -30
  33. package/dist/stdlib/date.d.ts +1 -7
  34. package/dist/stdlib/date.js +93 -188
  35. package/dist/stdlib/json.d.ts +2 -2
  36. package/dist/stdlib/json.js +24 -24
  37. package/dist/stdlib/math.d.ts +2 -2
  38. package/dist/stdlib/math.js +96 -76
  39. package/dist/stdlib/number.d.ts +3 -4
  40. package/dist/stdlib/number.js +94 -59
  41. package/dist/stdlib/object.d.ts +4 -4
  42. package/dist/stdlib/object.js +123 -49
  43. package/dist/stdlib/regexp.d.ts +6 -8
  44. package/dist/stdlib/regexp.js +71 -63
  45. package/dist/stdlib/string.d.ts +2 -2
  46. package/dist/stdlib/string.js +213 -50
  47. package/dist/stdlib/url.d.ts +5 -13
  48. package/dist/stdlib/url.js +196 -96
  49. package/dist/stdlib/value.d.ts +5 -4
  50. package/dist/stdlib/value.js +16 -16
  51. package/dist/stdlib/web.d.ts +4 -4
  52. package/dist/stdlib/web.js +8 -7
  53. package/dist/tool-runtime.d.ts +2 -1
  54. package/dist/tool-runtime.js +2 -2
  55. package/package.json +1 -1
  56. package/dist/interpreter/host.d.ts +0 -41
  57. package/dist/interpreter/host.js +0 -44
  58. package/dist/interpreter/methods.d.ts +0 -4
  59. package/dist/interpreter/methods.js +0 -837
  60. package/dist/values.d.ts +0 -37
  61. package/dist/values.js +0 -56
package/dist/values.d.ts DELETED
@@ -1,37 +0,0 @@
1
- export * as Values from "./values.js";
2
- import type { Fiber } from "effect";
3
- /**
4
- * Runtime values the interpreter recognizes by class. Each wraps the host value it stands for,
5
- * so hosts construct these to hand a value to a program and receive them back unchanged.
6
- */
7
- export declare class Promise {
8
- readonly fiber: Fiber.Fiber<unknown, unknown>;
9
- constructor(fiber: Fiber.Fiber<unknown, unknown>);
10
- }
11
- export declare class Date {
12
- time: number;
13
- constructor(time: number);
14
- }
15
- export declare class RegExp {
16
- readonly regex: globalThis.RegExp;
17
- constructor(pattern: string, flags: string);
18
- get lastIndex(): unknown;
19
- set lastIndex(value: unknown);
20
- }
21
- export declare class Map {
22
- readonly map: globalThis.Map<unknown, unknown>;
23
- }
24
- export declare class Set {
25
- readonly set: globalThis.Set<unknown>;
26
- }
27
- export declare class URLSearchParams {
28
- readonly params: globalThis.URLSearchParams;
29
- constructor(params: globalThis.URLSearchParams);
30
- }
31
- export declare class URL {
32
- readonly url: globalThis.URL;
33
- readonly searchParams: URLSearchParams;
34
- constructor(url: globalThis.URL);
35
- }
36
- /** Data-like runtime values; excludes Promise, which never crosses a boundary. */
37
- export declare const isValue: (value: unknown) => value is Date | RegExp | Map | Set | URL | URLSearchParams;
package/dist/values.js DELETED
@@ -1,56 +0,0 @@
1
- export * as Values from "./values.js";
2
- /**
3
- * Runtime values the interpreter recognizes by class. Each wraps the host value it stands for,
4
- * so hosts construct these to hand a value to a program and receive them back unchanged.
5
- */
6
- export class Promise {
7
- fiber;
8
- constructor(fiber) {
9
- this.fiber = fiber;
10
- }
11
- }
12
- export class Date {
13
- time;
14
- constructor(time) {
15
- this.time = time;
16
- }
17
- }
18
- export class RegExp {
19
- regex;
20
- constructor(pattern, flags) {
21
- this.regex = new globalThis.RegExp(pattern, flags);
22
- }
23
- get lastIndex() {
24
- return Reflect.get(this.regex, "lastIndex");
25
- }
26
- set lastIndex(value) {
27
- Reflect.set(this.regex, "lastIndex", value);
28
- }
29
- }
30
- export class Map {
31
- map = new globalThis.Map();
32
- }
33
- export class Set {
34
- set = new globalThis.Set();
35
- }
36
- export class URLSearchParams {
37
- params;
38
- constructor(params) {
39
- this.params = params;
40
- }
41
- }
42
- export class URL {
43
- url;
44
- searchParams;
45
- constructor(url) {
46
- this.url = url;
47
- this.searchParams = new URLSearchParams(url.searchParams);
48
- }
49
- }
50
- /** Data-like runtime values; excludes Promise, which never crosses a boundary. */
51
- export const isValue = (value) => value instanceof Date ||
52
- value instanceof RegExp ||
53
- value instanceof Map ||
54
- value instanceof Set ||
55
- value instanceof URL ||
56
- value instanceof URLSearchParams;