@taptap/maker 0.0.17 → 0.0.18
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 +1 -1
- package/dist/maker.js +407 -73
- package/package.json +1 -1
- package/skills/taptap-maker-local/SKILL.md +18 -21
package/README.md
CHANGED
package/dist/maker.js
CHANGED
|
@@ -29437,30 +29437,28 @@ function createMakerAssetPolicyBlock() {
|
|
|
29437
29437
|
MAKER_ASSET_POLICY_BEGIN,
|
|
29438
29438
|
"",
|
|
29439
29439
|
"This is a bound TapTap Maker project. For game asset generation or editing in this project,",
|
|
29440
|
-
"the local AI/Agent
|
|
29440
|
+
"the local AI/Agent should prefer Maker MCP proxy tools when they are available:",
|
|
29441
29441
|
"",
|
|
29442
29442
|
"- `generate_image` for one image asset.",
|
|
29443
29443
|
"- `batch_generate_images` for multiple image assets.",
|
|
29444
29444
|
"- `edit_image` for modifying existing project images.",
|
|
29445
29445
|
"- `create_video_task` for game video assets or referenced image/video generation.",
|
|
29446
|
+
"- `query_video_task` for refreshing video task status and fetching completed videos.",
|
|
29446
29447
|
"- `text_to_music` for game music or audio assets.",
|
|
29447
29448
|
"",
|
|
29448
|
-
"
|
|
29449
|
-
"
|
|
29450
|
-
"
|
|
29451
|
-
"
|
|
29452
|
-
"`assets/image` for the matching file. Do not call `edit_image` without an image path or CDN URL.",
|
|
29449
|
+
"Follow each Maker tool schema for supported local path, remote URL, and data URL inputs.",
|
|
29450
|
+
"If the user references attached/local media, inspect the attachment or workspace file path",
|
|
29451
|
+
"before calling the tool. Local proxy may convert resolvable local reference media to data URLs",
|
|
29452
|
+
"before forwarding to the remote Maker MCP server.",
|
|
29453
29453
|
"",
|
|
29454
|
-
"
|
|
29455
|
-
"
|
|
29454
|
+
"If the required Maker proxy tool is not exposed in the current AI session, explain that the",
|
|
29455
|
+
"Maker proxy tool is unavailable and suggest checking/reconnecting the Maker MCP session.",
|
|
29456
|
+
"Other client media tools may still be usable when their output is passed back through a supported",
|
|
29457
|
+
"local path, remote URL, or data URL input.",
|
|
29456
29458
|
"",
|
|
29457
|
-
"
|
|
29458
|
-
"
|
|
29459
|
-
"
|
|
29460
|
-
"native media generation unless the user explicitly asks to leave the Maker asset workflow.",
|
|
29461
|
-
"",
|
|
29462
|
-
"Generated assets must stay in the Maker project asset workflow under `assets/image`,",
|
|
29463
|
-
"`assets/video`, or `assets/audio`, with CDN mappings preserved for later edits and builds.",
|
|
29459
|
+
"Generated Maker proxy assets should stay in the Maker project asset workflow under",
|
|
29460
|
+
"`assets/image`, `assets/video`, or `assets/audio`, with remote mappings preserved for later",
|
|
29461
|
+
"edits and builds.",
|
|
29464
29462
|
"",
|
|
29465
29463
|
MAKER_ASSET_POLICY_END
|
|
29466
29464
|
].join("\n");
|
|
@@ -32191,15 +32189,12 @@ function formatMakerSkillStatus(_options = {}) {
|
|
|
32191
32189
|
"Maker creative asset tool policy",
|
|
32192
32190
|
`- entry: ${MAKER_LOCAL_SKILL_NAME} > Maker Creative Asset Tool Policy`,
|
|
32193
32191
|
"- Prefer Maker MCP proxy tools over native AI image/video/audio tools for bound Maker projects.",
|
|
32194
|
-
"-
|
|
32195
|
-
"- Do not invoke imagegen, built-in image/video/audio tools, or other native media generation.",
|
|
32196
|
-
"- Do not fall back to generic imagegen when Maker proxy tools are unavailable in the session.",
|
|
32192
|
+
"- If Maker proxy tools are missing, explain the session/configuration issue and available alternatives.",
|
|
32197
32193
|
"- Use generate_image, batch_generate_images, edit_image for game image assets.",
|
|
32198
|
-
"- Use create_video_task and text_to_music for game video/audio assets.",
|
|
32199
|
-
"- Generated assets are saved under assets/image, assets/video, or assets/audio with
|
|
32200
|
-
"-
|
|
32201
|
-
"-
|
|
32202
|
-
"- Do not call edit_image without an image path or CDN URL.",
|
|
32194
|
+
"- Use create_video_task, query_video_task, and text_to_music for game video/audio assets.",
|
|
32195
|
+
"- Generated assets are saved under assets/image, assets/video, or assets/audio with remote mappings.",
|
|
32196
|
+
"- Follow each tool schema for supported local path, remote URL, and data URL inputs.",
|
|
32197
|
+
"- Local proxy may convert resolvable local reference media to data URLs before forwarding.",
|
|
32203
32198
|
"Maker initialization next_step: execute `taptap-maker init`.",
|
|
32204
32199
|
"Load these documents when the current AI client supports reading local guide files."
|
|
32205
32200
|
].join("\n");
|
|
@@ -32609,6 +32604,41 @@ import path12 from "node:path";
|
|
|
32609
32604
|
var IMAGE_ASSET_DIRS = ["assets/image"];
|
|
32610
32605
|
var VIDEO_ASSET_DIRS = ["assets/video"];
|
|
32611
32606
|
var AUDIO_ASSET_DIRS = ["assets/audio"];
|
|
32607
|
+
var IMAGE_REFERENCE_MAX_BYTES = 10 * 1024 * 1024;
|
|
32608
|
+
var VIDEO_TASK_IMAGE_REFERENCE_MAX_BYTES = 30 * 1024 * 1024;
|
|
32609
|
+
var VIDEO_REFERENCE_MAX_BYTES = 50 * 1024 * 1024;
|
|
32610
|
+
var AUDIO_REFERENCE_MAX_BYTES = 15 * 1024 * 1024;
|
|
32611
|
+
var DATA_URL_MIME_BY_EXTENSION = {
|
|
32612
|
+
image: {
|
|
32613
|
+
".gif": "image/gif",
|
|
32614
|
+
".jpeg": "image/jpeg",
|
|
32615
|
+
".jpg": "image/jpeg",
|
|
32616
|
+
".png": "image/png",
|
|
32617
|
+
".webp": "image/webp"
|
|
32618
|
+
},
|
|
32619
|
+
video: {
|
|
32620
|
+
".mov": "video/quicktime",
|
|
32621
|
+
".mp4": "video/mp4"
|
|
32622
|
+
},
|
|
32623
|
+
audio: {
|
|
32624
|
+
".mp3": "audio/mpeg",
|
|
32625
|
+
".wav": "audio/wav"
|
|
32626
|
+
}
|
|
32627
|
+
};
|
|
32628
|
+
var RemoteProxyToolResultError = class extends Error {
|
|
32629
|
+
constructor(toolName, result) {
|
|
32630
|
+
super(
|
|
32631
|
+
[
|
|
32632
|
+
`Remote proxy tool ${toolName} returned an error result.`,
|
|
32633
|
+
"",
|
|
32634
|
+
formatRemoteProxyToolResult(result)
|
|
32635
|
+
].join("\n")
|
|
32636
|
+
);
|
|
32637
|
+
this.name = "RemoteProxyToolResultError";
|
|
32638
|
+
this.toolName = toolName;
|
|
32639
|
+
this.result = result;
|
|
32640
|
+
}
|
|
32641
|
+
};
|
|
32612
32642
|
function prepareRemoteProxyToolArgs(options) {
|
|
32613
32643
|
if (options.toolName === "edit_image") {
|
|
32614
32644
|
return rewriteEditImageAssetArgs(options.targetDir, options.args);
|
|
@@ -32616,12 +32646,18 @@ function prepareRemoteProxyToolArgs(options) {
|
|
|
32616
32646
|
if (options.toolName === "generate_image") {
|
|
32617
32647
|
return normalizeImageReferenceAssetArgs(options.targetDir, options.args);
|
|
32618
32648
|
}
|
|
32649
|
+
if (options.toolName === "batch_generate_images") {
|
|
32650
|
+
return normalizeBatchImageReferenceAssetArgs(options.targetDir, options.args);
|
|
32651
|
+
}
|
|
32619
32652
|
if (options.toolName === "create_video_task") {
|
|
32620
32653
|
return rewriteVideoReferenceAssetArgs(options.targetDir, options.args);
|
|
32621
32654
|
}
|
|
32622
32655
|
return options.args;
|
|
32623
32656
|
}
|
|
32624
32657
|
async function materializeRemoteProxyToolAssets(options) {
|
|
32658
|
+
if (isRemoteProxyToolErrorResult(options.result)) {
|
|
32659
|
+
throw new RemoteProxyToolResultError(options.toolName, options.result);
|
|
32660
|
+
}
|
|
32625
32661
|
if (!shouldMaterializeRemoteProxyTool(options.toolName)) {
|
|
32626
32662
|
return options.result;
|
|
32627
32663
|
}
|
|
@@ -32666,12 +32702,29 @@ function shouldMaterializeRemoteProxyTool(toolName) {
|
|
|
32666
32702
|
"batch_generate_images",
|
|
32667
32703
|
"edit_image",
|
|
32668
32704
|
"create_video_task",
|
|
32705
|
+
"query_video_task",
|
|
32669
32706
|
"text_to_music"
|
|
32670
32707
|
].includes(toolName);
|
|
32671
32708
|
}
|
|
32672
32709
|
function isTextContent(item) {
|
|
32673
32710
|
return typeof item === "object" && item !== null && item.type === "text" && typeof item.text === "string";
|
|
32674
32711
|
}
|
|
32712
|
+
function isRemoteProxyToolErrorResult(result) {
|
|
32713
|
+
return Boolean(result.isError);
|
|
32714
|
+
}
|
|
32715
|
+
function formatRemoteProxyToolResult(result) {
|
|
32716
|
+
return ["remote_result:", indent(formatUnknownForDiagnostics(result))].join("\n");
|
|
32717
|
+
}
|
|
32718
|
+
function formatUnknownForDiagnostics(value) {
|
|
32719
|
+
try {
|
|
32720
|
+
return JSON.stringify(value, null, 2) || String(value);
|
|
32721
|
+
} catch {
|
|
32722
|
+
return String(value);
|
|
32723
|
+
}
|
|
32724
|
+
}
|
|
32725
|
+
function indent(value) {
|
|
32726
|
+
return value.split("\n").map((line) => ` ${line}`).join("\n");
|
|
32727
|
+
}
|
|
32675
32728
|
function parseJsonObject(text) {
|
|
32676
32729
|
try {
|
|
32677
32730
|
const parsed = JSON.parse(text);
|
|
@@ -32690,8 +32743,8 @@ async function materializeParsedProxyResult(options) {
|
|
|
32690
32743
|
if (options.toolName === "edit_image") {
|
|
32691
32744
|
return await materializeSingleImageResult(options, "edit_image");
|
|
32692
32745
|
}
|
|
32693
|
-
if (options.toolName === "create_video_task") {
|
|
32694
|
-
return await materializeVideoResult(options);
|
|
32746
|
+
if (options.toolName === "create_video_task" || options.toolName === "query_video_task") {
|
|
32747
|
+
return await materializeVideoResult(options, options.toolName);
|
|
32695
32748
|
}
|
|
32696
32749
|
if (options.toolName === "text_to_music") {
|
|
32697
32750
|
return await materializeMusicResult(options);
|
|
@@ -32752,14 +32805,27 @@ async function materializeBatchImageResult(options) {
|
|
|
32752
32805
|
}
|
|
32753
32806
|
return { ...options.payload, results };
|
|
32754
32807
|
}
|
|
32755
|
-
async function materializeVideoResult(options) {
|
|
32808
|
+
async function materializeVideoResult(options, toolName) {
|
|
32756
32809
|
if (options.payload.status !== "succeeded") {
|
|
32757
32810
|
return options.payload;
|
|
32758
32811
|
}
|
|
32812
|
+
const taskId = stringField2(options.payload.task_id);
|
|
32813
|
+
const cdnUrl = stringField2(options.payload.cdn_url);
|
|
32814
|
+
const existing = findExistingMaterializedVideo(options.targetDir, {
|
|
32815
|
+
taskId,
|
|
32816
|
+
cdnUrl
|
|
32817
|
+
});
|
|
32818
|
+
if (existing) {
|
|
32819
|
+
return {
|
|
32820
|
+
...options.payload,
|
|
32821
|
+
...existing,
|
|
32822
|
+
download: { success: true }
|
|
32823
|
+
};
|
|
32824
|
+
}
|
|
32759
32825
|
const materialized = await materializeAsset({
|
|
32760
32826
|
targetDir: options.targetDir,
|
|
32761
|
-
url:
|
|
32762
|
-
baseName:
|
|
32827
|
+
url: cdnUrl,
|
|
32828
|
+
baseName: taskId,
|
|
32763
32829
|
relativeDir: "assets/video",
|
|
32764
32830
|
extension: "mp4",
|
|
32765
32831
|
now: options.now,
|
|
@@ -32767,16 +32833,51 @@ async function materializeVideoResult(options) {
|
|
|
32767
32833
|
});
|
|
32768
32834
|
return materialized ? persistMaterializedAsset({
|
|
32769
32835
|
targetDir: options.targetDir,
|
|
32770
|
-
toolName
|
|
32836
|
+
toolName,
|
|
32771
32837
|
payload: options.payload,
|
|
32772
32838
|
materialized,
|
|
32773
32839
|
cdnUrl: stringField2(options.payload.cdn_url),
|
|
32774
32840
|
now: options.now,
|
|
32775
32841
|
extraRegistryFields: {
|
|
32776
|
-
taskId
|
|
32842
|
+
taskId
|
|
32777
32843
|
}
|
|
32778
32844
|
}) : options.payload;
|
|
32779
32845
|
}
|
|
32846
|
+
function findExistingMaterializedVideo(targetDir, options) {
|
|
32847
|
+
if (!options.taskId || !options.cdnUrl) {
|
|
32848
|
+
return void 0;
|
|
32849
|
+
}
|
|
32850
|
+
const registry2 = readGeneratedAssetRegistry(targetDir);
|
|
32851
|
+
for (const record2 of Object.values(registry2)) {
|
|
32852
|
+
const localPath = stringField2(record2.localPath);
|
|
32853
|
+
const recordCdnUrl = stringField2(record2.cdnUrl) || stringField2(record2.previewUrl);
|
|
32854
|
+
if (stringField2(record2.taskId) !== options.taskId || recordCdnUrl !== options.cdnUrl || !localPath.startsWith("assets/video/")) {
|
|
32855
|
+
continue;
|
|
32856
|
+
}
|
|
32857
|
+
const absolutePath = resolveExistingMaterializedAssetPath(targetDir, record2, localPath);
|
|
32858
|
+
if (absolutePath) {
|
|
32859
|
+
return { localPath, absolutePath };
|
|
32860
|
+
}
|
|
32861
|
+
}
|
|
32862
|
+
return void 0;
|
|
32863
|
+
}
|
|
32864
|
+
function resolveExistingMaterializedAssetPath(targetDir, record2, localPath) {
|
|
32865
|
+
const candidates = [];
|
|
32866
|
+
const absolutePath = stringField2(record2.absolutePath);
|
|
32867
|
+
if (absolutePath && path12.isAbsolute(absolutePath)) {
|
|
32868
|
+
candidates.push(absolutePath);
|
|
32869
|
+
}
|
|
32870
|
+
candidates.push(path12.join(targetDir, ...localPath.split("/")));
|
|
32871
|
+
for (const candidate of candidates) {
|
|
32872
|
+
try {
|
|
32873
|
+
if (fs11.statSync(candidate).isFile()) {
|
|
32874
|
+
return candidate;
|
|
32875
|
+
}
|
|
32876
|
+
} catch {
|
|
32877
|
+
}
|
|
32878
|
+
}
|
|
32879
|
+
return void 0;
|
|
32880
|
+
}
|
|
32780
32881
|
async function materializeMusicResult(options) {
|
|
32781
32882
|
if (options.payload.success !== true) {
|
|
32782
32883
|
return options.payload;
|
|
@@ -32879,9 +32980,17 @@ function rewriteEditImageAssetArgs(targetDir, args) {
|
|
|
32879
32980
|
const registry2 = readGeneratedAssetRegistry(targetDir);
|
|
32880
32981
|
return {
|
|
32881
32982
|
...args,
|
|
32882
|
-
image: rewriteGeneratedAssetReference(targetDir, args.image, registry2,
|
|
32983
|
+
image: rewriteGeneratedAssetReference(targetDir, args.image, registry2, {
|
|
32984
|
+
assetDirs: IMAGE_ASSET_DIRS,
|
|
32985
|
+
mediaKind: "image",
|
|
32986
|
+
maxBytes: IMAGE_REFERENCE_MAX_BYTES
|
|
32987
|
+
}),
|
|
32883
32988
|
reference_images: Array.isArray(args.reference_images) ? args.reference_images.map(
|
|
32884
|
-
(item) => rewriteGeneratedAssetReference(targetDir, item, registry2,
|
|
32989
|
+
(item) => rewriteGeneratedAssetReference(targetDir, item, registry2, {
|
|
32990
|
+
assetDirs: IMAGE_ASSET_DIRS,
|
|
32991
|
+
mediaKind: "image",
|
|
32992
|
+
maxBytes: IMAGE_REFERENCE_MAX_BYTES
|
|
32993
|
+
})
|
|
32885
32994
|
) : args.reference_images
|
|
32886
32995
|
};
|
|
32887
32996
|
}
|
|
@@ -32889,46 +32998,89 @@ function normalizeImageReferenceAssetArgs(targetDir, args) {
|
|
|
32889
32998
|
const registry2 = readGeneratedAssetRegistry(targetDir);
|
|
32890
32999
|
return {
|
|
32891
33000
|
...args,
|
|
32892
|
-
image:
|
|
33001
|
+
image: rewriteGeneratedAssetReference(targetDir, args.image, registry2, {
|
|
33002
|
+
assetDirs: IMAGE_ASSET_DIRS,
|
|
33003
|
+
mediaKind: "image",
|
|
33004
|
+
maxBytes: IMAGE_REFERENCE_MAX_BYTES
|
|
33005
|
+
}),
|
|
33006
|
+
reference_image: rewriteGeneratedAssetReference(targetDir, args.reference_image, registry2, {
|
|
33007
|
+
assetDirs: IMAGE_ASSET_DIRS,
|
|
33008
|
+
mediaKind: "image",
|
|
33009
|
+
maxBytes: IMAGE_REFERENCE_MAX_BYTES
|
|
33010
|
+
}),
|
|
32893
33011
|
reference_images: Array.isArray(args.reference_images) ? args.reference_images.map(
|
|
32894
|
-
(item) =>
|
|
33012
|
+
(item) => rewriteGeneratedAssetReference(targetDir, item, registry2, {
|
|
33013
|
+
assetDirs: IMAGE_ASSET_DIRS,
|
|
33014
|
+
mediaKind: "image",
|
|
33015
|
+
maxBytes: IMAGE_REFERENCE_MAX_BYTES
|
|
33016
|
+
})
|
|
32895
33017
|
) : args.reference_images
|
|
32896
33018
|
};
|
|
32897
33019
|
}
|
|
33020
|
+
function normalizeBatchImageReferenceAssetArgs(targetDir, args) {
|
|
33021
|
+
if (!Array.isArray(args.images)) {
|
|
33022
|
+
return args;
|
|
33023
|
+
}
|
|
33024
|
+
return {
|
|
33025
|
+
...args,
|
|
33026
|
+
images: args.images.map(
|
|
33027
|
+
(item) => isRecord(item) ? normalizeImageReferenceAssetArgs(targetDir, item) : item
|
|
33028
|
+
)
|
|
33029
|
+
};
|
|
33030
|
+
}
|
|
32898
33031
|
function rewriteVideoReferenceAssetArgs(targetDir, args) {
|
|
32899
33032
|
const registry2 = readGeneratedAssetRegistry(targetDir);
|
|
32900
33033
|
return {
|
|
32901
33034
|
...args,
|
|
32902
|
-
images: rewriteUrlObjectArray(targetDir, args.images, registry2,
|
|
32903
|
-
|
|
32904
|
-
|
|
33035
|
+
images: rewriteUrlObjectArray(targetDir, args.images, registry2, {
|
|
33036
|
+
assetDirs: IMAGE_ASSET_DIRS,
|
|
33037
|
+
mediaKind: "image",
|
|
33038
|
+
maxBytes: VIDEO_TASK_IMAGE_REFERENCE_MAX_BYTES
|
|
33039
|
+
}),
|
|
33040
|
+
videos: rewriteUrlObjectArray(targetDir, args.videos, registry2, {
|
|
33041
|
+
assetDirs: VIDEO_ASSET_DIRS,
|
|
33042
|
+
mediaKind: "video",
|
|
33043
|
+
maxBytes: VIDEO_REFERENCE_MAX_BYTES
|
|
33044
|
+
}),
|
|
33045
|
+
audios: rewriteUrlObjectArray(targetDir, args.audios, registry2, {
|
|
33046
|
+
assetDirs: AUDIO_ASSET_DIRS,
|
|
33047
|
+
mediaKind: "audio",
|
|
33048
|
+
maxBytes: AUDIO_REFERENCE_MAX_BYTES
|
|
33049
|
+
})
|
|
32905
33050
|
};
|
|
32906
33051
|
}
|
|
32907
|
-
function rewriteUrlObjectArray(targetDir, value, registry2,
|
|
33052
|
+
function rewriteUrlObjectArray(targetDir, value, registry2, options) {
|
|
32908
33053
|
if (!Array.isArray(value)) {
|
|
32909
33054
|
return value;
|
|
32910
33055
|
}
|
|
32911
33056
|
return value.map(
|
|
32912
33057
|
(item) => isRecord(item) ? {
|
|
32913
33058
|
...item,
|
|
32914
|
-
url: rewriteGeneratedAssetReference(targetDir, item.url, registry2,
|
|
33059
|
+
url: rewriteGeneratedAssetReference(targetDir, item.url, registry2, options)
|
|
32915
33060
|
} : item
|
|
32916
33061
|
);
|
|
32917
33062
|
}
|
|
32918
|
-
function rewriteGeneratedAssetReference(targetDir, value, registry2,
|
|
33063
|
+
function rewriteGeneratedAssetReference(targetDir, value, registry2, options) {
|
|
32919
33064
|
var _a3, _b;
|
|
32920
33065
|
if (typeof value !== "string") {
|
|
32921
33066
|
return value;
|
|
32922
33067
|
}
|
|
32923
|
-
|
|
32924
|
-
const cdnUrl = localPath ? ((_a3 = registry2[localPath]) == null ? void 0 : _a3.cdnUrl) || ((_b = registry2[localPath]) == null ? void 0 : _b.previewUrl) : void 0;
|
|
32925
|
-
return cdnUrl || localPath || value;
|
|
32926
|
-
}
|
|
32927
|
-
function normalizeLocalAssetReference(targetDir, value, registry2, assetDirs) {
|
|
32928
|
-
if (typeof value !== "string") {
|
|
33068
|
+
if (/^https?:\/\//i.test(value) || value.startsWith("data:")) {
|
|
32929
33069
|
return value;
|
|
32930
33070
|
}
|
|
32931
|
-
|
|
33071
|
+
const localPath = resolveLocalAssetReference(targetDir, value, registry2, options.assetDirs);
|
|
33072
|
+
const cdnUrl = localPath ? ((_a3 = registry2[localPath]) == null ? void 0 : _a3.cdnUrl) || ((_b = registry2[localPath]) == null ? void 0 : _b.previewUrl) : void 0;
|
|
33073
|
+
if (cdnUrl) {
|
|
33074
|
+
return cdnUrl;
|
|
33075
|
+
}
|
|
33076
|
+
const dataUrl = localAssetReferenceToDataUrl({
|
|
33077
|
+
targetDir,
|
|
33078
|
+
value,
|
|
33079
|
+
localPath,
|
|
33080
|
+
mediaKind: options.mediaKind,
|
|
33081
|
+
maxBytes: options.maxBytes
|
|
33082
|
+
});
|
|
33083
|
+
return dataUrl || value;
|
|
32932
33084
|
}
|
|
32933
33085
|
function resolveLocalAssetReference(targetDir, value, registry2, assetDirs) {
|
|
32934
33086
|
if (/^https?:\/\//i.test(value) || value.startsWith("data:")) {
|
|
@@ -33004,6 +33156,66 @@ function isKnownAssetPath(relativePath, assetDirs) {
|
|
|
33004
33156
|
function isBareAssetName(value) {
|
|
33005
33157
|
return !value.includes("/") && !value.includes("\\");
|
|
33006
33158
|
}
|
|
33159
|
+
function localAssetReferenceToDataUrl(options) {
|
|
33160
|
+
const absolutePath = resolveLocalAssetAbsolutePath(options.targetDir, {
|
|
33161
|
+
value: options.value,
|
|
33162
|
+
localPath: options.localPath
|
|
33163
|
+
});
|
|
33164
|
+
if (!absolutePath) {
|
|
33165
|
+
return void 0;
|
|
33166
|
+
}
|
|
33167
|
+
const mime = dataUrlMimeForPath(absolutePath, options.mediaKind);
|
|
33168
|
+
if (!mime) {
|
|
33169
|
+
return void 0;
|
|
33170
|
+
}
|
|
33171
|
+
let stat;
|
|
33172
|
+
try {
|
|
33173
|
+
stat = fs11.statSync(absolutePath);
|
|
33174
|
+
} catch {
|
|
33175
|
+
return void 0;
|
|
33176
|
+
}
|
|
33177
|
+
if (!stat.isFile() || stat.size > options.maxBytes) {
|
|
33178
|
+
return void 0;
|
|
33179
|
+
}
|
|
33180
|
+
const bytes = fs11.readFileSync(absolutePath);
|
|
33181
|
+
return `data:${mime};base64,${bytes.toString("base64")}`;
|
|
33182
|
+
}
|
|
33183
|
+
function resolveLocalAssetAbsolutePath(targetDir, options) {
|
|
33184
|
+
const candidates = [];
|
|
33185
|
+
if (options.localPath) {
|
|
33186
|
+
const localPath = resolveProjectRelativePath(targetDir, options.localPath);
|
|
33187
|
+
if (localPath) {
|
|
33188
|
+
candidates.push(localPath);
|
|
33189
|
+
}
|
|
33190
|
+
}
|
|
33191
|
+
if (path12.isAbsolute(options.value)) {
|
|
33192
|
+
candidates.push(options.value);
|
|
33193
|
+
} else {
|
|
33194
|
+
const localPath = resolveProjectRelativePath(targetDir, options.value);
|
|
33195
|
+
if (localPath) {
|
|
33196
|
+
candidates.push(localPath);
|
|
33197
|
+
}
|
|
33198
|
+
}
|
|
33199
|
+
for (const candidate of candidates) {
|
|
33200
|
+
if (fs11.existsSync(candidate)) {
|
|
33201
|
+
return candidate;
|
|
33202
|
+
}
|
|
33203
|
+
}
|
|
33204
|
+
return void 0;
|
|
33205
|
+
}
|
|
33206
|
+
function resolveProjectRelativePath(targetDir, value) {
|
|
33207
|
+
const root = path12.resolve(targetDir);
|
|
33208
|
+
const absolutePath = path12.resolve(root, value);
|
|
33209
|
+
const relativePath = path12.relative(root, absolutePath);
|
|
33210
|
+
const escapesRoot = relativePath === ".." || relativePath.startsWith(`..${path12.sep}`) || path12.isAbsolute(relativePath);
|
|
33211
|
+
if (!escapesRoot) {
|
|
33212
|
+
return absolutePath;
|
|
33213
|
+
}
|
|
33214
|
+
return void 0;
|
|
33215
|
+
}
|
|
33216
|
+
function dataUrlMimeForPath(filePath, mediaKind) {
|
|
33217
|
+
return DATA_URL_MIME_BY_EXTENSION[mediaKind][path12.extname(filePath).toLowerCase()];
|
|
33218
|
+
}
|
|
33007
33219
|
function upsertGeneratedAssetRecord(targetDir, localPath, record2) {
|
|
33008
33220
|
const registry2 = readGeneratedAssetRegistry(targetDir);
|
|
33009
33221
|
registry2[localPath] = record2;
|
|
@@ -33069,8 +33281,9 @@ function extensionFromUrl(url2) {
|
|
|
33069
33281
|
}
|
|
33070
33282
|
|
|
33071
33283
|
// src/maker/server/mcp.ts
|
|
33072
|
-
var VERSION = true ? "0.0.
|
|
33284
|
+
var VERSION = true ? "0.0.18" : "dev";
|
|
33073
33285
|
var DEFAULT_BUILD_TIMEOUT_MS = 10 * 60 * 1e3;
|
|
33286
|
+
var REMOTE_PROXY_FORWARD_TIMEOUT_MS = 60 * 60 * 1e3;
|
|
33074
33287
|
var DEFAULT_PROXY_RETRY_ATTEMPTS = 5;
|
|
33075
33288
|
var DEFAULT_PROXY_RETRY_DELAY_MS = 30 * 1e3;
|
|
33076
33289
|
var PREVIEW_REFRESH_TIMEOUT_MS = 15 * 1e3;
|
|
@@ -33082,6 +33295,7 @@ var MAKER_REMOTE_PROXY_EXPOSED_TOOL_NAMES = [
|
|
|
33082
33295
|
"batch_generate_images",
|
|
33083
33296
|
"edit_image",
|
|
33084
33297
|
"create_video_task",
|
|
33298
|
+
"query_video_task",
|
|
33085
33299
|
"text_to_music"
|
|
33086
33300
|
];
|
|
33087
33301
|
var MakerCloneFailedError = class extends Error {
|
|
@@ -33096,7 +33310,7 @@ var MakerCloneFailedError = class extends Error {
|
|
|
33096
33310
|
var tools = [
|
|
33097
33311
|
{
|
|
33098
33312
|
name: "maker_status_lite",
|
|
33099
|
-
description: "Compatibility status surface for clients using tool output instead of the maker://status resource. Prefer reading maker://status when resources are available. Shows local Maker status for the user current working directory, including Git, Python runtime readiness, maker-lua-lsp readiness for local Lua diagnostics, PAT/TapTap auth, project binding, AI dev kit status, Maker proxy tools status and failures, Maker Git Workflow Policy guidance, Maker Creative Asset Tool Policy guidance to prefer Maker MCP proxy tools for bound game assets
|
|
33313
|
+
description: "Compatibility status surface for clients using tool output instead of the maker://status resource. Prefer reading maker://status when resources are available. Shows local Maker status for the user current working directory, including Git, Python runtime readiness, maker-lua-lsp readiness for local Lua diagnostics, PAT/TapTap auth, project binding, AI dev kit status, Maker proxy tools status and failures, Maker Git Workflow Policy guidance, Maker Creative Asset Tool Policy guidance to prefer Maker MCP proxy tools for bound game assets, supported local path/remote URL/data URL media inputs, and bundled workflow guide document paths. Maker initialization next_step: taptap-maker init.",
|
|
33100
33314
|
inputSchema: {
|
|
33101
33315
|
type: "object",
|
|
33102
33316
|
properties: {
|
|
@@ -33187,7 +33401,9 @@ async function listMakerTools(options) {
|
|
|
33187
33401
|
serverUrl: options.serverUrl,
|
|
33188
33402
|
env: options.env
|
|
33189
33403
|
}));
|
|
33190
|
-
remoteTools = filterExposedRemoteProxyTools(await listedRemoteTools())
|
|
33404
|
+
remoteTools = filterExposedRemoteProxyTools(await listedRemoteTools()).map(
|
|
33405
|
+
decorateRemoteProxyToolDefinition
|
|
33406
|
+
);
|
|
33191
33407
|
} catch {
|
|
33192
33408
|
remoteTools = [];
|
|
33193
33409
|
}
|
|
@@ -33199,6 +33415,54 @@ function filterExposedRemoteProxyTools(toolsToFilter) {
|
|
|
33199
33415
|
const exposedToolNames = new Set(MAKER_REMOTE_PROXY_EXPOSED_TOOL_NAMES);
|
|
33200
33416
|
return toolsToFilter.filter((tool) => exposedToolNames.has(tool.name));
|
|
33201
33417
|
}
|
|
33418
|
+
function decorateRemoteProxyToolDefinition(tool) {
|
|
33419
|
+
const guidance = remoteProxyToolGuidance(tool.name);
|
|
33420
|
+
if (!guidance) {
|
|
33421
|
+
return tool;
|
|
33422
|
+
}
|
|
33423
|
+
return {
|
|
33424
|
+
...tool,
|
|
33425
|
+
description: [tool.description, guidance].filter(Boolean).join("\n\n")
|
|
33426
|
+
};
|
|
33427
|
+
}
|
|
33428
|
+
function remoteProxyToolGuidance(toolName) {
|
|
33429
|
+
const failurePolicy = "If this Maker proxy tool fails or returns isError, include the full remote_result/error payload from the server so developers can diagnose the issue.";
|
|
33430
|
+
const localMediaSizeHint = "Large local/data URL media can be slow or fail: image inputs are commonly limited to about 10 MB, video-task image inputs to about 30 MB, video inputs to about 50 MB, and audio inputs to about 15 MB.";
|
|
33431
|
+
switch (toolName) {
|
|
33432
|
+
case "generate_image":
|
|
33433
|
+
case "batch_generate_images":
|
|
33434
|
+
return [
|
|
33435
|
+
"**Maker asset workflow hint:** In a bound Maker project, prefer this Maker MCP proxy tool for Maker project assets. Successful results are downloaded into the Maker project and recorded with remote mapping for later edits or video references.",
|
|
33436
|
+
localMediaSizeHint,
|
|
33437
|
+
failurePolicy
|
|
33438
|
+
].join(" ");
|
|
33439
|
+
case "edit_image":
|
|
33440
|
+
return [
|
|
33441
|
+
"**Maker asset workflow hint:** In a bound Maker project, prefer this Maker MCP proxy tool for image editing.",
|
|
33442
|
+
localMediaSizeHint,
|
|
33443
|
+
failurePolicy
|
|
33444
|
+
].join(" ");
|
|
33445
|
+
case "create_video_task":
|
|
33446
|
+
return [
|
|
33447
|
+
"**Maker asset workflow hint:** Prefer this Maker MCP proxy tool for Maker video generation. Image, video, and audio references may use remote URLs, existing data URLs, or resolvable local files that the local proxy can forward as data URLs.",
|
|
33448
|
+
localMediaSizeHint,
|
|
33449
|
+
failurePolicy
|
|
33450
|
+
].join(" ");
|
|
33451
|
+
case "query_video_task":
|
|
33452
|
+
return [
|
|
33453
|
+
"**Maker asset workflow hint:** Prefer this Maker MCP proxy tool to refresh video task status, release completed task quota, and materialize successful video results into the Maker project.",
|
|
33454
|
+
"Use this Maker MCP proxy tool to refresh video task status when create_video_task returns a task_id or reports video concurrency limits.",
|
|
33455
|
+
failurePolicy
|
|
33456
|
+
].join(" ");
|
|
33457
|
+
case "text_to_music":
|
|
33458
|
+
return [
|
|
33459
|
+
"**Maker asset workflow hint:** Prefer this Maker MCP proxy tool for Maker music generation so generated audio can be materialized into the project and recorded for later Maker references.",
|
|
33460
|
+
failurePolicy
|
|
33461
|
+
].join(" ");
|
|
33462
|
+
default:
|
|
33463
|
+
return void 0;
|
|
33464
|
+
}
|
|
33465
|
+
}
|
|
33202
33466
|
function isExposedRemoteProxyTool(name) {
|
|
33203
33467
|
return MAKER_REMOTE_PROXY_EXPOSED_TOOL_NAMES.includes(name);
|
|
33204
33468
|
}
|
|
@@ -33273,15 +33537,9 @@ async function callRemoteProxyTool(options) {
|
|
|
33273
33537
|
},
|
|
33274
33538
|
void 0,
|
|
33275
33539
|
{
|
|
33276
|
-
timeout:
|
|
33540
|
+
timeout: REMOTE_PROXY_FORWARD_TIMEOUT_MS,
|
|
33277
33541
|
resetTimeoutOnProgress: true,
|
|
33278
|
-
onprogress: options.progressToken
|
|
33279
|
-
options.extra.sendNotification({
|
|
33280
|
-
method: "notifications/progress",
|
|
33281
|
-
params: { progressToken: options.progressToken, ...progress }
|
|
33282
|
-
}).catch(() => {
|
|
33283
|
-
});
|
|
33284
|
-
} : void 0
|
|
33542
|
+
onprogress: createRemoteProxyProgressHandler(options.progressToken, options.extra)
|
|
33285
33543
|
}
|
|
33286
33544
|
);
|
|
33287
33545
|
} finally {
|
|
@@ -33310,6 +33568,19 @@ async function callRemoteProxyTool(options) {
|
|
|
33310
33568
|
result
|
|
33311
33569
|
});
|
|
33312
33570
|
}
|
|
33571
|
+
function createRemoteProxyProgressHandler(progressToken, extra) {
|
|
33572
|
+
if (progressToken === void 0) {
|
|
33573
|
+
return () => {
|
|
33574
|
+
};
|
|
33575
|
+
}
|
|
33576
|
+
return (progress) => {
|
|
33577
|
+
extra.sendNotification({
|
|
33578
|
+
method: "notifications/progress",
|
|
33579
|
+
params: { progressToken, ...progress }
|
|
33580
|
+
}).catch(() => {
|
|
33581
|
+
});
|
|
33582
|
+
};
|
|
33583
|
+
}
|
|
33313
33584
|
async function startMakerMcpServer() {
|
|
33314
33585
|
const server = new Server(
|
|
33315
33586
|
{
|
|
@@ -33706,7 +33977,7 @@ function formatMakerRemoteSyncStatusLines(status) {
|
|
|
33706
33977
|
((_a3 = status.failure) == null ? void 0 : _a3.retryable) !== void 0 ? `- failure_retryable: ${status.failure.retryable ? "yes" : "no"}` : "",
|
|
33707
33978
|
((_b = status.failure) == null ? void 0 : _b.retryReason) ? `- failure_retry_reason: ${status.failure.retryReason}` : "",
|
|
33708
33979
|
((_c = status.failure) == null ? void 0 : _c.stderr) ? `- failure_stderr:
|
|
33709
|
-
${
|
|
33980
|
+
${indent2(status.failure.stderr)}` : "",
|
|
33710
33981
|
`- next_action: ${status.nextAction}`
|
|
33711
33982
|
].filter(Boolean);
|
|
33712
33983
|
}
|
|
@@ -33914,6 +34185,8 @@ function createRemoteProxyContext(options) {
|
|
|
33914
34185
|
},
|
|
33915
34186
|
options: {
|
|
33916
34187
|
verbose: true,
|
|
34188
|
+
reset_timeout_on_progress: true,
|
|
34189
|
+
force_inject_progress_token: true,
|
|
33917
34190
|
exposed_tools: options.exposedTools
|
|
33918
34191
|
}
|
|
33919
34192
|
};
|
|
@@ -34710,7 +34983,7 @@ function formatBuildResult(result, progressSummary) {
|
|
|
34710
34983
|
...formatMakerBuildFailureLines(result.buildFailure),
|
|
34711
34984
|
"",
|
|
34712
34985
|
"remote_result:",
|
|
34713
|
-
|
|
34986
|
+
indent2(result.buildResult.resultText)
|
|
34714
34987
|
].filter(Boolean).join("\n");
|
|
34715
34988
|
}
|
|
34716
34989
|
if (result.mode === "submit_failed_before_build") {
|
|
@@ -34789,7 +35062,7 @@ function formatBuildResult(result, progressSummary) {
|
|
|
34789
35062
|
if (submitLines.length > 0) {
|
|
34790
35063
|
lines.push(...submitLines);
|
|
34791
35064
|
}
|
|
34792
|
-
lines.push("remote_result:",
|
|
35065
|
+
lines.push("remote_result:", indent2(result.resultText));
|
|
34793
35066
|
return lines.join("\n");
|
|
34794
35067
|
}
|
|
34795
35068
|
function formatPreviewRefreshLines(result) {
|
|
@@ -34880,7 +35153,7 @@ function formatMakerBuildFailureLines(failure) {
|
|
|
34880
35153
|
`- error_name: ${failure.name}`,
|
|
34881
35154
|
`- message: ${failure.message}`,
|
|
34882
35155
|
failure.stack ? `- stack:
|
|
34883
|
-
${
|
|
35156
|
+
${indent2(failure.stack)}` : ""
|
|
34884
35157
|
].filter(Boolean);
|
|
34885
35158
|
}
|
|
34886
35159
|
function formatMakerFailureLines(failure) {
|
|
@@ -34894,9 +35167,9 @@ function formatMakerFailureLines(failure) {
|
|
|
34894
35167
|
`- exit_code: ${failure.exitCode ?? "(none)"}`,
|
|
34895
35168
|
failure.command ? `- command: ${failure.command}` : "",
|
|
34896
35169
|
failure.stderr ? `- stderr:
|
|
34897
|
-
${
|
|
35170
|
+
${indent2(failure.stderr)}` : "",
|
|
34898
35171
|
failure.stdout ? `- stdout:
|
|
34899
|
-
${
|
|
35172
|
+
${indent2(failure.stdout)}` : "",
|
|
34900
35173
|
`- next_action: ${failure.nextAction}`
|
|
34901
35174
|
].filter(Boolean);
|
|
34902
35175
|
}
|
|
@@ -34928,25 +35201,86 @@ function formatToolException(toolName, error2) {
|
|
|
34928
35201
|
...formatClonePartialStateLines(error2.targetDir),
|
|
34929
35202
|
"",
|
|
34930
35203
|
"debug:",
|
|
34931
|
-
originalStack ?
|
|
35204
|
+
originalStack ? indent2(originalStack) : indent2(message),
|
|
34932
35205
|
"",
|
|
34933
35206
|
"next_action: 请根据 partial_state 判断是否直接重试;不要删除用户文件。若用户不懂目录状态,优先建议新建独立目录重新 clone。"
|
|
34934
35207
|
].join("\n");
|
|
34935
35208
|
}
|
|
35209
|
+
if (error2 instanceof RemoteProxyToolResultError) {
|
|
35210
|
+
return [
|
|
35211
|
+
"✗ Maker MCP proxy tool failed",
|
|
35212
|
+
"",
|
|
35213
|
+
`- tool: ${toolName}`,
|
|
35214
|
+
"- reason: remote_proxy_tool_result_error",
|
|
35215
|
+
`- error_name: ${error2.name}`,
|
|
35216
|
+
`- message: ${firstLine(error2.message)}`,
|
|
35217
|
+
"",
|
|
35218
|
+
formatRemoteProxyToolResult(error2.result),
|
|
35219
|
+
"",
|
|
35220
|
+
"next_action: 远端 proxy tool 已返回失败结果;请把 remote_result 原样反馈给开发者,方便排查 server 返回内容。"
|
|
35221
|
+
].join("\n");
|
|
35222
|
+
}
|
|
34936
35223
|
return [
|
|
34937
35224
|
"✗ Maker MCP tool failed",
|
|
34938
35225
|
"",
|
|
34939
35226
|
`- tool: ${toolName}`,
|
|
34940
35227
|
`- error_name: ${error2 instanceof Error ? error2.name : typeof error2}`,
|
|
34941
35228
|
`- message: ${message}`,
|
|
35229
|
+
...formatUnknownExceptionDetailLines(error2),
|
|
34942
35230
|
"",
|
|
34943
35231
|
"debug:",
|
|
34944
|
-
stack ?
|
|
35232
|
+
stack ? indent2(stack) : indent2(message),
|
|
34945
35233
|
"",
|
|
34946
35234
|
"next_action: 请把上面的完整错误反馈给开发者;如果本地已有 commit 但 push 未完成,不要重复 commit,直接重试 maker_build_current_directory。"
|
|
34947
35235
|
].join("\n");
|
|
34948
35236
|
}
|
|
34949
|
-
function
|
|
35237
|
+
function firstLine(value) {
|
|
35238
|
+
return value.split("\n")[0] || value;
|
|
35239
|
+
}
|
|
35240
|
+
function formatUnknownExceptionDetailLines(error2) {
|
|
35241
|
+
if (!(error2 instanceof Error)) {
|
|
35242
|
+
return [];
|
|
35243
|
+
}
|
|
35244
|
+
const details = errorOwnDiagnosticFields(error2);
|
|
35245
|
+
if (Object.keys(details).length === 0) {
|
|
35246
|
+
return [];
|
|
35247
|
+
}
|
|
35248
|
+
return ["", "error_details:", indent2(formatDiagnosticJson(details))];
|
|
35249
|
+
}
|
|
35250
|
+
function errorOwnDiagnosticFields(error2) {
|
|
35251
|
+
const details = {};
|
|
35252
|
+
for (const key of Object.getOwnPropertyNames(error2)) {
|
|
35253
|
+
if (key === "name" || key === "message" || key === "stack") {
|
|
35254
|
+
continue;
|
|
35255
|
+
}
|
|
35256
|
+
details[key] = sanitizeDiagnosticValue(error2[key]);
|
|
35257
|
+
}
|
|
35258
|
+
return details;
|
|
35259
|
+
}
|
|
35260
|
+
function sanitizeDiagnosticValue(value) {
|
|
35261
|
+
if (Array.isArray(value)) {
|
|
35262
|
+
return value.map((item) => sanitizeDiagnosticValue(item));
|
|
35263
|
+
}
|
|
35264
|
+
if (value && typeof value === "object") {
|
|
35265
|
+
const result = {};
|
|
35266
|
+
for (const [key, nestedValue] of Object.entries(value)) {
|
|
35267
|
+
result[key] = isSensitiveDiagnosticKey(key) ? "<redacted>" : sanitizeDiagnosticValue(nestedValue);
|
|
35268
|
+
}
|
|
35269
|
+
return result;
|
|
35270
|
+
}
|
|
35271
|
+
return value;
|
|
35272
|
+
}
|
|
35273
|
+
function isSensitiveDiagnosticKey(key) {
|
|
35274
|
+
return /token|secret|mac[_-]?key|authorization|cookie|(^|[_-])pat($|[_-])/i.test(key);
|
|
35275
|
+
}
|
|
35276
|
+
function formatDiagnosticJson(value) {
|
|
35277
|
+
try {
|
|
35278
|
+
return JSON.stringify(value, null, 2);
|
|
35279
|
+
} catch {
|
|
35280
|
+
return String(value);
|
|
35281
|
+
}
|
|
35282
|
+
}
|
|
35283
|
+
function indent2(value) {
|
|
34950
35284
|
return value.split("\n").map((line) => ` ${line}`).join("\n");
|
|
34951
35285
|
}
|
|
34952
35286
|
|
|
@@ -35837,7 +36171,7 @@ async function runMcpVerify(parsed, ctx) {
|
|
|
35837
36171
|
payload.explanation ? `- explanation: ${payload.explanation}` : "",
|
|
35838
36172
|
payload.error ? `- error: ${payload.error}` : "",
|
|
35839
36173
|
payload.stderr ? `- stderr:
|
|
35840
|
-
${
|
|
36174
|
+
${indent3(payload.stderr)}` : "",
|
|
35841
36175
|
payload.next_steps ? ["Next steps:", ...payload.next_steps.map((step, index) => `${index + 1}. ${step}`)].join(
|
|
35842
36176
|
"\n"
|
|
35843
36177
|
) : "",
|
|
@@ -36602,7 +36936,7 @@ function escapeToml(value) {
|
|
|
36602
36936
|
function isTomlBareKey(value) {
|
|
36603
36937
|
return /^[A-Za-z0-9_-]+$/.test(value);
|
|
36604
36938
|
}
|
|
36605
|
-
function
|
|
36939
|
+
function indent3(value) {
|
|
36606
36940
|
return value.split("\n").map((line) => ` ${line}`).join("\n");
|
|
36607
36941
|
}
|
|
36608
36942
|
function formatShellCommand(parts) {
|
|
@@ -36653,6 +36987,7 @@ function formatCliError(error2) {
|
|
|
36653
36987
|
}
|
|
36654
36988
|
|
|
36655
36989
|
// src/mcp-proxy/config.ts
|
|
36990
|
+
var DEFAULT_TOOL_CALL_TIMEOUT_MS = 60 * 60 * 1e3;
|
|
36656
36991
|
function readStdin() {
|
|
36657
36992
|
return new Promise((resolve, reject) => {
|
|
36658
36993
|
const chunks = [];
|
|
@@ -36776,8 +37111,7 @@ function applyDefaults(config2) {
|
|
|
36776
37111
|
verbose,
|
|
36777
37112
|
reconnect_interval: ((_b = config2.options) == null ? void 0 : _b.reconnect_interval) ?? 5e3,
|
|
36778
37113
|
request_timeout: ((_c = config2.options) == null ? void 0 : _c.request_timeout) ?? 3e4,
|
|
36779
|
-
tool_call_timeout: ((_d = config2.options) == null ? void 0 : _d.tool_call_timeout) ??
|
|
36780
|
-
// 5 分钟
|
|
37114
|
+
tool_call_timeout: ((_d = config2.options) == null ? void 0 : _d.tool_call_timeout) ?? DEFAULT_TOOL_CALL_TIMEOUT_MS,
|
|
36781
37115
|
reset_timeout_on_progress: ((_e = config2.options) == null ? void 0 : _e.reset_timeout_on_progress) ?? true,
|
|
36782
37116
|
health_check_interval: ((_f = config2.options) == null ? void 0 : _f.health_check_interval) ?? 3e4,
|
|
36783
37117
|
enable_cookie_sticky: ((_g = config2.options) == null ? void 0 : _g.enable_cookie_sticky) ?? true,
|
|
@@ -39075,7 +39409,7 @@ var TapTapMCPProxy = class {
|
|
|
39075
39409
|
void 0,
|
|
39076
39410
|
// resultSchema
|
|
39077
39411
|
{
|
|
39078
|
-
timeout: ((_b = this.config.options) == null ? void 0 : _b.tool_call_timeout) ??
|
|
39412
|
+
timeout: ((_b = this.config.options) == null ? void 0 : _b.tool_call_timeout) ?? DEFAULT_TOOL_CALL_TIMEOUT_MS,
|
|
39079
39413
|
resetTimeoutOnProgress: ((_c = this.config.options) == null ? void 0 : _c.reset_timeout_on_progress) ?? true,
|
|
39080
39414
|
onprogress: req.onprogress
|
|
39081
39415
|
}
|
|
@@ -39161,7 +39495,7 @@ var TapTapMCPProxy = class {
|
|
|
39161
39495
|
}
|
|
39162
39496
|
const progressToken = (_c = request.params._meta) == null ? void 0 : _c.progressToken;
|
|
39163
39497
|
const callToolOptions = {
|
|
39164
|
-
timeout: ((_d = this.config.options) == null ? void 0 : _d.tool_call_timeout) ??
|
|
39498
|
+
timeout: ((_d = this.config.options) == null ? void 0 : _d.tool_call_timeout) ?? DEFAULT_TOOL_CALL_TIMEOUT_MS,
|
|
39165
39499
|
resetTimeoutOnProgress: ((_e = this.config.options) == null ? void 0 : _e.reset_timeout_on_progress) ?? true
|
|
39166
39500
|
};
|
|
39167
39501
|
const forceInjectProgressToken = ((_f = this.config.options) == null ? void 0 : _f.force_inject_progress_token) ?? false;
|
package/package.json
CHANGED
|
@@ -74,33 +74,30 @@ selected files.
|
|
|
74
74
|
## Maker Creative Asset Tool Policy
|
|
75
75
|
|
|
76
76
|
When the current directory is a bound Maker project, use Maker MCP for game asset generation and
|
|
77
|
-
editing. Prefer Maker MCP proxy tools over native AI image/video/audio tools. These
|
|
78
|
-
generated files inside the project
|
|
79
|
-
|
|
77
|
+
editing when possible. Prefer Maker MCP proxy tools over native AI image/video/audio tools. These
|
|
78
|
+
Maker tools keep generated files inside the project, record remote mappings for later editing, and
|
|
79
|
+
can forward resolvable local reference media as data URLs when the remote tool schema supports it.
|
|
80
80
|
|
|
81
|
-
This
|
|
81
|
+
This guidance helps users prefer Maker-managed tools for Maker game assets.
|
|
82
82
|
|
|
83
|
-
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
that Maker proxy tools are unavailable in this session.
|
|
87
|
-
- Do not fall back to generic imagegen or native media generation unless the user explicitly asks to
|
|
88
|
-
leave the Maker asset workflow.
|
|
83
|
+
- Prefer Maker proxy tools for Maker project asset requests when the Maker proxy tool is callable.
|
|
84
|
+
- If the required Maker proxy tool is not exposed in the current AI session, tell the user that
|
|
85
|
+
Maker proxy tools are unavailable in this session.
|
|
89
86
|
|
|
90
87
|
- Use `generate_image` for one image.
|
|
91
88
|
- Use `batch_generate_images` for multiple images.
|
|
92
89
|
- Use `edit_image` for modifying project images.
|
|
93
90
|
- Use `create_video_task` for game videos and image/video referenced generation.
|
|
91
|
+
- Use `query_video_task` to refresh video task status, release completed task quota, and fetch final videos.
|
|
94
92
|
- Use `text_to_music` for game music or audio.
|
|
95
|
-
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
- Do not call `edit_image` without an image path or CDN URL.
|
|
93
|
+
- Follow each tool schema for supported local path, remote URL, and data URL inputs.
|
|
94
|
+
- Local proxy may convert resolvable local reference media to data URLs before forwarding.
|
|
95
|
+
- If a Maker proxy tool returns an error or `isError`, report the full remote result/error payload.
|
|
96
|
+
Include the server response payload so developers can diagnose the issue.
|
|
100
97
|
|
|
101
98
|
Generated assets should be saved by Maker MCP under `assets/image`, `assets/video`, or
|
|
102
|
-
`assets/audio`.
|
|
103
|
-
|
|
99
|
+
`assets/audio`. Prefer Maker proxy tools when the user is asking for Maker game assets in a bound
|
|
100
|
+
project.
|
|
104
101
|
|
|
105
102
|
## Project Detection
|
|
106
103
|
|
|
@@ -141,8 +138,8 @@ directory.
|
|
|
141
138
|
### Proxy Tools Missing From The Current Session
|
|
142
139
|
|
|
143
140
|
If the user is in a bound Maker project but `generate_image`, `batch_generate_images`, `edit_image`,
|
|
144
|
-
`create_video_task`, or `text_to_music` are missing from the current AI tool list,
|
|
145
|
-
cwd before suggesting repeated restarts:
|
|
141
|
+
`create_video_task`, `query_video_task`, or `text_to_music` are missing from the current AI tool list,
|
|
142
|
+
diagnose the MCP cwd before suggesting repeated restarts:
|
|
146
143
|
|
|
147
144
|
1. Read `maker://status` or call `maker_status_lite` without `target_dir` to see the MCP server cwd.
|
|
148
145
|
2. If the user provides or the client exposes the real Maker project directory, call
|
|
@@ -155,8 +152,8 @@ cwd before suggesting repeated restarts:
|
|
|
155
152
|
`taptap-maker` MCP config `cwd` to the Maker project directory, then reconnect `taptap-maker`
|
|
156
153
|
from the client's MCP UI such as `/mcp`.
|
|
157
154
|
|
|
158
|
-
|
|
159
|
-
|
|
155
|
+
When Maker proxy tools are missing, explain that this is likely a session/configuration problem and
|
|
156
|
+
that Maker tools are preferred for Maker game assets.
|
|
160
157
|
|
|
161
158
|
## Initialization Workflow
|
|
162
159
|
|