mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-14 13:22:37 +00:00
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.
22 lines
1.1 KiB
TypeScript
22 lines
1.1 KiB
TypeScript
import type { PluginClientStateSource } from "@getpaseo/plugin/host";
|
|
import { useSessionStore } from "@/stores/session-store";
|
|
import { selectWorkspace } from "@/stores/session-store-hooks/selectors";
|
|
import { normalizeWorkspaceOpaqueId } from "@/utils/workspace-identity";
|
|
import { createPluginAgentSnapshot, createPluginWorkspaceSnapshot } from "./snapshots";
|
|
|
|
export function createPluginClientStateSource(serverId: string): PluginClientStateSource {
|
|
return {
|
|
subscribe: useSessionStore.subscribe,
|
|
getWorkspace(workspaceId) {
|
|
const workspace = selectWorkspace(useSessionStore.getState(), serverId, workspaceId);
|
|
return workspace ? createPluginWorkspaceSnapshot(workspace) : null;
|
|
},
|
|
getAgent(agentId) {
|
|
const session = useSessionStore.getState().sessions[serverId];
|
|
const agent = session?.agents.get(agentId) ?? session?.agentDetails.get(agentId) ?? null;
|
|
const workspaceId = normalizeWorkspaceOpaqueId(agent?.workspaceId);
|
|
return agent && workspaceId ? createPluginAgentSnapshot(agent, workspaceId) : null;
|
|
},
|
|
};
|
|
}
|