democut 1.0.154 → 1.0.156
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/cli.js +51 -6
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -6916,7 +6916,7 @@ import { realpathSync } from "fs";
|
|
|
6916
6916
|
import { fileURLToPath } from "url";
|
|
6917
6917
|
|
|
6918
6918
|
// src/version.ts
|
|
6919
|
-
var VERSION = "1.0.
|
|
6919
|
+
var VERSION = "1.0.156";
|
|
6920
6920
|
|
|
6921
6921
|
// src/device-flow.ts
|
|
6922
6922
|
var DeviceFlowError = class extends Error {
|
|
@@ -8243,6 +8243,11 @@ var GENERATED_TOOLS = [
|
|
|
8243
8243
|
"cut_id": {
|
|
8244
8244
|
"type": "string",
|
|
8245
8245
|
"description": "\uCEF7 id(cut_\u2026)"
|
|
8246
|
+
},
|
|
8247
|
+
"words": {
|
|
8248
|
+
"default": false,
|
|
8249
|
+
"description": "true \uBA74 \uC120\uD0DD\uB41C \uBC84\uC804\uC758 \uB0B1\uB9D0 \uC2DC\uAC01\uC744 \uD568\uAED8 \uC900\uB2E4(edit.layers \uC2DC\uAC01\uC6A9)",
|
|
8250
|
+
"type": "boolean"
|
|
8246
8251
|
}
|
|
8247
8252
|
},
|
|
8248
8253
|
"required": [
|
|
@@ -11066,12 +11071,18 @@ var GENERATED_TOOLS = [
|
|
|
11066
11071
|
"edit": {
|
|
11067
11072
|
"type": "object",
|
|
11068
11073
|
"description": "\uBAA8\uB378 CutEdit \u2014 \uBAA8\uC591\uC740 \uC790\uC6D0 democut://guide \uC640 democut_get_options \uAC00 \uB9D0\uD55C\uB2E4(\uC5EC\uAE30\uC11C\uB294 \uC81C\uC57D\uC744 \uAC78\uC9C0 \uC54A\uB294\uB2E4)"
|
|
11074
|
+
},
|
|
11075
|
+
"rev": {
|
|
11076
|
+
"type": "integer",
|
|
11077
|
+
"minimum": 0,
|
|
11078
|
+
"description": "\uD604\uC7AC rev(democut_get_storyboard \uC758 \uAC12 \uADF8\uB300\uB85C). \uADF8 \uC0AC\uC774 \uBC14\uB00C\uC5C8\uC73C\uBA74 409 REV_MISMATCH"
|
|
11069
11079
|
}
|
|
11070
11080
|
},
|
|
11071
11081
|
"required": [
|
|
11072
11082
|
"slug",
|
|
11073
11083
|
"cut_id",
|
|
11074
|
-
"edit"
|
|
11084
|
+
"edit",
|
|
11085
|
+
"rev"
|
|
11075
11086
|
],
|
|
11076
11087
|
"additionalProperties": false
|
|
11077
11088
|
},
|
|
@@ -11285,12 +11296,18 @@ var GENERATED_TOOLS = [
|
|
|
11285
11296
|
"null"
|
|
11286
11297
|
],
|
|
11287
11298
|
"description": "\uBC30\uACBD\uC74C\uC545 \uC9C0\uC815(\uBAA8\uC591\uC740 CutBgm). null \uC774\uBA74 \uC74C\uC545\uC744 \uBE80\uB2E4 \u2014 \uBAA8\uB378 CutBgm \u2014 \uBAA8\uC591\uC740 \uC790\uC6D0 democut://guide \uC640 democut_get_options \uAC00 \uB9D0\uD55C\uB2E4(\uC5EC\uAE30\uC11C\uB294 \uC81C\uC57D\uC744 \uAC78\uC9C0 \uC54A\uB294\uB2E4)"
|
|
11299
|
+
},
|
|
11300
|
+
"rev": {
|
|
11301
|
+
"type": "integer",
|
|
11302
|
+
"minimum": 0,
|
|
11303
|
+
"description": "\uD604\uC7AC rev(democut_get_storyboard \uC758 \uAC12 \uADF8\uB300\uB85C). \uADF8 \uC0AC\uC774 \uBC14\uB00C\uC5C8\uC73C\uBA74 409 REV_MISMATCH"
|
|
11288
11304
|
}
|
|
11289
11305
|
},
|
|
11290
11306
|
"required": [
|
|
11291
11307
|
"slug",
|
|
11292
11308
|
"cut_id",
|
|
11293
|
-
"bgm"
|
|
11309
|
+
"bgm",
|
|
11310
|
+
"rev"
|
|
11294
11311
|
],
|
|
11295
11312
|
"additionalProperties": false
|
|
11296
11313
|
},
|
|
@@ -14975,6 +14992,9 @@ function needSlug(a) {
|
|
|
14975
14992
|
}
|
|
14976
14993
|
return slug;
|
|
14977
14994
|
}
|
|
14995
|
+
function revHeader(rev) {
|
|
14996
|
+
return rev === void 0 || rev === null ? {} : { headers: { "If-Match": String(rev) } };
|
|
14997
|
+
}
|
|
14978
14998
|
function optionChoiceLines(out4) {
|
|
14979
14999
|
const lines = [];
|
|
14980
15000
|
const voices = out4.voices ?? [];
|
|
@@ -15466,6 +15486,23 @@ function waitJobs(a = {}, deps = {}) {
|
|
|
15466
15486
|
return { text: lines.join("\n"), structured: callableStructured({ jobs, all_done: allDone }) };
|
|
15467
15487
|
});
|
|
15468
15488
|
}
|
|
15489
|
+
function spokenLines(cut) {
|
|
15490
|
+
const none = "\uC120\uD0DD\uB41C \uBC84\uC804\uC5D0 \uB0B1\uB9D0\xB7\uB300\uC0AC \uC2DC\uAC01\uC774 \uC5C6\uB2E4.";
|
|
15491
|
+
const timing = cut.versions?.find((v) => v.version === cut.current_version)?.timing;
|
|
15492
|
+
if (timing?.words?.length) {
|
|
15493
|
+
return [
|
|
15494
|
+
"\uB0B1\uB9D0 \uC2DC\uAC01(\uC120\uD0DD\uB41C \uBC84\uC804, \uC2DC\uC791-\uB05D ms) \u2014 edit.layers \uC758 at_ms\xB7end_ms \uC5D0 \uADF8\uB300\uB85C \uC4F4\uB2E4:",
|
|
15495
|
+
timing.words.map((w) => `${w.start_ms}-${w.end_ms}:${w.text}`).join(" ")
|
|
15496
|
+
];
|
|
15497
|
+
}
|
|
15498
|
+
if (timing?.dialogue?.length) {
|
|
15499
|
+
return [
|
|
15500
|
+
"\uC774 \uBC84\uC804\uC5D0\uB294 \uB0B1\uB9D0 \uC2DC\uAC01\uC774 \uC5C6\uB2E4. \uB300\uC0AC \uC904 \uC2DC\uAC01(\uC904 id: \uC2DC\uC791-\uB05D ms)\uC744 \uC4F4\uB2E4:",
|
|
15501
|
+
timing.dialogue.map((d) => `${d.id}:${d.start_ms}-${d.end_ms}`).join(" ")
|
|
15502
|
+
];
|
|
15503
|
+
}
|
|
15504
|
+
return [none];
|
|
15505
|
+
}
|
|
15469
15506
|
function getCut(a = {}, deps = {}) {
|
|
15470
15507
|
return guarded(READ_ONLY, async () => {
|
|
15471
15508
|
const slug = needSlug(a);
|
|
@@ -15473,7 +15510,8 @@ function getCut(a = {}, deps = {}) {
|
|
|
15473
15510
|
const cutId = (a.cut_id ?? "").trim();
|
|
15474
15511
|
if (!cutId) return { isError: true, text: "cut_id \uAC00 \uD544\uC694\uD569\uB2C8\uB2E4." };
|
|
15475
15512
|
const base = resolveBaseUrl(deps.baseUrl);
|
|
15476
|
-
const
|
|
15513
|
+
const q = a.words ? "?words=true" : "";
|
|
15514
|
+
const cut = await apiRequest(base, projectPath(slug, `/cuts/${encodeURIComponent(cutId)}${q}`), {}, deps);
|
|
15477
15515
|
const versions = [...cut.versions ?? []].sort((x, y) => y.version - x.version);
|
|
15478
15516
|
const lines = [cutLine(cut)];
|
|
15479
15517
|
lines.push(
|
|
@@ -15497,6 +15535,13 @@ function getCut(a = {}, deps = {}) {
|
|
|
15497
15535
|
);
|
|
15498
15536
|
lines.push(JSON.stringify(cut.draft_spec));
|
|
15499
15537
|
}
|
|
15538
|
+
lines.push(
|
|
15539
|
+
callableToolNames(
|
|
15540
|
+
"\uD3B8\uC9D1(edit) \u2014 set_cut_edit \uC5D0 \uADF8\uB300\uB85C \uB123\uC744 \uC218 \uC788\uB294 \uC804\uCCB4 \uAC12\uC774\uB2E4. \uACE0\uCE60 \uCE78\uB9CC \uBC14\uAFD4 \uD1B5\uC9F8\uB85C \uBCF4\uB0B4\uB77C(\uC548 \uADF8\uB7EC\uBA74 \uB098\uBA38\uC9C0 \uCE78\uC774 \uC0AC\uB77C\uC9C4\uB2E4):"
|
|
15541
|
+
)
|
|
15542
|
+
);
|
|
15543
|
+
lines.push(JSON.stringify(cut.edit ?? {}));
|
|
15544
|
+
if (a.words) lines.push(...spokenLines(cut));
|
|
15500
15545
|
if (cut.next_calls?.length)
|
|
15501
15546
|
lines.push(callableToolNames(`\uB2E4\uC74C \uD638\uCD9C: ${cut.next_calls.join(", ")}`));
|
|
15502
15547
|
return { text: lines.join("\n"), structured: callableStructured(cut) };
|
|
@@ -15822,7 +15867,7 @@ function setCutEdit(a = {}, deps = {}) {
|
|
|
15822
15867
|
const cut = await apiRequest(
|
|
15823
15868
|
base,
|
|
15824
15869
|
projectPath(slug, `/cuts/${encodeURIComponent(cutId)}/edit`),
|
|
15825
|
-
{ method: "PUT", body: { edit: a.edit } },
|
|
15870
|
+
{ method: "PUT", body: { edit: a.edit }, ...revHeader(a.rev) },
|
|
15826
15871
|
deps
|
|
15827
15872
|
);
|
|
15828
15873
|
return { text: [cutLine(cut), EDIT_NOTE].join("\n"), structured: callableStructured(cut) };
|
|
@@ -15843,7 +15888,7 @@ function setCutBgm(a = {}, deps = {}) {
|
|
|
15843
15888
|
cut = await apiRequest(
|
|
15844
15889
|
base,
|
|
15845
15890
|
projectPath(slug, `/cuts/${encodeURIComponent(cutId)}/bgm`),
|
|
15846
|
-
{ method: "PUT", body: { bgm: a.bgm } },
|
|
15891
|
+
{ method: "PUT", body: { bgm: a.bgm }, ...revHeader(a.rev) },
|
|
15847
15892
|
deps
|
|
15848
15893
|
);
|
|
15849
15894
|
} catch (e) {
|