feat: wire lifecycle manager into dashboard startup

- Register notifier plugins (desktop, openclaw) in services.ts
- Pass notifier config from orchestrator config to plugin create()
- Create and start lifecycle manager with 15s polling interval
- Add graceful shutdown (SIGINT/SIGTERM) to stop polling
- Add notifier packages as web dashboard dependencies
- Fix YAML config: move notifierConfig to notifiers record (matches schema)
This commit is contained in:
sjd9021 2026-02-15 22:02:11 +05:30
parent b462c45db0
commit 0393ab70a8
4 changed files with 54 additions and 15 deletions

View File

@ -1,16 +1,24 @@
# Agent Orchestrator — self-hosting config (dog-fooding)
dataDir: ~/.ao-sessions
worktreeDir: ~/.worktrees/ao
worktreeDir: ~/.worktrees
port: 3000
defaults:
runtime: tmux
agent: claude-code
workspace: worktree
notifiers: [desktop]
notifiers:
- desktop
- openclaw
projects:
integrator:
name: Integrator
repo: ComposioHQ/integrator
path: ~/integrator
defaultBranch: next
sessionPrefix: int
scm:
plugin: github
agentConfig:
permissions: skip
ao:
name: Agent Orchestrator
repo: ComposioHQ/agent-orchestrator
@ -19,11 +27,11 @@ projects:
sessionPrefix: ao
scm:
plugin: github
tracker:
plugin: linear
teamId: "2a6e9b1b-19cd-4e30-b5bd-7b34dc491c7e"
symlinks: [.claude]
postCreate:
- "pnpm install"
agentConfig:
permissions: skip
notifiers:
openclaw:
host: 100.94.117.76
port: 18789
token: 1af5c4fb9e07dc5e69a20de02bbea653f17c110089b68872
plugin: openclaw

View File

@ -27,7 +27,9 @@
"@composio/ao-plugin-workspace-worktree": "workspace:*",
"next": "^15.1.0",
"react": "^19.0.0",
"react-dom": "^19.0.0"
"react-dom": "^19.0.0",
"@composio/ao-plugin-notifier-desktop": "workspace:*",
"@composio/ao-plugin-notifier-openclaw": "workspace:*"
},
"devDependencies": {
"@tailwindcss/postcss": "^4.0.0",
@ -44,4 +46,4 @@
"typescript": "^5.7.0",
"vitest": "^2.1.0"
}
}
}

View File

@ -14,14 +14,20 @@ import {
loadConfig,
createPluginRegistry,
createSessionManager,
createLifecycleManager,
type OrchestratorConfig,
type PluginRegistry,
type SessionManager,
type LifecycleManager,
type SCM,
type Tracker,
type ProjectConfig,
} from "@composio/ao-core";
// Notifier plugins
import pluginNotifierDesktop from "@composio/ao-plugin-notifier-desktop";
import pluginNotifierOpenclaw from "@composio/ao-plugin-notifier-openclaw";
// Static plugin imports — webpack needs these to be string literals
import pluginRuntimeTmux from "@composio/ao-plugin-runtime-tmux";
import pluginAgentClaudeCode from "@composio/ao-plugin-agent-claude-code";
@ -34,6 +40,7 @@ export interface Services {
config: OrchestratorConfig;
registry: PluginRegistry;
sessionManager: SessionManager;
lifecycleManager: LifecycleManager;
}
// Cache in globalThis for Next.js HMR stability
@ -70,9 +77,25 @@ async function initServices(): Promise<Services> {
registry.register(pluginTrackerGithub);
registry.register(pluginTrackerLinear);
// Register notifier plugins (pass config from notifiers record)
registry.register(pluginNotifierDesktop, config.notifiers?.["desktop"] as Record<string, unknown> | undefined);
registry.register(pluginNotifierOpenclaw, config.notifiers?.["openclaw"] as Record<string, unknown> | undefined);
const sessionManager = createSessionManager({ config, registry });
const services = { config, registry, sessionManager };
// Create and start lifecycle manager (polling loop + notifiers)
const lifecycleManager = createLifecycleManager({ config, registry, sessionManager });
lifecycleManager.start(15_000); // Poll every 15 seconds
// Graceful shutdown
const shutdown = () => {
lifecycleManager.stop();
process.exit(0);
};
process.on("SIGINT", shutdown);
process.on("SIGTERM", shutdown);
const services = { config, registry, sessionManager, lifecycleManager };
globalForServices._aoServices = services;
return services;
}

View File

@ -458,6 +458,12 @@ importers:
'@composio/ao-plugin-agent-claude-code':
specifier: workspace:*
version: link:../plugins/agent-claude-code
'@composio/ao-plugin-notifier-desktop':
specifier: workspace:*
version: link:../plugins/notifier-desktop
'@composio/ao-plugin-notifier-openclaw':
specifier: workspace:*
version: link:../plugins/notifier-openclaw
'@composio/ao-plugin-runtime-tmux':
specifier: workspace:*
version: link:../plugins/runtime-tmux