speccore 4.0.1 → 4.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/README.en.md CHANGED
@@ -105,7 +105,9 @@ User Input (Natural Language / Slash Command)
105
105
 
106
106
  ---
107
107
 
108
- ## 🤖 Command Quick Reference (39 total)
108
+ ## 🔧 CLI Commands Quick Reference (39 total)
109
+
110
+ > Run in terminal. All commands start with `speccore`.
109
111
 
110
112
  | Category | Key Commands |
111
113
  | :--- | :--- |
@@ -122,6 +124,23 @@ User Input (Natural Language / Slash Command)
122
124
  | 📱 Platform | `platform-add` / `context` |
123
125
  | 🛠️ Tools | `health` / `report` / `template-add` / `help` / `demo` / `welcome` |
124
126
 
127
+ ## 🤖 AI Commands (Slash Command) Mapping
128
+
129
+ > Type `/` in AI tools (WorkBuddy / Cursor / Claude Code etc.). AI commands call the corresponding CLI command internally.
130
+
131
+ | CLI Command | AI Slash Command | Purpose |
132
+ | :--- | :--- | :--- |
133
+ | `speccore init` | `/spec-init` | Initialize project |
134
+ | `speccore import` | `/spec-import` | Import to global layer |
135
+ | `speccore iteration create` | `/spec-iteration-create` | Create iteration |
136
+ | `speccore new-task` | `/spec-new-task` | Create multi-platform task |
137
+ | `speccore execute` | `/spec-execute` | Execute development |
138
+ | `speccore progress` | `/spec-progress` | View progress |
139
+ | `speccore validate` | `/spec-validate` | Compliance check |
140
+ | `speccore impact` | `/spec-impact` | Impact analysis |
141
+ | `speccore audit` | `/spec-ai-audit` | AI smart audit |
142
+ | `speccore spec "query"` | `/spec query` | Natural language intent |
143
+
125
144
  > 📋 Full command reference: [Command Reference](docs/commands.en.md) | 🧠 Intent mapping: [Intent Map](docs/commands.en.md#natural-language-intent-mapping-31-types)
126
145
 
127
146
  ---
package/README.md CHANGED
@@ -104,7 +104,9 @@ SpecCore 采用**确定性逻辑与智能逻辑解耦**的架构:
104
104
 
105
105
  ---
106
106
 
107
- ## 🤖 AI 命令速查(39 个,按分类)
107
+ ## 🔧 终端命令速查(39 个 CLI 命令)
108
+
109
+ > 在终端中执行,所有命令以 `speccore` 开头。
108
110
 
109
111
  | 分类 | 命令 | 说明 |
110
112
  | :--- | :--- | :--- |
@@ -122,7 +124,24 @@ SpecCore 采用**确定性逻辑与智能逻辑解耦**的架构:
122
124
  | 🎯 场景 | `speccore goal` / `bugfix` / `research` / `handover` / `retro` | 端到端需求 + Bug + 调研 + 交接 + 回顾 |
123
125
  | 🛠️ 工具 | `speccore health` / `report` / `archive` / `config` / `rename` / `template-add` / `help` / `demo` / `welcome` | 健康度 + 报告 + 归档 + 配置 + 重命名等 |
124
126
 
125
- > 📋 完整命令参数和别名见 [命令参考手册](docs/命令参考.md) | 🧠 31 种意图映射见 [命令参考—意图映射](docs/命令参考.md#自然语言意图映射31-种)
127
+ ## 🤖 AI 命令(Slash Command)对应关系
128
+
129
+ > 在 AI 工具(WorkBuddy / Cursor / Claude Code 等)中输入 `/` + 命令。AI 命令在底层调用对应的 CLI 命令执行。
130
+
131
+ | CLI 终端命令 | AI Slash Command | 用途 |
132
+ | :--- | :--- | :--- |
133
+ | `speccore init` | `/spec-init` | 项目初始化 |
134
+ | `speccore import` | `/spec-import` | 导入项目到全量层 |
135
+ | `speccore iteration create` | `/spec-iteration-create` | 创建期次 |
136
+ | `speccore new-task` | `/spec-new-task` | 创建多平台 Task |
137
+ | `speccore execute` | `/spec-execute` | 执行开发任务 |
138
+ | `speccore progress` | `/spec-progress` | 查看进度 |
139
+ | `speccore validate` | `/spec-validate` | 合规性检查 |
140
+ | `speccore impact` | `/spec-impact` | 变更影响分析 |
141
+ | `speccore audit` | `/spec-ai-audit` | AI 智能审计 |
142
+ | `speccore spec "查询"` | `/spec 查询` | 自然语言智能入口 |
143
+
144
+ > 📋 完整命令参数见 [命令参考手册](docs/命令参考.md) | 🧠 31 种意图映射见 [意图映射表](docs/命令参考.md#自然语言意图映射31-种)
126
145
 
127
146
  ---
128
147
 
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Context Schema — Zod 数据模型
3
+ * 定义 .speccore/local/context.json 的运行时上下文数据结构
4
+ */
5
+ import { z } from 'zod';
6
+ export declare const HistoryEntrySchema: z.ZodObject<{
7
+ action: z.ZodString;
8
+ target: z.ZodString;
9
+ timestamp: z.ZodString;
10
+ }, z.core.$strip>;
11
+ export declare const ContextSchema: z.ZodObject<{
12
+ currentIteration: z.ZodDefault<z.ZodString>;
13
+ currentTask: z.ZodDefault<z.ZodString>;
14
+ currentAssignee: z.ZodDefault<z.ZodString>;
15
+ lastUpdated: z.ZodDefault<z.ZodString>;
16
+ lastAction: z.ZodDefault<z.ZodString>;
17
+ lastIntent: z.ZodDefault<z.ZodString>;
18
+ interruptedAt: z.ZodDefault<z.ZodString>;
19
+ iterationStatus: z.ZodDefault<z.ZodString>;
20
+ pendingTasks: z.ZodDefault<z.ZodNumber>;
21
+ inProgressTasks: z.ZodDefault<z.ZodNumber>;
22
+ completedTasks: z.ZodDefault<z.ZodNumber>;
23
+ blockedTasks: z.ZodDefault<z.ZodNumber>;
24
+ customAliases: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
25
+ history: z.ZodDefault<z.ZodArray<z.ZodObject<{
26
+ action: z.ZodString;
27
+ target: z.ZodString;
28
+ timestamp: z.ZodString;
29
+ }, z.core.$strip>>>;
30
+ }, z.core.$strip>;
31
+ export type HistoryEntry = z.infer<typeof HistoryEntrySchema>;
32
+ export type Context = z.infer<typeof ContextSchema>;
33
+ export declare const DEFAULT_CONTEXT: Context;
34
+ //# sourceMappingURL=context.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.schema.d.ts","sourceRoot":"","sources":["../../../src/core/schemas/context.schema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,kBAAkB;;;;iBAI7B,CAAC;AAGH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;iBAwBxB,CAAC;AAGH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAGpD,eAAO,MAAM,eAAe,EAAE,OAe7B,CAAC"}
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ /**
3
+ * Context Schema — Zod 数据模型
4
+ * 定义 .speccore/local/context.json 的运行时上下文数据结构
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.DEFAULT_CONTEXT = exports.ContextSchema = exports.HistoryEntrySchema = void 0;
8
+ const zod_1 = require("zod");
9
+ // 历史记录条目
10
+ exports.HistoryEntrySchema = zod_1.z.object({
11
+ action: zod_1.z.string(),
12
+ target: zod_1.z.string(),
13
+ timestamp: zod_1.z.string().datetime(),
14
+ });
15
+ // 上下文核心 Schema
16
+ exports.ContextSchema = zod_1.z.object({
17
+ // 当前上下文
18
+ currentIteration: zod_1.z.string().default(''),
19
+ currentTask: zod_1.z.string().default(''),
20
+ currentAssignee: zod_1.z.string().default(''),
21
+ // 状态追踪
22
+ lastUpdated: zod_1.z.string().default(''),
23
+ lastAction: zod_1.z.string().default(''),
24
+ lastIntent: zod_1.z.string().default(''),
25
+ interruptedAt: zod_1.z.string().default(''),
26
+ // 迭代/任务统计
27
+ iterationStatus: zod_1.z.string().default(''),
28
+ pendingTasks: zod_1.z.number().int().nonnegative().default(0),
29
+ inProgressTasks: zod_1.z.number().int().nonnegative().default(0),
30
+ completedTasks: zod_1.z.number().int().nonnegative().default(0),
31
+ blockedTasks: zod_1.z.number().int().nonnegative().default(0),
32
+ // 自定义别名(用户自定义的命令别名)
33
+ customAliases: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).default({}),
34
+ // 历史记录
35
+ history: zod_1.z.array(exports.HistoryEntrySchema).default([]),
36
+ });
37
+ // 默认上下文
38
+ exports.DEFAULT_CONTEXT = {
39
+ currentIteration: '',
40
+ currentTask: '',
41
+ currentAssignee: '',
42
+ lastUpdated: new Date().toISOString(),
43
+ lastAction: '',
44
+ lastIntent: '',
45
+ interruptedAt: '',
46
+ iterationStatus: '',
47
+ pendingTasks: 0,
48
+ inProgressTasks: 0,
49
+ completedTasks: 0,
50
+ blockedTasks: 0,
51
+ customAliases: {},
52
+ history: [],
53
+ };
54
+ //# sourceMappingURL=context.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.schema.js","sourceRoot":"","sources":["../../../src/core/schemas/context.schema.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6BAAwB;AAExB,SAAS;AACI,QAAA,kBAAkB,GAAG,OAAC,CAAC,MAAM,CAAC;IACzC,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;IAClB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;IAClB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACjC,CAAC,CAAC;AAEH,eAAe;AACF,QAAA,aAAa,GAAG,OAAC,CAAC,MAAM,CAAC;IACpC,QAAQ;IACR,gBAAgB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IACxC,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IACnC,eAAe,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IAEvC,OAAO;IACP,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IACnC,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IAClC,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IAClC,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IAErC,UAAU;IACV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据模型统一导出
3
+ *
4
+ * 使用方式:
5
+ * import { TaskSchema, IterationSchema, ContextSchema } from '@core/schemas';
6
+ * const task = TaskSchema.parse(data);
7
+ */
8
+ export { TaskSchema, TaskStatusSchema, TaskTypeSchema, PlatformSchema, PrioritySchema, TaskOutputSchema, ChangelogEntrySchema, AssigneeSchema, } from './task.schema';
9
+ export type { Task, TaskStatus, TaskType, Platform, Priority, TaskOutput, ChangelogEntry, Assignee, } from './task.schema';
10
+ export { IterationSchema, IterationStatusSchema, IterationGoalSchema, IterationStatsSchema, } from './iteration.schema';
11
+ export type { Iteration, IterationStatus, IterationGoal, IterationStats, } from './iteration.schema';
12
+ export { PlatformConfigSchema, PlatformsConfigSchema, DEFAULT_PLATFORMS, } from './platform.schema';
13
+ export type { PlatformConfig, PlatformsConfig, } from './platform.schema';
14
+ export { ContextSchema, HistoryEntrySchema, DEFAULT_CONTEXT, } from './context.schema';
15
+ export type { Context, HistoryEntry, } from './context.schema';
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/schemas/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,cAAc,EACd,QAAQ,GACT,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,SAAS,EACT,eAAe,EACf,aAAa,EACb,cAAc,GACf,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,cAAc,EACd,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,OAAO,EACP,YAAY,GACb,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ /**
3
+ * SpecCore Schemas — Zod 数据模型统一导出
4
+ *
5
+ * 使用方式:
6
+ * import { TaskSchema, IterationSchema, ContextSchema } from '@core/schemas';
7
+ * const task = TaskSchema.parse(data);
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.DEFAULT_CONTEXT = exports.HistoryEntrySchema = exports.ContextSchema = exports.DEFAULT_PLATFORMS = exports.PlatformsConfigSchema = exports.PlatformConfigSchema = exports.IterationStatsSchema = exports.IterationGoalSchema = exports.IterationStatusSchema = exports.IterationSchema = exports.AssigneeSchema = exports.ChangelogEntrySchema = exports.TaskOutputSchema = exports.PrioritySchema = exports.PlatformSchema = exports.TaskTypeSchema = exports.TaskStatusSchema = exports.TaskSchema = void 0;
11
+ // Task 模型
12
+ var task_schema_1 = require("./task.schema");
13
+ Object.defineProperty(exports, "TaskSchema", { enumerable: true, get: function () { return task_schema_1.TaskSchema; } });
14
+ Object.defineProperty(exports, "TaskStatusSchema", { enumerable: true, get: function () { return task_schema_1.TaskStatusSchema; } });
15
+ Object.defineProperty(exports, "TaskTypeSchema", { enumerable: true, get: function () { return task_schema_1.TaskTypeSchema; } });
16
+ Object.defineProperty(exports, "PlatformSchema", { enumerable: true, get: function () { return task_schema_1.PlatformSchema; } });
17
+ Object.defineProperty(exports, "PrioritySchema", { enumerable: true, get: function () { return task_schema_1.PrioritySchema; } });
18
+ Object.defineProperty(exports, "TaskOutputSchema", { enumerable: true, get: function () { return task_schema_1.TaskOutputSchema; } });
19
+ Object.defineProperty(exports, "ChangelogEntrySchema", { enumerable: true, get: function () { return task_schema_1.ChangelogEntrySchema; } });
20
+ Object.defineProperty(exports, "AssigneeSchema", { enumerable: true, get: function () { return task_schema_1.AssigneeSchema; } });
21
+ // Iteration 模型
22
+ var iteration_schema_1 = require("./iteration.schema");
23
+ Object.defineProperty(exports, "IterationSchema", { enumerable: true, get: function () { return iteration_schema_1.IterationSchema; } });
24
+ Object.defineProperty(exports, "IterationStatusSchema", { enumerable: true, get: function () { return iteration_schema_1.IterationStatusSchema; } });
25
+ Object.defineProperty(exports, "IterationGoalSchema", { enumerable: true, get: function () { return iteration_schema_1.IterationGoalSchema; } });
26
+ Object.defineProperty(exports, "IterationStatsSchema", { enumerable: true, get: function () { return iteration_schema_1.IterationStatsSchema; } });
27
+ // Platform 模型
28
+ var platform_schema_1 = require("./platform.schema");
29
+ Object.defineProperty(exports, "PlatformConfigSchema", { enumerable: true, get: function () { return platform_schema_1.PlatformConfigSchema; } });
30
+ Object.defineProperty(exports, "PlatformsConfigSchema", { enumerable: true, get: function () { return platform_schema_1.PlatformsConfigSchema; } });
31
+ Object.defineProperty(exports, "DEFAULT_PLATFORMS", { enumerable: true, get: function () { return platform_schema_1.DEFAULT_PLATFORMS; } });
32
+ // Context 模型
33
+ var context_schema_1 = require("./context.schema");
34
+ Object.defineProperty(exports, "ContextSchema", { enumerable: true, get: function () { return context_schema_1.ContextSchema; } });
35
+ Object.defineProperty(exports, "HistoryEntrySchema", { enumerable: true, get: function () { return context_schema_1.HistoryEntrySchema; } });
36
+ Object.defineProperty(exports, "DEFAULT_CONTEXT", { enumerable: true, get: function () { return context_schema_1.DEFAULT_CONTEXT; } });
37
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/schemas/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,UAAU;AACV,6CASuB;AARrB,yGAAA,UAAU,OAAA;AACV,+GAAA,gBAAgB,OAAA;AAChB,6GAAA,cAAc,OAAA;AACd,6GAAA,cAAc,OAAA;AACd,6GAAA,cAAc,OAAA;AACd,+GAAA,gBAAgB,OAAA;AAChB,mHAAA,oBAAoB,OAAA;AACpB,6GAAA,cAAc,OAAA;AAahB,eAAe;AACf,uDAK4B;AAJ1B,mHAAA,eAAe,OAAA;AACf,yHAAA,qBAAqB,OAAA;AACrB,uHAAA,mBAAmB,OAAA;AACnB,wHAAA,oBAAoB,OAAA;AAStB,cAAc;AACd,qDAI2B;AAHzB,uHAAA,oBAAoB,OAAA;AACpB,wHAAA,qBAAqB,OAAA;AACrB,oHAAA,iBAAiB,OAAA;AAOnB,aAAa;AACb,mDAI0B;AAHxB,+GAAA,aAAa,OAAA;AACb,oHAAA,kBAAkB,OAAA;AAClB,iHAAA,eAAe,OAAA"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Iteration Schema — Zod 数据模型
3
+ * 定义迭代(期次)的核心数据结构
4
+ */
5
+ import { z } from 'zod';
6
+ export declare const IterationStatusSchema: z.ZodEnum<{
7
+ archived: "archived";
8
+ completed: "completed";
9
+ planning: "planning";
10
+ active: "active";
11
+ paused: "paused";
12
+ }>;
13
+ export declare const IterationGoalSchema: z.ZodObject<{
14
+ description: z.ZodString;
15
+ scope: z.ZodOptional<z.ZodString>;
16
+ deliverables: z.ZodDefault<z.ZodArray<z.ZodString>>;
17
+ successCriteria: z.ZodDefault<z.ZodArray<z.ZodString>>;
18
+ }, z.core.$strip>;
19
+ export declare const IterationStatsSchema: z.ZodObject<{
20
+ totalTasks: z.ZodNumber;
21
+ pendingTasks: z.ZodNumber;
22
+ inProgressTasks: z.ZodNumber;
23
+ completedTasks: z.ZodNumber;
24
+ blockedTasks: z.ZodNumber;
25
+ completionRate: z.ZodNumber;
26
+ }, z.core.$strip>;
27
+ export declare const IterationSchema: z.ZodObject<{
28
+ id: z.ZodString;
29
+ name: z.ZodString;
30
+ status: z.ZodDefault<z.ZodEnum<{
31
+ archived: "archived";
32
+ completed: "completed";
33
+ planning: "planning";
34
+ active: "active";
35
+ paused: "paused";
36
+ }>>;
37
+ priority: z.ZodDefault<z.ZodEnum<{
38
+ high: "high";
39
+ medium: "medium";
40
+ low: "low";
41
+ }>>;
42
+ goal: z.ZodOptional<z.ZodObject<{
43
+ description: z.ZodString;
44
+ scope: z.ZodOptional<z.ZodString>;
45
+ deliverables: z.ZodDefault<z.ZodArray<z.ZodString>>;
46
+ successCriteria: z.ZodDefault<z.ZodArray<z.ZodString>>;
47
+ }, z.core.$strip>>;
48
+ tasks: z.ZodDefault<z.ZodArray<z.ZodString>>;
49
+ requirements: z.ZodDefault<z.ZodArray<z.ZodString>>;
50
+ startDate: z.ZodOptional<z.ZodString>;
51
+ endDate: z.ZodOptional<z.ZodString>;
52
+ assignee: z.ZodOptional<z.ZodString>;
53
+ changelog: z.ZodDefault<z.ZodArray<z.ZodObject<{
54
+ version: z.ZodString;
55
+ date: z.ZodString;
56
+ content: z.ZodString;
57
+ author: z.ZodString;
58
+ }, z.core.$strip>>>;
59
+ createdAt: z.ZodString;
60
+ updatedAt: z.ZodString;
61
+ }, z.core.$strip>;
62
+ export type IterationStatus = z.infer<typeof IterationStatusSchema>;
63
+ export type IterationGoal = z.infer<typeof IterationGoalSchema>;
64
+ export type IterationStats = z.infer<typeof IterationStatsSchema>;
65
+ export type Iteration = z.infer<typeof IterationSchema>;
66
+ //# sourceMappingURL=iteration.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iteration.schema.d.ts","sourceRoot":"","sources":["../../../src/core/schemas/iteration.schema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,qBAAqB;;;;;;EAMhC,CAAC;AAGH,eAAO,MAAM,mBAAmB;;;;;iBAK9B,CAAC;AAGH,eAAO,MAAM,oBAAoB;;;;;;;iBAO/B,CAAC;AAGH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmC1B,CAAC;AAGH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC"}
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ /**
3
+ * Iteration Schema — Zod 数据模型
4
+ * 定义迭代(期次)的核心数据结构
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.IterationSchema = exports.IterationStatsSchema = exports.IterationGoalSchema = exports.IterationStatusSchema = void 0;
8
+ const zod_1 = require("zod");
9
+ const task_schema_1 = require("./task.schema");
10
+ // 迭代状态
11
+ exports.IterationStatusSchema = zod_1.z.enum([
12
+ 'planning', // 规划中
13
+ 'active', // 进行中
14
+ 'paused', // 暂停
15
+ 'completed', // 已完成
16
+ 'archived', // 已归档
17
+ ]);
18
+ // 迭代目标
19
+ exports.IterationGoalSchema = zod_1.z.object({
20
+ description: zod_1.z.string().min(1),
21
+ scope: zod_1.z.string().optional(),
22
+ deliverables: zod_1.z.array(zod_1.z.string()).default([]),
23
+ successCriteria: zod_1.z.array(zod_1.z.string()).default([]),
24
+ });
25
+ // 迭代统计(计算字段,非持久化)
26
+ exports.IterationStatsSchema = zod_1.z.object({
27
+ totalTasks: zod_1.z.number().int().nonnegative(),
28
+ pendingTasks: zod_1.z.number().int().nonnegative(),
29
+ inProgressTasks: zod_1.z.number().int().nonnegative(),
30
+ completedTasks: zod_1.z.number().int().nonnegative(),
31
+ blockedTasks: zod_1.z.number().int().nonnegative(),
32
+ completionRate: zod_1.z.number().min(0).max(100),
33
+ });
34
+ // 迭代核心 Schema
35
+ exports.IterationSchema = zod_1.z.object({
36
+ id: zod_1.z.string().min(1),
37
+ name: zod_1.z.string().min(1).max(100),
38
+ // 状态
39
+ status: exports.IterationStatusSchema.default('planning'),
40
+ priority: task_schema_1.PrioritySchema.default('medium'),
41
+ // 目标
42
+ goal: exports.IterationGoalSchema.optional(),
43
+ // 任务列表(引用 Task ID)
44
+ tasks: zod_1.z.array(zod_1.z.string()).default([]),
45
+ // 关联需求(全量层 REQ-ID)
46
+ requirements: zod_1.z.array(zod_1.z.string()).default([]),
47
+ // 时间规划
48
+ startDate: zod_1.z.string().optional(),
49
+ endDate: zod_1.z.string().optional(),
50
+ // 负责人
51
+ assignee: zod_1.z.string().optional(),
52
+ // 变更历史
53
+ changelog: zod_1.z.array(zod_1.z.object({
54
+ version: zod_1.z.string(),
55
+ date: zod_1.z.string(),
56
+ content: zod_1.z.string(),
57
+ author: zod_1.z.string(),
58
+ })).default([]),
59
+ // 时间戳
60
+ createdAt: zod_1.z.string().datetime(),
61
+ updatedAt: zod_1.z.string().datetime(),
62
+ });
63
+ //# sourceMappingURL=iteration.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iteration.schema.js","sourceRoot":"","sources":["../../../src/core/schemas/iteration.schema.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6BAAwB;AACxB,+CAAiE;AAEjE,OAAO;AACM,QAAA,qBAAqB,GAAG,OAAC,CAAC,IAAI,CAAC;IAC1C,UAAU,EAAK,MAAM;IACrB,QAAQ,EAAQ,MAAM;IACtB,QAAQ,EAAQ,KAAK;IACrB,WAAW,EAAK,MAAM;IACtB,UAAU,EAAM,MAAM;CACvB,CAAC,CAAC;AAEH,OAAO;AACM,QAAA,mBAAmB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC1C,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,YAAY,E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,KAAK,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAEtC,mBAAmB;IACnB,YAAY,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAE7C,OAAO;IACP,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAE9B,MAAM;IACN,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAE/B,OAAO;IACP,SAAS,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,CAAC;QAC1B,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;QACnB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;QAChB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;QACnB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;KACnB,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAEf,MAAM;IACN,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACjC,CAAC,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Platform Schema — Zod 数据模型
3
+ * 定义平台配置的核心数据结构
4
+ * 对应 .speccore/config/platforms.yaml
5
+ */
6
+ import { z } from 'zod';
7
+ export declare const PlatformConfigSchema: z.ZodObject<{
8
+ name: z.ZodString;
9
+ description: z.ZodOptional<z.ZodString>;
10
+ default: z.ZodDefault<z.ZodBoolean>;
11
+ tech_stack: z.ZodOptional<z.ZodString>;
12
+ enabled: z.ZodDefault<z.ZodBoolean>;
13
+ }, z.core.$strip>;
14
+ export declare const PlatformsConfigSchema: z.ZodObject<{
15
+ platforms: z.ZodRecord<z.ZodString, z.ZodObject<{
16
+ name: z.ZodString;
17
+ description: z.ZodOptional<z.ZodString>;
18
+ default: z.ZodDefault<z.ZodBoolean>;
19
+ tech_stack: z.ZodOptional<z.ZodString>;
20
+ enabled: z.ZodDefault<z.ZodBoolean>;
21
+ }, z.core.$strip>>;
22
+ }, z.core.$strip>;
23
+ export type PlatformConfig = z.infer<typeof PlatformConfigSchema>;
24
+ export type PlatformsConfig = z.infer<typeof PlatformsConfigSchema>;
25
+ export declare const DEFAULT_PLATFORMS: PlatformsConfig;
26
+ //# sourceMappingURL=platform.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform.schema.d.ts","sourceRoot":"","sources":["../../../src/core/schemas/platform.schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,oBAAoB;;;;;;iBAM/B,CAAC;AAGH,eAAO,MAAM,qBAAqB;;;;;;;;iBAEhC,CAAC;AAGH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAGpE,eAAO,MAAM,iBAAiB,EAAE,eAwB/B,CAAC"}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ /**
3
+ * Platform Schema — Zod 数据模型
4
+ * 定义平台配置的核心数据结构
5
+ * 对应 .speccore/config/platforms.yaml
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.DEFAULT_PLATFORMS = exports.PlatformsConfigSchema = exports.PlatformConfigSchema = void 0;
9
+ const zod_1 = require("zod");
10
+ // 单个平台配置
11
+ exports.PlatformConfigSchema = zod_1.z.object({
12
+ name: zod_1.z.string().min(1).max(50),
13
+ description: zod_1.z.string().max(200).optional(),
14
+ default: zod_1.z.boolean().default(false),
15
+ tech_stack: zod_1.z.string().optional(),
16
+ enabled: zod_1.z.boolean().default(true),
17
+ });
18
+ // 平台集合(platforms.yaml 顶层结构)
19
+ exports.PlatformsConfigSchema = zod_1.z.object({
20
+ platforms: zod_1.z.record(zod_1.z.string(), exports.PlatformConfigSchema),
21
+ });
22
+ // 默认平台配置
23
+ exports.DEFAULT_PLATFORMS = {
24
+ platforms: {
25
+ web: {
26
+ name: 'Web端',
27
+ description: 'PC Web 端',
28
+ default: true,
29
+ tech_stack: 'Vue 3 + TypeScript + Vite',
30
+ enabled: true,
31
+ },
32
+ h5: {
33
+ name: 'H5端',
34
+ description: '移动端 H5',
35
+ default: true,
36
+ tech_stack: 'Vue 3 + Vant + Vite',
37
+ enabled: true,
38
+ },
39
+ miniapp: {
40
+ name: '小程序端',
41
+ description: '微信小程序',
42
+ default: true,
43
+ tech_stack: 'Taro + TypeScript',
44
+ enabled: true,
45
+ },
46
+ },
47
+ };
48
+ //# sourceMappingURL=platform.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform.schema.js","sourceRoot":"","sources":["../../../src/core/schemas/platform.schema.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,6BAAwB;AAExB,SAAS;AACI,QAAA,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3C,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;IAC/B,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IAC3C,OAAO,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IACnC,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,OAAO,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;CACnC,CAAC,CAAC;AAEH,4BAA4B;AACf,QAAA,qBAAqB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5C,SAAS,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,4BAAoB,CAAC;CACtD,CAAC,CAAC;AAMH,SAAS;AACI,QAAA,iBAAiB,GAAoB;IAChD,SAAS,EAAE;QACT,GAAG,EAAE;YACH,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,UAAU;YACvB,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,2BAA2B;YACvC,OAAO,EAAE,IAAI;SACd;QACD,EAAE,EAAE;YACF,IAAI,EAAE,KAAK;YACX,WAAW,EAAE,QAAQ;YACrB,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,qBAAqB;YACjC,OAAO,EAAE,IAAI;SACd;QACD,OAAO,EAAE;YACP,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,OAAO;YACpB,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,mBAAmB;YAC/B,OAAO,EAAE,IAAI;SACd;KACF;CACF,CAAC"}
@@ -0,0 +1,115 @@
1
+ /**
2
+ * Task Schema — Zod 数据模型
3
+ * 定义 Task(任务)的核心数据结构
4
+ */
5
+ import { z } from 'zod';
6
+ export declare const TaskStatusSchema: z.ZodEnum<{
7
+ archived: "archived";
8
+ pending: "pending";
9
+ in_progress: "in_progress";
10
+ completed: "completed";
11
+ blocked: "blocked";
12
+ }>;
13
+ export declare const TaskTypeSchema: z.ZodEnum<{
14
+ feature: "feature";
15
+ bugfix: "bugfix";
16
+ research: "research";
17
+ optimization: "optimization";
18
+ migration: "migration";
19
+ document: "document";
20
+ }>;
21
+ export declare const PlatformSchema: z.ZodEnum<{
22
+ web: "web";
23
+ h5: "h5";
24
+ miniapp: "miniapp";
25
+ tablet: "tablet";
26
+ tv: "tv";
27
+ }>;
28
+ export declare const PrioritySchema: z.ZodEnum<{
29
+ high: "high";
30
+ medium: "medium";
31
+ low: "low";
32
+ }>;
33
+ export declare const TaskOutputSchema: z.ZodObject<{
34
+ type: z.ZodString;
35
+ path: z.ZodString;
36
+ status: z.ZodDefault<z.ZodEnum<{
37
+ pending: "pending";
38
+ done: "done";
39
+ }>>;
40
+ }, z.core.$strip>;
41
+ export declare const ChangelogEntrySchema: z.ZodObject<{
42
+ version: z.ZodString;
43
+ date: z.ZodString;
44
+ content: z.ZodString;
45
+ source: z.ZodString;
46
+ author: z.ZodString;
47
+ }, z.core.$strip>;
48
+ export declare const AssigneeSchema: z.ZodObject<{
49
+ backend: z.ZodOptional<z.ZodString>;
50
+ frontend: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
51
+ }, z.core.$strip>;
52
+ export declare const TaskSchema: z.ZodObject<{
53
+ id: z.ZodString;
54
+ name: z.ZodString;
55
+ type: z.ZodEnum<{
56
+ feature: "feature";
57
+ bugfix: "bugfix";
58
+ research: "research";
59
+ optimization: "optimization";
60
+ migration: "migration";
61
+ document: "document";
62
+ }>;
63
+ status: z.ZodDefault<z.ZodEnum<{
64
+ archived: "archived";
65
+ pending: "pending";
66
+ in_progress: "in_progress";
67
+ completed: "completed";
68
+ blocked: "blocked";
69
+ }>>;
70
+ priority: z.ZodDefault<z.ZodEnum<{
71
+ high: "high";
72
+ medium: "medium";
73
+ low: "low";
74
+ }>>;
75
+ iteration: z.ZodString;
76
+ dependencies: z.ZodDefault<z.ZodArray<z.ZodString>>;
77
+ platforms: z.ZodDefault<z.ZodArray<z.ZodEnum<{
78
+ web: "web";
79
+ h5: "h5";
80
+ miniapp: "miniapp";
81
+ tablet: "tablet";
82
+ tv: "tv";
83
+ }>>>;
84
+ assignees: z.ZodOptional<z.ZodObject<{
85
+ backend: z.ZodOptional<z.ZodString>;
86
+ frontend: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
87
+ }, z.core.$strip>>;
88
+ outputs: z.ZodDefault<z.ZodArray<z.ZodObject<{
89
+ type: z.ZodString;
90
+ path: z.ZodString;
91
+ status: z.ZodDefault<z.ZodEnum<{
92
+ pending: "pending";
93
+ done: "done";
94
+ }>>;
95
+ }, z.core.$strip>>>;
96
+ acceptanceCriteria: z.ZodDefault<z.ZodArray<z.ZodString>>;
97
+ changelog: z.ZodDefault<z.ZodArray<z.ZodObject<{
98
+ version: z.ZodString;
99
+ date: z.ZodString;
100
+ content: z.ZodString;
101
+ source: z.ZodString;
102
+ author: z.ZodString;
103
+ }, z.core.$strip>>>;
104
+ createdAt: z.ZodString;
105
+ updatedAt: z.ZodString;
106
+ }, z.core.$strip>;
107
+ export type TaskStatus = z.infer<typeof TaskStatusSchema>;
108
+ export type TaskType = z.infer<typeof TaskTypeSchema>;
109
+ export type Platform = z.infer<typeof PlatformSchema>;
110
+ export type Priority = z.infer<typeof PrioritySchema>;
111
+ export type TaskOutput = z.infer<typeof TaskOutputSchema>;
112
+ export type ChangelogEntry = z.infer<typeof ChangelogEntrySchema>;
113
+ export type Assignee = z.infer<typeof AssigneeSchema>;
114
+ export type Task = z.infer<typeof TaskSchema>;
115
+ //# sourceMappingURL=task.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task.schema.d.ts","sourceRoot":"","sources":["../../../src/core/schemas/task.schema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,gBAAgB;;;;;;EAM3B,CAAC;AAGH,eAAO,MAAM,cAAc;;;;;;;EAOzB,CAAC;AAGH,eAAO,MAAM,cAAc;;;;;;EAMzB,CAAC;AAGH,eAAO,MAAM,cAAc;;;;EAIzB,CAAC;AAGH,eAAO,MAAM,gBAAgB;;;;;;;iBAI3B,CAAC;AAGH,eAAO,MAAM,oBAAoB;;;;;;iBAM/B,CAAC;AAIH,eAAO,MAAM,cAAc;;;iBAGzB,CAAC;AAGH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgCrB,CAAC;AAGH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AACtD,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AACtD,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AACtD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AACtD,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ /**
3
+ * Task Schema — Zod 数据模型
4
+ * 定义 Task(任务)的核心数据结构
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.TaskSchema = exports.AssigneeSchema = exports.ChangelogEntrySchema = exports.TaskOutputSchema = exports.PrioritySchema = exports.PlatformSchema = exports.TaskTypeSchema = exports.TaskStatusSchema = void 0;
8
+ const zod_1 = require("zod");
9
+ // 任务状态枚举
10
+ exports.TaskStatusSchema = zod_1.z.enum([
11
+ 'pending',
12
+ 'in_progress',
13
+ 'completed',
14
+ 'blocked',
15
+ 'archived',
16
+ ]);
17
+ // 任务类型枚举
18
+ exports.TaskTypeSchema = zod_1.z.enum([
19
+ 'feature',
20
+ 'bugfix',
21
+ 'research',
22
+ 'optimization',
23
+ 'migration',
24
+ 'document',
25
+ ]);
26
+ // 平台枚举
27
+ exports.PlatformSchema = zod_1.z.enum([
28
+ 'web',
29
+ 'h5',
30
+ 'miniapp',
31
+ 'tablet',
32
+ 'tv',
33
+ ]);
34
+ // 优先级枚举
35
+ exports.PrioritySchema = zod_1.z.enum([
36
+ 'high',
37
+ 'medium',
38
+ 'low',
39
+ ]);
40
+ // 任务产出物
41
+ exports.TaskOutputSchema = zod_1.z.object({
42
+ type: zod_1.z.string().min(1),
43
+ path: zod_1.z.string().min(1),
44
+ status: zod_1.z.enum(['pending', 'done']).default('pending'),
45
+ });
46
+ // 变更记录
47
+ exports.ChangelogEntrySchema = zod_1.z.object({
48
+ version: zod_1.z.string(),
49
+ date: zod_1.z.string(),
50
+ content: zod_1.z.string(),
51
+ source: zod_1.z.string(),
52
+ author: zod_1.z.string(),
53
+ });
54
+ // 执行人分配(支持多平台前端)
55
+ // 使用 string key 而不是 PlatformSchema enum,因为实际使用时只包含启用的平台
56
+ exports.AssigneeSchema = zod_1.z.object({
57
+ backend: zod_1.z.string().optional(),
58
+ frontend: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).optional(),
59
+ });
60
+ // 任务核心 Schema
61
+ exports.TaskSchema = zod_1.z.object({
62
+ // 标识
63
+ id: zod_1.z.string().regex(/^Task-\d{3}$/, 'Task ID must match Task-NNN format'),
64
+ name: zod_1.z.string().min(1).max(100),
65
+ // 分类
66
+ type: exports.TaskTypeSchema,
67
+ status: exports.TaskStatusSchema.default('pending'),
68
+ priority: exports.PrioritySchema.default('medium'),
69
+ // 关联
70
+ iteration: zod_1.z.string().min(1),
71
+ dependencies: zod_1.z.array(zod_1.z.string()).default([]),
72
+ // 平台
73
+ platforms: zod_1.z.array(exports.PlatformSchema).default(['web']),
74
+ // 执行人(按平台分配)
75
+ assignees: exports.AssigneeSchema.optional(),
76
+ // 产出物
77
+ outputs: zod_1.z.array(exports.TaskOutputSchema).default([]),
78
+ // 验收标准
79
+ acceptanceCriteria: zod_1.z.array(zod_1.z.string()).default([]),
80
+ // 变更历史
81
+ changelog: zod_1.z.array(exports.ChangelogEntrySchema).default([]),
82
+ // 时间戳
83
+ createdAt: zod_1.z.string().datetime(),
84
+ updatedAt: zod_1.z.string().datetime(),
85
+ });
86
+ //# sourceMappingURL=task.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task.schema.js","sourceRoot":"","sources":["../../../src/core/schemas/task.schema.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6BAAwB;AAExB,SAAS;AACI,QAAA,gBAAgB,GAAG,OAAC,CAAC,IAAI,CAAC;IACrC,SAAS;IACT,aAAa;IACb,WAAW;IACX,SAAS;IACT,UAAU;CACX,CAAC,CAAC;AAEH,SAAS;AACI,QAAA,cAAc,GAAG,OAAC,CAAC,IAAI,CAAC;IACnC,SAAS;IACT,QAAQ;IACR,UAAU;IACV,cAAc;IACd,WAAW;IACX,UAAU;CACX,CAAC,CAAC;AAEH,OAAO;AACM,QAAA,cAAc,GAAG,OAAC,CAAC,IAAI,CAAC;IACnC,KAAK;IACL,IAAI;IACJ,SAAS;IACT,QAAQ;IACR,IAAI;CACL,CAAC,CAAC;AAEH,QAAQ;AACK,QAAA,cAAc,GAAG,OAAC,CAAC,IAAI,CAAC;IACnC,MAAM;IACN,QAAQ;IACR,KAAK;CACN,CAAC,CAAC;AAEH,QAAQ;AACK,QAAA,gBAAgB,GAAG,OAAC,CAAC,MAAM,CAAC;IACvC,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,MAAM,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;CACvD,CAAC,CAAC;AAEH,OAAO;AACM,QAAA,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3C,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;IAC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IAEpC,MAAM;IACN,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,wBAAgB,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAE9C,OAAO;IACP,kBAAkB,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAEnD,OAAO;IACP,SAAS,EAAE,OAAC,CAAC,KAAK,CAAC,4BAAoB,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAEpD,MAAM;IACN,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACjC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "speccore",
3
- "version": "4.0.1",
3
+ "version": "4.1.0",
4
4
  "description": "SpecCore - Code by Spec, Not by Vibe.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -11,7 +11,9 @@
11
11
  "build": "tsc",
12
12
  "watch": "tsc --watch",
13
13
  "prepublish": "npm run build",
14
- "test": "jest",
14
+ "test": "vitest run",
15
+ "test:watch": "vitest",
16
+ "test:coverage": "vitest run --coverage",
15
17
  "lint": "eslint src/**/*.ts"
16
18
  },
17
19
  "keywords": [
@@ -35,13 +37,16 @@
35
37
  "commander": "^11.1.0",
36
38
  "fs-extra": "^11.2.0",
37
39
  "glob": "^10.3.10",
38
- "js-yaml": "^4.1.0"
40
+ "js-yaml": "^4.1.0",
41
+ "zod": "^4.4.3"
39
42
  },
40
43
  "devDependencies": {
41
44
  "@types/fs-extra": "^11.0.4",
42
45
  "@types/js-yaml": "^4.0.9",
43
46
  "@types/node": "^20.10.5",
44
- "typescript": "^5.3.3"
47
+ "@vitest/coverage-v8": "^4.1.10",
48
+ "typescript": "^5.3.3",
49
+ "vitest": "^4.1.10"
45
50
  },
46
51
  "engines": {
47
52
  "node": ">=18.0.0"