{"_id":"@adofai-ipc/client","_rev":"5-2652c144818eebf3cc556c404099a911","name":"@adofai-ipc/client","dist-tags":{"latest":"0.4.1"},"versions":{"0.1.0":{"name":"@adofai-ipc/client","version":"0.1.0","keywords":["adofai","ipc","localhost","typescript","unity","unitymodmanager"],"license":"MIT","_id":"@adofai-ipc/client@0.1.0","maintainers":[{"name":"impl.dev","email":"gangguhyeon1113@gmail.com"}],"homepage":"https://github.com/KGH1113/adofai-ipc#readme","bugs":{"url":"https://github.com/KGH1113/adofai-ipc/issues"},"dist":{"shasum":"37321b6282faa93b03e06ba002fbbc2943e47d19","tarball":"https://registry.npmjs.org/@adofai-ipc/client/-/client-0.1.0.tgz","fileCount":9,"integrity":"sha512-RyRmAUUPFN2KlWZ10/vIC6MKq3qjhFbHIkzNpj20sn/zsQG895hieI6PwMsBiz+15yd/V9qWFQGyFm+MUp8BoQ==","signatures":[{"sig":"MEYCIQD+WkymtKMb1jvCr9PbVBiUIe6a/nev/Dx3eKMyxLjTwwIhAM2BTtEqOW4LP9SMb/Nz3LF0bNKN950qCmcn2qv3FAEx","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":38015},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"build":"tsup","check":"tsc --noEmit","clean":"rm -rf dist"},"_npmUser":{"name":"impl.dev","email":"gangguhyeon1113@gmail.com"},"repository":{"url":"git+https://github.com/KGH1113/adofai-ipc.git","type":"git","directory":"packages/client"},"description":"TypeScript client for the AdofaiIpc local HTTP IPC gateway.","directories":{},"sideEffects":false,"_nodeVersion":"26.4.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","typescript":"^5.6.3"},"_npmOperationalInternal":{"tmp":"tmp/client_0.1.0_1783479942096_0.0189442032824112","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@adofai-ipc/client","version":"0.2.0","keywords":["adofai","ipc","localhost","typescript","unity","unitymodmanager"],"license":"MIT","_id":"@adofai-ipc/client@0.2.0","maintainers":[{"name":"impl.dev","email":"gangguhyeon1113@gmail.com"}],"homepage":"https://github.com/KGH1113/adofai-ipc#readme","bugs":{"url":"https://github.com/KGH1113/adofai-ipc/issues"},"dist":{"shasum":"78d247ceef9e864f952ce550f102a383375e4449","tarball":"https://registry.npmjs.org/@adofai-ipc/client/-/client-0.2.0.tgz","fileCount":8,"integrity":"sha512-iT4kSMlAP89yXuqjMpcaTdmK7epIq3rtagioYfkvKdbfKXWU6RV1dmm/rU2rLzColbqa5DOsVSJ8KEmHv4STHw==","signatures":[{"sig":"MEUCIA8DyaM3SkSakCRi1zk7aOBXUELo3p8B+nnOEx4fjvOsAiEAhVu9IhdcCRb5Jd41Sjn0LrAn1hdO239SuVwCFdw7wxQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":68449},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"15e72bfac963131179198bbb8a8ab416600cad2b","scripts":{"test":"pnpm run build && node --test test/*.test.mjs","build":"tsup","check":"tsc --noEmit","clean":"rm -rf dist","prepack":"pnpm run build"},"_npmUser":{"name":"impl.dev","email":"gangguhyeon1113@gmail.com"},"repository":{"url":"git+https://github.com/KGH1113/adofai-ipc.git","type":"git","directory":"packages/client"},"_npmVersion":"11.18.0","description":"TypeScript client for the AdofaiIpc local HTTP IPC gateway.","directories":{},"sideEffects":false,"_nodeVersion":"26.6.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","typescript":"^5.6.3"},"_npmOperationalInternal":{"tmp":"tmp/client_0.2.0_1786163211576_0.7579396699267935","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@adofai-ipc/client","version":"0.3.0","keywords":["adofai","ipc","localhost","typescript","unity","unitymodmanager"],"license":"MIT","_id":"@adofai-ipc/client@0.3.0","maintainers":[{"name":"impl.dev","email":"gangguhyeon1113@gmail.com"}],"homepage":"https://github.com/KGH1113/adofai-ipc#readme","bugs":{"url":"https://github.com/KGH1113/adofai-ipc/issues"},"dist":{"shasum":"6c6e03036d601d13b07a63e1e80c5c18e76335ce","tarball":"https://registry.npmjs.org/@adofai-ipc/client/-/client-0.3.0.tgz","fileCount":9,"integrity":"sha512-G8EXv9+4Z76YsApm/zHf+remYFllKOt8BN/CQTXBEELk69jPt96f1t8QY396pKewgcvbwTnYsdx3pDn6FVW4WA==","signatures":[{"sig":"MEUCIG5MCycEE92MOdgDkygh7clAziHKVq9k6CxvYOd204reAiEA2SeTXZhYNHyNY1DIf+5Ae2SY6o6sVaORouLus7nOipY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":91072},"main":"./dist/index.cjs","type":"module","_from":"file:build/npm/adofai-ipc-client-0.3.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"test":"pnpm run build && node --test test/*.test.mjs","build":"tsup","check":"tsc --noEmit","clean":"rm -rf dist"},"_npmUser":{"name":"impl.dev","email":"gangguhyeon1113@gmail.com"},"_resolved":"/Users/kgh/dev/src/adofai-ipc/build/npm/adofai-ipc-client-0.3.0.tgz","_integrity":"sha512-G8EXv9+4Z76YsApm/zHf+remYFllKOt8BN/CQTXBEELk69jPt96f1t8QY396pKewgcvbwTnYsdx3pDn6FVW4WA==","repository":{"url":"git+https://github.com/KGH1113/adofai-ipc.git","type":"git","directory":"packages/client"},"_npmVersion":"11.18.0","description":"TypeScript client for the AdofaiIpc local HTTP IPC gateway.","directories":{},"sideEffects":false,"_nodeVersion":"26.6.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","typescript":"^5.6.3","@types/node":"^22.10.2"},"_npmOperationalInternal":{"tmp":"tmp/client_0.3.0_1786341973837_0.46229409292884394","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@adofai-ipc/client","version":"0.4.0","keywords":["adofai","ipc","localhost","typescript","unity","unitymodmanager"],"license":"MIT","_id":"@adofai-ipc/client@0.4.0","maintainers":[{"name":"impl.dev","email":"gangguhyeon1113@gmail.com"}],"homepage":"https://github.com/KGH1113/adofai-ipc#readme","bugs":{"url":"https://github.com/KGH1113/adofai-ipc/issues"},"dist":{"shasum":"22d8dcc6711c17232e992d2938ba5146f5bc00f4","tarball":"https://registry.npmjs.org/@adofai-ipc/client/-/client-0.4.0.tgz","fileCount":9,"integrity":"sha512-L4OB1eRXilK7OeTcYo3BJq5vmegCcGSERS39LK6cHNsxriiHeoXiQiPLLU7A/s47nP0/yFub7Y70XqTvccO9CA==","signatures":[{"sig":"MEUCIQDCRNvLqin4LvmNYvZkwQ6yiiSDLFe5GXj43E52kvGTqQIgSpLdXihm+k8Ox5upxs8LjbR7ZwqIY5Uw2GId5l2I9xg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIEzdwZwZ3eus94fBl2bmDbO7nkb5Ni/NOJUaVjARBp/GAiA09aFJozZecoyHEWVfqkZmDfzApgcDxMBYSwoqgtzTNA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":91072},"main":"./dist/index.cjs","type":"module","_from":"file:build/adofai-ipc-client-0.4.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"test":"pnpm run build && node --test test/*.test.mjs","build":"tsup","check":"tsc --noEmit","clean":"rm -rf dist"},"_npmUser":{"name":"impl.dev","email":"gangguhyeon1113@gmail.com"},"_resolved":"/Users/kgh/dev/src/adofai-ipc/build/adofai-ipc-client-0.4.0.tgz","_integrity":"sha512-L4OB1eRXilK7OeTcYo3BJq5vmegCcGSERS39LK6cHNsxriiHeoXiQiPLLU7A/s47nP0/yFub7Y70XqTvccO9CA==","repository":{"url":"git+https://github.com/KGH1113/adofai-ipc.git","type":"git","directory":"packages/client"},"_npmVersion":"11.18.0","description":"TypeScript client for the AdofaiIpc local HTTP IPC gateway.","directories":{},"sideEffects":false,"_nodeVersion":"26.6.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","typescript":"^5.6.3","@types/node":"^22.10.2"},"_npmOperationalInternal":{"tmp":"tmp/client_0.4.0_1789898142470_0.8583080138011598","host":"s3://npm-registry-packages-npm-production"}},"0.4.1":{"_id":"@adofai-ipc/client@0.4.1","bugs":{"url":"https://github.com/KGH1113/adofai-ipc/issues"},"dist":{"shasum":"de3b2aa99c778f8a692592cf553ca9bf0d6a704b","tarball":"https://registry.npmjs.org/@adofai-ipc/client/-/client-0.4.1.tgz","fileCount":9,"integrity":"sha512-Igo98dy+vlk6dwDHsVnlMCSwGgdjIcJpcdADK6cFoS4RINMp56+OYQU3p8sDAeLWawXl2OrH8rzf5K9/NJQbBg==","signatures":[{"sig":"MEUCIQDAqhItpiqgboS3W53dl0hwPIGJFmsA3gBcAMLQfHwuYwIgBj09Gjj3Fh5TsxCG0d4sFfM6VaZw5cMrZYRdOgZ8pVk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDjClI16xOYYlNcHGpp1AKy3nOX+KV01TGlHQSz+IUeHAiEAy9X4ZXcuIqGQkDh08fyS7g+Hdy7ydvpzcQescEPJOWM="}],"unpackedSize":91072},"main":"./dist/index.cjs","name":"@adofai-ipc/client","type":"module","_from":"file:build/adofai-ipc-client-0.4.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"license":"MIT","scripts":{"test":"pnpm run build && node --test test/*.test.mjs","build":"tsup","check":"tsc --noEmit","clean":"rm -rf dist"},"version":"0.4.1","_npmUser":{"name":"impl.dev","email":"gangguhyeon1113@gmail.com"},"homepage":"https://github.com/KGH1113/adofai-ipc#readme","keywords":["adofai","ipc","localhost","typescript","unity","unitymodmanager"],"_resolved":"/Users/kgh/dev/src/adofai-ipc/build/adofai-ipc-client-0.4.1.tgz","_integrity":"sha512-Igo98dy+vlk6dwDHsVnlMCSwGgdjIcJpcdADK6cFoS4RINMp56+OYQU3p8sDAeLWawXl2OrH8rzf5K9/NJQbBg==","repository":{"url":"git+https://github.com/KGH1113/adofai-ipc.git","type":"git","directory":"packages/client"},"_npmVersion":"11.18.0","description":"TypeScript client for the AdofaiIpc local HTTP IPC gateway.","directories":{},"maintainers":[{"name":"impl.dev","email":"gangguhyeon1113@gmail.com"}],"sideEffects":false,"_nodeVersion":"26.6.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","typescript":"^5.6.3","@types/node":"^22.10.2"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/client_0.4.1_1789910311899_0.20895365152067313"}}},"time":{"created":"2026-07-08T03:05:41.859Z","modified":"2026-09-20T13:18:32.190Z","0.1.0":"2026-07-08T03:05:42.239Z","0.2.0":"2026-08-08T04:26:51.724Z","0.3.0":"2026-08-10T06:06:14.013Z","0.4.0":"2026-09-20T09:55:42.559Z","0.4.1":"2026-09-20T13:18:31.982Z"},"bugs":{"url":"https://github.com/KGH1113/adofai-ipc/issues"},"license":"MIT","homepage":"https://github.com/KGH1113/adofai-ipc#readme","keywords":["adofai","ipc","localhost","typescript","unity","unitymodmanager"],"repository":{"url":"git+https://github.com/KGH1113/adofai-ipc.git","type":"git","directory":"packages/client"},"description":"TypeScript client for the AdofaiIpc local HTTP IPC gateway.","maintainers":[{"name":"impl.dev","email":"gangguhyeon1113@gmail.com"}],"readme":"# @adofai-ipc/client\n\nTypeScript client for the AdofaiIpc local HTTP IPC gateway.\n\n## Install\n\n```bash\nnpm install @adofai-ipc/client\n```\n\n## Usage\n\n```ts\nimport { tryConnect } from \"@adofai-ipc/client\";\n\nconst client = await tryConnect();\n\nconst result = await client.call({\n  namespace: \"tufhelper2\",\n  method: \"level.open-from-id\",\n  params: {\n    id: \"1234\"\n  }\n});\n```\n\nYou can also bind calls to a namespace.\n\n```ts\nconst tufhelper = client.namespace(\"tufhelper2\");\n\nawait tufhelper.call(\"level.open-from-id\", {\n  id: \"1234\"\n});\n```\n\n## API\n\n### `tryConnect(options?)`\n\nFinds a running AdofaiIpc server by probing `/ipc/health`.\n\nThe client and server product versions must match exactly. A mismatch throws\n`IpcVersionMismatchError` and stops port probing. Use `onVersionMismatch` to display application UI;\nthe callback runs at most once per `tryConnect` call and does not suppress the typed error.\n\n```ts\nawait tryConnect({\n  onVersionMismatch(error) {\n    if (error.direction === \"client_outdated\") location.reload();\n    else openAdofaiIpcDownloadNotice(error);\n  }\n});\n```\n\n`server_outdated` means the mod must be updated, `client_outdated` means the web bundle must be\nupdated, and `legacy_server` means the server did not provide a valid product version. React\nStrictMode and consumer retry loops can call `tryConnect` more than once, so applications should\nstore mismatch as a terminal connection state and deduplicate their own modal or banner.\n\nDefaults:\n\n- host: `127.0.0.1`\n- startPort: `32145`\n- endPort: `32155`\n- probeTimeoutMs: `500`\n- requestTimeoutMs: `10000`\n\n`tryConnect` only confirms that the AdofaiIpc listener is running. It does not mean that a target\nnamespace is registered or that the owning mod has finished initializing.\n\n```ts\nconst client = await tryConnect({\n  probeTimeoutMs: 500,\n  requestTimeoutMs: 10_000\n});\n```\n\nThe legacy `timeoutMs` option remains as a deprecated alias for both values.\n\n### `new AdofaiIpcClient(options?)`\n\nCreates a client for a known AdofaiIpc base URL.\n\n```ts\nconst client = new AdofaiIpcClient({\n  baseUrl: \"http://127.0.0.1:32145\"\n});\n```\n\n### `client.call(options)`\n\nCalls a namespace method through `POST /ipc`.\n\n```ts\nawait client.call({\n  namespace: \"tufhelper2\",\n  method: \"activity.get\",\n  timeoutMs: 30_000\n});\n```\n\n### `client.namespace(name)`\n\nCreates a namespace-bound helper.\n\n### `client.health()`\n\nCalls `GET /ipc/health`.\n\n### `client.listNamespaces()`\n\nCalls `GET /ipc/namespaces`.\n\n### `client.getNamespace(name)`\n\nCalls `GET /ipc/namespaces/{name}`.\n\n### `client.waitForNamespace(name, options?)`\n\nPolls namespace discovery until the target namespace is registered. Set `status: \"ready\"` to also\nwait until the namespace owner explicitly marks initialization complete.\n\n```ts\nawait client.waitForNamespace(\"tufhelper2\", {\n  status: \"ready\",\n  timeoutMs: 15_000,\n  pollIntervalMs: 100\n});\n```\n\nAdofaiIpc namespaces have the strict states `initializing`, `ready`, and `error`. A ready wait that\nexpires reports `namespace_initializing`; an initialization failure reports `namespace_error`.\n\n## Error handling\n\nConnection failures are reported as `IpcConnectionError` with code `UNAVAILABLE`. Request\ntimeouts use the more specific `IpcTimeoutError`, which extends `IpcConnectionError` and has code\n`TIMEOUT`. Protocol failures, including `namespace_not_found`, are reported as\n`IpcResponseError`. `isIpcUnavailable` only matches the `UNAVAILABLE` state, not timeouts.\n\n```ts\nimport {\n  IpcTimeoutError,\n  isIpcUnavailable,\n  tryConnect\n} from \"@adofai-ipc/client\";\n\ntry {\n  const client = await tryConnect();\n  await client.health();\n} catch (error) {\n  if (error instanceof IpcTimeoutError) {\n    console.warn(`AdofaiIpc timed out after ${error.timeoutMs} ms.`);\n  } else if (isIpcUnavailable(error)) {\n    console.warn(\"AdofaiIpc is unavailable.\");\n  }\n}\n```\n\n`tryConnect` treats individual probe failures as expected and only throws an `UNAVAILABLE`\n`IpcConnectionError` after every candidate port has failed. A successful probe does not guarantee\nthat any specific namespace or mode feature is ready.\n\n## Notes\n\nThis package uses the global `fetch` API. Node.js 18 or newer is recommended.\n\nBrowser requests are still subject to AdofaiIpc namespace Origin policy.\n","readmeFilename":"README.md"}