@bastani/atomic 0.9.29-alpha.2 → 0.9.30-alpha.1
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/CHANGELOG.md +37 -0
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +6 -0
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/builtin/workflows/CHANGELOG.md +6 -0
- package/dist/builtin/workflows/package.json +1 -1
- package/dist/core/anthropic-thinking-guard.js.map +1 -1
- package/dist/core/extensions/loader-virtual-modules.d.ts.map +1 -1
- package/dist/core/extensions/loader-virtual-modules.js +6 -0
- package/dist/core/extensions/loader-virtual-modules.js.map +1 -1
- package/dist/core/http-dispatcher.d.ts +1 -1
- package/dist/core/http-dispatcher.d.ts.map +1 -1
- package/dist/core/http-dispatcher.js +2 -1
- package/dist/core/http-dispatcher.js.map +1 -1
- package/dist/core/key-id-schema.d.ts +6 -0
- package/dist/core/key-id-schema.d.ts.map +1 -0
- package/dist/core/key-id-schema.js +16 -0
- package/dist/core/key-id-schema.js.map +1 -0
- package/dist/core/keybindings-schema.d.ts +4 -0
- package/dist/core/keybindings-schema.d.ts.map +1 -0
- package/dist/core/keybindings-schema.js +20 -0
- package/dist/core/keybindings-schema.js.map +1 -0
- package/dist/core/keybindings.d.ts +226 -79
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +25 -20
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/model-config.d.ts +685 -164
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +22 -176
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/project-trust.d.ts.map +1 -1
- package/dist/core/project-trust.js +2 -1
- package/dist/core/project-trust.js.map +1 -1
- package/dist/core/settings-defaults.d.ts +80 -0
- package/dist/core/settings-defaults.d.ts.map +1 -0
- package/dist/core/settings-defaults.js +81 -0
- package/dist/core/settings-defaults.js.map +1 -0
- package/dist/core/settings-manager-basic-accessors.d.ts.map +1 -1
- package/dist/core/settings-manager-basic-accessors.js +34 -29
- package/dist/core/settings-manager-basic-accessors.js.map +1 -1
- package/dist/core/settings-manager-resource-accessors.d.ts.map +1 -1
- package/dist/core/settings-manager-resource-accessors.js +10 -9
- package/dist/core/settings-manager-resource-accessors.js.map +1 -1
- package/dist/core/settings-manager-ui-accessors.d.ts.map +1 -1
- package/dist/core/settings-manager-ui-accessors.js +26 -18
- package/dist/core/settings-manager-ui-accessors.js.map +1 -1
- package/dist/core/settings-schema.d.ts +292 -0
- package/dist/core/settings-schema.d.ts.map +1 -0
- package/dist/core/settings-schema.js +403 -0
- package/dist/core/settings-schema.js.map +1 -0
- package/dist/core/settings-types.d.ts +2 -181
- package/dist/core/settings-types.d.ts.map +1 -1
- package/dist/core/settings-types.js.map +1 -1
- package/dist/extensions/codemode/index.d.ts.map +1 -1
- package/dist/extensions/codemode/index.js +2 -1
- package/dist/extensions/codemode/index.js.map +1 -1
- package/dist/extensions/codemode/tool.d.ts +1 -1
- package/dist/extensions/codemode/tool.d.ts.map +1 -1
- package/dist/extensions/codemode/tool.js +2 -1
- package/dist/extensions/codemode/tool.js.map +1 -1
- package/dist/extensions/herdr/index.d.ts.map +1 -1
- package/dist/extensions/herdr/index.js +4 -1
- package/dist/extensions/herdr/index.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector-items.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector-items.js +2 -4
- package/dist/modes/interactive/components/settings-selector-items.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector-submenus.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector-submenus.js +2 -1
- package/dist/modes/interactive/components/settings-selector-submenus.js.map +1 -1
- package/dist/modes/interactive/theme/catppuccin-frappe.json +1 -1
- package/dist/modes/interactive/theme/catppuccin-latte.json +1 -1
- package/dist/modes/interactive/theme/catppuccin-macchiato.json +1 -1
- package/dist/modes/interactive/theme/catppuccin-mocha.json +1 -1
- package/dist/modes/interactive/theme/dark.json +1 -1
- package/dist/modes/interactive/theme/light.json +1 -1
- package/dist/modes/interactive/theme/theme-class.d.ts +3 -12
- package/dist/modes/interactive/theme/theme-class.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-class.js +2 -9
- package/dist/modes/interactive/theme/theme-class.js.map +1 -1
- package/dist/modes/interactive/theme/theme-loading.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-loading.js +3 -21
- package/dist/modes/interactive/theme/theme-loading.js.map +1 -1
- package/dist/modes/interactive/theme/theme-parse.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-parse.js +3 -0
- package/dist/modes/interactive/theme/theme-parse.js.map +1 -1
- package/dist/modes/interactive/theme/theme-schema.d.ts +5 -224
- package/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-schema.js +47 -72
- package/dist/modes/interactive/theme/theme-schema.js.map +1 -1
- package/dist/modes/interactive/theme/theme-tokens.d.ts +262 -0
- package/dist/modes/interactive/theme/theme-tokens.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme-tokens.js +126 -0
- package/dist/modes/interactive/theme/theme-tokens.js.map +1 -0
- package/docs/compaction/reference.md +1 -1
- package/docs/compaction.md +2 -2
- package/docs/keybindings.md +2 -0
- package/docs/models.md +2 -0
- package/docs/providers.md +1 -1
- package/docs/settings.md +2 -0
- package/docs/themes/reference.md +2 -2
- package/docs/themes.md +3 -1
- package/examples/extensions/dynamic-resources/dynamic.json +1 -1
- package/npm-shrinkwrap.json +32 -32
- package/package.json +5 -3
- package/schemas/keybindings.schema.json +413 -0
- package/schemas/models.schema.json +1178 -0
- package/schemas/settings.schema.json +940 -0
- package/schemas/theme.schema.json +369 -0
- package/dist/modes/interactive/theme/theme-schema.json +0 -361
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-config.d.ts","sourceRoot":"","sources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MAAM,GAAG,kBAAkB,GAAG,SAAS,CAE9D;IAED,cAAc,IAAI,SAAS,MAAM,EAAE,CAElC;IAED,QAAQ,IAAI,MAAM,GAAG,SAAS,CAE7B;CACD"}
|
|
@@ -1,58 +1,13 @@
|
|
|
1
1
|
/** Immutable, credential-blind models.json snapshot. */
|
|
2
2
|
import { readFile } from "node:fs/promises";
|
|
3
|
+
import { ProviderCompatSchema } from "@bastani/pi-ai/providers/compat-schema";
|
|
4
|
+
import { ModelCostSchema, ModelInputLimitsSchema, ModelInputModalitySchema, ModelPromptCacheSchema, ThinkingLevelMapSchema, } from "@bastani/pi-ai/providers/model-schema";
|
|
3
5
|
import { Type } from "typebox";
|
|
4
6
|
import { Compile } from "typebox/compile";
|
|
5
7
|
import { stripJsonComments } from "../utils/json.js";
|
|
6
8
|
import { normalizePath } from "../utils/paths.js";
|
|
7
9
|
import { stripBom } from "../utils/text.js";
|
|
8
10
|
import { normalizeProviderKeys } from "./azure-provider-compat.js";
|
|
9
|
-
const PercentileCutoffsSchema = Type.Object({
|
|
10
|
-
p50: Type.Optional(Type.Number()),
|
|
11
|
-
p75: Type.Optional(Type.Number()),
|
|
12
|
-
p90: Type.Optional(Type.Number()),
|
|
13
|
-
p99: Type.Optional(Type.Number()),
|
|
14
|
-
});
|
|
15
|
-
const OpenRouterRoutingSchema = Type.Object({
|
|
16
|
-
allow_fallbacks: Type.Optional(Type.Boolean()),
|
|
17
|
-
require_parameters: Type.Optional(Type.Boolean()),
|
|
18
|
-
data_collection: Type.Optional(Type.Union([Type.Literal("deny"), Type.Literal("allow")])),
|
|
19
|
-
zdr: Type.Optional(Type.Boolean()),
|
|
20
|
-
enforce_distillable_text: Type.Optional(Type.Boolean()),
|
|
21
|
-
order: Type.Optional(Type.Array(Type.String())),
|
|
22
|
-
only: Type.Optional(Type.Array(Type.String())),
|
|
23
|
-
ignore: Type.Optional(Type.Array(Type.String())),
|
|
24
|
-
quantizations: Type.Optional(Type.Array(Type.String())),
|
|
25
|
-
sort: Type.Optional(Type.Union([
|
|
26
|
-
Type.String(),
|
|
27
|
-
Type.Object({
|
|
28
|
-
by: Type.Optional(Type.String()),
|
|
29
|
-
partition: Type.Optional(Type.Union([Type.String(), Type.Null()])),
|
|
30
|
-
}),
|
|
31
|
-
])),
|
|
32
|
-
max_price: Type.Optional(Type.Object({
|
|
33
|
-
prompt: Type.Optional(Type.Union([Type.Number(), Type.String()])),
|
|
34
|
-
completion: Type.Optional(Type.Union([Type.Number(), Type.String()])),
|
|
35
|
-
image: Type.Optional(Type.Union([Type.Number(), Type.String()])),
|
|
36
|
-
audio: Type.Optional(Type.Union([Type.Number(), Type.String()])),
|
|
37
|
-
request: Type.Optional(Type.Union([Type.Number(), Type.String()])),
|
|
38
|
-
})),
|
|
39
|
-
preferred_min_throughput: Type.Optional(Type.Union([Type.Number(), PercentileCutoffsSchema])),
|
|
40
|
-
preferred_max_latency: Type.Optional(Type.Union([Type.Number(), PercentileCutoffsSchema])),
|
|
41
|
-
});
|
|
42
|
-
const VercelGatewayRoutingSchema = Type.Object({
|
|
43
|
-
only: Type.Optional(Type.Array(Type.String())),
|
|
44
|
-
order: Type.Optional(Type.Array(Type.String())),
|
|
45
|
-
});
|
|
46
|
-
const ThinkingLevelMapValueSchema = Type.Union([Type.String(), Type.Null()]);
|
|
47
|
-
const ThinkingLevelMapSchema = Type.Object({
|
|
48
|
-
off: Type.Optional(ThinkingLevelMapValueSchema),
|
|
49
|
-
minimal: Type.Optional(ThinkingLevelMapValueSchema),
|
|
50
|
-
low: Type.Optional(ThinkingLevelMapValueSchema),
|
|
51
|
-
medium: Type.Optional(ThinkingLevelMapValueSchema),
|
|
52
|
-
high: Type.Optional(ThinkingLevelMapValueSchema),
|
|
53
|
-
xhigh: Type.Optional(ThinkingLevelMapValueSchema),
|
|
54
|
-
max: Type.Optional(ThinkingLevelMapValueSchema),
|
|
55
|
-
});
|
|
56
11
|
const SamplingParamsSchema = Type.Record(Type.String(), Type.Unknown());
|
|
57
12
|
const SamplingParamsByThinkingLevelSchema = Type.Object({
|
|
58
13
|
off: Type.Optional(SamplingParamsSchema),
|
|
@@ -63,117 +18,14 @@ const SamplingParamsByThinkingLevelSchema = Type.Object({
|
|
|
63
18
|
xhigh: Type.Optional(SamplingParamsSchema),
|
|
64
19
|
max: Type.Optional(SamplingParamsSchema),
|
|
65
20
|
});
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
const OpenAICompletionsCompatSchema = Type.Object({
|
|
73
|
-
supportsStore: Type.Optional(Type.Boolean()),
|
|
74
|
-
supportsDeveloperRole: Type.Optional(Type.Boolean()),
|
|
75
|
-
supportsReasoningEffort: Type.Optional(Type.Boolean()),
|
|
76
|
-
supportsUsageInStreaming: Type.Optional(Type.Boolean()),
|
|
77
|
-
supportsFinishReason: Type.Optional(Type.Boolean()),
|
|
78
|
-
maxTokensField: Type.Optional(Type.Union([Type.Literal("max_completion_tokens"), Type.Literal("max_tokens")])),
|
|
79
|
-
requiresToolResultName: Type.Optional(Type.Boolean()),
|
|
80
|
-
requiresAssistantAfterToolResult: Type.Optional(Type.Boolean()),
|
|
81
|
-
requiresThinkingAsText: Type.Optional(Type.Boolean()),
|
|
82
|
-
requiresReasoningContentOnAssistantMessages: Type.Optional(Type.Boolean()),
|
|
83
|
-
thinkingFormat: Type.Optional(Type.Union([
|
|
84
|
-
Type.Literal("openai"),
|
|
85
|
-
Type.Literal("openrouter"),
|
|
86
|
-
Type.Literal("together"),
|
|
87
|
-
Type.Literal("baseten"),
|
|
88
|
-
Type.Literal("deepseek"),
|
|
89
|
-
Type.Literal("zai"),
|
|
90
|
-
Type.Literal("qwen"),
|
|
91
|
-
Type.Literal("chat-template"),
|
|
92
|
-
Type.Literal("qwen-chat-template"),
|
|
93
|
-
Type.Literal("string-thinking"),
|
|
94
|
-
Type.Literal("ant-ling"),
|
|
95
|
-
])),
|
|
96
|
-
chatTemplateKwargs: Type.Optional(Type.Record(Type.String(), ChatTemplateKwargSchema)),
|
|
97
|
-
chatTemplateArgs: Type.Optional(Type.Record(Type.String(), ChatTemplateKwargSchema)),
|
|
98
|
-
cacheControlFormat: Type.Optional(Type.Literal("anthropic")),
|
|
99
|
-
openRouterRouting: Type.Optional(OpenRouterRoutingSchema),
|
|
100
|
-
vercelGatewayRouting: Type.Optional(VercelGatewayRoutingSchema),
|
|
101
|
-
supportsOpenAIGrammarTools: Type.Optional(Type.Boolean()),
|
|
102
|
-
supportsStrictMode: Type.Optional(Type.Boolean()),
|
|
103
|
-
supportsMidConvoSystemMessages: Type.Optional(Type.Boolean()),
|
|
104
|
-
supportsMidConvoToolAdditions: Type.Optional(Type.Boolean()),
|
|
105
|
-
sendSessionAffinityHeaders: Type.Optional(Type.Boolean()),
|
|
106
|
-
sessionAffinityFormat: Type.Optional(Type.Union([Type.Literal("openai"), Type.Literal("openai-nosession"), Type.Literal("openrouter")])),
|
|
107
|
-
supportsLongCacheRetention: Type.Optional(Type.Boolean()),
|
|
108
|
-
vllmPriority: Type.Optional(Type.Number()),
|
|
109
|
-
supportsThinkingTokenBudget: Type.Optional(Type.Boolean()),
|
|
110
|
-
});
|
|
111
|
-
const OpenAIResponsesCompatSchema = Type.Object({
|
|
112
|
-
supportsDeveloperRole: Type.Optional(Type.Boolean()),
|
|
113
|
-
supportsMidConvoSystemMessages: Type.Optional(Type.Boolean()),
|
|
114
|
-
sessionAffinityFormat: Type.Optional(Type.Union([Type.Literal("openai"), Type.Literal("openai-nosession"), Type.Literal("openrouter")])),
|
|
115
|
-
supportsLongCacheRetention: Type.Optional(Type.Boolean()),
|
|
116
|
-
supportsStrictMode: Type.Optional(Type.Boolean()),
|
|
117
|
-
supportsOpenAIGrammarTools: Type.Optional(Type.Boolean()),
|
|
118
|
-
supportsAdditionalTools: Type.Optional(Type.Boolean()),
|
|
119
|
-
supportsToolSearch: Type.Optional(Type.Boolean()),
|
|
120
|
-
supportsMaxOutputTokens: Type.Optional(Type.Boolean()),
|
|
121
|
-
});
|
|
122
|
-
const ModelCostRatesSchema = {
|
|
123
|
-
input: Type.Number(),
|
|
124
|
-
output: Type.Number(),
|
|
125
|
-
cacheRead: Type.Number(),
|
|
126
|
-
cacheWrite: Type.Number(),
|
|
127
|
-
};
|
|
128
|
-
const ModelCostTierSchema = Type.Object({
|
|
129
|
-
inputTokensAbove: Type.Number(),
|
|
130
|
-
...ModelCostRatesSchema,
|
|
131
|
-
});
|
|
132
|
-
const ModelCostSchema = Type.Object({
|
|
133
|
-
...ModelCostRatesSchema,
|
|
134
|
-
tiers: Type.Optional(Type.Array(ModelCostTierSchema)),
|
|
135
|
-
});
|
|
136
|
-
const ModelPromptCacheSchema = Type.Object({
|
|
137
|
-
short: Type.Optional(Type.Number({ exclusiveMinimum: 0 })),
|
|
138
|
-
long: Type.Optional(Type.Number({ exclusiveMinimum: 0 })),
|
|
139
|
-
});
|
|
140
|
-
const ImageResizeSchema = Type.Object({
|
|
141
|
-
maxWidth: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
142
|
-
maxHeight: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
143
|
-
maxBytes: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
144
|
-
jpegQuality: Type.Optional(Type.Integer({ minimum: 1, maximum: 100 })),
|
|
145
|
-
});
|
|
146
|
-
const ModelInputLimitsSchema = Type.Object({
|
|
147
|
-
maxRequestBytes: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
148
|
-
images: Type.Optional(Type.Object({
|
|
149
|
-
resize: Type.Optional(ImageResizeSchema),
|
|
150
|
-
maxPerMessage: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
151
|
-
maxPerRequest: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
21
|
+
const PositiveTokenCountSchema = Type.Number({ exclusiveMinimum: 0 });
|
|
22
|
+
/** Everything pi-ai defines for compatibility, plus Atomic's alias for the grammar-tool capability. */
|
|
23
|
+
export const ModelsJsonCompatSchema = Type.Object({
|
|
24
|
+
...ProviderCompatSchema.properties,
|
|
25
|
+
supportsGrammarTools: Type.Optional(Type.Boolean({
|
|
26
|
+
description: "Atomic alias for supportsOpenAIGrammarTools. The canonical field wins if both are set.",
|
|
152
27
|
})),
|
|
153
|
-
});
|
|
154
|
-
const AnthropicMessagesCompatSchema = Type.Object({
|
|
155
|
-
supportsEagerToolInputStreaming: Type.Optional(Type.Boolean()),
|
|
156
|
-
supportsLongCacheRetention: Type.Optional(Type.Boolean()),
|
|
157
|
-
sendSessionAffinityHeaders: Type.Optional(Type.Boolean()),
|
|
158
|
-
supportsCacheControlOnTools: Type.Optional(Type.Boolean()),
|
|
159
|
-
supportsTemperature: Type.Optional(Type.Boolean()),
|
|
160
|
-
forceAdaptiveThinking: Type.Optional(Type.Boolean()),
|
|
161
|
-
allowEmptySignature: Type.Optional(Type.Boolean()),
|
|
162
|
-
supportsStrictTools: Type.Optional(Type.Boolean()),
|
|
163
|
-
supportsMidConvoEffort: Type.Optional(Type.Boolean()),
|
|
164
|
-
supportsMidConvoSystemMessages: Type.Optional(Type.Boolean()),
|
|
165
|
-
supportsMidConvoToolChanges: Type.Optional(Type.Boolean()),
|
|
166
|
-
enforcesPreservedThinkingBinding: Type.Optional(Type.Boolean()),
|
|
167
|
-
allowedFallbackModels: Type.Optional(Type.Array(Type.Object({
|
|
168
|
-
provider: Type.String({ minLength: 1 }),
|
|
169
|
-
model: Type.String({ minLength: 1 }),
|
|
170
|
-
cost: ModelCostSchema,
|
|
171
|
-
}), { maxItems: 3 })),
|
|
172
|
-
});
|
|
173
|
-
const ProviderCompatSchema = Type.Union([OpenAICompletionsCompatSchema, OpenAIResponsesCompatSchema, AnthropicMessagesCompatSchema], {
|
|
174
|
-
// OpenAI branches permit unknown fields; enforce fallback metadata across every branch.
|
|
175
|
-
allOf: [Type.Object({ allowedFallbackModels: AnthropicMessagesCompatSchema.properties.allowedFallbackModels })],
|
|
176
|
-
});
|
|
28
|
+
}, { description: "Provider and model compatibility overrides.", additionalProperties: true });
|
|
177
29
|
const ModelDefinitionSchema = Type.Object({
|
|
178
30
|
id: Type.String({ minLength: 1 }),
|
|
179
31
|
name: Type.Optional(Type.String({ minLength: 1 })),
|
|
@@ -181,37 +33,31 @@ const ModelDefinitionSchema = Type.Object({
|
|
|
181
33
|
baseUrl: Type.Optional(Type.String({ minLength: 1 })),
|
|
182
34
|
reasoning: Type.Optional(Type.Boolean()),
|
|
183
35
|
thinkingLevelMap: Type.Optional(ThinkingLevelMapSchema),
|
|
184
|
-
input: Type.Optional(Type.Array(
|
|
36
|
+
input: Type.Optional(Type.Array(ModelInputModalitySchema)),
|
|
185
37
|
inputLimits: Type.Optional(ModelInputLimitsSchema),
|
|
186
38
|
cost: Type.Optional(ModelCostSchema),
|
|
187
39
|
promptCache: Type.Optional(ModelPromptCacheSchema),
|
|
188
|
-
contextWindow: Type.Optional(
|
|
189
|
-
maxTokens: Type.Optional(
|
|
40
|
+
contextWindow: Type.Optional(PositiveTokenCountSchema),
|
|
41
|
+
maxTokens: Type.Optional(PositiveTokenCountSchema),
|
|
190
42
|
samplingParams: Type.Optional(SamplingParamsSchema),
|
|
191
43
|
samplingParamsByThinkingLevel: Type.Optional(SamplingParamsByThinkingLevelSchema),
|
|
192
44
|
headers: Type.Optional(Type.Record(Type.String(), Type.String())),
|
|
193
|
-
compat: Type.Optional(
|
|
45
|
+
compat: Type.Optional(ModelsJsonCompatSchema),
|
|
194
46
|
});
|
|
195
47
|
const ModelOverrideSchema = Type.Object({
|
|
196
48
|
name: Type.Optional(Type.String({ minLength: 1 })),
|
|
197
49
|
reasoning: Type.Optional(Type.Boolean()),
|
|
198
50
|
thinkingLevelMap: Type.Optional(ThinkingLevelMapSchema),
|
|
199
|
-
input: Type.Optional(Type.Array(
|
|
51
|
+
input: Type.Optional(Type.Array(ModelInputModalitySchema)),
|
|
200
52
|
inputLimits: Type.Optional(ModelInputLimitsSchema),
|
|
201
|
-
cost: Type.Optional(Type.
|
|
202
|
-
input: Type.Optional(Type.Number()),
|
|
203
|
-
output: Type.Optional(Type.Number()),
|
|
204
|
-
cacheRead: Type.Optional(Type.Number()),
|
|
205
|
-
cacheWrite: Type.Optional(Type.Number()),
|
|
206
|
-
tiers: Type.Optional(Type.Array(ModelCostTierSchema)),
|
|
207
|
-
})),
|
|
53
|
+
cost: Type.Optional(Type.Partial(ModelCostSchema)),
|
|
208
54
|
promptCache: Type.Optional(ModelPromptCacheSchema),
|
|
209
|
-
contextWindow: Type.Optional(
|
|
210
|
-
maxTokens: Type.Optional(
|
|
55
|
+
contextWindow: Type.Optional(PositiveTokenCountSchema),
|
|
56
|
+
maxTokens: Type.Optional(PositiveTokenCountSchema),
|
|
211
57
|
samplingParams: Type.Optional(SamplingParamsSchema),
|
|
212
58
|
samplingParamsByThinkingLevel: Type.Optional(SamplingParamsByThinkingLevelSchema),
|
|
213
59
|
headers: Type.Optional(Type.Record(Type.String(), Type.String())),
|
|
214
|
-
compat: Type.Optional(
|
|
60
|
+
compat: Type.Optional(ModelsJsonCompatSchema),
|
|
215
61
|
});
|
|
216
62
|
const ProviderConfigSchema = Type.Object({
|
|
217
63
|
name: Type.Optional(Type.String({ minLength: 1 })),
|
|
@@ -220,12 +66,13 @@ const ProviderConfigSchema = Type.Object({
|
|
|
220
66
|
api: Type.Optional(Type.String({ minLength: 1 })),
|
|
221
67
|
oauth: Type.Optional(Type.Literal("radius")),
|
|
222
68
|
headers: Type.Optional(Type.Record(Type.String(), Type.String())),
|
|
223
|
-
compat: Type.Optional(
|
|
69
|
+
compat: Type.Optional(ModelsJsonCompatSchema),
|
|
224
70
|
authHeader: Type.Optional(Type.Boolean()),
|
|
225
71
|
models: Type.Optional(Type.Array(ModelDefinitionSchema)),
|
|
226
72
|
modelOverrides: Type.Optional(Type.Record(Type.String(), ModelOverrideSchema)),
|
|
227
73
|
});
|
|
228
|
-
const ModelsConfigSchema = Type.Object({
|
|
74
|
+
export const ModelsConfigSchema = Type.Object({
|
|
75
|
+
$schema: Type.Optional(Type.String()),
|
|
229
76
|
providers: Type.Record(Type.String(), ProviderConfigSchema),
|
|
230
77
|
});
|
|
231
78
|
const validateModelsConfig = Compile(ModelsConfigSchema);
|
|
@@ -283,9 +130,8 @@ export class ModelConfig {
|
|
|
283
130
|
.join("\n") || "Unknown schema error";
|
|
284
131
|
return new ModelConfig(new Map(), `Invalid models.json schema:\n${errors}\n\nFile: ${path}`);
|
|
285
132
|
}
|
|
286
|
-
const config = parsed;
|
|
287
133
|
const providers = new Map();
|
|
288
|
-
for (const [providerId, provider] of Object.entries(normalizeProviderKeys(
|
|
134
|
+
for (const [providerId, provider] of Object.entries(normalizeProviderKeys(parsed.providers))) {
|
|
289
135
|
providers.set(providerId, deepFreeze(structuredClone(provider)));
|
|
290
136
|
}
|
|
291
137
|
return new ModelConfig(providers);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-config.js","sourceRoot":"","sources":["../../src/core/model-config.ts"],"names":[],"mappings":"AAAA,wDAAwD;AAExD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAe,IAAI,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,MAAM,uBAAuB,GAAG,IAAI,CAAC,MAAM,CAAC;IAC3C,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IACjC,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IACjC,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM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CAAC;iBACtE,IAAI,CAAC,IAAI,CAAC,IAAI,sBAAsB,CAAC;YACxC,OAAO,IAAI,WAAW,CAAC,IAAI,GAAG,EAAE,EAAE,gCAAgC,MAAM,aAAa,IAAI,EAAE,CAAC,CAAC;QAC9F,CAAC;QAED,MAAM,MAAM,GAAG,MAAoB,CAAC;QACpC,MAAM,SAAS,GAAG,IAAI,GAAG,EAA8B,CAAC;QACxD,KAAK,MAAM,CAAC,UAAU,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,qBAAqB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC;YAC9F,SAAS,CAAC,GAAG,CAAC,UAAU,EAAE,UAAU,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAClE,CAAC;QACD,OAAO,IAAI,WAAW,CAAC,SAAS,CAAC,CAAC;IACnC,CAAC;IAED,WAAW,CAAC,UAAkB;QAC7B,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACvC,CAAC;IAED,cAAc;QACb,OAAO,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC;IACnC,CAAC;IAED,QAAQ;QACP,OAAO,IAAI,CAAC,KAAK,CAAC;IACnB,CAAC;CACD","sourcesContent":["/** Immutable, credential-blind models.json snapshot. */\n\nimport { readFile } from \"node:fs/promises\";\nimport { type Static, Type } from \"typebox\";\nimport { Compile } from \"typebox/compile\";\nimport type { TLocalizedValidationError } from \"typebox/error\";\nimport { stripJsonComments } from \"../utils/json.ts\";\nimport { normalizePath } from \"../utils/paths.ts\";\nimport { stripBom } from \"../utils/text.ts\";\nimport { normalizeProviderKeys } from \"./azure-provider-compat.js\";\n\nconst PercentileCutoffsSchema = Type.Object({\n\tp50: Type.Optional(Type.Number()),\n\tp75: Type.Optional(Type.Number()),\n\tp90: Type.Optional(Type.Number()),\n\tp99: Type.Optional(Type.Number()),\n});\n\nconst OpenRouterRoutingSchema = Type.Object({\n\tallow_fallbacks: Type.Optional(Type.Boolean()),\n\trequire_parameters: Type.Optional(Type.Boolean()),\n\tdata_collection: Type.Optional(Type.Union([Type.Literal(\"deny\"), Type.Literal(\"allow\")])),\n\tzdr: Type.Optional(Type.Boolean()),\n\tenforce_distillable_text: Type.Optional(Type.Boolean()),\n\torder: Type.Optional(Type.Array(Type.String())),\n\tonly: Type.Optional(Type.Array(Type.String())),\n\tignore: Type.Optional(Type.Array(Type.String())),\n\tquantizations: Type.Optional(Type.Array(Type.String())),\n\tsort: Type.Optional(\n\t\tType.Union([\n\t\t\tType.String(),\n\t\t\tType.Object({\n\t\t\t\tby: Type.Optional(Type.String()),\n\t\t\t\tpartition: Type.Optional(Type.Union([Type.String(), Type.Null()])),\n\t\t\t}),\n\t\t]),\n\t),\n\tmax_price: Type.Optional(\n\t\tType.Object({\n\t\t\tprompt: Type.Optional(Type.Union([Type.Number(), Type.String()])),\n\t\t\tcompletion: Type.Optional(Type.Union([Type.Number(), Type.String()])),\n\t\t\timage: Type.Optional(Type.Union([Type.Number(), Type.String()])),\n\t\t\taudio: Type.Optional(Type.Union([Type.Number(), Type.String()])),\n\t\t\trequest: Type.Optional(Type.Union([Type.Number(), Type.String()])),\n\t\t}),\n\t),\n\tpreferred_min_throughput: Type.Optional(Type.Union([Type.Number(), PercentileCutoffsSchema])),\n\tpreferred_max_latency: Type.Optional(Type.Union([Type.Number(), PercentileCutoffsSchema])),\n});\n\nconst VercelGatewayRoutingSchema = Type.Object({\n\tonly: Type.Optional(Type.Array(Type.String())),\n\torder: Type.Optional(Type.Array(Type.String())),\n});\n\nconst ThinkingLevelMapValueSchema = Type.Union([Type.String(), Type.Null()]);\nconst ThinkingLevelMapSchema = Type.Object({\n\toff: Type.Optional(ThinkingLevelMapValueSchema),\n\tminimal: Type.Optional(ThinkingLevelMapValueSchema),\n\tlow: Type.Optional(ThinkingLevelMapValueSchema),\n\tmedium: Type.Optional(ThinkingLevelMapValueSchema),\n\thigh: Type.Optional(ThinkingLevelMapValueSchema),\n\txhigh: Type.Optional(ThinkingLevelMapValueSchema),\n\tmax: Type.Optional(ThinkingLevelMapValueSchema),\n});\n\nconst SamplingParamsSchema = Type.Record(Type.String(), Type.Unknown());\nconst SamplingParamsByThinkingLevelSchema = Type.Object({\n\toff: Type.Optional(SamplingParamsSchema),\n\tminimal: Type.Optional(SamplingParamsSchema),\n\tlow: Type.Optional(SamplingParamsSchema),\n\tmedium: Type.Optional(SamplingParamsSchema),\n\thigh: Type.Optional(SamplingParamsSchema),\n\txhigh: Type.Optional(SamplingParamsSchema),\n\tmax: Type.Optional(SamplingParamsSchema),\n});\n\nconst ChatTemplateKwargScalarSchema = Type.Union([Type.String(), Type.Number(), Type.Boolean(), Type.Null()]);\nconst ChatTemplateKwargVariableSchema = Type.Object({\n\t$var: Type.Union([Type.Literal(\"thinking.enabled\"), Type.Literal(\"thinking.effort\")]),\n\tomitWhenOff: Type.Optional(Type.Boolean()),\n});\nconst ChatTemplateKwargSchema = Type.Union([ChatTemplateKwargScalarSchema, ChatTemplateKwargVariableSchema]);\n\nconst OpenAICompletionsCompatSchema = Type.Object({\n\tsupportsStore: Type.Optional(Type.Boolean()),\n\tsupportsDeveloperRole: Type.Optional(Type.Boolean()),\n\tsupportsReasoningEffort: Type.Optional(Type.Boolean()),\n\tsupportsUsageInStreaming: Type.Optional(Type.Boolean()),\n\tsupportsFinishReason: Type.Optional(Type.Boolean()),\n\tmaxTokensField: Type.Optional(Type.Union([Type.Literal(\"max_completion_tokens\"), Type.Literal(\"max_tokens\")])),\n\trequiresToolResultName: Type.Optional(Type.Boolean()),\n\trequiresAssistantAfterToolResult: Type.Optional(Type.Boolean()),\n\trequiresThinkingAsText: Type.Optional(Type.Boolean()),\n\trequiresReasoningContentOnAssistantMessages: Type.Optional(Type.Boolean()),\n\tthinkingFormat: Type.Optional(\n\t\tType.Union([\n\t\t\tType.Literal(\"openai\"),\n\t\t\tType.Literal(\"openrouter\"),\n\t\t\tType.Literal(\"together\"),\n\t\t\tType.Literal(\"baseten\"),\n\t\t\tType.Literal(\"deepseek\"),\n\t\t\tType.Literal(\"zai\"),\n\t\t\tType.Literal(\"qwen\"),\n\t\t\tType.Literal(\"chat-template\"),\n\t\t\tType.Literal(\"qwen-chat-template\"),\n\t\t\tType.Literal(\"string-thinking\"),\n\t\t\tType.Literal(\"ant-ling\"),\n\t\t]),\n\t),\n\tchatTemplateKwargs: Type.Optional(Type.Record(Type.String(), ChatTemplateKwargSchema)),\n\tchatTemplateArgs: Type.Optional(Type.Record(Type.String(), ChatTemplateKwargSchema)),\n\tcacheControlFormat: Type.Optional(Type.Literal(\"anthropic\")),\n\topenRouterRouting: Type.Optional(OpenRouterRoutingSchema),\n\tvercelGatewayRouting: Type.Optional(VercelGatewayRoutingSchema),\n\tsupportsOpenAIGrammarTools: Type.Optional(Type.Boolean()),\n\tsupportsStrictMode: Type.Optional(Type.Boolean()),\n\tsupportsMidConvoSystemMessages: Type.Optional(Type.Boolean()),\n\tsupportsMidConvoToolAdditions: Type.Optional(Type.Boolean()),\n\tsendSessionAffinityHeaders: Type.Optional(Type.Boolean()),\n\tsessionAffinityFormat: Type.Optional(\n\t\tType.Union([Type.Literal(\"openai\"), Type.Literal(\"openai-nosession\"), Type.Literal(\"openrouter\")]),\n\t),\n\tsupportsLongCacheRetention: Type.Optional(Type.Boolean()),\n\tvllmPriority: Type.Optional(Type.Number()),\n\tsupportsThinkingTokenBudget: Type.Optional(Type.Boolean()),\n});\n\nconst OpenAIResponsesCompatSchema = Type.Object({\n\tsupportsDeveloperRole: Type.Optional(Type.Boolean()),\n\tsupportsMidConvoSystemMessages: Type.Optional(Type.Boolean()),\n\tsessionAffinityFormat: Type.Optional(\n\t\tType.Union([Type.Literal(\"openai\"), Type.Literal(\"openai-nosession\"), Type.Literal(\"openrouter\")]),\n\t),\n\tsupportsLongCacheRetention: Type.Optional(Type.Boolean()),\n\tsupportsStrictMode: Type.Optional(Type.Boolean()),\n\tsupportsOpenAIGrammarTools: Type.Optional(Type.Boolean()),\n\tsupportsAdditionalTools: Type.Optional(Type.Boolean()),\n\tsupportsToolSearch: Type.Optional(Type.Boolean()),\n\tsupportsMaxOutputTokens: Type.Optional(Type.Boolean()),\n});\n\nconst ModelCostRatesSchema = {\n\tinput: Type.Number(),\n\toutput: Type.Number(),\n\tcacheRead: Type.Number(),\n\tcacheWrite: Type.Number(),\n};\nconst ModelCostTierSchema = Type.Object({\n\tinputTokensAbove: Type.Number(),\n\t...ModelCostRatesSchema,\n});\nconst ModelCostSchema = Type.Object({\n\t...ModelCostRatesSchema,\n\ttiers: Type.Optional(Type.Array(ModelCostTierSchema)),\n});\nconst ModelPromptCacheSchema = Type.Object({\n\tshort: Type.Optional(Type.Number({ exclusiveMinimum: 0 })),\n\tlong: Type.Optional(Type.Number({ exclusiveMinimum: 0 })),\n});\nconst ImageResizeSchema = Type.Object({\n\tmaxWidth: Type.Optional(Type.Integer({ minimum: 1 })),\n\tmaxHeight: Type.Optional(Type.Integer({ minimum: 1 })),\n\tmaxBytes: Type.Optional(Type.Integer({ minimum: 1 })),\n\tjpegQuality: Type.Optional(Type.Integer({ minimum: 1, maximum: 100 })),\n});\nconst ModelInputLimitsSchema = Type.Object({\n\tmaxRequestBytes: Type.Optional(Type.Integer({ minimum: 1 })),\n\timages: Type.Optional(\n\t\tType.Object({\n\t\t\tresize: Type.Optional(ImageResizeSchema),\n\t\t\tmaxPerMessage: Type.Optional(Type.Integer({ minimum: 1 })),\n\t\t\tmaxPerRequest: Type.Optional(Type.Integer({ minimum: 1 })),\n\t\t}),\n\t),\n});\n\nconst AnthropicMessagesCompatSchema = Type.Object({\n\tsupportsEagerToolInputStreaming: Type.Optional(Type.Boolean()),\n\tsupportsLongCacheRetention: Type.Optional(Type.Boolean()),\n\tsendSessionAffinityHeaders: Type.Optional(Type.Boolean()),\n\tsupportsCacheControlOnTools: Type.Optional(Type.Boolean()),\n\tsupportsTemperature: Type.Optional(Type.Boolean()),\n\tforceAdaptiveThinking: Type.Optional(Type.Boolean()),\n\tallowEmptySignature: Type.Optional(Type.Boolean()),\n\tsupportsStrictTools: Type.Optional(Type.Boolean()),\n\tsupportsMidConvoEffort: Type.Optional(Type.Boolean()),\n\tsupportsMidConvoSystemMessages: Type.Optional(Type.Boolean()),\n\tsupportsMidConvoToolChanges: Type.Optional(Type.Boolean()),\n\tenforcesPreservedThinkingBinding: Type.Optional(Type.Boolean()),\n\tallowedFallbackModels: Type.Optional(\n\t\tType.Array(\n\t\t\tType.Object({\n\t\t\t\tprovider: Type.String({ minLength: 1 }),\n\t\t\t\tmodel: Type.String({ minLength: 1 }),\n\t\t\t\tcost: ModelCostSchema,\n\t\t\t}),\n\t\t\t{ maxItems: 3 },\n\t\t),\n\t),\n});\n\nconst ProviderCompatSchema = Type.Union(\n\t[OpenAICompletionsCompatSchema, OpenAIResponsesCompatSchema, AnthropicMessagesCompatSchema],\n\t{\n\t\t// OpenAI branches permit unknown fields; enforce fallback metadata across every branch.\n\t\tallOf: [Type.Object({ allowedFallbackModels: AnthropicMessagesCompatSchema.properties.allowedFallbackModels })],\n\t},\n);\n\nconst ModelDefinitionSchema = Type.Object({\n\tid: Type.String({ minLength: 1 }),\n\tname: Type.Optional(Type.String({ minLength: 1 })),\n\tapi: Type.Optional(Type.String({ minLength: 1 })),\n\tbaseUrl: Type.Optional(Type.String({ minLength: 1 })),\n\treasoning: Type.Optional(Type.Boolean()),\n\tthinkingLevelMap: Type.Optional(ThinkingLevelMapSchema),\n\tinput: Type.Optional(Type.Array(Type.Union([Type.Literal(\"text\"), Type.Literal(\"image\"), Type.Literal(\"pdf\")]))),\n\tinputLimits: Type.Optional(ModelInputLimitsSchema),\n\tcost: Type.Optional(ModelCostSchema),\n\tpromptCache: Type.Optional(ModelPromptCacheSchema),\n\tcontextWindow: Type.Optional(Type.Number()),\n\tmaxTokens: Type.Optional(Type.Number()),\n\tsamplingParams: Type.Optional(SamplingParamsSchema),\n\tsamplingParamsByThinkingLevel: Type.Optional(SamplingParamsByThinkingLevelSchema),\n\theaders: Type.Optional(Type.Record(Type.String(), Type.String())),\n\tcompat: Type.Optional(ProviderCompatSchema),\n});\n\nconst ModelOverrideSchema = Type.Object({\n\tname: Type.Optional(Type.String({ minLength: 1 })),\n\treasoning: Type.Optional(Type.Boolean()),\n\tthinkingLevelMap: Type.Optional(ThinkingLevelMapSchema),\n\tinput: Type.Optional(Type.Array(Type.Union([Type.Literal(\"text\"), Type.Literal(\"image\"), Type.Literal(\"pdf\")]))),\n\tinputLimits: Type.Optional(ModelInputLimitsSchema),\n\tcost: Type.Optional(\n\t\tType.Object({\n\t\t\tinput: Type.Optional(Type.Number()),\n\t\t\toutput: Type.Optional(Type.Number()),\n\t\t\tcacheRead: Type.Optional(Type.Number()),\n\t\t\tcacheWrite: Type.Optional(Type.Number()),\n\t\t\ttiers: Type.Optional(Type.Array(ModelCostTierSchema)),\n\t\t}),\n\t),\n\tpromptCache: Type.Optional(ModelPromptCacheSchema),\n\tcontextWindow: Type.Optional(Type.Number()),\n\tmaxTokens: Type.Optional(Type.Number()),\n\tsamplingParams: Type.Optional(SamplingParamsSchema),\n\tsamplingParamsByThinkingLevel: Type.Optional(SamplingParamsByThinkingLevelSchema),\n\theaders: Type.Optional(Type.Record(Type.String(), Type.String())),\n\tcompat: Type.Optional(ProviderCompatSchema),\n});\n\nconst ProviderConfigSchema = Type.Object({\n\tname: Type.Optional(Type.String({ minLength: 1 })),\n\tbaseUrl: Type.Optional(Type.String({ minLength: 1 })),\n\tapiKey: Type.Optional(Type.String({ minLength: 1 })),\n\tapi: Type.Optional(Type.String({ minLength: 1 })),\n\toauth: Type.Optional(Type.Literal(\"radius\")),\n\theaders: Type.Optional(Type.Record(Type.String(), Type.String())),\n\tcompat: Type.Optional(ProviderCompatSchema),\n\tauthHeader: Type.Optional(Type.Boolean()),\n\tmodels: Type.Optional(Type.Array(ModelDefinitionSchema)),\n\tmodelOverrides: Type.Optional(Type.Record(Type.String(), ModelOverrideSchema)),\n});\n\nconst ModelsConfigSchema = Type.Object({\n\tproviders: Type.Record(Type.String(), ProviderConfigSchema),\n});\nconst validateModelsConfig = Compile(ModelsConfigSchema);\n\nexport type ModelsJsonModel = Static<typeof ModelDefinitionSchema>;\nexport type ModelsJsonModelOverride = Static<typeof ModelOverrideSchema>;\nexport type ModelsJsonProvider = Static<typeof ProviderConfigSchema>;\ntype ModelsJson = Static<typeof ModelsConfigSchema>;\n\nfunction formatValidationPath(error: TLocalizedValidationError): string {\n\tif (error.keyword === \"required\") {\n\t\tconst requiredProperties = (error.params as { requiredProperties?: string[] }).requiredProperties;\n\t\tconst requiredProperty = requiredProperties?.[0];\n\t\tif (requiredProperty) {\n\t\t\tconst basePath = error.instancePath.replace(/^\\//, \"\").replace(/\\//g, \".\");\n\t\t\treturn basePath ? `${basePath}.${requiredProperty}` : requiredProperty;\n\t\t}\n\t}\n\tconst path = error.instancePath.replace(/^\\//, \"\").replace(/\\//g, \".\");\n\treturn path || \"root\";\n}\n\nfunction deepFreeze<T>(value: T): T {\n\tif (typeof value !== \"object\" || value === null || Object.isFrozen(value)) return value;\n\tfor (const child of Object.values(value)) deepFreeze(child);\n\treturn Object.freeze(value);\n}\n\n/** One immutable load of models.json. */\nexport class ModelConfig {\n\tprivate readonly providers: ReadonlyMap<string, ModelsJsonProvider>;\n\tprivate readonly error: string | undefined;\n\n\tprivate constructor(providers: ReadonlyMap<string, ModelsJsonProvider>, error?: string) {\n\t\tthis.providers = providers;\n\t\tthis.error = error;\n\t}\n\n\tstatic async load(modelsJsonPath: string | undefined): Promise<ModelConfig> {\n\t\tif (!modelsJsonPath) return new ModelConfig(new Map());\n\t\tconst path = normalizePath(modelsJsonPath);\n\t\tlet content: string;\n\t\ttry {\n\t\t\tcontent = await readFile(path, \"utf-8\");\n\t\t} catch (error) {\n\t\t\tif ((error as NodeJS.ErrnoException).code === \"ENOENT\") return new ModelConfig(new Map());\n\t\t\treturn new ModelConfig(\n\t\t\t\tnew Map(),\n\t\t\t\t`Failed to load models.json: ${error instanceof Error ? error.message : error}\\n\\nFile: ${path}`,\n\t\t\t);\n\t\t}\n\n\t\tlet parsed: unknown;\n\t\ttry {\n\t\t\tparsed = JSON.parse(stripJsonComments(stripBom(content)));\n\t\t} catch (error) {\n\t\t\treturn new ModelConfig(\n\t\t\t\tnew Map(),\n\t\t\t\t`Failed to parse models.json: ${error instanceof Error ? error.message : error}\\n\\nFile: ${path}`,\n\t\t\t);\n\t\t}\n\n\t\tif (!validateModelsConfig.Check(parsed)) {\n\t\t\tconst errors =\n\t\t\t\tvalidateModelsConfig\n\t\t\t\t\t.Errors(parsed)\n\t\t\t\t\t.map((error) => ` - ${formatValidationPath(error)}: ${error.message}`)\n\t\t\t\t\t.join(\"\\n\") || \"Unknown schema error\";\n\t\t\treturn new ModelConfig(new Map(), `Invalid models.json schema:\\n${errors}\\n\\nFile: ${path}`);\n\t\t}\n\n\t\tconst config = parsed as ModelsJson;\n\t\tconst providers = new Map<string, ModelsJsonProvider>();\n\t\tfor (const [providerId, provider] of Object.entries(normalizeProviderKeys(config.providers))) {\n\t\t\tproviders.set(providerId, deepFreeze(structuredClone(provider)));\n\t\t}\n\t\treturn new ModelConfig(providers);\n\t}\n\n\tgetProvider(providerId: string): ModelsJsonProvider | undefined {\n\t\treturn this.providers.get(providerId);\n\t}\n\n\tgetProviderIds(): readonly string[] {\n\t\treturn [...this.providers.keys()];\n\t}\n\n\tgetError(): string | undefined {\n\t\treturn this.error;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"model-config.js","sourceRoot":"","sources":["../../src/core/model-config.ts"],"names":[],"mappings":"AAAA,wDAAwD;AAExD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,EACN,eAAe,EACf,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,GACtB,MAAM,uCAAuC,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AE,CAAC,OAAO,oBAAoB,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC;iBACtE,IAAI,CAAC,IAAI,CAAC,IAAI,sBAAsB,CAAC;YACxC,OAAO,IAAI,WAAW,CAAC,IAAI,GAAG,EAAE,EAAE,gCAAgC,MAAM,aAAa,IAAI,EAAE,CAAC,CAAC;QAC9F,CAAC;QAED,MAAM,SAAS,GAAG,IAAI,GAAG,EAA8B,CAAC;QACxD,KAAK,MAAM,CAAC,UAAU,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,qBAAqB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC;YAC9F,SAAS,CAAC,GAAG,CAAC,UAAU,EAAE,UAAU,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAClE,CAAC;QACD,OAAO,IAAI,WAAW,CAAC,SAAS,CAAC,CAAC;IACnC,CAAC;IAED,WAAW,CAAC,UAAkB;QAC7B,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACvC,CAAC;IAED,cAAc;QACb,OAAO,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC;IACnC,CAAC;IAED,QAAQ;QACP,OAAO,IAAI,CAAC,KAAK,CAAC;IACnB,CAAC;CACD","sourcesContent":["/** Immutable, credential-blind models.json snapshot. */\n\nimport { readFile } from \"node:fs/promises\";\nimport { ProviderCompatSchema } from \"@bastani/pi-ai/providers/compat-schema\";\nimport {\n\tModelCostSchema,\n\tModelInputLimitsSchema,\n\tModelInputModalitySchema,\n\tModelPromptCacheSchema,\n\tThinkingLevelMapSchema,\n} from \"@bastani/pi-ai/providers/model-schema\";\nimport { type Static, Type } from \"typebox\";\nimport { Compile } from \"typebox/compile\";\nimport type { TLocalizedValidationError } from \"typebox/error\";\nimport { stripJsonComments } from \"../utils/json.ts\";\nimport { normalizePath } from \"../utils/paths.ts\";\nimport { stripBom } from \"../utils/text.ts\";\nimport { normalizeProviderKeys } from \"./azure-provider-compat.js\";\n\nconst SamplingParamsSchema = Type.Record(Type.String(), Type.Unknown());\nconst SamplingParamsByThinkingLevelSchema = Type.Object({\n\toff: Type.Optional(SamplingParamsSchema),\n\tminimal: Type.Optional(SamplingParamsSchema),\n\tlow: Type.Optional(SamplingParamsSchema),\n\tmedium: Type.Optional(SamplingParamsSchema),\n\thigh: Type.Optional(SamplingParamsSchema),\n\txhigh: Type.Optional(SamplingParamsSchema),\n\tmax: Type.Optional(SamplingParamsSchema),\n});\n\nconst PositiveTokenCountSchema = Type.Number({ exclusiveMinimum: 0 });\n\n/** Everything pi-ai defines for compatibility, plus Atomic's alias for the grammar-tool capability. */\nexport const ModelsJsonCompatSchema = Type.Object(\n\t{\n\t\t...ProviderCompatSchema.properties,\n\t\tsupportsGrammarTools: Type.Optional(\n\t\t\tType.Boolean({\n\t\t\t\tdescription: \"Atomic alias for supportsOpenAIGrammarTools. The canonical field wins if both are set.\",\n\t\t\t}),\n\t\t),\n\t},\n\t{ description: \"Provider and model compatibility overrides.\", additionalProperties: true },\n);\n\nconst ModelDefinitionSchema = Type.Object({\n\tid: Type.String({ minLength: 1 }),\n\tname: Type.Optional(Type.String({ minLength: 1 })),\n\tapi: Type.Optional(Type.String({ minLength: 1 })),\n\tbaseUrl: Type.Optional(Type.String({ minLength: 1 })),\n\treasoning: Type.Optional(Type.Boolean()),\n\tthinkingLevelMap: Type.Optional(ThinkingLevelMapSchema),\n\tinput: Type.Optional(Type.Array(ModelInputModalitySchema)),\n\tinputLimits: Type.Optional(ModelInputLimitsSchema),\n\tcost: Type.Optional(ModelCostSchema),\n\tpromptCache: Type.Optional(ModelPromptCacheSchema),\n\tcontextWindow: Type.Optional(PositiveTokenCountSchema),\n\tmaxTokens: Type.Optional(PositiveTokenCountSchema),\n\tsamplingParams: Type.Optional(SamplingParamsSchema),\n\tsamplingParamsByThinkingLevel: Type.Optional(SamplingParamsByThinkingLevelSchema),\n\theaders: Type.Optional(Type.Record(Type.String(), Type.String())),\n\tcompat: Type.Optional(ModelsJsonCompatSchema),\n});\n\nconst ModelOverrideSchema = Type.Object({\n\tname: Type.Optional(Type.String({ minLength: 1 })),\n\treasoning: Type.Optional(Type.Boolean()),\n\tthinkingLevelMap: Type.Optional(ThinkingLevelMapSchema),\n\tinput: Type.Optional(Type.Array(ModelInputModalitySchema)),\n\tinputLimits: Type.Optional(ModelInputLimitsSchema),\n\tcost: Type.Optional(Type.Partial(ModelCostSchema)),\n\tpromptCache: Type.Optional(ModelPromptCacheSchema),\n\tcontextWindow: Type.Optional(PositiveTokenCountSchema),\n\tmaxTokens: Type.Optional(PositiveTokenCountSchema),\n\tsamplingParams: Type.Optional(SamplingParamsSchema),\n\tsamplingParamsByThinkingLevel: Type.Optional(SamplingParamsByThinkingLevelSchema),\n\theaders: Type.Optional(Type.Record(Type.String(), Type.String())),\n\tcompat: Type.Optional(ModelsJsonCompatSchema),\n});\n\nconst ProviderConfigSchema = Type.Object({\n\tname: Type.Optional(Type.String({ minLength: 1 })),\n\tbaseUrl: Type.Optional(Type.String({ minLength: 1 })),\n\tapiKey: Type.Optional(Type.String({ minLength: 1 })),\n\tapi: Type.Optional(Type.String({ minLength: 1 })),\n\toauth: Type.Optional(Type.Literal(\"radius\")),\n\theaders: Type.Optional(Type.Record(Type.String(), Type.String())),\n\tcompat: Type.Optional(ModelsJsonCompatSchema),\n\tauthHeader: Type.Optional(Type.Boolean()),\n\tmodels: Type.Optional(Type.Array(ModelDefinitionSchema)),\n\tmodelOverrides: Type.Optional(Type.Record(Type.String(), ModelOverrideSchema)),\n});\n\nexport const ModelsConfigSchema = Type.Object({\n\t$schema: Type.Optional(Type.String()),\n\tproviders: Type.Record(Type.String(), ProviderConfigSchema),\n});\nconst validateModelsConfig = Compile(ModelsConfigSchema);\n\nexport type ModelsJsonModel = Static<typeof ModelDefinitionSchema>;\nexport type ModelsJsonModelOverride = Static<typeof ModelOverrideSchema>;\nexport type ModelsJsonProvider = Static<typeof ProviderConfigSchema>;\n\nfunction formatValidationPath(error: TLocalizedValidationError): string {\n\tif (error.keyword === \"required\") {\n\t\tconst requiredProperties = (error.params as { requiredProperties?: string[] }).requiredProperties;\n\t\tconst requiredProperty = requiredProperties?.[0];\n\t\tif (requiredProperty) {\n\t\t\tconst basePath = error.instancePath.replace(/^\\//, \"\").replace(/\\//g, \".\");\n\t\t\treturn basePath ? `${basePath}.${requiredProperty}` : requiredProperty;\n\t\t}\n\t}\n\tconst path = error.instancePath.replace(/^\\//, \"\").replace(/\\//g, \".\");\n\treturn path || \"root\";\n}\n\nfunction deepFreeze<T>(value: T): T {\n\tif (typeof value !== \"object\" || value === null || Object.isFrozen(value)) return value;\n\tfor (const child of Object.values(value)) deepFreeze(child);\n\treturn Object.freeze(value);\n}\n\n/** One immutable load of models.json. */\nexport class ModelConfig {\n\tprivate readonly providers: ReadonlyMap<string, ModelsJsonProvider>;\n\tprivate readonly error: string | undefined;\n\n\tprivate constructor(providers: ReadonlyMap<string, ModelsJsonProvider>, error?: string) {\n\t\tthis.providers = providers;\n\t\tthis.error = error;\n\t}\n\n\tstatic async load(modelsJsonPath: string | undefined): Promise<ModelConfig> {\n\t\tif (!modelsJsonPath) return new ModelConfig(new Map());\n\t\tconst path = normalizePath(modelsJsonPath);\n\t\tlet content: string;\n\t\ttry {\n\t\t\tcontent = await readFile(path, \"utf-8\");\n\t\t} catch (error) {\n\t\t\tif ((error as NodeJS.ErrnoException).code === \"ENOENT\") return new ModelConfig(new Map());\n\t\t\treturn new ModelConfig(\n\t\t\t\tnew Map(),\n\t\t\t\t`Failed to load models.json: ${error instanceof Error ? error.message : error}\\n\\nFile: ${path}`,\n\t\t\t);\n\t\t}\n\n\t\tlet parsed: unknown;\n\t\ttry {\n\t\t\tparsed = JSON.parse(stripJsonComments(stripBom(content)));\n\t\t} catch (error) {\n\t\t\treturn new ModelConfig(\n\t\t\t\tnew Map(),\n\t\t\t\t`Failed to parse models.json: ${error instanceof Error ? error.message : error}\\n\\nFile: ${path}`,\n\t\t\t);\n\t\t}\n\n\t\tif (!validateModelsConfig.Check(parsed)) {\n\t\t\tconst errors =\n\t\t\t\tvalidateModelsConfig\n\t\t\t\t\t.Errors(parsed)\n\t\t\t\t\t.map((error) => ` - ${formatValidationPath(error)}: ${error.message}`)\n\t\t\t\t\t.join(\"\\n\") || \"Unknown schema error\";\n\t\t\treturn new ModelConfig(new Map(), `Invalid models.json schema:\\n${errors}\\n\\nFile: ${path}`);\n\t\t}\n\n\t\tconst providers = new Map<string, ModelsJsonProvider>();\n\t\tfor (const [providerId, provider] of Object.entries(normalizeProviderKeys(parsed.providers))) {\n\t\t\tproviders.set(providerId, deepFreeze(structuredClone(provider)));\n\t\t}\n\t\treturn new ModelConfig(providers);\n\t}\n\n\tgetProvider(providerId: string): ModelsJsonProvider | undefined {\n\t\treturn this.providers.get(providerId);\n\t}\n\n\tgetProviderIds(): readonly string[] {\n\t\treturn [...this.providers.keys()];\n\t}\n\n\tgetError(): string | undefined {\n\t\treturn this.error;\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-trust.d.ts","sourceRoot":"","sources":["../../src/core/project-trust.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"project-trust.d.ts","sourceRoot":"","sources":["../../src/core/project-trust.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEvF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAIN,KAAK,iBAAiB,EACtB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,MAAM,OAAO,GAAG,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC;AAE/D,MAAM,WAAW,4BAA4B;IAC5C,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,iBAAiB,CAAC;IAC9B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,gBAAgB,CAAC,EAAE,oBAAoB,CAAC;IACxC,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C;AAMD;;;;;;;;GAQG;AACH,wBAAgB,wCAAwC,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE/E;AAqBD,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,4BAA4B,GAAG,OAAO,CAAC,OAAO,CAAC,CAkDnG"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { APP_TITLE, CONFIG_DIR_NAME } from "../config.js";
|
|
2
2
|
import { emitProjectTrustEvent } from "./extensions/runner.js";
|
|
3
|
+
import { SETTINGS_DEFAULTS } from "./settings-defaults.js";
|
|
3
4
|
import { getProjectTrustOptions, hasProjectTrustInputs, } from "./trust-manager.js";
|
|
4
5
|
function formatProjectTrustPrompt(cwd) {
|
|
5
6
|
return `Trust project folder?\n${cwd}\n\nThis allows ${APP_TITLE} to load ${CONFIG_DIR_NAME} settings and resources, install missing project packages, and execute project extensions.`;
|
|
@@ -50,7 +51,7 @@ export async function resolveProjectTrusted(options) {
|
|
|
50
51
|
if (decision !== null) {
|
|
51
52
|
return decision;
|
|
52
53
|
}
|
|
53
|
-
switch (options.defaultProjectTrust ??
|
|
54
|
+
switch (options.defaultProjectTrust ?? SETTINGS_DEFAULTS.defaultProjectTrust) {
|
|
54
55
|
case "always":
|
|
55
56
|
return true;
|
|
56
57
|
case "never":
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-trust.js","sourceRoot":"","sources":["../../src/core/project-trust.ts"],"names":[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AO,QAAQ,CAAC;IACjB,CAAC;IAED,QAAQ,OAAO,CAAC,mBAAmB,IAAI,iBAAiB,CAAC,mBAAmB,EAAE,CAAC;QAC9E,KAAK,QAAQ;YACZ,OAAO,IAAI,CAAC;QACb,KAAK,OAAO;YACX,OAAO,KAAK,CAAC;QACd,KAAK,KAAK;YACT,MAAM;IACR,CAAC;IAED,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,KAAK,EAAE,CAAC;QACxC,OAAO,KAAK,CAAC;IACd,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,wBAAwB,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,mBAAmB,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IACjH,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC5B,4BAA4B,CAAC,OAAO,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QAC3D,OAAO,QAAQ,CAAC,OAAO,CAAC;IACzB,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC","sourcesContent":["import { APP_TITLE, CONFIG_DIR_NAME } from \"../config.js\";\nimport { emitProjectTrustEvent } from \"./extensions/runner.ts\";\nimport type { LoadExtensionsResult, ProjectTrustContext } from \"./extensions/types.ts\";\nimport { SETTINGS_DEFAULTS } from \"./settings-defaults.ts\";\nimport type { DefaultProjectTrust } from \"./settings-manager.ts\";\nimport {\n\tgetProjectTrustOptions,\n\thasProjectTrustInputs,\n\ttype ProjectTrustOption,\n\ttype ProjectTrustStore,\n} from \"./trust-manager.ts\";\n\nexport type AppMode = \"interactive\" | \"print\" | \"json\" | \"rpc\";\n\nexport interface ResolveProjectTrustedOptions {\n\tcwd: string;\n\ttrustStore: ProjectTrustStore;\n\ttrustOverride?: boolean;\n\tdefaultProjectTrust?: DefaultProjectTrust;\n\textensionsResult?: LoadExtensionsResult;\n\tprojectTrustContext: ProjectTrustContext;\n\tpromptMessage?: string;\n\tonExtensionError?: (message: string) => void;\n}\n\nfunction formatProjectTrustPrompt(cwd: string): string {\n\treturn `Trust project folder?\\n${cwd}\\n\\nThis allows ${APP_TITLE} to load ${CONFIG_DIR_NAME} settings and resources, install missing project packages, and execute project extensions.`;\n}\n\n/**\n * The prompt shown for a `-e` extension source outside the project.\n *\n * Named through `APP_TITLE` for the same reason as the project-folder prompt\n * above: branding is configurable, so a hardcoded product name lies in a\n * rebranded distribution. The `.atomic/.pi` directory names stay literal —\n * they are the two compatibility paths the resource loader reads from that\n * source, not a product name.\n */\nexport function formatBorrowedExtensionSourceTrustPrompt(source: string): string {\n\treturn `Trust extension source?\\n${source}\\n\\nThis allows ${APP_TITLE} to load project-local .atomic/.pi resources and .agents/skills from this -e source, including extensions and workflows that can execute code.`;\n}\n\nasync function selectProjectTrustOption(\n\tcwd: string,\n\tctx: ProjectTrustContext,\n\tpromptMessage?: string,\n): Promise<ProjectTrustOption | undefined> {\n\tconst options = getProjectTrustOptions(cwd, { includeSessionOnly: true });\n\tconst selected = await ctx.ui.select(\n\t\tpromptMessage ?? formatProjectTrustPrompt(cwd),\n\t\toptions.map((option) => option.label),\n\t);\n\treturn options.find((option) => option.label === selected);\n}\n\nfunction saveProjectTrustPromptResult(trustStore: ProjectTrustStore, result: ProjectTrustOption): void {\n\tif (result.updates.length > 0) {\n\t\ttrustStore.setMany(result.updates);\n\t}\n}\n\nexport async function resolveProjectTrusted(options: ResolveProjectTrustedOptions): Promise<boolean> {\n\tif (options.trustOverride !== undefined) {\n\t\treturn options.trustOverride;\n\t}\n\tif (!hasProjectTrustInputs(options.cwd)) {\n\t\treturn true;\n\t}\n\n\tif (options.extensionsResult) {\n\t\tconst { result, errors } = await emitProjectTrustEvent(\n\t\t\toptions.extensionsResult,\n\t\t\t{ type: \"project_trust\", cwd: options.cwd },\n\t\t\toptions.projectTrustContext,\n\t\t);\n\t\tfor (const error of errors) {\n\t\t\toptions.onExtensionError?.(`Extension \"${error.extensionPath}\" project_trust error: ${error.error}`);\n\t\t}\n\t\tif (result) {\n\t\t\tconst trusted = result.trusted === \"yes\";\n\t\t\tif (result.remember === true) {\n\t\t\t\toptions.trustStore.set(options.cwd, trusted);\n\t\t\t}\n\t\t\treturn trusted;\n\t\t}\n\t}\n\n\tconst decision = options.trustStore.get(options.cwd);\n\tif (decision !== null) {\n\t\treturn decision;\n\t}\n\n\tswitch (options.defaultProjectTrust ?? SETTINGS_DEFAULTS.defaultProjectTrust) {\n\t\tcase \"always\":\n\t\t\treturn true;\n\t\tcase \"never\":\n\t\t\treturn false;\n\t\tcase \"ask\":\n\t\t\tbreak;\n\t}\n\n\tif (!options.projectTrustContext.hasUI) {\n\t\treturn false;\n\t}\n\n\tconst selected = await selectProjectTrustOption(options.cwd, options.projectTrustContext, options.promptMessage);\n\tif (selected !== undefined) {\n\t\tsaveProjectTrustPromptResult(options.trustStore, selected);\n\t\treturn selected.trusted;\n\t}\n\treturn false;\n}\n"]}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/** Runtime defaults shared by settings accessors and the published JSON Schema. */
|
|
2
|
+
export declare const SETTINGS_DEFAULTS: {
|
|
3
|
+
readonly routerModel: "";
|
|
4
|
+
readonly transport: "auto";
|
|
5
|
+
readonly steeringMode: "one-at-a-time";
|
|
6
|
+
readonly followUpMode: "one-at-a-time";
|
|
7
|
+
readonly compaction: {
|
|
8
|
+
readonly enabled: true;
|
|
9
|
+
readonly reserveTokens: 16384;
|
|
10
|
+
readonly compression_ratio: 0.5;
|
|
11
|
+
readonly preserve_recent: 2;
|
|
12
|
+
};
|
|
13
|
+
readonly branchSummary: {
|
|
14
|
+
readonly reserveTokens: 16384;
|
|
15
|
+
readonly skipPrompt: false;
|
|
16
|
+
};
|
|
17
|
+
readonly sessionSummary: {
|
|
18
|
+
readonly enabled: true;
|
|
19
|
+
};
|
|
20
|
+
readonly retry: {
|
|
21
|
+
readonly enabled: true;
|
|
22
|
+
readonly maxRetries: 3;
|
|
23
|
+
readonly baseDelayMs: 2000;
|
|
24
|
+
readonly maxAgentDelayMs: 60000;
|
|
25
|
+
readonly provider: {
|
|
26
|
+
readonly maxRetryDelayMs: 60000;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
readonly hideThinkingBlock: false;
|
|
30
|
+
readonly showCacheMissNotices: false;
|
|
31
|
+
readonly quietStartup: false;
|
|
32
|
+
readonly defaultProjectTrust: "ask";
|
|
33
|
+
readonly bashInterceptor: {
|
|
34
|
+
readonly enabled: false;
|
|
35
|
+
};
|
|
36
|
+
readonly search: {
|
|
37
|
+
readonly contextBefore: 1;
|
|
38
|
+
readonly contextAfter: 3;
|
|
39
|
+
};
|
|
40
|
+
readonly collapseChangelog: false;
|
|
41
|
+
readonly enableInstallTelemetry: true;
|
|
42
|
+
readonly enableSkillCommands: true;
|
|
43
|
+
readonly herdr: {
|
|
44
|
+
readonly enabled: true;
|
|
45
|
+
};
|
|
46
|
+
readonly terminal: {
|
|
47
|
+
readonly showImages: true;
|
|
48
|
+
readonly imageWidthCells: 60;
|
|
49
|
+
readonly clearOnShrink: false;
|
|
50
|
+
readonly showTerminalProgress: false;
|
|
51
|
+
};
|
|
52
|
+
readonly images: {
|
|
53
|
+
readonly autoResize: true;
|
|
54
|
+
readonly blockImages: false;
|
|
55
|
+
};
|
|
56
|
+
readonly doubleEscapeAction: "tree";
|
|
57
|
+
readonly treeFilterMode: "default";
|
|
58
|
+
readonly editorPaddingX: 0;
|
|
59
|
+
readonly outputPad: 1;
|
|
60
|
+
readonly autocompleteMaxVisible: 5;
|
|
61
|
+
readonly fullscreenScrollbar: "auto";
|
|
62
|
+
readonly fullscreenExitOutput: "transcript";
|
|
63
|
+
readonly fullscreenCopyOnSelect: true;
|
|
64
|
+
readonly fullscreenWheelScrollLines: "auto";
|
|
65
|
+
readonly codemode: {
|
|
66
|
+
readonly mode: "on";
|
|
67
|
+
readonly inlineBudget: 3000;
|
|
68
|
+
};
|
|
69
|
+
readonly markdown: {
|
|
70
|
+
readonly codeBlockIndent: " ";
|
|
71
|
+
readonly mermaid: "streaming";
|
|
72
|
+
readonly latex: true;
|
|
73
|
+
};
|
|
74
|
+
readonly warnings: {
|
|
75
|
+
readonly anthropicExtraUsage: true;
|
|
76
|
+
};
|
|
77
|
+
readonly httpIdleTimeoutMs: 600000;
|
|
78
|
+
readonly cacheWarming: "streaming";
|
|
79
|
+
};
|
|
80
|
+
//# sourceMappingURL=settings-defaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-defaults.d.ts","sourceRoot":"","sources":["../../src/core/settings-defaults.ts"],"names":[],"mappings":"AAEA,mFAAmF;AACnF,eAAO,MAAM,iBAAiB;aAC7B,WAAW,EAAE,EAAE;aACf,SAAS,EAAE,MAAM;aACjB,YAAY,EAAE,eAAe;aAC7B,YAAY,EAAE,eAAe;aAC7B,UAAU;iBACT,OAAO;iBACP,aAAa,EAAE,KAAK;iBACpB,iBAAiB,EAAE,GAAG;iBACtB,eAAe,EAAE,CAAC;;aAEnB,aAAa;iBACZ,aAAa,EAAE,KAAK;iBACpB,UAAU;;aAEX,cAAc;iBACb,OAAO;;aAER,KAAK;iBACJ,OAAO;iBACP,UAAU,EAAE,CAAC;iBACb,WAAW,EAAE,IAAI;iBACjB,eAAe;iBACf,QAAQ;qBACP,eAAe,EAAE,KAAK;;;aAGxB,iBAAiB;aACjB,oBAAoB;aACpB,YAAY;aACZ,mBAAmB,EAAE,KAAK;aAC1B,eAAe;iBACd,OAAO;;aAER,MAAM;iBACL,aAAa,EAAE,CAAC;iBAChB,YAAY,EAAE,CAAC;;aAEhB,iBAAiB;aACjB,sBAAsB;aACtB,mBAAmB;aACnB,KAAK;iBACJ,OAAO;;aAER,QAAQ;iBACP,UAAU;iBACV,eAAe,EAAE,EAAE;iBACnB,aAAa;iBACb,oBAAoB;;aAErB,MAAM;iBACL,UAAU;iBACV,WAAW;;aAEZ,kBAAkB,EAAE,MAAM;aAC1B,cAAc,EAAE,SAAS;aACzB,cAAc,EAAE,CAAC;aACjB,SAAS,EAAE,CAAC;aACZ,sBAAsB,EAAE,CAAC;aACzB,mBAAmB,EAAE,MAAM;aAC3B,oBAAoB,EAAE,YAAY;aAClC,sBAAsB;aACtB,0BAA0B,EAAE,MAAM;aAClC,QAAQ;iBACP,IAAI,EAAE,IAAI;iBACV,YAAY,EAAE,IAAI;;aAEnB,QAAQ;iBACP,eAAe,EAAE,IAAI;iBACrB,OAAO,EAAE,WAAW;iBACpB,KAAK;;aAEN,QAAQ;iBACP,mBAAmB;;aAEpB,iBAAiB,EAAE,MAAO;aAC1B,YAAY,EAAE,WAAW;CAChB,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { DEFAULT_MAX_AGENT_RETRY_DELAY_MS } from "@bastani/pi-ai/utils/retry";
|
|
2
|
+
/** Runtime defaults shared by settings accessors and the published JSON Schema. */
|
|
3
|
+
export const SETTINGS_DEFAULTS = {
|
|
4
|
+
routerModel: "",
|
|
5
|
+
transport: "auto",
|
|
6
|
+
steeringMode: "one-at-a-time",
|
|
7
|
+
followUpMode: "one-at-a-time",
|
|
8
|
+
compaction: {
|
|
9
|
+
enabled: true,
|
|
10
|
+
reserveTokens: 16384,
|
|
11
|
+
compression_ratio: 0.5,
|
|
12
|
+
preserve_recent: 2,
|
|
13
|
+
},
|
|
14
|
+
branchSummary: {
|
|
15
|
+
reserveTokens: 16384,
|
|
16
|
+
skipPrompt: false,
|
|
17
|
+
},
|
|
18
|
+
sessionSummary: {
|
|
19
|
+
enabled: true,
|
|
20
|
+
},
|
|
21
|
+
retry: {
|
|
22
|
+
enabled: true,
|
|
23
|
+
maxRetries: 3,
|
|
24
|
+
baseDelayMs: 2000,
|
|
25
|
+
maxAgentDelayMs: DEFAULT_MAX_AGENT_RETRY_DELAY_MS,
|
|
26
|
+
provider: {
|
|
27
|
+
maxRetryDelayMs: 60000,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
hideThinkingBlock: false,
|
|
31
|
+
showCacheMissNotices: false,
|
|
32
|
+
quietStartup: false,
|
|
33
|
+
defaultProjectTrust: "ask",
|
|
34
|
+
bashInterceptor: {
|
|
35
|
+
enabled: false,
|
|
36
|
+
},
|
|
37
|
+
search: {
|
|
38
|
+
contextBefore: 1,
|
|
39
|
+
contextAfter: 3,
|
|
40
|
+
},
|
|
41
|
+
collapseChangelog: false,
|
|
42
|
+
enableInstallTelemetry: true,
|
|
43
|
+
enableSkillCommands: true,
|
|
44
|
+
herdr: {
|
|
45
|
+
enabled: true,
|
|
46
|
+
},
|
|
47
|
+
terminal: {
|
|
48
|
+
showImages: true,
|
|
49
|
+
imageWidthCells: 60,
|
|
50
|
+
clearOnShrink: false,
|
|
51
|
+
showTerminalProgress: false,
|
|
52
|
+
},
|
|
53
|
+
images: {
|
|
54
|
+
autoResize: true,
|
|
55
|
+
blockImages: false,
|
|
56
|
+
},
|
|
57
|
+
doubleEscapeAction: "tree",
|
|
58
|
+
treeFilterMode: "default",
|
|
59
|
+
editorPaddingX: 0,
|
|
60
|
+
outputPad: 1,
|
|
61
|
+
autocompleteMaxVisible: 5,
|
|
62
|
+
fullscreenScrollbar: "auto",
|
|
63
|
+
fullscreenExitOutput: "transcript",
|
|
64
|
+
fullscreenCopyOnSelect: true,
|
|
65
|
+
fullscreenWheelScrollLines: "auto",
|
|
66
|
+
codemode: {
|
|
67
|
+
mode: "on",
|
|
68
|
+
inlineBudget: 3000,
|
|
69
|
+
},
|
|
70
|
+
markdown: {
|
|
71
|
+
codeBlockIndent: " ",
|
|
72
|
+
mermaid: "streaming",
|
|
73
|
+
latex: true,
|
|
74
|
+
},
|
|
75
|
+
warnings: {
|
|
76
|
+
anthropicExtraUsage: true,
|
|
77
|
+
},
|
|
78
|
+
httpIdleTimeoutMs: 600_000,
|
|
79
|
+
cacheWarming: "streaming",
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=settings-defaults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-defaults.js","sourceRoot":"","sources":["../../src/core/settings-defaults.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C;IACjB,SAAS,EAAE,CAAC;IACZ,sBAAsB,EAAE,CAAC;IACzB,mBAAmB,EAAE,MAAM;IAC3B,oBAAoB,EAAE,YAAY;IAClC,sBAAsB,EAAE,IAAI;IAC5B,0BAA0B,EAAE,MAAM;IAClC,QAAQ,EAAE;QACT,IAAI,EAAE,IAAI;QACV,YAAY,EAAE,IAAI;KAClB;IACD,QAAQ,EAAE;QACT,eAAe,EAAE,IAAI;QACrB,OAAO,EAAE,WAAW;QACpB,KAAK,EAAE,IAAI;KACX;IACD,QAAQ,EAAE;QACT,mBAAmB,EAAE,IAAI;KACzB;IACD,iBAAiB,EAAE,OAAO;IAC1B,YAAY,EAAE,WAAW;CAChB,CAAC","sourcesContent":["import { DEFAULT_MAX_AGENT_RETRY_DELAY_MS } from \"@bastani/pi-ai/utils/retry\";\n\n/** Runtime defaults shared by settings accessors and the published JSON Schema. */\nexport const SETTINGS_DEFAULTS = {\n\trouterModel: \"\",\n\ttransport: \"auto\",\n\tsteeringMode: \"one-at-a-time\",\n\tfollowUpMode: \"one-at-a-time\",\n\tcompaction: {\n\t\tenabled: true,\n\t\treserveTokens: 16384,\n\t\tcompression_ratio: 0.5,\n\t\tpreserve_recent: 2,\n\t},\n\tbranchSummary: {\n\t\treserveTokens: 16384,\n\t\tskipPrompt: false,\n\t},\n\tsessionSummary: {\n\t\tenabled: true,\n\t},\n\tretry: {\n\t\tenabled: true,\n\t\tmaxRetries: 3,\n\t\tbaseDelayMs: 2000,\n\t\tmaxAgentDelayMs: DEFAULT_MAX_AGENT_RETRY_DELAY_MS,\n\t\tprovider: {\n\t\t\tmaxRetryDelayMs: 60000,\n\t\t},\n\t},\n\thideThinkingBlock: false,\n\tshowCacheMissNotices: false,\n\tquietStartup: false,\n\tdefaultProjectTrust: \"ask\",\n\tbashInterceptor: {\n\t\tenabled: false,\n\t},\n\tsearch: {\n\t\tcontextBefore: 1,\n\t\tcontextAfter: 3,\n\t},\n\tcollapseChangelog: false,\n\tenableInstallTelemetry: true,\n\tenableSkillCommands: true,\n\therdr: {\n\t\tenabled: true,\n\t},\n\tterminal: {\n\t\tshowImages: true,\n\t\timageWidthCells: 60,\n\t\tclearOnShrink: false,\n\t\tshowTerminalProgress: false,\n\t},\n\timages: {\n\t\tautoResize: true,\n\t\tblockImages: false,\n\t},\n\tdoubleEscapeAction: \"tree\",\n\ttreeFilterMode: \"default\",\n\teditorPaddingX: 0,\n\toutputPad: 1,\n\tautocompleteMaxVisible: 5,\n\tfullscreenScrollbar: \"auto\",\n\tfullscreenExitOutput: \"transcript\",\n\tfullscreenCopyOnSelect: true,\n\tfullscreenWheelScrollLines: \"auto\",\n\tcodemode: {\n\t\tmode: \"on\",\n\t\tinlineBudget: 3000,\n\t},\n\tmarkdown: {\n\t\tcodeBlockIndent: \" \",\n\t\tmermaid: \"streaming\",\n\t\tlatex: true,\n\t},\n\twarnings: {\n\t\tanthropicExtraUsage: true,\n\t},\n\thttpIdleTimeoutMs: 600_000,\n\tcacheWarming: \"streaming\",\n} as const;\n"]}
|