@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,242 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* bootstrap-store.ts — Phase 8
|
|
3
|
+
*
|
|
4
|
+
* New bootstrapAceWorkspace() using the Zarrita-backed store.
|
|
5
|
+
*
|
|
6
|
+
* Replaces the old copyTree()-based bootstrap with:
|
|
7
|
+
* 1. Create minimal directories
|
|
8
|
+
* 2. Initialize AcePackedStore at .agents/ACE/ace-state.zarr
|
|
9
|
+
* 3. Bake core knowledge (agents, modules, kernel)
|
|
10
|
+
* 4. Write topology records
|
|
11
|
+
* 5. Write initial runtime state seeds
|
|
12
|
+
* 6. Write meta (codebooks, schema version)
|
|
13
|
+
* 7. Compact the store
|
|
14
|
+
* 8. Optionally materialize host integration files
|
|
15
|
+
* 9. Materialize hook context snapshot
|
|
16
|
+
* 10. Write tasks/todo.md starter
|
|
17
|
+
*/
|
|
18
|
+
import { mkdirSync, existsSync } from "fs";
|
|
19
|
+
import { join, dirname, resolve } from "path";
|
|
20
|
+
import { fileURLToPath } from "url";
|
|
21
|
+
import { openStore } from "./ace-packed-store.js";
|
|
22
|
+
import { bakeAllCoreKnowledge } from "./knowledge-bake.js";
|
|
23
|
+
import { bakeTopology } from "./topology-bake.js";
|
|
24
|
+
import { buildCatalog } from "./catalog-builder.js";
|
|
25
|
+
import { HookContextMaterializer } from "./materializers/hook-context-materializer.js";
|
|
26
|
+
import { HostFileMaterializer } from "./materializers/host-file-materializer.js";
|
|
27
|
+
import { TodoSyncer } from "./materializers/todo-syncer.js";
|
|
28
|
+
import { OPERATIONAL_ARTIFACT_REL_PATHS, operationalArtifactKey, } from "./store-artifacts.js";
|
|
29
|
+
import { STORE_VERSION } from "./types.js";
|
|
30
|
+
import { DEFAULT_LLAMA_CPP_MODEL, DEFAULT_OLLAMA_MODEL, } from "../tui/provider-discovery.js";
|
|
31
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
32
|
+
function getAssetsRoot() {
|
|
33
|
+
// Resolve relative to this file's location in the installed package
|
|
34
|
+
const candidate = resolve(__dirname, "..", "..", "assets");
|
|
35
|
+
if (existsSync(candidate))
|
|
36
|
+
return candidate;
|
|
37
|
+
// Fallback for dev (dist/store/ → ../../assets/)
|
|
38
|
+
return resolve(__dirname, "..", "..", "..", "assets");
|
|
39
|
+
}
|
|
40
|
+
async function applyLlmRuntimeConfig(store, opts) {
|
|
41
|
+
if (!opts.llm)
|
|
42
|
+
return;
|
|
43
|
+
const configuredModel = opts.model ?? (opts.llm === "llama.cpp" ? DEFAULT_LLAMA_CPP_MODEL : DEFAULT_OLLAMA_MODEL);
|
|
44
|
+
const profilePayload = {
|
|
45
|
+
provider: opts.llm,
|
|
46
|
+
model: configuredModel,
|
|
47
|
+
generated_at: new Date().toISOString(),
|
|
48
|
+
};
|
|
49
|
+
if (opts.ollamaUrl) {
|
|
50
|
+
profilePayload.base_url = opts.ollamaUrl;
|
|
51
|
+
if (opts.llm === "ollama") {
|
|
52
|
+
profilePayload.api_compat_base_url = opts.ollamaUrl.endsWith("/v1")
|
|
53
|
+
? opts.ollamaUrl
|
|
54
|
+
: `${opts.ollamaUrl}/v1`;
|
|
55
|
+
profilePayload.default_api_key = "ollama";
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
await store.setJSON("state/runtime/llm_profile", profilePayload);
|
|
59
|
+
const doctorCommands = opts.llm === "ollama"
|
|
60
|
+
? [
|
|
61
|
+
"ollama serve",
|
|
62
|
+
`ollama pull ${configuredModel}`,
|
|
63
|
+
...(opts.ollamaUrl ? [`curl -s ${opts.ollamaUrl}/api/tags`] : []),
|
|
64
|
+
]
|
|
65
|
+
: [
|
|
66
|
+
"# Start llama-server separately, for example:",
|
|
67
|
+
"# llama-server -m /path/to/model.gguf --port 8080",
|
|
68
|
+
...(opts.ollamaUrl
|
|
69
|
+
? [`curl -s ${opts.ollamaUrl.endsWith("/v1") ? opts.ollamaUrl : `${opts.ollamaUrl}/v1`}/models`]
|
|
70
|
+
: []),
|
|
71
|
+
];
|
|
72
|
+
await store.setBlob("state/runtime/doctor_checks.md", [
|
|
73
|
+
`# ACE + ${opts.llm} Doctor Checks`,
|
|
74
|
+
"",
|
|
75
|
+
"Run these commands to verify local-model readiness:",
|
|
76
|
+
"",
|
|
77
|
+
"```bash",
|
|
78
|
+
...doctorCommands,
|
|
79
|
+
opts.ollamaUrl
|
|
80
|
+
? `ace doctor --llm ${opts.llm} --model ${configuredModel} --base-url ${opts.ollamaUrl}`
|
|
81
|
+
: `ace doctor --llm ${opts.llm} --model ${configuredModel} --scan`,
|
|
82
|
+
"```",
|
|
83
|
+
"",
|
|
84
|
+
].join("\n"));
|
|
85
|
+
}
|
|
86
|
+
async function materializeStoreSurfaces(store, workspaceRoot, opts) {
|
|
87
|
+
const materialized = [];
|
|
88
|
+
await store.setJSON("meta/host_materialization", {
|
|
89
|
+
include_mcp_config: opts.includeMcpConfig ?? false,
|
|
90
|
+
include_client_config_bundle: opts.includeClientConfigBundle ?? false,
|
|
91
|
+
});
|
|
92
|
+
await applyLlmRuntimeConfig(store, opts);
|
|
93
|
+
const hostMat = new HostFileMaterializer(store, workspaceRoot);
|
|
94
|
+
await hostMat.seedStorePayload();
|
|
95
|
+
if ((opts.includeMcpConfig ?? false) || (opts.includeClientConfigBundle ?? false)) {
|
|
96
|
+
materialized.push(...(await hostMat.materializeAll({
|
|
97
|
+
mcpServerPath: opts.mcpServerPath,
|
|
98
|
+
includeMcpConfig: opts.includeMcpConfig ?? false,
|
|
99
|
+
includeClientConfigBundle: opts.includeClientConfigBundle ?? false,
|
|
100
|
+
})));
|
|
101
|
+
}
|
|
102
|
+
const hookCtx = new HookContextMaterializer(store, workspaceRoot);
|
|
103
|
+
await hookCtx.materialize();
|
|
104
|
+
materialized.push(join(workspaceRoot, ".agents", "ACE", "ace-hook-context.json"));
|
|
105
|
+
const todoSyncer = new TodoSyncer(store, workspaceRoot);
|
|
106
|
+
await todoSyncer.initStarter();
|
|
107
|
+
materialized.push(join(workspaceRoot, ".agents", "ACE", "tasks", "todo.md"));
|
|
108
|
+
await store.commit();
|
|
109
|
+
return [...new Set(materialized)];
|
|
110
|
+
}
|
|
111
|
+
async function seedOperationalArtifacts(store) {
|
|
112
|
+
for (const relPath of OPERATIONAL_ARTIFACT_REL_PATHS) {
|
|
113
|
+
const knowledgeKey = `knowledge/agent-state/${relPath.replace(/^agent-state\//, "")}`;
|
|
114
|
+
const content = relPath.endsWith("-archive.ndjson")
|
|
115
|
+
? ""
|
|
116
|
+
: (await store.getBlob(knowledgeKey)) ?? "";
|
|
117
|
+
await store.setBlob(operationalArtifactKey(relPath), content);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
export async function bootstrapStoreWorkspace(opts) {
|
|
121
|
+
const { workspaceRoot, force = false } = opts;
|
|
122
|
+
const warnings = [];
|
|
123
|
+
const materialized = [];
|
|
124
|
+
const storePath = join(workspaceRoot, ".agents", "ACE", "ace-state.zarr");
|
|
125
|
+
if (existsSync(storePath) && !force) {
|
|
126
|
+
if (!(opts.includeMcpConfig ?? false) && !(opts.includeClientConfigBundle ?? false) && !opts.llm) {
|
|
127
|
+
warnings.push(`Store already exists at ${storePath}. Use --force to reinitialize, or run 'ace migrate' to import existing state.`);
|
|
128
|
+
return { storePath, agents: 0, modules: { gates: 0, roles: 0, schemas: 0 }, materialized, warnings };
|
|
129
|
+
}
|
|
130
|
+
const existingStore = await openStore(storePath);
|
|
131
|
+
try {
|
|
132
|
+
await seedOperationalArtifacts(existingStore);
|
|
133
|
+
materialized.push(...(await materializeStoreSurfaces(existingStore, workspaceRoot, opts)));
|
|
134
|
+
const agents = (await existingStore.listAgents()).length;
|
|
135
|
+
warnings.push(`Reused existing store at ${storePath} and refreshed host materializations.`);
|
|
136
|
+
return { storePath, agents, modules: { gates: 0, roles: 0, schemas: 0 }, materialized, warnings };
|
|
137
|
+
}
|
|
138
|
+
finally {
|
|
139
|
+
await existingStore.close();
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
// 1. Create minimal directories under .agents/ACE/ (canonical ACE namespace)
|
|
143
|
+
for (const dir of [
|
|
144
|
+
join(workspaceRoot, ".agents", "ACE"),
|
|
145
|
+
join(workspaceRoot, ".agents", "ACE", "tasks"),
|
|
146
|
+
]) {
|
|
147
|
+
mkdirSync(dir, { recursive: true });
|
|
148
|
+
}
|
|
149
|
+
// 2. Initialize store
|
|
150
|
+
const store = await openStore(storePath);
|
|
151
|
+
try {
|
|
152
|
+
// 3. Write meta
|
|
153
|
+
await store.setJSON("meta/schema_version", STORE_VERSION);
|
|
154
|
+
await store.setJSON("meta/created_at", Date.now());
|
|
155
|
+
await store.setJSON("meta/project_name", opts.projectName ?? "ACE Workspace");
|
|
156
|
+
await store.setJSON("meta/host_materialization", {
|
|
157
|
+
include_mcp_config: opts.includeMcpConfig ?? false,
|
|
158
|
+
include_client_config_bundle: opts.includeClientConfigBundle ?? false,
|
|
159
|
+
});
|
|
160
|
+
// 4. Bake core knowledge
|
|
161
|
+
const assetsRoot = getAssetsRoot();
|
|
162
|
+
const knowledge = await bakeAllCoreKnowledge(store, assetsRoot);
|
|
163
|
+
// 5. Write topology
|
|
164
|
+
await bakeTopology(store, assetsRoot);
|
|
165
|
+
// 6. Write initial empty runtime seeds
|
|
166
|
+
await store.setJSON("state/handoffs/__index", []);
|
|
167
|
+
await store.setJSON("state/todo/index", []);
|
|
168
|
+
await store.setJSON("state/ledger/seq", 0);
|
|
169
|
+
await store.setJSON("state/scheduler/queue", []);
|
|
170
|
+
await store.setJSON("state/scheduler/locks", []);
|
|
171
|
+
await store.setJSON("state/runtime/sessions/index", []);
|
|
172
|
+
await store.setJSON("state/discovery/index", []);
|
|
173
|
+
await store.setJSON("state/vericify/posts/index", []);
|
|
174
|
+
await applyLlmRuntimeConfig(store, opts);
|
|
175
|
+
await seedOperationalArtifacts(store);
|
|
176
|
+
// 7. Build catalog
|
|
177
|
+
await buildCatalog(store);
|
|
178
|
+
// 8. Commit + compact
|
|
179
|
+
await store.commit();
|
|
180
|
+
await store.compact();
|
|
181
|
+
materialized.push(...(await materializeStoreSurfaces(store, workspaceRoot, opts)));
|
|
182
|
+
const agents = (await store.listAgents()).length;
|
|
183
|
+
return {
|
|
184
|
+
storePath,
|
|
185
|
+
agents,
|
|
186
|
+
modules: knowledge.modules,
|
|
187
|
+
materialized,
|
|
188
|
+
warnings,
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
finally {
|
|
192
|
+
await store.close();
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
// ── ace repair ────────────────────────────────────────────────────────────────
|
|
196
|
+
export async function repairWorkspace(workspaceRoot) {
|
|
197
|
+
const storePath = join(workspaceRoot, ".agents", "ACE", "ace-state.zarr");
|
|
198
|
+
if (!existsSync(storePath)) {
|
|
199
|
+
return [`No store found at ${storePath}. Run 'ace init' first.`];
|
|
200
|
+
}
|
|
201
|
+
const warnings = [];
|
|
202
|
+
const store = await openStore(storePath);
|
|
203
|
+
try {
|
|
204
|
+
const hostPolicy = (await store.getJSON("meta/host_materialization")) ?? {};
|
|
205
|
+
// Re-materialize host files
|
|
206
|
+
const hostMat = new HostFileMaterializer(store, workspaceRoot);
|
|
207
|
+
await hostMat.materializeAll({
|
|
208
|
+
includeMcpConfig: hostPolicy.include_mcp_config ?? false,
|
|
209
|
+
includeClientConfigBundle: hostPolicy.include_client_config_bundle ?? false,
|
|
210
|
+
});
|
|
211
|
+
// Re-materialize hook context
|
|
212
|
+
const hookCtx = new HookContextMaterializer(store, workspaceRoot);
|
|
213
|
+
await hookCtx.materialize();
|
|
214
|
+
await store.commit();
|
|
215
|
+
}
|
|
216
|
+
catch (e) {
|
|
217
|
+
warnings.push(`repair error: ${e.message}`);
|
|
218
|
+
}
|
|
219
|
+
finally {
|
|
220
|
+
await store.close();
|
|
221
|
+
}
|
|
222
|
+
return warnings;
|
|
223
|
+
}
|
|
224
|
+
// ── ace compact ───────────────────────────────────────────────────────────────
|
|
225
|
+
export async function compactWorkspace(workspaceRoot) {
|
|
226
|
+
const storePath = join(workspaceRoot, ".agents", "ACE", "ace-state.zarr");
|
|
227
|
+
if (!existsSync(storePath)) {
|
|
228
|
+
throw new Error(`No store found at ${storePath}. Run 'ace init' first.`);
|
|
229
|
+
}
|
|
230
|
+
const { statSync } = await import("fs");
|
|
231
|
+
const before = statSync(storePath).size;
|
|
232
|
+
const store = await openStore(storePath);
|
|
233
|
+
try {
|
|
234
|
+
await store.compact();
|
|
235
|
+
}
|
|
236
|
+
finally {
|
|
237
|
+
await store.close();
|
|
238
|
+
}
|
|
239
|
+
const after = statSync(storePath).size;
|
|
240
|
+
return { before, after };
|
|
241
|
+
}
|
|
242
|
+
//# sourceMappingURL=bootstrap-store.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* catalog-builder.ts
|
|
3
|
+
*
|
|
4
|
+
* Builds catalog_entry records after knowledge and topology are baked.
|
|
5
|
+
* Provides a queryable index of what's available in the store.
|
|
6
|
+
*/
|
|
7
|
+
import { AcePackedStore } from "./ace-packed-store.js";
|
|
8
|
+
export interface CatalogEntry {
|
|
9
|
+
kind: "agent" | "skill" | "gate" | "role" | "schema" | "kernel";
|
|
10
|
+
name: string;
|
|
11
|
+
group?: string;
|
|
12
|
+
files?: string[];
|
|
13
|
+
skills?: string[];
|
|
14
|
+
description?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function buildCatalog(store: AcePackedStore): Promise<CatalogEntry[]>;
|
|
17
|
+
export declare function queryCatalog(store: AcePackedStore, filter?: {
|
|
18
|
+
kind?: CatalogEntry["kind"];
|
|
19
|
+
group?: string;
|
|
20
|
+
}): Promise<CatalogEntry[]>;
|
|
21
|
+
//# sourceMappingURL=catalog-builder.d.ts.map
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* catalog-builder.ts
|
|
3
|
+
*
|
|
4
|
+
* Builds catalog_entry records after knowledge and topology are baked.
|
|
5
|
+
* Provides a queryable index of what's available in the store.
|
|
6
|
+
*/
|
|
7
|
+
import { ContentSource, EntityKind } from "./types.js";
|
|
8
|
+
export async function buildCatalog(store) {
|
|
9
|
+
const catalog = [];
|
|
10
|
+
// Agents
|
|
11
|
+
const agents = await store.listAgents();
|
|
12
|
+
const swarmRegistry = await store.getTopology("swarm_registry");
|
|
13
|
+
const skillBindings = await store.getTopology("skill_bindings");
|
|
14
|
+
for (const agentName of agents) {
|
|
15
|
+
const registryEntry = swarmRegistry.find((e) => e.key === agentName);
|
|
16
|
+
const skillsEntry = skillBindings.find((e) => e.key === agentName);
|
|
17
|
+
catalog.push({
|
|
18
|
+
kind: "agent",
|
|
19
|
+
name: agentName,
|
|
20
|
+
group: registryEntry ? registryEntry.value.group : undefined,
|
|
21
|
+
description: registryEntry ? registryEntry.value.objective : undefined,
|
|
22
|
+
skills: skillsEntry ? skillsEntry.value.skills : [],
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
// Skills
|
|
26
|
+
const skills = await store.listSkills();
|
|
27
|
+
for (const skillName of skills) {
|
|
28
|
+
catalog.push({ kind: "skill", name: skillName });
|
|
29
|
+
}
|
|
30
|
+
// Gates
|
|
31
|
+
for (const key of collectKeysByPrefix(store, "knowledge/gates/")) {
|
|
32
|
+
catalog.push({ kind: "gate", name: key.split("/").pop() });
|
|
33
|
+
}
|
|
34
|
+
// Write catalog to store
|
|
35
|
+
const catalogKey = "knowledge/catalog";
|
|
36
|
+
await store.setJSON(catalogKey, catalog);
|
|
37
|
+
await store.appendEntry({
|
|
38
|
+
kind: EntityKind.CatalogEntry,
|
|
39
|
+
content_source: ContentSource.Package,
|
|
40
|
+
key: catalogKey,
|
|
41
|
+
payload: { count: catalog.length },
|
|
42
|
+
});
|
|
43
|
+
console.log(`[catalog-builder] ${catalog.length} catalog entries written`);
|
|
44
|
+
return catalog;
|
|
45
|
+
}
|
|
46
|
+
function collectKeysByPrefix(store, prefix) {
|
|
47
|
+
// Access internal index synchronously — only call after store is opened
|
|
48
|
+
const keys = [];
|
|
49
|
+
// @ts-ignore — accessing private index for catalog building
|
|
50
|
+
for (const key of store["index"].keys()) {
|
|
51
|
+
if (key.startsWith(prefix))
|
|
52
|
+
keys.push(key);
|
|
53
|
+
}
|
|
54
|
+
return keys;
|
|
55
|
+
}
|
|
56
|
+
export async function queryCatalog(store, filter) {
|
|
57
|
+
const catalog = await store.getJSON("knowledge/catalog");
|
|
58
|
+
if (!catalog)
|
|
59
|
+
return [];
|
|
60
|
+
return catalog.filter((entry) => {
|
|
61
|
+
if (filter?.kind && entry.kind !== filter.kind)
|
|
62
|
+
return false;
|
|
63
|
+
if (filter?.group && entry.group !== filter.group)
|
|
64
|
+
return false;
|
|
65
|
+
return true;
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=catalog-builder.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Importer — Phase 7
|
|
3
|
+
*
|
|
4
|
+
* Reads all current files from an existing ACE workspace and creates a new
|
|
5
|
+
* ace-state.zarr with all content properly categorized.
|
|
6
|
+
*
|
|
7
|
+
* Used by `ace migrate` CLI command for one-time migration from file-backed
|
|
8
|
+
* workspaces to the Zarrita-backed store.
|
|
9
|
+
*/
|
|
10
|
+
export interface ImportResult {
|
|
11
|
+
handoffs: number;
|
|
12
|
+
todos: number;
|
|
13
|
+
ledger_events: number;
|
|
14
|
+
status_events: number;
|
|
15
|
+
vericify_posts: number;
|
|
16
|
+
warnings: string[];
|
|
17
|
+
}
|
|
18
|
+
export declare function importFromFileWorkspace(workspaceRoot: string, storePath: string): Promise<ImportResult>;
|
|
19
|
+
//# sourceMappingURL=importer.d.ts.map
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Importer — Phase 7
|
|
3
|
+
*
|
|
4
|
+
* Reads all current files from an existing ACE workspace and creates a new
|
|
5
|
+
* ace-state.zarr with all content properly categorized.
|
|
6
|
+
*
|
|
7
|
+
* Used by `ace migrate` CLI command for one-time migration from file-backed
|
|
8
|
+
* workspaces to the Zarrita-backed store.
|
|
9
|
+
*/
|
|
10
|
+
import { existsSync, readFileSync } from "fs";
|
|
11
|
+
import { join } from "path";
|
|
12
|
+
import { openStore } from "./ace-packed-store.js";
|
|
13
|
+
import { HandoffRepository } from "./repositories/handoff-repository.js";
|
|
14
|
+
import { TodoRepository } from "./repositories/todo-repository.js";
|
|
15
|
+
import { LedgerRepository } from "./repositories/ledger-repository.js";
|
|
16
|
+
import { TrackerRepository } from "./repositories/tracker-repository.js";
|
|
17
|
+
import { VericifyRepository } from "./repositories/vericify-repository.js";
|
|
18
|
+
function readJSON(path) {
|
|
19
|
+
if (!existsSync(path))
|
|
20
|
+
return undefined;
|
|
21
|
+
try {
|
|
22
|
+
return JSON.parse(readFileSync(path, "utf8"));
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function readText(path) {
|
|
29
|
+
if (!existsSync(path))
|
|
30
|
+
return undefined;
|
|
31
|
+
try {
|
|
32
|
+
return readFileSync(path, "utf8");
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export async function importFromFileWorkspace(workspaceRoot, storePath) {
|
|
39
|
+
const result = {
|
|
40
|
+
handoffs: 0,
|
|
41
|
+
todos: 0,
|
|
42
|
+
ledger_events: 0,
|
|
43
|
+
status_events: 0,
|
|
44
|
+
vericify_posts: 0,
|
|
45
|
+
warnings: [],
|
|
46
|
+
};
|
|
47
|
+
const store = await openStore(storePath);
|
|
48
|
+
try {
|
|
49
|
+
const handoffRepo = new HandoffRepository(store);
|
|
50
|
+
const todoRepo = new TodoRepository(store);
|
|
51
|
+
const ledgerRepo = new LedgerRepository(store);
|
|
52
|
+
const trackerRepo = new TrackerRepository(store);
|
|
53
|
+
const vericifyRepo = new VericifyRepository(store);
|
|
54
|
+
await ledgerRepo.init();
|
|
55
|
+
// ── Handoffs ──────────────────────────────────────────────────────────
|
|
56
|
+
const handoffReg = readJSON(join(workspaceRoot, "agent-state", "handoff-registry.json"));
|
|
57
|
+
if (handoffReg?.handoffs) {
|
|
58
|
+
for (const [id, data] of Object.entries(handoffReg.handoffs)) {
|
|
59
|
+
try {
|
|
60
|
+
const h = data;
|
|
61
|
+
await handoffRepo.create({
|
|
62
|
+
id,
|
|
63
|
+
from_agent: String(h.from_agent ?? h.from ?? "unknown"),
|
|
64
|
+
to_agent: String(h.to_agent ?? h.to ?? "unknown"),
|
|
65
|
+
status: h.status ?? "pending",
|
|
66
|
+
summary: String(h.summary ?? h.task ?? ""),
|
|
67
|
+
task: h.task ? String(h.task) : undefined,
|
|
68
|
+
});
|
|
69
|
+
result.handoffs++;
|
|
70
|
+
}
|
|
71
|
+
catch (e) {
|
|
72
|
+
result.warnings.push(`handoff ${id}: ${e.message}`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
// ── Todos ─────────────────────────────────────────────────────────────
|
|
77
|
+
const todoState = readJSON(join(workspaceRoot, "agent-state", "todo-state.json"));
|
|
78
|
+
if (todoState?.todos) {
|
|
79
|
+
for (const item of todoState.todos) {
|
|
80
|
+
try {
|
|
81
|
+
await todoRepo.create({
|
|
82
|
+
id: String(item.id),
|
|
83
|
+
title: String(item.title ?? item.content ?? ""),
|
|
84
|
+
status: item.status ?? "pending",
|
|
85
|
+
priority: item.priority,
|
|
86
|
+
assigned_to: item.assigned_to ? String(item.assigned_to) : undefined,
|
|
87
|
+
});
|
|
88
|
+
result.todos++;
|
|
89
|
+
}
|
|
90
|
+
catch (e) {
|
|
91
|
+
result.warnings.push(`todo ${item.id}: ${e.message}`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
// ── Run Ledger ────────────────────────────────────────────────────────
|
|
96
|
+
const ledger = readJSON(join(workspaceRoot, "agent-state", "run-ledger.json"));
|
|
97
|
+
if (ledger?.events) {
|
|
98
|
+
for (const ev of ledger.events) {
|
|
99
|
+
try {
|
|
100
|
+
await ledgerRepo.append({
|
|
101
|
+
kind: ev.kind ?? "note",
|
|
102
|
+
summary: String(ev.summary ?? ev.message ?? ""),
|
|
103
|
+
agent: ev.agent ? String(ev.agent) : undefined,
|
|
104
|
+
});
|
|
105
|
+
result.ledger_events++;
|
|
106
|
+
}
|
|
107
|
+
catch (e) {
|
|
108
|
+
result.warnings.push(`ledger event: ${e.message}`);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
// ── Status Events (NDJSON) ────────────────────────────────────────────
|
|
113
|
+
const ndjsonPath = join(workspaceRoot, "agent-state", "STATUS_EVENTS.ndjson");
|
|
114
|
+
const ndjsonContent = readText(ndjsonPath);
|
|
115
|
+
if (ndjsonContent) {
|
|
116
|
+
for (const line of ndjsonContent.split("\n").filter(Boolean)) {
|
|
117
|
+
try {
|
|
118
|
+
const ev = JSON.parse(line);
|
|
119
|
+
await trackerRepo.emit({
|
|
120
|
+
kind: String(ev.kind ?? ev.type ?? "note"),
|
|
121
|
+
summary: String(ev.summary ?? ev.message ?? ""),
|
|
122
|
+
agent: ev.agent ? String(ev.agent) : undefined,
|
|
123
|
+
});
|
|
124
|
+
result.status_events++;
|
|
125
|
+
}
|
|
126
|
+
catch (e) {
|
|
127
|
+
result.warnings.push(`status event: ${e.message}`);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
// ── Vericify Posts ────────────────────────────────────────────────────
|
|
132
|
+
const postsFile = readJSON(join(workspaceRoot, "agent-state", "vericify", "process-posts.json"));
|
|
133
|
+
if (postsFile?.posts) {
|
|
134
|
+
for (const post of postsFile.posts) {
|
|
135
|
+
try {
|
|
136
|
+
await vericifyRepo.appendPost({
|
|
137
|
+
run_id: String(post.run_id ?? "migrated"),
|
|
138
|
+
agent_id: String(post.agent_id ?? "unknown"),
|
|
139
|
+
kind: post.kind ?? "completion",
|
|
140
|
+
summary: String(post.summary ?? ""),
|
|
141
|
+
});
|
|
142
|
+
result.vericify_posts++;
|
|
143
|
+
}
|
|
144
|
+
catch (e) {
|
|
145
|
+
result.warnings.push(`vericify post: ${e.message}`);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
await store.commit();
|
|
150
|
+
await store.compact();
|
|
151
|
+
}
|
|
152
|
+
finally {
|
|
153
|
+
await store.close();
|
|
154
|
+
}
|
|
155
|
+
return result;
|
|
156
|
+
}
|
|
157
|
+
//# sourceMappingURL=importer.js.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* knowledge-bake.ts
|
|
3
|
+
*
|
|
4
|
+
* Reads core assets from the npm package (assets/) and writes them into an
|
|
5
|
+
* open AcePackedStore. Called once at `ace init` time.
|
|
6
|
+
*
|
|
7
|
+
* Baked categories:
|
|
8
|
+
* - Agent instructions (17 agents: 4 swarm + 13 composable)
|
|
9
|
+
* - Module definitions (gates, roles, schemas)
|
|
10
|
+
* - Kernel artifacts (DIRECTIVE_KERNEL, AGENT_REGISTRY)
|
|
11
|
+
* - Static ACE state artifacts (TASK, STATUS, TEAL_CONFIG, runtime registries, etc.)
|
|
12
|
+
* - Task artifacts (role packs, handoff templates, lessons seed, todo seed)
|
|
13
|
+
* - Runtime profile seed (ACE_WORKFLOW.md)
|
|
14
|
+
* - Skills (baked at init so the store is authoritative)
|
|
15
|
+
* - Hook/bootstrap scripts used by turnkey materialization
|
|
16
|
+
*/
|
|
17
|
+
import { AcePackedStore } from "./ace-packed-store.js";
|
|
18
|
+
export declare function bakeAgentInstructions(store: AcePackedStore, assetsRoot: string): Promise<{
|
|
19
|
+
agents: string[];
|
|
20
|
+
files: number;
|
|
21
|
+
}>;
|
|
22
|
+
export declare function bakeModules(store: AcePackedStore, assetsRoot: string): Promise<{
|
|
23
|
+
gates: number;
|
|
24
|
+
roles: number;
|
|
25
|
+
schemas: number;
|
|
26
|
+
}>;
|
|
27
|
+
export declare function bakeStaticStateArtifacts(store: AcePackedStore, assetsRoot: string): Promise<number>;
|
|
28
|
+
export declare function bakeScripts(store: AcePackedStore, assetsRoot: string): Promise<number>;
|
|
29
|
+
export declare function bakeTaskArtifacts(store: AcePackedStore, assetsRoot: string): Promise<{
|
|
30
|
+
state: number;
|
|
31
|
+
tasks: number;
|
|
32
|
+
runtime: number;
|
|
33
|
+
}>;
|
|
34
|
+
export declare function bakeSkillPack(store: AcePackedStore, assetsRoot: string, skillName: string): Promise<number>;
|
|
35
|
+
export declare function listAvailableSkills(assetsRoot: string): Promise<string[]>;
|
|
36
|
+
export declare function bakeAllCoreKnowledge(store: AcePackedStore, assetsRoot: string): Promise<{
|
|
37
|
+
agents: {
|
|
38
|
+
agents: string[];
|
|
39
|
+
files: number;
|
|
40
|
+
};
|
|
41
|
+
modules: {
|
|
42
|
+
gates: number;
|
|
43
|
+
roles: number;
|
|
44
|
+
schemas: number;
|
|
45
|
+
};
|
|
46
|
+
taskArtifacts: {
|
|
47
|
+
state: number;
|
|
48
|
+
tasks: number;
|
|
49
|
+
runtime: number;
|
|
50
|
+
};
|
|
51
|
+
skills: {
|
|
52
|
+
count: number;
|
|
53
|
+
files: number;
|
|
54
|
+
};
|
|
55
|
+
scripts: {
|
|
56
|
+
count: number;
|
|
57
|
+
};
|
|
58
|
+
}>;
|
|
59
|
+
//# sourceMappingURL=knowledge-bake.d.ts.map
|