{"_id":"@coglet/logsafe-plugin-sdk","name":"@coglet/logsafe-plugin-sdk","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@coglet/logsafe-plugin-sdk","version":"0.1.0","type":"module","license":"MIT","description":"Types and runtime helpers for building logsafe plugins.","keywords":["logsafe","plugin","sdk","logging","debugging"],"exports":{"./server":{"types":"./src/server.ts","default":"./src/server.ts"},"./ui":{"types":"./src/ui.tsx","default":"./src/ui.tsx"},"./package.json":"./package.json"},"engines":{"node":">=20"},"repository":{"type":"git","url":"git+https://github.com/omarqx/logsafe.git","directory":"packages/plugin-sdk"},"bugs":{"url":"https://github.com/omarqx/logsafe/issues"},"homepage":"https://github.com/omarqx/logsafe/blob/main/docs/PLUGINS.md","publishConfig":{"access":"public"},"peerDependencies":{"react":"^19"},"peerDependenciesMeta":{"react":{"optional":true}},"devDependencies":{"@testing-library/react":"^16.3.2","@types/react":"^19.2.17","jsdom":"^29.1.1","react":"^19.2.0","react-dom":"^19.2.0"},"gitHead":"8a92c640d0b0a1883db79270eb64ad5b9f273154","_id":"@coglet/logsafe-plugin-sdk@0.1.0","_nodeVersion":"24.14.1","_npmVersion":"11.11.0","dist":{"integrity":"sha512-4KX5tSuty2lwYaoGJTeyZBFHBm7i/gZNztQVcM4c+wfJt/Mnm0pQqvT5KgVYGU9fal0UipLzp/uBq6aYdhtPhg==","shasum":"dc17f1e7b0baa6e062c3f2103aefdebbd09139c5","tarball":"https://registry.npmjs.org/@coglet/logsafe-plugin-sdk/-/logsafe-plugin-sdk-0.1.0.tgz","fileCount":5,"unpackedSize":10130,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFhhYIhVMQOoTK+JHIwJfY78kX5tqUImJN7OdAKR0njkAiBnUu1GrEKSdKBznzkJSdgTVL7jbE6/bn70jUD/nnUJig=="}]},"_npmUser":{"name":"omarqx","email":"omarqaddoumi@gmail.com"},"directories":{},"maintainers":[{"name":"omarqx","email":"omarqaddoumi@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/logsafe-plugin-sdk_0.1.0_1784255760748_0.8642613136243478"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-17T02:36:00.616Z","0.1.0":"2026-07-17T02:36:00.902Z","modified":"2026-07-17T02:36:01.093Z"},"maintainers":[{"name":"omarqx","email":"omarqaddoumi@gmail.com"}],"description":"Types and runtime helpers for building logsafe plugins.","homepage":"https://github.com/omarqx/logsafe/blob/main/docs/PLUGINS.md","keywords":["logsafe","plugin","sdk","logging","debugging"],"repository":{"type":"git","url":"git+https://github.com/omarqx/logsafe.git","directory":"packages/plugin-sdk"},"bugs":{"url":"https://github.com/omarqx/logsafe/issues"},"license":"MIT","readme":"# @coglet/logsafe-plugin-sdk\n\nTypes and runtime helpers for building [logsafe](https://github.com/omarqx/logsafe)\nplugins — a plugin can enrich ingested events (matcher + transform), persist\nits own tables, mount API routes, and render a custom list row / detail view\nfor the sessions it owns.\n\nThis is the contract surface plugin authors build against. It has no\ndependency on the logsafe server itself — just the shared types and a few UI\nruntime hooks.\n\n## Install\n\n```bash\nnpm i @coglet/logsafe-plugin-sdk\n```\n\n`react` is an optional peer dependency (only needed if your plugin ships a UI).\n\n## Two entry points\n\n**`@coglet/logsafe-plugin-sdk/server`** — server contract:\n\n```ts\nimport type { ServerPlugin, IncomingEvent } from '@coglet/logsafe-plugin-sdk/server'\n\nexport const plugin: ServerPlugin = {\n  matchType: (ev: IncomingEvent) => (ev.ns.startsWith('http:') ? 'http' : null),\n  // transform?, afterInsert?, routes?, onSessionDelete? — all optional\n}\n```\n\n**`@coglet/logsafe-plugin-sdk/ui`** — UI contract + runtime hooks\n(`useCoreApi`, `usePluginFetch`, `useSessionEvents`, `useThemeTokens`,\n`FlatLogView`):\n\n```tsx\nimport type { UIPlugin, ListRowProps } from '@coglet/logsafe-plugin-sdk/ui'\nimport { useSessionEvents } from '@coglet/logsafe-plugin-sdk/ui'\n```\n\nA plugin declares itself via a `\"logsafe\"` manifest block in its own\n`package.json` (`id`, `apiVersion`, `ownedTypes`, `server`/`ui` entry\nmodules). Core refuses a plugin whose `apiVersion` major differs from\n`PLUGIN_API_VERSION`.\n\n## Full guide\n\nSee [PLUGINS.md](https://github.com/omarqx/logsafe/blob/main/docs/PLUGINS.md)\nfor the complete authoring walkthrough, and `templates/plugin-starter` for a\ncopyable skeleton with a conformance test.\n","readmeFilename":"README.md","_rev":"1-2ed0a8ed9bf7a670562980b12c18b803"}