@cleocode/contracts 2026.5.98 → 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,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Snapshot test for the OPERATIONS registry data.
|
|
3
|
+
*
|
|
4
|
+
* Pins the exact JSON shape of the full OPERATIONS array so that any
|
|
5
|
+
* accidental addition, removal, or mutation of an entry is caught
|
|
6
|
+
* immediately. This test MUST pass before and after the T10061 data
|
|
7
|
+
* relocation — it is the primary guard against behavior change.
|
|
8
|
+
*
|
|
9
|
+
* To update the snapshot intentionally:
|
|
10
|
+
* pnpm vitest --filter @cleocode/contracts run -u
|
|
11
|
+
*
|
|
12
|
+
* @since T10061 — T9833b / E-CLI-BOUNDARY / SG-ARCH-SOLID T9831
|
|
13
|
+
*/
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=operations-registry.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations-registry.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/operations-registry.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Snapshot test for the OPERATIONS registry data.
|
|
3
|
+
*
|
|
4
|
+
* Pins the exact JSON shape of the full OPERATIONS array so that any
|
|
5
|
+
* accidental addition, removal, or mutation of an entry is caught
|
|
6
|
+
* immediately. This test MUST pass before and after the T10061 data
|
|
7
|
+
* relocation — it is the primary guard against behavior change.
|
|
8
|
+
*
|
|
9
|
+
* To update the snapshot intentionally:
|
|
10
|
+
* pnpm vitest --filter @cleocode/contracts run -u
|
|
11
|
+
*
|
|
12
|
+
* @since T10061 — T9833b / E-CLI-BOUNDARY / SG-ARCH-SOLID T9831
|
|
13
|
+
*/
|
|
14
|
+
import { describe, expect, it } from 'vitest';
|
|
15
|
+
import { defineDomain, defineOp, OPERATIONS } from '../dispatch/operations-registry.js';
|
|
16
|
+
describe('operations-registry', () => {
|
|
17
|
+
it('OPERATIONS snapshot — zero behavior change across relocation', () => {
|
|
18
|
+
expect(JSON.stringify(OPERATIONS)).toMatchSnapshot();
|
|
19
|
+
});
|
|
20
|
+
it('OPERATIONS count is consistent', () => {
|
|
21
|
+
expect(OPERATIONS.length).toBeGreaterThan(0);
|
|
22
|
+
const queryCount = OPERATIONS.filter((o) => o.gateway === 'query').length;
|
|
23
|
+
const mutateCount = OPERATIONS.filter((o) => o.gateway === 'mutate').length;
|
|
24
|
+
expect(queryCount + mutateCount).toBe(OPERATIONS.length);
|
|
25
|
+
});
|
|
26
|
+
it('every operation has required structural fields', () => {
|
|
27
|
+
for (const op of OPERATIONS) {
|
|
28
|
+
expect(typeof op.gateway).toBe('string');
|
|
29
|
+
expect(typeof op.domain).toBe('string');
|
|
30
|
+
expect(typeof op.operation).toBe('string');
|
|
31
|
+
expect(typeof op.description).toBe('string');
|
|
32
|
+
expect(typeof op.tier).toBe('number');
|
|
33
|
+
expect(typeof op.idempotent).toBe('boolean');
|
|
34
|
+
expect(typeof op.sessionRequired).toBe('boolean');
|
|
35
|
+
expect(Array.isArray(op.requiredParams)).toBe(true);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
it('defineOp is an identity function', () => {
|
|
39
|
+
const def = OPERATIONS[0];
|
|
40
|
+
expect(defineOp(def)).toBe(def);
|
|
41
|
+
});
|
|
42
|
+
it('defineDomain returns the ops array unchanged', () => {
|
|
43
|
+
const ops = OPERATIONS.filter((o) => o.domain === 'tasks');
|
|
44
|
+
const result = defineDomain('tasks', ops);
|
|
45
|
+
expect(result).toBe(ops);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=operations-registry.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations-registry.test.js","sourceRoot":"","sources":["../../src/__tests__/operations-registry.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAExF,QAAQ,CAAC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AO,EAAE,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC7C,MAAM,CAAC,OAAO,EAAE,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAClD,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtD,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE;QAC1C,MAAM,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;QAC1B,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8CAA8C,EAAE,GAAG,EAAE;QACtD,MAAM,GAAG,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,OAAO,CAAC,CAAC;QAC3D,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAC1C,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Operations Registry — canonical OPERATIONS data for the CLEO dispatch layer.
|
|
3
|
+
*
|
|
4
|
+
* Relocated from `packages/cleo/src/dispatch/registry.ts` in T10061 /
|
|
5
|
+
* T9833b (E-CLI-BOUNDARY · Saga T9831 SG-ARCH-SOLID). The data array and
|
|
6
|
+
* builder helpers live here so that contracts owns the registry shape while
|
|
7
|
+
* `packages/cleo/src/dispatch/registry.ts` becomes a thin re-export shim.
|
|
8
|
+
*
|
|
9
|
+
* @since SG-ARCH-SOLID Saga T9831 · E-CLI-BOUNDARY T9833 · T10061
|
|
10
|
+
*/
|
|
11
|
+
import type { CanonicalDomain, Gateway, OperationDef, ParamDef, Tier } from './operation-def.js';
|
|
12
|
+
export type { CanonicalDomain, Gateway, OperationDef, ParamDef, Tier };
|
|
13
|
+
/**
|
|
14
|
+
* Type-constraining builder for a single {@link OperationDef}.
|
|
15
|
+
*
|
|
16
|
+
* Acts as an identity function: accepts an OperationDef literal and returns
|
|
17
|
+
* it unchanged. The purpose is to enforce the type at the call site so that
|
|
18
|
+
* editors provide auto-complete and TypeScript catches structural errors at
|
|
19
|
+
* authoring time rather than at array-level `satisfies` checks.
|
|
20
|
+
*/
|
|
21
|
+
export declare function defineOp(def: OperationDef): OperationDef;
|
|
22
|
+
/**
|
|
23
|
+
* Groups N {@link OperationDef} entries that share a {@link CanonicalDomain}.
|
|
24
|
+
*
|
|
25
|
+
* Returns the flat array of definitions — the grouping is purely a
|
|
26
|
+
* documentation/authoring convenience so large domains can be broken up
|
|
27
|
+
* into domain-scoped sections without changing the flat {@link OPERATIONS}
|
|
28
|
+
* shape that the dispatcher consumes.
|
|
29
|
+
*/
|
|
30
|
+
export declare function defineDomain(_domain: CanonicalDomain, ops: OperationDef[]): OperationDef[];
|
|
31
|
+
/** The single source of truth for all operations in CLEO. */
|
|
32
|
+
export declare const OPERATIONS: OperationDef[];
|
|
33
|
+
//# sourceMappingURL=operations-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations-registry.d.ts","sourceRoot":"","sources":["../../src/dispatch/operations-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAEjG,YAAY,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAMvE;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,YAAY,GAAG,YAAY,CAExD;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,YAAY,EAAE,GAAG,YAAY,EAAE,CAE1F;AAMD,6DAA6D;AAC7D,eAAO,MAAM,UAAU,EAAE,YAAY,EAkwPpC,CAAC"}
|