fix(plugins): publish the plugin SDK under the @getpaseo scope
The daemon imports the plugin SDK at runtime, but the workspace was named @paseo/plugin and marked private, so it was never published. 0.5.0-beta.1 shipped @getpaseo/server depending on a package that does not exist and `npm install @getpaseo/cli@beta` failed with a 404 for every user. Two things hid it. sync-workspace-versions only rewrites deps matching @getpaseo/*, so the "*" range on @paseo/plugin survived untouched into the published tarball. And `npm pack --dry-run`, which is all release:check and CI run, lists files without ever resolving the dependency graph. Renaming to @getpaseo/plugin rather than publishing the old name: @paseo is not our scope on npm, so that name could never have been published at all. The rename also brings the package under the version-sync filter, which is what pins it correctly from here on. Plugins scaffolded against the old name still import @paseo/plugin. Both spellings resolve through plugin-sdk-specifiers.ts, tagged COMPAT with a removal date, so existing plugins keep loading. This does not repair 0.5.0-beta.1 — a published tarball's dependencies cannot be changed. The package publishes with the next release.
This commit is contained in:
@@ -74,12 +74,12 @@
|
||||
"@babel/parser": "^7.29.8",
|
||||
"@getpaseo/client": "0.5.0-beta.1",
|
||||
"@getpaseo/highlight": "0.5.0-beta.1",
|
||||
"@getpaseo/plugin": "0.5.0-beta.1",
|
||||
"@getpaseo/protocol": "0.5.0-beta.1",
|
||||
"@getpaseo/relay": "0.5.0-beta.1",
|
||||
"@isaacs/ttlcache": "^2.1.4",
|
||||
"@modelcontextprotocol/sdk": "^1.20.1",
|
||||
"@opencode-ai/sdk": "1.14.46",
|
||||
"@paseo/plugin": "*",
|
||||
"@xterm/headless": "^6.0.0",
|
||||
"ai": "5.0.78",
|
||||
"ajv": "^8.20.0",
|
||||
|
||||
@@ -73,14 +73,18 @@ afterEach(async () => {
|
||||
});
|
||||
|
||||
describe("plugin author module externals", () => {
|
||||
it("leaves @paseo/plugin/server external in both bundles", async () => {
|
||||
const directory = await mkdtemp(path.join(tmpdir(), "paseo-plugin-compiler-"));
|
||||
temporaryDirectories.push(directory);
|
||||
const entryPath = path.join(directory, "index.ts");
|
||||
await writeFile(
|
||||
entryPath,
|
||||
`import type { PluginContext } from "@paseo/plugin";
|
||||
import { defineRpc } from "@paseo/plugin/server";
|
||||
// COMPAT(plugin-sdk-scope): plugins written against the unpublished @paseo/plugin name must
|
||||
// keep compiling. Drop that case with the specifiers in plugin-sdk-specifiers.ts.
|
||||
it.each(["@getpaseo/plugin", "@paseo/plugin"])(
|
||||
"leaves %s/server external in both bundles",
|
||||
async (sdk) => {
|
||||
const directory = await mkdtemp(path.join(tmpdir(), "paseo-plugin-compiler-"));
|
||||
temporaryDirectories.push(directory);
|
||||
const entryPath = path.join(directory, "index.ts");
|
||||
await writeFile(
|
||||
entryPath,
|
||||
`import type { PluginContext } from "${sdk}";
|
||||
import { defineRpc } from "${sdk}/server";
|
||||
import { z } from "zod";
|
||||
|
||||
const ping = defineRpc({
|
||||
@@ -94,12 +98,13 @@ export default function contribute(plugin: PluginContext) {
|
||||
return () => undefined;
|
||||
}
|
||||
`,
|
||||
);
|
||||
);
|
||||
|
||||
const { clientBundle, serverBundle } = await compilePlugin(entryPath);
|
||||
expect(clientBundle).toContain("@paseo/plugin/server");
|
||||
expect(serverBundle).toContain("@paseo/plugin/server");
|
||||
expect(clientBundle).not.toContain("Invalid plugin RPC method");
|
||||
expect(serverBundle).not.toContain("Invalid plugin RPC method");
|
||||
});
|
||||
const { clientBundle, serverBundle } = await compilePlugin(entryPath);
|
||||
expect(clientBundle).toContain(`${sdk}/server`);
|
||||
expect(serverBundle).toContain(`${sdk}/server`);
|
||||
expect(clientBundle).not.toContain("Invalid plugin RPC method");
|
||||
expect(serverBundle).not.toContain("Invalid plugin RPC method");
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
@@ -4,6 +4,7 @@ import { createRequire } from "node:module";
|
||||
import path from "node:path";
|
||||
import { parse } from "@babel/parser";
|
||||
import type { Plugin } from "esbuild";
|
||||
import { PLUGIN_SDK_SPECIFIERS } from "./plugin-sdk-specifiers.js";
|
||||
|
||||
const nodeRequire = createRequire(import.meta.url);
|
||||
const ESBUILD_BINARY_PATH = "ESBUILD_BINARY_PATH";
|
||||
@@ -307,15 +308,14 @@ async function compileTarget(entryPath: string, target: PluginBuildTarget): Prom
|
||||
external:
|
||||
target === "client"
|
||||
? [
|
||||
"@paseo/plugin",
|
||||
"@paseo/plugin/server",
|
||||
...PLUGIN_SDK_SPECIFIERS,
|
||||
"@tanstack/react-query",
|
||||
"react",
|
||||
"react/jsx-runtime",
|
||||
"react-native",
|
||||
"zod",
|
||||
]
|
||||
: ["@paseo/plugin", "@paseo/plugin/server", "zod"],
|
||||
: [...PLUGIN_SDK_SPECIFIERS, "zod"],
|
||||
plugins: [createRuntimeBoundaryPlugin(target), createUnusedPlatformModulePlugin(target)],
|
||||
logLevel: "silent",
|
||||
treeShaking: true,
|
||||
|
||||
@@ -21,7 +21,7 @@ test("plugin handlers create workspaces and agents through their Paseo API", asy
|
||||
);
|
||||
await writeFile(
|
||||
path.join(pluginDirectory, "index.tsx"),
|
||||
`import { defineRpc, type PluginContext } from "@paseo/plugin";
|
||||
`import { defineRpc, type PluginContext } from "@getpaseo/plugin";
|
||||
import { z } from "zod";
|
||||
|
||||
const create = defineRpc({
|
||||
|
||||
@@ -5,10 +5,11 @@ import {
|
||||
defineRpc,
|
||||
type PluginHandlerContext,
|
||||
type PluginRpcContract,
|
||||
} from "@paseo/plugin/server";
|
||||
} from "@getpaseo/plugin/server";
|
||||
import { createPaseoApi, type PaseoApi } from "@getpaseo/client";
|
||||
import { DaemonClient } from "@getpaseo/client/internal/daemon-client";
|
||||
import { createPluginDaemonTransportFactory } from "./daemon-transport.js";
|
||||
import { isPluginSdkSpecifier } from "./plugin-sdk-specifiers.js";
|
||||
|
||||
type RpcHandler = (input: unknown, context: PluginHandlerContext) => unknown | Promise<unknown>;
|
||||
|
||||
@@ -64,7 +65,7 @@ function register(contract: PluginRpcContract, handler: RpcHandler): void {
|
||||
const pluginAuthorRuntime = { defineAttachmentSource, defineRpc };
|
||||
|
||||
function runtimeRequire(name: string): unknown {
|
||||
if (name === "@paseo/plugin" || name === "@paseo/plugin/server") return pluginAuthorRuntime;
|
||||
if (isPluginSdkSpecifier(name)) return pluginAuthorRuntime;
|
||||
return nodeRequire(name);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
// Specifiers a plugin author can import to reach the SDK. The daemon never resolves these
|
||||
// from disk: the compiler marks them external and the plugin subprocess hands back its own
|
||||
// runtime, so a plugin typechecks against generated declarations without installing anything.
|
||||
//
|
||||
// COMPAT(plugin-sdk-scope): @paseo/plugin was the SDK name through 0.5.0-beta.1 and was never
|
||||
// published — that scope is not ours. Plugins scaffolded against that name still import it, so
|
||||
// both spellings resolve. Remove the @paseo/* entries after 2026-11-19.
|
||||
export const PLUGIN_SDK_SPECIFIERS = [
|
||||
"@getpaseo/plugin",
|
||||
"@getpaseo/plugin/server",
|
||||
"@paseo/plugin",
|
||||
"@paseo/plugin/server",
|
||||
] as const;
|
||||
|
||||
export function isPluginSdkSpecifier(name: string): boolean {
|
||||
return (PLUGIN_SDK_SPECIFIERS as readonly string[]).includes(name);
|
||||
}
|
||||
@@ -501,7 +501,7 @@ export default function contribute(plugin: unknown) {
|
||||
import { platform } from "node:os";
|
||||
import { Text } from "react-native";
|
||||
import { z } from "zod";
|
||||
import { defineAttachmentSource, defineRpc } from "@paseo/plugin";
|
||||
import { defineAttachmentSource, defineRpc } from "@getpaseo/plugin";
|
||||
|
||||
const greetRpc = defineRpc({
|
||||
name: "greet",
|
||||
@@ -560,6 +560,34 @@ export default function contribute(plugin: any) {
|
||||
await runtime.stopAll();
|
||||
});
|
||||
|
||||
// COMPAT(plugin-sdk-scope): plugins scaffolded through 0.5.0-beta.1 import the unpublished
|
||||
// @paseo/plugin name. Drop with the specifiers in plugin-sdk-specifiers.ts.
|
||||
it("loads a plugin that imports the pre-rename @paseo/plugin specifier", async () => {
|
||||
const directory = await createPlugin(
|
||||
"legacy-sdk",
|
||||
`import { z } from "zod";
|
||||
import { defineRpc } from "@paseo/plugin/server";
|
||||
|
||||
const pingRpc = defineRpc({
|
||||
name: "ping",
|
||||
input: z.object({}),
|
||||
output: z.object({ ok: z.boolean() }),
|
||||
});
|
||||
|
||||
export default function contribute(plugin: any) {
|
||||
plugin.handle(pingRpc, async () => ({ ok: true }));
|
||||
return () => undefined;
|
||||
}`,
|
||||
);
|
||||
const runtime = createTestRuntime();
|
||||
|
||||
await runtime.startPlugin("legacy-sdk", directory);
|
||||
|
||||
await expect(runtime.invoke("legacy-sdk", "ping", {})).resolves.toMatchObject({ ok: true });
|
||||
|
||||
await runtime.stopAll();
|
||||
});
|
||||
|
||||
it("keeps client and server modules in their target runtime", async () => {
|
||||
const directory = await mkdtemp(path.join(tmpdir(), "paseo-plugin-"));
|
||||
temporaryDirectories.push(directory);
|
||||
@@ -571,7 +599,7 @@ export default function contribute(plugin: any) {
|
||||
),
|
||||
writeFile(
|
||||
path.join(directory, "index.ts"),
|
||||
`import type { PluginContext } from "@paseo/plugin";
|
||||
`import type { PluginContext } from "@getpaseo/plugin";
|
||||
import { Surface } from "./surface.client";
|
||||
import { inspectRpc } from "./inspect.shared";
|
||||
import { inspectHost } from "./inspect.server";
|
||||
@@ -597,7 +625,7 @@ export function Surface() {
|
||||
),
|
||||
writeFile(
|
||||
path.join(directory, "inspect.shared.ts"),
|
||||
`import { defineRpc } from "@paseo/plugin/server";
|
||||
`import { defineRpc } from "@getpaseo/plugin/server";
|
||||
import { z } from "zod";
|
||||
|
||||
export const inspectRpc = defineRpc({
|
||||
@@ -643,7 +671,7 @@ export function inspectHost(_input: z.input<typeof inspectRpc.input>) {
|
||||
),
|
||||
writeFile(
|
||||
path.join(directory, "index.ts"),
|
||||
`import type { PluginContext } from "@paseo/plugin";
|
||||
`import type { PluginContext } from "@getpaseo/plugin";
|
||||
import { Surface } from "./surface.client";
|
||||
|
||||
export default function contribute(plugin: PluginContext) {
|
||||
@@ -683,7 +711,7 @@ export function Surface() { return readSecret(); }`,
|
||||
),
|
||||
writeFile(
|
||||
path.join(directory, "index.ts"),
|
||||
`import type { PluginContext } from "@paseo/plugin";
|
||||
`import type { PluginContext } from "@getpaseo/plugin";
|
||||
import { inspect } from "./inspect.server";
|
||||
import { inspectRpc } from "./inspect.shared";
|
||||
|
||||
@@ -695,7 +723,7 @@ export default function contribute(plugin: PluginContext) {
|
||||
),
|
||||
writeFile(
|
||||
path.join(directory, "inspect.shared.ts"),
|
||||
`import { defineRpc } from "@paseo/plugin";
|
||||
`import { defineRpc } from "@getpaseo/plugin";
|
||||
import { z } from "zod";
|
||||
export const inspectRpc = defineRpc({
|
||||
name: "inspect",
|
||||
@@ -728,7 +756,7 @@ export function inspect() { void Surface; return {}; }`,
|
||||
const directory = await createPlugin(
|
||||
"invalid-output",
|
||||
`import { z } from "zod";
|
||||
import { defineRpc } from "@paseo/plugin";
|
||||
import { defineRpc } from "@getpaseo/plugin";
|
||||
const brokenRpc = defineRpc({
|
||||
name: "broken",
|
||||
input: z.object({}),
|
||||
|
||||
Reference in New Issue
Block a user