maoda-commander-tt 0.0.42 → 0.0.44
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 +5 -76
- package/dist/main.js.map +1 -1
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -2308,12 +2308,12 @@ var ShortcutEmoPippitCnCommand = class extends ShortcutBaseCommand {
|
|
|
2308
2308
|
_meta() {
|
|
2309
2309
|
return {
|
|
2310
2310
|
name: "pippit-cn",
|
|
2311
|
-
description: "\
|
|
2311
|
+
description: "\u5728 pippit \u9879\u76EE\u542F\u52A8 platform-xyq",
|
|
2312
2312
|
aliases: ["ppc"]
|
|
2313
2313
|
};
|
|
2314
2314
|
}
|
|
2315
2315
|
async _execute(_ctx) {
|
|
2316
|
-
const cwd = join5(homedir3(), "work", "pippit
|
|
2316
|
+
const cwd = join5(homedir3(), "work", "pippit");
|
|
2317
2317
|
return this._runCommandLine(`w2 start && emo start platform-xyq`, cwd);
|
|
2318
2318
|
}
|
|
2319
2319
|
};
|
|
@@ -3289,6 +3289,7 @@ var ASSET_TYPE = {
|
|
|
3289
3289
|
image: "2",
|
|
3290
3290
|
audio: "4"
|
|
3291
3291
|
};
|
|
3292
|
+
var VIDEO_POLL_INTERVAL_SECONDS = 3;
|
|
3292
3293
|
var IMAGE_EXTENSIONS2 = /* @__PURE__ */ new Set([
|
|
3293
3294
|
".jpg",
|
|
3294
3295
|
".jpeg",
|
|
@@ -3584,15 +3585,11 @@ var XyqSession = class {
|
|
|
3584
3585
|
) : void 0) ?? runList.at(-1);
|
|
3585
3586
|
const runRecord = isRecord2(run) ? run : {};
|
|
3586
3587
|
const serverRunId = normalizeString2(runRecord.run_id);
|
|
3587
|
-
const queueInfo = await this._queryQueueInfoBestEffort(
|
|
3588
|
-
threadId,
|
|
3589
|
-
serverRunId ?? requestedRunId
|
|
3590
|
-
);
|
|
3591
3588
|
const entryList = Array.isArray(runRecord.entry_list) ? runRecord.entry_list : [];
|
|
3592
3589
|
const artifacts = entryList.map(extractVideoArtifact).filter((artifact) => artifact !== void 0);
|
|
3593
3590
|
const providerState = mapXyqRunState(toNumber(runRecord.state));
|
|
3594
3591
|
const state = hasUsableVideoOutput(artifacts) ? "completed" : providerState;
|
|
3595
|
-
const retryAfterSeconds = isTerminalXyqTaskState(state) ? 0 :
|
|
3592
|
+
const retryAfterSeconds = isTerminalXyqTaskState(state) ? 0 : VIDEO_POLL_INTERVAL_SECONDS;
|
|
3596
3593
|
return ok19({
|
|
3597
3594
|
taskId: createXyqTaskId(threadId),
|
|
3598
3595
|
threadId,
|
|
@@ -3600,7 +3597,7 @@ var XyqSession = class {
|
|
|
3600
3597
|
state,
|
|
3601
3598
|
retryAfterSeconds,
|
|
3602
3599
|
artifacts,
|
|
3603
|
-
...
|
|
3600
|
+
...runRecord.RunQueueInfo !== void 0 ? { queueInfo: camelizeValue(runRecord.RunQueueInfo) } : {},
|
|
3604
3601
|
...runRecord.fail_reason !== void 0 ? { failReason: camelizeValue(runRecord.fail_reason) } : {},
|
|
3605
3602
|
raw: camelizeValue(threadResult.value.data)
|
|
3606
3603
|
});
|
|
@@ -3815,31 +3812,6 @@ var XyqSession = class {
|
|
|
3815
3812
|
} : {};
|
|
3816
3813
|
return ok19(headers);
|
|
3817
3814
|
}
|
|
3818
|
-
async _queryQueueInfoBestEffort(threadId, runId) {
|
|
3819
|
-
const result = await requestXyqJson(
|
|
3820
|
-
this._fetcher,
|
|
3821
|
-
`${XYQ_ORIGIN}/api/biz/v1/agent/get_user_queue_info`,
|
|
3822
|
-
{
|
|
3823
|
-
method: "POST",
|
|
3824
|
-
headers: {
|
|
3825
|
-
...this._headers(),
|
|
3826
|
-
"content-type": "application/json"
|
|
3827
|
-
},
|
|
3828
|
-
body: JSON.stringify({
|
|
3829
|
-
uid: this.context.uid,
|
|
3830
|
-
thread_id: threadId,
|
|
3831
|
-
...runId ? { run_id: runId } : {},
|
|
3832
|
-
need_earliest_submitted_working_run: true
|
|
3833
|
-
})
|
|
3834
|
-
},
|
|
3835
|
-
{
|
|
3836
|
-
requestFailedCode: XyqErrorCode.VideoQueryRequestFailed,
|
|
3837
|
-
responseInvalidCode: XyqErrorCode.VideoQueryResponseInvalid,
|
|
3838
|
-
operation: "\u67E5\u8BE2 XYQ \u89C6\u9891\u4EFB\u52A1\u961F\u5217"
|
|
3839
|
-
}
|
|
3840
|
-
);
|
|
3841
|
-
return result.ok ? result.value.data : void 0;
|
|
3842
|
-
}
|
|
3843
3815
|
};
|
|
3844
3816
|
function buildSubmitAudioBody(input) {
|
|
3845
3817
|
const contentData = {
|
|
@@ -4105,19 +4077,6 @@ function extractVideoArtifact(entry) {
|
|
|
4105
4077
|
raw: camelizeValue(artifact)
|
|
4106
4078
|
};
|
|
4107
4079
|
}
|
|
4108
|
-
function resolveRetryAfterSeconds(queueInfo) {
|
|
4109
|
-
const parsed = parseJsonRecord(queueInfo) ?? queueInfo;
|
|
4110
|
-
const value = deepFindStringByKey(parsed, [
|
|
4111
|
-
"estimated_wait_seconds",
|
|
4112
|
-
"wait_seconds",
|
|
4113
|
-
"queue_wait_seconds"
|
|
4114
|
-
]);
|
|
4115
|
-
const seconds = Number(value ?? 0);
|
|
4116
|
-
if (Number.isFinite(seconds) && seconds > 0) {
|
|
4117
|
-
return Math.max(1, Math.min(Math.ceil(seconds), 5));
|
|
4118
|
-
}
|
|
4119
|
-
return 3;
|
|
4120
|
-
}
|
|
4121
4080
|
function deepCollectAudioOutputs(value) {
|
|
4122
4081
|
const results = /* @__PURE__ */ new Map();
|
|
4123
4082
|
collectAudioOutputs(value, void 0, results, 0);
|
|
@@ -4297,36 +4256,6 @@ function collectExplicitVideo(value, inheritedPippitAssetId, results, depth) {
|
|
|
4297
4256
|
function videoQualityScore(output) {
|
|
4298
4257
|
return (output.width ?? 0) * (output.height ?? 0);
|
|
4299
4258
|
}
|
|
4300
|
-
function deepFindStringByKey(value, keys, depth = 0) {
|
|
4301
|
-
if (depth > 6) {
|
|
4302
|
-
return void 0;
|
|
4303
|
-
}
|
|
4304
|
-
if (Array.isArray(value)) {
|
|
4305
|
-
for (const item of value) {
|
|
4306
|
-
const found = deepFindStringByKey(item, keys, depth + 1);
|
|
4307
|
-
if (found) {
|
|
4308
|
-
return found;
|
|
4309
|
-
}
|
|
4310
|
-
}
|
|
4311
|
-
return void 0;
|
|
4312
|
-
}
|
|
4313
|
-
if (!isRecord2(value)) {
|
|
4314
|
-
return void 0;
|
|
4315
|
-
}
|
|
4316
|
-
for (const key of keys) {
|
|
4317
|
-
const found = normalizeString2(value[key]);
|
|
4318
|
-
if (found) {
|
|
4319
|
-
return found;
|
|
4320
|
-
}
|
|
4321
|
-
}
|
|
4322
|
-
for (const child of Object.values(value)) {
|
|
4323
|
-
const found = deepFindStringByKey(child, keys, depth + 1);
|
|
4324
|
-
if (found) {
|
|
4325
|
-
return found;
|
|
4326
|
-
}
|
|
4327
|
-
}
|
|
4328
|
-
return void 0;
|
|
4329
|
-
}
|
|
4330
4259
|
function parseJsonRecord(value) {
|
|
4331
4260
|
if (isRecord2(value)) {
|
|
4332
4261
|
return value;
|