mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-21 10:16:44 +00:00
fix(ai): source core stream types from canonical packages and fix tarball fixtures
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import type { StreamFn } from "@openclaw/llm-core";
|
||||
/**
|
||||
* Anthropic Vertex stream facade.
|
||||
* Keeps Vertex-specific provider implementation in the bundled provider plugin
|
||||
* while core imports a small stable factory.
|
||||
*/
|
||||
import { loadBundledPluginPublicSurfaceModuleSync } from "../plugin-sdk/facade-runtime.js";
|
||||
import type { StreamFn } from "./runtime/index.js";
|
||||
|
||||
type AnthropicVertexStreamFacade = {
|
||||
createAnthropicVertexStreamFn: (
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* Registers caller-supplied custom API stream functions with the LLM registry.
|
||||
*/
|
||||
import type { ApiRegistry } from "@openclaw/ai";
|
||||
import type { StreamFn } from "@openclaw/llm-core";
|
||||
import type {
|
||||
Api,
|
||||
AssistantMessageEventStreamContract,
|
||||
@@ -9,7 +10,6 @@ import type {
|
||||
StreamOptions,
|
||||
} from "../llm/types.js";
|
||||
import { createAssistantMessageEventStream } from "../llm/utils/event-stream.js";
|
||||
import type { StreamFn } from "./runtime/index.js";
|
||||
import { buildStreamErrorAssistantMessage } from "./stream-message-shared.js";
|
||||
|
||||
const CUSTOM_API_SOURCE_PREFIX = "openclaw-custom-api:";
|
||||
|
||||
@@ -6,6 +6,7 @@ import type { ApiRegistry } from "@openclaw/ai";
|
||||
* backend but sanitizes unsupported thinking payload options for simple models.
|
||||
*/
|
||||
import { clampThinkingLevel } from "@openclaw/ai/internal/runtime";
|
||||
import type { StreamFn } from "@openclaw/llm-core";
|
||||
import {
|
||||
sanitizeGoogleThinkingPayload,
|
||||
type GoogleThinkingInputLevel,
|
||||
@@ -13,7 +14,6 @@ import {
|
||||
import { streamWithPayloadPatch } from "../llm/providers/stream-wrappers/stream-payload-utils.js";
|
||||
import type { Api, Model, ModelThinkingLevel } from "../llm/types.js";
|
||||
import { ensureCustomApiRegistered } from "./custom-api-registry.js";
|
||||
import type { StreamFn } from "./runtime/index.js";
|
||||
|
||||
/** Custom API id for the Google simple-completion stream adapter. */
|
||||
const GOOGLE_SIMPLE_COMPLETION_API: Api = "openclaw-google-generative-ai-simple";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import type { AgentMessage } from "@openclaw/agent-core";
|
||||
/**
|
||||
* Transcript repair helpers for tool-call replay.
|
||||
*
|
||||
@@ -9,7 +10,6 @@ import {
|
||||
normalizeOptionalString,
|
||||
readStringValue,
|
||||
} from "@openclaw/normalization-core/string-coerce";
|
||||
import type { AgentMessage } from "./runtime/index.js";
|
||||
import { isThinkingLikeBlock } from "./thinking-block.js";
|
||||
import {
|
||||
extractToolCallsFromAssistant,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import type { AgentMessage } from "@openclaw/agent-core";
|
||||
/**
|
||||
* Tool call id normalization and extraction helpers.
|
||||
*
|
||||
* Keeps provider-specific id formats replay-safe while preserving allowed native ids.
|
||||
*/
|
||||
import { sha256HexPrefix } from "../infra/crypto-digest.js";
|
||||
import type { AgentMessage } from "./runtime/index.js";
|
||||
import { isThinkingLikeBlock } from "./thinking-block.js";
|
||||
import { isAllowedToolCallName, normalizeAllowedToolNames } from "./tool-call-shared.js";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Stream payload utilities normalize provider stream payload fields for wrappers.
|
||||
import type { StreamFn } from "../../../agents/runtime/index.js";
|
||||
import type { StreamFn } from "@openclaw/llm-core";
|
||||
|
||||
/** Wraps a stream function and lets callers mutate outgoing provider payload objects. */
|
||||
export function streamWithPayloadPatch(
|
||||
|
||||
@@ -25,6 +25,7 @@ const AI_RUNTIME_PACKAGE_JSON = JSON.stringify({
|
||||
exports: {
|
||||
".": { import: "./dist/index.mjs" },
|
||||
"./providers": { import: "./dist/providers.mjs" },
|
||||
"./transports": { import: "./dist/transports.mjs" },
|
||||
"./internal/*": { import: "./dist/internal/*.mjs" },
|
||||
},
|
||||
});
|
||||
@@ -650,6 +651,7 @@ describe("check-openclaw-package-tarball", () => {
|
||||
"node_modules/@openclaw/ai/package.json": AI_RUNTIME_PACKAGE_JSON,
|
||||
"node_modules/@openclaw/ai/dist/index.mjs": "export {};\n",
|
||||
"node_modules/@openclaw/ai/dist/providers.mjs": "export {};\n",
|
||||
"node_modules/@openclaw/ai/dist/transports.mjs": "export {};\n",
|
||||
"node_modules/@openclaw/ai/dist/internal/runtime.mjs": "export {};\n",
|
||||
},
|
||||
(tarball) => {
|
||||
@@ -679,6 +681,7 @@ describe("check-openclaw-package-tarball", () => {
|
||||
"dist/index.js": "export {};\n",
|
||||
"node_modules/@openclaw/ai/package.json": AI_RUNTIME_PACKAGE_JSON,
|
||||
"node_modules/@openclaw/ai/dist/index.mjs": "export {};\n",
|
||||
"node_modules/@openclaw/ai/dist/transports.mjs": "export {};\n",
|
||||
"node_modules/@openclaw/ai/dist/internal/runtime.mjs": "export {};\n",
|
||||
},
|
||||
(tarball) => {
|
||||
@@ -719,6 +722,7 @@ describe("check-openclaw-package-tarball", () => {
|
||||
}),
|
||||
"node_modules/@openclaw/ai/dist/index.mjs": "export {};\n",
|
||||
"node_modules/@openclaw/ai/dist/providers.mjs": "export {};\n",
|
||||
"node_modules/@openclaw/ai/dist/transports.mjs": "export {};\n",
|
||||
"node_modules/@openclaw/ai/dist/internal/runtime.mjs": "export {};\n",
|
||||
},
|
||||
(tarball) => {
|
||||
|
||||
Reference in New Issue
Block a user