{"_id":"@ao-barbosa/phi-session-backend-sqlite-node","_rev":"2-4bdfea6cab11061055d225edc1cfccbe","name":"@ao-barbosa/phi-session-backend-sqlite-node","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@ao-barbosa/phi-session-backend-sqlite-node","version":"1.0.0","author":{"name":"Earendil Works"},"license":"MIT","_id":"@ao-barbosa/phi-session-backend-sqlite-node@1.0.0","maintainers":[{"name":"ao-barbosa","email":"arthur_o.b@hotmail.com"}],"contributors":[{"url":"https://github.com/ao-Barbosa","name":"ao-Barbosa"}],"homepage":"https://github.com/ao-Barbosa/phi#readme","bugs":{"url":"https://github.com/ao-Barbosa/phi/issues"},"dist":{"shasum":"f803a91fdce04d5529d950811d1b0c262f50e7b5","tarball":"https://registry.npmjs.org/@ao-barbosa/phi-session-backend-sqlite-node/-/phi-session-backend-sqlite-node-1.0.0.tgz","fileCount":64,"integrity":"sha512-sYesFwoY13dpnQ3TiaGg0ZYRTxVFDMZJQAQOfL6YzUkoMAjBBgDuazVya4ddso0tLYVPpvWi5Hg7xJ4A1PizCQ==","signatures":[{"sig":"MEUCICGdZzS5tPE1XxmV1mkFrW4P6cd57Sf1IeQvJH9YejszAiEA8eOVVe0vxJ9gdjOhd7xKwQ94AZi3AbH3iyt/6jW45sI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":316211},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=22.19.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"69be3c28c70d249af6bf11fe4d911198b5c70af4","scripts":{"test":"bun test --isolate --preload ../../../test-support/setup.ts --timeout 30000","build":"tsgo -p tsconfig.build.json && bun scripts/copy-migrations.mjs","clean":"rm -rf dist","coverage":"bun test --preload ../../../test-support/setup.ts --timeout 30000 --coverage","prepublishOnly":"bun run clean && bun run build","bench:session:timing":"bun benchmark/session/session-repo.bench.ts && bun benchmark/session/storage.bench.ts"},"_npmUser":{"name":"ao-barbosa","email":"arthur_o.b@hotmail.com"},"repository":{"url":"git+https://github.com/ao-Barbosa/phi.git","type":"git","directory":"packages/session-backends/sqlite-node"},"_npmVersion":"11.17.0","description":"Node sqlite session backend for @ao-barbosa/phi-agent-core sessions","directories":{},"_nodeVersion":"24.19.0","dependencies":{"@ao-barbosa/phi-ai":"^1.0.0","@ao-barbosa/phi-agent-core":"^1.0.0"},"_hasShrinkwrap":false,"packageManager":"bun@1.4.2","devDependencies":{"vitest":"4.1.9","@vitest/coverage-v8":"4.1.9"},"_npmOperationalInternal":{"tmp":"tmp/phi-session-backend-sqlite-node_1.0.0_1788806516115_0.6528030338650197","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"_id":"@ao-barbosa/phi-session-backend-sqlite-node@1.0.1","bugs":{"url":"https://github.com/ao-Barbosa/phi/issues"},"dist":{"shasum":"7222d2ce43c0a3bf4a90c52d6902ea7168fc93f8","tarball":"https://registry.npmjs.org/@ao-barbosa/phi-session-backend-sqlite-node/-/phi-session-backend-sqlite-node-1.0.1.tgz","fileCount":64,"integrity":"sha512-tXadn3O9SdqLXgcq7WkbS3BPSINeDRqrr5r++V1FbH1/gKbdnJ5ZpnJc1wwSsEhdKqyLLLGUCgx6JCQp4KPpdQ==","signatures":[{"sig":"MEYCIQDjF8gGGsIXL8aQ0ffk5+JxgK2nrIr1BmKi46vqn3xh6gIhAIlpJlKRDswX0B7+bnx6VvjWnyckvL++XLjF4ivCxhed","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIE/pS2Uye5m7B4M3TzqmPW1kcWfU3FZ19iDBHUDs0mq1AiEA017Lq5scw3HhXMgsMqb9ETe85zbJ9zekrtwFFoPMW48="}],"unpackedSize":316235},"main":"./dist/index.js","name":"@ao-barbosa/phi-session-backend-sqlite-node","type":"module","types":"./dist/index.d.ts","author":{"name":"Mario Zechner"},"engines":{"node":">=22.19.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"d4a3bef54ccdc2ab06cff573949ae42c8e28f068","license":"MIT","scripts":{"test":"bun test --isolate --preload ../../../test-support/setup.ts --timeout 30000","build":"tsgo -p tsconfig.build.json && bun scripts/copy-migrations.mjs","clean":"rm -rf dist","coverage":"bun test --preload ../../../test-support/setup.ts --timeout 30000 --coverage","prepublishOnly":"bun run clean && bun run build","bench:session:timing":"bun benchmark/session/session-repo.bench.ts && bun benchmark/session/storage.bench.ts"},"version":"1.0.1","_npmUser":{"name":"ao-barbosa","email":"arthur_o.b@hotmail.com"},"homepage":"https://github.com/ao-Barbosa/phi#readme","repository":{"url":"git+https://github.com/ao-Barbosa/phi.git","type":"git","directory":"packages/session-backends/sqlite-node"},"_npmVersion":"11.17.0","description":"Node sqlite session backend for @ao-barbosa/phi-agent-core sessions","directories":{},"maintainers":[{"name":"ao-barbosa","email":"arthur_o.b@hotmail.com"}],"_nodeVersion":"24.19.0","contributors":[{"url":"https://github.com/ao-Barbosa","name":"ao-Barbosa"}],"dependencies":{"@ao-barbosa/phi-ai":"^1.0.1","@ao-barbosa/phi-agent-core":"^1.0.1"},"_hasShrinkwrap":false,"packageManager":"bun@1.4.2","devDependencies":{"vitest":"4.1.9","@vitest/coverage-v8":"4.1.9"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/phi-session-backend-sqlite-node_1.0.1_1789685007148_0.2170007680949979"}}},"time":{"created":"2026-09-07T18:41:55.864Z","modified":"2026-09-17T22:43:27.420Z","1.0.0":"2026-09-07T18:41:56.246Z","1.0.1":"2026-09-17T22:43:27.261Z"},"bugs":{"url":"https://github.com/ao-Barbosa/phi/issues"},"author":{"name":"Mario Zechner"},"license":"MIT","homepage":"https://github.com/ao-Barbosa/phi#readme","repository":{"url":"git+https://github.com/ao-Barbosa/phi.git","type":"git","directory":"packages/session-backends/sqlite-node"},"description":"Node sqlite session backend for @ao-barbosa/phi-agent-core sessions","contributors":[{"url":"https://github.com/ao-Barbosa","name":"ao-Barbosa"}],"maintainers":[{"name":"ao-barbosa","email":"arthur_o.b@hotmail.com"}],"readme":"# @ao-Barbosa/phi-session-backend-sqlite-node\n\nNode `node:sqlite` Session backend for `@ao-Barbosa/phi-agent-core`.\n\n```ts\nimport { BACKGROUND_CONTEXT } from \"@ao-Barbosa/phi-agent-core\";\nimport {\n  createNodeSqliteFactory,\n  SqliteSessionRepo,\n} from \"@ao-Barbosa/phi-session-backend-sqlite-node\";\n\nconst repository = new SqliteSessionRepo({\n  directory: \"/var/lib/phi/sessions\",\n  databaseFactory: createNodeSqliteFactory(),\n});\n\nconst session = await repository.create({}, BACKGROUND_CONTEXT);\nconst main = await session.createBranch(\"main\", null, BACKGROUND_CONTEXT);\nawait main.appendMessage(\n  { role: \"user\", content: \"hello\", timestamp: Date.now() },\n  BACKGROUND_CONTEXT,\n);\nawait session.close(BACKGROUND_CONTEXT);\nawait repository.close(BACKGROUND_CONTEXT);\n```\n\nThe default layout creates one file per Session under `directory`. IDs containing only ASCII letters, digits, `_`, and `-` retain `{sessionId}.sqlite`; every other ID uses a `~`-prefixed base64url encoding of its UTF-16 code units. The durable ID is unchanged, and returned/listed metadata contains the canonical physical path. Pass `databasePath` to place multiple Sessions in one supported shared container; its parent is created when needed.\n\nThe database factory distinguishes intentional creation, no-create read-write open, and no-create read-only open. Session `open()` and deletion reject metadata outside the configured repository and never create a missing database. Listing is read-only and best-effort. Forking deliberately permits a foreign source metadata path: it reads that exact existing container read-only and never substitutes an active local Session with the same ID.\n\nThe host lifecycle, not this backend, guarantees one writable owner per Session. Directly opening the same Session for writes in another process is unsupported. The repository rejects overlapping local create/open/fork/delete ownership for one ID, but implements no cross-process lease, lock, fence, heartbeat, or takeover. The host must close a worker before deletion.\n\nA fork of a source open in the same repository queues its snapshot on that source's commit queue. Any other source, including one held open by a live Session worker, uses an independent read-only connection and one deferred WAL transaction; later worker commits may complete while that snapshot remains open. Shared-container deletion removes only the selected Session's rows. Repository close waits for every open Session cleanup attempt before reporting errors. The package does not export a search service or FTS index; search is the separate S3 projection.\n","readmeFilename":"README.md"}