@openclaw/voyage-provider 2026.10.10-beta.5 → 2026.11.5-beta.1

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.
@@ -0,0 +1 @@
1
+ {"version":3,"entries":[{"output":"embedding-batch.js","source":"extensions/voyage/embedding-batch.ts"},{"output":"index.js","source":"extensions/voyage/index.ts"},{"output":"memory-embedding-adapter.js","source":"extensions/voyage/memory-embedding-adapter.ts"}],"chunks":[{"output":"embedding-batch.js","sha256":"af75c40aa0ffd96755a06625ed901bf20102681c62e5aa363bc7a2bfbe8d73e8","facadeSource":"extensions/voyage/embedding-batch.ts","sources":["extensions/voyage/embedding-batch.ts"]},{"output":"index.js","sha256":"90ee73620e11eeca26c087cb438f12c49ef7cd458e61d03e9303115dfd27b730","facadeSource":"extensions/voyage/index.ts","sources":["extensions/voyage/index.ts"]},{"output":"memory-embedding-adapter.js","sha256":"78790a4efecfc6609f6012e3a61b78656dab956eff10cb9ad10cf40e41f96ece","facadeSource":"extensions/voyage/memory-embedding-adapter.ts","sources":["extensions/voyage/memory-embedding-adapter.ts"]}],"unrenderedSources":[]}
@@ -2,7 +2,7 @@ import { EMBEDDING_BATCH_ENDPOINT, buildBatchHeaders, buildEmbeddingBatchGroupOp
2
2
  import { assertOkOrThrowProviderError, createProviderOperationDeadline, readProviderJsonResponse, resolveProviderOperationTimeoutMs, waitProviderOperationPollInterval } from "openclaw/plugin-sdk/provider-http";
3
3
  import { readResponseWithLimit } from "openclaw/plugin-sdk/response-limit-runtime";
4
4
  import { normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
5
- //#region extensions/voyage/embedding-batch.ts
5
+ // extensions/voyage/embedding-batch.ts
6
6
  const VOYAGE_BATCH_COMPLETION_WINDOW = "12h";
7
7
  const VOYAGE_BATCH_MAX_REQUESTS = 5e4;
8
8
  const VOYAGE_BATCH_RESPONSE_MAX_BYTES = 16777216;
@@ -16,44 +16,6 @@ function buildVoyageBatchRequest(params) {
16
16
  onResponse: params.onResponse
17
17
  };
18
18
  }
19
- async function submitVoyageBatch(params) {
20
- const inputFileId = await uploadBatchJsonlFile({
21
- client: params.client,
22
- requests: params.requests,
23
- errorPrefix: "voyage batch file upload failed"
24
- });
25
- return await postJsonWithRetry({
26
- url: resolveEmbeddingEndpointUrl(params.client.baseUrl, "batches"),
27
- headers: buildBatchHeaders(params.client, { json: true }),
28
- ssrfPolicy: params.client.ssrfPolicy,
29
- resolveRequestHeaders: params.client.resolveRequestHeaders,
30
- body: {
31
- input_file_id: inputFileId,
32
- endpoint: EMBEDDING_BATCH_ENDPOINT,
33
- completion_window: VOYAGE_BATCH_COMPLETION_WINDOW,
34
- request_params: {
35
- model: params.client.model,
36
- input_type: "document"
37
- },
38
- metadata: {
39
- source: "clawdbot-memory",
40
- agent: params.agentId
41
- }
42
- },
43
- errorPrefix: "voyage batch create failed"
44
- });
45
- }
46
- async function fetchVoyageBatchStatus(params) {
47
- return await withRemoteHttpResponse(buildVoyageBatchRequest({
48
- client: params.client,
49
- path: `batches/${params.batchId}`,
50
- signal: params.signal,
51
- onResponse: async (res, requestHeaders) => {
52
- await assertOkOrThrowProviderError(res, "voyage.batch-status", { requestHeaders });
53
- return await readProviderJsonResponse(res, "voyage-batch-status", { maxBytes: VOYAGE_BATCH_RESPONSE_MAX_BYTES });
54
- }
55
- }));
56
- }
57
19
  async function readVoyageBatchError(params) {
58
20
  try {
59
21
  return await withRemoteHttpResponse(buildVoyageBatchRequest({
@@ -79,11 +41,34 @@ async function runVoyageEmbeddingBatches(params) {
79
41
  maxRequests: VOYAGE_BATCH_MAX_REQUESTS,
80
42
  debugLabel: "memory embeddings: voyage batch submit"
81
43
  }),
82
- submit: (group) => submitVoyageBatch({
83
- client: params.client,
84
- requests: group,
85
- agentId: params.agentId
86
- }),
44
+ submit: async (group) => {
45
+ const { client, agentId } = params;
46
+ const inputFileId = await uploadBatchJsonlFile({
47
+ client,
48
+ requests: group,
49
+ errorPrefix: "voyage batch file upload failed"
50
+ });
51
+ return await postJsonWithRetry({
52
+ url: resolveEmbeddingEndpointUrl(client.baseUrl, "batches"),
53
+ headers: buildBatchHeaders(client, { json: true }),
54
+ ssrfPolicy: client.ssrfPolicy,
55
+ resolveRequestHeaders: client.resolveRequestHeaders,
56
+ body: {
57
+ input_file_id: inputFileId,
58
+ endpoint: EMBEDDING_BATCH_ENDPOINT,
59
+ completion_window: VOYAGE_BATCH_COMPLETION_WINDOW,
60
+ request_params: {
61
+ model: client.model,
62
+ input_type: "document"
63
+ },
64
+ metadata: {
65
+ source: "clawdbot-memory",
66
+ agent: agentId
67
+ }
68
+ },
69
+ errorPrefix: "voyage batch create failed"
70
+ });
71
+ },
87
72
  readError: (errorFileId) => readVoyageBatchError({
88
73
  client: params.client,
89
74
  errorFileId
@@ -113,11 +98,15 @@ async function runVoyageEmbeddingBatches(params) {
113
98
  timeoutMs,
114
99
  debug,
115
100
  initial: batchInfo,
116
- fetchStatus: (signal) => fetchVoyageBatchStatus({
101
+ fetchStatus: async (signal) => await withRemoteHttpResponse(buildVoyageBatchRequest({
117
102
  client,
118
- batchId,
119
- signal
120
- }),
103
+ path: `batches/${batchId}`,
104
+ signal,
105
+ onResponse: async (res, requestHeaders) => {
106
+ await assertOkOrThrowProviderError(res, "voyage.batch-status", { requestHeaders });
107
+ return await readProviderJsonResponse(res, "voyage-batch-status", { maxBytes: VOYAGE_BATCH_RESPONSE_MAX_BYTES });
108
+ }
109
+ })),
121
110
  resolveTimeoutMs: () => resolveProviderOperationTimeoutMs({
122
111
  deadline,
123
112
  defaultTimeoutMs: timeoutMs
@@ -134,5 +123,4 @@ async function runVoyageEmbeddingBatches(params) {
134
123
  }
135
124
  });
136
125
  }
137
- //#endregion
138
126
  export { runVoyageEmbeddingBatches };
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { voyageMemoryEmbeddingProviderAdapter } from "./memory-embedding-adapter.js";
2
2
  import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
3
- //#region extensions/voyage/index.ts
3
+ // extensions/voyage/index.ts
4
4
  var voyage_default = definePluginEntry({
5
5
  id: "voyage",
6
6
  name: "Voyage Embeddings",
@@ -9,5 +9,4 @@ var voyage_default = definePluginEntry({
9
9
  api.registerEmbeddingProvider(voyageMemoryEmbeddingProviderAdapter);
10
10
  }
11
11
  });
12
- //#endregion
13
12
  export { voyage_default as default };
@@ -1,7 +1,14 @@
1
1
  import { runVoyageEmbeddingBatches } from "./embedding-batch.js";
2
- import { DEFAULT_VOYAGE_EMBEDDING_MODEL, createVoyageEmbeddingProvider } from "./embedding-provider.js";
3
2
  import { isMissingEmbeddingApiKeyError, mapBatchEmbeddingsByIndex, sanitizeEmbeddingCacheHeaders } from "openclaw/plugin-sdk/embedding-provider-adapter";
4
- //#region extensions/voyage/memory-embedding-adapter.ts
3
+ import { createRemoteEmbeddingProvider, normalizeEmbeddingModelWithPrefixes, resolveRemoteEmbeddingClient } from "openclaw/plugin-sdk/memory-core-host-engine-embeddings";
4
+ // extensions/voyage/memory-embedding-adapter.ts
5
+ const DEFAULT_VOYAGE_EMBEDDING_MODEL = "voyage-4-large";
6
+ const DEFAULT_VOYAGE_BASE_URL = "https://api.voyageai.com/v1";
7
+ const VOYAGE_MAX_INPUT_TOKENS = {
8
+ "voyage-3": 32e3,
9
+ "voyage-3-lite": 16e3,
10
+ "voyage-code-3": 32e3
11
+ };
5
12
  const voyageMemoryEmbeddingProviderAdapter = {
6
13
  id: "voyage",
7
14
  defaultModel: DEFAULT_VOYAGE_EMBEDDING_MODEL,
@@ -11,11 +18,28 @@ const voyageMemoryEmbeddingProviderAdapter = {
11
18
  allowExplicitWhenConfiguredAuto: true,
12
19
  shouldContinueAutoSelection: isMissingEmbeddingApiKeyError,
13
20
  create: async (options) => {
14
- const { provider, client } = await createVoyageEmbeddingProvider({
21
+ const preparedOptions = {
15
22
  ...options,
16
23
  provider: "voyage",
17
24
  fallback: "none"
25
+ };
26
+ const client = await resolveRemoteEmbeddingClient({
27
+ provider: "voyage",
28
+ options: preparedOptions,
29
+ defaultBaseUrl: DEFAULT_VOYAGE_BASE_URL,
30
+ normalizeModel: (model) => normalizeEmbeddingModelWithPrefixes({
31
+ model,
32
+ defaultModel: DEFAULT_VOYAGE_EMBEDDING_MODEL,
33
+ prefixes: ["voyage/"]
34
+ })
35
+ });
36
+ const provider = createRemoteEmbeddingProvider({
37
+ id: "voyage",
38
+ client,
39
+ errorPrefix: "voyage embeddings failed",
40
+ buildRequestFields: (kind) => ({ input_type: kind })
18
41
  });
42
+ provider.maxInputTokens = VOYAGE_MAX_INPUT_TOKENS[client.model];
19
43
  return {
20
44
  provider,
21
45
  runtime: {
@@ -28,17 +52,12 @@ const voyageMemoryEmbeddingProviderAdapter = {
28
52
  },
29
53
  batchEmbed: async (batch) => {
30
54
  const byCustomId = await runVoyageEmbeddingBatches({
55
+ ...batch,
31
56
  client,
32
- agentId: batch.agentId,
33
57
  requests: batch.chunks.map((chunk, index) => ({
34
58
  custom_id: String(index),
35
59
  body: { input: chunk.text }
36
- })),
37
- wait: batch.wait,
38
- concurrency: batch.concurrency,
39
- pollIntervalMs: batch.pollIntervalMs,
40
- timeoutMs: batch.timeoutMs,
41
- debug: batch.debug
60
+ }))
42
61
  });
43
62
  return mapBatchEmbeddingsByIndex(byCustomId, batch.chunks.length);
44
63
  }
@@ -46,5 +65,4 @@ const voyageMemoryEmbeddingProviderAdapter = {
46
65
  };
47
66
  }
48
67
  };
49
- //#endregion
50
68
  export { voyageMemoryEmbeddingProviderAdapter };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/voyage-provider",
3
- "version": "2026.10.10-beta.5",
3
+ "version": "2026.11.5-beta.1",
4
4
  "description": "OpenClaw Voyage embedding provider plugin.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -18,10 +18,10 @@
18
18
  "minHostVersion": ">=2026.7.2"
19
19
  },
20
20
  "compat": {
21
- "pluginApi": ">=2026.10.10-beta.5"
21
+ "pluginApi": ">=2026.11.5-beta.1"
22
22
  },
23
23
  "build": {
24
- "openclawVersion": "2026.10.10-beta.5",
24
+ "openclawVersion": "2026.11.5-beta.1",
25
25
  "bundledDist": false
26
26
  },
27
27
  "release": {
@@ -40,7 +40,7 @@
40
40
  "assets/activity.svg"
41
41
  ],
42
42
  "peerDependencies": {
43
- "openclaw": ">=2026.10.10-beta.5"
43
+ "openclaw": ">=2026.11.5-beta.1"
44
44
  },
45
45
  "peerDependenciesMeta": {
46
46
  "openclaw": {
@@ -1 +0,0 @@
1
- {"version":3,"entries":[{"output":"embedding-batch.js","source":"extensions/voyage/embedding-batch.ts"},{"output":"embedding-provider.js","source":"extensions/voyage/embedding-provider.ts"},{"output":"index.js","source":"extensions/voyage/index.ts"},{"output":"memory-embedding-adapter.js","source":"extensions/voyage/memory-embedding-adapter.ts"}],"chunks":[{"output":"embedding-batch.js","sha256":"77046317c96675ff3e9a47fe550cc5683a0cd640ec290a97db5806cd03389018","facadeSource":"extensions/voyage/embedding-batch.ts","sources":["extensions/voyage/embedding-batch.ts"]},{"output":"embedding-provider.js","sha256":"243b4fb0467401269941578e6f86355ed4485a0ec0f265ee347d57779ae06e36","facadeSource":"extensions/voyage/embedding-provider.ts","sources":["extensions/voyage/embedding-provider.ts"]},{"output":"index.js","sha256":"d1436175ff23f97588108addf44ac8fcc5b4a915bb87393444c4edc64ddf7582","facadeSource":"extensions/voyage/index.ts","sources":["extensions/voyage/index.ts"]},{"output":"memory-embedding-adapter.js","sha256":"fda97efa0d98800604ecad9bbd1d5117a3cec6fa339ac6c90722406904a48604","facadeSource":"extensions/voyage/memory-embedding-adapter.ts","sources":["extensions/voyage/memory-embedding-adapter.ts"]}],"unrenderedSources":[]}
@@ -1,37 +0,0 @@
1
- import { createRemoteEmbeddingProvider, normalizeEmbeddingModelWithPrefixes, resolveRemoteEmbeddingClient } from "openclaw/plugin-sdk/memory-core-host-engine-embeddings";
2
- //#region extensions/voyage/embedding-provider.ts
3
- const DEFAULT_VOYAGE_EMBEDDING_MODEL = "voyage-4-large";
4
- const DEFAULT_VOYAGE_BASE_URL = "https://api.voyageai.com/v1";
5
- const VOYAGE_MAX_INPUT_TOKENS = {
6
- "voyage-3": 32e3,
7
- "voyage-3-lite": 16e3,
8
- "voyage-code-3": 32e3
9
- };
10
- function normalizeVoyageModel(model) {
11
- return normalizeEmbeddingModelWithPrefixes({
12
- model,
13
- defaultModel: DEFAULT_VOYAGE_EMBEDDING_MODEL,
14
- prefixes: ["voyage/"]
15
- });
16
- }
17
- async function createVoyageEmbeddingProvider(options) {
18
- const client = await resolveRemoteEmbeddingClient({
19
- provider: "voyage",
20
- options,
21
- defaultBaseUrl: DEFAULT_VOYAGE_BASE_URL,
22
- normalizeModel: normalizeVoyageModel
23
- });
24
- const provider = createRemoteEmbeddingProvider({
25
- id: "voyage",
26
- client,
27
- errorPrefix: "voyage embeddings failed",
28
- buildRequestFields: (kind) => ({ input_type: kind })
29
- });
30
- provider.maxInputTokens = VOYAGE_MAX_INPUT_TOKENS[client.model];
31
- return {
32
- provider,
33
- client
34
- };
35
- }
36
- //#endregion
37
- export { DEFAULT_VOYAGE_EMBEDDING_MODEL, createVoyageEmbeddingProvider };