@abelxiaoxing/cadence 1.2.1 → 1.2.3
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/README.md +7 -1
- package/agents/diagnosis-worker.md +6 -2
- package/agents/implementation-worker.md +9 -2
- package/config/routes.example.json +0 -1
- package/package.json +1 -1
- package/prompts/abel-design.md +15 -4
- package/skills/abel-workflow/SKILL.md +5 -3
- package/src/apply-transaction.ts +1 -5
- package/src/child-session.ts +37 -46
- package/src/contracts.ts +278 -32
- package/src/control-contracts.ts +62 -0
- package/src/delivery-compiler.ts +239 -124
- package/src/design-control.ts +72 -27
- package/src/design-journal.ts +2 -2
- package/src/file-snapshot.ts +1 -1
- package/src/index.ts +295 -58
- package/src/packet-runtime.ts +79 -21
- package/src/parent-provider.ts +63 -30
- package/src/route-policy.ts +58 -14
- package/src/run-store.ts +115 -23
- package/src/subagent-activity.ts +82 -6
- package/src/submit-tool.ts +431 -39
- package/src/task-ledger.ts +1 -2
- package/src/worker-broker.ts +72 -13
- package/src/workflow-engine.ts +782 -54
- package/src/workspace-store.ts +2 -10
package/src/workspace-store.ts
CHANGED
|
@@ -20,7 +20,6 @@ import { isValidRelativePath } from "./contracts.ts";
|
|
|
20
20
|
import { observeSafePath } from "./safe-path.ts";
|
|
21
21
|
|
|
22
22
|
const SHA256 = /^[a-f0-9]{64}$/u;
|
|
23
|
-
const REVISION_VERSION = 2 as const;
|
|
24
23
|
|
|
25
24
|
export interface WorkspaceFileEntry {
|
|
26
25
|
kind: "file";
|
|
@@ -37,7 +36,6 @@ export type WorkspaceEntry = WorkspaceFileEntry | WorkspaceAbsentEntry;
|
|
|
37
36
|
export type WorkspaceEntries = Record<string, WorkspaceEntry>;
|
|
38
37
|
|
|
39
38
|
export interface WorkspaceRevision {
|
|
40
|
-
version: typeof REVISION_VERSION;
|
|
41
39
|
revisionId: string;
|
|
42
40
|
parentRevisionId: string | null;
|
|
43
41
|
manifestHash: string;
|
|
@@ -89,17 +87,13 @@ function stableEntries(entries: WorkspaceEntries): WorkspaceEntries {
|
|
|
89
87
|
|
|
90
88
|
function manifestHash(entries: WorkspaceEntries): string {
|
|
91
89
|
return hash(
|
|
92
|
-
"cadence-workspace-manifest
|
|
90
|
+
"cadence-workspace-manifest",
|
|
93
91
|
JSON.stringify(stableEntries(entries)),
|
|
94
92
|
);
|
|
95
93
|
}
|
|
96
94
|
|
|
97
95
|
function revisionId(parentRevisionId: string | null, manifest: string): string {
|
|
98
|
-
return hash(
|
|
99
|
-
"cadence-workspace-revision-v2",
|
|
100
|
-
parentRevisionId ?? "",
|
|
101
|
-
manifest,
|
|
102
|
-
);
|
|
96
|
+
return hash("cadence-workspace-revision", parentRevisionId ?? "", manifest);
|
|
103
97
|
}
|
|
104
98
|
|
|
105
99
|
function ensureDirectory(directory: string): void {
|
|
@@ -219,7 +213,6 @@ function requireRevisionShape(value: unknown): WorkspaceRevision {
|
|
|
219
213
|
}
|
|
220
214
|
const candidate = value as Partial<WorkspaceRevision>;
|
|
221
215
|
if (
|
|
222
|
-
candidate.version !== REVISION_VERSION ||
|
|
223
216
|
typeof candidate.revisionId !== "string" ||
|
|
224
217
|
!SHA256.test(candidate.revisionId) ||
|
|
225
218
|
(candidate.parentRevisionId !== null &&
|
|
@@ -287,7 +280,6 @@ export class WorkspaceStore {
|
|
|
287
280
|
const manifest = manifestHash(entries);
|
|
288
281
|
const id = revisionId(parentRevisionId, manifest);
|
|
289
282
|
const revision: WorkspaceRevision = {
|
|
290
|
-
version: REVISION_VERSION,
|
|
291
283
|
revisionId: id,
|
|
292
284
|
parentRevisionId,
|
|
293
285
|
manifestHash: manifest,
|