{"_id":"@aliyunpolar/polarmemory-shared","name":"@aliyunpolar/polarmemory-shared","dist-tags":{"latest":"2.1.0"},"versions":{"2.1.0":{"name":"@aliyunpolar/polarmemory-shared","version":"2.1.0","description":"Shared core for PolarDB-PG memory management clients: REST client, memory types, recall formatting, capture sanitisation.","license":"Apache-2.0","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"engines":{"node":">=20"},"scripts":{"build":"tsup","test":"vitest run","test:watch":"vitest","lint":"biome check src tests","lint:fix":"biome check --write src tests","typecheck":"tsc --noEmit","prepublishOnly":"pnpm run build && pnpm run test"},"publishConfig":{"access":"public"},"keywords":["polarmemory","memory","polardb"],"devDependencies":{"@biomejs/biome":"^1.9.4","@types/node":"^22.10.0","tsup":"^8.3.5","typescript":"^5.7.2","vitest":"^2.1.8"},"_id":"@aliyunpolar/polarmemory-shared@2.1.0","gitHead":"b92c71031abc0850aebd52b664e06cf0fbed7ce8","_nodeVersion":"22.22.2","_npmVersion":"10.9.7","dist":{"integrity":"sha512-Dqn129VyIPU2uhOaY2OUcr4+01sVyQD5JyQIPXk7E3DwoEqAgVyTXmQXmXP6gLn6NZuuyEzr+xLc67xKEOOM6w==","shasum":"0c1c38e213172727b5000a03b88636d6e2487893","tarball":"https://registry.npmjs.org/@aliyunpolar/polarmemory-shared/-/polarmemory-shared-2.1.0.tgz","fileCount":5,"unpackedSize":36524,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEgNCaDDJarLVZfDm3OKJJ2QUMd0zjDAXIqY2zurKoiDAiAvOMpbGrKj76zUm+wmggd+rK1lCQWkTHj3MVXTiVwyAg=="}]},"_npmUser":{"name":"liuchengshan","email":"liushanxian0719@gmail.com"},"directories":{},"maintainers":[{"name":"liuchengshan","email":"liushanxian0719@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/polarmemory-shared_2.1.0_1786621861258_0.885201483408613"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-13T11:51:00.976Z","2.1.0":"2026-08-13T11:51:01.393Z","modified":"2026-08-13T11:51:01.722Z"},"maintainers":[{"name":"liuchengshan","email":"liushanxian0719@gmail.com"}],"description":"Shared core for PolarDB-PG memory management clients: REST client, memory types, recall formatting, capture sanitisation.","keywords":["polarmemory","memory","polardb"],"license":"Apache-2.0","readme":"# @aliyunpolar/polarmemory-shared\n\nShared core modules for PolarDB-PG memory management access layers.\n\n## Install\n\n```sh\nnpm install @aliyunpolar/polarmemory-shared\n```\n\n> Typically consumed as a workspace dependency by `@aliyunpolar/polarmemory` (CLI) and `polarmemory_openclaw` (OpenClaw plugin). Direct installation is only needed if you are building a custom access layer.\n\n## What's in here\n\n| Module | Purpose |\n|---|---|\n| `http.ts` | Token-authenticated HTTP client for the polarmemory REST API |\n| `memory-api.ts` | Server contract: `/v1/memories`, `/v2/memories/search`, `/v2/memories/list`, `/v1/ping`, `/v1/db_info` |\n| `recall.ts` | `<recalled-memories>` injection block formatting with anti-injection preamble and tag-escape sanitisation |\n| `circuit.ts` | File-based circuit breaker — 60s cooldown on connection errors, cross-agent same-baseUrl sharing |\n| `fingerprint.ts` | SHA-256 turn fingerprinting + file-based dedup state for capture hooks |\n| `sanitize.ts` | Capture-side sanitisation: wrapper-strip (prevents recall→memory reflux), noise filtering, generic-reply detection |\n| `kb.ts` | Knowledge base provider interface (types only; not implemented in this release) |\n\n## What's NOT in here\n\n- Agent-specific logic (hooks, setup, config files, SKILL)\n- OpenClaw plugin SDK shapes\n- CLI commands or user-facing output\n- Any hardcoded server endpoints or credentials\n\n## Relationship to consumer packages\n\n```\n@aliyunpolar/polarmemory-shared        (this package)\n        ▲                        ▲\n        │                        │\n@aliyunpolar/polarmemory     polarmemory_openclaw\n(CLI + hooks)                (OpenClaw plugin)\n```\n\nBoth consumers import types, API functions, and sanitisation rules from this single source of truth. Neither may redefine REST paths, auth format, or payload shapes independently.\n\n## License\n\nApache-2.0\n","readmeFilename":"README.md","_rev":"1-a659cc443359a0c5d38d47cefefa2e68"}