@voybio/ace-swarm 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +109 -0
- package/LICENSE +186 -0
- package/README.md +229 -0
- package/assets/.agents/ACE/ACE-Init/AGENTS.md +210 -0
- package/assets/.agents/ACE/ACE-Init/instructions.md +118 -0
- package/assets/.agents/ACE/ACE_coders/AGENTS.md +154 -0
- package/assets/.agents/ACE/ACE_coders/INSTRUCTIONS.md +216 -0
- package/assets/.agents/ACE/AGENT_REGISTRY.md +70 -0
- package/assets/.agents/ACE/AGENT_REGISTRY_7.md +9 -0
- package/assets/.agents/ACE/DIRECTIVE_KERNEL.md +234 -0
- package/assets/.agents/ACE/UI/AGENTS.md +115 -0
- package/assets/.agents/ACE/UI/instructions.md +178 -0
- package/assets/.agents/ACE/VOS/ACE_VOS_MISSING_INFO_MATRIX.md +42 -0
- package/assets/.agents/ACE/VOS/AGENTS.md +72 -0
- package/assets/.agents/ACE/VOS/instructions.md +211 -0
- package/assets/.agents/ACE/agent-astgrep/AGENTS.md +123 -0
- package/assets/.agents/ACE/agent-astgrep/instructions.md +91 -0
- package/assets/.agents/ACE/agent-builder/AGENTS.md +172 -0
- package/assets/.agents/ACE/agent-builder/instructions.md +137 -0
- package/assets/.agents/ACE/agent-docs/AGENTS.md +159 -0
- package/assets/.agents/ACE/agent-docs/instructions.md +133 -0
- package/assets/.agents/ACE/agent-eval/AGENTS.md +46 -0
- package/assets/.agents/ACE/agent-eval/instructions.md +56 -0
- package/assets/.agents/ACE/agent-memory/AGENTS.md +49 -0
- package/assets/.agents/ACE/agent-memory/instructions.md +50 -0
- package/assets/.agents/ACE/agent-observability/AGENTS.md +46 -0
- package/assets/.agents/ACE/agent-observability/instructions.md +50 -0
- package/assets/.agents/ACE/agent-ops/AGENTS.md +201 -0
- package/assets/.agents/ACE/agent-ops/instructions.md +136 -0
- package/assets/.agents/ACE/agent-qa/AGENTS.md +189 -0
- package/assets/.agents/ACE/agent-qa/instructions.md +121 -0
- package/assets/.agents/ACE/agent-release/AGENTS.md +48 -0
- package/assets/.agents/ACE/agent-release/instructions.md +49 -0
- package/assets/.agents/ACE/agent-research/AGENTS.md +160 -0
- package/assets/.agents/ACE/agent-research/instructions.md +118 -0
- package/assets/.agents/ACE/agent-security/AGENTS.md +48 -0
- package/assets/.agents/ACE/agent-security/instructions.md +50 -0
- package/assets/.agents/ACE/agent-skeptic/AGENTS.md +178 -0
- package/assets/.agents/ACE/agent-skeptic/instructions.md +196 -0
- package/assets/.agents/ACE/agent-spec/AGENTS.md +169 -0
- package/assets/.agents/ACE/agent-spec/instructions.md +116 -0
- package/assets/.agents/ACE/orchestrator/AGENTS.md +365 -0
- package/assets/.agents/ACE/orchestrator/instructions.md +231 -0
- package/assets/.agents/skills/ace-orchestrator/SKILL.md +63 -0
- package/assets/.agents/skills/ace-orchestrator/references/engineering-bootstrap-playbook.md +360 -0
- package/assets/.agents/skills/astgrep-index/SKILL.md +58 -0
- package/assets/.agents/skills/codemunch/SKILL.md +65 -0
- package/assets/.agents/skills/codemunch/references/ast-driven-protocol.md +543 -0
- package/assets/.agents/skills/codesnipe/SKILL.md +64 -0
- package/assets/.agents/skills/codesnipe/references/dual-codebase-playbook.md +671 -0
- package/assets/.agents/skills/eval-harness/SKILL.md +203 -0
- package/assets/.agents/skills/handoff-lint/SKILL.md +164 -0
- package/assets/.agents/skills/incident-commander/SKILL.md +174 -0
- package/assets/.agents/skills/landing-review-watcher/SKILL.md +68 -0
- package/assets/.agents/skills/memory-curator/SKILL.md +179 -0
- package/assets/.agents/skills/problem-triage/SKILL.md +57 -0
- package/assets/.agents/skills/problem-triage/agents/openai.yaml +3 -0
- package/assets/.agents/skills/release-sentry/SKILL.md +189 -0
- package/assets/.agents/skills/risk-quant/SKILL.md +190 -0
- package/assets/.agents/skills/schema-forge/SKILL.md +174 -0
- package/assets/.agents/skills/skill-auditor/SKILL.md +52 -0
- package/assets/.agents/skills/state-auditor/SKILL.md +182 -0
- package/assets/.github/hooks/ace-copilot.json +68 -0
- package/assets/agent-state/ACE_WORKFLOW.md +131 -0
- package/assets/agent-state/ARTIFACT_MANIFEST.json +5 -0
- package/assets/agent-state/AST_GREP_COMMANDS.md +121 -0
- package/assets/agent-state/AST_GREP_INDEX.json +13 -0
- package/assets/agent-state/AST_GREP_INDEX.md +15 -0
- package/assets/agent-state/DECISIONS.md +7 -0
- package/assets/agent-state/EVIDENCE_LOG.md +7 -0
- package/assets/agent-state/HANDOFF.json +24 -0
- package/assets/agent-state/INTERFACE_REGISTRY.md +75 -0
- package/assets/agent-state/MODULES/gates/gate-autonomy.json +7 -0
- package/assets/agent-state/MODULES/gates/gate-completeness.json +7 -0
- package/assets/agent-state/MODULES/gates/gate-correctness.json +7 -0
- package/assets/agent-state/MODULES/gates/gate-evaluation.json +7 -0
- package/assets/agent-state/MODULES/gates/gate-operability.json +7 -0
- package/assets/agent-state/MODULES/gates/gate-security.json +7 -0
- package/assets/agent-state/MODULES/gates/gate-typescript-public-surface.json +7 -0
- package/assets/agent-state/MODULES/registry.json +41 -0
- package/assets/agent-state/MODULES/roles/capability-astgrep.json +49 -0
- package/assets/agent-state/MODULES/roles/capability-build.json +39 -0
- package/assets/agent-state/MODULES/roles/capability-docs.json +38 -0
- package/assets/agent-state/MODULES/roles/capability-eval.json +20 -0
- package/assets/agent-state/MODULES/roles/capability-memory.json +20 -0
- package/assets/agent-state/MODULES/roles/capability-observability.json +20 -0
- package/assets/agent-state/MODULES/roles/capability-ops.json +45 -0
- package/assets/agent-state/MODULES/roles/capability-qa.json +40 -0
- package/assets/agent-state/MODULES/roles/capability-release.json +21 -0
- package/assets/agent-state/MODULES/roles/capability-research.json +44 -0
- package/assets/agent-state/MODULES/roles/capability-security.json +21 -0
- package/assets/agent-state/MODULES/roles/capability-skeptic.json +48 -0
- package/assets/agent-state/MODULES/roles/capability-spec.json +42 -0
- package/assets/agent-state/MODULES/schemas/ACE_RUNTIME_PROFILE.schema.json +289 -0
- package/assets/agent-state/MODULES/schemas/ARTIFACT_MANIFEST.schema.json +185 -0
- package/assets/agent-state/MODULES/schemas/HANDOFF.agent-state.schema.json +124 -0
- package/assets/agent-state/MODULES/schemas/HANDOFF.schema.json +55 -0
- package/assets/agent-state/MODULES/schemas/RUNTIME_EXECUTOR_SESSION_REGISTRY.schema.json +290 -0
- package/assets/agent-state/MODULES/schemas/RUNTIME_TOOL_SPEC_REGISTRY.schema.json +144 -0
- package/assets/agent-state/MODULES/schemas/STATUS_EVENT.schema.json +84 -0
- package/assets/agent-state/MODULES/schemas/SWARM_HANDOFF.schema.json +138 -0
- package/assets/agent-state/MODULES/schemas/TRACKER_SNAPSHOT.schema.json +134 -0
- package/assets/agent-state/MODULES/schemas/VERICIFY_BRIDGE_SNAPSHOT.schema.json +157 -0
- package/assets/agent-state/MODULES/schemas/VERICIFY_PROCESS_POST_LOG.schema.json +93 -0
- package/assets/agent-state/MODULES/schemas/WORKSPACE_SESSION_REGISTRY.schema.json +133 -0
- package/assets/agent-state/PROVENANCE_LOG.md +28 -0
- package/assets/agent-state/QUALITY_GATES.md +15 -0
- package/assets/agent-state/RISKS.md +8 -0
- package/assets/agent-state/SCOPE.md +20 -0
- package/assets/agent-state/SKILL_CATALOG.md +48 -0
- package/assets/agent-state/STATUS.md +8 -0
- package/assets/agent-state/STATUS_EVENTS.ndjson +1 -0
- package/assets/agent-state/TASK.md +18 -0
- package/assets/agent-state/TEAL_CONFIG.md +117 -0
- package/assets/agent-state/handoff-registry.json +5 -0
- package/assets/agent-state/index-fingerprints.json +7 -0
- package/assets/agent-state/index.json +32 -0
- package/assets/agent-state/run-ledger.json +5 -0
- package/assets/agent-state/runtime-executor-sessions.json +5 -0
- package/assets/agent-state/runtime-tool-specs.json +5 -0
- package/assets/agent-state/runtime-workspaces.json +5 -0
- package/assets/agent-state/todo-state.json +7 -0
- package/assets/agent-state/tracker-snapshot.json +7 -0
- package/assets/agent-state/vericify/ace-bridge.json +60 -0
- package/assets/agent-state/vericify/process-posts.json +5 -0
- package/assets/instructions/ACE.instructions.md +187 -0
- package/assets/instructions/ACE_Coder.instructions.md +146 -0
- package/assets/instructions/ACE_UI.instructions.md +178 -0
- package/assets/instructions/ACE_VOS.instructions.md +211 -0
- package/assets/scripts/ace-hook-dispatch.mjs +538 -0
- package/assets/scripts/bootstrap-workspace.sh +27 -0
- package/assets/scripts/copilot-hook-dispatch.mjs +3 -0
- package/assets/scripts/eval-harness.sh +68 -0
- package/assets/scripts/render-mcp-configs.sh +396 -0
- package/assets/tasks/README.md +48 -0
- package/assets/tasks/SWARM_HANDOFF.example.json +53 -0
- package/assets/tasks/SWARM_HANDOFF.example_ui_to_coders.json +55 -0
- package/assets/tasks/SWARM_HANDOFF.example_vos_to_ui.json +55 -0
- package/assets/tasks/SWARM_HANDOFF.template.json +52 -0
- package/assets/tasks/cli_work_split.md +22 -0
- package/assets/tasks/lessons.md +17 -0
- package/assets/tasks/role_tasks.md +206 -0
- package/assets/tasks/todo.md +23 -0
- package/dist/ace-autonomy.d.ts +137 -0
- package/dist/ace-autonomy.js +472 -0
- package/dist/ace-context.d.ts +29 -0
- package/dist/ace-context.js +240 -0
- package/dist/ace-internal-tools.d.ts +8 -0
- package/dist/ace-internal-tools.js +76 -0
- package/dist/ace-server-instructions.d.ts +12 -0
- package/dist/ace-server-instructions.js +324 -0
- package/dist/agent-runtime/role-adapters.d.ts +29 -0
- package/dist/agent-runtime/role-adapters.js +573 -0
- package/dist/astgrep-index.d.ts +24 -0
- package/dist/astgrep-index.js +476 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.js +591 -0
- package/dist/git-ops.d.ts +53 -0
- package/dist/git-ops.js +238 -0
- package/dist/handoff-registry.d.ts +71 -0
- package/dist/handoff-registry.js +422 -0
- package/dist/helpers.d.ts +126 -0
- package/dist/helpers.js +1687 -0
- package/dist/index-store.d.ts +51 -0
- package/dist/index-store.js +328 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +7 -0
- package/dist/internal-tool-runtime.d.ts +21 -0
- package/dist/internal-tool-runtime.js +136 -0
- package/dist/job-scheduler.d.ts +175 -0
- package/dist/job-scheduler.js +1217 -0
- package/dist/kanban.d.ts +27 -0
- package/dist/kanban.js +339 -0
- package/dist/local-model-runtime.d.ts +40 -0
- package/dist/local-model-runtime.js +174 -0
- package/dist/model-bridge.d.ts +54 -0
- package/dist/model-bridge.js +587 -0
- package/dist/orchestrator-supervisor.d.ts +100 -0
- package/dist/orchestrator-supervisor.js +399 -0
- package/dist/problem-triage.d.ts +23 -0
- package/dist/problem-triage.js +448 -0
- package/dist/prompts.d.ts +7 -0
- package/dist/prompts.js +628 -0
- package/dist/public-surface.d.ts +30 -0
- package/dist/public-surface.js +316 -0
- package/dist/resources.d.ts +7 -0
- package/dist/resources.js +545 -0
- package/dist/run-ledger.d.ts +36 -0
- package/dist/run-ledger.js +257 -0
- package/dist/runtime-command.d.ts +18 -0
- package/dist/runtime-command.js +76 -0
- package/dist/runtime-executor.d.ts +104 -0
- package/dist/runtime-executor.js +985 -0
- package/dist/runtime-profile.d.ts +116 -0
- package/dist/runtime-profile.js +532 -0
- package/dist/runtime-tool-specs.d.ts +68 -0
- package/dist/runtime-tool-specs.js +527 -0
- package/dist/safe-edit.d.ts +52 -0
- package/dist/safe-edit.js +255 -0
- package/dist/schemas.d.ts +44 -0
- package/dist/schemas.js +830 -0
- package/dist/semantic-cache.d.ts +147 -0
- package/dist/semantic-cache.js +552 -0
- package/dist/semantic-hash.d.ts +83 -0
- package/dist/semantic-hash.js +346 -0
- package/dist/server.d.ts +10 -0
- package/dist/server.js +46 -0
- package/dist/shared.d.ts +136 -0
- package/dist/shared.js +269 -0
- package/dist/skill-auditor.d.ts +26 -0
- package/dist/skill-auditor.js +184 -0
- package/dist/skill-catalog.d.ts +60 -0
- package/dist/skill-catalog.js +305 -0
- package/dist/status-events.d.ts +40 -0
- package/dist/status-events.js +269 -0
- package/dist/store/ace-packed-store.d.ts +69 -0
- package/dist/store/ace-packed-store.js +434 -0
- package/dist/store/bootstrap-store.d.ts +46 -0
- package/dist/store/bootstrap-store.js +242 -0
- package/dist/store/catalog-builder.d.ts +21 -0
- package/dist/store/catalog-builder.js +68 -0
- package/dist/store/importer.d.ts +19 -0
- package/dist/store/importer.js +157 -0
- package/dist/store/knowledge-bake.d.ts +59 -0
- package/dist/store/knowledge-bake.js +339 -0
- package/dist/store/materializers/hook-context-materializer.d.ts +25 -0
- package/dist/store/materializers/hook-context-materializer.js +100 -0
- package/dist/store/materializers/host-file-materializer.d.ts +37 -0
- package/dist/store/materializers/host-file-materializer.js +271 -0
- package/dist/store/materializers/todo-syncer.d.ts +30 -0
- package/dist/store/materializers/todo-syncer.js +140 -0
- package/dist/store/materializers/vericify-projector.d.ts +38 -0
- package/dist/store/materializers/vericify-projector.js +239 -0
- package/dist/store/repositories/discovery-repository.d.ts +24 -0
- package/dist/store/repositories/discovery-repository.js +58 -0
- package/dist/store/repositories/handoff-repository.d.ts +31 -0
- package/dist/store/repositories/handoff-repository.js +67 -0
- package/dist/store/repositories/ledger-repository.d.ts +26 -0
- package/dist/store/repositories/ledger-repository.js +49 -0
- package/dist/store/repositories/runtime-kv-repository.d.ts +16 -0
- package/dist/store/repositories/runtime-kv-repository.js +36 -0
- package/dist/store/repositories/scheduler-repository.d.ts +50 -0
- package/dist/store/repositories/scheduler-repository.js +123 -0
- package/dist/store/repositories/session-repository.d.ts +33 -0
- package/dist/store/repositories/session-repository.js +82 -0
- package/dist/store/repositories/todo-repository.d.ts +31 -0
- package/dist/store/repositories/todo-repository.js +77 -0
- package/dist/store/repositories/tracker-repository.d.ts +25 -0
- package/dist/store/repositories/tracker-repository.js +43 -0
- package/dist/store/repositories/vericify-repository.d.ts +32 -0
- package/dist/store/repositories/vericify-repository.js +58 -0
- package/dist/store/skills-install.d.ts +28 -0
- package/dist/store/skills-install.js +86 -0
- package/dist/store/state-reader.d.ts +49 -0
- package/dist/store/state-reader.js +111 -0
- package/dist/store/store-artifacts.d.ts +12 -0
- package/dist/store/store-artifacts.js +138 -0
- package/dist/store/store-snapshot.d.ts +19 -0
- package/dist/store/store-snapshot.js +140 -0
- package/dist/store/topology-bake.d.ts +15 -0
- package/dist/store/topology-bake.js +215 -0
- package/dist/store/types.d.ts +155 -0
- package/dist/store/types.js +35 -0
- package/dist/store/workspace-snapshot.d.ts +26 -0
- package/dist/store/workspace-snapshot.js +107 -0
- package/dist/store/write-queue.d.ts +7 -0
- package/dist/store/write-queue.js +26 -0
- package/dist/todo-state.d.ts +41 -0
- package/dist/todo-state.js +399 -0
- package/dist/tools-agent.d.ts +7 -0
- package/dist/tools-agent.js +1542 -0
- package/dist/tools-discovery.d.ts +6 -0
- package/dist/tools-discovery.js +178 -0
- package/dist/tools-drift.d.ts +13 -0
- package/dist/tools-drift.js +357 -0
- package/dist/tools-files.d.ts +6 -0
- package/dist/tools-files.js +679 -0
- package/dist/tools-framework.d.ts +7 -0
- package/dist/tools-framework.js +1414 -0
- package/dist/tools-git.d.ts +6 -0
- package/dist/tools-git.js +183 -0
- package/dist/tools-handoff.d.ts +32 -0
- package/dist/tools-handoff.js +489 -0
- package/dist/tools-lifecycle.d.ts +6 -0
- package/dist/tools-lifecycle.js +205 -0
- package/dist/tools-memory.d.ts +6 -0
- package/dist/tools-memory.js +260 -0
- package/dist/tools-scheduler.d.ts +6 -0
- package/dist/tools-scheduler.js +228 -0
- package/dist/tools-skills.d.ts +3 -0
- package/dist/tools-skills.js +104 -0
- package/dist/tools-todo.d.ts +6 -0
- package/dist/tools-todo.js +154 -0
- package/dist/tools.d.ts +9 -0
- package/dist/tools.js +33 -0
- package/dist/tracker-adapters.d.ts +74 -0
- package/dist/tracker-adapters.js +776 -0
- package/dist/tracker-sync.d.ts +10 -0
- package/dist/tracker-sync.js +84 -0
- package/dist/tui/agent-runner.d.ts +137 -0
- package/dist/tui/agent-runner.js +466 -0
- package/dist/tui/agent-worker.d.ts +10 -0
- package/dist/tui/agent-worker.js +347 -0
- package/dist/tui/chat.d.ts +84 -0
- package/dist/tui/chat.js +368 -0
- package/dist/tui/commands.d.ts +57 -0
- package/dist/tui/commands.js +432 -0
- package/dist/tui/dashboard.d.ts +24 -0
- package/dist/tui/dashboard.js +110 -0
- package/dist/tui/index.d.ts +114 -0
- package/dist/tui/index.js +1059 -0
- package/dist/tui/input.d.ts +49 -0
- package/dist/tui/input.js +336 -0
- package/dist/tui/layout.d.ts +116 -0
- package/dist/tui/layout.js +367 -0
- package/dist/tui/ollama.d.ts +116 -0
- package/dist/tui/ollama.js +192 -0
- package/dist/tui/openai-compatible.d.ts +63 -0
- package/dist/tui/openai-compatible.js +370 -0
- package/dist/tui/provider-discovery.d.ts +59 -0
- package/dist/tui/provider-discovery.js +530 -0
- package/dist/tui/renderer.d.ts +166 -0
- package/dist/tui/renderer.js +304 -0
- package/dist/tui/tabs.d.ts +70 -0
- package/dist/tui/tabs.js +208 -0
- package/dist/tui/telemetry.d.ts +56 -0
- package/dist/tui/telemetry.js +106 -0
- package/dist/vericify-bridge.d.ts +146 -0
- package/dist/vericify-bridge.js +571 -0
- package/dist/vericify-context.d.ts +10 -0
- package/dist/vericify-context.js +72 -0
- package/dist/workspace-manager.d.ts +107 -0
- package/dist/workspace-manager.js +636 -0
- package/package.json +83 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* StateReader — read-only projection over AcePackedStore
|
|
3
|
+
*
|
|
4
|
+
* The TUI uses StateReader for dashboard ingestion.
|
|
5
|
+
* The TUI never opens the store for writing.
|
|
6
|
+
*
|
|
7
|
+
* Opens the store in a read-compatible mode (no write lock needed for reads).
|
|
8
|
+
*/
|
|
9
|
+
import { openStore } from "./ace-packed-store.js";
|
|
10
|
+
import { HandoffRepository } from "./repositories/handoff-repository.js";
|
|
11
|
+
import { TodoRepository } from "./repositories/todo-repository.js";
|
|
12
|
+
import { LedgerRepository } from "./repositories/ledger-repository.js";
|
|
13
|
+
import { SchedulerRepository } from "./repositories/scheduler-repository.js";
|
|
14
|
+
import { SessionRepository } from "./repositories/session-repository.js";
|
|
15
|
+
import { TrackerRepository } from "./repositories/tracker-repository.js";
|
|
16
|
+
import { DiscoveryRepository } from "./repositories/discovery-repository.js";
|
|
17
|
+
import { VericifyRepository } from "./repositories/vericify-repository.js";
|
|
18
|
+
export class StoreStateReader {
|
|
19
|
+
store = null;
|
|
20
|
+
get repos() {
|
|
21
|
+
if (!this.store)
|
|
22
|
+
throw new Error("StoreStateReader: not open");
|
|
23
|
+
return {
|
|
24
|
+
handoffs: new HandoffRepository(this.store),
|
|
25
|
+
todos: new TodoRepository(this.store),
|
|
26
|
+
ledger: new LedgerRepository(this.store),
|
|
27
|
+
scheduler: new SchedulerRepository(this.store),
|
|
28
|
+
sessions: new SessionRepository(this.store),
|
|
29
|
+
tracker: new TrackerRepository(this.store),
|
|
30
|
+
discovery: new DiscoveryRepository(this.store),
|
|
31
|
+
vericify: new VericifyRepository(this.store),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
async open(storePath) {
|
|
35
|
+
// Read-only: no write lock acquired — safe for concurrent TUI reads
|
|
36
|
+
this.store = await openStore(storePath, { readOnly: true });
|
|
37
|
+
}
|
|
38
|
+
async close() {
|
|
39
|
+
if (this.store) {
|
|
40
|
+
await this.store.close();
|
|
41
|
+
this.store = null;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
async snapshot() {
|
|
45
|
+
const r = this.repos;
|
|
46
|
+
const [handoffs, todos, ledger, jobs, sessions, events, providers, posts] = await Promise.all([
|
|
47
|
+
r.handoffs.list(),
|
|
48
|
+
r.todos.getAll(),
|
|
49
|
+
r.ledger.recent(20),
|
|
50
|
+
r.scheduler.listJobs(),
|
|
51
|
+
r.sessions.list(),
|
|
52
|
+
r.tracker.list({ limit: 50 }),
|
|
53
|
+
r.discovery.listAll(),
|
|
54
|
+
r.vericify.list(),
|
|
55
|
+
]);
|
|
56
|
+
return {
|
|
57
|
+
handoffs,
|
|
58
|
+
todos,
|
|
59
|
+
ledger,
|
|
60
|
+
jobs,
|
|
61
|
+
sessions,
|
|
62
|
+
events,
|
|
63
|
+
providers,
|
|
64
|
+
posts,
|
|
65
|
+
snapped_at: Date.now(),
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
async handoffs() { return this.repos.handoffs.list(); }
|
|
69
|
+
async todos() { return this.repos.todos.getAll(); }
|
|
70
|
+
async ledger() { return this.repos.ledger.list(); }
|
|
71
|
+
async schedulerState() { return this.repos.scheduler.listJobs(); }
|
|
72
|
+
async sessions() { return this.repos.sessions.list(); }
|
|
73
|
+
async statusEvents() { return this.repos.tracker.list(); }
|
|
74
|
+
async providerDiscovery() { return this.repos.discovery.listAll(); }
|
|
75
|
+
async vericifyPosts() { return this.repos.vericify.list(); }
|
|
76
|
+
async domainDocs(_domain) { return []; } // Phase 6 wiring
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Poll the store on an interval and call the callback with snapshots.
|
|
80
|
+
* TUI dashboard ingestion pattern.
|
|
81
|
+
*/
|
|
82
|
+
export function pollStore(storePath, intervalMs, onSnapshot, onError) {
|
|
83
|
+
let stopped = false;
|
|
84
|
+
let reader = null;
|
|
85
|
+
async function poll() {
|
|
86
|
+
while (!stopped) {
|
|
87
|
+
try {
|
|
88
|
+
if (!reader) {
|
|
89
|
+
reader = new StoreStateReader();
|
|
90
|
+
await reader.open(storePath);
|
|
91
|
+
}
|
|
92
|
+
const snap = await reader.snapshot();
|
|
93
|
+
onSnapshot(snap);
|
|
94
|
+
}
|
|
95
|
+
catch (err) {
|
|
96
|
+
onError?.(err);
|
|
97
|
+
// Close and reopen on next poll
|
|
98
|
+
if (reader) {
|
|
99
|
+
await reader.close().catch(() => { });
|
|
100
|
+
reader = null;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
await new Promise((r) => setTimeout(r, intervalMs));
|
|
104
|
+
}
|
|
105
|
+
if (reader)
|
|
106
|
+
await reader.close().catch(() => { });
|
|
107
|
+
}
|
|
108
|
+
poll();
|
|
109
|
+
return () => { stopped = true; };
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=state-reader.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const OPERATIONAL_ARTIFACT_REL_PATHS: Set<string>;
|
|
2
|
+
export declare function operationalArtifactKey(relPath: string): string;
|
|
3
|
+
export declare function isOperationalArtifactPath(relPath: string): boolean;
|
|
4
|
+
export declare function readOperationalArtifactSync(workspaceRoot: string, relPath: string): string | undefined;
|
|
5
|
+
export declare function operationalArtifactVirtualPath(workspaceRoot: string, relPath: string): string;
|
|
6
|
+
export declare function writeStoreBlobsSync(workspaceRoot: string, blobs: ReadonlyArray<{
|
|
7
|
+
key: string;
|
|
8
|
+
content: string;
|
|
9
|
+
}>): string[];
|
|
10
|
+
export declare function writeStoreBlobSync(workspaceRoot: string, key: string, content: string): string;
|
|
11
|
+
export declare function writeOperationalArtifactSync(workspaceRoot: string, relPath: string, content: string): string;
|
|
12
|
+
//# sourceMappingURL=store-artifacts.d.ts.map
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync, } from "node:fs";
|
|
2
|
+
import { dirname } from "node:path";
|
|
3
|
+
import { getWorkspaceStorePath, readStoreBlobSync, toVirtualStorePath } from "./store-snapshot.js";
|
|
4
|
+
import { HEADER_SIZE, MAGIC } from "./types.js";
|
|
5
|
+
const TEXT = new TextEncoder();
|
|
6
|
+
const DECODE = new TextDecoder();
|
|
7
|
+
export const OPERATIONAL_ARTIFACT_REL_PATHS = new Set([
|
|
8
|
+
"agent-state/AST_GREP_INDEX.json",
|
|
9
|
+
"agent-state/AST_GREP_INDEX.md",
|
|
10
|
+
"agent-state/EVIDENCE_LOG.md",
|
|
11
|
+
"agent-state/STATUS_EVENTS.ndjson",
|
|
12
|
+
"agent-state/STATUS_EVENTS-archive.ndjson",
|
|
13
|
+
"agent-state/handoff-registry.json",
|
|
14
|
+
"agent-state/index-fingerprints.json",
|
|
15
|
+
"agent-state/index.json",
|
|
16
|
+
"agent-state/run-ledger.json",
|
|
17
|
+
"agent-state/run-ledger-archive.ndjson",
|
|
18
|
+
"agent-state/runtime-executor-sessions.json",
|
|
19
|
+
"agent-state/runtime-tool-specs.json",
|
|
20
|
+
"agent-state/runtime-workspaces.json",
|
|
21
|
+
"agent-state/todo-state.json",
|
|
22
|
+
"agent-state/tracker-snapshot.json",
|
|
23
|
+
"agent-state/vericify/ace-bridge.json",
|
|
24
|
+
"agent-state/vericify/process-posts.json",
|
|
25
|
+
]);
|
|
26
|
+
const OPERATIONAL_ARTIFACT_PREFIX = "state/artifacts/";
|
|
27
|
+
function uint32ToBytes(value) {
|
|
28
|
+
const bytes = new Uint8Array(4);
|
|
29
|
+
new DataView(bytes.buffer).setUint32(0, value, false);
|
|
30
|
+
return bytes;
|
|
31
|
+
}
|
|
32
|
+
function uint64ToBytes(value) {
|
|
33
|
+
const bytes = new Uint8Array(8);
|
|
34
|
+
const view = new DataView(bytes.buffer);
|
|
35
|
+
view.setUint32(0, Math.floor(value / 2 ** 32), false);
|
|
36
|
+
view.setUint32(4, value >>> 0, false);
|
|
37
|
+
return bytes;
|
|
38
|
+
}
|
|
39
|
+
function bytesToUint64(bytes, offset = 0) {
|
|
40
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset);
|
|
41
|
+
return view.getUint32(offset, false) * 2 ** 32 + view.getUint32(offset + 4, false);
|
|
42
|
+
}
|
|
43
|
+
function writeHeader(header, indexOffset, indexLength) {
|
|
44
|
+
for (let idx = 0; idx < 8; idx += 1)
|
|
45
|
+
header[idx] = MAGIC.charCodeAt(idx);
|
|
46
|
+
header.set(uint32ToBytes(1), 8);
|
|
47
|
+
header.set(uint32ToBytes(0), 12);
|
|
48
|
+
header.set(uint64ToBytes(indexOffset), 16);
|
|
49
|
+
header.set(uint64ToBytes(indexLength), 24);
|
|
50
|
+
}
|
|
51
|
+
function readHeader(header) {
|
|
52
|
+
const magic = DECODE.decode(header.slice(0, 8));
|
|
53
|
+
if (magic !== MAGIC) {
|
|
54
|
+
throw new Error("AcePackedStore artifact write failed: invalid store header");
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
indexOffset: bytesToUint64(header, 16),
|
|
58
|
+
indexLength: bytesToUint64(header, 24),
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function defaultStoreBuffer() {
|
|
62
|
+
const header = new Uint8Array(HEADER_SIZE);
|
|
63
|
+
const indexBytes = TEXT.encode("{}");
|
|
64
|
+
writeHeader(header, HEADER_SIZE, indexBytes.length);
|
|
65
|
+
const buffer = Buffer.alloc(HEADER_SIZE + indexBytes.length);
|
|
66
|
+
buffer.set(header, 0);
|
|
67
|
+
buffer.set(indexBytes, HEADER_SIZE);
|
|
68
|
+
return buffer;
|
|
69
|
+
}
|
|
70
|
+
function readStoreBuffer(storePath) {
|
|
71
|
+
const file = existsSync(storePath) ? readFileSync(storePath) : defaultStoreBuffer();
|
|
72
|
+
if (file.length < HEADER_SIZE) {
|
|
73
|
+
return {
|
|
74
|
+
file: defaultStoreBuffer(),
|
|
75
|
+
chunkEnd: HEADER_SIZE,
|
|
76
|
+
index: {},
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
const { indexOffset, indexLength } = readHeader(file.subarray(0, HEADER_SIZE));
|
|
80
|
+
const indexRaw = file.subarray(indexOffset, indexOffset + indexLength);
|
|
81
|
+
const index = JSON.parse(DECODE.decode(indexRaw));
|
|
82
|
+
return { file, chunkEnd: indexOffset, index };
|
|
83
|
+
}
|
|
84
|
+
export function operationalArtifactKey(relPath) {
|
|
85
|
+
return `${OPERATIONAL_ARTIFACT_PREFIX}${relPath}`;
|
|
86
|
+
}
|
|
87
|
+
export function isOperationalArtifactPath(relPath) {
|
|
88
|
+
return OPERATIONAL_ARTIFACT_REL_PATHS.has(relPath);
|
|
89
|
+
}
|
|
90
|
+
export function readOperationalArtifactSync(workspaceRoot, relPath) {
|
|
91
|
+
return readStoreBlobSync(workspaceRoot, operationalArtifactKey(relPath));
|
|
92
|
+
}
|
|
93
|
+
export function operationalArtifactVirtualPath(workspaceRoot, relPath) {
|
|
94
|
+
return toVirtualStorePath(getWorkspaceStorePath(workspaceRoot), operationalArtifactKey(relPath));
|
|
95
|
+
}
|
|
96
|
+
export function writeStoreBlobsSync(workspaceRoot, blobs) {
|
|
97
|
+
const storePath = getWorkspaceStorePath(workspaceRoot);
|
|
98
|
+
const { file, chunkEnd, index } = readStoreBuffer(storePath);
|
|
99
|
+
const encoded = blobs.map(({ key, content }) => ({
|
|
100
|
+
key,
|
|
101
|
+
contentBytes: TEXT.encode(content),
|
|
102
|
+
}));
|
|
103
|
+
const appendedSize = encoded.reduce((sum, entry) => sum + 4 + entry.contentBytes.length, 0);
|
|
104
|
+
const nextIndexOffset = chunkEnd + appendedSize;
|
|
105
|
+
const nextIndex = { ...index };
|
|
106
|
+
let cursor = chunkEnd;
|
|
107
|
+
for (const entry of encoded) {
|
|
108
|
+
nextIndex[entry.key] = { offset: cursor, length: entry.contentBytes.length };
|
|
109
|
+
cursor += 4 + entry.contentBytes.length;
|
|
110
|
+
}
|
|
111
|
+
const indexBytes = TEXT.encode(JSON.stringify(nextIndex));
|
|
112
|
+
const output = Buffer.alloc(nextIndexOffset + indexBytes.length);
|
|
113
|
+
const header = new Uint8Array(HEADER_SIZE);
|
|
114
|
+
writeHeader(header, nextIndexOffset, indexBytes.length);
|
|
115
|
+
output.set(header, 0);
|
|
116
|
+
if (chunkEnd > HEADER_SIZE) {
|
|
117
|
+
output.set(file.subarray(HEADER_SIZE, chunkEnd), HEADER_SIZE);
|
|
118
|
+
}
|
|
119
|
+
cursor = chunkEnd;
|
|
120
|
+
for (const entry of encoded) {
|
|
121
|
+
output.set(uint32ToBytes(entry.contentBytes.length), cursor);
|
|
122
|
+
output.set(entry.contentBytes, cursor + 4);
|
|
123
|
+
cursor += 4 + entry.contentBytes.length;
|
|
124
|
+
}
|
|
125
|
+
output.set(indexBytes, nextIndexOffset);
|
|
126
|
+
mkdirSync(dirname(storePath), { recursive: true });
|
|
127
|
+
const tmpPath = `${storePath}.${process.pid}.${Date.now()}.tmp`;
|
|
128
|
+
writeFileSync(tmpPath, output);
|
|
129
|
+
renameSync(tmpPath, storePath);
|
|
130
|
+
return blobs.map(({ key }) => toVirtualStorePath(storePath, key));
|
|
131
|
+
}
|
|
132
|
+
export function writeStoreBlobSync(workspaceRoot, key, content) {
|
|
133
|
+
return writeStoreBlobsSync(workspaceRoot, [{ key, content }])[0];
|
|
134
|
+
}
|
|
135
|
+
export function writeOperationalArtifactSync(workspaceRoot, relPath, content) {
|
|
136
|
+
return writeStoreBlobSync(workspaceRoot, operationalArtifactKey(relPath), content);
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=store-artifacts.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare function getWorkspaceStorePath(workspaceRoot: string): string;
|
|
2
|
+
export declare function storeExistsSync(workspaceRoot: string): boolean;
|
|
3
|
+
export declare function readStoreBlobSync(workspaceRoot: string, key: string): string | undefined;
|
|
4
|
+
export declare function readStoreBlobByPathSync(storePath: string, key: string): string | undefined;
|
|
5
|
+
export declare function readStoreJsonSync<T>(workspaceRoot: string, key: string): T | undefined;
|
|
6
|
+
export declare function readStoreJsonByPathSync<T>(storePath: string, key: string): T | undefined;
|
|
7
|
+
export declare function listStoreKeysSync(workspaceRoot: string, prefix?: string): string[];
|
|
8
|
+
export declare function listStoreKeysByPathSync(storePath: string, prefix?: string): string[];
|
|
9
|
+
export declare function getStoreStatSync(storePath: string): {
|
|
10
|
+
mtimeMs: number;
|
|
11
|
+
size: number;
|
|
12
|
+
} | undefined;
|
|
13
|
+
export declare function toVirtualStorePath(storePath: string, key: string): string;
|
|
14
|
+
export declare function parseVirtualStorePath(path: string): {
|
|
15
|
+
storePath: string;
|
|
16
|
+
key: string;
|
|
17
|
+
} | undefined;
|
|
18
|
+
export declare function readVirtualStorePathSync(path: string): string | undefined;
|
|
19
|
+
//# sourceMappingURL=store-snapshot.d.ts.map
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import { HEADER_SIZE, MAGIC } from "./types.js";
|
|
4
|
+
const DECODE = new TextDecoder();
|
|
5
|
+
let cached;
|
|
6
|
+
function bytesToUint32(bytes, offset = 0) {
|
|
7
|
+
return new DataView(bytes.buffer, bytes.byteOffset).getUint32(offset, false);
|
|
8
|
+
}
|
|
9
|
+
function bytesToUint64(bytes, offset = 0) {
|
|
10
|
+
const dv = new DataView(bytes.buffer, bytes.byteOffset);
|
|
11
|
+
return dv.getUint32(offset, false) * 2 ** 32 + dv.getUint32(offset + 4, false);
|
|
12
|
+
}
|
|
13
|
+
function readHeader(bytes) {
|
|
14
|
+
const magic = DECODE.decode(bytes.slice(0, 8));
|
|
15
|
+
if (magic !== MAGIC) {
|
|
16
|
+
throw new Error("AcePackedStore snapshot: invalid magic bytes");
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
indexOffset: bytesToUint64(bytes, 16),
|
|
20
|
+
indexLength: bytesToUint64(bytes, 24),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function loadSnapshot(storePath) {
|
|
24
|
+
if (!existsSync(storePath))
|
|
25
|
+
return undefined;
|
|
26
|
+
const stats = statSync(storePath);
|
|
27
|
+
if (cached &&
|
|
28
|
+
cached.path === storePath &&
|
|
29
|
+
cached.mtimeMs === stats.mtimeMs &&
|
|
30
|
+
cached.size === stats.size) {
|
|
31
|
+
return cached;
|
|
32
|
+
}
|
|
33
|
+
try {
|
|
34
|
+
const file = readFileSync(storePath);
|
|
35
|
+
if (file.length < HEADER_SIZE)
|
|
36
|
+
return cached?.path === storePath ? cached : undefined;
|
|
37
|
+
const { indexOffset, indexLength } = readHeader(file);
|
|
38
|
+
const indexBytes = file.slice(indexOffset, indexOffset + indexLength);
|
|
39
|
+
const parsed = JSON.parse(DECODE.decode(indexBytes));
|
|
40
|
+
cached = {
|
|
41
|
+
path: storePath,
|
|
42
|
+
mtimeMs: stats.mtimeMs,
|
|
43
|
+
size: stats.size,
|
|
44
|
+
file,
|
|
45
|
+
index: new Map(Object.entries(parsed)),
|
|
46
|
+
};
|
|
47
|
+
return cached;
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
return cached?.path === storePath ? cached : undefined;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
export function getWorkspaceStorePath(workspaceRoot) {
|
|
54
|
+
return resolve(workspaceRoot, ".agents", "ACE", "ace-state.zarr");
|
|
55
|
+
}
|
|
56
|
+
export function storeExistsSync(workspaceRoot) {
|
|
57
|
+
return existsSync(getWorkspaceStorePath(workspaceRoot));
|
|
58
|
+
}
|
|
59
|
+
export function readStoreBlobSync(workspaceRoot, key) {
|
|
60
|
+
const snapshot = loadSnapshot(getWorkspaceStorePath(workspaceRoot));
|
|
61
|
+
const entry = snapshot?.index.get(key);
|
|
62
|
+
if (!snapshot || !entry)
|
|
63
|
+
return undefined;
|
|
64
|
+
const start = entry.offset + 4;
|
|
65
|
+
const end = start + entry.length;
|
|
66
|
+
return DECODE.decode(snapshot.file.slice(start, end));
|
|
67
|
+
}
|
|
68
|
+
export function readStoreBlobByPathSync(storePath, key) {
|
|
69
|
+
const snapshot = loadSnapshot(storePath);
|
|
70
|
+
const entry = snapshot?.index.get(key);
|
|
71
|
+
if (!snapshot || !entry)
|
|
72
|
+
return undefined;
|
|
73
|
+
const start = entry.offset + 4;
|
|
74
|
+
const end = start + entry.length;
|
|
75
|
+
return DECODE.decode(snapshot.file.slice(start, end));
|
|
76
|
+
}
|
|
77
|
+
export function readStoreJsonSync(workspaceRoot, key) {
|
|
78
|
+
const raw = readStoreBlobSync(workspaceRoot, key);
|
|
79
|
+
if (typeof raw !== "string")
|
|
80
|
+
return undefined;
|
|
81
|
+
try {
|
|
82
|
+
return JSON.parse(raw);
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
export function readStoreJsonByPathSync(storePath, key) {
|
|
89
|
+
const raw = readStoreBlobByPathSync(storePath, key);
|
|
90
|
+
if (typeof raw !== "string")
|
|
91
|
+
return undefined;
|
|
92
|
+
try {
|
|
93
|
+
return JSON.parse(raw);
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
return undefined;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
export function listStoreKeysSync(workspaceRoot, prefix = "") {
|
|
100
|
+
const snapshot = loadSnapshot(getWorkspaceStorePath(workspaceRoot));
|
|
101
|
+
if (!snapshot)
|
|
102
|
+
return [];
|
|
103
|
+
return [...snapshot.index.keys()]
|
|
104
|
+
.filter((key) => key.startsWith(prefix))
|
|
105
|
+
.sort((a, b) => a.localeCompare(b));
|
|
106
|
+
}
|
|
107
|
+
export function listStoreKeysByPathSync(storePath, prefix = "") {
|
|
108
|
+
const snapshot = loadSnapshot(storePath);
|
|
109
|
+
if (!snapshot)
|
|
110
|
+
return [];
|
|
111
|
+
return [...snapshot.index.keys()]
|
|
112
|
+
.filter((key) => key.startsWith(prefix))
|
|
113
|
+
.sort((a, b) => a.localeCompare(b));
|
|
114
|
+
}
|
|
115
|
+
export function getStoreStatSync(storePath) {
|
|
116
|
+
const snapshot = loadSnapshot(storePath);
|
|
117
|
+
if (!snapshot)
|
|
118
|
+
return undefined;
|
|
119
|
+
return { mtimeMs: snapshot.mtimeMs, size: snapshot.size };
|
|
120
|
+
}
|
|
121
|
+
export function toVirtualStorePath(storePath, key) {
|
|
122
|
+
return `${storePath}#${key}`;
|
|
123
|
+
}
|
|
124
|
+
export function parseVirtualStorePath(path) {
|
|
125
|
+
const marker = ".zarr#";
|
|
126
|
+
const index = path.indexOf(marker);
|
|
127
|
+
if (index === -1)
|
|
128
|
+
return undefined;
|
|
129
|
+
return {
|
|
130
|
+
storePath: path.slice(0, index + ".zarr".length),
|
|
131
|
+
key: path.slice(index + marker.length),
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
export function readVirtualStorePathSync(path) {
|
|
135
|
+
const parsed = parseVirtualStorePath(path);
|
|
136
|
+
if (!parsed)
|
|
137
|
+
return undefined;
|
|
138
|
+
return readStoreBlobByPathSync(parsed.storePath, parsed.key);
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=store-snapshot.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* topology-bake.ts
|
|
3
|
+
*
|
|
4
|
+
* Writes swarm topology into the store:
|
|
5
|
+
* - swarm_registry: agent graph, group, capabilities
|
|
6
|
+
* - agent_enablement: per-agent enable/disable flags and tool policies
|
|
7
|
+
* - skill_bindings: which skills each agent can activate
|
|
8
|
+
* - role_routing: role → agent dispatch table
|
|
9
|
+
*/
|
|
10
|
+
import { AcePackedStore } from "./ace-packed-store.js";
|
|
11
|
+
export declare function bakeTopology(store: AcePackedStore, _assetsRoot: string): Promise<void>;
|
|
12
|
+
export declare function resolveRole(store: AcePackedStore, role: string): Promise<string | undefined>;
|
|
13
|
+
export declare function getEnabledAgents(store: AcePackedStore): Promise<string[]>;
|
|
14
|
+
export declare function getAgentSkills(store: AcePackedStore, agentName: string): Promise<string[]>;
|
|
15
|
+
//# sourceMappingURL=topology-bake.d.ts.map
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* topology-bake.ts
|
|
3
|
+
*
|
|
4
|
+
* Writes swarm topology into the store:
|
|
5
|
+
* - swarm_registry: agent graph, group, capabilities
|
|
6
|
+
* - agent_enablement: per-agent enable/disable flags and tool policies
|
|
7
|
+
* - skill_bindings: which skills each agent can activate
|
|
8
|
+
* - role_routing: role → agent dispatch table
|
|
9
|
+
*/
|
|
10
|
+
import { ContentSource } from "./types.js";
|
|
11
|
+
// Derived from AGENT_REGISTRY.md table
|
|
12
|
+
const AGENT_DEFINITIONS = [
|
|
13
|
+
{
|
|
14
|
+
name: "ace-orchestrator",
|
|
15
|
+
group: "swarm",
|
|
16
|
+
objective: "Global routing and lifecycle control",
|
|
17
|
+
defaultSkills: ["handoff-lint", "state-auditor"],
|
|
18
|
+
enabled: true,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: "ace-vos",
|
|
22
|
+
group: "swarm",
|
|
23
|
+
objective: "Venture thesis and strategy hardening",
|
|
24
|
+
defaultSkills: ["risk-quant"],
|
|
25
|
+
enabled: true,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: "ace-ui",
|
|
29
|
+
group: "swarm",
|
|
30
|
+
objective: "UX/copy strategy and conversion surfaces",
|
|
31
|
+
defaultSkills: ["memory-curator"],
|
|
32
|
+
enabled: true,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "ace-coders",
|
|
36
|
+
group: "swarm",
|
|
37
|
+
objective: "Engineering execution and TDD delivery",
|
|
38
|
+
defaultSkills: ["handoff-lint"],
|
|
39
|
+
enabled: true,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: "astgrep",
|
|
43
|
+
group: "composable",
|
|
44
|
+
objective: "Structural discovery indexing",
|
|
45
|
+
defaultSkills: ["astgrep-index", "codemunch"],
|
|
46
|
+
enabled: true,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: "skeptic",
|
|
50
|
+
group: "composable",
|
|
51
|
+
objective: "Falsifiable quality gates and risk challenge",
|
|
52
|
+
defaultSkills: ["state-auditor", "risk-quant"],
|
|
53
|
+
enabled: true,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: "ops",
|
|
57
|
+
group: "composable",
|
|
58
|
+
objective: "Dependency orchestration and unblock routing",
|
|
59
|
+
defaultSkills: ["handoff-lint", "incident-commander", "state-auditor"],
|
|
60
|
+
enabled: true,
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: "research",
|
|
64
|
+
group: "composable",
|
|
65
|
+
objective: "Source-backed evidence and assumptions",
|
|
66
|
+
defaultSkills: ["codemunch", "codesnipe", "memory-curator"],
|
|
67
|
+
enabled: true,
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: "spec",
|
|
71
|
+
group: "composable",
|
|
72
|
+
objective: "Machine-readable requirement contracts",
|
|
73
|
+
defaultSkills: ["schema-forge", "handoff-lint"],
|
|
74
|
+
enabled: true,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: "builder",
|
|
78
|
+
group: "composable",
|
|
79
|
+
objective: "Build artifacts that satisfy spec",
|
|
80
|
+
defaultSkills: ["handoff-lint"],
|
|
81
|
+
enabled: true,
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: "qa",
|
|
85
|
+
group: "composable",
|
|
86
|
+
objective: "Verification and failure classification",
|
|
87
|
+
defaultSkills: ["eval-harness", "state-auditor"],
|
|
88
|
+
enabled: true,
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: "docs",
|
|
92
|
+
group: "composable",
|
|
93
|
+
objective: "Documentation consistency vs verified reality",
|
|
94
|
+
defaultSkills: ["memory-curator", "state-auditor"],
|
|
95
|
+
enabled: true,
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
name: "memory",
|
|
99
|
+
group: "composable",
|
|
100
|
+
objective: "Durable memory reconciliation",
|
|
101
|
+
defaultSkills: ["memory-curator"],
|
|
102
|
+
enabled: true,
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: "security",
|
|
106
|
+
group: "composable",
|
|
107
|
+
objective: "Security and policy gate review",
|
|
108
|
+
defaultSkills: ["risk-quant"],
|
|
109
|
+
enabled: true,
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
name: "observability",
|
|
113
|
+
group: "composable",
|
|
114
|
+
objective: "Operability and incident-readiness verification",
|
|
115
|
+
defaultSkills: ["incident-commander", "state-auditor"],
|
|
116
|
+
enabled: true,
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
name: "eval",
|
|
120
|
+
group: "composable",
|
|
121
|
+
objective: "Autonomy/regression benchmark execution",
|
|
122
|
+
defaultSkills: ["eval-harness"],
|
|
123
|
+
enabled: true,
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
name: "release",
|
|
127
|
+
group: "composable",
|
|
128
|
+
objective: "Promotion/hold/rollback decisions",
|
|
129
|
+
defaultSkills: ["release-sentry"],
|
|
130
|
+
enabled: true,
|
|
131
|
+
},
|
|
132
|
+
];
|
|
133
|
+
// Role routing: maps user-facing role names → agent names
|
|
134
|
+
const ROLE_ROUTING = {
|
|
135
|
+
orchestrator: "ace-orchestrator",
|
|
136
|
+
vos: "ace-vos",
|
|
137
|
+
ui: "ace-ui",
|
|
138
|
+
coders: "ace-coders",
|
|
139
|
+
astgrep: "astgrep",
|
|
140
|
+
skeptic: "skeptic",
|
|
141
|
+
ops: "ops",
|
|
142
|
+
research: "research",
|
|
143
|
+
spec: "spec",
|
|
144
|
+
builder: "builder",
|
|
145
|
+
qa: "qa",
|
|
146
|
+
docs: "docs",
|
|
147
|
+
memory: "memory",
|
|
148
|
+
security: "security",
|
|
149
|
+
observability: "observability",
|
|
150
|
+
eval: "eval",
|
|
151
|
+
release: "release",
|
|
152
|
+
// Aliases
|
|
153
|
+
coder: "ace-coders",
|
|
154
|
+
engineer: "ace-coders",
|
|
155
|
+
architect: "spec",
|
|
156
|
+
reviewer: "skeptic",
|
|
157
|
+
tester: "qa",
|
|
158
|
+
};
|
|
159
|
+
export async function bakeTopology(store, _assetsRoot) {
|
|
160
|
+
// 1. Swarm registry
|
|
161
|
+
const swarmEntries = AGENT_DEFINITIONS.map((a) => ({
|
|
162
|
+
kind: "swarm_registry",
|
|
163
|
+
key: a.name,
|
|
164
|
+
value: {
|
|
165
|
+
name: a.name,
|
|
166
|
+
group: a.group,
|
|
167
|
+
objective: a.objective,
|
|
168
|
+
},
|
|
169
|
+
source: ContentSource.Package,
|
|
170
|
+
}));
|
|
171
|
+
await store.setTopology("swarm_registry", swarmEntries);
|
|
172
|
+
// 2. Agent enablement
|
|
173
|
+
const enablementEntries = AGENT_DEFINITIONS.map((a) => ({
|
|
174
|
+
kind: "agent_enablement",
|
|
175
|
+
key: a.name,
|
|
176
|
+
value: { enabled: a.enabled },
|
|
177
|
+
source: ContentSource.Package,
|
|
178
|
+
}));
|
|
179
|
+
await store.setTopology("agent_enablement", enablementEntries);
|
|
180
|
+
// 3. Skill bindings
|
|
181
|
+
const skillEntries = AGENT_DEFINITIONS.map((a) => ({
|
|
182
|
+
kind: "skill_bindings",
|
|
183
|
+
key: a.name,
|
|
184
|
+
value: { skills: a.defaultSkills },
|
|
185
|
+
source: ContentSource.Package,
|
|
186
|
+
}));
|
|
187
|
+
await store.setTopology("skill_bindings", skillEntries);
|
|
188
|
+
// 4. Role routing
|
|
189
|
+
const roleEntries = Object.entries(ROLE_ROUTING).map(([role, agent]) => ({
|
|
190
|
+
kind: "role_routing",
|
|
191
|
+
key: role,
|
|
192
|
+
value: { agent },
|
|
193
|
+
source: ContentSource.Package,
|
|
194
|
+
}));
|
|
195
|
+
await store.setTopology("role_routing", roleEntries);
|
|
196
|
+
console.log(`[topology-bake] ${AGENT_DEFINITIONS.length} agents, ${Object.keys(ROLE_ROUTING).length} role routes`);
|
|
197
|
+
}
|
|
198
|
+
// ── Query helpers ─────────────────────────────────────────────────────────────
|
|
199
|
+
export async function resolveRole(store, role) {
|
|
200
|
+
const entries = await store.getTopology("role_routing");
|
|
201
|
+
const match = entries.find((e) => e.key === role);
|
|
202
|
+
return match ? match.value.agent : undefined;
|
|
203
|
+
}
|
|
204
|
+
export async function getEnabledAgents(store) {
|
|
205
|
+
const entries = await store.getTopology("agent_enablement");
|
|
206
|
+
return entries
|
|
207
|
+
.filter((e) => e.value.enabled)
|
|
208
|
+
.map((e) => e.key);
|
|
209
|
+
}
|
|
210
|
+
export async function getAgentSkills(store, agentName) {
|
|
211
|
+
const entries = await store.getTopology("skill_bindings");
|
|
212
|
+
const match = entries.find((e) => e.key === agentName);
|
|
213
|
+
return match ? match.value.skills : [];
|
|
214
|
+
}
|
|
215
|
+
//# sourceMappingURL=topology-bake.js.map
|