an open-source alternative to the dots, bots and muses of the world, run an office of claude code/codex like agents on your laptop, sandboxes or anywhere, uses your existing subscriptions
HTML agent-harnessagent-orchestrationagentsai-agentsautonomous-agentsclaude-codecodexcoding-agentsdesktop-appdeveloper-toolselectrongemini-cliharnessharness-engineeringlocal-firstmemorymulti-agentopencodeorchestrationtypescript
Merge branch 'pr-154' into integration/v0.4.5
Chaitanya Girifaa7e8f5a489
diff --cc src/main/hive.tsindex d990b23c,eada491a..bca1fcb8--- a/src/main/hive.ts+++ b/src/main/hive.ts@@@ -36,7 -37,7 +37,8 @@@ importtype AgentProvider} from '../shared/agentProvider';import { MCP_CATALOG } from '../shared/mcpCatalog';+import { selectBroadcastTargets } from '../shared/broadcast';+ import { preferredAgentRole } from '../shared/agentRole';import { expandTilde } from './fs';/** The subset of HarnessConfig the hive consumes for the default-MCP merge.diff --cc src/main/index.tsindex bf203221,8064ac61..b07121d5--- a/src/main/index.ts+++ b/src/main/index.ts@@@ -3209,106 -3088,13 +3209,112 @@@ ipcMain.handle('hive:setArchived', (_evhive.setArchived(id, archived === true);return { ok: true };});+ ipcMain.handle('hive:patchAgentRole', (_evt, id: unknown, role: unknown) => {+ if (typeof id !== 'string') return { ok: false, error: 'invalid id' };+ if (typeof role !== 'string') return { ok: false, error: 'invalid role' };+ if (!hive.enabled()) return { ok: false, error: 'hive disabled (no harnessHome)' };+ return hive.patchAgentRole(id, role);+ });+// ─── IPC: Settings hero payload (remote data, cached) ───────────────────────+/** Plan copy and sponsor, fetched from the repo so they can change without a+ * release. Validated in shared/heroPayload before it reaches the renderer. */+ipcMain.handle('hero:payload', async (_evt, force: unknown) =>+ loadHero(join(app.getPath('userData'), 'hero.json'), { force: force === true }));++// ─── IPC: skills (installed locally, and the browsable catalog) ─────────────+/** Skills the CLIs on this machine can already use. Scans the registered repos+ * plus the agent's own cwd, so a project-scoped skill shows up where it applies. */+ipcMain.handle('skills:local', (_evt, cwd: unknown): LocalSkill[] => {+ const cfg = readConfig();+ const cwds = [+ ...(typeof cwd === 'string' && cwd ? [cwd] : []),+ ...(cfg.registeredRepos ?? [])+ ];+ try {+ return listLocalSkills({ cwds, bundledDir: skillsResourceDir() });+ } catch (e) {+ console.error('[skills] local scan failed:', e);+ return [];+ }+});+/** The skills catalog, parsed from its README and cached in userData.+ * `force` is the explicit refresh button; everything else is served from a+ * day-old cache so opening the tab never waits on the network. */+ipcMain.handle('skills:catalog', async (_evt, force: unknown) => {+ const cachePath = join(app.getPath('userData'), 'skill-catalog.json');+ return loadCatalog(cachePath, { force: force === true });+});++/** Install one catalog skill into ~/.claude/skills. Structured refusals, never a+ * throw: the UI distinguishes "not installable" from "install failed". */+ipcMain.handle('skills:install', async (_evt, url: unknown, name: unknown) => {+ if (typeof url !== 'string' || typeof name !== 'string') {+ return { ok: false as const, error: 'bad request' };+ }+ return installSkill(url, name);+});+/** Delete an installed skill. The guard rails live in uninstallSkill — it refuses+ * any path it cannot prove is a skill folder inside a skills root. */+ipcMain.handle('skills:uninstall', (_evt, path: unknown) => {+ if (typeof path !== 'string') return { ok: false as const, error: 'bad request' };+ const cfg = readConfig();+ return uninstallSkill(path, { cwds: cfg.registeredRepos ?? [] });+});+/** Reveal a skill on disk. `openExternal` is deliberately https-only, so a+ * file:// URL cannot (and should not) be smuggled through it. */+ipcMain.handle('skills:reveal', (_evt, path: unknown) => {+ if (typeof path !== 'string' || !path.trim()) return { ok: false, error: 'bad request' };+ const skillRoots = [join(homedir(), '.claude', 'skills'), join(homedir(), '.config', 'opencode')];+ const target = resolve(path);+ const inRoot = skillRoots.some((r) => target.startsWith(resolve(r) + sep))+ || (readConfig().registeredRepos ?? []).some((c) => target.startsWith(resolve(c) + sep));+ if (!inRoot) return { ok: false, error: 'outside a managed skills directory' };+ shell.showItemInFolder(target);+ return { ok: true };+});++// ─── IPC: setup catalog (which external tools are actually here) ────────────+/**+ * Probe every catalog row against THIS machine.+ *+ * Presence is a PATH resolution, not a spawn: running each candidate to read a+ * --version would be a dozen process launches on every panel open, and several of+ * these CLIs boot a TUI when invoked bare. `resolveCommand` returns its input+ * unchanged when it finds nothing, so "resolved to a real, existing path that is+ * not just the bare name" is the found test.+ *+ * mempalace is the one row that does NOT come from PATH: the memory subsystem+ * already resolves it (including uv/pip locations PATH may not carry for a+ * Finder-launched app) and knows whether the palace is initialised, so it is+ * authoritative and reused rather than re-probed differently here.+ */+ipcMain.handle('tools:status', (): ToolStatus[] => {+ const win = process.platform === 'win32';+ const mem = (() => { try { memory.resetBinCache(); return memory.status(); } catch { return null; } })();+ return toolCatalog().map((spec): ToolStatus => {+ const installCommand = win ? spec.install.win32 : spec.install.posix;+ if (spec.id === 'mempalace') {+ return {+ ...spec,+ installCommand,+ found: !!mem?.available,+ path: mem?.bin ?? null,+ detail: mem?.available+ ? (mem.initialized ? 'palace initialised' : 'installed — palace not built yet')+ : undefined+ };+ }+ if (!spec.bin) return { ...spec, installCommand, found: false, path: null };+ let path: string | null = null;+ try {+ const resolved = resolveCliCommand(spec.bin);+ if (resolved !== spec.bin && existsSync(resolved)) path = resolved;+ } catch { /* a probe must never take the panel down */ }+ return { ...spec, installCommand, found: !!path, path };+ });+});+// ─── IPC: semantic memory (MemPalace CLI) ───────────────────────────────────ipcMain.handle('hive:memoryStatus', () => { memory.resetBinCache(); return memory.status(); });ipcMain.handle('hive:searchMemory', (_evt, query: unknown, wing: unknown) => {diff --cc src/renderer/src/hooks/useHive.tsindex c908196c,5b496454..3e0b90cc--- a/src/renderer/src/hooks/useHive.ts+++ b/src/renderer/src/hooks/useHive.ts@@@ -16,7 -16,7 +16,8 @@@ import} from '../../../shared/providerAutomation';import { DEFAULT_CONTEXT_TRIGGER, type ContextRule } from '../../../shared/triggers';import type { AgentProvider } from '../../../shared/agentProvider';+import { bridgeOf, providerPreset } from '../../../shared/agentProvider';+ import { isDurableRole, preferredAgentRole, roleForHiveSpawn } from '../../../shared/agentRole';import { acquireTerminal, resetTerminal, isTerminalAutomationSafe } from '@/components/terminalPool';import { deliverWithAcknowledgement } from './queueDelivery';import { OFFICE_CAST, DEFAULT_CHARACTER } from '@/scene/office/cast';