{"_id":"@athlera/core","_rev":"7-01195cc103fc80b8d01481838f924fa8","name":"@athlera/core","dist-tags":{"latest":"0.2.2"},"versions":{"0.0.0":{"name":"@athlera/core","version":"0.0.0","author":{"url":"https://athlera.com","name":"Athlera AS","email":"support@athlera.com"},"license":"MIT","_id":"@athlera/core@0.0.0","maintainers":[{"name":"chrisrm","email":"chris@hirvi.no"}],"contributors":[{"name":"Chris Magnussen","email":"chris@prek.no"}],"dist":{"shasum":"114f66622f890822ced5c30746a6245f4d070799","tarball":"https://registry.npmjs.org/@athlera/core/-/core-0.0.0.tgz","fileCount":5,"integrity":"sha512-cWgsYBFcBefaAEh9tR/LSOVI5Z+jSEEW0TOiqxUYPAmPGhTVgvkUE/PLBbv7pg4ejY09C9m81iyDLO5htK7yeQ==","signatures":[{"sig":"MEUCIQDGdcZm5qRhA32eXtastCJIeSTH2FezG0PB08K0zQOwQgIgZgcrJL91nyqN6rpL3q78sKb9+kapoOIDYbBFuLsslH0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12096},"type":"module","_from":"file:athlera-core-0.0.0.tgz","types":"./dist/index.d.ts","source":"./src/index.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"dev":"tsup --config ../../tsup.config.ts --watch","build":"pnpm clean && tsup --config ../../tsup.config.ts","clean":"rimraf dist"},"_npmUser":{"name":"chrisrm","email":"chris@hirvi.no"},"_resolved":"/private/var/folders/pk/2_9hhwf12mn0t168kg0hvk540000gn/T/3fc5593257e4d23d59a87d51b804423e/athlera-core-0.0.0.tgz","_integrity":"sha512-cWgsYBFcBefaAEh9tR/LSOVI5Z+jSEEW0TOiqxUYPAmPGhTVgvkUE/PLBbv7pg4ejY09C9m81iyDLO5htK7yeQ==","_npmVersion":"10.2.3","description":"This is our base package, it contains the core functionality of the Athlera framework.","directories":{},"sideEffects":false,"_nodeVersion":"18.19.0","dependencies":{"zod":"^3.24.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@athlera/tsconfig":"0.0.0"},"_npmOperationalInternal":{"tmp":"tmp/core_0.0.0_1741778220054_0.05783319107142959","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@athlera/core","version":"0.1.0","author":{"url":"https://athlera.com","name":"Athlera AS","email":"support@athlera.com"},"license":"MIT","_id":"@athlera/core@0.1.0","maintainers":[{"name":"chrisrm","email":"chris@hirvi.no"}],"contributors":[{"name":"Chris Magnussen","email":"chris@prek.no"}],"dist":{"shasum":"b92762e44e434640b378ad0c17cf18731a987843","tarball":"https://registry.npmjs.org/@athlera/core/-/core-0.1.0.tgz","fileCount":5,"integrity":"sha512-UjHMifGpE9VJ4vX/KXjT2OrY3gNe5zMuyplxChCxMv9T1Vl126yYqfIMBfS/XNFUcyLdRCLNeOWH9clHx/QhlQ==","signatures":[{"sig":"MEYCIQD6i+lFHtKFHGP5pc6w0LVSI6ChCnU26ZkPDUvav/pK6QIhAMTFbwo6BIzkNyh+yNvn0/gbBMySQqAabKlbM00emHsB","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12938},"type":"module","_from":"file:athlera-core-0.1.0.tgz","types":"./dist/index.d.ts","source":"./src/index.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"dev":"pnpm clean && tsup --config ../../tsup.config.ts --watch","build":"pnpm clean && tsup --config ../../tsup.config.ts","clean":"rimraf dist"},"_npmUser":{"name":"chrisrm","email":"chris@hirvi.no"},"_resolved":"/private/var/folders/pk/2_9hhwf12mn0t168kg0hvk540000gn/T/be894a96a7060fb07de9df3a5e15b8e2/athlera-core-0.1.0.tgz","_integrity":"sha512-UjHMifGpE9VJ4vX/KXjT2OrY3gNe5zMuyplxChCxMv9T1Vl126yYqfIMBfS/XNFUcyLdRCLNeOWH9clHx/QhlQ==","_npmVersion":"10.2.3","description":"This is our base package, it contains the core functionality of the Athlera framework.","directories":{},"sideEffects":false,"_nodeVersion":"18.19.0","dependencies":{"zod":"^3.24.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@athlera/tsconfig":"0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/core_0.1.0_1742384800494_0.6978829249983456","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@athlera/core","version":"0.2.0","author":{"url":"https://athlera.com","name":"Athlera AS","email":"support@athlera.com"},"license":"MIT","_id":"@athlera/core@0.2.0","maintainers":[{"name":"chrisrm","email":"chris@hirvi.no"}],"contributors":[{"name":"Chris Magnussen","email":"chris@prek.no"}],"dist":{"shasum":"5b0b0fe565a5b8544553fc75ecbf0dad93b2d344","tarball":"https://registry.npmjs.org/@athlera/core/-/core-0.2.0.tgz","fileCount":5,"integrity":"sha512-DZI3hwib2+mX79tcsigrOfvUapDx/opbU9kSC6wtgz6Lmt1OBL2Td/Mkua+gJTcOyAOMuNNFlPes/zPCN5sxpQ==","signatures":[{"sig":"MEUCIG2rhUkLfj8MaLKkXVjR0DWV328LOV1vbusUoUjP313SAiEAmUH1Q2f/nG+uorwV/nTt+MKfTCGQ9l2ljptOHpVtCRo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12938},"type":"module","_from":"file:athlera-core-0.2.0.tgz","types":"./dist/index.d.ts","source":"./src/index.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"dev":"pnpm clean && tsup --config ../../tsup.config.ts --watch","build":"pnpm clean && tsup --config ../../tsup.config.ts","clean":"rimraf dist"},"_npmUser":{"name":"chrisrm","email":"chris@hirvi.no"},"_resolved":"/private/var/folders/pk/2_9hhwf12mn0t168kg0hvk540000gn/T/076f81efcd495029b0024aeb2c8ec0d1/athlera-core-0.2.0.tgz","_integrity":"sha512-DZI3hwib2+mX79tcsigrOfvUapDx/opbU9kSC6wtgz6Lmt1OBL2Td/Mkua+gJTcOyAOMuNNFlPes/zPCN5sxpQ==","_npmVersion":"10.2.3","description":"This is our base package, it contains the core functionality of the Athlera framework.","directories":{},"sideEffects":false,"_nodeVersion":"18.19.0","dependencies":{"zod":"^3.24.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@athlera/tsconfig":"0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/core_0.2.0_1742820971516_0.5629151489025153","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@athlera/core","version":"0.2.1","author":{"url":"https://athlera.com","name":"Athlera AS","email":"support@athlera.com"},"license":"MIT","_id":"@athlera/core@0.2.1","maintainers":[{"name":"chrisrm","email":"chris@hirvi.no"}],"contributors":[{"name":"Chris Magnussen","email":"chris@prek.no"}],"dist":{"shasum":"5c3e7128fb980bc18d9448e03f256baa5ef3ecc1","tarball":"https://registry.npmjs.org/@athlera/core/-/core-0.2.1.tgz","fileCount":5,"integrity":"sha512-E1eyqDmZkjZPLIl0D50OoDX2ro7ajB2wilCemgXxt1ZMGp0jxMU7GvMgxiEO4cWVf2TfFeXi0YdCu5u6nEx8BQ==","signatures":[{"sig":"MEUCIGiAfS6vuJuAm1e5x30Oot3e3WIkh6S+VmuK6M4FlCXWAiEAkJRfjlwKtzfJ/EAzKrByrkX1fk0WNfxc3Lu3sghU0IY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":24620},"type":"module","_from":"file:athlera-core-0.2.1.tgz","types":"./dist/index.d.ts","source":"./src/index.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"dev":"pnpm clean && tsup --config ../../tsup.config.ts --watch","build":"pnpm clean && tsup --config ../../tsup.config.ts","clean":"rimraf dist"},"_npmUser":{"name":"chrisrm","email":"chris@hirvi.no"},"_resolved":"/private/var/folders/pk/2_9hhwf12mn0t168kg0hvk540000gn/T/094bd8a5738b8ff78dcb878d47e685c8/athlera-core-0.2.1.tgz","_integrity":"sha512-E1eyqDmZkjZPLIl0D50OoDX2ro7ajB2wilCemgXxt1ZMGp0jxMU7GvMgxiEO4cWVf2TfFeXi0YdCu5u6nEx8BQ==","_npmVersion":"10.2.3","description":"This is our base package, it contains the core functionality of the Athlera framework.","directories":{},"sideEffects":false,"_nodeVersion":"18.19.0","dependencies":{"zod":"^3.24.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@athlera/tsconfig":"0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/core_0.2.1_1743579969646_0.17142974645866538","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@athlera/core","version":"0.2.2","author":{"url":"https://athlera.com","name":"Athlera AS","email":"support@athlera.com"},"license":"MIT","_id":"@athlera/core@0.2.2","maintainers":[{"name":"chrisrm","email":"chris@hirvi.no"}],"contributors":[{"name":"Chris Magnussen","email":"chris@prek.no"}],"dist":{"shasum":"743045b92d56fd2ae466b0143e69231d0de7c8f4","tarball":"https://registry.npmjs.org/@athlera/core/-/core-0.2.2.tgz","fileCount":5,"integrity":"sha512-pfcd29KxFzKDJIKBRbMMpzBmFM+mjBhS1zgkDAnX0Rg2ez2FG+q/G2lMRCFE83j+3HGdfiPuBohsbUOY3/m08Q==","signatures":[{"sig":"MEQCIHtTu31+gX4QTTKVys3/j9S7P/9PRJgmRUP2LOha2lOjAiAce0jvI08kDOEbYe9T5Oh05PuERpNDjTcv5ZXKigVk2Q==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":24620},"type":"module","_from":"file:athlera-core-0.2.2.tgz","types":"./dist/index.d.ts","source":"./src/index.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"dev":"pnpm clean && tsup --config ../../tsup.config.ts --watch","build":"pnpm clean && tsup --config ../../tsup.config.ts","clean":"rimraf dist"},"_npmUser":{"name":"chrisrm","email":"chris@hirvi.no"},"_resolved":"/private/var/folders/pk/2_9hhwf12mn0t168kg0hvk540000gn/T/8ead02ee2e8b1e4903c6a6020787f7b3/athlera-core-0.2.2.tgz","_integrity":"sha512-pfcd29KxFzKDJIKBRbMMpzBmFM+mjBhS1zgkDAnX0Rg2ez2FG+q/G2lMRCFE83j+3HGdfiPuBohsbUOY3/m08Q==","_npmVersion":"10.2.3","description":"This is our base package, it contains the core functionality of the Athlera framework.","directories":{},"sideEffects":false,"_nodeVersion":"18.19.0","dependencies":{"zod":"^3.24.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@athlera/tsconfig":"0.1.1"},"_npmOperationalInternal":{"tmp":"tmp/core_0.2.2_1746019988472_0.0986490133944804","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-03-12T11:16:59.935Z","modified":"2025-08-26T10:32:58.854Z","0.0.0":"2025-03-12T11:17:00.222Z","0.1.0":"2025-03-19T11:46:40.688Z","0.2.0":"2025-03-24T12:56:11.682Z","0.2.1":"2025-04-02T07:46:09.849Z","0.2.2":"2025-04-30T13:33:08.746Z"},"author":{"url":"https://athlera.com","name":"Athlera AS","email":"support@athlera.com"},"license":"MIT","description":"This is our base package, it contains the core functionality of the Athlera framework.","contributors":[{"name":"Chris Magnussen","email":"chris@prek.no"}],"maintainers":[{"email":"chris@hirvi.no","name":"chrisrm"},{"email":"ruben@prek.no","name":"rubenmagn"},{"email":"are@meisfjord.com","name":"aremeis"}],"readme":"# `@athlera/core`\n\nThis is our base package, it contains the core functionality of the Athlera framework.\n\n## Installation\n\n```bash\npnpm add @athlera/core\n```\n\n## Tooling\n\nThis package contains methods for creating tools. A tool is a piece of code that can be run by the AI to perform a specific task. Tools can be used to perform a wide range of tasks, from simple calculations to complex machine learning models.\n\n### Create a new tool using `createTool`\n\nTo create your own tool, you can use the `@athlera/core`. This package provides helper functions and classes for defining tools.\n\n`tools/weather.ts`\n\n```typescript\nimport { createTool } from '@athlera/core';\n\nconst getWeatherInformation = createTool({\n    name: 'getWeatherInformation',\n    description: 'Show the weather in a given city to the user',\n    inputSchema: z.object({\n        city: z.string(),\n    }),\n    execute: async ({ city }: { city: string }) => {\n        return `The weather in ${city} is sunny`;\n    },\n});\n\nexport {\n    getWeatherInformation\n}\n```\n\n#### Create a new tool using `Tool` class\n\nYou can also create a tool using the `Tool` class directly.\n\n`tools/weather.ts`\n\n```typescript\nimport { Tool } from '@athlera/core';\n\nclass GetLocation extends Tool {\n    name = 'getLocation';\n    description = 'Get the user location.';\n    inputSchema = z.object({});\n}\n\nexport {\n    GetLocation\n}\n```\n\n### Scaffold a new tool with CLI\n\nTo create a new tool with CLI, you can use the `@athlera/cli` package. This package provides helper functions and classes for defining tools and CLI commands.\n\n```bash\npnpx athlera create:tool --name=\"getWeatherInformation\"\n```\n\nThis will add a new tool to your project, in the `tools` directory. You can choose where to place the tool by providing a destination.\n\n```bash\npnpx athlera create:tool --name=\"getWeatherInformation\" --destination=\"src/tools\"\n```\n\n### Use tool in your code. Example for AI SDK (Vercel)\n\n```typescript\nimport { streamText } from 'ai';\nimport { openai } from '@ai-sdk/openai';\nimport { getWeatherInformation, GetLocation } from '~/tools/weather'\nimport { createAssistantRuntime } from '@athlera-ai/ai-sdk'\n\nexport async function POST(request: Request) {\n    const { \n        messages, \n        assistant \n    } = await request.json();\n\n    const runtime = createAssistantRuntime(assistant, {\n        tools: [\n            getWeatherInformation, \n            new GetLocation\n        ],\n        messages\n    });\n\n    return runtime.stream();\n    //return runtime.generate();\n}\n","readmeFilename":"README.md"}