wp-typia 0.24.11 → 0.24.13
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/dist/cli.js +168 -84
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -21,7 +21,7 @@ var package_default;
|
|
|
21
21
|
var init_package = __esm(() => {
|
|
22
22
|
package_default = {
|
|
23
23
|
name: "wp-typia",
|
|
24
|
-
version: "0.24.
|
|
24
|
+
version: "0.24.13",
|
|
25
25
|
description: "Canonical CLI package for wp-typia scaffolding and project workflows",
|
|
26
26
|
packageManager: "bun@1.3.11",
|
|
27
27
|
type: "module",
|
|
@@ -77,7 +77,7 @@ var init_package = __esm(() => {
|
|
|
77
77
|
dependencies: {
|
|
78
78
|
"@gunshi/plugin-completion": "0.32.0",
|
|
79
79
|
"@wp-typia/api-client": "^0.4.6",
|
|
80
|
-
"@wp-typia/project-tools": "0.24.
|
|
80
|
+
"@wp-typia/project-tools": "0.24.11",
|
|
81
81
|
gunshi: "0.32.0",
|
|
82
82
|
zod: "4.3.6"
|
|
83
83
|
},
|
|
@@ -98,6 +98,104 @@ function formatAddKindUsagePlaceholder() {
|
|
|
98
98
|
}
|
|
99
99
|
var init_add_kind_ids = () => {};
|
|
100
100
|
|
|
101
|
+
// src/ai-agent-detection.ts
|
|
102
|
+
function detectAIAgents(env = process.env, agents = AI_AGENT_DEFINITIONS) {
|
|
103
|
+
const aiAgents = [];
|
|
104
|
+
const aiAgentEnvVars = [];
|
|
105
|
+
for (const agent of agents) {
|
|
106
|
+
if (!agent.detect(env)) {
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
aiAgents.push(agent.name);
|
|
110
|
+
aiAgentEnvVars.push(...agent.envVars.filter((envVar) => Boolean(env[envVar])));
|
|
111
|
+
}
|
|
112
|
+
return {
|
|
113
|
+
aiAgentEnvVars,
|
|
114
|
+
aiAgents,
|
|
115
|
+
isAIAgent: aiAgents.length > 0
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
var AI_AGENT_DEFINITIONS;
|
|
119
|
+
var init_ai_agent_detection = __esm(() => {
|
|
120
|
+
AI_AGENT_DEFINITIONS = [
|
|
121
|
+
{
|
|
122
|
+
detect: (env) => Boolean(env.CLAUDECODE) || Boolean(env.CLAUDE_CODE),
|
|
123
|
+
envVars: ["CLAUDECODE", "CLAUDE_CODE"],
|
|
124
|
+
name: "claude"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
detect: (env) => Boolean(env.CURSOR_AGENT),
|
|
128
|
+
envVars: ["CURSOR_AGENT"],
|
|
129
|
+
name: "cursor"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
detect: (env) => Boolean(env.CODEX_CI) || Boolean(env.CODEX_THREAD_ID) || Boolean(env.CODEX_SANDBOX),
|
|
133
|
+
envVars: ["CODEX_CI", "CODEX_THREAD_ID", "CODEX_SANDBOX"],
|
|
134
|
+
name: "codex"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
detect: (env) => Boolean(env.AMP_CURRENT_THREAD_ID) || env.AGENT === "amp",
|
|
138
|
+
envVars: ["AMP_CURRENT_THREAD_ID", "AGENT"],
|
|
139
|
+
name: "amp"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
detect: (env) => Boolean(env.GEMINI_CLI),
|
|
143
|
+
envVars: ["GEMINI_CLI"],
|
|
144
|
+
name: "gemini"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
detect: (env) => env.OPENCODE === "1",
|
|
148
|
+
envVars: ["OPENCODE"],
|
|
149
|
+
name: "opencode"
|
|
150
|
+
}
|
|
151
|
+
];
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
// src/structured-output-notices.ts
|
|
155
|
+
function getExplicitFormat(argv) {
|
|
156
|
+
for (let index = 0;index < argv.length; index += 1) {
|
|
157
|
+
const arg = argv[index];
|
|
158
|
+
if (!arg) {
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
if (arg === "--") {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
if (arg === "--format") {
|
|
165
|
+
const next = argv[index + 1];
|
|
166
|
+
return next && !next.startsWith("-") ? next : undefined;
|
|
167
|
+
}
|
|
168
|
+
if (arg.startsWith("--format=")) {
|
|
169
|
+
return arg.slice("--format=".length) || undefined;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
function createAIAgentStructuredOutputNotice(detection) {
|
|
175
|
+
if (!detection.isAIAgent) {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
const agentLabel = detection.aiAgents.length > 0 ? detection.aiAgents.join(", ") : "AI agent";
|
|
179
|
+
const envLabel = detection.aiAgentEnvVars.length > 0 ? ` via ${detection.aiAgentEnvVars.join(", ")}` : "";
|
|
180
|
+
return `Detected ${agentLabel}${envLabel}; defaulting to --format json. Pass --format text for human-readable output.`;
|
|
181
|
+
}
|
|
182
|
+
function getStructuredOutputNoticesForArgv(argv) {
|
|
183
|
+
if (getExplicitFormat(argv) !== undefined) {
|
|
184
|
+
return [];
|
|
185
|
+
}
|
|
186
|
+
const notice = createAIAgentStructuredOutputNotice(detectAIAgents());
|
|
187
|
+
return notice ? [notice] : [];
|
|
188
|
+
}
|
|
189
|
+
function withStructuredOutputNotices(payload, notices) {
|
|
190
|
+
return notices && notices.length > 0 ? {
|
|
191
|
+
...payload,
|
|
192
|
+
notices: [...notices]
|
|
193
|
+
} : payload;
|
|
194
|
+
}
|
|
195
|
+
var init_structured_output_notices = __esm(() => {
|
|
196
|
+
init_ai_agent_detection();
|
|
197
|
+
});
|
|
198
|
+
|
|
101
199
|
// src/print-block.ts
|
|
102
200
|
function printBlock(printLine, lines) {
|
|
103
201
|
for (const line of lines) {
|
|
@@ -2845,6 +2943,7 @@ async function dispatchPortableCliAdd({
|
|
|
2845
2943
|
mergedFlags,
|
|
2846
2944
|
positionals,
|
|
2847
2945
|
printLine,
|
|
2946
|
+
structuredNotices,
|
|
2848
2947
|
warnLine
|
|
2849
2948
|
}) {
|
|
2850
2949
|
const kind = positionals[1];
|
|
@@ -2870,12 +2969,12 @@ async function dispatchPortableCliAdd({
|
|
|
2870
2969
|
error
|
|
2871
2970
|
});
|
|
2872
2971
|
}
|
|
2873
|
-
printLine(JSON.stringify(buildStructuredCompletionSuccessPayload("add", completion, {
|
|
2972
|
+
printLine(JSON.stringify(withStructuredOutputNotices(buildStructuredCompletionSuccessPayload("add", completion, {
|
|
2874
2973
|
dryRun: Boolean(mergedFlags["dry-run"]),
|
|
2875
2974
|
kind,
|
|
2876
2975
|
name,
|
|
2877
2976
|
projectDir: extractCompletionProjectDir(completion) ?? cwd
|
|
2878
|
-
}), null, 2));
|
|
2977
|
+
}), structuredNotices), null, 2));
|
|
2879
2978
|
return;
|
|
2880
2979
|
}
|
|
2881
2980
|
await executeAddCommand({
|
|
@@ -2892,6 +2991,7 @@ async function dispatchPortableCliAdd({
|
|
|
2892
2991
|
var init_add2 = __esm(() => {
|
|
2893
2992
|
init_runtime_bridge();
|
|
2894
2993
|
init_runtime_bridge_output();
|
|
2994
|
+
init_structured_output_notices();
|
|
2895
2995
|
});
|
|
2896
2996
|
|
|
2897
2997
|
// src/portable-cli/dispatchers/create.ts
|
|
@@ -2908,6 +3008,7 @@ async function dispatchPortableCliCreate({
|
|
|
2908
3008
|
mergedFlags,
|
|
2909
3009
|
positionals,
|
|
2910
3010
|
printLine,
|
|
3011
|
+
structuredNotices,
|
|
2911
3012
|
warnLine
|
|
2912
3013
|
}) {
|
|
2913
3014
|
const projectDir = positionals[1];
|
|
@@ -2936,17 +3037,18 @@ async function dispatchPortableCliCreate({
|
|
|
2936
3037
|
});
|
|
2937
3038
|
}
|
|
2938
3039
|
if (mergedFlags.format === "json") {
|
|
2939
|
-
printLine(JSON.stringify(buildStructuredCompletionSuccessPayload("create", completion, {
|
|
3040
|
+
printLine(JSON.stringify(withStructuredOutputNotices(buildStructuredCompletionSuccessPayload("create", completion, {
|
|
2940
3041
|
dryRun: Boolean(mergedFlags["dry-run"]),
|
|
2941
3042
|
projectDir: extractCompletionProjectDir(completion) ?? projectDir,
|
|
2942
3043
|
template: typeof mergedFlags.template === "string" ? mergedFlags.template : undefined
|
|
2943
|
-
}), null, 2));
|
|
3044
|
+
}), structuredNotices), null, 2));
|
|
2944
3045
|
}
|
|
2945
3046
|
}
|
|
2946
3047
|
var init_create2 = __esm(() => {
|
|
2947
3048
|
init_runtime_bridge();
|
|
2948
3049
|
init_runtime_bridge_output();
|
|
2949
3050
|
init_cli_error_messages();
|
|
3051
|
+
init_structured_output_notices();
|
|
2950
3052
|
});
|
|
2951
3053
|
|
|
2952
3054
|
// src/portable-cli/doctor.ts
|
|
@@ -2958,7 +3060,7 @@ import {
|
|
|
2958
3060
|
CLI_DIAGNOSTIC_CODES as CLI_DIAGNOSTIC_CODES19,
|
|
2959
3061
|
createCliCommandError as createCliCommandError8
|
|
2960
3062
|
} from "@wp-typia/project-tools/cli-diagnostics";
|
|
2961
|
-
async function renderPortableCliDoctorJson(cwd, exitPolicy, wordpressVersionCheck, printLine) {
|
|
3063
|
+
async function renderPortableCliDoctorJson(cwd, exitPolicy, wordpressVersionCheck, printLine, structuredNotices) {
|
|
2962
3064
|
const {
|
|
2963
3065
|
createDoctorRunSummary,
|
|
2964
3066
|
getDoctorChecks,
|
|
@@ -2966,10 +3068,7 @@ async function renderPortableCliDoctorJson(cwd, exitPolicy, wordpressVersionChec
|
|
|
2966
3068
|
} = await import("@wp-typia/project-tools/cli-doctor");
|
|
2967
3069
|
const checks = await getDoctorChecks(cwd, { wordpressVersionCheck });
|
|
2968
3070
|
const summary = createDoctorRunSummary(checks, { exitPolicy });
|
|
2969
|
-
printLine(JSON.stringify({
|
|
2970
|
-
checks,
|
|
2971
|
-
summary
|
|
2972
|
-
}, null, 2));
|
|
3071
|
+
printLine(JSON.stringify(withStructuredOutputNotices({ checks, summary }, structuredNotices), null, 2));
|
|
2973
3072
|
if (summary.exitCode === 1) {
|
|
2974
3073
|
throw createCliCommandError8({
|
|
2975
3074
|
code: CLI_DIAGNOSTIC_CODES19.DOCTOR_CHECK_FAILED,
|
|
@@ -2982,18 +3081,20 @@ async function renderPortableCliDoctorJson(cwd, exitPolicy, wordpressVersionChec
|
|
|
2982
3081
|
async function dispatchPortableCliDoctor({
|
|
2983
3082
|
cwd,
|
|
2984
3083
|
mergedFlags,
|
|
2985
|
-
printLine
|
|
3084
|
+
printLine,
|
|
3085
|
+
structuredNotices
|
|
2986
3086
|
}) {
|
|
2987
3087
|
const exitPolicy = mergedFlags["workspace-only"] ? "workspace-only" : "strict";
|
|
2988
3088
|
const wordpressVersionCheck = Boolean(mergedFlags["wp-version-check"]);
|
|
2989
3089
|
if (mergedFlags.format === "json") {
|
|
2990
|
-
await renderPortableCliDoctorJson(cwd, exitPolicy, wordpressVersionCheck, printLine);
|
|
3090
|
+
await renderPortableCliDoctorJson(cwd, exitPolicy, wordpressVersionCheck, printLine, structuredNotices);
|
|
2991
3091
|
return;
|
|
2992
3092
|
}
|
|
2993
3093
|
await executeDoctorCommand(cwd, { exitPolicy, wordpressVersionCheck });
|
|
2994
3094
|
}
|
|
2995
3095
|
var init_doctor = __esm(() => {
|
|
2996
3096
|
init_runtime_bridge();
|
|
3097
|
+
init_structured_output_notices();
|
|
2997
3098
|
});
|
|
2998
3099
|
|
|
2999
3100
|
// src/portable-cli/templates.ts
|
|
@@ -3009,11 +3110,11 @@ import {
|
|
|
3009
3110
|
getTemplateById,
|
|
3010
3111
|
listTemplates
|
|
3011
3112
|
} from "@wp-typia/project-tools/cli-templates";
|
|
3012
|
-
function renderPortableCliTemplatesJson(printLine, flags, subcommand) {
|
|
3113
|
+
function renderPortableCliTemplatesJson(printLine, flags, subcommand, structuredNotices) {
|
|
3013
3114
|
if (subcommand === "list") {
|
|
3014
|
-
printLine(JSON.stringify({
|
|
3115
|
+
printLine(JSON.stringify(withStructuredOutputNotices({
|
|
3015
3116
|
templates: listTemplates()
|
|
3016
|
-
}, null, 2));
|
|
3117
|
+
}, structuredNotices), null, 2));
|
|
3017
3118
|
return;
|
|
3018
3119
|
}
|
|
3019
3120
|
const templateId = flags.id;
|
|
@@ -3032,14 +3133,13 @@ function renderPortableCliTemplatesJson(printLine, flags, subcommand) {
|
|
|
3032
3133
|
detailLines: [`Unknown template "${templateId}".`]
|
|
3033
3134
|
});
|
|
3034
3135
|
}
|
|
3035
|
-
printLine(JSON.stringify({
|
|
3036
|
-
template
|
|
3037
|
-
}, null, 2));
|
|
3136
|
+
printLine(JSON.stringify(withStructuredOutputNotices({ template }, structuredNotices), null, 2));
|
|
3038
3137
|
}
|
|
3039
3138
|
async function dispatchPortableCliTemplates({
|
|
3040
3139
|
mergedFlags,
|
|
3041
3140
|
positionals,
|
|
3042
|
-
printLine
|
|
3141
|
+
printLine,
|
|
3142
|
+
structuredNotices
|
|
3043
3143
|
}) {
|
|
3044
3144
|
const subcommand = positionals[1];
|
|
3045
3145
|
const templateId = typeof mergedFlags.id === "string" ? mergedFlags.id : positionals[2];
|
|
@@ -3057,7 +3157,7 @@ async function dispatchPortableCliTemplates({
|
|
|
3057
3157
|
renderPortableCliTemplatesJson(printLine, {
|
|
3058
3158
|
format: mergedFlags.format,
|
|
3059
3159
|
id: templateId
|
|
3060
|
-
}, resolvedSubcommand);
|
|
3160
|
+
}, resolvedSubcommand, structuredNotices);
|
|
3061
3161
|
return;
|
|
3062
3162
|
}
|
|
3063
3163
|
await executeTemplatesCommand({
|
|
@@ -3069,6 +3169,7 @@ async function dispatchPortableCliTemplates({
|
|
|
3069
3169
|
}
|
|
3070
3170
|
var init_templates = __esm(() => {
|
|
3071
3171
|
init_runtime_bridge();
|
|
3172
|
+
init_structured_output_notices();
|
|
3072
3173
|
});
|
|
3073
3174
|
|
|
3074
3175
|
// src/gunshi-cli.ts
|
|
@@ -3213,61 +3314,12 @@ import {
|
|
|
3213
3314
|
} from "@wp-typia/project-tools/cli-diagnostics";
|
|
3214
3315
|
|
|
3215
3316
|
// src/cli-diagnostic-output.ts
|
|
3317
|
+
init_ai_agent_detection();
|
|
3216
3318
|
import {
|
|
3217
3319
|
createCliCommandError as createCliCommandError2,
|
|
3218
3320
|
serializeCliDiagnosticError
|
|
3219
3321
|
} from "@wp-typia/project-tools/cli-diagnostics";
|
|
3220
3322
|
|
|
3221
|
-
// src/ai-agent-detection.ts
|
|
3222
|
-
var AI_AGENT_DEFINITIONS = [
|
|
3223
|
-
{
|
|
3224
|
-
detect: (env) => Boolean(env.CLAUDECODE) || Boolean(env.CLAUDE_CODE),
|
|
3225
|
-
envVars: ["CLAUDECODE", "CLAUDE_CODE"],
|
|
3226
|
-
name: "claude"
|
|
3227
|
-
},
|
|
3228
|
-
{
|
|
3229
|
-
detect: (env) => Boolean(env.CURSOR_AGENT),
|
|
3230
|
-
envVars: ["CURSOR_AGENT"],
|
|
3231
|
-
name: "cursor"
|
|
3232
|
-
},
|
|
3233
|
-
{
|
|
3234
|
-
detect: (env) => Boolean(env.CODEX_CI) || Boolean(env.CODEX_THREAD_ID) || Boolean(env.CODEX_SANDBOX),
|
|
3235
|
-
envVars: ["CODEX_CI", "CODEX_THREAD_ID", "CODEX_SANDBOX"],
|
|
3236
|
-
name: "codex"
|
|
3237
|
-
},
|
|
3238
|
-
{
|
|
3239
|
-
detect: (env) => Boolean(env.AMP_CURRENT_THREAD_ID) || env.AGENT === "amp",
|
|
3240
|
-
envVars: ["AMP_CURRENT_THREAD_ID", "AGENT"],
|
|
3241
|
-
name: "amp"
|
|
3242
|
-
},
|
|
3243
|
-
{
|
|
3244
|
-
detect: (env) => Boolean(env.GEMINI_CLI),
|
|
3245
|
-
envVars: ["GEMINI_CLI"],
|
|
3246
|
-
name: "gemini"
|
|
3247
|
-
},
|
|
3248
|
-
{
|
|
3249
|
-
detect: (env) => env.OPENCODE === "1",
|
|
3250
|
-
envVars: ["OPENCODE"],
|
|
3251
|
-
name: "opencode"
|
|
3252
|
-
}
|
|
3253
|
-
];
|
|
3254
|
-
function detectAIAgents(env = process.env, agents = AI_AGENT_DEFINITIONS) {
|
|
3255
|
-
const aiAgents = [];
|
|
3256
|
-
const aiAgentEnvVars = [];
|
|
3257
|
-
for (const agent of agents) {
|
|
3258
|
-
if (!agent.detect(env)) {
|
|
3259
|
-
continue;
|
|
3260
|
-
}
|
|
3261
|
-
aiAgents.push(agent.name);
|
|
3262
|
-
aiAgentEnvVars.push(...agent.envVars.filter((envVar) => Boolean(env[envVar])));
|
|
3263
|
-
}
|
|
3264
|
-
return {
|
|
3265
|
-
aiAgentEnvVars,
|
|
3266
|
-
aiAgents,
|
|
3267
|
-
isAIAgent: aiAgents.length > 0
|
|
3268
|
-
};
|
|
3269
|
-
}
|
|
3270
|
-
|
|
3271
3323
|
// bin/argv-walker.js
|
|
3272
3324
|
function normalizeOptionSet(values) {
|
|
3273
3325
|
return values instanceof Set ? values : new Set(values);
|
|
@@ -3320,6 +3372,12 @@ import {
|
|
|
3320
3372
|
} from "@wp-typia/project-tools/cli-diagnostics";
|
|
3321
3373
|
|
|
3322
3374
|
// src/command-options/add.ts
|
|
3375
|
+
var ADD_BLOCK_TEMPLATE_CHOICES = [
|
|
3376
|
+
"basic",
|
|
3377
|
+
"interactivity",
|
|
3378
|
+
"persistence",
|
|
3379
|
+
"compound"
|
|
3380
|
+
];
|
|
3323
3381
|
var ADD_OPTION_METADATA = {
|
|
3324
3382
|
"alternate-render-targets": {
|
|
3325
3383
|
description: "Comma-separated alternate render targets for dynamic block scaffolds (email,mjml,plain-text).",
|
|
@@ -3497,7 +3555,9 @@ var ADD_OPTION_METADATA = {
|
|
|
3497
3555
|
type: "string"
|
|
3498
3556
|
},
|
|
3499
3557
|
template: {
|
|
3500
|
-
|
|
3558
|
+
choices: ADD_BLOCK_TEMPLATE_CHOICES,
|
|
3559
|
+
defaultValue: "basic",
|
|
3560
|
+
description: "Built-in block family for add block; interactive runs prompt when omitted.",
|
|
3501
3561
|
short: "t",
|
|
3502
3562
|
type: "string"
|
|
3503
3563
|
},
|
|
@@ -3535,6 +3595,14 @@ var ADD_OPTION_METADATA = {
|
|
|
3535
3595
|
}
|
|
3536
3596
|
};
|
|
3537
3597
|
// src/command-options/create.ts
|
|
3598
|
+
var CREATE_TEMPLATE_CHOICES = [
|
|
3599
|
+
"basic",
|
|
3600
|
+
"interactivity",
|
|
3601
|
+
"persistence",
|
|
3602
|
+
"compound",
|
|
3603
|
+
"query-loop",
|
|
3604
|
+
"workspace"
|
|
3605
|
+
];
|
|
3538
3606
|
var CREATE_OPTION_METADATA = {
|
|
3539
3607
|
"alternate-render-targets": {
|
|
3540
3608
|
description: "Comma-separated alternate render targets for dynamic block scaffolds (email,mjml,plain-text).",
|
|
@@ -3592,7 +3660,9 @@ var CREATE_OPTION_METADATA = {
|
|
|
3592
3660
|
type: "string"
|
|
3593
3661
|
},
|
|
3594
3662
|
template: {
|
|
3595
|
-
|
|
3663
|
+
choices: CREATE_TEMPLATE_CHOICES,
|
|
3664
|
+
defaultValue: "basic",
|
|
3665
|
+
description: "Template id, external template package, local path, or GitHub locator.",
|
|
3596
3666
|
short: "t",
|
|
3597
3667
|
type: "string"
|
|
3598
3668
|
},
|
|
@@ -3793,7 +3863,12 @@ function formatPortableCliOptionHelp(metadata) {
|
|
|
3793
3863
|
return Object.entries(metadata).filter(([, option]) => !option.hidden).map(([name, option]) => {
|
|
3794
3864
|
const valueLabel = option.type === "string" ? " <value>" : "";
|
|
3795
3865
|
const short = option.short ? `, -${option.short}${valueLabel}` : "";
|
|
3796
|
-
|
|
3866
|
+
const details = [
|
|
3867
|
+
option.description,
|
|
3868
|
+
option.choices && option.choices.length > 0 ? `Choices: ${option.choices.join(", ")}.` : undefined,
|
|
3869
|
+
option.defaultValue !== undefined ? `Default: ${option.defaultValue}.` : undefined
|
|
3870
|
+
].filter((value) => Boolean(value));
|
|
3871
|
+
return `- --${name}${valueLabel}${short}: ${details.join(" ")}`;
|
|
3797
3872
|
});
|
|
3798
3873
|
}
|
|
3799
3874
|
function buildCommandOptionParser(...metadataMaps) {
|
|
@@ -4086,6 +4161,7 @@ function validateCliOutputFormatArgv(argv) {
|
|
|
4086
4161
|
}
|
|
4087
4162
|
|
|
4088
4163
|
// src/cli-diagnostic-output.ts
|
|
4164
|
+
init_structured_output_notices();
|
|
4089
4165
|
function prefersStructuredCliArgv(argv) {
|
|
4090
4166
|
let explicitFormat;
|
|
4091
4167
|
for (let index = 0;index < argv.length; index += 1) {
|
|
@@ -4341,6 +4417,9 @@ function normalizeWpTypiaArgv(argv) {
|
|
|
4341
4417
|
return normalizedArgv;
|
|
4342
4418
|
}
|
|
4343
4419
|
|
|
4420
|
+
// src/portable-cli/errors.ts
|
|
4421
|
+
init_structured_output_notices();
|
|
4422
|
+
|
|
4344
4423
|
// src/portable-cli/help.ts
|
|
4345
4424
|
init_package();
|
|
4346
4425
|
init_add_kind_ids();
|
|
@@ -4494,10 +4573,10 @@ async function handlePortableCliEntrypointError(error, argv) {
|
|
|
4494
4573
|
command: resolveCanonicalCommandContext(argv),
|
|
4495
4574
|
error
|
|
4496
4575
|
});
|
|
4497
|
-
process.stderr.write(`${JSON.stringify({
|
|
4576
|
+
process.stderr.write(`${JSON.stringify(withStructuredOutputNotices({
|
|
4498
4577
|
ok: false,
|
|
4499
4578
|
error: serializeCliDiagnosticError2(diagnostic)
|
|
4500
|
-
}, null, 2)}
|
|
4579
|
+
}, getStructuredOutputNoticesForArgv(argv)), null, 2)}
|
|
4501
4580
|
`);
|
|
4502
4581
|
process.exitCode = 1;
|
|
4503
4582
|
return;
|
|
@@ -4515,6 +4594,7 @@ import {
|
|
|
4515
4594
|
CLI_DIAGNOSTIC_CODES as CLI_DIAGNOSTIC_CODES21,
|
|
4516
4595
|
createCliCommandError as createCliCommandError10
|
|
4517
4596
|
} from "@wp-typia/project-tools/cli-diagnostics";
|
|
4597
|
+
init_ai_agent_detection();
|
|
4518
4598
|
|
|
4519
4599
|
// src/completions.ts
|
|
4520
4600
|
import {
|
|
@@ -5590,6 +5670,7 @@ function renderPortableCliVersion(printLine, options = {}) {
|
|
|
5590
5670
|
}
|
|
5591
5671
|
|
|
5592
5672
|
// src/node-cli.ts
|
|
5673
|
+
init_structured_output_notices();
|
|
5593
5674
|
var PORTABLE_CLI_OPTION_PARSER = buildCommandOptionParser(ALL_COMMAND_OPTION_METADATA);
|
|
5594
5675
|
var PORTABLE_CLI_BOOLEAN_OPTION_NAMES = ["help", "version"];
|
|
5595
5676
|
var printLine = (line) => {
|
|
@@ -5687,14 +5768,15 @@ async function dispatchPortableCliSkills({
|
|
|
5687
5768
|
cwd,
|
|
5688
5769
|
mergedFlags,
|
|
5689
5770
|
positionals,
|
|
5690
|
-
printLine: printLine2
|
|
5771
|
+
printLine: printLine2,
|
|
5772
|
+
structuredNotices
|
|
5691
5773
|
}) {
|
|
5692
5774
|
const subcommand = positionals[1] ?? "list";
|
|
5693
5775
|
const structured = mergedFlags.format === "json";
|
|
5694
5776
|
if (subcommand === "list") {
|
|
5695
5777
|
const result = listSkills();
|
|
5696
5778
|
if (structured) {
|
|
5697
|
-
printLine2(JSON.stringify(result, null, 2));
|
|
5779
|
+
printLine2(JSON.stringify(withStructuredOutputNotices(result, structuredNotices), null, 2));
|
|
5698
5780
|
return;
|
|
5699
5781
|
}
|
|
5700
5782
|
if (result.agents.length === 0) {
|
|
@@ -5715,7 +5797,7 @@ async function dispatchPortableCliSkills({
|
|
|
5715
5797
|
global: mergedFlags.local ? false : true
|
|
5716
5798
|
});
|
|
5717
5799
|
if (structured) {
|
|
5718
|
-
printLine2(JSON.stringify(result, null, 2));
|
|
5800
|
+
printLine2(JSON.stringify(withStructuredOutputNotices(result, structuredNotices), null, 2));
|
|
5719
5801
|
return;
|
|
5720
5802
|
}
|
|
5721
5803
|
if (!result.updated) {
|
|
@@ -5753,6 +5835,7 @@ var PORTABLE_CLI_COMMAND_DISPATCHERS = {
|
|
|
5753
5835
|
mergedFlags,
|
|
5754
5836
|
positionals,
|
|
5755
5837
|
printLine: printLine2,
|
|
5838
|
+
structuredNotices,
|
|
5756
5839
|
warnLine: warnLine2
|
|
5757
5840
|
}) => {
|
|
5758
5841
|
const plan = await executeInitCommand({
|
|
@@ -5766,7 +5849,7 @@ var PORTABLE_CLI_COMMAND_DISPATCHERS = {
|
|
|
5766
5849
|
warnLine: warnLine2
|
|
5767
5850
|
});
|
|
5768
5851
|
if (mergedFlags.format === "json") {
|
|
5769
|
-
printLine2(JSON.stringify(buildStructuredInitSuccessPayload(plan), null, 2));
|
|
5852
|
+
printLine2(JSON.stringify(withStructuredOutputNotices(buildStructuredInitSuccessPayload(plan), structuredNotices), null, 2));
|
|
5770
5853
|
}
|
|
5771
5854
|
},
|
|
5772
5855
|
migrate: async ({
|
|
@@ -5787,6 +5870,7 @@ var PORTABLE_CLI_COMMAND_DISPATCHERS = {
|
|
|
5787
5870
|
mergedFlags,
|
|
5788
5871
|
positionals,
|
|
5789
5872
|
printLine: printLine2,
|
|
5873
|
+
structuredNotices,
|
|
5790
5874
|
warnLine: warnLine2
|
|
5791
5875
|
}) => {
|
|
5792
5876
|
try {
|
|
@@ -5799,9 +5883,7 @@ var PORTABLE_CLI_COMMAND_DISPATCHERS = {
|
|
|
5799
5883
|
target: syncTarget
|
|
5800
5884
|
});
|
|
5801
5885
|
if (mergedFlags.format === "json") {
|
|
5802
|
-
printLine2(JSON.stringify({
|
|
5803
|
-
sync
|
|
5804
|
-
}, null, 2));
|
|
5886
|
+
printLine2(JSON.stringify(withStructuredOutputNotices({ sync }, structuredNotices), null, 2));
|
|
5805
5887
|
return;
|
|
5806
5888
|
}
|
|
5807
5889
|
if (sync.dryRun) {
|
|
@@ -5847,6 +5929,7 @@ async function runNodeCli(argv = process.argv.slice(2)) {
|
|
|
5847
5929
|
const { argv: argvWithoutConfigOverride, configOverridePath } = extractWpTypiaConfigOverride(normalizedArgv);
|
|
5848
5930
|
validateCliOutputFormatArgv(argvWithoutConfigOverride);
|
|
5849
5931
|
const outputFormatArgv = normalizeCliOutputFormatArgv(argvWithoutConfigOverride);
|
|
5932
|
+
const structuredNotices = getStructuredOutputNoticesForArgv(argvWithoutConfigOverride);
|
|
5850
5933
|
const { argv: cliArgv, flags } = parseGlobalFlags(outputFormatArgv);
|
|
5851
5934
|
const { flags: commandFlags, positionals } = parseArgv(cliArgv);
|
|
5852
5935
|
const aiDetection = detectAIAgents();
|
|
@@ -5901,6 +5984,7 @@ async function runNodeCli(argv = process.argv.slice(2)) {
|
|
|
5901
5984
|
mergedFlags,
|
|
5902
5985
|
positionals,
|
|
5903
5986
|
printLine,
|
|
5987
|
+
structuredNotices,
|
|
5904
5988
|
warnLine
|
|
5905
5989
|
});
|
|
5906
5990
|
return;
|
|
@@ -6009,4 +6093,4 @@ export {
|
|
|
6009
6093
|
runGunshiCli
|
|
6010
6094
|
};
|
|
6011
6095
|
|
|
6012
|
-
//# debugId=
|
|
6096
|
+
//# debugId=9C1AF3EFBE8B9E3464756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wp-typia",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.13",
|
|
4
4
|
"description": "Canonical CLI package for wp-typia scaffolding and project workflows",
|
|
5
5
|
"packageManager": "bun@1.3.11",
|
|
6
6
|
"type": "module",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@gunshi/plugin-completion": "0.32.0",
|
|
58
58
|
"@wp-typia/api-client": "^0.4.6",
|
|
59
|
-
"@wp-typia/project-tools": "0.24.
|
|
59
|
+
"@wp-typia/project-tools": "0.24.11",
|
|
60
60
|
"gunshi": "0.32.0",
|
|
61
61
|
"zod": "4.3.6"
|
|
62
62
|
},
|