@hubblecommerce/overmind-core 0.1.8 → 0.1.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/dist/src/config/app.config.d.ts +4 -0
- package/dist/src/config/app.config.d.ts.map +1 -1
- package/dist/src/config/app.config.js +4 -0
- package/dist/src/tools/repository.tool.d.ts +55 -0
- package/dist/src/tools/repository.tool.d.ts.map +1 -0
- package/dist/src/tools/repository.tool.js +94 -0
- package/dist/src/types/repository.types.d.ts +22 -0
- package/dist/src/types/repository.types.d.ts.map +1 -0
- package/dist/src/types/repository.types.js +1 -0
- package/package.json +9 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.config.d.ts","sourceRoot":"","sources":["../../../src/config/app.config.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"app.config.d.ts","sourceRoot":"","sources":["../../../src/config/app.config.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuDlB,CAAC"}
|
|
@@ -49,4 +49,8 @@ export const config = {
|
|
|
49
49
|
suggestionsSpaceId: process.env.CONFLUENCE_SUGGESTIONS_SPACE_ID || '',
|
|
50
50
|
suggestionsParentId: process.env.CONFLUENCE_SUGGESTIONS_PARENT_ID || '',
|
|
51
51
|
},
|
|
52
|
+
intake: {
|
|
53
|
+
url: process.env.INTAKE_URL || 'http://localhost:3002',
|
|
54
|
+
internalToken: process.env.INTAKE_INTERNAL_TOKEN || '',
|
|
55
|
+
},
|
|
52
56
|
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare function createSearchRepositoryTool(): import("@langchain/core/tools").DynamicStructuredTool<z.ZodObject<{
|
|
3
|
+
projectId: z.ZodString;
|
|
4
|
+
pattern: z.ZodString;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
projectId: string;
|
|
7
|
+
pattern: string;
|
|
8
|
+
}, {
|
|
9
|
+
projectId: string;
|
|
10
|
+
pattern: string;
|
|
11
|
+
}>, {
|
|
12
|
+
projectId: string;
|
|
13
|
+
pattern: string;
|
|
14
|
+
}, {
|
|
15
|
+
projectId: string;
|
|
16
|
+
pattern: string;
|
|
17
|
+
}, string, unknown, "search_repository_code">;
|
|
18
|
+
export declare function createGetRepositoryFileTool(): import("@langchain/core/tools").DynamicStructuredTool<z.ZodObject<{
|
|
19
|
+
projectId: z.ZodString;
|
|
20
|
+
filePath: z.ZodString;
|
|
21
|
+
}, "strip", z.ZodTypeAny, {
|
|
22
|
+
projectId: string;
|
|
23
|
+
filePath: string;
|
|
24
|
+
}, {
|
|
25
|
+
projectId: string;
|
|
26
|
+
filePath: string;
|
|
27
|
+
}>, {
|
|
28
|
+
projectId: string;
|
|
29
|
+
filePath: string;
|
|
30
|
+
}, {
|
|
31
|
+
projectId: string;
|
|
32
|
+
filePath: string;
|
|
33
|
+
}, string, unknown, "get_repository_file">;
|
|
34
|
+
export declare function createGetRepositoryStructureTool(): import("@langchain/core/tools").DynamicStructuredTool<z.ZodObject<{
|
|
35
|
+
projectId: z.ZodString;
|
|
36
|
+
path: z.ZodOptional<z.ZodString>;
|
|
37
|
+
depth: z.ZodOptional<z.ZodNumber>;
|
|
38
|
+
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
projectId: string;
|
|
40
|
+
path?: string | undefined;
|
|
41
|
+
depth?: number | undefined;
|
|
42
|
+
}, {
|
|
43
|
+
projectId: string;
|
|
44
|
+
path?: string | undefined;
|
|
45
|
+
depth?: number | undefined;
|
|
46
|
+
}>, {
|
|
47
|
+
projectId: string;
|
|
48
|
+
path?: string | undefined;
|
|
49
|
+
depth?: number | undefined;
|
|
50
|
+
}, {
|
|
51
|
+
projectId: string;
|
|
52
|
+
path?: string | undefined;
|
|
53
|
+
depth?: number | undefined;
|
|
54
|
+
}, string, unknown, "get_repository_structure">;
|
|
55
|
+
//# sourceMappingURL=repository.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository.tool.d.ts","sourceRoot":"","sources":["../../../src/tools/repository.tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAsBxB,wBAAgB,0BAA0B;;;;;;;;;;;;;;;8CAyBzC;AAED,wBAAgB,2BAA2B;;;;;;;;;;;;;;;2CAyB1C;AAED,wBAAgB,gCAAgC;;;;;;;;;;;;;;;;;;;;gDA6B/C"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { tool } from '@langchain/core/tools';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { config } from '../config/app.config.js';
|
|
4
|
+
async function intakeRequest(endpoint, body) {
|
|
5
|
+
const response = await fetch(`${config.intake.url}/repository${endpoint}`, {
|
|
6
|
+
method: 'POST',
|
|
7
|
+
headers: {
|
|
8
|
+
'Content-Type': 'application/json',
|
|
9
|
+
'Authorization': `Bearer ${config.intake.internalToken}`,
|
|
10
|
+
},
|
|
11
|
+
body: JSON.stringify(body),
|
|
12
|
+
});
|
|
13
|
+
if (!response.ok) {
|
|
14
|
+
const error = await response.text();
|
|
15
|
+
throw new Error(`Intake API error: ${response.status} ${error}`);
|
|
16
|
+
}
|
|
17
|
+
return response.json();
|
|
18
|
+
}
|
|
19
|
+
export function createSearchRepositoryTool() {
|
|
20
|
+
return tool(async ({ projectId, pattern }) => {
|
|
21
|
+
try {
|
|
22
|
+
const result = await intakeRequest('/search', { projectId, pattern });
|
|
23
|
+
return JSON.stringify({
|
|
24
|
+
output: result.output,
|
|
25
|
+
totalMatches: result.totalMatches,
|
|
26
|
+
truncated: result.truncated,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
return JSON.stringify({ error: true, message: String(error) });
|
|
31
|
+
}
|
|
32
|
+
}, {
|
|
33
|
+
name: 'search_repository_code',
|
|
34
|
+
description: `Search a GitLab repository's code for a pattern. Returns matching lines grouped by file path with surrounding context.
|
|
35
|
+
Use specific patterns to get focused results — broad patterns may be truncated.
|
|
36
|
+
The 'truncated' flag indicates the query was too broad; narrow the pattern and retry.`,
|
|
37
|
+
schema: z.object({
|
|
38
|
+
projectId: z.string().describe('GitLab project path (e.g. "group/project")'),
|
|
39
|
+
pattern: z.string().describe('Search pattern (JavaScript regex syntax)'),
|
|
40
|
+
}),
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
export function createGetRepositoryFileTool() {
|
|
44
|
+
return tool(async ({ projectId, filePath }) => {
|
|
45
|
+
try {
|
|
46
|
+
const result = await intakeRequest('/file', { projectId, filePath });
|
|
47
|
+
return JSON.stringify({
|
|
48
|
+
content: result.content,
|
|
49
|
+
totalChars: result.totalChars,
|
|
50
|
+
truncated: result.truncated,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
return JSON.stringify({ error: true, message: String(error) });
|
|
55
|
+
}
|
|
56
|
+
}, {
|
|
57
|
+
name: 'get_repository_file',
|
|
58
|
+
description: `Get the full content of a specific file from a GitLab repository.
|
|
59
|
+
Use after finding relevant files via search_repository_code or get_repository_structure.
|
|
60
|
+
Large files may be truncated.`,
|
|
61
|
+
schema: z.object({
|
|
62
|
+
projectId: z.string().describe('GitLab project path (e.g. "group/project")'),
|
|
63
|
+
filePath: z.string().describe('Path to the file within the repository (e.g. "src/index.ts")'),
|
|
64
|
+
}),
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
export function createGetRepositoryStructureTool() {
|
|
68
|
+
return tool(async ({ projectId, path, depth }) => {
|
|
69
|
+
try {
|
|
70
|
+
const result = await intakeRequest('/structure', {
|
|
71
|
+
projectId,
|
|
72
|
+
path,
|
|
73
|
+
depth,
|
|
74
|
+
});
|
|
75
|
+
return JSON.stringify({
|
|
76
|
+
structure: result.structure,
|
|
77
|
+
truncated: result.truncated,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
return JSON.stringify({ error: true, message: String(error) });
|
|
82
|
+
}
|
|
83
|
+
}, {
|
|
84
|
+
name: 'get_repository_structure',
|
|
85
|
+
description: `Get the directory structure of a GitLab repository as an indented file tree.
|
|
86
|
+
By default shows top-level only (depth 1). Use 'path' to drill into a subdirectory and 'depth' to control levels.
|
|
87
|
+
Start with depth 1 to orient, then drill deeper into relevant directories.`,
|
|
88
|
+
schema: z.object({
|
|
89
|
+
projectId: z.string().describe('GitLab project path (e.g. "group/project")'),
|
|
90
|
+
path: z.string().optional().describe('Subdirectory to start from (e.g. "src/components")'),
|
|
91
|
+
depth: z.number().optional().describe('How many levels deep to show (default: 1)'),
|
|
92
|
+
}),
|
|
93
|
+
});
|
|
94
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface RepositorySearchResponse {
|
|
2
|
+
projectId: string;
|
|
3
|
+
pattern: string;
|
|
4
|
+
output: string;
|
|
5
|
+
totalMatches: number;
|
|
6
|
+
truncated: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface RepositoryFileResponse {
|
|
9
|
+
projectId: string;
|
|
10
|
+
filePath: string;
|
|
11
|
+
content: string;
|
|
12
|
+
totalChars: number;
|
|
13
|
+
truncated: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface RepositoryStructureResponse {
|
|
16
|
+
projectId: string;
|
|
17
|
+
path: string;
|
|
18
|
+
depth: number;
|
|
19
|
+
structure: string;
|
|
20
|
+
truncated: boolean;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=repository.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository.types.d.ts","sourceRoot":"","sources":["../../../src/types/repository.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,wBAAwB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,sBAAsB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,2BAA2B;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubblecommerce/overmind-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Shared infrastructure package for the Overmind AI agent system",
|
|
6
6
|
"main": "./dist/src/index.js",
|
|
@@ -53,6 +53,14 @@
|
|
|
53
53
|
"./utils/repomix-search": {
|
|
54
54
|
"types": "./dist/src/utils/repomix-search.d.ts",
|
|
55
55
|
"default": "./dist/src/utils/repomix-search.js"
|
|
56
|
+
},
|
|
57
|
+
"./tools/repository": {
|
|
58
|
+
"types": "./dist/src/tools/repository.tool.d.ts",
|
|
59
|
+
"default": "./dist/src/tools/repository.tool.js"
|
|
60
|
+
},
|
|
61
|
+
"./types/repository": {
|
|
62
|
+
"types": "./dist/src/types/repository.types.d.ts",
|
|
63
|
+
"default": "./dist/src/types/repository.types.js"
|
|
56
64
|
}
|
|
57
65
|
},
|
|
58
66
|
"files": [
|