@wji.ai/cli 0.7.0 → 0.8.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/README.md +4 -1
- package/dist/index.js +7162 -76
- package/package.json +6 -9
- package/skill/short-drama/SKILL.md +22 -10
- package/skill/short-drama/reference/bgm-sfx.md +124 -0
- package/skill/short-drama/reference/canvas-recipes.md +19 -2
- package/skill/short-drama/reference/film-mixing-guideline.md +447 -0
- package/skill/short-drama/reference/mix-over-video.md +89 -0
- package/skill/short-drama/reference/operations-cli.md +1 -1
- package/skill/short-drama/reference/schema.md +4 -2
- package/skill/short-drama/reference/stage-characters.md +2 -2
- package/skill/short-drama/reference/stage-storyboard.md +29 -6
- package/skill/short-drama/reference/workspace-layout.md +2 -2
- package/skill/short-drama/scripts/selftest.mjs +54 -9
- package/skill/short-drama/scripts/short-drama.mjs +150 -12
- package/dist/commands/agent.js +0 -294
- package/dist/commands/asset.js +0 -241
- package/dist/commands/auth.js +0 -216
- package/dist/commands/backreel-enquiry.js +0 -171
- package/dist/commands/backreel-episode.js +0 -243
- package/dist/commands/backreel-fund.js +0 -299
- package/dist/commands/backreel.js +0 -443
- package/dist/commands/canvas.js +0 -1706
- package/dist/commands/class.js +0 -395
- package/dist/commands/config.js +0 -113
- package/dist/commands/crew.js +0 -205
- package/dist/commands/fsnode.js +0 -288
- package/dist/commands/gen.js +0 -356
- package/dist/commands/model.js +0 -136
- package/dist/commands/npc-album.js +0 -201
- package/dist/commands/npc-live.js +0 -316
- package/dist/commands/npc.js +0 -437
- package/dist/commands/org.js +0 -85
- package/dist/commands/preset.js +0 -176
- package/dist/commands/profile.js +0 -129
- package/dist/commands/skill.js +0 -272
- package/dist/commands/workspace.js +0 -470
- package/dist/core/archive.js +0 -95
- package/dist/core/backreel.js +0 -23
- package/dist/core/client.js +0 -269
- package/dist/core/config.js +0 -95
- package/dist/core/crew.js +0 -546
- package/dist/core/image.js +0 -106
- package/dist/core/members.js +0 -54
- package/dist/core/npc.js +0 -108
- package/dist/core/output.js +0 -174
- package/dist/core/prompt.js +0 -118
- package/dist/core/vod.js +0 -149
- package/dist/core/zip.js +0 -87
package/dist/core/zip.js
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Minimal ZIP writer — "stored" (no compression) entries only.
|
|
3
|
-
*
|
|
4
|
-
* The backend's skill importer keeps just the `.md` files and re-parses them, so
|
|
5
|
-
* compression buys nothing here; storing avoids pulling a zip dependency into an
|
|
6
|
-
* otherwise dependency-light CLI. Enough of the spec is implemented to produce a
|
|
7
|
-
* archive JSZip (what the backend uses) reads back correctly.
|
|
8
|
-
*/
|
|
9
|
-
const CRC_TABLE = (() => {
|
|
10
|
-
const table = new Uint32Array(256);
|
|
11
|
-
for (let n = 0; n < 256; n++) {
|
|
12
|
-
let c = n;
|
|
13
|
-
for (let k = 0; k < 8; k++)
|
|
14
|
-
c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1;
|
|
15
|
-
table[n] = c >>> 0;
|
|
16
|
-
}
|
|
17
|
-
return table;
|
|
18
|
-
})();
|
|
19
|
-
function crc32(buf) {
|
|
20
|
-
let crc = 0xffffffff;
|
|
21
|
-
for (let i = 0; i < buf.length; i++)
|
|
22
|
-
crc = CRC_TABLE[(crc ^ buf[i]) & 0xff] ^ (crc >>> 8);
|
|
23
|
-
return (crc ^ 0xffffffff) >>> 0;
|
|
24
|
-
}
|
|
25
|
-
/** DOS date/time — a fixed, valid timestamp is fine; the backend ignores it. */
|
|
26
|
-
function dosDateTime(date = new Date()) {
|
|
27
|
-
const time = (date.getHours() << 11) | (date.getMinutes() << 5) | (Math.floor(date.getSeconds() / 2));
|
|
28
|
-
const day = (((date.getFullYear() - 1980) & 0x7f) << 9) | ((date.getMonth() + 1) << 5) | date.getDate();
|
|
29
|
-
return { time: time & 0xffff, day: day & 0xffff };
|
|
30
|
-
}
|
|
31
|
-
export function createZip(entries) {
|
|
32
|
-
const { time, day } = dosDateTime();
|
|
33
|
-
const locals = [];
|
|
34
|
-
const centrals = [];
|
|
35
|
-
let offset = 0;
|
|
36
|
-
for (const entry of entries) {
|
|
37
|
-
const nameBuf = Buffer.from(entry.path.replace(/\\/g, '/'), 'utf8');
|
|
38
|
-
const data = Buffer.isBuffer(entry.content) ? entry.content : Buffer.from(entry.content, 'utf8');
|
|
39
|
-
const crc = crc32(data);
|
|
40
|
-
const local = Buffer.alloc(30 + nameBuf.length);
|
|
41
|
-
local.writeUInt32LE(0x04034b50, 0); // local file header signature
|
|
42
|
-
local.writeUInt16LE(20, 4); // version needed
|
|
43
|
-
local.writeUInt16LE(0, 6); // flags
|
|
44
|
-
local.writeUInt16LE(0, 8); // method: store
|
|
45
|
-
local.writeUInt16LE(time, 10);
|
|
46
|
-
local.writeUInt16LE(day, 12);
|
|
47
|
-
local.writeUInt32LE(crc, 14);
|
|
48
|
-
local.writeUInt32LE(data.length, 18); // compressed size
|
|
49
|
-
local.writeUInt32LE(data.length, 22); // uncompressed size
|
|
50
|
-
local.writeUInt16LE(nameBuf.length, 26);
|
|
51
|
-
local.writeUInt16LE(0, 28); // extra length
|
|
52
|
-
nameBuf.copy(local, 30);
|
|
53
|
-
locals.push(local, data);
|
|
54
|
-
const central = Buffer.alloc(46 + nameBuf.length);
|
|
55
|
-
central.writeUInt32LE(0x02014b50, 0); // central directory header signature
|
|
56
|
-
central.writeUInt16LE(20, 4); // version made by
|
|
57
|
-
central.writeUInt16LE(20, 6); // version needed
|
|
58
|
-
central.writeUInt16LE(0, 8); // flags
|
|
59
|
-
central.writeUInt16LE(0, 10); // method
|
|
60
|
-
central.writeUInt16LE(time, 12);
|
|
61
|
-
central.writeUInt16LE(day, 14);
|
|
62
|
-
central.writeUInt32LE(crc, 16);
|
|
63
|
-
central.writeUInt32LE(data.length, 20);
|
|
64
|
-
central.writeUInt32LE(data.length, 24);
|
|
65
|
-
central.writeUInt16LE(nameBuf.length, 28);
|
|
66
|
-
central.writeUInt16LE(0, 30); // extra length
|
|
67
|
-
central.writeUInt16LE(0, 32); // comment length
|
|
68
|
-
central.writeUInt16LE(0, 34); // disk number
|
|
69
|
-
central.writeUInt16LE(0, 36); // internal attrs
|
|
70
|
-
central.writeUInt32LE(0, 38); // external attrs
|
|
71
|
-
central.writeUInt32LE(offset, 42); // local header offset
|
|
72
|
-
nameBuf.copy(central, 46);
|
|
73
|
-
centrals.push(central);
|
|
74
|
-
offset += local.length + data.length;
|
|
75
|
-
}
|
|
76
|
-
const centralDir = Buffer.concat(centrals);
|
|
77
|
-
const end = Buffer.alloc(22);
|
|
78
|
-
end.writeUInt32LE(0x06054b50, 0); // end of central directory signature
|
|
79
|
-
end.writeUInt16LE(0, 4); // disk number
|
|
80
|
-
end.writeUInt16LE(0, 6); // central dir start disk
|
|
81
|
-
end.writeUInt16LE(entries.length, 8); // entries on this disk
|
|
82
|
-
end.writeUInt16LE(entries.length, 10); // total entries
|
|
83
|
-
end.writeUInt32LE(centralDir.length, 12);
|
|
84
|
-
end.writeUInt32LE(offset, 16); // central dir offset
|
|
85
|
-
end.writeUInt16LE(0, 20); // comment length
|
|
86
|
-
return Buffer.concat([...locals, centralDir, end]);
|
|
87
|
-
}
|