la-machina-engine 0.9.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1039,8 +1039,18 @@ var ModelProviderEnum = import_zod.z.enum([
1039
1039
  "openai",
1040
1040
  "google",
1041
1041
  "openai-compatible",
1042
+ // Plan 034 — native per-provider AI SDK adapters. Use these for
1043
+ // any non-OpenAI-native endpoint instead of multiplexing through
1044
+ // openai-compatible (which drops tool_use.input fidelity for
1045
+ // Anthropic-shape streams).
1046
+ "openrouter",
1047
+ "xai",
1048
+ "groq",
1049
+ "gateway",
1042
1050
  "bedrock",
1051
+ // enum only; adapter not yet wired
1043
1052
  "vertex",
1053
+ // enum only; adapter not yet wired
1044
1054
  "proxy"
1045
1055
  ]);
1046
1056
  var StorageProviderEnum = import_zod.z.enum(["local", "r2", "r2-binding"]);
@@ -2008,6 +2018,10 @@ var import_anthropic = require("@ai-sdk/anthropic");
2008
2018
  var import_openai = require("@ai-sdk/openai");
2009
2019
  var import_google = require("@ai-sdk/google");
2010
2020
  var import_openai_compatible = require("@ai-sdk/openai-compatible");
2021
+ var import_ai_sdk_provider = require("@openrouter/ai-sdk-provider");
2022
+ var import_xai = require("@ai-sdk/xai");
2023
+ var import_groq = require("@ai-sdk/groq");
2024
+ var import_gateway = require("@ai-sdk/gateway");
2011
2025
  var AISdkAdapter = class {
2012
2026
  options;
2013
2027
  model = null;
@@ -2086,6 +2100,25 @@ var AISdkAdapter = class {
2086
2100
  modelId
2087
2101
  );
2088
2102
  break;
2103
+ // Plan 034 — native per-provider AI SDK adapters. Each
2104
+ // adapter knows its upstream's streaming shape and
2105
+ // assembles tool_use.input correctly, unlike routing
2106
+ // non-OpenAI-format streams through openai-compatible.
2107
+ case "openrouter":
2108
+ this.model = (0, import_ai_sdk_provider.createOpenRouter)({ apiKey })(modelId);
2109
+ break;
2110
+ case "xai":
2111
+ this.model = (0, import_xai.createXai)({ apiKey, ...baseURL !== void 0 ? { baseURL } : {} })(modelId);
2112
+ break;
2113
+ case "groq":
2114
+ this.model = (0, import_groq.createGroq)({ apiKey, ...baseURL !== void 0 ? { baseURL } : {} })(modelId);
2115
+ break;
2116
+ case "gateway":
2117
+ if (typeof process !== "undefined" && process.env !== void 0) {
2118
+ process.env.AI_GATEWAY_API_KEY = apiKey;
2119
+ }
2120
+ this.model = (0, import_gateway.gateway)(modelId);
2121
+ break;
2089
2122
  default:
2090
2123
  throw new Error(`AI SDK: unsupported provider "${provider}".`);
2091
2124
  }
@@ -7979,7 +8012,10 @@ function getMcpSection(options) {
7979
8012
  // src/prompts/systemPrompt.ts
7980
8013
  async function buildSystemPrompt(options) {
7981
8014
  const sections = [];
7982
- if (!options.coordinatorMode) {
8015
+ if (options.coordinatorMode) {
8016
+ } else if (options.staticBase !== void 0 && options.staticBase.length > 0) {
8017
+ sections.push(options.staticBase);
8018
+ } else {
7983
8019
  sections.push(getBaseSection());
7984
8020
  sections.push(getDoingTasksSection());
7985
8021
  sections.push(getActionsSection());
@@ -10522,6 +10558,7 @@ var Engine = class {
10522
10558
  const knowledgeRuntime = this.resolveKnowledgeRuntime(options.knowledge, storage);
10523
10559
  let systemPrompt = await buildSystemPrompt({
10524
10560
  ...coordinatorBase !== void 0 ? { base: coordinatorBase } : {},
10561
+ ...options.systemPromptBase !== void 0 ? { staticBase: options.systemPromptBase } : {},
10525
10562
  memory,
10526
10563
  storage,
10527
10564
  // When an override was supplied, skip the legacy disk-scan path.
@@ -10719,6 +10756,7 @@ var Engine = class {
10719
10756
  const knowledgeRuntime = this.resolveKnowledgeRuntime(options.knowledge, storage);
10720
10757
  let systemPrompt = await buildSystemPrompt({
10721
10758
  ...coordinatorBase !== void 0 ? { base: coordinatorBase } : {},
10759
+ ...options.systemPromptBase !== void 0 ? { staticBase: options.systemPromptBase } : {},
10722
10760
  memory,
10723
10761
  storage,
10724
10762
  // When an override was supplied, skip the legacy disk-scan path.