@richhardry/codor 0.10.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/LICENSE +21 -0
- package/README.md +293 -0
- package/bin/codor.mjs +7 -0
- package/node_modules/@codor/adapter-antigravity/dist/adapter.d.ts +41 -0
- package/node_modules/@codor/adapter-antigravity/dist/adapter.d.ts.map +1 -0
- package/node_modules/@codor/adapter-antigravity/dist/adapter.js +275 -0
- package/node_modules/@codor/adapter-antigravity/dist/adapter.js.map +1 -0
- package/node_modules/@codor/adapter-antigravity/dist/index.d.ts +2 -0
- package/node_modules/@codor/adapter-antigravity/dist/index.d.ts.map +1 -0
- package/node_modules/@codor/adapter-antigravity/dist/index.js +2 -0
- package/node_modules/@codor/adapter-antigravity/dist/index.js.map +1 -0
- package/node_modules/@codor/adapter-antigravity/package.json +18 -0
- package/node_modules/@codor/adapter-claude-code/dist/adapter.d.ts +94 -0
- package/node_modules/@codor/adapter-claude-code/dist/adapter.d.ts.map +1 -0
- package/node_modules/@codor/adapter-claude-code/dist/adapter.js +785 -0
- package/node_modules/@codor/adapter-claude-code/dist/adapter.js.map +1 -0
- package/node_modules/@codor/adapter-claude-code/dist/index.d.ts +8 -0
- package/node_modules/@codor/adapter-claude-code/dist/index.d.ts.map +1 -0
- package/node_modules/@codor/adapter-claude-code/dist/index.js +5 -0
- package/node_modules/@codor/adapter-claude-code/dist/index.js.map +1 -0
- package/node_modules/@codor/adapter-claude-code/dist/limits-probe.d.ts +18 -0
- package/node_modules/@codor/adapter-claude-code/dist/limits-probe.d.ts.map +1 -0
- package/node_modules/@codor/adapter-claude-code/dist/limits-probe.js +67 -0
- package/node_modules/@codor/adapter-claude-code/dist/limits-probe.js.map +1 -0
- package/node_modules/@codor/adapter-claude-code/dist/peek.d.ts +3 -0
- package/node_modules/@codor/adapter-claude-code/dist/peek.d.ts.map +1 -0
- package/node_modules/@codor/adapter-claude-code/dist/peek.js +128 -0
- package/node_modules/@codor/adapter-claude-code/dist/peek.js.map +1 -0
- package/node_modules/@codor/adapter-claude-code/dist/query.d.ts +9 -0
- package/node_modules/@codor/adapter-claude-code/dist/query.d.ts.map +1 -0
- package/node_modules/@codor/adapter-claude-code/dist/query.js +7 -0
- package/node_modules/@codor/adapter-claude-code/dist/query.js.map +1 -0
- package/node_modules/@codor/adapter-claude-code/dist/translate.d.ts +40 -0
- package/node_modules/@codor/adapter-claude-code/dist/translate.d.ts.map +1 -0
- package/node_modules/@codor/adapter-claude-code/dist/translate.js +505 -0
- package/node_modules/@codor/adapter-claude-code/dist/translate.js.map +1 -0
- package/node_modules/@codor/adapter-claude-code/package.json +18 -0
- package/node_modules/@codor/adapter-codex/dist/adapter.d.ts +105 -0
- package/node_modules/@codor/adapter-codex/dist/adapter.d.ts.map +1 -0
- package/node_modules/@codor/adapter-codex/dist/adapter.js +625 -0
- package/node_modules/@codor/adapter-codex/dist/adapter.js.map +1 -0
- package/node_modules/@codor/adapter-codex/dist/app-server-transport.d.ts +39 -0
- package/node_modules/@codor/adapter-codex/dist/app-server-transport.d.ts.map +1 -0
- package/node_modules/@codor/adapter-codex/dist/app-server-transport.js +186 -0
- package/node_modules/@codor/adapter-codex/dist/app-server-transport.js.map +1 -0
- package/node_modules/@codor/adapter-codex/dist/index.d.ts +8 -0
- package/node_modules/@codor/adapter-codex/dist/index.d.ts.map +1 -0
- package/node_modules/@codor/adapter-codex/dist/index.js +5 -0
- package/node_modules/@codor/adapter-codex/dist/index.js.map +1 -0
- package/node_modules/@codor/adapter-codex/dist/limits-probe.d.ts +18 -0
- package/node_modules/@codor/adapter-codex/dist/limits-probe.d.ts.map +1 -0
- package/node_modules/@codor/adapter-codex/dist/limits-probe.js +87 -0
- package/node_modules/@codor/adapter-codex/dist/limits-probe.js.map +1 -0
- package/node_modules/@codor/adapter-codex/dist/peek.d.ts +3 -0
- package/node_modules/@codor/adapter-codex/dist/peek.d.ts.map +1 -0
- package/node_modules/@codor/adapter-codex/dist/peek.js +98 -0
- package/node_modules/@codor/adapter-codex/dist/peek.js.map +1 -0
- package/node_modules/@codor/adapter-codex/dist/translate.d.ts +17 -0
- package/node_modules/@codor/adapter-codex/dist/translate.d.ts.map +1 -0
- package/node_modules/@codor/adapter-codex/dist/translate.js +286 -0
- package/node_modules/@codor/adapter-codex/dist/translate.js.map +1 -0
- package/node_modules/@codor/adapter-codex/package.json +17 -0
- package/node_modules/@codor/adapter-copilot/dist/adapter.d.ts +40 -0
- package/node_modules/@codor/adapter-copilot/dist/adapter.d.ts.map +1 -0
- package/node_modules/@codor/adapter-copilot/dist/adapter.js +190 -0
- package/node_modules/@codor/adapter-copilot/dist/adapter.js.map +1 -0
- package/node_modules/@codor/adapter-copilot/dist/index.d.ts +4 -0
- package/node_modules/@codor/adapter-copilot/dist/index.d.ts.map +1 -0
- package/node_modules/@codor/adapter-copilot/dist/index.js +3 -0
- package/node_modules/@codor/adapter-copilot/dist/index.js.map +1 -0
- package/node_modules/@codor/adapter-copilot/dist/translate.d.ts +11 -0
- package/node_modules/@codor/adapter-copilot/dist/translate.d.ts.map +1 -0
- package/node_modules/@codor/adapter-copilot/dist/translate.js +184 -0
- package/node_modules/@codor/adapter-copilot/dist/translate.js.map +1 -0
- package/node_modules/@codor/adapter-copilot/package.json +18 -0
- package/node_modules/@codor/adapter-cursor/dist/adapter.d.ts +32 -0
- package/node_modules/@codor/adapter-cursor/dist/adapter.d.ts.map +1 -0
- package/node_modules/@codor/adapter-cursor/dist/adapter.js +179 -0
- package/node_modules/@codor/adapter-cursor/dist/adapter.js.map +1 -0
- package/node_modules/@codor/adapter-cursor/dist/index.d.ts +9 -0
- package/node_modules/@codor/adapter-cursor/dist/index.d.ts.map +1 -0
- package/node_modules/@codor/adapter-cursor/dist/index.js +8 -0
- package/node_modules/@codor/adapter-cursor/dist/index.js.map +1 -0
- package/node_modules/@codor/adapter-cursor/dist/translate.d.ts +15 -0
- package/node_modules/@codor/adapter-cursor/dist/translate.d.ts.map +1 -0
- package/node_modules/@codor/adapter-cursor/dist/translate.js +164 -0
- package/node_modules/@codor/adapter-cursor/dist/translate.js.map +1 -0
- package/node_modules/@codor/adapter-cursor/package.json +17 -0
- package/node_modules/@codor/adapter-gemini/dist/adapter.d.ts +36 -0
- package/node_modules/@codor/adapter-gemini/dist/adapter.d.ts.map +1 -0
- package/node_modules/@codor/adapter-gemini/dist/adapter.js +245 -0
- package/node_modules/@codor/adapter-gemini/dist/adapter.js.map +1 -0
- package/node_modules/@codor/adapter-gemini/dist/index.d.ts +4 -0
- package/node_modules/@codor/adapter-gemini/dist/index.d.ts.map +1 -0
- package/node_modules/@codor/adapter-gemini/dist/index.js +3 -0
- package/node_modules/@codor/adapter-gemini/dist/index.js.map +1 -0
- package/node_modules/@codor/adapter-gemini/dist/translate.d.ts +12 -0
- package/node_modules/@codor/adapter-gemini/dist/translate.d.ts.map +1 -0
- package/node_modules/@codor/adapter-gemini/dist/translate.js +123 -0
- package/node_modules/@codor/adapter-gemini/dist/translate.js.map +1 -0
- package/node_modules/@codor/adapter-gemini/package.json +18 -0
- package/node_modules/@codor/adapter-opencode/dist/adapter.d.ts +42 -0
- package/node_modules/@codor/adapter-opencode/dist/adapter.d.ts.map +1 -0
- package/node_modules/@codor/adapter-opencode/dist/adapter.js +240 -0
- package/node_modules/@codor/adapter-opencode/dist/adapter.js.map +1 -0
- package/node_modules/@codor/adapter-opencode/dist/index.d.ts +4 -0
- package/node_modules/@codor/adapter-opencode/dist/index.d.ts.map +1 -0
- package/node_modules/@codor/adapter-opencode/dist/index.js +3 -0
- package/node_modules/@codor/adapter-opencode/dist/index.js.map +1 -0
- package/node_modules/@codor/adapter-opencode/dist/translate.d.ts +12 -0
- package/node_modules/@codor/adapter-opencode/dist/translate.d.ts.map +1 -0
- package/node_modules/@codor/adapter-opencode/dist/translate.js +144 -0
- package/node_modules/@codor/adapter-opencode/dist/translate.js.map +1 -0
- package/node_modules/@codor/adapter-opencode/package.json +18 -0
- package/node_modules/@codor/cli/dist/artifact.d.ts +33 -0
- package/node_modules/@codor/cli/dist/artifact.d.ts.map +1 -0
- package/node_modules/@codor/cli/dist/artifact.js +183 -0
- package/node_modules/@codor/cli/dist/artifact.js.map +1 -0
- package/node_modules/@codor/cli/dist/attach.d.ts +25 -0
- package/node_modules/@codor/cli/dist/attach.d.ts.map +1 -0
- package/node_modules/@codor/cli/dist/attach.js +133 -0
- package/node_modules/@codor/cli/dist/attach.js.map +1 -0
- package/node_modules/@codor/cli/dist/connection.d.ts +21 -0
- package/node_modules/@codor/cli/dist/connection.d.ts.map +1 -0
- package/node_modules/@codor/cli/dist/connection.js +130 -0
- package/node_modules/@codor/cli/dist/connection.js.map +1 -0
- package/node_modules/@codor/cli/dist/detect.d.ts +14 -0
- package/node_modules/@codor/cli/dist/detect.d.ts.map +1 -0
- package/node_modules/@codor/cli/dist/detect.js +99 -0
- package/node_modules/@codor/cli/dist/detect.js.map +1 -0
- package/node_modules/@codor/cli/dist/index.d.ts +17 -0
- package/node_modules/@codor/cli/dist/index.d.ts.map +1 -0
- package/node_modules/@codor/cli/dist/index.js +24 -0
- package/node_modules/@codor/cli/dist/index.js.map +1 -0
- package/node_modules/@codor/cli/dist/mirror.d.ts +4 -0
- package/node_modules/@codor/cli/dist/mirror.d.ts.map +1 -0
- package/node_modules/@codor/cli/dist/mirror.js +93 -0
- package/node_modules/@codor/cli/dist/mirror.js.map +1 -0
- package/node_modules/@codor/cli/dist/program.d.ts +17 -0
- package/node_modules/@codor/cli/dist/program.d.ts.map +1 -0
- package/node_modules/@codor/cli/dist/program.js +1068 -0
- package/node_modules/@codor/cli/dist/program.js.map +1 -0
- package/node_modules/@codor/cli/dist/runtime-install.d.ts +61 -0
- package/node_modules/@codor/cli/dist/runtime-install.d.ts.map +1 -0
- package/node_modules/@codor/cli/dist/runtime-install.js +122 -0
- package/node_modules/@codor/cli/dist/runtime-install.js.map +1 -0
- package/node_modules/@codor/cli/dist/runtime-paths.d.ts +24 -0
- package/node_modules/@codor/cli/dist/runtime-paths.d.ts.map +1 -0
- package/node_modules/@codor/cli/dist/runtime-paths.js +69 -0
- package/node_modules/@codor/cli/dist/runtime-paths.js.map +1 -0
- package/node_modules/@codor/cli/dist/setup-flow.d.ts +69 -0
- package/node_modules/@codor/cli/dist/setup-flow.d.ts.map +1 -0
- package/node_modules/@codor/cli/dist/setup-flow.js +110 -0
- package/node_modules/@codor/cli/dist/setup-flow.js.map +1 -0
- package/node_modules/@codor/cli/dist/setup-session.d.ts +105 -0
- package/node_modules/@codor/cli/dist/setup-session.d.ts.map +1 -0
- package/node_modules/@codor/cli/dist/setup-session.js +346 -0
- package/node_modules/@codor/cli/dist/setup-session.js.map +1 -0
- package/node_modules/@codor/cli/dist/setup-ui.d.ts +93 -0
- package/node_modules/@codor/cli/dist/setup-ui.d.ts.map +1 -0
- package/node_modules/@codor/cli/dist/setup-ui.js +249 -0
- package/node_modules/@codor/cli/dist/setup-ui.js.map +1 -0
- package/node_modules/@codor/cli/dist/setup.d.ts +108 -0
- package/node_modules/@codor/cli/dist/setup.d.ts.map +1 -0
- package/node_modules/@codor/cli/dist/setup.js +878 -0
- package/node_modules/@codor/cli/dist/setup.js.map +1 -0
- package/node_modules/@codor/cli/dist/terminal-keys.d.ts +26 -0
- package/node_modules/@codor/cli/dist/terminal-keys.d.ts.map +1 -0
- package/node_modules/@codor/cli/dist/terminal-keys.js +70 -0
- package/node_modules/@codor/cli/dist/terminal-keys.js.map +1 -0
- package/node_modules/@codor/cli/dist/terminal-qr.d.ts +2 -0
- package/node_modules/@codor/cli/dist/terminal-qr.d.ts.map +1 -0
- package/node_modules/@codor/cli/dist/terminal-qr.js +30 -0
- package/node_modules/@codor/cli/dist/terminal-qr.js.map +1 -0
- package/node_modules/@codor/cli/dist/up.d.ts +52 -0
- package/node_modules/@codor/cli/dist/up.d.ts.map +1 -0
- package/node_modules/@codor/cli/dist/up.js +178 -0
- package/node_modules/@codor/cli/dist/up.js.map +1 -0
- package/node_modules/@codor/cli/package.json +24 -0
- package/node_modules/@codor/cli/packaging/systemd/codor.service +21 -0
- package/node_modules/@codor/cli/runtime/web/assets/LandingPage-BOmG5kSw.js +31 -0
- package/node_modules/@codor/cli/runtime/web/assets/LedgerPage-CecuTS8-.js +1 -0
- package/node_modules/@codor/cli/runtime/web/assets/NoChannels-CYiBXGQd.js +11 -0
- package/node_modules/@codor/cli/runtime/web/assets/PairingCodeInput-Cr6XDWx-.js +1 -0
- package/node_modules/@codor/cli/runtime/web/assets/PairingPage-CQBWNA2L.js +6 -0
- package/node_modules/@codor/cli/runtime/web/assets/SettingsPage-DGLbSXE7.js +16 -0
- package/node_modules/@codor/cli/runtime/web/assets/StartupUnavailable-DdQBHip_.js +1 -0
- package/node_modules/@codor/cli/runtime/web/assets/arrow-left-BOpjMuRi.js +6 -0
- package/node_modules/@codor/cli/runtime/web/assets/browser-BWQYNOsD.js +6 -0
- package/node_modules/@codor/cli/runtime/web/assets/graph-toBZHlC0.js +1 -0
- package/node_modules/@codor/cli/runtime/web/assets/index-Cxi54Xim.js +408 -0
- package/node_modules/@codor/cli/runtime/web/assets/index-DjwJakJC.css +1 -0
- package/node_modules/@codor/cli/runtime/web/assets/qr-DpynCwP9.js +8 -0
- package/node_modules/@codor/cli/runtime/web/assets/react-C8w-UNLI.js +32 -0
- package/node_modules/@codor/cli/runtime/web/assets/sodium-DtsvMzX9.js +1 -0
- package/node_modules/@codor/cli/runtime/web/codor-192.png +0 -0
- package/node_modules/@codor/cli/runtime/web/codor-512.png +0 -0
- package/node_modules/@codor/cli/runtime/web/codor-apple-touch-180.png +0 -0
- package/node_modules/@codor/cli/runtime/web/codor-favicon.svg +86 -0
- package/node_modules/@codor/cli/runtime/web/codor-mark.svg +86 -0
- package/node_modules/@codor/cli/runtime/web/codor-maskable-512.png +0 -0
- package/node_modules/@codor/cli/runtime/web/codor-og.png +0 -0
- package/node_modules/@codor/cli/runtime/web/fonts/BitcountPropSingle-latin.woff2 +0 -0
- package/node_modules/@codor/cli/runtime/web/fonts/Geist-Variable.woff2 +0 -0
- package/node_modules/@codor/cli/runtime/web/fonts/GeistMono-Variable.woff2 +0 -0
- package/node_modules/@codor/cli/runtime/web/fonts/OFL.txt +93 -0
- package/node_modules/@codor/cli/runtime/web/index.html +53 -0
- package/node_modules/@codor/cli/runtime/web/manifest.webmanifest +1 -0
- package/node_modules/@codor/cli/runtime/web/sw.js +2 -0
- package/node_modules/@codor/protocol/dist/adapter.d.ts +118 -0
- package/node_modules/@codor/protocol/dist/adapter.d.ts.map +1 -0
- package/node_modules/@codor/protocol/dist/adapter.js +15 -0
- package/node_modules/@codor/protocol/dist/adapter.js.map +1 -0
- package/node_modules/@codor/protocol/dist/body.d.ts +14 -0
- package/node_modules/@codor/protocol/dist/body.d.ts.map +1 -0
- package/node_modules/@codor/protocol/dist/body.js +50 -0
- package/node_modules/@codor/protocol/dist/body.js.map +1 -0
- package/node_modules/@codor/protocol/dist/changelog.d.ts +30 -0
- package/node_modules/@codor/protocol/dist/changelog.d.ts.map +1 -0
- package/node_modules/@codor/protocol/dist/changelog.js +19 -0
- package/node_modules/@codor/protocol/dist/changelog.js.map +1 -0
- package/node_modules/@codor/protocol/dist/default-recipient.d.ts +8 -0
- package/node_modules/@codor/protocol/dist/default-recipient.d.ts.map +1 -0
- package/node_modules/@codor/protocol/dist/default-recipient.js +19 -0
- package/node_modules/@codor/protocol/dist/default-recipient.js.map +1 -0
- package/node_modules/@codor/protocol/dist/delivery.d.ts +42 -0
- package/node_modules/@codor/protocol/dist/delivery.d.ts.map +1 -0
- package/node_modules/@codor/protocol/dist/delivery.js +44 -0
- package/node_modules/@codor/protocol/dist/delivery.js.map +1 -0
- package/node_modules/@codor/protocol/dist/events.d.ts +284 -0
- package/node_modules/@codor/protocol/dist/events.d.ts.map +1 -0
- package/node_modules/@codor/protocol/dist/events.js +150 -0
- package/node_modules/@codor/protocol/dist/events.js.map +1 -0
- package/node_modules/@codor/protocol/dist/ids.d.ts +19 -0
- package/node_modules/@codor/protocol/dist/ids.d.ts.map +1 -0
- package/node_modules/@codor/protocol/dist/ids.js +27 -0
- package/node_modules/@codor/protocol/dist/ids.js.map +1 -0
- package/node_modules/@codor/protocol/dist/index.d.ts +14 -0
- package/node_modules/@codor/protocol/dist/index.d.ts.map +1 -0
- package/node_modules/@codor/protocol/dist/index.js +14 -0
- package/node_modules/@codor/protocol/dist/index.js.map +1 -0
- package/node_modules/@codor/protocol/dist/interaction.d.ts +45 -0
- package/node_modules/@codor/protocol/dist/interaction.d.ts.map +1 -0
- package/node_modules/@codor/protocol/dist/interaction.js +33 -0
- package/node_modules/@codor/protocol/dist/interaction.js.map +1 -0
- package/node_modules/@codor/protocol/dist/member.d.ts +146 -0
- package/node_modules/@codor/protocol/dist/member.d.ts.map +1 -0
- package/node_modules/@codor/protocol/dist/member.js +169 -0
- package/node_modules/@codor/protocol/dist/member.js.map +1 -0
- package/node_modules/@codor/protocol/dist/message.d.ts +166 -0
- package/node_modules/@codor/protocol/dist/message.d.ts.map +1 -0
- package/node_modules/@codor/protocol/dist/message.js +95 -0
- package/node_modules/@codor/protocol/dist/message.js.map +1 -0
- package/node_modules/@codor/protocol/dist/observability.d.ts +80 -0
- package/node_modules/@codor/protocol/dist/observability.d.ts.map +1 -0
- package/node_modules/@codor/protocol/dist/observability.js +41 -0
- package/node_modules/@codor/protocol/dist/observability.js.map +1 -0
- package/node_modules/@codor/protocol/dist/room.d.ts +430 -0
- package/node_modules/@codor/protocol/dist/room.d.ts.map +1 -0
- package/node_modules/@codor/protocol/dist/room.js +142 -0
- package/node_modules/@codor/protocol/dist/room.js.map +1 -0
- package/node_modules/@codor/protocol/dist/ws.d.ts +1348 -0
- package/node_modules/@codor/protocol/dist/ws.d.ts.map +1 -0
- package/node_modules/@codor/protocol/dist/ws.js +282 -0
- package/node_modules/@codor/protocol/dist/ws.js.map +1 -0
- package/node_modules/@codor/protocol/package.json +17 -0
- package/node_modules/@codor/switchboard/dist/adapter-registry.d.ts +14 -0
- package/node_modules/@codor/switchboard/dist/adapter-registry.d.ts.map +1 -0
- package/node_modules/@codor/switchboard/dist/adapter-registry.js +175 -0
- package/node_modules/@codor/switchboard/dist/adapter-registry.js.map +1 -0
- package/node_modules/@codor/switchboard/dist/authorization.d.ts +13 -0
- package/node_modules/@codor/switchboard/dist/authorization.d.ts.map +1 -0
- package/node_modules/@codor/switchboard/dist/authorization.js +96 -0
- package/node_modules/@codor/switchboard/dist/authorization.js.map +1 -0
- package/node_modules/@codor/switchboard/dist/blobs.d.ts +17 -0
- package/node_modules/@codor/switchboard/dist/blobs.d.ts.map +1 -0
- package/node_modules/@codor/switchboard/dist/blobs.js +54 -0
- package/node_modules/@codor/switchboard/dist/blobs.js.map +1 -0
- package/node_modules/@codor/switchboard/dist/collaboration.d.ts +115 -0
- package/node_modules/@codor/switchboard/dist/collaboration.d.ts.map +1 -0
- package/node_modules/@codor/switchboard/dist/collaboration.js +123 -0
- package/node_modules/@codor/switchboard/dist/collaboration.js.map +1 -0
- package/node_modules/@codor/switchboard/dist/continuation.d.ts +33 -0
- package/node_modules/@codor/switchboard/dist/continuation.d.ts.map +1 -0
- package/node_modules/@codor/switchboard/dist/continuation.js +177 -0
- package/node_modules/@codor/switchboard/dist/continuation.js.map +1 -0
- package/node_modules/@codor/switchboard/dist/crypto/browser-sessions.d.ts +22 -0
- package/node_modules/@codor/switchboard/dist/crypto/browser-sessions.d.ts.map +1 -0
- package/node_modules/@codor/switchboard/dist/crypto/browser-sessions.js +92 -0
- package/node_modules/@codor/switchboard/dist/crypto/browser-sessions.js.map +1 -0
- package/node_modules/@codor/switchboard/dist/crypto/challenge.d.ts +37 -0
- package/node_modules/@codor/switchboard/dist/crypto/challenge.d.ts.map +1 -0
- package/node_modules/@codor/switchboard/dist/crypto/challenge.js +132 -0
- package/node_modules/@codor/switchboard/dist/crypto/challenge.js.map +1 -0
- package/node_modules/@codor/switchboard/dist/crypto/keys.d.ts +41 -0
- package/node_modules/@codor/switchboard/dist/crypto/keys.d.ts.map +1 -0
- package/node_modules/@codor/switchboard/dist/crypto/keys.js +145 -0
- package/node_modules/@codor/switchboard/dist/crypto/keys.js.map +1 -0
- package/node_modules/@codor/switchboard/dist/crypto/pairing.d.ts +53 -0
- package/node_modules/@codor/switchboard/dist/crypto/pairing.d.ts.map +1 -0
- package/node_modules/@codor/switchboard/dist/crypto/pairing.js +182 -0
- package/node_modules/@codor/switchboard/dist/crypto/pairing.js.map +1 -0
- package/node_modules/@codor/switchboard/dist/crypto/roomkeys.d.ts +30 -0
- package/node_modules/@codor/switchboard/dist/crypto/roomkeys.d.ts.map +1 -0
- package/node_modules/@codor/switchboard/dist/crypto/roomkeys.js +101 -0
- package/node_modules/@codor/switchboard/dist/crypto/roomkeys.js.map +1 -0
- package/node_modules/@codor/switchboard/dist/daemon.d.ts +545 -0
- package/node_modules/@codor/switchboard/dist/daemon.d.ts.map +1 -0
- package/node_modules/@codor/switchboard/dist/daemon.js +3907 -0
- package/node_modules/@codor/switchboard/dist/daemon.js.map +1 -0
- package/node_modules/@codor/switchboard/dist/fake-adapter.d.ts +103 -0
- package/node_modules/@codor/switchboard/dist/fake-adapter.d.ts.map +1 -0
- package/node_modules/@codor/switchboard/dist/fake-adapter.js +228 -0
- package/node_modules/@codor/switchboard/dist/fake-adapter.js.map +1 -0
- package/node_modules/@codor/switchboard/dist/index.d.ts +44 -0
- package/node_modules/@codor/switchboard/dist/index.d.ts.map +1 -0
- package/node_modules/@codor/switchboard/dist/index.js +24 -0
- package/node_modules/@codor/switchboard/dist/index.js.map +1 -0
- package/node_modules/@codor/switchboard/dist/ledger/resolve.d.ts +12 -0
- package/node_modules/@codor/switchboard/dist/ledger/resolve.d.ts.map +1 -0
- package/node_modules/@codor/switchboard/dist/ledger/resolve.js +17 -0
- package/node_modules/@codor/switchboard/dist/ledger/resolve.js.map +1 -0
- package/node_modules/@codor/switchboard/dist/ledger/vault.d.ts +47 -0
- package/node_modules/@codor/switchboard/dist/ledger/vault.d.ts.map +1 -0
- package/node_modules/@codor/switchboard/dist/ledger/vault.js +175 -0
- package/node_modules/@codor/switchboard/dist/ledger/vault.js.map +1 -0
- package/node_modules/@codor/switchboard/dist/ledger/watch.d.ts +73 -0
- package/node_modules/@codor/switchboard/dist/ledger/watch.d.ts.map +1 -0
- package/node_modules/@codor/switchboard/dist/ledger/watch.js +232 -0
- package/node_modules/@codor/switchboard/dist/ledger/watch.js.map +1 -0
- package/node_modules/@codor/switchboard/dist/local-dirs.d.ts +14 -0
- package/node_modules/@codor/switchboard/dist/local-dirs.d.ts.map +1 -0
- package/node_modules/@codor/switchboard/dist/local-dirs.js +40 -0
- package/node_modules/@codor/switchboard/dist/local-dirs.js.map +1 -0
- package/node_modules/@codor/switchboard/dist/local-socket.d.ts +3 -0
- package/node_modules/@codor/switchboard/dist/local-socket.d.ts.map +1 -0
- package/node_modules/@codor/switchboard/dist/local-socket.js +16 -0
- package/node_modules/@codor/switchboard/dist/local-socket.js.map +1 -0
- package/node_modules/@codor/switchboard/dist/pricing.d.ts +32 -0
- package/node_modules/@codor/switchboard/dist/pricing.d.ts.map +1 -0
- package/node_modules/@codor/switchboard/dist/pricing.js +64 -0
- package/node_modules/@codor/switchboard/dist/pricing.js.map +1 -0
- package/node_modules/@codor/switchboard/dist/process-liveness.d.ts +2 -0
- package/node_modules/@codor/switchboard/dist/process-liveness.d.ts.map +1 -0
- package/node_modules/@codor/switchboard/dist/process-liveness.js +9 -0
- package/node_modules/@codor/switchboard/dist/process-liveness.js.map +1 -0
- package/node_modules/@codor/switchboard/dist/push/producer.d.ts +54 -0
- package/node_modules/@codor/switchboard/dist/push/producer.d.ts.map +1 -0
- package/node_modules/@codor/switchboard/dist/push/producer.js +168 -0
- package/node_modules/@codor/switchboard/dist/push/producer.js.map +1 -0
- package/node_modules/@codor/switchboard/dist/push/subscriptions.d.ts +29 -0
- package/node_modules/@codor/switchboard/dist/push/subscriptions.d.ts.map +1 -0
- package/node_modules/@codor/switchboard/dist/push/subscriptions.js +83 -0
- package/node_modules/@codor/switchboard/dist/push/subscriptions.js.map +1 -0
- package/node_modules/@codor/switchboard/dist/redact.d.ts +11 -0
- package/node_modules/@codor/switchboard/dist/redact.d.ts.map +1 -0
- package/node_modules/@codor/switchboard/dist/redact.js +65 -0
- package/node_modules/@codor/switchboard/dist/redact.js.map +1 -0
- package/node_modules/@codor/switchboard/dist/residency.d.ts +110 -0
- package/node_modules/@codor/switchboard/dist/residency.d.ts.map +1 -0
- package/node_modules/@codor/switchboard/dist/residency.js +587 -0
- package/node_modules/@codor/switchboard/dist/residency.js.map +1 -0
- package/node_modules/@codor/switchboard/dist/router.d.ts +120 -0
- package/node_modules/@codor/switchboard/dist/router.d.ts.map +1 -0
- package/node_modules/@codor/switchboard/dist/router.js +198 -0
- package/node_modules/@codor/switchboard/dist/router.js.map +1 -0
- package/node_modules/@codor/switchboard/dist/server.d.ts +50 -0
- package/node_modules/@codor/switchboard/dist/server.d.ts.map +1 -0
- package/node_modules/@codor/switchboard/dist/server.js +1425 -0
- package/node_modules/@codor/switchboard/dist/server.js.map +1 -0
- package/node_modules/@codor/switchboard/dist/store.d.ts +534 -0
- package/node_modules/@codor/switchboard/dist/store.d.ts.map +1 -0
- package/node_modules/@codor/switchboard/dist/store.js +2625 -0
- package/node_modules/@codor/switchboard/dist/store.js.map +1 -0
- package/node_modules/@codor/switchboard/dist/transport/hyperswarm.d.ts +59 -0
- package/node_modules/@codor/switchboard/dist/transport/hyperswarm.d.ts.map +1 -0
- package/node_modules/@codor/switchboard/dist/transport/hyperswarm.js +183 -0
- package/node_modules/@codor/switchboard/dist/transport/hyperswarm.js.map +1 -0
- package/node_modules/@codor/switchboard/dist/transport/peer.d.ts +87 -0
- package/node_modules/@codor/switchboard/dist/transport/peer.d.ts.map +1 -0
- package/node_modules/@codor/switchboard/dist/transport/peer.js +316 -0
- package/node_modules/@codor/switchboard/dist/transport/peer.js.map +1 -0
- package/node_modules/@codor/switchboard/dist/working-directory.d.ts +2 -0
- package/node_modules/@codor/switchboard/dist/working-directory.d.ts.map +1 -0
- package/node_modules/@codor/switchboard/dist/working-directory.js +26 -0
- package/node_modules/@codor/switchboard/dist/working-directory.js.map +1 -0
- package/node_modules/@codor/switchboard/package.json +33 -0
- package/package.json +58 -0
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import sodium from 'sodium-native';
|
|
2
|
+
import { decodeKey } from '../crypto/keys.js';
|
|
3
|
+
import { redactText } from '../redact.js';
|
|
4
|
+
export const PUSH_BUCKETS = [512, 2_048];
|
|
5
|
+
export const PUSH_PREVIEW_LIMIT = 120;
|
|
6
|
+
export const PUSH_ENVELOPE_OVERHEAD = sodium.crypto_aead_xchacha20poly1305_ietf_NPUBBYTES +
|
|
7
|
+
sodium.crypto_aead_xchacha20poly1305_ietf_ABYTES;
|
|
8
|
+
export const PUSH_DEVICE_ENVELOPE_MAGIC = Buffer.from('WRPUSH1\0', 'utf8');
|
|
9
|
+
export const PUSH_SEALED_ROOM_KEY_BYTES = sodium.crypto_aead_xchacha20poly1305_ietf_KEYBYTES + sodium.crypto_box_SEALBYTES;
|
|
10
|
+
export const PUSH_DEVICE_ENVELOPE_OVERHEAD = PUSH_DEVICE_ENVELOPE_MAGIC.length + 4 + 2 + PUSH_SEALED_ROOM_KEY_BYTES;
|
|
11
|
+
const PUSH_ASSOCIATED_DATA = Buffer.from('codor-push-v1\0', 'utf8');
|
|
12
|
+
const SIGNATURE_DOMAIN = Buffer.from('codor-relay-notify-v1\0', 'utf8');
|
|
13
|
+
function codePointSlice(value, maximum) {
|
|
14
|
+
return [...value].slice(0, maximum).join('');
|
|
15
|
+
}
|
|
16
|
+
export function buildPushPreview(event) {
|
|
17
|
+
return {
|
|
18
|
+
room: event.room,
|
|
19
|
+
msg_id: event.msg_id,
|
|
20
|
+
kind: event.kind,
|
|
21
|
+
preview: codePointSlice(redactText(event.preview), PUSH_PREVIEW_LIMIT),
|
|
22
|
+
...(event.delivery_id && { delivery_id: event.delivery_id }),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export function paddedPushPreview(preview) {
|
|
26
|
+
const encoded = Buffer.from(JSON.stringify(preview), 'utf8');
|
|
27
|
+
const bucket = PUSH_BUCKETS.find((size) => encoded.length + 4 <= size);
|
|
28
|
+
if (bucket === undefined)
|
|
29
|
+
throw new Error('push preview exceeds the largest padding bucket');
|
|
30
|
+
const padded = Buffer.alloc(bucket);
|
|
31
|
+
padded.writeUInt32BE(encoded.length, 0);
|
|
32
|
+
encoded.copy(padded, 4);
|
|
33
|
+
if (encoded.length + 4 < padded.length) {
|
|
34
|
+
sodium.randombytes_buf(padded.subarray(encoded.length + 4));
|
|
35
|
+
}
|
|
36
|
+
return padded;
|
|
37
|
+
}
|
|
38
|
+
// harn:assume push-previews-redacted-pad-then-sealed ref=producer-pad-seal-sign
|
|
39
|
+
export function sealPushPreview(preview, roomKey) {
|
|
40
|
+
const padded = paddedPushPreview(preview);
|
|
41
|
+
const nonce = Buffer.alloc(sodium.crypto_aead_xchacha20poly1305_ietf_NPUBBYTES);
|
|
42
|
+
sodium.randombytes_buf(nonce);
|
|
43
|
+
const ciphertext = Buffer.alloc(padded.length + sodium.crypto_aead_xchacha20poly1305_ietf_ABYTES);
|
|
44
|
+
sodium.crypto_aead_xchacha20poly1305_ietf_encrypt(ciphertext, padded, PUSH_ASSOCIATED_DATA, null, nonce, roomKey);
|
|
45
|
+
return Buffer.concat([nonce, ciphertext]);
|
|
46
|
+
}
|
|
47
|
+
// harn:assume push-room-key-rotation-reaches-surviving-devices ref=device-key-wrapped-push
|
|
48
|
+
export function wrapPushForDevice(sealedPreview, sealedRoomKey, generation) {
|
|
49
|
+
if (!Number.isSafeInteger(generation) || generation < 1 || generation > 0xffff_ffff) {
|
|
50
|
+
throw new Error('room key generation is invalid');
|
|
51
|
+
}
|
|
52
|
+
const key = Buffer.from(sealedRoomKey, 'base64url');
|
|
53
|
+
if (key.length !== PUSH_SEALED_ROOM_KEY_BYTES || key.toString('base64url') !== sealedRoomKey) {
|
|
54
|
+
throw new Error('sealed room key is invalid');
|
|
55
|
+
}
|
|
56
|
+
const header = Buffer.alloc(PUSH_DEVICE_ENVELOPE_MAGIC.length + 6);
|
|
57
|
+
PUSH_DEVICE_ENVELOPE_MAGIC.copy(header);
|
|
58
|
+
header.writeUInt32BE(generation, PUSH_DEVICE_ENVELOPE_MAGIC.length);
|
|
59
|
+
header.writeUInt16BE(key.length, PUSH_DEVICE_ENVELOPE_MAGIC.length + 4);
|
|
60
|
+
return Buffer.concat([header, key, sealedPreview]);
|
|
61
|
+
}
|
|
62
|
+
// harn:end push-room-key-rotation-reaches-surviving-devices
|
|
63
|
+
function canonicalNotifyBytes(body, auth) {
|
|
64
|
+
return Buffer.concat([
|
|
65
|
+
SIGNATURE_DOMAIN,
|
|
66
|
+
Buffer.from(JSON.stringify({
|
|
67
|
+
sender: auth.sender,
|
|
68
|
+
timestamp: auth.timestamp,
|
|
69
|
+
subscription: {
|
|
70
|
+
endpoint: body.subscription.endpoint,
|
|
71
|
+
expirationTime: body.subscription.expirationTime ?? null,
|
|
72
|
+
keys: {
|
|
73
|
+
p256dh: body.subscription.keys.p256dh,
|
|
74
|
+
auth: body.subscription.keys.auth,
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
sealed: body.sealed,
|
|
78
|
+
ttl: body.ttl,
|
|
79
|
+
}), 'utf8'),
|
|
80
|
+
]);
|
|
81
|
+
}
|
|
82
|
+
function relayEndpoint(relayUrl) {
|
|
83
|
+
const url = new URL(relayUrl);
|
|
84
|
+
const local = url.hostname === '127.0.0.1' || url.hostname === 'localhost' || url.hostname === '::1';
|
|
85
|
+
if (url.protocol !== 'https:' && !(local && url.protocol === 'http:')) {
|
|
86
|
+
throw new Error('relay_url must use https except on localhost');
|
|
87
|
+
}
|
|
88
|
+
url.pathname = `${url.pathname.replace(/\/$/, '')}/notify`;
|
|
89
|
+
url.search = '';
|
|
90
|
+
url.hash = '';
|
|
91
|
+
return url.toString();
|
|
92
|
+
}
|
|
93
|
+
// harn:assume push-configuration-and-failures-are-visible ref=push-delivery-diagnostics
|
|
94
|
+
export class PushProducer {
|
|
95
|
+
options;
|
|
96
|
+
request;
|
|
97
|
+
now;
|
|
98
|
+
ttl;
|
|
99
|
+
endpoint;
|
|
100
|
+
constructor(options) {
|
|
101
|
+
this.options = options;
|
|
102
|
+
this.request = options.fetch ?? fetch;
|
|
103
|
+
this.now = options.now ?? Date.now;
|
|
104
|
+
this.ttl = options.ttl ?? 60;
|
|
105
|
+
this.endpoint = options.relayUrl ? relayEndpoint(options.relayUrl) : undefined;
|
|
106
|
+
}
|
|
107
|
+
get enabled() {
|
|
108
|
+
return this.endpoint !== undefined;
|
|
109
|
+
}
|
|
110
|
+
async notify(event) {
|
|
111
|
+
if (!this.endpoint)
|
|
112
|
+
return [{ status: 'disabled' }];
|
|
113
|
+
if (event.target_human_ids.length === 0)
|
|
114
|
+
return [{ status: 'ignored' }];
|
|
115
|
+
const records = this.options.subscriptions.list();
|
|
116
|
+
if (records.length === 0)
|
|
117
|
+
return [];
|
|
118
|
+
const preview = buildPushPreview(event);
|
|
119
|
+
const sealed = sealPushPreview(preview, this.options.roomKeys.roomKey(event.room));
|
|
120
|
+
return Promise.all(records.map((record) => {
|
|
121
|
+
const roomKey = this.options.roomKeys.sealedFor(record.device_id)
|
|
122
|
+
.find((candidate) => candidate.room === event.room);
|
|
123
|
+
if (!roomKey)
|
|
124
|
+
return {
|
|
125
|
+
device_id: record.device_id,
|
|
126
|
+
status: 'ignored',
|
|
127
|
+
};
|
|
128
|
+
return this.send(this.endpoint, record, wrapPushForDevice(sealed, roomKey.sealed_key, roomKey.generation));
|
|
129
|
+
}));
|
|
130
|
+
}
|
|
131
|
+
async send(endpoint, record, sealed) {
|
|
132
|
+
const body = {
|
|
133
|
+
subscription: record.subscription,
|
|
134
|
+
sealed: sealed.toString('base64'),
|
|
135
|
+
ttl: this.ttl,
|
|
136
|
+
};
|
|
137
|
+
const sender = this.options.identity.sign_public_key;
|
|
138
|
+
const timestamp = String(this.now());
|
|
139
|
+
const signature = Buffer.alloc(sodium.crypto_sign_BYTES);
|
|
140
|
+
sodium.crypto_sign_detached(signature, canonicalNotifyBytes(body, { sender, timestamp }), decodeKey(this.options.identity.sign_secret_key, sodium.crypto_sign_SECRETKEYBYTES, 'Ed25519 secret key'));
|
|
141
|
+
try {
|
|
142
|
+
const response = await this.request(endpoint, {
|
|
143
|
+
method: 'POST',
|
|
144
|
+
headers: {
|
|
145
|
+
'content-type': 'application/json',
|
|
146
|
+
'x-codor-sender': sender,
|
|
147
|
+
'x-codor-timestamp': timestamp,
|
|
148
|
+
'x-codor-signature': signature.toString('base64url'),
|
|
149
|
+
},
|
|
150
|
+
body: JSON.stringify(body),
|
|
151
|
+
});
|
|
152
|
+
if (response.status === 410) {
|
|
153
|
+
this.options.subscriptions.remove(record.device_id);
|
|
154
|
+
return { device_id: record.device_id, status: 'expired', http_status: 410 };
|
|
155
|
+
}
|
|
156
|
+
if (!response.ok) {
|
|
157
|
+
return { device_id: record.device_id, status: 'failed', http_status: response.status };
|
|
158
|
+
}
|
|
159
|
+
return { device_id: record.device_id, status: 'sent', http_status: response.status };
|
|
160
|
+
}
|
|
161
|
+
catch {
|
|
162
|
+
return { device_id: record.device_id, status: 'failed', error: 'network_error' };
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
// harn:end push-configuration-and-failures-are-visible
|
|
167
|
+
// harn:end push-previews-redacted-pad-then-sealed
|
|
168
|
+
//# sourceMappingURL=producer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"producer.js","sourceRoot":"","sources":["../../src/push/producer.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,eAAe,CAAC;AAEnC,OAAO,EAAuB,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAO1C,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE,KAAK,CAAU,CAAC;AAClD,MAAM,CAA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,mBAAmB,EAAE,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC;iBACrD;gBACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;aAC3B,CAAC,CAAC;YACH,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;gBAC5B,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;gBACpD,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC;YAC9E,CAAC;YACD,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;gBACjB,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;YACzF,CAAC;YACD,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;QACvF,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC;QACnF,CAAC;IACH,CAAC;CACF;AACD,uDAAuD;AACvD,kDAAkD"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type DeviceKeyStore } from '../crypto/keys.js';
|
|
3
|
+
export declare const WebPushSubscriptionSchema: z.ZodObject<{
|
|
4
|
+
endpoint: z.ZodURL;
|
|
5
|
+
expirationTime: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
6
|
+
keys: z.ZodObject<{
|
|
7
|
+
p256dh: z.ZodString;
|
|
8
|
+
auth: z.ZodString;
|
|
9
|
+
}, z.core.$strict>;
|
|
10
|
+
}, z.core.$strict>;
|
|
11
|
+
export type WebPushSubscription = z.infer<typeof WebPushSubscriptionSchema>;
|
|
12
|
+
export interface DevicePushSubscription {
|
|
13
|
+
device_id: string;
|
|
14
|
+
subscription: WebPushSubscription;
|
|
15
|
+
updated_at: string;
|
|
16
|
+
}
|
|
17
|
+
export declare class PushSubscriptionStore {
|
|
18
|
+
private readonly keys;
|
|
19
|
+
private readonly now;
|
|
20
|
+
private readonly path;
|
|
21
|
+
constructor(dataDir: string, keys: DeviceKeyStore, now?: () => Date);
|
|
22
|
+
register(deviceId: string, input: unknown): DevicePushSubscription;
|
|
23
|
+
remove(deviceId: string): boolean;
|
|
24
|
+
list(): DevicePushSubscription[];
|
|
25
|
+
get(deviceId: string): DevicePushSubscription | undefined;
|
|
26
|
+
private read;
|
|
27
|
+
private write;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=subscriptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../../src/push/subscriptions.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,KAAK,cAAc,EAAoB,MAAM,mBAAmB,CAAC;AAE1E,eAAO,MAAM,yBAAyB;;;;;;;kBASpC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,mBAAmB,CAAC;IAClC,UAAU,EAAE,MAAM,CAAC;CACpB;AAQD,qBAAa,qBAAqB;IAK9B,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,GAAG;IALtB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;gBAG5B,OAAO,EAAE,MAAM,EACE,IAAI,EAAE,cAAc,EACpB,GAAG,GAAE,MAAM,IAAuB;IAQrD,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,sBAAsB;IAiBlE,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAQjC,IAAI,IAAI,sBAAsB,EAAE;IAOhC,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,sBAAsB,GAAG,SAAS;IAIzD,OAAO,CAAC,IAAI;IAeZ,OAAO,CAAC,KAAK;CAGd"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { privateJsonWrite } from '../crypto/keys.js';
|
|
5
|
+
export const WebPushSubscriptionSchema = z.strictObject({
|
|
6
|
+
endpoint: z.url().refine((value) => new URL(value).protocol === 'https:', {
|
|
7
|
+
message: 'push endpoint must use https',
|
|
8
|
+
}),
|
|
9
|
+
expirationTime: z.number().int().nonnegative().nullable().optional(),
|
|
10
|
+
keys: z.strictObject({
|
|
11
|
+
p256dh: z.string().min(1).max(256),
|
|
12
|
+
auth: z.string().min(1).max(128),
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
// harn:assume push-only-for-human-targeted-events ref=paired-device-subscriptions
|
|
16
|
+
export class PushSubscriptionStore {
|
|
17
|
+
keys;
|
|
18
|
+
now;
|
|
19
|
+
path;
|
|
20
|
+
constructor(dataDir, keys, now = () => new Date()) {
|
|
21
|
+
this.keys = keys;
|
|
22
|
+
this.now = now;
|
|
23
|
+
this.path = join(dataDir, 'crypto', 'push-subscriptions.json');
|
|
24
|
+
if (!existsSync(this.path)) {
|
|
25
|
+
privateJsonWrite(this.path, { version: 1, subscriptions: [] });
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
register(deviceId, input) {
|
|
29
|
+
const peer = this.keys.getPeer(deviceId);
|
|
30
|
+
if (!peer || peer.kind !== 'device')
|
|
31
|
+
throw new Error('push subscriptions require a paired device');
|
|
32
|
+
const subscription = WebPushSubscriptionSchema.parse(input);
|
|
33
|
+
const state = this.read();
|
|
34
|
+
const record = {
|
|
35
|
+
device_id: deviceId,
|
|
36
|
+
subscription,
|
|
37
|
+
updated_at: this.now().toISOString(),
|
|
38
|
+
};
|
|
39
|
+
const index = state.subscriptions.findIndex((item) => item.device_id === deviceId);
|
|
40
|
+
if (index >= 0)
|
|
41
|
+
state.subscriptions[index] = record;
|
|
42
|
+
else
|
|
43
|
+
state.subscriptions.push(record);
|
|
44
|
+
this.write(state);
|
|
45
|
+
return record;
|
|
46
|
+
}
|
|
47
|
+
remove(deviceId) {
|
|
48
|
+
const state = this.read();
|
|
49
|
+
const next = state.subscriptions.filter((item) => item.device_id !== deviceId);
|
|
50
|
+
if (next.length === state.subscriptions.length)
|
|
51
|
+
return false;
|
|
52
|
+
this.write({ version: 1, subscriptions: next });
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
list() {
|
|
56
|
+
return this.read().subscriptions.filter((record) => {
|
|
57
|
+
const peer = this.keys.getPeer(record.device_id);
|
|
58
|
+
return peer?.kind === 'device';
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
get(deviceId) {
|
|
62
|
+
return this.list().find((record) => record.device_id === deviceId);
|
|
63
|
+
}
|
|
64
|
+
read() {
|
|
65
|
+
const parsed = JSON.parse(readFileSync(this.path, 'utf8'));
|
|
66
|
+
if (parsed.version !== 1 || !Array.isArray(parsed.subscriptions)) {
|
|
67
|
+
throw new Error('invalid push subscription file');
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
version: 1,
|
|
71
|
+
subscriptions: parsed.subscriptions.map((record) => ({
|
|
72
|
+
device_id: z.string().min(1).parse(record.device_id),
|
|
73
|
+
subscription: WebPushSubscriptionSchema.parse(record.subscription),
|
|
74
|
+
updated_at: z.iso.datetime().parse(record.updated_at),
|
|
75
|
+
})),
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
write(state) {
|
|
79
|
+
privateJsonWrite(this.path, state);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
// harn:end push-only-for-human-targeted-events
|
|
83
|
+
//# sourceMappingURL=subscriptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscriptions.js","sourceRoot":"","sources":["../../src/push/subscriptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAuB,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1E,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,YAAY,CAAC;IACtD,QAAQ,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,QAAQ,KAAK,QAAQ,EAAE;QACxE,OAAO,EAAE,8BAA8B;KACxC,CAAC;IACF,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACpE,IAAI,EAAE,CAAC,CAAC,YAAY,CAAC;QACnB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;QAClC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;KACjC,CAAC;CACH,CAAC,CAAC;AAeH,kFAAkF;AAClF,MAAM,OAAO,qBAAqB;IAKb;IACA;IALF,IAAI,CAAS;IAE9B,YACE,OAAe,EACE,IAAoB,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,CAAC;YACV,aAAa,EAAE,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;gBACnD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC;gBACpD,YAAY,EAAE,yBAAyB,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC;gBAClE,UAAU,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC;aACtD,CAAC,CAAC;SACJ,CAAC;IACJ,CAAC;IAEO,KAAK,CAAC,KAAuB;QACnC,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACrC,CAAC;CACF;AACD,+CAA+C"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Redaction projection (PRIVACY): applied to every body/event payload BEFORE
|
|
3
|
+
* it is serialized into a WS frame or REST response. Raw content stays in
|
|
4
|
+
* the store and in the blobs on disk — redaction is a serving-side
|
|
5
|
+
* projection, gated per room by `config.redaction_enabled`.
|
|
6
|
+
*/
|
|
7
|
+
export declare const REDACTED = "[redacted]";
|
|
8
|
+
export declare function redactText(text: string): string;
|
|
9
|
+
/** Deep-redacts every string in a JSON-serializable value. */
|
|
10
|
+
export declare function redactValue<T>(value: T): T;
|
|
11
|
+
//# sourceMappingURL=redact.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redact.d.ts","sourceRoot":"","sources":["../src/redact.ts"],"names":[],"mappings":"AACA;;;;;GAKG;AA8BH,eAAO,MAAM,QAAQ,eAAe,CAAC;AAErC,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAY/C;AAED,8DAA8D;AAC9D,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAW1C"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// harn:assume redaction-before-fanout ref=redaction-projection
|
|
2
|
+
/**
|
|
3
|
+
* Redaction projection (PRIVACY): applied to every body/event payload BEFORE
|
|
4
|
+
* it is serialized into a WS frame or REST response. Raw content stays in
|
|
5
|
+
* the store and in the blobs on disk — redaction is a serving-side
|
|
6
|
+
* projection, gated per room by `config.redaction_enabled`.
|
|
7
|
+
*/
|
|
8
|
+
const PATTERNS = [
|
|
9
|
+
// harn:assume pairing-codes-redacted-from-content ref=pairing-code-redaction
|
|
10
|
+
// Pairing codes, in display form and in labeled form.
|
|
11
|
+
//
|
|
12
|
+
// Both patterns reject a candidate that is adjacent to a word character or a
|
|
13
|
+
// hyphen. `\b` does NOT: a hyphen is a non-word character, so `\b[X]{4}-[X]{4}\b`
|
|
14
|
+
// matches the middle groups of a UUID (`…-9fd8-48d3-…`), and ids are what
|
|
15
|
+
// clients use to correlate runs and address deliveries. The bare display form
|
|
16
|
+
// additionally requires the canonical uppercase that `formatPairingCode` emits,
|
|
17
|
+
// because case-insensitively it also matches ordinary hyphenated prose
|
|
18
|
+
// ("self-help", "well-kept"). A code carrying a label is redacted in any case.
|
|
19
|
+
/(?<![\w-])[23456789A-HJ-NP-Z]{4}-[23456789A-HJ-NP-Z]{4}(?![\w-])/g,
|
|
20
|
+
/\b(?:pairing[ _-]?)?code\s*[:=]\s*["']?[23456789A-HJ-NP-Z]{4}-?[23456789A-HJ-NP-Z]{4}["']?(?![\w-])/gi,
|
|
21
|
+
// harn:end pairing-codes-redacted-from-content
|
|
22
|
+
// AWS access key ids
|
|
23
|
+
/\b(?:AKIA|ASIA|ABIA|ACCA)[0-9A-Z]{16}\b/g,
|
|
24
|
+
// Bearer tokens (authorization headers pasted into logs)
|
|
25
|
+
/\bBearer\s+[A-Za-z0-9._~+/=-]{16,}/g,
|
|
26
|
+
// GitHub tokens
|
|
27
|
+
/\bgh[pousr]_[A-Za-z0-9]{20,}\b/g,
|
|
28
|
+
// OpenAI/Anthropic-style secret keys
|
|
29
|
+
/\bsk-[A-Za-z0-9_-]{16,}\b/g,
|
|
30
|
+
// PEM private key blocks
|
|
31
|
+
/-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*?(-----END [A-Z ]*PRIVATE KEY-----|$)/g,
|
|
32
|
+
// Generic KEY=value with a high-entropy-looking value
|
|
33
|
+
/\b([A-Z][A-Z0-9_]*(?:KEY|TOKEN|SECRET|PASSWORD|CREDENTIAL)[A-Z0-9_]*)=("[^"]{12,}"|'[^']{12,}'|[^\s"']{12,})/g,
|
|
34
|
+
];
|
|
35
|
+
export const REDACTED = '[redacted]';
|
|
36
|
+
export function redactText(text) {
|
|
37
|
+
let out = text;
|
|
38
|
+
for (const pattern of PATTERNS) {
|
|
39
|
+
out = out.replace(pattern, (match, ...groups) => {
|
|
40
|
+
// KEY=value keeps the key name for debuggability
|
|
41
|
+
if (typeof groups[0] === 'string' && match.includes('=')) {
|
|
42
|
+
return `${groups[0]}=${REDACTED}`;
|
|
43
|
+
}
|
|
44
|
+
return REDACTED;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return out;
|
|
48
|
+
}
|
|
49
|
+
/** Deep-redacts every string in a JSON-serializable value. */
|
|
50
|
+
export function redactValue(value) {
|
|
51
|
+
if (typeof value === 'string')
|
|
52
|
+
return redactText(value);
|
|
53
|
+
if (Array.isArray(value))
|
|
54
|
+
return value.map((v) => redactValue(v));
|
|
55
|
+
if (value !== null && typeof value === 'object') {
|
|
56
|
+
const out = {};
|
|
57
|
+
for (const [k, v] of Object.entries(value)) {
|
|
58
|
+
out[k] = redactValue(v);
|
|
59
|
+
}
|
|
60
|
+
return out;
|
|
61
|
+
}
|
|
62
|
+
return value;
|
|
63
|
+
}
|
|
64
|
+
// harn:end redaction-before-fanout
|
|
65
|
+
//# sourceMappingURL=redact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redact.js","s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AO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,CAAiB,CAAC;IAClF,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAChD,MAAM,GAAG,GAA4B,EAAE,CAAC;QACxC,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAgC,CAAC,EAAE,CAAC;YACtE,GAAG,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;QAC1B,CAAC;QACD,OAAO,GAAmB,CAAC;IAC7B,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AACD,mCAAmC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import type { HarnessAdapter, Member, ThinkingLevel, WireEvent } from '@codor/protocol';
|
|
2
|
+
import type { HyperswarmTransport } from './transport/hyperswarm.js';
|
|
3
|
+
type AttemptState = 'accepted' | 'started' | 'completed' | 'ambiguous';
|
|
4
|
+
export interface ResidentMember {
|
|
5
|
+
id: string;
|
|
6
|
+
harness: string;
|
|
7
|
+
cwd: string;
|
|
8
|
+
policy?: string;
|
|
9
|
+
model?: string;
|
|
10
|
+
thinking?: ThinkingLevel;
|
|
11
|
+
session_ref?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ResidentDeliveryRequest {
|
|
14
|
+
rpc_id: string;
|
|
15
|
+
room: string;
|
|
16
|
+
member: ResidentMember;
|
|
17
|
+
payload: string;
|
|
18
|
+
trigger_msg: number;
|
|
19
|
+
}
|
|
20
|
+
export interface ResidentAttempt {
|
|
21
|
+
home_peer: string;
|
|
22
|
+
rpc_id: string;
|
|
23
|
+
room: string;
|
|
24
|
+
member: ResidentMember;
|
|
25
|
+
payload: string;
|
|
26
|
+
trigger_msg: number;
|
|
27
|
+
state: AttemptState;
|
|
28
|
+
attempt_count: number;
|
|
29
|
+
events_ref: string;
|
|
30
|
+
acked_event_index: number;
|
|
31
|
+
session_ref?: string;
|
|
32
|
+
}
|
|
33
|
+
export type ResidencyBoundary = 'resident_event_sent' | 'home_complete_before_event_ack';
|
|
34
|
+
export interface ResidencyCoordinatorOptions {
|
|
35
|
+
transport: HyperswarmTransport;
|
|
36
|
+
adapters: HarnessAdapter[];
|
|
37
|
+
journalPath: string;
|
|
38
|
+
blobRoot: string;
|
|
39
|
+
completionAckRetryMs?: number;
|
|
40
|
+
maxPendingCompletionAcks?: number;
|
|
41
|
+
boundaryHook?: (boundary: ResidencyBoundary, detail: {
|
|
42
|
+
rpc_id: string;
|
|
43
|
+
event_index: number;
|
|
44
|
+
event: WireEvent;
|
|
45
|
+
}) => void;
|
|
46
|
+
}
|
|
47
|
+
export interface RemoteDeliverHooks {
|
|
48
|
+
onSessionRef?(sessionRef: string): void;
|
|
49
|
+
lastEventIndex?: number;
|
|
50
|
+
}
|
|
51
|
+
export declare class RemoteAttemptAmbiguousError extends Error {
|
|
52
|
+
readonly rpcId: string;
|
|
53
|
+
constructor(rpcId: string);
|
|
54
|
+
}
|
|
55
|
+
export declare class ResidentAttemptJournal {
|
|
56
|
+
private readonly db;
|
|
57
|
+
private readonly blobs;
|
|
58
|
+
constructor(path: string, blobRoot: string);
|
|
59
|
+
get(homePeer: string, rpcId: string): ResidentAttempt | undefined;
|
|
60
|
+
ensure(homePeer: string, request: ResidentDeliveryRequest): ResidentAttempt;
|
|
61
|
+
begin(homePeer: string, rpcId: string): ResidentAttempt;
|
|
62
|
+
setState(homePeer: string, rpcId: string, state: AttemptState): ResidentAttempt;
|
|
63
|
+
setSessionRef(homePeer: string, rpcId: string, sessionRef: string): void;
|
|
64
|
+
appendEvent(homePeer: string, rpcId: string, event: WireEvent): number;
|
|
65
|
+
events(attempt: ResidentAttempt): WireEvent[];
|
|
66
|
+
acknowledge(homePeer: string, rpcId: string, eventIndex: number): void;
|
|
67
|
+
close(): void;
|
|
68
|
+
}
|
|
69
|
+
export declare class ResidencyCoordinator {
|
|
70
|
+
private readonly options;
|
|
71
|
+
readonly journal: ResidentAttemptJournal;
|
|
72
|
+
private readonly transport;
|
|
73
|
+
private readonly adapters;
|
|
74
|
+
private readonly sessions;
|
|
75
|
+
private readonly activeResidentAttempts;
|
|
76
|
+
private readonly pendingHomeAttempts;
|
|
77
|
+
private readonly completedHomeIndexes;
|
|
78
|
+
private readonly maxPendingCompletionAcks;
|
|
79
|
+
private readonly completionAckTimer;
|
|
80
|
+
private readonly reachabilityHandlers;
|
|
81
|
+
private readonly stopEnvelope;
|
|
82
|
+
private readonly stopPeerState;
|
|
83
|
+
private closed;
|
|
84
|
+
constructor(options: ResidencyCoordinatorOptions);
|
|
85
|
+
registeredAdapters(): {
|
|
86
|
+
id: string;
|
|
87
|
+
capabilities: HarnessAdapter['capabilities'];
|
|
88
|
+
}[];
|
|
89
|
+
isReachable(peerId: string): boolean;
|
|
90
|
+
onReachability(handler: (peerId: string, connected: boolean) => void): () => void;
|
|
91
|
+
deliver(host: string, request: ResidentDeliveryRequest, hooks?: RemoteDeliverHooks): AsyncIterable<WireEvent>;
|
|
92
|
+
close(): Promise<void>;
|
|
93
|
+
private handleEnvelope;
|
|
94
|
+
private handlePeerState;
|
|
95
|
+
private sendDelivery;
|
|
96
|
+
private acceptResidentDelivery;
|
|
97
|
+
private runResidentAttempt;
|
|
98
|
+
private emitResidentEvent;
|
|
99
|
+
private reconcileResident;
|
|
100
|
+
private sendOutcome;
|
|
101
|
+
private handleOutcome;
|
|
102
|
+
private handleRemoteEvent;
|
|
103
|
+
pendingCompletionAckCount(host?: string): number;
|
|
104
|
+
private sendCompletionEventAck;
|
|
105
|
+
private retryCompletionAcks;
|
|
106
|
+
private attemptKey;
|
|
107
|
+
}
|
|
108
|
+
export declare function remoteMemberSpec(member: Member): ResidentMember;
|
|
109
|
+
export {};
|
|
110
|
+
//# sourceMappingURL=residency.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"residency.d.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