@cleocode/contracts 2026.5.62 → 2026.5.64
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__/llm-config-schema.test.d.ts +20 -0
- package/dist/__tests__/llm-config-schema.test.d.ts.map +1 -0
- package/dist/__tests__/llm-config-schema.test.js +121 -0
- package/dist/__tests__/llm-config-schema.test.js.map +1 -0
- package/dist/config.d.ts +95 -5
- package/dist/config.d.ts.map +1 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/operations/llm.d.ts +380 -0
- package/dist/operations/llm.d.ts.map +1 -1
- package/dist/project-context.d.ts +69 -0
- package/dist/project-context.d.ts.map +1 -0
- package/dist/project-context.js +14 -0
- package/dist/project-context.js.map +1 -0
- package/dist/release/channel.d.ts +20 -0
- package/dist/release/channel.d.ts.map +1 -0
- package/dist/release/channel.js +12 -0
- package/dist/release/channel.js.map +1 -0
- package/dist/release/github-pr.d.ts +79 -0
- package/dist/release/github-pr.d.ts.map +1 -0
- package/dist/release/github-pr.js +12 -0
- package/dist/release/github-pr.js.map +1 -0
- package/dist/release/version-bump.d.ts +73 -0
- package/dist/release/version-bump.d.ts.map +1 -0
- package/dist/release/version-bump.js +12 -0
- package/dist/release/version-bump.js.map +1 -0
- package/package.json +2 -2
- package/src/__tests__/llm-config-schema.test.ts +135 -0
- package/src/config.ts +100 -5
- package/src/index.ts +67 -0
- package/src/operations/llm.ts +437 -0
- package/src/project-context.ts +106 -0
- package/src/release/channel.ts +21 -0
- package/src/release/github-pr.ts +89 -0
- package/src/release/version-bump.ts +79 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Version-bump contracts — types describing how `cleo release ship` finds
|
|
3
|
+
* and updates version-bearing files across a project's ecosystem(s).
|
|
4
|
+
*
|
|
5
|
+
* The implementation lives in `@cleocode/core/release/version-bump.ts`. The
|
|
6
|
+
* types live here so contracts consumers (CLI, studio, downstream tools)
|
|
7
|
+
* can describe / validate the same shapes without depending on core.
|
|
8
|
+
*
|
|
9
|
+
* @adr ADR-063
|
|
10
|
+
*/
|
|
11
|
+
/** Supported version-bump strategies. */
|
|
12
|
+
export type VersionBumpStrategy = 'plain' | 'json' | 'toml' | 'sed';
|
|
13
|
+
/**
|
|
14
|
+
* Version bump target — a single file the release pipeline knows how to
|
|
15
|
+
* bump. Discovery returns these, an explicit config in
|
|
16
|
+
* `.cleo/config.json` (`release.versionBump.files`) populates them.
|
|
17
|
+
*/
|
|
18
|
+
export interface VersionBumpTarget {
|
|
19
|
+
/** Path relative to the project root. */
|
|
20
|
+
file: string;
|
|
21
|
+
/** Update strategy. */
|
|
22
|
+
strategy: VersionBumpStrategy;
|
|
23
|
+
/** JSON field path for `strategy='json'` (e.g. `version`, `package.version`). */
|
|
24
|
+
field?: string;
|
|
25
|
+
/** TOML key for `strategy='toml'` (default: `version`). */
|
|
26
|
+
key?: string;
|
|
27
|
+
/** TOML section for `strategy='toml'` (e.g. `package`, `workspace.package`). */
|
|
28
|
+
section?: string;
|
|
29
|
+
/** Sed pattern with `{{VERSION}}` placeholder for `strategy='sed'`. */
|
|
30
|
+
pattern?: string;
|
|
31
|
+
}
|
|
32
|
+
/** Bump type used by `calculateNewVersion`. */
|
|
33
|
+
export type BumpType = 'patch' | 'minor' | 'major';
|
|
34
|
+
/** Result for a single file's bump attempt. */
|
|
35
|
+
export interface BumpResult {
|
|
36
|
+
/** Path relative to the project root. */
|
|
37
|
+
file: string;
|
|
38
|
+
/** Strategy used. */
|
|
39
|
+
strategy: VersionBumpStrategy | string;
|
|
40
|
+
/** Whether the bump succeeded. */
|
|
41
|
+
success: boolean;
|
|
42
|
+
/** Version found in the file before the bump, if it could be extracted. */
|
|
43
|
+
previousVersion?: string;
|
|
44
|
+
/** Version written to the file. */
|
|
45
|
+
newVersion?: string;
|
|
46
|
+
/** Human-readable error when `success === false`. */
|
|
47
|
+
error?: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Where the version-bump targets came from. Lets callers log / diagnose why
|
|
51
|
+
* a release commit included or omitted version files.
|
|
52
|
+
*/
|
|
53
|
+
export type VersionBumpTargetSource = 'config' | 'workspace' | 'none';
|
|
54
|
+
/** Envelope returned by `resolveVersionBumpTargets`. */
|
|
55
|
+
export interface ResolveVersionBumpTargetsResult {
|
|
56
|
+
/** Targets to bump. Empty when `source === 'none'`. */
|
|
57
|
+
targets: VersionBumpTarget[];
|
|
58
|
+
/**
|
|
59
|
+
* How the targets were resolved:
|
|
60
|
+
* - `'config'` — explicit `release.versionBump.files` entry
|
|
61
|
+
* - `'workspace'` — auto-discovered from filesystem markers
|
|
62
|
+
* - `'none'` — neither config nor a recognised workspace
|
|
63
|
+
*/
|
|
64
|
+
source: VersionBumpTargetSource;
|
|
65
|
+
}
|
|
66
|
+
/** Bulk-bump result envelope. */
|
|
67
|
+
export interface BumpVersionFromConfigResult {
|
|
68
|
+
/** Per-file results. */
|
|
69
|
+
results: BumpResult[];
|
|
70
|
+
/** `true` iff every result succeeded. */
|
|
71
|
+
allSuccess: boolean;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=version-bump.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-bump.d.ts","sourceRoot":"","sources":["../../src/release/version-bump.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,yCAAyC;AACzC,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;AAEpE;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,uBAAuB;IACvB,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,iFAAiF;IACjF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2DAA2D;IAC3D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gFAAgF;IAChF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uEAAuE;IACvE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,+CAA+C;AAC/C,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;AAEnD,+CAA+C;AAC/C,MAAM,WAAW,UAAU;IACzB,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,qBAAqB;IACrB,QAAQ,EAAE,mBAAmB,GAAG,MAAM,CAAC;IACvC,kCAAkC;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,2EAA2E;IAC3E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mCAAmC;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qDAAqD;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG,QAAQ,GAAG,WAAW,GAAG,MAAM,CAAC;AAEtE,wDAAwD;AACxD,MAAM,WAAW,+BAA+B;IAC9C,uDAAuD;IACvD,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B;;;;;OAKG;IACH,MAAM,EAAE,uBAAuB,CAAC;CACjC;AAED,iCAAiC;AACjC,MAAM,WAAW,2BAA2B;IAC1C,wBAAwB;IACxB,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,yCAAyC;IACzC,UAAU,EAAE,OAAO,CAAC;CACrB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Version-bump contracts — types describing how `cleo release ship` finds
|
|
3
|
+
* and updates version-bearing files across a project's ecosystem(s).
|
|
4
|
+
*
|
|
5
|
+
* The implementation lives in `@cleocode/core/release/version-bump.ts`. The
|
|
6
|
+
* types live here so contracts consumers (CLI, studio, downstream tools)
|
|
7
|
+
* can describe / validate the same shapes without depending on core.
|
|
8
|
+
*
|
|
9
|
+
* @adr ADR-063
|
|
10
|
+
*/
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=version-bump.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-bump.js","sourceRoot":"","sources":["../../src/release/version-bump.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cleocode/contracts",
|
|
3
|
-
"version": "2026.5.
|
|
3
|
+
"version": "2026.5.64",
|
|
4
4
|
"description": "Domain types, interfaces, and contracts for the CLEO ecosystem",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"dependencies": {
|
|
83
83
|
"zod": "^4.3.6",
|
|
84
84
|
"zod-to-json-schema": "^3.25.2",
|
|
85
|
-
"@cleocode/lafs": "2026.5.
|
|
85
|
+
"@cleocode/lafs": "2026.5.64"
|
|
86
86
|
},
|
|
87
87
|
"scripts": {
|
|
88
88
|
"build": "tsc -b --force && node scripts/emit-schemas.mjs",
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schema roundtrip tests for the extended `LlmConfig` shape.
|
|
3
|
+
*
|
|
4
|
+
* Asserts that:
|
|
5
|
+
*
|
|
6
|
+
* 1. A literal `LlmConfig` object containing the new `default`, `roles`, and
|
|
7
|
+
* the legacy `daemon` fields typechecks and survives a JSON
|
|
8
|
+
* serialize/deserialize cycle without structural loss.
|
|
9
|
+
* 2. All five `RoleName` values (`extraction`, `consolidation`, `derivation`,
|
|
10
|
+
* `hygiene`, `judgement`) are accepted as keys of `roles`.
|
|
11
|
+
* 3. Omitting `default` and/or `roles` still typechecks (both are optional).
|
|
12
|
+
*
|
|
13
|
+
* These tests guard the Phase 2 schema extension of
|
|
14
|
+
* T-LLM-CRED-CENTRALIZATION against accidental regressions.
|
|
15
|
+
*
|
|
16
|
+
* @task T9256
|
|
17
|
+
* @epic T-LLM-CRED-CENTRALIZATION
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import { describe, expect, it } from 'vitest';
|
|
21
|
+
import type { LlmConfig, LlmDefaultConfig, LlmRoleConfig, RoleName } from '../config.js';
|
|
22
|
+
|
|
23
|
+
describe('LlmConfig — Phase 2 schema extension (T9256)', () => {
|
|
24
|
+
it('accepts a fully-populated config with default, roles, and legacy daemon', () => {
|
|
25
|
+
const cfg: LlmConfig = {
|
|
26
|
+
daemon: { provider: 'anthropic', model: 'claude-sonnet-4-6' },
|
|
27
|
+
providers: {
|
|
28
|
+
anthropic: { apiKey: 'sk-test-anthropic' },
|
|
29
|
+
openai: { apiKey: 'sk-test-openai' },
|
|
30
|
+
},
|
|
31
|
+
default: { provider: 'anthropic', model: 'claude-sonnet-4-6' },
|
|
32
|
+
roles: {
|
|
33
|
+
extraction: {
|
|
34
|
+
provider: 'anthropic',
|
|
35
|
+
model: 'claude-haiku-4-5',
|
|
36
|
+
credentialLabel: 'ext-key',
|
|
37
|
+
},
|
|
38
|
+
consolidation: {
|
|
39
|
+
provider: 'openai',
|
|
40
|
+
model: 'gpt-4o',
|
|
41
|
+
},
|
|
42
|
+
derivation: {
|
|
43
|
+
provider: 'gemini',
|
|
44
|
+
model: 'gemini-2.5-pro',
|
|
45
|
+
},
|
|
46
|
+
hygiene: {
|
|
47
|
+
provider: 'moonshot',
|
|
48
|
+
model: 'kimi-k2',
|
|
49
|
+
},
|
|
50
|
+
judgement: {
|
|
51
|
+
provider: 'anthropic',
|
|
52
|
+
model: 'claude-opus-4-7',
|
|
53
|
+
credentialLabel: 'judge-key',
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const roundtripped: LlmConfig = JSON.parse(JSON.stringify(cfg));
|
|
59
|
+
expect(roundtripped).toEqual(cfg);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('preserves structural identity across JSON serialize/deserialize', () => {
|
|
63
|
+
const cfg: LlmConfig = {
|
|
64
|
+
default: { provider: 'anthropic', model: 'claude-sonnet-4-6' },
|
|
65
|
+
roles: {
|
|
66
|
+
extraction: { provider: 'anthropic', model: 'claude-haiku-4-5' },
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const serialized = JSON.stringify(cfg);
|
|
71
|
+
const parsed = JSON.parse(serialized) as LlmConfig;
|
|
72
|
+
|
|
73
|
+
expect(parsed.default).toEqual(cfg.default);
|
|
74
|
+
expect(parsed.roles).toEqual(cfg.roles);
|
|
75
|
+
expect(parsed.roles?.extraction?.provider).toBe('anthropic');
|
|
76
|
+
expect(parsed.roles?.extraction?.model).toBe('claude-haiku-4-5');
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it('accepts all five RoleName values as keys of roles', () => {
|
|
80
|
+
const roleNames: readonly RoleName[] = [
|
|
81
|
+
'extraction',
|
|
82
|
+
'consolidation',
|
|
83
|
+
'derivation',
|
|
84
|
+
'hygiene',
|
|
85
|
+
'judgement',
|
|
86
|
+
] as const;
|
|
87
|
+
|
|
88
|
+
// Build a `roles` map populated with one entry per role name. The TS
|
|
89
|
+
// compiler enforces that only valid `RoleName` keys appear here — any
|
|
90
|
+
// typo would be a compile-time error.
|
|
91
|
+
const roles: Partial<Record<RoleName, LlmRoleConfig>> = {};
|
|
92
|
+
for (const name of roleNames) {
|
|
93
|
+
roles[name] = { provider: 'anthropic', model: 'claude-sonnet-4-6' };
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const cfg: LlmConfig = { roles };
|
|
97
|
+
expect(Object.keys(cfg.roles ?? {})).toHaveLength(5);
|
|
98
|
+
for (const name of roleNames) {
|
|
99
|
+
expect(cfg.roles?.[name]?.provider).toBe('anthropic');
|
|
100
|
+
expect(cfg.roles?.[name]?.model).toBe('claude-sonnet-4-6');
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it('typechecks when default and roles are both omitted', () => {
|
|
105
|
+
const cfg: LlmConfig = {
|
|
106
|
+
daemon: { provider: 'anthropic', model: 'claude-sonnet-4-6' },
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
expect(cfg.default).toBeUndefined();
|
|
110
|
+
expect(cfg.roles).toBeUndefined();
|
|
111
|
+
expect(cfg.daemon?.provider).toBe('anthropic');
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
it('typechecks an empty LlmConfig (all fields optional)', () => {
|
|
115
|
+
const cfg: LlmConfig = {};
|
|
116
|
+
expect(cfg).toEqual({});
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
it('allows a role entry without an optional credentialLabel', () => {
|
|
120
|
+
const role: LlmRoleConfig = {
|
|
121
|
+
provider: 'openai',
|
|
122
|
+
model: 'gpt-4o-mini',
|
|
123
|
+
};
|
|
124
|
+
expect(role.credentialLabel).toBeUndefined();
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
it('allows LlmDefaultConfig with only provider + model (no credential)', () => {
|
|
128
|
+
const def: LlmDefaultConfig = {
|
|
129
|
+
provider: 'anthropic',
|
|
130
|
+
model: 'claude-sonnet-4-6',
|
|
131
|
+
};
|
|
132
|
+
expect(def.provider).toBe('anthropic');
|
|
133
|
+
expect(def.model).toBe('claude-sonnet-4-6');
|
|
134
|
+
});
|
|
135
|
+
});
|
package/src/config.ts
CHANGED
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
* @task T5710
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
+
import type { ModelTransport } from './operations/llm.js';
|
|
13
|
+
|
|
12
14
|
/** Output format options. */
|
|
13
15
|
export type OutputFormat = 'json' | 'text' | 'jsonl' | 'markdown' | 'table';
|
|
14
16
|
|
|
@@ -282,7 +284,11 @@ export interface BrainTieringConfig {
|
|
|
282
284
|
export interface BrainLlmExtractionConfig {
|
|
283
285
|
/** Enable LLM-driven extraction gate (default: true). */
|
|
284
286
|
enabled: boolean;
|
|
285
|
-
/**
|
|
287
|
+
/**
|
|
288
|
+
* Anthropic model to use for extraction. Default lives in
|
|
289
|
+
* `@cleocode/core/llm/role-resolver` (`IMPLICIT_FALLBACK_MODEL`) so the
|
|
290
|
+
* literal stays in a single source location (T9255 grep guard).
|
|
291
|
+
*/
|
|
286
292
|
model: string;
|
|
287
293
|
/** Minimum importance score (0.0–1.0) below which extractions are dropped (default: 0.6). */
|
|
288
294
|
minImportance: number;
|
|
@@ -325,10 +331,11 @@ export interface BrainConfig {
|
|
|
325
331
|
* LLM-driven extraction gate settings.
|
|
326
332
|
* When enabled and ANTHROPIC_API_KEY is present, session transcripts are
|
|
327
333
|
* processed by an LLM to extract typed structured memories instead of the
|
|
328
|
-
* legacy keyword regex. Defaults are enabled: true and model
|
|
329
|
-
*
|
|
334
|
+
* legacy keyword regex. Defaults are enabled: true and model defaults to
|
|
335
|
+
* the centralised implicit fallback (cheap Haiku class) defined in
|
|
336
|
+
* `@cleocode/core/llm/role-resolver` so extraction cost stays bounded.
|
|
330
337
|
*
|
|
331
|
-
* @defaultValue { enabled: true, model:
|
|
338
|
+
* @defaultValue { enabled: true, model: IMPLICIT_FALLBACK_MODEL, minImportance: 0.6, maxExtractions: 7, maxTranscriptChars: 60000 }
|
|
332
339
|
*/
|
|
333
340
|
llmExtraction?: BrainLlmExtractionConfig;
|
|
334
341
|
}
|
|
@@ -381,7 +388,7 @@ export interface DaemonLLMConfig {
|
|
|
381
388
|
* LLM provider transport used by daemon loops.
|
|
382
389
|
* @defaultValue 'anthropic'
|
|
383
390
|
*/
|
|
384
|
-
provider:
|
|
391
|
+
provider: ModelTransport;
|
|
385
392
|
/**
|
|
386
393
|
* Full model identifier for the selected provider.
|
|
387
394
|
* @defaultValue 'claude-sonnet-4-6'
|
|
@@ -389,14 +396,85 @@ export interface DaemonLLMConfig {
|
|
|
389
396
|
model: string;
|
|
390
397
|
}
|
|
391
398
|
|
|
399
|
+
/**
|
|
400
|
+
* Canonical model transport identifier — re-export of {@link ModelTransport}
|
|
401
|
+
* from `operations/llm.ts` so config-layer types stay in lock-step with the
|
|
402
|
+
* operations layer with no risk of drift.
|
|
403
|
+
*
|
|
404
|
+
* Previously declared as a separate string-literal union; collapsed in the
|
|
405
|
+
* T-LLM-CRED Phase 2 DRY/SOLID review (P1-2). Adding a new transport now
|
|
406
|
+
* requires editing only `operations/llm.ts`.
|
|
407
|
+
*
|
|
408
|
+
* @task T-LLM-CRED-CENTRALIZATION Phase 2 — DRY review P1-2
|
|
409
|
+
*/
|
|
410
|
+
export type LlmTransport = ModelTransport;
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* Logical LLM role name used by role-aware resolvers (BRAIN, sentient, etc.).
|
|
414
|
+
*
|
|
415
|
+
* Each role can pin its own provider + model + credential label, with
|
|
416
|
+
* resolution falling back to `LlmConfig.default` and finally to the legacy
|
|
417
|
+
* `LlmConfig.daemon` block.
|
|
418
|
+
*
|
|
419
|
+
* @task T-LLM-CRED-CENTRALIZATION Phase 2 (T9256)
|
|
420
|
+
*/
|
|
421
|
+
export type RoleName = 'extraction' | 'consolidation' | 'derivation' | 'hygiene' | 'judgement';
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* Canonical default LLM target for unscoped (non-role) calls.
|
|
425
|
+
*
|
|
426
|
+
* Replaces the role previously played by `LlmConfig.daemon`. The `daemon`
|
|
427
|
+
* field stays as a deprecated alias for one release cycle to give downstream
|
|
428
|
+
* consumers time to migrate.
|
|
429
|
+
*
|
|
430
|
+
* @task T-LLM-CRED-CENTRALIZATION Phase 2 (T9256)
|
|
431
|
+
*/
|
|
432
|
+
export interface LlmDefaultConfig {
|
|
433
|
+
/** LLM provider transport for the default model. */
|
|
434
|
+
provider: LlmTransport;
|
|
435
|
+
/** Full model identifier for the selected provider. */
|
|
436
|
+
model: string;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* Per-role LLM configuration entry.
|
|
441
|
+
*
|
|
442
|
+
* Each role may optionally pin to a specific credential label (matching a
|
|
443
|
+
* `CredentialResult.label`) so that, e.g., the `extraction` role can use a
|
|
444
|
+
* different Anthropic API key than `judgement` without changing the global
|
|
445
|
+
* default.
|
|
446
|
+
*
|
|
447
|
+
* @task T-LLM-CRED-CENTRALIZATION Phase 2 (T9256)
|
|
448
|
+
*/
|
|
449
|
+
export interface LlmRoleConfig {
|
|
450
|
+
/** LLM provider transport for this role. */
|
|
451
|
+
provider: LlmTransport;
|
|
452
|
+
/** Full model identifier for the selected provider. */
|
|
453
|
+
model: string;
|
|
454
|
+
/**
|
|
455
|
+
* Optional credential label to pin this role to a specific credential
|
|
456
|
+
* entry resolved by `resolveCredentials()`. When omitted, the role
|
|
457
|
+
* inherits the default credential resolution order.
|
|
458
|
+
*/
|
|
459
|
+
credentialLabel?: string;
|
|
460
|
+
}
|
|
461
|
+
|
|
392
462
|
/**
|
|
393
463
|
* Top-level LLM configuration block inside CleoConfig.
|
|
394
464
|
*
|
|
395
465
|
* Stored at `llm` in config.json.
|
|
466
|
+
*
|
|
467
|
+
* Resolution order for role-scoped calls:
|
|
468
|
+
* `roles[role]` → `default` → `daemon` (legacy).
|
|
396
469
|
*/
|
|
397
470
|
export interface LlmConfig {
|
|
398
471
|
/**
|
|
399
472
|
* Daemon LLM settings (provider + model for background loops).
|
|
473
|
+
*
|
|
474
|
+
* @deprecated Use `default` instead. Retained as a fallback alias for
|
|
475
|
+
* one release cycle (T-LLM-CRED-CENTRALIZATION Phase 2 · T9256). New
|
|
476
|
+
* code must read `default` first and only fall through to `daemon` when
|
|
477
|
+
* `default` is absent.
|
|
400
478
|
* @defaultValue { provider: 'anthropic', model: 'claude-sonnet-4-6' }
|
|
401
479
|
*/
|
|
402
480
|
daemon?: DaemonLLMConfig;
|
|
@@ -405,6 +483,23 @@ export interface LlmConfig {
|
|
|
405
483
|
* Keys are provider names: 'anthropic' | 'openai' | 'gemini' | 'moonshot'.
|
|
406
484
|
*/
|
|
407
485
|
providers?: Record<string, LlmProviderEntry>;
|
|
486
|
+
/**
|
|
487
|
+
* Canonical default LLM for unscoped calls. Replaces the role previously
|
|
488
|
+
* played by `daemon`, which stays as a deprecated alias for one release
|
|
489
|
+
* cycle.
|
|
490
|
+
*
|
|
491
|
+
* @task T-LLM-CRED-CENTRALIZATION Phase 2 (T9256)
|
|
492
|
+
*/
|
|
493
|
+
default?: LlmDefaultConfig;
|
|
494
|
+
/**
|
|
495
|
+
* Per-role LLM overrides. Each role optionally pins to a credential
|
|
496
|
+
* label.
|
|
497
|
+
*
|
|
498
|
+
* Resolution order: `roles[role]` → `default` → `daemon` (legacy).
|
|
499
|
+
*
|
|
500
|
+
* @task T-LLM-CRED-CENTRALIZATION Phase 2 (T9256)
|
|
501
|
+
*/
|
|
502
|
+
roles?: Partial<Record<RoleName, LlmRoleConfig>>;
|
|
408
503
|
}
|
|
409
504
|
|
|
410
505
|
/** SignalDock transport mode. */
|
package/src/index.ts
CHANGED
|
@@ -219,7 +219,10 @@ export type {
|
|
|
219
219
|
LifecycleConfig,
|
|
220
220
|
LifecycleEnforcementMode,
|
|
221
221
|
LlmConfig,
|
|
222
|
+
LlmDefaultConfig,
|
|
222
223
|
LlmProviderEntry,
|
|
224
|
+
LlmRoleConfig,
|
|
225
|
+
LlmTransport,
|
|
223
226
|
LoggingConfig,
|
|
224
227
|
LogLevel,
|
|
225
228
|
MemoryBridgeMode,
|
|
@@ -227,6 +230,7 @@ export type {
|
|
|
227
230
|
OutputFormat,
|
|
228
231
|
ProviderConfig,
|
|
229
232
|
ResolvedValue,
|
|
233
|
+
RoleName,
|
|
230
234
|
SessionConfig,
|
|
231
235
|
SessionSummaryInput,
|
|
232
236
|
SharingConfig,
|
|
@@ -614,6 +618,35 @@ export type {
|
|
|
614
618
|
LifecycleStatusResult,
|
|
615
619
|
StageRecord,
|
|
616
620
|
} from './operations/lifecycle.js';
|
|
621
|
+
// === LLM Credential + Role-Resolver Wire Types (T-LLM-CRED Phase 1/2 — T9255) ===
|
|
622
|
+
export type {
|
|
623
|
+
AuthTypeWire,
|
|
624
|
+
CredentialResultWire,
|
|
625
|
+
CredentialSourceWire,
|
|
626
|
+
CredentialsStoreStrategyWire,
|
|
627
|
+
// `cleo llm` CLI / dispatch operation contracts (T9258)
|
|
628
|
+
LlmAddParams,
|
|
629
|
+
LlmAddResult,
|
|
630
|
+
LlmListParams,
|
|
631
|
+
LlmListResult,
|
|
632
|
+
LlmProfileParams,
|
|
633
|
+
LlmProfileResult,
|
|
634
|
+
LlmRemoveParams,
|
|
635
|
+
LlmRemoveResult,
|
|
636
|
+
LlmStoredCredentialView,
|
|
637
|
+
LlmTestParams,
|
|
638
|
+
LlmTestResult,
|
|
639
|
+
LlmUseParams,
|
|
640
|
+
LlmUseResult,
|
|
641
|
+
LlmWhoamiEntry,
|
|
642
|
+
LlmWhoamiParams,
|
|
643
|
+
LlmWhoamiResult,
|
|
644
|
+
ModelTransport,
|
|
645
|
+
ResolutionSource,
|
|
646
|
+
ResolvedLLM,
|
|
647
|
+
ResolveLLMForRoleOptions,
|
|
648
|
+
StoredAuthTypeWire,
|
|
649
|
+
} from './operations/llm.js';
|
|
617
650
|
// Multi-pass retrieval bundle types (PSYCHE Wave 4 · T1090)
|
|
618
651
|
export type {
|
|
619
652
|
PassMask,
|
|
@@ -1092,7 +1125,31 @@ export type {
|
|
|
1092
1125
|
SyncResult,
|
|
1093
1126
|
SyncStatus,
|
|
1094
1127
|
} from './postgres-data-accessor.js';
|
|
1128
|
+
// === Project Context (ecosystem detection types) ===
|
|
1129
|
+
export type {
|
|
1130
|
+
EcosystemHint,
|
|
1131
|
+
FileNamingConvention,
|
|
1132
|
+
ImportStyle,
|
|
1133
|
+
ProjectContext,
|
|
1134
|
+
ProjectType,
|
|
1135
|
+
TestFramework,
|
|
1136
|
+
} from './project-context.js';
|
|
1095
1137
|
export type { AdapterPathProvider } from './provider-paths.js';
|
|
1138
|
+
// === Release Channel ===
|
|
1139
|
+
export type { ChannelValidationResult, ReleaseChannel } from './release/channel.js';
|
|
1140
|
+
// === Release GitHub PR ===
|
|
1141
|
+
export type {
|
|
1142
|
+
BranchProtectionResult,
|
|
1143
|
+
CleoKnownLabel,
|
|
1144
|
+
CleoLabelPalette,
|
|
1145
|
+
LabelDefinition,
|
|
1146
|
+
LabelEnsureResult,
|
|
1147
|
+
PRCreateOptions,
|
|
1148
|
+
PRLabelResolution,
|
|
1149
|
+
PRMode,
|
|
1150
|
+
PRResult,
|
|
1151
|
+
RepoIdentity,
|
|
1152
|
+
} from './release/github-pr.js';
|
|
1096
1153
|
// === Release Pipeline (T1597 / ADR-063) ===
|
|
1097
1154
|
export type {
|
|
1098
1155
|
PublishResult,
|
|
@@ -1102,6 +1159,16 @@ export type {
|
|
|
1102
1159
|
ReleaseVersionScheme,
|
|
1103
1160
|
VerifyResult,
|
|
1104
1161
|
} from './release/pipeline.js';
|
|
1162
|
+
// === Release Version Bump ===
|
|
1163
|
+
export type {
|
|
1164
|
+
BumpResult,
|
|
1165
|
+
BumpType,
|
|
1166
|
+
BumpVersionFromConfigResult,
|
|
1167
|
+
ResolveVersionBumpTargetsResult,
|
|
1168
|
+
VersionBumpStrategy,
|
|
1169
|
+
VersionBumpTarget,
|
|
1170
|
+
VersionBumpTargetSource,
|
|
1171
|
+
} from './release/version-bump.js';
|
|
1105
1172
|
// === Result Types (Dashboard, Stats, Log, Context, Sequence, Analysis, Deps) ===
|
|
1106
1173
|
export type {
|
|
1107
1174
|
BottleneckTask,
|