@acedatacloud/sdk 2026.727.2 → 2026.728.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acedatacloud/sdk",
3
- "version": "2026.727.2",
3
+ "version": "2026.728.0",
4
4
  "description": "Official TypeScript SDK for AceDataCloud — AI-powered data services",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -137,6 +137,17 @@ export function taskStatus(state: Record<string, unknown>): 'succeeded' | 'faile
137
137
  }
138
138
  if (words.length > 0) return '';
139
139
 
140
+ // `success: false` alone is ambiguous — some services set it for a transient
141
+ // hiccup mid-run, alongside a bare string, and carry on. A *structured* error
142
+ // (a dict with a code) is the upstream's final answer: hailuo reports an
143
+ // unavailable model that way, with no finished_at, and treating it as still
144
+ // running makes the caller poll until timeout instead of showing the reason.
145
+ if (response.success === false) {
146
+ const error = response.error as Record<string, unknown> | undefined;
147
+ const structured = !!error && typeof error === 'object' && !!error.code;
148
+ if (artifactUrls(state).length > 0 || structured) return 'failed';
149
+ }
150
+
140
151
  const finished =
141
152
  (response.finished_at !== undefined && response.finished_at !== null) ||
142
153
  (state.finished_at !== undefined && state.finished_at !== null);