Files
orca/src/cli/plugin-handler-groups.ts
T
NeilandClaude 60d262ebee feat(plugins): hooks for agent launches and prompts, plus plugin dev hook (#37295)
* plugins: agent.launch.before and agent.prompt.before hooks; orca plugin dev hook

agent.launch.before runs at the PTY spawn every agent terminal goes through
(window tabs, runtime/CLI agent launch, automations, orchestration), before
dispatch to its host: change the command line, add env (Orca's own ORCA_*
variables and the agent's environment stay hidden), or deny. Restores and
resumes are not hooked. agent.prompt.before runs in sendTerminalAgentPrompt
(launch prompts, orchestration dispatch, terminal send to an agent) with the
agent named: rewrite or deny. The terminal hooks move into one runtime layer.
orca plugin dev hook runs a hook through one dev plugin and prints the decision.

Co-Authored-By: Claude <noreply@anthropic.com>

* plugins: recheck rewritten launch commands, forward hook env to WSL, keep prompt delivery outside the hook order

- A command agent.launch.before rewrote passes the AI Vault resume check again
  on both spawn paths.
- Variables a hook adds are named in WSLENV on Windows so WSL agents get them.
- agent.prompt.before holds the terminal's order only while it decides; a
  delivery waiting on a permission answer no longer blocks later input.

Co-Authored-By: Claude <noreply@anthropic.com>

* plugins: plugin dev hook honours onError: deny

Co-Authored-By: Claude <noreply@anthropic.com>

* plugins: regenerate the testing bundle and skill guides on the rebased hooks

Generated files only (lint-staged's oxlint refuses a commit with no lintable files).

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 21:20:29 -08:00

56 lines
1.6 KiB
TypeScript

import type { HandlerGroup } from './handler-group-manifest'
// Authoring runs offline; runtime commands reach the Orca host. Split so authoring never loads the RPC graph.
export const PLUGIN_HANDLER_GROUPS: readonly HandlerGroup[] = [
{
name: 'plugin-authoring',
keys: [
'plugin create',
'plugin types',
'plugin validate',
'plugin inspect',
'plugin release-entry',
'plugin test',
'plugin check'
],
load: async () => (await import('./handlers/plugin-authoring.js')).PLUGIN_AUTHORING_HANDLERS
},
{
name: 'plugin-runtime',
keys: [
'plugin list',
'plugin logs',
'plugin enable',
'plugin disable',
'plugin system on',
'plugin system off',
'plugin restart',
'plugin dev load',
'plugin dev reload',
'plugin dev inspect',
'plugin dev unload'
],
load: async () => (await import('./handlers/plugin-runtime.js')).PLUGIN_RUNTIME_HANDLERS
},
{
name: 'plugin-dev-watch',
keys: ['plugin dev watch'],
load: async () => (await import('./handlers/plugin-dev-watch.js')).PLUGIN_DEV_WATCH_HANDLERS
},
{
name: 'plugin-dev-emit',
keys: ['plugin dev emit', 'plugin dev hook'],
load: async () => (await import('./handlers/plugin-dev-emit.js')).PLUGIN_DEV_EMIT_HANDLERS
},
{
name: 'plugin-dev-request',
keys: ['plugin dev request'],
load: async () => (await import('./handlers/plugin-dev-request.js')).PLUGIN_DEV_REQUEST_HANDLERS
},
{
name: 'plugin-view',
keys: ['plugin open', 'plugin shot'],
load: async () => (await import('./handlers/plugin-view.js')).PLUGIN_VIEW_HANDLERS
}
]