fraim-hub 2.0.231 → 2.0.232
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/src/ai-hub/hosts.js
CHANGED
|
@@ -58,10 +58,8 @@ function parseSeekMentoringSignal(line) {
|
|
|
58
58
|
typeof obj.item === 'object' && obj.item !== null) {
|
|
59
59
|
const item = obj.item;
|
|
60
60
|
const itemType = item.type;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
(tool === 'seekMentoring' || tool === 'mcp__fraim__seekMentoring')) {
|
|
64
|
-
const args = item.arguments;
|
|
61
|
+
if (itemType === 'mcp_tool_call' && isFraimTool(item.tool, 'seekMentoring')) {
|
|
62
|
+
const args = normalizeToolArgs(item.arguments) || undefined;
|
|
65
63
|
const sig = extractSignalFromArgs(args);
|
|
66
64
|
if (sig)
|
|
67
65
|
return sig;
|
|
@@ -82,13 +80,9 @@ function parseSeekMentoringSignal(line) {
|
|
|
82
80
|
continue;
|
|
83
81
|
const c = candidate;
|
|
84
82
|
const isToolUse = c.type === 'tool_use' || c.type === 'function_call';
|
|
85
|
-
|
|
86
|
-
const isSeekMentoring = nameField === 'seekMentoring' ||
|
|
87
|
-
nameField === 'mcp__fraim__seekMentoring' ||
|
|
88
|
-
nameField.endsWith('seekMentoring');
|
|
89
|
-
if (!isToolUse || !isSeekMentoring)
|
|
83
|
+
if (!isToolUse || !isFraimTool(readToolName(c), 'seekMentoring'))
|
|
90
84
|
continue;
|
|
91
|
-
const input = (c.input || c.arguments || c.parameters);
|
|
85
|
+
const input = normalizeToolArgs(c.input || c.arguments || c.parameters) || undefined;
|
|
92
86
|
const sig = extractSignalFromArgs(input);
|
|
93
87
|
if (sig)
|
|
94
88
|
return sig;
|
|
@@ -116,8 +110,7 @@ function parseFraimJobLoadSignal(line) {
|
|
|
116
110
|
if ((obj.type === 'item.started' || obj.type === 'item.completed') &&
|
|
117
111
|
typeof obj.item === 'object' && obj.item !== null) {
|
|
118
112
|
const item = obj.item;
|
|
119
|
-
|
|
120
|
-
if (item.type === 'mcp_tool_call' && isGetFraimJobTool(tool)) {
|
|
113
|
+
if (item.type === 'mcp_tool_call' && isFraimTool(item.tool, 'get_fraim_job')) {
|
|
121
114
|
const sig = readFraimJobFromArgs(item.arguments);
|
|
122
115
|
if (sig)
|
|
123
116
|
return sig;
|
|
@@ -138,8 +131,7 @@ function parseFraimJobLoadSignal(line) {
|
|
|
138
131
|
continue;
|
|
139
132
|
const c = candidate;
|
|
140
133
|
const isToolUse = c.type === 'tool_use' || c.type === 'function_call';
|
|
141
|
-
|
|
142
|
-
if (!isToolUse || !isGetFraimJobTool(nameField))
|
|
134
|
+
if (!isToolUse || !isFraimTool(readToolName(c), 'get_fraim_job'))
|
|
143
135
|
continue;
|
|
144
136
|
const sig = readFraimJobFromArgs(c.input || c.arguments || c.parameters);
|
|
145
137
|
if (sig)
|
|
@@ -276,8 +268,8 @@ function parseAgentIdentitySignal(line) {
|
|
|
276
268
|
// Codex shape.
|
|
277
269
|
if ((obj.type === 'item.started' || obj.type === 'item.completed') && typeof obj.item === 'object' && obj.item !== null) {
|
|
278
270
|
const item = obj.item;
|
|
279
|
-
if (item.type === 'mcp_tool_call' && item.tool
|
|
280
|
-
return readAgentFromArgs(item.arguments);
|
|
271
|
+
if (item.type === 'mcp_tool_call' && isFraimTool(item.tool, 'fraim_connect')) {
|
|
272
|
+
return readAgentFromArgs(normalizeToolArgs(item.arguments) || undefined);
|
|
281
273
|
}
|
|
282
274
|
}
|
|
283
275
|
// Claude Code shape.
|
|
@@ -293,10 +285,9 @@ function parseAgentIdentitySignal(line) {
|
|
|
293
285
|
const c = candidate;
|
|
294
286
|
if (c.type !== 'tool_use' && c.type !== 'function_call')
|
|
295
287
|
continue;
|
|
296
|
-
|
|
297
|
-
if (!name.endsWith('fraim_connect'))
|
|
288
|
+
if (!isFraimTool(readToolName(c), 'fraim_connect'))
|
|
298
289
|
continue;
|
|
299
|
-
const sig = readAgentFromArgs((c.input || c.arguments));
|
|
290
|
+
const sig = readAgentFromArgs(normalizeToolArgs(c.input || c.arguments || c.parameters) || undefined);
|
|
300
291
|
if (sig)
|
|
301
292
|
return sig;
|
|
302
293
|
}
|
|
@@ -312,10 +303,31 @@ function readAgentFromArgs(args) {
|
|
|
312
303
|
return null;
|
|
313
304
|
return { agentName, agentModel };
|
|
314
305
|
}
|
|
315
|
-
function
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
306
|
+
function readToolName(candidate) {
|
|
307
|
+
if (typeof candidate.name === 'string')
|
|
308
|
+
return candidate.name;
|
|
309
|
+
if (typeof candidate.tool_name === 'string')
|
|
310
|
+
return candidate.tool_name;
|
|
311
|
+
if (typeof candidate.tool === 'string')
|
|
312
|
+
return candidate.tool;
|
|
313
|
+
if (typeof candidate.function === 'object' && candidate.function !== null) {
|
|
314
|
+
const fn = candidate.function;
|
|
315
|
+
if (typeof fn.name === 'string')
|
|
316
|
+
return fn.name;
|
|
317
|
+
}
|
|
318
|
+
return null;
|
|
319
|
+
}
|
|
320
|
+
function canonicalToolName(rawName) {
|
|
321
|
+
if (typeof rawName !== 'string')
|
|
322
|
+
return null;
|
|
323
|
+
const trimmed = rawName.trim();
|
|
324
|
+
if (!trimmed)
|
|
325
|
+
return null;
|
|
326
|
+
const byDoubleUnderscore = trimmed.split('__').filter(Boolean).pop() || trimmed;
|
|
327
|
+
return byDoubleUnderscore.split(/[./:]/).filter(Boolean).pop() || null;
|
|
328
|
+
}
|
|
329
|
+
function isFraimTool(rawName, canonicalName) {
|
|
330
|
+
return canonicalToolName(rawName) === canonicalName;
|
|
319
331
|
}
|
|
320
332
|
function readFraimJobFromArgs(rawArgs) {
|
|
321
333
|
const args = normalizeToolArgs(rawArgs);
|
|
@@ -1237,6 +1237,9 @@ async function configureFraimForHubAgent(hubId) {
|
|
|
1237
1237
|
}
|
|
1238
1238
|
}
|
|
1239
1239
|
function hubCommandVersion(command, extraBinDirs, basePath) {
|
|
1240
|
+
if (process.env.NODE_ENV === 'test' && process.env.FRAIM_TEST_HUB_COMMAND_VERSION_EMPTY === '1') {
|
|
1241
|
+
return null;
|
|
1242
|
+
}
|
|
1240
1243
|
const executable = process.platform === 'win32' ? 'cmd.exe' : command;
|
|
1241
1244
|
const args = process.platform === 'win32'
|
|
1242
1245
|
? ['/d', '/s', '/c', `${command} --version`]
|
|
@@ -1252,6 +1255,9 @@ function hubCommandVersion(command, extraBinDirs, basePath) {
|
|
|
1252
1255
|
return raw || null;
|
|
1253
1256
|
}
|
|
1254
1257
|
function hubRunProcess(command, args, env) {
|
|
1258
|
+
if (process.env.NODE_ENV === 'test' && command === 'npm' && process.env.FRAIM_TEST_HUB_NPM_ERROR) {
|
|
1259
|
+
return Promise.reject(new Error(process.env.FRAIM_TEST_HUB_NPM_ERROR));
|
|
1260
|
+
}
|
|
1255
1261
|
return new Promise((resolve, reject) => {
|
|
1256
1262
|
const [realCmd, realArgs] = process.platform === 'win32'
|
|
1257
1263
|
? ['cmd.exe', ['/d', '/s', '/c', command, ...args]]
|
|
@@ -76,6 +76,8 @@ const guiAppDetect = (configSurfaceCheck, appName, options = {}) => {
|
|
|
76
76
|
};
|
|
77
77
|
};
|
|
78
78
|
const availableByVersionProbe = (command) => {
|
|
79
|
+
if (process.env.FRAIM_DETECT_DISABLE_CLI_PROBES === '1')
|
|
80
|
+
return false;
|
|
79
81
|
const result = process.platform === 'win32'
|
|
80
82
|
? (0, child_process_1.spawnSync)('cmd.exe', ['/d', '/s', '/c', `${command} --version`], { encoding: 'utf8', timeout: 1500 })
|
|
81
83
|
: (0, child_process_1.spawnSync)(command, ['--version'], { encoding: 'utf8', timeout: 1500 });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fraim-hub",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.232",
|
|
4
4
|
"description": "FRAIM Hub local companion package.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"fraim-hub": "bin/fraim-hub.js"
|
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
"electron": "^41.2.2",
|
|
159
159
|
"electron-updater": "^6.8.9",
|
|
160
160
|
"express": "^5.2.1",
|
|
161
|
-
"fraim": "2.0.
|
|
161
|
+
"fraim": "2.0.232",
|
|
162
162
|
"mongodb": "^7.0.0",
|
|
163
163
|
"node-cron": "4.2.1",
|
|
164
164
|
"node-edge-tts": "^1.2.10",
|