mirror of
https://github.com/wassname/pi-plan.git
synced 2026-10-03 12:42:00 +08:00
Bundle Intercom/VCC with the internal supervisor. Add default alignment questions and conversational plan review. Cover model recovery, cancellation and packed single-package operation.
11 lines
761 B
TypeScript
11 lines
761 B
TypeScript
import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
import { type ModelRole, RoleModels } from "../../src/role-models.js";
|
|
|
|
const [directory, role, provider, id] = process.argv.slice(2);
|
|
let selected: (event: any, ctx: any) => void;
|
|
const pi = { on(_name: string, handler: any) { selected = handler; }, setModel: async () => true };
|
|
const ctx = { model: { provider, id }, modelRegistry: { find: (provider: string, id: string) => ({ provider, id }) }, ui: { notify(message: string) { throw new Error(message); } } };
|
|
const models = new RoleModels(pi as unknown as ExtensionAPI, directory);
|
|
await models.enter(role as ModelRole, ctx as unknown as ExtensionContext);
|
|
selected!({ source: "cycle", model: { provider, id } }, ctx);
|