@yeaft/webchat-agent 0.1.486 → 0.1.488
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/cli.js +5 -28
- package/unify/engine.js +8 -20
- package/unify/eval/cases/tool-use.js +1 -22
- package/unify/pipeline/dispatcher.js +373 -0
- package/unify/session.js +21 -0
- package/unify/skills.js +15 -9
- package/unify/tools/agent.js +0 -1
- package/unify/tools/apply-patch.js +0 -1
- package/unify/tools/ask-user.js +0 -1
- package/unify/tools/bash.js +0 -1
- package/unify/tools/close-agent.js +0 -1
- package/unify/tools/enter-worktree.js +0 -1
- package/unify/tools/exit-worktree.js +0 -1
- package/unify/tools/file-edit.js +0 -1
- package/unify/tools/file-read.js +0 -1
- package/unify/tools/file-write.js +0 -1
- package/unify/tools/glob.js +0 -1
- package/unify/tools/grep.js +0 -1
- package/unify/tools/history-search.js +0 -1
- package/unify/tools/image-generation.js +0 -1
- package/unify/tools/js-repl.js +0 -2
- package/unify/tools/list-agents.js +0 -1
- package/unify/tools/list-dir.js +0 -1
- package/unify/tools/mcp-tools.js +0 -2
- package/unify/tools/memory-query.js +0 -1
- package/unify/tools/memory-read.js +0 -1
- package/unify/tools/memory-search.js +0 -1
- package/unify/tools/memory-write.js +0 -1
- package/unify/tools/notebook-edit.js +0 -1
- package/unify/tools/request-permissions.js +0 -1
- package/unify/tools/send-message.js +0 -1
- package/unify/tools/skill.js +0 -1
- package/unify/tools/task-tools.js +0 -8
- package/unify/tools/thread-tools.js +0 -7
- package/unify/tools/tool-search.js +47 -56
- package/unify/tools/types.js +3 -6
- package/unify/tools/view-image.js +0 -1
- package/unify/tools/wait-agent.js +0 -1
- package/unify/tools/web-fetch.js +0 -1
- package/unify/tools/web-search.js +0 -1
- package/unify/tools/write-stdin.js +0 -1
- package/unify/web-bridge.js +281 -181
package/unify/session.js
CHANGED
|
@@ -27,7 +27,10 @@ import { initThreadStore } from './threads/store.js';
|
|
|
27
27
|
import { Engine } from './engine.js';
|
|
28
28
|
import { createThreadEngineRegistry } from './threads/engine-registry.js';
|
|
29
29
|
import { MAIN_THREAD_ID } from './threads/store.js';
|
|
30
|
+
import { getThreadStore } from './threads/store.js';
|
|
30
31
|
import { createIntentClassifier } from './router/intent-classifier.js';
|
|
32
|
+
import { initInputQueueStore } from './input-queue/store.js';
|
|
33
|
+
import { createDispatcher } from './pipeline/dispatcher.js';
|
|
31
34
|
import { join } from 'path';
|
|
32
35
|
|
|
33
36
|
/**
|
|
@@ -193,6 +196,22 @@ export async function loadSession(options = {}) {
|
|
|
193
196
|
// config as the engines so it can use primaryModel for classification.
|
|
194
197
|
const router = createIntentClassifier({ adapter, trace, config });
|
|
195
198
|
|
|
199
|
+
// task-310 Phase 2 integration: wire InputQueue + Dispatcher so the
|
|
200
|
+
// web-bridge can submit `unify_chat` inputs through the unified pipeline
|
|
201
|
+
// (queue → router → engineRegistry → EngineInstance). In read-only mode
|
|
202
|
+
// the queue is memory-only (no disk writes).
|
|
203
|
+
const inputQueue = initInputQueueStore({
|
|
204
|
+
yeaftDir: config._readOnly ? null : yeaftDir,
|
|
205
|
+
force: true,
|
|
206
|
+
});
|
|
207
|
+
const dispatcher = createDispatcher({
|
|
208
|
+
inputQueue,
|
|
209
|
+
router,
|
|
210
|
+
engineRegistry,
|
|
211
|
+
threadStore: getThreadStore(),
|
|
212
|
+
trace,
|
|
213
|
+
});
|
|
214
|
+
|
|
196
215
|
// ─── 10. Build session ─────────────────────────────────
|
|
197
216
|
const status = {
|
|
198
217
|
skills: skillManager.size,
|
|
@@ -224,6 +243,8 @@ export async function loadSession(options = {}) {
|
|
|
224
243
|
engine,
|
|
225
244
|
engineRegistry,
|
|
226
245
|
router,
|
|
246
|
+
inputQueue,
|
|
247
|
+
dispatcher,
|
|
227
248
|
adapter,
|
|
228
249
|
config,
|
|
229
250
|
conversationStore,
|
package/unify/skills.js
CHANGED
|
@@ -381,17 +381,21 @@ export class SkillManager {
|
|
|
381
381
|
}
|
|
382
382
|
|
|
383
383
|
/**
|
|
384
|
-
* List all skills (metadata only — no content)
|
|
384
|
+
* List all skills (metadata only — no content).
|
|
385
385
|
* This is the "progressive disclosure" list tier.
|
|
386
386
|
*
|
|
387
|
-
*
|
|
387
|
+
* task-311: the legacy `mode` parameter (chat/work filter) is accepted but
|
|
388
|
+
* ignored — Unify no longer has mode distinction, so every skill is treated
|
|
389
|
+
* as universally applicable. The `mode` field on each record is still
|
|
390
|
+
* surfaced for historic YAML compatibility.
|
|
391
|
+
*
|
|
392
|
+
* @param {string} [_mode] — deprecated, ignored
|
|
388
393
|
* @returns {Array<{ name: string, description: string, trigger: string, mode: string, category?: string, platforms?: string[], keywords?: string[], source: string, hasReferences: boolean, hasTemplates: boolean }>}
|
|
389
394
|
*/
|
|
390
|
-
list(
|
|
395
|
+
list(_mode) {
|
|
391
396
|
const skills = [...this.#skills.values()];
|
|
392
|
-
const filtered = mode ? skills.filter(s => s.mode === 'both' || s.mode === mode) : skills;
|
|
393
397
|
|
|
394
|
-
return
|
|
398
|
+
return skills.map(s => ({
|
|
395
399
|
name: s.name,
|
|
396
400
|
description: s.description || '',
|
|
397
401
|
trigger: s.trigger || '',
|
|
@@ -447,20 +451,22 @@ export class SkillManager {
|
|
|
447
451
|
* Find skills relevant to a prompt.
|
|
448
452
|
* Enhanced matching: regex triggers, keyword lists, name/description match.
|
|
449
453
|
*
|
|
454
|
+
* task-311: the `mode` parameter is accepted but ignored (all skills are
|
|
455
|
+
* considered universally applicable since mode distinction was removed).
|
|
456
|
+
*
|
|
450
457
|
* @param {string} prompt — user's prompt
|
|
451
|
-
* @param {string} [
|
|
458
|
+
* @param {string} [_mode] — deprecated, ignored
|
|
452
459
|
* @returns {Skill[]}
|
|
453
460
|
*/
|
|
454
|
-
findRelevant(prompt,
|
|
461
|
+
findRelevant(prompt, _mode) {
|
|
455
462
|
if (!prompt) return [];
|
|
456
463
|
|
|
457
464
|
const lowerPrompt = prompt.toLowerCase();
|
|
458
465
|
const cleanPrompt = lowerPrompt.replace(/[^\w\s]/g, '');
|
|
459
466
|
const promptWords = cleanPrompt.split(/\s+/).filter(w => w.length > 2);
|
|
460
467
|
const allSkills = [...this.#skills.values()];
|
|
461
|
-
const filtered = mode ? allSkills.filter(s => s.mode === 'both' || s.mode === mode) : allSkills;
|
|
462
468
|
|
|
463
|
-
return
|
|
469
|
+
return allSkills.filter(skill => {
|
|
464
470
|
// 1. Regex or keyword trigger match
|
|
465
471
|
if (skill.trigger && matchTrigger(skill.trigger, lowerPrompt, promptWords)) {
|
|
466
472
|
return true;
|
package/unify/tools/agent.js
CHANGED
package/unify/tools/ask-user.js
CHANGED
package/unify/tools/bash.js
CHANGED
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/js-repl.js
CHANGED
|
@@ -69,7 +69,6 @@ Guidelines:
|
|
|
69
69
|
},
|
|
70
70
|
required: ['code'],
|
|
71
71
|
},
|
|
72
|
-
modes: ['chat', 'work'],
|
|
73
72
|
isConcurrencySafe: () => false,
|
|
74
73
|
isReadOnly: () => true,
|
|
75
74
|
async execute(input, ctx) {
|
|
@@ -112,7 +111,6 @@ Use when you want a clean slate.`,
|
|
|
112
111
|
type: 'object',
|
|
113
112
|
properties: {},
|
|
114
113
|
},
|
|
115
|
-
modes: ['chat', 'work'],
|
|
116
114
|
isConcurrencySafe: () => false,
|
|
117
115
|
isReadOnly: () => false,
|
|
118
116
|
async execute(input, ctx) {
|
package/unify/tools/list-dir.js
CHANGED
package/unify/tools/mcp-tools.js
CHANGED
|
@@ -31,7 +31,6 @@ Usage guidelines:
|
|
|
31
31
|
},
|
|
32
32
|
},
|
|
33
33
|
},
|
|
34
|
-
modes: ['chat', 'work'],
|
|
35
34
|
isConcurrencySafe: () => true,
|
|
36
35
|
isReadOnly: () => true,
|
|
37
36
|
async execute(input, ctx) {
|
|
@@ -88,7 +87,6 @@ Usage guidelines:
|
|
|
88
87
|
},
|
|
89
88
|
required: ['tool_name'],
|
|
90
89
|
},
|
|
91
|
-
modes: ['chat', 'work'],
|
|
92
90
|
async execute(input, ctx) {
|
|
93
91
|
const mcpManager = ctx?.mcpManager;
|
|
94
92
|
|
package/unify/tools/skill.js
CHANGED
|
@@ -72,7 +72,6 @@ Use this to break down complex work into trackable items.`,
|
|
|
72
72
|
},
|
|
73
73
|
required: ['title'],
|
|
74
74
|
},
|
|
75
|
-
modes: ['work'],
|
|
76
75
|
isConcurrencySafe: () => false,
|
|
77
76
|
isReadOnly: () => false,
|
|
78
77
|
async execute(input, ctx) {
|
|
@@ -143,7 +142,6 @@ Status values: pending, in_progress, completed, blocked, cancelled`,
|
|
|
143
142
|
},
|
|
144
143
|
required: ['task_id'],
|
|
145
144
|
},
|
|
146
|
-
modes: ['work'],
|
|
147
145
|
isConcurrencySafe: () => false,
|
|
148
146
|
isReadOnly: () => false,
|
|
149
147
|
async execute(input, ctx) {
|
|
@@ -192,7 +190,6 @@ Shows task IDs, titles, status, and priority. Filter by status if needed.`,
|
|
|
192
190
|
},
|
|
193
191
|
},
|
|
194
192
|
},
|
|
195
|
-
modes: ['work'],
|
|
196
193
|
isConcurrencySafe: () => true,
|
|
197
194
|
isReadOnly: () => true,
|
|
198
195
|
async execute(input, ctx) {
|
|
@@ -247,7 +244,6 @@ export const taskGet = defineTool({
|
|
|
247
244
|
},
|
|
248
245
|
required: ['task_id'],
|
|
249
246
|
},
|
|
250
|
-
modes: ['work'],
|
|
251
247
|
isConcurrencySafe: () => true,
|
|
252
248
|
isReadOnly: () => true,
|
|
253
249
|
async execute(input, ctx) {
|
|
@@ -302,7 +298,6 @@ Use "view" to see the full log, or "append" to add a new entry.`,
|
|
|
302
298
|
},
|
|
303
299
|
required: ['task_id', 'action'],
|
|
304
300
|
},
|
|
305
|
-
modes: ['work'],
|
|
306
301
|
isConcurrencySafe: () => false,
|
|
307
302
|
isReadOnly: (input) => input?.action === 'view',
|
|
308
303
|
async execute(input, ctx) {
|
|
@@ -358,7 +353,6 @@ memory can be rewritten to keep it current.`,
|
|
|
358
353
|
},
|
|
359
354
|
required: ['task_id', 'action'],
|
|
360
355
|
},
|
|
361
|
-
modes: ['work'],
|
|
362
356
|
isConcurrencySafe: () => false,
|
|
363
357
|
isReadOnly: (input) => input?.action === 'view',
|
|
364
358
|
async execute(input, ctx) {
|
|
@@ -416,7 +410,6 @@ The new task is linked as a child of the original.`,
|
|
|
416
410
|
},
|
|
417
411
|
required: ['parent_task_id', 'title'],
|
|
418
412
|
},
|
|
419
|
-
modes: ['work'],
|
|
420
413
|
isConcurrencySafe: () => false,
|
|
421
414
|
isReadOnly: () => false,
|
|
422
415
|
async execute(input, ctx) {
|
|
@@ -475,7 +468,6 @@ approach, steps, and status of the current work.`,
|
|
|
475
468
|
},
|
|
476
469
|
required: ['action'],
|
|
477
470
|
},
|
|
478
|
-
modes: ['work'],
|
|
479
471
|
isConcurrencySafe: () => false,
|
|
480
472
|
isReadOnly: (input) => input?.action === 'view',
|
|
481
473
|
async execute(input, ctx) {
|
|
@@ -46,7 +46,6 @@ engine to the new thread — call SwitchThread to activate it.`,
|
|
|
46
46
|
},
|
|
47
47
|
required: ['name'],
|
|
48
48
|
},
|
|
49
|
-
modes: ['work'],
|
|
50
49
|
isConcurrencySafe: () => false,
|
|
51
50
|
isReadOnly: () => false,
|
|
52
51
|
async execute(input) {
|
|
@@ -89,7 +88,6 @@ thread.`,
|
|
|
89
88
|
},
|
|
90
89
|
required: ['thread_id'],
|
|
91
90
|
},
|
|
92
|
-
modes: ['work'],
|
|
93
91
|
isConcurrencySafe: () => false,
|
|
94
92
|
isReadOnly: () => false,
|
|
95
93
|
async execute(input) {
|
|
@@ -120,7 +118,6 @@ exposes id, name, goal, parentThreadId, status ('active'|'idle'|'archived'),
|
|
|
120
118
|
messageCount, lastMessageAt, archived, attachedTaskId. Reads only cached
|
|
121
119
|
fields — does not scan messages.`,
|
|
122
120
|
parameters: { type: 'object', properties: {} },
|
|
123
|
-
modes: ['work'],
|
|
124
121
|
isConcurrencySafe: () => true,
|
|
125
122
|
isReadOnly: () => true,
|
|
126
123
|
async execute() {
|
|
@@ -168,7 +165,6 @@ the same thread.`,
|
|
|
168
165
|
},
|
|
169
166
|
required: ['thread_id', 'task_id'],
|
|
170
167
|
},
|
|
171
|
-
modes: ['work'],
|
|
172
168
|
isConcurrencySafe: () => false,
|
|
173
169
|
isReadOnly: () => false,
|
|
174
170
|
async execute(input) {
|
|
@@ -227,7 +223,6 @@ This replaces the deprecated SpawnSubtask tool.`,
|
|
|
227
223
|
},
|
|
228
224
|
required: ['title'],
|
|
229
225
|
},
|
|
230
|
-
modes: ['work'],
|
|
231
226
|
isConcurrencySafe: () => false,
|
|
232
227
|
isReadOnly: () => false,
|
|
233
228
|
async execute(input) {
|
|
@@ -287,7 +282,6 @@ Use this to cross-reference work on another thread without switching.`,
|
|
|
287
282
|
},
|
|
288
283
|
required: ['thread_id'],
|
|
289
284
|
},
|
|
290
|
-
modes: ['work'],
|
|
291
285
|
isConcurrencySafe: () => true,
|
|
292
286
|
isReadOnly: () => true,
|
|
293
287
|
async execute(input) {
|
|
@@ -333,7 +327,6 @@ Use this to review another thread's recent activity without switching.`,
|
|
|
333
327
|
},
|
|
334
328
|
required: ['thread_id'],
|
|
335
329
|
},
|
|
336
|
-
modes: ['work'],
|
|
337
330
|
isConcurrencySafe: () => true,
|
|
338
331
|
isReadOnly: () => true,
|
|
339
332
|
async execute(input, ctx) {
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* tool-search.js — Search available tools by name or description.
|
|
3
|
+
*
|
|
4
|
+
* task-311: chat/work mode was removed in task-297; this tool no longer
|
|
5
|
+
* accepts or reports a `modes` filter. Results come back as plain
|
|
6
|
+
* { name, description } pairs.
|
|
3
7
|
*/
|
|
4
8
|
|
|
5
9
|
import { defineTool } from './types.js';
|
|
@@ -9,7 +13,7 @@ export default defineTool({
|
|
|
9
13
|
description: `Search available tools by name or description keyword.
|
|
10
14
|
|
|
11
15
|
Use when you're unsure which tool to use for a task.
|
|
12
|
-
Returns matching tools with their descriptions
|
|
16
|
+
Returns matching tools with their descriptions.`,
|
|
13
17
|
parameters: {
|
|
14
18
|
type: 'object',
|
|
15
19
|
properties: {
|
|
@@ -17,77 +21,64 @@ Returns matching tools with their descriptions and parameters.`,
|
|
|
17
21
|
type: 'string',
|
|
18
22
|
description: 'Search keyword to match against tool names and descriptions',
|
|
19
23
|
},
|
|
20
|
-
mode: {
|
|
21
|
-
type: 'string',
|
|
22
|
-
enum: ['chat', 'work'],
|
|
23
|
-
description: 'Filter by mode (optional)',
|
|
24
|
-
},
|
|
25
24
|
},
|
|
26
25
|
required: ['query'],
|
|
27
26
|
},
|
|
28
|
-
modes: ['chat', 'work'],
|
|
29
27
|
isConcurrencySafe: () => true,
|
|
30
28
|
isReadOnly: () => true,
|
|
31
|
-
async execute(input,
|
|
32
|
-
const { query
|
|
29
|
+
async execute(input, _ctx) {
|
|
30
|
+
const { query } = input;
|
|
33
31
|
if (!query) return JSON.stringify({ error: 'query is required' });
|
|
34
32
|
|
|
35
|
-
// Access the tool registry through the engine context
|
|
36
|
-
// Since we don't have direct registry access, list what we know
|
|
37
33
|
const lowerQuery = query.toLowerCase();
|
|
38
34
|
|
|
39
|
-
//
|
|
40
|
-
// This is a self-referential tool — it describes the tools available to this engine
|
|
35
|
+
// Self-referential catalogue of tools available to the engine.
|
|
41
36
|
const toolList = [
|
|
42
|
-
{ name: 'AskUser', description: 'Ask the user a question'
|
|
43
|
-
{ name: 'MemoryRead', description: 'Read from memory system'
|
|
44
|
-
{ name: 'MemoryWrite', description: 'Write to memory system'
|
|
45
|
-
{ name: 'MemorySearch', description: 'Search memory entries'
|
|
46
|
-
{ name: 'WebSearch', description: 'Search the web'
|
|
47
|
-
{ name: 'WebFetch', description: 'Fetch web page content'
|
|
48
|
-
{ name: 'HistorySearch', description: 'Search conversation history'
|
|
49
|
-
{ name: 'Bash', description: 'Execute shell commands'
|
|
50
|
-
{ name: 'FileRead', description: 'Read file with line numbers'
|
|
51
|
-
{ name: 'FileWrite', description: 'Write/create files'
|
|
52
|
-
{ name: 'FileEdit', description: 'Surgical string replacement in files'
|
|
53
|
-
{ name: 'Glob', description: 'Find files by pattern'
|
|
54
|
-
{ name: 'Grep', description: 'Search file contents'
|
|
55
|
-
{ name: 'ListDir', description: 'List directory contents'
|
|
56
|
-
{ name: 'ApplyPatch', description: 'Apply unified diff patches'
|
|
57
|
-
{ name: 'Agent', description: 'Create sub-agents'
|
|
58
|
-
{ name: 'SendMessage', description: 'Send message to sub-agent'
|
|
59
|
-
{ name: 'WaitAgent', description: 'Wait for sub-agent result'
|
|
60
|
-
{ name: 'CloseAgent', description: 'Close a sub-agent'
|
|
61
|
-
{ name: 'ListAgents', description: 'List all sub-agents'
|
|
62
|
-
{ name: 'TaskCreate', description: 'Create a task'
|
|
63
|
-
{ name: 'TaskUpdate', description: 'Update task status'
|
|
64
|
-
{ name: 'TaskList', description: 'List all tasks'
|
|
65
|
-
{ name: 'TaskGet', description: 'Get task details'
|
|
66
|
-
{ name: 'FollowupTask', description: 'Create follow-up task'
|
|
67
|
-
{ name: 'UpdatePlan', description: 'View/update execution plan'
|
|
68
|
-
{ name: 'JsRepl', description: 'JavaScript REPL evaluation'
|
|
69
|
-
{ name: 'JsReplReset', description: 'Reset REPL state'
|
|
70
|
-
{ name: 'NotebookEdit', description: 'Edit Jupyter notebooks'
|
|
71
|
-
{ name: 'ImageGeneration', description: 'Generate images from text'
|
|
72
|
-
{ name: 'ViewImage', description: 'View image metadata'
|
|
73
|
-
{ name: 'RequestPermissions', description: 'Request dangerous operation permissions'
|
|
74
|
-
{ name: 'WriteStdin', description: 'Write to running process stdin'
|
|
75
|
-
{ name: 'Skill', description: 'Load skills from library'
|
|
76
|
-
{ name: 'EnterWorktree', description: 'Create git worktree'
|
|
77
|
-
{ name: 'ExitWorktree', description: 'Exit git worktree'
|
|
78
|
-
{ name: 'mcp_list_tools', description: 'List MCP server tools'
|
|
79
|
-
{ name: 'mcp_call_tool', description: 'Call MCP server tool'
|
|
37
|
+
{ name: 'AskUser', description: 'Ask the user a question' },
|
|
38
|
+
{ name: 'MemoryRead', description: 'Read from memory system' },
|
|
39
|
+
{ name: 'MemoryWrite', description: 'Write to memory system' },
|
|
40
|
+
{ name: 'MemorySearch', description: 'Search memory entries' },
|
|
41
|
+
{ name: 'WebSearch', description: 'Search the web' },
|
|
42
|
+
{ name: 'WebFetch', description: 'Fetch web page content' },
|
|
43
|
+
{ name: 'HistorySearch', description: 'Search conversation history' },
|
|
44
|
+
{ name: 'Bash', description: 'Execute shell commands' },
|
|
45
|
+
{ name: 'FileRead', description: 'Read file with line numbers' },
|
|
46
|
+
{ name: 'FileWrite', description: 'Write/create files' },
|
|
47
|
+
{ name: 'FileEdit', description: 'Surgical string replacement in files' },
|
|
48
|
+
{ name: 'Glob', description: 'Find files by pattern' },
|
|
49
|
+
{ name: 'Grep', description: 'Search file contents' },
|
|
50
|
+
{ name: 'ListDir', description: 'List directory contents' },
|
|
51
|
+
{ name: 'ApplyPatch', description: 'Apply unified diff patches' },
|
|
52
|
+
{ name: 'Agent', description: 'Create sub-agents' },
|
|
53
|
+
{ name: 'SendMessage', description: 'Send message to sub-agent' },
|
|
54
|
+
{ name: 'WaitAgent', description: 'Wait for sub-agent result' },
|
|
55
|
+
{ name: 'CloseAgent', description: 'Close a sub-agent' },
|
|
56
|
+
{ name: 'ListAgents', description: 'List all sub-agents' },
|
|
57
|
+
{ name: 'TaskCreate', description: 'Create a task' },
|
|
58
|
+
{ name: 'TaskUpdate', description: 'Update task status' },
|
|
59
|
+
{ name: 'TaskList', description: 'List all tasks' },
|
|
60
|
+
{ name: 'TaskGet', description: 'Get task details' },
|
|
61
|
+
{ name: 'FollowupTask', description: 'Create follow-up task' },
|
|
62
|
+
{ name: 'UpdatePlan', description: 'View/update execution plan' },
|
|
63
|
+
{ name: 'JsRepl', description: 'JavaScript REPL evaluation' },
|
|
64
|
+
{ name: 'JsReplReset', description: 'Reset REPL state' },
|
|
65
|
+
{ name: 'NotebookEdit', description: 'Edit Jupyter notebooks' },
|
|
66
|
+
{ name: 'ImageGeneration', description: 'Generate images from text' },
|
|
67
|
+
{ name: 'ViewImage', description: 'View image metadata' },
|
|
68
|
+
{ name: 'RequestPermissions', description: 'Request dangerous operation permissions' },
|
|
69
|
+
{ name: 'WriteStdin', description: 'Write to running process stdin' },
|
|
70
|
+
{ name: 'Skill', description: 'Load skills from library' },
|
|
71
|
+
{ name: 'EnterWorktree', description: 'Create git worktree' },
|
|
72
|
+
{ name: 'ExitWorktree', description: 'Exit git worktree' },
|
|
73
|
+
{ name: 'mcp_list_tools', description: 'List MCP server tools' },
|
|
74
|
+
{ name: 'mcp_call_tool', description: 'Call MCP server tool' },
|
|
80
75
|
];
|
|
81
76
|
|
|
82
|
-
|
|
77
|
+
const results = toolList.filter(t =>
|
|
83
78
|
t.name.toLowerCase().includes(lowerQuery) ||
|
|
84
79
|
t.description.toLowerCase().includes(lowerQuery)
|
|
85
80
|
);
|
|
86
81
|
|
|
87
|
-
if (mode) {
|
|
88
|
-
results = results.filter(t => t.modes.includes(mode));
|
|
89
|
-
}
|
|
90
|
-
|
|
91
82
|
return JSON.stringify({
|
|
92
83
|
results,
|
|
93
84
|
totalResults: results.length,
|
package/unify/tools/types.js
CHANGED
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
* This ensures consistent shape and API-format conversion.
|
|
6
6
|
*
|
|
7
7
|
* Reference: yeaft-unify-core-systems.md §3.1
|
|
8
|
+
*
|
|
9
|
+
* task-311: the legacy `modes` field (task-297 deprecated) is now fully
|
|
10
|
+
* removed — Unify runs in a single unified mode.
|
|
8
11
|
*/
|
|
9
12
|
|
|
10
13
|
/**
|
|
@@ -24,9 +27,6 @@
|
|
|
24
27
|
* @property {string} description — LLM-facing description
|
|
25
28
|
* @property {object} parameters — JSON Schema for input
|
|
26
29
|
* @property {(input: object, ctx?: ToolContext) => Promise<string>} execute — execution function
|
|
27
|
-
* @property {string[]} [modes] — @deprecated since task-297. Legacy mode filter (['chat', 'work']).
|
|
28
|
-
* Unify no longer has mode distinction; the ToolRegistry ignores this field and exposes every
|
|
29
|
-
* registered tool to the engine. Retained only so existing tool definitions keep loading.
|
|
30
30
|
* @property {(input?: object) => boolean} [isConcurrencySafe] — can run in parallel?
|
|
31
31
|
* @property {(input?: object) => boolean} [isReadOnly] — read-only operation?
|
|
32
32
|
* @property {(input?: object) => boolean} [isDestructive] — destructive operation?
|
|
@@ -40,7 +40,6 @@
|
|
|
40
40
|
* description: string,
|
|
41
41
|
* parameters: object,
|
|
42
42
|
* execute: (input: object, ctx?: ToolContext) => Promise<string>,
|
|
43
|
-
* modes?: string[], // @deprecated since task-297 — ignored by ToolRegistry
|
|
44
43
|
* isConcurrencySafe?: (input?: object) => boolean,
|
|
45
44
|
* isReadOnly?: (input?: object) => boolean,
|
|
46
45
|
* isDestructive?: (input?: object) => boolean,
|
|
@@ -52,7 +51,6 @@ export function defineTool({
|
|
|
52
51
|
description,
|
|
53
52
|
parameters,
|
|
54
53
|
execute,
|
|
55
|
-
modes = ['chat', 'work'],
|
|
56
54
|
isConcurrencySafe = () => false,
|
|
57
55
|
isReadOnly = () => false,
|
|
58
56
|
isDestructive = () => false,
|
|
@@ -65,7 +63,6 @@ export function defineTool({
|
|
|
65
63
|
description: description || `Tool: ${name}`,
|
|
66
64
|
parameters: parameters || { type: 'object', properties: {} },
|
|
67
65
|
execute,
|
|
68
|
-
modes,
|
|
69
66
|
isConcurrencySafe,
|
|
70
67
|
isReadOnly,
|
|
71
68
|
isDestructive,
|