{"_id":"@arlopass/bridge","name":"@arlopass/bridge","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@arlopass/bridge","version":"0.1.0","license":"MIT","type":"module","publishConfig":{"access":"public","provenance":true},"repository":{"type":"git","url":"git+https://github.com/arlopass/arlopass.git","directory":"apps/bridge"},"homepage":"https://github.com/arlopass/arlopass/tree/main/apps/bridge#readme","bugs":{"url":"https://github.com/arlopass/arlopass/issues"},"bin":{"arlopass-bridge":"dist/main.js"},"main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit","lint":"eslint \"src/**/*.ts\"","test":"vitest run --passWithNoTests"},"dependencies":{"@arlopass/audit":"workspace:*","@arlopass/policy":"workspace:*","@arlopass/protocol":"workspace:*","@arlopass/telemetry":"workspace:*"},"_id":"@arlopass/bridge@0.1.0","gitHead":"524008c81190adecca51ec54fbe99d77ebdd056f","description":"Local native messaging daemon that routes requests between the Arlopass browser extension and provider adapters.","_nodeVersion":"22.22.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-TlJ95LpS3G8xqu2wbIFG0JdlJsCHkM3sWiaam5BiHYGycJOQM4+oDoiy3b2IXuTW/J9FHsH37i2uoVzAop8T5A==","shasum":"b119aeea8d1550bee524b8080ac614a6881f4f1e","tarball":"https://registry.npmjs.org/@arlopass/bridge/-/bridge-0.1.0.tgz","fileCount":158,"unpackedSize":956547,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@arlopass%2fbridge@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCVSMgeVYlDfey1PQQwLJUG3FlyxcW01NPEXQiD+g3glAIhAKg4H2CEKfDUiQ0I+d4+r+EMecH9Bo0z/Va8LzYBS5LJ"}]},"_npmUser":{"name":"davidszakacs","email":"szakacs_david@hotmail.com"},"directories":{},"maintainers":[{"name":"davidszakacs","email":"szakacs_david@hotmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/bridge_0.1.0_1774820820993_0.6888556668934565"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-29T21:47:00.936Z","0.1.0":"2026-03-29T21:47:01.236Z","modified":"2026-03-29T21:47:01.635Z"},"maintainers":[{"name":"davidszakacs","email":"szakacs_david@hotmail.com"}],"description":"Local native messaging daemon that routes requests between the Arlopass browser extension and provider adapters.","homepage":"https://github.com/arlopass/arlopass/tree/main/apps/bridge#readme","repository":{"type":"git","url":"git+https://github.com/arlopass/arlopass.git","directory":"apps/bridge"},"bugs":{"url":"https://github.com/arlopass/arlopass/issues"},"license":"MIT","readme":"# @arlopass/bridge\n\nLocal native messaging daemon that routes requests between the Arlopass browser extension and provider adapters.\n\n## Overview\n\nThe bridge is the authoritative enforcement point for the Arlopass security model. It runs on the user's machine, communicates with the extension via Chrome's Native Messaging protocol (stdio), and dispatches requests to the appropriate adapter (Ollama, Claude, CLI tools, cloud providers).\n\n## Responsibilities\n\n- **Handshake authentication** — HMAC challenge/response with ephemeral session keys\n- **Session management** — Session key lifecycle, grant synchronization\n- **Policy enforcement** — Runtime policy checks (authoritative, not just UX preflight)\n- **Request routing** — Envelope validation and dispatch to the correct executor\n- **Provider connections** — Cloud provider discovery, token management, model listing\n- **Audit logging** — Decision recording for compliance\n\n## Message Types\n\n| Category | Messages |\n|----------|----------|\n| Handshake | `handshake.challenge`, `handshake.verify` |\n| Grants | `grant.sync`, `grant.revoke` |\n| Requests | `request.check` |\n| CLI | `cli.models.list`, `cli.thinking-levels.list`, `cli.chat.execute` |\n| Cloud | `cloud.connection.*`, `cloud.chat.execute`, `cloud.models.discover` |\n\n## Running the Bridge\n\n### Development\n\n```bash\n# Using the dev runner (recommended)\npnpm run dev:bridge\n\n# Or manually\nnode --loader ./scripts/dev/ts-js-specifier-loader.mjs ./apps/bridge/src/main.ts\n```\n\n### Environment Variables\n\nThe bridge generates its own signing key automatically on first run and persists it to `bridge-state.json`. No shared secret is required.\n\n| Variable | Required | Description |\n|----------|----------|-------------|\n| `ARLOPASS_BRIDGE_PAIRING_STATE_PATH` | No | Override path for pairing state file |\n| `ARLOPASS_BRIDGE_HANDSHAKE_STATE_PATH` | No | Override path for handshake state file |\n\n### Native Messaging Host Registration\n\nThe bridge must be registered as a Chrome native messaging host:\n\n```bash\npnpm run dev:register-native-host\n```\n\nThis creates the `com.arlopass.bridge` host manifest and registers it in the Chrome NativeMessagingHosts registry.\n\n## Project Structure\n\n```\nsrc/\n├── bridge-handler.ts     # Main request router\n├── main.ts               # Entry point\n├── native-host.ts        # Native messaging protocol\n├── native-host-manifest.ts\n├── audit/                # Audit event emission\n├── cli/                  # CLI execution logic\n├── cloud/                # Cloud provider connections\n├── permissions/          # Permission evaluation\n├── policy/               # Runtime policy enforcement\n├── secrets/              # OS keychain integration\n└── session/              # Session state management\n```\n\n## Dependencies\n\n- `@arlopass/protocol` — Envelope validation and error taxonomy\n- `@arlopass/policy` — Policy bundle evaluation\n- `@arlopass/audit` — Audit event recording\n- `@arlopass/telemetry` — Request metrics and tracing\n","readmeFilename":"README.md","_rev":"1-868375a01d61e7c9f3f9ffa9ec74bb42"}