@anvia/durable 0.0.0-bootstrap.0 → 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.
- package/LICENSE +21 -0
- package/README.md +161 -3
- package/dist/chunk-7WOOJGHA.js +499 -0
- package/dist/chunk-7WOOJGHA.js.map +1 -0
- package/dist/chunk-ETGANBD4.js +83 -0
- package/dist/chunk-ETGANBD4.js.map +1 -0
- package/dist/chunk-KIMHK6CE.js +353 -0
- package/dist/chunk-KIMHK6CE.js.map +1 -0
- package/dist/index.d.ts +182 -0
- package/dist/index.js +1930 -0
- package/dist/index.js.map +1 -0
- package/dist/maintenance.d.ts +10 -0
- package/dist/maintenance.js +119 -0
- package/dist/maintenance.js.map +1 -0
- package/dist/protocol.d.ts +37 -0
- package/dist/protocol.js +213 -0
- package/dist/protocol.js.map +1 -0
- package/dist/sqlite.d.ts +40 -0
- package/dist/sqlite.js +8 -0
- package/dist/sqlite.js.map +1 -0
- package/dist/task-protocol-Cewz7y6v.d.ts +38 -0
- package/dist/types-CBjKEKQ7.d.ts +396 -0
- package/package.json +50 -6
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
import { AgentInteractionRequest } from '@anvia/core/agent/interactions';
|
|
2
|
+
import { JsonValue, Usage, Message } from '@anvia/core/completion';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { Agent, AgentInput, AgentOutcome } from '@anvia/core/agent';
|
|
5
|
+
|
|
6
|
+
type DurableMetrics = {
|
|
7
|
+
observedAt: string;
|
|
8
|
+
runs: Record<string, number>;
|
|
9
|
+
tasks: Record<string, number>;
|
|
10
|
+
oldestPendingAgeMs: number;
|
|
11
|
+
operations: number;
|
|
12
|
+
events: number;
|
|
13
|
+
databaseBytes: number;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
type DurableLimits = {
|
|
17
|
+
maxPendingRuns: number;
|
|
18
|
+
maxPendingTasks: number;
|
|
19
|
+
maxPayloadBytes: number;
|
|
20
|
+
maxOperations: number;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
type DurableTask = {
|
|
24
|
+
id: string;
|
|
25
|
+
agentId: string;
|
|
26
|
+
prompt: string;
|
|
27
|
+
dependsOn?: readonly string[];
|
|
28
|
+
};
|
|
29
|
+
type DurableGraphSubmission = {
|
|
30
|
+
sessionId: string;
|
|
31
|
+
requestId: string;
|
|
32
|
+
/** A static directed acyclic graph, limited to 100 tasks. */
|
|
33
|
+
tasks: readonly DurableTask[];
|
|
34
|
+
};
|
|
35
|
+
type DurableGraphRecord = {
|
|
36
|
+
id: string;
|
|
37
|
+
submission: DurableGraphSubmission;
|
|
38
|
+
createdAt: string;
|
|
39
|
+
cancelled: boolean;
|
|
40
|
+
/** IDs are persisted atomically with the child runs. */
|
|
41
|
+
runIds: Record<string, string>;
|
|
42
|
+
};
|
|
43
|
+
type DurableTaskWait = {
|
|
44
|
+
type: "dependencies" | "dependency_failed";
|
|
45
|
+
taskIds: string[];
|
|
46
|
+
} | {
|
|
47
|
+
type: "capacity";
|
|
48
|
+
} | {
|
|
49
|
+
type: "interaction";
|
|
50
|
+
interactionId: string;
|
|
51
|
+
} | {
|
|
52
|
+
type: "retry";
|
|
53
|
+
until: string;
|
|
54
|
+
} | {
|
|
55
|
+
type: "recovery";
|
|
56
|
+
operationId?: string;
|
|
57
|
+
};
|
|
58
|
+
type DurableGraphNode = {
|
|
59
|
+
id: string;
|
|
60
|
+
agentId: string;
|
|
61
|
+
runId: string;
|
|
62
|
+
status: DurableRunStatus;
|
|
63
|
+
wait?: DurableTaskWait;
|
|
64
|
+
output?: JsonValue;
|
|
65
|
+
interaction?: AgentInteractionRequest;
|
|
66
|
+
error?: string;
|
|
67
|
+
};
|
|
68
|
+
type DurableGraphSnapshot = {
|
|
69
|
+
id: string;
|
|
70
|
+
sessionId: string;
|
|
71
|
+
requestId: string;
|
|
72
|
+
createdAt: string;
|
|
73
|
+
status: "running" | "waiting" | "blocked" | "completed" | "cancelled";
|
|
74
|
+
nodes: DurableGraphNode[];
|
|
75
|
+
edges: {
|
|
76
|
+
source: string;
|
|
77
|
+
target: string;
|
|
78
|
+
}[];
|
|
79
|
+
cursor: number;
|
|
80
|
+
};
|
|
81
|
+
type DurableGraphEvent = DurableEvent & {
|
|
82
|
+
graphId: string;
|
|
83
|
+
taskId: string;
|
|
84
|
+
};
|
|
85
|
+
type DurableGraphListOptions = {
|
|
86
|
+
sessionId?: string | undefined;
|
|
87
|
+
after?: number | undefined;
|
|
88
|
+
limit?: number | undefined;
|
|
89
|
+
};
|
|
90
|
+
type DurableGraphPage = {
|
|
91
|
+
graphs: {
|
|
92
|
+
id: string;
|
|
93
|
+
sessionId: string;
|
|
94
|
+
requestId: string;
|
|
95
|
+
createdAt: string;
|
|
96
|
+
}[];
|
|
97
|
+
nextCursor?: number;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
type TaskOutcome<R = JsonValue> = {
|
|
101
|
+
status: "completed";
|
|
102
|
+
output: R;
|
|
103
|
+
} | {
|
|
104
|
+
status: "failed" | "cancelled";
|
|
105
|
+
error: string;
|
|
106
|
+
};
|
|
107
|
+
type TaskWait = {
|
|
108
|
+
type: "children";
|
|
109
|
+
ids: string[];
|
|
110
|
+
policy: "allSettled" | "failFast";
|
|
111
|
+
} | {
|
|
112
|
+
type: "timer";
|
|
113
|
+
until: string;
|
|
114
|
+
} | {
|
|
115
|
+
type: "agent";
|
|
116
|
+
runId: string;
|
|
117
|
+
status: DurableRunStatus;
|
|
118
|
+
} | {
|
|
119
|
+
type: "signal";
|
|
120
|
+
name: string;
|
|
121
|
+
};
|
|
122
|
+
type TaskTransition<S, R> = {
|
|
123
|
+
status: "pending";
|
|
124
|
+
checkpoint: S;
|
|
125
|
+
} | {
|
|
126
|
+
status: "waiting";
|
|
127
|
+
checkpoint: S;
|
|
128
|
+
wait: TaskWait;
|
|
129
|
+
} | TaskOutcome<R>;
|
|
130
|
+
type TaskContext<I, S> = {
|
|
131
|
+
readonly id: string;
|
|
132
|
+
readonly input: I;
|
|
133
|
+
readonly checkpoint: S;
|
|
134
|
+
readonly signal: AbortSignal;
|
|
135
|
+
/** The key is unique for this parent's lifetime. Replay returns the same child. */
|
|
136
|
+
spawn<CI, CS, CR>(key: string, task: TaskDefinition<CI, CS, CR>, input: CI): string;
|
|
137
|
+
spawnAgent(key: string, input: {
|
|
138
|
+
agentId: string;
|
|
139
|
+
prompt: string;
|
|
140
|
+
}): string;
|
|
141
|
+
children(): TaskRecord[];
|
|
142
|
+
signalValue(name: string): JsonValue | undefined;
|
|
143
|
+
/** Effects default to manual reconciliation after an uncertain interruption. */
|
|
144
|
+
effect<T extends JsonValue>(key: string, input: JsonValue, execute: (operationId: string, signal: AbortSignal) => Promise<T>, recovery?: ToolRecovery): Promise<T>;
|
|
145
|
+
};
|
|
146
|
+
type TaskDefinition<I, S, R> = {
|
|
147
|
+
readonly name: string;
|
|
148
|
+
readonly version: number;
|
|
149
|
+
readonly input: z.ZodType<I>;
|
|
150
|
+
readonly checkpoint: z.ZodType<S>;
|
|
151
|
+
readonly output: z.ZodType<R>;
|
|
152
|
+
readonly initial: (input: I) => S;
|
|
153
|
+
/** Re-entered from the last committed checkpoint; external effects belong in effect(). */
|
|
154
|
+
readonly run: (context: TaskContext<I, S>) => Promise<TaskTransition<S, R>>;
|
|
155
|
+
readonly migrate?: (input: JsonValue, checkpoint: JsonValue, fromVersion: number) => {
|
|
156
|
+
input: I;
|
|
157
|
+
checkpoint: S;
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
type DefinedTask<I, S, R> = TaskDefinition<I, S, R> & {
|
|
161
|
+
readonly registration: RegisteredTask;
|
|
162
|
+
};
|
|
163
|
+
/** Type-erased at registration; schemas enforce every persisted boundary. */
|
|
164
|
+
type RegisteredTask = {
|
|
165
|
+
readonly name: string;
|
|
166
|
+
readonly version: number;
|
|
167
|
+
parseInput(value: unknown): JsonValue;
|
|
168
|
+
parseCheckpoint(value: unknown): JsonValue;
|
|
169
|
+
parseOutput(value: unknown): JsonValue;
|
|
170
|
+
initial(input: JsonValue): JsonValue;
|
|
171
|
+
run(context: TaskContext<JsonValue, JsonValue>): Promise<TaskTransition<JsonValue, JsonValue>>;
|
|
172
|
+
migrate?: (input: JsonValue, checkpoint: JsonValue, version: number) => {
|
|
173
|
+
input: JsonValue;
|
|
174
|
+
checkpoint: JsonValue;
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
type TaskRecord = {
|
|
178
|
+
id: string;
|
|
179
|
+
rootId: string;
|
|
180
|
+
parentId?: string;
|
|
181
|
+
agentRunId?: string;
|
|
182
|
+
depth: number;
|
|
183
|
+
sessionId: string;
|
|
184
|
+
key: string;
|
|
185
|
+
name: string;
|
|
186
|
+
version: number;
|
|
187
|
+
submissionVersion: number;
|
|
188
|
+
/** Original input for deduplication, even after migration. */
|
|
189
|
+
submissionInput: JsonValue;
|
|
190
|
+
input: JsonValue;
|
|
191
|
+
checkpoint: JsonValue;
|
|
192
|
+
status: "pending" | "running" | "waiting" | "completing" | "cancelling" | "completed" | "failed" | "cancelled" | "needs_attention";
|
|
193
|
+
wait?: TaskWait;
|
|
194
|
+
outcome?: TaskOutcome;
|
|
195
|
+
error?: string;
|
|
196
|
+
blockedOperation?: string;
|
|
197
|
+
signals: Record<string, {
|
|
198
|
+
requestId: string;
|
|
199
|
+
value: JsonValue;
|
|
200
|
+
}>;
|
|
201
|
+
createdAt: string;
|
|
202
|
+
updatedAt: string;
|
|
203
|
+
};
|
|
204
|
+
type TaskListOptions = {
|
|
205
|
+
sessionId?: string | undefined;
|
|
206
|
+
after?: number | undefined;
|
|
207
|
+
limit?: number | undefined;
|
|
208
|
+
};
|
|
209
|
+
type TaskPage = {
|
|
210
|
+
tasks: TaskRecord[];
|
|
211
|
+
nextCursor?: number;
|
|
212
|
+
};
|
|
213
|
+
type TaskGraphSnapshot = {
|
|
214
|
+
rootId: string;
|
|
215
|
+
nodes: TaskRecord[];
|
|
216
|
+
edges: {
|
|
217
|
+
source: string;
|
|
218
|
+
target: string;
|
|
219
|
+
type: "owns" | "waits";
|
|
220
|
+
}[];
|
|
221
|
+
cursor: number;
|
|
222
|
+
};
|
|
223
|
+
type TaskEvent = {
|
|
224
|
+
rootId: string;
|
|
225
|
+
sequence: number;
|
|
226
|
+
taskId: string;
|
|
227
|
+
createdAt: string;
|
|
228
|
+
type: "submitted" | "status";
|
|
229
|
+
data: JsonValue;
|
|
230
|
+
};
|
|
231
|
+
interface TaskTransaction {
|
|
232
|
+
getTask(id: string): TaskRecord | undefined;
|
|
233
|
+
findTask(sessionId: string, parentId: string | undefined, key: string): TaskRecord | undefined;
|
|
234
|
+
putTask(task: TaskRecord): void;
|
|
235
|
+
taskChildren(id: string): TaskRecord[];
|
|
236
|
+
taskTree(rootId: string): TaskRecord[];
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
type ToolRecovery = "safe" | "idempotent" | "manual";
|
|
240
|
+
/** Opt-in retries for core completion-attempt errors, including validation and observers. */
|
|
241
|
+
type DurableModelRetry = {
|
|
242
|
+
maxAttempts: number;
|
|
243
|
+
initialDelayMs: number;
|
|
244
|
+
maxDelayMs: number;
|
|
245
|
+
};
|
|
246
|
+
type DurableAgentRegistration = {
|
|
247
|
+
agent: Agent<unknown>;
|
|
248
|
+
/** Bump whenever code, model, tools, schemas, or instructions change incompatibly. */
|
|
249
|
+
version: string;
|
|
250
|
+
/** Unlisted tools require reconciliation if interrupted after their intent was committed. */
|
|
251
|
+
toolRecovery?: Readonly<Record<string, ToolRecovery>>;
|
|
252
|
+
modelRetry?: DurableModelRetry;
|
|
253
|
+
};
|
|
254
|
+
type DurableRunStatus = "queued" | "retry_wait" | "pending" | "running" | "waiting" | "needs_attention" | "completed" | "failed" | "cancelled";
|
|
255
|
+
type DurableSubmission = {
|
|
256
|
+
agentId: string;
|
|
257
|
+
sessionId: string;
|
|
258
|
+
requestId: string;
|
|
259
|
+
prompt: string;
|
|
260
|
+
};
|
|
261
|
+
type DurableRunRecord = DurableSubmission & {
|
|
262
|
+
id: string;
|
|
263
|
+
version: string;
|
|
264
|
+
status: DurableRunStatus;
|
|
265
|
+
createdAt: string;
|
|
266
|
+
updatedAt: string;
|
|
267
|
+
startedAt?: string;
|
|
268
|
+
graphId?: string;
|
|
269
|
+
taskId?: string;
|
|
270
|
+
dependencies?: string[];
|
|
271
|
+
epoch: number;
|
|
272
|
+
input: AgentInput;
|
|
273
|
+
modelTurns: number;
|
|
274
|
+
maxModelTurns: number;
|
|
275
|
+
usage: Usage;
|
|
276
|
+
/** Canonical history before this submission, retained across interaction continuations. */
|
|
277
|
+
history: Message[];
|
|
278
|
+
outcome?: AgentOutcome<unknown>;
|
|
279
|
+
error?: string;
|
|
280
|
+
blockedOperation?: string;
|
|
281
|
+
modelRetry?: DurableModelRetry;
|
|
282
|
+
nextAttemptAt?: string;
|
|
283
|
+
responses: Record<string, JsonValue>;
|
|
284
|
+
};
|
|
285
|
+
type DurableOperation = {
|
|
286
|
+
key: string;
|
|
287
|
+
kind: "model" | "tool" | "effect";
|
|
288
|
+
input: JsonValue;
|
|
289
|
+
status: "started" | "completed";
|
|
290
|
+
recovery: ToolRecovery;
|
|
291
|
+
result?: JsonValue | undefined;
|
|
292
|
+
/** Persisted before each completion attempt, including interrupted attempts; reset by explicit retry(). */
|
|
293
|
+
attempts?: number | undefined;
|
|
294
|
+
};
|
|
295
|
+
type DurableListOptions = {
|
|
296
|
+
sessionId?: string | undefined;
|
|
297
|
+
agentId?: string | undefined;
|
|
298
|
+
status?: DurableRunStatus | undefined;
|
|
299
|
+
/** Exclusive insertion cursor, unrelated to progress-event cursors. */
|
|
300
|
+
after?: number | undefined;
|
|
301
|
+
limit?: number | undefined;
|
|
302
|
+
};
|
|
303
|
+
type DurableRunSummary = Pick<DurableRunRecord, "id" | "agentId" | "sessionId" | "requestId" | "status" | "createdAt" | "updatedAt" | "error" | "blockedOperation" | "nextAttemptAt">;
|
|
304
|
+
type DurableRunPage = {
|
|
305
|
+
runs: DurableRunSummary[];
|
|
306
|
+
nextCursor?: number;
|
|
307
|
+
};
|
|
308
|
+
type DurableSubmitOptions = {
|
|
309
|
+
/** Queue behind unfinished work in the session instead of rejecting the submission. */
|
|
310
|
+
enqueue?: boolean;
|
|
311
|
+
};
|
|
312
|
+
type DurableEvent = {
|
|
313
|
+
sequence: number;
|
|
314
|
+
runId: string;
|
|
315
|
+
createdAt: string;
|
|
316
|
+
type: "submitted" | "status" | "model_started" | "model_completed" | "tool_started" | "tool_completed";
|
|
317
|
+
data: JsonValue;
|
|
318
|
+
};
|
|
319
|
+
type DurableSnapshot = {
|
|
320
|
+
run: DurableRunRecord;
|
|
321
|
+
/** Committed operation state, including results produced before the run finishes. */
|
|
322
|
+
operations: DurableOperation[];
|
|
323
|
+
/** Global commit cursor; pass to stream({ after: cursor }) after rendering this snapshot. */
|
|
324
|
+
cursor: number;
|
|
325
|
+
};
|
|
326
|
+
/** Synchronous, atomic transaction. Never perform external work inside its callback. */
|
|
327
|
+
interface DurableTransaction extends TaskTransaction {
|
|
328
|
+
pendingCounts(): {
|
|
329
|
+
runs: number;
|
|
330
|
+
tasks: number;
|
|
331
|
+
};
|
|
332
|
+
operationCount(id: string): number;
|
|
333
|
+
getGraph(id: string): DurableGraphRecord | undefined;
|
|
334
|
+
findGraphRequest(sessionId: string, requestId: string): DurableGraphRecord | undefined;
|
|
335
|
+
putGraph(graph: DurableGraphRecord): void;
|
|
336
|
+
getRun(id: string): DurableRunRecord | undefined;
|
|
337
|
+
findRequest(sessionId: string, requestId: string): DurableRunRecord | undefined;
|
|
338
|
+
activeRun(sessionId: string): DurableRunRecord | undefined;
|
|
339
|
+
latestCompleted(sessionId: string): DurableRunRecord | undefined;
|
|
340
|
+
hasLaterStartedRun(id: string): boolean;
|
|
341
|
+
putRun(run: DurableRunRecord): void;
|
|
342
|
+
getOperation(runId: string, key: string): DurableOperation | undefined;
|
|
343
|
+
operations(runId: string): DurableOperation[];
|
|
344
|
+
putOperation(runId: string, operation: DurableOperation): void;
|
|
345
|
+
appendEvent(runId: string, type: DurableEvent["type"], data: JsonValue): void;
|
|
346
|
+
cursor(): number;
|
|
347
|
+
}
|
|
348
|
+
/** A store is exclusively owned by one open runtime. All returned values must be detached copies. */
|
|
349
|
+
interface DurableStore {
|
|
350
|
+
metrics(): DurableMetrics;
|
|
351
|
+
listTasks(options: TaskListOptions): TaskPage;
|
|
352
|
+
scheduleTasks(excluded: readonly string[], limit: number): string[];
|
|
353
|
+
unsettledTaskRoots(after: number): {
|
|
354
|
+
ids: string[];
|
|
355
|
+
cursor?: number;
|
|
356
|
+
};
|
|
357
|
+
taskEvents(rootId: string, after: number, limit: number): DurableEvent[];
|
|
358
|
+
acquire(): void;
|
|
359
|
+
close(): void;
|
|
360
|
+
transaction<T>(callback: (tx: DurableTransaction) => T): T;
|
|
361
|
+
listGraphs(options: DurableGraphListOptions): DurableGraphPage;
|
|
362
|
+
graphEvents(graphId: string, after: number, limit: number): DurableEvent[];
|
|
363
|
+
list(options: DurableListOptions): DurableRunPage;
|
|
364
|
+
/** Oldest eligible unfinished run per session, excluding executions still settling. */
|
|
365
|
+
schedule(now: string, limit: number, excludedSessions: readonly string[]): {
|
|
366
|
+
ids: string[];
|
|
367
|
+
nextAttemptAt?: string;
|
|
368
|
+
};
|
|
369
|
+
events(runId: string, after: number, limit: number): DurableEvent[];
|
|
370
|
+
}
|
|
371
|
+
type DurableRuntimeOptions = {
|
|
372
|
+
store: DurableStore;
|
|
373
|
+
limits?: Partial<DurableLimits>;
|
|
374
|
+
/** Called once after a fatal storage/scheduler failure; never includes task payloads automatically. */
|
|
375
|
+
onFatalError?: (error: unknown) => void;
|
|
376
|
+
agents?: readonly DurableAgentRegistration[];
|
|
377
|
+
tasks?: readonly {
|
|
378
|
+
readonly registration: RegisteredTask;
|
|
379
|
+
}[];
|
|
380
|
+
/** Independent capacity for custom task phases. Waiting phases release their slot. */
|
|
381
|
+
maxConcurrentTasks?: number;
|
|
382
|
+
/** Maximum simultaneous executions across sessions. Defaults to 4. */
|
|
383
|
+
maxConcurrentRuns?: number;
|
|
384
|
+
};
|
|
385
|
+
/** Lightweight owner metadata for application authorization. */
|
|
386
|
+
type DurableRunScope = {
|
|
387
|
+
runId: string;
|
|
388
|
+
agentId: string;
|
|
389
|
+
sessionId: string;
|
|
390
|
+
graphId?: string;
|
|
391
|
+
taskId?: string;
|
|
392
|
+
rootTaskId?: string;
|
|
393
|
+
taskName?: string;
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
export type { DurableRunRecord as A, DurableRunStatus as B, DurableRunSummary as C, DurableSnapshot as D, DurableTask as E, DurableTaskWait as F, DurableTransaction as G, TaskContext as H, TaskOutcome as I, TaskTransaction as J, TaskTransition as K, TaskWait as L, ToolRecovery as M, RegisteredTask as R, TaskRecord as T, DurableEvent as a, DurableGraphSnapshot as b, DurableGraphEvent as c, DurableStore as d, DurableAgentRegistration as e, DurableOperation as f, TaskGraphSnapshot as g, TaskEvent as h, DurableRuntimeOptions as i, DefinedTask as j, DurableRunScope as k, TaskListOptions as l, TaskPage as m, DurableSubmission as n, DurableSubmitOptions as o, DurableGraphSubmission as p, DurableGraphListOptions as q, DurableGraphPage as r, DurableListOptions as s, DurableRunPage as t, DurableMetrics as u, TaskDefinition as v, DurableGraphNode as w, DurableGraphRecord as x, DurableLimits as y, DurableModelRetry as z };
|
package/package.json
CHANGED
|
@@ -1,17 +1,61 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anvia/durable",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Durable agent execution with persisted model and tool checkpoints for Anvia.",
|
|
5
|
+
"author": "anvia",
|
|
5
6
|
"license": "MIT",
|
|
6
7
|
"repository": {
|
|
7
8
|
"type": "git",
|
|
8
9
|
"url": "https://github.com/anvia-hq/anvia",
|
|
9
10
|
"directory": "packages/durable"
|
|
10
11
|
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
11
15
|
"publishConfig": {
|
|
12
16
|
"access": "public"
|
|
13
17
|
},
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
"type": "module",
|
|
19
|
+
"sideEffects": false,
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=22.16.0"
|
|
22
|
+
},
|
|
23
|
+
"main": "./dist/index.js",
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"exports": {
|
|
26
|
+
".": {
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"import": "./dist/index.js"
|
|
29
|
+
},
|
|
30
|
+
"./sqlite": {
|
|
31
|
+
"types": "./dist/sqlite.d.ts",
|
|
32
|
+
"import": "./dist/sqlite.js"
|
|
33
|
+
},
|
|
34
|
+
"./protocol": {
|
|
35
|
+
"types": "./dist/protocol.d.ts",
|
|
36
|
+
"import": "./dist/protocol.js"
|
|
37
|
+
},
|
|
38
|
+
"./maintenance": {
|
|
39
|
+
"types": "./dist/maintenance.d.ts",
|
|
40
|
+
"import": "./dist/maintenance.js"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@types/node": "^24.12.2",
|
|
45
|
+
"tsup": "^8.5.1",
|
|
46
|
+
"tsx": "^4.23.12",
|
|
47
|
+
"typescript": "^5.9.3",
|
|
48
|
+
"vitest": "^4.1.11",
|
|
49
|
+
"zod": "^4.6.5",
|
|
50
|
+
"@anvia/core": "1.7.0"
|
|
51
|
+
},
|
|
52
|
+
"peerDependencies": {
|
|
53
|
+
"zod": "^4.6.5",
|
|
54
|
+
"@anvia/core": "^1.7.0"
|
|
55
|
+
},
|
|
56
|
+
"scripts": {
|
|
57
|
+
"build": "tsup src/index.ts src/sqlite.ts src/protocol.ts src/maintenance.ts --format esm --dts --sourcemap --clean",
|
|
58
|
+
"test": "vitest run",
|
|
59
|
+
"typecheck": "tsc --noEmit"
|
|
60
|
+
}
|
|
61
|
+
}
|