@ninkch/dsh-artcraft 0.3.0 → 0.3.1
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/index.js +34 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -55,7 +55,7 @@ import crypto from 'node:crypto';
|
|
|
55
55
|
import { fileURLToPath } from 'node:url';
|
|
56
56
|
|
|
57
57
|
const NAME = 'artcraft';
|
|
58
|
-
const VERSION = '0.3.
|
|
58
|
+
const VERSION = '0.3.1';
|
|
59
59
|
const HERE = path.dirname(fileURLToPath(import.meta.url));
|
|
60
60
|
|
|
61
61
|
const BINS = [
|
|
@@ -1045,13 +1045,15 @@ export function apply(ctx) {
|
|
|
1045
1045
|
ctx.effect(() => {
|
|
1046
1046
|
const disposers = [];
|
|
1047
1047
|
const attempt = (def) => {
|
|
1048
|
+
// 44.0.0 起注册器强制要求 output(缺了整工具拒注册,见 RELEASING.md 教训与 issue #1):
|
|
1049
|
+
// 兜底 output 必须随 shape 一起传入,两个命名约定都要带。
|
|
1048
1050
|
const output = def.output ?? {
|
|
1049
1051
|
schema: { type: 'object', additionalProperties: true },
|
|
1050
1052
|
render: (_args, value) => [{ type: 'text', text: JSON.stringify(value, null, 2) }],
|
|
1051
1053
|
};
|
|
1052
1054
|
for (const shape of [
|
|
1053
|
-
{ name: def.name, description: def.description, parameters: def.schema, execute: def.execute },
|
|
1054
|
-
{ name: def.name, description: def.description, inputSchema: def.schema, handler: def.execute },
|
|
1055
|
+
{ name: def.name, description: def.description, parameters: def.schema, execute: def.execute, output },
|
|
1056
|
+
{ name: def.name, description: def.description, inputSchema: def.schema, handler: def.execute, output },
|
|
1055
1057
|
]) {
|
|
1056
1058
|
try {
|
|
1057
1059
|
const d = ctx.tools.register(shape);
|
|
@@ -1302,6 +1304,22 @@ export function apply(ctx) {
|
|
|
1302
1304
|
attempt({
|
|
1303
1305
|
name: 'artcraft_qc',
|
|
1304
1306
|
description: '交付质检(确定性规则):对产物跑家族探针并按平台规格核对,返回 PASS/WARN/FAIL/MANUAL 清单与修复命令。支持 video/audio/image/pdf/doc/sheet/deck/fig/cad。用法:path=产物绝对路径;platform 可选(bilibili|youtube|douyin|reels|shorts|wechat|broadcast|podcast)核对画幅/帧率/响度目标;kind 可选,强制指定类型;live 默认 true——若检测到运行中的 App,会额外取示波器读数(filmcraft scopes.read)、Essential Sound 体检、字幕长度与 EffectCraft 能力表(结果在 appChecks)。只报事实与实测值,判定留给调用方。',
|
|
1307
|
+
output: {
|
|
1308
|
+
schema: { type: 'object', additionalProperties: true },
|
|
1309
|
+
render: (_args, v) => {
|
|
1310
|
+
if (!v || !Array.isArray(v.checks)) return [{ type: 'text', text: JSON.stringify(v, null, 2) }];
|
|
1311
|
+
const lines = [`QC ${String(v.verdict || '').toUpperCase()} ${v.path ?? ''}`,
|
|
1312
|
+
`kind=${v.kind ?? '?'} bin=${v.bin ?? '-'} platform=${v.platform?.id ?? '-'} 计数=${JSON.stringify(v.counts ?? {})}`];
|
|
1313
|
+
for (const c of v.checks) {
|
|
1314
|
+
lines.push(`[${String(c.level).toUpperCase().padEnd(6)}] ${c.id}: ${c.detail}`);
|
|
1315
|
+
if (c.fix) lines.push(` fix: ${c.fix}`);
|
|
1316
|
+
}
|
|
1317
|
+
if (Array.isArray(v.appChecks) && v.appChecks.length) {
|
|
1318
|
+
lines.push('appChecks: ' + JSON.stringify(v.appChecks));
|
|
1319
|
+
}
|
|
1320
|
+
return [{ type: 'text', text: lines.join('\n') }];
|
|
1321
|
+
},
|
|
1322
|
+
},
|
|
1305
1323
|
schema: {
|
|
1306
1324
|
type: 'object',
|
|
1307
1325
|
properties: {
|
|
@@ -1322,6 +1340,19 @@ export function apply(ctx) {
|
|
|
1322
1340
|
attempt({
|
|
1323
1341
|
name: 'artcraft_live',
|
|
1324
1342
|
description: '探测哪些 ArtCraft App 正在运行(控制通道活性):对已知端口逐个调用 engine.commands 作为活性证据,返回 live 列表、耗时与当前可用命令数。用于"边看边调"前的准备——确认目标 App 已以 --control 启动。可用 ports 追加自定义端口(如 [{app:"designcraft",port:8000}])。',
|
|
1343
|
+
output: {
|
|
1344
|
+
schema: { type: 'object', additionalProperties: true },
|
|
1345
|
+
render: (_args, v) => {
|
|
1346
|
+
if (!v || !Array.isArray(v.apps)) return [{ type: 'text', text: JSON.stringify(v, null, 2) }];
|
|
1347
|
+
const lines = [`LIVE ${v.live}/${v.total} ${v.note ?? ''}`];
|
|
1348
|
+
for (const a of v.apps) {
|
|
1349
|
+
lines.push(a.live
|
|
1350
|
+
? `[LIVE ] ${String(a.app).padEnd(13)} :${a.port} ${a.commands ?? '?'} cmds, ${a.ms}ms`
|
|
1351
|
+
: `[— ] ${String(a.app).padEnd(13)} :${a.port} ${(a.error || '').slice(0, 90)}`);
|
|
1352
|
+
}
|
|
1353
|
+
return [{ type: 'text', text: lines.join('\n') }];
|
|
1354
|
+
},
|
|
1355
|
+
},
|
|
1325
1356
|
schema: {
|
|
1326
1357
|
type: 'object',
|
|
1327
1358
|
properties: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ninkch/dsh-artcraft",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Drive the open-source ArtCraft studio suite (13 family apps: PhotoCraft, VectorCraft, FilmCraft, LightCraft, PdfCraft, EffectCraft, DesignCraft, WordCraft, DeckCraft, GridCraft, CADCraft, SoundCraft, FigCraft) from DeepSeek Harness: agent tools, a same-origin HTTP API, a bundled craft skill pack, and plugins-page status with self-update.",
|
|
6
6
|
"keywords": [
|