feat: 项目基础设施、类型定义和依赖

This commit is contained in:
2026-06-08 17:08:26 +08:00
parent 880695ed53
commit 0f12e3c100
3 changed files with 68 additions and 1 deletions

View File

@@ -4,6 +4,10 @@
"workspaces": {
"": {
"name": "rune",
"dependencies": {
"cac": "^6.7.14",
"yaml": "^2.7.0",
},
"devDependencies": {
"@types/bun": "latest",
},
@@ -19,8 +23,12 @@
"bun-types": ["bun-types@1.3.14", "", { "dependencies": { "@types/node": "*" } }, "sha512-4N0ig0fEomHt5R0KCFWjovxow98rIoRwKolrYdCcknNwMekCXRnWEUvgu5soYV8QXtVsrUD8B95MBOZGPvr6KQ=="],
"cac": ["cac@6.7.14", "", {}, "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ=="],
"typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="],
"undici-types": ["undici-types@7.24.6", "", {}, "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg=="],
"yaml": ["yaml@2.9.0", "", { "bin": { "yaml": "bin.mjs" } }, "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA=="],
}
}

View File

@@ -1,12 +1,20 @@
{
"name": "rune",
"module": "index.ts",
"version": "0.1.0",
"module": "src/cli.ts",
"type": "module",
"bin": {
"rune": "./src/cli.ts"
},
"private": true,
"devDependencies": {
"@types/bun": "latest"
},
"peerDependencies": {
"typescript": "^5"
},
"dependencies": {
"cac": "^6.7.14",
"yaml": "^2.7.0"
}
}

51
src/types.ts Normal file
View File

@@ -0,0 +1,51 @@
export interface DocumentConfig {
name: string;
prompt: string;
template?: string;
}
export interface DiscussStage {
prompt: string;
}
export interface PlanStage {
documents: DocumentConfig[];
}
export interface BuildStage {
prompt: string;
}
export interface ArchiveStage {
prompt: string;
}
export interface StagesConfig {
discuss?: DiscussStage;
plan?: PlanStage;
build?: BuildStage;
archive?: ArchiveStage;
}
export interface RuneConfig {
stages: StagesConfig;
}
export interface TaskItem {
checked: boolean;
text: string;
}
export interface ChangeStatus {
name: string;
documents: string[];
taskProgress: { completed: number; total: number } | null;
}
export const STAGES = ["discuss", "plan", "build", "archive"] as const;
export type Stage = (typeof STAGES)[number];
export const RUNE_DIR = ".rune";
export const CONFIG_FILE = "config.yaml";
export const CHANGES_DIR = "changes";
export const ARCHIVE_DIR = "archive";