@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,422 @@
|
|
|
1
|
+
import { resolveWorkspaceRoot, safeRead, safeWrite, wsPath, withFileLock } from "./helpers.js";
|
|
2
|
+
import { isReadError } from "./shared.js";
|
|
3
|
+
import { openStore } from "./store/ace-packed-store.js";
|
|
4
|
+
import { VericifyProjector } from "./store/materializers/vericify-projector.js";
|
|
5
|
+
import { HandoffRepository } from "./store/repositories/handoff-repository.js";
|
|
6
|
+
import { getWorkspaceStorePath, listStoreKeysSync, readStoreJsonSync, storeExistsSync, } from "./store/store-snapshot.js";
|
|
7
|
+
import { withStoreWriteQueue } from "./store/write-queue.js";
|
|
8
|
+
const HANDOFF_REGISTRY_REL = "agent-state/handoff-registry.json";
|
|
9
|
+
function workspaceRoot() {
|
|
10
|
+
return resolveWorkspaceRoot();
|
|
11
|
+
}
|
|
12
|
+
const TRANSITIONS = {
|
|
13
|
+
open: ["accepted", "blocked"],
|
|
14
|
+
accepted: ["blocked", "completed"],
|
|
15
|
+
blocked: ["accepted", "completed"],
|
|
16
|
+
completed: ["blocked"],
|
|
17
|
+
};
|
|
18
|
+
function defaultRegistry() {
|
|
19
|
+
const now = new Date().toISOString();
|
|
20
|
+
return {
|
|
21
|
+
version: 1,
|
|
22
|
+
updated_at: now,
|
|
23
|
+
handoffs: {},
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function parseRegistry(raw) {
|
|
27
|
+
try {
|
|
28
|
+
const parsed = JSON.parse(raw);
|
|
29
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
const candidate = parsed;
|
|
33
|
+
if (candidate.version !== 1 || !candidate.handoffs || typeof candidate.handoffs !== "object") {
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
const handoffs = {};
|
|
37
|
+
for (const [key, value] of Object.entries(candidate.handoffs)) {
|
|
38
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
39
|
+
continue;
|
|
40
|
+
const row = value;
|
|
41
|
+
if (typeof row.handoff_id !== "string" ||
|
|
42
|
+
typeof row.created_at !== "string" ||
|
|
43
|
+
typeof row.updated_at !== "string" ||
|
|
44
|
+
typeof row.from !== "string" ||
|
|
45
|
+
typeof row.to !== "string" ||
|
|
46
|
+
typeof row.title !== "string" ||
|
|
47
|
+
typeof row.status !== "string" ||
|
|
48
|
+
!Array.isArray(row.history)) {
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
const history = row.history.filter((event) => {
|
|
52
|
+
if (!event || typeof event !== "object" || Array.isArray(event))
|
|
53
|
+
return false;
|
|
54
|
+
const e = event;
|
|
55
|
+
return (typeof e.timestamp_utc === "string" &&
|
|
56
|
+
typeof e.status === "string" &&
|
|
57
|
+
typeof e.actor === "string");
|
|
58
|
+
});
|
|
59
|
+
handoffs[key] = {
|
|
60
|
+
handoff_id: row.handoff_id,
|
|
61
|
+
created_at: row.created_at,
|
|
62
|
+
updated_at: row.updated_at,
|
|
63
|
+
from: row.from,
|
|
64
|
+
to: row.to,
|
|
65
|
+
title: row.title,
|
|
66
|
+
task_type: typeof row.task_type === "string" ? row.task_type : undefined,
|
|
67
|
+
priority: typeof row.priority === "string" ? row.priority : undefined,
|
|
68
|
+
source_file: typeof row.source_file === "string" ? row.source_file : undefined,
|
|
69
|
+
status: row.status === "open" ||
|
|
70
|
+
row.status === "accepted" ||
|
|
71
|
+
row.status === "blocked" ||
|
|
72
|
+
row.status === "completed"
|
|
73
|
+
? row.status
|
|
74
|
+
: "open",
|
|
75
|
+
history,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
version: 1,
|
|
80
|
+
updated_at: typeof candidate.updated_at === "string"
|
|
81
|
+
? candidate.updated_at
|
|
82
|
+
: new Date().toISOString(),
|
|
83
|
+
handoffs,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
return undefined;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
function mapLegacyStatusToStore(status) {
|
|
91
|
+
switch (status) {
|
|
92
|
+
case "accepted":
|
|
93
|
+
return "acked";
|
|
94
|
+
case "completed":
|
|
95
|
+
return "closed";
|
|
96
|
+
case "blocked":
|
|
97
|
+
return "blocked";
|
|
98
|
+
default:
|
|
99
|
+
return "pending";
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
function mapStoreStatusToLegacy(status, metadata) {
|
|
103
|
+
if (metadata.legacy_status === "open" ||
|
|
104
|
+
metadata.legacy_status === "accepted" ||
|
|
105
|
+
metadata.legacy_status === "blocked" ||
|
|
106
|
+
metadata.legacy_status === "completed") {
|
|
107
|
+
return metadata.legacy_status;
|
|
108
|
+
}
|
|
109
|
+
switch (status) {
|
|
110
|
+
case "acked":
|
|
111
|
+
case "active":
|
|
112
|
+
return "accepted";
|
|
113
|
+
case "closed":
|
|
114
|
+
return "completed";
|
|
115
|
+
case "blocked":
|
|
116
|
+
return "blocked";
|
|
117
|
+
default:
|
|
118
|
+
return "open";
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
function normalizeHistory(value, fallbackStatus, updatedAt) {
|
|
122
|
+
if (!Array.isArray(value)) {
|
|
123
|
+
return [
|
|
124
|
+
{
|
|
125
|
+
timestamp_utc: updatedAt,
|
|
126
|
+
status: fallbackStatus,
|
|
127
|
+
actor: "store",
|
|
128
|
+
},
|
|
129
|
+
];
|
|
130
|
+
}
|
|
131
|
+
const history = value.filter((event) => {
|
|
132
|
+
if (!event || typeof event !== "object" || Array.isArray(event))
|
|
133
|
+
return false;
|
|
134
|
+
const candidate = event;
|
|
135
|
+
return (typeof candidate.timestamp_utc === "string" &&
|
|
136
|
+
(candidate.status === "open" ||
|
|
137
|
+
candidate.status === "accepted" ||
|
|
138
|
+
candidate.status === "blocked" ||
|
|
139
|
+
candidate.status === "completed") &&
|
|
140
|
+
typeof candidate.actor === "string");
|
|
141
|
+
});
|
|
142
|
+
return history.length > 0
|
|
143
|
+
? history
|
|
144
|
+
: [
|
|
145
|
+
{
|
|
146
|
+
timestamp_utc: updatedAt,
|
|
147
|
+
status: fallbackStatus,
|
|
148
|
+
actor: "store",
|
|
149
|
+
},
|
|
150
|
+
];
|
|
151
|
+
}
|
|
152
|
+
function toLegacyHandoffRecord(record) {
|
|
153
|
+
const metadata = record.metadata && typeof record.metadata === "object" && !Array.isArray(record.metadata)
|
|
154
|
+
? record.metadata
|
|
155
|
+
: {};
|
|
156
|
+
const createdAt = new Date(record.created_at).toISOString();
|
|
157
|
+
const updatedAt = new Date(record.updated_at).toISOString();
|
|
158
|
+
const status = mapStoreStatusToLegacy(record.status, metadata);
|
|
159
|
+
return {
|
|
160
|
+
handoff_id: record.id,
|
|
161
|
+
created_at: createdAt,
|
|
162
|
+
updated_at: updatedAt,
|
|
163
|
+
from: record.from_agent,
|
|
164
|
+
to: record.to_agent,
|
|
165
|
+
title: typeof metadata.title === "string" ? metadata.title : record.summary,
|
|
166
|
+
task_type: typeof metadata.task_type === "string" ? metadata.task_type : record.task,
|
|
167
|
+
priority: typeof metadata.priority === "string" ? metadata.priority : undefined,
|
|
168
|
+
source_file: typeof metadata.source_file === "string" ? metadata.source_file : undefined,
|
|
169
|
+
status,
|
|
170
|
+
history: normalizeHistory(metadata.history, status, updatedAt),
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
function readStoreBackedRegistry() {
|
|
174
|
+
const root = workspaceRoot();
|
|
175
|
+
if (!storeExistsSync(root))
|
|
176
|
+
return undefined;
|
|
177
|
+
const records = listStoreKeysSync(root, "state/handoffs/")
|
|
178
|
+
.map((key) => readStoreJsonSync(root, key))
|
|
179
|
+
.filter((record) => record !== undefined && record !== null && typeof record.id === "string")
|
|
180
|
+
.sort((left, right) => left.created_at - right.created_at);
|
|
181
|
+
const handoffs = Object.fromEntries(records.map((record) => {
|
|
182
|
+
const legacy = toLegacyHandoffRecord(record);
|
|
183
|
+
return [legacy.handoff_id, legacy];
|
|
184
|
+
}));
|
|
185
|
+
return {
|
|
186
|
+
version: 1,
|
|
187
|
+
updated_at: records.length
|
|
188
|
+
? new Date(records[records.length - 1].updated_at).toISOString()
|
|
189
|
+
: new Date().toISOString(),
|
|
190
|
+
handoffs,
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
function writeRegistry(registry) {
|
|
194
|
+
registry.updated_at = new Date().toISOString();
|
|
195
|
+
return safeWrite(HANDOFF_REGISTRY_REL, JSON.stringify(registry, null, 2));
|
|
196
|
+
}
|
|
197
|
+
export function readHandoffRegistry() {
|
|
198
|
+
const storeRegistry = readStoreBackedRegistry();
|
|
199
|
+
if (storeRegistry)
|
|
200
|
+
return storeRegistry;
|
|
201
|
+
const raw = safeRead(HANDOFF_REGISTRY_REL);
|
|
202
|
+
if (isReadError(raw)) {
|
|
203
|
+
return defaultRegistry();
|
|
204
|
+
}
|
|
205
|
+
return parseRegistry(raw) ?? defaultRegistry();
|
|
206
|
+
}
|
|
207
|
+
export function registerHandoff(input) {
|
|
208
|
+
const registry = readHandoffRegistry();
|
|
209
|
+
const now = new Date().toISOString();
|
|
210
|
+
const actor = input.actor ?? "create_handoff";
|
|
211
|
+
const note = input.note ?? "created";
|
|
212
|
+
const existing = registry.handoffs[input.handoff_id];
|
|
213
|
+
if (existing) {
|
|
214
|
+
return {
|
|
215
|
+
record: existing,
|
|
216
|
+
path: wsPath(HANDOFF_REGISTRY_REL),
|
|
217
|
+
duplicate: true,
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
const record = {
|
|
221
|
+
handoff_id: input.handoff_id,
|
|
222
|
+
created_at: now,
|
|
223
|
+
updated_at: now,
|
|
224
|
+
from: input.from,
|
|
225
|
+
to: input.to,
|
|
226
|
+
title: input.title,
|
|
227
|
+
task_type: input.task_type,
|
|
228
|
+
priority: input.priority,
|
|
229
|
+
source_file: input.source_file,
|
|
230
|
+
status: "open",
|
|
231
|
+
history: [
|
|
232
|
+
{
|
|
233
|
+
timestamp_utc: now,
|
|
234
|
+
status: "open",
|
|
235
|
+
actor,
|
|
236
|
+
note,
|
|
237
|
+
},
|
|
238
|
+
],
|
|
239
|
+
};
|
|
240
|
+
registry.handoffs[input.handoff_id] = record;
|
|
241
|
+
const path = writeRegistry(registry);
|
|
242
|
+
return { record, path };
|
|
243
|
+
}
|
|
244
|
+
export function acknowledgeHandoff(input) {
|
|
245
|
+
const registry = readHandoffRegistry();
|
|
246
|
+
const path = wsPath(HANDOFF_REGISTRY_REL);
|
|
247
|
+
const record = registry.handoffs[input.handoff_id];
|
|
248
|
+
if (!record) {
|
|
249
|
+
return {
|
|
250
|
+
ok: false,
|
|
251
|
+
path,
|
|
252
|
+
error: `handoff_id not found: ${input.handoff_id}`,
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
const previous = record.status;
|
|
256
|
+
if (previous !== input.status) {
|
|
257
|
+
const allowed = TRANSITIONS[previous];
|
|
258
|
+
if (!allowed.includes(input.status)) {
|
|
259
|
+
return {
|
|
260
|
+
ok: false,
|
|
261
|
+
path,
|
|
262
|
+
error: `invalid transition: ${previous} -> ${input.status}`,
|
|
263
|
+
allowed,
|
|
264
|
+
previous_status: previous,
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
const now = new Date().toISOString();
|
|
269
|
+
record.status = input.status;
|
|
270
|
+
record.updated_at = now;
|
|
271
|
+
record.history.push({
|
|
272
|
+
timestamp_utc: now,
|
|
273
|
+
status: input.status,
|
|
274
|
+
actor: input.actor ?? "ack_handoff",
|
|
275
|
+
note: input.note,
|
|
276
|
+
});
|
|
277
|
+
const writtenPath = writeRegistry(registry);
|
|
278
|
+
return {
|
|
279
|
+
ok: true,
|
|
280
|
+
path: writtenPath,
|
|
281
|
+
previous_status: previous,
|
|
282
|
+
record,
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
export function getHandoffRegistryPath() {
|
|
286
|
+
return wsPath(HANDOFF_REGISTRY_REL);
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Concurrency-safe variant of registerHandoff.
|
|
290
|
+
*/
|
|
291
|
+
export async function registerHandoffSafe(input) {
|
|
292
|
+
const root = workspaceRoot();
|
|
293
|
+
const storePath = getWorkspaceStorePath(root);
|
|
294
|
+
if (!storeExistsSync(root)) {
|
|
295
|
+
return withFileLock(HANDOFF_REGISTRY_REL, () => registerHandoff(input));
|
|
296
|
+
}
|
|
297
|
+
return withFileLock(HANDOFF_REGISTRY_REL, async () => {
|
|
298
|
+
return withStoreWriteQueue(storePath, async () => {
|
|
299
|
+
const store = await openStore(storePath);
|
|
300
|
+
try {
|
|
301
|
+
const repo = new HandoffRepository(store);
|
|
302
|
+
const existing = await repo.get(input.handoff_id);
|
|
303
|
+
if (existing) {
|
|
304
|
+
return {
|
|
305
|
+
record: toLegacyHandoffRecord(existing),
|
|
306
|
+
path: wsPath(HANDOFF_REGISTRY_REL),
|
|
307
|
+
duplicate: true,
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
const now = new Date().toISOString();
|
|
311
|
+
const record = await repo.create({
|
|
312
|
+
id: input.handoff_id,
|
|
313
|
+
from_agent: input.from,
|
|
314
|
+
to_agent: input.to,
|
|
315
|
+
status: "pending",
|
|
316
|
+
summary: input.title,
|
|
317
|
+
task: input.task_type,
|
|
318
|
+
metadata: {
|
|
319
|
+
legacy_status: "open",
|
|
320
|
+
title: input.title,
|
|
321
|
+
task_type: input.task_type,
|
|
322
|
+
priority: input.priority,
|
|
323
|
+
source_file: input.source_file,
|
|
324
|
+
history: [
|
|
325
|
+
{
|
|
326
|
+
timestamp_utc: now,
|
|
327
|
+
status: "open",
|
|
328
|
+
actor: input.actor ?? "create_handoff",
|
|
329
|
+
note: input.note ?? "created",
|
|
330
|
+
},
|
|
331
|
+
],
|
|
332
|
+
},
|
|
333
|
+
});
|
|
334
|
+
await store.commit();
|
|
335
|
+
const projector = new VericifyProjector(store, root);
|
|
336
|
+
await projector.projectHandoffs();
|
|
337
|
+
await store.commit();
|
|
338
|
+
return {
|
|
339
|
+
record: toLegacyHandoffRecord(record),
|
|
340
|
+
path: wsPath(HANDOFF_REGISTRY_REL),
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
finally {
|
|
344
|
+
await store.close();
|
|
345
|
+
}
|
|
346
|
+
});
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Concurrency-safe variant of acknowledgeHandoff.
|
|
351
|
+
*/
|
|
352
|
+
export async function acknowledgeHandoffSafe(input) {
|
|
353
|
+
const root = workspaceRoot();
|
|
354
|
+
const storePath = getWorkspaceStorePath(root);
|
|
355
|
+
if (!storeExistsSync(root)) {
|
|
356
|
+
return withFileLock(HANDOFF_REGISTRY_REL, () => acknowledgeHandoff(input));
|
|
357
|
+
}
|
|
358
|
+
return withFileLock(HANDOFF_REGISTRY_REL, async () => {
|
|
359
|
+
return withStoreWriteQueue(storePath, async () => {
|
|
360
|
+
const store = await openStore(storePath);
|
|
361
|
+
try {
|
|
362
|
+
const repo = new HandoffRepository(store);
|
|
363
|
+
const current = await repo.get(input.handoff_id);
|
|
364
|
+
const path = wsPath(HANDOFF_REGISTRY_REL);
|
|
365
|
+
if (!current) {
|
|
366
|
+
return {
|
|
367
|
+
ok: false,
|
|
368
|
+
path,
|
|
369
|
+
error: `handoff_id not found: ${input.handoff_id}`,
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
const currentLegacy = toLegacyHandoffRecord(current);
|
|
373
|
+
const previous = currentLegacy.status;
|
|
374
|
+
if (previous !== input.status) {
|
|
375
|
+
const allowed = TRANSITIONS[previous];
|
|
376
|
+
if (!allowed.includes(input.status)) {
|
|
377
|
+
return {
|
|
378
|
+
ok: false,
|
|
379
|
+
path,
|
|
380
|
+
error: `invalid transition: ${previous} -> ${input.status}`,
|
|
381
|
+
allowed,
|
|
382
|
+
previous_status: previous,
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
const metadata = current.metadata && typeof current.metadata === "object" && !Array.isArray(current.metadata)
|
|
387
|
+
? { ...current.metadata }
|
|
388
|
+
: {};
|
|
389
|
+
const now = new Date().toISOString();
|
|
390
|
+
const history = normalizeHistory(metadata.history, previous, currentLegacy.updated_at);
|
|
391
|
+
history.push({
|
|
392
|
+
timestamp_utc: now,
|
|
393
|
+
status: input.status,
|
|
394
|
+
actor: input.actor ?? "ack_handoff",
|
|
395
|
+
note: input.note,
|
|
396
|
+
});
|
|
397
|
+
const updated = await repo.update(input.handoff_id, {
|
|
398
|
+
status: mapLegacyStatusToStore(input.status),
|
|
399
|
+
metadata: {
|
|
400
|
+
...metadata,
|
|
401
|
+
legacy_status: input.status,
|
|
402
|
+
history,
|
|
403
|
+
},
|
|
404
|
+
});
|
|
405
|
+
await store.commit();
|
|
406
|
+
const projector = new VericifyProjector(store, root);
|
|
407
|
+
await projector.projectHandoffs();
|
|
408
|
+
await store.commit();
|
|
409
|
+
return {
|
|
410
|
+
ok: true,
|
|
411
|
+
path,
|
|
412
|
+
previous_status: previous,
|
|
413
|
+
record: toLegacyHandoffRecord(updated),
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
finally {
|
|
417
|
+
await store.close();
|
|
418
|
+
}
|
|
419
|
+
});
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
//# sourceMappingURL=handoff-registry.js.map
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared helpers – path resolution, file I/O, artifact discovery, bootstrap.
|
|
3
|
+
*/
|
|
4
|
+
export { isInside, isReadError, normalizeRelPath, looksLikeSwarmHandoffPath } from "./shared.js";
|
|
5
|
+
export declare const SERVER_ROOT: string;
|
|
6
|
+
export declare const PACKAGE_ROOT: string;
|
|
7
|
+
export declare function resolveWorkspaceRoot(): string;
|
|
8
|
+
export declare const WORKSPACE_ROOT: string;
|
|
9
|
+
export declare const DEFAULTS_ROOT: string;
|
|
10
|
+
export declare const ACE_ROOT_REL = ".agents/ACE";
|
|
11
|
+
export declare const ACE_SKILLS_ROOT_REL = ".agents/ACE/skills";
|
|
12
|
+
export declare const ACE_TASKS_ROOT_REL = ".agents/ACE/tasks";
|
|
13
|
+
export declare const ACE_SCRIPTS_ROOT_REL = ".agents/ACE/scripts/ace";
|
|
14
|
+
export declare const ACE_BUNDLE_ROOT_REL = ".mcp-config";
|
|
15
|
+
export declare const ACE_LLM_ROOT_REL = ".agents/ACE/.ace";
|
|
16
|
+
export declare const ACE_VSCODE_ROOT_REL = ".vscode";
|
|
17
|
+
export declare const ACE_CURSOR_ROOT_REL = ".cursor";
|
|
18
|
+
export declare const ACE_CLAUDE_ROOT_REL = ".claude";
|
|
19
|
+
export declare const ACE_GITHUB_ROOT_REL = ".github";
|
|
20
|
+
export declare const ACE_HOST_AGENTS_REL = "AGENTS.md";
|
|
21
|
+
export declare const ACE_HOST_CLAUDE_REL = "CLAUDE.md";
|
|
22
|
+
export declare const ACE_HOST_CURSOR_RULES_REL = ".cursorrules";
|
|
23
|
+
export declare const ALL_MCP_CLIENTS: readonly ["codex", "vscode", "claude", "cursor", "antigravity"];
|
|
24
|
+
export type McpClient = (typeof ALL_MCP_CLIENTS)[number];
|
|
25
|
+
export declare const ALL_LLM_PROVIDERS: readonly ["ollama", "llama.cpp"];
|
|
26
|
+
export type LlmProvider = (typeof ALL_LLM_PROVIDERS)[number];
|
|
27
|
+
export declare const ALL_AGENTS: readonly ["orchestrator", "vos", "ui", "coders", "astgrep", "skeptic", "ops", "research", "spec", "builder", "qa", "docs", "memory", "security", "observability", "eval", "release"];
|
|
28
|
+
export type AgentRole = (typeof ALL_AGENTS)[number];
|
|
29
|
+
export declare const SWARM_AGENTS: readonly ["orchestrator", "vos", "ui", "coders"];
|
|
30
|
+
export type SwarmAgentRole = (typeof SWARM_AGENTS)[number];
|
|
31
|
+
export declare const COMPOSABLE_AGENTS: readonly ["astgrep", "skeptic", "ops", "research", "spec", "builder", "qa", "docs", "memory", "security", "observability", "eval", "release"];
|
|
32
|
+
export type ComposableAgentRole = (typeof COMPOSABLE_AGENTS)[number];
|
|
33
|
+
export declare const SWARM_SUBAGENT_MAP: Record<SwarmAgentRole, readonly ComposableAgentRole[]>;
|
|
34
|
+
export type TaskKey = "todo" | "role_tasks" | "cli_work_split" | "lessons" | "readme" | "handoff_template" | "handoff_example" | "handoff_example_vos_ui" | "handoff_example_ui_coders";
|
|
35
|
+
export type KernelKey = "directive_kernel" | "agent_registry";
|
|
36
|
+
export declare const AGENT_FILES: Record<AgentRole, string[]>;
|
|
37
|
+
export declare const AGENT_MANIFEST_FILES: Record<AgentRole, string[]>;
|
|
38
|
+
export declare const TASK_FILES: Record<TaskKey, string[]>;
|
|
39
|
+
export declare const KERNEL_FILES: Record<KernelKey, string[]>;
|
|
40
|
+
export type ArtifactSource = "workspace" | "package-defaults" | "store" | "missing";
|
|
41
|
+
export interface SkillReference {
|
|
42
|
+
name: string;
|
|
43
|
+
path: string;
|
|
44
|
+
source: "workspace" | "package-defaults" | "store";
|
|
45
|
+
}
|
|
46
|
+
export interface BootstrapOptions {
|
|
47
|
+
projectName?: string;
|
|
48
|
+
force?: boolean;
|
|
49
|
+
includeMcpConfig?: boolean;
|
|
50
|
+
includeClientConfigBundle?: boolean;
|
|
51
|
+
llmProvider?: LlmProvider;
|
|
52
|
+
llmModel?: string;
|
|
53
|
+
llmBaseUrl?: string;
|
|
54
|
+
ollamaModel?: string;
|
|
55
|
+
ollamaBaseUrl?: string;
|
|
56
|
+
/**
|
|
57
|
+
* When true, skip copying store-managed trees (tasks, agent-state, skills,
|
|
58
|
+
* and the .agents/ACE defaults tree). Pass this when bootstrapStoreWorkspace()
|
|
59
|
+
* has already run so the store is authoritative for those paths.
|
|
60
|
+
*/
|
|
61
|
+
skipStoreManaged?: boolean;
|
|
62
|
+
}
|
|
63
|
+
export interface BootstrapResult {
|
|
64
|
+
created: string[];
|
|
65
|
+
updated: string[];
|
|
66
|
+
skipped: string[];
|
|
67
|
+
}
|
|
68
|
+
export declare function mapAceWorkspaceRelativePath(path: string): string;
|
|
69
|
+
export declare function acePath(...segments: string[]): string;
|
|
70
|
+
export declare function wsPath(...segments: string[]): string;
|
|
71
|
+
/** Normalize a path for validation: workspace-relative, forward slashes. */
|
|
72
|
+
export declare function normalizePathForValidation(path: string): string;
|
|
73
|
+
/** Check if a role is a swarm agent (vs composable). */
|
|
74
|
+
export declare function isSwarmRole(role: string): role is (typeof SWARM_AGENTS)[number];
|
|
75
|
+
/** Atomically write a file via tmp + rename to prevent partial writes. */
|
|
76
|
+
export declare function atomicWrite(filePath: string, content: string): string;
|
|
77
|
+
/** Check if a file exists. Relative paths are workspace-relative. */
|
|
78
|
+
export declare function fileExists(filePath: string): boolean;
|
|
79
|
+
export declare function resolveWorkspaceWritePath(filePath: string): string;
|
|
80
|
+
export declare function resolveWorkspaceReadPath(filePath: string): string;
|
|
81
|
+
export declare function resolveWorkspaceArtifactPath(filePath: string, mode?: "read" | "write"): string;
|
|
82
|
+
export declare function classifyPathSource(path?: string): ArtifactSource;
|
|
83
|
+
/** Safely read a workspace file, returning either text or a not-found/access message. */
|
|
84
|
+
export declare function safeRead(filePath: string): string;
|
|
85
|
+
/** Safely write a workspace file atomically (tmp + rename), creating directories if needed. */
|
|
86
|
+
export declare function safeWrite(filePath: string, content: string): string;
|
|
87
|
+
/**
|
|
88
|
+
* Execute `fn` while holding a per-path serialization lock.
|
|
89
|
+
* Prevents concurrent read-modify-write cycles on the same file
|
|
90
|
+
* within a single process. Cross-process safety relies on atomic rename.
|
|
91
|
+
*/
|
|
92
|
+
export declare function withFileLock<T>(path: string, fn: () => T | Promise<T>): Promise<T>;
|
|
93
|
+
export declare function getAgentInstructionPath(role: AgentRole): string | undefined;
|
|
94
|
+
export declare function getAgentManifestPath(role: AgentRole): string | undefined;
|
|
95
|
+
export declare function readAgentInstructions(role: AgentRole): string;
|
|
96
|
+
export declare function readAgentManifest(role: AgentRole): string;
|
|
97
|
+
export declare function getTaskArtifactPath(key: TaskKey): string | undefined;
|
|
98
|
+
export declare function readTaskArtifact(key: TaskKey): string;
|
|
99
|
+
export declare function getKernelArtifactPath(key: KernelKey): string | undefined;
|
|
100
|
+
export declare function readKernelArtifact(key: KernelKey): string;
|
|
101
|
+
export declare function resolveWritableTaskPath(key: TaskKey): string;
|
|
102
|
+
export declare function listAvailableSkills(): SkillReference[];
|
|
103
|
+
export declare function getSkillPath(name: string): string | undefined;
|
|
104
|
+
export declare function readSkillInstructions(name: string): string;
|
|
105
|
+
export declare function getMcpClientBundlePath(client: McpClient): string;
|
|
106
|
+
export declare function getMcpClientInstallHint(client: McpClient): string;
|
|
107
|
+
export declare function getMcpServerConfigSnippet(client?: McpClient): string;
|
|
108
|
+
export declare function getAllMcpServerConfigSnippets(): Record<McpClient, string>;
|
|
109
|
+
export declare function bootstrapAceWorkspace(options?: BootstrapOptions): BootstrapResult;
|
|
110
|
+
export interface DriftEntry {
|
|
111
|
+
asset_path: string;
|
|
112
|
+
runtime_path: string;
|
|
113
|
+
status: "match" | "drift" | "missing-runtime" | "missing-asset";
|
|
114
|
+
}
|
|
115
|
+
export interface DriftReport {
|
|
116
|
+
checked: number;
|
|
117
|
+
drifted: number;
|
|
118
|
+
missing_runtime: number;
|
|
119
|
+
entries: DriftEntry[];
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Compare packaged assets against runtime workspace copies.
|
|
123
|
+
* Detects silent divergence between authoritative defaults and live state.
|
|
124
|
+
*/
|
|
125
|
+
export declare function detectAssetDrift(): DriftReport;
|
|
126
|
+
//# sourceMappingURL=helpers.d.ts.map
|