@taptap/maker 0.0.17-beta.4 → 0.0.18-beta.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/README.md +1 -1
- package/dist/maker.js +301 -13
- package/package.json +1 -1
- package/skills/taptap-maker-local/SKILL.md +24 -11
package/README.md
CHANGED
package/dist/maker.js
CHANGED
|
@@ -29444,6 +29444,8 @@ function createMakerAssetPolicyBlock() {
|
|
|
29444
29444
|
"- `edit_image` for modifying existing project images.",
|
|
29445
29445
|
"- `create_video_task` for game video assets or referenced image/video generation.",
|
|
29446
29446
|
"- `text_to_music` for game music or audio assets.",
|
|
29447
|
+
"- `create_3d_model_task` for game 3D model assets.",
|
|
29448
|
+
"- `query_3d_model_task` for polling 3D model tasks.",
|
|
29447
29449
|
"",
|
|
29448
29450
|
"Before calling `edit_image`, resolve dragged or referenced images to a local project image path",
|
|
29449
29451
|
"or CDN URL first. If the user references an attached/local image, inspect the attachment or",
|
|
@@ -29460,7 +29462,8 @@ function createMakerAssetPolicyBlock() {
|
|
|
29460
29462
|
"native media generation unless the user explicitly asks to leave the Maker asset workflow.",
|
|
29461
29463
|
"",
|
|
29462
29464
|
"Generated assets must stay in the Maker project asset workflow under `assets/image`,",
|
|
29463
|
-
"`assets/video`, or `assets/
|
|
29465
|
+
"`assets/video`, `assets/audio`, or `assets/model`, with CDN mappings preserved for later edits",
|
|
29466
|
+
"and builds.",
|
|
29464
29467
|
"",
|
|
29465
29468
|
MAKER_ASSET_POLICY_END
|
|
29466
29469
|
].join("\n");
|
|
@@ -29677,7 +29680,7 @@ async function downloadAndExtractDevKit(url2, fetchImpl = fetch, timeoutMs = DEF
|
|
|
29677
29680
|
fs5.rmSync(zipPath, { force: true });
|
|
29678
29681
|
return tempDir;
|
|
29679
29682
|
}
|
|
29680
|
-
function extractZip(zipPath, targetDir) {
|
|
29683
|
+
function extractZip(zipPath, targetDir, label = "AI dev kit") {
|
|
29681
29684
|
if (process.platform === "win32") {
|
|
29682
29685
|
const result = spawnSync2(
|
|
29683
29686
|
"powershell.exe",
|
|
@@ -29694,11 +29697,11 @@ function extractZip(zipPath, targetDir) {
|
|
|
29694
29697
|
{ encoding: "utf8" }
|
|
29695
29698
|
);
|
|
29696
29699
|
if (result.status !== 0) {
|
|
29697
|
-
throw new Error(`Failed to extract
|
|
29700
|
+
throw new Error(`Failed to extract ${label} zip: ${formatSpawnFailure(result)}`);
|
|
29698
29701
|
}
|
|
29699
29702
|
return;
|
|
29700
29703
|
}
|
|
29701
|
-
const unzipResult = spawnSync2("unzip", ["-
|
|
29704
|
+
const unzipResult = spawnSync2("unzip", ["-oq", zipPath, "-d", targetDir], { encoding: "utf8" });
|
|
29702
29705
|
if (unzipResult.status === 0) {
|
|
29703
29706
|
return;
|
|
29704
29707
|
}
|
|
@@ -29716,7 +29719,7 @@ function extractZip(zipPath, targetDir) {
|
|
|
29716
29719
|
}
|
|
29717
29720
|
throw new Error(
|
|
29718
29721
|
[
|
|
29719
|
-
`Failed to extract
|
|
29722
|
+
`Failed to extract ${label} zip: unzip: ${formatSpawnFailure(unzipResult)}`,
|
|
29720
29723
|
...pythonFailures
|
|
29721
29724
|
].join("; ")
|
|
29722
29725
|
);
|
|
@@ -29931,6 +29934,35 @@ async function listMakerProjects(options) {
|
|
|
29931
29934
|
}
|
|
29932
29935
|
return normalizeProjectsResponse(json2);
|
|
29933
29936
|
}
|
|
29937
|
+
async function createMakerProject(options) {
|
|
29938
|
+
const name = options.name.trim();
|
|
29939
|
+
if (!name) {
|
|
29940
|
+
throw new Error("Maker project name is required.");
|
|
29941
|
+
}
|
|
29942
|
+
const response = await fetch(`${getMakerApiBase()}/apps`, {
|
|
29943
|
+
method: "POST",
|
|
29944
|
+
headers: {
|
|
29945
|
+
Authorization: `Bearer ${options.pat}`,
|
|
29946
|
+
Accept: "application/json",
|
|
29947
|
+
"Content-Type": "application/json"
|
|
29948
|
+
},
|
|
29949
|
+
body: JSON.stringify({
|
|
29950
|
+
name,
|
|
29951
|
+
gameType: options.gameType || "sce"
|
|
29952
|
+
})
|
|
29953
|
+
});
|
|
29954
|
+
const json2 = await response.json();
|
|
29955
|
+
if (!response.ok) {
|
|
29956
|
+
throw new Error(`Maker project create failed: HTTP ${response.status} ${JSON.stringify(json2)}`);
|
|
29957
|
+
}
|
|
29958
|
+
const body = json2;
|
|
29959
|
+
const projects = normalizeProjectsResponse(body.app ? { apps: [body.app] } : json2);
|
|
29960
|
+
const project = projects[0];
|
|
29961
|
+
if (!(project == null ? void 0 : project.id)) {
|
|
29962
|
+
throw new Error(`Maker project create returned no app id: ${JSON.stringify(json2)}`);
|
|
29963
|
+
}
|
|
29964
|
+
return project;
|
|
29965
|
+
}
|
|
29934
29966
|
async function cloneMakerProject(options) {
|
|
29935
29967
|
var _a3, _b, _c, _d, _e, _f, _g, _h;
|
|
29936
29968
|
const target = path7.resolve(options.targetDir);
|
|
@@ -32196,7 +32228,8 @@ function formatMakerSkillStatus(_options = {}) {
|
|
|
32196
32228
|
"- Do not fall back to generic imagegen when Maker proxy tools are unavailable in the session.",
|
|
32197
32229
|
"- Use generate_image, batch_generate_images, edit_image for game image assets.",
|
|
32198
32230
|
"- Use create_video_task and text_to_music for game video/audio assets.",
|
|
32199
|
-
"-
|
|
32231
|
+
"- Use create_3d_model_task and query_3d_model_task for game 3D model assets.",
|
|
32232
|
+
"- Generated assets are saved under assets/image, assets/video, assets/audio, or assets/model with CDN mappings.",
|
|
32200
32233
|
"- Before edit_image, resolve dragged or referenced images to a local project image path or CDN URL.",
|
|
32201
32234
|
"- If only a file name is given, search assets/image for the matching file before calling edit_image.",
|
|
32202
32235
|
"- Do not call edit_image without an image path or CDN URL.",
|
|
@@ -32609,6 +32642,8 @@ import path12 from "node:path";
|
|
|
32609
32642
|
var IMAGE_ASSET_DIRS = ["assets/image"];
|
|
32610
32643
|
var VIDEO_ASSET_DIRS = ["assets/video"];
|
|
32611
32644
|
var AUDIO_ASSET_DIRS = ["assets/audio"];
|
|
32645
|
+
var MODEL_ASSET_DIRS = ["assets/model"];
|
|
32646
|
+
var THREE_D_MODEL_VIEWS = ["front", "left", "back", "right"];
|
|
32612
32647
|
function prepareRemoteProxyToolArgs(options) {
|
|
32613
32648
|
if (options.toolName === "edit_image") {
|
|
32614
32649
|
return rewriteEditImageAssetArgs(options.targetDir, options.args);
|
|
@@ -32619,6 +32654,9 @@ function prepareRemoteProxyToolArgs(options) {
|
|
|
32619
32654
|
if (options.toolName === "create_video_task") {
|
|
32620
32655
|
return rewriteVideoReferenceAssetArgs(options.targetDir, options.args);
|
|
32621
32656
|
}
|
|
32657
|
+
if (options.toolName === "create_3d_model_task") {
|
|
32658
|
+
return rewrite3dModelAssetArgs(options.targetDir, options.args);
|
|
32659
|
+
}
|
|
32622
32660
|
return options.args;
|
|
32623
32661
|
}
|
|
32624
32662
|
async function materializeRemoteProxyToolAssets(options) {
|
|
@@ -32666,7 +32704,9 @@ function shouldMaterializeRemoteProxyTool(toolName) {
|
|
|
32666
32704
|
"batch_generate_images",
|
|
32667
32705
|
"edit_image",
|
|
32668
32706
|
"create_video_task",
|
|
32669
|
-
"text_to_music"
|
|
32707
|
+
"text_to_music",
|
|
32708
|
+
"create_3d_model_task",
|
|
32709
|
+
"query_3d_model_task"
|
|
32670
32710
|
].includes(toolName);
|
|
32671
32711
|
}
|
|
32672
32712
|
function isTextContent(item) {
|
|
@@ -32696,6 +32736,9 @@ async function materializeParsedProxyResult(options) {
|
|
|
32696
32736
|
if (options.toolName === "text_to_music") {
|
|
32697
32737
|
return await materializeMusicResult(options);
|
|
32698
32738
|
}
|
|
32739
|
+
if (options.toolName === "create_3d_model_task" || options.toolName === "query_3d_model_task") {
|
|
32740
|
+
return await materialize3dModelResult(options, options.toolName);
|
|
32741
|
+
}
|
|
32699
32742
|
return options.payload;
|
|
32700
32743
|
}
|
|
32701
32744
|
async function materializeSingleImageResult(options, toolName) {
|
|
@@ -32809,6 +32852,155 @@ async function materializeMusicResult(options) {
|
|
|
32809
32852
|
})
|
|
32810
32853
|
} : options.payload;
|
|
32811
32854
|
}
|
|
32855
|
+
async function materialize3dModelResult(options, toolName) {
|
|
32856
|
+
if (options.payload.phase === 1) {
|
|
32857
|
+
return await materialize3dPreviewResult(options);
|
|
32858
|
+
}
|
|
32859
|
+
return await materialize3dFinalResult(options, toolName);
|
|
32860
|
+
}
|
|
32861
|
+
async function materialize3dPreviewResult(options) {
|
|
32862
|
+
if (!isRecord(options.payload.preview_urls)) {
|
|
32863
|
+
return options.payload;
|
|
32864
|
+
}
|
|
32865
|
+
let changed = false;
|
|
32866
|
+
const previewAssets = {};
|
|
32867
|
+
const taskId = get3dTaskId(options.payload);
|
|
32868
|
+
const mode = stringField2(options.payload.mode);
|
|
32869
|
+
for (const view of THREE_D_MODEL_VIEWS) {
|
|
32870
|
+
const url2 = stringField2(options.payload.preview_urls[view]);
|
|
32871
|
+
const materialized = await materializeAsset({
|
|
32872
|
+
targetDir: options.targetDir,
|
|
32873
|
+
url: url2,
|
|
32874
|
+
baseName: `${taskId || "3d_model"}_${view}`,
|
|
32875
|
+
relativeDir: "assets/image",
|
|
32876
|
+
extension: extensionFromUrl(url2) || "png",
|
|
32877
|
+
now: options.now,
|
|
32878
|
+
fetchImpl: options.fetchImpl
|
|
32879
|
+
});
|
|
32880
|
+
if (!materialized) {
|
|
32881
|
+
continue;
|
|
32882
|
+
}
|
|
32883
|
+
changed = true;
|
|
32884
|
+
previewAssets[view] = { ...materialized, cdnUrl: url2 };
|
|
32885
|
+
if ("localPath" in materialized && url2) {
|
|
32886
|
+
upsertGeneratedAssetRecord(options.targetDir, materialized.localPath, {
|
|
32887
|
+
tool: "create_3d_model_task",
|
|
32888
|
+
name: `${taskId || "3d_model"}_${view}`,
|
|
32889
|
+
cdnUrl: url2,
|
|
32890
|
+
previewUrl: url2,
|
|
32891
|
+
localPath: materialized.localPath,
|
|
32892
|
+
absolutePath: materialized.absolutePath,
|
|
32893
|
+
createdAt: options.now.toISOString(),
|
|
32894
|
+
taskId,
|
|
32895
|
+
mode,
|
|
32896
|
+
phase: 1,
|
|
32897
|
+
view
|
|
32898
|
+
});
|
|
32899
|
+
}
|
|
32900
|
+
}
|
|
32901
|
+
return {
|
|
32902
|
+
...options.payload,
|
|
32903
|
+
...changed ? { preview_assets: previewAssets } : {},
|
|
32904
|
+
...create3dPreviewReviewGuidance()
|
|
32905
|
+
};
|
|
32906
|
+
}
|
|
32907
|
+
function create3dPreviewReviewGuidance() {
|
|
32908
|
+
return {
|
|
32909
|
+
workflow_state: "awaiting_user_review",
|
|
32910
|
+
user_review_required: true,
|
|
32911
|
+
next_action: "Show the four-view previews to the user and ask whether they approve them or want changes.",
|
|
32912
|
+
approval_next_step: "If the user approves, continue the original 3D model generation flow by calling create_3d_model_task again with the approved four-view images.",
|
|
32913
|
+
revision_next_step: "If the user requests changes, call create_3d_model_task again with the requested changes to regenerate the four-view previews before model generation.",
|
|
32914
|
+
agent_instruction: "Do not stop after phase 1. The 3D model is not complete until the user approves the four-view previews and final model generation finishes."
|
|
32915
|
+
};
|
|
32916
|
+
}
|
|
32917
|
+
async function materialize3dFinalResult(options, toolName) {
|
|
32918
|
+
if (options.payload.status !== "success") {
|
|
32919
|
+
return options.payload;
|
|
32920
|
+
}
|
|
32921
|
+
let changed = false;
|
|
32922
|
+
const nextPayload = { ...options.payload };
|
|
32923
|
+
const taskId = get3dTaskId(options.payload);
|
|
32924
|
+
const modelCdnUrl = stringField2(options.payload.model_cdn_url);
|
|
32925
|
+
const renderedImageUrl = stringField2(options.payload.rendered_image_url);
|
|
32926
|
+
const mdlConversionError = stringField2(options.payload.mdl_conversion_error);
|
|
32927
|
+
const mdlUrl = stringField2(options.payload.mdl_cdn_url);
|
|
32928
|
+
const mdlMaterialized = await materializeAsset({
|
|
32929
|
+
targetDir: options.targetDir,
|
|
32930
|
+
url: mdlUrl,
|
|
32931
|
+
baseName: taskId || "3d_model",
|
|
32932
|
+
relativeDir: MODEL_ASSET_DIRS[0],
|
|
32933
|
+
extension: extensionFromUrl(mdlUrl) || "zip",
|
|
32934
|
+
now: options.now,
|
|
32935
|
+
fetchImpl: options.fetchImpl
|
|
32936
|
+
});
|
|
32937
|
+
if (mdlMaterialized) {
|
|
32938
|
+
changed = true;
|
|
32939
|
+
nextPayload.mdlDownload = mdlMaterialized.download;
|
|
32940
|
+
if ("localPath" in mdlMaterialized) {
|
|
32941
|
+
nextPayload.mdlLocalPath = mdlMaterialized.localPath;
|
|
32942
|
+
nextPayload.mdlAbsolutePath = mdlMaterialized.absolutePath;
|
|
32943
|
+
extractZip(
|
|
32944
|
+
mdlMaterialized.absolutePath,
|
|
32945
|
+
path12.join(options.targetDir, "assets"),
|
|
32946
|
+
"3D model asset"
|
|
32947
|
+
);
|
|
32948
|
+
nextPayload.mdlExtracted = true;
|
|
32949
|
+
nextPayload.mdlExtractedTo = "assets";
|
|
32950
|
+
if (mdlUrl) {
|
|
32951
|
+
upsertGeneratedAssetRecord(options.targetDir, mdlMaterialized.localPath, {
|
|
32952
|
+
tool: toolName,
|
|
32953
|
+
name: taskId,
|
|
32954
|
+
cdnUrl: mdlUrl,
|
|
32955
|
+
previewUrl: renderedImageUrl || mdlUrl,
|
|
32956
|
+
localPath: mdlMaterialized.localPath,
|
|
32957
|
+
absolutePath: mdlMaterialized.absolutePath,
|
|
32958
|
+
createdAt: options.now.toISOString(),
|
|
32959
|
+
taskId,
|
|
32960
|
+
modelCdnUrl,
|
|
32961
|
+
renderedImageUrl,
|
|
32962
|
+
mdlConversionError
|
|
32963
|
+
});
|
|
32964
|
+
}
|
|
32965
|
+
}
|
|
32966
|
+
}
|
|
32967
|
+
const renderedImageMaterialized = await materializeAsset({
|
|
32968
|
+
targetDir: options.targetDir,
|
|
32969
|
+
url: renderedImageUrl,
|
|
32970
|
+
baseName: `${taskId || "3d_model"}_render`,
|
|
32971
|
+
relativeDir: "assets/image",
|
|
32972
|
+
extension: extensionFromUrl(renderedImageUrl) || "png",
|
|
32973
|
+
now: options.now,
|
|
32974
|
+
fetchImpl: options.fetchImpl
|
|
32975
|
+
});
|
|
32976
|
+
if (renderedImageMaterialized) {
|
|
32977
|
+
changed = true;
|
|
32978
|
+
nextPayload.renderedImageDownload = renderedImageMaterialized.download;
|
|
32979
|
+
if ("localPath" in renderedImageMaterialized) {
|
|
32980
|
+
nextPayload.renderedImageLocalPath = renderedImageMaterialized.localPath;
|
|
32981
|
+
nextPayload.renderedImageAbsolutePath = renderedImageMaterialized.absolutePath;
|
|
32982
|
+
if (renderedImageUrl) {
|
|
32983
|
+
upsertGeneratedAssetRecord(options.targetDir, renderedImageMaterialized.localPath, {
|
|
32984
|
+
tool: toolName,
|
|
32985
|
+
name: `${taskId || "3d_model"}_render`,
|
|
32986
|
+
cdnUrl: renderedImageUrl,
|
|
32987
|
+
previewUrl: renderedImageUrl,
|
|
32988
|
+
localPath: renderedImageMaterialized.localPath,
|
|
32989
|
+
absolutePath: renderedImageMaterialized.absolutePath,
|
|
32990
|
+
createdAt: options.now.toISOString(),
|
|
32991
|
+
taskId,
|
|
32992
|
+
modelCdnUrl,
|
|
32993
|
+
renderedImageUrl,
|
|
32994
|
+
mdlConversionError
|
|
32995
|
+
});
|
|
32996
|
+
}
|
|
32997
|
+
}
|
|
32998
|
+
}
|
|
32999
|
+
return changed ? nextPayload : options.payload;
|
|
33000
|
+
}
|
|
33001
|
+
function get3dTaskId(payload) {
|
|
33002
|
+
return stringField2(payload.task_id) || stringField2(payload.taskId);
|
|
33003
|
+
}
|
|
32812
33004
|
function persistMaterializedAsset(options) {
|
|
32813
33005
|
const nextPayload = { ...options.payload, ...options.materialized };
|
|
32814
33006
|
if (!("localPath" in options.materialized) || !options.cdnUrl) {
|
|
@@ -32904,6 +33096,54 @@ function rewriteVideoReferenceAssetArgs(targetDir, args) {
|
|
|
32904
33096
|
audios: rewriteUrlObjectArray(targetDir, args.audios, registry2, AUDIO_ASSET_DIRS)
|
|
32905
33097
|
};
|
|
32906
33098
|
}
|
|
33099
|
+
function rewrite3dModelAssetArgs(targetDir, args) {
|
|
33100
|
+
const registry2 = readGeneratedAssetRegistry(targetDir);
|
|
33101
|
+
return {
|
|
33102
|
+
...args,
|
|
33103
|
+
image: rewriteGeneratedAssetReference(targetDir, args.image, registry2, IMAGE_ASSET_DIRS),
|
|
33104
|
+
front_image: rewriteGeneratedAssetReference(
|
|
33105
|
+
targetDir,
|
|
33106
|
+
args.front_image,
|
|
33107
|
+
registry2,
|
|
33108
|
+
IMAGE_ASSET_DIRS
|
|
33109
|
+
),
|
|
33110
|
+
left_image: rewriteGeneratedAssetReference(
|
|
33111
|
+
targetDir,
|
|
33112
|
+
args.left_image,
|
|
33113
|
+
registry2,
|
|
33114
|
+
IMAGE_ASSET_DIRS
|
|
33115
|
+
),
|
|
33116
|
+
back_image: rewriteGeneratedAssetReference(
|
|
33117
|
+
targetDir,
|
|
33118
|
+
args.back_image,
|
|
33119
|
+
registry2,
|
|
33120
|
+
IMAGE_ASSET_DIRS
|
|
33121
|
+
),
|
|
33122
|
+
right_image: rewriteGeneratedAssetReference(
|
|
33123
|
+
targetDir,
|
|
33124
|
+
args.right_image,
|
|
33125
|
+
registry2,
|
|
33126
|
+
IMAGE_ASSET_DIRS
|
|
33127
|
+
),
|
|
33128
|
+
confirmed_image_paths: rewrite3dConfirmedImagePaths(
|
|
33129
|
+
targetDir,
|
|
33130
|
+
args.confirmed_image_paths,
|
|
33131
|
+
registry2
|
|
33132
|
+
)
|
|
33133
|
+
};
|
|
33134
|
+
}
|
|
33135
|
+
function rewrite3dConfirmedImagePaths(targetDir, value, registry2) {
|
|
33136
|
+
if (!isRecord(value)) {
|
|
33137
|
+
return value;
|
|
33138
|
+
}
|
|
33139
|
+
return {
|
|
33140
|
+
...value,
|
|
33141
|
+
front: rewriteGeneratedAssetReference(targetDir, value.front, registry2, IMAGE_ASSET_DIRS),
|
|
33142
|
+
left: rewriteGeneratedAssetReference(targetDir, value.left, registry2, IMAGE_ASSET_DIRS),
|
|
33143
|
+
back: rewriteGeneratedAssetReference(targetDir, value.back, registry2, IMAGE_ASSET_DIRS),
|
|
33144
|
+
right: rewriteGeneratedAssetReference(targetDir, value.right, registry2, IMAGE_ASSET_DIRS)
|
|
33145
|
+
};
|
|
33146
|
+
}
|
|
32907
33147
|
function rewriteUrlObjectArray(targetDir, value, registry2, assetDirs) {
|
|
32908
33148
|
if (!Array.isArray(value)) {
|
|
32909
33149
|
return value;
|
|
@@ -33069,7 +33309,7 @@ function extensionFromUrl(url2) {
|
|
|
33069
33309
|
}
|
|
33070
33310
|
|
|
33071
33311
|
// src/maker/server/mcp.ts
|
|
33072
|
-
var VERSION = true ? "0.0.
|
|
33312
|
+
var VERSION = true ? "0.0.18-beta.1" : "dev";
|
|
33073
33313
|
var DEFAULT_BUILD_TIMEOUT_MS = 10 * 60 * 1e3;
|
|
33074
33314
|
var DEFAULT_PROXY_RETRY_ATTEMPTS = 5;
|
|
33075
33315
|
var DEFAULT_PROXY_RETRY_DELAY_MS = 30 * 1e3;
|
|
@@ -33082,7 +33322,9 @@ var MAKER_REMOTE_PROXY_EXPOSED_TOOL_NAMES = [
|
|
|
33082
33322
|
"batch_generate_images",
|
|
33083
33323
|
"edit_image",
|
|
33084
33324
|
"create_video_task",
|
|
33085
|
-
"text_to_music"
|
|
33325
|
+
"text_to_music",
|
|
33326
|
+
"create_3d_model_task",
|
|
33327
|
+
"query_3d_model_task"
|
|
33086
33328
|
];
|
|
33087
33329
|
var MakerCloneFailedError = class extends Error {
|
|
33088
33330
|
constructor(targetDir, originalError) {
|
|
@@ -35112,6 +35354,7 @@ var BOOLEAN_OPTIONS = /* @__PURE__ */ new Set([
|
|
|
35112
35354
|
"pat_from_stdin",
|
|
35113
35355
|
"reset",
|
|
35114
35356
|
"all",
|
|
35357
|
+
"create",
|
|
35115
35358
|
"h",
|
|
35116
35359
|
"help"
|
|
35117
35360
|
]);
|
|
@@ -35257,6 +35500,7 @@ async function runInit(parsed, ctx) {
|
|
|
35257
35500
|
});
|
|
35258
35501
|
const selected = await resolveProjectSelection(parsed, projects, {
|
|
35259
35502
|
existingProjectConfig,
|
|
35503
|
+
pat,
|
|
35260
35504
|
skipConfirm
|
|
35261
35505
|
});
|
|
35262
35506
|
emit(ctx, "app", "Maker app selected", {
|
|
@@ -36047,6 +36291,13 @@ async function resolvePat(parsed, ctx) {
|
|
|
36047
36291
|
async function resolveProjectSelection(parsed, projects, options) {
|
|
36048
36292
|
var _a3;
|
|
36049
36293
|
const appId = stringOption(parsed, "app_id") || parsed.positionals[0];
|
|
36294
|
+
const createNewProject = booleanOption(parsed, "create");
|
|
36295
|
+
if (createNewProject && appId) {
|
|
36296
|
+
throw new Error("Cannot use --create together with --app-id or a positional app id.");
|
|
36297
|
+
}
|
|
36298
|
+
if (createNewProject) {
|
|
36299
|
+
return createProjectFromInit(parsed, options);
|
|
36300
|
+
}
|
|
36050
36301
|
if (appId) {
|
|
36051
36302
|
return projects.find((project) => project.id === appId) || { id: appId };
|
|
36052
36303
|
}
|
|
@@ -36059,7 +36310,12 @@ async function resolveProjectSelection(parsed, projects, options) {
|
|
|
36059
36310
|
};
|
|
36060
36311
|
}
|
|
36061
36312
|
if (projects.length === 0) {
|
|
36062
|
-
|
|
36313
|
+
if (options.skipConfirm) {
|
|
36314
|
+
throw new Error("No Maker apps found for this PAT. Use --create --name to create one.");
|
|
36315
|
+
}
|
|
36316
|
+
process.stdout.write(`${formatMakerProjectList(projects)}
|
|
36317
|
+
`);
|
|
36318
|
+
return createProjectFromInit(parsed, options);
|
|
36063
36319
|
}
|
|
36064
36320
|
if (options.skipConfirm) {
|
|
36065
36321
|
throw new Error("Missing --app-id in non-interactive init mode.");
|
|
@@ -36069,7 +36325,7 @@ async function resolveProjectSelection(parsed, projects, options) {
|
|
|
36069
36325
|
for (; ; ) {
|
|
36070
36326
|
process.stdout.write(`${formatMakerProjectList(orderedProjects, { showAll })}
|
|
36071
36327
|
`);
|
|
36072
|
-
const answer = await promptRequired("Choose app by index, app_id, or 'all' to show all");
|
|
36328
|
+
const answer = await promptRequired("Choose app by index, app_id, 'new', or 'all' to show all");
|
|
36073
36329
|
const normalized = answer.trim().toLowerCase();
|
|
36074
36330
|
if (["a", "all"].includes(normalized)) {
|
|
36075
36331
|
if (showAll) {
|
|
@@ -36079,6 +36335,9 @@ async function resolveProjectSelection(parsed, projects, options) {
|
|
|
36079
36335
|
}
|
|
36080
36336
|
continue;
|
|
36081
36337
|
}
|
|
36338
|
+
if (["0", "n", "new", "create"].includes(normalized)) {
|
|
36339
|
+
return createProjectFromInit(parsed, options);
|
|
36340
|
+
}
|
|
36082
36341
|
const visibleCount = showAll ? orderedProjects.length : Math.min(MAKER_PROJECT_DEFAULT_TEXT_LIMIT, orderedProjects.length);
|
|
36083
36342
|
const byIndex = Number(answer);
|
|
36084
36343
|
if (Number.isInteger(byIndex) && byIndex >= 1 && byIndex <= visibleCount) {
|
|
@@ -36091,6 +36350,31 @@ async function resolveProjectSelection(parsed, projects, options) {
|
|
|
36091
36350
|
return selected;
|
|
36092
36351
|
}
|
|
36093
36352
|
}
|
|
36353
|
+
async function createProjectFromInit(parsed, options) {
|
|
36354
|
+
var _a3;
|
|
36355
|
+
const existingProjectId = (_a3 = options.existingProjectConfig) == null ? void 0 : _a3.project_id;
|
|
36356
|
+
if (existingProjectId) {
|
|
36357
|
+
throw new Error(
|
|
36358
|
+
[
|
|
36359
|
+
`Current directory is already bound to Maker project ${existingProjectId}.`,
|
|
36360
|
+
"A Maker workspace directory can only be bound to one project at a time.",
|
|
36361
|
+
"Please create/open a new empty directory before creating a new Maker project."
|
|
36362
|
+
].join("\n")
|
|
36363
|
+
);
|
|
36364
|
+
}
|
|
36365
|
+
const name = stringOption(parsed, "name") || stringOption(parsed, "project_name");
|
|
36366
|
+
if (!name && options.skipConfirm) {
|
|
36367
|
+
throw new Error("Missing --name in non-interactive create mode.");
|
|
36368
|
+
}
|
|
36369
|
+
const projectName = name || await promptRequired("Enter new Maker project name");
|
|
36370
|
+
return createMakerProject({
|
|
36371
|
+
name: projectName,
|
|
36372
|
+
gameType: "sce",
|
|
36373
|
+
pat: options.pat
|
|
36374
|
+
}).catch((error2) => {
|
|
36375
|
+
throw appendPatRecoveryUrl(error2, parsed);
|
|
36376
|
+
});
|
|
36377
|
+
}
|
|
36094
36378
|
function ensureInitTargetCanRecordProject(targetDir, existingProjectId, selectedProjectId) {
|
|
36095
36379
|
if (!existingProjectId || existingProjectId === selectedProjectId) {
|
|
36096
36380
|
return;
|
|
@@ -36469,7 +36753,7 @@ function rejectRemovedAppsPaginationOptions(parsed) {
|
|
|
36469
36753
|
}
|
|
36470
36754
|
function formatMakerProjectList(projects, options = {}) {
|
|
36471
36755
|
if (projects.length === 0) {
|
|
36472
|
-
return "No Maker apps found.";
|
|
36756
|
+
return ["No Maker apps found.", "", "0. Create a new Maker project"].join("\n");
|
|
36473
36757
|
}
|
|
36474
36758
|
const sortedProjects = sortProjectsByRecentActivity(projects);
|
|
36475
36759
|
const showAll = options.showAll === true;
|
|
@@ -36479,7 +36763,9 @@ function formatMakerProjectList(projects, options = {}) {
|
|
|
36479
36763
|
`Maker apps (${projects.length})`,
|
|
36480
36764
|
hiddenCount > 0 ? `Showing ${visibleProjects.length} most recently active apps, sorted by last activity. ${hiddenCount} more hidden. Run \`taptap-maker apps --all\` to show all, or use \`--json\` for the complete machine-readable list.` : `Showing all ${visibleProjects.length} Maker apps, sorted by last activity.`,
|
|
36481
36765
|
"",
|
|
36482
|
-
...visibleProjects.map((project, index) => formatProjectListItem(project, index))
|
|
36766
|
+
...visibleProjects.map((project, index) => formatProjectListItem(project, index)),
|
|
36767
|
+
"",
|
|
36768
|
+
"0. Create a new Maker project"
|
|
36483
36769
|
].filter((line) => line !== "").join("\n");
|
|
36484
36770
|
}
|
|
36485
36771
|
function emit(ctx, step, message, data) {
|
|
@@ -36614,6 +36900,7 @@ function printHelp() {
|
|
|
36614
36900
|
"Usage:",
|
|
36615
36901
|
" taptap-maker Start MCP server mode",
|
|
36616
36902
|
" taptap-maker init [--env rnd|production] [--app-id ID] [--target-dir DIR] [--pat PAT]",
|
|
36903
|
+
" [--create --name NAME]",
|
|
36617
36904
|
" [--skip-confirm] [--skip-mcp-install] [--register-mcp codex,cursor,claude]",
|
|
36618
36905
|
" [--json]",
|
|
36619
36906
|
" taptap-maker doctor [--target-dir DIR] [--env rnd|production] [--json]",
|
|
@@ -39278,6 +39565,7 @@ function printHelp2() {
|
|
|
39278
39565
|
"Usage:",
|
|
39279
39566
|
" taptap-maker Start MCP server mode",
|
|
39280
39567
|
" taptap-maker init [--env rnd|production] [--app-id ID] [--target-dir DIR] [--pat PAT]",
|
|
39568
|
+
" [--create --name NAME]",
|
|
39281
39569
|
" [--skip-confirm] [--skip-mcp-install] [--register-mcp codex,cursor,claude]",
|
|
39282
39570
|
" [--json]",
|
|
39283
39571
|
" taptap-maker doctor [--target-dir DIR] [--env rnd|production] [--json]",
|
package/package.json
CHANGED
|
@@ -92,6 +92,8 @@ This policy overrides generic imagegen or native media skills for Maker game ass
|
|
|
92
92
|
- Use `edit_image` for modifying project images.
|
|
93
93
|
- Use `create_video_task` for game videos and image/video referenced generation.
|
|
94
94
|
- Use `text_to_music` for game music or audio.
|
|
95
|
+
- Use `create_3d_model_task` for game 3D models.
|
|
96
|
+
- Use `query_3d_model_task` for polling 3D model tasks.
|
|
95
97
|
- Before `edit_image`, resolve dragged or referenced images to a local project image path or CDN
|
|
96
98
|
URL. If the user references an attached/local image, inspect the attachment or workspace file path
|
|
97
99
|
first. If the image is under `assets/image`, pass that path. If only a file name is given, search
|
|
@@ -99,8 +101,8 @@ This policy overrides generic imagegen or native media skills for Maker game ass
|
|
|
99
101
|
- Do not call `edit_image` without an image path or CDN URL.
|
|
100
102
|
|
|
101
103
|
Generated assets should be saved by Maker MCP under `assets/image`, `assets/video`, or
|
|
102
|
-
`assets/audio
|
|
103
|
-
assets in a bound project.
|
|
104
|
+
`assets/audio`; generated 3D MDL zip files are saved under `assets/model`. Do not prefer
|
|
105
|
+
client-native image generation when the user is asking for Maker game assets in a bound project.
|
|
104
106
|
|
|
105
107
|
## Project Detection
|
|
106
108
|
|
|
@@ -141,8 +143,8 @@ directory.
|
|
|
141
143
|
### Proxy Tools Missing From The Current Session
|
|
142
144
|
|
|
143
145
|
If the user is in a bound Maker project but `generate_image`, `batch_generate_images`, `edit_image`,
|
|
144
|
-
`create_video_task`, or `
|
|
145
|
-
cwd before suggesting repeated restarts:
|
|
146
|
+
`create_video_task`, `text_to_music`, `create_3d_model_task`, or `query_3d_model_task` are missing
|
|
147
|
+
from the current AI tool list, diagnose the MCP cwd before suggesting repeated restarts:
|
|
146
148
|
|
|
147
149
|
1. Read `maker://status` or call `maker_status_lite` without `target_dir` to see the MCP server cwd.
|
|
148
150
|
2. If the user provides or the client exposes the real Maker project directory, call
|
|
@@ -190,8 +192,12 @@ Workflow:
|
|
|
190
192
|
login/project clone/MCP config, then guide the user to retry `taptap-maker python setup` with
|
|
191
193
|
the current AI or install Python 3.12 manually and run `taptap-maker python doctor`.
|
|
192
194
|
5. Run `taptap-maker init` in the user's intended Maker directory. The CLI will request PAT if
|
|
193
|
-
missing, fetch TapTap token, show a paged app preview, ask the user to choose
|
|
194
|
-
|
|
195
|
+
missing, fetch TapTap token, show a paged app preview, ask the user to choose or create a Maker
|
|
196
|
+
project, clone the Maker project, prepare the AI dev kit, and install/verify MCP config.
|
|
197
|
+
The app preview always includes `0. Create a new Maker project` at the bottom. This row must
|
|
198
|
+
remain visible when an AI summarizes or truncates a long app list. Users can choose `0`/`new`
|
|
199
|
+
and enter a project name, or use `taptap-maker init --create --name "my-local-game"` for
|
|
200
|
+
non-interactive runs.
|
|
195
201
|
The generated MCP config pins the selected Maker project directory as `cwd` when the target
|
|
196
202
|
client supports it. If a user manually reinstalls MCP config later, prefer
|
|
197
203
|
`taptap-maker mcp install --target-dir <PROJECT_DIR>`.
|
|
@@ -287,7 +293,8 @@ a Maker project, or when the user explicitly asks to switch or re-clone.
|
|
|
287
293
|
|
|
288
294
|
If the current directory is already bound, app lists from `taptap-maker apps` are reference only.
|
|
289
295
|
Continue operating on the current bound project. When the user explicitly requests a different
|
|
290
|
-
project
|
|
296
|
+
project or wants to create a new project, require a new independent directory before starting the
|
|
297
|
+
project selection or creation flow.
|
|
291
298
|
|
|
292
299
|
When app selection is needed, show the returned app preview and total count, then ask the user to
|
|
293
300
|
choose by index, app id, or name. The default preview shows the 40 most recently active apps.
|
|
@@ -296,17 +303,21 @@ full list, or run `taptap-maker apps --all` for a one-shot human-readable dump;
|
|
|
296
303
|
`taptap-maker apps --json` only when AI / scripts need the machine-readable list. If the
|
|
297
304
|
chat/client width is enough, you may present the preview as a compact two-column layout;
|
|
298
305
|
otherwise keep a single column. Keep app_id visible in every app row, and include the preview
|
|
299
|
-
details instead of only a summary such as "40 apps are available".
|
|
306
|
+
details instead of only a summary such as "40 apps are available". Always preserve the final
|
|
307
|
+
`0. Create a new Maker project` row, because it is the supported creation entry even when the app
|
|
308
|
+
preview is cropped.
|
|
300
309
|
|
|
301
310
|
Selection confirmation:
|
|
302
311
|
|
|
303
312
|
- Ask the user to choose by index, app id, or name.
|
|
313
|
+
- If the user wants a new project, tell them to choose `0`/`new` in `taptap-maker init` and enter a
|
|
314
|
+
project name; do not invent a project name unless the user explicitly asks the AI to name it.
|
|
304
315
|
- Treat the user's explicit reply as the selected app.
|
|
305
316
|
- If there is only one app, still ask for confirmation before selecting it.
|
|
306
317
|
|
|
307
|
-
After the user chooses, route the next action to `taptap-maker init` so the
|
|
308
|
-
workflow can continue
|
|
309
|
-
through the supported CLI option.
|
|
318
|
+
After the user chooses or creates a project, route the next action to `taptap-maker init` so the
|
|
319
|
+
Maker initialization workflow can continue. For non-interactive CLI runs, pass the selected app id
|
|
320
|
+
through the supported CLI option, or use `--create --name <NAME>` for creation.
|
|
310
321
|
|
|
311
322
|
## Working Directory Compliance Check
|
|
312
323
|
|
|
@@ -320,6 +331,8 @@ After `taptap-maker doctor`, decide whether the directory is suitable for clone:
|
|
|
320
331
|
|
|
321
332
|
- If the directory is already bound to a Maker project, do not clone again unless the user
|
|
322
333
|
explicitly asks to switch or re-clone.
|
|
334
|
+
- If the directory is already bound to a Maker project and the user wants a new project, stop and
|
|
335
|
+
require a new independent directory; do not create a new Maker project into the existing binding.
|
|
323
336
|
- If Git is missing, stop and tell the user to install Git first.
|
|
324
337
|
- If `Maker Git directory` reports `inside_parent_git_repo` or `target_is_git_root: no` with an
|
|
325
338
|
outer `git_root`, explain that the directory is under another Git repository. Recommend a
|