@code-yeongyu/senpi 2026.8.22-2 → 2026.8.23

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 (35) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/core/model-config-schema.d.ts +12 -12
  3. package/dist/core/model-config-schema.js +2 -2
  4. package/dist/core/model-config-schema.js.map +1 -1
  5. package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +14 -0
  6. package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
  7. package/node_modules/@code-yeongyu/senpi-codemode/src/extension/eval-notifier.ts +16 -4
  8. package/node_modules/@code-yeongyu/senpi-codemode/src/index.ts +5 -2
  9. package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
  10. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.d.ts +5 -1
  11. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.d.ts.map +1 -1
  12. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.js +13 -5
  13. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.js.map +1 -1
  14. package/node_modules/@earendil-works/pi-ai/dist/cursor/composer-prompt.d.ts +27 -0
  15. package/node_modules/@earendil-works/pi-ai/dist/cursor/composer-prompt.d.ts.map +1 -0
  16. package/node_modules/@earendil-works/pi-ai/dist/cursor/composer-prompt.js +54 -0
  17. package/node_modules/@earendil-works/pi-ai/dist/cursor/composer-prompt.js.map +1 -0
  18. package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
  19. package/node_modules/@earendil-works/pi-ai/dist/providers/data/nvidia.json +1 -1
  20. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
  21. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/kimi-xtml/markers.d.ts +4 -0
  22. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/kimi-xtml/markers.d.ts.map +1 -1
  23. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/kimi-xtml/markers.js +14 -0
  24. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/kimi-xtml/markers.js.map +1 -1
  25. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/kimi-xtml/recovery-stream.d.ts.map +1 -1
  26. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/kimi-xtml/recovery-stream.js +65 -35
  27. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/kimi-xtml/recovery-stream.js.map +1 -1
  28. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/kimi-xtml/thinking-recovery.d.ts.map +1 -1
  29. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/kimi-xtml/thinking-recovery.js +40 -12
  30. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/kimi-xtml/thinking-recovery.js.map +1 -1
  31. package/node_modules/@earendil-works/pi-ai/package.json +2 -2
  32. package/node_modules/@earendil-works/pi-pty/package.json +1 -1
  33. package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
  34. package/node_modules/@earendil-works/pi-tui/package.json +1 -1
  35. package/package.json +7 -7
package/CHANGELOG.md CHANGED
@@ -12,6 +12,20 @@
12
12
 
13
13
  ### Removed
14
14
 
15
+ ## [2026.8.23] - 2026-08-23
16
+
17
+ ### Breaking Changes
18
+
19
+ ### Fixed
20
+
21
+ - User `models.json` files may now declare the `video` input modality for custom provider models, matching the runtime model type and the builtin Kimi Coding catalog; previously a video entry failed schema validation, which rejected the entire models.json and unregistered every user-defined provider ([#1087](https://github.com/code-yeongyu/senpi/pull/1087)).
22
+
23
+ ### Added
24
+
25
+ ### Changed
26
+
27
+ ### Removed
28
+
15
29
  ## [2026.8.22-2] - 2026-08-22
16
30
 
17
31
  ### Breaking Changes
@@ -18,7 +18,7 @@ declare const ModelDefinitionSchema: Type.TObject<{
18
18
  xhigh: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
19
19
  max: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
20
20
  }>>;
21
- input: Type.TOptional<Type.TArray<Type.TUnion<[Type.TLiteral<"text">, Type.TLiteral<"image">]>>>;
21
+ input: Type.TOptional<Type.TArray<Type.TUnion<[Type.TLiteral<"text">, Type.TLiteral<"image">, Type.TLiteral<"video">]>>>;
22
22
  cost: Type.TOptional<Type.TObject<{
23
23
  tiers: Type.TOptional<Type.TArray<Type.TObject<{
24
24
  input: Type.TNumber;
@@ -137,7 +137,7 @@ declare const ModelOverrideSchema: Type.TObject<{
137
137
  max: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
138
138
  }>>;
139
139
  thinkingLevelMapMode: Type.TOptional<Type.TUnion<[Type.TLiteral<"merge">, Type.TLiteral<"replace">]>>;
140
- input: Type.TOptional<Type.TArray<Type.TUnion<[Type.TLiteral<"text">, Type.TLiteral<"image">]>>>;
140
+ input: Type.TOptional<Type.TArray<Type.TUnion<[Type.TLiteral<"text">, Type.TLiteral<"image">, Type.TLiteral<"video">]>>>;
141
141
  cost: Type.TOptional<Type.TObject<{
142
142
  input: Type.TOptional<Type.TNumber>;
143
143
  output: Type.TOptional<Type.TNumber>;
@@ -357,7 +357,7 @@ declare const ProviderConfigSchema: Type.TObject<{
357
357
  xhigh: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
358
358
  max: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
359
359
  }>>;
360
- input: Type.TOptional<Type.TArray<Type.TUnion<[Type.TLiteral<"text">, Type.TLiteral<"image">]>>>;
360
+ input: Type.TOptional<Type.TArray<Type.TUnion<[Type.TLiteral<"text">, Type.TLiteral<"image">, Type.TLiteral<"video">]>>>;
361
361
  cost: Type.TOptional<Type.TObject<{
362
362
  tiers: Type.TOptional<Type.TArray<Type.TObject<{
363
363
  input: Type.TNumber;
@@ -476,7 +476,7 @@ declare const ProviderConfigSchema: Type.TObject<{
476
476
  max: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
477
477
  }>>;
478
478
  thinkingLevelMapMode: Type.TOptional<Type.TUnion<[Type.TLiteral<"merge">, Type.TLiteral<"replace">]>>;
479
- input: Type.TOptional<Type.TArray<Type.TUnion<[Type.TLiteral<"text">, Type.TLiteral<"image">]>>>;
479
+ input: Type.TOptional<Type.TArray<Type.TUnion<[Type.TLiteral<"text">, Type.TLiteral<"image">, Type.TLiteral<"video">]>>>;
480
480
  cost: Type.TOptional<Type.TObject<{
481
481
  input: Type.TOptional<Type.TNumber>;
482
482
  output: Type.TOptional<Type.TNumber>;
@@ -699,7 +699,7 @@ declare const ModelsConfigSchema: Type.TObject<{
699
699
  xhigh: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
700
700
  max: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
701
701
  }>>;
702
- input: Type.TOptional<Type.TArray<Type.TUnion<[Type.TLiteral<"text">, Type.TLiteral<"image">]>>>;
702
+ input: Type.TOptional<Type.TArray<Type.TUnion<[Type.TLiteral<"text">, Type.TLiteral<"image">, Type.TLiteral<"video">]>>>;
703
703
  cost: Type.TOptional<Type.TObject<{
704
704
  tiers: Type.TOptional<Type.TArray<Type.TObject<{
705
705
  input: Type.TNumber;
@@ -818,7 +818,7 @@ declare const ModelsConfigSchema: Type.TObject<{
818
818
  max: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
819
819
  }>>;
820
820
  thinkingLevelMapMode: Type.TOptional<Type.TUnion<[Type.TLiteral<"merge">, Type.TLiteral<"replace">]>>;
821
- input: Type.TOptional<Type.TArray<Type.TUnion<[Type.TLiteral<"text">, Type.TLiteral<"image">]>>>;
821
+ input: Type.TOptional<Type.TArray<Type.TUnion<[Type.TLiteral<"text">, Type.TLiteral<"image">, Type.TLiteral<"video">]>>>;
822
822
  cost: Type.TOptional<Type.TObject<{
823
823
  input: Type.TOptional<Type.TNumber>;
824
824
  output: Type.TOptional<Type.TNumber>;
@@ -1042,7 +1042,7 @@ export declare const validateModelsConfig: import("typebox/compile").Validator<{
1042
1042
  xhigh: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
1043
1043
  max: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
1044
1044
  }>>;
1045
- input: Type.TOptional<Type.TArray<Type.TUnion<[Type.TLiteral<"text">, Type.TLiteral<"image">]>>>;
1045
+ input: Type.TOptional<Type.TArray<Type.TUnion<[Type.TLiteral<"text">, Type.TLiteral<"image">, Type.TLiteral<"video">]>>>;
1046
1046
  cost: Type.TOptional<Type.TObject<{
1047
1047
  tiers: Type.TOptional<Type.TArray<Type.TObject<{
1048
1048
  input: Type.TNumber;
@@ -1161,7 +1161,7 @@ export declare const validateModelsConfig: import("typebox/compile").Validator<{
1161
1161
  max: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
1162
1162
  }>>;
1163
1163
  thinkingLevelMapMode: Type.TOptional<Type.TUnion<[Type.TLiteral<"merge">, Type.TLiteral<"replace">]>>;
1164
- input: Type.TOptional<Type.TArray<Type.TUnion<[Type.TLiteral<"text">, Type.TLiteral<"image">]>>>;
1164
+ input: Type.TOptional<Type.TArray<Type.TUnion<[Type.TLiteral<"text">, Type.TLiteral<"image">, Type.TLiteral<"video">]>>>;
1165
1165
  cost: Type.TOptional<Type.TObject<{
1166
1166
  input: Type.TOptional<Type.TNumber>;
1167
1167
  output: Type.TOptional<Type.TNumber>;
@@ -1368,7 +1368,7 @@ export declare const validateModelsConfig: import("typebox/compile").Validator<{
1368
1368
  models?: {
1369
1369
  name?: string | undefined;
1370
1370
  headers?: Record<string, string> | undefined;
1371
- input?: ("text" | "image")[] | undefined;
1371
+ input?: ("text" | "image" | "video")[] | undefined;
1372
1372
  upstreamModelId?: string | undefined;
1373
1373
  serviceTier?: "auto" | "flex" | "priority" | undefined;
1374
1374
  promptPreset?: string | undefined;
@@ -1491,7 +1491,7 @@ export declare const validateModelsConfig: import("typebox/compile").Validator<{
1491
1491
  modelOverrides?: Record<string, {
1492
1492
  name?: string | undefined;
1493
1493
  headers?: Record<string, string> | undefined;
1494
- input?: ("text" | "image")[] | undefined;
1494
+ input?: ("text" | "image" | "video")[] | undefined;
1495
1495
  promptPreset?: string | undefined;
1496
1496
  recoverTextToolCalls?: boolean | undefined;
1497
1497
  reasoning?: boolean | undefined;
@@ -1710,7 +1710,7 @@ export declare const validateModelsConfig: import("typebox/compile").Validator<{
1710
1710
  models?: {
1711
1711
  name?: string | undefined;
1712
1712
  headers?: Record<string, string> | undefined;
1713
- input?: ("text" | "image")[] | undefined;
1713
+ input?: ("text" | "image" | "video")[] | undefined;
1714
1714
  upstreamModelId?: string | undefined;
1715
1715
  serviceTier?: "auto" | "flex" | "priority" | undefined;
1716
1716
  promptPreset?: string | undefined;
@@ -1833,7 +1833,7 @@ export declare const validateModelsConfig: import("typebox/compile").Validator<{
1833
1833
  modelOverrides?: Record<string, {
1834
1834
  name?: string | undefined;
1835
1835
  headers?: Record<string, string> | undefined;
1836
- input?: ("text" | "image")[] | undefined;
1836
+ input?: ("text" | "image" | "video")[] | undefined;
1837
1837
  promptPreset?: string | undefined;
1838
1838
  recoverTextToolCalls?: boolean | undefined;
1839
1839
  reasoning?: boolean | undefined;
@@ -142,7 +142,7 @@ const ModelDefinitionSchema = Type.Object({
142
142
  baseUrl: Type.Optional(Type.String({ minLength: 1 })),
143
143
  reasoning: Type.Optional(Type.Boolean()),
144
144
  thinkingLevelMap: Type.Optional(ThinkingLevelMapSchema),
145
- input: Type.Optional(Type.Array(Type.Union([Type.Literal("text"), Type.Literal("image")]))),
145
+ input: Type.Optional(Type.Array(Type.Union([Type.Literal("text"), Type.Literal("image"), Type.Literal("video")]))),
146
146
  cost: Type.Optional(ModelCostSchema),
147
147
  contextWindow: Type.Optional(Type.Number()),
148
148
  maxTokens: Type.Optional(Type.Number()),
@@ -158,7 +158,7 @@ const ModelOverrideSchema = Type.Object({
158
158
  reasoning: Type.Optional(Type.Boolean()),
159
159
  thinkingLevelMap: Type.Optional(ThinkingLevelMapSchema),
160
160
  thinkingLevelMapMode: Type.Optional(Type.Union([Type.Literal("merge"), Type.Literal("replace")])),
161
- input: Type.Optional(Type.Array(Type.Union([Type.Literal("text"), Type.Literal("image")]))),
161
+ input: Type.Optional(Type.Array(Type.Union([Type.Literal("text"), Type.Literal("image"), Type.Literal("video")]))),
162
162
  cost: Type.Optional(Type.Object({
163
163
  input: Type.Optional(Type.Number()),
164
164
  output: Type.Optional(Type.Number()),
@@ -1 +1 @@
1
- {"version":3,"file":"model-config-schema.js","sourceRoot":"","sources":["../../src/core/model-config-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,IAAI,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,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,EAAE,CAAC;IACjC,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;CACjC,CAAC,CAAC;AAEH,MAAM,uBAAuB,GAAG,IAAI,CAAC,MAAM,CAAC;IAC3C,eAAe,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;IAC9C,kBAAkB,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;IACjD,eAAe,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,O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C,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACnE,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACnE,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;IACxD,cAAc,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,mBAAmB,CAAC,CAAC;CAC9E,CAAC,CAAC;AAEH,MAAM,kBAAkB,GAAG,IAAI,CAAC,MAAM,CAAC;IACtC,iBAAiB,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3E,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,oBAAoB,CAAC;CAC3D,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC","sourcesContent":["import { type Static, Type } from \"typebox\";\nimport { Compile } from \"typebox/compile\";\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 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\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\tsupportsDisabledThinking: 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(\"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\tcacheControlFormat: Type.Optional(Type.Literal(\"anthropic\")),\n\topenRouterRouting: Type.Optional(OpenRouterRoutingSchema),\n\tvercelGatewayRouting: Type.Optional(VercelGatewayRoutingSchema),\n\tzaiToolStream: Type.Optional(Type.Boolean()),\n\tsupportsStrictMode: Type.Optional(Type.Boolean()),\n\ttoolCallFormat: Type.Optional(Type.String()),\n\tsendSessionAffinityHeaders: Type.Optional(Type.Boolean()),\n\tdeferredToolsMode: Type.Optional(Type.Literal(\"kimi\")),\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});\n\nconst OpenAIResponsesCompatSchema = Type.Object({\n\tsupportsDeveloperRole: 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\tsupportsWebSocket: Type.Optional(Type.Boolean()),\n\tsupportsRemoteCompactionV2: Type.Optional(Type.Boolean()),\n\tsupportsWebSearchPreview: Type.Optional(Type.Boolean()),\n\tsupportsToolSearch: Type.Optional(Type.Boolean()),\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\tsupportsDisabledThinking: Type.Optional(Type.Boolean()),\n\tsupportsTemperature: Type.Optional(Type.Boolean()),\n\tsupportsToolChoice: Type.Optional(Type.Boolean()),\n\tsupportsForcedToolChoice: Type.Optional(Type.Boolean()),\n\tforceAdaptiveThinking: Type.Optional(Type.Boolean()),\n\tallowEmptySignature: Type.Optional(Type.Boolean()),\n\tsupportsToolReferences: Type.Optional(Type.Boolean()),\n\tsupportsWebSearch: Type.Optional(Type.Boolean()),\n});\n\nconst ProviderCompatSchema = Type.Union([\n\tOpenAICompletionsCompatSchema,\n\tOpenAIResponsesCompatSchema,\n\tAnthropicMessagesCompatSchema,\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 ExtraBodySchema = Type.Record(Type.String(), Type.Unknown());\n\nconst ModelDefinitionSchema = Type.Object({\n\tid: Type.String({ minLength: 1 }),\n\tname: Type.Optional(Type.String({ minLength: 1 })),\n\tupstreamModelId: Type.Optional(Type.String({ minLength: 1 })),\n\tserviceTier: Type.Optional(Type.Union([Type.Literal(\"auto\"), Type.Literal(\"flex\"), Type.Literal(\"priority\")])),\n\tpromptPreset: Type.Optional(Type.String({ minLength: 1 })),\n\trecoverTextToolCalls: Type.Optional(Type.Boolean()),\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\")]))),\n\tcost: Type.Optional(ModelCostSchema),\n\tcontextWindow: Type.Optional(Type.Number()),\n\tmaxTokens: Type.Optional(Type.Number()),\n\theaders: Type.Optional(Type.Record(Type.String(), Type.String())),\n\textraBody: Type.Optional(ExtraBodySchema),\n\tcacheRetention: Type.Optional(Type.Union([Type.Literal(\"none\"), Type.Literal(\"short\"), Type.Literal(\"long\")])),\n\tcompat: Type.Optional(ProviderCompatSchema),\n});\n\nconst ModelOverrideSchema = Type.Object({\n\tname: Type.Optional(Type.String({ minLength: 1 })),\n\tpromptPreset: Type.Optional(Type.String({ minLength: 1 })),\n\trecoverTextToolCalls: Type.Optional(Type.Boolean()),\n\treasoning: Type.Optional(Type.Boolean()),\n\tthinkingLevelMap: Type.Optional(ThinkingLevelMapSchema),\n\tthinkingLevelMapMode: Type.Optional(Type.Union([Type.Literal(\"merge\"), Type.Literal(\"replace\")])),\n\tinput: Type.Optional(Type.Array(Type.Union([Type.Literal(\"text\"), Type.Literal(\"image\")]))),\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\tcontextWindow: Type.Optional(Type.Number()),\n\tmaxTokens: Type.Optional(Type.Number()),\n\theaders: Type.Optional(Type.Record(Type.String(), Type.String())),\n\textraBody: Type.Optional(ExtraBodySchema),\n\tcacheRetention: Type.Optional(Type.Union([Type.Literal(\"none\"), Type.Literal(\"short\"), Type.Literal(\"long\")])),\n\tcompat: Type.Optional(ProviderCompatSchema),\n});\n\nconst ProviderConfigSchema = Type.Object({\n\tname: Type.Optional(Type.String({ minLength: 1 })),\n\tdisabled: Type.Optional(Type.Boolean()),\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\textraBody: Type.Optional(ExtraBodySchema),\n\tcacheRetention: Type.Optional(Type.Union([Type.Literal(\"none\"), Type.Literal(\"short\"), Type.Literal(\"long\")])),\n\tcompat: Type.Optional(ProviderCompatSchema),\n\tauthHeader: Type.Optional(Type.Boolean()),\n\twhitelist: Type.Optional(Type.Array(Type.String({ minLength: 1 }))),\n\tblacklist: Type.Optional(Type.Array(Type.String({ minLength: 1 }))),\n\tmodels: Type.Optional(Type.Array(ModelDefinitionSchema)),\n\tmodelOverrides: Type.Optional(Type.Record(Type.String(), ModelOverrideSchema)),\n});\n\nconst ModelsConfigSchema = Type.Object({\n\tdisabledProviders: Type.Optional(Type.Array(Type.String({ minLength: 1 }))),\n\tproviders: Type.Record(Type.String(), ProviderConfigSchema),\n});\nexport const validateModelsConfig = Compile(ModelsConfigSchema);\n\nexport type ModelsJsonModel = Static<typeof ModelDefinitionSchema>;\nexport type ModelsJsonModelOverride = Static<typeof ModelOverrideSchema>;\nexport type ModelsJsonProvider = Static<typeof ProviderConfigSchema>;\nexport type ModelsJson = Static<typeof ModelsConfigSchema>;\n"]}
1
+ {"version":3,"file":"model-config-schema.js","sourceRoot":"","sources":["../../src/core/model-config-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,IAAI,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,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,EAAE,CAAC;IACjC,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;CACjC,CAAC,CAAC;AAEH,MAAM,uBAAuB,GAAG,IAAI,CAAC,MAAM,CAAC;IAC3C,eAAe,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;IAC9C,kBAAkB,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;IACjD,eAAe,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,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IAC9G,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,oBAAoB,CAAC;IAC3C,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;IACzC,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACnE,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACnE,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;IACxD,cAAc,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,mBAAmB,CAAC,CAAC;CAC9E,CAAC,CAAC;AAEH,MAAM,kBAAkB,GAAG,IAAI,CAAC,MAAM,CAAC;IACtC,iBAAiB,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3E,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,oBAAoB,CAAC;CAC3D,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC","sourcesContent":["import { type Static, Type } from \"typebox\";\nimport { Compile } from \"typebox/compile\";\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 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\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\tsupportsDisabledThinking: 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(\"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\tcacheControlFormat: Type.Optional(Type.Literal(\"anthropic\")),\n\topenRouterRouting: Type.Optional(OpenRouterRoutingSchema),\n\tvercelGatewayRouting: Type.Optional(VercelGatewayRoutingSchema),\n\tzaiToolStream: Type.Optional(Type.Boolean()),\n\tsupportsStrictMode: Type.Optional(Type.Boolean()),\n\ttoolCallFormat: Type.Optional(Type.String()),\n\tsendSessionAffinityHeaders: Type.Optional(Type.Boolean()),\n\tdeferredToolsMode: Type.Optional(Type.Literal(\"kimi\")),\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});\n\nconst OpenAIResponsesCompatSchema = Type.Object({\n\tsupportsDeveloperRole: 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\tsupportsWebSocket: Type.Optional(Type.Boolean()),\n\tsupportsRemoteCompactionV2: Type.Optional(Type.Boolean()),\n\tsupportsWebSearchPreview: Type.Optional(Type.Boolean()),\n\tsupportsToolSearch: Type.Optional(Type.Boolean()),\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\tsupportsDisabledThinking: Type.Optional(Type.Boolean()),\n\tsupportsTemperature: Type.Optional(Type.Boolean()),\n\tsupportsToolChoice: Type.Optional(Type.Boolean()),\n\tsupportsForcedToolChoice: Type.Optional(Type.Boolean()),\n\tforceAdaptiveThinking: Type.Optional(Type.Boolean()),\n\tallowEmptySignature: Type.Optional(Type.Boolean()),\n\tsupportsToolReferences: Type.Optional(Type.Boolean()),\n\tsupportsWebSearch: Type.Optional(Type.Boolean()),\n});\n\nconst ProviderCompatSchema = Type.Union([\n\tOpenAICompletionsCompatSchema,\n\tOpenAIResponsesCompatSchema,\n\tAnthropicMessagesCompatSchema,\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 ExtraBodySchema = Type.Record(Type.String(), Type.Unknown());\n\nconst ModelDefinitionSchema = Type.Object({\n\tid: Type.String({ minLength: 1 }),\n\tname: Type.Optional(Type.String({ minLength: 1 })),\n\tupstreamModelId: Type.Optional(Type.String({ minLength: 1 })),\n\tserviceTier: Type.Optional(Type.Union([Type.Literal(\"auto\"), Type.Literal(\"flex\"), Type.Literal(\"priority\")])),\n\tpromptPreset: Type.Optional(Type.String({ minLength: 1 })),\n\trecoverTextToolCalls: Type.Optional(Type.Boolean()),\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(\"video\")]))),\n\tcost: Type.Optional(ModelCostSchema),\n\tcontextWindow: Type.Optional(Type.Number()),\n\tmaxTokens: Type.Optional(Type.Number()),\n\theaders: Type.Optional(Type.Record(Type.String(), Type.String())),\n\textraBody: Type.Optional(ExtraBodySchema),\n\tcacheRetention: Type.Optional(Type.Union([Type.Literal(\"none\"), Type.Literal(\"short\"), Type.Literal(\"long\")])),\n\tcompat: Type.Optional(ProviderCompatSchema),\n});\n\nconst ModelOverrideSchema = Type.Object({\n\tname: Type.Optional(Type.String({ minLength: 1 })),\n\tpromptPreset: Type.Optional(Type.String({ minLength: 1 })),\n\trecoverTextToolCalls: Type.Optional(Type.Boolean()),\n\treasoning: Type.Optional(Type.Boolean()),\n\tthinkingLevelMap: Type.Optional(ThinkingLevelMapSchema),\n\tthinkingLevelMapMode: Type.Optional(Type.Union([Type.Literal(\"merge\"), Type.Literal(\"replace\")])),\n\tinput: Type.Optional(Type.Array(Type.Union([Type.Literal(\"text\"), Type.Literal(\"image\"), Type.Literal(\"video\")]))),\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\tcontextWindow: Type.Optional(Type.Number()),\n\tmaxTokens: Type.Optional(Type.Number()),\n\theaders: Type.Optional(Type.Record(Type.String(), Type.String())),\n\textraBody: Type.Optional(ExtraBodySchema),\n\tcacheRetention: Type.Optional(Type.Union([Type.Literal(\"none\"), Type.Literal(\"short\"), Type.Literal(\"long\")])),\n\tcompat: Type.Optional(ProviderCompatSchema),\n});\n\nconst ProviderConfigSchema = Type.Object({\n\tname: Type.Optional(Type.String({ minLength: 1 })),\n\tdisabled: Type.Optional(Type.Boolean()),\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\textraBody: Type.Optional(ExtraBodySchema),\n\tcacheRetention: Type.Optional(Type.Union([Type.Literal(\"none\"), Type.Literal(\"short\"), Type.Literal(\"long\")])),\n\tcompat: Type.Optional(ProviderCompatSchema),\n\tauthHeader: Type.Optional(Type.Boolean()),\n\twhitelist: Type.Optional(Type.Array(Type.String({ minLength: 1 }))),\n\tblacklist: Type.Optional(Type.Array(Type.String({ minLength: 1 }))),\n\tmodels: Type.Optional(Type.Array(ModelDefinitionSchema)),\n\tmodelOverrides: Type.Optional(Type.Record(Type.String(), ModelOverrideSchema)),\n});\n\nconst ModelsConfigSchema = Type.Object({\n\tdisabledProviders: Type.Optional(Type.Array(Type.String({ minLength: 1 }))),\n\tproviders: Type.Record(Type.String(), ProviderConfigSchema),\n});\nexport const validateModelsConfig = Compile(ModelsConfigSchema);\n\nexport type ModelsJsonModel = Static<typeof ModelDefinitionSchema>;\nexport type ModelsJsonModelOverride = Static<typeof ModelOverrideSchema>;\nexport type ModelsJsonProvider = Static<typeof ProviderConfigSchema>;\nexport type ModelsJson = Static<typeof ModelsConfigSchema>;\n"]}
@@ -12,6 +12,20 @@
12
12
 
13
13
  ### Removed
14
14
 
15
+ ## [2026.8.23] - 2026-08-23
16
+
17
+ ### Breaking Changes
18
+
19
+ ### Added
20
+
21
+ ### Changed
22
+
23
+ ### Fixed
24
+
25
+ - Detached eval cell completion notices no longer enter the user-input steering queue. They were delivered via `sendUserMessage`, so hosts projecting that queue (e.g. the OmO desktop composer) rendered the raw `<system-reminder>Detached eval cell …</system-reminder>` notice under the STEERING heading as if the user had typed and queued it. Notices now deliver via `sendMessage` with `customType: "senpi-codemode:notification"` and `display: false` — model-visible, never painted as user input — matching the terminal and monitor notification contract.
26
+
27
+ ### Removed
28
+
15
29
  ## [2026.8.22-2] - 2026-08-22
16
30
 
17
31
  ### Breaking Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code-yeongyu/senpi-codemode",
3
- "version": "2026.8.22-2",
3
+ "version": "2026.8.23",
4
4
  "private": true,
5
5
  "description": "Source-only senpi extension package for codemode evaluation tools",
6
6
  "type": "module",
@@ -31,14 +31,14 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@babel/parser": "8.0.4",
34
- "@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.8.22-2",
34
+ "@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.8.23",
35
35
  "typebox": "1.3.16"
36
36
  },
37
37
  "peerDependencies": {
38
- "@code-yeongyu/senpi": "2026.8.22-2"
38
+ "@code-yeongyu/senpi": "2026.8.23"
39
39
  },
40
40
  "devDependencies": {
41
- "@code-yeongyu/senpi": "2026.8.22-2"
41
+ "@code-yeongyu/senpi": "2026.8.23"
42
42
  },
43
43
  "keywords": [
44
44
  "senpi",
@@ -3,10 +3,17 @@ import type { EvalDetachedCellNotification, EvalDetachedCellNotifier } from "../
3
3
 
4
4
  const NON_INTERACTIVE_MODES = new Set(["print", "json"]);
5
5
 
6
+ /** Provenance marker for agent-internal detached-cell notices. */
7
+ export const EVAL_NOTIFICATION_CUSTOM_TYPE = "senpi-codemode:notification";
8
+
6
9
  export type EvalNotifyMode = "wake" | "next-turn" | "off";
7
10
 
8
11
  export interface EvalNotifierDeps {
9
- readonly sendUserMessage: (content: string, options?: { deliverAs?: "steer" | "followUp" }) => void;
12
+ /** Deliver a model-visible notification without rendering synthetic user input. */
13
+ readonly sendMessage: (
14
+ message: { customType: string; content: string; display: boolean },
15
+ options: { triggerTurn: boolean; deliverAs: "steer" | "followUp" },
16
+ ) => void;
10
17
  readonly getContext: () => ExtensionContext | undefined;
11
18
  readonly getMode: () => EvalNotifyMode;
12
19
  }
@@ -33,8 +40,13 @@ export class EvalNotifier implements EvalDetachedCellNotifier {
33
40
  const pending = cells.filter((cell) => !this.#notified.has(cell.cellId));
34
41
  if (pending.length === 0) return;
35
42
  for (const cell of pending) this.#notified.add(cell.cellId);
36
- this.#deps.sendUserMessage(pending.map((cell) => cell.content).join("\n\n"), {
37
- deliverAs: mode === "wake" ? "steer" : "followUp",
38
- });
43
+ this.#deps.sendMessage(
44
+ {
45
+ customType: EVAL_NOTIFICATION_CUSTOM_TYPE,
46
+ content: pending.map((cell) => cell.content).join("\n\n"),
47
+ display: false,
48
+ },
49
+ { triggerTurn: true, deliverAs: mode === "wake" ? "steer" : "followUp" },
50
+ );
39
51
  }
40
52
  }
@@ -44,7 +44,10 @@ export interface CodemodeExtensionAPI {
44
44
  executeTool: AgentExecuteTool;
45
45
  getActiveTools(): string[];
46
46
  getAllTools(): readonly EvalSchemaToolInfo[];
47
- sendUserMessage(content: string, options?: { deliverAs?: "steer" | "followUp" }): void;
47
+ sendMessage(
48
+ message: { customType: string; content: string; display: boolean },
49
+ options?: { triggerTurn?: boolean; deliverAs?: "steer" | "followUp" | "nextTurn" },
50
+ ): void;
48
51
  /** Optional host event bus; a host without one turns extension event emission into a harmless no-op. */
49
52
  events?: { emit(name: string, data: unknown): void };
50
53
  /** Optional host RPC surface for forwarding extension-owned events to connected clients. */
@@ -69,7 +72,7 @@ export default function senpiCodemode(pi: CodemodeExtensionAPI, options: SenpiCo
69
72
  let activeContext: ExtensionContext | undefined;
70
73
  let activeCells: EvalDetachedCellManager | undefined;
71
74
  const notifier = new EvalNotifier({
72
- sendUserMessage: (content, notifyOptions) => pi.sendUserMessage(content, notifyOptions),
75
+ sendMessage: (message, notifyOptions) => pi.sendMessage(message, notifyOptions),
73
76
  getContext: () => activeContext,
74
77
  getMode: () => "wake",
75
78
  });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@earendil-works/pi-agent-core",
3
3
  "private": true,
4
- "version": "2026.8.22-2",
4
+ "version": "2026.8.23",
5
5
  "description": "General-purpose agent with transport abstraction, state management, and attachment support",
6
6
  "type": "module",
7
7
  "main": "./dist/index.js",
@@ -36,8 +36,8 @@
36
36
  "prepublishOnly": "npm run build"
37
37
  },
38
38
  "dependencies": {
39
- "@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.8.22-2",
40
- "@earendil-works/pi-telemetry": "npm:@code-yeongyu/senpi-telemetry@2026.8.22-2",
39
+ "@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.8.23",
40
+ "@earendil-works/pi-telemetry": "npm:@code-yeongyu/senpi-telemetry@2026.8.23",
41
41
  "diff": "9.0.0",
42
42
  "ignore": "7.0.6",
43
43
  "typebox": "1.3.16",
@@ -168,8 +168,12 @@ export declare function buildMcpToolDefinitions(tools: Tool[] | undefined): McpT
168
168
  * Build one Cursor system-message JSON blob per system prompt. When no system
169
169
  * prompt is provided, returns a single default greeting so we never emit an
170
170
  * empty `rootPromptMessagesJson` head.
171
+ *
172
+ * Composer models get their operating prefix as its own leading blob rather
173
+ * than concatenated into the host prompt, so Cursor's per-blob prompt cache
174
+ * keeps the prefix stable while the host prompt changes underneath it.
171
175
  */
172
- export declare function buildCursorSystemPromptJsons(systemPrompt: string | undefined): string[];
176
+ export declare function buildCursorSystemPromptJsons(systemPrompt: string | undefined, modelId?: string): string[];
173
177
  /** Exported for tests: decodes Cursor history blobs built from conversation messages. */
174
178
  export declare function buildCursorHistoryForTest(messages: Message[], activeUserMessageIndex?: number): {
175
179
  rootPromptMessagesJson: unknown[];
@@ -1 +1 @@
1
- {"version":3,"file":"cursor-agent.d.ts","sourceRoot":"","sources":["../../src/api/cursor-agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AAIpC,OAAO,KAAK,EAEX,gBAAgB,EAGhB,OAAO,EAEP,mBAAmB,EACnB,cAAc,EACd,WAAW,EACX,eAAe,EACf,IAAI,EACJ,QAAQ,EACR,iBAAiB,EACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAGN,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AA0BvE,OAAO,EAIN,KAAK,kBAAkB,EAcvB,KAAK,0BAA0B,EA+D/B,KAAK,iB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O,CAAC;IACnB,KAAK,EAAE,CAAC,MAAM,GAAG,OAAO,CAAC,EAAE,CAAC;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;CACvB;AAED;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAAC,OAAO,EAAE;IACtD,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,WAAW,CAAC;CACrB,GAAG,OAAO,CAAC,qBAAqB,EAAE,GAAG,IAAI,CAAC,CAqG1C"}
@@ -19,6 +19,7 @@ import { createHash, randomUUID } from "node:crypto";
19
19
  import * as http2 from "node:http2";
20
20
  import { create, fromBinary, fromJson, toBinary, toJson } from "@bufbuild/protobuf";
21
21
  import { ValueSchema } from "@bufbuild/protobuf/wkt";
22
+ import { CURSOR_COMPOSER_PROMPT, isCursorComposerModel } from "../cursor/composer-prompt.js";
22
23
  import { calculateCost } from "../models.js";
23
24
  import { clearStreamingPartialJson, kCursorExecResolved, kStreamingBlockIndex, kStreamingBlockKind, kStreamingEnvelopeId, kStreamingLastParseLen, kStreamingPartialJson, } from "../utils/block-symbols.js";
24
25
  import { AssistantMessageEventStream } from "../utils/event-stream.js";
@@ -3024,13 +3025,20 @@ function findLastUserMessageIndex(messages) {
3024
3025
  * Build one Cursor system-message JSON blob per system prompt. When no system
3025
3026
  * prompt is provided, returns a single default greeting so we never emit an
3026
3027
  * empty `rootPromptMessagesJson` head.
3028
+ *
3029
+ * Composer models get their operating prefix as its own leading blob rather
3030
+ * than concatenated into the host prompt, so Cursor's per-blob prompt cache
3031
+ * keeps the prefix stable while the host prompt changes underneath it.
3027
3032
  */
3028
- export function buildCursorSystemPromptJsons(systemPrompt) {
3033
+ export function buildCursorSystemPromptJsons(systemPrompt, modelId) {
3029
3034
  const trimmed = systemPrompt?.trim();
3030
- if (!trimmed) {
3031
- return [JSON.stringify({ role: "system", content: "You are a helpful assistant." })];
3035
+ const host = trimmed
3036
+ ? [JSON.stringify({ role: "system", content: trimmed })]
3037
+ : [JSON.stringify({ role: "system", content: "You are a helpful assistant." })];
3038
+ if (modelId !== undefined && isCursorComposerModel(modelId)) {
3039
+ return [JSON.stringify({ role: "system", content: CURSOR_COMPOSER_PROMPT }), ...host];
3032
3040
  }
3033
- return [JSON.stringify({ role: "system", content: trimmed })];
3041
+ return host;
3034
3042
  }
3035
3043
  /**
3036
3044
  * Build `ConversationStateStructure.rootPromptMessagesJson` blob IDs for the
@@ -3316,7 +3324,7 @@ function extractImages(content) {
3316
3324
  }
3317
3325
  async function buildGrpcRequest(model, context, options, state) {
3318
3326
  const blobStore = state.blobStore;
3319
- const systemPromptIds = buildCursorSystemPromptJsons(context.systemPrompt).map((json) => storeCursorBlob(blobStore, new TextEncoder().encode(json)));
3327
+ const systemPromptIds = buildCursorSystemPromptJsons(context.systemPrompt, model.id).map((json) => storeCursorBlob(blobStore, new TextEncoder().encode(json)));
3320
3328
  const activeUserMessageIndex = context.messages.length - 1;
3321
3329
  const activeMessage = context.messages[activeUserMessageIndex];
3322
3330
  const activeUserMessage = activeMessage?.role === "user" ? activeMessage : undefined;