@yeaft/webchat-agent 0.1.429 → 0.1.430
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/index.js +1 -0
- package/unify/session.js +2 -16
- package/unify/tools/index.js +37 -0
package/package.json
CHANGED
package/unify/index.js
CHANGED
|
@@ -37,5 +37,6 @@ export { MCPManager, createMCPManager } from './mcp.js';
|
|
|
37
37
|
export { SkillManager, createSkillManager, parseSkill, serializeSkill } from './skills.js';
|
|
38
38
|
export { defineTool } from './tools/types.js';
|
|
39
39
|
export { ToolRegistry, createEmptyRegistry } from './tools/registry.js';
|
|
40
|
+
export { createFullRegistry, allTools } from './tools/index.js';
|
|
40
41
|
export { loadSession } from './session.js';
|
|
41
42
|
|
package/unify/session.js
CHANGED
|
@@ -21,16 +21,10 @@ import { ConversationStore } from './conversation/persist.js';
|
|
|
21
21
|
import { MemoryStore } from './memory/store.js';
|
|
22
22
|
import { SkillManager, createSkillManager } from './skills.js';
|
|
23
23
|
import { MCPManager } from './mcp.js';
|
|
24
|
-
import {
|
|
24
|
+
import { createFullRegistry } from './tools/index.js';
|
|
25
25
|
import { Engine } from './engine.js';
|
|
26
26
|
import { join } from 'path';
|
|
27
27
|
|
|
28
|
-
// Built-in tools
|
|
29
|
-
import mcpTools from './tools/mcp-tools.js';
|
|
30
|
-
import skillTool from './tools/skill.js';
|
|
31
|
-
import enterWorktree from './tools/enter-worktree.js';
|
|
32
|
-
import exitWorktree from './tools/exit-worktree.js';
|
|
33
|
-
|
|
34
28
|
/**
|
|
35
29
|
* @typedef {Object} SessionOptions
|
|
36
30
|
* @property {string} [dir] — Yeaft data directory override (default: ~/.yeaft)
|
|
@@ -129,15 +123,7 @@ export async function loadSession(options = {}) {
|
|
|
129
123
|
}
|
|
130
124
|
|
|
131
125
|
// ─── 8. Build tool registry ────────────────────────────
|
|
132
|
-
const toolRegistry =
|
|
133
|
-
|
|
134
|
-
// Register built-in tools
|
|
135
|
-
for (const tool of mcpTools) {
|
|
136
|
-
toolRegistry.register(tool);
|
|
137
|
-
}
|
|
138
|
-
toolRegistry.register(skillTool);
|
|
139
|
-
toolRegistry.register(enterWorktree);
|
|
140
|
-
toolRegistry.register(exitWorktree);
|
|
126
|
+
const toolRegistry = createFullRegistry();
|
|
141
127
|
|
|
142
128
|
// Register any extra tools from caller
|
|
143
129
|
for (const tool of extraTools) {
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* tools/index.js — All built-in tools + createFullRegistry()
|
|
3
|
+
*
|
|
4
|
+
* Central barrel file that imports every built-in tool and exposes a
|
|
5
|
+
* factory function to create a ToolRegistry pre-loaded with all of them.
|
|
6
|
+
*
|
|
7
|
+
* session.js should use createFullRegistry() instead of createEmptyRegistry()
|
|
8
|
+
* to ensure all built-in tools are available to the LLM.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { ToolRegistry } from './registry.js';
|
|
12
|
+
import mcpTools from './mcp-tools.js';
|
|
13
|
+
import skillTool from './skill.js';
|
|
14
|
+
import enterWorktree from './enter-worktree.js';
|
|
15
|
+
import exitWorktree from './exit-worktree.js';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* All built-in tools, flattened into a single array.
|
|
19
|
+
* mcpTools is already an array; the rest are single ToolDef objects.
|
|
20
|
+
* @type {import('./types.js').ToolDef[]}
|
|
21
|
+
*/
|
|
22
|
+
export const allTools = [
|
|
23
|
+
...mcpTools,
|
|
24
|
+
skillTool,
|
|
25
|
+
enterWorktree,
|
|
26
|
+
exitWorktree,
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Create a ToolRegistry pre-loaded with all built-in tools.
|
|
31
|
+
* @returns {ToolRegistry}
|
|
32
|
+
*/
|
|
33
|
+
export function createFullRegistry() {
|
|
34
|
+
const registry = new ToolRegistry();
|
|
35
|
+
registry.registerAll(allTools);
|
|
36
|
+
return registry;
|
|
37
|
+
}
|