@cleocode/contracts 2026.5.99 → 2026.5.100
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/__tests__/operations-registry.test.d.ts +15 -0
- package/dist/__tests__/operations-registry.test.d.ts.map +1 -0
- package/dist/__tests__/operations-registry.test.js +48 -0
- package/dist/__tests__/operations-registry.test.js.map +1 -0
- package/dist/dispatch/operations-registry.d.ts +33 -0
- package/dist/dispatch/operations-registry.d.ts.map +1 -0
- package/dist/dispatch/operations-registry.js +7709 -0
- package/dist/dispatch/operations-registry.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/project-tools.d.ts +105 -0
- package/dist/project-tools.d.ts.map +1 -0
- package/dist/project-tools.js +14 -0
- package/dist/project-tools.js.map +1 -0
- package/dist/release/plan.d.ts +3 -3
- package/dist/tools/brain-fetch.d.ts +22 -0
- package/dist/tools/brain-fetch.d.ts.map +1 -0
- package/dist/tools/brain-fetch.js +9 -0
- package/dist/tools/brain-fetch.js.map +1 -0
- package/dist/tools/brain-observe.d.ts +22 -0
- package/dist/tools/brain-observe.d.ts.map +1 -0
- package/dist/tools/brain-observe.js +9 -0
- package/dist/tools/brain-observe.js.map +1 -0
- package/dist/tools/brain-search.d.ts +22 -0
- package/dist/tools/brain-search.d.ts.map +1 -0
- package/dist/tools/brain-search.js +9 -0
- package/dist/tools/brain-search.js.map +1 -0
- package/dist/tools/brain-timeline.d.ts +22 -0
- package/dist/tools/brain-timeline.d.ts.map +1 -0
- package/dist/tools/brain-timeline.js +9 -0
- package/dist/tools/brain-timeline.js.map +1 -0
- package/dist/tools/build-retrieval-bundle.d.ts +22 -0
- package/dist/tools/build-retrieval-bundle.d.ts.map +1 -0
- package/dist/tools/build-retrieval-bundle.js +9 -0
- package/dist/tools/build-retrieval-bundle.js.map +1 -0
- package/dist/tools/build-task-tree.d.ts +44 -0
- package/dist/tools/build-task-tree.d.ts.map +1 -0
- package/dist/tools/build-task-tree.js +9 -0
- package/dist/tools/build-task-tree.js.map +1 -0
- package/dist/tools/compute-critical-path.d.ts +33 -0
- package/dist/tools/compute-critical-path.d.ts.map +1 -0
- package/dist/tools/compute-critical-path.js +9 -0
- package/dist/tools/compute-critical-path.js.map +1 -0
- package/dist/tools/describe-schema.d.ts +40 -0
- package/dist/tools/describe-schema.d.ts.map +1 -0
- package/dist/tools/describe-schema.js +9 -0
- package/dist/tools/describe-schema.js.map +1 -0
- package/dist/tools/index.d.ts +19 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +10 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/render-task-tree.d.ts +18 -0
- package/dist/tools/render-task-tree.d.ts.map +1 -0
- package/dist/tools/render-task-tree.js +9 -0
- package/dist/tools/render-task-tree.js.map +1 -0
- package/dist/tools/score-task-priority.d.ts +59 -0
- package/dist/tools/score-task-priority.d.ts.map +1 -0
- package/dist/tools/score-task-priority.js +9 -0
- package/dist/tools/score-task-priority.js.map +1 -0
- package/package.json +2 -2
- package/src/__tests__/__snapshots__/operations-registry.test.ts.snap +3 -0
- package/src/__tests__/operations-registry.test.ts +53 -0
- package/src/dispatch/operations-registry.ts +7987 -0
- package/src/index.ts +45 -0
- package/src/project-tools.ts +117 -0
- package/src/tools/brain-fetch.ts +25 -0
- package/src/tools/brain-observe.ts +25 -0
- package/src/tools/brain-search.ts +25 -0
- package/src/tools/brain-timeline.ts +25 -0
- package/src/tools/build-retrieval-bundle.ts +25 -0
- package/src/tools/build-task-tree.ts +48 -0
- package/src/tools/compute-critical-path.ts +35 -0
- package/src/tools/describe-schema.ts +43 -0
- package/src/tools/index.ts +43 -0
- package/src/tools/render-task-tree.ts +19 -0
- package/src/tools/score-task-priority.ts +59 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ProjectTools contracts — input/output types for scaffold-project,
|
|
3
|
+
* doctor-project, and scaffold-global SDK tools.
|
|
4
|
+
*
|
|
5
|
+
* These are pure-functional, harness-agnostic operation contracts. Each
|
|
6
|
+
* tool function accepts an options bag and returns a typed result envelope —
|
|
7
|
+
* no I/O is performed inside the contract shapes themselves.
|
|
8
|
+
*
|
|
9
|
+
* Taxonomy: Category B SDK Tool (ADR-064).
|
|
10
|
+
*
|
|
11
|
+
* @since SG-ARCH-SOLID Saga T9831 · E-CORE-TOOLS T9835 (T9835b)
|
|
12
|
+
*/
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=project-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-tools.js","sourceRoot":"","sources":["../src/project-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG"}
|
package/dist/release/plan.d.ts
CHANGED
|
@@ -169,8 +169,8 @@ export declare const TaskKindSchema: z.ZodEnum<{
|
|
|
169
169
|
refactor: "refactor";
|
|
170
170
|
chore: "chore";
|
|
171
171
|
breaking: "breaking";
|
|
172
|
-
revert: "revert";
|
|
173
172
|
hotfix: "hotfix";
|
|
173
|
+
revert: "revert";
|
|
174
174
|
}>;
|
|
175
175
|
/** Zod schema for {@link IMPACT}. */
|
|
176
176
|
export declare const ImpactSchema: z.ZodEnum<{
|
|
@@ -207,8 +207,8 @@ export declare const ReleasePlanTaskSchema: z.ZodObject<{
|
|
|
207
207
|
refactor: "refactor";
|
|
208
208
|
chore: "chore";
|
|
209
209
|
breaking: "breaking";
|
|
210
|
-
revert: "revert";
|
|
211
210
|
hotfix: "hotfix";
|
|
211
|
+
revert: "revert";
|
|
212
212
|
}>;
|
|
213
213
|
impact: z.ZodEnum<{
|
|
214
214
|
major: "major";
|
|
@@ -372,8 +372,8 @@ export declare const ReleasePlanSchema: z.ZodObject<{
|
|
|
372
372
|
refactor: "refactor";
|
|
373
373
|
chore: "chore";
|
|
374
374
|
breaking: "breaking";
|
|
375
|
-
revert: "revert";
|
|
376
375
|
hotfix: "hotfix";
|
|
376
|
+
revert: "revert";
|
|
377
377
|
}>;
|
|
378
378
|
impact: z.ZodEnum<{
|
|
379
379
|
major: "major";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contract types for the fetchBrainEntries SDK tool.
|
|
3
|
+
*
|
|
4
|
+
* @arch SDK Tool (Category B) — harness-agnostic, pure-functional wrapper
|
|
5
|
+
* @task T10070
|
|
6
|
+
* @epic T9835
|
|
7
|
+
*/
|
|
8
|
+
import type { FetchBrainEntriesParams, FetchBrainEntriesResult } from '../memory/fetch.js';
|
|
9
|
+
export type { FetchBrainEntriesParams, FetchBrainEntriesResult };
|
|
10
|
+
/** Input accepted by the fetchBrainEntries SDK tool. */
|
|
11
|
+
export interface FetchBrainEntriesInput {
|
|
12
|
+
/** Project root directory for DB resolution. */
|
|
13
|
+
projectRoot: string;
|
|
14
|
+
/** Fetch parameters forwarded to fetchBrainEntries. */
|
|
15
|
+
params: FetchBrainEntriesParams;
|
|
16
|
+
}
|
|
17
|
+
/** Output produced by the fetchBrainEntries SDK tool. */
|
|
18
|
+
export interface FetchBrainEntriesOutput {
|
|
19
|
+
/** Result from fetchBrainEntries. */
|
|
20
|
+
result: FetchBrainEntriesResult;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=brain-fetch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brain-fetch.d.ts","sourceRoot":"","sources":["../../src/tools/brain-fetch.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE3F,YAAY,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,CAAC;AAEjE,wDAAwD;AACxD,MAAM,WAAW,sBAAsB;IACrC,gDAAgD;IAChD,WAAW,EAAE,MAAM,CAAC;IACpB,uDAAuD;IACvD,MAAM,EAAE,uBAAuB,CAAC;CACjC;AAED,yDAAyD;AACzD,MAAM,WAAW,uBAAuB;IACtC,qCAAqC;IACrC,MAAM,EAAE,uBAAuB,CAAC;CACjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brain-fetch.js","sourceRoot":"","sources":["../../src/tools/brain-fetch.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contract types for the observeBrain SDK tool.
|
|
3
|
+
*
|
|
4
|
+
* @arch SDK Tool (Category B) — harness-agnostic, pure-functional wrapper
|
|
5
|
+
* @task T10070
|
|
6
|
+
* @epic T9835
|
|
7
|
+
*/
|
|
8
|
+
import type { ObserveBrainParams, ObserveBrainResult } from '../memory/observe.js';
|
|
9
|
+
export type { ObserveBrainParams, ObserveBrainResult };
|
|
10
|
+
/** Input accepted by the observeBrain SDK tool. */
|
|
11
|
+
export interface ObserveBrainInput {
|
|
12
|
+
/** Project root directory for DB resolution. */
|
|
13
|
+
projectRoot: string;
|
|
14
|
+
/** Observation data forwarded to observeBrain. */
|
|
15
|
+
params: ObserveBrainParams;
|
|
16
|
+
}
|
|
17
|
+
/** Output produced by the observeBrain SDK tool. */
|
|
18
|
+
export interface ObserveBrainOutput {
|
|
19
|
+
/** Result from observeBrain. */
|
|
20
|
+
result: ObserveBrainResult;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=brain-observe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brain-observe.d.ts","sourceRoot":"","sources":["../../src/tools/brain-observe.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAEnF,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,CAAC;AAEvD,mDAAmD;AACnD,MAAM,WAAW,iBAAiB;IAChC,gDAAgD;IAChD,WAAW,EAAE,MAAM,CAAC;IACpB,kDAAkD;IAClD,MAAM,EAAE,kBAAkB,CAAC;CAC5B;AAED,oDAAoD;AACpD,MAAM,WAAW,kBAAkB;IACjC,gCAAgC;IAChC,MAAM,EAAE,kBAAkB,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brain-observe.js","sourceRoot":"","sources":["../../src/tools/brain-observe.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contract types for the searchBrain SDK tool.
|
|
3
|
+
*
|
|
4
|
+
* @arch SDK Tool (Category B) — harness-agnostic, pure-functional wrapper
|
|
5
|
+
* @task T10070
|
|
6
|
+
* @epic T9835
|
|
7
|
+
*/
|
|
8
|
+
import type { SearchBrainCompactParams, SearchBrainCompactResult } from '../memory/search.js';
|
|
9
|
+
export type { SearchBrainCompactParams, SearchBrainCompactResult };
|
|
10
|
+
/** Input accepted by the searchBrain SDK tool. */
|
|
11
|
+
export interface SearchBrainInput {
|
|
12
|
+
/** Project root directory for DB resolution. */
|
|
13
|
+
projectRoot: string;
|
|
14
|
+
/** Search parameters forwarded to searchBrainCompact. */
|
|
15
|
+
params: SearchBrainCompactParams;
|
|
16
|
+
}
|
|
17
|
+
/** Output produced by the searchBrain SDK tool. */
|
|
18
|
+
export interface SearchBrainOutput {
|
|
19
|
+
/** Compact search results from searchBrainCompact. */
|
|
20
|
+
result: SearchBrainCompactResult;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=brain-search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brain-search.d.ts","sourceRoot":"","sources":["../../src/tools/brain-search.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAE9F,YAAY,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,CAAC;AAEnE,kDAAkD;AAClD,MAAM,WAAW,gBAAgB;IAC/B,gDAAgD;IAChD,WAAW,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,MAAM,EAAE,wBAAwB,CAAC;CAClC;AAED,mDAAmD;AACnD,MAAM,WAAW,iBAAiB;IAChC,sDAAsD;IACtD,MAAM,EAAE,wBAAwB,CAAC;CAClC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brain-search.js","sourceRoot":"","sources":["../../src/tools/brain-search.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contract types for the timelineBrain SDK tool.
|
|
3
|
+
*
|
|
4
|
+
* @arch SDK Tool (Category B) — harness-agnostic, pure-functional wrapper
|
|
5
|
+
* @task T10070
|
|
6
|
+
* @epic T9835
|
|
7
|
+
*/
|
|
8
|
+
import type { TimelineBrainParams, TimelineBrainResult } from '../memory/timeline.js';
|
|
9
|
+
export type { TimelineBrainParams, TimelineBrainResult };
|
|
10
|
+
/** Input accepted by the timelineBrain SDK tool. */
|
|
11
|
+
export interface TimelineBrainInput {
|
|
12
|
+
/** Project root directory for DB resolution. */
|
|
13
|
+
projectRoot: string;
|
|
14
|
+
/** Timeline parameters forwarded to timelineBrain. */
|
|
15
|
+
params: TimelineBrainParams;
|
|
16
|
+
}
|
|
17
|
+
/** Output produced by the timelineBrain SDK tool. */
|
|
18
|
+
export interface TimelineBrainOutput {
|
|
19
|
+
/** Result from timelineBrain. */
|
|
20
|
+
result: TimelineBrainResult;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=brain-timeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brain-timeline.d.ts","sourceRoot":"","sources":["../../src/tools/brain-timeline.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEtF,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,CAAC;AAEzD,oDAAoD;AACpD,MAAM,WAAW,kBAAkB;IACjC,gDAAgD;IAChD,WAAW,EAAE,MAAM,CAAC;IACpB,sDAAsD;IACtD,MAAM,EAAE,mBAAmB,CAAC;CAC7B;AAED,qDAAqD;AACrD,MAAM,WAAW,mBAAmB;IAClC,iCAAiC;IACjC,MAAM,EAAE,mBAAmB,CAAC;CAC7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brain-timeline.js","sourceRoot":"","sources":["../../src/tools/brain-timeline.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contract types for the buildRetrievalBundle SDK tool.
|
|
3
|
+
*
|
|
4
|
+
* @arch SDK Tool (Category B) — harness-agnostic, pure-functional wrapper
|
|
5
|
+
* @task T10070
|
|
6
|
+
* @epic T9835
|
|
7
|
+
*/
|
|
8
|
+
import type { RetrievalBundle, RetrievalRequest } from '../operations/memory.js';
|
|
9
|
+
export type { RetrievalBundle, RetrievalRequest };
|
|
10
|
+
/** Input accepted by the buildRetrievalBundle SDK tool. */
|
|
11
|
+
export interface BuildRetrievalBundleInput {
|
|
12
|
+
/** Retrieval request forwarded to buildRetrievalBundle. */
|
|
13
|
+
req: RetrievalRequest;
|
|
14
|
+
/** Project root directory for DB resolution. */
|
|
15
|
+
projectRoot: string;
|
|
16
|
+
}
|
|
17
|
+
/** Output produced by the buildRetrievalBundle SDK tool. */
|
|
18
|
+
export interface BuildRetrievalBundleOutput {
|
|
19
|
+
/** Fully-structured retrieval bundle with token accounting. */
|
|
20
|
+
bundle: RetrievalBundle;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=build-retrieval-bundle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-retrieval-bundle.d.ts","sourceRoot":"","sources":["../../src/tools/build-retrieval-bundle.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEjF,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,CAAC;AAElD,2DAA2D;AAC3D,MAAM,WAAW,yBAAyB;IACxC,2DAA2D;IAC3D,GAAG,EAAE,gBAAgB,CAAC;IACtB,gDAAgD;IAChD,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,4DAA4D;AAC5D,MAAM,WAAW,0BAA0B;IACzC,+DAA+D;IAC/D,MAAM,EAAE,eAAe,CAAC;CACzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-retrieval-bundle.js","sourceRoot":"","sources":["../../src/tools/build-retrieval-bundle.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contract types for the buildTaskTree SDK tool.
|
|
3
|
+
*
|
|
4
|
+
* @arch SDK Tool (Category B) — harness-agnostic, pure-functional
|
|
5
|
+
* @task T10068
|
|
6
|
+
* @epic T9835
|
|
7
|
+
*/
|
|
8
|
+
import type { TaskPriority } from '../task.js';
|
|
9
|
+
import type { TaskTreeNode } from '../tasks.js';
|
|
10
|
+
export type { TaskTreeNode };
|
|
11
|
+
/** Minimal task shape required by buildTaskTree. */
|
|
12
|
+
export interface BuildTaskTreeInput {
|
|
13
|
+
/** Unique task identifier. */
|
|
14
|
+
id: string;
|
|
15
|
+
/** Human-readable task title. */
|
|
16
|
+
title: string;
|
|
17
|
+
/** Current task status. */
|
|
18
|
+
status: string;
|
|
19
|
+
/** Task type classification. */
|
|
20
|
+
type?: string;
|
|
21
|
+
/** Task priority level. */
|
|
22
|
+
priority: TaskPriority;
|
|
23
|
+
/** ID of the parent task (null for root). */
|
|
24
|
+
parentId?: string | null;
|
|
25
|
+
/** Sort position within sibling scope. */
|
|
26
|
+
position?: number | null;
|
|
27
|
+
/** Dependency IDs. */
|
|
28
|
+
depends?: string[];
|
|
29
|
+
/** Additional labels. */
|
|
30
|
+
labels?: string[];
|
|
31
|
+
}
|
|
32
|
+
/** Options for buildTaskTree. */
|
|
33
|
+
export interface BuildTaskTreeOptions {
|
|
34
|
+
/** When true, annotate each node with transitive blocker chains. */
|
|
35
|
+
withBlockers?: boolean;
|
|
36
|
+
}
|
|
37
|
+
/** Result of buildTaskTree. */
|
|
38
|
+
export interface BuildTaskTreeResult {
|
|
39
|
+
/** Root-level tree nodes. */
|
|
40
|
+
tree: TaskTreeNode[];
|
|
41
|
+
/** Total number of nodes across all levels. */
|
|
42
|
+
totalNodes: number;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=build-task-tree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-task-tree.d.ts","sourceRoot":"","sources":["../../src/tools/build-task-tree.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,YAAY,EAAE,YAAY,EAAE,CAAC;AAE7B,oDAAoD;AACpD,MAAM,WAAW,kBAAkB;IACjC,8BAA8B;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,iCAAiC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,gCAAgC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,QAAQ,EAAE,YAAY,CAAC;IACvB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,sBAAsB;IACtB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,yBAAyB;IACzB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,iCAAiC;AACjC,MAAM,WAAW,oBAAoB;IACnC,oEAAoE;IACpE,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,+BAA+B;AAC/B,MAAM,WAAW,mBAAmB;IAClC,6BAA6B;IAC7B,IAAI,EAAE,YAAY,EAAE,CAAC;IACrB,+CAA+C;IAC/C,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-task-tree.js","sourceRoot":"","sources":["../../src/tools/build-task-tree.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contract types for the computeCriticalPath SDK tool.
|
|
3
|
+
*
|
|
4
|
+
* @arch SDK Tool (Category B) — harness-agnostic, pure-functional
|
|
5
|
+
* @task T10068
|
|
6
|
+
* @epic T9835
|
|
7
|
+
*/
|
|
8
|
+
/** A node in the dependency DAG. */
|
|
9
|
+
export interface CriticalPathNode {
|
|
10
|
+
/** Unique task identifier. */
|
|
11
|
+
id: string;
|
|
12
|
+
/** Human-readable task title. */
|
|
13
|
+
title: string;
|
|
14
|
+
/** Current task status. */
|
|
15
|
+
status: string;
|
|
16
|
+
/** Dependency IDs (scoped to the same set of nodes). */
|
|
17
|
+
depends: string[];
|
|
18
|
+
}
|
|
19
|
+
/** A directed edge in the dependency DAG (dependency → dependent). */
|
|
20
|
+
export interface CriticalPathEdge {
|
|
21
|
+
/** Source node ID (the dependency). */
|
|
22
|
+
from: string;
|
|
23
|
+
/** Target node ID (the dependent). */
|
|
24
|
+
to: string;
|
|
25
|
+
}
|
|
26
|
+
/** Result of computeCriticalPath. */
|
|
27
|
+
export interface CriticalPathResult {
|
|
28
|
+
/** Ordered task IDs from path start to end (empty when graph has cycles). */
|
|
29
|
+
path: string[];
|
|
30
|
+
/** Length of the critical path. */
|
|
31
|
+
length: number;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=compute-critical-path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compute-critical-path.d.ts","sourceRoot":"","sources":["../../src/tools/compute-critical-path.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,oCAAoC;AACpC,MAAM,WAAW,gBAAgB;IAC/B,8BAA8B;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,iCAAiC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,sEAAsE;AACtE,MAAM,WAAW,gBAAgB;IAC/B,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,qCAAqC;AACrC,MAAM,WAAW,kBAAkB;IACjC,6EAA6E;IAC7E,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,mCAAmC;IACnC,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compute-critical-path.js","sourceRoot":"","sources":["../../src/tools/compute-critical-path.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contract types for the describeSchema SDK tool.
|
|
3
|
+
*
|
|
4
|
+
* @arch SDK Tool (Category B) — harness-agnostic, pure-functional
|
|
5
|
+
* @task T10071
|
|
6
|
+
* @epic T9835
|
|
7
|
+
*/
|
|
8
|
+
/** A single column in a table descriptor. */
|
|
9
|
+
export interface SchemaColumn {
|
|
10
|
+
/** Column name as declared in the drizzle schema. */
|
|
11
|
+
name: string;
|
|
12
|
+
/** SQLite data type (e.g. "TEXT", "INTEGER", "REAL", "BLOB"). */
|
|
13
|
+
type: string;
|
|
14
|
+
/** True when the column has a NOT NULL constraint. */
|
|
15
|
+
notNull: boolean;
|
|
16
|
+
/** True when the column is part of the primary key. */
|
|
17
|
+
primaryKey: boolean;
|
|
18
|
+
}
|
|
19
|
+
/** A single index in a table descriptor. */
|
|
20
|
+
export interface SchemaIndex {
|
|
21
|
+
/** Index name as declared in the drizzle schema. */
|
|
22
|
+
name: string;
|
|
23
|
+
/** True when the index enforces uniqueness. */
|
|
24
|
+
unique: boolean;
|
|
25
|
+
}
|
|
26
|
+
/** Descriptor for one database table. */
|
|
27
|
+
export interface SchemaTableDescriptor {
|
|
28
|
+
/** Table name as stored in SQLite (snake_case). */
|
|
29
|
+
name: string;
|
|
30
|
+
/** Ordered list of column descriptors. */
|
|
31
|
+
columns: SchemaColumn[];
|
|
32
|
+
/** List of indexes defined on this table (may be empty). */
|
|
33
|
+
indexes: SchemaIndex[];
|
|
34
|
+
}
|
|
35
|
+
/** Full output of describeSchema — all tables in the drizzle schema. */
|
|
36
|
+
export interface SchemaDescriptor {
|
|
37
|
+
/** One entry per drizzle table exported from the schema barrel. */
|
|
38
|
+
tables: SchemaTableDescriptor[];
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=describe-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"describe-schema.d.ts","sourceRoot":"","sources":["../../src/tools/describe-schema.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,6CAA6C;AAC7C,MAAM,WAAW,YAAY;IAC3B,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,IAAI,EAAE,MAAM,CAAC;IACb,sDAAsD;IACtD,OAAO,EAAE,OAAO,CAAC;IACjB,uDAAuD;IACvD,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,4CAA4C;AAC5C,MAAM,WAAW,WAAW;IAC1B,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,yCAAyC;AACzC,MAAM,WAAW,qBAAqB;IACpC,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,4DAA4D;IAC5D,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB;AAED,wEAAwE;AACxE,MAAM,WAAW,gBAAgB;IAC/B,mEAAmE;IACnE,MAAM,EAAE,qBAAqB,EAAE,CAAC;CACjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"describe-schema.js","sourceRoot":"","sources":["../../src/tools/describe-schema.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SDK Tool contract types.
|
|
3
|
+
*
|
|
4
|
+
* @arch Contracts barrel for Category B SDK Tools in packages/core/src/tools/
|
|
5
|
+
* @task T10068
|
|
6
|
+
* @task T10070
|
|
7
|
+
* @epic T9835
|
|
8
|
+
*/
|
|
9
|
+
export type { FetchBrainEntriesInput, FetchBrainEntriesOutput } from './brain-fetch.js';
|
|
10
|
+
export type { ObserveBrainInput, ObserveBrainOutput } from './brain-observe.js';
|
|
11
|
+
export type { SearchBrainInput, SearchBrainOutput } from './brain-search.js';
|
|
12
|
+
export type { TimelineBrainInput, TimelineBrainOutput } from './brain-timeline.js';
|
|
13
|
+
export type { BuildRetrievalBundleInput, BuildRetrievalBundleOutput, } from './build-retrieval-bundle.js';
|
|
14
|
+
export type { BuildTaskTreeInput, BuildTaskTreeOptions, BuildTaskTreeResult, } from './build-task-tree.js';
|
|
15
|
+
export type { CriticalPathEdge, CriticalPathNode, CriticalPathResult, } from './compute-critical-path.js';
|
|
16
|
+
export type { SchemaColumn, SchemaDescriptor, SchemaIndex, SchemaTableDescriptor, } from './describe-schema.js';
|
|
17
|
+
export type { RenderTaskTreeInput } from './render-task-tree.js';
|
|
18
|
+
export type { ScoreFactor, ScoreTaskContext, ScoreTaskInput, ScoreTaskResult, } from './score-task-priority.js';
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,YAAY,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AACxF,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAEhF,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC7E,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACnF,YAAY,EACV,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,6BAA6B,CAAC;AAGrC,YAAY,EACV,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,4BAA4B,CAAC;AACpC,YAAY,EACV,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,YAAY,EACV,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,eAAe,GAChB,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contract types for the renderTaskTree SDK tools.
|
|
3
|
+
*
|
|
4
|
+
* @arch SDK Tool (Category B) — harness-agnostic, pure-functional
|
|
5
|
+
* @task T10068
|
|
6
|
+
* @epic T9835
|
|
7
|
+
*/
|
|
8
|
+
import type { CriticalPathEdge, CriticalPathNode } from './compute-critical-path.js';
|
|
9
|
+
/** Input to both text and Mermaid renderers. */
|
|
10
|
+
export interface RenderTaskTreeInput {
|
|
11
|
+
/** Task nodes to render. */
|
|
12
|
+
nodes: CriticalPathNode[];
|
|
13
|
+
/** Directed edges between nodes. */
|
|
14
|
+
edges: CriticalPathEdge[];
|
|
15
|
+
/** Task IDs on the critical path (highlighted in output). */
|
|
16
|
+
criticalPath: string[];
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=render-task-tree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-task-tree.d.ts","sourceRoot":"","sources":["../../src/tools/render-task-tree.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAErF,gDAAgD;AAChD,MAAM,WAAW,mBAAmB;IAClC,4BAA4B;IAC5B,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,oCAAoC;IACpC,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,6DAA6D;IAC7D,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-task-tree.js","sourceRoot":"","sources":["../../src/tools/render-task-tree.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contract types for the scoreTask SDK tool.
|
|
3
|
+
*
|
|
4
|
+
* @arch SDK Tool (Category B) — harness-agnostic, pure-functional
|
|
5
|
+
* @task T10068
|
|
6
|
+
* @epic T9835
|
|
7
|
+
*/
|
|
8
|
+
import type { TaskPriority } from '../task.js';
|
|
9
|
+
/** Minimal task shape required by scoreTask. */
|
|
10
|
+
export interface ScoreTaskInput {
|
|
11
|
+
/** Unique task identifier. */
|
|
12
|
+
id: string;
|
|
13
|
+
/** Human-readable task title. */
|
|
14
|
+
title: string;
|
|
15
|
+
/** Task priority level. */
|
|
16
|
+
priority: TaskPriority;
|
|
17
|
+
/** Phase slug this task belongs to. */
|
|
18
|
+
phase?: string;
|
|
19
|
+
/** Dependency IDs. */
|
|
20
|
+
depends?: string[];
|
|
21
|
+
/** ISO timestamp of task creation. */
|
|
22
|
+
createdAt?: string;
|
|
23
|
+
/** Labels for pattern matching. */
|
|
24
|
+
labels?: string[];
|
|
25
|
+
}
|
|
26
|
+
/** Context provided to scoreTask to enable phase-aware and dependency-aware scoring. */
|
|
27
|
+
export interface ScoreTaskContext {
|
|
28
|
+
/** Current project phase slug (used for phase alignment bonus). */
|
|
29
|
+
currentPhase?: string | null;
|
|
30
|
+
/** Map of all task IDs to their statuses (used for dep readiness check). */
|
|
31
|
+
taskStatuses?: Map<string, string>;
|
|
32
|
+
/** Current timestamp (ms since epoch) — defaults to Date.now() when omitted. */
|
|
33
|
+
nowMs?: number;
|
|
34
|
+
/** Matched success patterns from BRAIN (optional bonus scoring). */
|
|
35
|
+
successPatterns?: Array<{
|
|
36
|
+
pattern: string;
|
|
37
|
+
}>;
|
|
38
|
+
/** Matched failure patterns from BRAIN (optional penalty scoring). */
|
|
39
|
+
failurePatterns?: Array<{
|
|
40
|
+
pattern: string;
|
|
41
|
+
}>;
|
|
42
|
+
}
|
|
43
|
+
/** A scoring factor contributing to the final score. */
|
|
44
|
+
export interface ScoreFactor {
|
|
45
|
+
/** Factor name (e.g. "priority", "phaseAlignment"). */
|
|
46
|
+
name: string;
|
|
47
|
+
/** Numeric contribution (positive = bonus, negative = penalty). */
|
|
48
|
+
delta: number;
|
|
49
|
+
/** Human-readable explanation. */
|
|
50
|
+
detail: string;
|
|
51
|
+
}
|
|
52
|
+
/** Result of scoreTask. */
|
|
53
|
+
export interface ScoreTaskResult {
|
|
54
|
+
/** Final computed score. */
|
|
55
|
+
score: number;
|
|
56
|
+
/** Individual scoring factors. */
|
|
57
|
+
factors: ScoreFactor[];
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=score-task-priority.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"score-task-priority.d.ts","sourceRoot":"","sources":["../../src/tools/score-task-priority.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,gDAAgD;AAChD,MAAM,WAAW,cAAc;IAC7B,8BAA8B;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,iCAAiC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,QAAQ,EAAE,YAAY,CAAC;IACvB,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sBAAsB;IACtB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,wFAAwF;AACxF,MAAM,WAAW,gBAAgB;IAC/B,mEAAmE;IACnE,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,4EAA4E;IAC5E,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,gFAAgF;IAChF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,eAAe,CAAC,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7C,sEAAsE;IACtE,eAAe,CAAC,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC9C;AAED,wDAAwD;AACxD,MAAM,WAAW,WAAW;IAC1B,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,mEAAmE;IACnE,KAAK,EAAE,MAAM,CAAC;IACd,kCAAkC;IAClC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,2BAA2B;AAC3B,MAAM,WAAW,eAAe;IAC9B,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,kCAAkC;IAClC,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"score-task-priority.js","sourceRoot":"","sources":["../../src/tools/score-task-priority.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cleocode/contracts",
|
|
3
|
-
"version": "2026.5.
|
|
3
|
+
"version": "2026.5.100",
|
|
4
4
|
"description": "Domain types, interfaces, and contracts for the CLEO ecosystem",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
"dependencies": {
|
|
139
139
|
"zod": "^4.3.6",
|
|
140
140
|
"zod-to-json-schema": "^3.25.2",
|
|
141
|
-
"@cleocode/lafs": "2026.5.
|
|
141
|
+
"@cleocode/lafs": "2026.5.100"
|
|
142
142
|
},
|
|
143
143
|
"scripts": {
|
|
144
144
|
"build": "tsc -b --force && node scripts/emit-schemas.mjs",
|