@skydiveai/pi-extensions 0.1.0-beta.2446 → 0.1.0-beta.2448

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.d.mts CHANGED
@@ -85,6 +85,13 @@ declare const _default: ExtensionFactory;
85
85
  //#region src/extensions/memory.d.ts
86
86
  declare const memoryExtension: ExtensionFactory;
87
87
  //#endregion
88
+ //#region src/extensions/provider-api-compat.d.ts
89
+ /**
90
+ * Keep older harnesses compatible with provider-native model specs that use
91
+ * the OpenAI-compatible wire through the transparent proxy.
92
+ */
93
+ declare const providerApiCompatExtension: ExtensionFactory;
94
+ //#endregion
88
95
  //#region src/extensions/soul.d.ts
89
96
  declare const soulExtension: ExtensionFactory;
90
97
  //#endregion
@@ -188,4 +195,4 @@ declare function runClosingTextLoop({
188
195
  enabled?: boolean;
189
196
  }): Promise<void>;
190
197
  //#endregion
191
- export { type CreateHarnessOptions, all, createHarness, createHealthHandler, createPlatformEnvMiddleware, installToolUpdateAutoStop, isPlatformConfigLoaded, loadPlatformConfig, localToolsExtension, _default as mcpExtension, memoryExtension, platformExtensions, runClosingTextLoop, runToolUpdateLoop, soulExtension, toolCallEnvExtension, turnEndedWithoutVisibleText };
198
+ export { type CreateHarnessOptions, all, createHarness, createHealthHandler, createPlatformEnvMiddleware, installToolUpdateAutoStop, isPlatformConfigLoaded, loadPlatformConfig, localToolsExtension, _default as mcpExtension, memoryExtension, platformExtensions, providerApiCompatExtension, runClosingTextLoop, runToolUpdateLoop, soulExtension, toolCallEnvExtension, turnEndedWithoutVisibleText };
package/dist/index.mjs CHANGED
@@ -24,6 +24,7 @@ import { execFile } from "node:child_process";
24
24
  import { availableParallelism } from "node:os";
25
25
  import { promisify } from "node:util";
26
26
  import { parse } from "yaml";
27
+ import { getModels } from "@earendil-works/pi-ai";
27
28
  import { quote } from "shell-quote";
28
29
  import { createWriteStream } from "node:fs";
29
30
  import { finished } from "node:stream/promises";
@@ -4048,6 +4049,20 @@ function createPlatformMemoryExtension({ channelContext }) {
4048
4049
  };
4049
4050
  }
4050
4051
  //#endregion
4052
+ //#region src/extensions/provider-api-compat.ts
4053
+ const OPENAI_COMPATIBLE_PROVIDERS = ["google", "openai"];
4054
+ const OPENAI_COMPLETIONS_API = "openai-completions";
4055
+ /**
4056
+ * Keep older harnesses compatible with provider-native model specs that use
4057
+ * the OpenAI-compatible wire through the transparent proxy.
4058
+ */
4059
+ const providerApiCompatExtension = (pi) => {
4060
+ for (const provider of OPENAI_COMPATIBLE_PROVIDERS) pi.registerProvider(provider, { models: getModels(provider).map((model) => ({
4061
+ ...model,
4062
+ api: OPENAI_COMPLETIONS_API
4063
+ })) });
4064
+ };
4065
+ //#endregion
4051
4066
  //#region src/extensions/self-trace.ts
4052
4067
  const log$3 = logger.child({ module: "self-trace-extension" });
4053
4068
  /**
@@ -5133,6 +5148,7 @@ const all = [
5133
5148
  */
5134
5149
  function platformExtensions({ sessionId, channelContext }) {
5135
5150
  return [
5151
+ providerApiCompatExtension,
5136
5152
  createPlatformExtensions({
5137
5153
  sessionId,
5138
5154
  channelContext
@@ -5147,4 +5163,4 @@ function platformExtensions({ sessionId, channelContext }) {
5147
5163
  ];
5148
5164
  }
5149
5165
  //#endregion
5150
- export { all, createHarness, createHealthHandler, createPlatformEnvMiddleware, installToolUpdateAutoStop, isPlatformConfigLoaded, loadPlatformConfig, localToolsExtension, mcp_default as mcpExtension, memoryExtension, platformExtensions, runClosingTextLoop, runToolUpdateLoop, soulExtension, toolCallEnvExtension, turnEndedWithoutVisibleText };
5166
+ export { all, createHarness, createHealthHandler, createPlatformEnvMiddleware, installToolUpdateAutoStop, isPlatformConfigLoaded, loadPlatformConfig, localToolsExtension, mcp_default as mcpExtension, memoryExtension, platformExtensions, providerApiCompatExtension, runClosingTextLoop, runToolUpdateLoop, soulExtension, toolCallEnvExtension, turnEndedWithoutVisibleText };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skydiveai/pi-extensions",
3
- "version": "0.1.0-beta.2446",
3
+ "version": "0.1.0-beta.2448",
4
4
  "homepage": "https://skydive.com",
5
5
  "license": "MIT",
6
6
  "author": "Create, Inc.",