{"_id":"@dogsvr/cl-grpc","_rev":"6-708d94741c02841af33b26ea7db9915c","name":"@dogsvr/cl-grpc","dist-tags":{"latest":"0.4.2"},"versions":{"0.0.1":{"name":"@dogsvr/cl-grpc","version":"0.0.1","author":{"name":"rowanzhu"},"license":"MIT","_id":"@dogsvr/cl-grpc@0.0.1","maintainers":[{"name":"rowanzhu","email":"rowanzhu@gmail.com"}],"homepage":"https://github.com/dogsvr/cl-grpc#readme","bugs":{"url":"https://github.com/dogsvr/cl-grpc/issues"},"dist":{"shasum":"8cf87ff98071740811a525c8f21428f118ffb591","tarball":"https://registry.npmjs.org/@dogsvr/cl-grpc/-/cl-grpc-0.0.1.tgz","fileCount":6,"integrity":"sha512-FeuLQo5iCpRXatqlenwWWSl2E6oXCXU2oBp1XXtb9kjuCbA54qMi8AVQKjk10jNqW6LrWbAPRCBx7uaXiM/pZQ==","signatures":[{"sig":"MEUCIBCeJsOe4fwNcjiKcsdfVmcm8G/9xPG6KnJi+Zbj3f5zAiEAs/+xmi0xD33kuTz9uZt7tILt200hCXWAEWKFTc1cC+k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12263},"main":"index.js","types":"./index.d.ts","gitHead":"e275f161a026eb7d21f04b9456a193007c6fda2c","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rm -rf dist && mkdir dist && cp package.json README.md dist && npx tsc","protoc":"grpc_tools_node_protoc --plugin=protoc-gen-ts_proto=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=./src/proto --ts_proto_opt=outputServices=nice-grpc,outputServices=generic-definitions,useExactTypes=false --proto_path=./src/proto ./src/proto/common_api.proto"},"_npmUser":{"name":"rowanzhu","email":"rowanzhu@gmail.com"},"repository":{"url":"git+https://github.com/dogsvr/cl-grpc.git","type":"git"},"_npmVersion":"8.11.0","description":"","directories":{},"_nodeVersion":"16.15.1","dependencies":{"long":"^5.2.3","nice-grpc":"^2.1.10","protobufjs":"^7.4.0"},"_hasShrinkwrap":false,"devDependencies":{"ts-proto":"^2.4.2","grpc-tools":"^1.12.4","@dogsvr/dogsvr":"^0.0.1"},"_npmOperationalInternal":{"tmp":"tmp/cl-grpc_0.0.1_1733055615204_0.8346128007121916","host":"s3://npm-registry-packages"}},"0.0.2":{"name":"@dogsvr/cl-grpc","version":"0.0.2","author":{"name":"rowanzhu"},"license":"MIT","_id":"@dogsvr/cl-grpc@0.0.2","maintainers":[{"name":"rowanzhu","email":"rowanzhu@gmail.com"}],"homepage":"https://github.com/dogsvr/cl-grpc#readme","bugs":{"url":"https://github.com/dogsvr/cl-grpc/issues"},"dist":{"shasum":"96745db83b27aa197790fe0abf4176a76a3b2b4e","tarball":"https://registry.npmjs.org/@dogsvr/cl-grpc/-/cl-grpc-0.0.2.tgz","fileCount":6,"integrity":"sha512-kOjRfWcrwmaX6aDB9LBgwFYra6QypUUwHKOFGTYEuDV4AhAqxBajiuX5/SZ9scSuwd6HbUQoBnewkZHCnBnlsA==","signatures":[{"sig":"MEUCIQDzuAnZPIi5RUK6Y9KawrmN7PzZDMsnAY29WvOaUtV98wIgaorj7xJ9sDA2420mtE0WAowMXXUKTF5FhEUSHCmxT+E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":15005},"main":"index.js","types":"./index.d.ts","gitHead":"a1c0ede9b561d5b9b08761ce0e02e637ca4411c0","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rm -rf dist && mkdir dist && cp package.json README.md dist && npx tsc","protoc":"grpc_tools_node_protoc --plugin=protoc-gen-ts_proto=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=./src/proto --ts_proto_opt=outputServices=nice-grpc,outputServices=generic-definitions,useExactTypes=false --proto_path=./src/proto ./src/proto/common_api.proto"},"_npmUser":{"name":"rowanzhu","email":"rowanzhu@gmail.com"},"repository":{"url":"git+https://github.com/dogsvr/cl-grpc.git","type":"git"},"_npmVersion":"8.11.0","description":"","directories":{},"_nodeVersion":"16.15.1","dependencies":{"long":"^5.2.3","nice-grpc":"^2.1.10","protobufjs":"^7.4.0","@bufbuild/protobuf":"^2.2.2"},"_hasShrinkwrap":false,"devDependencies":{"ts-proto":"^2.4.2","grpc-tools":"^1.12.4","@dogsvr/dogsvr":"latest"},"_npmOperationalInternal":{"tmp":"tmp/cl-grpc_0.0.2_1733651469923_0.8586644585575569","host":"s3://npm-registry-packages"}},"0.0.4":{"name":"@dogsvr/cl-grpc","version":"0.0.4","author":{"name":"rowanzhu"},"license":"MIT","_id":"@dogsvr/cl-grpc@0.0.4","maintainers":[{"name":"rowanzhu","email":"rowanzhu@gmail.com"}],"homepage":"https://github.com/dogsvr/cl-grpc#readme","bugs":{"url":"https://github.com/dogsvr/cl-grpc/issues"},"dist":{"shasum":"6b25d451510176ac00f04c009a0676a72c9f5c5d","tarball":"https://registry.npmjs.org/@dogsvr/cl-grpc/-/cl-grpc-0.0.4.tgz","fileCount":6,"integrity":"sha512-xb4OZY4DfYrTWy3XIi3gGi1LDfb5DFAJIQD7A679PjBJ6SQgc85uOhV9UxYLntMhseuYQePWno+x2xaK0EwrVw==","signatures":[{"sig":"MEYCIQDw/KOylZzd4H7qDw/OJJNSagWCsikQmiXa+QPjyu1+SQIhAIwo9KSKroYiwl1xwORiOOyls3R5abDHbYB21RplfrbZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":15005},"main":"index.js","types":"./index.d.ts","gitHead":"42b1886b6be7353511c7b5ffe34c32d0a88bc2af","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rm -rf dist && mkdir dist && cp package.json README.md dist && npx tsc","protoc":"grpc_tools_node_protoc --plugin=protoc-gen-ts_proto=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=./src/proto --ts_proto_opt=outputServices=nice-grpc,outputServices=generic-definitions,useExactTypes=false --proto_path=./src/proto ./src/proto/common_api.proto"},"_npmUser":{"name":"rowanzhu","email":"rowanzhu@gmail.com"},"repository":{"url":"git+https://github.com/dogsvr/cl-grpc.git","type":"git"},"_npmVersion":"8.11.0","description":"","directories":{},"_nodeVersion":"16.15.1","dependencies":{"long":"^5.2.3","nice-grpc":"^2.1.10","protobufjs":"^7.4.0","@bufbuild/protobuf":"^2.2.2"},"_hasShrinkwrap":false,"devDependencies":{"ts-proto":"^2.4.2","grpc-tools":"^1.12.4","@dogsvr/dogsvr":"latest"},"_npmOperationalInternal":{"tmp":"tmp/cl-grpc_0.0.4_1734799045284_0.15923533814621327","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@dogsvr/cl-grpc","version":"0.4.0","keywords":["dogsvr","grpc","nice-grpc","connection-layer","server-to-server"],"author":{"name":"rowanzhu"},"license":"MIT","_id":"@dogsvr/cl-grpc@0.4.0","maintainers":[{"name":"rowanzhu","email":"rowanzhu@gmail.com"}],"homepage":"https://github.com/dogsvr/cl-grpc#readme","bugs":{"url":"https://github.com/dogsvr/cl-grpc/issues"},"dist":{"shasum":"09e42875bb3e4767e7d8bf304b8fa913c01b366d","tarball":"https://registry.npmjs.org/@dogsvr/cl-grpc/-/cl-grpc-0.4.0.tgz","fileCount":7,"integrity":"sha512-fdp994UMdPUsrI10DD2fN0koPqXkhaCkWFuEZFBV10MMV2E60NrJlufFR5AH1bwY131GKaALaSONzMQaRYTZvQ==","signatures":[{"sig":"MEQCIAs8G80UCLPVbbbRuCs1ztXaoGlqOeqCuKjMoy0gt1GfAiBZVw+jQXe4FGSYuQmx+4vXFjCFSIxIA8OQ3be3/goUiw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":20574},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"17e2a841f8af982c20d46a255044eb74ce64ed15","scripts":{"build":"rm -rf dist && tsc","protoc":"grpc_tools_node_protoc --plugin=protoc-gen-ts_proto=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=./src/proto --ts_proto_opt=outputServices=nice-grpc,outputServices=generic-definitions,useExactTypes=false,forceLong=number --proto_path=./src/proto ./src/proto/common_api.proto"},"_npmUser":{"name":"rowanzhu","email":"rowanzhu@gmail.com"},"repository":{"url":"git+https://github.com/dogsvr/cl-grpc.git","type":"git"},"_npmVersion":"11.6.2","description":"gRPC connection layer for @dogsvr/dogsvr (server-to-server).","directories":{},"_nodeVersion":"24.13.0","dependencies":{"long":"^5.3.2","nice-grpc":"^2.1.16","protobufjs":"^8.0.3","@bufbuild/protobuf":"^2.12.0"},"_hasShrinkwrap":false,"devDependencies":{"ts-proto":"^2.11.6","grpc-tools":"^1.13.1","typescript":"^6.0.3","@types/node":"^24.12.2","@dogsvr/dogsvr":"^0.4.0"},"_npmOperationalInternal":{"tmp":"tmp/cl-grpc_0.4.0_1777811291152_0.49083487566323414","host":"s3://npm-registry-packages-npm-production"}},"0.4.1":{"name":"@dogsvr/cl-grpc","version":"0.4.1","keywords":["dogsvr","grpc","nice-grpc","connection-layer","server-to-server"],"author":{"name":"rowanzhu"},"license":"MIT","_id":"@dogsvr/cl-grpc@0.4.1","maintainers":[{"name":"rowanzhu","email":"rowanzhu@gmail.com"}],"homepage":"https://github.com/dogsvr/cl-grpc#readme","bugs":{"url":"https://github.com/dogsvr/cl-grpc/issues"},"dist":{"shasum":"083984eb8a3abd7a803f9dc0346456df390a52cf","tarball":"https://registry.npmjs.org/@dogsvr/cl-grpc/-/cl-grpc-0.4.1.tgz","fileCount":7,"integrity":"sha512-yBgj2n2/6ooGfWZ2LLlu0I3mr7H1G4/I/CjMs3qGBT/opxbBTn7+OQ6yT6itXuNZpCdu2KYqInoQsSHJ96j3sQ==","signatures":[{"sig":"MEYCIQC80il9uOMZ5uvFHQ1UUgdwmed7Mdgko5J3XEmMorPlnQIhAIZL0gb0dv/xx4CTL3o2Sbz8ZLj7ojX8MgjKIC/fk847","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":20554},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"17e2a841f8af982c20d46a255044eb74ce64ed15","scripts":{"build":"rm -rf dist && tsc","protoc":"grpc_tools_node_protoc --plugin=protoc-gen-ts_proto=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=./src/proto --ts_proto_opt=outputServices=nice-grpc,outputServices=generic-definitions,useExactTypes=false,forceLong=number --proto_path=./src/proto ./src/proto/common_api.proto"},"_npmUser":{"name":"rowanzhu","email":"rowanzhu@gmail.com"},"repository":{"url":"git+https://github.com/dogsvr/cl-grpc.git","type":"git"},"_npmVersion":"11.6.2","description":"gRPC connection layer for @dogsvr/dogsvr (server-to-server).","directories":{},"_nodeVersion":"24.13.0","dependencies":{"long":"^5.3.2","nice-grpc":"^2.1.16","protobufjs":"^8.0.3","@bufbuild/protobuf":"^2.12.0"},"_hasShrinkwrap":false,"devDependencies":{"ts-proto":"^2.11.6","grpc-tools":"^1.13.1","typescript":"^6.0.3","@types/node":"^24.12.2","@dogsvr/dogsvr":"^0.4.0"},"_npmOperationalInternal":{"tmp":"tmp/cl-grpc_0.4.1_1777813209128_0.7502001925849897","host":"s3://npm-registry-packages-npm-production"}},"0.4.2":{"name":"@dogsvr/cl-grpc","version":"0.4.2","description":"gRPC connection layer for @dogsvr/dogsvr (server-to-server).","keywords":["dogsvr","grpc","nice-grpc","connection-layer","server-to-server"],"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./package.json":"./package.json"},"scripts":{"protoc":"grpc_tools_node_protoc --plugin=protoc-gen-ts_proto=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=./src/proto --ts_proto_opt=outputServices=nice-grpc,outputServices=generic-definitions,useExactTypes=false,forceLong=number --proto_path=./src/proto ./src/proto/common_api.proto","build":"rm -rf dist && tsc"},"repository":{"type":"git","url":"git+https://github.com/dogsvr/cl-grpc.git"},"author":{"name":"rowanzhu"},"license":"MIT","bugs":{"url":"https://github.com/dogsvr/cl-grpc/issues"},"homepage":"https://github.com/dogsvr/cl-grpc#readme","dependencies":{"@bufbuild/protobuf":"^2.12.0","long":"^5.3.2","nice-grpc":"^2.1.16","protobufjs":"^8.0.3"},"peerDependencies":{"@dogsvr/dogsvr":"^0.4.0"},"devDependencies":{"@dogsvr/dogsvr":"^0.4.0","@types/node":"^24.12.2","grpc-tools":"^1.13.1","ts-proto":"^2.11.6","typescript":"^6.0.3"},"gitHead":"8ba2120b0189d8beb3f69aa0b731a3cb80b2b6ee","_id":"@dogsvr/cl-grpc@0.4.2","_nodeVersion":"24.13.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-3Pl/uDfd/VgVGGpCSSs6UyFyvseT5XBt2yoCEXDNBToXEm6mKuBK3vl35gc8psxs3oBzVkIEpJKvPil6V5JwIA==","shasum":"972c22b1a74cd1ba52b233b566a1aa83b593c2fa","tarball":"https://registry.npmjs.org/@dogsvr/cl-grpc/-/cl-grpc-0.4.2.tgz","fileCount":7,"unpackedSize":25051,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDLQ1enBG2Ul/SvTfaBg/9TJUEi99yt85yCySAls8GIHwIgIWx910E7oGEX0vCKVEVMcXl4HZuejU0kfq7N94HFbg8="}]},"_npmUser":{"name":"rowanzhu","email":"rowanzhu@gmail.com"},"directories":{},"maintainers":[{"name":"rowanzhu","email":"rowanzhu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cl-grpc_0.4.2_1785065950321_0.7031016337033633"},"_hasShrinkwrap":false}},"time":{"created":"2024-12-01T12:20:15.126Z","modified":"2026-07-26T11:39:10.615Z","0.0.1":"2024-12-01T12:20:15.386Z","0.0.2":"2024-12-08T09:51:10.189Z","0.0.4":"2024-12-21T16:37:25.498Z","0.4.0":"2026-05-03T12:28:11.296Z","0.4.1":"2026-05-03T13:00:09.255Z","0.4.2":"2026-07-26T11:39:10.475Z"},"bugs":{"url":"https://github.com/dogsvr/cl-grpc/issues"},"author":{"name":"rowanzhu"},"license":"MIT","homepage":"https://github.com/dogsvr/cl-grpc#readme","keywords":["dogsvr","grpc","nice-grpc","connection-layer","server-to-server"],"repository":{"type":"git","url":"git+https://github.com/dogsvr/cl-grpc.git"},"description":"gRPC connection layer for @dogsvr/dogsvr (server-to-server).","maintainers":[{"name":"rowanzhu","email":"rowanzhu@gmail.com"}],"readme":"# @dogsvr/cl-grpc\n\ngRPC connection layer for [`@dogsvr/dogsvr`](https://github.com/dogsvr/dogsvr) — server-to-server unary calls. Provides both inbound (`CL`, a gRPC server) and outbound (`CLC`, a gRPC client) sides so any two dogsvr servers can talk to each other.\n\n## Install\n\n```sh\nnpm install @dogsvr/cl-grpc\n```\n\n**Node.js**: tested on **v24.13.0 on Linux (x86-64)**; other maintained LTS lines are expected to work but are not routinely exercised. File an issue if something breaks on your runtime.\n\n## Usage\n\nImporting the package in the main thread self-registers a `\"grpc\"` CL and CLC factory with `@dogsvr/dogsvr`:\n\n```ts\nimport * as dogsvr from '@dogsvr/dogsvr/main_thread';\nimport '@dogsvr/cl-grpc';\ndogsvr.startServer(__dirname + '/main_thread_config.json');\n```\n\nWire up the corresponding `main_thread_config.json`:\n\n```jsonc\n{\n    \"cl\": {\n        \"grpc\": { \"type\": \"grpc\", \"port\": 20001 }             // inbound: open a gRPC server\n    },\n    \"clc\": {\n        \"battlesvr\": { \"type\": \"grpc\", \"address\": \"127.0.0.1:30001\" }  // outbound: call another server\n    }\n}\n```\n\nWorker-side usage is unchanged — use the dogsvr worker API to call out:\n\n```ts\nimport * as dogsvr from '@dogsvr/dogsvr/worker_thread';\nawait dogsvr.callCmdByClc('battlesvr', head, innerReq);\n```\n\n### Logging\n\n`@grpc/grpc-js`'s internal logs (channel state transitions, subchannel picks, keepalive, retries, etc.) are routed through dogsvr's logger as `module: \"grpc-js\"` via the global `setLogger`/`setLogVerbosity` API.\n\n**Default level: `ERROR`.** grpc-js emits per-RPC channel chatter at `INFO` and has no `WARN` tier; `ERROR` matches grpc-js's own out-of-the-box default. Override per-CL/CLC for protocol debugging:\n\n```jsonc\n\"cl\":  { \"grpc\":      { \"type\": \"grpc\", \"port\": 20001,                     \"log\": { \"level\": \"DEBUG\" } } },\n\"clc\": { \"battlesvr\": { \"type\": \"grpc\", \"address\": \"127.0.0.1:30001\",      \"log\": { \"level\": \"DEBUG\" } } }\n```\n\nAccepts grpc-js `LogVerbosity` keys: **`\"DEBUG\"` | `\"INFO\"` | `\"ERROR\"` | `\"NONE\"`** — all upper-case, matching the grpc-js enum member names. Values pass straight to `setLogVerbosity`. **Case-sensitive** and **fails silently**: mis-cased spellings like `\"debug\"` are looked up on the `LogVerbosity` object, resolve to `undefined`, and grpc-js keeps its previous verbosity — no exception, no log line, no effect. When multiple CL/CLC instances coexist (process-global verbosity), the most verbose configured level wins.\n\n**`GRPC_VERBOSITY` / `GRPC_TRACE` env vars are overridden** by this routing — use `cl.<name>.log.level: \"DEBUG\"` for verbose investigation instead.\n\n### Regenerating gRPC stubs\n\n```sh\nnpm run protoc      # grpc-tools + ts-proto (nice-grpc output)\n```\n\n## Role in dogsvr\n\nThe counterpart to inbound CLs like `@dogsvr/cl-tsrpc`: where a TSRPC CL handles a client-to-server link, `cl-grpc` handles server-to-server mesh. See the [dogsvr README](https://github.com/dogsvr/dogsvr) for how CL and CLC factories register and how routing works across the mesh.\n\n## See also\n\n- [`example-proj`](https://github.com/dogsvr/example-proj) — three-server reference that uses this CL/CLC between `zonesvr` (:20001) and `battlesvr` (:30001)\n- [`@dogsvr/cl-tsrpc`](https://github.com/dogsvr/cl-tsrpc) — TSRPC CL for client-facing WS/HTTP endpoints\n","readmeFilename":"README.md"}