Skip to content

Plugin package#4

Merged
dewitt4 merged 8 commits into
mainfrom
plugin-package
Apr 2, 2026
Merged

Plugin package#4
dewitt4 merged 8 commits into
mainfrom
plugin-package

Conversation

@dewitt4
Copy link
Copy Markdown
Contributor

@dewitt4 dewitt4 commented Apr 2, 2026

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:

  • Adds a new plugin template under packages/plugins/template with 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:

  • Introduces a comprehensive unit test file with inline mocks for PluginContext and PluginAPI, and sets up Jest-based testing for the template plugin. (__tests__/index.test.ts)
  • Adds TypeScript configuration files for both source and test code, ensuring compatibility with the plugin SDK and Jest. (tsconfig.json, tsconfig.test.json, __tests__/tsconfig.json) [1] [2] [3]

Dependency and Configuration Updates:

  • Updates the root and template package.json files 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]
  • Updates pnpm-lock.yaml to 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:

  • Updates import paths in the template to reference the local SDK source directly, ensuring the template works out-of-the-box before publishing the SDK. (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.

dewitt4 added 5 commits March 31, 2026 13:49
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.
@dewitt4 dewitt4 requested a review from Copilot April 2, 2026 16:32
@dewitt4 dewitt4 self-assigned this Apr 2, 2026
@dewitt4 dewitt4 added the enhancement New feature or request label Apr 2, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread pnpm-lock.yaml
Comment on lines +181 to +185
<<<<<<< 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
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
<<<<<<< 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)

Copilot uses AI. Check for mistakes.
Comment thread pnpm-lock.yaml
Comment on lines +291 to +295
<<<<<<< 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
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
<<<<<<< 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)

Copilot uses AI. Check for mistakes.
Comment thread pnpm-lock.yaml
Comment on lines +396 to +400
<<<<<<< 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
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More unresolved git merge conflict markers in pnpm-lock.yaml. This needs to be resolved and the lockfile regenerated to ensure consistency.

Suggested change
<<<<<<< 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)

Copilot uses AI. Check for mistakes.
Comment thread pnpm-lock.yaml
Comment on lines +11777 to +11781
<<<<<<< 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
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unresolved merge conflict markers remain in the snapshots section of pnpm-lock.yaml. Please resolve and regenerate the lockfile (pnpm install) before merging.

Suggested change
<<<<<<< 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):

Copilot uses AI. Check for mistakes.
Comment on lines +5 to +13
<<<<<<< Updated upstream
"baseUrl": ".",
"types": ["jest"],
"paths": {
"@agentbase/plugin-sdk": ["../sdk/src/index.ts"]
}
=======
"types": ["jest"]
>>>>>>> Stashed changes
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file contains unresolved git merge conflict markers (<<<<<<<, =======, >>>>>>>). It won’t compile as JSON until the conflict is resolved.

Suggested change
<<<<<<< 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"]
}

Copilot uses AI. Check for mistakes.
Comment on lines +5 to +13
<<<<<<< Updated upstream
"rootDir": "../../..",
"baseUrl": "..",
"lib": ["ES2022", "DOM"],
"types": ["jest"],
"paths": {
"@agentbase/plugin-sdk": ["../sdk/src/index.ts"]
}
},
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This tsconfig for tests contains unresolved git merge conflict markers, so TypeScript/Jest tooling won’t be able to parse it.

Copilot uses AI. Check for mistakes.
Comment on lines +12 to +16
<<<<<<< Updated upstream
import { PluginContext, PluginAPI } from "@agentbase/plugin-sdk";
=======
import { PluginContext, PluginAPI } from "../../sdk/src";
>>>>>>> Stashed changes
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unresolved merge conflict markers are present in this test file’s imports. Tests won’t compile until the conflict is resolved.

Suggested change
<<<<<<< Updated upstream
import { PluginContext, PluginAPI } from "@agentbase/plugin-sdk";
=======
import { PluginContext, PluginAPI } from "../../sdk/src";
>>>>>>> Stashed changes
import { PluginContext, PluginAPI } from "@agentbase/plugin-sdk";

Copilot uses AI. Check for mistakes.
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+/);
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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);

Copilot uses AI. Check for mistakes.
"description": "TODO: Describe your plugin",
"entryPoint": "dist/index.js",
"author": "Your Name",
"agentbaseVersion": ">=1.0.0",
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
"agentbaseVersion": ">=1.0.0",
"agentbaseVersion": "{{AGENTBASE_VERSION_RANGE}}",

Copilot uses AI. Check for mistakes.
"build": "tsc"
},
"devDependencies": {
"@types/jest": "^30.0.0",
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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).

Suggested change
"@types/jest": "^30.0.0",
"@types/jest": "^29.0.0",

Copilot uses AI. Check for mistakes.
dewitt4 added 3 commits April 2, 2026 09:49
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.
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.
@dewitt4 dewitt4 merged commit 2864ab9 into main Apr 2, 2026
4 checks passed
@dewitt4 dewitt4 deleted the plugin-package branch April 2, 2026 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants