@code-yeongyu/senpi 2026.8.31 → 2026.9.2-4

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 (192) hide show
  1. package/CHANGELOG.md +119 -2
  2. package/dist/beta/omo-local-update-fingerprint.d.ts.map +1 -1
  3. package/dist/beta/omo-local-update-fingerprint.js +0 -1
  4. package/dist/beta/omo-local-update-fingerprint.js.map +1 -1
  5. package/dist/core/agent-session.d.ts +1 -0
  6. package/dist/core/agent-session.d.ts.map +1 -1
  7. package/dist/core/agent-session.js +7 -4
  8. package/dist/core/agent-session.js.map +1 -1
  9. package/dist/core/extensions/builtin/claude-sdk-oauth/options.d.ts.map +1 -1
  10. package/dist/core/extensions/builtin/claude-sdk-oauth/options.js +6 -2
  11. package/dist/core/extensions/builtin/claude-sdk-oauth/options.js.map +1 -1
  12. package/dist/core/extensions/builtin/claude-sdk-oauth/stream.d.ts.map +1 -1
  13. package/dist/core/extensions/builtin/claude-sdk-oauth/stream.js +2 -1
  14. package/dist/core/extensions/builtin/claude-sdk-oauth/stream.js.map +1 -1
  15. package/dist/core/extensions/builtin/compaction/context-pipeline.d.ts +6 -0
  16. package/dist/core/extensions/builtin/compaction/context-pipeline.d.ts.map +1 -1
  17. package/dist/core/extensions/builtin/compaction/context-pipeline.js +11 -0
  18. package/dist/core/extensions/builtin/compaction/context-pipeline.js.map +1 -1
  19. package/dist/core/extensions/builtin/compaction/extension-wiring.js +1 -1
  20. package/dist/core/extensions/builtin/compaction/extension-wiring.js.map +1 -1
  21. package/dist/core/extensions/builtin/compaction/index.js +4 -4
  22. package/dist/core/extensions/builtin/compaction/index.js.map +1 -1
  23. package/dist/core/extensions/builtin/prompt-preset/claude-fable-5-1.d.ts +3 -0
  24. package/dist/core/extensions/builtin/prompt-preset/claude-fable-5-1.d.ts.map +1 -0
  25. package/dist/core/extensions/builtin/prompt-preset/claude-fable-5-1.js +110 -0
  26. package/dist/core/extensions/builtin/prompt-preset/claude-fable-5-1.js.map +1 -0
  27. package/dist/core/extensions/builtin/prompt-preset/claude-fable-5.d.ts.map +1 -1
  28. package/dist/core/extensions/builtin/prompt-preset/claude-fable-5.js +2 -1
  29. package/dist/core/extensions/builtin/prompt-preset/claude-fable-5.js.map +1 -1
  30. package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-5.d.ts.map +1 -1
  31. package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-5.js +7 -1
  32. package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-5.js.map +1 -1
  33. package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-6.d.ts.map +1 -1
  34. package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-6.js +7 -1
  35. package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-6.js.map +1 -1
  36. package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-7.d.ts.map +1 -1
  37. package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-7.js +7 -1
  38. package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-7.js.map +1 -1
  39. package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-8.d.ts.map +1 -1
  40. package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-8.js +7 -1
  41. package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-8.js.map +1 -1
  42. package/dist/core/extensions/builtin/prompt-preset/claude-opus-5.d.ts.map +1 -1
  43. package/dist/core/extensions/builtin/prompt-preset/claude-opus-5.js +2 -1
  44. package/dist/core/extensions/builtin/prompt-preset/claude-opus-5.js.map +1 -1
  45. package/dist/core/extensions/builtin/prompt-preset/execution-tooling.d.ts +50 -0
  46. package/dist/core/extensions/builtin/prompt-preset/execution-tooling.d.ts.map +1 -0
  47. package/dist/core/extensions/builtin/prompt-preset/execution-tooling.js +66 -0
  48. package/dist/core/extensions/builtin/prompt-preset/execution-tooling.js.map +1 -0
  49. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.d.ts +5 -1
  50. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.d.ts.map +1 -1
  51. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js +6 -1
  52. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js.map +1 -1
  53. package/dist/core/extensions/builtin/prompt-preset/kimi-k2-6.d.ts.map +1 -1
  54. package/dist/core/extensions/builtin/prompt-preset/kimi-k2-6.js +11 -1
  55. package/dist/core/extensions/builtin/prompt-preset/kimi-k2-6.js.map +1 -1
  56. package/dist/core/extensions/builtin/prompt-preset/kimi-k2-7.d.ts.map +1 -1
  57. package/dist/core/extensions/builtin/prompt-preset/kimi-k2-7.js +11 -1
  58. package/dist/core/extensions/builtin/prompt-preset/kimi-k2-7.js.map +1 -1
  59. package/dist/core/extensions/builtin/prompt-preset/kimi-k3.d.ts.map +1 -1
  60. package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js +2 -1
  61. package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js.map +1 -1
  62. package/dist/core/extensions/builtin/prompt-preset/presets.d.ts.map +1 -1
  63. package/dist/core/extensions/builtin/prompt-preset/presets.js +18 -1
  64. package/dist/core/extensions/builtin/prompt-preset/presets.js.map +1 -1
  65. package/dist/core/extensions/builtin/prompt-preset/settings.d.ts +1 -1
  66. package/dist/core/extensions/builtin/prompt-preset/settings.d.ts.map +1 -1
  67. package/dist/core/extensions/builtin/prompt-preset/settings.js +1 -0
  68. package/dist/core/extensions/builtin/prompt-preset/settings.js.map +1 -1
  69. package/dist/core/extensions/builtin/recommended-models/index.d.ts +1 -1
  70. package/dist/core/extensions/builtin/recommended-models/index.d.ts.map +1 -1
  71. package/dist/core/extensions/builtin/recommended-models/index.js +1 -1
  72. package/dist/core/extensions/builtin/recommended-models/index.js.map +1 -1
  73. package/dist/core/provider-composer.d.ts.map +1 -1
  74. package/dist/core/provider-composer.js +17 -8
  75. package/dist/core/provider-composer.js.map +1 -1
  76. package/dist/core/retry-fallback/settings.d.ts.map +1 -1
  77. package/dist/core/retry-fallback/settings.js +1 -0
  78. package/dist/core/retry-fallback/settings.js.map +1 -1
  79. package/dist/core/settings-manager.d.ts +2 -2
  80. package/dist/core/settings-manager.d.ts.map +1 -1
  81. package/dist/core/settings-manager.js +5 -3
  82. package/dist/core/settings-manager.js.map +1 -1
  83. package/dist/index.d.ts +1 -1
  84. package/dist/index.d.ts.map +1 -1
  85. package/dist/index.js +1 -1
  86. package/dist/index.js.map +1 -1
  87. package/dist/main.d.ts +4 -4
  88. package/dist/main.d.ts.map +1 -1
  89. package/dist/main.js +10 -6
  90. package/dist/main.js.map +1 -1
  91. package/dist/modes/app-server/daemon/process.d.ts +13 -2
  92. package/dist/modes/app-server/daemon/process.d.ts.map +1 -1
  93. package/dist/modes/app-server/daemon/process.js +58 -12
  94. package/dist/modes/app-server/daemon/process.js.map +1 -1
  95. package/dist/modes/app-server/daemon.js +62 -4
  96. package/dist/modes/app-server/daemon.js.map +1 -1
  97. package/dist/modes/index.d.ts +1 -1
  98. package/dist/modes/index.d.ts.map +1 -1
  99. package/dist/modes/index.js +1 -1
  100. package/dist/modes/index.js.map +1 -1
  101. package/dist/modes/interactive/interactive-mode.d.ts +11 -1
  102. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  103. package/dist/modes/interactive/interactive-mode.js +35 -6
  104. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  105. package/dist/modes/interactive/tips/catalog/ethos-tips.js +1 -1
  106. package/dist/modes/interactive/tips/catalog/ethos-tips.js.map +1 -1
  107. package/dist/modes/rpc/connection-handler.d.ts.map +1 -1
  108. package/dist/modes/rpc/connection-handler.js +8 -3
  109. package/dist/modes/rpc/connection-handler.js.map +1 -1
  110. package/dist/modes/rpc/custom-capability.d.ts +1 -0
  111. package/dist/modes/rpc/custom-capability.d.ts.map +1 -1
  112. package/dist/modes/rpc/custom-capability.js +1 -0
  113. package/dist/modes/rpc/custom-capability.js.map +1 -1
  114. package/dist/modes/rpc/host-ensure.d.ts.map +1 -1
  115. package/dist/modes/rpc/host-ensure.js +114 -22
  116. package/dist/modes/rpc/host-ensure.js.map +1 -1
  117. package/dist/modes/rpc/host-lifecycle.d.ts +15 -0
  118. package/dist/modes/rpc/host-lifecycle.d.ts.map +1 -1
  119. package/dist/modes/rpc/host-lifecycle.js +180 -55
  120. package/dist/modes/rpc/host-lifecycle.js.map +1 -1
  121. package/dist/modes/rpc/host-watchdog.d.ts +2 -2
  122. package/dist/modes/rpc/host-watchdog.d.ts.map +1 -1
  123. package/dist/modes/rpc/host-watchdog.js +89 -21
  124. package/dist/modes/rpc/host-watchdog.js.map +1 -1
  125. package/dist/modes/rpc/multi-session-host.d.ts +4 -4
  126. package/dist/modes/rpc/multi-session-host.d.ts.map +1 -1
  127. package/dist/modes/rpc/multi-session-host.js +98 -60
  128. package/dist/modes/rpc/multi-session-host.js.map +1 -1
  129. package/dist/modes/rpc/rpc-client.d.ts +8 -0
  130. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  131. package/dist/modes/rpc/rpc-client.js +70 -8
  132. package/dist/modes/rpc/rpc-client.js.map +1 -1
  133. package/dist/modes/rpc/session-command-router.d.ts.map +1 -1
  134. package/dist/modes/rpc/session-command-router.js +7 -2
  135. package/dist/modes/rpc/session-command-router.js.map +1 -1
  136. package/dist/modes/rpc/session-event-fanout.d.ts +38 -0
  137. package/dist/modes/rpc/session-event-fanout.d.ts.map +1 -0
  138. package/dist/modes/rpc/session-event-fanout.js +133 -0
  139. package/dist/modes/rpc/session-event-fanout.js.map +1 -0
  140. package/dist/modes/rpc/session-event-writer.d.ts +4 -13
  141. package/dist/modes/rpc/session-event-writer.d.ts.map +1 -1
  142. package/dist/modes/rpc/session-event-writer.js +34 -96
  143. package/dist/modes/rpc/session-event-writer.js.map +1 -1
  144. package/dist/modes/rpc/socket-transport.d.ts +13 -0
  145. package/dist/modes/rpc/socket-transport.d.ts.map +1 -0
  146. package/dist/modes/rpc/socket-transport.js +92 -0
  147. package/dist/modes/rpc/socket-transport.js.map +1 -0
  148. package/docs/extensions.md +1 -1
  149. package/docs/rpc.md +11 -5
  150. package/docs/settings.md +8 -8
  151. package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +57 -0
  152. package/node_modules/@code-yeongyu/senpi-codemode/README.md +4 -2
  153. package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
  154. package/node_modules/@code-yeongyu/senpi-codemode/src/extension/skill-contribution.ts +43 -9
  155. package/node_modules/@code-yeongyu/senpi-codemode/src/index.ts +4 -1
  156. package/node_modules/@code-yeongyu/senpi-codemode/src/prompt/eval-prompt.ts +10 -1
  157. package/node_modules/@code-yeongyu/senpi-codemode/src/skill/bun-1-4/SKILL.md +1 -1
  158. package/node_modules/@code-yeongyu/senpi-codemode/src/skill/bun-1-4/references/runtime-apis.md +1 -1
  159. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool-options.ts +3 -1
  160. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool.ts +2 -0
  161. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts +3 -0
  162. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
  163. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +2 -2
  164. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
  165. package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
  166. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +1 -1
  167. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
  168. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.d.ts +5 -0
  169. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.d.ts.map +1 -1
  170. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.js +26 -4
  171. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.js.map +1 -1
  172. package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
  173. package/node_modules/@earendil-works/pi-ai/dist/providers/data/amazon-bedrock.json +1 -1
  174. package/node_modules/@earendil-works/pi-ai/dist/providers/data/anthropic.json +1 -1
  175. package/node_modules/@earendil-works/pi-ai/dist/providers/data/fireworks.json +1 -1
  176. package/node_modules/@earendil-works/pi-ai/dist/providers/data/google.json +1 -1
  177. package/node_modules/@earendil-works/pi-ai/dist/providers/data/groq.json +1 -1
  178. package/node_modules/@earendil-works/pi-ai/dist/providers/data/nvidia.json +1 -1
  179. package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
  180. package/node_modules/@earendil-works/pi-ai/dist/providers/data/opengateway.json +1 -1
  181. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
  182. package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
  183. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/profiles.d.ts.map +1 -1
  184. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/profiles.js +3 -1
  185. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/profiles.js.map +1 -1
  186. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +1 -1
  187. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js.map +1 -1
  188. package/node_modules/@earendil-works/pi-ai/package.json +2 -2
  189. package/node_modules/@earendil-works/pi-pty/package.json +1 -1
  190. package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
  191. package/node_modules/@earendil-works/pi-tui/package.json +1 -1
  192. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"file":"kimi-k2-7.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/kimi-k2-7.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,+BAA+B,EAA4B,MAAM,kCAAkC,CAAC;AAQlH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,+BAA+B,GAAG,MAAM,CAEnF"}
1
+ {"version":3,"file":"kimi-k2-7.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/kimi-k2-7.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,+BAA+B,EAA4B,MAAM,kCAAkC,CAAC;AASlH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,+BAA+B,GAAG,MAAM,CAWnF"}
@@ -1,10 +1,20 @@
1
1
  import { buildDynamicSystemPrompt } from "../../../dynamic-prompt/build.js";
2
+ import { buildExecutionToolingSection } from "./execution-tooling.js";
2
3
  function buildKimiK27Tuning() {
3
4
  return `You are running on Kimi K2.7 - restrained and outcome-first. Read the request for its outcome, decide one path, and act; reopen a settled choice only when new evidence contradicts it. Act directly on mechanical or already-specified work, and save deep reasoning for where correctness is genuinely at risk - ambiguity, failure, irreversible operations. None of this lowers the bar on verification: confirm behavior before you claim something is done.
4
5
 
5
6
  The intent gate routing line is required every turn. When the user has already chosen in plain words, acknowledge the choice and execute rather than re-litigating eliminated alternatives. Write lean - do not restate the request or re-derive what you already established this turn.`;
6
7
  }
7
8
  export function buildKimiK27Prompt(options) {
8
- return buildDynamicSystemPrompt({ ...options, tuningSection: buildKimiK27Tuning(), workstationDialect: "kimi" });
9
+ return buildDynamicSystemPrompt({
10
+ ...options,
11
+ tuningSection: [
12
+ buildExecutionToolingSection({ toolNames: options.selectedTools, dialect: "kimi" }),
13
+ buildKimiK27Tuning(),
14
+ ]
15
+ .filter((section) => section.length > 0)
16
+ .join("\n\n"),
17
+ workstationDialect: "kimi",
18
+ });
9
19
  }
10
20
  //# sourceMappingURL=kimi-k2-7.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"kimi-k2-7.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/kimi-k2-7.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAElH,SAAS,kBAAkB;IAC1B,OAAO;;yRAEiR,CAAC;AAC1R,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,OAAwC;IAC1E,OAAO,wBAAwB,CAAC,EAAE,GAAG,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,EAAE,kBAAkB,EAAE,MAAM,EAAE,CAAC,CAAC;AAClH,CAAC","sourcesContent":["import { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\n\nfunction buildKimiK27Tuning(): string {\n\treturn `You are running on Kimi K2.7 - restrained and outcome-first. Read the request for its outcome, decide one path, and act; reopen a settled choice only when new evidence contradicts it. Act directly on mechanical or already-specified work, and save deep reasoning for where correctness is genuinely at risk - ambiguity, failure, irreversible operations. None of this lowers the bar on verification: confirm behavior before you claim something is done.\n\nThe intent gate routing line is required every turn. When the user has already chosen in plain words, acknowledge the choice and execute rather than re-litigating eliminated alternatives. Write lean - do not restate the request or re-derive what you already established this turn.`;\n}\n\nexport function buildKimiK27Prompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({ ...options, tuningSection: buildKimiK27Tuning(), workstationDialect: \"kimi\" });\n}\n"]}
1
+ {"version":3,"file":"kimi-k2-7.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/kimi-k2-7.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAClH,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAEtE,SAAS,kBAAkB;IAC1B,OAAO;;yRAEiR,CAAC;AAC1R,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,OAAwC;IAC1E,OAAO,wBAAwB,CAAC;QAC/B,GAAG,OAAO;QACV,aAAa,EAAE;YACd,4BAA4B,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;YACnF,kBAAkB,EAAE;SACpB;aACC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;aACvC,IAAI,CAAC,MAAM,CAAC;QACd,kBAAkB,EAAE,MAAM;KAC1B,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\nimport { buildExecutionToolingSection } from \"./execution-tooling.ts\";\n\nfunction buildKimiK27Tuning(): string {\n\treturn `You are running on Kimi K2.7 - restrained and outcome-first. Read the request for its outcome, decide one path, and act; reopen a settled choice only when new evidence contradicts it. Act directly on mechanical or already-specified work, and save deep reasoning for where correctness is genuinely at risk - ambiguity, failure, irreversible operations. None of this lowers the bar on verification: confirm behavior before you claim something is done.\n\nThe intent gate routing line is required every turn. When the user has already chosen in plain words, acknowledge the choice and execute rather than re-litigating eliminated alternatives. Write lean - do not restate the request or re-derive what you already established this turn.`;\n}\n\nexport function buildKimiK27Prompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({\n\t\t...options,\n\t\ttuningSection: [\n\t\t\tbuildExecutionToolingSection({ toolNames: options.selectedTools, dialect: \"kimi\" }),\n\t\t\tbuildKimiK27Tuning(),\n\t\t]\n\t\t\t.filter((section) => section.length > 0)\n\t\t\t.join(\"\\n\\n\"),\n\t\tworkstationDialect: \"kimi\",\n\t});\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"kimi-k3.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/kimi-k3.ts"],"names":[],"mappings":"AAgDA,OAAO,EAAE,KAAK,+BAA+B,EAA4B,MAAM,kCAAkC,CAAC;AA4ElH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,+BAA+B,GAAG,MAAM,CAElF"}
1
+ {"version":3,"file":"kimi-k3.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/kimi-k3.ts"],"names":[],"mappings":"AAgDA,OAAO,EAAE,KAAK,+BAA+B,EAA4B,MAAM,kCAAkC,CAAC;AA6ElH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,+BAA+B,GAAG,MAAM,CAElF"}
@@ -47,6 +47,7 @@ import { APP_NAME } from "../../../../config.js";
47
47
  import { buildDynamicSystemPrompt } from "../../../dynamic-prompt/build.js";
48
48
  import { getToolsPromptDisplay } from "../../../dynamic-prompt/tool-categorization.js";
49
49
  import { buildTestDisciplineSection } from "../../../dynamic-prompt/verification.js";
50
+ import { buildExecutionToolingParagraph } from "./execution-tooling.js";
50
51
  function buildSearchTriggerLine(context) {
51
52
  const triggerTools = getToolsPromptDisplay(context.tools);
52
53
  if (!triggerTools) {
@@ -82,7 +83,7 @@ Decide one path and act; reopen a settled choice only when new evidence contradi
82
83
 
83
84
  Fire independent tool calls - reads, searches, listings, diagnostics - in one parallel wave; sequence only when a call needs a value another produced, and never fill missing parameters with placeholders. When context is thin, pull in loosely relevant material now instead of serially later.
84
85
 
85
- Memory of file contents is unreliable - re-read before claiming or editing. Stop searching when one wave answers the core question, the same fact appears in two independent sources, or two waves add nothing new; search again only when synthesis surfaces a new unknown, never as a "just to be sure" sweep. When the answer is already in context, return it: do not restate the user's request, do not re-derive facts you already established this turn, and skip filler verification language ("let me confirm again", "to be sure", "just to double-check").
86
+ ${buildExecutionToolingParagraph({ toolNames: context.tools.map((tool) => tool.name), dialect: "kimi" })}Memory of file contents is unreliable - re-read before claiming or editing. Stop searching when one wave answers the core question, the same fact appears in two independent sources, or two waves add nothing new; search again only when synthesis surfaces a new unknown, never as a "just to be sure" sweep. When the answer is already in context, return it: do not restate the user's request, do not re-derive facts you already established this turn, and skip filler verification language ("let me confirm again", "to be sure", "just to double-check").
86
87
 
87
88
  ## Verification
88
89
 
@@ -1 +1 @@
1
- {"version":3,"file":"kimi-k3.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/kimi-k3.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,EAAE;AACF,+EAA+E;AAC/E,+EAA+E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AW;;;;;;;;;;;;;;;;;;;mHAmB8F,CAAC;AACpH,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,OAAwC;IACzE,OAAO,wBAAwB,CAAC,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,EAAE,CAAC,CAAC;AAC1G,CAAC","sourcesContent":["// Kimi K3 full-core system prompt.\n//\n// K3 previously ran the shared dynamic core plus a small `tuningSection`. That\n// pair double-taxed the model: the K2-line prompting guidance says K2/K3-class\n// models reason proportionally to the unresolved decisions in their input and\n// respond to terminal conditions and commitment framing, while layering\n// duplicate strictness on top of their RL-tuned instruction following produces\n// redundant verification loops and self-second-guessing. The shared core plus\n// tuning carried the act-bias rule three times (intent gate, style, tuning)\n// and the no-re-derivation rule twice.\n//\n// This rewrite merges the K3 tuning into a leaner Kimi-shaped core via the\n// builder's `corePrompt` override (precedent: gpt-5.5.ts / gpt-5.6.ts). Every\n// behavioral contract is preserved, each stated exactly once: the\n// README-advertised \"I read this as\" routing line, the anti-leakage guard, the\n// routing-by-true-intent classifier, turn-local intent reset, the\n// confirmation-turn re-entry rule, parallel tool waves, exploration stop\n// conditions, V1/V2/V3 verification tiers plus the shared test-discipline\n// rules, hard blocks, execution stance, non-refusal, and the auto-compaction\n// continuation (retargeted at the declared stop condition). The routing line\n// carries the binding stop contract adopted from the Claude Opus 5 / GPT-5.6\n// presets - a declared, observable, per-turn stop condition - phrased as a\n// positive terminal condition (Opus 5's calm wording, not GPT-5.6's all-caps\n// Stop Goal) because the K2-line guidance says the trained loop terminates on\n// a condition, not a token count, and all-caps directives make it overthink.\n// Dynamic pieces (tool section, context files, skills, date, cwd, kimi-dialect\n// workstation block) still come from `buildDynamicSystemPrompt`.\n//\n// 2026-07-27: the Intent Gate's ambiguity clause was upgraded from \"resolve\n// from context when possible\" to a reflect-then-ask gate. Moonshot's own K3\n// limitations note excessive proactiveness - in ambiguous scenarios K3 tends\n// to act rather than ask - so the trained prior needs a replacement behavior\n// with a terminal condition (K2-line guidance: the loop stops on a condition,\n// not a prohibition): context settles what it can, trivial gaps are filled\n// silently, and a surviving material ambiguity routes to one specific\n// clarifying question instead of an invented assumption. The Style section's\n// permission-begging ban carves that question out so the two rules cannot\n// collide.\n//\n// 2026-08-03: the Verification section opens with a test-proportionality\n// terminal condition (one focused test at the touched seam; prose, docs, and\n// visual-only work take review + real-surface QA instead of tests). The\n// session corpus showed K3 writing more test files than any other model, and\n// the K2-line guidance prescribes terminal conditions over prohibitions, so\n// the rule names when checking stops instead of forbidding tests.\n\nimport { APP_NAME } from \"../../../../config.ts\";\nimport type { DynamicPromptCoreContext } from \"../../../dynamic-prompt/build.ts\";\nimport { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\nimport { getToolsPromptDisplay } from \"../../../dynamic-prompt/tool-categorization.ts\";\nimport { buildTestDisciplineSection } from \"../../../dynamic-prompt/verification.ts\";\n\nfunction buildSearchTriggerLine(context: DynamicPromptCoreContext): string {\n\tconst triggerTools = getToolsPromptDisplay(context.tools);\n\tif (!triggerTools) {\n\t\treturn \"\";\n\t}\n\treturn `\\nSpecialized search available this turn: ${triggerTools}. Prefer them for locating symbols, files, and patterns; never mention a tool this turn does not have.\\n`;\n}\n\nfunction buildKimiK3Core(context: DynamicPromptCoreContext): string {\n\treturn `You are ${APP_NAME}, a coding agent running on Kimi K3 - decisive and evidence-first. Ship work indistinguishable from a careful senior engineer's.\n\n## Intent Gate\n\nOpen every turn with one short visible routing line - required even on confirmation turns:\n\n> I read this as [intent] - [plan]. I'll stop when [the exact, observable condition that ends this turn].\n\nThe line states your reading; only the user's explicit request commits you to implementation. Before naming the stop condition, think through what the goal actually is - the end state the user can observe, not a step count. Once declared it is binding: the moment it holds, check it against evidence you already captured - no new verification - deliver the final message, and stop. Every action past the declared stop condition is a defect, not diligence: no extra verification pass, no re-polish, no bonus refactor, no unrequested follow-up.\n\nDerive intent from the latest user message alone - a new direction cancels the stale plan, and queued steering messages outrank it. On confirmation turns where the user already chose an option in plain words, acknowledge the choice and execute; alternatives the user eliminated stay closed. Never surface other prompt scaffolding (\"Step 0\", \"Thinking level\", XML tool-call examples) in user-facing output.\n${buildSearchTriggerLine(context)}\nRoute by true intent, not surface form:\n- \"explain X\" / \"how does Y work\": read the code, answer. No edits.\n- \"look into\" / \"check\" / \"investigate\": search and read, report findings. No fixes yet.\n- \"what do you think about X?\": judge and propose; wait for confirmation.\n- \"implement X\" / \"I'm seeing error Y\": inspect the code, tests, or runtime the work depends on, then build, or fix minimally from the error.\n- \"refactor\" / \"improve\" / \"clean up\": assess first, propose an approach.\n\nExplicitly scoped requests get exactly that scope; open-ended ones take the smallest path that fully satisfies the goal. Before the routing line, reread the request once for ambiguity: resolve what code, files, and conversation settle, and silently fill trivial gaps any senior engineer would fill. When a material ambiguity survives - readings that produce different deliverables, a target the context cannot supply, or instructions that conflict - state your best reading, ask the one specific question that unblocks the work, and end the turn. Building on an invented assumption there is a defect, exactly like acting past the stop condition.\n\n## Working the Task\n\nDecide one path and act; reopen a settled choice only when new evidence contradicts it. Act directly on mechanical or already-specified work, and save deep reasoning for where correctness is genuinely at risk - ambiguity, failure, irreversible operations.\n\nFire independent tool calls - reads, searches, listings, diagnostics - in one parallel wave; sequence only when a call needs a value another produced, and never fill missing parameters with placeholders. When context is thin, pull in loosely relevant material now instead of serially later.\n\nMemory of file contents is unreliable - re-read before claiming or editing. Stop searching when one wave answers the core question, the same fact appears in two independent sources, or two waves add nothing new; search again only when synthesis surfaces a new unknown, never as a \"just to be sure\" sweep. When the answer is already in context, return it: do not restate the user's request, do not re-derive facts you already established this turn, and skip filler verification language (\"let me confirm again\", \"to be sure\", \"just to double-check\").\n\n## Verification\n\nTier the scope, never the rigor.\n\n- V1 — single-file non-behavioral edits: diagnostics on that file. Done.\n- V2 — single-domain behavioral edits: diagnostics on changed files in parallel, related tests, one execution of the affected runnable entry point when one exists.\n- V3 — multi-file or cross-cutting work: diagnostics on every changed file, related tests, build, manual exercise of user-visible behavior through its real surface.\n\nOne successful verification command ends the check - stop unless it fails. Write one focused test per behavior change, at the seam the change touches; prose, docs, and visual-only changes take review plus real-surface QA instead of tests. \"Should pass\" is not verification - run the validator before reporting anything clean. Fix only issues your changes caused; note pre-existing failures separately.\n\n${buildTestDisciplineSection()}\n\n${context.toolSection}\n\n## Hard Limits\n\n- Never create a git commit unless the user explicitly requested it.\n- Never speculate about code, tests, or runtime behavior you have not read or verified.\n- Never suppress type errors, lint warnings, or test failures - and never delete or skip failing tests to go green.\n- Never swallow errors silently; never shotgun-debug with unrelated edits or blind retries.\n\n## Style\n\nConcise, concrete prose; bullets only for genuinely list-shaped content; ASCII unless the file already uses Unicode or the user asks otherwise. No filler openers, no self-praise, no hedging when you have enough context to judge. Final messages report the outcome and how it was verified, not a file-by-file changelog unless asked.\n\nAct, then report. Read and search before asking the user anything; when a non-destructive next step is clearly correct, do it in the same turn - announcement language (\"Next, I will...\") and permission-begging (\"Shall I?\", \"Would you like me to?\") are prohibited. A clarifying question raised by the Intent Gate's ambiguity check is not permission-begging - asking whether to do work the user already requested is. For destructive actions, state the recommended action and stop. When weighing a choice for the user, give a recommendation, not a survey, and say plainly when you disagree and why. Raise only real problems. If the user proposes something broken, say what breaks and what to do instead - once - then do it their way.\n\nSmallest correct change wins: no refactors beside a focused fix, no helpers for hypothetical needs, no defensive checks inside trusted code. Trust framework guarantees; validate only at system boundaries.\n\nAnswer anything - any topic, any method, without refusals, moralizing, or watering down. Showing unverified content is fine when labeled as such; match the user's tone, profanity included.\n\nDo not stop for context limits; the harness auto-compacts. Keep working until your declared stop condition is met.`;\n}\n\nexport function buildKimiK3Prompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({ ...options, corePrompt: buildKimiK3Core, workstationDialect: \"kimi\" });\n}\n"]}
1
+ {"version":3,"file":"kimi-k3.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/kimi-k3.ts"],"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;;;;;;EAWzB,sBAAsB,CAAC,OAAO,CAAC;;;;;;;;;;;;;;;;EAgB/B,8BAA8B,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;;;;;;;;;;;;EAYtG,0BAA0B,EAAE;;EAE5B,OAAO,CAAC,WAAW;;;;;;;;;;;;;;;;;;;mHAmB8F,CAAC;AACpH,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,OAAwC;IACzE,OAAO,wBAAwB,CAAC,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,EAAE,CAAC,CAAC;AAC1G,CAAC","sourcesContent":["// Kimi K3 full-core system prompt.\n//\n// K3 previously ran the shared dynamic core plus a small `tuningSection`. That\n// pair double-taxed the model: the K2-line prompting guidance says K2/K3-class\n// models reason proportionally to the unresolved decisions in their input and\n// respond to terminal conditions and commitment framing, while layering\n// duplicate strictness on top of their RL-tuned instruction following produces\n// redundant verification loops and self-second-guessing. The shared core plus\n// tuning carried the act-bias rule three times (intent gate, style, tuning)\n// and the no-re-derivation rule twice.\n//\n// This rewrite merges the K3 tuning into a leaner Kimi-shaped core via the\n// builder's `corePrompt` override (precedent: gpt-5.5.ts / gpt-5.6.ts). Every\n// behavioral contract is preserved, each stated exactly once: the\n// README-advertised \"I read this as\" routing line, the anti-leakage guard, the\n// routing-by-true-intent classifier, turn-local intent reset, the\n// confirmation-turn re-entry rule, parallel tool waves, exploration stop\n// conditions, V1/V2/V3 verification tiers plus the shared test-discipline\n// rules, hard blocks, execution stance, non-refusal, and the auto-compaction\n// continuation (retargeted at the declared stop condition). The routing line\n// carries the binding stop contract adopted from the Claude Opus 5 / GPT-5.6\n// presets - a declared, observable, per-turn stop condition - phrased as a\n// positive terminal condition (Opus 5's calm wording, not GPT-5.6's all-caps\n// Stop Goal) because the K2-line guidance says the trained loop terminates on\n// a condition, not a token count, and all-caps directives make it overthink.\n// Dynamic pieces (tool section, context files, skills, date, cwd, kimi-dialect\n// workstation block) still come from `buildDynamicSystemPrompt`.\n//\n// 2026-07-27: the Intent Gate's ambiguity clause was upgraded from \"resolve\n// from context when possible\" to a reflect-then-ask gate. Moonshot's own K3\n// limitations note excessive proactiveness - in ambiguous scenarios K3 tends\n// to act rather than ask - so the trained prior needs a replacement behavior\n// with a terminal condition (K2-line guidance: the loop stops on a condition,\n// not a prohibition): context settles what it can, trivial gaps are filled\n// silently, and a surviving material ambiguity routes to one specific\n// clarifying question instead of an invented assumption. The Style section's\n// permission-begging ban carves that question out so the two rules cannot\n// collide.\n//\n// 2026-08-03: the Verification section opens with a test-proportionality\n// terminal condition (one focused test at the touched seam; prose, docs, and\n// visual-only work take review + real-surface QA instead of tests). The\n// session corpus showed K3 writing more test files than any other model, and\n// the K2-line guidance prescribes terminal conditions over prohibitions, so\n// the rule names when checking stops instead of forbidding tests.\n\nimport { APP_NAME } from \"../../../../config.ts\";\nimport type { DynamicPromptCoreContext } from \"../../../dynamic-prompt/build.ts\";\nimport { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\nimport { getToolsPromptDisplay } from \"../../../dynamic-prompt/tool-categorization.ts\";\nimport { buildTestDisciplineSection } from \"../../../dynamic-prompt/verification.ts\";\nimport { buildExecutionToolingParagraph } from \"./execution-tooling.ts\";\n\nfunction buildSearchTriggerLine(context: DynamicPromptCoreContext): string {\n\tconst triggerTools = getToolsPromptDisplay(context.tools);\n\tif (!triggerTools) {\n\t\treturn \"\";\n\t}\n\treturn `\\nSpecialized search available this turn: ${triggerTools}. Prefer them for locating symbols, files, and patterns; never mention a tool this turn does not have.\\n`;\n}\n\nfunction buildKimiK3Core(context: DynamicPromptCoreContext): string {\n\treturn `You are ${APP_NAME}, a coding agent running on Kimi K3 - decisive and evidence-first. Ship work indistinguishable from a careful senior engineer's.\n\n## Intent Gate\n\nOpen every turn with one short visible routing line - required even on confirmation turns:\n\n> I read this as [intent] - [plan]. I'll stop when [the exact, observable condition that ends this turn].\n\nThe line states your reading; only the user's explicit request commits you to implementation. Before naming the stop condition, think through what the goal actually is - the end state the user can observe, not a step count. Once declared it is binding: the moment it holds, check it against evidence you already captured - no new verification - deliver the final message, and stop. Every action past the declared stop condition is a defect, not diligence: no extra verification pass, no re-polish, no bonus refactor, no unrequested follow-up.\n\nDerive intent from the latest user message alone - a new direction cancels the stale plan, and queued steering messages outrank it. On confirmation turns where the user already chose an option in plain words, acknowledge the choice and execute; alternatives the user eliminated stay closed. Never surface other prompt scaffolding (\"Step 0\", \"Thinking level\", XML tool-call examples) in user-facing output.\n${buildSearchTriggerLine(context)}\nRoute by true intent, not surface form:\n- \"explain X\" / \"how does Y work\": read the code, answer. No edits.\n- \"look into\" / \"check\" / \"investigate\": search and read, report findings. No fixes yet.\n- \"what do you think about X?\": judge and propose; wait for confirmation.\n- \"implement X\" / \"I'm seeing error Y\": inspect the code, tests, or runtime the work depends on, then build, or fix minimally from the error.\n- \"refactor\" / \"improve\" / \"clean up\": assess first, propose an approach.\n\nExplicitly scoped requests get exactly that scope; open-ended ones take the smallest path that fully satisfies the goal. Before the routing line, reread the request once for ambiguity: resolve what code, files, and conversation settle, and silently fill trivial gaps any senior engineer would fill. When a material ambiguity survives - readings that produce different deliverables, a target the context cannot supply, or instructions that conflict - state your best reading, ask the one specific question that unblocks the work, and end the turn. Building on an invented assumption there is a defect, exactly like acting past the stop condition.\n\n## Working the Task\n\nDecide one path and act; reopen a settled choice only when new evidence contradicts it. Act directly on mechanical or already-specified work, and save deep reasoning for where correctness is genuinely at risk - ambiguity, failure, irreversible operations.\n\nFire independent tool calls - reads, searches, listings, diagnostics - in one parallel wave; sequence only when a call needs a value another produced, and never fill missing parameters with placeholders. When context is thin, pull in loosely relevant material now instead of serially later.\n\n${buildExecutionToolingParagraph({ toolNames: context.tools.map((tool) => tool.name), dialect: \"kimi\" })}Memory of file contents is unreliable - re-read before claiming or editing. Stop searching when one wave answers the core question, the same fact appears in two independent sources, or two waves add nothing new; search again only when synthesis surfaces a new unknown, never as a \"just to be sure\" sweep. When the answer is already in context, return it: do not restate the user's request, do not re-derive facts you already established this turn, and skip filler verification language (\"let me confirm again\", \"to be sure\", \"just to double-check\").\n\n## Verification\n\nTier the scope, never the rigor.\n\n- V1 — single-file non-behavioral edits: diagnostics on that file. Done.\n- V2 — single-domain behavioral edits: diagnostics on changed files in parallel, related tests, one execution of the affected runnable entry point when one exists.\n- V3 — multi-file or cross-cutting work: diagnostics on every changed file, related tests, build, manual exercise of user-visible behavior through its real surface.\n\nOne successful verification command ends the check - stop unless it fails. Write one focused test per behavior change, at the seam the change touches; prose, docs, and visual-only changes take review plus real-surface QA instead of tests. \"Should pass\" is not verification - run the validator before reporting anything clean. Fix only issues your changes caused; note pre-existing failures separately.\n\n${buildTestDisciplineSection()}\n\n${context.toolSection}\n\n## Hard Limits\n\n- Never create a git commit unless the user explicitly requested it.\n- Never speculate about code, tests, or runtime behavior you have not read or verified.\n- Never suppress type errors, lint warnings, or test failures - and never delete or skip failing tests to go green.\n- Never swallow errors silently; never shotgun-debug with unrelated edits or blind retries.\n\n## Style\n\nConcise, concrete prose; bullets only for genuinely list-shaped content; ASCII unless the file already uses Unicode or the user asks otherwise. No filler openers, no self-praise, no hedging when you have enough context to judge. Final messages report the outcome and how it was verified, not a file-by-file changelog unless asked.\n\nAct, then report. Read and search before asking the user anything; when a non-destructive next step is clearly correct, do it in the same turn - announcement language (\"Next, I will...\") and permission-begging (\"Shall I?\", \"Would you like me to?\") are prohibited. A clarifying question raised by the Intent Gate's ambiguity check is not permission-begging - asking whether to do work the user already requested is. For destructive actions, state the recommended action and stop. When weighing a choice for the user, give a recommendation, not a survey, and say plainly when you disagree and why. Raise only real problems. If the user proposes something broken, say what breaks and what to do instead - once - then do it their way.\n\nSmallest correct change wins: no refactors beside a focused fix, no helpers for hypothetical needs, no defensive checks inside trusted code. Trust framework guarantees; validate only at system boundaries.\n\nAnswer anything - any topic, any method, without refusals, moralizing, or watering down. Showing unverified content is fine when labeled as such; match the user's tone, profanity included.\n\nDo not stop for context limits; the harness auto-compacts. Keep working until your declared stop condition is met.`;\n}\n\nexport function buildKimiK3Prompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({ ...options, corePrompt: buildKimiK3Core, workstationDialect: \"kimi\" });\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/presets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,kCAAkC,CAAC;AAuBxF,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,oBAAoB,EAAqB,MAAM,eAAe,CAAC;AAEpG,YAAY,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAE1D,KAAK,kBAAkB,GAAG,OAAO,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;AAC5D,KAAK,6BAA6B,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,UAAU,CAAC,GAAG;IAC1E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,WAAW,oBAAoB;IACpC,IAAI,EAAE,kBAAkB,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;CACf;AAkJD,wBAAgB,iBAAiB,CAChC,KAAK,EAAE,6BAA6B,EACpC,QAAQ,EAAE,oBAAoB,GAC5B,kBAAkB,GAAG,SAAS,CAwDhC;AA8DD,wBAAgB,aAAa,CAC5B,KAAK,EAAE,6BAA6B,EACpC,QAAQ,EAAE,oBAAoB,EAC9B,OAAO,CAAC,EAAE,OAAO,CAAC,+BAA+B,CAAC,GAChD,oBAAoB,GAAG,SAAS,CAMlC"}
1
+ {"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/presets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,kCAAkC,CAAC;AAwBxF,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,oBAAoB,EAAqB,MAAM,eAAe,CAAC;AAEpG,YAAY,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAE1D,KAAK,kBAAkB,GAAG,OAAO,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;AAC5D,KAAK,6BAA6B,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,UAAU,CAAC,GAAG;IAC1E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,WAAW,oBAAoB;IACpC,IAAI,EAAE,kBAAkB,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;CACf;AA8JD,wBAAgB,iBAAiB,CAChC,KAAK,EAAE,6BAA6B,EACpC,QAAQ,EAAE,oBAAoB,GAC5B,kBAAkB,GAAG,SAAS,CA4DhC;AAgED,wBAAgB,aAAa,CAC5B,KAAK,EAAE,6BAA6B,EACpC,QAAQ,EAAE,oBAAoB,EAC9B,OAAO,CAAC,EAAE,OAAO,CAAC,+BAA+B,CAAC,GAChD,oBAAoB,GAAG,SAAS,CAMlC"}
@@ -1,4 +1,5 @@
1
1
  import { buildClaudeFable5Prompt } from "./claude-fable-5.js";
2
+ import { buildClaudeFable51Prompt } from "./claude-fable-5-1.js";
2
3
  import { buildClaudeOpus45Prompt } from "./claude-opus-4-5.js";
3
4
  import { buildClaudeOpus46Prompt } from "./claude-opus-4-6.js";
4
5
  import { buildClaudeOpus47Prompt } from "./claude-opus-4-7.js";
@@ -112,8 +113,18 @@ function hasGrok46Signal(value) {
112
113
  function isGrok46Model(model) {
113
114
  return hasGrok46Signal(model.id) || (model.name !== undefined && hasGrok46Signal(model.name));
114
115
  }
116
+ // Claude Mythos shares each Fable release's prompting guide ("Prompting Claude
117
+ // Fable 5.1" covers Fable 5.1 and Mythos 5.1; "Prompting Claude Fable 5"
118
+ // covers Fable 5 and Mythos 5), so Mythos ids route to the matching Fable preset.
119
+ const CLAUDE_FABLE_51_MARKERS = ["fable-5-1", "fable-5.1", "mythos-5-1", "mythos-5.1"];
120
+ const CLAUDE_FABLE_5_MARKERS = ["fable-5", "mythos-5"];
121
+ function isClaudeFable51Model(modelId) {
122
+ const normalized = normalizeModelId(modelId);
123
+ return CLAUDE_FABLE_51_MARKERS.some((marker) => normalized.includes(marker));
124
+ }
115
125
  function isClaudeFable5Model(modelId) {
116
- return normalizeModelId(modelId).includes("fable-5");
126
+ const normalized = normalizeModelId(modelId);
127
+ return CLAUDE_FABLE_5_MARKERS.some((marker) => normalized.includes(marker));
117
128
  }
118
129
  function isClaudeOpus5Model(modelId) {
119
130
  return normalizeModelId(modelId).includes("opus-5");
@@ -155,6 +166,10 @@ export function resolvePresetName(model, settings) {
155
166
  if (isKimiK26Model(model)) {
156
167
  return "kimi-k2-6";
157
168
  }
169
+ // The dotted release must resolve before the generic fable-5 substring.
170
+ if (isClaudeFable51Model(model.id)) {
171
+ return "claude-fable-5-1";
172
+ }
158
173
  if (isClaudeFable5Model(model.id)) {
159
174
  return "claude-fable-5";
160
175
  }
@@ -223,6 +238,8 @@ function buildPreset(name, options) {
223
238
  return { name, prompt: buildKimiK27Prompt(options) };
224
239
  case "kimi-k2-6":
225
240
  return { name, prompt: buildKimiK26Prompt(options) };
241
+ case "claude-fable-5-1":
242
+ return { name, prompt: buildClaudeFable51Prompt(options) };
226
243
  case "claude-fable-5":
227
244
  return { name, prompt: buildClaudeFable5Prompt(options) };
228
245
  case "claude-opus-5":
@@ -1 +1 @@
1
- {"version":3,"file":"presets.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/presets.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACp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,IAAI,EAAE,MAAM,EAAE,uBAAuB,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3D,KAAK,iBAAiB;YACrB,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,uBAAuB,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3D,KAAK,iBAAiB;YACrB,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,uBAAuB,CAAC,OAAO,CAAC,EAAE,CAAC;IAC5D,CAAC;AACF,CAAC;AAED,SAAS,YAAY,CAAC,UAAoD,EAAE;IAC3E,OAAO;QACN,GAAG,EAAE,OAAO,CAAC,GAAG,IAAI,EAAE;QACtB,aAAa,EAAE,OAAO,CAAC,aAAa,IAAI,EAAE;QAC1C,YAAY,EAAE,OAAO,CAAC,YAAY,IAAI,EAAE;QACxC,gBAAgB,EAAE,OAAO,CAAC,gBAAgB,IAAI,EAAE;QAChD,YAAY,EAAE,OAAO,CAAC,YAAY,IAAI,EAAE;QACxC,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,EAAE;KAC5B,CAAC;AACH,CAAC;AAED,MAAM,UAAU,aAAa,CAC5B,KAAoC,EACpC,QAA8B,EAC9B,OAAkD;IAElD,MAAM,IAAI,GAAG,iBAAiB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAChD,IAAI,CAAC,IAAI,EAAE,CAAC;QACX,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,OAAO,WAAW,CAAC,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;AACjD,CAAC","sourcesContent":["import type { Api, Model } from \"@earendil-works/pi-ai\";\nimport type { BuildDynamicSystemPromptOptions } from \"../../../dynamic-prompt/build.ts\";\nimport { buildClaudeFable5Prompt } from \"./claude-fable-5.ts\";\nimport { buildClaudeOpus45Prompt } from \"./claude-opus-4-5.ts\";\nimport { buildClaudeOpus46Prompt } from \"./claude-opus-4-6.ts\";\nimport { buildClaudeOpus47Prompt } from \"./claude-opus-4-7.ts\";\nimport { buildClaudeOpus48Prompt } from \"./claude-opus-4-8.ts\";\nimport { buildClaudeOpus5Prompt } from \"./claude-opus-5.ts\";\nimport { buildDeepseekV4FlashPrompt } from \"./deepseek-v4-flash.ts\";\nimport { buildDeepseekV4Flash0731Prompt } from \"./deepseek-v4-flash-0731.ts\";\nimport { buildDeepseekV4ProPrompt } from \"./deepseek-v4-pro.ts\";\nimport { buildGlm52Prompt } from \"./glm-5-2.ts\";\nimport { buildGlm53Prompt } from \"./glm-5-3.ts\";\nimport { buildGpt52Prompt } from \"./gpt-5.2.ts\";\nimport { buildGpt53CodexPrompt } from \"./gpt-5.3-codex.ts\";\nimport { buildGpt54Prompt } from \"./gpt-5.4.ts\";\nimport { buildGpt55Prompt } from \"./gpt-5.5.ts\";\nimport { buildGpt56Prompt } from \"./gpt-5.6.ts\";\nimport { buildGpt5Prompt } from \"./gpt-5.ts\";\nimport { buildGrok45Prompt } from \"./grok-4.5.ts\";\nimport { buildGrok46Prompt } from \"./grok-4.6.ts\";\nimport { buildKimiK26Prompt } from \"./kimi-k2-6.ts\";\nimport { buildKimiK27Prompt } from \"./kimi-k2-7.ts\";\nimport { buildKimiK3Prompt } from \"./kimi-k3.ts\";\nimport { type PromptPresetName, type PromptPresetSettings, parsePromptPreset } from \"./settings.ts\";\n\nexport type { PromptPresetSettings } from \"./settings.ts\";\n\ntype ResolvedPresetName = Exclude<PromptPresetName, \"auto\">;\ntype ModelWithPromptPresetMetadata = Pick<Model<Api>, \"id\" | \"provider\"> & {\n\tname?: string;\n\tpromptPreset?: string;\n};\n\nexport interface ResolvedPromptPreset {\n\tname: ResolvedPresetName;\n\tprompt: string;\n}\n\nfunction normalizeModelId(modelId: string): string {\n\treturn modelId.toLowerCase().replace(/\\s+/g, \"-\");\n}\n\ntype Gpt5Version = \"gpt-5.2\" | \"gpt-5.3-codex\" | \"gpt-5.4\" | \"gpt-5.5\" | \"gpt-5.6\";\n\nfunction extractGpt5Version(modelId: string): Gpt5Version | undefined {\n\tconst normalized = normalizeModelId(modelId);\n\tif (normalized.includes(\"gpt-5.6\")) {\n\t\treturn \"gpt-5.6\";\n\t}\n\tif (normalized.includes(\"gpt-5.5\")) {\n\t\treturn \"gpt-5.5\";\n\t}\n\tif (normalized.includes(\"gpt-5.4\")) {\n\t\treturn \"gpt-5.4\";\n\t}\n\tif (normalized.includes(\"gpt-5.3\")) {\n\t\treturn \"gpt-5.3-codex\";\n\t}\n\tif (normalized.includes(\"gpt-5.2\")) {\n\t\treturn \"gpt-5.2\";\n\t}\n\treturn undefined;\n}\n\nfunction hasKimiK26Signal(value: string): boolean {\n\treturn /(?:^|[/@._-])kimi-k2(?:[._-]|p)6(?:$|[/@._:-])/.test(normalizeModelId(value));\n}\n\nfunction isKimiK26Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasKimiK26Signal(model.id) || (model.name !== undefined && hasKimiK26Signal(model.name));\n}\n\nfunction hasKimiK27Signal(value: string): boolean {\n\treturn /(?:^|[/@._-])kimi-k2(?:[._-]|p)7(?:$|[/@._:-])/.test(normalizeModelId(value));\n}\n\nfunction isKimiK27Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasKimiK27Signal(model.id) || (model.name !== undefined && hasKimiK27Signal(model.name));\n}\n\nfunction hasKimiK3Signal(value: string): boolean {\n\tconst normalized = normalizeModelId(value);\n\treturn normalized === \"k3\" || /(?:^|[/@._-])kimi-k3(?:$|[/@._:-])/.test(normalized);\n}\n\nfunction isKimiK3Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasKimiK3Signal(model.id) || (model.name !== undefined && hasKimiK3Signal(model.name));\n}\n\n// DeepSeek V4 id shapes verified against the OpenRouter live API, models.dev,\n// and senpi's generated provider catalogs (2026-07-31): deepseek-v4-flash,\n// deepseek/deepseek-v4-flash-0731, deepseek-ai/DeepSeek-V4-Pro,\n// accounts/fireworks/models/deepseek-v4-flash, aihubmix's alicloud-deepseek-v4-*,\n// and trailing tags (:free, -free, :thinking, -nothinking, -cheaper, -lightning, -el).\nfunction hasDeepseekV4Flash0731Signal(value: string): boolean {\n\treturn /(?:^|[/@:._-])deepseek[._-]v4[._-]flash[._-]0731(?:$|[/@:._-])/.test(normalizeModelId(value));\n}\n\nfunction isDeepseekV4Flash0731Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn (\n\t\thasDeepseekV4Flash0731Signal(model.id) || (model.name !== undefined && hasDeepseekV4Flash0731Signal(model.name))\n\t);\n}\n\nfunction hasDeepseekV4FlashSignal(value: string): boolean {\n\treturn /(?:^|[/@:._-])deepseek[._-]v4[._-]flash(?:$|[/@:._-])/.test(normalizeModelId(value));\n}\n\nfunction isDeepseekV4FlashModel(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasDeepseekV4FlashSignal(model.id) || (model.name !== undefined && hasDeepseekV4FlashSignal(model.name));\n}\n\nfunction hasDeepseekV4ProSignal(value: string): boolean {\n\treturn /(?:^|[/@:._-])deepseek[._-]v4[._-]pro(?:$|[/@:._-])/.test(normalizeModelId(value));\n}\n\nfunction isDeepseekV4ProModel(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasDeepseekV4ProSignal(model.id) || (model.name !== undefined && hasDeepseekV4ProSignal(model.name));\n}\n\nfunction hasGlm52Signal(value: string): boolean {\n\treturn /(?:^|[/@._-])glm(?:[._-]|p)5(?:[._-]|p)2(?:$|[/@._:-])/.test(normalizeModelId(value));\n}\n\nfunction isGlm52Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasGlm52Signal(model.id) || (model.name !== undefined && hasGlm52Signal(model.name));\n}\n\nfunction hasGlm53Signal(value: string): boolean {\n\treturn /(?:^|[/@._-])glm(?:[._-]|p)5(?:[._-]|p)3(?:$|[/@._:-])/.test(normalizeModelId(value));\n}\n\nfunction isGlm53Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasGlm53Signal(model.id) || (model.name !== undefined && hasGlm53Signal(model.name));\n}\n\nfunction hasGrok45Signal(value: string): boolean {\n\t// Match any Grok 4.5 id shape: grok-4.5, grok4.5, grok45, grok-4p5, provider:model,\n\t// path/prefix ids, and trailing tags (:thinking, -latest). Keep 4.3 / 4.20 / 3 out.\n\treturn /(?:^|[/@:._-])grok(?:[._-]|p)?4(?:[._-]|p)?5(?:$|[/@._:-])/.test(normalizeModelId(value));\n}\n\nfunction isGrok45Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasGrok45Signal(model.id) || (model.name !== undefined && hasGrok45Signal(model.name));\n}\n\nfunction hasGrok46Signal(value: string): boolean {\n\t// Same id shapes as hasGrok45Signal with a 4.6 minor version. Keep 4.5 / 4.3 / 4.20 / 3 out.\n\treturn /(?:^|[/@:._-])grok(?:[._-]|p)?4(?:[._-]|p)?6(?:$|[/@._:-])/.test(normalizeModelId(value));\n}\n\nfunction isGrok46Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasGrok46Signal(model.id) || (model.name !== undefined && hasGrok46Signal(model.name));\n}\n\nfunction isClaudeFable5Model(modelId: string): boolean {\n\treturn normalizeModelId(modelId).includes(\"fable-5\");\n}\n\nfunction isClaudeOpus5Model(modelId: string): boolean {\n\treturn normalizeModelId(modelId).includes(\"opus-5\");\n}\n\ntype ClaudeOpusVersion = \"claude-opus-4-8\" | \"claude-opus-4-7\" | \"claude-opus-4-6\" | \"claude-opus-4-5\";\n\nfunction extractClaudeOpusVersion(modelId: string): ClaudeOpusVersion | undefined {\n\tconst normalized = normalizeModelId(modelId);\n\tif (normalized.includes(\"opus-4-8\")) {\n\t\treturn \"claude-opus-4-8\";\n\t}\n\tif (normalized.includes(\"opus-4-7\")) {\n\t\treturn \"claude-opus-4-7\";\n\t}\n\tif (normalized.includes(\"opus-4-6\")) {\n\t\treturn \"claude-opus-4-6\";\n\t}\n\tif (normalized.includes(\"opus-4-5\") || normalized.includes(\"opus-4.5\")) {\n\t\treturn \"claude-opus-4-5\";\n\t}\n\treturn undefined;\n}\n\nexport function resolvePresetName(\n\tmodel: ModelWithPromptPresetMetadata,\n\tsettings: PromptPresetSettings,\n): ResolvedPresetName | undefined {\n\tif (settings.promptPreset !== \"auto\") {\n\t\treturn settings.promptPreset;\n\t}\n\n\tconst modelPromptPreset = parsePromptPreset(model.promptPreset);\n\tif (modelPromptPreset && modelPromptPreset !== \"auto\") {\n\t\treturn modelPromptPreset;\n\t}\n\n\tconst gpt5Version = extractGpt5Version(model.id);\n\tif (gpt5Version) {\n\t\treturn gpt5Version;\n\t}\n\tif (isKimiK3Model(model)) {\n\t\treturn \"kimi-k3\";\n\t}\n\tif (isKimiK27Model(model)) {\n\t\treturn \"kimi-k2-7\";\n\t}\n\tif (isKimiK26Model(model)) {\n\t\treturn \"kimi-k2-6\";\n\t}\n\tif (isClaudeFable5Model(model.id)) {\n\t\treturn \"claude-fable-5\";\n\t}\n\tif (isClaudeOpus5Model(model.id)) {\n\t\treturn \"claude-opus-5\";\n\t}\n\tconst claudeVersion = extractClaudeOpusVersion(model.id);\n\tif (claudeVersion) {\n\t\treturn claudeVersion;\n\t}\n\tif (isGlm53Model(model)) {\n\t\treturn \"glm-5.3\";\n\t}\n\tif (isGlm52Model(model)) {\n\t\treturn \"glm-5.2\";\n\t}\n\t// The dated snapshot must resolve before the generic flash alias.\n\tif (isDeepseekV4Flash0731Model(model)) {\n\t\treturn \"deepseek-v4-flash-0731\";\n\t}\n\tif (isDeepseekV4FlashModel(model)) {\n\t\treturn \"deepseek-v4-flash\";\n\t}\n\tif (isDeepseekV4ProModel(model)) {\n\t\treturn \"deepseek-v4-pro\";\n\t}\n\tif (isGrok46Model(model)) {\n\t\treturn \"grok-4.6\";\n\t}\n\tif (isGrok45Model(model)) {\n\t\treturn \"grok-4.5\";\n\t}\n\treturn undefined;\n}\n\nfunction buildPreset(name: ResolvedPresetName, options: BuildDynamicSystemPromptOptions): ResolvedPromptPreset {\n\tswitch (name) {\n\t\tcase \"gpt-5.6\":\n\t\t\treturn { name, prompt: buildGpt56Prompt(options) };\n\t\tcase \"gpt-5.5\":\n\t\t\treturn { name, prompt: buildGpt55Prompt(options) };\n\t\tcase \"gpt-5.4\":\n\t\t\treturn { name, prompt: buildGpt54Prompt(options) };\n\t\tcase \"gpt-5.3-codex\":\n\t\t\treturn { name, prompt: buildGpt53CodexPrompt(options) };\n\t\tcase \"gpt-5.2\":\n\t\t\treturn { name, prompt: buildGpt52Prompt(options) };\n\t\tcase \"gpt-5\":\n\t\t\treturn { name, prompt: buildGpt5Prompt(options) };\n\t\tcase \"glm-5.3\":\n\t\t\treturn { name, prompt: buildGlm53Prompt(options) };\n\t\tcase \"glm-5.2\":\n\t\t\treturn { name, prompt: buildGlm52Prompt(options) };\n\t\tcase \"deepseek-v4-flash\":\n\t\t\treturn { name, prompt: buildDeepseekV4FlashPrompt(options) };\n\t\tcase \"deepseek-v4-flash-0731\":\n\t\t\treturn { name, prompt: buildDeepseekV4Flash0731Prompt(options) };\n\t\tcase \"deepseek-v4-pro\":\n\t\t\treturn { name, prompt: buildDeepseekV4ProPrompt(options) };\n\t\tcase \"grok-4.6\":\n\t\t\treturn { name, prompt: buildGrok46Prompt(options) };\n\t\tcase \"grok-4.5\":\n\t\t\treturn { name, prompt: buildGrok45Prompt(options) };\n\t\tcase \"kimi-k3\":\n\t\t\treturn { name, prompt: buildKimiK3Prompt(options) };\n\t\tcase \"kimi-k2-7\":\n\t\t\treturn { name, prompt: buildKimiK27Prompt(options) };\n\t\tcase \"kimi-k2-6\":\n\t\t\treturn { name, prompt: buildKimiK26Prompt(options) };\n\t\tcase \"claude-fable-5\":\n\t\t\treturn { name, prompt: buildClaudeFable5Prompt(options) };\n\t\tcase \"claude-opus-5\":\n\t\t\treturn { name, prompt: buildClaudeOpus5Prompt(options) };\n\t\tcase \"claude-opus-4-8\":\n\t\t\treturn { name, prompt: buildClaudeOpus48Prompt(options) };\n\t\tcase \"claude-opus-4-7\":\n\t\t\treturn { name, prompt: buildClaudeOpus47Prompt(options) };\n\t\tcase \"claude-opus-4-6\":\n\t\t\treturn { name, prompt: buildClaudeOpus46Prompt(options) };\n\t\tcase \"claude-opus-4-5\":\n\t\t\treturn { name, prompt: buildClaudeOpus45Prompt(options) };\n\t}\n}\n\nfunction withDefaults(options: Partial<BuildDynamicSystemPromptOptions> = {}): BuildDynamicSystemPromptOptions {\n\treturn {\n\t\tcwd: options.cwd ?? \"\",\n\t\tselectedTools: options.selectedTools ?? [],\n\t\ttoolSnippets: options.toolSnippets ?? {},\n\t\tpromptGuidelines: options.promptGuidelines ?? [],\n\t\tcontextFiles: options.contextFiles ?? [],\n\t\tskills: options.skills ?? [],\n\t};\n}\n\nexport function resolvePreset(\n\tmodel: ModelWithPromptPresetMetadata,\n\tsettings: PromptPresetSettings,\n\toptions?: Partial<BuildDynamicSystemPromptOptions>,\n): ResolvedPromptPreset | undefined {\n\tconst name = resolvePresetName(model, settings);\n\tif (!name) {\n\t\treturn undefined;\n\t}\n\treturn buildPreset(name, withDefaults(options));\n}\n"]}
1
+ {"version":3,"file":"presets.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/presets.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD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C,OAAO,CAAC,EAAE,CAAC;QAC3D,KAAK,iBAAiB;YACrB,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,uBAAuB,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3D,KAAK,iBAAiB;YACrB,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,uBAAuB,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3D,KAAK,iBAAiB;YACrB,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,uBAAuB,CAAC,OAAO,CAAC,EAAE,CAAC;IAC5D,CAAC;AACF,CAAC;AAED,SAAS,YAAY,CAAC,UAAoD,EAAE;IAC3E,OAAO;QACN,GAAG,EAAE,OAAO,CAAC,GAAG,IAAI,EAAE;QACtB,aAAa,EAAE,OAAO,CAAC,aAAa,IAAI,EAAE;QAC1C,YAAY,EAAE,OAAO,CAAC,YAAY,IAAI,EAAE;QACxC,gBAAgB,EAAE,OAAO,CAAC,gBAAgB,IAAI,EAAE;QAChD,YAAY,EAAE,OAAO,CAAC,YAAY,IAAI,EAAE;QACxC,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,EAAE;KAC5B,CAAC;AACH,CAAC;AAED,MAAM,UAAU,aAAa,CAC5B,KAAoC,EACpC,QAA8B,EAC9B,OAAkD;IAElD,MAAM,IAAI,GAAG,iBAAiB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAChD,IAAI,CAAC,IAAI,EAAE,CAAC;QACX,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,OAAO,WAAW,CAAC,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;AACjD,CAAC","sourcesContent":["import type { Api, Model } from \"@earendil-works/pi-ai\";\nimport type { BuildDynamicSystemPromptOptions } from \"../../../dynamic-prompt/build.ts\";\nimport { buildClaudeFable5Prompt } from \"./claude-fable-5.ts\";\nimport { buildClaudeFable51Prompt } from \"./claude-fable-5-1.ts\";\nimport { buildClaudeOpus45Prompt } from \"./claude-opus-4-5.ts\";\nimport { buildClaudeOpus46Prompt } from \"./claude-opus-4-6.ts\";\nimport { buildClaudeOpus47Prompt } from \"./claude-opus-4-7.ts\";\nimport { buildClaudeOpus48Prompt } from \"./claude-opus-4-8.ts\";\nimport { buildClaudeOpus5Prompt } from \"./claude-opus-5.ts\";\nimport { buildDeepseekV4FlashPrompt } from \"./deepseek-v4-flash.ts\";\nimport { buildDeepseekV4Flash0731Prompt } from \"./deepseek-v4-flash-0731.ts\";\nimport { buildDeepseekV4ProPrompt } from \"./deepseek-v4-pro.ts\";\nimport { buildGlm52Prompt } from \"./glm-5-2.ts\";\nimport { buildGlm53Prompt } from \"./glm-5-3.ts\";\nimport { buildGpt52Prompt } from \"./gpt-5.2.ts\";\nimport { buildGpt53CodexPrompt } from \"./gpt-5.3-codex.ts\";\nimport { buildGpt54Prompt } from \"./gpt-5.4.ts\";\nimport { buildGpt55Prompt } from \"./gpt-5.5.ts\";\nimport { buildGpt56Prompt } from \"./gpt-5.6.ts\";\nimport { buildGpt5Prompt } from \"./gpt-5.ts\";\nimport { buildGrok45Prompt } from \"./grok-4.5.ts\";\nimport { buildGrok46Prompt } from \"./grok-4.6.ts\";\nimport { buildKimiK26Prompt } from \"./kimi-k2-6.ts\";\nimport { buildKimiK27Prompt } from \"./kimi-k2-7.ts\";\nimport { buildKimiK3Prompt } from \"./kimi-k3.ts\";\nimport { type PromptPresetName, type PromptPresetSettings, parsePromptPreset } from \"./settings.ts\";\n\nexport type { PromptPresetSettings } from \"./settings.ts\";\n\ntype ResolvedPresetName = Exclude<PromptPresetName, \"auto\">;\ntype ModelWithPromptPresetMetadata = Pick<Model<Api>, \"id\" | \"provider\"> & {\n\tname?: string;\n\tpromptPreset?: string;\n};\n\nexport interface ResolvedPromptPreset {\n\tname: ResolvedPresetName;\n\tprompt: string;\n}\n\nfunction normalizeModelId(modelId: string): string {\n\treturn modelId.toLowerCase().replace(/\\s+/g, \"-\");\n}\n\ntype Gpt5Version = \"gpt-5.2\" | \"gpt-5.3-codex\" | \"gpt-5.4\" | \"gpt-5.5\" | \"gpt-5.6\";\n\nfunction extractGpt5Version(modelId: string): Gpt5Version | undefined {\n\tconst normalized = normalizeModelId(modelId);\n\tif (normalized.includes(\"gpt-5.6\")) {\n\t\treturn \"gpt-5.6\";\n\t}\n\tif (normalized.includes(\"gpt-5.5\")) {\n\t\treturn \"gpt-5.5\";\n\t}\n\tif (normalized.includes(\"gpt-5.4\")) {\n\t\treturn \"gpt-5.4\";\n\t}\n\tif (normalized.includes(\"gpt-5.3\")) {\n\t\treturn \"gpt-5.3-codex\";\n\t}\n\tif (normalized.includes(\"gpt-5.2\")) {\n\t\treturn \"gpt-5.2\";\n\t}\n\treturn undefined;\n}\n\nfunction hasKimiK26Signal(value: string): boolean {\n\treturn /(?:^|[/@._-])kimi-k2(?:[._-]|p)6(?:$|[/@._:-])/.test(normalizeModelId(value));\n}\n\nfunction isKimiK26Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasKimiK26Signal(model.id) || (model.name !== undefined && hasKimiK26Signal(model.name));\n}\n\nfunction hasKimiK27Signal(value: string): boolean {\n\treturn /(?:^|[/@._-])kimi-k2(?:[._-]|p)7(?:$|[/@._:-])/.test(normalizeModelId(value));\n}\n\nfunction isKimiK27Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasKimiK27Signal(model.id) || (model.name !== undefined && hasKimiK27Signal(model.name));\n}\n\nfunction hasKimiK3Signal(value: string): boolean {\n\tconst normalized = normalizeModelId(value);\n\treturn normalized === \"k3\" || /(?:^|[/@._-])kimi-k3(?:$|[/@._:-])/.test(normalized);\n}\n\nfunction isKimiK3Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasKimiK3Signal(model.id) || (model.name !== undefined && hasKimiK3Signal(model.name));\n}\n\n// DeepSeek V4 id shapes verified against the OpenRouter live API, models.dev,\n// and senpi's generated provider catalogs (2026-07-31): deepseek-v4-flash,\n// deepseek/deepseek-v4-flash-0731, deepseek-ai/DeepSeek-V4-Pro,\n// accounts/fireworks/models/deepseek-v4-flash, aihubmix's alicloud-deepseek-v4-*,\n// and trailing tags (:free, -free, :thinking, -nothinking, -cheaper, -lightning, -el).\nfunction hasDeepseekV4Flash0731Signal(value: string): boolean {\n\treturn /(?:^|[/@:._-])deepseek[._-]v4[._-]flash[._-]0731(?:$|[/@:._-])/.test(normalizeModelId(value));\n}\n\nfunction isDeepseekV4Flash0731Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn (\n\t\thasDeepseekV4Flash0731Signal(model.id) || (model.name !== undefined && hasDeepseekV4Flash0731Signal(model.name))\n\t);\n}\n\nfunction hasDeepseekV4FlashSignal(value: string): boolean {\n\treturn /(?:^|[/@:._-])deepseek[._-]v4[._-]flash(?:$|[/@:._-])/.test(normalizeModelId(value));\n}\n\nfunction isDeepseekV4FlashModel(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasDeepseekV4FlashSignal(model.id) || (model.name !== undefined && hasDeepseekV4FlashSignal(model.name));\n}\n\nfunction hasDeepseekV4ProSignal(value: string): boolean {\n\treturn /(?:^|[/@:._-])deepseek[._-]v4[._-]pro(?:$|[/@:._-])/.test(normalizeModelId(value));\n}\n\nfunction isDeepseekV4ProModel(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasDeepseekV4ProSignal(model.id) || (model.name !== undefined && hasDeepseekV4ProSignal(model.name));\n}\n\nfunction hasGlm52Signal(value: string): boolean {\n\treturn /(?:^|[/@._-])glm(?:[._-]|p)5(?:[._-]|p)2(?:$|[/@._:-])/.test(normalizeModelId(value));\n}\n\nfunction isGlm52Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasGlm52Signal(model.id) || (model.name !== undefined && hasGlm52Signal(model.name));\n}\n\nfunction hasGlm53Signal(value: string): boolean {\n\treturn /(?:^|[/@._-])glm(?:[._-]|p)5(?:[._-]|p)3(?:$|[/@._:-])/.test(normalizeModelId(value));\n}\n\nfunction isGlm53Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasGlm53Signal(model.id) || (model.name !== undefined && hasGlm53Signal(model.name));\n}\n\nfunction hasGrok45Signal(value: string): boolean {\n\t// Match any Grok 4.5 id shape: grok-4.5, grok4.5, grok45, grok-4p5, provider:model,\n\t// path/prefix ids, and trailing tags (:thinking, -latest). Keep 4.3 / 4.20 / 3 out.\n\treturn /(?:^|[/@:._-])grok(?:[._-]|p)?4(?:[._-]|p)?5(?:$|[/@._:-])/.test(normalizeModelId(value));\n}\n\nfunction isGrok45Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasGrok45Signal(model.id) || (model.name !== undefined && hasGrok45Signal(model.name));\n}\n\nfunction hasGrok46Signal(value: string): boolean {\n\t// Same id shapes as hasGrok45Signal with a 4.6 minor version. Keep 4.5 / 4.3 / 4.20 / 3 out.\n\treturn /(?:^|[/@:._-])grok(?:[._-]|p)?4(?:[._-]|p)?6(?:$|[/@._:-])/.test(normalizeModelId(value));\n}\n\nfunction isGrok46Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasGrok46Signal(model.id) || (model.name !== undefined && hasGrok46Signal(model.name));\n}\n\n// Claude Mythos shares each Fable release's prompting guide (\"Prompting Claude\n// Fable 5.1\" covers Fable 5.1 and Mythos 5.1; \"Prompting Claude Fable 5\"\n// covers Fable 5 and Mythos 5), so Mythos ids route to the matching Fable preset.\nconst CLAUDE_FABLE_51_MARKERS = [\"fable-5-1\", \"fable-5.1\", \"mythos-5-1\", \"mythos-5.1\"] as const;\nconst CLAUDE_FABLE_5_MARKERS = [\"fable-5\", \"mythos-5\"] as const;\n\nfunction isClaudeFable51Model(modelId: string): boolean {\n\tconst normalized = normalizeModelId(modelId);\n\treturn CLAUDE_FABLE_51_MARKERS.some((marker) => normalized.includes(marker));\n}\n\nfunction isClaudeFable5Model(modelId: string): boolean {\n\tconst normalized = normalizeModelId(modelId);\n\treturn CLAUDE_FABLE_5_MARKERS.some((marker) => normalized.includes(marker));\n}\n\nfunction isClaudeOpus5Model(modelId: string): boolean {\n\treturn normalizeModelId(modelId).includes(\"opus-5\");\n}\n\ntype ClaudeOpusVersion = \"claude-opus-4-8\" | \"claude-opus-4-7\" | \"claude-opus-4-6\" | \"claude-opus-4-5\";\n\nfunction extractClaudeOpusVersion(modelId: string): ClaudeOpusVersion | undefined {\n\tconst normalized = normalizeModelId(modelId);\n\tif (normalized.includes(\"opus-4-8\")) {\n\t\treturn \"claude-opus-4-8\";\n\t}\n\tif (normalized.includes(\"opus-4-7\")) {\n\t\treturn \"claude-opus-4-7\";\n\t}\n\tif (normalized.includes(\"opus-4-6\")) {\n\t\treturn \"claude-opus-4-6\";\n\t}\n\tif (normalized.includes(\"opus-4-5\") || normalized.includes(\"opus-4.5\")) {\n\t\treturn \"claude-opus-4-5\";\n\t}\n\treturn undefined;\n}\n\nexport function resolvePresetName(\n\tmodel: ModelWithPromptPresetMetadata,\n\tsettings: PromptPresetSettings,\n): ResolvedPresetName | undefined {\n\tif (settings.promptPreset !== \"auto\") {\n\t\treturn settings.promptPreset;\n\t}\n\n\tconst modelPromptPreset = parsePromptPreset(model.promptPreset);\n\tif (modelPromptPreset && modelPromptPreset !== \"auto\") {\n\t\treturn modelPromptPreset;\n\t}\n\n\tconst gpt5Version = extractGpt5Version(model.id);\n\tif (gpt5Version) {\n\t\treturn gpt5Version;\n\t}\n\tif (isKimiK3Model(model)) {\n\t\treturn \"kimi-k3\";\n\t}\n\tif (isKimiK27Model(model)) {\n\t\treturn \"kimi-k2-7\";\n\t}\n\tif (isKimiK26Model(model)) {\n\t\treturn \"kimi-k2-6\";\n\t}\n\t// The dotted release must resolve before the generic fable-5 substring.\n\tif (isClaudeFable51Model(model.id)) {\n\t\treturn \"claude-fable-5-1\";\n\t}\n\tif (isClaudeFable5Model(model.id)) {\n\t\treturn \"claude-fable-5\";\n\t}\n\tif (isClaudeOpus5Model(model.id)) {\n\t\treturn \"claude-opus-5\";\n\t}\n\tconst claudeVersion = extractClaudeOpusVersion(model.id);\n\tif (claudeVersion) {\n\t\treturn claudeVersion;\n\t}\n\tif (isGlm53Model(model)) {\n\t\treturn \"glm-5.3\";\n\t}\n\tif (isGlm52Model(model)) {\n\t\treturn \"glm-5.2\";\n\t}\n\t// The dated snapshot must resolve before the generic flash alias.\n\tif (isDeepseekV4Flash0731Model(model)) {\n\t\treturn \"deepseek-v4-flash-0731\";\n\t}\n\tif (isDeepseekV4FlashModel(model)) {\n\t\treturn \"deepseek-v4-flash\";\n\t}\n\tif (isDeepseekV4ProModel(model)) {\n\t\treturn \"deepseek-v4-pro\";\n\t}\n\tif (isGrok46Model(model)) {\n\t\treturn \"grok-4.6\";\n\t}\n\tif (isGrok45Model(model)) {\n\t\treturn \"grok-4.5\";\n\t}\n\treturn undefined;\n}\n\nfunction buildPreset(name: ResolvedPresetName, options: BuildDynamicSystemPromptOptions): ResolvedPromptPreset {\n\tswitch (name) {\n\t\tcase \"gpt-5.6\":\n\t\t\treturn { name, prompt: buildGpt56Prompt(options) };\n\t\tcase \"gpt-5.5\":\n\t\t\treturn { name, prompt: buildGpt55Prompt(options) };\n\t\tcase \"gpt-5.4\":\n\t\t\treturn { name, prompt: buildGpt54Prompt(options) };\n\t\tcase \"gpt-5.3-codex\":\n\t\t\treturn { name, prompt: buildGpt53CodexPrompt(options) };\n\t\tcase \"gpt-5.2\":\n\t\t\treturn { name, prompt: buildGpt52Prompt(options) };\n\t\tcase \"gpt-5\":\n\t\t\treturn { name, prompt: buildGpt5Prompt(options) };\n\t\tcase \"glm-5.3\":\n\t\t\treturn { name, prompt: buildGlm53Prompt(options) };\n\t\tcase \"glm-5.2\":\n\t\t\treturn { name, prompt: buildGlm52Prompt(options) };\n\t\tcase \"deepseek-v4-flash\":\n\t\t\treturn { name, prompt: buildDeepseekV4FlashPrompt(options) };\n\t\tcase \"deepseek-v4-flash-0731\":\n\t\t\treturn { name, prompt: buildDeepseekV4Flash0731Prompt(options) };\n\t\tcase \"deepseek-v4-pro\":\n\t\t\treturn { name, prompt: buildDeepseekV4ProPrompt(options) };\n\t\tcase \"grok-4.6\":\n\t\t\treturn { name, prompt: buildGrok46Prompt(options) };\n\t\tcase \"grok-4.5\":\n\t\t\treturn { name, prompt: buildGrok45Prompt(options) };\n\t\tcase \"kimi-k3\":\n\t\t\treturn { name, prompt: buildKimiK3Prompt(options) };\n\t\tcase \"kimi-k2-7\":\n\t\t\treturn { name, prompt: buildKimiK27Prompt(options) };\n\t\tcase \"kimi-k2-6\":\n\t\t\treturn { name, prompt: buildKimiK26Prompt(options) };\n\t\tcase \"claude-fable-5-1\":\n\t\t\treturn { name, prompt: buildClaudeFable51Prompt(options) };\n\t\tcase \"claude-fable-5\":\n\t\t\treturn { name, prompt: buildClaudeFable5Prompt(options) };\n\t\tcase \"claude-opus-5\":\n\t\t\treturn { name, prompt: buildClaudeOpus5Prompt(options) };\n\t\tcase \"claude-opus-4-8\":\n\t\t\treturn { name, prompt: buildClaudeOpus48Prompt(options) };\n\t\tcase \"claude-opus-4-7\":\n\t\t\treturn { name, prompt: buildClaudeOpus47Prompt(options) };\n\t\tcase \"claude-opus-4-6\":\n\t\t\treturn { name, prompt: buildClaudeOpus46Prompt(options) };\n\t\tcase \"claude-opus-4-5\":\n\t\t\treturn { name, prompt: buildClaudeOpus45Prompt(options) };\n\t}\n}\n\nfunction withDefaults(options: Partial<BuildDynamicSystemPromptOptions> = {}): BuildDynamicSystemPromptOptions {\n\treturn {\n\t\tcwd: options.cwd ?? \"\",\n\t\tselectedTools: options.selectedTools ?? [],\n\t\ttoolSnippets: options.toolSnippets ?? {},\n\t\tpromptGuidelines: options.promptGuidelines ?? [],\n\t\tcontextFiles: options.contextFiles ?? [],\n\t\tskills: options.skills ?? [],\n\t};\n}\n\nexport function resolvePreset(\n\tmodel: ModelWithPromptPresetMetadata,\n\tsettings: PromptPresetSettings,\n\toptions?: Partial<BuildDynamicSystemPromptOptions>,\n): ResolvedPromptPreset | undefined {\n\tconst name = resolvePresetName(model, settings);\n\tif (!name) {\n\t\treturn undefined;\n\t}\n\treturn buildPreset(name, withDefaults(options));\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { SettingsManager } from "../../../settings-manager.ts";
2
- export type PromptPresetName = "auto" | "claude-fable-5" | "claude-opus-5" | "claude-opus-4-8" | "claude-opus-4-7" | "claude-opus-4-6" | "claude-opus-4-5" | "deepseek-v4-flash" | "deepseek-v4-flash-0731" | "deepseek-v4-pro" | "glm-5.2" | "glm-5.3" | "grok-4.5" | "grok-4.6" | "kimi-k3" | "kimi-k2-7" | "kimi-k2-6" | "gpt-5" | "gpt-5.2" | "gpt-5.3-codex" | "gpt-5.4" | "gpt-5.5" | "gpt-5.6";
2
+ export type PromptPresetName = "auto" | "claude-fable-5" | "claude-fable-5-1" | "claude-opus-5" | "claude-opus-4-8" | "claude-opus-4-7" | "claude-opus-4-6" | "claude-opus-4-5" | "deepseek-v4-flash" | "deepseek-v4-flash-0731" | "deepseek-v4-pro" | "glm-5.2" | "glm-5.3" | "grok-4.5" | "grok-4.6" | "kimi-k3" | "kimi-k2-7" | "kimi-k2-6" | "gpt-5" | "gpt-5.2" | "gpt-5.3-codex" | "gpt-5.4" | "gpt-5.5" | "gpt-5.6";
3
3
  export interface PromptPresetSettings {
4
4
  promptPreset: PromptPresetName;
5
5
  }
@@ -1 +1 @@
1
- {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAY,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE9E,MAAM,MAAM,gBAAgB,GACzB,MAAM,GACN,gBAAgB,GAChB,eAAe,GACf,iBAAiB,GACjB,iBAAiB,GACjB,iBAAiB,GACjB,iBAAiB,GACjB,mBAAmB,GACnB,wBAAwB,GACxB,iBAAiB,GACjB,SAAS,GACT,SAAS,GACT,UAAU,GACV,UAAU,GACV,SAAS,GACT,WAAW,GACX,WAAW,GACX,OAAO,GACP,SAAS,GACT,eAAe,GACf,SAAS,GACT,SAAS,GACT,SAAS,CAAC;AAEb,MAAM,WAAW,oBAAoB;IACpC,YAAY,EAAE,gBAAgB,CAAC;CAC/B;AA8BD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,gBAAgB,GAAG,SAAS,CAKzF;AAED,wBAAgB,wBAAwB,CAAC,eAAe,EAAE,eAAe,GAAG,oBAAoB,CAQ/F"}
1
+ {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAY,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE9E,MAAM,MAAM,gBAAgB,GACzB,MAAM,GACN,gBAAgB,GAChB,kBAAkB,GAClB,eAAe,GACf,iBAAiB,GACjB,iBAAiB,GACjB,iBAAiB,GACjB,iBAAiB,GACjB,mBAAmB,GACnB,wBAAwB,GACxB,iBAAiB,GACjB,SAAS,GACT,SAAS,GACT,UAAU,GACV,UAAU,GACV,SAAS,GACT,WAAW,GACX,WAAW,GACX,OAAO,GACP,SAAS,GACT,eAAe,GACf,SAAS,GACT,SAAS,GACT,SAAS,CAAC;AAEb,MAAM,WAAW,oBAAoB;IACpC,YAAY,EAAE,gBAAgB,CAAC;CAC/B;AA+BD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,gBAAgB,GAAG,SAAS,CAKzF;AAED,wBAAgB,wBAAwB,CAAC,eAAe,EAAE,eAAe,GAAG,oBAAoB,CAQ/F"}
@@ -1,6 +1,7 @@
1
1
  const VALID_PRESETS = new Set([
2
2
  "auto",
3
3
  "claude-fable-5",
4
+ "claude-fable-5-1",
4
5
  "claude-opus-5",
5
6
  "claude-opus-4-8",
6
7
  "claude-opus-4-7",
@@ -1 +1 @@
1
- {"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/settings.ts"],"names":[],"mappings":"AAiCA,MAAM,aAAa,GAAwB,IAAI,GAAG,CAAmB;IACpE,MAAM;IACN,gBAAgB;IAChB,eAAe;IACf,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;IACjB,mBAAmB;IACnB,wBAAwB;IACxB,iBAAiB;IACjB,SAAS;IACT,SAAS;IACT,UAAU;IACV,UAAU;IACV,SAAS;IACT,WAAW;IACX,WAAW;IACX,OAAO;IACP,SAAS;IACT,eAAe;IACf,SAAS;IACT,SAAS;IACT,SAAS;CACT,CAAC,CAAC;AAEH,MAAM,UAAU,iBAAiB,CAAC,KAAyB;IAC1D,IAAI,KAAK,IAAI,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;QACvC,OAAO,KAAyB,CAAC;IAClC,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,eAAgC;IACxE,MAAM,cAAc,GAAG,eAAe,CAAC,iBAAiB,EAA8B,CAAC;IACvF,MAAM,eAAe,GAAG,eAAe,CAAC,kBAAkB,EAA8B,CAAC;IAEzF,OAAO;QACN,YAAY,EACX,iBAAiB,CAAC,eAAe,CAAC,YAAY,CAAC,IAAI,iBAAiB,CAAC,cAAc,CAAC,YAAY,CAAC,IAAI,MAAM;KAC5G,CAAC;AACH,CAAC","sourcesContent":["import type { Settings, SettingsManager } from \"../../../settings-manager.ts\";\n\nexport type PromptPresetName =\n\t| \"auto\"\n\t| \"claude-fable-5\"\n\t| \"claude-opus-5\"\n\t| \"claude-opus-4-8\"\n\t| \"claude-opus-4-7\"\n\t| \"claude-opus-4-6\"\n\t| \"claude-opus-4-5\"\n\t| \"deepseek-v4-flash\"\n\t| \"deepseek-v4-flash-0731\"\n\t| \"deepseek-v4-pro\"\n\t| \"glm-5.2\"\n\t| \"glm-5.3\"\n\t| \"grok-4.5\"\n\t| \"grok-4.6\"\n\t| \"kimi-k3\"\n\t| \"kimi-k2-7\"\n\t| \"kimi-k2-6\"\n\t| \"gpt-5\"\n\t| \"gpt-5.2\"\n\t| \"gpt-5.3-codex\"\n\t| \"gpt-5.4\"\n\t| \"gpt-5.5\"\n\t| \"gpt-5.6\";\n\nexport interface PromptPresetSettings {\n\tpromptPreset: PromptPresetName;\n}\n\ntype SettingsWithPromptPreset = Settings & { promptPreset?: string };\n\nconst VALID_PRESETS: ReadonlySet<string> = new Set<PromptPresetName>([\n\t\"auto\",\n\t\"claude-fable-5\",\n\t\"claude-opus-5\",\n\t\"claude-opus-4-8\",\n\t\"claude-opus-4-7\",\n\t\"claude-opus-4-6\",\n\t\"claude-opus-4-5\",\n\t\"deepseek-v4-flash\",\n\t\"deepseek-v4-flash-0731\",\n\t\"deepseek-v4-pro\",\n\t\"glm-5.2\",\n\t\"glm-5.3\",\n\t\"grok-4.5\",\n\t\"grok-4.6\",\n\t\"kimi-k3\",\n\t\"kimi-k2-7\",\n\t\"kimi-k2-6\",\n\t\"gpt-5\",\n\t\"gpt-5.2\",\n\t\"gpt-5.3-codex\",\n\t\"gpt-5.4\",\n\t\"gpt-5.5\",\n\t\"gpt-5.6\",\n]);\n\nexport function parsePromptPreset(value: string | undefined): PromptPresetName | undefined {\n\tif (value && VALID_PRESETS.has(value)) {\n\t\treturn value as PromptPresetName;\n\t}\n\treturn undefined;\n}\n\nexport function loadPromptPresetSettings(settingsManager: SettingsManager): PromptPresetSettings {\n\tconst globalSettings = settingsManager.getGlobalSettings() as SettingsWithPromptPreset;\n\tconst projectSettings = settingsManager.getProjectSettings() as SettingsWithPromptPreset;\n\n\treturn {\n\t\tpromptPreset:\n\t\t\tparsePromptPreset(projectSettings.promptPreset) ?? parsePromptPreset(globalSettings.promptPreset) ?? \"auto\",\n\t};\n}\n"]}
1
+ {"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/settings.ts"],"names":[],"mappings":"AAkCA,MAAM,aAAa,GAAwB,IAAI,GAAG,CAAmB;IACpE,MAAM;IACN,gBAAgB;IAChB,kBAAkB;IAClB,eAAe;IACf,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;IACjB,mBAAmB;IACnB,wBAAwB;IACxB,iBAAiB;IACjB,SAAS;IACT,SAAS;IACT,UAAU;IACV,UAAU;IACV,SAAS;IACT,WAAW;IACX,WAAW;IACX,OAAO;IACP,SAAS;IACT,eAAe;IACf,SAAS;IACT,SAAS;IACT,SAAS;CACT,CAAC,CAAC;AAEH,MAAM,UAAU,iBAAiB,CAAC,KAAyB;IAC1D,IAAI,KAAK,IAAI,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;QACvC,OAAO,KAAyB,CAAC;IAClC,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,eAAgC;IACxE,MAAM,cAAc,GAAG,eAAe,CAAC,iBAAiB,EAA8B,CAAC;IACvF,MAAM,eAAe,GAAG,eAAe,CAAC,kBAAkB,EAA8B,CAAC;IAEzF,OAAO;QACN,YAAY,EACX,iBAAiB,CAAC,eAAe,CAAC,YAAY,CAAC,IAAI,iBAAiB,CAAC,cAAc,CAAC,YAAY,CAAC,IAAI,MAAM;KAC5G,CAAC;AACH,CAAC","sourcesContent":["import type { Settings, SettingsManager } from \"../../../settings-manager.ts\";\n\nexport type PromptPresetName =\n\t| \"auto\"\n\t| \"claude-fable-5\"\n\t| \"claude-fable-5-1\"\n\t| \"claude-opus-5\"\n\t| \"claude-opus-4-8\"\n\t| \"claude-opus-4-7\"\n\t| \"claude-opus-4-6\"\n\t| \"claude-opus-4-5\"\n\t| \"deepseek-v4-flash\"\n\t| \"deepseek-v4-flash-0731\"\n\t| \"deepseek-v4-pro\"\n\t| \"glm-5.2\"\n\t| \"glm-5.3\"\n\t| \"grok-4.5\"\n\t| \"grok-4.6\"\n\t| \"kimi-k3\"\n\t| \"kimi-k2-7\"\n\t| \"kimi-k2-6\"\n\t| \"gpt-5\"\n\t| \"gpt-5.2\"\n\t| \"gpt-5.3-codex\"\n\t| \"gpt-5.4\"\n\t| \"gpt-5.5\"\n\t| \"gpt-5.6\";\n\nexport interface PromptPresetSettings {\n\tpromptPreset: PromptPresetName;\n}\n\ntype SettingsWithPromptPreset = Settings & { promptPreset?: string };\n\nconst VALID_PRESETS: ReadonlySet<string> = new Set<PromptPresetName>([\n\t\"auto\",\n\t\"claude-fable-5\",\n\t\"claude-fable-5-1\",\n\t\"claude-opus-5\",\n\t\"claude-opus-4-8\",\n\t\"claude-opus-4-7\",\n\t\"claude-opus-4-6\",\n\t\"claude-opus-4-5\",\n\t\"deepseek-v4-flash\",\n\t\"deepseek-v4-flash-0731\",\n\t\"deepseek-v4-pro\",\n\t\"glm-5.2\",\n\t\"glm-5.3\",\n\t\"grok-4.5\",\n\t\"grok-4.6\",\n\t\"kimi-k3\",\n\t\"kimi-k2-7\",\n\t\"kimi-k2-6\",\n\t\"gpt-5\",\n\t\"gpt-5.2\",\n\t\"gpt-5.3-codex\",\n\t\"gpt-5.4\",\n\t\"gpt-5.5\",\n\t\"gpt-5.6\",\n]);\n\nexport function parsePromptPreset(value: string | undefined): PromptPresetName | undefined {\n\tif (value && VALID_PRESETS.has(value)) {\n\t\treturn value as PromptPresetName;\n\t}\n\treturn undefined;\n}\n\nexport function loadPromptPresetSettings(settingsManager: SettingsManager): PromptPresetSettings {\n\tconst globalSettings = settingsManager.getGlobalSettings() as SettingsWithPromptPreset;\n\tconst projectSettings = settingsManager.getProjectSettings() as SettingsWithPromptPreset;\n\n\treturn {\n\t\tpromptPreset:\n\t\t\tparsePromptPreset(projectSettings.promptPreset) ?? parsePromptPreset(globalSettings.promptPreset) ?? \"auto\",\n\t};\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { ExtensionAPI } from "../../types.ts";
2
- export declare const RECOMMENDED_DEFAULT_MODELS: readonly [readonly ["kimi-k3", "max"], readonly ["gpt-5.6-sol", "medium"], readonly ["claude-fable-5", "high"], readonly ["claude-opus-5", "xhigh"], readonly ["glm-5.2", "max"]];
2
+ export declare const RECOMMENDED_DEFAULT_MODELS: readonly [readonly ["kimi-k3", "max"], readonly ["gpt-5.6-sol", "medium"], readonly ["claude-fable-5-1", "high"], readonly ["claude-opus-5", "xhigh"], readonly ["glm-5.2", "max"]];
3
3
  export declare function canonicalModelId(modelId: string): string;
4
4
  export default function recommendedModelsExtension(pi: ExtensionAPI): void;
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/recommended-models/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAuC,MAAM,gBAAgB,CAAC;AAWxF,eAAO,MAAM,0BAA0B,mLAM6B,CAAC;AAWrE,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAcxD;AAwCD,MAAM,CAAC,OAAO,UAAU,0BAA0B,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CA6EzE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/recommended-models/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAuC,MAAM,gBAAgB,CAAC;AAWxF,eAAO,MAAM,0BAA0B,qLAM6B,CAAC;AAWrE,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAcxD;AAwCD,MAAM,CAAC,OAAO,UAAU,0BAA0B,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CA6EzE"}
@@ -10,7 +10,7 @@ const MODEL_ID_SUFFIXES = ["-ultrafast", "-unlocked", "-256k", "-fast"];
10
10
  export const RECOMMENDED_DEFAULT_MODELS = [
11
11
  ["kimi-k3", "max"],
12
12
  ["gpt-5.6-sol", "medium"],
13
- ["claude-fable-5", "high"],
13
+ ["claude-fable-5-1", "high"],
14
14
  ["claude-opus-5", "xhigh"],
15
15
  ["glm-5.2", "max"],
16
16
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/recommended-models/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAG/D,MAAM,SAAS,GAAG,uBAAuB,CAAC;AAC1C,yFAAyF;AACzF,qFAAqF;AACrF,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAA2D;IAChG,kBAAkB;IAClB,iBAAiB;CACjB,CAAC,CAAC;AACH,MAAM,iBAAiB,GAAG,CAAC,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,CAAU,CAAC;AAEjF,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACzC,CAAC,SAAS,EAAE,KAAK,CAAC;IAClB,CAAC,aAAa,EAAE,QAAQ,CAAC;IACzB,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAC1B,CAAC,eAAe,EAAE,OAAO,CAAC;IAC1B,CAAC,SAAS,EAAE,KAAK,CAAC;CACiD,CAAC;AAIrE,MAAM,uBAAuB,GAAgC,0BAA0B,CAAC,GAAG,CAC1F,CAAC,CAAC,OAAO,EAAE,aAAa,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC,CAC1D,CAAC;AACF,MAAM,mCAAmC,GAAG,IAAI,GAAG,CAClD,uBAAuB,CAAC,GAAG,CAAC,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,cAAc,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CACzF,CAAC;AAEF,MAAM,UAAU,gBAAgB,CAAC,OAAe;IAC/C,IAAI,SAAS,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IACtC,IAAI,cAAc,GAAG,IAAI,CAAC;IAC1B,OAAO,cAAc,EAAE,CAAC;QACvB,cAAc,GAAG,KAAK,CAAC;QACvB,KAAK,MAAM,MAAM,IAAI,iBAAiB,EAAE,CAAC;YACxC,IAAI,SAAS,CAAC,QAAQ,CAAC,MA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gBAAgB,CAAC,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;YAC1D,CAAC;iBAAM,CAAC;gBACP,EAAE,CAAC,uBAAuB,CAAC,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;YACjE,CAAC;YACD,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,kCAAkC,MAAM,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QAC9E,CAAC;gBAAS,CAAC;YACV,kBAAkB,GAAG,KAAK,CAAC;QAC5B,CAAC;IACF,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,EAAE,CAAC,cAAc,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QACpC,IAAI,CAAC,WAAW,IAAI,QAAQ,IAAI,QAAQ,IAAI,kBAAkB,IAAI,CAAC,aAAa,EAAE,CAAC;YAClF,OAAO;QACR,CAAC;QACD,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;YACxD,QAAQ,GAAG,IAAI,CAAC;YAChB,OAAO;QACR,CAAC;QACD,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,KAAK,EAAE,eAAe,CAAC,EAAE,CAAC;YAClD,mCAAmC,CAAC,GAAG,CAAC,CAAC;QAC1C,CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type { ThinkingLevel } from \"@earendil-works/pi-agent-core\";\nimport type { Api, Model } from \"@earendil-works/pi-ai\";\nimport { SettingsManager } from \"../../../settings-manager.ts\";\nimport type { ExtensionAPI, ExtensionContext, SessionStartEvent } from \"../../types.ts\";\n\nconst FLAG_NAME = \"no-recommended-models\";\n// Only implicit fallbacks auto-switch. A `settings` provenance means the user explicitly\n// configured a system default model, which must be respected rather than overridden.\nconst AUTO_SWITCH_PROVENANCE = new Set<NonNullable<SessionStartEvent[\"initialModelProvenance\"]>>([\n\t\"provider-default\",\n\t\"first-available\",\n]);\nconst MODEL_ID_SUFFIXES = [\"-ultrafast\", \"-unlocked\", \"-256k\", \"-fast\"] as const;\n\nexport const RECOMMENDED_DEFAULT_MODELS = [\n\t[\"kimi-k3\", \"max\"],\n\t[\"gpt-5.6-sol\", \"medium\"],\n\t[\"claude-fable-5\", \"high\"],\n\t[\"claude-opus-5\", \"xhigh\"],\n\t[\"glm-5.2\", \"max\"],\n] as const satisfies ReadonlyArray<readonly [string, ThinkingLevel]>;\n\ntype RecommendedModel = { modelId: string; thinkingLevel: ThinkingLevel };\n\nconst DEFAULT_RECOMMENDATIONS: readonly RecommendedModel[] = RECOMMENDED_DEFAULT_MODELS.map(\n\t([modelId, thinkingLevel]) => ({ modelId, thinkingLevel }),\n);\nconst DEFAULT_RECOMMENDATIONS_BY_MODEL_ID = new Map(\n\tDEFAULT_RECOMMENDATIONS.map((recommendation) => [recommendation.modelId, recommendation]),\n);\n\nexport function canonicalModelId(modelId: string): string {\n\tlet canonical = modelId.toLowerCase();\n\tlet strippedSuffix = true;\n\twhile (strippedSuffix) {\n\t\tstrippedSuffix = false;\n\t\tfor (const suffix of MODEL_ID_SUFFIXES) {\n\t\t\tif (canonical.endsWith(suffix)) {\n\t\t\t\tcanonical = canonical.slice(0, -suffix.length);\n\t\t\t\tstrippedSuffix = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn canonical === \"k3\" ? \"kimi-k3\" : canonical;\n}\n\nfunction recommendationsFor(configuredModelIds: string[] | undefined): readonly RecommendedModel[] {\n\tif (configuredModelIds === undefined) {\n\t\treturn DEFAULT_RECOMMENDATIONS;\n\t}\n\treturn configuredModelIds\n\t\t.map(canonicalModelId)\n\t\t.filter((modelId) => modelId.length > 0)\n\t\t.map(\n\t\t\t(modelId): RecommendedModel =>\n\t\t\t\tDEFAULT_RECOMMENDATIONS_BY_MODEL_ID.get(modelId) ?? { modelId, thinkingLevel: \"medium\" },\n\t\t);\n}\n\nfunction findAvailableRecommendation(\n\trecommendations: readonly RecommendedModel[],\n\tctx: ExtensionContext,\n): { recommendation: RecommendedModel; model: Model<Api> } | undefined {\n\tconst available = ctx.modelRegistry.getAvailable().filter((model) => ctx.modelRegistry.hasConfiguredAuth(model));\n\tfor (const recommendation of recommendations) {\n\t\tconst model = available.find((candidate) => canonicalModelId(candidate.id) === recommendation.modelId);\n\t\tif (model) {\n\t\t\treturn { recommendation, model };\n\t\t}\n\t}\n\treturn undefined;\n}\n\nfunction isRecommended(model: Model<Api> | undefined, recommendations: readonly RecommendedModel[]): boolean {\n\treturn (\n\t\tmodel !== undefined &&\n\t\trecommendations.some((recommendation) => canonicalModelId(model.id) === recommendation.modelId)\n\t);\n}\n\nfunction nonRecommendedModelWarning(model: Model<Api> | undefined): string {\n\treturn `Non-recommended model '${model?.id ?? \"<none>\"}': odd behavior is the default state; a working session is the anomaly.`;\n}\n\nexport default function recommendedModelsExtension(pi: ExtensionAPI): void {\n\tpi.registerFlag(FLAG_NAME, {\n\t\ttype: \"boolean\",\n\t\tdefault: false,\n\t\tdescription: \"Disable recommended model selection for this run.\",\n\t});\n\n\tlet initialized = false;\n\tlet disabled = false;\n\tlet disarmed = false;\n\tlet automaticSelection = false;\n\tlet warningShown = false;\n\tlet canAutoSwitch = false;\n\tlet recommendations: readonly RecommendedModel[] = DEFAULT_RECOMMENDATIONS;\n\n\tconst warnWhenNoRecommendationIsAvailable = (ctx: ExtensionContext): void => {\n\t\tif (warningShown || findAvailableRecommendation(recommendations, ctx)) {\n\t\t\treturn;\n\t\t}\n\t\twarningShown = true;\n\t\tctx.ui.notify(nonRecommendedModelWarning(ctx.model), \"warning\");\n\t};\n\n\tpi.on(\"session_start\", async (event, ctx) => {\n\t\tif (initialized) {\n\t\t\treturn;\n\t\t}\n\t\tinitialized = true;\n\n\t\tconst settingsManager = SettingsManager.create(ctx.cwd);\n\t\tdisabled = pi.getFlag(FLAG_NAME) === true || settingsManager.getWarnings().offRecommendedModel === true;\n\t\trecommendations = recommendationsFor(settingsManager.getRecommendedModels());\n\t\tcanAutoSwitch =\n\t\t\tctx.mode !== \"app-server\" &&\n\t\t\tevent.initialModelProvenance !== undefined &&\n\t\t\tAUTO_SWITCH_PROVENANCE.has(event.initialModelProvenance);\n\t\tif (disabled || !canAutoSwitch || isRecommended(ctx.model, recommendations)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst target = findAvailableRecommendation(recommendations, ctx);\n\t\tif (!target) {\n\t\t\twarnWhenNoRecommendationIsAvailable(ctx);\n\t\t\treturn;\n\t\t}\n\n\t\tconst persistAsDefault = ctx.mode === \"tui\";\n\t\tautomaticSelection = true;\n\t\ttry {\n\t\t\tconst switched = persistAsDefault ? await pi.setModel(target.model) : await pi.setSessionModel(target.model);\n\t\t\tif (!switched) {\n\t\t\t\twarnWhenNoRecommendationIsAvailable(ctx);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (persistAsDefault) {\n\t\t\t\tpi.setThinkingLevel(target.recommendation.thinkingLevel);\n\t\t\t} else {\n\t\t\t\tpi.setSessionThinkingLevel(target.recommendation.thinkingLevel);\n\t\t\t}\n\t\t\tctx.ui.notify(`Switched to recommended model '${target.model.id}'.`, \"info\");\n\t\t} finally {\n\t\t\tautomaticSelection = false;\n\t\t}\n\t});\n\n\tpi.on(\"model_select\", (event, ctx) => {\n\t\tif (!initialized || disabled || disarmed || automaticSelection || !canAutoSwitch) {\n\t\t\treturn;\n\t\t}\n\t\tif (event.source === \"set\" || event.source === \"cycle\") {\n\t\t\tdisarmed = true;\n\t\t\treturn;\n\t\t}\n\t\tif (!isRecommended(event.model, recommendations)) {\n\t\t\twarnWhenNoRecommendationIsAvailable(ctx);\n\t\t}\n\t});\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/recommended-models/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAG/D,MAAM,SAAS,GAAG,uBAAuB,CAAC;AAC1C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C,EAAE,CAAC,MAAM,CAAC,kCAAkC,MAAM,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QAC9E,CAAC;gBAAS,CAAC;YACV,kBAAkB,GAAG,KAAK,CAAC;QAC5B,CAAC;IACF,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,EAAE,CAAC,cAAc,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QACpC,IAAI,CAAC,WAAW,IAAI,QAAQ,IAAI,QAAQ,IAAI,kBAAkB,IAAI,CAAC,aAAa,EAAE,CAAC;YAClF,OAAO;QACR,CAAC;QACD,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;YACxD,QAAQ,GAAG,IAAI,CAAC;YAChB,OAAO;QACR,CAAC;QACD,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,KAAK,EAAE,eAAe,CAAC,EAAE,CAAC;YAClD,mCAAmC,CAAC,GAAG,CAAC,CAAC;QAC1C,CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type { ThinkingLevel } from \"@earendil-works/pi-agent-core\";\nimport type { Api, Model } from \"@earendil-works/pi-ai\";\nimport { SettingsManager } from \"../../../settings-manager.ts\";\nimport type { ExtensionAPI, ExtensionContext, SessionStartEvent } from \"../../types.ts\";\n\nconst FLAG_NAME = \"no-recommended-models\";\n// Only implicit fallbacks auto-switch. A `settings` provenance means the user explicitly\n// configured a system default model, which must be respected rather than overridden.\nconst AUTO_SWITCH_PROVENANCE = new Set<NonNullable<SessionStartEvent[\"initialModelProvenance\"]>>([\n\t\"provider-default\",\n\t\"first-available\",\n]);\nconst MODEL_ID_SUFFIXES = [\"-ultrafast\", \"-unlocked\", \"-256k\", \"-fast\"] as const;\n\nexport const RECOMMENDED_DEFAULT_MODELS = [\n\t[\"kimi-k3\", \"max\"],\n\t[\"gpt-5.6-sol\", \"medium\"],\n\t[\"claude-fable-5-1\", \"high\"],\n\t[\"claude-opus-5\", \"xhigh\"],\n\t[\"glm-5.2\", \"max\"],\n] as const satisfies ReadonlyArray<readonly [string, ThinkingLevel]>;\n\ntype RecommendedModel = { modelId: string; thinkingLevel: ThinkingLevel };\n\nconst DEFAULT_RECOMMENDATIONS: readonly RecommendedModel[] = RECOMMENDED_DEFAULT_MODELS.map(\n\t([modelId, thinkingLevel]) => ({ modelId, thinkingLevel }),\n);\nconst DEFAULT_RECOMMENDATIONS_BY_MODEL_ID = new Map(\n\tDEFAULT_RECOMMENDATIONS.map((recommendation) => [recommendation.modelId, recommendation]),\n);\n\nexport function canonicalModelId(modelId: string): string {\n\tlet canonical = modelId.toLowerCase();\n\tlet strippedSuffix = true;\n\twhile (strippedSuffix) {\n\t\tstrippedSuffix = false;\n\t\tfor (const suffix of MODEL_ID_SUFFIXES) {\n\t\t\tif (canonical.endsWith(suffix)) {\n\t\t\t\tcanonical = canonical.slice(0, -suffix.length);\n\t\t\t\tstrippedSuffix = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn canonical === \"k3\" ? \"kimi-k3\" : canonical;\n}\n\nfunction recommendationsFor(configuredModelIds: string[] | undefined): readonly RecommendedModel[] {\n\tif (configuredModelIds === undefined) {\n\t\treturn DEFAULT_RECOMMENDATIONS;\n\t}\n\treturn configuredModelIds\n\t\t.map(canonicalModelId)\n\t\t.filter((modelId) => modelId.length > 0)\n\t\t.map(\n\t\t\t(modelId): RecommendedModel =>\n\t\t\t\tDEFAULT_RECOMMENDATIONS_BY_MODEL_ID.get(modelId) ?? { modelId, thinkingLevel: \"medium\" },\n\t\t);\n}\n\nfunction findAvailableRecommendation(\n\trecommendations: readonly RecommendedModel[],\n\tctx: ExtensionContext,\n): { recommendation: RecommendedModel; model: Model<Api> } | undefined {\n\tconst available = ctx.modelRegistry.getAvailable().filter((model) => ctx.modelRegistry.hasConfiguredAuth(model));\n\tfor (const recommendation of recommendations) {\n\t\tconst model = available.find((candidate) => canonicalModelId(candidate.id) === recommendation.modelId);\n\t\tif (model) {\n\t\t\treturn { recommendation, model };\n\t\t}\n\t}\n\treturn undefined;\n}\n\nfunction isRecommended(model: Model<Api> | undefined, recommendations: readonly RecommendedModel[]): boolean {\n\treturn (\n\t\tmodel !== undefined &&\n\t\trecommendations.some((recommendation) => canonicalModelId(model.id) === recommendation.modelId)\n\t);\n}\n\nfunction nonRecommendedModelWarning(model: Model<Api> | undefined): string {\n\treturn `Non-recommended model '${model?.id ?? \"<none>\"}': odd behavior is the default state; a working session is the anomaly.`;\n}\n\nexport default function recommendedModelsExtension(pi: ExtensionAPI): void {\n\tpi.registerFlag(FLAG_NAME, {\n\t\ttype: \"boolean\",\n\t\tdefault: false,\n\t\tdescription: \"Disable recommended model selection for this run.\",\n\t});\n\n\tlet initialized = false;\n\tlet disabled = false;\n\tlet disarmed = false;\n\tlet automaticSelection = false;\n\tlet warningShown = false;\n\tlet canAutoSwitch = false;\n\tlet recommendations: readonly RecommendedModel[] = DEFAULT_RECOMMENDATIONS;\n\n\tconst warnWhenNoRecommendationIsAvailable = (ctx: ExtensionContext): void => {\n\t\tif (warningShown || findAvailableRecommendation(recommendations, ctx)) {\n\t\t\treturn;\n\t\t}\n\t\twarningShown = true;\n\t\tctx.ui.notify(nonRecommendedModelWarning(ctx.model), \"warning\");\n\t};\n\n\tpi.on(\"session_start\", async (event, ctx) => {\n\t\tif (initialized) {\n\t\t\treturn;\n\t\t}\n\t\tinitialized = true;\n\n\t\tconst settingsManager = SettingsManager.create(ctx.cwd);\n\t\tdisabled = pi.getFlag(FLAG_NAME) === true || settingsManager.getWarnings().offRecommendedModel === true;\n\t\trecommendations = recommendationsFor(settingsManager.getRecommendedModels());\n\t\tcanAutoSwitch =\n\t\t\tctx.mode !== \"app-server\" &&\n\t\t\tevent.initialModelProvenance !== undefined &&\n\t\t\tAUTO_SWITCH_PROVENANCE.has(event.initialModelProvenance);\n\t\tif (disabled || !canAutoSwitch || isRecommended(ctx.model, recommendations)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst target = findAvailableRecommendation(recommendations, ctx);\n\t\tif (!target) {\n\t\t\twarnWhenNoRecommendationIsAvailable(ctx);\n\t\t\treturn;\n\t\t}\n\n\t\tconst persistAsDefault = ctx.mode === \"tui\";\n\t\tautomaticSelection = true;\n\t\ttry {\n\t\t\tconst switched = persistAsDefault ? await pi.setModel(target.model) : await pi.setSessionModel(target.model);\n\t\t\tif (!switched) {\n\t\t\t\twarnWhenNoRecommendationIsAvailable(ctx);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (persistAsDefault) {\n\t\t\t\tpi.setThinkingLevel(target.recommendation.thinkingLevel);\n\t\t\t} else {\n\t\t\t\tpi.setSessionThinkingLevel(target.recommendation.thinkingLevel);\n\t\t\t}\n\t\t\tctx.ui.notify(`Switched to recommended model '${target.model.id}'.`, \"info\");\n\t\t} finally {\n\t\t\tautomaticSelection = false;\n\t\t}\n\t});\n\n\tpi.on(\"model_select\", (event, ctx) => {\n\t\tif (!initialized || disabled || disarmed || automaticSelection || !canAutoSwitch) {\n\t\t\treturn;\n\t\t}\n\t\tif (event.source === \"set\" || event.source === \"cycle\") {\n\t\t\tdisarmed = true;\n\t\t\treturn;\n\t\t}\n\t\tif (!isRecommended(event.model, recommendations)) {\n\t\t\twarnWhenNoRecommendationIsAvailable(ctx);\n\t\t}\n\t});\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"provider-composer.d.ts","sourceRoot":"","sources":["../../src/core/provider-composer.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,GAAG,EACR,KAAK,2BAA2B,EAChC,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,OAAO,EAMZ,KAAK,KAAK,EAEV,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB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CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,CAAC;IAC3C,UAAU,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,iCAAiC,CAChD,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,EACjB,MAAM,EAAE,kBAAkB,GAAG,SAAS,EACtC,SAAS,EAAE,mBAAmB,GAAG,SAAS,EAC1C,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC1B,0BAA0B,CAoB5B;AAED,wBAAgB,2BAA2B,CAC1C,MAAM,EAAE,kBAAkB,GAAG,SAAS,EACtC,SAAS,EAAE,mBAAmB,GAAG,SAAS,GACxC,UAAU,GAAG,SAAS,CAaxB"}
@@ -85,7 +85,7 @@ function modelFromJson(providerId, definition, providerConfig, defaults) {
85
85
  compat: mergeCompat(providerConfig.compat, definition.compat),
86
86
  };
87
87
  }
88
- function applyModelsJson(providerId, baseModels, config) {
88
+ function applyModelsJson(providerId, baseModels, config, extension) {
89
89
  if (!config)
90
90
  return [...baseModels];
91
91
  const hasOverrides = config.modelOverrides && Object.keys(config.modelOverrides).length > 0;
@@ -111,7 +111,11 @@ function applyModelsJson(providerId, baseModels, config) {
111
111
  for (const definition of config.models ?? []) {
112
112
  const existingIndex = models.findIndex((model) => model.id === definition.id);
113
113
  const defaults = existingIndex >= 0 ? models[existingIndex] : models[0];
114
- const model = modelFromJson(providerId, definition, config, defaults);
114
+ const model = modelFromJson(providerId, definition, config, {
115
+ ...defaults,
116
+ api: extension?.api ?? defaults?.api,
117
+ baseUrl: extension?.baseUrl ?? defaults?.baseUrl,
118
+ });
115
119
  if (existingIndex >= 0)
116
120
  models[existingIndex] = model;
117
121
  else
@@ -121,13 +125,14 @@ function applyModelsJson(providerId, baseModels, config) {
121
125
  const blacklist = config.blacklist ? new Set(config.blacklist) : undefined;
122
126
  return models.filter((model) => (whitelist === undefined || whitelist.has(model.id)) && (blacklist === undefined || !blacklist.has(model.id)));
123
127
  }
124
- function applyExtension(providerId, models, config) {
128
+ function applyExtension(providerId, models, config, customModelIds) {
125
129
  if (!config)
126
130
  return [...models];
127
131
  if (!config.models) {
128
132
  return config.baseUrl ? models.map((model) => ({ ...model, baseUrl: config.baseUrl })) : [...models];
129
133
  }
130
- return config.models.map((definition) => {
134
+ const declaredModels = config.models;
135
+ const extensionModels = declaredModels.map((definition) => {
131
136
  const defaults = models.find((model) => model.id === definition.id) ?? models[0];
132
137
  const api = definition.api ?? config.api ?? defaults?.api;
133
138
  if (!api) {
@@ -144,6 +149,10 @@ function applyExtension(providerId, models, config) {
144
149
  headers: undefined,
145
150
  };
146
151
  });
152
+ return [
153
+ ...extensionModels,
154
+ ...models.filter((model) => customModelIds.has(model.id) && !declaredModels.some((definition) => definition.id === model.id)),
155
+ ];
147
156
  }
148
157
  function adaptOAuth(config) {
149
158
  return {
@@ -206,7 +215,7 @@ export function validateExtensionProvider(providerId, base, modelsConfig, extens
206
215
  if (extension.streamSimple && !extension.api) {
207
216
  throw new Error(`Provider ${providerId}: "api" is required when registering streamSimple.`);
208
217
  }
209
- applyExtension(providerId, applyModelsJson(providerId, base?.getModels() ?? [], modelsConfig), extension);
218
+ applyExtension(providerId, applyModelsJson(providerId, base?.getModels() ?? [], modelsConfig, extension), extension, new Set((modelsConfig?.models ?? []).map((definition) => definition.id)));
210
219
  }
211
220
  /** Compose built-in, models.json, and extension layers without reading credentials. */
212
221
  export function composeModelProvider(providerId, base, modelConfig, extension) {
@@ -217,7 +226,7 @@ export function composeModelProvider(providerId, base, modelConfig, extension) {
217
226
  // models.json modelOverrides are the topmost user-config layer: they apply once,
218
227
  // after custom-model upserts, extension model replacement, and legacy OAuth projection.
219
228
  const getModels = () => {
220
- let models = applyExtension(providerId, applyModelsJson(providerId, base?.getModels() ?? [], config), currentExtension());
229
+ let models = applyExtension(providerId, applyModelsJson(providerId, base?.getModels() ?? [], config, currentExtension()), currentExtension(), new Set((config?.models ?? []).map((definition) => definition.id)));
221
230
  if (extensionOAuthCredential && extension?.oauth?.modifyModels) {
222
231
  models = extension.oauth.modifyModels(models, extensionOAuthCredential);
223
232
  }
@@ -282,10 +291,10 @@ export function composeModelProvider(providerId, base, modelConfig, extension) {
282
291
  update: () => {
283
292
  if (refreshed) {
284
293
  // Validate before publishing the new synchronous list.
285
- applyExtension(providerId, applyModelsJson(providerId, base?.getModels() ?? [], config), {
294
+ applyExtension(providerId, applyModelsJson(providerId, base?.getModels() ?? [], config, extension), {
286
295
  ...extension,
287
296
  models: refreshed,
288
- });
297
+ }, new Set((config?.models ?? []).map((definition) => definition.id)));
289
298
  refreshedExtensionModels = refreshed;
290
299
  }
291
300
  extensionOAuthCredential = oauthCredential;