@jini-ai/daemon 0.3.8 → 0.5.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.
- package/CHANGELOG.md +119 -0
- package/README.md +50 -8
- package/dist/agent-executor/contracts.d.ts +736 -0
- package/dist/agent-executor/contracts.js +28 -0
- package/dist/agent-executor/event-translation.d.ts +87 -0
- package/dist/agent-executor/event-translation.js +230 -0
- package/dist/agent-executor/events.d.ts +190 -0
- package/dist/agent-executor/events.js +848 -0
- package/dist/agent-executor/handoff.d.ts +18 -0
- package/dist/agent-executor/handoff.js +16 -0
- package/dist/agent-executor/index.d.ts +98 -0
- package/dist/agent-executor/index.js +98 -0
- package/dist/agent-executor/launch.d.ts +375 -0
- package/dist/agent-executor/launch.js +1001 -0
- package/dist/agent-executor/mcp-bridge.d.ts +338 -0
- package/dist/agent-executor/mcp-bridge.js +835 -0
- package/dist/agent-executor/values.d.ts +5 -0
- package/dist/agent-executor/values.js +13 -0
- package/dist/agent-executor.d.ts +375 -176
- package/dist/agent-executor.js +388 -335
- package/dist/artifacts/index.d.ts +14 -0
- package/dist/artifacts/index.js +14 -0
- package/dist/artifacts/manifest.d.ts +90 -0
- package/dist/artifacts/manifest.js +229 -0
- package/dist/artifacts/publication-guard.d.ts +28 -0
- package/dist/artifacts/publication-guard.js +77 -0
- package/dist/artifacts/runtime-compat.d.ts +37 -0
- package/dist/artifacts/runtime-compat.js +33 -0
- package/dist/artifacts/store.d.ts +85 -0
- package/dist/artifacts/store.js +92 -0
- package/dist/artifacts/stub-guard.d.ts +73 -0
- package/dist/artifacts/stub-guard.js +198 -0
- package/dist/artifacts/text-suppression.d.ts +68 -0
- package/dist/artifacts/text-suppression.js +184 -0
- package/dist/close-status.d.ts +11 -8
- package/dist/close-status.js +31 -19
- package/dist/continuation/continuation-transport.d.ts +3 -1
- package/dist/continuation/continuation-transport.js +1 -1
- package/dist/continuation/journal.d.ts +12 -5
- package/dist/continuation/journal.js +4 -4
- package/dist/continuation/run-scoped-context-store.d.ts +13 -4
- package/dist/continuation/run-scoped-context-store.js +6 -6
- package/dist/continuation/run-start-handler.d.ts +1 -1
- package/dist/continuation/run-start-handler.js +3 -16
- package/dist/delegated-tool-bridge.d.ts +7 -3
- package/dist/delegated-tool-bridge.js +32 -31
- package/dist/event-log.d.ts +7 -5
- package/dist/event-log.js +12 -11
- package/dist/frontend-capability-tools.d.ts +1 -1
- package/dist/frontend-capability-tools.js +3 -2
- package/dist/frontend-session-registry.d.ts +32 -9
- package/dist/frontend-session-registry.js +12 -11
- package/dist/http/active-context.d.ts +105 -0
- package/dist/http/active-context.js +67 -0
- package/dist/http/agents.d.ts +68 -0
- package/dist/http/agents.js +12 -0
- package/dist/http/attachments.d.ts +618 -0
- package/dist/http/attachments.js +1034 -0
- package/dist/http/cancel-owned-runs.d.ts +49 -0
- package/dist/http/cancel-owned-runs.js +35 -0
- package/dist/http/component-catalog.d.ts +84 -0
- package/dist/http/component-catalog.js +64 -0
- package/dist/http/connectors.d.ts +209 -0
- package/dist/http/connectors.js +409 -0
- package/dist/http/daemon-status.d.ts +76 -0
- package/dist/http/daemon-status.js +55 -0
- package/dist/http/db-ops.d.ts +123 -0
- package/dist/http/db-ops.js +189 -0
- package/dist/http/delegated-tools.d.ts +113 -0
- package/dist/http/delegated-tools.js +230 -0
- package/dist/http/frontend-control.d.ts +136 -0
- package/dist/http/frontend-control.js +79 -0
- package/dist/http/frontend-sessions.d.ts +110 -0
- package/dist/http/frontend-sessions.js +180 -0
- package/dist/http/health.d.ts +95 -0
- package/dist/http/health.js +40 -0
- package/dist/http/host-tools.d.ts +214 -0
- package/dist/http/host-tools.js +329 -0
- package/dist/http/index.d.ts +52 -0
- package/dist/http/index.js +27 -0
- package/dist/http/media.d.ts +146 -0
- package/dist/http/media.js +346 -0
- package/dist/http/memory.d.ts +265 -0
- package/dist/http/memory.js +328 -0
- package/dist/http/model-proxy.d.ts +49 -0
- package/dist/http/model-proxy.js +642 -0
- package/dist/http/remote-run-events.d.ts +70 -0
- package/dist/http/remote-run-events.js +224 -0
- package/dist/http/research.d.ts +48 -0
- package/dist/http/research.js +315 -0
- package/dist/http/route-manifest.d.ts +35 -0
- package/dist/http/route-manifest.js +103 -0
- package/dist/http/routines.d.ts +120 -0
- package/dist/http/routines.js +298 -0
- package/dist/http/run-credentials.d.ts +73 -0
- package/dist/http/run-credentials.js +71 -0
- package/dist/http/runs.d.ts +91 -0
- package/dist/http/runs.js +221 -0
- package/dist/http/terminals.d.ts +138 -0
- package/dist/http/terminals.js +325 -0
- package/dist/http/tool-catalog.d.ts +78 -0
- package/dist/http/tool-catalog.js +66 -0
- package/dist/http/workspace-root.d.ts +77 -0
- package/dist/http/workspace-root.js +63 -0
- package/dist/http/xai.d.ts +90 -0
- package/dist/http/xai.js +655 -0
- package/dist/image-prompt-delivery.d.ts +13 -3
- package/dist/image-prompt-delivery.js +5 -5
- package/dist/index.d.ts +556 -4
- package/dist/index.js +556 -4
- package/dist/legacy-data-migration.d.ts +59 -8
- package/dist/legacy-data-migration.js +38 -33
- package/dist/read-only-tools.d.ts +130 -0
- package/dist/read-only-tools.js +115 -0
- package/dist/remote-tool-bridge.d.ts +11 -5
- package/dist/remote-tool-bridge.js +15 -15
- package/dist/routines/index.d.ts +1 -1
- package/dist/routines/index.js +1 -1
- package/dist/routines/routine-store.d.ts +34 -12
- package/dist/routines/routine-store.js +21 -20
- package/dist/routines/schedule.d.ts +48 -10
- package/dist/routines/schedule.js +21 -21
- package/dist/routines/scheduler.d.ts +32 -11
- package/dist/routines/scheduler.js +61 -57
- package/dist/routines/types.d.ts +10 -3
- package/dist/run/core/result.d.ts +6 -2
- package/dist/run/core/result.js +3 -3
- package/dist/run/core/retry.d.ts +17 -4
- package/dist/run/core/retry.js +7 -11
- package/dist/run/diagnostics/diagnostics.d.ts +14 -4
- package/dist/run/diagnostics/diagnostics.js +7 -7
- package/dist/run/index.d.ts +1 -1
- package/dist/run/index.js +1 -1
- package/dist/run-credentials.d.ts +138 -0
- package/dist/run-credentials.js +152 -0
- package/dist/run-lifecycle.d.ts +92 -33
- package/dist/run-lifecycle.js +81 -74
- package/dist/scheduler.d.ts +8 -0
- package/dist/scheduler.js +2 -0
- package/dist/session-coordination.d.ts +115 -0
- package/dist/session-coordination.js +111 -0
- package/dist/store/agent-sessions/errors.d.ts +8 -0
- package/dist/store/agent-sessions/errors.js +10 -0
- package/dist/store/agent-sessions/index.d.ts +12 -0
- package/dist/store/agent-sessions/index.js +19 -0
- package/dist/store/agent-sessions/pglite.d.ts +12 -0
- package/dist/store/agent-sessions/pglite.js +7 -0
- package/dist/store/agent-sessions/ports.d.ts +24 -0
- package/dist/store/agent-sessions/ports.js +2 -0
- package/dist/store/agent-sessions/postgres.d.ts +12 -0
- package/dist/store/agent-sessions/postgres.js +7 -0
- package/dist/store/agent-sessions/schema.d.ts +3 -0
- package/dist/store/agent-sessions/schema.js +23 -0
- package/dist/store/agent-sessions/sql.d.ts +35 -0
- package/dist/store/agent-sessions/sql.js +59 -0
- package/dist/store/agent-sessions/sqlite.d.ts +117 -0
- package/dist/store/agent-sessions/sqlite.js +128 -0
- package/dist/store/event-log/sqlite.d.ts +75 -0
- package/dist/store/event-log/sqlite.js +230 -0
- package/dist/surface-exchanges.d.ts +97 -0
- package/dist/surface-exchanges.js +153 -0
- package/dist/terminal-session.d.ts +43 -11
- package/dist/terminal-session.js +22 -20
- package/dist/tokens.js +4 -4
- package/dist/tool-audit.d.ts +114 -0
- package/dist/tool-audit.js +95 -0
- package/dist/tool-executor.d.ts +22 -7
- package/dist/tool-executor.js +16 -16
- package/dist/tool-result-media.d.ts +3 -1
- package/dist/tool-result-media.js +1 -1
- package/dist/tool-result-surfaces.d.ts +3 -1
- package/dist/tool-result-surfaces.js +1 -1
- package/package.json +127 -9
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
## Unreleased
|
|
2
|
+
|
|
3
|
+
### Fixes
|
|
4
|
+
|
|
5
|
+
- Keep packed session-store test fixtures within daemon's source root, use the SQLite driver's zero-argument close API, and declare PostgreSQL test types with `@types/pg`.
|
|
6
|
+
|
|
7
|
+
- Align parser feeds, event sinks, run streams, attachment matchers and OAuth cache construction with current dependency APIs.
|
|
8
|
+
- Omit absent optional arguments under strict TypeScript checking; restore lifecycle event input, terminal options and the delegated `tool_result` discriminant.
|
|
9
|
+
- Compile tests alongside source and update test fixtures to current callback and argument contracts without removing assertions.
|
|
10
|
+
|
|
11
|
+
## 0.5.0 — 2026-10-02
|
|
12
|
+
|
|
13
|
+
### BREAKING
|
|
14
|
+
|
|
15
|
+
- Daemon HTTP route packs and read-only tools now belong to this package. Run services use concept subpaths, optional HTTP peers and canonical core contracts.
|
|
16
|
+
- Distribution includes runtime output, release documentation and required assets only. Process records and per-job neutrality checks are no longer part of the package surface.
|
|
17
|
+
|
|
18
|
+
### BREAKING — HTTP and run coordination ownership
|
|
19
|
+
|
|
20
|
+
- Add optional `./http` with route packs moved from HTTP kit, plus `./read-only-tools`.
|
|
21
|
+
- Remove delegated policy facades; use real policy exports with host messages and core IDs.
|
|
22
|
+
- Run coordination modules use concept paths. Surface exchanges take core Clock/IdGenerator;
|
|
23
|
+
the Node credential adapter uses core token comparison. Database-lane object APIs reconciled.
|
|
24
|
+
- HTTP kit and Express are optional HTTP peers; chat is test-only.
|
|
25
|
+
|
|
26
|
+
- BREAKING: All three session-store factories and SQLite event logs accept optional core `Clock` through `{ clock }` instead of `{ now }`, preserving system-time defaults.
|
|
27
|
+
|
|
28
|
+
## 0.4.0 (unpublished release candidate)
|
|
29
|
+
|
|
30
|
+
- Session-id adapters and the SQLite event log move to dedicated store subpaths; all database connections are injected.
|
|
31
|
+
|
|
32
|
+
# @jini-ai/daemon
|
|
33
|
+
|
|
34
|
+
## 0.2.1
|
|
35
|
+
|
|
36
|
+
### Patch Changes
|
|
37
|
+
|
|
38
|
+
- Add top-level `main`/`types` fields alongside the existing `exports` map. A consumer on
|
|
39
|
+
TypeScript's classic `moduleResolution: "node"` (node10) — which ignores `package.json#exports`
|
|
40
|
+
entirely — could not resolve this package's types at all (`TS2307: Cannot find module`) even
|
|
41
|
+
after the previous exports-map fix restored `require()` at runtime; type resolution and runtime
|
|
42
|
+
resolution are separate algorithms. Verified against a real external consumer (whose
|
|
43
|
+
tsconfig uses this legacy resolution mode): adding these two fields, with its tsconfig completely
|
|
44
|
+
unchanged, made the error disappear. Also fixes absolute-path `require()` (distinct from a bare
|
|
45
|
+
specifier, which already worked) for the same reason — `main` was previously absent.
|
|
46
|
+
|
|
47
|
+
Purely additive: every modern resolver (Node's own runtime `exports` resolution, TypeScript's
|
|
48
|
+
`bundler`/`node16`/`nodenext`) prefers `exports` over `main`/`types` when both are present, so
|
|
49
|
+
this changes nothing for a consumer already on a modern resolver.
|
|
50
|
+
|
|
51
|
+
- Updated dependencies
|
|
52
|
+
- @jini-ai/protocol@0.1.2
|
|
53
|
+
- @jini-ai/core@0.1.2
|
|
54
|
+
- @jini-ai/agent-runtime@0.2.1
|
|
55
|
+
- @jini-ai/platform@0.1.2
|
|
56
|
+
|
|
57
|
+
## 0.2.0
|
|
58
|
+
|
|
59
|
+
### Minor Changes
|
|
60
|
+
|
|
61
|
+
- Add a `"default"` export condition to every published package's `exports` map — every one of
|
|
62
|
+
them lacked it, which meant `require()` failed with `ERR_PACKAGE_PATH_NOT_EXPORTED` for any
|
|
63
|
+
CommonJS consumer (found via a real external integration attempt; Node needs `require(esm)`
|
|
64
|
+
support, i.e. Node >=22.12, for this to resolve).
|
|
65
|
+
|
|
66
|
+
`@jini-ai/agent-runtime`:
|
|
67
|
+
|
|
68
|
+
- **New**: `RuntimeBuildOptions.permissionMode` (`'bypass' | 'restricted'`) lets a caller opt a
|
|
69
|
+
run OUT of the auto-approve-every-permission-prompt flag every def with one
|
|
70
|
+
(`bypassPermissions` / `--yolo` / `--dangerously-skip-permissions`) previously pushed
|
|
71
|
+
unconditionally, with no way to turn it off. Omitting it keeps today's default (bypass)
|
|
72
|
+
behavior unchanged.
|
|
73
|
+
- **New**: `ClaudeStreamEvent`, `CopilotStreamEvent`, and `QoderEvent` are now real exported
|
|
74
|
+
discriminated unions instead of `Record<string, unknown>` — a real external consumer guessed a
|
|
75
|
+
nonexistent field name (`event.text` instead of the actual `event.delta`) against the old
|
|
76
|
+
untyped sink and silently lost every streamed token with no compile or runtime error.
|
|
77
|
+
- Fixed a doc/implementation mismatch in `claude-stream.ts`: the module doc claimed `tool_result`
|
|
78
|
+
events carry `{ tool_use_id, content, is_error }`; the actual emitted shape is
|
|
79
|
+
`{ toolUseId, content, isError }`.
|
|
80
|
+
|
|
81
|
+
`@jini-ai/daemon`: `AgentExecutorRunInput.permissionMode` forwards the new
|
|
82
|
+
`RuntimeBuildOptions.permissionMode` through to `buildArgs`, so a host can actually reach the new
|
|
83
|
+
opt-out from the daemon's real run-input surface, not just from `@jini-ai/agent-runtime` in
|
|
84
|
+
isolation.
|
|
85
|
+
|
|
86
|
+
`@jini-ai/agentic`: `setAtPointer` no longer throws on a malformed (e.g. missing leading `/`)
|
|
87
|
+
`updateDataModel` path — degrades to a no-op like its sibling `getAtPointer`, matching this
|
|
88
|
+
package's own "a bad binding must not crash the renderer" contract. That path is agent-authored
|
|
89
|
+
wire data with no error boundary above it in any host, so the uncaught throw could unmount an
|
|
90
|
+
entire chat UI from ~40 bytes of malformed input.
|
|
91
|
+
|
|
92
|
+
`@jini-ai/chat-react`: a local (client-resolved) A2UI button action is no longer a silent no-op —
|
|
93
|
+
`A2uiSurfaceCard` now surfaces the resolved value. New `ExtEventErrorBoundary` confines a
|
|
94
|
+
`kind: 'ext'` event group's renderer to its own card instead of letting a render/effect-phase
|
|
95
|
+
throw from agent-controlled content unmount the whole chat root (there was no error boundary
|
|
96
|
+
anywhere in this package or its hosts before this).
|
|
97
|
+
|
|
98
|
+
- 0d15314: Add a neutral Composer footer slot for host-owned controls, forward an optional host-selected model through every AgentExecutor runtime transport, expose daemon-owned live agent/model discovery with an explicit rescan route, and recognize Claude Code's partial-stream `message_delta` turn boundary so successful stream-json runs close cleanly.
|
|
99
|
+
|
|
100
|
+
### Patch Changes
|
|
101
|
+
|
|
102
|
+
- e181b22: Enforce flat-package domain/runtime/admission metadata, invert optional capability dependencies,
|
|
103
|
+
inject failure-contained run-stream encoders, clean up provisional replay subscribers, and add a
|
|
104
|
+
neutral node-host HTTP-extension composition seam.
|
|
105
|
+
- Updated dependencies
|
|
106
|
+
- Updated dependencies [0d15314]
|
|
107
|
+
- @jini-ai/protocol@0.1.1
|
|
108
|
+
- @jini-ai/core@0.1.1
|
|
109
|
+
- @jini-ai/platform@0.1.1
|
|
110
|
+
- @jini-ai/agent-runtime@0.2.0
|
|
111
|
+
|
|
112
|
+
## Unreleased — C2 concern ownership
|
|
113
|
+
|
|
114
|
+
- Add audit, held surface-exchange, session-coordination, live-run credential and ownership subpaths; convert daemon calls to required/optional object arguments and inject host ports.
|
|
115
|
+
- Make watchdog cancellation permanent and agent permission defaults restricted, with explicit bypass and invalid-mode rejection.
|
|
116
|
+
|
|
117
|
+
- Added isolated SQLite event-log and rich legacy session entries with host injection.
|
|
118
|
+
- Added neutral session-id port, in-memory store and shared-kernel SQLite/PGlite/Postgres adapters.
|
|
119
|
+
- Preserved durable cursor validation, default cap 2000, dedupe/restart/media semantics.
|
package/README.md
CHANGED
|
@@ -9,6 +9,9 @@ running process: a `RunLifecycle` you can `start`/`emit`/`cancel`/`resume`/`stre
|
|
|
9
9
|
`ToolExecutor` that is the *only* thing allowed to invoke a registered tool's handler, and an
|
|
10
10
|
`AgentExecutor` that spawns and streams a real agent CLI into that lifecycle.
|
|
11
11
|
|
|
12
|
+
Package `typecheck` and `build` compile source and tests together; runtime test execution remains a separate command.
|
|
13
|
+
Packed-consumer fixtures are local to this package. PostgreSQL test declarations come from the development dependency `@types/pg`.
|
|
14
|
+
|
|
12
15
|
## Install
|
|
13
16
|
|
|
14
17
|
```sh
|
|
@@ -26,11 +29,11 @@ spawn — needs `node-pty` installed; everything else has no native-addon depend
|
|
|
26
29
|
(`start`/`get`/`list`/`cancel`/`onCancelRequested`/`emit`/`finish`/`resume`/`waitForTerminal`/
|
|
27
30
|
`stream`/`rehydrate`), keyed on an opaque `contextRef`, backed by an injected `EventLog`.
|
|
28
31
|
- **Event log** — `createInMemoryEventLog`, the reference `EventLog` implementation (the port
|
|
29
|
-
types themselves live in `@jini-ai/protocol` so a storage adapter like `@jini-ai/sqlite` can
|
|
32
|
+
types themselves live in `@jini-ai/protocol` so a storage adapter like `@jini-ai/daemon/store/event-log/sqlite` can
|
|
30
33
|
implement them without depending on this package).
|
|
31
34
|
- **Tool-execution boundary** — `createToolExecutor`, the `ToolExecutor` interface
|
|
32
35
|
(`execute`/`resumeConfirmation`/`cancel`/`getAuditRecord`). It is the sole caller of
|
|
33
|
-
`@jini-ai/core/
|
|
36
|
+
`@jini-ai/core/composition`'s `authorizeToolInvocation` — routes and agents only ever see
|
|
34
37
|
`ToolRegistry` descriptors, never a handler, and this is the one path that can run one, gated by
|
|
35
38
|
an injected `ExecutionDelegate` (authorize/confirm) with a resumable confirmation flow.
|
|
36
39
|
- **Agent executor** — `createAgentExecutor`, `AgentExecutorError` — wires
|
|
@@ -62,20 +65,20 @@ spawn — needs `node-pty` installed; everything else has no native-addon depend
|
|
|
62
65
|
import { createToolRegistry } from '@jini-ai/core';
|
|
63
66
|
import { createInMemoryEventLog, createRunLifecycle, createToolExecutor } from '@jini-ai/daemon';
|
|
64
67
|
|
|
65
|
-
const eventLog = createInMemoryEventLog();
|
|
68
|
+
const eventLog = createInMemoryEventLog({});
|
|
66
69
|
const lifecycle = createRunLifecycle({ eventLog });
|
|
67
|
-
const registry = createToolRegistry();
|
|
70
|
+
const registry = createToolRegistry({});
|
|
68
71
|
const executor = createToolExecutor({ registry });
|
|
69
72
|
|
|
70
73
|
const { run } = await lifecycle.start({ contextRef: 'workspace-42' });
|
|
71
|
-
await lifecycle.emit(run.id, { event: 'stdout', data: { chunk: 'hello' } });
|
|
72
|
-
await lifecycle.finish({ runId: run.id, status: 'succeeded', code: 0, signal: null });
|
|
74
|
+
await lifecycle.emit({ runId: run.id, input: { event: 'stdout', data: { chunk: 'hello' } } });
|
|
75
|
+
await lifecycle.finish({ runId: run.id, status: 'succeeded', code: 0, signal: null, resumable: false });
|
|
73
76
|
```
|
|
74
77
|
|
|
75
78
|
## What's swappable
|
|
76
79
|
|
|
77
80
|
`EventLog` and `RunLifecycle` are consumed as ports — this package ships the reference in-memory
|
|
78
|
-
implementations, but a host wires `@jini-ai/sqlite`'s durable `EventLog` for persistence, or its
|
|
81
|
+
implementations, but a host wires `@jini-ai/daemon/store/event-log/sqlite`'s durable `EventLog` for persistence, or its
|
|
79
82
|
own `RunLifecycle`, as long as it satisfies the same `@jini-ai/protocol`/interface shapes.
|
|
80
83
|
`ExecutionDelegate` (authorize/confirm UI) is a transport-supplied seam on `createToolExecutor` —
|
|
81
84
|
omit it for a headless caller. `PtySpawn` (terminal sessions) and `RoutineStore` (routine
|
|
@@ -89,4 +92,43 @@ ESM only — ships `"type": "module"` with no CommonJS `require` build.
|
|
|
89
92
|
|
|
90
93
|
## Provenance
|
|
91
94
|
|
|
92
|
-
See
|
|
95
|
+
See the archived provenance ledger for per-file provenance and scope decisions. Apache-2.0.
|
|
96
|
+
|
|
97
|
+
## Storage concern subpaths
|
|
98
|
+
|
|
99
|
+
The root remains driver-free. `./store/event-log/sqlite` exports the unchanged cursor/dedupe/replay
|
|
100
|
+
adapter. `createSqliteEventLog({ db }, { maxEntriesPerRun, clock })` borrows the host handle, ensures
|
|
101
|
+
its dedicated schema idempotently, never changes pragmas, and has a harmless `close({})`.
|
|
102
|
+
`openSqliteEventLog({ file, open }, options)` owns a host-acquired handle, sets WAL, cleans up failed
|
|
103
|
+
setup, and closes once. Owned acquisition uses only `openSqliteEventLog`; borrowed creation takes `{ db }`. No ambient driver is loaded.
|
|
104
|
+
|
|
105
|
+
`./store/agent-sessions` exports `AgentSessionStore`, `AgentSessionStoreError` and
|
|
106
|
+
`createInMemoryAgentSessionStore`. `./store/agent-sessions/{sqlite,pglite,postgres}` export the named
|
|
107
|
+
`createSqliteAgentSessionStore`, `createPgliteAgentSessionStore` and `createPostgresAgentSessionStore`
|
|
108
|
+
factories with `{ kernel }` plus optional `{ clock }` (`Clock.nowMs()` from core, defaulting to system wall time). They borrow an already-migrated kernel, join its
|
|
109
|
+
transactions, and use the unchanged `assistant_agent_sessions` mapping. PGlite supports embedded
|
|
110
|
+
and owner-socket kernels. Extra host tables are accepted. No schema/bootstrap/pragma/close occurs
|
|
111
|
+
at construction. SQL failures retain a cause under `AgentSessionStoreError({ code: 'unavailable' })`.
|
|
112
|
+
|
|
113
|
+
The SQLite entry also preserves rich legacy `agent_sessions` functions and exports
|
|
114
|
+
`LEGACY_AGENT_SESSIONS_DDL`. These records include hashes/model/cwd/message cursors and belong to
|
|
115
|
+
the local legacy model; they are separate from the simple session-id port.
|
|
116
|
+
|
|
117
|
+
Database/Kysely/drivers are optional peers and are needed only by the selected concern. Hosts import
|
|
118
|
+
and inject their own drivers. Real Postgres session tests require `JINI_DAEMON_TEST_POSTGRES_URL`
|
|
119
|
+
targeting a disposable `jini_daemon_test_*` database; `pnpm run test:postgres` fails when it is unavailable.
|
|
120
|
+
|
|
121
|
+
## Design decisions
|
|
122
|
+
|
|
123
|
+
- [Remote tool execution records into the owning run](docs/decisions/DR-001-remote-tool-event-recording.md).
|
|
124
|
+
|
|
125
|
+
- [Agent subprocess environment is an explicit allowlist](docs/decisions/DR-002-explicit-subprocess-environment.md).
|
|
126
|
+
|
|
127
|
+
## Optional HTTP surface
|
|
128
|
+
|
|
129
|
+
`@jini-ai/daemon/http` exports daemon route packs, attachment storage, frontend control,
|
|
130
|
+
workspace-root resolution and the live route manifest. Install `@jini-ai/http-kit` and
|
|
131
|
+
`express` only when using this entry. `@jini-ai/daemon/read-only-tools` owns the fail-closed
|
|
132
|
+
execution gate; compose it around the bare executor, beneath recovery decorators, since an
|
|
133
|
+
outer wrapper cannot intercept references those decorators already hold.
|
|
134
|
+
See [API.md](https://github.com/AINSEP/Jini/blob/main/packages/daemon/API.md) for route, credential, audit, surface and session contracts.
|