Plugin package#4
Conversation
Add a new plugin scaffold under packages/plugins/template: manifest, src/index.ts, package.json, tsconfig files, and a Jest test suite (__tests__). Update @agentbase/plugin-sdk package.json (packages/plugins/package.json) to point main/types to sdk/src and add Jest-related devDependencies for running tests and ts-jest. This provides a ready-to-use plugin template and test setup.
Add a new plugin scaffold under packages/plugins/template: manifest, src/index.ts, package.json, tsconfig files, and a Jest test suite (__tests__). Update @agentbase/plugin-sdk package.json (packages/plugins/package.json) to point main/types to sdk/src and add Jest-related devDependencies for running tests and ts-jest. This provides a ready-to-use plugin template and test setup.
Add a new plugin scaffold under packages/plugins/template: manifest, src/index.ts, package.json, tsconfig files, and a Jest test suite (__tests__). Update @agentbase/plugin-sdk package.json (packages/plugins/package.json) to point main/types to sdk/src and add Jest-related devDependencies for running tests and ts-jest. This provides a ready-to-use plugin template and test setup.
Remove leftover merge conflict markers and standardize imports to use "@agentbase/plugin-sdk" in src and tests. Update __tests__/tsconfig.json path to reference "../sdk/src/index.ts" so tests resolve the SDK correctly. Tweak package tsconfig by removing rootDir and enabling noEmit to align build/test behavior.
Resolve merge conflicts and configure the template plugin to build/test against the local SDK. Changes: switch imports/path mappings to the monorepo SDK (../../sdk/src and @agentbase/plugin-sdk mapping), update tsconfig/tsconfig.test/includes/rootDir/types to include SDK sources, adjust package.json (name -> @agentbase/plugin-template, version, private flag, build script, jest config), and update pnpm-workspace.yaml and pnpm-lock.yaml to add workspace entries and test/dev deps for the template package. General housekeeping to allow running tests and TypeScript checks against the local SDK.
There was a problem hiding this comment.
Pull request overview
This PR adds a new packages/plugins/template workspace intended to serve as a starting point for Agentbase plugin development, including example plugin code and a Jest/TypeScript test setup. It also updates pnpm workspace configuration and plugin SDK/package dependencies to support plugin development and testing.
Changes:
- Added a new plugin template package (
packages/plugins/template) with manifest, boilerplate implementation, and Jest-based unit tests. - Updated pnpm workspace globs to include plugin subpackages.
- Updated dependencies/config (including Jest/ts-jest) and lockfile entries to support plugin testing.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 18 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-workspace.yaml | Expands workspace package globs to include plugin subpackages. |
| pnpm-lock.yaml | Updates lockfile for new Jest/TypeScript dependencies (currently contains merge conflicts). |
| packages/plugins/package.json | Adjusts SDK entry points and adds Jest devDependencies for the plugin SDK package. |
| packages/plugins/template/package.json | Defines the template plugin package config and embedded Jest config (currently contains merge conflicts). |
| packages/plugins/template/manifest.json | Adds a template plugin manifest for runtime metadata. |
| packages/plugins/template/src/index.ts | Adds boilerplate plugin implementation using the SDK (currently contains merge conflicts). |
| packages/plugins/template/tsconfig.json | Adds TypeScript config for the template plugin (currently contains merge conflicts). |
| packages/plugins/template/tsconfig.test.json | Adds TS config for Jest tests (currently contains merge conflicts). |
| packages/plugins/template/tests/index.test.ts | Adds unit tests and inline mocks for template plugin (currently contains merge conflicts). |
| packages/plugins/template/tests/tsconfig.json | Adds test-specific TS config (currently contains merge conflicts). |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <<<<<<< Updated upstream | ||
| version: 29.4.6(@babel/core@7.29.0)(@jest/transform@29.7.0)(@jest/types@30.3.0)(babel-jest@29.7.0(@babel/core@7.29.0))(jest-util@30.3.0)(jest@29.7.0(@types/node@22.19.11)(ts-node@10.9.2(@types/node@22.19.11)(typescript@5.9.3)))(typescript@5.9.3) | ||
| ======= | ||
| version: 29.4.6(@babel/core@7.29.0)(@jest/transform@29.7.0)(@jest/types@30.2.0)(babel-jest@29.7.0(@babel/core@7.29.0))(jest-util@30.2.0)(jest@29.7.0)(typescript@5.9.3) | ||
| >>>>>>> Stashed changes |
There was a problem hiding this comment.
Unresolved git merge conflict markers (<<<<<<<, =======, >>>>>>>) are present in the lockfile. pnpm will fail to parse/install until these are removed and a single ts-jest entry is kept.
| <<<<<<< Updated upstream | |
| version: 29.4.6(@babel/core@7.29.0)(@jest/transform@29.7.0)(@jest/types@30.3.0)(babel-jest@29.7.0(@babel/core@7.29.0))(jest-util@30.3.0)(jest@29.7.0(@types/node@22.19.11)(ts-node@10.9.2(@types/node@22.19.11)(typescript@5.9.3)))(typescript@5.9.3) | |
| ======= | |
| version: 29.4.6(@babel/core@7.29.0)(@jest/transform@29.7.0)(@jest/types@30.2.0)(babel-jest@29.7.0(@babel/core@7.29.0))(jest-util@30.2.0)(jest@29.7.0)(typescript@5.9.3) | |
| >>>>>>> Stashed changes | |
| version: 29.4.6(@babel/core@7.29.0)(@jest/transform@29.7.0)(@jest/types@30.3.0)(babel-jest@29.7.0(@babel/core@7.29.0))(jest-util@30.3.0)(jest@29.7.0(@types/node@22.19.11)(ts-node@10.9.2(@types/node@22.19.11)(typescript@5.9.3)))(typescript@5.9.3) |
| <<<<<<< Updated upstream | ||
| version: 29.4.6(@babel/core@7.29.0)(@jest/transform@29.7.0)(@jest/types@30.3.0)(babel-jest@29.7.0(@babel/core@7.29.0))(jest-util@30.3.0)(jest@29.7.0(@types/node@22.19.11)(ts-node@10.9.2(@types/node@22.19.11)(typescript@5.9.3)))(typescript@5.9.3) | ||
| ======= | ||
| version: 29.4.6(@babel/core@7.29.0)(@jest/transform@29.7.0)(@jest/types@30.2.0)(babel-jest@29.7.0(@babel/core@7.29.0))(jest-util@30.2.0)(jest@29.7.0)(typescript@5.9.3) | ||
| >>>>>>> Stashed changes |
There was a problem hiding this comment.
Unresolved git merge conflict markers (<<<<<<<, =======, >>>>>>>) are present here as well. Resolve the conflict and ensure the selected ts-jest version line matches the intended dependency graph.
| <<<<<<< Updated upstream | |
| version: 29.4.6(@babel/core@7.29.0)(@jest/transform@29.7.0)(@jest/types@30.3.0)(babel-jest@29.7.0(@babel/core@7.29.0))(jest-util@30.3.0)(jest@29.7.0(@types/node@22.19.11)(ts-node@10.9.2(@types/node@22.19.11)(typescript@5.9.3)))(typescript@5.9.3) | |
| ======= | |
| version: 29.4.6(@babel/core@7.29.0)(@jest/transform@29.7.0)(@jest/types@30.2.0)(babel-jest@29.7.0(@babel/core@7.29.0))(jest-util@30.2.0)(jest@29.7.0)(typescript@5.9.3) | |
| >>>>>>> Stashed changes | |
| version: 29.4.6(@babel/core@7.29.0)(@jest/transform@29.7.0)(@jest/types@30.2.0)(babel-jest@29.7.0(@babel/core@7.29.0))(jest-util@30.2.0)(jest@29.7.0)(typescript@5.9.3) |
| <<<<<<< Updated upstream | ||
| version: 29.4.6(@babel/core@7.29.0)(@jest/transform@29.7.0)(@jest/types@30.3.0)(babel-jest@29.7.0(@babel/core@7.29.0))(jest-util@30.3.0)(jest@29.7.0(@types/node@22.19.11)(ts-node@10.9.2(@types/node@22.19.11)(typescript@5.9.3)))(typescript@5.9.3) | ||
| ======= | ||
| version: 29.4.6(@babel/core@7.29.0)(@jest/transform@29.7.0)(@jest/types@30.2.0)(babel-jest@29.7.0(@babel/core@7.29.0))(jest-util@30.2.0)(jest@29.7.0)(typescript@5.9.3) | ||
| >>>>>>> Stashed changes |
There was a problem hiding this comment.
More unresolved git merge conflict markers in pnpm-lock.yaml. This needs to be resolved and the lockfile regenerated to ensure consistency.
| <<<<<<< Updated upstream | |
| version: 29.4.6(@babel/core@7.29.0)(@jest/transform@29.7.0)(@jest/types@30.3.0)(babel-jest@29.7.0(@babel/core@7.29.0))(jest-util@30.3.0)(jest@29.7.0(@types/node@22.19.11)(ts-node@10.9.2(@types/node@22.19.11)(typescript@5.9.3)))(typescript@5.9.3) | |
| ======= | |
| version: 29.4.6(@babel/core@7.29.0)(@jest/transform@29.7.0)(@jest/types@30.2.0)(babel-jest@29.7.0(@babel/core@7.29.0))(jest-util@30.2.0)(jest@29.7.0)(typescript@5.9.3) | |
| >>>>>>> Stashed changes | |
| version: 29.4.6(@babel/core@7.29.0)(@jest/transform@29.7.0)(@jest/types@30.3.0)(babel-jest@29.7.0(@babel/core@7.29.0))(jest-util@30.3.0)(jest@29.7.0(@types/node@22.19.11)(ts-node@10.9.2(@types/node@22.19.11)(typescript@5.9.3)))(typescript@5.9.3) |
| <<<<<<< Updated upstream | ||
| ts-jest@29.4.6(@babel/core@7.29.0)(@jest/transform@29.7.0)(@jest/types@30.3.0)(babel-jest@29.7.0(@babel/core@7.29.0))(jest-util@30.3.0)(jest@29.7.0(@types/node@22.19.11)(ts-node@10.9.2(@types/node@22.19.11)(typescript@5.9.3)))(typescript@5.9.3): | ||
| ======= | ||
| ts-jest@29.4.6(@babel/core@7.29.0)(@jest/transform@29.7.0)(@jest/types@30.2.0)(babel-jest@29.7.0(@babel/core@7.29.0))(jest-util@30.2.0)(jest@29.7.0)(typescript@5.9.3): | ||
| >>>>>>> Stashed changes |
There was a problem hiding this comment.
Unresolved merge conflict markers remain in the snapshots section of pnpm-lock.yaml. Please resolve and regenerate the lockfile (pnpm install) before merging.
| <<<<<<< Updated upstream | |
| ts-jest@29.4.6(@babel/core@7.29.0)(@jest/transform@29.7.0)(@jest/types@30.3.0)(babel-jest@29.7.0(@babel/core@7.29.0))(jest-util@30.3.0)(jest@29.7.0(@types/node@22.19.11)(ts-node@10.9.2(@types/node@22.19.11)(typescript@5.9.3)))(typescript@5.9.3): | |
| ======= | |
| ts-jest@29.4.6(@babel/core@7.29.0)(@jest/transform@29.7.0)(@jest/types@30.2.0)(babel-jest@29.7.0(@babel/core@7.29.0))(jest-util@30.2.0)(jest@29.7.0)(typescript@5.9.3): | |
| >>>>>>> Stashed changes | |
| ts-jest@29.4.6(@babel/core@7.29.0)(@jest/transform@29.7.0)(@jest/types@30.3.0)(babel-jest@29.7.0(@babel/core@7.29.0))(jest-util@30.3.0)(jest@29.7.0(@types/node@22.19.11)(ts-node@10.9.2(@types/node@22.19.11)(typescript@5.9.3)))(typescript@5.9.3): |
| <<<<<<< Updated upstream | ||
| "baseUrl": ".", | ||
| "types": ["jest"], | ||
| "paths": { | ||
| "@agentbase/plugin-sdk": ["../sdk/src/index.ts"] | ||
| } | ||
| ======= | ||
| "types": ["jest"] | ||
| >>>>>>> Stashed changes |
There was a problem hiding this comment.
This file contains unresolved git merge conflict markers (<<<<<<<, =======, >>>>>>>). It won’t compile as JSON until the conflict is resolved.
| <<<<<<< Updated upstream | |
| "baseUrl": ".", | |
| "types": ["jest"], | |
| "paths": { | |
| "@agentbase/plugin-sdk": ["../sdk/src/index.ts"] | |
| } | |
| ======= | |
| "types": ["jest"] | |
| >>>>>>> Stashed changes | |
| "baseUrl": ".", | |
| "types": ["jest"], | |
| "paths": { | |
| "@agentbase/plugin-sdk": ["../sdk/src/index.ts"] | |
| } |
| <<<<<<< Updated upstream | ||
| "rootDir": "../../..", | ||
| "baseUrl": "..", | ||
| "lib": ["ES2022", "DOM"], | ||
| "types": ["jest"], | ||
| "paths": { | ||
| "@agentbase/plugin-sdk": ["../sdk/src/index.ts"] | ||
| } | ||
| }, |
There was a problem hiding this comment.
This tsconfig for tests contains unresolved git merge conflict markers, so TypeScript/Jest tooling won’t be able to parse it.
| <<<<<<< Updated upstream | ||
| import { PluginContext, PluginAPI } from "@agentbase/plugin-sdk"; | ||
| ======= | ||
| import { PluginContext, PluginAPI } from "../../sdk/src"; | ||
| >>>>>>> Stashed changes |
There was a problem hiding this comment.
Unresolved merge conflict markers are present in this test file’s imports. Tests won’t compile until the conflict is resolved.
| <<<<<<< Updated upstream | |
| import { PluginContext, PluginAPI } from "@agentbase/plugin-sdk"; | |
| ======= | |
| import { PluginContext, PluginAPI } from "../../sdk/src"; | |
| >>>>>>> Stashed changes | |
| import { PluginContext, PluginAPI } from "@agentbase/plugin-sdk"; |
| describe("manifest", () => { | ||
| it("exports a valid plugin with name and version", () => { | ||
| expect(plugin.manifest.name).toBe("{{PLUGIN_SLUG}}"); | ||
| expect(plugin.manifest.version).toMatch(/^\d+\.\d+\.\d+/); |
There was a problem hiding this comment.
This assertion requires plugin.manifest.version to match a numeric SemVer pattern, but the template currently sets the version to the placeholder string {{PLUGIN_VERSION}} (see src/index.ts). This will fail when running pnpm -r test unless either the template uses a real SemVer (e.g., 0.0.0) or the test is updated to accept placeholders.
| expect(plugin.manifest.version).toMatch(/^\d+\.\d+\.\d+/); | |
| const version = plugin.manifest.version; | |
| const isSemVer = /^\d+\.\d+\.\d+/.test(version); | |
| const isPlaceholder = /^{{.+}}$/.test(version); | |
| expect(isSemVer || isPlaceholder).toBe(true); |
| "description": "TODO: Describe your plugin", | ||
| "entryPoint": "dist/index.js", | ||
| "author": "Your Name", | ||
| "agentbaseVersion": ">=1.0.0", |
There was a problem hiding this comment.
agentbaseVersion is set to ">=1.0.0", but the repo/package version is currently 0.1.0. If this field is used for compatibility checks, the template plugin would be marked incompatible in current builds. Consider using a placeholder (e.g., {{AGENTBASE_VERSION_RANGE}}) or aligning it with the current platform version range.
| "agentbaseVersion": ">=1.0.0", | |
| "agentbaseVersion": "{{AGENTBASE_VERSION_RANGE}}", |
| "build": "tsc" | ||
| }, | ||
| "devDependencies": { | ||
| "@types/jest": "^30.0.0", |
There was a problem hiding this comment.
@types/jest is set to ^30.0.0 while jest is ^29.7.0. Since @types/jest@30 pulls in expect@30/pretty-format@30 (see lockfile), this version skew can cause confusing type/runtime dependency mismatches. Prefer aligning @types/jest major with the installed Jest major (or bump Jest to 30 if that’s the intention).
| "@types/jest": "^30.0.0", | |
| "@types/jest": "^29.0.0", |
Remove leftover merge markers and clean up the template plugin configuration. Set package metadata to @agentbase/plugin-template (v0.0.0) and mark private; standardize build script to `tsc`. Update src import to use the published `@agentbase/plugin-sdk` instead of a local SDK path. Simplify tsconfig (set rootDir, remove local path mapping, keep strict/noEmit and usual declarations) and trim test/jest configuration. These changes finalize the template and remove references to stashed/updated conflict variants.
…nd lib from Python gitignore rule
Import api and switch token retrieval to api.getToken() instead of destructuring token from useAuth(). keep calling useAuth() to preserve any context side effects. This centralizes token access through the lib/api helper.
This pull request introduces a new plugin template package for Agentbase, providing boilerplate code, configuration, and test harness for plugin development. It also sets up a robust TypeScript and Jest-based testing environment, and makes several dependency and configuration updates to support plugin development and testing.
The most important changes are:
New Plugin Template and Boilerplate:
packages/plugins/templatewith example implementation, manifest, and package configuration, offering a starting point for new plugins. (manifest.json,package.json,src/index.ts) [1] [2] [3]Testing Infrastructure:
PluginContextandPluginAPI, and sets up Jest-based testing for the template plugin. (__tests__/index.test.ts)tsconfig.json,tsconfig.test.json,__tests__/tsconfig.json) [1] [2] [3]Dependency and Configuration Updates:
package.jsonfiles to point to the correct SDK entry points and include new devDependencies for testing (jest,ts-jest,@types/jest). (packages/plugins/package.json,package.json) [1] [2]pnpm-lock.yamlto reflect new and updated dependencies for Jest and TypeScript in both the root and template plugin packages. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]SDK Import Path Adjustments:
src/index.ts,__tests__/index.test.ts, TypeScript config files) [1] [2] [3] [4] [5]These changes together provide a ready-to-use, testable template for Agentbase plugin development, with a focus on developer experience and robust testing support.