task-o-matic 0.0.17 → 0.0.19
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/lib/ai-service/base-operations.d.ts.map +1 -1
- package/dist/lib/ai-service/base-operations.js +1 -2
- package/dist/lib/ai-service/documentation-operations.d.ts +2 -2
- package/dist/lib/ai-service/documentation-operations.d.ts.map +1 -1
- package/dist/lib/ai-service/documentation-operations.js +19 -13
- package/dist/lib/ai-service/filesystem-tools.js +1 -1
- package/dist/lib/ai-service/prd-operations.d.ts.map +1 -1
- package/dist/lib/ai-service/prd-operations.js +4 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-operations.d.ts","sourceRoot":"","sources":["../../../src/lib/ai-service/base-operations.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,qBAAa,cAAc;IACzB,SAAS,CAAC,UAAU,aAAoB;IACxC,SAAS,CAAC,cAAc,iBAAwB;IAChD,SAAS,CAAC,YAAY,eAAsB;IAC5C,SAAS,CAAC,aAAa,gBAAuB;IAE9C;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,SAAS,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,QAAQ;IAQ7D;;;;;;OAMG;IACH,SAAS,CAAC,wBAAwB,CAAC,KAAK,EAAE,GAAG,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"base-operations.d.ts","sourceRoot":"","sources":["../../../src/lib/ai-service/base-operations.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,qBAAa,cAAc;IACzB,SAAS,CAAC,UAAU,aAAoB;IACxC,SAAS,CAAC,cAAc,iBAAwB;IAChD,SAAS,CAAC,YAAY,eAAsB;IAC5C,SAAS,CAAC,aAAa,gBAAuB;IAE9C;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,SAAS,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,QAAQ;IAQ7D;;;;;;OAMG;IACH,SAAS,CAAC,wBAAwB,CAAC,KAAK,EAAE,GAAG,GAAG,IAAI;IAkB9C,UAAU,CACd,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,EAC1B,YAAY,CAAC,EAAE,MAAM,EACrB,WAAW,CAAC,EAAE,MAAM,EACpB,gBAAgB,CAAC,EAAE,gBAAgB,EACnC,WAAW,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GACjC,OAAO,CAAC,MAAM,CAAC;CAgEnB"}
|
|
@@ -46,8 +46,7 @@ class BaseOperations {
|
|
|
46
46
|
* @protected
|
|
47
47
|
*/
|
|
48
48
|
handleContext7ToolResult(chunk) {
|
|
49
|
-
if (chunk.type === "tool-result" &&
|
|
50
|
-
chunk.toolName === "get-library-docs") {
|
|
49
|
+
if (chunk.type === "tool-result" && chunk.toolName === "get-library-docs") {
|
|
51
50
|
const docs = chunk.output;
|
|
52
51
|
const libraryID = chunk.input?.context7CompatibleLibraryID || "unknown";
|
|
53
52
|
const topic = chunk.input?.topic || "general";
|
|
@@ -4,8 +4,8 @@ export declare class DocumentationOperations extends BaseOperations {
|
|
|
4
4
|
enhanceTaskWithDocumentation(taskId: string, taskTitle: string, taskDescription: string, stackInfo?: string, streamingOptions?: StreamingOptions, retryConfig?: Partial<RetryConfig>, config?: Partial<AIConfig>, existingResearch?: Record<string, Array<{
|
|
5
5
|
query: string;
|
|
6
6
|
doc: string;
|
|
7
|
-
}
|
|
8
|
-
analyzeDocumentationNeeds(taskId: string, taskTitle: string, taskDescription: string, stackInfo?: string, streamingOptions?: StreamingOptions, retryConfig?: Partial<RetryConfig>, config?: Partial<AIConfig>, existingResearch?: (TaskDocumentation | undefined)[]): Promise<DocumentationDetection>;
|
|
7
|
+
}>>, enableFilesystemTools?: boolean): Promise<string>;
|
|
8
|
+
analyzeDocumentationNeeds(taskId: string, taskTitle: string, taskDescription: string, stackInfo?: string, streamingOptions?: StreamingOptions, retryConfig?: Partial<RetryConfig>, config?: Partial<AIConfig>, existingResearch?: (TaskDocumentation | undefined)[], enableFilesystemTools?: boolean): Promise<DocumentationDetection>;
|
|
9
9
|
generateDocumentationRecap(libraries: Array<{
|
|
10
10
|
name: string;
|
|
11
11
|
context7Id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documentation-operations.d.ts","sourceRoot":"","sources":["../../../src/lib/ai-service/documentation-operations.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,QAAQ,EACR,sBAAsB,EACtB,gBAAgB,EAChB,WAAW,EACX,iBAAiB,EAClB,MAAM,aAAa,CAAC;AAKrB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,qBAAa,uBAAwB,SAAQ,cAAc;IACnD,4BAA4B,CAChC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,MAAM,EACvB,SAAS,CAAC,EAAE,MAAM,EAClB,gBAAgB,CAAC,EAAE,gBAAgB,EACnC,WAAW,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,EAClC,MAAM,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,EAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"documentation-operations.d.ts","sourceRoot":"","sources":["../../../src/lib/ai-service/documentation-operations.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,QAAQ,EACR,sBAAsB,EACtB,gBAAgB,EAChB,WAAW,EACX,iBAAiB,EAClB,MAAM,aAAa,CAAC;AAKrB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,qBAAa,uBAAwB,SAAQ,cAAc;IACnD,4BAA4B,CAChC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,MAAM,EACvB,SAAS,CAAC,EAAE,MAAM,EAClB,gBAAgB,CAAC,EAAE,gBAAgB,EACnC,WAAW,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,EAClC,MAAM,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,EAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,EACxE,qBAAqB,CAAC,EAAE,OAAO,GAC9B,OAAO,CAAC,MAAM,CAAC;IA6JZ,yBAAyB,CAC7B,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,MAAM,EACvB,SAAS,CAAC,EAAE,MAAM,EAClB,gBAAgB,CAAC,EAAE,gBAAgB,EACnC,WAAW,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,EAClC,MAAM,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,EAC1B,gBAAgB,CAAC,EAAE,CAAC,iBAAiB,GAAG,SAAS,CAAC,EAAE,EACpD,qBAAqB,CAAC,EAAE,OAAO,GAC9B,OAAO,CAAC,sBAAsB,CAAC;IAmM5B,0BAA0B,CAC9B,SAAS,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,EACtE,gBAAgB,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,EAC7D,gBAAgB,CAAC,EAAE,gBAAgB,EACnC,WAAW,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GACjC,OAAO,CAAC,MAAM,CAAC;CA8CnB"}
|
|
@@ -8,7 +8,7 @@ const ai_service_factory_1 = require("../../utils/ai-service-factory");
|
|
|
8
8
|
const filesystem_tools_1 = require("./filesystem-tools");
|
|
9
9
|
const base_operations_1 = require("./base-operations");
|
|
10
10
|
class DocumentationOperations extends base_operations_1.BaseOperations {
|
|
11
|
-
async enhanceTaskWithDocumentation(taskId, taskTitle, taskDescription, stackInfo, streamingOptions, retryConfig, config, existingResearch) {
|
|
11
|
+
async enhanceTaskWithDocumentation(taskId, taskTitle, taskDescription, stackInfo, streamingOptions, retryConfig, config, existingResearch, enableFilesystemTools) {
|
|
12
12
|
return this.retryHandler
|
|
13
13
|
.executeWithRetry(async () => {
|
|
14
14
|
const mcpTools = await this.context7Client.getMCPTools();
|
|
@@ -43,7 +43,7 @@ class DocumentationOperations extends base_operations_1.BaseOperations {
|
|
|
43
43
|
const prompt = promptResult.prompt;
|
|
44
44
|
const allTools = {
|
|
45
45
|
...mcpTools,
|
|
46
|
-
...filesystem_tools_1.filesystemTools,
|
|
46
|
+
...(enableFilesystemTools ? filesystem_tools_1.filesystemTools : {}),
|
|
47
47
|
};
|
|
48
48
|
const result = await (0, ai_1.streamText)({
|
|
49
49
|
model,
|
|
@@ -51,17 +51,21 @@ class DocumentationOperations extends base_operations_1.BaseOperations {
|
|
|
51
51
|
system: prompts_1.TASK_ENHANCEMENT_SYSTEM_PROMPT +
|
|
52
52
|
`
|
|
53
53
|
|
|
54
|
-
You have access to Context7 documentation tools and filesystem tools.
|
|
54
|
+
You have access to Context7 documentation tools${enableFilesystemTools ? " and filesystem tools" : ""}.
|
|
55
55
|
|
|
56
56
|
## Available Tools:
|
|
57
57
|
- Context7 MCP tools (context7_resolve_library_id, context7_get_library_docs) for library documentation
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
${enableFilesystemTools
|
|
59
|
+
? `- readFile: Read the contents of any file in the project
|
|
60
|
+
- listDirectory: List contents of directories`
|
|
61
|
+
: ""}
|
|
60
62
|
|
|
61
63
|
## Research Strategy:
|
|
62
64
|
1. Use Context7 MCP tools for library documentation research
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
${enableFilesystemTools
|
|
66
|
+
? `2. Use filesystem tools to understand project structure, existing code, and dependencies`
|
|
67
|
+
: ""}
|
|
68
|
+
${enableFilesystemTools ? "3" : "2"}. Synthesize information from all sources to enhance the task
|
|
65
69
|
|
|
66
70
|
Technology stack context: ${stackInfo || "Not specified"}
|
|
67
71
|
|
|
@@ -103,12 +107,12 @@ ${existingResearchContext}`,
|
|
|
103
107
|
const toolCalls = await result.toolCalls;
|
|
104
108
|
const toolResults = await result.toolResults;
|
|
105
109
|
if (toolCalls.length > 0) {
|
|
106
|
-
console.log("AI made tool calls:", toolCalls.map((tc) => ({ tool: tc
|
|
110
|
+
console.log("AI made tool calls:", toolCalls.map((tc) => ({ tool: tc?.toolName, input: tc?.input })));
|
|
107
111
|
}
|
|
108
112
|
if (toolResults.length > 0) {
|
|
109
113
|
console.log("Tool results received:", toolResults.map((tr) => ({
|
|
110
|
-
tool: tr
|
|
111
|
-
output: tr
|
|
114
|
+
tool: tr?.toolName,
|
|
115
|
+
output: tr?.output,
|
|
112
116
|
})));
|
|
113
117
|
}
|
|
114
118
|
let fullText = "";
|
|
@@ -124,7 +128,8 @@ ${existingResearchContext}`,
|
|
|
124
128
|
await this.context7Client.closeMCPConnection();
|
|
125
129
|
});
|
|
126
130
|
}
|
|
127
|
-
async analyzeDocumentationNeeds(taskId, taskTitle, taskDescription, stackInfo, streamingOptions, retryConfig, config, existingResearch) {
|
|
131
|
+
async analyzeDocumentationNeeds(taskId, taskTitle, taskDescription, stackInfo, streamingOptions, retryConfig, config, existingResearch, enableFilesystemTools) {
|
|
132
|
+
// @ts-expect-error tool result type discrepency i cant be bothered with (that will probably bite me later...)
|
|
128
133
|
return this.retryHandler
|
|
129
134
|
.executeWithRetry(async () => {
|
|
130
135
|
const mcpTools = await this.context7Client.getMCPTools();
|
|
@@ -158,6 +163,7 @@ ${existingResearchContext}`,
|
|
|
158
163
|
const files = [];
|
|
159
164
|
const allTools = {
|
|
160
165
|
...mcpTools,
|
|
166
|
+
...(enableFilesystemTools ? filesystem_tools_1.filesystemTools : {}),
|
|
161
167
|
};
|
|
162
168
|
const result = await (0, ai_1.streamText)({
|
|
163
169
|
model,
|
|
@@ -259,8 +265,8 @@ ${existingResearchContext}`,
|
|
|
259
265
|
libraries,
|
|
260
266
|
confidence: libraries.length > 0 ? 0.8 : 0.3,
|
|
261
267
|
toolResults: toolResults.map((tr) => ({
|
|
262
|
-
toolName: tr
|
|
263
|
-
output: tr
|
|
268
|
+
toolName: tr?.toolName,
|
|
269
|
+
output: tr?.output,
|
|
264
270
|
})),
|
|
265
271
|
files,
|
|
266
272
|
};
|
|
@@ -13,7 +13,7 @@ exports.readFileTool = (0, ai_1.tool)({
|
|
|
13
13
|
execute: async ({ filePath }) => {
|
|
14
14
|
try {
|
|
15
15
|
const resolvedPath = (0, path_1.resolve)(filePath);
|
|
16
|
-
const content = await (0, promises_1.readFile)(resolvedPath,
|
|
16
|
+
const content = await (0, promises_1.readFile)(resolvedPath, "utf-8");
|
|
17
17
|
const stats = await (0, promises_1.stat)(resolvedPath);
|
|
18
18
|
return {
|
|
19
19
|
success: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prd-operations.d.ts","sourceRoot":"","sources":["../../../src/lib/ai-service/prd-operations.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,QAAQ,EAER,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EAIZ,MAAM,aAAa,CAAC;AAYrB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAMnD,qBAAa,aAAc,SAAQ,cAAc;IACzC,QAAQ,CACZ,UAAU,EAAE,MAAM,EAClB,MAAM,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,EAC1B,cAAc,CAAC,EAAE,MAAM,EACvB,WAAW,CAAC,EAAE,MAAM,EACpB,gBAAgB,CAAC,EAAE,gBAAgB,EACnC,WAAW,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,EAClC,gBAAgB,CAAC,EAAE,MAAM,EACzB,qBAAqB,CAAC,EAAE,OAAO,GAC9B,OAAO,CAAC,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"prd-operations.d.ts","sourceRoot":"","sources":["../../../src/lib/ai-service/prd-operations.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,QAAQ,EAER,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EAIZ,MAAM,aAAa,CAAC;AAYrB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAMnD,qBAAa,aAAc,SAAQ,cAAc;IACzC,QAAQ,CACZ,UAAU,EAAE,MAAM,EAClB,MAAM,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,EAC1B,cAAc,CAAC,EAAE,MAAM,EACvB,WAAW,CAAC,EAAE,MAAM,EACpB,gBAAgB,CAAC,EAAE,gBAAgB,EACnC,WAAW,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,EAClC,gBAAgB,CAAC,EAAE,MAAM,EACzB,qBAAqB,CAAC,EAAE,OAAO,GAC9B,OAAO,CAAC,gBAAgB,CAAC;IA+LtB,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,EACnC,WAAW,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GACjC,OAAO,CAAC,MAAM,CAAC;IAqBZ,WAAW,CACf,IAAI,EAAE,MAAM,EAAE,EACd,mBAAmB,EAAE,MAAM,EAC3B,MAAM,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,EAC1B,cAAc,CAAC,EAAE,MAAM,EACvB,WAAW,CAAC,EAAE,MAAM,EACpB,gBAAgB,CAAC,EAAE,gBAAgB,EACnC,WAAW,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GACjC,OAAO,CAAC,MAAM,CAAC;CA0BnB"}
|
|
@@ -42,6 +42,10 @@ const base_operations_1 = require("./base-operations");
|
|
|
42
42
|
const task_o_matic_error_1 = require("../../utils/task-o-matic-error");
|
|
43
43
|
class PRDOperations extends base_operations_1.BaseOperations {
|
|
44
44
|
async parsePRD(prdContent, config, promptOverride, userMessage, streamingOptions, retryConfig, workingDirectory, enableFilesystemTools) {
|
|
45
|
+
// console.log(
|
|
46
|
+
// `[Library Debug] parsePRD called. Config arg has key: ${!!config?.apiKey} Provider internal key: ${!!this.modelProvider.getAIConfig()
|
|
47
|
+
// ?.apiKey}`
|
|
48
|
+
// );
|
|
45
49
|
return this.retryHandler.executeWithRetry(async () => {
|
|
46
50
|
let stackInfo = "";
|
|
47
51
|
try {
|