@cristochang/spec-core 0.1.0 → 0.1.1
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 +0 -2
- package/dist/schema.d.ts +41 -6
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -43,8 +43,6 @@ var SpecInfo = z.object({
|
|
|
43
43
|
// Auto-filled (optional)
|
|
44
44
|
changes: z.array(z.string().min(1)).optional().describe("List of files modified (auto-filled, non-empty strings)"),
|
|
45
45
|
verification: z.string().optional().describe("Verification result (auto-filled)")
|
|
46
|
-
}).meta({
|
|
47
|
-
ref: "Spec"
|
|
48
46
|
});
|
|
49
47
|
|
|
50
48
|
// src/index.ts
|
package/dist/schema.d.ts
CHANGED
|
@@ -1,12 +1,47 @@
|
|
|
1
|
-
import z from "zod"
|
|
1
|
+
import z from "zod"
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* Spec status values
|
|
4
5
|
*/
|
|
5
|
-
export
|
|
6
|
-
export type SpecStatus = z.infer<typeof SpecStatusSchema
|
|
6
|
+
export const SpecStatusSchema = z.enum(["pending", "approved", "implemented", "cancelled"])
|
|
7
|
+
export type SpecStatus = z.infer<typeof SpecStatusSchema>
|
|
8
|
+
|
|
7
9
|
/**
|
|
8
10
|
* Main Spec data structure
|
|
9
11
|
*/
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
export const SpecInfo = z
|
|
13
|
+
.object({
|
|
14
|
+
// Meta (required)
|
|
15
|
+
id: z.string().describe("Unique identifier for the spec (ULID)"),
|
|
16
|
+
created: z
|
|
17
|
+
.string()
|
|
18
|
+
.datetime()
|
|
19
|
+
.describe("ISO 8601 timestamp of creation (Zod validated)"),
|
|
20
|
+
status: SpecStatusSchema.describe("Current status of the spec"),
|
|
21
|
+
|
|
22
|
+
// Core (required)
|
|
23
|
+
objective: z.string().describe("Clear, one-sentence objective"),
|
|
24
|
+
scope: z
|
|
25
|
+
.object({
|
|
26
|
+
inclusions: z.array(z.string()).min(1).describe("Items to include in scope (at least one)"),
|
|
27
|
+
exclusions: z.array(z.string()).min(0).describe("Items explicitly excluded from scope"),
|
|
28
|
+
})
|
|
29
|
+
.describe("Scope boundaries"),
|
|
30
|
+
successCriteria: z.array(z.string()).describe("Verifiable success criteria"),
|
|
31
|
+
|
|
32
|
+
// Optional
|
|
33
|
+
constraints: z.array(z.string()).optional().describe("Technical or architectural constraints"),
|
|
34
|
+
implementationNotes: z
|
|
35
|
+
.string()
|
|
36
|
+
.optional()
|
|
37
|
+
.describe("Non-binding implementation guidance for AI; not a requirement"),
|
|
38
|
+
|
|
39
|
+
// Auto-filled (optional)
|
|
40
|
+
changes: z
|
|
41
|
+
.array(z.string().min(1))
|
|
42
|
+
.optional()
|
|
43
|
+
.describe("List of files modified (auto-filled, non-empty strings)"),
|
|
44
|
+
verification: z.string().optional().describe("Verification result (auto-filled)"),
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
export type SpecInfo = z.infer<typeof SpecInfo>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@cristochang/spec-core",
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Spec data structures and validation for OpenCode",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
],
|
|
41
41
|
"author": "OpenCode",
|
|
42
42
|
"license": "MIT",
|
|
43
|
-
"dependencies": {
|
|
44
|
-
"zod": "^
|
|
45
|
-
"ulid": "^
|
|
46
|
-
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"zod": "^4.0.0",
|
|
45
|
+
"ulid": "^3.0.0"
|
|
46
|
+
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/node": "22.13.9",
|
|
49
49
|
"esbuild": "0.27.2",
|