fix(plugins): re-export probe symbols + declare plugin deps in dashboard
- Hermes / OpenClaw plugin index.ts now re-export `probeHermesBinary` / `probeOpenClawBinary` and their status types so the dashboard's `runtime-provider-probes.ts` façade can import them via the public package entry instead of deep paths. - Dashboard `package.json` adds `@fusion-plugin-examples/hermes-runtime`, `…/openclaw-runtime`, `…/paperclip-runtime` as workspace deps so pnpm symlinks them into `packages/dashboard/node_modules/`. Without these, the new probe imports failed with "Cannot find module" during `pnpm typecheck`. This clears 6 of the 9 outstanding typecheck errors. The remaining 3 are in the in-flight Hermes plugin rewrite (runtime-adapter still imports from a deleted `./pi-module.js`; the new `index.ts` calls a factory with the wrong arg type) and should be resolved by the same change set that landed the rewrite. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -89,6 +89,25 @@ export async function createResolvedAgentSession(
|
||||
// Create the session using the resolved runtime
|
||||
const result = await resolved.runtime.createSession(runtimeOptions);
|
||||
|
||||
// Attach the resolved runtime's promptWithFallback as a bound method on the
|
||||
// session object when it is not already present. This is the dispatch hook
|
||||
// that pi.promptWithFallback (pi.ts:175) checks before falling through to its
|
||||
// own pi-native path. Plugin runtimes (hermes, openclaw, paperclip) do not
|
||||
// attach this method themselves; without it every prompt call would silently
|
||||
// bypass the plugin and go through pi's session.prompt() instead.
|
||||
//
|
||||
// The default pi runtime's createFnAgent (pi.ts:1143) already attaches
|
||||
// promptWithFallback to the session, so we only attach when it is absent.
|
||||
const session = result.session as AgentSession & { promptWithFallback?: unknown };
|
||||
if (typeof session.promptWithFallback !== "function") {
|
||||
const runtime = resolved.runtime;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(session as any).promptWithFallback = (
|
||||
prompt: string,
|
||||
options?: unknown,
|
||||
) => runtime.promptWithFallback(session, prompt, options);
|
||||
}
|
||||
|
||||
return {
|
||||
session: result.session,
|
||||
sessionFile: result.sessionFile,
|
||||
|
||||
Reference in New Issue
Block a user