@zenera/gym 1.1.40 → 1.1.42

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 (51) hide show
  1. package/README.md +169 -104
  2. package/dist/agents.d.ts +25 -0
  3. package/dist/agents.js +52 -0
  4. package/dist/bindings.d.ts +25 -0
  5. package/dist/bindings.js +81 -0
  6. package/dist/box.d.ts +39 -36
  7. package/dist/box.js +183 -217
  8. package/dist/cache.d.ts +24 -14
  9. package/dist/cache.js +102 -66
  10. package/dist/catalog.d.ts +83 -0
  11. package/dist/catalog.js +293 -0
  12. package/dist/command.d.ts +1 -0
  13. package/dist/command.js +235 -68
  14. package/dist/fake.d.ts +4 -0
  15. package/dist/fake.js +142 -0
  16. package/dist/generate.d.ts +28 -24
  17. package/dist/generate.js +417 -120
  18. package/dist/inputs.d.ts +12 -0
  19. package/dist/inputs.js +132 -0
  20. package/dist/knowledge.d.ts +50 -0
  21. package/dist/knowledge.js +199 -0
  22. package/dist/logger.d.ts +10 -8
  23. package/dist/logger.js +4 -3
  24. package/dist/paging.d.ts +2 -2
  25. package/dist/paging.js +2 -2
  26. package/dist/probe.d.ts +5 -5
  27. package/dist/probe.js +15 -15
  28. package/dist/prompt.d.ts +31 -18
  29. package/dist/prompt.js +160 -146
  30. package/dist/quiet.d.ts +2 -0
  31. package/dist/quiet.js +7 -0
  32. package/dist/router.js +5 -1
  33. package/dist/runtime.d.ts +160 -0
  34. package/dist/runtime.js +229 -0
  35. package/dist/schema.js +1 -2
  36. package/dist/server.js +98 -57
  37. package/dist/setup.d.ts +47 -6
  38. package/dist/setup.js +157 -21
  39. package/dist/spec.d.ts +4 -3
  40. package/dist/spec.js +73 -22
  41. package/dist/store.d.ts +78 -0
  42. package/dist/store.js +253 -0
  43. package/dist/synth.d.ts +42 -0
  44. package/dist/synth.js +589 -0
  45. package/dist/worker.d.ts +41 -0
  46. package/dist/worker.js +99 -0
  47. package/package.json +5 -3
  48. package/dist/envelope.d.ts +0 -13
  49. package/dist/envelope.js +0 -9
  50. package/dist/image.d.ts +0 -25
  51. package/dist/image.js +0 -81
@@ -1,41 +1,46 @@
1
- import type { Model } from '@zenera/neo';
1
+ import { type Model } from '@zenera/neo';
2
+ import type { Bindings } from './bindings.ts';
2
3
  import type { Box } from './box.ts';
3
- import type { GeneratorInput } from './envelope.ts';
4
- import { type ExampleRequest } from './prompt.ts';
4
+ import type { Catalog } from './catalog.ts';
5
+ import { type Binding } from './runtime.ts';
6
+ import { type Repair } from './prompt.ts';
5
7
  import { type Operation } from './spec.ts';
8
+ import type { World } from './synth.ts';
6
9
  import { type Checks } from './validate.ts';
10
+ /** Failed tests per build before giving up. */
11
+ export declare const DEFAULT_ATTEMPTS = 5;
7
12
  export interface BuildOptions {
8
13
  model: Model;
9
14
  box: Box;
10
15
  checks: Checks;
11
- /** how many times the model may be asked before giving up */
16
+ catalog: Catalog;
17
+ world: World;
18
+ /** where each type lives; a passing handler adds the ones it was first to use */
19
+ bindings: Bindings;
20
+ /** every operation being served, for siblings and list_operations */
21
+ operations: readonly Operation[];
22
+ /** the cached handler of another operation, if one has been written */
23
+ sourceOf: (operation: Operation) => Promise<string | undefined>;
12
24
  attempts?: number;
25
+ /** where HTML reports of agent runs go */
26
+ reportDir?: string;
13
27
  onAttempt?: (attempt: number, diagnostics: readonly string[], source: string, limit: number) => void | Promise<void>;
14
28
  signal?: AbortSignal;
15
29
  }
16
30
  export interface Built {
17
31
  source: string;
18
32
  attempts: number;
19
- }
20
- /**
21
- * Tries per generator. Each one carries the previous file and what was wrong
22
- * with it, so the later attempts are the informed ones — a model that has seen
23
- * its own traceback usually needs two or three goes at a fiddly schema, and the
24
- * whole loop costs nothing once the file is cached.
25
- */
26
- export declare const DEFAULT_ATTEMPTS = 5;
27
- export interface RegenerateOptions extends BuildOptions {
28
- currentSource: string;
29
- failingInput: GeneratorInput;
30
- fault: string;
31
- stderr?: string;
32
- examples?: readonly ExampleRequest[];
33
+ report?: string;
34
+ /** where the handler stores each type it uses: part of its identity */
35
+ bindings: Record<string, Binding>;
33
36
  }
34
37
  export declare class BuildFailed extends Error {
35
38
  readonly operation: Operation;
36
39
  readonly diagnostics: readonly string[];
37
40
  /** the build report on disk, filled in by whoever was writing one */
38
41
  dump?: string;
42
+ /** the agent's HTML run report */
43
+ report?: string;
39
44
  constructor(operation: Operation, diagnostics: readonly string[]);
40
45
  }
41
46
  /**
@@ -43,15 +48,14 @@ export declare class BuildFailed extends Error {
43
48
  *
44
49
  * `fetch failed` is undici's word for a dozen different problems — a DNS
45
50
  * miss, a refused connection, a TLS error, a timeout — and which one it was is
46
- * only ever in `cause`. Reporting the top-level message alone turns every
47
- * network fault into the same useless sentence.
51
+ * only ever in `cause`.
48
52
  */
49
53
  export declare function reason(err: unknown): string;
50
- export declare function build(operation: Operation, opts: BuildOptions): Promise<Built>;
51
- export declare function regenerate(operation: Operation, opts: RegenerateOptions): Promise<Built>;
54
+ /** Writes the handler for an operation, or repairs the one it has. */
55
+ export declare function build(operation: Operation, opts: BuildOptions, repair?: Repair): Promise<Built>;
52
56
  /**
53
- * Models fence code even when told not to, and a stray ```python line is a
54
- * syntax error rather than a bad answer — not worth a round trip.
57
+ * Models fence code even when told not to, and a stray ```ts line is a syntax
58
+ * error rather than a bad answer — not worth a round trip.
55
59
  */
56
60
  export declare function unfence(text: string): string;
57
61
  //# sourceMappingURL=generate.d.ts.map