democut 0.6.15 → 0.6.17

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 (2) hide show
  1. package/dist/cli.js +312 -1
  2. 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 = "0.6.15";
6919
+ var VERSION = "0.6.17";
6920
6920
 
6921
6921
  // src/device-flow.ts
6922
6922
  var DeviceFlowError = class extends Error {
@@ -16295,6 +16295,21 @@ var GENERATED_TOOLS = [
16295
16295
  "title": "Image Prompt",
16296
16296
  "type": "string"
16297
16297
  },
16298
+ "provider": {
16299
+ "anyOf": [
16300
+ {
16301
+ "maxLength": 32,
16302
+ "minLength": 1,
16303
+ "type": "string"
16304
+ },
16305
+ {
16306
+ "type": "null"
16307
+ }
16308
+ ],
16309
+ "default": null,
16310
+ "description": "\uC601\uC0C1 \uC0DD\uC131 \uACF5\uAE09\uC790(\uC608: minimax). \uBE44\uC6B0\uBA74 \uC11C\uBC84 \uAE30\uBCF8\uAC12 \u2014 \uC4F8 \uC218 \uC788\uB294 \uBAA9\uB85D\uC740 GET \u2026/options \uC758 videogen_providers",
16311
+ "title": "Provider"
16312
+ },
16298
16313
  "seed": {
16299
16314
  "anyOf": [
16300
16315
  {
@@ -17129,6 +17144,21 @@ var GENERATED_TOOLS = [
17129
17144
  "title": "Image Prompt",
17130
17145
  "type": "string"
17131
17146
  },
17147
+ "provider": {
17148
+ "anyOf": [
17149
+ {
17150
+ "maxLength": 32,
17151
+ "minLength": 1,
17152
+ "type": "string"
17153
+ },
17154
+ {
17155
+ "type": "null"
17156
+ }
17157
+ ],
17158
+ "default": null,
17159
+ "description": "\uC601\uC0C1 \uC0DD\uC131 \uACF5\uAE09\uC790(\uC608: minimax). \uBE44\uC6B0\uBA74 \uC11C\uBC84 \uAE30\uBCF8\uAC12 \u2014 \uC4F8 \uC218 \uC788\uB294 \uBAA9\uB85D\uC740 GET \u2026/options \uC758 videogen_providers",
17160
+ "title": "Provider"
17161
+ },
17132
17162
  "seed": {
17133
17163
  "anyOf": [
17134
17164
  {
@@ -18136,6 +18166,183 @@ var GENERATED_TOOLS = [
18136
18166
  "idempotentHint": true,
18137
18167
  "openWorldHint": false
18138
18168
  }
18169
+ },
18170
+ {
18171
+ "name": "democut_list_characters",
18172
+ "description": "\uC544\uBC14\uD0C0 \uBAA9\uB85D.",
18173
+ "inputSchema": {
18174
+ "type": "object",
18175
+ "properties": {},
18176
+ "required": [],
18177
+ "additionalProperties": false
18178
+ },
18179
+ "annotations": {
18180
+ "readOnlyHint": true,
18181
+ "destructiveHint": false,
18182
+ "idempotentHint": true,
18183
+ "openWorldHint": false
18184
+ }
18185
+ },
18186
+ {
18187
+ "name": "democut_create_character",
18188
+ "description": "\uC544\uBC14\uD0C0\uB97C \uB9CC\uB4E0\uB2E4(0\uC6D0).",
18189
+ "inputSchema": {
18190
+ "type": "object",
18191
+ "properties": {
18192
+ "name": {
18193
+ "maxLength": 100,
18194
+ "minLength": 1,
18195
+ "title": "Name",
18196
+ "type": "string"
18197
+ },
18198
+ "role": {
18199
+ "default": "",
18200
+ "title": "Role",
18201
+ "type": "string"
18202
+ },
18203
+ "voice_id": {
18204
+ "anyOf": [
18205
+ {
18206
+ "type": "string"
18207
+ },
18208
+ {
18209
+ "type": "null"
18210
+ }
18211
+ ],
18212
+ "default": null,
18213
+ "title": "Voice Id"
18214
+ },
18215
+ "persona_text": {
18216
+ "default": "",
18217
+ "title": "Persona Text",
18218
+ "type": "string"
18219
+ },
18220
+ "look_text": {
18221
+ "default": "",
18222
+ "title": "Look Text",
18223
+ "type": "string"
18224
+ }
18225
+ },
18226
+ "required": [
18227
+ "name"
18228
+ ],
18229
+ "additionalProperties": false
18230
+ },
18231
+ "annotations": {
18232
+ "readOnlyHint": false,
18233
+ "destructiveHint": false,
18234
+ "idempotentHint": false,
18235
+ "openWorldHint": false
18236
+ }
18237
+ },
18238
+ {
18239
+ "name": "democut_get_character",
18240
+ "description": "\uC544\uBC14\uD0C0 \uD558\uB098(\uC0AC\uC9C4 \uD310).",
18241
+ "inputSchema": {
18242
+ "type": "object",
18243
+ "properties": {
18244
+ "character_id": {
18245
+ "type": "string",
18246
+ "description": "\uC544\uBC14\uD0C0 id(chr_\u2026)"
18247
+ }
18248
+ },
18249
+ "required": [
18250
+ "character_id"
18251
+ ],
18252
+ "additionalProperties": false
18253
+ },
18254
+ "annotations": {
18255
+ "readOnlyHint": true,
18256
+ "destructiveHint": false,
18257
+ "idempotentHint": true,
18258
+ "openWorldHint": false
18259
+ }
18260
+ },
18261
+ {
18262
+ "name": "democut_put_character",
18263
+ "description": "\uC544\uBC14\uD0C0\uB97C \uC804\uCCB4 \uAD50\uCCB4\uD55C\uB2E4(If-Match rev). democut_get_character \uC758 rev \uB97C \uADF8\uB300\uB85C \uB123\uC5B4\uB77C \u2014 \uADF8 \uC0AC\uC774 \uB204\uAC00 \uBC14\uAFE8\uC73C\uBA74 409 \uC774\uACE0 \uBCD1\uD569\uD558\uC9C0 \uC54A\uB294\uB2E4.",
18264
+ "inputSchema": {
18265
+ "type": "object",
18266
+ "properties": {
18267
+ "character_id": {
18268
+ "type": "string",
18269
+ "description": "\uC544\uBC14\uD0C0 id(chr_\u2026)"
18270
+ },
18271
+ "name": {
18272
+ "maxLength": 100,
18273
+ "minLength": 1,
18274
+ "title": "Name",
18275
+ "type": "string"
18276
+ },
18277
+ "role": {
18278
+ "default": "",
18279
+ "title": "Role",
18280
+ "type": "string"
18281
+ },
18282
+ "voice_id": {
18283
+ "anyOf": [
18284
+ {
18285
+ "type": "string"
18286
+ },
18287
+ {
18288
+ "type": "null"
18289
+ }
18290
+ ],
18291
+ "default": null,
18292
+ "title": "Voice Id"
18293
+ },
18294
+ "persona_text": {
18295
+ "default": "",
18296
+ "title": "Persona Text",
18297
+ "type": "string"
18298
+ },
18299
+ "look_text": {
18300
+ "default": "",
18301
+ "title": "Look Text",
18302
+ "type": "string"
18303
+ },
18304
+ "rev": {
18305
+ "type": "integer",
18306
+ "minimum": 0,
18307
+ "description": "\uD604\uC7AC rev(get_character \uC758 \uAC12 \uADF8\uB300\uB85C). \uADF8 \uC0AC\uC774 \uBC14\uB00C\uC5C8\uC73C\uBA74 409 REV_MISMATCH"
18308
+ }
18309
+ },
18310
+ "required": [
18311
+ "character_id",
18312
+ "name",
18313
+ "rev"
18314
+ ],
18315
+ "additionalProperties": false
18316
+ },
18317
+ "annotations": {
18318
+ "readOnlyHint": false,
18319
+ "destructiveHint": false,
18320
+ "idempotentHint": true,
18321
+ "openWorldHint": false
18322
+ }
18323
+ },
18324
+ {
18325
+ "name": "democut_delete_character",
18326
+ "description": "\uC544\uBC14\uD0C0\uB97C \uC9C0\uC6B4\uB2E4.",
18327
+ "inputSchema": {
18328
+ "type": "object",
18329
+ "properties": {
18330
+ "character_id": {
18331
+ "type": "string",
18332
+ "description": "\uC544\uBC14\uD0C0 id(chr_\u2026)"
18333
+ }
18334
+ },
18335
+ "required": [
18336
+ "character_id"
18337
+ ],
18338
+ "additionalProperties": false
18339
+ },
18340
+ "annotations": {
18341
+ "readOnlyHint": false,
18342
+ "destructiveHint": true,
18343
+ "idempotentHint": true,
18344
+ "openWorldHint": false
18345
+ }
18139
18346
  }
18140
18347
  ];
18141
18348
 
@@ -18321,6 +18528,7 @@ async function apiRequest(baseUrl, path, init = {}, deps = {}) {
18321
18528
  const fetchImpl = deps.fetchImpl ?? fetch;
18322
18529
  const token = await getValidAccessToken(baseUrl, deps);
18323
18530
  const headers = {
18531
+ ...init.headers ?? {},
18324
18532
  Authorization: `Bearer ${token}`,
18325
18533
  "User-Agent": `democut/${VERSION}`
18326
18534
  };
@@ -18960,6 +19168,98 @@ function cancelJob(a = {}, deps = {}) {
18960
19168
  return { text: lines.join("\n") };
18961
19169
  });
18962
19170
  }
19171
+ function characterLine(c) {
19172
+ const photos = c.photos?.length ? `\uC0AC\uC9C4 ${c.photos.length}\uC7A5` : "\uC0AC\uC9C4 \uC5C6\uC74C";
19173
+ return `${c.name} [${c.id}] rev=${c.rev} \xB7 ${photos}${c.current_photo_id ? " (\uB300\uD45C \uC788\uC74C)" : ""}`;
19174
+ }
19175
+ function listCharacters(_a3 = {}, deps = {}) {
19176
+ return guarded(READ_ONLY, async () => {
19177
+ const base = resolveBaseUrl(deps.baseUrl);
19178
+ const out2 = await apiRequest(base, "/api/characters", {}, deps);
19179
+ if (!out2.characters?.length) {
19180
+ return { text: "\uC544\uBC14\uD0C0\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. democut_create_character \uB85C \uB9CC\uB4DC\uC138\uC694." };
19181
+ }
19182
+ return {
19183
+ text: [`\uC544\uBC14\uD0C0 ${out2.characters.length}\uAC1C:`, ...out2.characters.map((c) => ` ${characterLine(c)}`)].join("\n")
19184
+ };
19185
+ });
19186
+ }
19187
+ function characterBody(a) {
19188
+ return {
19189
+ name: a.name,
19190
+ role: a.role ?? "",
19191
+ voice_id: a.voice_id ?? null,
19192
+ persona_text: a.persona_text ?? "",
19193
+ look_text: a.look_text ?? ""
19194
+ };
19195
+ }
19196
+ function createCharacter(a = {}, deps = {}) {
19197
+ return guarded(READ_ONLY, async () => {
19198
+ if (!(a.name ?? "").trim()) return { isError: true, text: "name \uC774 \uD544\uC694\uD569\uB2C8\uB2E4." };
19199
+ const base = resolveBaseUrl(deps.baseUrl);
19200
+ const out2 = await apiRequest(
19201
+ base,
19202
+ "/api/characters",
19203
+ { method: "POST", body: characterBody(a) },
19204
+ deps
19205
+ );
19206
+ return {
19207
+ text: [
19208
+ `\uC544\uBC14\uD0C0\uB97C \uB9CC\uB4E4\uC5C8\uC2B5\uB2C8\uB2E4: ${characterLine(out2)}`,
19209
+ `\uCEF7\uC5D0\uC11C \uC4F0\uB824\uBA74 spec.pip.avatar_id \uC5D0 ${out2.id} \uB97C \uB123\uC73C\uC138\uC694.`
19210
+ ].join("\n")
19211
+ };
19212
+ });
19213
+ }
19214
+ function getCharacter(a = {}, deps = {}) {
19215
+ return guarded(READ_ONLY, async () => {
19216
+ const id = (a.character_id ?? "").trim();
19217
+ if (!id) return { isError: true, text: "character_id \uAC00 \uD544\uC694\uD569\uB2C8\uB2E4." };
19218
+ const base = resolveBaseUrl(deps.baseUrl);
19219
+ const out2 = await apiRequest(base, `/api/characters/${encodeURIComponent(id)}`, {}, deps);
19220
+ const lines = [characterLine(out2)];
19221
+ if (out2.role) lines.push(` \uC5ED\uD560: ${out2.role}`);
19222
+ if (out2.voice_id) lines.push(` \uBCF4\uC774\uC2A4: ${out2.voice_id}`);
19223
+ for (const p of out2.photos ?? []) {
19224
+ lines.push(` \uC0AC\uC9C4 ${p.seq}: ${p.asset_id} (${p.source})${p.id === out2.current_photo_id ? " \u2190 \uB300\uD45C" : ""}`);
19225
+ }
19226
+ return { text: lines.join("\n") };
19227
+ });
19228
+ }
19229
+ function putCharacter(a = {}, deps = {}) {
19230
+ return guarded(READ_ONLY, async () => {
19231
+ const id = (a.character_id ?? "").trim();
19232
+ if (!id) return { isError: true, text: "character_id \uAC00 \uD544\uC694\uD569\uB2C8\uB2E4." };
19233
+ if (!(a.name ?? "").trim()) return { isError: true, text: "name \uC774 \uD544\uC694\uD569\uB2C8\uB2E4(\uC804\uCCB4 \uAD50\uCCB4\uC785\uB2C8\uB2E4)." };
19234
+ if (a.rev === void 0 || a.rev === null) {
19235
+ return { isError: true, text: "rev \uAC00 \uD544\uC694\uD569\uB2C8\uB2E4 \u2014 democut_get_character \uB85C \uD604\uC7AC rev \uB97C \uC77D\uC5B4 \uADF8\uB300\uB85C \uB123\uC73C\uC138\uC694." };
19236
+ }
19237
+ const base = resolveBaseUrl(deps.baseUrl);
19238
+ const out2 = await apiRequest(
19239
+ base,
19240
+ `/api/characters/${encodeURIComponent(id)}`,
19241
+ { method: "PUT", body: characterBody(a), headers: { "If-Match": String(a.rev) } },
19242
+ deps
19243
+ );
19244
+ return { text: `\uC544\uBC14\uD0C0\uB97C \uBC14\uAFE8\uC2B5\uB2C8\uB2E4: ${characterLine(out2)}` };
19245
+ });
19246
+ }
19247
+ function deleteCharacter(a = {}, deps = {}) {
19248
+ return guarded(READ_ONLY, async () => {
19249
+ const id = (a.character_id ?? "").trim();
19250
+ if (!id) return { isError: true, text: "character_id \uAC00 \uD544\uC694\uD569\uB2C8\uB2E4." };
19251
+ const base = resolveBaseUrl(deps.baseUrl);
19252
+ await apiRequest(
19253
+ base,
19254
+ `/api/characters/${encodeURIComponent(id)}`,
19255
+ { method: "DELETE" },
19256
+ deps
19257
+ );
19258
+ return {
19259
+ text: `\uC544\uBC14\uD0C0 ${id} \uB97C \uC9C0\uC6E0\uC2B5\uB2C8\uB2E4. \uC774\uBBF8 \uB9CC\uB4E0 \uCEF7\uC740 \uADF8\uB300\uB85C\uC785\uB2C8\uB2E4(\uADF8\uB54C \uC4F4 \uC790\uC0B0\uC744 \uC790\uAE30 \uD589\uC5D0 \uAC16\uACE0 \uC788\uC2B5\uB2C8\uB2E4).`
19260
+ };
19261
+ });
19262
+ }
18963
19263
 
18964
19264
  // src/mcp/server.ts
18965
19265
  var TOOLS = GENERATED_TOOLS;
@@ -18993,6 +19293,17 @@ function dispatch(name, args, deps = {}) {
18993
19293
  return importCut(args, deps);
18994
19294
  case "democut_cancel_job":
18995
19295
  return cancelJob(args, deps);
19296
+ // ── 아바타(캐릭터) CRUD (MR 19a) ──
19297
+ case "democut_list_characters":
19298
+ return listCharacters(args, deps);
19299
+ case "democut_create_character":
19300
+ return createCharacter(args, deps);
19301
+ case "democut_get_character":
19302
+ return getCharacter(args, deps);
19303
+ case "democut_put_character":
19304
+ return putCharacter(args, deps);
19305
+ case "democut_delete_character":
19306
+ return deleteCharacter(args, deps);
18996
19307
  default:
18997
19308
  return Promise.resolve({ isError: true, text: `\uC54C \uC218 \uC5C6\uB294 \uB3C4\uAD6C: ${name}` });
18998
19309
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "democut",
3
- "version": "0.6.15",
3
+ "version": "0.6.17",
4
4
  "description": "DemoCut 에이전트 CLI — device flow 로그인(RFC 8628) + 영상 생성",
5
5
  "license": "MIT",
6
6
  "author": "InfoGrab",