@wowok/agent-mcp 2.5.1 → 2.5.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/dist/index.js +46 -6
- package/dist/knowledge/guard-design-patterns.js +104 -1
- package/dist/knowledge/guard-ledger.js +3 -3
- package/dist/knowledge/guard-lint.js +3 -3
- package/dist/knowledge/guard-risk.js +23 -15
- package/dist/knowledge/guard-templates.js +174 -2
- package/dist/knowledge/guard-translation.js +3 -3
- package/dist/knowledge/index.d.ts +3 -0
- package/dist/knowledge/index.js +9 -0
- package/dist/knowledge/machine-context.d.ts +1 -1
- package/dist/knowledge/machine-context.js +21 -0
- package/dist/knowledge/machine-ledger.d.ts +1 -0
- package/dist/knowledge/machine-ledger.js +31 -11
- package/dist/knowledge/machine-templates.js +32 -78
- package/dist/knowledge/mcp-schema-audit.js +3 -2
- package/dist/knowledge/overrides-loader.d.ts +13 -0
- package/dist/knowledge/overrides-loader.js +67 -0
- package/dist/knowledge/payment-risk.d.ts +4 -0
- package/dist/knowledge/payment-risk.js +67 -0
- package/dist/knowledge/repository-confirm.d.ts +4 -0
- package/dist/knowledge/repository-confirm.js +44 -0
- package/dist/knowledge/repository-risk.d.ts +8 -2
- package/dist/knowledge/repository-risk.js +61 -0
- package/dist/knowledge/repository-translation.js +23 -0
- package/dist/knowledge/scenario-modes.js +22 -5
- package/dist/knowledge/service-templates.js +38 -0
- package/dist/knowledge/treasury-templates.js +42 -0
- package/dist/loop-engineering/context-collect.d.ts +7 -0
- package/dist/loop-engineering/context-collect.js +83 -0
- package/dist/loop-engineering/improve.d.ts +29 -0
- package/dist/loop-engineering/improve.js +178 -0
- package/dist/project/business-puzzle.d.ts +1 -0
- package/dist/project/business-puzzle.js +11 -0
- package/dist/project/context-assembly.d.ts +16 -0
- package/dist/project/context-assembly.js +130 -0
- package/dist/project/deployment-doc.d.ts +126 -0
- package/dist/project/deployment-doc.js +632 -0
- package/dist/project/index.d.ts +25 -0
- package/dist/project/index.js +78 -0
- package/dist/project/migration.d.ts +22 -0
- package/dist/project/migration.js +125 -0
- package/dist/project/project-store.d.ts +110 -0
- package/dist/project/project-store.js +425 -0
- package/dist/project/risk-aggregator.d.ts +7 -0
- package/dist/project/risk-aggregator.js +15 -0
- package/dist/project/rollback-policy.d.ts +45 -0
- package/dist/project/rollback-policy.js +290 -0
- package/dist/project/stage-gate.d.ts +49 -0
- package/dist/project/stage-gate.js +310 -0
- package/dist/schema/call/allocation.d.ts +5 -0
- package/dist/schema/call/arbitration.d.ts +5 -0
- package/dist/schema/call/base.d.ts +3 -0
- package/dist/schema/call/base.js +3 -2
- package/dist/schema/call/bridge.d.ts +24 -0
- package/dist/schema/call/contact.d.ts +5 -0
- package/dist/schema/call/demand.d.ts +5 -0
- package/dist/schema/call/guard.d.ts +15 -0
- package/dist/schema/call/machine.d.ts +10 -0
- package/dist/schema/call/order.d.ts +5 -0
- package/dist/schema/call/payment.d.ts +5 -0
- package/dist/schema/call/permission.d.ts +5 -0
- package/dist/schema/call/personal.d.ts +5 -0
- package/dist/schema/call/progress.d.ts +5 -0
- package/dist/schema/call/proof.d.ts +10 -0
- package/dist/schema/call/repository.d.ts +5 -0
- package/dist/schema/call/reward.d.ts +5 -0
- package/dist/schema/call/service.d.ts +5 -0
- package/dist/schema/call/treasury.d.ts +5 -0
- package/dist/schema/operations.d.ts +210 -0
- package/dist/schema/operations.js +24 -0
- package/dist/schema/project/index.d.ts +2798 -85
- package/dist/schema/project/index.js +667 -2
- package/dist/schema/query/index.d.ts +601 -0
- package/dist/schema/query/index.js +61 -0
- package/dist/schemas/bridge_operation.schema.json +4 -0
- package/dist/schemas/guard2file.schema.json +4 -0
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/machineNode2file.schema.json +4 -0
- package/dist/schemas/onchain_operations.schema.json +20 -0
- package/dist/schemas/onchain_operations_allocation.schema.json +4 -0
- package/dist/schemas/onchain_operations_arbitration.schema.json +4 -0
- package/dist/schemas/onchain_operations_contact.schema.json +4 -0
- package/dist/schemas/onchain_operations_demand.schema.json +4 -0
- package/dist/schemas/onchain_operations_gen_passport.schema.json +8 -0
- package/dist/schemas/onchain_operations_gen_proof.schema.json +8 -0
- package/dist/schemas/onchain_operations_guard.schema.json +4 -577
- package/dist/schemas/onchain_operations_machine.schema.json +4 -0
- package/dist/schemas/onchain_operations_order.schema.json +4 -0
- package/dist/schemas/onchain_operations_payment.schema.json +4 -0
- package/dist/schemas/onchain_operations_permission.schema.json +4 -0
- package/dist/schemas/onchain_operations_personal.schema.json +4 -0
- package/dist/schemas/onchain_operations_progress.schema.json +4 -0
- package/dist/schemas/onchain_operations_proof.schema.json +4 -0
- package/dist/schemas/onchain_operations_repository.schema.json +4 -0
- package/dist/schemas/onchain_operations_reward.schema.json +4 -0
- package/dist/schemas/onchain_operations_service.schema.json +4 -0
- package/dist/schemas/onchain_operations_treasury.schema.json +4 -0
- package/dist/schemas/project_operation.output.json +1955 -0
- package/dist/schemas/project_operation.schema.json +133 -2
- package/dist/schemas/query_toolkit.output.json +407 -1
- package/dist/schemas/query_toolkit.schema.json +132 -0
- package/dist/tools/handlers/project.js +788 -2
- package/dist/tools/handlers/query.js +38 -2
- package/dist/tools/index.js +346 -37
- package/dist/tools/wrap.js +61 -7
- package/package.json +2 -2
- package/dist/schemas/onchain_operations.output.json +0 -2819
package/dist/project/index.d.ts
CHANGED
|
@@ -7,6 +7,31 @@ export * from "./query.js";
|
|
|
7
7
|
export declare function isProjectServiceEnabled(): boolean;
|
|
8
8
|
export declare function getGraph(): ProjectGraph;
|
|
9
9
|
export declare function setGraph(g: ProjectGraph): void;
|
|
10
|
+
export type ProjectStage = 1 | 2 | 3 | 4 | 5;
|
|
11
|
+
export interface StageCacheEntry {
|
|
12
|
+
stage: ProjectStage;
|
|
13
|
+
updated_at: number;
|
|
14
|
+
puzzles?: Record<string, unknown>;
|
|
15
|
+
risk_status?: string;
|
|
16
|
+
risk_can_proceed?: boolean;
|
|
17
|
+
doc_generated?: boolean;
|
|
18
|
+
doc_error_count?: number;
|
|
19
|
+
trace_coherent?: boolean;
|
|
20
|
+
trace_can_proceed?: boolean;
|
|
21
|
+
business_intent?: string;
|
|
22
|
+
industry?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare function getStageCache(prefix: string, version: string): StageCacheEntry | undefined;
|
|
25
|
+
export declare function updateStageCache(prefix: string, version: string, update: Partial<StageCacheEntry>): StageCacheEntry;
|
|
26
|
+
export declare function getProjectStatus(prefix: string, version: string): {
|
|
27
|
+
stage: ProjectStage;
|
|
28
|
+
stage_name: string;
|
|
29
|
+
stage_description: string;
|
|
30
|
+
next_action: string;
|
|
31
|
+
can_proceed: boolean;
|
|
32
|
+
details: StageCacheEntry | undefined;
|
|
33
|
+
};
|
|
34
|
+
export declare function clearStageCache(prefix: string, version: string): void;
|
|
10
35
|
export interface NormalizeCallInput {
|
|
11
36
|
operation_type: string;
|
|
12
37
|
data: any;
|
package/dist/project/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import { LocalMark } from "@wowok/wowok";
|
|
|
6
6
|
import { readFileSync, writeFileSync, existsSync, mkdirSync } from "fs";
|
|
7
7
|
import { dirname, join } from "path";
|
|
8
8
|
import { homedir } from "os";
|
|
9
|
+
import * as ProjectStore from "./project-store.js";
|
|
9
10
|
export * from "./namespace.js";
|
|
10
11
|
export * from "./graph.js";
|
|
11
12
|
export * from "./query.js";
|
|
@@ -62,6 +63,83 @@ export function getGraph() {
|
|
|
62
63
|
export function setGraph(g) {
|
|
63
64
|
GRAPH_INSTANCE = g;
|
|
64
65
|
}
|
|
66
|
+
const STAGE_CACHE = new Map();
|
|
67
|
+
function stageCacheKey(prefix, version) {
|
|
68
|
+
return `${prefix}:${version}`;
|
|
69
|
+
}
|
|
70
|
+
export function getStageCache(prefix, version) {
|
|
71
|
+
const key = stageCacheKey(prefix, version);
|
|
72
|
+
const cached = STAGE_CACHE.get(key);
|
|
73
|
+
if (cached)
|
|
74
|
+
return cached;
|
|
75
|
+
const stageState = ProjectStore.loadStageState(prefix, version);
|
|
76
|
+
if (stageState) {
|
|
77
|
+
const entry = {
|
|
78
|
+
stage: stageState.stage,
|
|
79
|
+
updated_at: stageState.updated_at,
|
|
80
|
+
};
|
|
81
|
+
STAGE_CACHE.set(key, entry);
|
|
82
|
+
return entry;
|
|
83
|
+
}
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
export function updateStageCache(prefix, version, update) {
|
|
87
|
+
const key = stageCacheKey(prefix, version);
|
|
88
|
+
const existing = STAGE_CACHE.get(key);
|
|
89
|
+
const entry = {
|
|
90
|
+
stage: update.stage ?? existing?.stage ?? 1,
|
|
91
|
+
updated_at: Date.now(),
|
|
92
|
+
...existing,
|
|
93
|
+
...update,
|
|
94
|
+
};
|
|
95
|
+
STAGE_CACHE.set(key, entry);
|
|
96
|
+
persistStageState(prefix, version, entry);
|
|
97
|
+
return entry;
|
|
98
|
+
}
|
|
99
|
+
function persistStageState(prefix, version, entry) {
|
|
100
|
+
try {
|
|
101
|
+
let state = ProjectStore.loadStageState(prefix, version);
|
|
102
|
+
if (!state) {
|
|
103
|
+
ProjectStore.initProject(prefix, version, {
|
|
104
|
+
mcpVersion: `project-service-v${PROJECT_SERVICE_VERSION}`,
|
|
105
|
+
});
|
|
106
|
+
state = ProjectStore.loadStageState(prefix, version);
|
|
107
|
+
if (!state)
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
if (state.archived) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
state.stage = entry.stage;
|
|
114
|
+
state.updated_at = entry.updated_at;
|
|
115
|
+
ProjectStore.saveStageState(prefix, version, state);
|
|
116
|
+
}
|
|
117
|
+
catch {
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
export function getProjectStatus(prefix, version) {
|
|
121
|
+
const entry = getStageCache(prefix, version);
|
|
122
|
+
const stage = entry?.stage ?? 1;
|
|
123
|
+
const stageInfo = {
|
|
124
|
+
1: { name: "Project Naming", description: "Project namespace established. Ready to analyze business intent.", next: "analyze_intent" },
|
|
125
|
+
2: { name: "Business Puzzle", description: "Business intent analyzed. Puzzles may need completion before risk assessment.", next: entry?.puzzles ? "aggregate_risks" : "analyze_intent" },
|
|
126
|
+
3: { name: "Risk Calibration", description: "Risks assessed. Fix CRITICAL risks before generating deployment doc.", next: entry?.risk_can_proceed ? "generate_deployment_doc" : "aggregate_risks" },
|
|
127
|
+
4: { name: "Deployment Document", description: "Deployment doc generated. Fix D-errors before substep trace.", next: entry?.doc_error_count === 0 ? "trace_substeps" : "generate_deployment_doc" },
|
|
128
|
+
5: { name: "Substep Trace", description: "Substeps traced. Ready for deployment execution.", next: entry?.trace_can_proceed ? "deploy" : "trace_substeps" },
|
|
129
|
+
};
|
|
130
|
+
const info = stageInfo[stage];
|
|
131
|
+
return {
|
|
132
|
+
stage,
|
|
133
|
+
stage_name: info.name,
|
|
134
|
+
stage_description: info.description,
|
|
135
|
+
next_action: info.next,
|
|
136
|
+
can_proceed: stage < 5,
|
|
137
|
+
details: entry,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
export function clearStageCache(prefix, version) {
|
|
141
|
+
STAGE_CACHE.delete(stageCacheKey(prefix, version));
|
|
142
|
+
}
|
|
65
143
|
export function normalize(input) {
|
|
66
144
|
if (!isProjectServiceEnabled()) {
|
|
67
145
|
return { data: input.data, warnings: [] };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface MigrationStep {
|
|
2
|
+
from: string;
|
|
3
|
+
to: string;
|
|
4
|
+
description: string;
|
|
5
|
+
migrate: (projectDirPath: string) => void;
|
|
6
|
+
}
|
|
7
|
+
export interface MigrationResult {
|
|
8
|
+
migrated: boolean;
|
|
9
|
+
from_version: string;
|
|
10
|
+
to_version: string;
|
|
11
|
+
steps_executed: string[];
|
|
12
|
+
backup_path?: string;
|
|
13
|
+
needs_recalibration: boolean;
|
|
14
|
+
message: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function migrateProject(prefix: string, version: string): MigrationResult;
|
|
17
|
+
export declare function needsMigration(prefix: string, version: string): boolean;
|
|
18
|
+
export declare function listAvailableMigrations(): Array<{
|
|
19
|
+
from: string;
|
|
20
|
+
to: string;
|
|
21
|
+
description: string;
|
|
22
|
+
}>;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { copyFileSync, mkdirSync, readdirSync } from "fs";
|
|
2
|
+
import { join } from "path";
|
|
3
|
+
import { CURRENT_SCHEMA_VERSION, projectDir, loadManifest, saveManifest, } from "./project-store.js";
|
|
4
|
+
const MIGRATIONS = [];
|
|
5
|
+
function backupProject(prefix, version) {
|
|
6
|
+
const srcDir = projectDir(prefix, version);
|
|
7
|
+
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
8
|
+
const backupDir = join(srcDir, ".backup", timestamp);
|
|
9
|
+
mkdirSync(backupDir, { recursive: true });
|
|
10
|
+
function copyDir(srcRel) {
|
|
11
|
+
const srcAbs = join(srcDir, srcRel);
|
|
12
|
+
const items = readdirSync(srcAbs, { withFileTypes: true });
|
|
13
|
+
for (const item of items) {
|
|
14
|
+
if (srcRel === "" && item.name === ".backup")
|
|
15
|
+
continue;
|
|
16
|
+
const rel = srcRel ? join(srcRel, item.name) : item.name;
|
|
17
|
+
const abs = join(srcDir, rel);
|
|
18
|
+
if (item.isDirectory()) {
|
|
19
|
+
mkdirSync(join(backupDir, rel), { recursive: true });
|
|
20
|
+
copyDir(rel);
|
|
21
|
+
}
|
|
22
|
+
else if (item.isFile()) {
|
|
23
|
+
copyFileSync(abs, join(backupDir, rel));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
copyDir("");
|
|
28
|
+
return backupDir;
|
|
29
|
+
}
|
|
30
|
+
export function migrateProject(prefix, version) {
|
|
31
|
+
const manifest = loadManifest(prefix, version);
|
|
32
|
+
const fromVersion = manifest.schema_version;
|
|
33
|
+
if (fromVersion === CURRENT_SCHEMA_VERSION) {
|
|
34
|
+
return {
|
|
35
|
+
migrated: false,
|
|
36
|
+
from_version: fromVersion,
|
|
37
|
+
to_version: CURRENT_SCHEMA_VERSION,
|
|
38
|
+
steps_executed: [],
|
|
39
|
+
needs_recalibration: manifest.needs_recalibration ?? false,
|
|
40
|
+
message: `Project schema is up-to-date (${fromVersion}). No migration needed.`,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
const backupPath = backupProject(prefix, version);
|
|
44
|
+
const dir = projectDir(prefix, version);
|
|
45
|
+
const stepsExecuted = [];
|
|
46
|
+
let current = fromVersion;
|
|
47
|
+
let safetyCounter = 0;
|
|
48
|
+
const MAX_STEPS = 50;
|
|
49
|
+
while (current !== CURRENT_SCHEMA_VERSION && safetyCounter < MAX_STEPS) {
|
|
50
|
+
const step = MIGRATIONS.find((m) => m.from === current);
|
|
51
|
+
if (!step) {
|
|
52
|
+
const updatedManifest = {
|
|
53
|
+
...manifest,
|
|
54
|
+
needs_recalibration: true,
|
|
55
|
+
updated_at: new Date().toISOString(),
|
|
56
|
+
};
|
|
57
|
+
saveManifest(prefix, version, updatedManifest);
|
|
58
|
+
return {
|
|
59
|
+
migrated: false,
|
|
60
|
+
from_version: fromVersion,
|
|
61
|
+
to_version: current,
|
|
62
|
+
steps_executed: stepsExecuted,
|
|
63
|
+
backup_path: backupPath,
|
|
64
|
+
needs_recalibration: true,
|
|
65
|
+
message: `No migration path from schema ${current} to ${CURRENT_SCHEMA_VERSION}. ` +
|
|
66
|
+
`Project backed up to ${backupPath}. Manual recalibration required.`,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
try {
|
|
70
|
+
step.migrate(dir);
|
|
71
|
+
stepsExecuted.push(`${step.from}→${step.to}: ${step.description}`);
|
|
72
|
+
current = step.to;
|
|
73
|
+
}
|
|
74
|
+
catch (e) {
|
|
75
|
+
const updatedManifest = {
|
|
76
|
+
...manifest,
|
|
77
|
+
needs_recalibration: true,
|
|
78
|
+
updated_at: new Date().toISOString(),
|
|
79
|
+
};
|
|
80
|
+
saveManifest(prefix, version, updatedManifest);
|
|
81
|
+
return {
|
|
82
|
+
migrated: false,
|
|
83
|
+
from_version: fromVersion,
|
|
84
|
+
to_version: current,
|
|
85
|
+
steps_executed: stepsExecuted,
|
|
86
|
+
backup_path: backupPath,
|
|
87
|
+
needs_recalibration: true,
|
|
88
|
+
message: `Migration ${step.from}→${step.to} failed: ${e instanceof Error ? e.message : String(e)}. ` +
|
|
89
|
+
`Project backed up to ${backupPath}. Manual intervention required.`,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
safetyCounter++;
|
|
93
|
+
}
|
|
94
|
+
const updatedManifest = {
|
|
95
|
+
...manifest,
|
|
96
|
+
schema_version: CURRENT_SCHEMA_VERSION,
|
|
97
|
+
needs_recalibration: true,
|
|
98
|
+
updated_at: new Date().toISOString(),
|
|
99
|
+
};
|
|
100
|
+
saveManifest(prefix, version, updatedManifest);
|
|
101
|
+
return {
|
|
102
|
+
migrated: true,
|
|
103
|
+
from_version: fromVersion,
|
|
104
|
+
to_version: CURRENT_SCHEMA_VERSION,
|
|
105
|
+
steps_executed: stepsExecuted,
|
|
106
|
+
backup_path: backupPath,
|
|
107
|
+
needs_recalibration: true,
|
|
108
|
+
message: `Project migrated from schema ${fromVersion} to ${CURRENT_SCHEMA_VERSION}. ` +
|
|
109
|
+
`${stepsExecuted.length} migration step(s) executed. ` +
|
|
110
|
+
`Recalibration recommended: re-run aggregate_risks and generate_deployment_doc. ` +
|
|
111
|
+
`Backup saved to ${backupPath}.`,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
export function needsMigration(prefix, version) {
|
|
115
|
+
try {
|
|
116
|
+
const manifest = loadManifest(prefix, version);
|
|
117
|
+
return manifest.schema_version !== CURRENT_SCHEMA_VERSION;
|
|
118
|
+
}
|
|
119
|
+
catch {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
export function listAvailableMigrations() {
|
|
124
|
+
return MIGRATIONS.map((m) => ({ from: m.from, to: m.to, description: m.description }));
|
|
125
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
export declare const CURRENT_SCHEMA_VERSION = "1.0.0";
|
|
2
|
+
export declare function projectsRootDir(): string;
|
|
3
|
+
export declare function projectDir(prefix: string, version: string): string;
|
|
4
|
+
export declare function deploymentDir(prefix: string, version: string): string;
|
|
5
|
+
export interface ProjectManifest {
|
|
6
|
+
schema_version: string;
|
|
7
|
+
mcp_version: string;
|
|
8
|
+
prefix: string;
|
|
9
|
+
version: string;
|
|
10
|
+
created_at: string;
|
|
11
|
+
updated_at: string;
|
|
12
|
+
forked_from?: string;
|
|
13
|
+
needs_recalibration?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export type ProjectStage = 1 | 2 | 3 | 4 | 5;
|
|
16
|
+
export interface StageState {
|
|
17
|
+
stage: ProjectStage;
|
|
18
|
+
updated_at: number;
|
|
19
|
+
stage_meta: Record<ProjectStage, {
|
|
20
|
+
committed: boolean;
|
|
21
|
+
committed_at?: number;
|
|
22
|
+
gate_passed: boolean;
|
|
23
|
+
blocking_issues: string[];
|
|
24
|
+
completion: number;
|
|
25
|
+
}>;
|
|
26
|
+
has_published_object: boolean;
|
|
27
|
+
archived: boolean;
|
|
28
|
+
}
|
|
29
|
+
export type AuditEventType = "stage_commit" | "stage_rollback" | "risk_acknowledged" | "fork_created" | "migration_applied" | "gate_validation" | "object_published";
|
|
30
|
+
export interface AuditRecord {
|
|
31
|
+
timestamp: string;
|
|
32
|
+
event: AuditEventType;
|
|
33
|
+
stage?: ProjectStage;
|
|
34
|
+
reason: string;
|
|
35
|
+
affected_files: string[];
|
|
36
|
+
user_confirmed?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export declare function ensureProjectDir(prefix: string, version: string): string;
|
|
39
|
+
export declare function initProject(prefix: string, version: string, options?: {
|
|
40
|
+
mcpVersion?: string;
|
|
41
|
+
forkedFrom?: string;
|
|
42
|
+
}): ProjectManifest;
|
|
43
|
+
export declare function loadManifest(prefix: string, version: string): ProjectManifest;
|
|
44
|
+
export declare function saveManifest(prefix: string, version: string, manifest: ProjectManifest): void;
|
|
45
|
+
export declare function loadStageState(prefix: string, version: string): StageState | undefined;
|
|
46
|
+
export declare function saveStageState(prefix: string, version: string, state: StageState): void;
|
|
47
|
+
export declare function saveProjectFile(prefix: string, version: string, relPath: string, data: unknown): string;
|
|
48
|
+
export declare function loadProjectFile<T = unknown>(prefix: string, version: string, relPath: string): T | undefined;
|
|
49
|
+
export declare function saveProjectMarkdown(prefix: string, version: string, relPath: string, markdown: string): string;
|
|
50
|
+
export declare function appendJsonl(prefix: string, version: string, relPath: string, record: unknown): string;
|
|
51
|
+
export declare function appendAudit(prefix: string, version: string, record: AuditRecord): void;
|
|
52
|
+
export declare function readAuditLog(prefix: string, version: string): AuditRecord[];
|
|
53
|
+
export interface LocalProjectEntry {
|
|
54
|
+
dir_name: string;
|
|
55
|
+
prefix: string;
|
|
56
|
+
version: string;
|
|
57
|
+
path: string;
|
|
58
|
+
initialized: boolean;
|
|
59
|
+
archived: boolean;
|
|
60
|
+
needs_migration: boolean;
|
|
61
|
+
forked_from?: string;
|
|
62
|
+
mtime: number;
|
|
63
|
+
}
|
|
64
|
+
export declare function parseProjectDirName(dirName: string): {
|
|
65
|
+
prefix: string;
|
|
66
|
+
version: string;
|
|
67
|
+
} | undefined;
|
|
68
|
+
export declare function listLocalProjects(): LocalProjectEntry[];
|
|
69
|
+
export declare function projectExists(prefix: string, version: string): boolean;
|
|
70
|
+
export interface ForkOptions {
|
|
71
|
+
newVersion: string;
|
|
72
|
+
newPrefix?: string;
|
|
73
|
+
mcpVersion?: string;
|
|
74
|
+
}
|
|
75
|
+
export interface ForkResult {
|
|
76
|
+
new_prefix: string;
|
|
77
|
+
new_version: string;
|
|
78
|
+
new_path: string;
|
|
79
|
+
forked_from: string;
|
|
80
|
+
copied_files: string[];
|
|
81
|
+
}
|
|
82
|
+
export declare function forkProject(srcPrefix: string, srcVersion: string, opts: ForkOptions): ForkResult;
|
|
83
|
+
export interface ProjectFileEntry {
|
|
84
|
+
path: string;
|
|
85
|
+
abs_path: string;
|
|
86
|
+
size: number;
|
|
87
|
+
mtime: number;
|
|
88
|
+
kind: "json" | "markdown" | "jsonl" | "other";
|
|
89
|
+
}
|
|
90
|
+
export declare function listProjectFiles(prefix: string, version: string): ProjectFileEntry[];
|
|
91
|
+
export declare function readProjectFile(prefix: string, version: string, relPath: string): string | undefined;
|
|
92
|
+
export declare function commitStage(prefix: string, version: string, stage: ProjectStage, options?: {
|
|
93
|
+
gatePassed?: boolean;
|
|
94
|
+
blockingIssues?: string[];
|
|
95
|
+
completion?: number;
|
|
96
|
+
reason?: string;
|
|
97
|
+
userConfirmed?: boolean;
|
|
98
|
+
}): StageState;
|
|
99
|
+
export declare function rollbackStage(prefix: string, version: string, toStage: ProjectStage, options?: {
|
|
100
|
+
reason?: string;
|
|
101
|
+
affectedFiles?: string[];
|
|
102
|
+
}): StageState;
|
|
103
|
+
export declare function markObjectPublished(prefix: string, version: string, objectName: string): void;
|
|
104
|
+
export interface ProjectSyncStatus {
|
|
105
|
+
local_exists: boolean;
|
|
106
|
+
initialized: boolean;
|
|
107
|
+
needs_migration: boolean;
|
|
108
|
+
archived: boolean;
|
|
109
|
+
}
|
|
110
|
+
export declare function getLocalSyncStatus(prefix: string, version: string): ProjectSyncStatus;
|