ferix-code 0.0.2-beta.15 → 0.0.2-beta.16
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/index.js +24 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -71,7 +71,7 @@ import { Command } from "commander";
|
|
|
71
71
|
// package.json
|
|
72
72
|
var package_default = {
|
|
73
73
|
name: "ferix-code",
|
|
74
|
-
version: "0.0.2-beta.
|
|
74
|
+
version: "0.0.2-beta.16",
|
|
75
75
|
description: "Composable RALPH loops for AI coding agents - v2 with Effect",
|
|
76
76
|
type: "module",
|
|
77
77
|
bin: {
|
|
@@ -1059,32 +1059,49 @@ init_esm_shims();
|
|
|
1059
1059
|
init_esm_shims();
|
|
1060
1060
|
import pc13 from "picocolors";
|
|
1061
1061
|
var brightWhite = (s) => pc13.bold(pc13.white(s));
|
|
1062
|
+
function normalizeToolName(tool) {
|
|
1063
|
+
return tool.toLowerCase();
|
|
1064
|
+
}
|
|
1065
|
+
function getInputValue(obj, key) {
|
|
1066
|
+
if (obj[key] !== void 0) {
|
|
1067
|
+
return obj[key];
|
|
1068
|
+
}
|
|
1069
|
+
const camelKey = key.replace(/_([a-z])/g, (_, c) => c.toUpperCase());
|
|
1070
|
+
if (obj[camelKey] !== void 0) {
|
|
1071
|
+
return obj[camelKey];
|
|
1072
|
+
}
|
|
1073
|
+
const snakeKey = key.replace(/([A-Z])/g, "_$1").toLowerCase();
|
|
1074
|
+
if (obj[snakeKey] !== void 0) {
|
|
1075
|
+
return obj[snakeKey];
|
|
1076
|
+
}
|
|
1077
|
+
return void 0;
|
|
1078
|
+
}
|
|
1062
1079
|
function createToolDisplayRegistry() {
|
|
1063
1080
|
const configs = /* @__PURE__ */ new Map();
|
|
1064
1081
|
const defaultColor = pc13.white;
|
|
1065
1082
|
return {
|
|
1066
1083
|
register(config) {
|
|
1067
|
-
configs.set(config.tool, config);
|
|
1084
|
+
configs.set(normalizeToolName(config.tool), config);
|
|
1068
1085
|
},
|
|
1069
1086
|
getInputKey(tool) {
|
|
1070
|
-
return configs.get(tool)?.inputKey;
|
|
1087
|
+
return configs.get(normalizeToolName(tool))?.inputKey;
|
|
1071
1088
|
},
|
|
1072
1089
|
getColor(tool) {
|
|
1073
|
-
return configs.get(tool)?.color ?? defaultColor;
|
|
1090
|
+
return configs.get(normalizeToolName(tool))?.color ?? defaultColor;
|
|
1074
1091
|
},
|
|
1075
1092
|
getMaxLength(tool) {
|
|
1076
|
-
return configs.get(tool)?.maxLength ?? MAX_TOOL_INPUT_LENGTH;
|
|
1093
|
+
return configs.get(normalizeToolName(tool))?.maxLength ?? MAX_TOOL_INPUT_LENGTH;
|
|
1077
1094
|
},
|
|
1078
1095
|
formatInput(tool, input) {
|
|
1079
1096
|
if (!input || typeof input !== "object") {
|
|
1080
1097
|
return "";
|
|
1081
1098
|
}
|
|
1082
|
-
const config = configs.get(tool);
|
|
1099
|
+
const config = configs.get(normalizeToolName(tool));
|
|
1083
1100
|
if (!config) {
|
|
1084
1101
|
return "";
|
|
1085
1102
|
}
|
|
1086
1103
|
const obj = input;
|
|
1087
|
-
const value = obj
|
|
1104
|
+
const value = getInputValue(obj, config.inputKey);
|
|
1088
1105
|
if (!value) {
|
|
1089
1106
|
return "";
|
|
1090
1107
|
}
|