@acedatacloud/openclaw-provider 2026.5.34 → 2026.10.2

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 (81) hide show
  1. package/README.md +72 -59
  2. package/assets/icon.png +0 -0
  3. package/dist/index.d.ts +4 -10
  4. package/dist/index.js +34 -20
  5. package/dist/src/chat/generated-catalog.d.ts +9 -7
  6. package/dist/src/chat/generated-catalog.js +3893 -65
  7. package/dist/src/chat/onboard.d.ts +1 -1
  8. package/dist/src/chat/onboard.js +13 -2
  9. package/dist/src/chat/provider-catalog.d.ts +4 -2
  10. package/dist/src/chat/provider-catalog.js +2 -51
  11. package/dist/src/chat/runtime.d.ts +4 -0
  12. package/dist/src/chat/runtime.js +77 -0
  13. package/dist/src/constants.d.ts +1 -1
  14. package/dist/src/constants.js +1 -1
  15. package/dist/src/search/acedata-search-client.d.ts +2 -0
  16. package/dist/src/search/acedata-search-client.js +21 -13
  17. package/dist/src/search/acedata-search-config.js +6 -4
  18. package/dist/src/search/acedata-search-provider.d.ts +3 -2
  19. package/dist/src/search/acedata-search-provider.js +5 -2
  20. package/dist/src/search/acedata-search-shared.d.ts +2 -1
  21. package/dist/src/search/acedata-search-shared.js +37 -6
  22. package/dist/src/services/catalog.d.ts +46 -0
  23. package/dist/src/services/catalog.js +24 -0
  24. package/dist/src/services/client.d.ts +36 -0
  25. package/dist/src/services/client.js +315 -0
  26. package/dist/src/services/contracts/face.json +16 -0
  27. package/dist/src/services/contracts/fish-audio.json +15 -0
  28. package/dist/src/services/contracts/flux.json +13 -0
  29. package/dist/src/services/contracts/google-search.json +9 -0
  30. package/dist/src/services/contracts/gpt-image.json +13 -0
  31. package/dist/src/services/contracts/grok.json +12 -0
  32. package/dist/src/services/contracts/happyhorse.json +11 -0
  33. package/dist/src/services/contracts/kling.json +20 -0
  34. package/dist/src/services/contracts/midjourney.json +17 -0
  35. package/dist/src/services/contracts/minimax.json +13 -0
  36. package/dist/src/services/contracts/nano-banana.json +12 -0
  37. package/dist/src/services/contracts/qwen-image.json +11 -0
  38. package/dist/src/services/contracts/seedance.json +11 -0
  39. package/dist/src/services/contracts/seedream.json +13 -0
  40. package/dist/src/services/contracts/suno.json +27 -0
  41. package/dist/src/services/contracts/veo.json +15 -0
  42. package/dist/src/services/contracts/wan.json +12 -0
  43. package/dist/src/services/media.d.ts +25 -0
  44. package/dist/src/services/media.js +350 -0
  45. package/dist/src/services/parameters.d.ts +6 -0
  46. package/dist/src/services/parameters.js +165 -0
  47. package/dist/src/services/tools.d.ts +6 -0
  48. package/dist/src/services/tools.js +59 -0
  49. package/docs/architecture.md +58 -0
  50. package/docs/capabilities.md +75 -0
  51. package/docs/cookbook.md +77 -0
  52. package/docs/model-catalog.md +126 -0
  53. package/openclaw.plugin.json +5679 -8
  54. package/package.json +31 -23
  55. package/skills/acedata-face/SKILL.md +14 -0
  56. package/skills/acedata-fish-audio/SKILL.md +20 -0
  57. package/skills/acedata-flux/SKILL.md +18 -0
  58. package/skills/acedata-google-search/SKILL.md +14 -0
  59. package/skills/acedata-gpt-image/SKILL.md +18 -0
  60. package/skills/acedata-grok/SKILL.md +17 -0
  61. package/skills/acedata-happyhorse/SKILL.md +16 -0
  62. package/skills/acedata-kling/SKILL.md +25 -0
  63. package/skills/acedata-midjourney/SKILL.md +22 -0
  64. package/skills/acedata-minimax/SKILL.md +18 -0
  65. package/skills/acedata-nano-banana/SKILL.md +17 -0
  66. package/skills/acedata-qwen-image/SKILL.md +16 -0
  67. package/skills/acedata-seedance/SKILL.md +16 -0
  68. package/skills/acedata-seedream/SKILL.md +18 -0
  69. package/skills/acedata-suno/SKILL.md +32 -0
  70. package/skills/acedata-veo/SKILL.md +20 -0
  71. package/skills/acedata-wan/SKILL.md +17 -0
  72. package/index.ts +0 -110
  73. package/src/chat/generated-catalog.ts +0 -77
  74. package/src/chat/model-overrides.json +0 -93
  75. package/src/chat/onboard.ts +0 -33
  76. package/src/chat/provider-catalog.ts +0 -73
  77. package/src/constants.ts +0 -3
  78. package/src/search/acedata-search-client.ts +0 -160
  79. package/src/search/acedata-search-config.ts +0 -76
  80. package/src/search/acedata-search-provider.ts +0 -80
  81. package/src/search/acedata-search-shared.ts +0 -29
@@ -1,4 +1,4 @@
1
- import { type OpenClawConfig } from "openclaw/plugin-sdk/provider-onboard";
1
+ import type { OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";
2
2
  import { ACEDATA_DEFAULT_MODEL_REF } from "../constants.js";
3
3
  export { ACEDATA_DEFAULT_MODEL_REF };
4
4
  export declare function applyAcedataProviderConfig(cfg: OpenClawConfig): OpenClawConfig;
@@ -1,4 +1,3 @@
1
- import { applyAgentDefaultModelPrimary, } from "openclaw/plugin-sdk/provider-onboard";
2
1
  import { ACEDATA_DEFAULT_MODEL_REF } from "../constants.js";
3
2
  export { ACEDATA_DEFAULT_MODEL_REF };
4
3
  export function applyAcedataProviderConfig(cfg) {
@@ -19,5 +18,17 @@ export function applyAcedataProviderConfig(cfg) {
19
18
  };
20
19
  }
21
20
  export function applyAcedataConfig(cfg) {
22
- return applyAgentDefaultModelPrimary(applyAcedataProviderConfig(cfg), ACEDATA_DEFAULT_MODEL_REF);
21
+ const next = applyAcedataProviderConfig(cfg);
22
+ if (cfg.agents?.defaults?.model)
23
+ return next;
24
+ return {
25
+ ...next,
26
+ agents: {
27
+ ...next.agents,
28
+ defaults: {
29
+ ...next.agents?.defaults,
30
+ model: { primary: ACEDATA_DEFAULT_MODEL_REF },
31
+ },
32
+ },
33
+ };
23
34
  }
@@ -1,4 +1,6 @@
1
- import type { ModelDefinitionConfig, ModelProviderConfig } from "openclaw/plugin-sdk/provider-model-shared";
2
- export declare function isAcedataReasoningModel(modelId: string): boolean;
1
+ import type { OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";
2
+ type ModelProviderConfig = NonNullable<NonNullable<OpenClawConfig["models"]>["providers"]>[string];
3
+ type ModelDefinitionConfig = ModelProviderConfig["models"][number];
3
4
  export declare function listAcedataChatModels(): ModelDefinitionConfig[];
4
5
  export declare function buildAcedataChatProvider(): ModelProviderConfig;
6
+ export {};
@@ -1,62 +1,13 @@
1
1
  import { ACEDATA_BASE_URL } from "../constants.js";
2
2
  import { GENERATED_CHAT_MODELS } from "./generated-catalog.js";
3
- const ZERO_COST = { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 };
4
- const CATALOG_REASONING_BY_ID = new Map(GENERATED_CHAT_MODELS.map((m) => [m.id.toLowerCase(), m.reasoning]));
5
- // Heuristic fallback for ids NOT in the curated catalog (used by
6
- // resolveDynamicModel passthrough). Authoritative source: catalog lookup above.
7
- const REASONING_HEURISTIC_PREFIXES = [
8
- "gpt-5",
9
- "claude-opus-",
10
- "claude-sonnet-4",
11
- "claude-3-7-sonnet",
12
- "gemini-3.1-pro",
13
- "gemini-3-pro",
14
- "grok-4",
15
- "deepseek-r",
16
- "deepseek-v4",
17
- "deepseek-reasoner",
18
- "kimi-k2-thinking",
19
- "kimi-k2.5",
20
- "glm-5",
21
- ];
22
- const REASONING_HEURISTIC_EXACT = new Set([
23
- "o1",
24
- "o1-mini",
25
- "o1-pro",
26
- "o3",
27
- "o3-mini",
28
- "o3-pro",
29
- "o4-mini",
30
- ]);
31
- export function isAcedataReasoningModel(modelId) {
32
- const normalized = modelId.trim().toLowerCase();
33
- if (!normalized)
34
- return false;
35
- const fromCatalog = CATALOG_REASONING_BY_ID.get(normalized);
36
- if (fromCatalog !== undefined)
37
- return fromCatalog;
38
- if (REASONING_HEURISTIC_EXACT.has(normalized))
39
- return true;
40
- return REASONING_HEURISTIC_PREFIXES.some((prefix) => normalized.startsWith(prefix));
41
- }
42
- function toModelDefinition(entry) {
43
- return {
44
- id: entry.id,
45
- name: entry.name,
46
- reasoning: entry.reasoning,
47
- input: entry.vision ? ["text", "image"] : ["text"],
48
- cost: ZERO_COST,
49
- contextWindow: entry.contextWindow,
50
- maxTokens: entry.maxTokens,
51
- };
52
- }
53
3
  export function listAcedataChatModels() {
54
- return GENERATED_CHAT_MODELS.map(toModelDefinition);
4
+ return GENERATED_CHAT_MODELS.map(({ reasoningEfforts, thinkingToggle, ...model }) => model);
55
5
  }
56
6
  export function buildAcedataChatProvider() {
57
7
  return {
58
8
  baseUrl: ACEDATA_BASE_URL,
59
9
  api: "openai-completions",
10
+ authHeader: true,
60
11
  models: listAcedataChatModels(),
61
12
  };
62
13
  }
@@ -0,0 +1,4 @@
1
+ import type { ProviderDefaultThinkingPolicyContext, ProviderThinkingProfile, ProviderWrapStreamFnContext, ProviderPrepareRuntimeAuthContext, ProviderPreparedRuntimeAuth } from "openclaw/plugin-sdk/plugin-entry";
2
+ export declare function prepareAcedataRuntimeAuth(ctx: ProviderPrepareRuntimeAuthContext): Promise<ProviderPreparedRuntimeAuth | undefined>;
3
+ export declare function resolveAcedataThinkingProfile(ctx: ProviderDefaultThinkingPolicyContext): ProviderThinkingProfile | null;
4
+ export declare function wrapAcedataStream(ctx: ProviderWrapStreamFnContext): ProviderWrapStreamFnContext["streamFn"];
@@ -0,0 +1,77 @@
1
+ import { GENERATED_CHAT_MODELS } from "./generated-catalog.js";
2
+ export async function prepareAcedataRuntimeAuth(ctx) {
3
+ if (ctx.model.api !== "anthropic-messages" ||
4
+ new URL(ctx.model.baseUrl).origin !== "https://api.acedata.cloud")
5
+ return undefined;
6
+ return {
7
+ apiKey: ctx.apiKey,
8
+ request: { auth: { mode: "authorization-bearer", token: ctx.apiKey } },
9
+ };
10
+ }
11
+ export function resolveAcedataThinkingProfile(ctx) {
12
+ const model = GENERATED_CHAT_MODELS.find((row) => row.id === ctx.modelId.replace(/^acedatacloud\//, ""));
13
+ if (!model?.reasoning)
14
+ return null;
15
+ const accepted = new Set([
16
+ "off",
17
+ "minimal",
18
+ "low",
19
+ "medium",
20
+ "high",
21
+ "xhigh",
22
+ "max",
23
+ ]);
24
+ const levels = model.reasoningEfforts
25
+ .map((value) => (value === "none" ? "off" : value))
26
+ .filter((value) => accepted.has(value));
27
+ if (model.thinkingToggle && !levels.includes("off"))
28
+ levels.unshift("off");
29
+ if (!levels.length)
30
+ levels.push("low");
31
+ if (model.thinkingToggle && levels.length === 1)
32
+ levels.push("low");
33
+ return {
34
+ levels: levels.map((id) => ({
35
+ id,
36
+ ...(model.thinkingToggle &&
37
+ model.reasoningEfforts.length === 0 &&
38
+ id === "low"
39
+ ? { label: "on" }
40
+ : {}),
41
+ })),
42
+ defaultLevel: levels.find((id) => id !== "off") ?? "off",
43
+ };
44
+ }
45
+ export function wrapAcedataStream(ctx) {
46
+ const stream = ctx.streamFn;
47
+ if (!stream)
48
+ return undefined;
49
+ const wrapped = (model, context, options) => {
50
+ const entry = GENERATED_CHAT_MODELS.find((row) => row.id === model.id.replace(/^acedatacloud\//, ""));
51
+ const headers = entry?.api === "anthropic-messages" &&
52
+ new URL(model.baseUrl).origin === "https://api.acedata.cloud" &&
53
+ options?.apiKey
54
+ ? { ...options.headers, Authorization: `Bearer ${options.apiKey}` }
55
+ : options?.headers;
56
+ // Toggle-only hosts accept thinking.type, but do not accept an effort field.
57
+ const toggleOnly = entry?.thinkingToggle && entry.reasoningEfforts.length === 0;
58
+ const onPayload = options?.onPayload;
59
+ return stream(model, context, {
60
+ ...options,
61
+ ...(headers ? { headers } : {}),
62
+ ...(toggleOnly
63
+ ? {
64
+ onPayload: async (payload, requestModel) => {
65
+ const next = (await onPayload?.(payload, requestModel)) ?? payload;
66
+ if (next && typeof next === "object" && !Array.isArray(next)) {
67
+ const { reasoning_effort: ignored, ...rest } = next;
68
+ return rest;
69
+ }
70
+ return next;
71
+ },
72
+ }
73
+ : {}),
74
+ });
75
+ };
76
+ return wrapped;
77
+ }
@@ -1,3 +1,3 @@
1
- export declare const ACEDATA_BASE_URL = "https://api.acedata.cloud/v1";
1
+ export declare const ACEDATA_BASE_URL = "https://api.acedata.cloud/openai";
2
2
  export declare const ACEDATA_PROVIDER_ID = "acedatacloud";
3
3
  export declare const ACEDATA_DEFAULT_MODEL_REF = "acedatacloud/gpt-4.1-mini";
@@ -1,3 +1,3 @@
1
- export const ACEDATA_BASE_URL = "https://api.acedata.cloud/v1";
1
+ export const ACEDATA_BASE_URL = "https://api.acedata.cloud/openai";
2
2
  export const ACEDATA_PROVIDER_ID = "acedatacloud";
3
3
  export const ACEDATA_DEFAULT_MODEL_REF = "acedatacloud/gpt-4.1-mini";
@@ -23,6 +23,8 @@ export type AcedataSearchResponse = {
23
23
  };
24
24
  export type RunAcedataSearchArgs = {
25
25
  cfg?: OpenClawConfig;
26
+ apiKey?: string;
27
+ signal?: AbortSignal;
26
28
  query: string;
27
29
  type?: AcedataSearchType;
28
30
  country?: string;
@@ -1,7 +1,11 @@
1
1
  import { resolveAcedataSearchApiKey, resolveAcedataSearchBaseUrl, resolveAcedataSearchTimeoutSeconds, } from "./acedata-search-config.js";
2
+ import { cleanResult, readLimited } from "../services/client.js";
2
3
  const SEARCH_PATH = "/serp/google";
3
4
  function buildSearchUrl(baseUrl) {
4
- return `${baseUrl.replace(/\/$/, "")}${SEARCH_PATH}`;
5
+ const url = new URL(`${baseUrl.replace(/\/$/, "")}${SEARCH_PATH}`);
6
+ if (url.protocol !== "https:" || url.username || url.password)
7
+ throw new Error("Search base URL must use HTTPS without embedded credentials.");
8
+ return url.toString();
5
9
  }
6
10
  function asString(value) {
7
11
  return typeof value === "string" && value.trim() ? value : undefined;
@@ -34,7 +38,7 @@ export async function runAcedataSearch(args) {
34
38
  if (!query.trim()) {
35
39
  throw new Error("Ace Data Cloud search query is required");
36
40
  }
37
- const apiKey = resolveAcedataSearchApiKey(cfg);
41
+ const apiKey = resolveAcedataSearchApiKey(cfg) ?? args.apiKey;
38
42
  if (!apiKey) {
39
43
  throw new Error("Ace Data Cloud API key not configured. Set ACEDATA_API_KEY env var or configure plugins.entries.acedatacloud.config.webSearch.apiKey.");
40
44
  }
@@ -63,32 +67,36 @@ export async function runAcedataSearch(args) {
63
67
  Accept: "application/json",
64
68
  },
65
69
  body: JSON.stringify(body),
66
- signal: controller.signal,
70
+ redirect: "error",
71
+ signal: args.signal ? AbortSignal.any([args.signal, controller.signal]) : controller.signal,
67
72
  });
68
73
  }
69
74
  catch (cause) {
75
+ clearTimeout(timer);
70
76
  if (cause?.name === "AbortError") {
71
77
  throw new Error(`Ace Data Cloud search timed out after ${timeoutSeconds}s`);
72
78
  }
73
- throw new Error(`Ace Data Cloud search request failed: ${cause.message}`, { cause });
74
- }
75
- finally {
76
- clearTimeout(timer);
79
+ args.signal?.throwIfAborted();
80
+ throw new Error("Ace Data Cloud search request failed.");
77
81
  }
78
82
  if (!response.ok) {
79
- const text = await response.text().catch(() => "");
80
- throw new Error(`Ace Data Cloud search API returned HTTP ${response.status}${text ? `: ${text.slice(0, 500)}` : ""}`);
83
+ clearTimeout(timer);
84
+ await response.body?.cancel();
85
+ throw new Error(`Ace Data Cloud search API returned HTTP ${response.status}`);
81
86
  }
82
87
  let payload;
83
88
  try {
84
- payload = await response.json();
89
+ payload = cleanResult(JSON.parse((await readLimited(response, 8 * 1024 * 1024)).toString("utf8")));
85
90
  }
86
- catch (cause) {
87
- throw new Error("Ace Data Cloud search returned malformed JSON", { cause });
91
+ catch {
92
+ throw new Error("Ace Data Cloud search returned malformed or oversized JSON");
93
+ }
94
+ finally {
95
+ clearTimeout(timer);
88
96
  }
89
97
  const root = (payload && typeof payload === "object" ? payload : {});
90
98
  const data = (root.data && typeof root.data === "object" ? root.data : root) ?? {};
91
- const organic = normalizeOrganicResults(data.organic_results ?? data.results ?? data.items);
99
+ const organic = normalizeOrganicResults(data.organic ?? data.organic_results ?? data.results ?? data.items ?? data.images ?? data.news ?? data.videos ?? data.places);
92
100
  const result = {
93
101
  type,
94
102
  query,
@@ -1,7 +1,5 @@
1
- import { resolvePositiveTimeoutSeconds } from "openclaw/plugin-sdk/provider-web-search";
2
1
  import { normalizeResolvedSecretInputString, normalizeSecretInput, } from "openclaw/plugin-sdk/secret-input";
3
2
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
4
- import { ACEDATA_BASE_URL } from "../constants.js";
5
3
  export const ACEDATA_SEARCH_DEFAULT_TIMEOUT_SECONDS = 30;
6
4
  export function resolveAcedataSearchConfig(cfg) {
7
5
  const pluginConfig = cfg?.plugins?.entries?.acedatacloud?.config;
@@ -36,10 +34,14 @@ export function resolveAcedataSearchBaseUrl(cfg) {
36
34
  normalizeSecretInput(process.env.ACEDATA_BASE_URL) ||
37
35
  "";
38
36
  if (!configured) {
39
- return ACEDATA_BASE_URL.replace(/\/v1\/?$/, "");
37
+ return "https://api.acedata.cloud";
40
38
  }
41
39
  return configured.replace(/\/$/, "");
42
40
  }
43
41
  export function resolveAcedataSearchTimeoutSeconds(override) {
44
- return resolvePositiveTimeoutSeconds(override, ACEDATA_SEARCH_DEFAULT_TIMEOUT_SECONDS);
42
+ return typeof override === "number" &&
43
+ Number.isFinite(override) &&
44
+ override > 0
45
+ ? Math.max(1, Math.floor(override))
46
+ : ACEDATA_SEARCH_DEFAULT_TIMEOUT_SECONDS;
45
47
  }
@@ -1,2 +1,3 @@
1
- import type { WebSearchProviderPlugin } from "openclaw/plugin-sdk/provider-web-search-contract";
2
- export declare function createAcedataWebSearchProvider(): WebSearchProviderPlugin;
1
+ import type { OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";
2
+ import type { WebSearchProviderPlugin } from "./acedata-search-shared.js";
3
+ export declare function createAcedataWebSearchProvider(resolveSharedKey?: (cfg?: OpenClawConfig) => Promise<string>): WebSearchProviderPlugin;
@@ -1,4 +1,5 @@
1
1
  import { readPositiveIntegerParam } from "openclaw/plugin-sdk/param-readers";
2
+ import { resolveAcedataSearchApiKey } from "./acedata-search-config.js";
2
3
  import { runAcedataSearch } from "./acedata-search-client.js";
3
4
  import { buildAcedataSearchProviderBase } from "./acedata-search-shared.js";
4
5
  const SUPPORTED_TYPES = ["search", "images", "news", "videos", "maps", "places"];
@@ -42,13 +43,13 @@ function normalizeSearchType(value) {
42
43
  return undefined;
43
44
  return SUPPORTED_TYPES.includes(value) ? value : undefined;
44
45
  }
45
- export function createAcedataWebSearchProvider() {
46
+ export function createAcedataWebSearchProvider(resolveSharedKey) {
46
47
  return {
47
48
  ...buildAcedataSearchProviderBase(),
48
49
  createTool: (ctx) => ({
49
50
  description: "Search the web using Ace Data Cloud's Google SERP API. Returns structured organic results plus optional knowledge graph and answer box. Supports image/news/video/maps verticals.",
50
51
  parameters: AcedataSearchSchema,
51
- execute: async (args) => {
52
+ execute: async (args, execution) => {
52
53
  const query = typeof args.query === "string" ? args.query : "";
53
54
  const count = readPositiveIntegerParam(args, "count", {
54
55
  message: "count must be an integer from 1 to 100",
@@ -59,6 +60,8 @@ export function createAcedataWebSearchProvider() {
59
60
  });
60
61
  return await runAcedataSearch({
61
62
  cfg: ctx.config,
63
+ apiKey: resolveAcedataSearchApiKey(ctx.config) ?? await resolveSharedKey?.(ctx.config),
64
+ signal: execution?.signal,
62
65
  query,
63
66
  type: normalizeSearchType(args.type) ?? "search",
64
67
  country: typeof args.country === "string" ? args.country : undefined,
@@ -1,3 +1,4 @@
1
- import { type WebSearchProviderPlugin } from "openclaw/plugin-sdk/provider-web-search-contract";
1
+ import type { OpenClawPluginApi } from "openclaw/plugin-sdk/plugin-entry";
2
+ export type WebSearchProviderPlugin = Parameters<OpenClawPluginApi["registerWebSearchProvider"]>[0];
2
3
  export declare const ACEDATA_SEARCH_CREDENTIAL_PATH = "plugins.entries.acedatacloud.config.webSearch.apiKey";
3
4
  export declare function buildAcedataSearchProviderBase(): Omit<WebSearchProviderPlugin, "createTool">;
@@ -1,4 +1,4 @@
1
- import { createWebSearchProviderContractFields, } from "openclaw/plugin-sdk/provider-web-search-contract";
1
+ import { resolveAcedataSearchConfig } from "./acedata-search-config.js";
2
2
  export const ACEDATA_SEARCH_CREDENTIAL_PATH = "plugins.entries.acedatacloud.config.webSearch.apiKey";
3
3
  export function buildAcedataSearchProviderBase() {
4
4
  return {
@@ -13,11 +13,42 @@ export function buildAcedataSearchProviderBase() {
13
13
  docsUrl: "https://platform.acedata.cloud/services/3a30e2fb-3a99-4ae7-bc3e-9a51d5d6f02b",
14
14
  autoDetectOrder: 80,
15
15
  credentialPath: ACEDATA_SEARCH_CREDENTIAL_PATH,
16
- ...createWebSearchProviderContractFields({
17
- credentialPath: ACEDATA_SEARCH_CREDENTIAL_PATH,
18
- searchCredential: { type: "scoped", scopeId: "acedatacloud" },
19
- configuredCredential: { pluginId: "acedatacloud" },
20
- selectionPluginId: "acedatacloud",
16
+ getCredentialValue: (searchConfig) => {
17
+ const scoped = searchConfig?.acedatacloud;
18
+ return scoped && typeof scoped === "object" && "apiKey" in scoped
19
+ ? scoped.apiKey
20
+ : undefined;
21
+ },
22
+ setCredentialValue: (searchConfig, value) => {
23
+ const scoped = searchConfig.acedatacloud;
24
+ searchConfig.acedatacloud = {
25
+ ...(scoped && typeof scoped === "object" ? scoped : {}),
26
+ apiKey: value,
27
+ };
28
+ },
29
+ getConfiguredCredentialValue: (config) => resolveAcedataSearchConfig(config)?.apiKey,
30
+ setConfiguredCredentialValue: (config, value) => {
31
+ config.plugins ??= {};
32
+ config.plugins.entries ??= {};
33
+ const entry = (config.plugins.entries.acedatacloud ??= {});
34
+ entry.config ??= {};
35
+ entry.config.webSearch = {
36
+ ...resolveAcedataSearchConfig(config),
37
+ apiKey: value,
38
+ };
39
+ },
40
+ applySelectionConfig: (config) => ({
41
+ ...config,
42
+ plugins: {
43
+ ...config.plugins,
44
+ entries: {
45
+ ...config.plugins?.entries,
46
+ acedatacloud: {
47
+ ...config.plugins?.entries?.acedatacloud,
48
+ enabled: true,
49
+ },
50
+ },
51
+ },
21
52
  }),
22
53
  };
23
54
  }
@@ -0,0 +1,46 @@
1
+ export type Schema = Record<string, unknown>;
2
+ export type Endpoint = {
3
+ method: string;
4
+ path: string;
5
+ operation: string;
6
+ schema: Schema;
7
+ properties: Record<string, Schema>;
8
+ parameters?: Array<{
9
+ in: string;
10
+ name: string;
11
+ required?: boolean;
12
+ schema: Schema;
13
+ }>;
14
+ defaults?: Record<string, unknown>;
15
+ fixed?: Record<string, unknown>;
16
+ allow_empty?: string[];
17
+ query_actions?: string[];
18
+ media_response?: boolean;
19
+ read_only?: boolean;
20
+ destructive?: boolean;
21
+ asynchronous?: boolean;
22
+ selector?: Record<string, string>;
23
+ selector_default?: string;
24
+ tool?: {
25
+ label: string;
26
+ description: string;
27
+ input: Array<{
28
+ name: string;
29
+ required: boolean;
30
+ schema: Schema;
31
+ }>;
32
+ };
33
+ };
34
+ export type Service = {
35
+ id: string;
36
+ label: string;
37
+ taskPath: string | null;
38
+ source: {
39
+ repository: string;
40
+ commit: string;
41
+ path: string;
42
+ };
43
+ endpoints: Record<string, Endpoint>;
44
+ };
45
+ export declare const SERVICES: readonly Service[];
46
+ export declare function serviceById(id: string): Service;
@@ -0,0 +1,24 @@
1
+ import c0 from "./contracts/face.json" with { type: "json" };
2
+ import c1 from "./contracts/fish-audio.json" with { type: "json" };
3
+ import c2 from "./contracts/flux.json" with { type: "json" };
4
+ import c3 from "./contracts/google-search.json" with { type: "json" };
5
+ import c4 from "./contracts/gpt-image.json" with { type: "json" };
6
+ import c5 from "./contracts/grok.json" with { type: "json" };
7
+ import c6 from "./contracts/happyhorse.json" with { type: "json" };
8
+ import c7 from "./contracts/kling.json" with { type: "json" };
9
+ import c8 from "./contracts/midjourney.json" with { type: "json" };
10
+ import c9 from "./contracts/minimax.json" with { type: "json" };
11
+ import c10 from "./contracts/nano-banana.json" with { type: "json" };
12
+ import c11 from "./contracts/qwen-image.json" with { type: "json" };
13
+ import c12 from "./contracts/seedance.json" with { type: "json" };
14
+ import c13 from "./contracts/seedream.json" with { type: "json" };
15
+ import c14 from "./contracts/suno.json" with { type: "json" };
16
+ import c15 from "./contracts/veo.json" with { type: "json" };
17
+ import c16 from "./contracts/wan.json" with { type: "json" };
18
+ export const SERVICES = [c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16];
19
+ export function serviceById(id) {
20
+ const service = SERVICES.find(s => s.id === id);
21
+ if (!service)
22
+ throw new Error(`Unknown Ace Data Cloud service: ${id}`);
23
+ return service;
24
+ }
@@ -0,0 +1,36 @@
1
+ import type { Endpoint, Service } from "./catalog.js";
2
+ type Values = Record<string, unknown>;
3
+ export declare const record: (x: unknown) => Values;
4
+ export declare function cleanResult(x: unknown): unknown;
5
+ export declare function mediaUrls(x: unknown): string[];
6
+ export type PreparedRequest = {
7
+ method: string;
8
+ path: string;
9
+ body: Values;
10
+ query: Values;
11
+ headers: Record<string, string>;
12
+ asynchronous: boolean;
13
+ readOnly: boolean;
14
+ endpoint: Endpoint;
15
+ };
16
+ export declare function prepare(service: Service, tool: string, parameters: Values): PreparedRequest;
17
+ export type ServiceResult = {
18
+ status: "pending" | "succeeded" | "failed" | "partial";
19
+ success: boolean;
20
+ task_id: string;
21
+ trace_id: string;
22
+ media_urls: string[];
23
+ data: unknown;
24
+ result: unknown;
25
+ };
26
+ export declare function normalize(body: unknown, taskId?: string, retrieved?: boolean, synchronous?: boolean, allowPartial?: boolean): ServiceResult;
27
+ export declare function readLimited(response: Response, limit: number): Promise<Buffer>;
28
+ export declare class ServiceClient {
29
+ private readonly apiKey;
30
+ private readonly fetchFn;
31
+ constructor(apiKey: string, fetchFn?: typeof fetch);
32
+ request(request: PreparedRequest, signal?: AbortSignal): Promise<unknown>;
33
+ invoke(service: Service, tool: string, params: Values, signal?: AbortSignal): Promise<ServiceResult>;
34
+ complete(service: Service, tool: string, params: Values, timeoutMs?: number): Promise<ServiceResult>;
35
+ }
36
+ export {};