@baoanaz/cviauto-core 0.6.5
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/LICENSE +235 -0
- package/dist/channel/api/assert.d.ts +3 -0
- package/dist/channel/api/assert.d.ts.map +1 -0
- package/dist/channel/api/assert.js +11 -0
- package/dist/channel/api/assert.js.map +1 -0
- package/dist/channel/api/context.d.ts +21 -0
- package/dist/channel/api/context.d.ts.map +1 -0
- package/dist/channel/api/context.js +99 -0
- package/dist/channel/api/context.js.map +1 -0
- package/dist/channel/api/create.d.ts +9 -0
- package/dist/channel/api/create.d.ts.map +1 -0
- package/dist/channel/api/create.js +104 -0
- package/dist/channel/api/create.js.map +1 -0
- package/dist/channel/api/inbox.d.ts +51 -0
- package/dist/channel/api/inbox.d.ts.map +1 -0
- package/dist/channel/api/inbox.js +176 -0
- package/dist/channel/api/inbox.js.map +1 -0
- package/dist/channel/api/interrupt.d.ts +31 -0
- package/dist/channel/api/interrupt.d.ts.map +1 -0
- package/dist/channel/api/interrupt.js +98 -0
- package/dist/channel/api/interrupt.js.map +1 -0
- package/dist/channel/api/post-thread.d.ts +14 -0
- package/dist/channel/api/post-thread.d.ts.map +1 -0
- package/dist/channel/api/post-thread.js +109 -0
- package/dist/channel/api/post-thread.js.map +1 -0
- package/dist/channel/api/read.d.ts +17 -0
- package/dist/channel/api/read.d.ts.map +1 -0
- package/dist/channel/api/read.js +44 -0
- package/dist/channel/api/read.js.map +1 -0
- package/dist/channel/api/resolve.d.ts +21 -0
- package/dist/channel/api/resolve.d.ts.map +1 -0
- package/dist/channel/api/resolve.js +28 -0
- package/dist/channel/api/resolve.js.map +1 -0
- package/dist/channel/api/runtime.d.ts +70 -0
- package/dist/channel/api/runtime.d.ts.map +1 -0
- package/dist/channel/api/runtime.js +11 -0
- package/dist/channel/api/runtime.js.map +1 -0
- package/dist/channel/api/send.d.ts +4 -0
- package/dist/channel/api/send.d.ts.map +1 -0
- package/dist/channel/api/send.js +52 -0
- package/dist/channel/api/send.js.map +1 -0
- package/dist/channel/api/spawn.d.ts +13 -0
- package/dist/channel/api/spawn.d.ts.map +1 -0
- package/dist/channel/api/spawn.js +52 -0
- package/dist/channel/api/spawn.js.map +1 -0
- package/dist/channel/api/title.d.ts +5 -0
- package/dist/channel/api/title.d.ts.map +1 -0
- package/dist/channel/api/title.js +40 -0
- package/dist/channel/api/title.js.map +1 -0
- package/dist/channel/api/types.d.ts +65 -0
- package/dist/channel/api/types.d.ts.map +1 -0
- package/dist/channel/api/types.js +2 -0
- package/dist/channel/api/types.js.map +1 -0
- package/dist/channel/api/watch-channels.d.ts +40 -0
- package/dist/channel/api/watch-channels.d.ts.map +1 -0
- package/dist/channel/api/watch-channels.js +143 -0
- package/dist/channel/api/watch-channels.js.map +1 -0
- package/dist/channel/api/watch.d.ts +11 -0
- package/dist/channel/api/watch.d.ts.map +1 -0
- package/dist/channel/api/watch.js +17 -0
- package/dist/channel/api/watch.js.map +1 -0
- package/dist/channel/api/workers.d.ts +69 -0
- package/dist/channel/api/workers.d.ts.map +1 -0
- package/dist/channel/api/workers.js +143 -0
- package/dist/channel/api/workers.js.map +1 -0
- package/dist/channel/index.d.ts +38 -0
- package/dist/channel/index.d.ts.map +1 -0
- package/dist/channel/index.js +23 -0
- package/dist/channel/index.js.map +1 -0
- package/dist/channel/internal/store/channel-metadata.d.ts +23 -0
- package/dist/channel/internal/store/channel-metadata.d.ts.map +1 -0
- package/dist/channel/internal/store/channel-metadata.js +94 -0
- package/dist/channel/internal/store/channel-metadata.js.map +1 -0
- package/dist/channel/internal/store/delivery.d.ts +27 -0
- package/dist/channel/internal/store/delivery.d.ts.map +1 -0
- package/dist/channel/internal/store/delivery.js +37 -0
- package/dist/channel/internal/store/delivery.js.map +1 -0
- package/dist/channel/internal/store/events.d.ts +215 -0
- package/dist/channel/internal/store/events.d.ts.map +1 -0
- package/dist/channel/internal/store/events.js +204 -0
- package/dist/channel/internal/store/events.js.map +1 -0
- package/dist/channel/internal/store/filter.d.ts +21 -0
- package/dist/channel/internal/store/filter.d.ts.map +1 -0
- package/dist/channel/internal/store/filter.js +75 -0
- package/dist/channel/internal/store/filter.js.map +1 -0
- package/dist/channel/internal/store/inbox.d.ts +17 -0
- package/dist/channel/internal/store/inbox.d.ts.map +1 -0
- package/dist/channel/internal/store/inbox.js +30 -0
- package/dist/channel/internal/store/inbox.js.map +1 -0
- package/dist/channel/internal/store/lock.d.ts +17 -0
- package/dist/channel/internal/store/lock.d.ts.map +1 -0
- package/dist/channel/internal/store/lock.js +88 -0
- package/dist/channel/internal/store/lock.js.map +1 -0
- package/dist/channel/internal/store/paths.d.ts +43 -0
- package/dist/channel/internal/store/paths.d.ts.map +1 -0
- package/dist/channel/internal/store/paths.js +233 -0
- package/dist/channel/internal/store/paths.js.map +1 -0
- package/dist/channel/internal/store/schema.d.ts +77 -0
- package/dist/channel/internal/store/schema.d.ts.map +1 -0
- package/dist/channel/internal/store/schema.js +127 -0
- package/dist/channel/internal/store/schema.js.map +1 -0
- package/dist/channel/internal/store/seq.d.ts +12 -0
- package/dist/channel/internal/store/seq.d.ts.map +1 -0
- package/dist/channel/internal/store/seq.js +134 -0
- package/dist/channel/internal/store/seq.js.map +1 -0
- package/dist/channel/internal/store/thread-state.d.ts +37 -0
- package/dist/channel/internal/store/thread-state.d.ts.map +1 -0
- package/dist/channel/internal/store/thread-state.js +208 -0
- package/dist/channel/internal/store/thread-state.js.map +1 -0
- package/dist/channel/internal/store/watch.d.ts +10 -0
- package/dist/channel/internal/store/watch.d.ts.map +1 -0
- package/dist/channel/internal/store/watch.js +122 -0
- package/dist/channel/internal/store/watch.js.map +1 -0
- package/dist/channel/internal/store/worker-state.d.ts +56 -0
- package/dist/channel/internal/store/worker-state.d.ts.map +1 -0
- package/dist/channel/internal/store/worker-state.js +220 -0
- package/dist/channel/internal/store/worker-state.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/mem/adapters/claude.d.ts +22 -0
- package/dist/mem/adapters/claude.d.ts.map +1 -0
- package/dist/mem/adapters/claude.js +234 -0
- package/dist/mem/adapters/claude.js.map +1 -0
- package/dist/mem/adapters/codex.d.ts +35 -0
- package/dist/mem/adapters/codex.d.ts.map +1 -0
- package/dist/mem/adapters/codex.js +222 -0
- package/dist/mem/adapters/codex.js.map +1 -0
- package/dist/mem/adapters/opencode.d.ts +19 -0
- package/dist/mem/adapters/opencode.d.ts.map +1 -0
- package/dist/mem/adapters/opencode.js +25 -0
- package/dist/mem/adapters/opencode.js.map +1 -0
- package/dist/mem/adapters/pi.d.ts +20 -0
- package/dist/mem/adapters/pi.d.ts.map +1 -0
- package/dist/mem/adapters/pi.js +299 -0
- package/dist/mem/adapters/pi.js.map +1 -0
- package/dist/mem/context.d.ts +23 -0
- package/dist/mem/context.d.ts.map +1 -0
- package/dist/mem/context.js +118 -0
- package/dist/mem/context.js.map +1 -0
- package/dist/mem/dialogue.d.ts +17 -0
- package/dist/mem/dialogue.d.ts.map +1 -0
- package/dist/mem/dialogue.js +51 -0
- package/dist/mem/dialogue.js.map +1 -0
- package/dist/mem/filter.d.ts +31 -0
- package/dist/mem/filter.d.ts.map +1 -0
- package/dist/mem/filter.js +66 -0
- package/dist/mem/filter.js.map +1 -0
- package/dist/mem/index.d.ts +18 -0
- package/dist/mem/index.d.ts.map +1 -0
- package/dist/mem/index.js +17 -0
- package/dist/mem/index.js.map +1 -0
- package/dist/mem/internal/jsonl.d.ts +35 -0
- package/dist/mem/internal/jsonl.d.ts.map +1 -0
- package/dist/mem/internal/jsonl.js +125 -0
- package/dist/mem/internal/jsonl.js.map +1 -0
- package/dist/mem/internal/paths.d.ts +25 -0
- package/dist/mem/internal/paths.d.ts.map +1 -0
- package/dist/mem/internal/paths.js +97 -0
- package/dist/mem/internal/paths.js.map +1 -0
- package/dist/mem/phase.d.ts +45 -0
- package/dist/mem/phase.d.ts.map +1 -0
- package/dist/mem/phase.js +220 -0
- package/dist/mem/phase.js.map +1 -0
- package/dist/mem/projects.d.ts +13 -0
- package/dist/mem/projects.d.ts.map +1 -0
- package/dist/mem/projects.js +37 -0
- package/dist/mem/projects.js.map +1 -0
- package/dist/mem/search.d.ts +32 -0
- package/dist/mem/search.d.ts.map +1 -0
- package/dist/mem/search.js +125 -0
- package/dist/mem/search.js.map +1 -0
- package/dist/mem/sessions.d.ts +37 -0
- package/dist/mem/sessions.d.ts.map +1 -0
- package/dist/mem/sessions.js +279 -0
- package/dist/mem/sessions.js.map +1 -0
- package/dist/mem/types.d.ts +176 -0
- package/dist/mem/types.d.ts.map +1 -0
- package/dist/mem/types.js +10 -0
- package/dist/mem/types.js.map +1 -0
- package/dist/task/index.d.ts +9 -0
- package/dist/task/index.d.ts.map +1 -0
- package/dist/task/index.js +9 -0
- package/dist/task/index.js.map +1 -0
- package/dist/task/paths.d.ts +37 -0
- package/dist/task/paths.d.ts.map +1 -0
- package/dist/task/paths.js +49 -0
- package/dist/task/paths.js.map +1 -0
- package/dist/task/phase.d.ts +27 -0
- package/dist/task/phase.d.ts.map +1 -0
- package/dist/task/phase.js +24 -0
- package/dist/task/phase.js.map +1 -0
- package/dist/task/records.d.ts +39 -0
- package/dist/task/records.d.ts.map +1 -0
- package/dist/task/records.js +89 -0
- package/dist/task/records.js.map +1 -0
- package/dist/task/schema.d.ts +77 -0
- package/dist/task/schema.d.ts.map +1 -0
- package/dist/task/schema.js +220 -0
- package/dist/task/schema.js.map +1 -0
- package/dist/testing/index.d.ts +2 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +4 -0
- package/dist/testing/index.js.map +1 -0
- package/package.json +78 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Infer the phase of a task from either its parsed record or its raw
|
|
3
|
+
* status string. Accepts a record so callers that already have one don't
|
|
4
|
+
* need to re-pluck `status` first.
|
|
5
|
+
*/
|
|
6
|
+
export function inferTaskPhase(recordOrStatus) {
|
|
7
|
+
const status = typeof recordOrStatus === "string"
|
|
8
|
+
? recordOrStatus
|
|
9
|
+
: recordOrStatus?.status;
|
|
10
|
+
switch (status) {
|
|
11
|
+
case "planning":
|
|
12
|
+
return "plan";
|
|
13
|
+
case "in_progress":
|
|
14
|
+
return "implement";
|
|
15
|
+
case "review":
|
|
16
|
+
return "review";
|
|
17
|
+
case "completed":
|
|
18
|
+
case "done":
|
|
19
|
+
return "completed";
|
|
20
|
+
default:
|
|
21
|
+
return "unknown";
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=phase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phase.js","sourceRoot":"","sources":["../../src/task/phase.ts"],"names":[],"mappings":"AA2BA;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAC5B,cAA6D;IAE7D,MAAM,MAAM,GACV,OAAO,cAAc,KAAK,QAAQ;QAChC,CAAC,CAAC,cAAc;QAChB,CAAC,CAAC,cAAc,EAAE,MAAM,CAAC;IAC7B,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,UAAU;YACb,OAAO,MAAM,CAAC;QAChB,KAAK,aAAa;YAChB,OAAO,WAAW,CAAC;QACrB,KAAK,QAAQ;YACX,OAAO,QAAQ,CAAC;QAClB,KAAK,WAAW,CAAC;QACjB,KAAK,MAAM;YACT,OAAO,WAAW,CAAC;QACrB;YACE,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { emptyTaskRecord, type TrellisTaskRecord } from "./schema.js";
|
|
2
|
+
export interface LoadTaskRecordOptions {
|
|
3
|
+
/** Absolute or repo-relative directory containing `task.json`. */
|
|
4
|
+
taskDir: string;
|
|
5
|
+
/** Optional repo root used to resolve relative `taskDir` values. */
|
|
6
|
+
cwd?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface WriteTaskRecordOptions {
|
|
9
|
+
/** Absolute or repo-relative directory containing `task.json`. */
|
|
10
|
+
taskDir: string;
|
|
11
|
+
/** Canonical record to persist. Unknown fields on disk are preserved. */
|
|
12
|
+
record: TrellisTaskRecord;
|
|
13
|
+
/** Optional repo root used to resolve relative `taskDir` values. */
|
|
14
|
+
cwd?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Read a task.json file and return a canonicalized record.
|
|
18
|
+
*
|
|
19
|
+
* Unknown fields on disk that are not part of the canonical 24-field
|
|
20
|
+
* shape are NOT returned — `loadTaskRecord` is the structured public API.
|
|
21
|
+
* To preserve unknown fields across a load/write cycle, callers should
|
|
22
|
+
* use {@link writeTaskRecord}, which merges canonical updates on top of
|
|
23
|
+
* the on-disk JSON object instead of overwriting it.
|
|
24
|
+
*/
|
|
25
|
+
export declare function loadTaskRecord(options: LoadTaskRecordOptions): TrellisTaskRecord;
|
|
26
|
+
/**
|
|
27
|
+
* Write a task.json file with canonical field ordering. Unknown fields
|
|
28
|
+
* already present on disk are preserved verbatim — only the canonical
|
|
29
|
+
* fields are overwritten by `record`. Field order: canonical fields
|
|
30
|
+
* first (in `TASK_RECORD_FIELD_ORDER`), then any preserved unknown
|
|
31
|
+
* fields in their original insertion order. If an existing `task.json` is
|
|
32
|
+
* present but cannot be parsed as a JSON object, the write is rejected instead
|
|
33
|
+
* of silently replacing potentially recoverable local data.
|
|
34
|
+
*
|
|
35
|
+
* The directory containing `task.json` is created if it does not exist.
|
|
36
|
+
*/
|
|
37
|
+
export declare function writeTaskRecord(options: WriteTaskRecordOptions): void;
|
|
38
|
+
export { emptyTaskRecord };
|
|
39
|
+
//# sourceMappingURL=records.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"records.d.ts","sourceRoot":"","sources":["../../src/task/records.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,eAAe,EAGf,KAAK,iBAAiB,EACvB,MAAM,aAAa,CAAC;AAIrB,MAAM,WAAW,qBAAqB;IACpC,kEAAkE;IAClE,OAAO,EAAE,MAAM,CAAC;IAChB,oEAAoE;IACpE,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,sBAAsB;IACrC,kEAAkE;IAClE,OAAO,EAAE,MAAM,CAAC;IAChB,yEAAyE;IACzE,MAAM,EAAE,iBAAiB,CAAC;IAC1B,oEAAoE;IACpE,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,qBAAqB,GAC7B,iBAAiB,CAYnB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,IAAI,CAsBrE;AAoCD,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { TASK_RECORD_FIELD_ORDER, emptyTaskRecord, isPlainObject, taskRecordSchema, } from "./schema.js";
|
|
4
|
+
const TASK_JSON_BASENAME = "task.json";
|
|
5
|
+
/**
|
|
6
|
+
* Read a task.json file and return a canonicalized record.
|
|
7
|
+
*
|
|
8
|
+
* Unknown fields on disk that are not part of the canonical 24-field
|
|
9
|
+
* shape are NOT returned — `loadTaskRecord` is the structured public API.
|
|
10
|
+
* To preserve unknown fields across a load/write cycle, callers should
|
|
11
|
+
* use {@link writeTaskRecord}, which merges canonical updates on top of
|
|
12
|
+
* the on-disk JSON object instead of overwriting it.
|
|
13
|
+
*/
|
|
14
|
+
export function loadTaskRecord(options) {
|
|
15
|
+
const file = resolveTaskJsonPath(options.taskDir, options.cwd);
|
|
16
|
+
const raw = fs.readFileSync(file, "utf-8");
|
|
17
|
+
let parsed;
|
|
18
|
+
try {
|
|
19
|
+
parsed = JSON.parse(raw);
|
|
20
|
+
}
|
|
21
|
+
catch (err) {
|
|
22
|
+
throw new Error(`Failed to parse ${file}: ${err instanceof Error ? err.message : err}`);
|
|
23
|
+
}
|
|
24
|
+
return taskRecordSchema.parse(parsed);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Write a task.json file with canonical field ordering. Unknown fields
|
|
28
|
+
* already present on disk are preserved verbatim — only the canonical
|
|
29
|
+
* fields are overwritten by `record`. Field order: canonical fields
|
|
30
|
+
* first (in `TASK_RECORD_FIELD_ORDER`), then any preserved unknown
|
|
31
|
+
* fields in their original insertion order. If an existing `task.json` is
|
|
32
|
+
* present but cannot be parsed as a JSON object, the write is rejected instead
|
|
33
|
+
* of silently replacing potentially recoverable local data.
|
|
34
|
+
*
|
|
35
|
+
* The directory containing `task.json` is created if it does not exist.
|
|
36
|
+
*/
|
|
37
|
+
export function writeTaskRecord(options) {
|
|
38
|
+
const record = taskRecordSchema.parse(options.record);
|
|
39
|
+
const file = resolveTaskJsonPath(options.taskDir, options.cwd);
|
|
40
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
41
|
+
const existing = readExistingObject(file);
|
|
42
|
+
const out = {};
|
|
43
|
+
const recordBag = record;
|
|
44
|
+
for (const field of TASK_RECORD_FIELD_ORDER) {
|
|
45
|
+
out[field] = recordBag[field];
|
|
46
|
+
}
|
|
47
|
+
if (existing) {
|
|
48
|
+
for (const key of Object.keys(existing)) {
|
|
49
|
+
if (!(key in out)) {
|
|
50
|
+
out[key] = existing[key];
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const json = JSON.stringify(out, null, 2) + "\n";
|
|
55
|
+
fs.writeFileSync(file, json, "utf-8");
|
|
56
|
+
}
|
|
57
|
+
function readExistingObject(file) {
|
|
58
|
+
let raw;
|
|
59
|
+
try {
|
|
60
|
+
raw = fs.readFileSync(file, "utf-8");
|
|
61
|
+
}
|
|
62
|
+
catch (err) {
|
|
63
|
+
if (err.code === "ENOENT")
|
|
64
|
+
return null;
|
|
65
|
+
throw err;
|
|
66
|
+
}
|
|
67
|
+
let parsed;
|
|
68
|
+
try {
|
|
69
|
+
parsed = JSON.parse(raw);
|
|
70
|
+
}
|
|
71
|
+
catch (err) {
|
|
72
|
+
throw new Error(`Refusing to overwrite corrupt ${file}: ${err instanceof Error ? err.message : String(err)}`);
|
|
73
|
+
}
|
|
74
|
+
if (!isPlainObject(parsed)) {
|
|
75
|
+
throw new Error(`Refusing to overwrite non-object task record at ${file}`);
|
|
76
|
+
}
|
|
77
|
+
return parsed;
|
|
78
|
+
}
|
|
79
|
+
function resolveTaskJsonPath(taskDir, cwd) {
|
|
80
|
+
if (path.isAbsolute(taskDir)) {
|
|
81
|
+
return path.join(taskDir, TASK_JSON_BASENAME);
|
|
82
|
+
}
|
|
83
|
+
const base = cwd ?? process.cwd();
|
|
84
|
+
return path.join(path.resolve(base, taskDir), TASK_JSON_BASENAME);
|
|
85
|
+
}
|
|
86
|
+
// Re-exported so callers can build a starter record without hitting the
|
|
87
|
+
// schema module directly.
|
|
88
|
+
export { emptyTaskRecord };
|
|
89
|
+
//# sourceMappingURL=records.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"records.js","sourceRoot":"","sources":["../../src/task/records.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EACL,uBAAuB,EACvB,eAAe,EACf,aAAa,EACb,gBAAgB,GAEjB,MAAM,aAAa,CAAC;AAErB,MAAM,kBAAkB,GAAG,WAAW,CAAC;AAkBvC;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAC5B,OAA8B;IAE9B,MAAM,IAAI,GAAG,mBAAmB,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IAC/D,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC3C,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KA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,CAAC,EAAE,kBAAkB,CAAC,CAAC;AACpE,CAAC;AAED,wEAAwE;AACxE,0BAA0B;AAC1B,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical task.json shape — single source of truth for Trellis tasks.
|
|
3
|
+
*
|
|
4
|
+
* The runtime Python writer is `.cviauto/scripts/common/task_store.py`
|
|
5
|
+
* (`cmd_create`). The 24-field shape and field order below mirror that
|
|
6
|
+
* writer exactly so every TS and Python entry point produces structurally
|
|
7
|
+
* identical task.json files.
|
|
8
|
+
*
|
|
9
|
+
* Downstream consumers (CLI bootstrap, migration tooling, external Node
|
|
10
|
+
* services) should depend on this type instead of redefining their own
|
|
11
|
+
* task.json shape.
|
|
12
|
+
*/
|
|
13
|
+
export interface TrellisTaskRecord {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
title: string;
|
|
17
|
+
description: string;
|
|
18
|
+
status: string;
|
|
19
|
+
dev_type: string | null;
|
|
20
|
+
scope: string | null;
|
|
21
|
+
package: string | null;
|
|
22
|
+
priority: string;
|
|
23
|
+
creator: string;
|
|
24
|
+
assignee: string;
|
|
25
|
+
createdAt: string;
|
|
26
|
+
completedAt: string | null;
|
|
27
|
+
branch: string | null;
|
|
28
|
+
base_branch: string | null;
|
|
29
|
+
worktree_path: string | null;
|
|
30
|
+
commit: string | null;
|
|
31
|
+
pr_url: string | null;
|
|
32
|
+
subtasks: string[];
|
|
33
|
+
children: string[];
|
|
34
|
+
parent: string | null;
|
|
35
|
+
relatedFiles: string[];
|
|
36
|
+
notes: string;
|
|
37
|
+
meta: Record<string, unknown>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Canonical task field order — matches `task_store.py::cmd_create`. Used
|
|
41
|
+
* by `writeTaskRecord` so the on-disk JSON layout is deterministic.
|
|
42
|
+
*/
|
|
43
|
+
export declare const TASK_RECORD_FIELD_ORDER: readonly ["id", "name", "title", "description", "status", "dev_type", "scope", "package", "priority", "creator", "assignee", "createdAt", "completedAt", "branch", "base_branch", "worktree_path", "commit", "pr_url", "subtasks", "children", "parent", "relatedFiles", "notes", "meta"];
|
|
44
|
+
export type TaskRecordField = (typeof TASK_RECORD_FIELD_ORDER)[number];
|
|
45
|
+
/**
|
|
46
|
+
* Lightweight runtime schema for {@link TrellisTaskRecord}. Zero-dep on
|
|
47
|
+
* purpose — `taskRecordSchema.parse(input)` returns a canonicalized
|
|
48
|
+
* record, throwing on shape violations; `taskRecordSchema.safeParse`
|
|
49
|
+
* returns a result discriminated by `success`.
|
|
50
|
+
*
|
|
51
|
+
* All canonical fields are required; older partial records are rejected rather
|
|
52
|
+
* than backfilled with defaults. Unknown fields on the input are intentionally
|
|
53
|
+
* omitted from this structured output. `writeTaskRecord` preserves unknown
|
|
54
|
+
* fields already present on disk by merging canonical updates over the existing
|
|
55
|
+
* JSON object.
|
|
56
|
+
*/
|
|
57
|
+
export declare const taskRecordSchema: {
|
|
58
|
+
readonly parse: (input: unknown) => TrellisTaskRecord;
|
|
59
|
+
readonly safeParse: (input: unknown) => {
|
|
60
|
+
success: true;
|
|
61
|
+
data: TrellisTaskRecord;
|
|
62
|
+
} | {
|
|
63
|
+
success: false;
|
|
64
|
+
error: Error;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Produce a fully-populated canonical-shape {@link TrellisTaskRecord}.
|
|
69
|
+
*
|
|
70
|
+
* All 24 fields are present in canonical order. `overrides` shallow-merges
|
|
71
|
+
* over the defaults — callers supply per-task values (id, name, title,
|
|
72
|
+
* assignee, createdAt, etc.) and leave null-default fields untouched
|
|
73
|
+
* unless they have a real value.
|
|
74
|
+
*/
|
|
75
|
+
export declare function emptyTaskRecord(overrides?: Partial<TrellisTaskRecord>): TrellisTaskRecord;
|
|
76
|
+
export declare function isPlainObject(value: unknown): value is Record<string, unknown>;
|
|
77
|
+
//# sourceMappingURL=schema.d.ts.map
|
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AAgB;4BACd,OAAO,KAAG,iBAAiB;gCAI/B,OAAO,KAEZ;QAAE,OAAO,EAAE,IAAI,CAAC;QAAC,IAAI,EAAE,iBAAiB,CAAA;KAAE,GAC1C;QAAE,OAAO,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,KAAK,CAAA;KAAE;CAU5B,CAAC;AAwDX;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,SAAS,GAAE,OAAO,CAAC,iBAAiB,CAAM,GACzC,iBAAiB,CA0CnB;AAED,wBAAgB,aAAa,CAC3B,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAOlC"}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical task field order — matches `task_store.py::cmd_create`. Used
|
|
3
|
+
* by `writeTaskRecord` so the on-disk JSON layout is deterministic.
|
|
4
|
+
*/
|
|
5
|
+
export const TASK_RECORD_FIELD_ORDER = [
|
|
6
|
+
"id",
|
|
7
|
+
"name",
|
|
8
|
+
"title",
|
|
9
|
+
"description",
|
|
10
|
+
"status",
|
|
11
|
+
"dev_type",
|
|
12
|
+
"scope",
|
|
13
|
+
"package",
|
|
14
|
+
"priority",
|
|
15
|
+
"creator",
|
|
16
|
+
"assignee",
|
|
17
|
+
"createdAt",
|
|
18
|
+
"completedAt",
|
|
19
|
+
"branch",
|
|
20
|
+
"base_branch",
|
|
21
|
+
"worktree_path",
|
|
22
|
+
"commit",
|
|
23
|
+
"pr_url",
|
|
24
|
+
"subtasks",
|
|
25
|
+
"children",
|
|
26
|
+
"parent",
|
|
27
|
+
"relatedFiles",
|
|
28
|
+
"notes",
|
|
29
|
+
"meta",
|
|
30
|
+
];
|
|
31
|
+
const STRING_FIELDS = new Set([
|
|
32
|
+
"id",
|
|
33
|
+
"name",
|
|
34
|
+
"title",
|
|
35
|
+
"description",
|
|
36
|
+
"status",
|
|
37
|
+
"priority",
|
|
38
|
+
"creator",
|
|
39
|
+
"assignee",
|
|
40
|
+
"createdAt",
|
|
41
|
+
"notes",
|
|
42
|
+
]);
|
|
43
|
+
const NULLABLE_STRING_FIELDS = new Set([
|
|
44
|
+
"dev_type",
|
|
45
|
+
"scope",
|
|
46
|
+
"package",
|
|
47
|
+
"completedAt",
|
|
48
|
+
"branch",
|
|
49
|
+
"base_branch",
|
|
50
|
+
"worktree_path",
|
|
51
|
+
"commit",
|
|
52
|
+
"pr_url",
|
|
53
|
+
"parent",
|
|
54
|
+
]);
|
|
55
|
+
const STRING_ARRAY_FIELDS = new Set([
|
|
56
|
+
"subtasks",
|
|
57
|
+
"children",
|
|
58
|
+
"relatedFiles",
|
|
59
|
+
]);
|
|
60
|
+
/**
|
|
61
|
+
* Lightweight runtime schema for {@link TrellisTaskRecord}. Zero-dep on
|
|
62
|
+
* purpose — `taskRecordSchema.parse(input)` returns a canonicalized
|
|
63
|
+
* record, throwing on shape violations; `taskRecordSchema.safeParse`
|
|
64
|
+
* returns a result discriminated by `success`.
|
|
65
|
+
*
|
|
66
|
+
* All canonical fields are required; older partial records are rejected rather
|
|
67
|
+
* than backfilled with defaults. Unknown fields on the input are intentionally
|
|
68
|
+
* omitted from this structured output. `writeTaskRecord` preserves unknown
|
|
69
|
+
* fields already present on disk by merging canonical updates over the existing
|
|
70
|
+
* JSON object.
|
|
71
|
+
*/
|
|
72
|
+
export const taskRecordSchema = {
|
|
73
|
+
parse(input) {
|
|
74
|
+
return parseTaskRecord(input);
|
|
75
|
+
},
|
|
76
|
+
safeParse(input) {
|
|
77
|
+
try {
|
|
78
|
+
return { success: true, data: parseTaskRecord(input) };
|
|
79
|
+
}
|
|
80
|
+
catch (err) {
|
|
81
|
+
return {
|
|
82
|
+
success: false,
|
|
83
|
+
error: err instanceof Error ? err : new Error(String(err)),
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
function parseTaskRecord(input) {
|
|
89
|
+
if (!isPlainObject(input)) {
|
|
90
|
+
throw new Error("task record must be a JSON object");
|
|
91
|
+
}
|
|
92
|
+
const out = emptyTaskRecord();
|
|
93
|
+
for (const field of TASK_RECORD_FIELD_ORDER) {
|
|
94
|
+
if (!(field in input)) {
|
|
95
|
+
throw new Error(`task.${field} is required`);
|
|
96
|
+
}
|
|
97
|
+
const value = input[field];
|
|
98
|
+
assignField(out, field, value);
|
|
99
|
+
}
|
|
100
|
+
return out;
|
|
101
|
+
}
|
|
102
|
+
function assignField(record, field, value) {
|
|
103
|
+
const bag = record;
|
|
104
|
+
if (STRING_FIELDS.has(field)) {
|
|
105
|
+
if (typeof value !== "string") {
|
|
106
|
+
throw new Error(`task.${field} must be a string`);
|
|
107
|
+
}
|
|
108
|
+
bag[field] = value;
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
if (NULLABLE_STRING_FIELDS.has(field)) {
|
|
112
|
+
if (value !== null && typeof value !== "string") {
|
|
113
|
+
throw new Error(`task.${field} must be a string or null`);
|
|
114
|
+
}
|
|
115
|
+
bag[field] = value;
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
if (STRING_ARRAY_FIELDS.has(field)) {
|
|
119
|
+
if (!Array.isArray(value) || value.some((v) => typeof v !== "string")) {
|
|
120
|
+
throw new Error(`task.${field} must be an array of strings`);
|
|
121
|
+
}
|
|
122
|
+
bag[field] = [...value];
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
if (field === "meta") {
|
|
126
|
+
if (!isPlainObject(value)) {
|
|
127
|
+
throw new Error("task.meta must be a JSON object");
|
|
128
|
+
}
|
|
129
|
+
record.meta = cloneJsonObject(value, "task.meta");
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
// Should be unreachable given the field sets cover every canonical field.
|
|
133
|
+
/* c8 ignore next */
|
|
134
|
+
throw new Error(`unknown canonical task field: ${field}`);
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Produce a fully-populated canonical-shape {@link TrellisTaskRecord}.
|
|
138
|
+
*
|
|
139
|
+
* All 24 fields are present in canonical order. `overrides` shallow-merges
|
|
140
|
+
* over the defaults — callers supply per-task values (id, name, title,
|
|
141
|
+
* assignee, createdAt, etc.) and leave null-default fields untouched
|
|
142
|
+
* unless they have a real value.
|
|
143
|
+
*/
|
|
144
|
+
export function emptyTaskRecord(overrides = {}) {
|
|
145
|
+
const today = new Date().toISOString().split("T")[0] ?? "";
|
|
146
|
+
const base = {
|
|
147
|
+
id: "",
|
|
148
|
+
name: "",
|
|
149
|
+
title: "",
|
|
150
|
+
description: "",
|
|
151
|
+
status: "planning",
|
|
152
|
+
dev_type: null,
|
|
153
|
+
scope: null,
|
|
154
|
+
package: null,
|
|
155
|
+
priority: "P2",
|
|
156
|
+
creator: "",
|
|
157
|
+
assignee: "",
|
|
158
|
+
createdAt: today,
|
|
159
|
+
completedAt: null,
|
|
160
|
+
branch: null,
|
|
161
|
+
base_branch: null,
|
|
162
|
+
worktree_path: null,
|
|
163
|
+
commit: null,
|
|
164
|
+
pr_url: null,
|
|
165
|
+
subtasks: [],
|
|
166
|
+
children: [],
|
|
167
|
+
parent: null,
|
|
168
|
+
relatedFiles: [],
|
|
169
|
+
notes: "",
|
|
170
|
+
meta: {},
|
|
171
|
+
};
|
|
172
|
+
const record = { ...base, ...overrides };
|
|
173
|
+
if (overrides.subtasks !== undefined) {
|
|
174
|
+
record.subtasks = [...overrides.subtasks];
|
|
175
|
+
}
|
|
176
|
+
if (overrides.children !== undefined) {
|
|
177
|
+
record.children = [...overrides.children];
|
|
178
|
+
}
|
|
179
|
+
if (overrides.relatedFiles !== undefined) {
|
|
180
|
+
record.relatedFiles = [...overrides.relatedFiles];
|
|
181
|
+
}
|
|
182
|
+
if (overrides.meta !== undefined) {
|
|
183
|
+
record.meta = cloneJsonObject(overrides.meta, "task.meta");
|
|
184
|
+
}
|
|
185
|
+
return record;
|
|
186
|
+
}
|
|
187
|
+
export function isPlainObject(value) {
|
|
188
|
+
return (typeof value === "object" &&
|
|
189
|
+
value !== null &&
|
|
190
|
+
!Array.isArray(value) &&
|
|
191
|
+
Object.getPrototypeOf(value) === Object.prototype);
|
|
192
|
+
}
|
|
193
|
+
function cloneJsonObject(value, path) {
|
|
194
|
+
const out = {};
|
|
195
|
+
for (const [key, child] of Object.entries(value)) {
|
|
196
|
+
out[key] = cloneJsonValue(child, `${path}.${key}`);
|
|
197
|
+
}
|
|
198
|
+
return out;
|
|
199
|
+
}
|
|
200
|
+
function cloneJsonValue(value, path) {
|
|
201
|
+
if (value === null ||
|
|
202
|
+
typeof value === "string" ||
|
|
203
|
+
typeof value === "boolean") {
|
|
204
|
+
return value;
|
|
205
|
+
}
|
|
206
|
+
if (typeof value === "number") {
|
|
207
|
+
if (!Number.isFinite(value)) {
|
|
208
|
+
throw new Error(`${path} must be a finite JSON number`);
|
|
209
|
+
}
|
|
210
|
+
return value;
|
|
211
|
+
}
|
|
212
|
+
if (Array.isArray(value)) {
|
|
213
|
+
return value.map((item, index) => cloneJsonValue(item, `${path}[${index}]`));
|
|
214
|
+
}
|
|
215
|
+
if (isPlainObject(value)) {
|
|
216
|
+
return cloneJsonObject(value, path);
|
|
217
|
+
}
|
|
218
|
+
throw new Error(`${path} must contain only JSON values`);
|
|
219
|
+
}
|
|
220
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/task/schema.ts"],"names":[],"mappings":"AAuCA;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,IAAI;IACJ,MAAM;IACN,OAAO;IACP,aAAa;IACb,QAAQ;IACR,UAAU;IACV,OAAO;IACP,SAAS;IACT,UAAU;IACV,SAAS;IACT,UAAU;IACV,WAAW;IACX,aAAa;IACb,QAAQ;IACR,aAAa;IACb,eAAe;IACf,QAAQ;IACR,QAAQ;IACR,UAAU;IACV,UAAU;IACV,QAAQ;IACR,cAAc;IACd,OAAO;IACP,MAAM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ACb,CAAC;AAED,SAAS,cAAc,CAAC,KAAc,EAAE,IAAY;IAClD,IACE,KAAK,KAAK,IAAI;QACd,OAAO,KAAK,KAAK,QAAQ;QACzB,OAAO,KAAK,KAAK,SAAS,EAC1B,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YAC5B,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,+BAA+B,CAAC,CAAC;QAC1D,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAC/B,cAAc,CAAC,IAAI,EAAE,GAAG,IAAI,IAAI,KAAK,GAAG,CAAC,CAC1C,CAAC;IACJ,CAAC;IACD,IAAI,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACtC,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,gCAAgC,CAAC,CAAC;AAC3D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,0CAA0C"}
|
package/package.json
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@baoanaz/cviauto-core",
|
|
3
|
+
"version": "0.6.5",
|
|
4
|
+
"description": "Cviauto core SDK — channel and task domain primitives consumed by the Cviauto CLI and downstream Node services",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
"./package.json": "./package.json",
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./channel": {
|
|
16
|
+
"types": "./dist/channel/index.d.ts",
|
|
17
|
+
"import": "./dist/channel/index.js",
|
|
18
|
+
"default": "./dist/channel/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./mem": {
|
|
21
|
+
"types": "./dist/mem/index.d.ts",
|
|
22
|
+
"import": "./dist/mem/index.js",
|
|
23
|
+
"default": "./dist/mem/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./task": {
|
|
26
|
+
"types": "./dist/task/index.d.ts",
|
|
27
|
+
"import": "./dist/task/index.js",
|
|
28
|
+
"default": "./dist/task/index.js"
|
|
29
|
+
},
|
|
30
|
+
"./testing": {
|
|
31
|
+
"types": "./dist/testing/index.d.ts",
|
|
32
|
+
"import": "./dist/testing/index.js",
|
|
33
|
+
"default": "./dist/testing/index.js"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"files": [
|
|
37
|
+
"dist"
|
|
38
|
+
],
|
|
39
|
+
"sideEffects": false,
|
|
40
|
+
"publishConfig": {
|
|
41
|
+
"access": "public",
|
|
42
|
+
"provenance": true
|
|
43
|
+
},
|
|
44
|
+
"keywords": [
|
|
45
|
+
"cviauto",
|
|
46
|
+
"channel",
|
|
47
|
+
"sdk",
|
|
48
|
+
"agent",
|
|
49
|
+
"events"
|
|
50
|
+
],
|
|
51
|
+
"author": "Mindfold LLC",
|
|
52
|
+
"license": "AGPL-3.0-only",
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@eslint/js": "^9.18.0",
|
|
55
|
+
"@types/node": "^20.17.10",
|
|
56
|
+
"eslint": "^9.18.0",
|
|
57
|
+
"typescript": "^5.7.2",
|
|
58
|
+
"typescript-eslint": "^8.21.0",
|
|
59
|
+
"vitest": "^4.0.18"
|
|
60
|
+
},
|
|
61
|
+
"engines": {
|
|
62
|
+
"node": ">=18.17.0"
|
|
63
|
+
},
|
|
64
|
+
"repository": {
|
|
65
|
+
"type": "git",
|
|
66
|
+
"url": "https://github.com/baoanaz/cviauto-trellis.git"
|
|
67
|
+
},
|
|
68
|
+
"scripts": {
|
|
69
|
+
"build": "pnpm run clean && tsc",
|
|
70
|
+
"clean": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"",
|
|
71
|
+
"dev": "tsc --watch",
|
|
72
|
+
"test": "vitest run",
|
|
73
|
+
"test:watch": "vitest",
|
|
74
|
+
"lint": "eslint src/ test/",
|
|
75
|
+
"lint:fix": "eslint src/ test/ --fix",
|
|
76
|
+
"typecheck": "tsc --noEmit"
|
|
77
|
+
}
|
|
78
|
+
}
|