@comfanion/workflow 4.25.1 → 4.27.0
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
CHANGED
package/src/build-info.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: "Business Analyst - Use for: gathering requirements, validating requirements, brainstorming. Has skills: requirements-gathering, requirements-validation, acceptance-criteria, methodologies"
|
|
3
|
-
mode: all # Can be primary agent or invoked via @analyst
|
|
3
|
+
mode: allа т # Can be primary agent or invoked via @analyst
|
|
4
4
|
temperature: 0.3
|
|
5
5
|
|
|
6
6
|
# Tools - what this agent can use
|
|
@@ -13,14 +13,12 @@ import fs from "fs/promises"
|
|
|
13
13
|
* - tool.execute.after - after Edit/Write tool executes
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
// File extensions for each index type
|
|
17
16
|
const INDEX_EXTENSIONS: Record<string, string[]> = {
|
|
18
17
|
code: ['.js', '.ts', '.jsx', '.tsx', '.mjs', '.cjs', '.py', '.go', '.rs', '.java', '.kt', '.swift', '.c', '.cpp', '.h', '.hpp', '.cs', '.rb', '.php', '.scala', '.clj'],
|
|
19
18
|
docs: ['.md', '.mdx', '.txt', '.rst', '.adoc'],
|
|
20
19
|
config: ['.yaml', '.yml', '.json', '.toml', '.ini', '.xml'],
|
|
21
20
|
}
|
|
22
21
|
|
|
23
|
-
// Debounce map to batch rapid changes
|
|
24
22
|
const pendingFiles: Map<string, { indexName: string; timestamp: number }> = new Map()
|
|
25
23
|
const DEBOUNCE_MS = 2000
|
|
26
24
|
|
|
@@ -74,27 +72,23 @@ async function processPendingFiles(projectRoot: string): Promise<void> {
|
|
|
74
72
|
console.log(`[file-indexer] ✅ Reindexed: ${path.relative(projectRoot, filePath)} -> ${indexName}`)
|
|
75
73
|
}
|
|
76
74
|
} catch (e) {
|
|
77
|
-
|
|
75
|
+
// Silently ignore indexing errors
|
|
78
76
|
}
|
|
79
77
|
}
|
|
80
78
|
|
|
81
79
|
await indexer.unloadModel()
|
|
82
80
|
}
|
|
83
81
|
} catch (e) {
|
|
84
|
-
|
|
82
|
+
// Silently ignore - vectorizer might not be installed
|
|
85
83
|
}
|
|
86
84
|
}
|
|
87
85
|
|
|
88
86
|
export const FileIndexerPlugin: Plugin = async ({ directory }) => {
|
|
89
87
|
let processingTimeout: NodeJS.Timeout | null = null
|
|
90
88
|
|
|
91
|
-
// Log plugin initialization
|
|
92
|
-
console.log(`[file-indexer] 🚀 Plugin loaded for: ${directory}`)
|
|
93
|
-
|
|
94
89
|
function queueFileForIndexing(filePath: string): void {
|
|
95
90
|
const relativePath = path.relative(directory, filePath)
|
|
96
91
|
|
|
97
|
-
// Skip ignored directories
|
|
98
92
|
if (
|
|
99
93
|
relativePath.startsWith('node_modules') ||
|
|
100
94
|
relativePath.startsWith('.git') ||
|
|
@@ -109,8 +103,6 @@ export const FileIndexerPlugin: Plugin = async ({ directory }) => {
|
|
|
109
103
|
const indexName = getIndexForFile(filePath)
|
|
110
104
|
if (!indexName) return
|
|
111
105
|
|
|
112
|
-
console.log(`[file-indexer] 📝 Queued: ${relativePath} -> ${indexName}`)
|
|
113
|
-
|
|
114
106
|
pendingFiles.set(filePath, { indexName, timestamp: Date.now() })
|
|
115
107
|
|
|
116
108
|
if (processingTimeout) {
|
|
@@ -124,46 +116,25 @@ export const FileIndexerPlugin: Plugin = async ({ directory }) => {
|
|
|
124
116
|
}
|
|
125
117
|
|
|
126
118
|
return {
|
|
127
|
-
/**
|
|
128
|
-
* Event handler for file events
|
|
129
|
-
*/
|
|
130
119
|
event: async ({ event }) => {
|
|
131
|
-
//
|
|
132
|
-
const eventData = JSON.stringify(event.data || {}, null, 2).slice(0, 500)
|
|
133
|
-
console.log(`[file-indexer] 📨 Event: ${event.type}\n${eventData}`)
|
|
134
|
-
|
|
135
|
-
// file.edited - when agent edits a file via Edit tool
|
|
120
|
+
// file.edited - when agent edits a file
|
|
136
121
|
if (event.type === "file.edited") {
|
|
137
122
|
const filePath = event.data?.path || event.data?.filePath || event.data?.file
|
|
138
|
-
|
|
139
|
-
if (filePath) {
|
|
140
|
-
queueFileForIndexing(filePath)
|
|
141
|
-
}
|
|
123
|
+
if (filePath) queueFileForIndexing(filePath)
|
|
142
124
|
}
|
|
143
125
|
|
|
144
|
-
// file.watcher.updated - when file changes on disk
|
|
126
|
+
// file.watcher.updated - when file changes on disk
|
|
145
127
|
if (event.type === "file.watcher.updated") {
|
|
146
128
|
const filePath = event.data?.path || event.data?.filePath || event.data?.file
|
|
147
|
-
|
|
148
|
-
if (filePath) {
|
|
149
|
-
queueFileForIndexing(filePath)
|
|
150
|
-
}
|
|
129
|
+
if (filePath) queueFileForIndexing(filePath)
|
|
151
130
|
}
|
|
152
131
|
},
|
|
153
132
|
|
|
154
|
-
/**
|
|
155
|
-
* Hook: After any tool executes
|
|
156
|
-
*/
|
|
157
133
|
"tool.execute.after": async (input, output) => {
|
|
158
134
|
const toolName = input.tool?.toLowerCase()
|
|
159
135
|
const filePath = input.args?.filePath
|
|
160
136
|
|
|
161
|
-
// Log full input structure
|
|
162
|
-
console.log(`[file-indexer] 🔧 tool.execute.after: ${toolName}, filePath: ${filePath}`)
|
|
163
|
-
console.log(`[file-indexer] 🔧 input.args: ${JSON.stringify(input.args || {}, null, 2).slice(0, 300)}`)
|
|
164
|
-
|
|
165
137
|
if ((toolName === "edit" || toolName === "write" || toolName === "patch") && filePath) {
|
|
166
|
-
console.log(`[file-indexer] 📝 Tool edited file: ${filePath}`)
|
|
167
138
|
queueFileForIndexing(filePath)
|
|
168
139
|
}
|
|
169
140
|
},
|