@tyvm/knowhow 0.0.68 → 0.0.70

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 (215) hide show
  1. package/docs/shell-commands.md +174 -0
  2. package/package.json +2 -2
  3. package/src/agents/base/base.ts +1 -3
  4. package/src/agents/developer/developer.ts +21 -16
  5. package/src/agents/tools/agentCall.ts +4 -2
  6. package/src/agents/tools/fileSearch.ts +5 -1
  7. package/src/agents/tools/list.ts +41 -37
  8. package/src/agents/tools/startAgentTask.ts +131 -22
  9. package/src/chat/CliChatService.ts +57 -11
  10. package/src/chat/modules/AgentModule.ts +72 -12
  11. package/src/chat/modules/CustomCommandsModule.ts +79 -0
  12. package/src/chat/modules/InternalChatModule.ts +11 -1
  13. package/src/chat/modules/ShellCommandModule.ts +96 -0
  14. package/src/chat/modules/index.ts +1 -0
  15. package/src/chat/types.ts +14 -2
  16. package/src/chat.ts +16 -13
  17. package/src/cli.ts +16 -6
  18. package/src/clients/anthropic.ts +88 -91
  19. package/src/clients/gemini.ts +495 -94
  20. package/src/clients/index.ts +125 -0
  21. package/src/clients/knowhow.ts +81 -0
  22. package/src/clients/openai.ts +256 -145
  23. package/src/clients/pricing/anthropic.ts +90 -0
  24. package/src/clients/pricing/google.ts +65 -0
  25. package/src/clients/pricing/index.ts +4 -0
  26. package/src/clients/pricing/openai.ts +134 -0
  27. package/src/clients/pricing/xai.ts +62 -0
  28. package/src/clients/types.ts +170 -1
  29. package/src/clients/xai.ts +275 -46
  30. package/src/config.ts +61 -15
  31. package/src/embeddings.ts +9 -1
  32. package/src/microphone.ts +15 -16
  33. package/src/migrations.ts +151 -0
  34. package/src/plugins/AgentsMdPlugin.ts +118 -0
  35. package/src/plugins/PluginBase.ts +8 -0
  36. package/src/plugins/downloader/downloader.ts +5 -6
  37. package/src/plugins/embedding.ts +10 -8
  38. package/src/plugins/exec.ts +70 -0
  39. package/src/plugins/github.ts +120 -74
  40. package/src/plugins/language.ts +11 -13
  41. package/src/plugins/plugins.ts +25 -4
  42. package/src/plugins/tmux.ts +132 -0
  43. package/src/plugins/types.ts +1 -0
  44. package/src/plugins/vim.ts +14 -1
  45. package/src/server/index.ts +2 -0
  46. package/src/services/AgentSyncFs.ts +417 -0
  47. package/src/services/{AgentSynchronization.ts → AgentSyncKnowhowWeb.ts} +2 -2
  48. package/src/services/EventService.ts +0 -1
  49. package/src/services/KnowhowClient.ts +106 -0
  50. package/src/services/index.ts +4 -2
  51. package/src/types.ts +57 -4
  52. package/src/worker.ts +25 -2
  53. package/tests/manual/modalities/README.md +157 -0
  54. package/tests/manual/modalities/google.modalities.test.ts +335 -0
  55. package/tests/manual/modalities/openai.modalities.test.ts +329 -0
  56. package/tests/manual/modalities/streaming.test.ts +260 -0
  57. package/tests/manual/modalities/xai.modalities.test.ts +307 -0
  58. package/tests/plugins/language/languagePlugin-content-triggers.test.ts +5 -5
  59. package/tests/plugins/language/languagePlugin-integration.test.ts +1 -1
  60. package/tests/plugins/language/languagePlugin.test.ts +17 -8
  61. package/ts_build/package.json +2 -2
  62. package/ts_build/src/agents/base/base.js +1 -1
  63. package/ts_build/src/agents/base/base.js.map +1 -1
  64. package/ts_build/src/agents/developer/developer.js +21 -15
  65. package/ts_build/src/agents/developer/developer.js.map +1 -1
  66. package/ts_build/src/agents/tools/agentCall.js +4 -2
  67. package/ts_build/src/agents/tools/agentCall.js.map +1 -1
  68. package/ts_build/src/agents/tools/executeScript/index.d.ts +1 -1
  69. package/ts_build/src/agents/tools/fileSearch.js +2 -1
  70. package/ts_build/src/agents/tools/fileSearch.js.map +1 -1
  71. package/ts_build/src/agents/tools/github/index.d.ts +1 -1
  72. package/ts_build/src/agents/tools/list.js +41 -37
  73. package/ts_build/src/agents/tools/list.js.map +1 -1
  74. package/ts_build/src/agents/tools/startAgentTask.d.ts +2 -1
  75. package/ts_build/src/agents/tools/startAgentTask.js +118 -17
  76. package/ts_build/src/agents/tools/startAgentTask.js.map +1 -1
  77. package/ts_build/src/chat/CliChatService.d.ts +4 -0
  78. package/ts_build/src/chat/CliChatService.js +39 -5
  79. package/ts_build/src/chat/CliChatService.js.map +1 -1
  80. package/ts_build/src/chat/modules/AgentModule.d.ts +4 -1
  81. package/ts_build/src/chat/modules/AgentModule.js +49 -11
  82. package/ts_build/src/chat/modules/AgentModule.js.map +1 -1
  83. package/ts_build/src/chat/modules/CustomCommandsModule.d.ts +9 -0
  84. package/ts_build/src/chat/modules/CustomCommandsModule.js +58 -0
  85. package/ts_build/src/chat/modules/CustomCommandsModule.js.map +1 -0
  86. package/ts_build/src/chat/modules/InternalChatModule.d.ts +2 -0
  87. package/ts_build/src/chat/modules/InternalChatModule.js +10 -0
  88. package/ts_build/src/chat/modules/InternalChatModule.js.map +1 -1
  89. package/ts_build/src/chat/modules/ShellCommandModule.d.ts +8 -0
  90. package/ts_build/src/chat/modules/ShellCommandModule.js +83 -0
  91. package/ts_build/src/chat/modules/ShellCommandModule.js.map +1 -0
  92. package/ts_build/src/chat/modules/index.d.ts +1 -0
  93. package/ts_build/src/chat/modules/index.js +3 -1
  94. package/ts_build/src/chat/modules/index.js.map +1 -1
  95. package/ts_build/src/chat/types.d.ts +11 -1
  96. package/ts_build/src/chat.js +16 -13
  97. package/ts_build/src/chat.js.map +1 -1
  98. package/ts_build/src/cli.js +10 -3
  99. package/ts_build/src/cli.js.map +1 -1
  100. package/ts_build/src/clients/anthropic.d.ts +6 -1
  101. package/ts_build/src/clients/anthropic.js +47 -92
  102. package/ts_build/src/clients/anthropic.js.map +1 -1
  103. package/ts_build/src/clients/gemini.d.ts +81 -2
  104. package/ts_build/src/clients/gemini.js +362 -79
  105. package/ts_build/src/clients/gemini.js.map +1 -1
  106. package/ts_build/src/clients/index.d.ts +9 -1
  107. package/ts_build/src/clients/index.js +65 -0
  108. package/ts_build/src/clients/index.js.map +1 -1
  109. package/ts_build/src/clients/knowhow.d.ts +9 -1
  110. package/ts_build/src/clients/knowhow.js +43 -0
  111. package/ts_build/src/clients/knowhow.js.map +1 -1
  112. package/ts_build/src/clients/openai.d.ts +9 -1
  113. package/ts_build/src/clients/openai.js +201 -133
  114. package/ts_build/src/clients/openai.js.map +1 -1
  115. package/ts_build/src/clients/pricing/anthropic.d.ts +17 -0
  116. package/ts_build/src/clients/pricing/anthropic.js +93 -0
  117. package/ts_build/src/clients/pricing/anthropic.js.map +1 -0
  118. package/ts_build/src/clients/pricing/google.d.ts +73 -0
  119. package/ts_build/src/clients/pricing/google.js +68 -0
  120. package/ts_build/src/clients/pricing/google.js.map +1 -0
  121. package/ts_build/src/clients/pricing/index.d.ts +4 -0
  122. package/ts_build/src/clients/pricing/index.js +14 -0
  123. package/ts_build/src/clients/pricing/index.js.map +1 -0
  124. package/ts_build/src/clients/pricing/openai.d.ts +7 -0
  125. package/ts_build/src/clients/pricing/openai.js +137 -0
  126. package/ts_build/src/clients/pricing/openai.js.map +1 -0
  127. package/ts_build/src/clients/pricing/xai.d.ts +26 -0
  128. package/ts_build/src/clients/pricing/xai.js +59 -0
  129. package/ts_build/src/clients/pricing/xai.js.map +1 -0
  130. package/ts_build/src/clients/types.d.ts +135 -0
  131. package/ts_build/src/clients/xai.d.ts +9 -1
  132. package/ts_build/src/clients/xai.js +178 -46
  133. package/ts_build/src/clients/xai.js.map +1 -1
  134. package/ts_build/src/config.d.ts +1 -0
  135. package/ts_build/src/config.js +45 -16
  136. package/ts_build/src/config.js.map +1 -1
  137. package/ts_build/src/embeddings.js +8 -1
  138. package/ts_build/src/embeddings.js.map +1 -1
  139. package/ts_build/src/microphone.js +7 -9
  140. package/ts_build/src/microphone.js.map +1 -1
  141. package/ts_build/src/migrations.d.ts +17 -0
  142. package/ts_build/src/migrations.js +86 -0
  143. package/ts_build/src/migrations.js.map +1 -0
  144. package/ts_build/src/plugins/AgentsMdPlugin.d.ts +13 -0
  145. package/ts_build/src/plugins/AgentsMdPlugin.js +118 -0
  146. package/ts_build/src/plugins/AgentsMdPlugin.js.map +1 -0
  147. package/ts_build/src/plugins/PluginBase.d.ts +1 -0
  148. package/ts_build/src/plugins/PluginBase.js +3 -0
  149. package/ts_build/src/plugins/PluginBase.js.map +1 -1
  150. package/ts_build/src/plugins/downloader/downloader.js +5 -5
  151. package/ts_build/src/plugins/downloader/downloader.js.map +1 -1
  152. package/ts_build/src/plugins/embedding.js +9 -8
  153. package/ts_build/src/plugins/embedding.js.map +1 -1
  154. package/ts_build/src/plugins/exec.d.ts +10 -0
  155. package/ts_build/src/plugins/exec.js +56 -0
  156. package/ts_build/src/plugins/exec.js.map +1 -0
  157. package/ts_build/src/plugins/github.js +93 -51
  158. package/ts_build/src/plugins/github.js.map +1 -1
  159. package/ts_build/src/plugins/language.js +14 -11
  160. package/ts_build/src/plugins/language.js.map +1 -1
  161. package/ts_build/src/plugins/plugins.d.ts +1 -0
  162. package/ts_build/src/plugins/plugins.js +19 -1
  163. package/ts_build/src/plugins/plugins.js.map +1 -1
  164. package/ts_build/src/plugins/tmux.d.ts +14 -0
  165. package/ts_build/src/plugins/tmux.js +108 -0
  166. package/ts_build/src/plugins/tmux.js.map +1 -0
  167. package/ts_build/src/plugins/types.d.ts +1 -0
  168. package/ts_build/src/plugins/vim.js +11 -1
  169. package/ts_build/src/plugins/vim.js.map +1 -1
  170. package/ts_build/src/server/index.js.map +1 -1
  171. package/ts_build/src/services/AgentSyncFs.d.ts +34 -0
  172. package/ts_build/src/services/AgentSyncFs.js +325 -0
  173. package/ts_build/src/services/AgentSyncFs.js.map +1 -0
  174. package/ts_build/src/services/AgentSyncKnowhowWeb.d.ts +29 -0
  175. package/ts_build/src/services/AgentSyncKnowhowWeb.js +178 -0
  176. package/ts_build/src/services/AgentSyncKnowhowWeb.js.map +1 -0
  177. package/ts_build/src/services/AgentSynchronization.d.ts +1 -1
  178. package/ts_build/src/services/AgentSynchronization.js +3 -3
  179. package/ts_build/src/services/AgentSynchronization.js.map +1 -1
  180. package/ts_build/src/services/EventService.js.map +1 -1
  181. package/ts_build/src/services/KnowhowClient.d.ts +9 -1
  182. package/ts_build/src/services/KnowhowClient.js +58 -0
  183. package/ts_build/src/services/KnowhowClient.js.map +1 -1
  184. package/ts_build/src/services/index.d.ts +2 -1
  185. package/ts_build/src/services/index.js +2 -1
  186. package/ts_build/src/services/index.js.map +1 -1
  187. package/ts_build/src/types.d.ts +26 -1
  188. package/ts_build/src/types.js +45 -4
  189. package/ts_build/src/types.js.map +1 -1
  190. package/ts_build/src/utils/PersistentInputManager.d.ts +28 -0
  191. package/ts_build/src/utils/PersistentInputManager.js +293 -0
  192. package/ts_build/src/utils/PersistentInputManager.js.map +1 -0
  193. package/ts_build/src/worker.js +11 -2
  194. package/ts_build/src/worker.js.map +1 -1
  195. package/ts_build/tests/manual/modalities/google.modalities.test.d.ts +1 -0
  196. package/ts_build/tests/manual/modalities/google.modalities.test.js +252 -0
  197. package/ts_build/tests/manual/modalities/google.modalities.test.js.map +1 -0
  198. package/ts_build/tests/manual/modalities/openai.modalities.test.d.ts +1 -0
  199. package/ts_build/tests/manual/modalities/openai.modalities.test.js +252 -0
  200. package/ts_build/tests/manual/modalities/openai.modalities.test.js.map +1 -0
  201. package/ts_build/tests/manual/modalities/streaming.test.d.ts +1 -0
  202. package/ts_build/tests/manual/modalities/streaming.test.js +206 -0
  203. package/ts_build/tests/manual/modalities/streaming.test.js.map +1 -0
  204. package/ts_build/tests/manual/modalities/xai.modalities.test.d.ts +1 -0
  205. package/ts_build/tests/manual/modalities/xai.modalities.test.js +226 -0
  206. package/ts_build/tests/manual/modalities/xai.modalities.test.js.map +1 -0
  207. package/ts_build/tests/manual/persistent-input-test.d.ts +1 -0
  208. package/ts_build/tests/manual/persistent-input-test.js +35 -0
  209. package/ts_build/tests/manual/persistent-input-test.js.map +1 -0
  210. package/ts_build/tests/plugins/language/languagePlugin-content-triggers.test.js +5 -5
  211. package/ts_build/tests/plugins/language/languagePlugin-content-triggers.test.js.map +1 -1
  212. package/ts_build/tests/plugins/language/languagePlugin-integration.test.js +1 -1
  213. package/ts_build/tests/plugins/language/languagePlugin-integration.test.js.map +1 -1
  214. package/ts_build/tests/plugins/language/languagePlugin.test.js +17 -7
  215. package/ts_build/tests/plugins/language/languagePlugin.test.js.map +1 -1
package/src/cli.ts CHANGED
@@ -7,7 +7,7 @@ import { Command } from "commander";
7
7
  import { execSync } from "child_process";
8
8
  import { version } from "../package.json";
9
9
  import { generate, embed, upload } from "./index";
10
- import { init } from "./config";
10
+ import { init, migrateConfig } from "./config";
11
11
 
12
12
  import { download, purge } from ".";
13
13
  import { includedTools } from "./agents/tools/list";
@@ -26,6 +26,7 @@ import { startChat } from "./chat";
26
26
  import { askAI } from "./chat-old";
27
27
  import { getConfiguredEmbeddingMap, queryEmbedding } from "./embeddings";
28
28
  import { getConfig } from "./config";
29
+ import { getEnabledPlugins } from "./types";
29
30
  import { marked } from "marked";
30
31
  import { BaseAgent } from "./agents/base/base";
31
32
  import { AskModule } from "./chat/modules/AskModule";
@@ -36,9 +37,16 @@ import { SetupModule } from "./chat/modules/SetupModule";
36
37
  import { CliChatService } from "./chat/CliChatService";
37
38
 
38
39
  async function setupServices() {
39
- const { Agents, Mcp, Clients } = services();
40
+ await migrateConfig();
41
+
42
+ const { Agents, Mcp, Clients, Tools: OldTools } = services();
40
43
  const Tools = new LazyToolsService();
41
44
 
45
+ // We need to wireup the LazyTools to be connected to the same singletons that are in services()
46
+ Tools.setContext({
47
+ ...OldTools.getContext(),
48
+ });
49
+
42
50
  const { Researcher, Developer, Patcher, Setup } = agents({
43
51
  ...services(),
44
52
  Tools,
@@ -85,7 +93,7 @@ async function readStdin(): Promise<string> {
85
93
  async function main() {
86
94
  const program = new Command();
87
95
  const config = await getConfig();
88
- const chatService = new CliChatService(config.plugins);
96
+ const chatService = new CliChatService(getEnabledPlugins(config.plugins));
89
97
 
90
98
  program
91
99
  .name("knowhow")
@@ -114,13 +122,13 @@ async function main() {
114
122
  try {
115
123
  console.log("🔄 Checking for knowhow updates...");
116
124
  console.log(`Current version: ${version}`);
117
-
125
+
118
126
  console.log("📦 Installing latest version from npm...");
119
127
  execSync("npm install -g knowhow@latest", {
120
128
  stdio: "inherit",
121
129
  encoding: "utf-8",
122
130
  });
123
-
131
+
124
132
  console.log("✓ knowhow has been updated successfully!");
125
133
  console.log("Run 'knowhow --version' to see the new version.");
126
134
  } catch (error) {
@@ -195,6 +203,8 @@ async function main() {
195
203
  "10"
196
204
  )
197
205
  .option("--message-id <messageId>", "Knowhow message ID for task tracking")
206
+ .option("--sync-fs", "Enable filesystem-based synchronization")
207
+ .option("--task-id <taskId>", "Pre-generated task ID (used with --sync-fs for predictable agent directory path)")
198
208
  .option("--prompt-file <path>", "Custom prompt template file with {text}")
199
209
  .option("--input <text>", "Task input (fallback to stdin if not provided)")
200
210
  .action(async (options) => {
@@ -255,7 +265,7 @@ async function main() {
255
265
  const askModule = new AskModule();
256
266
  await askModule.initialize(chatService);
257
267
  await askModule.processAIQuery(input, {
258
- plugins: config.plugins,
268
+ plugins: config.plugins.enabled,
259
269
  currentModel: options.model,
260
270
  currentProvider: options.provider,
261
271
  });
@@ -1,5 +1,6 @@
1
1
  import Anthropic from "@anthropic-ai/sdk";
2
2
  import { wait } from "../utils";
3
+ import { AnthropicTextPricing } from "./pricing";
3
4
  import { Models } from "../types";
4
5
  import {
5
6
  GenericClient,
@@ -9,6 +10,14 @@ import {
9
10
  Message,
10
11
  EmbeddingOptions,
11
12
  EmbeddingResponse,
13
+ AudioTranscriptionOptions,
14
+ AudioTranscriptionResponse,
15
+ AudioGenerationOptions,
16
+ AudioGenerationResponse,
17
+ ImageGenerationOptions,
18
+ ImageGenerationResponse,
19
+ VideoGenerationOptions,
20
+ VideoGenerationResponse,
12
21
  } from "./types";
13
22
 
14
23
  type MessageParam = Anthropic.MessageParam;
@@ -37,6 +46,52 @@ export class GenericAnthropicClient implements GenericClient {
37
46
  }
38
47
  }
39
48
 
49
+ /**
50
+ * Clean JSON Schema for Anthropic API compatibility.
51
+ * Removes unsupported fields like additionalProperties, $ref, $defs, positional.
52
+ */
53
+ private cleanSchemaForAnthropic(schema: any): any {
54
+ if (!schema || typeof schema !== 'object') {
55
+ return schema;
56
+ }
57
+
58
+ // Handle arrays
59
+ if (Array.isArray(schema)) {
60
+ return schema.map(item => this.cleanSchemaForAnthropic(item));
61
+ }
62
+
63
+ const cleaned: any = {};
64
+
65
+ for (const key in schema) {
66
+ if (!Object.prototype.hasOwnProperty.call(schema, key)) {
67
+ continue;
68
+ }
69
+
70
+ // Skip unsupported properties
71
+ if (
72
+ key === 'additionalProperties' ||
73
+ key === '$ref' ||
74
+ key === '$defs' ||
75
+ key === 'positional'
76
+ ) {
77
+ continue;
78
+ }
79
+
80
+ const value = schema[key];
81
+
82
+ // Recursively clean nested objects
83
+ if (typeof value === 'object' && value !== null) {
84
+ cleaned[key] = this.cleanSchemaForAnthropic(value);
85
+ }
86
+ // Copy primitive values as-is
87
+ else {
88
+ cleaned[key] = value;
89
+ }
90
+ }
91
+
92
+ return cleaned;
93
+ }
94
+
40
95
  transformTools(tools?: Tool[]): Anthropic.Tool[] {
41
96
  if (!tools) {
42
97
  return [];
@@ -44,7 +99,7 @@ export class GenericAnthropicClient implements GenericClient {
44
99
  const transformed = tools.map((tool) => ({
45
100
  name: tool.function.name || "",
46
101
  description: tool.function.description || "",
47
- input_schema: tool.function.parameters as any,
102
+ input_schema: this.cleanSchemaForAnthropic(tool.function.parameters) as any,
48
103
  }));
49
104
 
50
105
  this.handleToolCaching(transformed);
@@ -294,7 +349,7 @@ export class GenericAnthropicClient implements GenericClient {
294
349
  },
295
350
  ]
296
351
  : undefined,
297
- max_tokens: options.max_tokens || 4096,
352
+ max_tokens: options.max_tokens || 8000,
298
353
  ...(tools.length && {
299
354
  tool_choice: { type: "auto" },
300
355
  tools,
@@ -352,98 +407,14 @@ export class GenericAnthropicClient implements GenericClient {
352
407
  }
353
408
 
354
409
  pricesPerMillion() {
355
- return {
356
- [Models.anthropic.Opus4_6]: {
357
- input: 5.0,
358
- input_gt_200k: 10.0,
359
- cache_write: 6.25,
360
- cache_hit: 0.5,
361
- output: 25.0,
362
- output_gt_200k: 37.5,
363
- },
364
- [Models.anthropic.Sonnet4_6]: {
365
- input: 3.0,
366
- input_gt_200k: 6.0,
367
- cache_write: 3.75,
368
- cache_hit: 0.3,
369
- output: 15.0,
370
- output_gt_200k: 22.5,
371
- },
372
- [Models.anthropic.Opus4_5]: {
373
- input: 5.0,
374
- cache_write: 6.25,
375
- cache_hit: 0.5,
376
- output: 25.0,
377
- },
378
- [Models.anthropic.Opus4_1]: {
379
- input: 15.0,
380
- cache_write: 18.75,
381
- cache_hit: 1.5,
382
- output: 75.0,
383
- },
384
- [Models.anthropic.Opus4]: {
385
- input: 15.0,
386
- cache_write: 18.75,
387
- cache_hit: 1.5,
388
- output: 75.0,
389
- },
390
- [Models.anthropic.Sonnet4]: {
391
- input: 3.0,
392
- input_gt_200k: 6.0,
393
- cache_write: 3.75,
394
- cache_hit: 0.3,
395
- output: 15.0,
396
- output_gt_200k: 22.5,
397
- },
398
- [Models.anthropic.Sonnet4_5]: {
399
- input: 3.0,
400
- input_gt_200k: 6.0,
401
- cache_write: 3.75,
402
- cache_hit: 0.3,
403
- output: 15.0,
404
- output_gt_200k: 22.5,
405
- },
406
- [Models.anthropic.Haiku4_5]: {
407
- input: 1,
408
- cache_write: 1.25,
409
- cache_hit: 0.1,
410
- output: 5,
411
- },
412
- [Models.anthropic.Sonnet3_7]: {
413
- input: 3.0,
414
- cache_write: 3.75,
415
- cache_hit: 0.3,
416
- output: 15.0,
417
- },
418
- [Models.anthropic.Sonnet3_5]: {
419
- input: 3.0,
420
- cache_write: 3.75,
421
- cache_hit: 0.3,
422
- output: 15.0,
423
- },
424
- [Models.anthropic.Haiku3_5]: {
425
- input: 0.8,
426
- cache_write: 1.0,
427
- cache_hit: 0.08,
428
- output: 4.0,
429
- },
430
- [Models.anthropic.Opus3]: {
431
- input: 15.0,
432
- cache_write: 18.75,
433
- cache_hit: 1.5,
434
- output: 75.0,
435
- },
436
- [Models.anthropic.Haiku3]: {
437
- input: 0.25,
438
- cache_write: 0.3125,
439
- cache_hit: 0.025,
440
- output: 1.25,
441
- },
442
- };
410
+ return AnthropicTextPricing;
443
411
  }
444
412
 
445
413
  calculateCost(model: string, usage: Usage): number | undefined {
446
- const p = this.pricesPerMillion()[model];
414
+ const rawP = this.pricesPerMillion()[model];
415
+ // Fall back to pricing file for unknown/newer models
416
+ const fallback = AnthropicTextPricing[model as keyof typeof AnthropicTextPricing];
417
+ const p: any = rawP || fallback || undefined;
447
418
  if (!p) return undefined;
448
419
 
449
420
  const inputTokens = usage.input_tokens ?? 0;
@@ -486,4 +457,30 @@ export class GenericAnthropicClient implements GenericClient {
486
457
  async createEmbedding(options: EmbeddingOptions): Promise<EmbeddingResponse> {
487
458
  throw new Error("Provider does not support embeddings");
488
459
  }
460
+
461
+ async createAudioTranscription(
462
+ options: AudioTranscriptionOptions
463
+ ): Promise<AudioTranscriptionResponse> {
464
+ throw new Error("Anthropic does not support audio transcription");
465
+ }
466
+
467
+ async createAudioGeneration(
468
+ options: AudioGenerationOptions
469
+ ): Promise<AudioGenerationResponse> {
470
+ throw new Error("Anthropic does not support audio generation");
471
+ }
472
+
473
+ async createImageGeneration(
474
+ options: ImageGenerationOptions
475
+ ): Promise<ImageGenerationResponse> {
476
+ throw new Error("Anthropic does not support image generation");
477
+ }
478
+
479
+ async createVideoGeneration(
480
+ options: VideoGenerationOptions
481
+ ): Promise<VideoGenerationResponse> {
482
+ throw new Error(
483
+ "Video generation is not supported by the Anthropic provider."
484
+ );
485
+ }
489
486
  }