{"_id":"@agent-nuvira/sdk","_rev":"2-253522886ea90daa465adce7a448495c","name":"@agent-nuvira/sdk","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@agent-nuvira/sdk","version":"1.0.0","keywords":["agent-nuvira","sdk","agents","multi-agent","ai","code-generation"],"author":{"name":"Dheeraj Sharma"},"license":"MIT","_id":"@agent-nuvira/sdk@1.0.0","maintainers":[{"name":"imdheerajsharma","email":"imdheeraj@gmail.com"}],"homepage":"https://github.com/imdheerajKube/agent-nuvira#readme","bugs":{"url":"https://github.com/imdheerajKube/agent-nuvira/issues"},"dist":{"shasum":"ec4f4a3a5d4c236a81302175d4386ac45e77681f","tarball":"https://registry.npmjs.org/@agent-nuvira/sdk/-/sdk-1.0.0.tgz","fileCount":26,"integrity":"sha512-2Qf4veDL09VturgxFztZEWVJFneFbnD/vq1tmg2RtJhtYOl7dA26tu5uBHAcmOXKEaXUkMInYhUwFluSMjSSHw==","signatures":[{"sig":"MEYCIQDInl1TM1KFsOU5zJnWvsZZkezJvV2xbP/4ElrDxyIm9QIhAJRuAw0W4i4+EUZ4yvPlBRwTbqUvRvEWcApSpPOzr8Rq","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":85174},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=21.7.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./agent":{"types":"./dist/agent.d.ts","import":"./dist/agent.js"},"./types":{"types":"./dist/types.d.ts","import":"./dist/types.js"},"./testing":{"types":"./dist/testing.d.ts","import":"./dist/testing.js"}},"gitHead":"c0fdfc61b33306adf4b16d699ad054a30f67ae41","scripts":{"dev":"tsc --watch","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"imdheerajsharma","email":"imdheeraj@gmail.com"},"repository":{"url":"git+https://github.com/imdheerajKube/agent-nuvira.git","type":"git"},"_npmVersion":"12.0.1","description":"Agent-Baba-D SDK — Build custom agents for the Agent-Baba-D multi-agent orchestration system","directories":{},"_nodeVersion":"26.5.0","dependencies":{},"_hasShrinkwrap":false,"peerDependencies":{"typescript":">=5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.0.0_1784224853842_0.3195346087325297","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@agent-nuvira/sdk","version":"1.0.1","description":"Agent-Nuvira SDK — Build custom agents for the Agent-Nuvira multi-agent orchestration system","type":"module","main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./testing":{"types":"./dist/testing.d.ts","import":"./dist/testing.js"},"./agent":{"types":"./dist/agent.d.ts","import":"./dist/agent.js"},"./types":{"types":"./dist/types.d.ts","import":"./dist/types.js"}},"scripts":{"build":"tsc","dev":"tsc --watch","prepublishOnly":"npm run build"},"keywords":["agent-nuvira","sdk","agents","multi-agent","ai","code-generation"],"license":"MIT","author":{"name":"Dheeraj Sharma"},"repository":{"type":"git","url":"git+https://github.com/imdheerajKube/agent-nuvira.git"},"engines":{"node":">=21.7.0"},"dependencies":{},"peerDependencies":{"typescript":">=5.0.0"},"gitHead":"c0fdfc61b33306adf4b16d699ad054a30f67ae41","_id":"@agent-nuvira/sdk@1.0.1","bugs":{"url":"https://github.com/imdheerajKube/agent-nuvira/issues"},"homepage":"https://github.com/imdheerajKube/agent-nuvira#readme","_nodeVersion":"26.5.0","_npmVersion":"12.0.1","dist":{"integrity":"sha512-uleMnQUVT07HFrpKRQtZcXD7CpMpB3UnlwrLIRLbp7Sm3X9dlI8HtiKuAIBcSsr17hyUjmCoorn/fpS/bbMmPg==","shasum":"7c59ecbbe2eaf62a7448f078bdc3cba14fb0bc55","tarball":"https://registry.npmjs.org/@agent-nuvira/sdk/-/sdk-1.0.1.tgz","fileCount":26,"unpackedSize":85174,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDCQSUzC7Q23W8cdzPbHiNNScr3iMcCRDBsVgyDsZ9HSQIgS3sOWzyQbZ9DUpUivkC56edEsEW3q+TVxB5ZKLUUxtc="}]},"_npmUser":{"name":"imdheerajsharma","email":"imdheeraj@gmail.com"},"directories":{},"maintainers":[{"name":"imdheerajsharma","email":"imdheeraj@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_1.0.1_1784225104503_0.40036753966998306"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-16T18:00:53.608Z","modified":"2026-07-16T18:05:04.882Z","1.0.0":"2026-07-16T18:00:54.012Z","1.0.1":"2026-07-16T18:05:04.630Z"},"bugs":{"url":"https://github.com/imdheerajKube/agent-nuvira/issues"},"author":{"name":"Dheeraj Sharma"},"license":"MIT","homepage":"https://github.com/imdheerajKube/agent-nuvira#readme","keywords":["agent-nuvira","sdk","agents","multi-agent","ai","code-generation"],"repository":{"type":"git","url":"git+https://github.com/imdheerajKube/agent-nuvira.git"},"description":"Agent-Nuvira SDK — Build custom agents for the Agent-Nuvira multi-agent orchestration system","maintainers":[{"name":"imdheerajsharma","email":"imdheeraj@gmail.com"}],"readme":"# @agent-nuvira/sdk\n\n> Build custom agents for the Agent-Nuvira multi-agent orchestration system.\n\n## Installation\n\n```bash\nnpm install @agent-nuvira/sdk\n```\n\n## Quick Start\n\nCreate a custom agent in three steps:\n\n### 1. Scaffold the project\n\n```bash\n# From the agent-nuvira project root\nnpx tsx src/index.ts sdk scaffold my-agent CodeFormatter \"Formats source code\"\n\n# Or manually create the files (see examples below)\n```\n\n### 2. Implement your agent\n\n```ts\n// src/code-formatter.ts\nimport { Agent, type AgentContext, type AgentResult, type LLMCallFn } from '@agent-nuvira/sdk';\n\nexport class CodeFormatter extends Agent {\n  readonly name = 'CodeFormatter';\n  readonly description = 'Formats source code according to project conventions';\n\n  async execute(context: AgentContext, callLLM: LLMCallFn): Promise<AgentResult> {\n    // Read files from the context\n    const files = context.artifacts;\n\n    // Build a prompt\n    const prompt = [\n      `You are the CodeFormatter agent.`,\n      `Goal: ${context.goal}`,\n      '',\n      `Files to format:`,\n      ...files.map(f => `- ${f.path}`),\n    ].join('\\n');\n\n    // Call the LLM\n    const response = await callLLM(prompt);\n\n    return {\n      success: true,\n      summary: `Formatted ${files.length} file(s)`,\n      details: response,\n    };\n  }\n}\n\n// Required: export a descriptor for automatic registration\nexport const agentDescriptor = {\n  AgentClass: CodeFormatter,\n  name: 'CodeFormatter',\n  description: 'Formats source code according to project conventions',\n  agentType: 'code-formatter',\n  tags: 'code, format',\n};\n```\n\n### 3. Test your agent\n\n```ts\n// tests/code-formatter.test.ts\nimport { describe, it } from 'vitest';\nimport { CodeFormatter } from '../src/code-formatter.js';\nimport {\n  createMockContext,\n  createMockLLM,\n  createFailingMockLLM,\n  runAgentTest,\n  assertAgentSuccess,\n  assertAgentFailure,\n} from '@agent-nuvira/sdk/testing';\n\ndescribe('CodeFormatter', () => {\n  const agent = new CodeFormatter();\n\n  it('should format files', async () => {\n    const ctx = createMockContext({\n      goal: 'Format all TypeScript files',\n      artifacts: [{ path: 'src/index.ts', content: 'const x=1', description: 'Source' }],\n    });\n    const llm = createMockLLM('Formatted content');\n\n    const result = await runAgentTest(agent, ctx, llm);\n\n    assertAgentSuccess(result);\n  });\n});\n```\n\n## API Reference\n\n### `Agent` (base class)\n\n| Method | Description |\n|---|---|\n| `abstract execute(context, callLLM)` | Main logic — implement this |\n| `validate(context)` | Optional pre-execution check |\n| `cleanup()` | Optional post-execution cleanup |\n\n### Core Types\n\n| Type | Description |\n|---|---|\n| `AgentContext` | Shared context bus — read inputs, write outputs |\n| `AgentResult` | Success/failure result with summary and details |\n| `TaskStep` | A single step in the execution plan |\n| `FileChange` | A proposed file modification |\n| `Artifact` | A file artifact (input or output) |\n| `LLMCallFn` | Function signature for LLM calls |\n| `InferenceOptions` | LLM generation parameters |\n\n### Testing Utilities (`@agent-nuvira/sdk/testing`)\n\n| Function | Description |\n|---|---|\n| `createMockContext(options)` | Build a fully typed mock AgentContext |\n| `createMockLLM(response)` | Mock LLM that returns a fixed response |\n| `createFailingMockLLM(error)` | Mock LLM that throws an error |\n| `createSequentialMockLLM(responses)` | Mock LLM with sequenced responses |\n| `runAgentTest(agent, context, callLLM)` | Execute agent with validate + cleanup |\n| `assertAgentSuccess(result)` | Assert result indicates success |\n| `assertAgentFailure(result, errorSubstring?)` | Assert result indicates failure |\n| `addArtifact(context, path, content, description)` | Add a file artifact |\n| `addTaskStep(context, id, agentType, description, dependsOn)` | Add a task step |\n| `addFileChange(context, path, newContent, ...)` | Add a file change |\n\n## Scaffolding\n\nGenerate a new agent project:\n\n```bash\nagent-nuvira sdk scaffold my-agent CodeFormatter \"Formats source code\"\nagent-nuvira sdk scaffold --template basic-agent my-minimal-agent MinimalAgent \"Minimal example\"\nagent-nuvira sdk scaffold --template agent-pack my-agent-pack AgentPack \"Collection of agents\"\n```\n\nList available templates:\n\n```bash\nagent-nuvira sdk templates\n```\n\n## Publishing\n\n```bash\n# Build the SDK\nnpm run build:sdk\n\n# Publish to npm\ncd src/agent-sdk && npm publish\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}