{"_id":"@atheon-labs/trinity-daemon","_rev":"4-d917b82e02b4c23a5a04ee2058a4759f","name":"@atheon-labs/trinity-daemon","dist-tags":{"latest":"0.4.0"},"versions":{"0.1.0":{"name":"@atheon-labs/trinity-daemon","version":"0.1.0","license":"UNLICENSED","_id":"@atheon-labs/trinity-daemon@0.1.0","maintainers":[{"name":"atheonlabs","email":"hello@atheon.xyz"}],"homepage":"https://github.com/atheonxyz/trinity#readme","bugs":{"url":"https://github.com/atheonxyz/trinity/issues"},"bin":{"trinity-daemon":"dist/index.js"},"dist":{"shasum":"f9ab689f4c304083b46ade22fb3a9c7a09b2ea79","tarball":"https://registry.npmjs.org/@atheon-labs/trinity-daemon/-/trinity-daemon-0.1.0.tgz","fileCount":3,"integrity":"sha512-U3h/Qq2N+Mi/VhtggInbxrCfWiL2iie9nRBnaFnL3qt36FgrZjfES5k7tqeqTia5NG1k2nkv+ON42l6Mz1bU/g==","signatures":[{"sig":"MEYCIQDCZBXcsbyqcl6jzd2YShWtC+l9I+Ggfrrwf/PkysNPJwIhAOrIQaXHv0KG7C/0N8UYX3hJTOJn30u/H5xJqcdd6q95","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":132147},"main":"./dist/index.js","type":"module","engines":{"node":">=20"},"gitHead":"3c7a53bf90aa74d118de0d36407978a28b928615","scripts":{"dev":"tsx src/index.ts","test":"vitest run","build":"tsup","start":"node dist/index.js","typecheck":"tsc --noEmit","test:watch":"vitest","prepublishOnly":"npm run typecheck && npm run test && npm run build"},"_npmUser":{"name":"atheonlabs","email":"hello@atheon.xyz"},"repository":{"url":"git+https://github.com/atheonxyz/trinity.git","type":"git","directory":"daemon"},"_npmVersion":"11.5.1","description":"Folder-scoped IDE relay for Trinity — watches a repo and ships secret-redacted coding-session summaries.","directories":{},"_nodeVersion":"24.7.0","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","tsup":"^8.3.5","vitest":"^4.1.10","chokidar":"^4.0.1","typescript":"^5.7.2","@types/node":"^22.10.0"},"_npmOperationalInternal":{"tmp":"tmp/trinity-daemon_0.1.0_1783336869766_0.8345167297021188","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@atheon-labs/trinity-daemon","version":"0.2.0","license":"UNLICENSED","_id":"@atheon-labs/trinity-daemon@0.2.0","maintainers":[{"name":"atheonlabs","email":"hello@atheon.xyz"}],"homepage":"https://github.com/atheonxyz/trinity#readme","bugs":{"url":"https://github.com/atheonxyz/trinity/issues"},"bin":{"trinity-daemon":"dist/index.js"},"dist":{"shasum":"30ccb34a5dd37efdee2dcf0ceeeb76df6864d1ca","tarball":"https://registry.npmjs.org/@atheon-labs/trinity-daemon/-/trinity-daemon-0.2.0.tgz","fileCount":3,"integrity":"sha512-I0NITH1us05nyQh8LH4u05TTJPHPdVfDlkpGLHOeqZ4dxTDjWpeZkIOXz8bgpRFr2JHOsex7xWDdi2MxCC/Sxw==","signatures":[{"sig":"MEYCIQC+aSTV01gmyDx3Y6TRXxN4Fz1kHJB0DC4sgJ/VnybQNQIhAKQHkQ/rqybxm4Qch3wdO1VVcYPdGG4khLP3eXIt9cft","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":160670},"main":"./dist/index.js","type":"module","engines":{"node":">=20"},"gitHead":"3f67665aaf8a2e03b1a1c87c336af011b86528ab","scripts":{"dev":"tsx src/index.ts","test":"vitest run","build":"tsup","start":"node dist/index.js","typecheck":"tsc --noEmit","test:watch":"vitest","prepublishOnly":"npm run typecheck && npm run test && npm run build"},"_npmUser":{"name":"atheonlabs","email":"hello@atheon.xyz"},"repository":{"url":"git+https://github.com/atheonxyz/trinity.git","type":"git","directory":"daemon"},"_npmVersion":"11.5.1","description":"Folder-scoped IDE relay for Trinity — watches a repo and ships secret-redacted coding-session summaries.","directories":{},"_nodeVersion":"24.7.0","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","tsup":"^8.3.5","vitest":"^4.1.10","chokidar":"^4.0.1","typescript":"^5.7.2","@types/node":"^22.10.0"},"_npmOperationalInternal":{"tmp":"tmp/trinity-daemon_0.2.0_1783503452758_0.4538842195665267","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@atheon-labs/trinity-daemon","version":"0.3.0","license":"UNLICENSED","_id":"@atheon-labs/trinity-daemon@0.3.0","maintainers":[{"name":"atheonlabs","email":"hello@atheon.xyz"}],"homepage":"https://github.com/atheonxyz/trinity#readme","bugs":{"url":"https://github.com/atheonxyz/trinity/issues"},"bin":{"trinity-daemon":"dist/index.js"},"dist":{"shasum":"9bbd2eb319f5cae109da5dcd759bcb43d3b02059","tarball":"https://registry.npmjs.org/@atheon-labs/trinity-daemon/-/trinity-daemon-0.3.0.tgz","fileCount":3,"integrity":"sha512-mFSwl+9YkvIf5Xr37cnwwYYVXDJuepUQ7KMFoMIDI7lFuI15c5U5QMO/P0zk+ZOkx9TjEXRqDP9DD52on4nLMQ==","signatures":[{"sig":"MEYCIQCO7wTVEEMmERqaKQ15Qvr05OTmu5XmBM0uj5XX4akrOAIhAOZcHbUOHKqDBoURVEK9xZoYYTWdTXI3alKd5TtGXbWQ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":161118},"main":"./dist/index.js","type":"module","engines":{"node":">=20"},"scripts":{"dev":"tsx src/index.ts","test":"vitest run","build":"tsup","start":"node dist/index.js","typecheck":"tsc --noEmit","test:watch":"vitest","prepublishOnly":"npm run typecheck && npm run test && npm run build"},"_npmUser":{"name":"atheonlabs","email":"hello@atheon.xyz"},"repository":{"url":"git+https://github.com/atheonxyz/trinity.git","type":"git","directory":"daemon"},"_npmVersion":"11.5.1","description":"Folder-scoped IDE relay for Trinity — watches a repo and ships secret-redacted coding-session summaries.","directories":{},"_nodeVersion":"24.7.0","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","tsup":"^8.3.5","vitest":"^4.1.10","chokidar":"^4.0.1","typescript":"^5.7.2","@types/node":"^22.10.0"},"_npmOperationalInternal":{"tmp":"tmp/trinity-daemon_0.3.0_1783681502091_0.03600556114981135","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@atheon-labs/trinity-daemon","version":"0.4.0","description":"Folder-scoped IDE relay for Trinity — watches a repo and ships secret-redacted coding-session summaries.","license":"UNLICENSED","type":"module","main":"./dist/index.js","bin":{"trinity-daemon":"dist/index.js"},"engines":{"node":">=20"},"repository":{"type":"git","url":"git+https://github.com/atheonxyz/trinity.git","directory":"daemon"},"publishConfig":{"access":"public","provenance":true},"scripts":{"build":"tsup","typecheck":"tsc --noEmit","start":"node dist/index.js","dev":"tsx src/index.ts","test":"vitest run","test:watch":"vitest","prepublishOnly":"npm run typecheck && npm run test && npm run build"},"devDependencies":{"@types/node":"^22.10.0","chokidar":"^4.0.1","tsup":"^8.3.5","tsx":"^4.19.2","typescript":"^5.7.2","vitest":"^4.1.10"},"_id":"@atheon-labs/trinity-daemon@0.4.0","gitHead":"36c5644aa57e56fdf032869f5ddcb0660c6d8170","bugs":{"url":"https://github.com/atheonxyz/trinity/issues"},"homepage":"https://github.com/atheonxyz/trinity#readme","_nodeVersion":"24.7.0","_npmVersion":"11.5.1","dist":{"integrity":"sha512-o56gy9qkFpwuWBHJTfflsOTVXGx5skwxBLyqumK6h6VaMOl8FpbpdbHHYmIgGR3hRkg7Yw8bg5SBXPLcDqiudA==","shasum":"ca6ff3c68073d6ec3f8832a3b9e5a2f58db3c028","tarball":"https://registry.npmjs.org/@atheon-labs/trinity-daemon/-/trinity-daemon-0.4.0.tgz","fileCount":3,"unpackedSize":171793,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICcLaOcZAI9CEKoTLF2/pEcKkgYA5c5DzugbnznSNl5LAiBrQqRxDX5qq83svM1g0XadZKrY9YWQIRlgWbjB4pUUCQ=="}]},"_npmUser":{"name":"atheonlabs","email":"hello@atheon.xyz"},"directories":{},"maintainers":[{"name":"atheonlabs","email":"hello@atheon.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/trinity-daemon_0.4.0_1784042373942_0.9465855312729956"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-06T11:21:09.495Z","modified":"2026-07-14T15:19:34.199Z","0.1.0":"2026-07-06T11:21:09.886Z","0.2.0":"2026-07-08T09:37:32.904Z","0.3.0":"2026-07-10T11:05:02.269Z","0.4.0":"2026-07-14T15:19:34.070Z"},"bugs":{"url":"https://github.com/atheonxyz/trinity/issues"},"license":"UNLICENSED","homepage":"https://github.com/atheonxyz/trinity#readme","repository":{"type":"git","url":"git+https://github.com/atheonxyz/trinity.git","directory":"daemon"},"description":"Folder-scoped IDE relay for Trinity — watches a repo and ships secret-redacted coding-session summaries.","maintainers":[{"name":"atheonlabs","email":"hello@atheon.xyz"}],"readme":"# Trinity Daemon\n\nA **folder-scoped IDE relay** you run on your laptop. It watches one repo, tails your\n**Claude Code** and **Codex** session logs (cwd-matched to that repo), and every few minutes\nships two things to the Trinity backend: **secret-redacted verbatim turns** (role-tagged\nprompts, assistant text, and clipped tool I/O — the `coding_session_v2` transcript\nlane) and a repo summary (turn / tool-call counts, prompt & result summaries, the changed-file\nlist, a `git diff --stat`, and the `HEAD` commit SHA).\n\nIt **never** sends file contents or full transcripts. The published package is a single\nself-contained file — zero runtime dependencies, Node ≥ 20.\n\n## Onboard (the one-liner)\n\nThe dashboard's **People → Connect IDE** screen hands you a ready-to-run command. Paste it in\nthe repo you want to track:\n\n```bash\nnpx -y @atheon-labs/trinity-daemon@latest onboard --relay \"<relay-url-from-dashboard>\"\n```\n\n`onboard` writes `.trinity/config.json` (auto-gitignored), runs preflight checks, proves it can\nreach the backend, and installs a background service that runs on boot. Re-running it rotates the\nrelay and reloads the service. Flags:\n\n- `--foreground` — run in the terminal instead of installing a service.\n- `--no-service` — write config only; start it yourself later.\n\nWithin seconds the dashboard shows the daemon as **connected**; your first captured coding\nsession appears there too.\n\n## Provisioning a relay URL (dashboard or API)\n\nThe daemon authenticates with a per-developer **relay token** the backend mints. Normally you\nclick **Connect IDE** on the People screen and copy the command. Via API:\n\n```bash\nAPI=http://localhost:8080\nTOK=<your bearer token>          # from /auth/login or /auth/signup\nPID=<your project id>            # from /projects\n\nPERSON=$(curl -s -X POST \"$API/people\" -H \"Authorization: Bearer $TOK\" \\\n  -H 'content-type: application/json' -d '{\"email\":\"you@example.com\",\"name\":\"You\"}' | jq -r .person.id)\n\nRELAY=$(curl -s -X POST \"$API/people/$PERSON/relay?projectId=$PID\" \\\n  -H \"Authorization: Bearer $TOK\" | jq -r .relay.ingestUrl)\necho \"$RELAY\"                    # e.g. http://localhost:8080/ingest/hook/<token>\n```\n\n> The returned `ingestUrl` uses the server's `INGEST_PUBLIC_URL` if set (e.g. a Cloudflare\n> tunnel). Running the daemon and backend on the same laptop, you can swap the host for\n> `http://localhost:8080` — keep the `/ingest/hook/<token>` path.\n\nSessions land in the project the relay token is scoped to — open that project's **Activity Log**\nor **People → sessions** in the dashboard, or Ask about what you worked on.\n\n## CLI\n\n```\ntrinity-daemon onboard [dir] --relay <url>   config + service + connectivity, one shot\ntrinity-daemon init  [dir] [--relay <url>]   write .trinity/config.json\ntrinity-daemon update-config [dir] --relay <url>\n                                              update an existing relay URL\ntrinity-daemon watch [dir]                   watch the repo and ship summaries\ntrinity-daemon install-service   [dir]       run on boot (macOS LaunchAgent)\ntrinity-daemon restart [dir] | restart-service   rebuild + reload the service\ntrinity-daemon uninstall-service [dir]       remove the boot service\ntrinity-daemon update [--force]              fetch the latest npm version + reload the service\ntrinity-daemon [dir]                         alias for `watch`\n```\n\nThe lower-level `init` / `watch` / `install-service` commands stay for power users; `onboard`\ncomposes them into one idempotent step.\n\n## Updating\n\nThe background service runs a version-pinned copy, so it doesn't pick up new npm releases on its\nown. To upgrade:\n\n```bash\nnpx -y @atheon-labs/trinity-daemon@latest update\n```\n\n`update` fetches the latest published version from npm (just `fetch` + the system `tar` — no npm\nCLI needed), stages it in `~/.trinity/bin/`, and re-points + reloads every installed background\nservice onto it. Add `--force` to re-download and reload even when already on the latest version.\n\nA running daemon **checks npm on startup and once a day** and logs an **\"update available\"** notice\nwhen a newer version is published, so long-lived services don't silently fall behind. Applying it\nstays the explicit `update` command by default. To let a daemon **update itself unattended**, set\n`\"autoUpdate\": true` in its `.trinity/config.json` — on detecting a newer version it installs it and\nreloads its own service automatically.\n\n## Build from source\n\n```bash\nnpm install\nnpm run build            # → dist/index.js (single bundled file; bin: trinity-daemon)\nnpm test\n# or run from source: npm run dev -- watch /path/to/repo\n```\n\n## Privacy\n\n- Only paths **under** the repo are buffered; file contents are never read (git `diff --stat` only).\n- `.gitignore` + `.trinityignore` are honored; secrets (`.env*`, `*.pem`, `*.key`, `id_rsa`,\n  `.npmrc`, `.netrc`, …) are **always** blocked.\n- A **send-log** prints before every flush, so you always see exactly what leaves the machine.\n- On startup the daemon sends a tiny connectivity ping (version + a daily-keyed id — no repo\n  path, email, branch, or file names) so the dashboard can show it as connected immediately.\n\n## Config (`.trinity/config.json`)\n\n```json\n{\n  \"relayUrl\": \"http://localhost:8080/ingest/hook/<token>\",\n  \"repoPath\": \"/path/to/repo\",\n  \"flushIntervalMs\": 300000,\n  \"autoUpdate\": false,\n  \"mirrorRelayUrls\": [\"http://localhost:8080/ingest/hook/<dev-token>\"]\n}\n```\n\n`autoUpdate` (optional, default `false`) lets a running daemon install newer published versions and\nreload its own service without a manual `update`.\n\n`mirrorRelayUrls` (optional) sends a **best-effort copy** of everything — sessions, connectivity\npings, worktree provenance — to each extra relay URL, e.g. a local dev stack alongside prod. Each\nentry is a full tokenized relay URL minted by that backend's own dashboard. Mirrors are strictly\nfire-and-forget: only the primary `relayUrl`'s response decides whether a flush is committed or\nretried, so a dead mirror can never stall or roll back real ingestion. Mirrors may miss windows\n(that's the deal); both backends dedupe re-sends on `external_id`. Mirror endpoints appear\n(token-masked) in the send-log.\n\nManage mirrors from the CLI — changes apply live (an installed background service is restarted;\na foreground `watch` needs a manual restart):\n\n```bash\ntrinity-daemon mirror add \"http://localhost:8080/ingest/hook/<dev-token>\"\ntrinity-daemon mirror list\ntrinity-daemon mirror remove \"http://localhost:8080/ingest/hook/<dev-token>\"\n```\n\n`mirror add` probes the new mirror with a hello ping but only warns if it's unreachable — a\nmirror is allowed to be down; that's the whole design.\n","readmeFilename":"README.md"}