toolcraft 0.0.53 → 0.0.54
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 +26 -1
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -887,6 +887,31 @@ function describeHelpValueToken(schema, field) {
|
|
|
887
887
|
}
|
|
888
888
|
return describeFieldNameValueToken(field.displayPath, field.optionFlag) ?? "value";
|
|
889
889
|
}
|
|
890
|
+
function formatCompactEnumSignatureToken(schema) {
|
|
891
|
+
if (schema.kind !== "enum" || schema.values.length < 2 || schema.values.length > 3) {
|
|
892
|
+
return undefined;
|
|
893
|
+
}
|
|
894
|
+
const tokens = schema.values.map((value) => String(value));
|
|
895
|
+
const compact = tokens.every((token) => token.length > 0 &&
|
|
896
|
+
token.length <= 24 &&
|
|
897
|
+
token.trim() === token &&
|
|
898
|
+
!token.includes("|") &&
|
|
899
|
+
!token.includes("\t") &&
|
|
900
|
+
!token.includes("\n") &&
|
|
901
|
+
!token.includes("\r") &&
|
|
902
|
+
!token.includes(" "));
|
|
903
|
+
return compact ? tokens.join("|") : undefined;
|
|
904
|
+
}
|
|
905
|
+
function formatCommandParameterFieldFlags(field, globalLongOptionFlags) {
|
|
906
|
+
if (field.positionalIndex !== undefined || field.schema.kind === "boolean") {
|
|
907
|
+
return formatHelpFieldFlags(field, globalLongOptionFlags);
|
|
908
|
+
}
|
|
909
|
+
const enumToken = formatCompactEnumSignatureToken(field.schema);
|
|
910
|
+
if (enumToken !== undefined) {
|
|
911
|
+
return `${formatOptionFlags(field, globalLongOptionFlags)} ${enumToken}`;
|
|
912
|
+
}
|
|
913
|
+
return formatHelpFieldFlags(field, globalLongOptionFlags);
|
|
914
|
+
}
|
|
890
915
|
function describeDynamicFieldType(field) {
|
|
891
916
|
if (field.schema.kind === "record") {
|
|
892
917
|
const valueSchema = unwrapOptional(field.schema.value);
|
|
@@ -1035,7 +1060,7 @@ function formatCommandParameterTokens(command, casing, globalLongOptionFlags) {
|
|
|
1035
1060
|
const fields = assignPositionals(collected.fields, command.positional);
|
|
1036
1061
|
return fields
|
|
1037
1062
|
.filter((field) => field.global !== true)
|
|
1038
|
-
.map((field) => wrapOptionalCommandParameterToken(
|
|
1063
|
+
.map((field) => wrapOptionalCommandParameterToken(formatCommandParameterFieldFlags(field, globalLongOptionFlags), field.positionalIndex === undefined && (field.optional || field.hasDefault)))
|
|
1039
1064
|
.concat(collected.dynamicFields.flatMap((field) => formatCommandDynamicParameterTokens(field, casing)));
|
|
1040
1065
|
}
|
|
1041
1066
|
function formatCommandRowName(node, casing, globalLongOptionFlags) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "toolcraft",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.54",
|
|
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.54",
|
|
51
51
|
"commander": "^14.0.3",
|
|
52
52
|
"fast-string-width": "^3.0.2",
|
|
53
53
|
"fast-wrap-ansi": "^0.2.0",
|