@zenera/neo 1.1.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 (109) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +178 -0
  3. package/dist/agent.d.ts +66 -0
  4. package/dist/agent.js +97 -0
  5. package/dist/architecture.d.ts +74 -0
  6. package/dist/architecture.js +105 -0
  7. package/dist/embedding.d.ts +60 -0
  8. package/dist/embedding.js +21 -0
  9. package/dist/embeddings/gemini.d.ts +24 -0
  10. package/dist/embeddings/gemini.js +71 -0
  11. package/dist/embeddings/index.d.ts +4 -0
  12. package/dist/embeddings/index.js +4 -0
  13. package/dist/embeddings/openai.d.ts +18 -0
  14. package/dist/embeddings/openai.js +27 -0
  15. package/dist/embeddings/openrouter.d.ts +21 -0
  16. package/dist/embeddings/openrouter.js +54 -0
  17. package/dist/events.d.ts +144 -0
  18. package/dist/events.js +110 -0
  19. package/dist/ids.d.ts +14 -0
  20. package/dist/ids.js +33 -0
  21. package/dist/index.d.ts +25 -0
  22. package/dist/index.js +25 -0
  23. package/dist/inspect/client.d.ts +2 -0
  24. package/dist/inspect/client.js +1326 -0
  25. package/dist/inspect/css.d.ts +2 -0
  26. package/dist/inspect/css.js +164 -0
  27. package/dist/inspect/index.d.ts +9 -0
  28. package/dist/inspect/index.js +12 -0
  29. package/dist/inspect/page.d.ts +3 -0
  30. package/dist/inspect/page.js +93 -0
  31. package/dist/inspect/report.d.ts +54 -0
  32. package/dist/inspect/report.js +62 -0
  33. package/dist/kernel.d.ts +178 -0
  34. package/dist/kernel.js +929 -0
  35. package/dist/memory-stores/factory.d.ts +15 -0
  36. package/dist/memory-stores/factory.js +29 -0
  37. package/dist/memory-stores/file.d.ts +37 -0
  38. package/dist/memory-stores/file.js +174 -0
  39. package/dist/memory-stores/in-memory.d.ts +17 -0
  40. package/dist/memory-stores/in-memory.js +80 -0
  41. package/dist/memory-stores/index.d.ts +4 -0
  42. package/dist/memory-stores/index.js +5 -0
  43. package/dist/memory.d.ts +115 -0
  44. package/dist/memory.js +213 -0
  45. package/dist/model.d.ts +25 -0
  46. package/dist/model.js +2 -0
  47. package/dist/models/anthropic.d.ts +36 -0
  48. package/dist/models/anthropic.js +293 -0
  49. package/dist/models/factory.d.ts +202 -0
  50. package/dist/models/factory.js +533 -0
  51. package/dist/models/gemini.d.ts +45 -0
  52. package/dist/models/gemini.js +368 -0
  53. package/dist/models/index.d.ts +7 -0
  54. package/dist/models/index.js +7 -0
  55. package/dist/models/openai-chat.d.ts +19 -0
  56. package/dist/models/openai-chat.js +203 -0
  57. package/dist/models/openai-responses.d.ts +31 -0
  58. package/dist/models/openai-responses.js +258 -0
  59. package/dist/models/openrouter.d.ts +44 -0
  60. package/dist/models/openrouter.js +230 -0
  61. package/dist/payload-stores/factory.d.ts +15 -0
  62. package/dist/payload-stores/factory.js +30 -0
  63. package/dist/payload-stores/file.d.ts +29 -0
  64. package/dist/payload-stores/file.js +112 -0
  65. package/dist/payload-stores/in-memory.d.ts +17 -0
  66. package/dist/payload-stores/in-memory.js +40 -0
  67. package/dist/payload-stores/index.d.ts +4 -0
  68. package/dist/payload-stores/index.js +5 -0
  69. package/dist/payload.d.ts +89 -0
  70. package/dist/payload.js +181 -0
  71. package/dist/project/config.d.ts +302 -0
  72. package/dist/project/config.js +290 -0
  73. package/dist/project/index.d.ts +4 -0
  74. package/dist/project/index.js +4 -0
  75. package/dist/project/load.d.ts +142 -0
  76. package/dist/project/load.js +430 -0
  77. package/dist/project/refs.d.ts +23 -0
  78. package/dist/project/refs.js +70 -0
  79. package/dist/prompt.d.ts +66 -0
  80. package/dist/prompt.js +62 -0
  81. package/dist/runner.d.ts +103 -0
  82. package/dist/runner.js +537 -0
  83. package/dist/services.d.ts +23 -0
  84. package/dist/services.js +44 -0
  85. package/dist/skill-providers/factory.d.ts +16 -0
  86. package/dist/skill-providers/factory.js +26 -0
  87. package/dist/skill-providers/file.d.ts +44 -0
  88. package/dist/skill-providers/file.js +209 -0
  89. package/dist/skill-providers/index.d.ts +4 -0
  90. package/dist/skill-providers/index.js +5 -0
  91. package/dist/skill-providers/static.d.ts +13 -0
  92. package/dist/skill-providers/static.js +47 -0
  93. package/dist/skills.d.ts +102 -0
  94. package/dist/skills.js +232 -0
  95. package/dist/state.d.ts +86 -0
  96. package/dist/state.js +49 -0
  97. package/dist/tools/exa.d.ts +23 -0
  98. package/dist/tools/exa.js +389 -0
  99. package/dist/tools/index.d.ts +4 -0
  100. package/dist/tools/index.js +6 -0
  101. package/dist/tools/sandbox.d.ts +172 -0
  102. package/dist/tools/sandbox.js +602 -0
  103. package/dist/tools/workspace.d.ts +53 -0
  104. package/dist/tools/workspace.js +1034 -0
  105. package/dist/trajectory.d.ts +213 -0
  106. package/dist/trajectory.js +232 -0
  107. package/dist/types.d.ts +195 -0
  108. package/dist/types.js +134 -0
  109. package/package.json +98 -0
@@ -0,0 +1,172 @@
1
+ import { type AnyTool } from '../types.ts';
2
+ /** Where the workspace appears inside the container. */
3
+ export declare const SANDBOX_MOUNT = "/workspace";
4
+ /** The image a project gets when it does not name one. */
5
+ export declare const DEFAULT_SANDBOX_IMAGE = "docker.io/library/python:3.14-slim-bookworm";
6
+ /** The family name config selects the whole set by: `tools: [sandbox:*]`. */
7
+ export declare const SANDBOX_GROUP = "sandbox";
8
+ /**
9
+ * Everything about a container that an author can state, and that two agents
10
+ * can therefore disagree about. Two specs that are equal share a container;
11
+ * two that differ get one each, because the identity of a container here *is*
12
+ * its configuration.
13
+ */
14
+ export interface SandboxSpec {
15
+ /** the base image commands run in */
16
+ image?: string;
17
+ /** fractional cores, as podman's `--cpus` */
18
+ cpus?: number;
19
+ /** MiB, as podman's `--memory` */
20
+ memory?: number;
21
+ network?: SandboxNetwork;
22
+ /** where the workspace is mounted, and the default cwd */
23
+ workdir?: string;
24
+ /** default seconds a single command may take */
25
+ timeout?: number;
26
+ /** uid, name, or `uid:gid`; unset means the image's own user */
27
+ user?: string;
28
+ /** keep the container between sessions rather than removing it */
29
+ persist?: boolean;
30
+ /** environment inside the container — resolved values, never a passthrough */
31
+ env?: Record<string, string>;
32
+ }
33
+ export type SandboxNetwork = 'bridge' | 'none' | 'host';
34
+ export interface SandboxMount {
35
+ /** absolute host path */
36
+ host: string;
37
+ /** absolute path inside the container */
38
+ at: string;
39
+ readOnly?: boolean;
40
+ }
41
+ export interface SandboxOptions extends SandboxSpec {
42
+ /** host directory mounted at `workdir` */
43
+ root: string;
44
+ /**
45
+ * Stable name for whatever owns this sandbox — a session id, typically.
46
+ * It prefixes the container name, so a crashed process leaves something a
47
+ * human can recognise rather than a hash.
48
+ */
49
+ key: string;
50
+ /** refuse to mount the workspace writable */
51
+ readOnly?: boolean;
52
+ /** extra bind mounts; the host side must already exist */
53
+ mounts?: readonly SandboxMount[];
54
+ /** the container engine binary */
55
+ engine?: string;
56
+ /** how processes are spawned — the seam tests replace */
57
+ exec?: Runner;
58
+ }
59
+ /**
60
+ * Per-agent overrides on top of one base spec. An agent that overrides nothing
61
+ * shares the base container; an agent that names a different image gets its
62
+ * own, and two agents that name the *same* different image share that.
63
+ */
64
+ export interface SandboxPoolOptions extends SandboxOptions {
65
+ agents?: Record<string, SandboxSpec>;
66
+ }
67
+ /** A failure the caller can do something about — a missing engine, usually. */
68
+ export declare class SandboxError extends Error {
69
+ readonly hint?: string;
70
+ constructor(message: string, hint?: string);
71
+ }
72
+ export interface ProcOptions {
73
+ /** written to stdin, which is then closed */
74
+ input?: string;
75
+ timeoutMs?: number;
76
+ signal?: AbortSignal;
77
+ /** per stream */
78
+ maxBytes?: number;
79
+ }
80
+ export interface ProcResult {
81
+ code: number;
82
+ stdout: string;
83
+ stderr: string;
84
+ truncated: boolean;
85
+ timedOut: boolean;
86
+ }
87
+ export type Runner = (bin: string, args: readonly string[], opts?: ProcOptions) => Promise<ProcResult>;
88
+ export declare const runProcess: Runner;
89
+ interface Resolved extends Required<Omit<SandboxSpec, 'user'>> {
90
+ user?: string;
91
+ root: string;
92
+ key: string;
93
+ readOnly: boolean;
94
+ mounts: readonly SandboxMount[];
95
+ engine: string;
96
+ }
97
+ export interface ExecOptions {
98
+ cwd?: string;
99
+ /** seconds; the spec's default otherwise */
100
+ timeout?: number;
101
+ signal?: AbortSignal;
102
+ }
103
+ export interface ExecResult {
104
+ exit_code: number;
105
+ stdout: string;
106
+ stderr: string;
107
+ truncated?: boolean;
108
+ timed_out?: boolean;
109
+ duration_ms: number;
110
+ }
111
+ interface Job {
112
+ id: string;
113
+ command: string;
114
+ cwd: string;
115
+ startedAt: number;
116
+ }
117
+ /**
118
+ * The container, started when it is first needed and not before. A project
119
+ * whose agents never shell out never pays for an image pull, and a session
120
+ * that only ever asks a question never leaves anything behind.
121
+ */
122
+ export declare class Sandbox {
123
+ #private;
124
+ readonly name: string;
125
+ readonly spec: Resolved;
126
+ constructor(opts: SandboxOptions);
127
+ /** Whether anything was actually started — `dispose` is free when not. */
128
+ get started(): boolean;
129
+ /**
130
+ * Idempotent, and single-flight: several tool calls in one batch all await
131
+ * the same start rather than racing to create the same container.
132
+ */
133
+ start(): Promise<void>;
134
+ /**
135
+ * Runs one command and waits for it. The script goes down stdin, so no part
136
+ * of it is ever parsed by a shell on this side of the container.
137
+ */
138
+ exec(command: string, opts?: ExecOptions): Promise<ExecResult>;
139
+ /**
140
+ * Starts a command and returns. The wrapper writes the log and the exit
141
+ * code to files the container owns, which is what makes the job readable
142
+ * after the `exec` that started it has long returned.
143
+ */
144
+ startJob(command: string, opts?: ExecOptions): Promise<Job>;
145
+ /** A window of a job's log, plus whether it is still going. */
146
+ readJob(id: string, from?: number): Promise<unknown>;
147
+ /** Signals a job's whole process group, so its children go too. */
148
+ stopJob(id: string): Promise<unknown>;
149
+ /**
150
+ * Stops a persisted container and removes an ephemeral one. Stopping
151
+ * rather than removing is what makes `persist` mean anything: a stopped
152
+ * container costs disk, a running one costs the machine's whole budget.
153
+ */
154
+ dispose(): Promise<void>;
155
+ /**
156
+ * A path inside the container, contained to the working directory. Purely
157
+ * lexical, and correctly so: this is the container's path space, not this
158
+ * machine's, and there is nothing here to resolve a symlink against.
159
+ */
160
+ inside(path?: string): string;
161
+ }
162
+ export declare class SandboxPool {
163
+ #private;
164
+ constructor(opts: SandboxPoolOptions);
165
+ for(agent?: string): Sandbox;
166
+ /** The containers that were actually started, for a status line. */
167
+ get running(): readonly Sandbox[];
168
+ dispose(): Promise<void>;
169
+ }
170
+ export declare function sandboxTools<TCtx = unknown>(opts: SandboxPoolOptions | SandboxPool): AnyTool<TCtx>[];
171
+ export {};
172
+ //# sourceMappingURL=sandbox.d.ts.map