{"_id":"@asymmetric-ai/hone","name":"@asymmetric-ai/hone","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@asymmetric-ai/hone","version":"0.1.0","type":"module","description":"Hone SDK — send AI-agent conversations and MCP tool calls to Hone for observability.","license":"MIT","author":{"name":"Ankit Saxena"},"homepage":"https://github.com/ankit-saxena/agent-evals/tree/main/sdks/typescript","repository":{"type":"git","url":"git+https://github.com/ankit-saxena/agent-evals.git","directory":"sdks/typescript"},"keywords":["hone","observability","ai-agents","llm","mcp","opentelemetry"],"main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"sideEffects":false,"scripts":{"build":"tsc -p tsconfig.build.json","prepublishOnly":"npm run build","typecheck":"tsc --noEmit","test":"vitest run"},"publishConfig":{"access":"public"},"peerDependencies":{"@modelcontextprotocol/sdk":"^1.0.0"},"peerDependenciesMeta":{"@modelcontextprotocol/sdk":{"optional":true}},"devDependencies":{"@types/node":"^22","typescript":"^5.7.2","vitest":"^3.0.5"},"_id":"@asymmetric-ai/hone@0.1.0","gitHead":"4c8595eb618754a83299010abf92e55f55742da4","bugs":{"url":"https://github.com/ankit-saxena/agent-evals/issues"},"_nodeVersion":"20.18.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-DC7yyv3ZrbEALFzw6BQoQccoieQvn1sTZSFvsI9XKrEZZDK5UJ9s3otYzVLfEvuE2+gTg0uMNtblq2w5egupUw==","shasum":"8076df9b95ef41b555f182b750a5c333ca8b368c","tarball":"https://registry.npmjs.org/@asymmetric-ai/hone/-/hone-0.1.0.tgz","fileCount":23,"unpackedSize":47168,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIC1kubzE+4cBmcSJANlYL2J5wgOrS+IvbbWDt8GSmmZnAiEA+/rYQfzo8rBuS/Ebxu1CBo6wrR7eaMe9yGjJsP7n35c="}]},"_npmUser":{"name":"walterw21","email":"ankit.saxena21@gmail.com"},"directories":{},"maintainers":[{"name":"walterw21","email":"ankit.saxena21@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/hone_0.1.0_1783750218410_0.016026611452558903"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-11T06:10:18.231Z","0.1.0":"2026-07-11T06:10:18.625Z","modified":"2026-07-11T06:10:18.794Z"},"maintainers":[{"name":"walterw21","email":"ankit.saxena21@gmail.com"}],"description":"Hone SDK — send AI-agent conversations and MCP tool calls to Hone for observability.","homepage":"https://github.com/ankit-saxena/agent-evals/tree/main/sdks/typescript","keywords":["hone","observability","ai-agents","llm","mcp","opentelemetry"],"repository":{"type":"git","url":"git+https://github.com/ankit-saxena/agent-evals.git","directory":"sdks/typescript"},"author":{"name":"Ankit Saxena"},"bugs":{"url":"https://github.com/ankit-saxena/agent-evals/issues"},"license":"MIT","readme":"# hone (TypeScript SDK)\n\nSend AI-agent conversations and MCP tool calls to [Hone](https://hone.dev), an\nobservability platform for AI agents. The SDK is ESM, has zero runtime\ndependencies (it uses the global `fetch`), and never throws capture failures\ninto your application by default.\n\n## Install\n\n```bash\nnpm install @asymmetric-ai/hone\n```\n\nNode 22+ is required (global `fetch`, `crypto.randomUUID`).\n\n## Configure\n\nSet an API key and, optionally, an endpoint. Both can come from the environment\nor from `init`:\n\n```ts\nimport { init } from \"@asymmetric-ai/hone\";\n\ninit(\"sk_your_key\", { endpoint: \"https://api.hone.dev\" });\n```\n\n| Value      | Source                                          |\n| ---------- | ----------------------------------------------- |\n| API key    | `init(apiKey)` or `HONE_API_KEY`                |\n| Endpoint   | `init(_, { endpoint })` or `HONE_ENDPOINT`      |\n| Default    | `https://api.hone.dev` (local: `http://localhost:8080`) |\n\nAuth is sent as the `x-api-key: sk_<hex>` header. A `401` means the key is\ninvalid.\n\n## Capture a turn with `begin` / `end`\n\n`begin` opens a new conversation (a fresh `session_id`) and records the start\ntime. `end` posts the session once, then the event with a computed `latency`.\n\n```ts\nimport { begin } from \"@asymmetric-ai/hone\";\n\nconst interaction = begin({\n  userId: \"user-42\",\n  agentName: \"support-bot\",\n  input: \"How do I reset my password?\",\n});\n\ninteraction.setProperty(\"model\", \"opus\");\ninteraction.setProperties({ promptTokens: 128, cached: false });\n\nconst answer = await runYourAgent();\nawait interaction.end(answer, { success: true });\n```\n\n## One-shot capture with `track`\n\nFor a fully-formed turn, `track` posts the session and event in one call. Pass\n`conversationId` to group several turns under a single session:\n\n```ts\nimport { track } from \"@asymmetric-ai/hone\";\n\nawait track({\n  userId: \"user-42\",\n  agentName: \"support-bot\",\n  input: \"Hi\",\n  output: \"Hello! How can I help?\",\n  conversationId: \"thread-abc\", // optional; groups turns\n});\n```\n\n## `identify`\n\nAttach traits to the next session for a user. Traits are string key/values and\nare consumed once:\n\n```ts\nimport { identify } from \"@asymmetric-ai/hone\";\n\nidentify(\"user-42\", { plan: \"pro\", region: \"us-east\" });\n```\n\n## MCP tool calls with `trackMCP`\n\nWrap an MCP server so every tool invocation becomes a `PRIMITIVE_TYPE_TOOL`\nevent (`primitive_name` is the tool name). The\n[`@modelcontextprotocol/sdk`](https://www.npmjs.com/package/@modelcontextprotocol/sdk)\npackage is an **optional** peer dependency — if it is absent, `trackMCP` simply\ndoes nothing.\n\n```ts\nimport { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { trackMCP } from \"@asymmetric-ai/hone\";\n\nconst server = new McpServer({ name: \"my-server\", version: \"1.0.0\" });\ntrackMCP(server); // wrap before registering tools\n\nserver.tool(\"add\", async ({ a, b }) => ({\n  content: [{ type: \"text\", text: String(a + b) }],\n}));\n```\n\nOptions let you drop sensitive payloads:\n\n```ts\ntrackMCP(server, \"sk_scoped_key\", { disableInput: true, disableOutput: true });\n```\n\n## Error handling\n\nCapture failures are logged and swallowed by default so observability never\nbreaks the host app. For tests (or strict environments) enable `throwOnError`:\n\n```ts\ninit(\"sk_test\", { throwOnError: true });\n```\n\n## API summary\n\n| Export                         | Purpose                                             |\n| ------------------------------ | --------------------------------------------------- |\n| `init(apiKey?, options?)`      | Module-level config (falls back to env).            |\n| `begin(args) → Interaction`    | Open a conversation; `end`, `setProperty(-ies)`.    |\n| `track(args) → Promise<void>`  | One-shot turn capture; `conversationId` groups them.|\n| `identify(userId, traits)`     | Traits for the next session.                        |\n| `trackMCP(server, key?, opts?)`| Instrument an MCP server's tool calls.              |\n| `HoneTransportError`           | Error thrown under `throwOnError`.                  |\n","readmeFilename":"README.md","_rev":"1-ce9159f316ce98ce6cad39e132c16158"}