@gajae-code/coding-agent 0.15.5 → 0.15.6

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 (155) hide show
  1. package/CHANGELOG.md +26 -1
  2. package/dist/types/async/job-manager.d.ts +83 -0
  3. package/dist/types/cli/auth-gateway-cli.d.ts +17 -0
  4. package/dist/types/cli/model-presets-cli.d.ts +9 -0
  5. package/dist/types/cli/update-cli.d.ts +2 -0
  6. package/dist/types/commands/auth-gateway.d.ts +3 -0
  7. package/dist/types/commands/gc.d.ts +13 -0
  8. package/dist/types/commands/model-presets.d.ts +21 -0
  9. package/dist/types/config/autorouting-tier-map.d.ts +96 -0
  10. package/dist/types/config/file-lock.d.ts +49 -2
  11. package/dist/types/config/internal/model-preset-registry-test-state.d.ts +4 -0
  12. package/dist/types/config/internal/model-preset-registry-test-support.d.ts +3 -0
  13. package/dist/types/config/keybindings.d.ts +3 -2
  14. package/dist/types/config/model-preset-registry.d.ts +368 -0
  15. package/dist/types/config/model-profile-activation.d.ts +39 -0
  16. package/dist/types/config/model-profiles.d.ts +5 -3
  17. package/dist/types/config/model-registry.d.ts +11 -5
  18. package/dist/types/config/settings-schema.d.ts +9 -0
  19. package/dist/types/coordinator-mcp/model-preset.d.ts +7 -5
  20. package/dist/types/coordinator-mcp/projection-scan.d.ts +46 -0
  21. package/dist/types/extensibility/extensions/types.d.ts +2 -5
  22. package/dist/types/gjc-runtime/empty-delete-gc.d.ts +58 -0
  23. package/dist/types/gjc-runtime/gc-runtime.d.ts +2 -0
  24. package/dist/types/gjc-runtime/session-state-lock.d.ts +35 -6
  25. package/dist/types/gjc-runtime/session-state-sidecar.d.ts +6 -0
  26. package/dist/types/index.d.ts +1 -0
  27. package/dist/types/main.d.ts +3 -1
  28. package/dist/types/modes/components/jobs-overlay-model.d.ts +4 -2
  29. package/dist/types/modes/jobs-observer.d.ts +36 -0
  30. package/dist/types/sdk/broker/broker.d.ts +3 -0
  31. package/dist/types/sdk/bus/kind-aware-reconciliation.d.ts +3 -0
  32. package/dist/types/sdk/bus/prompt-reconciliation.d.ts +4 -0
  33. package/dist/types/sdk/client/discovery.d.ts +1 -0
  34. package/dist/types/sdk/host/model-pin.d.ts +7 -2
  35. package/dist/types/sdk/host/sdk-run-capability.d.ts +1 -0
  36. package/dist/types/sdk/host/session-runtime.d.ts +15 -1
  37. package/dist/types/sdk/prompt-deadline-manager.d.ts +11 -1
  38. package/dist/types/sdk/protocol/adapter-validation.d.ts +2 -0
  39. package/dist/types/sdk/router/session-router.d.ts +9 -0
  40. package/dist/types/session/account-inventory.d.ts +1 -0
  41. package/dist/types/session/agent-session.d.ts +19 -7
  42. package/dist/types/session/fold-coordinator.d.ts +201 -0
  43. package/dist/types/session/sdk-run-capability-internal.d.ts +7 -0
  44. package/dist/types/session/sdk-run-capability.d.ts +2 -0
  45. package/dist/types/telemetry/control.d.ts +11 -0
  46. package/dist/types/telemetry/events.d.ts +20 -0
  47. package/dist/types/telemetry/index.d.ts +3 -0
  48. package/dist/types/telemetry/transport.d.ts +22 -0
  49. package/dist/types/tools/bash-interactive.d.ts +23 -0
  50. package/dist/types/tools/index.d.ts +6 -5
  51. package/dist/types/web/search/providers/base.d.ts +9 -4
  52. package/dist/types/web/search/providers/xai.d.ts +2 -1
  53. package/dist/types/web/search/types.d.ts +14 -0
  54. package/package.json +10 -7
  55. package/scripts/generate-hotkeys-docs.ts +4 -0
  56. package/scripts/generate-sdk-operation-inventory.ts +3 -3
  57. package/src/async/job-manager.ts +671 -39
  58. package/src/cli/auth-broker-cli.ts +40 -12
  59. package/src/cli/auth-gateway-cli.ts +273 -97
  60. package/src/cli/config-cli.ts +2 -2
  61. package/src/cli/fast-help.ts +3 -0
  62. package/src/cli/model-presets-cli.ts +100 -0
  63. package/src/cli/update-cli.ts +40 -5
  64. package/src/cli.ts +6 -2
  65. package/src/commands/auth-gateway.ts +12 -8
  66. package/src/commands/gc.ts +19 -0
  67. package/src/commands/model-presets.ts +24 -0
  68. package/src/config/autorouting-tier-map.ts +32 -0
  69. package/src/config/file-lock-gc.ts +9 -4
  70. package/src/config/file-lock.ts +775 -59
  71. package/src/config/internal/model-preset-registry-test-state.ts +28 -0
  72. package/src/config/internal/model-preset-registry-test-support.ts +11 -0
  73. package/src/config/keybindings.ts +6 -2
  74. package/src/config/model-preset-registry.ts +2799 -0
  75. package/src/config/model-profile-activation.ts +115 -28
  76. package/src/config/model-profile-contract.ts +4 -1
  77. package/src/config/model-profiles.ts +51 -9
  78. package/src/config/model-registry.ts +1021 -122
  79. package/src/config/settings-schema.ts +11 -0
  80. package/src/config/settings.ts +6 -1
  81. package/src/coordinator-mcp/model-preset.ts +32 -17
  82. package/src/coordinator-mcp/projection-scan.ts +571 -0
  83. package/src/coordinator-mcp/server.ts +19 -24
  84. package/src/coordinator-mcp/session-reaper.ts +9 -3
  85. package/src/extensibility/extensions/loader.ts +0 -1
  86. package/src/extensibility/extensions/types.ts +2 -3
  87. package/src/extensibility/gjc-plugins/runtime-adapters.ts +1 -0
  88. package/src/gjc-runtime/empty-delete-gc.ts +301 -0
  89. package/src/gjc-runtime/gc-render.ts +29 -0
  90. package/src/gjc-runtime/gc-runtime.ts +174 -11
  91. package/src/gjc-runtime/session-state-lock.ts +1242 -141
  92. package/src/gjc-runtime/session-state-sidecar.ts +76 -3
  93. package/src/index.ts +1 -0
  94. package/src/internal-urls/docs-index.generated.ts +9 -8
  95. package/src/lsp/config.ts +4 -3
  96. package/src/lsp/path-trust.ts +12 -6
  97. package/src/main.ts +9 -2
  98. package/src/modes/acp/acp-agent.ts +11 -5
  99. package/src/modes/components/jobs-overlay-model.ts +99 -16
  100. package/src/modes/components/model-selector.ts +158 -18
  101. package/src/modes/components/status-line/segments.ts +6 -1
  102. package/src/modes/controllers/extension-ui-controller.ts +1 -1
  103. package/src/modes/controllers/input-controller.ts +23 -6
  104. package/src/modes/interactive-mode.ts +14 -1
  105. package/src/modes/jobs-observer.ts +149 -16
  106. package/src/modes/runtime-init.ts +1 -1
  107. package/src/modes/utils/injected-user-submission.ts +15 -1
  108. package/src/prompts/tools/bash.md +2 -2
  109. package/src/prompts/tools/fold-receipt.md +3 -0
  110. package/src/prompts/tools/job.md +1 -1
  111. package/src/sdk/acp/adapter.ts +17 -2
  112. package/src/sdk/broker/broker.ts +48 -21
  113. package/src/sdk/broker/lifecycle.ts +32 -6
  114. package/src/sdk/bus/chat-daemon-control.ts +2 -2
  115. package/src/sdk/bus/chat-daemon-runtime.ts +11 -1
  116. package/src/sdk/bus/kind-aware-reconciliation.ts +36 -6
  117. package/src/sdk/bus/prompt-reconciliation.ts +28 -4
  118. package/src/sdk/bus/slack-conversation.ts +5 -1
  119. package/src/sdk/cli/session-cli.ts +12 -1
  120. package/src/sdk/client/discovery.ts +3 -1
  121. package/src/sdk/host/control/dispatch.ts +3 -0
  122. package/src/sdk/host/model-pin.ts +185 -25
  123. package/src/sdk/host/sdk-run-capability.ts +1 -0
  124. package/src/sdk/host/session-runtime.test.ts +371 -37
  125. package/src/sdk/host/session-runtime.ts +364 -52
  126. package/src/sdk/prompt-deadline-manager.ts +16 -1
  127. package/src/sdk/protocol/adapter-validation.ts +27 -0
  128. package/src/sdk/protocol/operation-inventory.generated.json +2 -2
  129. package/src/sdk/protocol/operation-registry.ts +4 -1
  130. package/src/sdk/router/session-router.ts +228 -96
  131. package/src/sdk/session.ts +83 -12
  132. package/src/session/account-inventory.ts +27 -11
  133. package/src/session/agent-session.ts +678 -103
  134. package/src/session/fold-coordinator.ts +433 -0
  135. package/src/session/sdk-run-capability-internal.ts +15 -0
  136. package/src/session/sdk-run-capability.ts +2 -0
  137. package/src/session/session-manager.ts +5 -4
  138. package/src/setup/provider-presets.json +1 -1
  139. package/src/slash-commands/helpers/credential-switch.ts +6 -1
  140. package/src/task/executor.ts +19 -3
  141. package/src/telemetry/control.ts +26 -0
  142. package/src/telemetry/events.ts +142 -0
  143. package/src/telemetry/index.ts +3 -0
  144. package/src/telemetry/transport.ts +87 -0
  145. package/src/tools/bash-interactive.ts +182 -85
  146. package/src/tools/bash.ts +772 -67
  147. package/src/tools/index.ts +7 -5
  148. package/src/tools/tool-catalog.generated.ts +1 -1
  149. package/src/web/search/provider.ts +120 -11
  150. package/src/web/search/providers/anthropic.ts +89 -17
  151. package/src/web/search/providers/base.ts +9 -4
  152. package/src/web/search/providers/gemini.ts +87 -15
  153. package/src/web/search/providers/openai-compatible.ts +23 -8
  154. package/src/web/search/providers/xai.ts +98 -12
  155. package/src/web/search/types.ts +16 -0
@@ -0,0 +1,368 @@
1
+ import type { Api, Model } from "@gajae-code/ai/core";
2
+ import * as z from "zod/v4";
3
+ import { type ModelProfileDefinition } from "./model-profiles";
4
+ import type { ModelsConfig } from "./models-config-schema";
5
+ export declare const MODEL_PRESET_REGISTRY_CONTRACT_VERSION = "1.0.0";
6
+ export declare const DEFAULT_MODEL_PRESET_REGISTRY_URL = "https://raw.githubusercontent.com/Yeachan-Heo/gajae-code-presets/dev/latest.json";
7
+ export declare const MODEL_PRESET_REGISTRY_REFRESH_INTERVAL_MS: number;
8
+ export declare const MODEL_PRESET_REGISTRY_STARTUP_DELAY_MS = 30000;
9
+ export declare const MODEL_PRESET_REGISTRY_MAX_MANIFEST_BYTES: number;
10
+ export declare const MODEL_PRESET_REGISTRY_MAX_SNAPSHOT_BYTES: number;
11
+ export declare const MODEL_PRESET_REGISTRY_MAX_PROFILES_BYTES: number;
12
+ export declare const MODEL_PRESET_REGISTRY_MAX_PRESETS_BYTES: number;
13
+ export interface ModelPresetRegistryTrustedKey {
14
+ keyId: string;
15
+ publicKeyPem: string;
16
+ validFrom: string;
17
+ revokedAt?: string;
18
+ }
19
+ export declare const ModelPresetRegistryManifestSchema: z.ZodObject<{
20
+ schemaVersion: z.ZodLiteral<"1.0.0">;
21
+ signed: z.ZodObject<{
22
+ registryRevision: z.ZodNumber;
23
+ revision: z.ZodString;
24
+ publishedAt: z.ZodString;
25
+ compatibility: z.ZodObject<{
26
+ consumerContract: z.ZodObject<{
27
+ minVersion: z.ZodString;
28
+ maxVersion: z.ZodString;
29
+ }, z.core.$strict>;
30
+ }, z.core.$strict>;
31
+ snapshot: z.ZodObject<{
32
+ path: z.ZodString;
33
+ sha256: z.ZodString;
34
+ bytes: z.ZodNumber;
35
+ count: z.ZodNumber;
36
+ }, z.core.$strict>;
37
+ contents: z.ZodObject<{
38
+ presets: z.ZodObject<{
39
+ path: z.ZodString;
40
+ sha256: z.ZodString;
41
+ bytes: z.ZodNumber;
42
+ count: z.ZodNumber;
43
+ }, z.core.$strict>;
44
+ profiles: z.ZodObject<{
45
+ path: z.ZodString;
46
+ sha256: z.ZodString;
47
+ bytes: z.ZodNumber;
48
+ count: z.ZodNumber;
49
+ }, z.core.$strict>;
50
+ }, z.core.$strict>;
51
+ provenance: z.ZodObject<{
52
+ sourceRepository: z.ZodLiteral<"https://github.com/Yeachan-Heo/gajae-code">;
53
+ sourceRevision: z.ZodString;
54
+ sourcePaths: z.ZodArray<z.ZodString>;
55
+ generatedBy: z.ZodString;
56
+ generatedAt: z.ZodString;
57
+ }, z.core.$strict>;
58
+ }, z.core.$strict>;
59
+ signature: z.ZodObject<{
60
+ algorithm: z.ZodLiteral<"Ed25519">;
61
+ keyId: z.ZodString;
62
+ value: z.ZodString;
63
+ }, z.core.$strict>;
64
+ }, z.core.$strict>;
65
+ export declare const ModelPresetRegistrySnapshotSchema: z.ZodObject<{
66
+ schemaVersion: z.ZodLiteral<"1.0.0">;
67
+ registryRevision: z.ZodNumber;
68
+ revision: z.ZodString;
69
+ compatibility: z.ZodObject<{
70
+ consumerContract: z.ZodObject<{
71
+ minVersion: z.ZodString;
72
+ maxVersion: z.ZodString;
73
+ }, z.core.$strict>;
74
+ }, z.core.$strict>;
75
+ provenance: z.ZodObject<{
76
+ sourceRepository: z.ZodLiteral<"https://github.com/Yeachan-Heo/gajae-code">;
77
+ sourceRevision: z.ZodString;
78
+ sourcePaths: z.ZodArray<z.ZodString>;
79
+ generatedBy: z.ZodString;
80
+ generatedAt: z.ZodString;
81
+ }, z.core.$strict>;
82
+ contents: z.ZodObject<{
83
+ presets: z.ZodObject<{
84
+ path: z.ZodString;
85
+ sha256: z.ZodString;
86
+ bytes: z.ZodNumber;
87
+ count: z.ZodNumber;
88
+ }, z.core.$strict>;
89
+ profiles: z.ZodObject<{
90
+ path: z.ZodString;
91
+ sha256: z.ZodString;
92
+ bytes: z.ZodNumber;
93
+ count: z.ZodNumber;
94
+ }, z.core.$strict>;
95
+ }, z.core.$strict>;
96
+ }, z.core.$strict>;
97
+ export declare const ModelPresetRegistryProfilesSchema: z.ZodObject<{
98
+ schemaVersion: z.ZodLiteral<"1.0.0">;
99
+ revision: z.ZodString;
100
+ dynamicProviders: z.ZodArray<z.ZodString>;
101
+ profiles: z.ZodArray<z.ZodObject<{
102
+ id: z.ZodString;
103
+ displayName: z.ZodString;
104
+ providerGroup: z.ZodString;
105
+ requiredProviders: z.ZodArray<z.ZodString>;
106
+ alternativeProviderGroups: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString>>>;
107
+ roleBindings: z.ZodObject<{
108
+ default: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
109
+ executor: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
110
+ architect: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
111
+ planner: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
112
+ critic: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
113
+ }, z.core.$strict>;
114
+ }, z.core.$strict>>;
115
+ }, z.core.$strict>;
116
+ export declare const ModelPresetRegistryPresetsSchema: z.ZodObject<{
117
+ schemaVersion: z.ZodLiteral<"1.0.0">;
118
+ revision: z.ZodString;
119
+ presets: z.ZodArray<z.ZodObject<{
120
+ id: z.ZodString;
121
+ provider: z.ZodString;
122
+ name: z.ZodString;
123
+ api: z.ZodEnum<{
124
+ "anthropic-messages": "anthropic-messages";
125
+ "azure-openai-responses": "azure-openai-responses";
126
+ "bedrock-converse-stream": "bedrock-converse-stream";
127
+ "cursor-agent": "cursor-agent";
128
+ "google-gemini-cli": "google-gemini-cli";
129
+ "google-generative-ai": "google-generative-ai";
130
+ "google-vertex": "google-vertex";
131
+ "ollama-chat": "ollama-chat";
132
+ "openai-codex-responses": "openai-codex-responses";
133
+ "openai-completions": "openai-completions";
134
+ "openai-responses": "openai-responses";
135
+ }>;
136
+ reasoning: z.ZodBoolean;
137
+ input: z.ZodArray<z.ZodEnum<{
138
+ image: "image";
139
+ text: "text";
140
+ }>>;
141
+ output: z.ZodOptional<z.ZodArray<z.ZodEnum<{
142
+ image: "image";
143
+ text: "text";
144
+ }>>>;
145
+ cost: z.ZodObject<{
146
+ input: z.ZodNumber;
147
+ output: z.ZodNumber;
148
+ cacheRead: z.ZodNumber;
149
+ cacheWrite: z.ZodNumber;
150
+ }, z.core.$strict>;
151
+ contextWindow: z.ZodNumber;
152
+ maxTokens: z.ZodNumber;
153
+ compat: z.ZodOptional<z.ZodObject<{
154
+ maxTokensField: z.ZodOptional<z.ZodLiteral<"max_tokens">>;
155
+ reasoningContentField: z.ZodOptional<z.ZodLiteral<"reasoning_content">>;
156
+ thinkingFormat: z.ZodOptional<z.ZodLiteral<"zai">>;
157
+ reasoningEffortMap: z.ZodOptional<z.ZodObject<{
158
+ minimal: z.ZodOptional<z.ZodEnum<{
159
+ high: "high";
160
+ low: "low";
161
+ max: "max";
162
+ medium: "medium";
163
+ minimal: "minimal";
164
+ xhigh: "xhigh";
165
+ }>>;
166
+ low: z.ZodOptional<z.ZodEnum<{
167
+ high: "high";
168
+ low: "low";
169
+ max: "max";
170
+ medium: "medium";
171
+ minimal: "minimal";
172
+ xhigh: "xhigh";
173
+ }>>;
174
+ medium: z.ZodOptional<z.ZodEnum<{
175
+ high: "high";
176
+ low: "low";
177
+ max: "max";
178
+ medium: "medium";
179
+ minimal: "minimal";
180
+ xhigh: "xhigh";
181
+ }>>;
182
+ high: z.ZodOptional<z.ZodEnum<{
183
+ high: "high";
184
+ low: "low";
185
+ max: "max";
186
+ medium: "medium";
187
+ minimal: "minimal";
188
+ xhigh: "xhigh";
189
+ }>>;
190
+ xhigh: z.ZodOptional<z.ZodEnum<{
191
+ high: "high";
192
+ low: "low";
193
+ max: "max";
194
+ medium: "medium";
195
+ minimal: "minimal";
196
+ xhigh: "xhigh";
197
+ }>>;
198
+ max: z.ZodOptional<z.ZodEnum<{
199
+ high: "high";
200
+ low: "low";
201
+ max: "max";
202
+ medium: "medium";
203
+ minimal: "minimal";
204
+ xhigh: "xhigh";
205
+ }>>;
206
+ }, z.core.$strict>>;
207
+ requiresAssistantContentForToolCalls: z.ZodOptional<z.ZodBoolean>;
208
+ requiresReasoningContentForToolCalls: z.ZodOptional<z.ZodBoolean>;
209
+ supportsDeveloperRole: z.ZodOptional<z.ZodBoolean>;
210
+ supportsMultipleSystemMessages: z.ZodOptional<z.ZodBoolean>;
211
+ supportsReasoningEffort: z.ZodOptional<z.ZodBoolean>;
212
+ supportsStore: z.ZodOptional<z.ZodBoolean>;
213
+ supportsToolChoice: z.ZodOptional<z.ZodBoolean>;
214
+ supportsUsageInStreaming: z.ZodOptional<z.ZodBoolean>;
215
+ }, z.core.$strict>>;
216
+ thinking: z.ZodOptional<z.ZodObject<{
217
+ mode: z.ZodEnum<{
218
+ "anthropic-adaptive": "anthropic-adaptive";
219
+ "anthropic-budget-effort": "anthropic-budget-effort";
220
+ budget: "budget";
221
+ effort: "effort";
222
+ "google-level": "google-level";
223
+ }>;
224
+ minLevel: z.ZodOptional<z.ZodEnum<{
225
+ high: "high";
226
+ low: "low";
227
+ max: "max";
228
+ medium: "medium";
229
+ minimal: "minimal";
230
+ xhigh: "xhigh";
231
+ }>>;
232
+ maxLevel: z.ZodOptional<z.ZodEnum<{
233
+ high: "high";
234
+ low: "low";
235
+ max: "max";
236
+ medium: "medium";
237
+ minimal: "minimal";
238
+ xhigh: "xhigh";
239
+ }>>;
240
+ defaultLevel: z.ZodOptional<z.ZodEnum<{
241
+ high: "high";
242
+ low: "low";
243
+ max: "max";
244
+ medium: "medium";
245
+ minimal: "minimal";
246
+ xhigh: "xhigh";
247
+ }>>;
248
+ levels: z.ZodOptional<z.ZodArray<z.ZodEnum<{
249
+ high: "high";
250
+ low: "low";
251
+ max: "max";
252
+ medium: "medium";
253
+ minimal: "minimal";
254
+ xhigh: "xhigh";
255
+ }>>>;
256
+ }, z.core.$strict>>;
257
+ longContextPricing: z.ZodOptional<z.ZodObject<{
258
+ threshold: z.ZodNumber;
259
+ cost: z.ZodObject<{
260
+ input: z.ZodNumber;
261
+ output: z.ZodNumber;
262
+ cacheRead: z.ZodNumber;
263
+ cacheWrite: z.ZodNumber;
264
+ }, z.core.$strict>;
265
+ }, z.core.$strict>>;
266
+ applyPatchToolType: z.ZodOptional<z.ZodLiteral<"freeform">>;
267
+ preferWebsockets: z.ZodOptional<z.ZodBoolean>;
268
+ premiumMultiplier: z.ZodOptional<z.ZodNumber>;
269
+ priority: z.ZodOptional<z.ZodNumber>;
270
+ contextPromotionTarget: z.ZodOptional<z.ZodString>;
271
+ }, z.core.$strict>>;
272
+ }, z.core.$strict>;
273
+ export type ModelPresetRegistryManifest = z.infer<typeof ModelPresetRegistryManifestSchema>;
274
+ export type ModelPresetRegistrySnapshot = z.infer<typeof ModelPresetRegistrySnapshotSchema>;
275
+ export type ModelPresetRegistryProfiles = z.infer<typeof ModelPresetRegistryProfilesSchema>;
276
+ export type ModelPresetRegistryPresets = z.infer<typeof ModelPresetRegistryPresetsSchema>;
277
+ export interface ModelPresetRegistryDependencies {
278
+ agentDir?: string;
279
+ manifestUrl?: string;
280
+ fetch?: typeof fetch;
281
+ now?: () => Date;
282
+ timeoutMs?: number;
283
+ maxManifestBytes?: number;
284
+ maxSnapshotBytes?: number;
285
+ maxProfilesBytes?: number;
286
+ maxPresetsBytes?: number;
287
+ maxStateBytes?: number;
288
+ automaticRefresh?: boolean;
289
+ startupDelayMs?: number;
290
+ refreshIntervalMs?: number;
291
+ knownManifestSha256?: string;
292
+ }
293
+ export interface AcceptedModelPresetRegistry {
294
+ profiles: Map<string, ModelProfileDefinition>;
295
+ presets: Model<Api>[];
296
+ dynamicProviders: string[];
297
+ revision?: number;
298
+ revisionId?: string;
299
+ manifestSha256?: string;
300
+ keyId?: string;
301
+ sourceRevision?: string;
302
+ retainedProfiles: string[];
303
+ retainedPresets: string[];
304
+ error?: string;
305
+ disabled: boolean;
306
+ pinnedRevision?: number;
307
+ }
308
+ export type ModelPresetRegistryRefreshResult = {
309
+ status: "updated";
310
+ revision: number;
311
+ revisionId: string;
312
+ manifestSha256: string;
313
+ retainedProfiles: string[];
314
+ retainedPresets: string[];
315
+ } | {
316
+ status: "not_modified";
317
+ revision?: number;
318
+ } | {
319
+ status: "disabled";
320
+ revision?: number;
321
+ };
322
+ export interface ModelPresetRegistryStatus {
323
+ contractVersion: string;
324
+ source: "embedded" | "registry";
325
+ cacheHealth: "empty" | "valid" | "corrupt";
326
+ activeRevision?: number;
327
+ activeRevisionId?: string;
328
+ highestSeenRevision?: number;
329
+ manifestSha256?: string;
330
+ snapshotSha256?: string;
331
+ profilesSha256?: string;
332
+ presetsSha256?: string;
333
+ keyId?: string;
334
+ sourceRevision?: string;
335
+ acceptedAt?: string;
336
+ publishedAt?: string;
337
+ lastCheckedAt?: string;
338
+ lastError?: string;
339
+ disabled: boolean;
340
+ pinnedRevision?: number;
341
+ retainedProfiles: string[];
342
+ retainedPresets: string[];
343
+ historyRevisions: number[];
344
+ profileCount: number;
345
+ presetCount: number;
346
+ }
347
+ export declare function canonicalModelPresetRegistryJson(value: unknown): string;
348
+ export declare function loadAcceptedModelPresetRegistry(agentDir?: string, dependencies?: Omit<ModelPresetRegistryDependencies, "agentDir">): AcceptedModelPresetRegistry;
349
+ /**
350
+ * Async accepted-registry loader for validation paths that can await disk I/O.
351
+ * It mirrors the synchronous loader's fail-closed result contract while using
352
+ * Bun file reads for state/control payloads.
353
+ */
354
+ export declare function loadAcceptedModelPresetRegistryAsync(agentDir?: string, dependencies?: Omit<ModelPresetRegistryDependencies, "agentDir">): Promise<AcceptedModelPresetRegistry>;
355
+ export declare function loadAcceptedModelPresetProfiles(agentDir?: string, dependencies?: Omit<ModelPresetRegistryDependencies, "agentDir">): AcceptedModelPresetRegistry;
356
+ export declare function loadEffectiveModelProfiles(userProfiles: ModelsConfig["profiles"] | undefined, agentDir?: string, dependencies?: Omit<ModelPresetRegistryDependencies, "agentDir">): Map<string, ModelProfileDefinition>;
357
+ export declare function refreshModelPresetRegistry(dependencies?: ModelPresetRegistryDependencies): Promise<ModelPresetRegistryRefreshResult>;
358
+ export declare function setModelPresetRegistryDisabled(options: ModelPresetRegistryDependencies & {
359
+ disabled: boolean;
360
+ }): Promise<void>;
361
+ export declare function setModelPresetRegistryPin(options: ModelPresetRegistryDependencies & {
362
+ revision?: number;
363
+ }): Promise<void>;
364
+ export declare function rollbackModelPresetRegistry(options: ModelPresetRegistryDependencies & {
365
+ revision?: number;
366
+ }): Promise<void>;
367
+ export declare function getModelPresetRegistryStatus(dependencies?: ModelPresetRegistryDependencies): ModelPresetRegistryStatus;
368
+ export declare function refreshModelPresetRegistryInBackground(dependencies?: ModelPresetRegistryDependencies, onAccepted?: () => void): () => Promise<void>;
@@ -1,6 +1,7 @@
1
1
  import { ThinkingLevel } from "@gajae-code/agent-core";
2
2
  import type { Api, Model } from "@gajae-code/ai/core";
3
3
  import type { AgentSession, DefaultFallbackRuntimeState } from "../session/agent-session";
4
+ import { type ModelProfileDefinition } from "./model-profiles";
4
5
  export { resolveModelProfileName } from "./model-profile-contract";
5
6
  import { type GjcModelAssignmentTargetId, type ModelRegistry } from "./model-registry";
6
7
  import { type ModelSelectorValue } from "./model-selector-value";
@@ -129,6 +130,44 @@ export declare class ModelProfileCredentialError extends Error {
129
130
  constructor(profileLabel: string, providers: readonly string[], role?: string);
130
131
  }
131
132
  export declare function formatModelProfileCredentialError(profileLabel: string, providers: readonly string[]): string;
133
+ /**
134
+ * Resolve the explicitly configured OpenAI-compatible proxy provider id for a
135
+ * preset. Returns undefined when unset or empty. Passwords/labels are never
136
+ * treated as proxy ids here; only lowercase provider ids from settings.
137
+ */
138
+ export declare function resolveProxyProviderId(settings: Pick<Settings, "get"> | undefined): string | undefined;
139
+ export type ProxyProviderConfig = {
140
+ status: "unset";
141
+ } | {
142
+ status: "configured";
143
+ id: string;
144
+ } | {
145
+ status: "invalid";
146
+ value: string;
147
+ };
148
+ export declare function inspectProxyProviderId(settings: Pick<Settings, "get"> | undefined): ProxyProviderConfig;
149
+ /** Passive surfaces fail closed on malformed settings instead of throwing. */
150
+ export declare function tryResolveProxyProviderId(settings: Pick<Settings, "get"> | undefined): string | undefined;
151
+ export type ModelProfileProxyMode = "fallback" | "always";
152
+ export declare function resolveProxyMode(settings: Pick<Settings, "get"> | undefined): ModelProfileProxyMode;
153
+ /**
154
+ * Rewrite a qualified provider selector so its model is served through the
155
+ * configured proxy. The proxy catalog uses sub-provider-prefixed model ids
156
+ * (e.g. `xiaomi/mimo-v2.5-pro` under `litellm`). Exact provider-prefixed
157
+ * matches win; a unique final-segment match is accepted for gateways that do
158
+ * not retain the upstream provider prefix. Missing or ambiguous matches fail
159
+ * closed rather than leaving an unauthenticated role selector behind.
160
+ */
161
+ export declare function getProxyRoutableProviders(profile: ModelProfileDefinition): ReadonlySet<string>;
162
+ /**
163
+ * Profile sources whose non-default qualified role bindings are part of the
164
+ * activation contract. Proxy rewrites run before role resolution, so a
165
+ * rewritten selector satisfies this prerequisite when its concrete proxy
166
+ * model is present in the effective catalog. Embedded built-ins intentionally
167
+ * retain their legacy tolerance for stale qualified role tails.
168
+ */
169
+ export declare function requiresQualifiedModelProfileRoleResolution(profile: Pick<ModelProfileDefinition, "source">): boolean;
170
+ export declare function rewriteSelectorForProxy(selector: string, proxyProvider: string, proxyMode: ModelProfileProxyMode, allModels: Model<Api>[], directlyAuthenticated: ReadonlySet<string>, routableProviders: ReadonlySet<string>): string;
132
171
  export declare function prepareModelProfileActivation(options: PrepareModelProfileActivationOptions): Promise<PreparedModelProfileActivation>;
133
172
  export declare function applyPreparedModelProfileActivation(prepared: PreparedModelProfileActivation, options?: ApplyModelProfileActivationOptions): Promise<void>;
134
173
  export interface MaterializeModelProfileForDeletionResult {
@@ -5,6 +5,7 @@ export interface ModelProfileDefinition {
5
5
  name: string;
6
6
  requiredProviders: string[];
7
7
  displayName?: string;
8
+ providerGroup?: string;
8
9
  /**
9
10
  * Optional groups of providers that are interchangeable fallbacks.
10
11
  * Each group is an array of provider ids where at least one must be
@@ -16,7 +17,7 @@ export interface ModelProfileDefinition {
16
17
  */
17
18
  alternativeProviderGroups?: readonly (readonly string[])[];
18
19
  modelMapping: Partial<Record<ModelProfileRole, ModelSelectorValue>>;
19
- source: "builtin" | "user";
20
+ source: "builtin" | "registry" | "user";
20
21
  }
21
22
  export interface ResolvedProfileBinding {
22
23
  defaultSelector?: ModelSelectorValue;
@@ -45,10 +46,11 @@ export interface ModelProfilePresentation {
45
46
  displayName: string;
46
47
  providerGroup: string;
47
48
  }
48
- export declare function getModelProfilePresentation(profile: string | Pick<ModelProfileDefinition, "name" | "displayName">): ModelProfilePresentation;
49
+ export declare function getModelProfilePresentation(profile: string | Pick<ModelProfileDefinition, "name" | "displayName" | "providerGroup">): ModelProfilePresentation;
49
50
  export declare function formatModelProfileDisplayLabel(profile: Pick<ModelProfileDefinition, "name" | "displayName">): string;
50
51
  export declare function groupModelProfilesForPresetLanding(profiles: ReadonlyMap<string, ModelProfileDefinition>): Map<string, ModelProfileDefinition[]>;
51
52
  export declare function recommendModelProfileForProvider(providerId: string, profiles: ReadonlyMap<string, ModelProfileDefinition>): ModelProfileDefinition | undefined;
52
- export declare function mergeModelProfiles(userProfiles?: ModelsConfig["profiles"]): Map<string, ModelProfileDefinition>;
53
+ export type RegistryModelProfilesInput = ReadonlyMap<string, ModelProfileDefinition> | readonly ModelProfileDefinition[] | Readonly<Record<string, ModelProfileDefinition>>;
54
+ export declare function mergeModelProfiles(userProfiles?: ModelsConfig["profiles"], registryProfiles?: RegistryModelProfilesInput): Map<string, ModelProfileDefinition>;
53
55
  export declare function resolveProfileBindings(definition: ModelProfileDefinition): ResolvedProfileBinding;
54
56
  export declare function formatAvailableProfileNames(profiles: ReadonlyMap<string, ModelProfileDefinition>): string;
@@ -4,10 +4,11 @@ import { type ThemeColor } from "../modes/theme/theme";
4
4
  import { type ActiveProviderDescriptor } from "../sdk/providers";
5
5
  import type { AuthStorage } from "../session/auth-storage";
6
6
  import type { ActiveSearchModelContext, WebSearchMode } from "../web/search/types";
7
- import { type ConfigError, ConfigFile } from "./config-file";
7
+ import { ConfigError, ConfigFile } from "./config-file";
8
8
  import { isAuthenticated, kNoAuth } from "./model-auth";
9
9
  import { type ConfiguredModelBindings } from "./model-bindings-applier";
10
10
  import { type ProviderDiscoveryState } from "./model-discovery-manager";
11
+ import { type ModelPresetRegistryDependencies } from "./model-preset-registry";
11
12
  export type { ProviderDiscoveryState, ProviderDiscoveryStatus } from "./model-discovery-manager";
12
13
  import { type CanonicalModelIndex, type CanonicalModelRecord, type CanonicalModelVariant, type ModelEquivalenceConfig } from "./model-equivalence";
13
14
  import { type ModelProfileDefinition } from "./model-profiles";
@@ -301,6 +302,7 @@ export declare const ModelsConfigFile: ConfigFile<{
301
302
  }>;
302
303
  /** Provider override config (baseUrl, headers, apiKey, compat, transport) without custom models */
303
304
  interface ProviderOverride {
305
+ api?: Api;
304
306
  baseUrl?: string;
305
307
  headers?: Record<string, string>;
306
308
  apiKey?: string;
@@ -309,6 +311,7 @@ interface ProviderOverride {
309
311
  transport?: Model<Api>["transport"];
310
312
  requestTransform?: ModelRequestTransform;
311
313
  cacheRetention?: CacheRetention;
314
+ isOAuth?: boolean;
312
315
  }
313
316
  /**
314
317
  * Merge a freshly discovered model with the matching bundled/configured entry
@@ -349,12 +352,13 @@ export declare class ModelRegistry {
349
352
  /**
350
353
  * @param authStorage - Auth storage for API key resolution
351
354
  */
352
- constructor(authStorage: AuthStorage, modelsPath?: string, registrySettings?: Pick<Settings, "get" | "getGlobal">);
355
+ constructor(authStorage: AuthStorage, modelsPath?: string, registrySettings?: Pick<Settings, "get" | "getGlobal">, modelPresetRegistryDependencies?: ModelPresetRegistryDependencies);
356
+ dispose(): Promise<void>;
353
357
  onCatalogChanged(listener: () => void): () => void;
354
358
  /** Replace the read-only settings snapshot used by profile-scoped resolution. */
355
359
  setScopedSettings(settingsReader: Pick<Settings, "get" | "getGlobal">): void;
356
360
  /**
357
- * Reload models from disk (built-in + custom from models.json).
361
+ * Reload models from disk (embedded + accepted registry + custom from models.yml).
358
362
  */
359
363
  refresh(strategy?: ModelRefreshStrategy): Promise<void>;
360
364
  refreshInBackground(strategy?: ModelRefreshStrategy): void;
@@ -384,8 +388,8 @@ export declare class ModelRegistry {
384
388
  /** The currently configured modelBindings, for pre-profile baseline lookup. */
385
389
  getConfiguredModelBindings(): ConfiguredModelBindings | undefined;
386
390
  /**
387
- * Get all models (built-in + custom).
388
- * If models.json had errors, returns only built-in models.
391
+ * Get all models (embedded + accepted registry + custom).
392
+ * If models.yml had errors, returns embedded plus accepted registry models.
389
393
  */
390
394
  getAll(): Model<Api>[];
391
395
  /** Provider ids declared in models.yml, including override-only providers. */
@@ -520,6 +524,8 @@ export declare class ModelRegistry {
520
524
  * Get the base URL associated with a provider, if any model defines one.
521
525
  */
522
526
  getProviderBaseUrl(provider: string): string | undefined;
527
+ /** Opaque owner token for registry-scoped AuthStorage reads. */
528
+ getAuthStorageOwner(): object;
523
529
  getProviderWebSearchMode(provider: string): WebSearchMode | undefined;
524
530
  getActiveSearchModelContext(model: Model<Api>): ActiveSearchModelContext;
525
531
  /**
@@ -1888,6 +1888,15 @@ export declare const SETTINGS_SCHEMA: {
1888
1888
  }];
1889
1889
  };
1890
1890
  };
1891
+ readonly "telemetry.enabled": {
1892
+ readonly type: "boolean";
1893
+ readonly default: false;
1894
+ readonly ui: {
1895
+ readonly tab: "interaction";
1896
+ readonly label: "Anonymous Usage Telemetry";
1897
+ readonly description: "Send minimal allowlisted update and adoption events. Disabled by default; no prompts, paths, environment, identity, or arbitrary errors are collected.";
1898
+ };
1899
+ };
1891
1900
  readonly "starReminder.enabled": {
1892
1901
  readonly type: "boolean";
1893
1902
  readonly default: true;
@@ -2,20 +2,22 @@ export interface CoordinatorModelProfile {
2
2
  name: string;
3
3
  }
4
4
  /**
5
- * Loads the merged built-in + custom model-profile names from `models.yml`
5
+ * Loads the merged embedded + accepted registry + custom model-profile names
6
6
  * without loading the session-host model registry. The child still owns
7
7
  * profile activation; this validates the selection before session creation.
8
8
  */
9
9
  export type CoordinatorModelProfileLoader = () => Map<string, CoordinatorModelProfile> | Promise<Map<string, CoordinatorModelProfile>>;
10
10
  /**
11
- * Thrown by the default loader when `models.yml` exists but is invalid or
12
- * unreadable. This lets the resolver fail closed with a distinct, stable reason
13
- * instead of silently collapsing a broken registry to the built-ins-only set
14
- * (which would misreport a caller's valid custom profile as unknown).
11
+ * Thrown by the default loader when `models.yml` or the accepted preset
12
+ * registry is invalid or unreadable. This lets the resolver fail closed with a
13
+ * distinct, stable reason instead of silently collapsing a broken registry to
14
+ * the built-ins-only set (which would misreport a caller's valid custom
15
+ * profile as unknown).
15
16
  */
16
17
  export declare class CoordinatorModelProfileRegistryError extends Error {
17
18
  constructor(cause?: unknown);
18
19
  }
20
+ export declare function createCoordinatorModelProfileLoader(agentDir: string): CoordinatorModelProfileLoader;
19
21
  export declare const loadCoordinatorModelProfiles: CoordinatorModelProfileLoader;
20
22
  export type CoordinatorMpresetResolution = {
21
23
  ok: true;
@@ -0,0 +1,46 @@
1
+ /** Test-only platform seam; production always follows the host platform. */
2
+ export declare const ProjectionScanTestHooks: {
3
+ platform?: NodeJS.Platform;
4
+ };
5
+ /** Post-filter parse-candidate cap. Exhaustion returns an explicit incomplete result. */
6
+ export declare const COORDINATOR_JSON_SCAN_CAP = 10000;
7
+ export interface ProjectionScanStat {
8
+ size: number | bigint;
9
+ dev?: number | bigint;
10
+ ino?: number | bigint;
11
+ nlink?: number | bigint;
12
+ mtimeNs?: number | bigint;
13
+ ctimeNs?: number | bigint;
14
+ isDirectory?(): boolean;
15
+ isFile(): boolean;
16
+ isSymbolicLink(): boolean;
17
+ }
18
+ export interface ProjectionScanFs {
19
+ readdir(dir: string): Promise<string[]>;
20
+ lstat(file: string): Promise<ProjectionScanStat>;
21
+ readFile(file: string, encoding: "utf8", expected?: ProjectionScanStat): Promise<string>;
22
+ /** Optional descriptor-bound reader used by the production filesystem. */
23
+ readFileSafe?: (file: string, encoding: "utf8", expected?: ProjectionScanStat) => Promise<string>;
24
+ /** Optional pinned directory authority used for enumeration and every child operation. */
25
+ openDirectory?: (dir: string) => Promise<ProjectionScanDirectory>;
26
+ }
27
+ export interface ProjectionScanDirectory {
28
+ readonly stat: ProjectionScanStat;
29
+ readdir(): Promise<string[]>;
30
+ lstat(entry: string): Promise<ProjectionScanStat>;
31
+ readFile(entry: string, encoding: "utf8", expected?: ProjectionScanStat): Promise<string>;
32
+ close(): Promise<void>;
33
+ }
34
+ export interface ProjectionScanResult {
35
+ values: unknown[];
36
+ parsed: number;
37
+ capped: boolean;
38
+ skippedDebris: number;
39
+ skippedEmpty: number;
40
+ /** Candidates that changed or disappeared after enumeration. */
41
+ raced: number;
42
+ /** True when the scan cannot be authoritative for its caller. */
43
+ incomplete: boolean;
44
+ }
45
+ export declare function isCoordinatorScanDebrisName(name: string): boolean;
46
+ export declare function listCoordinatorJsonFiles(dir: string, io?: ProjectionScanFs, cap?: number): Promise<ProjectionScanResult>;
@@ -344,7 +344,7 @@ export interface ExtensionContext {
344
344
  cleanedArgs?: string;
345
345
  }) => void;
346
346
  preflightSignal?: AbortSignal;
347
- sdkRunToken?: string;
347
+ sdkRunCapability?: unknown;
348
348
  }): Promise<unknown>;
349
349
  setPlanMode?(on: boolean): unknown;
350
350
  operateGoal?(op: "create" | "get" | "resume" | "pause" | "complete" | "drop", objective?: string): Promise<unknown>;
@@ -844,8 +844,6 @@ export interface ExtensionAPI {
844
844
  startsOwnRun: boolean;
845
845
  }) => void;
846
846
  preflightSignal?: AbortSignal;
847
- /** Internal SDK correlation owner for an exact queued follow-up. */
848
- sdkRunToken?: string;
849
847
  }): Promise<void>;
850
848
  /** Append a custom entry to the session for state persistence (not sent to LLM). */
851
849
  appendEntry<T = unknown>(customType: string, data?: T): void;
@@ -1031,8 +1029,6 @@ export type SendUserMessageHandler = (content: string | (TextContent | ImageCont
1031
1029
  removed?: boolean;
1032
1030
  }) => void;
1033
1031
  preflightSignal?: AbortSignal;
1034
- /** Internal SDK correlation owner for an exact queued follow-up. */
1035
- sdkRunToken?: string;
1036
1032
  }) => void | Promise<void>;
1037
1033
  export type AppendEntryHandler = <T = unknown>(customType: string, data?: T) => void;
1038
1034
  export type GetActiveToolsHandler = () => string[];
@@ -1169,6 +1165,7 @@ export interface ExtensionContextActions {
1169
1165
  cleanedArgs?: string;
1170
1166
  }) => void;
1171
1167
  preflightSignal?: AbortSignal;
1168
+ sdkRunCapability?: unknown;
1172
1169
  }) => Promise<unknown>;
1173
1170
  setPlanMode?: (on: boolean) => unknown;
1174
1171
  operateGoal?: (op: "create" | "get" | "resume" | "pause" | "complete" | "drop", objective?: string) => Promise<unknown>;