aibridge-context 1.2.0 → 1.4.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/core/stateManager.js +1179 -68
- package/core/watcher.js +9 -9
- package/package.json +1 -1
- package/templates/state.template.json +9 -4
package/core/watcher.js
CHANGED
|
@@ -7,6 +7,8 @@ const { syncContextToGit } = require('./gitSync');
|
|
|
7
7
|
const {
|
|
8
8
|
createDebouncedStateUpdater,
|
|
9
9
|
loadRuntimeConfig,
|
|
10
|
+
scoreEvent,
|
|
11
|
+
shouldIgnoreProjectFile,
|
|
10
12
|
updateProjectState
|
|
11
13
|
} = require('./stateManager');
|
|
12
14
|
|
|
@@ -18,8 +20,7 @@ async function startWatcher(projectRoot, options) {
|
|
|
18
20
|
const settings = Object.assign({ logger: null }, options);
|
|
19
21
|
const logger = settings.logger;
|
|
20
22
|
const config = await loadRuntimeConfig(projectRoot);
|
|
21
|
-
const syncCallback = async () =>
|
|
22
|
-
syncContextToGit(projectRoot, config.gitSync, logger);
|
|
23
|
+
const syncCallback = async () => syncContextToGit(projectRoot, config.gitSync, logger);
|
|
23
24
|
const debouncedUpdater = createDebouncedStateUpdater(projectRoot, {
|
|
24
25
|
debounceMs: config.debounceMs,
|
|
25
26
|
logger,
|
|
@@ -27,11 +28,10 @@ async function startWatcher(projectRoot, options) {
|
|
|
27
28
|
});
|
|
28
29
|
|
|
29
30
|
const watcher = chokidar.watch(projectRoot, {
|
|
30
|
-
ignored
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
],
|
|
31
|
+
ignored(filePath) {
|
|
32
|
+
const normalizedPath = normalizeFilePath(projectRoot, filePath);
|
|
33
|
+
return shouldIgnoreProjectFile(normalizedPath);
|
|
34
|
+
},
|
|
35
35
|
ignoreInitial: true,
|
|
36
36
|
persistent: true
|
|
37
37
|
});
|
|
@@ -39,12 +39,12 @@ async function startWatcher(projectRoot, options) {
|
|
|
39
39
|
function handleEvent(action, filePath) {
|
|
40
40
|
const normalizedPath = normalizeFilePath(projectRoot, filePath);
|
|
41
41
|
|
|
42
|
-
if (!normalizedPath || normalizedPath
|
|
42
|
+
if (!normalizedPath || shouldIgnoreProjectFile(normalizedPath) || scoreEvent(normalizedPath) < 2) {
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
if (logger) {
|
|
47
|
-
logger.
|
|
47
|
+
logger.debug(`Queued meaningful ${action} for ${normalizedPath}`);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
debouncedUpdater.enqueue({
|
package/package.json
CHANGED
|
@@ -2,11 +2,16 @@
|
|
|
2
2
|
"project": "",
|
|
3
3
|
"version": "",
|
|
4
4
|
"last_updated": "1970-01-01T00:00:00.000Z",
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
"
|
|
5
|
+
"ai_summary": "",
|
|
6
|
+
"tech_stack": {
|
|
7
|
+
"language": "",
|
|
8
|
+
"framework": "",
|
|
9
|
+
"runtime": "",
|
|
10
|
+
"package_manager": ""
|
|
8
11
|
},
|
|
12
|
+
"current_stage": "",
|
|
9
13
|
"recent_updates": [],
|
|
10
|
-
"
|
|
14
|
+
"key_features": [],
|
|
15
|
+
"known_issues": [],
|
|
11
16
|
"next_steps": []
|
|
12
17
|
}
|