@cleocode/contracts 2026.6.13 → 2026.6.15

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.
Files changed (140) hide show
  1. package/dist/__tests__/operation-def.test.js +4 -1
  2. package/dist/__tests__/operation-def.test.js.map +1 -1
  3. package/dist/__tests__/provider-def.test.d.ts +12 -0
  4. package/dist/__tests__/provider-def.test.d.ts.map +1 -0
  5. package/dist/__tests__/provider-def.test.js +84 -0
  6. package/dist/__tests__/provider-def.test.js.map +1 -0
  7. package/dist/__tests__/service-provider.test.d.ts +17 -0
  8. package/dist/__tests__/service-provider.test.d.ts.map +1 -0
  9. package/dist/__tests__/service-provider.test.js +108 -0
  10. package/dist/__tests__/service-provider.test.js.map +1 -0
  11. package/dist/boundary.d.ts +52 -0
  12. package/dist/boundary.d.ts.map +1 -1
  13. package/dist/boundary.js +23 -0
  14. package/dist/boundary.js.map +1 -1
  15. package/dist/branch-lock.d.ts +4 -0
  16. package/dist/branch-lock.d.ts.map +1 -1
  17. package/dist/branch-lock.js.map +1 -1
  18. package/dist/conduit.d.ts +171 -0
  19. package/dist/conduit.d.ts.map +1 -1
  20. package/dist/config/index.d.ts +23 -0
  21. package/dist/config/index.d.ts.map +1 -0
  22. package/dist/config/index.js +22 -0
  23. package/dist/config/index.js.map +1 -0
  24. package/dist/config.d.ts +109 -1
  25. package/dist/config.d.ts.map +1 -1
  26. package/dist/dispatch/__tests__/tasks-gateway-crud-ops.test.d.ts +21 -0
  27. package/dist/dispatch/__tests__/tasks-gateway-crud-ops.test.d.ts.map +1 -0
  28. package/dist/dispatch/__tests__/tasks-gateway-crud-ops.test.js +84 -0
  29. package/dist/dispatch/__tests__/tasks-gateway-crud-ops.test.js.map +1 -0
  30. package/dist/dispatch/identity.d.ts +1 -1
  31. package/dist/dispatch/identity.d.ts.map +1 -1
  32. package/dist/dispatch/identity.js +20 -0
  33. package/dist/dispatch/identity.js.map +1 -1
  34. package/dist/dispatch/operation-def.d.ts +20 -0
  35. package/dist/dispatch/operation-def.d.ts.map +1 -1
  36. package/dist/dispatch/operations-registry.d.ts.map +1 -1
  37. package/dist/dispatch/operations-registry.js +1030 -46
  38. package/dist/dispatch/operations-registry.js.map +1 -1
  39. package/dist/index.d.ts +17 -8
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/index.js +15 -2
  42. package/dist/index.js.map +1 -1
  43. package/dist/lease-ipc/__tests__/freeze.test.js +92 -0
  44. package/dist/lease-ipc/__tests__/freeze.test.js.map +1 -1
  45. package/dist/lease-ipc/index.d.ts +2 -2
  46. package/dist/lease-ipc/index.d.ts.map +1 -1
  47. package/dist/lease-ipc/index.js +1 -1
  48. package/dist/lease-ipc/index.js.map +1 -1
  49. package/dist/lease-ipc/messages.d.ts +167 -3
  50. package/dist/lease-ipc/messages.d.ts.map +1 -1
  51. package/dist/lease-ipc/messages.js +93 -0
  52. package/dist/lease-ipc/messages.js.map +1 -1
  53. package/dist/llm/catalog-schema.d.ts +242 -0
  54. package/dist/llm/catalog-schema.d.ts.map +1 -0
  55. package/dist/llm/catalog-schema.js +153 -0
  56. package/dist/llm/catalog-schema.js.map +1 -0
  57. package/dist/llm/catalog-schema.json +139 -0
  58. package/dist/llm/index.d.ts +15 -0
  59. package/dist/llm/index.d.ts.map +1 -0
  60. package/dist/llm/index.js +14 -0
  61. package/dist/llm/index.js.map +1 -0
  62. package/dist/llm/oauth.d.ts +16 -2
  63. package/dist/llm/oauth.d.ts.map +1 -1
  64. package/dist/llm/onboarding.d.ts +126 -0
  65. package/dist/llm/onboarding.d.ts.map +1 -0
  66. package/dist/llm/onboarding.js +34 -0
  67. package/dist/llm/onboarding.js.map +1 -0
  68. package/dist/llm/provider-def.d.ts +254 -0
  69. package/dist/llm/provider-def.d.ts.map +1 -0
  70. package/dist/llm/provider-def.js +93 -0
  71. package/dist/llm/provider-def.js.map +1 -0
  72. package/dist/llm/system-resolver.d.ts +42 -0
  73. package/dist/llm/system-resolver.d.ts.map +1 -1
  74. package/dist/operations/admin.d.ts +124 -1
  75. package/dist/operations/admin.d.ts.map +1 -1
  76. package/dist/operations/entities.d.ts +110 -0
  77. package/dist/operations/entities.d.ts.map +1 -0
  78. package/dist/operations/entities.js +695 -0
  79. package/dist/operations/entities.js.map +1 -0
  80. package/dist/operations/llm.d.ts +16 -1
  81. package/dist/operations/llm.d.ts.map +1 -1
  82. package/dist/operations/output-contracts-data.d.ts.map +1 -1
  83. package/dist/operations/output-contracts-data.js +230 -0
  84. package/dist/operations/output-contracts-data.js.map +1 -1
  85. package/dist/operations/service.d.ts +68 -0
  86. package/dist/operations/service.d.ts.map +1 -0
  87. package/dist/operations/service.js +336 -0
  88. package/dist/operations/service.js.map +1 -0
  89. package/dist/operations/tasks.d.ts +109 -0
  90. package/dist/operations/tasks.d.ts.map +1 -1
  91. package/dist/operations/tasks.js.map +1 -1
  92. package/dist/operations/worktree.d.ts +11 -1
  93. package/dist/operations/worktree.d.ts.map +1 -1
  94. package/dist/playbook.d.ts +56 -0
  95. package/dist/playbook.d.ts.map +1 -1
  96. package/dist/release/plan.d.ts +5 -5
  97. package/dist/spawn.d.ts +70 -0
  98. package/dist/spawn.d.ts.map +1 -1
  99. package/dist/spawn.js +1 -0
  100. package/dist/spawn.js.map +1 -1
  101. package/dist/vault/service-provider.d.ts +343 -0
  102. package/dist/vault/service-provider.d.ts.map +1 -0
  103. package/dist/vault/service-provider.js +857 -0
  104. package/dist/vault/service-provider.js.map +1 -0
  105. package/dist/workgraph.d.ts +12 -12
  106. package/package.json +10 -2
  107. package/src/__tests__/__snapshots__/operations-registry.test.ts.snap +1 -1
  108. package/src/__tests__/operation-def.test.ts +6 -1
  109. package/src/__tests__/provider-def.test.ts +93 -0
  110. package/src/__tests__/service-provider.test.ts +129 -0
  111. package/src/boundary.ts +69 -0
  112. package/src/branch-lock.ts +4 -0
  113. package/src/conduit.ts +200 -0
  114. package/src/config/index.ts +35 -0
  115. package/src/config.ts +116 -1
  116. package/src/dispatch/__tests__/tasks-gateway-crud-ops.test.ts +99 -0
  117. package/src/dispatch/identity.ts +20 -0
  118. package/src/dispatch/operation-def.ts +21 -0
  119. package/src/dispatch/operations-registry.ts +1062 -36
  120. package/src/index.ts +147 -2
  121. package/src/lease-ipc/__tests__/freeze.test.ts +96 -0
  122. package/src/lease-ipc/index.ts +12 -0
  123. package/src/lease-ipc/messages.ts +117 -0
  124. package/src/llm/catalog-schema.json +139 -0
  125. package/src/llm/catalog-schema.ts +184 -0
  126. package/src/llm/index.ts +29 -0
  127. package/src/llm/oauth.ts +16 -2
  128. package/src/llm/onboarding.ts +131 -0
  129. package/src/llm/provider-def.ts +291 -0
  130. package/src/llm/system-resolver.ts +45 -0
  131. package/src/operations/admin.ts +144 -0
  132. package/src/operations/entities.ts +758 -0
  133. package/src/operations/llm.ts +16 -0
  134. package/src/operations/output-contracts-data.ts +264 -0
  135. package/src/operations/service.ts +360 -0
  136. package/src/operations/tasks.ts +119 -0
  137. package/src/operations/worktree.ts +11 -0
  138. package/src/playbook.ts +56 -0
  139. package/src/spawn.ts +79 -0
  140. package/src/vault/service-provider.ts +1137 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog-schema.d.ts","sourceRoot":"","sources":["../../src/llm/catalog-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,mEAAmE;AACnE,eAAO,MAAM,sBAAsB,iEAMzB,CAAC;AAEX,0DAA0D;AAC1D,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzE,0EAA0E;AAC1E,eAAO,MAAM,kBAAkB,oDAAqD,CAAC;AAErF,sDAAsD;AACtD,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAQlE,+CAA+C;AAC/C,eAAO,MAAM,uBAAu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* This is the type+validation SSoT for the **shipped, offline-first** provider+model
5
+ * catalog seed that populates the global `models_catalog` table (T11733) and backs
6
+ * offline/degraded catalog reads (T11737). It mirrors the JSON Schema in the sibling
7
+ * `catalog-schema.json` (draft 2020-12) one-to-one.
8
+ *
9
+ * ## Offline-first — NO network is implied by these types
10
+ *
11
+ * The {@link CuratedCatalog} shape describes a committed, build-time snapshot of the
12
+ * models.dev wire shape. Nothing here fetches; the network refresh op
13
+ * (`cleo llm refresh-catalog`) is a SEPARATE leaf. The seeder reads the bundled
14
+ * `curated-catalog.json` (validated against {@link curatedCatalogSchema}) and upserts
15
+ * every row offline.
16
+ *
17
+ * ## models_catalog row parity (AC4)
18
+ *
19
+ * {@link modelsCatalogRowSelectSchema} / {@link modelsCatalogRowInsertSchema} describe the
20
+ * FLATTENED per-row shape persisted in the `models_catalog` DB table — the json/cost/
21
+ * modalities sub-objects serialize to TEXT columns, booleans to `integer({mode:'boolean'})`.
22
+ * {@link flattenCatalogToRows} (in core) maps a {@link CuratedCatalog} → these rows.
23
+ *
24
+ * Contracts-purity (Gate 10): this module exports ONLY zod schemas (values) and
25
+ * `z.infer` types — no bodied runtime helpers. The flatten/seed logic lives in core.
26
+ *
27
+ * @module llm/catalog-schema
28
+ * @task T11731
29
+ * @epic T11694 (E8-CATALOG-CURATION)
30
+ */
31
+ import { z } from 'zod';
32
+ /** Legal `models_catalog.status` availability-lifecycle values. */
33
+ export const CATALOG_MODEL_STATUSES = [
34
+ 'stable',
35
+ 'beta',
36
+ 'preview',
37
+ 'deprecated',
38
+ 'retired',
39
+ ];
40
+ /** Legal provider auth mechanisms carried in a catalog provider entry. */
41
+ export const CATALOG_AUTH_TYPES = ['api_key', 'oauth', 'bedrock', 'vertex'];
42
+ /** ISO date `YYYY-MM-DD` matcher (the catalog sort/version key shape). */
43
+ const isoDate = z.string().regex(/^\d{4}-\d{2}-\d{2}$/, 'must be an ISO date (YYYY-MM-DD)');
44
+ /** Semver `MAJOR.MINOR.PATCH` matcher for the catalog snapshot version. */
45
+ const semver = z.string().regex(/^\d+\.\d+\.\d+$/, 'must be semver (MAJOR.MINOR.PATCH)');
46
+ /** Input/output modality lists for a model. */
47
+ export const catalogModalitiesSchema = z
48
+ .object({
49
+ input: z.array(z.string()),
50
+ output: z.array(z.string()),
51
+ })
52
+ .strict();
53
+ /** Per-1M-token cost facets for a model (all optional — providers vary). */
54
+ export const catalogCostSchema = z
55
+ .object({
56
+ input: z.number().optional(),
57
+ output: z.number().optional(),
58
+ cache_read: z.number().optional(),
59
+ cache_write: z.number().optional(),
60
+ context_over_200k: z.number().optional(),
61
+ })
62
+ .strict();
63
+ /** Context/output token-window limits for a model. */
64
+ export const catalogLimitSchema = z
65
+ .object({
66
+ context: z.number(),
67
+ output: z.number(),
68
+ })
69
+ .strict();
70
+ /** The provider-of-record (npm package + api protocol) for a model. */
71
+ export const catalogModelProviderSchema = z
72
+ .object({
73
+ npm: z.string(),
74
+ api: z.string(),
75
+ })
76
+ .strict();
77
+ /** Full models.dev wire capability set for a single model entry. */
78
+ export const catalogModelEntrySchema = z
79
+ .object({
80
+ id: z.string(),
81
+ name: z.string(),
82
+ family: z.string(),
83
+ attachment: z.boolean(),
84
+ reasoning: z.boolean(),
85
+ temperature: z.boolean(),
86
+ interleaved: z.boolean(),
87
+ tool_call: z.boolean(),
88
+ modalities: catalogModalitiesSchema,
89
+ cost: catalogCostSchema,
90
+ limit: catalogLimitSchema,
91
+ status: z.enum(CATALOG_MODEL_STATUSES),
92
+ release_date: isoDate,
93
+ provider: catalogModelProviderSchema,
94
+ })
95
+ .strict();
96
+ /** A provider record in the catalog envelope. */
97
+ export const catalogProviderSchema = z
98
+ .object({
99
+ id: z.string(),
100
+ endpoint: z.string(),
101
+ authTypes: z.array(z.enum(CATALOG_AUTH_TYPES)).min(1),
102
+ npm: z.string().optional(),
103
+ })
104
+ .strict();
105
+ /**
106
+ * Top-level shape of the curated catalog seed (`curated-catalog.json`).
107
+ *
108
+ * `providers` is keyed by provider id; `models` is keyed by provider id → model id →
109
+ * {@link catalogModelEntrySchema}.
110
+ */
111
+ export const curatedCatalogSchema = z
112
+ .object({
113
+ $schema: z.string().optional(),
114
+ version: semver,
115
+ lastUpdated: isoDate,
116
+ providers: z.record(z.string(), catalogProviderSchema),
117
+ models: z.record(z.string(), z.record(z.string(), catalogModelEntrySchema)),
118
+ })
119
+ .strict();
120
+ /**
121
+ * INSERT/UPSERT shape for one `models_catalog` row (the flattened persistence form).
122
+ *
123
+ * The catalog's nested `modalities` / `cost` sub-objects are JSON-serialized into the
124
+ * `modalities` / `cost` TEXT columns; booleans persist as `integer({mode:'boolean'})`.
125
+ * `provider_id` is the catalog key; `models_dev_id` mirrors the entry `id`.
126
+ */
127
+ export const modelsCatalogRowInsertSchema = z
128
+ .object({
129
+ id: z.string(),
130
+ providerId: z.string(),
131
+ name: z.string(),
132
+ family: z.string(),
133
+ attachment: z.boolean(),
134
+ reasoning: z.boolean(),
135
+ temperature: z.boolean(),
136
+ interleaved: z.boolean(),
137
+ toolCall: z.boolean(),
138
+ modalities: z.string(),
139
+ cost: z.string(),
140
+ contextLimit: z.number().nullable().optional(),
141
+ outputLimit: z.number().nullable().optional(),
142
+ status: z.enum(CATALOG_MODEL_STATUSES),
143
+ releaseDate: isoDate,
144
+ modelsDevId: z.string(),
145
+ source: z.string(),
146
+ seededAt: z.string().optional(),
147
+ })
148
+ .strict();
149
+ /** SELECT shape for one `models_catalog` row (adds the always-present `seededAt`). */
150
+ export const modelsCatalogRowSelectSchema = modelsCatalogRowInsertSchema.extend({
151
+ seededAt: z.string(),
152
+ });
153
+ //# sourceMappingURL=catalog-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog-schema.js","sourceRoot":"","sources":["../../src/llm/catalog-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,mEAAmE;AACnE,MAAM,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IAC7C,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC;IACtC,WAAW,EAAE,OAAO;IACpB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAChC,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ,sFAAsF;AACtF,MAAM,CAAC,MAAM,4BAA4B,GAAG,4BAA4B,CAAC,MAAM,CAAC;IAC9E,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;CACrB,CAAC,CAAC"}
@@ -0,0 +1,139 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://cleocode.dev/schemas/llm/curated-catalog.json",
4
+ "title": "Curated Models Catalog",
5
+ "description": "The shipped, offline-first provider+model catalog seed (E8 · T11731). One self-contained snapshot of the models.dev wire shape that seeds the global `models_catalog` table and backs offline/degraded reads. NO network access is implied by this file — it is the build-time committed mirror.",
6
+ "type": "object",
7
+ "required": ["version", "lastUpdated", "providers", "models"],
8
+ "additionalProperties": false,
9
+ "properties": {
10
+ "$schema": { "type": "string" },
11
+ "version": {
12
+ "type": "string",
13
+ "pattern": "^\\d+\\.\\d+\\.\\d+$",
14
+ "description": "Semver version of this catalog snapshot. Bumped on every regeneration; drives the seeder skip/re-seed decision."
15
+ },
16
+ "lastUpdated": {
17
+ "type": "string",
18
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
19
+ "description": "ISO date (YYYY-MM-DD) the snapshot was generated."
20
+ },
21
+ "providers": {
22
+ "type": "object",
23
+ "description": "Provider records keyed by models.dev provider id (e.g. `anthropic`, `openai`, `google`).",
24
+ "additionalProperties": {
25
+ "type": "object",
26
+ "required": ["id", "endpoint", "authTypes"],
27
+ "additionalProperties": false,
28
+ "properties": {
29
+ "id": { "type": "string", "description": "Provider id (matches the map key)." },
30
+ "endpoint": {
31
+ "type": "string",
32
+ "description": "Provider API base URL (e.g. `https://api.anthropic.com`)."
33
+ },
34
+ "authTypes": {
35
+ "type": "array",
36
+ "description": "Supported auth mechanisms keyed by provider id.",
37
+ "items": { "type": "string", "enum": ["api_key", "oauth", "bedrock", "vertex"] },
38
+ "minItems": 1
39
+ },
40
+ "npm": {
41
+ "type": "string",
42
+ "description": "Provider SDK npm package, when applicable (e.g. `@anthropic-ai/sdk`)."
43
+ }
44
+ }
45
+ }
46
+ },
47
+ "models": {
48
+ "type": "object",
49
+ "description": "Model entries keyed by provider id; each value is a map of model-id → model entry.",
50
+ "additionalProperties": {
51
+ "type": "object",
52
+ "additionalProperties": {
53
+ "$ref": "#/$defs/modelEntry"
54
+ }
55
+ }
56
+ }
57
+ },
58
+ "$defs": {
59
+ "modelEntry": {
60
+ "type": "object",
61
+ "description": "Full models.dev wire capability set for a single model.",
62
+ "required": [
63
+ "id",
64
+ "name",
65
+ "family",
66
+ "attachment",
67
+ "reasoning",
68
+ "temperature",
69
+ "interleaved",
70
+ "tool_call",
71
+ "modalities",
72
+ "cost",
73
+ "limit",
74
+ "status",
75
+ "release_date",
76
+ "provider"
77
+ ],
78
+ "additionalProperties": false,
79
+ "properties": {
80
+ "id": { "type": "string", "description": "Model identifier (e.g. `claude-haiku-4-5`)." },
81
+ "name": { "type": "string", "description": "Human-readable display name." },
82
+ "family": { "type": "string", "description": "Model family (e.g. `claude`, `gpt`, `gemini`)." },
83
+ "attachment": { "type": "boolean", "description": "Supports file/image attachments." },
84
+ "reasoning": { "type": "boolean", "description": "Supports extended reasoning / thinking." },
85
+ "temperature": { "type": "boolean", "description": "Honours a temperature parameter." },
86
+ "interleaved": { "type": "boolean", "description": "Supports interleaved thinking blocks." },
87
+ "tool_call": { "type": "boolean", "description": "Supports tool/function calling." },
88
+ "modalities": {
89
+ "type": "object",
90
+ "required": ["input", "output"],
91
+ "additionalProperties": false,
92
+ "properties": {
93
+ "input": { "type": "array", "items": { "type": "string" } },
94
+ "output": { "type": "array", "items": { "type": "string" } }
95
+ }
96
+ },
97
+ "cost": {
98
+ "type": "object",
99
+ "additionalProperties": false,
100
+ "properties": {
101
+ "input": { "type": "number" },
102
+ "output": { "type": "number" },
103
+ "cache_read": { "type": "number" },
104
+ "cache_write": { "type": "number" },
105
+ "context_over_200k": { "type": "number" }
106
+ }
107
+ },
108
+ "limit": {
109
+ "type": "object",
110
+ "required": ["context", "output"],
111
+ "additionalProperties": false,
112
+ "properties": {
113
+ "context": { "type": "number", "description": "Max context window (tokens)." },
114
+ "output": { "type": "number", "description": "Max output tokens." }
115
+ }
116
+ },
117
+ "status": {
118
+ "type": "string",
119
+ "enum": ["stable", "beta", "preview", "deprecated", "retired"],
120
+ "description": "Availability lifecycle of the model."
121
+ },
122
+ "release_date": {
123
+ "type": "string",
124
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
125
+ "description": "ISO release date (YYYY-MM-DD). The SSoT sort key — latest wins."
126
+ },
127
+ "provider": {
128
+ "type": "object",
129
+ "required": ["npm", "api"],
130
+ "additionalProperties": false,
131
+ "properties": {
132
+ "npm": { "type": "string" },
133
+ "api": { "type": "string" }
134
+ }
135
+ }
136
+ }
137
+ }
138
+ }
139
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * `@cleocode/contracts/llm` — LLM contract subpath barrel.
3
+ *
4
+ * Re-exports the declarative provider contracts so consumers can import from the
5
+ * `./llm` subpath (`@cleocode/contracts/llm`) in addition to the package root.
6
+ * Currently fronts the M3 Provider SSoT {@link ProviderDef} contract (T11702);
7
+ * other `llm/*` modules continue to export from the package root barrel.
8
+ *
9
+ * @module llm
10
+ * @task T11702
11
+ * @epic T11667
12
+ */
13
+ export type { AiSdkEndpoint, AnthropicMessagesEndpoint, OAuthFlowDef, OpenAICompletionsEndpoint, OpenAIResponsesEndpoint, ProviderDef, ProviderEndpoint, ProviderTransport, RequestQuirk, RequestQuirkKind, } from './provider-def.js';
14
+ export { PROVIDER_TRANSPORTS, REQUEST_QUIRK_KINDS, } from './provider-def.js';
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/llm/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,YAAY,EACV,aAAa,EACb,yBAAyB,EACzB,YAAY,EACZ,yBAAyB,EACzB,uBAAuB,EACvB,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * `@cleocode/contracts/llm` — LLM contract subpath barrel.
3
+ *
4
+ * Re-exports the declarative provider contracts so consumers can import from the
5
+ * `./llm` subpath (`@cleocode/contracts/llm`) in addition to the package root.
6
+ * Currently fronts the M3 Provider SSoT {@link ProviderDef} contract (T11702);
7
+ * other `llm/*` modules continue to export from the package root barrel.
8
+ *
9
+ * @module llm
10
+ * @task T11702
11
+ * @epic T11667
12
+ */
13
+ export { PROVIDER_TRANSPORTS, REQUEST_QUIRK_KINDS, } from './provider-def.js';
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/llm/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAcH,OAAO,EACL,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,mBAAmB,CAAC"}
@@ -134,9 +134,23 @@ export interface ProviderOAuthConfig {
134
134
  * `code_challenge`/`code_challenge_method`/`state`).
135
135
  *
136
136
  * Used by OpenAI/Codex (`id_token_add_organizations=true`,
137
- * `codex_cli_simplified_flow=true`, `originator=codex_cli_rs`). Anthropic and
138
- * Kimi Code leave this unset.
137
+ * `codex_cli_simplified_flow=true`, `originator=codex_cli_rs`) and Anthropic
138
+ * (`code=true` — makes the hosted callback page display the authorization
139
+ * code for manual paste-back). Kimi Code leaves this unset.
139
140
  */
140
141
  extraAuthParams?: Readonly<Record<string, string>>;
142
+ /**
143
+ * Encoding of the token-endpoint request body (code exchange + refresh).
144
+ *
145
+ * - `'form'` (default) — RFC 6749 §4.1.3 `application/x-www-form-urlencoded`.
146
+ * Used by OpenAI/Codex and every spec-compliant authorization server.
147
+ * - `'json'` — non-standard `application/json` body. Anthropic's token
148
+ * endpoint (`platform.claude.com/v1/oauth/token`) expects JSON and
149
+ * additionally requires the authorize-time `state` echoed in the exchange
150
+ * body (the same wire shape pi-ai, OpenCode, and Claude Code use).
151
+ *
152
+ * @default 'form'
153
+ */
154
+ tokenBodyFormat?: 'form' | 'json';
141
155
  }
142
156
  //# sourceMappingURL=oauth.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../../src/llm/oauth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH;;;;;;;GAOG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,aAAa,CAAC;AAM/C;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IAC1B,2BAA2B;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0EAA0E;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,SAAS,EAAE,MAAM,CAAC;CACnB;AAMD;;;;;;;;GAQG;AACH,MAAM,WAAW,cAAc;IAC7B,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,CAAC;IACjB,wDAAwD;IACxD,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;;OAMG;IACH,qBAAqB,EAAE,MAAM,CAAC;IAC9B;;;;;OAKG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,M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AIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACjD;AAMD;;;;;;;;GAQG;AACH,MAAM,WAAW,mBAAmB;IAClC,2CAA2C;IAC3C,IAAI,EAAE,SAAS,CAAC;IAChB,2BAA2B;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,0BAA0B;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;;;;;;OAWG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;;;;OASG;IACH,eAAe,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACnD;;;;;;;;;;;OAWG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACnC"}
@@ -0,0 +1,126 @@
1
+ /**
2
+ * Onboarding login engine — typed result envelope (T11724 · M3).
3
+ *
4
+ * The 3-step onboarding login flow (`runOnboardingLogin` in `@cleocode/core`)
5
+ * walks a provider from a cold start to a usable, validated profile binding:
6
+ *
7
+ * 1. **connect** — resolve the provider (alias → canonical) and land a
8
+ * credential (Account) in the multi-credential pool (OAuth token or API
9
+ * key). NO browser interaction in the engine itself: the owner-driven
10
+ * OAuth code/token is passed in, so the flow is non-interactive and
11
+ * testable.
12
+ * 2. **select** — pick a model from the catalog (latest by `release_date`,
13
+ * or an explicit override validated against the catalog).
14
+ * 3. **bind** — write the `llm.default` / `llm.roles[role]` config binding
15
+ * that ties the account + model together.
16
+ * 4. **validate** — round-trip the binding through `resolveLLMForSystem` and
17
+ * confirm the resolved provider/model are consistent. NOT a live LLM call:
18
+ * no token is materialized, only the resolution metadata is asserted.
19
+ *
20
+ * ## Security — NO secret fields (AC2)
21
+ *
22
+ * This module is **types-only** (Gate 10 contracts-purity). The result
23
+ * envelope carries ONLY non-secret identifiers — provider name, account label,
24
+ * model id, profile/role name, and per-step status. It NEVER carries an access
25
+ * token, API key, refresh token, or any token-derived value beyond a redacted
26
+ * preview. The plaintext secret is materialized only at the wire via the
27
+ * {@link SealedCredential} handle — never on this envelope.
28
+ *
29
+ * @module llm/onboarding
30
+ * @task T11724
31
+ * @epic T11671 (E6-ONBOARDING-FRONT-DOOR)
32
+ */
33
+ import type { ProviderId } from './provider-id.js';
34
+ /**
35
+ * Discriminant naming each step of the onboarding login flow, in execution
36
+ * order. Surfaced on every {@link OnboardingStepResult} so a UI / CLI can
37
+ * render a deterministic 4-row progress checklist.
38
+ *
39
+ * @task T11724
40
+ */
41
+ export type OnboardingStepName = 'connect' | 'select' | 'bind' | 'validate';
42
+ /**
43
+ * Outcome of a single onboarding step.
44
+ *
45
+ * - `'ok'` — the step completed successfully.
46
+ * - `'failed'` — the step could not complete (e.g. missing credential,
47
+ * unknown model, config write error). The engine STOPS at the first
48
+ * `'failed'` step and returns the partial envelope; it does NOT throw.
49
+ * - `'skipped'` — the step was intentionally not run because an earlier step
50
+ * failed (downstream steps are short-circuited but still reported so the
51
+ * 4-row shape is stable).
52
+ *
53
+ * @task T11724
54
+ */
55
+ export type OnboardingStepStatus = 'ok' | 'failed' | 'skipped';
56
+ /**
57
+ * Result of one step in the onboarding login flow.
58
+ *
59
+ * `detail` is a short, human-readable, SECRET-FREE summary of what the step
60
+ * did (e.g. `"account 'work' connected (oauth)"`, `"model 'claude-…' selected
61
+ * from catalog"`). `code` carries a stable `E_*` error code on failure so a
62
+ * caller can branch programmatically without string-matching `detail`.
63
+ *
64
+ * @task T11724
65
+ */
66
+ export interface OnboardingStepResult {
67
+ /** Which step this result describes. */
68
+ readonly step: OnboardingStepName;
69
+ /** Terminal status of the step. */
70
+ readonly status: OnboardingStepStatus;
71
+ /** Human-readable, secret-free summary of the step outcome. */
72
+ readonly detail: string;
73
+ /**
74
+ * Stable `E_*` error code when `status === 'failed'`; omitted otherwise.
75
+ * Never carries a token or other secret.
76
+ */
77
+ readonly code?: string;
78
+ }
79
+ /**
80
+ * The auth scheme by which the connect step landed a credential in the pool.
81
+ *
82
+ * - `'oauth'` — an OAuth access token (PKCE / device-code) was supplied.
83
+ * - `'api_key'` — a raw API key was supplied (OAuth-less providers fall
84
+ * through to this path — AC4).
85
+ *
86
+ * @task T11724
87
+ */
88
+ export type OnboardingAuthMode = 'oauth' | 'api_key';
89
+ /**
90
+ * Typed result envelope returned by `runOnboardingLogin` (AC2).
91
+ *
92
+ * Carries NO secret fields — only the per-step trace and the non-secret
93
+ * identifiers needed to render the result and confirm the binding. `validated`
94
+ * is the single boolean a caller checks to know the end-to-end flow succeeded
95
+ * (all four steps `'ok'` AND the round-trip resolution was consistent).
96
+ *
97
+ * @task T11724
98
+ */
99
+ export interface OnboardingResult {
100
+ /** The 4 step traces, always length 4, in execution order. */
101
+ readonly steps: ReadonlyArray<OnboardingStepResult>;
102
+ /** Canonical provider id the flow resolved to (alias → canonical). */
103
+ readonly provider: ProviderId;
104
+ /**
105
+ * Human-readable account/credential label the connect step stored in the
106
+ * pool (e.g. `'oauth-login'`, `'work'`). Names *which* credential the
107
+ * binding points at — safe to log/serialize; NOT a secret.
108
+ */
109
+ readonly accountLabel: string;
110
+ /** The auth scheme used by the connect step, or `null` when connect failed. */
111
+ readonly authMode: OnboardingAuthMode | null;
112
+ /** Catalog model id the select step chose, or `null` when select failed. */
113
+ readonly modelId: string | null;
114
+ /**
115
+ * The profile/role name the bind step wrote (e.g. `'default'` for the global
116
+ * binding or a {@link import('../config.js').RoleName} for a per-role
117
+ * binding), or `null` when bind failed.
118
+ */
119
+ readonly profileName: string | null;
120
+ /**
121
+ * `true` only when all four steps succeeded AND the validate round-trip
122
+ * confirmed the binding resolves to the connected provider + selected model.
123
+ */
124
+ readonly validated: boolean;
125
+ }
126
+ //# sourceMappingURL=onboarding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"onboarding.d.ts","sourceRoot":"","sources":["../../src/llm/onboarding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;AAE5E;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,oBAAoB,GAAG,IAAI,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE/D;;;;;;;;;GASG;AACH,MAAM,WAAW,oBAAoB;IACnC,wCAAwC;IACxC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAClC,mCAAmC;IACnC,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAC;IACtC,+DAA+D;IAC/D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,SAAS,CAAC;AAErD;;;;;;;;;GASG;AACH,MAAM,WAAW,gBAAgB;IAC/B,8DAA8D;IAC9D,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAC;IACpD,sEAAsE;IACtE,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,+EAA+E;IAC/E,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAC7C,4EAA4E;IAC5E,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC;;;;OAIG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Onboarding login engine — typed result envelope (T11724 · M3).
3
+ *
4
+ * The 3-step onboarding login flow (`runOnboardingLogin` in `@cleocode/core`)
5
+ * walks a provider from a cold start to a usable, validated profile binding:
6
+ *
7
+ * 1. **connect** — resolve the provider (alias → canonical) and land a
8
+ * credential (Account) in the multi-credential pool (OAuth token or API
9
+ * key). NO browser interaction in the engine itself: the owner-driven
10
+ * OAuth code/token is passed in, so the flow is non-interactive and
11
+ * testable.
12
+ * 2. **select** — pick a model from the catalog (latest by `release_date`,
13
+ * or an explicit override validated against the catalog).
14
+ * 3. **bind** — write the `llm.default` / `llm.roles[role]` config binding
15
+ * that ties the account + model together.
16
+ * 4. **validate** — round-trip the binding through `resolveLLMForSystem` and
17
+ * confirm the resolved provider/model are consistent. NOT a live LLM call:
18
+ * no token is materialized, only the resolution metadata is asserted.
19
+ *
20
+ * ## Security — NO secret fields (AC2)
21
+ *
22
+ * This module is **types-only** (Gate 10 contracts-purity). The result
23
+ * envelope carries ONLY non-secret identifiers — provider name, account label,
24
+ * model id, profile/role name, and per-step status. It NEVER carries an access
25
+ * token, API key, refresh token, or any token-derived value beyond a redacted
26
+ * preview. The plaintext secret is materialized only at the wire via the
27
+ * {@link SealedCredential} handle — never on this envelope.
28
+ *
29
+ * @module llm/onboarding
30
+ * @task T11724
31
+ * @epic T11671 (E6-ONBOARDING-FRONT-DOOR)
32
+ */
33
+ export {};
34
+ //# sourceMappingURL=onboarding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"onboarding.js","sourceRoot":"","sources":["../../src/llm/onboarding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG"}