{"_id":"@dieulc/pi-office-protocol","_rev":"5-41f61ca9662fcf50f3cdebc7cbe5d774","name":"@dieulc/pi-office-protocol","dist-tags":{"latest":"0.5.0"},"versions":{"0.1.0":{"name":"@dieulc/pi-office-protocol","version":"0.1.0","license":"MIT","_id":"@dieulc/pi-office-protocol@0.1.0","maintainers":[{"name":"dieulc","email":"dieuluucanh@gmail.com"}],"dist":{"shasum":"acf977e4c16300fd7929ed1f96dada44057ff7f2","tarball":"https://registry.npmjs.org/@dieulc/pi-office-protocol/-/pi-office-protocol-0.1.0.tgz","fileCount":3,"integrity":"sha512-Zn03mz3EAYNmad0euekOzbqSDqJBdgMCPK3t44kuBoYdi8Er9pec8/VvnPOGWWrii8dezhvad0GS81T6vxrEPQ==","signatures":[{"sig":"MEUCIQDeK5SR0ljuFIW1cUEjNy5A/NIaePKzmY4T5Q9qv0T4VQIgY01RxKnS9DZvNGmM/QU7vBAAEK3cFCIH4SxNdoBtdr8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6582},"main":"./src/protocol.ts","type":"module","types":"./src/protocol.ts","exports":{".":"./src/protocol.ts"},"gitHead":"27c924c0c23579c12ca7cfb31745bb8d78aeb833","scripts":{"typecheck":"tsc --noEmit"},"_npmUser":{"name":"dieulc","email":"dieuluucanh@gmail.com"},"_npmVersion":"11.13.0","description":"Shared bridge wire protocol between the pi-office-bridge Pi extension and the pi-for-office task-pane add-in.","directories":{},"_nodeVersion":"24.16.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/pi-office-protocol_0.1.0_1788887662402_0.3939607679678834","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@dieulc/pi-office-protocol","version":"0.2.0","license":"MIT","_id":"@dieulc/pi-office-protocol@0.2.0","maintainers":[{"name":"dieulc","email":"dieuluucanh@gmail.com"}],"dist":{"shasum":"9cb33a0518249d0ea3074f240eecdce4894d6665","tarball":"https://registry.npmjs.org/@dieulc/pi-office-protocol/-/pi-office-protocol-0.2.0.tgz","fileCount":3,"integrity":"sha512-9PdWFp+j+vGTJIl7cly7jCyPGA6hl2G5ke195E8fQTJqWPQmH4U9ve1dpEF9oFQSvPlPH82P6YJZQjNpjj7TUA==","signatures":[{"sig":"MEUCIBMTSLAZA4JtiWBG3dBUTjpIiyd6iQOo1Jy1zXFwEf6UAiEAhS1W76kVjNBSGVjz1oUA5Kw3FUa8bcKoJ8ZFCnyiFTI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8371},"main":"./src/protocol.ts","type":"module","types":"./src/protocol.ts","exports":{".":"./src/protocol.ts"},"gitHead":"bd9648ce411d14177c5317b07fc572956d94e5c7","scripts":{"typecheck":"tsc --noEmit"},"_npmUser":{"name":"dieulc","email":"dieuluucanh@gmail.com"},"_npmVersion":"11.13.0","description":"Shared bridge wire protocol between the pi-office-bridge Pi extension and the pi-for-office task-pane add-in.","directories":{},"_nodeVersion":"24.16.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/pi-office-protocol_0.2.0_1789083486463_0.2678172617777661","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@dieulc/pi-office-protocol","version":"0.3.0","license":"MIT","_id":"@dieulc/pi-office-protocol@0.3.0","maintainers":[{"name":"dieulc","email":"dieuluucanh@gmail.com"}],"dist":{"shasum":"67bda13a017ae2fb845bca41de0c62da477e0a06","tarball":"https://registry.npmjs.org/@dieulc/pi-office-protocol/-/pi-office-protocol-0.3.0.tgz","fileCount":4,"integrity":"sha512-mlDkT7b4tbayQWhxnDIoRsuFXPDF6pNDksknJtAGMO7muNgAjF79hzi6nc+RisSp6cQaMD8dXR/BTyeCghITzw==","signatures":[{"sig":"MEQCIAzGPG1Is/5gycRwxVxsMiv5kVIPSBJxmKJ2J5yGVqLmAiAEKx2+9FlFrtQiJ4TmTVHs4linz5x3xgPjlIUzpCh6kA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":56274},"main":"./src/protocol.ts","type":"module","types":"./src/protocol.ts","exports":{".":"./src/protocol.ts","./office-catalog":"./src/office-catalog.ts"},"gitHead":"e0083b35d9984b3688461d116001ee81515f66d2","scripts":{"test":"node --test --experimental-strip-types tests/office-catalog.test.ts","build":"tsc --noEmit","typecheck":"tsc --noEmit"},"_npmUser":{"name":"dieulc","email":"dieuluucanh@gmail.com"},"_npmVersion":"11.13.0","description":"Shared bridge wire protocol + office op catalog between the pi-office-bridge Pi extension and the pi-for-office task-pane add-in.","directories":{},"_nodeVersion":"24.16.0","dependencies":{"typebox":"^1.3.10"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/pi-office-protocol_0.3.0_1789284514371_0.5978619589768139","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@dieulc/pi-office-protocol","version":"0.4.0","license":"MIT","_id":"@dieulc/pi-office-protocol@0.4.0","maintainers":[{"name":"dieulc","email":"dieuluucanh@gmail.com"}],"dist":{"shasum":"bf88467867cbf9ee398ffd23bf5b38cc9d365652","tarball":"https://registry.npmjs.org/@dieulc/pi-office-protocol/-/pi-office-protocol-0.4.0.tgz","fileCount":4,"integrity":"sha512-nEsSnLPG6UwzgYNYwIj343M48NPFQfDUcgE6rHT1pJhVRT30WZ3pa1ALlrGZVPr4RSMSUfIGiD2Q5YGpOVzV0w==","signatures":[{"sig":"MEQCIAI2XfZ5s+qKzI0N5E78DwHD4wrAm2vYGcgszVWJ3C2EAiBQXCshgvJ/NzTYhDcHdf/k29FoxVS7+v+PDHfg0UJ5gg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIHdKytGgiYyKZpNJppnB1psWbzOSE7Y7ggJE0UEEOTgEAiAglXz3W22AcgL6L4c5LhE4claHI3Uet1ImMAxLGopxQg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":61231},"main":"./src/protocol.ts","type":"module","types":"./src/protocol.ts","exports":{".":"./src/protocol.ts","./office-catalog":"./src/office-catalog.ts"},"gitHead":"dd91ed8215794d0ba9d68e975f96be3cbf4c29ba","scripts":{"test":"node --test --experimental-strip-types tests/office-catalog.test.ts","build":"tsc --noEmit","typecheck":"tsc --noEmit"},"_npmUser":{"name":"dieulc","email":"dieuluucanh@gmail.com"},"_npmVersion":"11.13.0","description":"Shared bridge wire protocol + office op catalog between the pi-office-bridge Pi extension and the pi-for-office task-pane add-in.","directories":{},"_nodeVersion":"24.16.0","dependencies":{"typebox":"^1.3.10"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/pi-office-protocol_0.4.0_1789453204536_0.4408491937479768","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"_id":"@dieulc/pi-office-protocol@0.5.0","dist":{"shasum":"995293e9e839f1c3b11e7494e13a8fa9ea29da7c","tarball":"https://registry.npmjs.org/@dieulc/pi-office-protocol/-/pi-office-protocol-0.5.0.tgz","fileCount":4,"integrity":"sha512-nM0ZsZhExd2VBT442D52vV1GnyNwhcVhvY1MOPYFYa1ukxcsVmNbHRNjSdSHYes6+ElzdzuIpIEtDlrqc5JiLw==","signatures":[{"sig":"MEUCIQDo1N5WbcYe14kfX1bZa32tQCroIcG04Bk19LfFs5P+BwIgUisouU4VVoClD/pphTswFQHuiu96/McQp4L+L6fSCE0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHHGcxgShv098XRcEt309JF8f8UULq8DSoxao1e21eKIAiEAulwGw7loBV/GsbqStCXGyolK6FHxQmzU7CtsAOZytIA="}],"unpackedSize":87962},"main":"./src/protocol.ts","name":"@dieulc/pi-office-protocol","type":"module","types":"./src/protocol.ts","exports":{".":"./src/protocol.ts","./office-catalog":"./src/office-catalog.ts"},"gitHead":"b5979294b5d9e43a073a79cf67bcfbed25b17c71","license":"MIT","scripts":{"test":"node --test --experimental-strip-types tests/office-catalog.test.ts tests/protocol.test.ts","build":"tsc --noEmit","typecheck":"tsc --noEmit"},"version":"0.5.0","_npmUser":{"name":"dieulc","email":"dieuluucanh@gmail.com"},"_npmVersion":"11.13.0","description":"Shared bridge wire protocol + office op catalog between the pi-office-bridge Pi extension and the pi-for-office task-pane add-in.","directories":{},"maintainers":[{"name":"dieulc","email":"dieuluucanh@gmail.com"}],"_nodeVersion":"24.16.0","dependencies":{"typebox":"^1.3.10"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-office-protocol_0.5.0_1789825253218_0.35033045279163977"}}},"time":{"created":"2026-09-08T17:14:22.200Z","modified":"2026-09-19T13:40:53.486Z","0.1.0":"2026-09-08T17:14:22.527Z","0.2.0":"2026-09-10T23:38:06.594Z","0.3.0":"2026-09-13T07:28:34.512Z","0.4.0":"2026-09-15T06:20:04.614Z","0.5.0":"2026-09-19T13:40:53.318Z"},"license":"MIT","description":"Shared bridge wire protocol + office op catalog between the pi-office-bridge Pi extension and the pi-for-office task-pane add-in.","maintainers":[{"name":"dieulc","email":"dieuluucanh@gmail.com"}],"readme":"# @dieulc/pi-office-protocol\n\nShared WebSocket wire protocol between the pi-for-office task-pane add-in\n(`packages/add-in/src/bridge/`) and the Pi bridge extension\n(`packages/bridge-extension/`).\n\nHolding the protocol in one package keeps the two halves of the bridge in\nlockstep — a breaking change is one commit, and the end-to-end interop test\n(`packages/bridge-extension/tests/pane-interop.mjs`) proves both sides speak the\nsame format at runtime.\n\n## Messages\n\n- **Client → Server:** `hello`, `ping`, `tool_result`, `user_message`, `status`, `pane_state`, `abort`\n- **Server → Client:** `welcome`, `pong`, `tool_call`, `agent_message` (delta/final), `tool_activity`, `error`\n\n## Protocol v2 (breaking)\n\nv2 adds **document identity and targeting** so the bridge can serve several open\ndocuments of the same host app:\n\n- `hello.document: DocumentIdentity` — **required**. `{ id, name, source }`\n  where `id` is a stable local hash (`url_sha256:…` / `wps_path_sha256:…`) or\n  `null` for unsaved documents, and `source` is one of `\"document.url\"`,\n  `\"wps.activeWorkbook.fullName\"`, `\"unknown\"`. Raw URLs/paths are never sent.\n- `pane_state` (client → server) — best-effort `{ focused?, visible?, activeAt? }`\n  so `document: \"active\"` can resolve to the document the user is looking at.\n- `tool_call.documentId?: string` — the document the call was routed to (echoed\n  for logging and pane-side validation).\n- `agent_message` final gains `promptId?: string` — correlates a reply with the\n  pane prompt that triggered it.\n- `OFFICE_TARGET_PARAM = \"document\"` — the tool-argument key that selects a\n  target; the server strips it before forwarding the call to a pane.\n\nA v1 client is rejected at the handshake with `protocol_mismatch`; update both\nhalves together (protocol 0.4.0, bridge 0.4.0).\n\n## Protocol v3 (additive)\n\nv3 makes a pane prompt feel live and interruptible. It is **additive**: a v2\npane is still accepted and simply receives final replies only.\n\n- `agent_message` **delta** frames are now actually produced: while the agent\n  answers a pane prompt the server streams\n  `{ type: \"agent_message\", kind: \"delta\", text, promptId?, messageId? }`,\n  coalesced to stay under `MAX_TEXT_CHARS`. Deltas are **display-only**: the\n  concatenation is not guaranteed to equal the final text, so the pane replaces\n  its live buffer with `kind: \"final\"` when it arrives.\n- `abort` (client → server) — `{ type: \"abort\", promptId? }` stops the run\n  answering that prompt (or whatever run is in flight for this pane when\n  `promptId` is omitted). A v2 server ignores the frame, so a Stop button must\n  stay usable if the reply keeps arriving.\n- `MIN_SUPPORTED_PROTOCOL_VERSION = 2` and `isProtocolVersionSupported()` — the\n  server accepts the whole `[MIN_SUPPORTED_PROTOCOL_VERSION, BRIDGE_PROTOCOL_VERSION]`\n  window instead of demanding an exact match.\n- Deltas are only sent to panes whose `hello.protocolVersion >= 3`; the server\n  never sends a delta to a v2 pane (which would drop it).\n\nUpdate both halves together on a breaking change; an additive change may ship\nprotocol-first (protocol 0.5.0, bridge 0.5.0).\n\n## Version & capabilities\n\n`BRIDGE_PROTOCOL_VERSION` is bumped only on **breaking** message-shape changes.\nAdditive fields keep both halves compatible:\n\n- `welcome.serverVersion?: string` — the bridge extension's package version.\n- `welcome.capabilities?: BridgeCapability[]` — currently `\"http-health\"`\n  (the server answers `GET /health` with JSON metadata), `\"agent-deltas\"`\n  (the server streams `agent_message` deltas), and `\"client-abort\"` (the server\n  honours the `abort` frame). Prefer a capability check over a version\n  comparison so a peer's features are discoverable at runtime.\n\nBoth are **optional**. An absent `capabilities` array (or absent\n`serverVersion`) means the peer is a legacy 0.1.0 bridge: clients must degrade\ngracefully (the live WebSocket status is still authoritative) instead of\nassuming the server is unreachable.\n\nSee `src/protocol.ts` for the typed shapes.\n","readmeFilename":"README.md"}