@revealui/ai 0.2.8 → 0.2.9
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/README.md +2 -2
- package/dist/a2a/card.d.ts +1 -1
- package/dist/a2a/card.d.ts.map +1 -1
- package/dist/a2a/card.js +4 -4
- package/dist/a2a/handler.d.ts +4 -4
- package/dist/a2a/handler.js +5 -5
- package/dist/a2a/index.d.ts +1 -1
- package/dist/a2a/index.js +1 -1
- package/dist/audit/emitter.d.ts +1 -1
- package/dist/audit/emitter.js +2 -2
- package/dist/audit/index.d.ts +2 -2
- package/dist/audit/index.js +2 -2
- package/dist/audit/store.d.ts +2 -2
- package/dist/audit/store.js +2 -2
- package/dist/client/errors.d.ts +13 -0
- package/dist/client/errors.d.ts.map +1 -0
- package/dist/client/errors.js +28 -0
- package/dist/client/hooks/useAgentContext.d.ts.map +1 -1
- package/dist/client/hooks/useAgentContext.js +6 -5
- package/dist/client/hooks/useAgentStream.d.ts +2 -2
- package/dist/client/hooks/useAgentStream.js +3 -3
- package/dist/client/hooks/useEpisodicMemory.d.ts.map +1 -1
- package/dist/client/hooks/useEpisodicMemory.js +6 -5
- package/dist/client/hooks/useWorkingMemory.d.ts.map +1 -1
- package/dist/client/hooks/useWorkingMemory.js +7 -6
- package/dist/embeddings/index.d.ts +1 -1
- package/dist/embeddings/index.js +4 -4
- package/dist/inference/context-budget.d.ts +1 -1
- package/dist/inference/context-budget.js +4 -4
- package/dist/inference/index.d.ts +1 -1
- package/dist/inference/index.js +1 -1
- package/dist/inference/runRag.d.ts +3 -3
- package/dist/inference/runRag.d.ts.map +1 -1
- package/dist/inference/runRag.js +1 -1
- package/dist/inference/task-decomposer.d.ts +1 -1
- package/dist/inference/task-decomposer.d.ts.map +1 -1
- package/dist/inference/task-decomposer.js +3 -3
- package/dist/inference/tool-result-compressor.d.ts +1 -1
- package/dist/inference/tool-result-compressor.js +1 -1
- package/dist/ingestion/{cms-indexer.d.ts → admin-indexer.d.ts} +12 -12
- package/dist/ingestion/admin-indexer.d.ts.map +1 -0
- package/dist/ingestion/{cms-indexer.js → admin-indexer.js} +9 -9
- package/dist/ingestion/bm25.d.ts +1 -1
- package/dist/ingestion/bm25.js +1 -1
- package/dist/ingestion/file-parsers.d.ts +1 -1
- package/dist/ingestion/file-parsers.d.ts.map +1 -1
- package/dist/ingestion/file-parsers.js +36 -17
- package/dist/ingestion/hybrid-search.d.ts +1 -1
- package/dist/ingestion/hybrid-search.js +1 -1
- package/dist/ingestion/index.d.ts +1 -1
- package/dist/ingestion/index.d.ts.map +1 -1
- package/dist/ingestion/index.js +1 -1
- package/dist/ingestion/rag-vector-service.d.ts +1 -1
- package/dist/ingestion/rag-vector-service.js +1 -1
- package/dist/ingestion/reranker.d.ts +1 -1
- package/dist/ingestion/reranker.js +1 -1
- package/dist/ingestion/text-splitter.d.ts +1 -1
- package/dist/ingestion/text-splitter.js +2 -2
- package/dist/llm/client.d.ts +7 -10
- package/dist/llm/client.d.ts.map +1 -1
- package/dist/llm/client.js +10 -34
- package/dist/llm/key-validator.d.ts +1 -1
- package/dist/llm/key-validator.js +8 -8
- package/dist/llm/providers/base.d.ts +2 -2
- package/dist/llm/providers/groq.d.ts +2 -2
- package/dist/llm/providers/groq.d.ts.map +1 -1
- package/dist/llm/providers/groq.js +2 -2
- package/dist/llm/providers/inference-snaps.d.ts +5 -5
- package/dist/llm/providers/inference-snaps.d.ts.map +1 -1
- package/dist/llm/providers/inference-snaps.js +4 -4
- package/dist/llm/providers/ollama.d.ts +2 -2
- package/dist/llm/providers/ollama.d.ts.map +1 -1
- package/dist/llm/providers/ollama.js +1 -1
- package/dist/llm/providers/openai-compat.d.ts +2 -2
- package/dist/llm/providers/openai-compat.js +5 -5
- package/dist/llm/providers/vultr.js +1 -1
- package/dist/llm/server.d.ts +0 -1
- package/dist/llm/server.d.ts.map +1 -1
- package/dist/llm/server.js +0 -1
- package/dist/llm/token-counter.d.ts.map +1 -1
- package/dist/llm/token-counter.js +11 -8
- package/dist/llm/workspace-provider-config.d.ts +1 -1
- package/dist/llm/workspace-provider-config.d.ts.map +1 -1
- package/dist/llm/workspace-provider-config.js +1 -1
- package/dist/memory/crdt/or-set.d.ts +12 -0
- package/dist/memory/crdt/or-set.d.ts.map +1 -1
- package/dist/memory/crdt/or-set.js +27 -0
- package/dist/memory/index.d.ts +1 -0
- package/dist/memory/index.d.ts.map +1 -1
- package/dist/memory/index.js +1 -0
- package/dist/memory/persistence/crdt-persistence.d.ts +21 -1
- package/dist/memory/persistence/crdt-persistence.d.ts.map +1 -1
- package/dist/memory/persistence/crdt-persistence.js +67 -0
- package/dist/memory/preferences/user-preferences-manager.d.ts.map +1 -1
- package/dist/memory/preferences/user-preferences-manager.js +11 -1
- package/dist/memory/stores/episodic-memory.js +2 -2
- package/dist/memory/stores/working-memory.d.ts +7 -2
- package/dist/memory/stores/working-memory.d.ts.map +1 -1
- package/dist/memory/stores/working-memory.js +31 -17
- package/dist/memory/sync/index.d.ts +2 -0
- package/dist/memory/sync/index.d.ts.map +1 -0
- package/dist/memory/sync/index.js +1 -0
- package/dist/memory/sync/sync-manager.d.ts +104 -0
- package/dist/memory/sync/sync-manager.d.ts.map +1 -0
- package/dist/memory/sync/sync-manager.js +137 -0
- package/dist/memory/utils/validation.js +1 -1
- package/dist/memory/vector/vector-memory-service.d.ts +1 -1
- package/dist/memory/vector/vector-memory-service.js +1 -1
- package/dist/orchestration/agent.d.ts +2 -2
- package/dist/orchestration/defaults.d.ts +1 -1
- package/dist/orchestration/defaults.js +1 -1
- package/dist/orchestration/orchestrator.d.ts +3 -3
- package/dist/orchestration/orchestrator.js +3 -3
- package/dist/orchestration/runtime.d.ts +1 -1
- package/dist/orchestration/runtime.js +1 -1
- package/dist/orchestration/streaming-runtime.d.ts +2 -2
- package/dist/orchestration/streaming-runtime.js +2 -2
- package/dist/orchestration/ticket-agent.d.ts +11 -11
- package/dist/orchestration/ticket-agent.d.ts.map +1 -1
- package/dist/orchestration/ticket-agent.js +10 -10
- package/dist/skills/catalog/vercel-catalog.d.ts.map +1 -1
- package/dist/skills/catalog/vercel-catalog.js +7 -4
- package/dist/skills/loader/github-loader.d.ts.map +1 -1
- package/dist/skills/loader/github-loader.js +2 -0
- package/dist/skills/loader/local-loader.js +1 -1
- package/dist/skills/loader/vercel-loader.d.ts.map +1 -1
- package/dist/skills/loader/vercel-loader.js +2 -0
- package/dist/skills/parser/skill-md-parser.js +2 -2
- package/dist/skills/registry/skill-registry.js +1 -1
- package/dist/templates/prompt-spec.js +1 -1
- package/dist/templates/skill-spec.js +1 -1
- package/dist/tools/{cms → admin}/collection-tools.d.ts +2 -2
- package/dist/tools/admin/collection-tools.d.ts.map +1 -0
- package/dist/tools/{cms → admin}/collection-tools.js +8 -8
- package/dist/tools/{cms → admin}/factory.d.ts +11 -11
- package/dist/tools/admin/factory.d.ts.map +1 -0
- package/dist/tools/{cms → admin}/factory.js +4 -4
- package/dist/tools/{cms → admin}/global-tools.d.ts +1 -1
- package/dist/tools/admin/global-tools.d.ts.map +1 -0
- package/dist/tools/{cms → admin}/global-tools.js +4 -4
- package/dist/tools/{cms → admin}/index.d.ts +4 -4
- package/dist/tools/admin/index.d.ts.map +1 -0
- package/dist/tools/{cms → admin}/index.js +3 -3
- package/dist/tools/{cms → admin}/media-tools.d.ts +1 -1
- package/dist/tools/admin/media-tools.d.ts.map +1 -0
- package/dist/tools/{cms → admin}/media-tools.js +4 -4
- package/dist/tools/{cms → admin}/user-tools.d.ts +1 -1
- package/dist/tools/admin/user-tools.d.ts.map +1 -0
- package/dist/tools/{cms → admin}/user-tools.js +1 -1
- package/dist/tools/coding/file-edit.d.ts +1 -1
- package/dist/tools/coding/file-edit.js +2 -2
- package/dist/tools/coding/file-glob.d.ts +1 -1
- package/dist/tools/coding/file-glob.d.ts.map +1 -1
- package/dist/tools/coding/file-glob.js +2 -1
- package/dist/tools/coding/file-grep.d.ts +1 -1
- package/dist/tools/coding/file-grep.d.ts.map +1 -1
- package/dist/tools/coding/file-grep.js +2 -1
- package/dist/tools/coding/file-read.d.ts +1 -1
- package/dist/tools/coding/file-read.d.ts.map +1 -1
- package/dist/tools/coding/file-read.js +15 -9
- package/dist/tools/coding/file-write.d.ts +1 -1
- package/dist/tools/coding/file-write.js +1 -1
- package/dist/tools/coding/git-ops.d.ts +1 -1
- package/dist/tools/coding/git-ops.d.ts.map +1 -1
- package/dist/tools/coding/git-ops.js +5 -7
- package/dist/tools/coding/index.d.ts +1 -1
- package/dist/tools/coding/index.d.ts.map +1 -1
- package/dist/tools/coding/lint-fix.d.ts +1 -1
- package/dist/tools/coding/lint-fix.d.ts.map +1 -1
- package/dist/tools/coding/lint-fix.js +8 -4
- package/dist/tools/coding/project-context.d.ts +1 -1
- package/dist/tools/coding/project-context.d.ts.map +1 -1
- package/dist/tools/coding/project-context.js +25 -24
- package/dist/tools/coding/safety.d.ts +1 -1
- package/dist/tools/coding/safety.d.ts.map +1 -1
- package/dist/tools/coding/shell-exec.d.ts +1 -1
- package/dist/tools/coding/shell-exec.js +1 -1
- package/dist/tools/coding/test-runner.d.ts +1 -1
- package/dist/tools/coding/test-runner.d.ts.map +1 -1
- package/dist/tools/coding/test-runner.js +12 -7
- package/dist/tools/deduplicator.js +1 -1
- package/dist/tools/document-summarizer.js +2 -2
- package/dist/tools/memory/store-memory.d.ts +1 -1
- package/dist/tools/memory/store-memory.js +2 -2
- package/dist/tools/ticket-tools.d.ts +2 -2
- package/dist/tools/ticket-tools.js +3 -3
- package/dist/tools/web/duck-duck-go.d.ts +3 -3
- package/dist/tools/web/duck-duck-go.js +4 -4
- package/dist/tools/web/exa.d.ts +1 -1
- package/dist/tools/web/exa.js +1 -1
- package/dist/tools/web/scraper.js +1 -1
- package/dist/tools/web/tavily.d.ts +2 -2
- package/dist/tools/web/tavily.js +2 -2
- package/dist/tools/web/types.d.ts +2 -2
- package/dist/tools/web/types.js +2 -2
- package/package.json +20 -15
- package/dist/ingestion/cms-indexer.d.ts.map +0 -1
- package/dist/llm/providers/bitnet.d.ts +0 -28
- package/dist/llm/providers/bitnet.d.ts.map +0 -1
- package/dist/llm/providers/bitnet.js +0 -36
- package/dist/tools/cms/collection-tools.d.ts.map +0 -1
- package/dist/tools/cms/factory.d.ts.map +0 -1
- package/dist/tools/cms/global-tools.d.ts.map +0 -1
- package/dist/tools/cms/index.d.ts.map +0 -1
- package/dist/tools/cms/media-tools.d.ts.map +0 -1
- package/dist/tools/cms/user-tools.d.ts.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Admin Media Tools
|
|
3
3
|
* Tools for managing media files (images, videos, documents)
|
|
4
4
|
*/
|
|
5
5
|
import { z } from 'zod/v4';
|
|
@@ -9,7 +9,7 @@ import { z } from 'zod/v4';
|
|
|
9
9
|
*/
|
|
10
10
|
export const listMediaTool = {
|
|
11
11
|
name: 'list_media',
|
|
12
|
-
description: 'Get a list of media files from the
|
|
12
|
+
description: 'Get a list of media files from the admin media library. Use this to browse uploaded images, videos, and documents.',
|
|
13
13
|
parameters: z.object({
|
|
14
14
|
page: z.number().optional().describe('Page number for pagination (default: 1)'),
|
|
15
15
|
limit: z.number().optional().describe('Number of results per page (default: 10)'),
|
|
@@ -63,7 +63,7 @@ export const getMediaTool = {
|
|
|
63
63
|
*/
|
|
64
64
|
export const uploadMediaTool = {
|
|
65
65
|
name: 'upload_media',
|
|
66
|
-
description: 'Upload a new media file (image, video, or document) to the
|
|
66
|
+
description: 'Upload a new media file (image, video, or document) to the admin. The file should be provided as a base64-encoded string.',
|
|
67
67
|
parameters: z.object({
|
|
68
68
|
filename: z.string().describe('The filename (e.g., "logo.png")'),
|
|
69
69
|
mimeType: z.string().describe('The MIME type (e.g., "image/png", "image/jpeg")'),
|
|
@@ -93,7 +93,7 @@ export const uploadMediaTool = {
|
|
|
93
93
|
*/
|
|
94
94
|
export const deleteMediaTool = {
|
|
95
95
|
name: 'delete_media',
|
|
96
|
-
description: 'Delete a media file from the
|
|
96
|
+
description: 'Delete a media file from the admin media library. This removes both the database record and the file from storage. This action is permanent.',
|
|
97
97
|
parameters: z.object({
|
|
98
98
|
id: z.string().describe('The media file ID to delete'),
|
|
99
99
|
}),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-tools.d.ts","sourceRoot":"","sources":["../../../src/tools/admin/user-tools.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,YAAY,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,IAoBhC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,IAiC3B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,IAsC5B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,IAsC5B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,IAuB5B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* file_edit
|
|
2
|
+
* file_edit - Surgical string replacement in a file
|
|
3
3
|
*/
|
|
4
4
|
import { readFileSync, writeFileSync } from 'node:fs';
|
|
5
5
|
import { z } from 'zod/v4';
|
|
@@ -23,7 +23,7 @@ export const fileEditTool = {
|
|
|
23
23
|
return { success: false, error: check.reason };
|
|
24
24
|
}
|
|
25
25
|
if (old_text === new_text) {
|
|
26
|
-
return { success: false, error: 'old_text and new_text are identical
|
|
26
|
+
return { success: false, error: 'old_text and new_text are identical - nothing to change' };
|
|
27
27
|
}
|
|
28
28
|
const resolvedPath = resolveSafePath(path, config);
|
|
29
29
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-glob.d.ts","sourceRoot":"","sources":["../../../src/tools/coding/file-glob.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"file-glob.d.ts","sourceRoot":"","sources":["../../../src/tools/coding/file-glob.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,YAAY,CAAC;AAgEnD,eAAO,MAAM,YAAY,EAAE,IAgE1B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* file_glob
|
|
2
|
+
* file_glob - Fast file pattern matching with picomatch-style globs
|
|
3
3
|
*/
|
|
4
4
|
import { readdirSync, statSync } from 'node:fs';
|
|
5
5
|
import { join, relative } from 'node:path';
|
|
@@ -8,6 +8,7 @@ import { getSafetyConfig } from './safety.js';
|
|
|
8
8
|
/** Simple glob matcher supporting *, **, and ? */
|
|
9
9
|
function matchGlob(pattern, filePath) {
|
|
10
10
|
const regex = pattern
|
|
11
|
+
.replace(/\\/g, '\\\\')
|
|
11
12
|
.replace(/\./g, '\\.')
|
|
12
13
|
.replace(/\*\*/g, '⟨GLOBSTAR⟩')
|
|
13
14
|
.replace(/\*/g, '[^/]*')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-grep.d.ts","sourceRoot":"","sources":["../../../src/tools/coding/file-grep.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"file-grep.d.ts","sourceRoot":"","sources":["../../../src/tools/coding/file-grep.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,YAAY,CAAC;AAkGnD,eAAO,MAAM,YAAY,EAAE,IA0H1B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* file_grep
|
|
2
|
+
* file_grep - Regex content search across files
|
|
3
3
|
*/
|
|
4
4
|
import { readdirSync, readFileSync, statSync } from 'node:fs';
|
|
5
5
|
import { join, relative } from 'node:path';
|
|
@@ -8,6 +8,7 @@ import { getSafetyConfig } from './safety.js';
|
|
|
8
8
|
/** Simple glob test for file filtering */
|
|
9
9
|
function matchesGlob(filePath, glob) {
|
|
10
10
|
const regex = glob
|
|
11
|
+
.replace(/\\/g, '\\\\')
|
|
11
12
|
.replace(/\./g, '\\.')
|
|
12
13
|
.replace(/\*\*/g, '⟨GLOBSTAR⟩')
|
|
13
14
|
.replace(/\*/g, '[^/]*')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-read.d.ts","sourceRoot":"","sources":["../../../src/tools/coding/file-read.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,YAAY,CAAC;AAGnD,eAAO,MAAM,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"file-read.d.ts","sourceRoot":"","sources":["../../../src/tools/coding/file-read.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,YAAY,CAAC;AAGnD,eAAO,MAAM,YAAY,EAAE,IAsE1B,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* file_read
|
|
2
|
+
* file_read - Read file contents with line numbers
|
|
3
3
|
*/
|
|
4
|
-
import { readFileSync
|
|
4
|
+
import { readFileSync } from 'node:fs';
|
|
5
5
|
import { z } from 'zod/v4';
|
|
6
6
|
import { getSafetyConfig, resolveSafePath, validatePath } from './safety.js';
|
|
7
7
|
export const fileReadTool = {
|
|
@@ -24,14 +24,20 @@ export const fileReadTool = {
|
|
|
24
24
|
const maxLines = limit ?? 2000;
|
|
25
25
|
const startLine = (offset ?? 1) - 1; // Convert to 0-based
|
|
26
26
|
try {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
// Read first, then check if directory (avoids TOCTOU race between stat and read)
|
|
28
|
+
let raw;
|
|
29
|
+
try {
|
|
30
|
+
raw = readFileSync(resolvedPath, 'utf8');
|
|
31
|
+
}
|
|
32
|
+
catch (readErr) {
|
|
33
|
+
if (readErr.code === 'EISDIR') {
|
|
34
|
+
return {
|
|
35
|
+
success: false,
|
|
36
|
+
error: `${path} is a directory, not a file. Use file_glob to list directory contents.`,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
throw readErr;
|
|
33
40
|
}
|
|
34
|
-
const raw = readFileSync(resolvedPath, 'utf8');
|
|
35
41
|
const allLines = raw.split('\n');
|
|
36
42
|
const totalLines = allLines.length;
|
|
37
43
|
const sliced = allLines.slice(startLine, startLine + maxLines);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-ops.d.ts","sourceRoot":"","sources":["../../../src/tools/coding/git-ops.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"git-ops.d.ts","sourceRoot":"","sources":["../../../src/tools/coding/git-ops.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,YAAY,CAAC;AAuBnD,eAAO,MAAM,UAAU,EAAE,IA4FxB,CAAC"}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* git_ops
|
|
2
|
+
* git_ops - Git operations wrapper (status, diff, log, blame)
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { execFileSync } from 'node:child_process';
|
|
5
5
|
import { z } from 'zod/v4';
|
|
6
6
|
import { getSafetyConfig } from './safety.js';
|
|
7
7
|
const GIT_OPERATIONS = ['status', 'diff', 'diff_full', 'log', 'blame', 'show', 'branch'];
|
|
8
8
|
/** Max output per git command */
|
|
9
9
|
const MAX_OUTPUT = 50_000;
|
|
10
10
|
function runGit(args, cwd) {
|
|
11
|
-
|
|
12
|
-
return execSync(cmd, {
|
|
11
|
+
return execFileSync('git', args, {
|
|
13
12
|
cwd,
|
|
14
13
|
timeout: 15_000,
|
|
15
14
|
maxBuffer: MAX_OUTPUT,
|
|
@@ -17,7 +16,6 @@ function runGit(args, cwd) {
|
|
|
17
16
|
env: {
|
|
18
17
|
...process.env,
|
|
19
18
|
GIT_TERMINAL_PROMPT: '0',
|
|
20
|
-
// Prevent pager from blocking
|
|
21
19
|
GIT_PAGER: 'cat',
|
|
22
20
|
},
|
|
23
21
|
}).trim();
|
|
@@ -25,7 +23,7 @@ function runGit(args, cwd) {
|
|
|
25
23
|
export const gitOpsTool = {
|
|
26
24
|
name: 'git_ops',
|
|
27
25
|
label: 'Git Operations',
|
|
28
|
-
description: 'Run read-only git operations: status, diff (summary), diff_full (full patch), log, blame, show, branch. Safe operations only
|
|
26
|
+
description: 'Run read-only git operations: status, diff (summary), diff_full (full patch), log, blame, show, branch. Safe operations only - no push, commit, reset, or checkout.',
|
|
29
27
|
parameters: z.object({
|
|
30
28
|
operation: z.enum(GIT_OPERATIONS).describe('Git operation to perform'),
|
|
31
29
|
args: z
|
|
@@ -57,7 +55,7 @@ export const gitOpsTool = {
|
|
|
57
55
|
output = runGit(['diff', '--stat', ...args], config.projectRoot);
|
|
58
56
|
break;
|
|
59
57
|
case 'diff_full':
|
|
60
|
-
// Full patch content for code review
|
|
58
|
+
// Full patch content for code review - hunks per file
|
|
61
59
|
output = runGit(['diff', '--no-color', '-U3', ...args], config.projectRoot);
|
|
62
60
|
break;
|
|
63
61
|
case 'log':
|
|
@@ -20,7 +20,7 @@ export { testRunnerTool } from './test-runner.js';
|
|
|
20
20
|
* Configuration for the coding tools factory
|
|
21
21
|
*/
|
|
22
22
|
export interface CodingToolsConfig {
|
|
23
|
-
/** Project root directory
|
|
23
|
+
/** Project root directory - all file operations sandboxed here */
|
|
24
24
|
projectRoot: string;
|
|
25
25
|
/** Additional directories to allow (e.g., /tmp for scratch files) */
|
|
26
26
|
allowedPaths?: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/coding/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAevC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EACL,eAAe,EACf,eAAe,EACf,eAAe,EACf,eAAe,EACf,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/coding/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAevC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EACL,eAAe,EACf,eAAe,EACf,eAAe,EACf,eAAe,EACf,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,oEAAoE;IACpE,WAAW,EAAE,MAAM,CAAC;IACpB,qEAAqE;IACrE,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,0DAA0D;IAC1D,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,kCAAkC;IAClC,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,4CAA4C;IAC5C,OAAO,CAAC,EAAE,KAAK,CACX,WAAW,GACX,YAAY,GACZ,WAAW,GACX,WAAW,GACX,WAAW,GACX,YAAY,GACZ,SAAS,GACT,iBAAiB,GACjB,aAAa,GACb,UAAU,CACb,CAAC;CACH;AAgBD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,EAAE,CAmBnE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lint-fix.d.ts","sourceRoot":"","sources":["../../../src/tools/coding/lint-fix.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"lint-fix.d.ts","sourceRoot":"","sources":["../../../src/tools/coding/lint-fix.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,YAAY,CAAC;AA6MnD,eAAO,MAAM,WAAW,EAAE,IAqHzB,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* lint_fix
|
|
2
|
+
* lint_fix - Run linter and optionally auto-fix issues
|
|
3
3
|
*
|
|
4
4
|
* Detects the linter (Biome, ESLint) and runs it with machine-parseable
|
|
5
5
|
* output. Returns structured diagnostic counts and details.
|
|
6
6
|
*/
|
|
7
7
|
import { execSync } from 'node:child_process';
|
|
8
|
-
import { existsSync } from 'node:fs';
|
|
8
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
9
9
|
import { join } from 'node:path';
|
|
10
10
|
import { z } from 'zod/v4';
|
|
11
11
|
import { getSafetyConfig } from './safety.js';
|
|
@@ -22,7 +22,7 @@ function detectLinter(projectRoot) {
|
|
|
22
22
|
const pkgPath = join(projectRoot, 'package.json');
|
|
23
23
|
if (existsSync(pkgPath)) {
|
|
24
24
|
try {
|
|
25
|
-
const pkg = JSON.parse(
|
|
25
|
+
const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'));
|
|
26
26
|
const deps = {
|
|
27
27
|
...pkg.dependencies,
|
|
28
28
|
...pkg.devDependencies,
|
|
@@ -38,8 +38,12 @@ function detectLinter(projectRoot) {
|
|
|
38
38
|
}
|
|
39
39
|
return 'unknown';
|
|
40
40
|
}
|
|
41
|
+
/** Validate that a file argument is safe for shell use (no metacharacters) */
|
|
42
|
+
function isSafeShellArg(arg) {
|
|
43
|
+
return /^[\w./@-]+$/.test(arg);
|
|
44
|
+
}
|
|
41
45
|
function buildCommand(linter, file, fix) {
|
|
42
|
-
const target = file
|
|
46
|
+
const target = file && isSafeShellArg(file) ? file : '.';
|
|
43
47
|
switch (linter) {
|
|
44
48
|
case 'biome':
|
|
45
49
|
return fix ? `npx biome check --write ${target}` : `npx biome check ${target}`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* project_context
|
|
2
|
+
* project_context - Query the harness content layer for relevant project rules and skills
|
|
3
3
|
*/
|
|
4
4
|
import type { Tool } from '../base.js';
|
|
5
5
|
export declare const projectContextTool: Tool;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-context.d.ts","sourceRoot":"","sources":["../../../src/tools/coding/project-context.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"project-context.d.ts","sourceRoot":"","sources":["../../../src/tools/coding/project-context.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,YAAY,CAAC;AAyFnD,eAAO,MAAM,kBAAkB,EAAE,IAkDhC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* project_context
|
|
2
|
+
* project_context - Query the harness content layer for relevant project rules and skills
|
|
3
3
|
*/
|
|
4
|
-
import { readdirSync, readFileSync
|
|
4
|
+
import { readdirSync, readFileSync } from 'node:fs';
|
|
5
5
|
import { join } from 'node:path';
|
|
6
6
|
import { z } from 'zod/v4';
|
|
7
7
|
import { getSafetyConfig } from './safety.js';
|
|
@@ -28,27 +28,28 @@ function searchContent(projectRoot, query, scope) {
|
|
|
28
28
|
}
|
|
29
29
|
for (const entry of entries) {
|
|
30
30
|
const fullPath = join(dir, entry);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
catch {
|
|
48
|
-
// Not a skill directory, skip
|
|
31
|
+
// Try reading as skill directory first, then as markdown file
|
|
32
|
+
// (avoids TOCTOU race between stat and read)
|
|
33
|
+
if (!entry.includes('.')) {
|
|
34
|
+
// Likely a directory, check for SKILL.md
|
|
35
|
+
const skillPath = join(fullPath, 'SKILL.md');
|
|
36
|
+
try {
|
|
37
|
+
const content = readFileSync(skillPath, 'utf8');
|
|
38
|
+
if (matchesQuery(content, queryTerms)) {
|
|
39
|
+
results.push({
|
|
40
|
+
id: entry,
|
|
41
|
+
type: 'skill',
|
|
42
|
+
path: skillPath.replace(`${projectRoot}/`, ''),
|
|
43
|
+
content,
|
|
44
|
+
});
|
|
49
45
|
}
|
|
50
46
|
}
|
|
51
|
-
|
|
47
|
+
catch {
|
|
48
|
+
// Not a skill directory or not readable, skip
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (entry.endsWith('.md')) {
|
|
52
|
+
try {
|
|
52
53
|
const content = readFileSync(fullPath, 'utf8');
|
|
53
54
|
if (matchesQuery(content, queryTerms)) {
|
|
54
55
|
results.push({
|
|
@@ -59,9 +60,9 @@ function searchContent(projectRoot, query, scope) {
|
|
|
59
60
|
});
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
catch {
|
|
64
|
+
// Not readable, skip
|
|
65
|
+
}
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
68
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Path sandboxing and command denylist for secure tool execution
|
|
4
4
|
*/
|
|
5
5
|
export interface SafetyConfig {
|
|
6
|
-
/** Project root directory
|
|
6
|
+
/** Project root directory - all file operations are sandboxed here */
|
|
7
7
|
projectRoot: string;
|
|
8
8
|
/** Additional directories to allow (e.g., /tmp for scratch files) */
|
|
9
9
|
allowedPaths?: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safety.d.ts","sourceRoot":"","sources":["../../../src/tools/coding/safety.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,MAAM,WAAW,YAAY;IAC3B,
|
|
1
|
+
{"version":3,"file":"safety.d.ts","sourceRoot":"","sources":["../../../src/tools/coding/safety.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,MAAM,WAAW,YAAY;IAC3B,wEAAwE;IACxE,WAAW,EAAE,MAAM,CAAC;IACpB,qEAAqE;IACrE,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,0DAA0D;IAC1D,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,gEAAgE;IAChE,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B;AAiDD,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,YAAY,GACnB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CA0BpC;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,MAAM,CAE9E;AAMD,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,YAAY,GACnB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAapC;AAQD,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAE1D;AAED,wBAAgB,eAAe,IAAI,YAAY,CAK9C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-runner.d.ts","sourceRoot":"","sources":["../../../src/tools/coding/test-runner.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"test-runner.d.ts","sourceRoot":"","sources":["../../../src/tools/coding/test-runner.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,YAAY,CAAC;AA2JnD,eAAO,MAAM,cAAc,EAAE,IA0G5B,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* test_runner
|
|
2
|
+
* test_runner - Run tests and return structured results
|
|
3
3
|
*
|
|
4
4
|
* Detects the test framework (Vitest, Jest, Mocha) and runs tests with
|
|
5
5
|
* machine-parseable output. Returns structured pass/fail/skip counts
|
|
6
6
|
* and failure details.
|
|
7
7
|
*/
|
|
8
8
|
import { execSync } from 'node:child_process';
|
|
9
|
-
import { existsSync } from 'node:fs';
|
|
9
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
10
10
|
import { join } from 'node:path';
|
|
11
11
|
import { z } from 'zod/v4';
|
|
12
12
|
import { getSafetyConfig } from './safety.js';
|
|
@@ -19,8 +19,7 @@ function detectFramework(projectRoot) {
|
|
|
19
19
|
if (!existsSync(pkgPath))
|
|
20
20
|
return 'unknown';
|
|
21
21
|
try {
|
|
22
|
-
|
|
23
|
-
const pkg = JSON.parse(execSync(`cat "${pkgPath}"`, { encoding: 'utf8', timeout: 5000 }));
|
|
22
|
+
const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'));
|
|
24
23
|
const deps = {
|
|
25
24
|
...pkg.dependencies,
|
|
26
25
|
...pkg.devDependencies,
|
|
@@ -37,12 +36,18 @@ function detectFramework(projectRoot) {
|
|
|
37
36
|
}
|
|
38
37
|
return 'unknown';
|
|
39
38
|
}
|
|
39
|
+
/** Validate that an argument is safe for shell use (no metacharacters) */
|
|
40
|
+
function isSafeShellArg(arg) {
|
|
41
|
+
return /^[\w./@-]+$/.test(arg);
|
|
42
|
+
}
|
|
40
43
|
function buildCommand(framework, file, grep) {
|
|
41
|
-
const
|
|
42
|
-
const
|
|
44
|
+
const safeFile = file && isSafeShellArg(file) ? file : undefined;
|
|
45
|
+
const fileArg = safeFile ? ` ${safeFile}` : '';
|
|
46
|
+
const safeGrep = grep && isSafeShellArg(grep) ? grep : undefined;
|
|
47
|
+
const grepArg = safeGrep ? ` -t "${safeGrep}"` : '';
|
|
43
48
|
switch (framework) {
|
|
44
49
|
case 'vitest':
|
|
45
|
-
return `npx vitest run${fileArg}${
|
|
50
|
+
return `npx vitest run${fileArg}${safeGrep ? ` --reporter=verbose` : ''} --no-color`;
|
|
46
51
|
case 'jest':
|
|
47
52
|
return `npx jest${fileArg}${grepArg} --no-color --forceExit`;
|
|
48
53
|
case 'mocha':
|
|
@@ -22,7 +22,7 @@ function stableStringify(obj) {
|
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* Compute a stable cache key for a (toolName, params) pair.
|
|
25
|
-
* Uses a simple djb2-style hash
|
|
25
|
+
* Uses a simple djb2-style hash - no crypto dep required.
|
|
26
26
|
*/
|
|
27
27
|
function hashKey(toolName, params) {
|
|
28
28
|
const raw = `${toolName}::${stableStringify(params)}`;
|
|
@@ -32,7 +32,7 @@ export function createDocumentSummarizerTool(_db, llmClient) {
|
|
|
32
32
|
}
|
|
33
33
|
const fullContent = chunks.map((c) => c.content).join('\n\n');
|
|
34
34
|
const estimatedTokens = Math.ceil(fullContent.length / CHARS_PER_TOKEN);
|
|
35
|
-
// Short document
|
|
35
|
+
// Short document - return directly without LLM call
|
|
36
36
|
if (estimatedTokens <= SHORT_DOCUMENT_TOKENS) {
|
|
37
37
|
return {
|
|
38
38
|
success: true,
|
|
@@ -45,7 +45,7 @@ export function createDocumentSummarizerTool(_db, llmClient) {
|
|
|
45
45
|
metadata: { executionTime: Date.now() - start },
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
|
-
// Long document
|
|
48
|
+
// Long document - summarize with LLM
|
|
49
49
|
const focusInstruction = focusQuestion
|
|
50
50
|
? `Focus especially on answering: "${focusQuestion}"`
|
|
51
51
|
: '';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Explicit memory storage tool that agents must call to persist information
|
|
5
5
|
* to long-term episodic memory. Agents are never auto-enrolled into memory
|
|
6
|
-
* writes
|
|
6
|
+
* writes - they must invoke this tool with a clear reason.
|
|
7
7
|
*
|
|
8
8
|
* GDPR rationale: Requiring explicit intent aligns with the data minimisation
|
|
9
9
|
* principle (GDPR Art. 5(1)(c)) and purpose limitation principle (Art. 5(1)(b)).
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Explicit memory storage tool that agents must call to persist information
|
|
5
5
|
* to long-term episodic memory. Agents are never auto-enrolled into memory
|
|
6
|
-
* writes
|
|
6
|
+
* writes - they must invoke this tool with a clear reason.
|
|
7
7
|
*
|
|
8
8
|
* GDPR rationale: Requiring explicit intent aligns with the data minimisation
|
|
9
9
|
* principle (GDPR Art. 5(1)(c)) and purpose limitation principle (Art. 5(1)(b)).
|
|
@@ -36,7 +36,7 @@ export function createStoreMemoryTool(memory, agentId) {
|
|
|
36
36
|
name: 'store_memory',
|
|
37
37
|
description: 'Explicitly store important information in long-term memory for future sessions. ' +
|
|
38
38
|
'Only call this when information is genuinely valuable to retain. ' +
|
|
39
|
-
'Provide a clear reason
|
|
39
|
+
'Provide a clear reason - this is required for privacy compliance.',
|
|
40
40
|
parameters: StoreMemoryParamsSchema,
|
|
41
41
|
async execute(params) {
|
|
42
42
|
const { content, tags, reason } = StoreMemoryParamsSchema.parse(params);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Ticket Mutation Tools
|
|
3
3
|
*
|
|
4
|
-
* Tools that allow an agent to update ticket state as it works
|
|
4
|
+
* Tools that allow an agent to update ticket state as it works -
|
|
5
5
|
* closing a ticket when done, moving it between columns, and writing
|
|
6
6
|
* its results back as a comment.
|
|
7
7
|
*
|
|
8
8
|
* These are injected by createTicketTools() and are always paired with
|
|
9
|
-
*
|
|
9
|
+
* admin tools so agents can act on content AND report back through the ticket.
|
|
10
10
|
*/
|
|
11
11
|
import type { Tool } from './base.js';
|
|
12
12
|
/**
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Ticket Mutation Tools
|
|
3
3
|
*
|
|
4
|
-
* Tools that allow an agent to update ticket state as it works
|
|
4
|
+
* Tools that allow an agent to update ticket state as it works -
|
|
5
5
|
* closing a ticket when done, moving it between columns, and writing
|
|
6
6
|
* its results back as a comment.
|
|
7
7
|
*
|
|
8
8
|
* These are injected by createTicketTools() and are always paired with
|
|
9
|
-
*
|
|
9
|
+
* admin tools so agents can act on content AND report back through the ticket.
|
|
10
10
|
*/
|
|
11
11
|
import { z } from 'zod/v4';
|
|
12
12
|
export function createTicketTools(ticketId, client) {
|
|
@@ -41,7 +41,7 @@ export function createTicketTools(ticketId, client) {
|
|
|
41
41
|
};
|
|
42
42
|
const addCommentTool = {
|
|
43
43
|
name: 'add_ticket_comment',
|
|
44
|
-
description: 'Write a comment on the current ticket. Use this to report what you did, what changed in the
|
|
44
|
+
description: 'Write a comment on the current ticket. Use this to report what you did, what changed in the admin, or why you could not complete the task.',
|
|
45
45
|
parameters: z.object({
|
|
46
46
|
text: z.string().min(1).describe('The comment text to add to the ticket'),
|
|
47
47
|
}),
|