toolcraft 0.0.56 → 0.0.58
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.d.ts +1 -0
- package/dist/cli.js +13 -12
- package/package.json +2 -2
package/dist/cli.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export interface CLIControls {
|
|
|
13
13
|
export interface RunCLIOptions<TServices extends object = Record<string, unknown>> {
|
|
14
14
|
apiVersion?: string;
|
|
15
15
|
approvals?: boolean;
|
|
16
|
+
argv?: readonly string[];
|
|
16
17
|
casing?: Casing;
|
|
17
18
|
controls?: CLIControls;
|
|
18
19
|
fetch?: typeof globalThis.fetch;
|
package/dist/cli.js
CHANGED
|
@@ -3189,15 +3189,16 @@ function configureCommanderSuggestionOutput(command) {
|
|
|
3189
3189
|
}
|
|
3190
3190
|
export async function runCLI(roots, options = {}) {
|
|
3191
3191
|
enableSourceMaps();
|
|
3192
|
-
const
|
|
3192
|
+
const argv = [...(options.argv ?? process.argv)];
|
|
3193
|
+
const normalizedRoot = normalizeRoots(roots, argv);
|
|
3193
3194
|
const root = options.approvals === true ? mergeApprovalsGroup(normalizedRoot) : normalizedRoot;
|
|
3194
3195
|
await resolveMcpProxies(root, { projectRoot: options.projectRoot });
|
|
3195
3196
|
const casing = options.casing ?? "kebab";
|
|
3196
3197
|
const services = (options.services ?? {});
|
|
3197
3198
|
const runtimeOptions = options.humanInLoop ?? {};
|
|
3198
3199
|
const runtimeFetch = options.fetch ?? globalThis.fetch;
|
|
3199
|
-
const version = options.version ?? findEntrypointPackageMetadata(
|
|
3200
|
-
const rootUsageName = options.rootUsageName ?? inferProgramName(
|
|
3200
|
+
const version = options.version ?? findEntrypointPackageMetadata(argv[1])?.version;
|
|
3201
|
+
const rootUsageName = options.rootUsageName ?? inferProgramName(argv);
|
|
3201
3202
|
const controls = resolveCLIControls(options.controls);
|
|
3202
3203
|
const servicesWithBuiltIns = {
|
|
3203
3204
|
...services,
|
|
@@ -3208,8 +3209,8 @@ export async function runCLI(roots, options = {}) {
|
|
|
3208
3209
|
apiVersion: options.apiVersion
|
|
3209
3210
|
};
|
|
3210
3211
|
validateServices(services);
|
|
3211
|
-
if (hasHelpFlag(
|
|
3212
|
-
await renderGeneratedHelp(root,
|
|
3212
|
+
if (hasHelpFlag(argv)) {
|
|
3213
|
+
await renderGeneratedHelp(root, argv, { ...options, version });
|
|
3213
3214
|
return;
|
|
3214
3215
|
}
|
|
3215
3216
|
const program = new CommanderCommand();
|
|
@@ -3250,7 +3251,7 @@ export async function runCLI(roots, options = {}) {
|
|
|
3250
3251
|
addCommanderChild(program, command, isDefaultChild, rootChildNames);
|
|
3251
3252
|
}
|
|
3252
3253
|
configureCommanderSuggestionOutput(program);
|
|
3253
|
-
const unknownCommand = findUnknownCommanderCommand(program,
|
|
3254
|
+
const unknownCommand = findUnknownCommanderCommand(program, argv);
|
|
3254
3255
|
if (unknownCommand !== undefined) {
|
|
3255
3256
|
createLogger().error(appendUsagePointer(formatUnknownCommandMessage(unknownCommand.input, unknownCommand.currentCommand), {
|
|
3256
3257
|
rootUsageName,
|
|
@@ -3260,7 +3261,7 @@ export async function runCLI(roots, options = {}) {
|
|
|
3260
3261
|
return;
|
|
3261
3262
|
}
|
|
3262
3263
|
try {
|
|
3263
|
-
await program.parseAsync(
|
|
3264
|
+
await program.parseAsync(argv);
|
|
3264
3265
|
}
|
|
3265
3266
|
catch (error) {
|
|
3266
3267
|
if (error instanceof ApprovalDeclinedError) {
|
|
@@ -3269,7 +3270,7 @@ export async function runCLI(roots, options = {}) {
|
|
|
3269
3270
|
}
|
|
3270
3271
|
const resolvedFlags = lastActionCommand ? getResolvedFlags(lastActionCommand) : undefined;
|
|
3271
3272
|
const report = await writeErrorReport({
|
|
3272
|
-
argv
|
|
3273
|
+
argv,
|
|
3273
3274
|
command: errorReportContext?.command,
|
|
3274
3275
|
commandPath: errorReportContext?.commandPath ?? resolvedCommandPath,
|
|
3275
3276
|
env: process.env,
|
|
@@ -3286,13 +3287,13 @@ export async function runCLI(roots, options = {}) {
|
|
|
3286
3287
|
await handleRunError(error, {
|
|
3287
3288
|
debugStackMode: resolvedFlags !== undefined
|
|
3288
3289
|
? resolveDebugStackMode(resolvedFlags.debug)
|
|
3289
|
-
: getDebugStackModeFromArgv(
|
|
3290
|
+
: getDebugStackModeFromArgv(argv),
|
|
3290
3291
|
output: resolvedFlags !== undefined
|
|
3291
3292
|
? resolveOutput(resolvedFlags)
|
|
3292
|
-
: resolveOutputFromArgv(
|
|
3293
|
-
verbose: resolvedFlags ? Boolean(resolvedFlags.verbose) :
|
|
3293
|
+
: resolveOutputFromArgv(argv),
|
|
3294
|
+
verbose: resolvedFlags ? Boolean(resolvedFlags.verbose) : argv.includes("--verbose"),
|
|
3294
3295
|
program,
|
|
3295
|
-
argv
|
|
3296
|
+
argv,
|
|
3296
3297
|
rootUsageName,
|
|
3297
3298
|
commandPath: resolvedCommandPath,
|
|
3298
3299
|
userErrorPattern: errorReportContext?.params === undefined ? "usage" : "runtime-user"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "toolcraft",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.58",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"postpack": "node ../../scripts/manage-bundled-workspace-deps.mjs cleanup . toolcraft-design @poe-code/frontmatter @poe-code/agent-mcp-config @poe-code/agent-human-in-loop @poe-code/task-list @poe-code/agent-defs @poe-code/config-mutations @poe-code/process-runner tiny-mcp-client mcp-oauth auth-store"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"toolcraft-schema": "0.0.
|
|
50
|
+
"toolcraft-schema": "0.0.58",
|
|
51
51
|
"commander": "^14.0.3",
|
|
52
52
|
"fast-string-width": "^3.0.2",
|
|
53
53
|
"fast-wrap-ansi": "^0.2.0",
|