{"_id":"@alexma03/utcp-direct-call","_rev":"2-cb03a8d479c6f7a5c797a4786678acde","name":"@alexma03/utcp-direct-call","dist-tags":{"latest":"1.1.2"},"versions":{"1.1.1":{"name":"@alexma03/utcp-direct-call","version":"1.1.1","keywords":["utcp","universal-tool-calling-protocol","tools","api","typescript","tool calling","direct-call","callable","agent","ai","llm"],"author":{"name":"Alexma03"},"license":"MPL-2.0","_id":"@alexma03/utcp-direct-call@1.1.1","maintainers":[{"name":"alexma03","email":"alex03marcos@gmail.com"}],"homepage":"https://github.com/Alexma03/alexma03-utcp#readme","bugs":{"url":"https://github.com/Alexma03/alexma03-utcp/issues"},"dist":{"shasum":"b4ff1e37bbe5940608d6307ac07052e6cbe3a447","tarball":"https://registry.npmjs.org/@alexma03/utcp-direct-call/-/utcp-direct-call-1.1.1.tgz","fileCount":8,"integrity":"sha512-CCf9hT/pN9DYePkrUK/3NGgswtz0JVdRGgZMOS4ZyDIHMuerqOEGshE5cry+4JsfyBFzfeZzQw4OEWiGBm0ARg==","signatures":[{"sig":"MEQCIEpolml6iYw8+sb5oqFJR7sgrL0qPYw3N7Ljt2ro4oj6AiBASOw118yh1vqjIZohMolTig/k2zL8ZavNpM7pKE+gxw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":799612},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","module":"dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"97f8055784030184a8917378a6de581d7ae7f22d","scripts":{"build":"tsup"},"_npmUser":{"name":"alexma03","email":"alex03marcos@gmail.com"},"repository":{"url":"git+https://github.com/Alexma03/alexma03-utcp.git","type":"git","directory":"packages/direct-call"},"_npmVersion":"11.9.0","description":"Direct callable functions plugin for UTCP","directories":{},"_nodeVersion":"24.14.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"bun-types":"latest","@types/bun":"latest","typescript":"^5.0.0","@alexma03/utcp-sdk":"workspace:*"},"peerDependencies":{"@alexma03/utcp-sdk":"workspace:*"},"_npmOperationalInternal":{"tmp":"tmp/utcp-direct-call_1.1.1_1773650857448_0.04651233201340177","host":"s3://npm-registry-packages-npm-production"}},"1.1.2":{"name":"@alexma03/utcp-direct-call","version":"1.1.2","description":"Direct callable functions plugin for UTCP","main":"dist/index.cjs","module":"dist/index.js","types":"dist/index.d.ts","type":"module","license":"MPL-2.0","author":{"name":"Alexma03"},"repository":{"type":"git","url":"git+https://github.com/Alexma03/alexma03-utcp.git","directory":"packages/direct-call"},"homepage":"https://github.com/Alexma03/alexma03-utcp#readme","bugs":{"url":"https://github.com/Alexma03/alexma03-utcp/issues"},"keywords":["utcp","universal-tool-calling-protocol","tools","api","typescript","tool calling","direct-call","callable","agent","ai","llm"],"publishConfig":{"access":"public"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js"}},"dependencies":{},"peerDependencies":{"@alexma03/utcp-sdk":"^1.1.1"},"devDependencies":{"@alexma03/utcp-sdk":"^1.1.1","@types/jest":"29.5.12","@types/node":"20.0.0","jest":"29.7.0","ts-jest":"29.1.2","typescript":"^5.0.0"},"scripts":{"build":"tsup","test":"jest"},"_id":"@alexma03/utcp-direct-call@1.1.2","_integrity":"sha512-OqxmuRqtI/t1u8zSWBuv0fpkCjR4WUbcQ35WcGQp0zCKfKg2S9MX51oQhNNAAm4XNmOgQmHgRuJ95eEzLDHSqw==","_resolved":"/private/var/folders/mw/dp007xzd5sz9vkhkjfz0fdh40000gn/T/7c3976f4817384cdb852fb7df7be1b21/alexma03-utcp-direct-call-1.1.2.tgz","_from":"file:alexma03-utcp-direct-call-1.1.2.tgz","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-OqxmuRqtI/t1u8zSWBuv0fpkCjR4WUbcQ35WcGQp0zCKfKg2S9MX51oQhNNAAm4XNmOgQmHgRuJ95eEzLDHSqw==","shasum":"1b967f2a723cc94b214716db771f17545cadf9c4","tarball":"https://registry.npmjs.org/@alexma03/utcp-direct-call/-/utcp-direct-call-1.1.2.tgz","fileCount":8,"unpackedSize":799810,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFVoeFI5Z9D1U0c6SsjkxdjtFKHZ6QgIgVLP3bdb87HIAiEA7fICq4aLieG5fLOx/5/YlxPMKDpdLlI6nXJcPjqwIUU="}]},"_npmUser":{"name":"alexma03","email":"alex03marcos@gmail.com"},"directories":{},"maintainers":[{"name":"alexma03","email":"alex03marcos@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/utcp-direct-call_1.1.2_1773735241505_0.11027907880485754"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-16T08:47:37.370Z","modified":"2026-03-17T08:14:01.780Z","1.1.1":"2026-03-16T08:47:37.596Z","1.1.2":"2026-03-17T08:14:01.667Z"},"bugs":{"url":"https://github.com/Alexma03/alexma03-utcp/issues"},"author":{"name":"Alexma03"},"license":"MPL-2.0","homepage":"https://github.com/Alexma03/alexma03-utcp#readme","keywords":["utcp","universal-tool-calling-protocol","tools","api","typescript","tool calling","direct-call","callable","agent","ai","llm"],"repository":{"type":"git","url":"git+https://github.com/Alexma03/alexma03-utcp.git","directory":"packages/direct-call"},"description":"Direct callable functions plugin for UTCP","maintainers":[{"name":"alexma03","email":"alex03marcos@gmail.com"}],"readme":"# @alexma03/utcp-direct-call\n\nDirect callable functions plugin for UTCP (Universal Tool Calling Protocol).\n\nThis plugin allows you to register and call JavaScript/TypeScript functions directly as UTCP tools, without the need for external APIs or file-based configurations.\n\n## Features\n\n- **Direct Function Calls**: Register JavaScript/TypeScript functions as UTCP tools\n- **Simple Registration**: Use `addFunctionToUtcpDirectCall()` to register functions at the global level\n- **Type-Safe**: Full TypeScript support with proper type definitions\n- **Streaming Support**: Built-in support for streaming responses\n\n## Installation\n\n```bash\nnpm install @alexma03/utcp-direct-call\n```\n\n## Usage\n\n**Important:** When UTCP calls your registered functions, it spreads the toolArgs object properties as separate parameters. For example, if toolArgs is `{ name: 'Alice', age: 30 }`, your function will be called as `yourFunction('Alice', 30)`, not `yourFunction({ name: 'Alice', age: 30 })`.\n\n### Using `addFunctionToUtcpDirectCall`\n\n```typescript\nimport { addFunctionToUtcpDirectCall } from '@alexma03/utcp-direct-call';\nimport { UtcpManual } from '@alexma03/utcp-sdk';\n\n// Register a function that returns a UTCP manual\nconst getMyManual = addFunctionToUtcpDirectCall('myManual', async (): Promise<UtcpManual> => {\n  return {\n    utcp_version: '1.0.0',\n    manual_version: '1.0.0',\n    tools: [\n      {\n        name: 'exampleTool',\n        description: 'An example tool',\n        inputs: { type: 'object', properties: {} },\n        outputs: { type: 'object', properties: {} },\n        tags: [],\n        tool_call_template: {\n          call_template_type: 'direct-call',\n          callable_name: 'exampleTool'\n        }\n      }\n    ]\n  };\n});\n\n// Register a tool function\nconst myTool = addFunctionToUtcpDirectCall('exampleTool', async (...args: any[]): Promise<any> => {\n  return { result: 'Hello from direct call!' };\n});\n\n// You can also use named functions\n// Note: Parameters are spread from the toolArgs object\nasync function greet(name: string) {\n  return `Hello, ${name}!`;\n}\naddFunctionToUtcpDirectCall('greet', greet);\n```\n\n### Manual Registration\n\n```typescript\nimport { registerCallable } from '@alexma03/utcp-direct-call';\nimport { UtcpManual } from '@alexma03/utcp-sdk';\n\n// Register a callable for returning manuals\nregisterCallable('myManual', async () => {\n  return {\n    utcp_version: '1.0.0',\n    manual_version: '1.0.0',\n    tools: []\n  } as UtcpManual;\n});\n\n// Register a callable for tool execution\nregisterCallable('myTool', async (...args: any[]) => {\n  return { result: 'Success!' };\n});\n```\n\n## License\n\nMPL-2.0\n","readmeFilename":"README.md"}