gsd-pi 2.72.0-dev.3118184 → 2.72.0-dev.3159350
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/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +14 -14
- package/dist/web/standalone/.next/build-manifest.json +2 -2
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +14 -14
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware-manifest.json +5 -5
- package/dist/web/standalone/.next/server/pages/404.html +1 -1
- package/dist/web/standalone/.next/server/pages/500.html +1 -1
- package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
- package/package.json +1 -1
- package/dist/resources/extensions/gsd/auto-observability.js +0 -54
- package/dist/resources/extensions/gsd/file-watcher.js +0 -80
- package/dist/resources/extensions/gsd/rtk-status.js +0 -43
- package/src/resources/extensions/gsd/auto-observability.ts +0 -72
- package/src/resources/extensions/gsd/file-watcher.ts +0 -100
- package/src/resources/extensions/gsd/rtk-status.ts +0 -53
- /package/dist/web/standalone/.next/static/{NzO79SOz9jHX-VY5-0t2O → eR2tLKungpmiiOyUIhqjF}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{NzO79SOz9jHX-VY5-0t2O → eR2tLKungpmiiOyUIhqjF}/_ssgManifest.js +0 -0
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import type { FSWatcher } from "chokidar";
|
|
2
|
-
import type { EventBus } from "@gsd/pi-coding-agent";
|
|
3
|
-
import { relative } from "node:path";
|
|
4
|
-
|
|
5
|
-
let watcher: FSWatcher | null = null;
|
|
6
|
-
let pending = new Map<string, ReturnType<typeof setTimeout>>();
|
|
7
|
-
|
|
8
|
-
const EVENT_MAP: Record<string, string> = {
|
|
9
|
-
"settings.json": "settings-changed",
|
|
10
|
-
"auth.json": "auth-changed",
|
|
11
|
-
"models.json": "models-changed",
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const EXTENSIONS_DIR = "extensions";
|
|
15
|
-
|
|
16
|
-
const IGNORED_PATTERNS = [
|
|
17
|
-
"**/sessions/**",
|
|
18
|
-
"**/*.tmp",
|
|
19
|
-
"**/*.swp",
|
|
20
|
-
"**/*~",
|
|
21
|
-
"**/.DS_Store",
|
|
22
|
-
];
|
|
23
|
-
|
|
24
|
-
const DEBOUNCE_MS = 300;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Start watching `agentDir` (e.g. `~/.gsd/agent/`) for config changes.
|
|
28
|
-
* Emits events on the supplied EventBus when watched files are modified.
|
|
29
|
-
*/
|
|
30
|
-
export async function startFileWatcher(
|
|
31
|
-
agentDir: string,
|
|
32
|
-
eventBus: EventBus,
|
|
33
|
-
): Promise<void> {
|
|
34
|
-
if (watcher) {
|
|
35
|
-
await watcher.close();
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const { watch } = await import("chokidar");
|
|
39
|
-
|
|
40
|
-
pending = new Map<string, ReturnType<typeof setTimeout>>();
|
|
41
|
-
|
|
42
|
-
function debounceEmit(event: string): void {
|
|
43
|
-
const existing = pending.get(event);
|
|
44
|
-
if (existing) clearTimeout(existing);
|
|
45
|
-
pending.set(
|
|
46
|
-
event,
|
|
47
|
-
setTimeout(() => {
|
|
48
|
-
pending.delete(event);
|
|
49
|
-
eventBus.emit(event, { timestamp: Date.now() });
|
|
50
|
-
}, DEBOUNCE_MS),
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function resolveEvent(filePath: string): string | null {
|
|
55
|
-
const rel = relative(agentDir, filePath);
|
|
56
|
-
if (rel.startsWith("..")) return null;
|
|
57
|
-
|
|
58
|
-
// Check direct file matches
|
|
59
|
-
for (const [file, event] of Object.entries(EVENT_MAP)) {
|
|
60
|
-
if (rel === file) return event;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// Check extensions directory
|
|
64
|
-
if (rel.startsWith(EXTENSIONS_DIR + "/") || rel === EXTENSIONS_DIR) {
|
|
65
|
-
return "extensions-changed";
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return null;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
watcher = watch(agentDir, {
|
|
72
|
-
ignoreInitial: true,
|
|
73
|
-
depth: 2,
|
|
74
|
-
ignored: IGNORED_PATTERNS,
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
for (const eventType of ["add", "change", "unlink"] as const) {
|
|
78
|
-
watcher.on(eventType, (filePath: string) => {
|
|
79
|
-
const event = resolveEvent(filePath);
|
|
80
|
-
if (event) debounceEmit(event);
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// Wait for watcher to be ready
|
|
85
|
-
await new Promise<void>((resolve) => {
|
|
86
|
-
watcher!.on("ready", resolve);
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Stop the file watcher and clean up resources.
|
|
92
|
-
*/
|
|
93
|
-
export async function stopFileWatcher(): Promise<void> {
|
|
94
|
-
for (const timer of pending.values()) clearTimeout(timer);
|
|
95
|
-
pending.clear();
|
|
96
|
-
if (watcher) {
|
|
97
|
-
await watcher.close();
|
|
98
|
-
watcher = null;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import type { ExtensionContext } from "@gsd/pi-coding-agent";
|
|
2
|
-
import {
|
|
3
|
-
ensureRtkSessionBaseline,
|
|
4
|
-
formatRtkSavingsLabel,
|
|
5
|
-
getRtkSessionSavings,
|
|
6
|
-
} from "../shared/rtk-session-stats.js";
|
|
7
|
-
import { loadEffectiveGSDPreferences } from "./preferences.js";
|
|
8
|
-
|
|
9
|
-
const STATUS_KEY = "gsd-rtk";
|
|
10
|
-
const REFRESH_INTERVAL_MS = 30_000;
|
|
11
|
-
|
|
12
|
-
let refreshTimer: ReturnType<typeof setInterval> | null = null;
|
|
13
|
-
|
|
14
|
-
function clearTimer(): void {
|
|
15
|
-
if (refreshTimer) {
|
|
16
|
-
clearInterval(refreshTimer);
|
|
17
|
-
refreshTimer = null;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function isRtkEnabledInPrefs(): boolean {
|
|
22
|
-
return loadEffectiveGSDPreferences()?.preferences.experimental?.rtk === true;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function updateStatus(ctx: ExtensionContext): void {
|
|
26
|
-
if (!ctx.hasUI) return;
|
|
27
|
-
if (!isRtkEnabledInPrefs()) return;
|
|
28
|
-
|
|
29
|
-
const basePath = ctx.cwd;
|
|
30
|
-
const sessionId = ctx.sessionManager.getSessionId();
|
|
31
|
-
ensureRtkSessionBaseline(basePath, sessionId);
|
|
32
|
-
const savings = getRtkSessionSavings(basePath, sessionId);
|
|
33
|
-
ctx.ui.setStatus(STATUS_KEY, formatRtkSavingsLabel(savings) ?? undefined);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export function startRtkStatusUpdates(ctx: ExtensionContext): void {
|
|
37
|
-
clearTimer();
|
|
38
|
-
if (!isRtkEnabledInPrefs()) {
|
|
39
|
-
// Ensure any previously set status is cleared (e.g. preference was toggled off)
|
|
40
|
-
ctx.ui.setStatus(STATUS_KEY, undefined);
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
updateStatus(ctx);
|
|
44
|
-
if (!ctx.hasUI) return;
|
|
45
|
-
refreshTimer = setInterval(() => {
|
|
46
|
-
updateStatus(ctx);
|
|
47
|
-
}, REFRESH_INTERVAL_MS);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export function stopRtkStatusUpdates(ctx?: ExtensionContext): void {
|
|
51
|
-
clearTimer();
|
|
52
|
-
ctx?.ui.setStatus(STATUS_KEY, undefined);
|
|
53
|
-
}
|
|
File without changes
|
|
File without changes
|