maoda-commander-tt 0.0.31 → 0.0.37
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/main.js +6 -2
- package/dist/main.js.map +1 -1
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -3563,10 +3563,11 @@ var XyqSession = class {
|
|
|
3563
3563
|
threadId,
|
|
3564
3564
|
serverRunId ?? requestedRunId
|
|
3565
3565
|
);
|
|
3566
|
-
const state = mapVideoRunState(toNumber(runRecord.state));
|
|
3567
|
-
const retryAfterSeconds = isTerminalVideoState(state) ? 0 : resolveRetryAfterSeconds(queueInfo ?? runRecord.RunQueueInfo);
|
|
3568
3566
|
const entryList = Array.isArray(runRecord.entry_list) ? runRecord.entry_list : [];
|
|
3569
3567
|
const artifacts = entryList.map(extractVideoArtifact).filter((artifact) => artifact !== void 0);
|
|
3568
|
+
const providerState = mapVideoRunState(toNumber(runRecord.state));
|
|
3569
|
+
const state = hasUsableVideoOutput(artifacts) ? "completed" : providerState;
|
|
3570
|
+
const retryAfterSeconds = isTerminalVideoState(state) ? 0 : resolveRetryAfterSeconds(queueInfo ?? runRecord.RunQueueInfo);
|
|
3570
3571
|
return ok20({
|
|
3571
3572
|
taskId: createXyqTaskId(threadId),
|
|
3572
3573
|
threadId,
|
|
@@ -3928,6 +3929,9 @@ function mapVideoRunState(stateCode) {
|
|
|
3928
3929
|
function isTerminalVideoState(state) {
|
|
3929
3930
|
return ["completed", "failed", "canceled", "inputRequired"].includes(state);
|
|
3930
3931
|
}
|
|
3932
|
+
function hasUsableVideoOutput(artifacts) {
|
|
3933
|
+
return artifacts.some((artifact) => artifact.videos.length > 0);
|
|
3934
|
+
}
|
|
3931
3935
|
function extractVideoArtifact(entry) {
|
|
3932
3936
|
if (!isRecord2(entry)) {
|
|
3933
3937
|
return void 0;
|