{"_id":"@atlaso-labs/opencode","_rev":"3-c05e5f4106320eae961b8b308f7b802e","name":"@atlaso-labs/opencode","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@atlaso-labs/opencode","version":"0.1.0","keywords":["opencode","opencode-plugin","memory","long-term-memory","agent-memory","recall","atlaso"],"author":{"name":"Atlaso Labs Inc.","email":"hello@atlaso.ai"},"license":"MIT","_id":"@atlaso-labs/opencode@0.1.0","maintainers":[{"name":"ashishkh","email":"ashishkhandelwal054@gmail.com"}],"homepage":"https://atlaso.ai","bugs":{"url":"https://github.com/atlaso-labs/opencode/issues"},"dist":{"shasum":"1d0dcfac15f1238d26ae0fc0daaa4d4cfca6e306","tarball":"https://registry.npmjs.org/@atlaso-labs/opencode/-/opencode-0.1.0.tgz","fileCount":16,"integrity":"sha512-+wu9gcJuLQth2rF6uayxbm3uYIBMsLFb3xjmOkM8EfjeCZG9Ym0YQjrcSC6IL0AHnBVmp5KAHMOpp/XwhbkmSQ==","signatures":[{"sig":"MEUCIQCHXcrSJ/4yZpfYOe72ARZCgx7/cCEev98zcS36yjRgzAIgOhLz87P2IN9s3Dm6Bx5cIAKe5sBUt9bly00MWygK9ck=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":64834},"main":"src/index.ts","type":"module","module":"src/index.ts","exports":{".":{"import":"./src/index.ts","default":"./src/index.ts"}},"gitHead":"9d630da7eae4d29a6057bb7d82ae13281b047972","scripts":{"test":"bun test","typecheck":"tsc --noEmit"},"_npmUser":{"name":"ashishkh","email":"ashishkhandelwal054@gmail.com"},"repository":{"url":"git+https://github.com/atlaso-labs/opencode.git","type":"git"},"_npmVersion":"10.8.2","description":"Long-term memory for OpenCode — recalls what you've decided and remembers what matters, across sessions, projects, and tools. A pure-TypeScript OpenCode plugin (no engine; HTTP to the Atlaso brain only).","directories":{},"_nodeVersion":"20.19.6","_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest","typescript":"^5","@opencode-ai/plugin":"latest"},"_npmOperationalInternal":{"tmp":"tmp/opencode_0.1.0_1782635907536_0.5187167803437576","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@atlaso-labs/opencode","version":"0.1.1","keywords":["opencode","opencode-plugin","memory","long-term-memory","agent-memory","recall","atlaso"],"author":{"name":"Atlaso Labs Inc.","email":"hello@atlaso.ai"},"license":"MIT","_id":"@atlaso-labs/opencode@0.1.1","maintainers":[{"name":"ashishkh","email":"ashishkhandelwal054@gmail.com"}],"homepage":"https://atlaso.ai","bugs":{"url":"https://github.com/atlaso-labs/opencode/issues"},"dist":{"shasum":"1af4bdece4cacc17709b2eaa73e930cfedf482f8","tarball":"https://registry.npmjs.org/@atlaso-labs/opencode/-/opencode-0.1.1.tgz","fileCount":16,"integrity":"sha512-ZWz2IsiOancZIm1JHU3FsxKIKbefjhnw3LMbw2Kqmhq4PajO6FL6wqWxGxEC6SLAr+5OIAOrOmPhRXFsf7whEA==","signatures":[{"sig":"MEYCIQCQy86RWY1IQYMAZkSvAE8HOyJqgk9pyi+/hWSkEsddMwIhAKU5LGx5SVkdC7eiYplRk0hhN3aD8OAzKczKS1v2bS7f","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":64834},"main":"src/index.ts","type":"module","module":"src/index.ts","exports":{".":{"import":"./src/index.ts","default":"./src/index.ts"}},"gitHead":"42955ba29ae5e8cb81b9e2bdd8cf9e5b81f560e6","scripts":{"test":"bun test","typecheck":"tsc --noEmit"},"_npmUser":{"name":"ashishkh","email":"ashishkhandelwal054@gmail.com"},"repository":{"url":"git+https://github.com/atlaso-labs/opencode.git","type":"git"},"_npmVersion":"10.8.2","description":"Long-term memory for OpenCode — recalls what you've decided and remembers what matters, across sessions, projects, and tools. A pure-TypeScript OpenCode plugin (no engine; HTTP to the Atlaso brain only).","directories":{},"_nodeVersion":"20.19.6","_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest","typescript":"^5","@opencode-ai/plugin":"latest"},"_npmOperationalInternal":{"tmp":"tmp/opencode_0.1.1_1783233403761_0.330869160156692","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@atlaso-labs/opencode","version":"0.2.0","description":"Long-term memory for OpenCode — recalls what you've decided and remembers what matters, across sessions, projects, and tools. A pure-TypeScript OpenCode plugin (no engine; HTTP to the Atlaso brain only).","type":"module","license":"MIT","author":{"name":"Atlaso Labs Inc.","email":"hello@atlaso.ai"},"homepage":"https://atlaso.ai","repository":{"type":"git","url":"git+https://github.com/atlaso-labs/opencode.git"},"keywords":["opencode","opencode-plugin","memory","long-term-memory","agent-memory","recall","atlaso"],"main":"src/index.ts","module":"src/index.ts","exports":{".":{"import":"./src/index.ts","default":"./src/index.ts"}},"scripts":{"test":"bun test","typecheck":"tsc --noEmit"},"devDependencies":{"@opencode-ai/plugin":"latest","@types/bun":"latest","typescript":"^5"},"bugs":{"url":"https://github.com/atlaso-labs/opencode/issues"},"publishConfig":{"access":"public"},"gitHead":"ed951ad0703a3f860c6b64a08e1c45c9eb11e698","_id":"@atlaso-labs/opencode@0.2.0","_nodeVersion":"20.19.6","_npmVersion":"11.19.0","dist":{"integrity":"sha512-gJBooCiLzHsX26cUFqy3jQHhxAg5g2jyZ2Phyt2emtTKabfP1hf0JUeug4JdVXGqKqElu/DXY93MWoyO7v/nDw==","shasum":"30e255e35822c54a8a445286d69fa33c312f319c","tarball":"https://registry.npmjs.org/@atlaso-labs/opencode/-/opencode-0.2.0.tgz","fileCount":23,"unpackedSize":155157,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDCixtuERBSNQiWYgvhrI9o73huCYLVocseawAj1qmliAIgTR7PqQ6CYYXAtWri4BLUM6SIHoGzTbX38F+yfGyDQbM="}]},"_npmUser":{"name":"ashishkh","email":"ashishkhandelwal054@gmail.com"},"directories":{},"maintainers":[{"name":"ashishkh","email":"ashishkhandelwal054@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/opencode_0.2.0_1785676004797_0.045396868915904554"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-28T08:38:27.342Z","modified":"2026-08-02T13:06:45.120Z","0.1.0":"2026-06-28T08:38:27.681Z","0.1.1":"2026-07-05T06:36:43.896Z","0.2.0":"2026-08-02T13:06:44.942Z"},"bugs":{"url":"https://github.com/atlaso-labs/opencode/issues"},"author":{"name":"Atlaso Labs Inc.","email":"hello@atlaso.ai"},"license":"MIT","homepage":"https://atlaso.ai","keywords":["opencode","opencode-plugin","memory","long-term-memory","agent-memory","recall","atlaso"],"repository":{"type":"git","url":"git+https://github.com/atlaso-labs/opencode.git"},"description":"Long-term memory for OpenCode — recalls what you've decided and remembers what matters, across sessions, projects, and tools. A pure-TypeScript OpenCode plugin (no engine; HTTP to the Atlaso brain only).","maintainers":[{"name":"ashishkh","email":"ashishkhandelwal054@gmail.com"}],"readme":"# Atlaso × OpenCode\n\nLong-term memory for [OpenCode](https://opencode.ai) — recalls what you've\ndecided and remembers what matters, across sessions, projects, and tools.\n\nThis is a **pure-TypeScript, bun-native OpenCode plugin**. No Python, no local\nengine: the plugin only does HTTP to the Atlaso brain's `/v1/*` API. The\nintelligence — retrieval, the conflict gate, the worth-keeping judgment — stays\non the server. Memory is **fail-open**: a hook error never breaks an OpenCode\nturn.\n\n## What you get\n\n| Piece | OpenCode mechanism | What it does |\n|---|---|---|\n| **Auto-recall** | plugin `chat.message` hook | Before each of your turns, recalled memory is injected as a synthetic text part so the model sees it. |\n| **Auto-capture** | plugin `event` hook on `session.idle` | When a turn finishes, the user's statement is saved (scrubbed for secrets first). |\n| **Instructions** | `AGENTS.md` (native rules format) | Teaches the model how to use memory well (personal vs project, what's worth keeping). |\n| **Skill** | `.opencode/skills/memory/SKILL.md` | Curation judgment, auto-discovered by OpenCode. |\n\nThe automatic loop is the value and comes **entirely from the plugin hooks**.\n\n> **Model-invoked memory tools** (`recall` / `remember` / `forget` / `recent` /\n> `status` over MCP) are a **remote-MCP follow-up shipped at deploy** — this\n> connector intentionally ships **no** local Python MCP. The hooks above don't\n> depend on them.\n\n## Install\n\nAtlaso memory is one npm package: `@atlaso-labs/opencode`.\n\n### Recommended — add it to your `opencode.json`\n\n```bash\nbun add -d @atlaso-labs/opencode\n```\n\nthen list it in your project (or global `~/.config/opencode/`) `opencode.json`:\n\n```json\n{\n  \"$schema\": \"https://opencode.ai/config.json\",\n  \"plugin\": [\"@atlaso-labs/opencode\"],\n  \"instructions\": [\".opencode/atlaso/AGENTS.md\"]\n}\n```\n\nThe `opencode.json` in this folder is a ready-to-use template. Copy `AGENTS.md`\nto `.opencode/atlaso/AGENTS.md` (or point `instructions` at wherever you keep it),\nand the `skills/memory/` folder to `.opencode/skills/memory/` so OpenCode\nauto-discovers the curation skill.\n\n### Dev — drop the plugin file in directly\n\nFor local hacking you can skip npm and copy the entry into OpenCode's plugin\ndirectory ([docs](https://opencode.ai/docs/plugins/)):\n\n- **Project-local:** copy `src/index.ts` → `<repo>/.opencode/plugins/atlaso-memory.ts`\n- **Global:** copy it → `~/.config/opencode/plugins/atlaso-memory.ts`\n\n(Note the **plural** `plugins/` directory — that's the OpenCode convention. When\ncopying the single file in, keep the `lib/` folder reachable next to it, or use\nthe npm install above so the imports resolve.)\n\n### Sign in (first run)\n\nMemory is **cloud-linked**: on the first turn after install the plugin opens a\nbrowser to **authorize this device** (a one-time device-link flow that writes the\nshared `~/.atlaso/auth.json`). Approve it in the dashboard and memory starts\nsyncing. Until then — or for a tool that isn't your active tool on the free plan\n— the plugin simply does nothing that turn (fail-open).\n\nOpenCode itself: `curl -fsSL https://opencode.ai/install | bash` (or\n`npm i -g opencode-ai`); provider auth via the TUI `/connect` or\n`opencode auth login`.\n\n## How it works\n\n```\ntools/opencode/\n  src/index.ts          plugin entry: chat.message (recall) + event/session.idle (capture)\n  src/connect-entry.ts  detached browser-authorize process (spawned on first run)\n  lib/                  tool-agnostic brain client, copied from the Cursor connector:\n    atlaso.ts             thin /v1/* HTTP client (recall/deposit/entitlement), fail-open\n    capture.ts            commodity heuristics (worth-keeping gate, scope, polarity, secret scrub)\n    project.ts            stable per-project key (git remote / path hash), read-only\n    entitlement.ts        cloud-linked vs local-only gate (free = 1 active tool/device)\n    state.ts              cached entitlement verdict (tool+device scoped)\n    connect.ts            device-link handshake → ~/.atlaso/auth.json\n    render.ts             builds the \"=== Atlaso Memory ===\" injection string\n    log.ts                opt-in debug log (ATLASO_DEBUG=1)\n  skills/memory/SKILL.md  curation judgment (auto-discovered)\n  AGENTS.md               memory instructions (native rules format)\n  opencode.json           install template\n  tests/                  bun tests (lib + plugin behavior, all with fakes — no network)\n```\n\n- **The dual memory** (the headline feature) is preserved: `personal` memories\n  follow the user across every project/tool; `project` memories stay isolated to\n  the repo (a stable key derived from the git remote, with strict cross-project\n  visibility). Nothing is ever written into your project folder.\n- **Auto-capture** rides `session.idle`, which carries only the sessionID — so the\n  plugin stashes the user's statement at `chat.message` and deposits it when the\n  turn goes idle. Assistant-snippet enrichment is a follow-up (see the `TODO` in\n  `src/index.ts`).\n- **Secrets never leave the machine**: captures are scrubbed client-side\n  (defense-in-depth; the server re-scrubs too).\n- **Graceful degradation**: a revoked or non-entitled tool keeps working and never\n  deletes memories — that's the shared cloud-linked/local-only state machine.\n\n## Honesty / caveats (verify on a live OpenCode before relying on these)\n\n- **Auto-capture is the documented, robust half.** It's a write-only side effect\n  on the documented `event`/`session.idle` hook — it depends on nothing fragile.\n- **Auto-recall injection is a community pattern.** Pushing a synthetic text part\n  onto `chat.message` `output.parts` is how working OpenCode memory plugins inject\n  AI-visible context today; a documented true-injection API is still an open\n  feature request, and some OpenCode builds have reportedly mis-rendered injected\n  parts. We only ever **add** a well-formed part and otherwise no-op, so a future\n  OpenCode never breaks because of us — but **confirm the block actually surfaces\n  to the model in your build**.\n- **The exact `session.idle` payload path is `event.properties.sessionID`** per\n  the current contract; confirm it live (a different shape just means no capture\n  that turn — still fail-open).\n- **Windows global-config path is unverified.** Project-level `<repo>/.opencode/`\n  works cross-OS; the documented global path is `~/.config/opencode`.\n\n## Dev / test\n\n```bash\ncd platform/tools/opencode\nbun install\nbun test          # all fakes, no network\nbun run typecheck # tsc --noEmit\n```\n\n`ATLASO_DEBUG=1` writes per-hook logs to `<atlaso dir>/atlaso-opencode-*.log`.\nEnv escape hatches: `ATLASO_NO_CONNECT=1` (skip the browser-authorize),\n`ATLASO_SERVER` (point at a non-prod brain), `ATLASO_GLOBAL_PATH` (redirect\n`auth.json` + state for throwaway testing).\n","readmeFilename":"README.md"}