wyuc 1d1ce80e04
feat(maic-agent): editor-agent line (v0) — Pro-mode "Edit with AI" (#777)
Promote the editor-agent line to main: read-then-act editor agent (read_scene_content, regenerate_scene, regenerate_scene_actions, edit_interactive_html), a routable maic-agent model stage, the agent sidebar UI, interactive-scene runtime-error capture, and the timeline/script editor. Cross-reviewed and smoke-verified; see #777.
2026-06-23 16:56:37 +08:00

11 lines
543 B
TypeScript

import type { BeforeToolCallContext, BeforeToolCallResult } from '@earendil-works/pi-agent-core';
/** v0 capability restriction = tool allowlist (NOT a hardcoded workflow).
* Widening capability = adding a name here. */
export function makeAllowlistGate(allowed: ReadonlySet<string>) {
return async (ctx: BeforeToolCallContext): Promise<BeforeToolCallResult | undefined> => {
if (allowed.has(ctx.toolCall.name)) return undefined;
return { block: true, reason: `Tool "${ctx.toolCall.name}" is not enabled in this build.` };
};
}