@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
package/dist/operations/llm.d.ts
CHANGED
|
@@ -52,6 +52,15 @@ export interface ModelConfig {
|
|
|
52
52
|
cachePolicy?: PromptCachePolicy | null;
|
|
53
53
|
/** Fallback model config used on final retry attempt. */
|
|
54
54
|
fallback?: Omit<ModelConfig, 'fallback'> | null;
|
|
55
|
+
/**
|
|
56
|
+
* Extra HTTP headers to attach to the provider client (merged into the SDK's
|
|
57
|
+
* `defaultHeaders`). Populated from `authHeaders(cred)` when a credential is
|
|
58
|
+
* resolved with `authType: 'oauth'` so the provider client uses the
|
|
59
|
+
* `Authorization: Bearer …` scheme instead of `x-api-key`.
|
|
60
|
+
*
|
|
61
|
+
* @task T-LLM-CRED-CENTRALIZATION Phase 1
|
|
62
|
+
*/
|
|
63
|
+
extraHeaders?: Record<string, string> | null;
|
|
55
64
|
}
|
|
56
65
|
/** Parameters for a single LLM call. */
|
|
57
66
|
export interface LLMCallParams {
|
|
@@ -105,4 +114,375 @@ export interface LLMCallResult<T = string> {
|
|
|
105
114
|
thinkingBlocks: Array<Record<string, unknown>>;
|
|
106
115
|
reasoningDetails: Array<Record<string, unknown>>;
|
|
107
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* Which credential-resolution tier produced a {@link CredentialResultWire}.
|
|
119
|
+
*
|
|
120
|
+
* Mirrors `CredentialSource` in `@cleocode/core/llm/credentials.ts`. The set is
|
|
121
|
+
* append-only; new tiers (e.g. `aws-sdk`, `gcp-sdk` in Phase 3) extend this
|
|
122
|
+
* union.
|
|
123
|
+
*
|
|
124
|
+
* @task T-LLM-CRED-CENTRALIZATION Phase 1
|
|
125
|
+
* @task T9255
|
|
126
|
+
*/
|
|
127
|
+
export type CredentialSourceWire = 'explicit' | 'env' | 'cred-file' | 'claude-creds' | 'global-config' | 'project-config';
|
|
128
|
+
/**
|
|
129
|
+
* Authentication scheme used when sending the credential to the provider.
|
|
130
|
+
*
|
|
131
|
+
* - `api_key` — provider-issued long-lived key sent as `x-api-key` (Anthropic)
|
|
132
|
+
* or `Authorization: Bearer …` (OpenAI, Gemini, Moonshot).
|
|
133
|
+
* - `oauth` — short-lived OAuth bearer token sent as `Authorization: Bearer …`
|
|
134
|
+
* with the matching beta header.
|
|
135
|
+
*
|
|
136
|
+
* @task T-LLM-CRED-CENTRALIZATION Phase 1
|
|
137
|
+
* @task T9255
|
|
138
|
+
*/
|
|
139
|
+
export type AuthTypeWire = 'api_key' | 'oauth';
|
|
140
|
+
/**
|
|
141
|
+
* Resolved credential as returned by `resolveCredentials()` /
|
|
142
|
+
* `resolveLLMForRole()`. Mirrors `CredentialResult` in core. Compatible by
|
|
143
|
+
* structural typing.
|
|
144
|
+
*
|
|
145
|
+
* @task T-LLM-CRED-CENTRALIZATION Phase 1
|
|
146
|
+
* @task T9255
|
|
147
|
+
*/
|
|
148
|
+
export interface CredentialResultWire {
|
|
149
|
+
/** Provider transport this credential is for. */
|
|
150
|
+
provider: ModelTransport;
|
|
151
|
+
/** API key or OAuth bearer token. `null` only when no credential was found. */
|
|
152
|
+
apiKey: string | null;
|
|
153
|
+
/** Which tier produced this credential. `undefined` when `apiKey` is `null`. */
|
|
154
|
+
source: CredentialSourceWire | undefined;
|
|
155
|
+
/** Scheme used to present the credential to the provider. */
|
|
156
|
+
authType: AuthTypeWire;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Which configuration tier produced a {@link ResolvedLLM}.
|
|
160
|
+
*
|
|
161
|
+
* Resolution chain order:
|
|
162
|
+
* 1. `role` — `config.llm.roles[role]` (explicit override)
|
|
163
|
+
* 2. `default` — `config.llm.default` (canonical default)
|
|
164
|
+
* 3. `daemon-legacy` — `config.llm.daemon` (deprecated alias)
|
|
165
|
+
* 4. `implicit-fallback` — hard-coded fallback inside the resolver
|
|
166
|
+
*
|
|
167
|
+
* Useful for `cleo llm whoami` diagnostics and for migration tooling that
|
|
168
|
+
* needs to identify call-sites still on the legacy `daemon` block.
|
|
169
|
+
*
|
|
170
|
+
* @task T9255
|
|
171
|
+
*/
|
|
172
|
+
export type ResolutionSource = 'role' | 'default' | 'daemon-legacy' | 'implicit-fallback';
|
|
173
|
+
/**
|
|
174
|
+
* Result envelope returned by `resolveLLMForRole(role)`.
|
|
175
|
+
*
|
|
176
|
+
* Carries the fully-wired SDK client plus the {@link CredentialResultWire}
|
|
177
|
+
* so raw-fetch callers (sleep-consolidation, observer-reflector, hygiene-scan)
|
|
178
|
+
* can call `authHeaders(credential)` themselves when bypassing the SDK
|
|
179
|
+
* client (e.g. to call the Anthropic Messages REST API directly).
|
|
180
|
+
*
|
|
181
|
+
* `client` is `null` only when `credential.apiKey` is also `null` — in which
|
|
182
|
+
* case the caller MUST fall back to its graceful-degradation path
|
|
183
|
+
* (`return null` / skip / log warn).
|
|
184
|
+
*
|
|
185
|
+
* `client` is typed as `unknown` here because the concrete SDK classes
|
|
186
|
+
* (Anthropic, OpenAI, GoogleGenerativeAI) are not referenced from contracts
|
|
187
|
+
* to preserve its zero-dependency footprint. Consumers MUST narrow via the
|
|
188
|
+
* typed helpers in `@cleocode/core/llm/role-resolver` (e.g.
|
|
189
|
+
* `resolveAnthropicForRole`) rather than casting with `as unknown as X`.
|
|
190
|
+
*
|
|
191
|
+
* @task T9255
|
|
192
|
+
*/
|
|
193
|
+
export interface ResolvedLLM {
|
|
194
|
+
/** LLM provider transport that was resolved. */
|
|
195
|
+
provider: ModelTransport;
|
|
196
|
+
/** Full model identifier. */
|
|
197
|
+
model: string;
|
|
198
|
+
/**
|
|
199
|
+
* Fully-wired SDK client constructed via `clientForModelConfig`. `null`
|
|
200
|
+
* when no credential is available. Typed as `unknown` — consumers MUST
|
|
201
|
+
* narrow via a provider-specific helper (e.g. `resolveAnthropicForRole`
|
|
202
|
+
* in `@cleocode/core/llm/role-resolver`), NEVER via an `as unknown as X`
|
|
203
|
+
* cast.
|
|
204
|
+
*/
|
|
205
|
+
client: unknown;
|
|
206
|
+
/**
|
|
207
|
+
* Resolved credential. `null` when no tier produced a token. Callers
|
|
208
|
+
* MUST handle this case.
|
|
209
|
+
*/
|
|
210
|
+
credential: CredentialResultWire | null;
|
|
211
|
+
/** Which config path produced this resolution. */
|
|
212
|
+
source: ResolutionSource;
|
|
213
|
+
/** When `roles[role].credentialLabel` was set, the label that was used. */
|
|
214
|
+
credentialLabel?: string;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Options accepted by `resolveLLMForRole()`.
|
|
218
|
+
*
|
|
219
|
+
* @task T9255
|
|
220
|
+
*/
|
|
221
|
+
export interface ResolveLLMForRoleOptions {
|
|
222
|
+
/**
|
|
223
|
+
* Absolute path to the project root. Forwarded to `loadConfig()` and to
|
|
224
|
+
* `resolveCredentials({ projectRoot })` for tier-5 project-config lookup.
|
|
225
|
+
* Defaults to `process.cwd()`.
|
|
226
|
+
*/
|
|
227
|
+
projectRoot?: string;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Storage-level authentication scheme as persisted in the credentials store.
|
|
231
|
+
*
|
|
232
|
+
* Wider than the wire-level {@link AuthTypeWire}: includes `'aws_sdk'` for
|
|
233
|
+
* Bedrock / Vertex entries where the AWS SDK supplies the credential
|
|
234
|
+
* out-of-band. The runtime resolver narrows `'aws_sdk' → 'api_key'` for
|
|
235
|
+
* wire-level use until Phase 3 widens {@link AuthTypeWire}.
|
|
236
|
+
*
|
|
237
|
+
* Mirrors `StoredAuthType` in `@cleocode/core/llm/credentials-store`.
|
|
238
|
+
*
|
|
239
|
+
* @task T9258
|
|
240
|
+
*/
|
|
241
|
+
export type StoredAuthTypeWire = 'api_key' | 'oauth' | 'aws_sdk';
|
|
242
|
+
/**
|
|
243
|
+
* Strategy used by the credentials-store picker.
|
|
244
|
+
*
|
|
245
|
+
* Mirrors `CredentialsStoreStrategy` in
|
|
246
|
+
* `@cleocode/core/llm/credentials-store`. Held here so callers outside
|
|
247
|
+
* `core` can render UI without taking a dependency on the storage module.
|
|
248
|
+
*
|
|
249
|
+
* @task T9258
|
|
250
|
+
*/
|
|
251
|
+
export type CredentialsStoreStrategyWire = 'priorityWithFallback' | 'roundRobin' | 'priorityOnly';
|
|
252
|
+
/**
|
|
253
|
+
* Token-redacted view of a single stored credential.
|
|
254
|
+
*
|
|
255
|
+
* `tokenPreview` is the last 4 characters of `accessToken` prefixed by
|
|
256
|
+
* `'…'` (e.g. `'…aB7q'`). The full token is NEVER returned by any
|
|
257
|
+
* `cleo llm` operation — callers that need the live token must resolve it
|
|
258
|
+
* through `resolveLLMForRole()`.
|
|
259
|
+
*
|
|
260
|
+
* @task T9258
|
|
261
|
+
*/
|
|
262
|
+
export interface LlmStoredCredentialView {
|
|
263
|
+
/** LLM transport this credential is for. */
|
|
264
|
+
provider: ModelTransport;
|
|
265
|
+
/** Human-readable identifier, unique within `provider`. */
|
|
266
|
+
label: string;
|
|
267
|
+
/** Storage-level auth scheme. */
|
|
268
|
+
authType: StoredAuthTypeWire;
|
|
269
|
+
/** Redacted token preview — last 4 chars, prefixed by `'…'`. */
|
|
270
|
+
tokenPreview: string;
|
|
271
|
+
/** Whether the entry carried a non-empty refresh token. */
|
|
272
|
+
hasRefreshToken: boolean;
|
|
273
|
+
/** Unix epoch ms; `null` means "never expires". */
|
|
274
|
+
expiresAt: number | null;
|
|
275
|
+
/** Lower wins. */
|
|
276
|
+
priority: number;
|
|
277
|
+
/** Free-form provenance label (`claude-code`, `cli-input`, etc.). */
|
|
278
|
+
source: string | undefined;
|
|
279
|
+
/** Optional override for provider base URL. */
|
|
280
|
+
baseUrl: string | null;
|
|
281
|
+
/** When `true`, the picker skips this entry. */
|
|
282
|
+
disabled: boolean;
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Parameters for `llm.add` (mutate).
|
|
286
|
+
*
|
|
287
|
+
* Mirrors the `cleo llm add <provider> --api-key <k>` CLI surface. When
|
|
288
|
+
* `authType` is omitted, the dispatcher auto-detects from the token
|
|
289
|
+
* prefix: tokens beginning with `sk-ant-oat-` are stored as `'oauth'`,
|
|
290
|
+
* everything else as `'api_key'`.
|
|
291
|
+
*
|
|
292
|
+
* @task T9258
|
|
293
|
+
*/
|
|
294
|
+
export interface LlmAddParams {
|
|
295
|
+
/** Target provider transport. */
|
|
296
|
+
provider: ModelTransport;
|
|
297
|
+
/** API key or OAuth bearer token to persist. */
|
|
298
|
+
apiKey: string;
|
|
299
|
+
/** Human-readable label, unique within `provider`. Defaults to `'default'`. */
|
|
300
|
+
label?: string;
|
|
301
|
+
/** Optional override for the provider base URL. */
|
|
302
|
+
baseUrl?: string;
|
|
303
|
+
/** Optional explicit auth type override (skips prefix auto-detect). */
|
|
304
|
+
authType?: StoredAuthTypeWire;
|
|
305
|
+
/** Optional priority override (lower wins). */
|
|
306
|
+
priority?: number;
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Result envelope for `llm.add`.
|
|
310
|
+
*
|
|
311
|
+
* @task T9258
|
|
312
|
+
*/
|
|
313
|
+
export interface LlmAddResult {
|
|
314
|
+
/** Token-redacted view of the newly stored entry. */
|
|
315
|
+
credential: LlmStoredCredentialView;
|
|
316
|
+
/** Detected auth type (`'oauth'` for `sk-ant-oat-*`, else `'api_key'`). */
|
|
317
|
+
detectedAuthType: StoredAuthTypeWire;
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Parameters for `llm.list` (query).
|
|
321
|
+
*
|
|
322
|
+
* @task T9258
|
|
323
|
+
*/
|
|
324
|
+
export interface LlmListParams {
|
|
325
|
+
/** Optional provider filter — when set, only entries for that provider. */
|
|
326
|
+
provider?: ModelTransport;
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Result envelope for `llm.list`.
|
|
330
|
+
*
|
|
331
|
+
* @task T9258
|
|
332
|
+
*/
|
|
333
|
+
export interface LlmListResult {
|
|
334
|
+
/** Token-redacted credentials, in store order (priority asc). */
|
|
335
|
+
credentials: LlmStoredCredentialView[];
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Parameters for `llm.remove` (mutate).
|
|
339
|
+
*
|
|
340
|
+
* @task T9258
|
|
341
|
+
*/
|
|
342
|
+
export interface LlmRemoveParams {
|
|
343
|
+
/** Target provider transport. */
|
|
344
|
+
provider: ModelTransport;
|
|
345
|
+
/** Label of the credential to remove. */
|
|
346
|
+
label: string;
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Result envelope for `llm.remove`.
|
|
350
|
+
*
|
|
351
|
+
* @task T9258
|
|
352
|
+
*/
|
|
353
|
+
export interface LlmRemoveResult {
|
|
354
|
+
/** `true` when a matching entry was deleted. */
|
|
355
|
+
removed: boolean;
|
|
356
|
+
/** Echo of the targeted `(provider, label)` pair. */
|
|
357
|
+
provider: ModelTransport;
|
|
358
|
+
/** Echo of the targeted label. */
|
|
359
|
+
label: string;
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* Parameters for `llm.use` (mutate) — set `llm.default.{provider,model}`.
|
|
363
|
+
*
|
|
364
|
+
* @task T9258
|
|
365
|
+
*/
|
|
366
|
+
export interface LlmUseParams {
|
|
367
|
+
/** Provider transport to mark as the default. */
|
|
368
|
+
provider: ModelTransport;
|
|
369
|
+
/** Optional default model identifier. When omitted, `default.model` is left untouched. */
|
|
370
|
+
model?: string;
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* Result envelope for `llm.use`.
|
|
374
|
+
*
|
|
375
|
+
* @task T9258
|
|
376
|
+
*/
|
|
377
|
+
export interface LlmUseResult {
|
|
378
|
+
/** Provider written to `llm.default.provider`. */
|
|
379
|
+
provider: ModelTransport;
|
|
380
|
+
/** Model written to `llm.default.model` — `null` when not provided. */
|
|
381
|
+
model: string | null;
|
|
382
|
+
/** Config scope the write landed in (`'global'` for `cleo llm use`). */
|
|
383
|
+
scope: 'project' | 'global';
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Parameters for `llm.profile` (mutate) — set `llm.roles[role]`.
|
|
387
|
+
*
|
|
388
|
+
* @task T9258
|
|
389
|
+
*/
|
|
390
|
+
export interface LlmProfileParams {
|
|
391
|
+
/** Logical role name. */
|
|
392
|
+
role: string;
|
|
393
|
+
/** Provider transport for this role. */
|
|
394
|
+
provider: ModelTransport;
|
|
395
|
+
/** Optional model identifier for this role. */
|
|
396
|
+
model?: string;
|
|
397
|
+
/** Optional credential label to pin this role to a specific store entry. */
|
|
398
|
+
credentialLabel?: string;
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* Result envelope for `llm.profile`.
|
|
402
|
+
*
|
|
403
|
+
* @task T9258
|
|
404
|
+
*/
|
|
405
|
+
export interface LlmProfileResult {
|
|
406
|
+
/** Role name written to `llm.roles[role]`. */
|
|
407
|
+
role: string;
|
|
408
|
+
/** Provider written for the role. */
|
|
409
|
+
provider: ModelTransport;
|
|
410
|
+
/** Model written for the role (or `null` when not supplied). */
|
|
411
|
+
model: string | null;
|
|
412
|
+
/** Credential label written for the role (or `null` when not supplied). */
|
|
413
|
+
credentialLabel: string | null;
|
|
414
|
+
/** Config scope the write landed in. */
|
|
415
|
+
scope: 'project' | 'global';
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* Parameters for `llm.test` (query).
|
|
419
|
+
*
|
|
420
|
+
* @task T9258
|
|
421
|
+
*/
|
|
422
|
+
export interface LlmTestParams {
|
|
423
|
+
/** Provider transport to test. */
|
|
424
|
+
provider: ModelTransport;
|
|
425
|
+
/** Optional credential label to pin the test to a specific store entry. */
|
|
426
|
+
label?: string;
|
|
427
|
+
/** Optional model override. Defaults to the provider's implicit fallback. */
|
|
428
|
+
model?: string;
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* Result envelope for `llm.test`. Tokens are NEVER included.
|
|
432
|
+
*
|
|
433
|
+
* @task T9258
|
|
434
|
+
*/
|
|
435
|
+
export interface LlmTestResult {
|
|
436
|
+
/** Provider transport that was probed. */
|
|
437
|
+
provider: ModelTransport;
|
|
438
|
+
/** Model identifier used for the probe. */
|
|
439
|
+
model: string;
|
|
440
|
+
/** End-to-end round-trip latency in ms. */
|
|
441
|
+
latencyMs: number;
|
|
442
|
+
/** Provider response identifier (e.g. Anthropic `msg_…`). `null` when unavailable. */
|
|
443
|
+
providerResponseId: string | null;
|
|
444
|
+
/** Redacted credential preview (last 4 chars) — confirms which entry was used. */
|
|
445
|
+
credentialPreview: string;
|
|
446
|
+
/** Resolution tier that produced the credential (`env`, `cred-file`, etc.). */
|
|
447
|
+
credentialSource: CredentialSourceWire;
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* Single `whoami` row — one entry per `RoleName`.
|
|
451
|
+
*
|
|
452
|
+
* @task T9258
|
|
453
|
+
*/
|
|
454
|
+
export interface LlmWhoamiEntry {
|
|
455
|
+
/** Role name (`'extraction' | 'consolidation' | ...`). */
|
|
456
|
+
role: string;
|
|
457
|
+
/** Provider that would be picked for this role. */
|
|
458
|
+
provider: ModelTransport;
|
|
459
|
+
/** Model that would be used. */
|
|
460
|
+
model: string;
|
|
461
|
+
/** Which config tier produced the resolution. */
|
|
462
|
+
source: ResolutionSource;
|
|
463
|
+
/** Credential label, when the role pinned a specific store entry. */
|
|
464
|
+
credentialLabel: string | undefined;
|
|
465
|
+
/** Resolution tier of the eventual credential, when one was reachable. */
|
|
466
|
+
credentialSource: CredentialSourceWire | undefined;
|
|
467
|
+
/** Whether a usable credential exists for this role. */
|
|
468
|
+
hasCredential: boolean;
|
|
469
|
+
}
|
|
470
|
+
/**
|
|
471
|
+
* Parameters for `llm.whoami` (query). Reserved for future filters.
|
|
472
|
+
*
|
|
473
|
+
* @task T9258
|
|
474
|
+
*/
|
|
475
|
+
export interface LlmWhoamiParams {
|
|
476
|
+
/** Optional role filter — when set, only that role is resolved. */
|
|
477
|
+
role?: string;
|
|
478
|
+
}
|
|
479
|
+
/**
|
|
480
|
+
* Result envelope for `llm.whoami`.
|
|
481
|
+
*
|
|
482
|
+
* @task T9258
|
|
483
|
+
*/
|
|
484
|
+
export interface LlmWhoamiResult {
|
|
485
|
+
/** One entry per role resolved (filtered by `params.role` when set). */
|
|
486
|
+
entries: LlmWhoamiEntry[];
|
|
487
|
+
}
|
|
108
488
|
//# sourceMappingURL=llm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llm.d.ts","sourceRoot":"","sources":["../../src/operations/llm.ts"],"names":[],"mappings":"AA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@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project context — canonical ecosystem detection types.
|
|
3
|
+
*
|
|
4
|
+
* Defines the shape of `.cleo/project-context.json` and the smaller hint
|
|
5
|
+
* envelope consumed by release-flow / spawn-engine / codebase-map analyzers.
|
|
6
|
+
*
|
|
7
|
+
* Type-only: the detector implementation lives in `@cleocode/core/store/
|
|
8
|
+
* project-detect.ts`. Centralising the types here lets any package (release,
|
|
9
|
+
* studio, agents, …) reason about ecosystem signals without importing core.
|
|
10
|
+
*
|
|
11
|
+
* @adr ADR-013
|
|
12
|
+
*/
|
|
13
|
+
/** Detected project ecosystem. Matches the writer in `detectProjectType`. */
|
|
14
|
+
export type ProjectType = 'node' | 'python' | 'rust' | 'go' | 'ruby' | 'java' | 'dotnet' | 'bash' | 'elixir' | 'php' | 'deno' | 'bun' | 'unknown';
|
|
15
|
+
/** Detected test framework. */
|
|
16
|
+
export type TestFramework = 'jest' | 'vitest' | 'mocha' | 'pytest' | 'bats' | 'cargo' | 'go' | 'rspec' | 'junit' | 'playwright' | 'cypress' | 'ava' | 'uvu' | 'tap' | 'node:test' | 'deno' | 'bun' | 'custom' | 'unknown';
|
|
17
|
+
/** File-naming convention detected from source files. */
|
|
18
|
+
export type FileNamingConvention = 'kebab-case' | 'snake_case' | 'camelCase' | 'PascalCase';
|
|
19
|
+
/** Module import style. */
|
|
20
|
+
export type ImportStyle = 'esm' | 'commonjs' | 'mixed';
|
|
21
|
+
/** Schema-compliant project context for LLM agent consumption. */
|
|
22
|
+
export interface ProjectContext {
|
|
23
|
+
schemaVersion: string;
|
|
24
|
+
detectedAt: string;
|
|
25
|
+
projectTypes: ProjectType[];
|
|
26
|
+
primaryType?: ProjectType;
|
|
27
|
+
monorepo: boolean;
|
|
28
|
+
testing?: {
|
|
29
|
+
framework?: TestFramework;
|
|
30
|
+
command?: string;
|
|
31
|
+
testFilePatterns?: string[];
|
|
32
|
+
directories?: {
|
|
33
|
+
unit?: string;
|
|
34
|
+
integration?: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
build?: {
|
|
38
|
+
command?: string;
|
|
39
|
+
outputDir?: string;
|
|
40
|
+
};
|
|
41
|
+
directories?: {
|
|
42
|
+
source?: string;
|
|
43
|
+
tests?: string;
|
|
44
|
+
docs?: string;
|
|
45
|
+
};
|
|
46
|
+
conventions?: {
|
|
47
|
+
fileNaming?: FileNamingConvention;
|
|
48
|
+
importStyle?: ImportStyle;
|
|
49
|
+
typeSystem?: string;
|
|
50
|
+
};
|
|
51
|
+
llmHints?: {
|
|
52
|
+
preferredTestStyle?: string;
|
|
53
|
+
typeSystem?: string;
|
|
54
|
+
commonPatterns?: string[];
|
|
55
|
+
avoidPatterns?: string[];
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Narrow subset of {@link ProjectContext} consumed by the release engine's
|
|
60
|
+
* workspace discovery and other ecosystem-aware flows. Avoid passing the
|
|
61
|
+
* full {@link ProjectContext} when only the three discriminating fields are
|
|
62
|
+
* needed.
|
|
63
|
+
*/
|
|
64
|
+
export interface EcosystemHint {
|
|
65
|
+
primaryType?: ProjectType;
|
|
66
|
+
projectTypes?: ProjectType[];
|
|
67
|
+
monorepo?: boolean;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=project-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-context.d.ts","sourceRoot":"","sources":["../src/project-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,6EAA6E;AAC7E,MAAM,MAAM,WAAW,GACnB,MAAM,GACN,QAAQ,GACR,MAAM,GACN,IAAI,GACJ,MAAM,GACN,MAAM,GACN,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,KAAK,GACL,MAAM,GACN,KAAK,GACL,SAAS,CAAC;AAEd,+BAA+B;AAC/B,MAAM,MAAM,aAAa,GACrB,MAAM,GACN,QAAQ,GACR,OAAO,GACP,Q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C,EAAE;QACT,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;QAC1B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;KAC1B,CAAC;CACH;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project context — canonical ecosystem detection types.
|
|
3
|
+
*
|
|
4
|
+
* Defines the shape of `.cleo/project-context.json` and the smaller hint
|
|
5
|
+
* envelope consumed by release-flow / spawn-engine / codebase-map analyzers.
|
|
6
|
+
*
|
|
7
|
+
* Type-only: the detector implementation lives in `@cleocode/core/store/
|
|
8
|
+
* project-detect.ts`. Centralising the types here lets any package (release,
|
|
9
|
+
* studio, agents, …) reason about ecosystem signals without importing core.
|
|
10
|
+
*
|
|
11
|
+
* @adr ADR-013
|
|
12
|
+
*/
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=project-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-context.js","sourceRoot":"","sources":["../src/project-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Release channel contracts — types describing the npm dist-tag channel
|
|
3
|
+
* model used by the release pipeline.
|
|
4
|
+
*
|
|
5
|
+
* The implementation (branch→channel resolution, version validation) lives
|
|
6
|
+
* in `@cleocode/core/release/channel.ts`. The types live here so consumers
|
|
7
|
+
* can describe / validate the same shapes without depending on core.
|
|
8
|
+
*
|
|
9
|
+
* @adr ADR-063
|
|
10
|
+
*/
|
|
11
|
+
/** npm dist-tag channel for a release. */
|
|
12
|
+
export type ReleaseChannel = 'latest' | 'beta' | 'alpha';
|
|
13
|
+
/** Result of validating a version string against a channel's expectations. */
|
|
14
|
+
export interface ChannelValidationResult {
|
|
15
|
+
valid: boolean;
|
|
16
|
+
expected?: string;
|
|
17
|
+
actual?: string;
|
|
18
|
+
message: string;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=channel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../../src/release/channel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,0CAA0C;AAC1C,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAEzD,8EAA8E;AAC9E,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Release channel contracts — types describing the npm dist-tag channel
|
|
3
|
+
* model used by the release pipeline.
|
|
4
|
+
*
|
|
5
|
+
* The implementation (branch→channel resolution, version validation) lives
|
|
6
|
+
* in `@cleocode/core/release/channel.ts`. The types live here so consumers
|
|
7
|
+
* can describe / validate the same shapes without depending on core.
|
|
8
|
+
*
|
|
9
|
+
* @adr ADR-063
|
|
10
|
+
*/
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=channel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channel.js","sourceRoot":"","sources":["../../src/release/channel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitHub PR contracts — types describing the PR-creation surface used by
|
|
3
|
+
* the release pipeline.
|
|
4
|
+
*
|
|
5
|
+
* The implementation lives in `@cleocode/core/release/github-pr.ts`. The
|
|
6
|
+
* types live here so consumers (CLI, studio, downstream tools) can describe
|
|
7
|
+
* / validate the same shapes without depending on core.
|
|
8
|
+
*
|
|
9
|
+
* @adr ADR-063
|
|
10
|
+
*/
|
|
11
|
+
import type { ReleaseChannel } from './channel.js';
|
|
12
|
+
/** Outcome of `detectBranchProtection`. */
|
|
13
|
+
export interface BranchProtectionResult {
|
|
14
|
+
protected: boolean;
|
|
15
|
+
detectionMethod: 'gh-api' | 'push-dry-run' | 'unknown';
|
|
16
|
+
error?: string;
|
|
17
|
+
}
|
|
18
|
+
/** Input to `createPullRequest`. */
|
|
19
|
+
export interface PRCreateOptions {
|
|
20
|
+
base: string;
|
|
21
|
+
head: string;
|
|
22
|
+
title: string;
|
|
23
|
+
body: string;
|
|
24
|
+
/**
|
|
25
|
+
* Requested PR labels. Non-existent ones are filtered or auto-created by
|
|
26
|
+
* the resolver; the engine never passes a bare list to `gh pr create`.
|
|
27
|
+
*/
|
|
28
|
+
labels?: string[];
|
|
29
|
+
version: string;
|
|
30
|
+
epicId?: string;
|
|
31
|
+
projectRoot?: string;
|
|
32
|
+
}
|
|
33
|
+
/** How a PR-create attempt resolved. */
|
|
34
|
+
export type PRMode = 'created' | 'manual' | 'skipped';
|
|
35
|
+
/** Outcome of `createPullRequest`. */
|
|
36
|
+
export interface PRResult {
|
|
37
|
+
mode: PRMode;
|
|
38
|
+
prUrl?: string;
|
|
39
|
+
prNumber?: number;
|
|
40
|
+
instructions?: string;
|
|
41
|
+
error?: string;
|
|
42
|
+
}
|
|
43
|
+
/** Parsed `owner/repo` pair extracted from a git remote URL. */
|
|
44
|
+
export interface RepoIdentity {
|
|
45
|
+
owner: string;
|
|
46
|
+
repo: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Names of the labels CLEO knows how to auto-create when they are missing
|
|
50
|
+
* on a repo. Includes the universal `release` flag plus one label per npm
|
|
51
|
+
* dist-tag channel.
|
|
52
|
+
*/
|
|
53
|
+
export type CleoKnownLabel = 'release' | ReleaseChannel;
|
|
54
|
+
/** Color + description used when CLEO auto-creates one of its known labels. */
|
|
55
|
+
export interface LabelDefinition {
|
|
56
|
+
color: string;
|
|
57
|
+
description: string;
|
|
58
|
+
}
|
|
59
|
+
/** Static palette of CLEO-known labels keyed by label name. */
|
|
60
|
+
export type CleoLabelPalette = Readonly<Record<CleoKnownLabel, LabelDefinition>>;
|
|
61
|
+
/** Outcome of {@link ensureCleoLabelsExist}. */
|
|
62
|
+
export interface LabelEnsureResult {
|
|
63
|
+
/** Labels that exist on the repo after this call (pre-existed or auto-created). */
|
|
64
|
+
ensured: string[];
|
|
65
|
+
/** Labels that this call created. */
|
|
66
|
+
created: string[];
|
|
67
|
+
/** Labels that could not be ensured (unknown to CLEO, or `gh label create` failed). */
|
|
68
|
+
missing: string[];
|
|
69
|
+
}
|
|
70
|
+
/** Outcome of {@link resolvePRLabels} — what to actually pass to `gh pr create`. */
|
|
71
|
+
export interface PRLabelResolution {
|
|
72
|
+
/** Labels safe to pass to `gh pr create`. */
|
|
73
|
+
labels: string[];
|
|
74
|
+
/** Labels auto-created during resolution. */
|
|
75
|
+
created: string[];
|
|
76
|
+
/** Labels dropped because they could not be ensured. */
|
|
77
|
+
missing: string[];
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=github-pr.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-pr.d.ts","sourceRoot":"","sources":["../../src/release/github-pr.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,2CAA2C;AAC3C,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,EAAE,QAAQ,GAAG,cAAc,GAAG,SAAS,CAAC;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,oCAAo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AChC,6CAA6C;IAC7C,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,6CAA6C;IAC7C,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,wDAAwD;IACxD,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitHub PR contracts — types describing the PR-creation surface used by
|
|
3
|
+
* the release pipeline.
|
|
4
|
+
*
|
|
5
|
+
* The implementation lives in `@cleocode/core/release/github-pr.ts`. The
|
|
6
|
+
* types live here so consumers (CLI, studio, downstream tools) can describe
|
|
7
|
+
* / validate the same shapes without depending on core.
|
|
8
|
+
*
|
|
9
|
+
* @adr ADR-063
|
|
10
|
+
*/
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=github-pr.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-pr.js","sourceRoot":"","sources":["../../src/release/github-pr.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
|