From 0f12e3c100f19d669291d29da21ab314bf68ada6 Mon Sep 17 00:00:00 2001 From: lanyuanxiaoyao Date: Mon, 8 Jun 2026 17:08:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=A1=B9=E7=9B=AE=E5=9F=BA=E7=A1=80?= =?UTF-8?q?=E8=AE=BE=E6=96=BD=E3=80=81=E7=B1=BB=E5=9E=8B=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E5=92=8C=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bun.lock | 8 ++++++++ package.json | 10 +++++++++- src/types.ts | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 src/types.ts diff --git a/bun.lock b/bun.lock index c40cb4b..926c8ef 100644 --- a/bun.lock +++ b/bun.lock @@ -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=="], } } diff --git a/package.json b/package.json index 19dfbf3..418e938 100644 --- a/package.json +++ b/package.json @@ -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" } } diff --git a/src/types.ts b/src/types.ts new file mode 100644 index 0000000..a3e6ca3 --- /dev/null +++ b/src/types.ts @@ -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";