@yeaft/webchat-agent 0.1.453 → 0.1.455
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/package.json +1 -1
- package/unify/engine.js +4 -0
- package/unify/tools/apply-patch.js +1 -1
- package/unify/tools/bash.js +1 -1
- package/unify/tools/enter-worktree.js +1 -1
- package/unify/tools/exit-worktree.js +1 -1
- package/unify/tools/file-edit.js +1 -1
- package/unify/tools/file-read.js +1 -1
- package/unify/tools/file-write.js +1 -1
- package/unify/tools/glob.js +1 -1
- package/unify/tools/grep.js +1 -1
- package/unify/tools/list-dir.js +1 -1
- package/unify/tools/notebook-edit.js +1 -1
- package/unify/tools/request-permissions.js +1 -1
- package/unify/tools/tool-search.js +13 -13
- package/unify/tools/write-stdin.js +1 -1
- package/unify/web-bridge.js +1 -0
package/package.json
CHANGED
package/unify/engine.js
CHANGED
|
@@ -374,6 +374,7 @@ export class Engine {
|
|
|
374
374
|
});
|
|
375
375
|
|
|
376
376
|
const startTime = Date.now();
|
|
377
|
+
let ttfbMs = null; // Time to first token
|
|
377
378
|
let responseText = '';
|
|
378
379
|
const toolCalls = [];
|
|
379
380
|
let stopReason = 'end_turn';
|
|
@@ -393,6 +394,7 @@ export class Engine {
|
|
|
393
394
|
})) {
|
|
394
395
|
switch (event.type) {
|
|
395
396
|
case 'text_delta':
|
|
397
|
+
if (ttfbMs === null) ttfbMs = Date.now() - startTime;
|
|
396
398
|
responseText += event.text;
|
|
397
399
|
yield event;
|
|
398
400
|
break;
|
|
@@ -439,6 +441,7 @@ export class Engine {
|
|
|
439
441
|
toolCalls: toolCalls.map(tc => ({ id: tc.id, name: tc.name, input: tc.input })),
|
|
440
442
|
usage: { inputTokens: totalUsage.inputTokens, outputTokens: totalUsage.outputTokens },
|
|
441
443
|
latencyMs,
|
|
444
|
+
ttfbMs,
|
|
442
445
|
stopReason: 'error',
|
|
443
446
|
};
|
|
444
447
|
|
|
@@ -495,6 +498,7 @@ export class Engine {
|
|
|
495
498
|
toolCalls: toolCalls.map(tc => ({ id: tc.id, name: tc.name, input: tc.input })),
|
|
496
499
|
usage: { inputTokens: totalUsage.inputTokens, outputTokens: totalUsage.outputTokens },
|
|
497
500
|
latencyMs,
|
|
501
|
+
ttfbMs,
|
|
498
502
|
stopReason,
|
|
499
503
|
};
|
|
500
504
|
|
package/unify/tools/bash.js
CHANGED
|
@@ -41,7 +41,7 @@ unless discard_changes is set to true.`,
|
|
|
41
41
|
},
|
|
42
42
|
required: ['path', 'action'],
|
|
43
43
|
},
|
|
44
|
-
modes: ['work'],
|
|
44
|
+
modes: ['chat', 'work'],
|
|
45
45
|
isDestructive: (input) => input?.action === 'remove',
|
|
46
46
|
async execute(input, ctx) {
|
|
47
47
|
const worktreePath = resolve(input.path);
|
package/unify/tools/file-edit.js
CHANGED
package/unify/tools/file-read.js
CHANGED
package/unify/tools/glob.js
CHANGED
package/unify/tools/grep.js
CHANGED
package/unify/tools/list-dir.js
CHANGED
|
@@ -46,14 +46,14 @@ Returns matching tools with their descriptions and parameters.`,
|
|
|
46
46
|
{ name: 'WebSearch', description: 'Search the web', modes: ['chat', 'work'] },
|
|
47
47
|
{ name: 'WebFetch', description: 'Fetch web page content', modes: ['chat', 'work'] },
|
|
48
48
|
{ name: 'HistorySearch', description: 'Search conversation history', modes: ['chat', 'work'] },
|
|
49
|
-
{ name: 'Bash', description: 'Execute shell commands', modes: ['work'] },
|
|
50
|
-
{ name: 'FileRead', description: 'Read file with line numbers', modes: ['work'] },
|
|
51
|
-
{ name: 'FileWrite', description: 'Write/create files', modes: ['work'] },
|
|
52
|
-
{ name: 'FileEdit', description: 'Surgical string replacement in files', modes: ['work'] },
|
|
53
|
-
{ name: 'Glob', description: 'Find files by pattern', modes: ['work'] },
|
|
54
|
-
{ name: 'Grep', description: 'Search file contents', modes: ['work'] },
|
|
55
|
-
{ name: 'ListDir', description: 'List directory contents', modes: ['work'] },
|
|
56
|
-
{ name: 'ApplyPatch', description: 'Apply unified diff patches', modes: ['work'] },
|
|
49
|
+
{ name: 'Bash', description: 'Execute shell commands', modes: ['chat', 'work'] },
|
|
50
|
+
{ name: 'FileRead', description: 'Read file with line numbers', modes: ['chat', 'work'] },
|
|
51
|
+
{ name: 'FileWrite', description: 'Write/create files', modes: ['chat', 'work'] },
|
|
52
|
+
{ name: 'FileEdit', description: 'Surgical string replacement in files', modes: ['chat', 'work'] },
|
|
53
|
+
{ name: 'Glob', description: 'Find files by pattern', modes: ['chat', 'work'] },
|
|
54
|
+
{ name: 'Grep', description: 'Search file contents', modes: ['chat', 'work'] },
|
|
55
|
+
{ name: 'ListDir', description: 'List directory contents', modes: ['chat', 'work'] },
|
|
56
|
+
{ name: 'ApplyPatch', description: 'Apply unified diff patches', modes: ['chat', 'work'] },
|
|
57
57
|
{ name: 'Agent', description: 'Create sub-agents', modes: ['work'] },
|
|
58
58
|
{ name: 'SendMessage', description: 'Send message to sub-agent', modes: ['work'] },
|
|
59
59
|
{ name: 'WaitAgent', description: 'Wait for sub-agent result', modes: ['work'] },
|
|
@@ -67,14 +67,14 @@ Returns matching tools with their descriptions and parameters.`,
|
|
|
67
67
|
{ name: 'UpdatePlan', description: 'View/update execution plan', modes: ['work'] },
|
|
68
68
|
{ name: 'JsRepl', description: 'JavaScript REPL evaluation', modes: ['chat', 'work'] },
|
|
69
69
|
{ name: 'JsReplReset', description: 'Reset REPL state', modes: ['chat', 'work'] },
|
|
70
|
-
{ name: 'NotebookEdit', description: 'Edit Jupyter notebooks', modes: ['work'] },
|
|
70
|
+
{ name: 'NotebookEdit', description: 'Edit Jupyter notebooks', modes: ['chat', 'work'] },
|
|
71
71
|
{ name: 'ImageGeneration', description: 'Generate images from text', modes: ['chat', 'work'] },
|
|
72
72
|
{ name: 'ViewImage', description: 'View image metadata', modes: ['chat', 'work'] },
|
|
73
|
-
{ name: 'RequestPermissions', description: 'Request dangerous operation permissions', modes: ['work'] },
|
|
74
|
-
{ name: 'WriteStdin', description: 'Write to running process stdin', modes: ['work'] },
|
|
73
|
+
{ name: 'RequestPermissions', description: 'Request dangerous operation permissions', modes: ['chat', 'work'] },
|
|
74
|
+
{ name: 'WriteStdin', description: 'Write to running process stdin', modes: ['chat', 'work'] },
|
|
75
75
|
{ name: 'Skill', description: 'Load skills from library', modes: ['chat', 'work'] },
|
|
76
|
-
{ name: 'EnterWorktree', description: 'Create git worktree', modes: ['work'] },
|
|
77
|
-
{ name: 'ExitWorktree', description: 'Exit git worktree', modes: ['work'] },
|
|
76
|
+
{ name: 'EnterWorktree', description: 'Create git worktree', modes: ['chat', 'work'] },
|
|
77
|
+
{ name: 'ExitWorktree', description: 'Exit git worktree', modes: ['chat', 'work'] },
|
|
78
78
|
{ name: 'mcp_list_tools', description: 'List MCP server tools', modes: ['chat', 'work'] },
|
|
79
79
|
{ name: 'mcp_call_tool', description: 'Call MCP server tool', modes: ['chat', 'work'] },
|
|
80
80
|
];
|