@dream_engine/agent 0.0.0-stage → 0.1.1

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.
@@ -0,0 +1,126 @@
1
+ import { type SerializedError } from '@dream_engine/core';
2
+ import type { LocalModelClient } from './local-model.js';
3
+ import type { ToolRegistry, AgentResult } from './tools.js';
4
+ /**
5
+ * Shared task lifecycle status for the central orchestrator and both agents.
6
+ * Full lifecycle: created → planning → running → (waiting_for_agent | waiting_for_user |
7
+ * paused | recovering | verifying) → completed | failed | cancelled.
8
+ */
9
+ export type TaskStatus = 'created' | 'planning' | 'running' | 'waiting_for_agent' | 'waiting_for_user' | 'paused' | 'recovering' | 'verifying' | 'completed' | 'failed' | 'cancelled';
10
+ /** A single step in a task plan: one tool call. */
11
+ export interface TaskStep {
12
+ /** Stable id for the step. */
13
+ id: string;
14
+ /** Tool name to call. */
15
+ tool: string;
16
+ /** Tool arguments (validated against the tool's input schema at execution time). */
17
+ args: Record<string, unknown>;
18
+ /** Human-readable description of what this step does. */
19
+ description?: string;
20
+ /** Step status. */
21
+ status: 'pending' | 'running' | 'completed' | 'failed' | 'skipped';
22
+ /** Structured result when completed/failed. */
23
+ result?: AgentResult;
24
+ /** Audit timestamps. */
25
+ startedAt?: string;
26
+ finishedAt?: string;
27
+ }
28
+ /** A persisted agent task with its plan, state and audit log. */
29
+ export interface AgentTask {
30
+ id: string;
31
+ /** Owner (token identity) for isolation in hosted mode. */
32
+ owner: string | null;
33
+ /** The original goal or instruction. */
34
+ goal: string;
35
+ status: TaskStatus;
36
+ /** The plan: ordered steps to execute. */
37
+ steps: TaskStep[];
38
+ /** Index of the next step to run (resume point). */
39
+ cursor: number;
40
+ createdAt: string;
41
+ startedAt: string | null;
42
+ finishedAt: string | null;
43
+ /** Error that ended the task (failed/cancelled). */
44
+ error: SerializedError | null;
45
+ /** Final summary or output. */
46
+ summary: string | null;
47
+ }
48
+ /** A single audit-log entry recorded for each step. */
49
+ export interface AuditEntry {
50
+ taskId: string;
51
+ stepId: string;
52
+ tool: string;
53
+ status: TaskStep['status'];
54
+ ok: boolean;
55
+ durationMs: number;
56
+ error: SerializedError | null;
57
+ at: string;
58
+ }
59
+ /** Options for creating a task. */
60
+ export interface CreateTaskOptions {
61
+ owner?: string | null;
62
+ /** Explicit plan (skips the planner). When omitted and a model is configured, the planner is used. */
63
+ steps?: Array<{
64
+ tool: string;
65
+ args: Record<string, unknown>;
66
+ description?: string;
67
+ }>;
68
+ /** Model client used for planning. When omitted, an explicit plan is required. */
69
+ model?: LocalModelClient | null;
70
+ }
71
+ /** Options for running/resuming a task. */
72
+ export interface AgentRunOptions {
73
+ owner?: string | null;
74
+ signal?: AbortSignal;
75
+ /** Optional callback invoked after each step (for live progress). */
76
+ onStep?: (step: TaskStep, task: AgentTask) => void | Promise<void>;
77
+ }
78
+ /**
79
+ * Persists agent tasks to disk so they survive restarts (R9-style persistence for the agent engine).
80
+ * Tasks are stored as individual JSON documents, validated and resolved safely.
81
+ */
82
+ export declare class TaskStore {
83
+ private readonly store;
84
+ constructor(dir: string);
85
+ save(task: AgentTask): void;
86
+ get(id: string): AgentTask | null;
87
+ list(owner?: string | null): AgentTask[];
88
+ delete(id: string): void;
89
+ /** Loads all persisted tasks into memory (call at startup). */
90
+ load(): AgentTask[];
91
+ }
92
+ /**
93
+ * The agent engine (Phase 10): plans goals into tool-call sequences, executes them
94
+ * step by step with persisted state, supports resume after interruption, and records
95
+ * an audit log for every step.
96
+ *
97
+ * The planner uses a {@link LocalModelClient} when one is configured; otherwise a
98
+ * caller must supply an explicit plan. Execution always goes through the
99
+ * {@link ToolRegistry}, so every step is validated and returns a structured result.
100
+ */
101
+ export declare class AgentEngine {
102
+ private readonly tools;
103
+ private readonly store;
104
+ private readonly tasks;
105
+ private readonly audit;
106
+ constructor(tools: ToolRegistry, store: TaskStore);
107
+ /** Number of tasks currently tracked (in memory). */
108
+ get taskCount(): number;
109
+ /** All audit entries recorded so far (capped at 1000). */
110
+ get auditLog(): readonly AuditEntry[];
111
+ /** Creates a task: plans the goal (or uses an explicit plan) and persists it. */
112
+ create(goal: string, options?: CreateTaskOptions): Promise<AgentTask>;
113
+ /** Plans a goal into tool-call steps using the model. Returns validated steps. */
114
+ private plan;
115
+ /** Runs a task from its current cursor. Resumes if already running. */
116
+ run(taskId: string, options?: AgentRunOptions): Promise<AgentTask>;
117
+ /** Resumes an interrupted task (cancelled/failed) from its current cursor. */
118
+ resume(taskId: string, options?: AgentRunOptions): Promise<AgentTask>;
119
+ /** Cancels a running task at the next step boundary. */
120
+ cancel(taskId: string, owner?: string | null): AgentTask;
121
+ get(taskId: string, owner?: string | null): AgentTask | null;
122
+ list(owner?: string | null): AgentTask[];
123
+ private requireTask;
124
+ private recordAudit;
125
+ }
126
+ //# sourceMappingURL=engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2D,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAEnH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE5D;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAClB,SAAS,GACT,UAAU,GACV,SAAS,GACT,mBAAmB,GACnB,kBAAkB,GAClB,QAAQ,GACR,YAAY,GACZ,WAAW,GACX,WAAW,GACX,QAAQ,GACR,WAAW,CAAC;AAEhB,mDAAmD;AACnD,MAAM,WAAW,QAAQ;IACvB,8BAA8B;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,oFAAoF;IACpF,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,yDAAyD;IACzD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mBAAmB;IAC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3E,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,SAAS,CAAC;IAkC/E,kFAAkF;YACpE,IAAI;IA8BlB,uEAAuE;IACjE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,eAAoB,GAAG,OAAO,CAAC,SAAS,CAAC;IAgD5E,8EAA8E;IACxE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,eAAoB,GAAG,OAAO,CAAC,SAAS,CAAC;IAe/E,wDAAwD;IACxD,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS;IAUxD,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI;IAM5D,IAAI,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE;IAIxC,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,WAAW;CAapB"}
package/dist/engine.js ADDED
@@ -0,0 +1,241 @@
1
+ import { createId, RuntimeError, ValidationError, serializeError } from '@dream_engine/core';
2
+ import { JsonDocumentStore } from '@dream_engine/storage';
3
+ /**
4
+ * Persists agent tasks to disk so they survive restarts (R9-style persistence for the agent engine).
5
+ * Tasks are stored as individual JSON documents, validated and resolved safely.
6
+ */
7
+ export class TaskStore {
8
+ store;
9
+ constructor(dir) {
10
+ this.store = new JsonDocumentStore(dir, { sensitive: true });
11
+ }
12
+ save(task) {
13
+ this.store.save(task.id, task);
14
+ }
15
+ get(id) {
16
+ return this.store.get(id) ?? null;
17
+ }
18
+ list(owner) {
19
+ return this.store
20
+ .list()
21
+ .map((id) => this.store.get(id))
22
+ .filter((t) => Boolean(t) && (owner === undefined || t.owner === owner))
23
+ .map((t) => ({ ...t }));
24
+ }
25
+ delete(id) {
26
+ this.store.delete(id);
27
+ }
28
+ /** Loads all persisted tasks into memory (call at startup). */
29
+ load() {
30
+ return this.list();
31
+ }
32
+ }
33
+ /**
34
+ * The agent engine (Phase 10): plans goals into tool-call sequences, executes them
35
+ * step by step with persisted state, supports resume after interruption, and records
36
+ * an audit log for every step.
37
+ *
38
+ * The planner uses a {@link LocalModelClient} when one is configured; otherwise a
39
+ * caller must supply an explicit plan. Execution always goes through the
40
+ * {@link ToolRegistry}, so every step is validated and returns a structured result.
41
+ */
42
+ export class AgentEngine {
43
+ tools;
44
+ store;
45
+ tasks = new Map();
46
+ audit = [];
47
+ constructor(tools, store) {
48
+ this.tools = tools;
49
+ this.store = store;
50
+ for (const task of store.load())
51
+ this.tasks.set(task.id, task);
52
+ }
53
+ /** Number of tasks currently tracked (in memory). */
54
+ get taskCount() {
55
+ return this.tasks.size;
56
+ }
57
+ /** All audit entries recorded so far (capped at 1000). */
58
+ get auditLog() {
59
+ return this.audit;
60
+ }
61
+ /** Creates a task: plans the goal (or uses an explicit plan) and persists it. */
62
+ async create(goal, options = {}) {
63
+ if (!goal?.trim())
64
+ throw new ValidationError('Task goal is required');
65
+ let steps;
66
+ if (options.steps?.length) {
67
+ steps = options.steps.map((s) => ({
68
+ id: createId('step'),
69
+ tool: s.tool,
70
+ args: s.args,
71
+ description: s.description,
72
+ status: 'pending',
73
+ }));
74
+ }
75
+ else if (options.model) {
76
+ steps = await this.plan(goal, options.model);
77
+ }
78
+ else {
79
+ throw new ValidationError('No plan provided and no model configured; pass steps or a model to plan with');
80
+ }
81
+ const task = {
82
+ id: createId('task'),
83
+ owner: options.owner ?? null,
84
+ goal: goal.trim(),
85
+ status: 'created',
86
+ steps,
87
+ cursor: 0,
88
+ createdAt: new Date().toISOString(),
89
+ startedAt: null,
90
+ finishedAt: null,
91
+ error: null,
92
+ summary: null,
93
+ };
94
+ this.tasks.set(task.id, task);
95
+ this.store.save(task);
96
+ return { ...task };
97
+ }
98
+ /** Plans a goal into tool-call steps using the model. Returns validated steps. */
99
+ async plan(goal, model) {
100
+ const toolNames = this.tools.list().map((t) => t.name);
101
+ const system = [
102
+ 'You are a planning engine. Given a goal, produce a JSON array of tool calls that accomplish it.',
103
+ `Available tools: ${toolNames.join(', ')}.`,
104
+ 'Respond with ONLY a JSON array: [{"tool":"...","args":{...},"description":"..."}].',
105
+ 'Do not invent tools. Keep the plan minimal and ordered.',
106
+ ].join('\n');
107
+ const result = await model.complete(system, { temperature: 0 });
108
+ let parsed;
109
+ try {
110
+ parsed = JSON.parse(result.text);
111
+ }
112
+ catch {
113
+ throw new RuntimeError('Planner returned non-JSON output');
114
+ }
115
+ if (!Array.isArray(parsed))
116
+ throw new RuntimeError('Planner output is not a JSON array');
117
+ return parsed.map((item) => {
118
+ const obj = item;
119
+ if (typeof obj.tool !== 'string')
120
+ throw new RuntimeError('Plan step is missing a tool name');
121
+ if (!toolNames.includes(obj.tool))
122
+ throw new RuntimeError(`Plan step references unknown tool: ${obj.tool}`);
123
+ return {
124
+ id: createId('step'),
125
+ tool: obj.tool,
126
+ args: obj.args ?? {},
127
+ description: typeof obj.description === 'string' ? obj.description : undefined,
128
+ status: 'pending',
129
+ };
130
+ });
131
+ }
132
+ /** Runs a task from its current cursor. Resumes if already running. */
133
+ async run(taskId, options = {}) {
134
+ const task = this.requireTask(taskId, options.owner);
135
+ if (task.status === 'running')
136
+ throw new RuntimeError(`Task ${taskId} is already running`);
137
+ if (task.status === 'completed')
138
+ return { ...task };
139
+ task.status = 'running';
140
+ task.startedAt ??= new Date().toISOString();
141
+ this.store.save(task);
142
+ try {
143
+ while (task.cursor < task.steps.length) {
144
+ if (options.signal?.aborted) {
145
+ task.status = 'cancelled';
146
+ task.error = serializeError(new RuntimeError('Task cancelled'));
147
+ break;
148
+ }
149
+ const step = task.steps[task.cursor];
150
+ step.status = 'running';
151
+ step.startedAt = new Date().toISOString();
152
+ this.store.save(task);
153
+ const started = Date.now();
154
+ const result = await this.tools.call(step.tool, step.args, { signal: options.signal, owner: task.owner ?? undefined });
155
+ step.finishedAt = new Date().toISOString();
156
+ step.result = result;
157
+ step.status = result.ok ? 'completed' : 'failed';
158
+ this.recordAudit(task.id, step, Date.now() - started, result);
159
+ if (!result.ok) {
160
+ task.status = 'failed';
161
+ task.error = result.error;
162
+ task.finishedAt = new Date().toISOString();
163
+ break;
164
+ }
165
+ task.cursor++;
166
+ this.store.save(task);
167
+ await options.onStep?.(step, { ...task });
168
+ }
169
+ if (task.status === 'running') {
170
+ task.status = 'completed';
171
+ task.summary = `Completed ${task.cursor} step(s).`;
172
+ task.finishedAt = new Date().toISOString();
173
+ }
174
+ }
175
+ catch (error) {
176
+ task.status = 'failed';
177
+ task.error = serializeError(error);
178
+ task.finishedAt = new Date().toISOString();
179
+ }
180
+ this.store.save(task);
181
+ return { ...task };
182
+ }
183
+ /** Resumes an interrupted task (cancelled/failed) from its current cursor. */
184
+ async resume(taskId, options = {}) {
185
+ const task = this.requireTask(taskId, options.owner);
186
+ if (task.status === 'running')
187
+ throw new RuntimeError(`Task ${taskId} is already running`);
188
+ if (task.status === 'completed')
189
+ return { ...task };
190
+ // Reset any unfinished step so it can run again.
191
+ const current = task.steps[task.cursor];
192
+ if (current && (current.status === 'running' || current.status === 'failed')) {
193
+ current.status = 'pending';
194
+ current.result = undefined;
195
+ current.startedAt = undefined;
196
+ current.finishedAt = undefined;
197
+ }
198
+ return this.run(taskId, options);
199
+ }
200
+ /** Cancels a running task at the next step boundary. */
201
+ cancel(taskId, owner) {
202
+ const task = this.requireTask(taskId, owner);
203
+ if (task.status === 'completed' || task.status === 'cancelled')
204
+ return { ...task };
205
+ task.status = 'cancelled';
206
+ task.error = serializeError(new RuntimeError('Task cancelled'));
207
+ task.finishedAt = new Date().toISOString();
208
+ this.store.save(task);
209
+ return { ...task };
210
+ }
211
+ get(taskId, owner) {
212
+ const task = this.tasks.get(taskId);
213
+ if (!task || (owner !== undefined && task.owner !== owner))
214
+ return null;
215
+ return { ...task };
216
+ }
217
+ list(owner) {
218
+ return [...this.tasks.values()].filter((t) => owner === undefined || t.owner === owner).map((t) => ({ ...t }));
219
+ }
220
+ requireTask(taskId, owner) {
221
+ const task = this.tasks.get(taskId);
222
+ if (!task || (owner !== undefined && task.owner !== owner))
223
+ throw new RuntimeError(`Task ${taskId} not found`);
224
+ return task;
225
+ }
226
+ recordAudit(taskId, step, durationMs, result) {
227
+ this.audit.push({
228
+ taskId,
229
+ stepId: step.id,
230
+ tool: step.tool,
231
+ status: step.status,
232
+ ok: result.ok,
233
+ durationMs,
234
+ error: result.error,
235
+ at: new Date().toISOString(),
236
+ });
237
+ if (this.audit.length > 1000)
238
+ this.audit.shift();
239
+ }
240
+ }
241
+ //# sourceMappingURL=engine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine.js","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAwB,MAAM,oBAAoB,CAAC;AACnH,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AA2F1D;;;GAGG;AACH,MAAM,OAAO,SAAS;IACH,KAAK,CAA+B;IAErD,YAAY,GAAW;QACrB,IAAI,CAAC,KAAK,GAAG,IAAI,iBAAiB,CAAY,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED,IAAI,CAAC,IAAe;QAClB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IACjC,CAAC;IAED,GAAG,CAAC,EAAU;QACZ,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC;IACpC,CAAC;IAED,IAAI,CAAC,KAAqB;QACxB,OAAO,IAAI,CAAC,KAAK;aACd,IAAI,EAAE;aACN,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC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KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACpC,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC;YAAE,MAAM,IAAI,YAAY,CAAC,QAAQ,MAAM,YAAY,CAAC,CAAC;QAC/G,OAAO,IAAI,CAAC;IACd,CAAC;IAEO,WAAW,CAAC,MAAc,EAAE,IAAc,EAAE,UAAkB,EAAE,MAAmB;QACzF,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;YACd,MAAM;YACN,MAAM,EAAE,IAAI,CAAC,EAAE;YACf,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,EAAE,EAAE,MAAM,CAAC,EAAE;YACb,UAAU;YACV,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,EAAE,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;SAC7B,CAAC,CAAC;QACH,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI;YAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACnD,CAAC;CACF"}
@@ -0,0 +1,8 @@
1
+ export * from './tools.js';
2
+ export * from './mcp.js';
3
+ export * from './local-model.js';
4
+ export * from './engine.js';
5
+ export * from './providers.js';
6
+ export * from './collaboration.js';
7
+ export * from './orchestrator.js';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+ export * from './tools.js';
2
+ export * from './mcp.js';
3
+ export * from './local-model.js';
4
+ export * from './engine.js';
5
+ export * from './providers.js';
6
+ export * from './collaboration.js';
7
+ export * from './orchestrator.js';
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,85 @@
1
+ import { type BashirWebConfig } from '@dream_engine/core';
2
+ /**
3
+ * Optional adapter for **local** language / vision models.
4
+ *
5
+ * BashirWeb never needs a model: every core feature is deterministic. This client exists for
6
+ * users who want to summarise extracted content or describe screenshots with a model they run
7
+ * themselves (Ollama, llama.cpp server, LM Studio, vLLM, ...). It talks plain HTTP with `fetch`;
8
+ * no vendor SDK is imported. It is disabled unless `ai.enabled` is true.
9
+ *
10
+ * Model output is untrusted text. Never feed it back into consequential browser actions
11
+ * without validation and approval.
12
+ */
13
+ export type LocalModelProvider = 'ollama' | 'openai-compatible';
14
+ export interface LocalModelOptions {
15
+ provider: LocalModelProvider;
16
+ /** Base URL, e.g. `http://127.0.0.1:11434` (Ollama) or `http://127.0.0.1:8080/v1` (OpenAI-compatible). */
17
+ endpoint: string;
18
+ model: string;
19
+ /** Request timeout in ms (default 60000). */
20
+ timeout?: number;
21
+ /** Optional bearer token for OpenAI-compatible servers that require one. Never logged. */
22
+ apiKey?: string;
23
+ /** Custom fetch implementation (defaults to global fetch). */
24
+ fetch?: typeof fetch;
25
+ }
26
+ export interface CompletionOptions {
27
+ system?: string;
28
+ /** PNG/JPEG images for multimodal models. */
29
+ images?: Buffer[];
30
+ temperature?: number;
31
+ /** Upper bound on generated tokens (provider permitting). */
32
+ maxTokens?: number;
33
+ signal?: AbortSignal;
34
+ }
35
+ export interface CompletionResult {
36
+ text: string;
37
+ model: string;
38
+ provider: LocalModelProvider;
39
+ durationMs: number;
40
+ }
41
+ export interface LocalModelHealth {
42
+ ok: boolean;
43
+ provider: LocalModelProvider;
44
+ endpoint: string;
45
+ /** Models reported by the server, when it exposes a listing endpoint. */
46
+ models: string[] | null;
47
+ /** Whether the configured model appears in `models` (null when unknown). */
48
+ modelAvailable: boolean | null;
49
+ message: string;
50
+ }
51
+ /** Shape-compatible with `VisionAdapter` from `@dream_engine/browser` (assign it to `page.visual.vision`). */
52
+ export interface LocalVisionAdapter {
53
+ readonly name: string;
54
+ analyze(image: Buffer, prompt?: string): Promise<{
55
+ description: string;
56
+ }>;
57
+ }
58
+ export declare class LocalModelClient {
59
+ readonly provider: LocalModelProvider;
60
+ readonly endpoint: string;
61
+ readonly model: string;
62
+ private readonly timeout;
63
+ private readonly apiKey;
64
+ private readonly fetchImpl;
65
+ constructor(options: LocalModelOptions);
66
+ /** Generates a completion for a single user prompt. */
67
+ complete(prompt: string, options?: CompletionOptions): Promise<CompletionResult>;
68
+ /** Summarises (untrusted) page text. The text is delimited so instructions inside it are treated as data. */
69
+ summarize(text: string, options?: {
70
+ maxWords?: number;
71
+ signal?: AbortSignal;
72
+ }): Promise<CompletionResult>;
73
+ /** Checks that the server is reachable and (when it can be listed) that the model is installed. */
74
+ health(signal?: AbortSignal): Promise<LocalModelHealth>;
75
+ /** Returns an adapter usable as `page.visual.vision` (requires a multimodal model). */
76
+ asVisionAdapter(): LocalVisionAdapter;
77
+ private openAiPath;
78
+ private request;
79
+ }
80
+ /**
81
+ * Creates a client from the `ai` config section, or returns null when AI is disabled.
82
+ * Throws ConfigurationError when enabled but incomplete.
83
+ */
84
+ export declare function createLocalModel(config: BashirWebConfig['ai'], extra?: Pick<LocalModelOptions, 'apiKey' | 'fetch'>): LocalModelClient | null;
85
+ //# sourceMappingURL=local-model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-model.d.ts","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