{"_id":"@act-sdk/core","_rev":"7-df50c06b2c6bc02d573e0e6bee4ea323","name":"@act-sdk/core","dist-tags":{"latest":"3.0.1"},"versions":{"1.0.0":{"name":"@act-sdk/core","version":"1.0.0","_id":"@act-sdk/core@1.0.0","maintainers":[{"name":"act-sdk","email":"kupamakunura@gmail.com"}],"dist":{"shasum":"ef44621eb3431f7ecac5f1feae74fa5e39e9109a","tarball":"https://registry.npmjs.org/@act-sdk/core/-/core-1.0.0.tgz","fileCount":5,"integrity":"sha512-IuGqEN9u0afPUAt63mJwLUcdm1XELExEYSvRTAP09M/HESU+Bkfp5qz/fkuZRErUk/QjWN2JCN+kLF/4StkCQw==","signatures":[{"sig":"MEQCICGgEFO4UmnfKNcwwBvju8rMFyXzca82nabuJcrgSKAfAiB9zLNo8hSuccS2fh44MRBA+DuOW9LJadSROF8R9TFucw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9157},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"2e950e1aa5a042db2e9702696f2ea43a1dfea216","private":false,"scripts":{"dev":"tsup --watch","build":"tsup","typecheck":"pnpm -s tsc --noEmit -p tsconfig.json"},"_npmUser":{"name":"act-sdk","email":"kupamakunura@gmail.com"},"_npmVersion":"11.6.4","description":"Core primitives for defining and running Act SDK actions.","directories":{},"_nodeVersion":"22.17.1","dependencies":{"zod":"^3.22.0","zod-to-json-schema":"^3.25.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"zod":"^3"},"_npmOperationalInternal":{"tmp":"tmp/core_1.0.0_1772490263345_0.043635218215102745","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@act-sdk/core","version":"1.0.1","_id":"@act-sdk/core@1.0.1","maintainers":[{"name":"act-sdk","email":"kupamakunura@gmail.com"}],"dist":{"shasum":"a44427a3dc6dd51004655e899ade70f65f9f9267","tarball":"https://registry.npmjs.org/@act-sdk/core/-/core-1.0.1.tgz","fileCount":5,"integrity":"sha512-KCg4VWNm8aFCj1cTHfSG+2L29jx0uUYIj+I077ttrcG8Fds4oUKv0H7Hw2IPgjRNug0rO4GdMZ24+u2Sn/cA+Q==","signatures":[{"sig":"MEYCIQCZD2fDTuzkEszWjeAqGrNIwwhhW6jvCvkoDp5lOxNM/QIhAP+B1QH0UScwH8PA0miEbN8y+76aCgAy/MWSuBHsPodo","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9156},"main":"./dist/index.js","type":"module","_from":"file:act-sdk-core-1.0.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"private":false,"scripts":{"dev":"tsup --watch","build":"tsup","typecheck":"pnpm -s tsc --noEmit -p tsconfig.json"},"_npmUser":{"name":"act-sdk","email":"kupamakunura@gmail.com"},"_resolved":"/tmp/5c45fa91ce7d16b2c0e2697f291cb9c4/act-sdk-core-1.0.1.tgz","_integrity":"sha512-KCg4VWNm8aFCj1cTHfSG+2L29jx0uUYIj+I077ttrcG8Fds4oUKv0H7Hw2IPgjRNug0rO4GdMZ24+u2Sn/cA+Q==","_npmVersion":"11.6.4","description":"Core primitives for defining and running Act SDK actions.","directories":{},"_nodeVersion":"22.17.1","dependencies":{"zod":"^3.22.0","zod-to-json-schema":"^3.25.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"zod":"^3"},"_npmOperationalInternal":{"tmp":"tmp/core_1.0.1_1772491596686_0.10357654955697404","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@act-sdk/core","version":"1.1.0","_id":"@act-sdk/core@1.1.0","maintainers":[{"name":"act-sdk","email":"kupamakunura@gmail.com"}],"dist":{"shasum":"b8be6fa3bc60493b8d9bcaf2100a42470a1039de","tarball":"https://registry.npmjs.org/@act-sdk/core/-/core-1.1.0.tgz","fileCount":5,"integrity":"sha512-xy6HO0PBObtA1J2EpCKfz0fFTmPfqNMb3+7B06rqZViLY3KCVKqfSIvRnzivBCf6RI43EuAttikwWtJMbj+UNw==","signatures":[{"sig":"MEQCIHhYwv3YkBaEO/0rCLJWos/nolzuMShSUb/iiWXwtyuKAiBpXpxyk216pkBmmOKBUqN6lRtB00XXeMKRwi+3tkCqoQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9176},"main":"./dist/index.js","type":"module","_from":"file:act-sdk-core-1.1.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"private":false,"scripts":{"dev":"tsup --watch","build":"tsup","typecheck":"pnpm -s tsc --noEmit -p tsconfig.json"},"_npmUser":{"name":"act-sdk","email":"kupamakunura@gmail.com"},"_resolved":"/tmp/8e879f5b0bb4b52f54a7e2b79a7f3a08/act-sdk-core-1.1.0.tgz","_integrity":"sha512-xy6HO0PBObtA1J2EpCKfz0fFTmPfqNMb3+7B06rqZViLY3KCVKqfSIvRnzivBCf6RI43EuAttikwWtJMbj+UNw==","_npmVersion":"11.6.4","description":"Core primitives for defining and running Act SDK actions.","directories":{},"_nodeVersion":"22.17.1","dependencies":{"zod":"^3.22.0","zod-to-json-schema":"^3.25.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"zod":"^3"},"_npmOperationalInternal":{"tmp":"tmp/core_1.1.0_1772968334139_0.482626767126326","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@act-sdk/core","version":"2.0.0","_id":"@act-sdk/core@2.0.0","maintainers":[{"name":"act-sdk","email":"kupamakunura@gmail.com"}],"dist":{"shasum":"3d1b8775ac566a3a581c49b9c1321cf4ee77a3c1","tarball":"https://registry.npmjs.org/@act-sdk/core/-/core-2.0.0.tgz","fileCount":5,"integrity":"sha512-Bd5f32pBOaCJHr0GfW1RLoMkpd4hFoxr467XgcmdgGyyaYeAEKofBspC3nsPtYWpGPQyee1rGIlhI/H0vOAWZg==","signatures":[{"sig":"MEUCIQDqhPIrqo8m+xDOStGyHI0kNOtSae6yRao/VVmqfk1CWQIgBP5o/OghFww6IBfeyQCV4KJKpH9KkHAoVKpLohj9IlE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9753},"main":"./dist/index.js","type":"module","_from":"file:act-sdk-core-2.0.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"private":false,"scripts":{"dev":"tsup --watch","build":"tsup","typecheck":"pnpm -s tsc --noEmit -p tsconfig.json"},"_npmUser":{"name":"act-sdk","email":"kupamakunura@gmail.com"},"_resolved":"/tmp/6c82307faf349ab7b77a3da5f80a3c50/act-sdk-core-2.0.0.tgz","_integrity":"sha512-Bd5f32pBOaCJHr0GfW1RLoMkpd4hFoxr467XgcmdgGyyaYeAEKofBspC3nsPtYWpGPQyee1rGIlhI/H0vOAWZg==","_npmVersion":"11.6.4","description":"Core primitives for defining and running Act SDK actions.","directories":{},"_nodeVersion":"22.17.1","dependencies":{"zod":"^3.25.0 || ^4.0.0","zod-to-json-schema":"^3.25.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"zod":"^3.25.0 || ^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/core_2.0.0_1772970106492_0.006878011595299771","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"name":"@act-sdk/core","version":"2.0.1","_id":"@act-sdk/core@2.0.1","maintainers":[{"name":"act-sdk","email":"kupamakunura@gmail.com"}],"dist":{"shasum":"423d0d6ed521d340e242f3642135dd83354126db","tarball":"https://registry.npmjs.org/@act-sdk/core/-/core-2.0.1.tgz","fileCount":5,"integrity":"sha512-IAxNiW8K+G42geXkn52V1eYldAXeWMximXEQ5HfPtjR/P/F2KmyrqPqdT2R0WI4MUZNb2KgcglYwjewWKIWXTw==","signatures":[{"sig":"MEQCID2gh83SlsQOmdFXlIVxb68uU0aP0KLHHF457NdJYs3VAiBVVWhikE7sJhtZq9zQreJ/PQwvOd6yjeaNMFKO6iLXHw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9753},"main":"./dist/index.js","type":"module","_from":"file:act-sdk-core-2.0.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"private":false,"scripts":{"dev":"tsup --watch","build":"tsup","typecheck":"pnpm -s tsc --noEmit -p tsconfig.json"},"_npmUser":{"name":"act-sdk","email":"kupamakunura@gmail.com"},"_resolved":"/tmp/9d3c3aa623f187dfcf4a53416ea67898/act-sdk-core-2.0.1.tgz","_integrity":"sha512-IAxNiW8K+G42geXkn52V1eYldAXeWMximXEQ5HfPtjR/P/F2KmyrqPqdT2R0WI4MUZNb2KgcglYwjewWKIWXTw==","_npmVersion":"11.6.4","description":"Core primitives for defining and running Act SDK actions.","directories":{},"_nodeVersion":"22.17.1","dependencies":{"zod":"^3.25.0 || ^4.0.0","zod-to-json-schema":"^3.25.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"zod":"^3.25.0 || ^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/core_2.0.1_1772972213686_0.6469482273863016","host":"s3://npm-registry-packages-npm-production"}},"3.0.0":{"name":"@act-sdk/core","version":"3.0.0","_id":"@act-sdk/core@3.0.0","maintainers":[{"name":"act-sdk","email":"kupamakunura@gmail.com"}],"dist":{"shasum":"b1ee8505b090f2451f2a9d608d181da2917fbba0","tarball":"https://registry.npmjs.org/@act-sdk/core/-/core-3.0.0.tgz","fileCount":6,"integrity":"sha512-oxDMp9591JCTLNcDyFa9ZmPLo6KZPv+VXe0/qO7/NANwlqObBOr9SqIT+sFuTgOkPXyer29Vva4H7YDbYKkc1A==","signatures":[{"sig":"MEUCIQDskAmqWJ45qejmdZ8L/wGKmKvbVRexiukXOh/nU2Sz/AIgcBxyXO3ILVlLGcnS/UDvukWRV7qBWUEhx3Z1D3UzzOo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9850},"main":"./dist/index.js","type":"module","_from":"file:act-sdk-core-3.0.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"private":false,"scripts":{"dev":"tsup --watch","test":"pnpm run build && node --test test/**/*.test.mjs","build":"tsup","typecheck":"pnpm -s tsc --noEmit -p tsconfig.json"},"_npmUser":{"name":"act-sdk","email":"kupamakunura@gmail.com"},"_resolved":"/tmp/19a61824612c317d0fcae1c1d1796ad9/act-sdk-core-3.0.0.tgz","_integrity":"sha512-oxDMp9591JCTLNcDyFa9ZmPLo6KZPv+VXe0/qO7/NANwlqObBOr9SqIT+sFuTgOkPXyer29Vva4H7YDbYKkc1A==","_npmVersion":"11.6.4","description":"Action registry for building MCP-ready apps.","directories":{},"_nodeVersion":"22.17.1","dependencies":{"zod":"^3.25.0 || ^4.0.0","zod-to-json-schema":"^3.25.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"zod":"^3.25.0 || ^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/core_3.0.0_1775193540280_0.7785971434786818","host":"s3://npm-registry-packages-npm-production"}},"3.0.1":{"name":"@act-sdk/core","version":"3.0.1","private":false,"type":"module","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"publishConfig":{"access":"public"},"dependencies":{"zod":"^3.25.0 || ^4.0.0","zod-to-json-schema":"^3.25.1"},"peerDependencies":{"zod":"^3.25.0 || ^4.0.0"},"scripts":{"build":"tsup","dev":"tsup --watch","typecheck":"pnpm -s tsc --noEmit -p tsconfig.json","test":"pnpm run build && node --test test/**/*.test.mjs"},"_id":"@act-sdk/core@3.0.1","description":"Action registry for building MCP-ready apps.","_integrity":"sha512-MWQrIn+iAb0efCRWumiY1bdsPlbNA3rGgks24UzBUa9mudUx2z+VW/F420L/iO2P/FAAli/OyobgRxYR6L5Cpg==","_resolved":"/tmp/76367dbb8b81e3350c4734a070cf0298/act-sdk-core-3.0.1.tgz","_from":"file:act-sdk-core-3.0.1.tgz","_nodeVersion":"22.17.1","_npmVersion":"11.6.4","dist":{"integrity":"sha512-MWQrIn+iAb0efCRWumiY1bdsPlbNA3rGgks24UzBUa9mudUx2z+VW/F420L/iO2P/FAAli/OyobgRxYR6L5Cpg==","shasum":"70f263641d999b48b42754e24ccc0b43318daa76","tarball":"https://registry.npmjs.org/@act-sdk/core/-/core-3.0.1.tgz","fileCount":6,"unpackedSize":9850,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDd9b6HLcF5tpL2gqsKj6O7fIgIBklLH8QIWVGSZhe+mwIgW8SpY9OS1IfQZl9j3c3NVhHzZS0qDHCGXwD2dIk/2jI="}]},"_npmUser":{"name":"act-sdk","email":"kupamakunura@gmail.com"},"directories":{},"maintainers":[{"name":"act-sdk","email":"kupamakunura@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/core_3.0.1_1775195714157_0.6302321912727515"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-02T22:24:23.238Z","modified":"2026-04-03T05:55:14.427Z","1.0.0":"2026-03-02T22:24:23.510Z","1.0.1":"2026-03-02T22:46:36.818Z","1.1.0":"2026-03-08T11:12:14.275Z","2.0.0":"2026-03-08T11:41:46.654Z","2.0.1":"2026-03-08T12:16:53.847Z","3.0.0":"2026-04-03T05:19:00.437Z","3.0.1":"2026-04-03T05:55:14.307Z"},"description":"Action registry for building MCP-ready apps.","maintainers":[{"name":"act-sdk","email":"kupamakunura@gmail.com"}],"readme":"# @act-sdk/core\n\nAction registry for building MCP-ready apps.\n\n## What is this?\n\nThe core registry that lets you define actions with type-safe inputs. Actions can be called directly in your app OR exposed as MCP tools. Your existing functions become both internal logic and AI-accessible tools.\n\n## Installation\n\n```bash\nnpm install @act-sdk/core zod\n```\n\nWorks with Zod v3.25+ and v4.\n\n## Quick Start\n\n```typescript\nimport { createAct, defineConfig } from '@act-sdk/core';\nimport { z } from 'zod';\n\n// 1. Create action registry\nexport const act = createAct();\n\n// 2. Register actions — returns the handler function\nexport const getDoughnuts = act.action({\n  id: 'getDoughnuts',\n  description: 'Get doughnuts for a user',\n  input: z.object({\n    userId: z.string(),\n    limit: z.number().optional(),\n  }),\n  handler: async ({ userId, limit }) => {\n    return db.doughnuts.findMany({ \n      where: { userId }, \n      take: limit ?? 10 \n    });\n  },\n});\n\n// 3. Use directly in your app\nawait getDoughnuts({ userId: '123', limit: 5 });\n\n// 4. Export config for MCP adapters\nexport default defineConfig({\n  name: 'my-app',\n  description: 'My app MCP server',\n  version: '1.0.0',\n  act,\n});\n```\n\n## API\n\n### `createAct()`\n\nCreates an action registry.\n\n```typescript\nconst act = createAct();\n```\n\n### `act.action(def)`\n\nRegister an action. **Returns the handler function** so you can call it directly.\n\n```typescript\nexport const myAction = act.action({\n  id: 'myAction',\n  description: 'Does something',\n  input: z.object({ name: z.string() }),  // optional\n  handler: async ({ name }, context) => {\n    // context.authInfo available when called via MCP with auth\n    return `Hello, ${name}!`;\n  },\n});\n\n// Call it directly\nawait myAction({ name: 'Alice' });\n```\n\n### `act.getRegistry()`\n\nAccess the internal registry.\n\n```typescript\nconst registry = act.getRegistry();\n\nregistry.all();      // Get all registered actions\nregistry.get(id);    // Get specific action by ID\nregistry.has(id);    // Check if action exists\nregistry.size();     // Number of registered actions\n```\n\n### `defineConfig(config)`\n\nCreate a config object for MCP adapters.\n\n```typescript\nexport default defineConfig({\n  name: 'my-app',\n  description: 'My app description',\n  version: '1.0.0',\n  act,\n});\n```\n\n## Type Safety\n\nFull TypeScript support with automatic inference:\n\n```typescript\nconst calculate = act.action({\n  id: 'calculate',\n  input: z.object({\n    amount: z.number(),\n    tax: z.number(),\n  }),\n  handler: async ({ amount, tax }) => {\n    // amount and tax are typed as number\n    return amount + (amount * tax);\n  },\n});\n```\n\n## Authentication Context\n\nWhen actions are called via MCP adapters with auth, they receive context:\n\n```typescript\nact.action({\n  id: 'getProfile',\n  description: 'Get user profile',\n  handler: async (args, context) => {\n    // context.authInfo contains auth data from adapter\n    const userId = context?.authInfo?.userId;\n    return db.users.findOne({ id: userId });\n  },\n});\n```\n\n## Related Packages\n\n- **@act-sdk/mcp** - Convert actions to MCP server\n- **@act-sdk/adapters** - STDIO and Next.js adapters\n\n","readmeFilename":"README.md"}