@mrclrchtr/supi-cache 1.7.0 → 1.8.1
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/README.md +7 -3
- package/node_modules/@mrclrchtr/supi-core/README.md +3 -13
- package/node_modules/@mrclrchtr/supi-core/package.json +13 -8
- package/node_modules/@mrclrchtr/supi-core/src/api.ts +26 -92
- package/node_modules/@mrclrchtr/supi-core/src/config.ts +11 -0
- package/node_modules/@mrclrchtr/supi-core/src/context.ts +16 -0
- package/node_modules/@mrclrchtr/supi-core/src/index.ts +26 -92
- package/node_modules/@mrclrchtr/supi-core/src/path.ts +2 -0
- package/node_modules/@mrclrchtr/supi-core/src/project.ts +15 -0
- package/node_modules/@mrclrchtr/supi-core/src/session.ts +4 -0
- package/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +2 -0
- package/node_modules/@mrclrchtr/supi-core/src/settings.ts +9 -0
- package/node_modules/@mrclrchtr/supi-core/src/substrate-types.ts +11 -0
- package/node_modules/@mrclrchtr/supi-core/src/types.ts +2 -0
- package/package.json +5 -5
- package/src/config.ts +1 -1
- package/src/forensics/forensics.ts +1 -1
- package/src/settings-registration.ts +2 -2
- package/src/tool/guidance.ts +6 -8
- package/node_modules/@mrclrchtr/supi-core/src/extension.ts +0 -1
package/README.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
1
3
|
# @mrclrchtr/supi-cache
|
|
2
4
|
|
|
3
5
|
Adds prompt-cache monitoring and cache-regression forensics to the [pi coding agent](https://github.com/earendil-works/pi).
|
|
@@ -8,7 +10,7 @@ Adds prompt-cache monitoring and cache-regression forensics to the [pi coding ag
|
|
|
8
10
|
pi install npm:@mrclrchtr/supi-cache
|
|
9
11
|
```
|
|
10
12
|
|
|
11
|
-
This is a **beta** package.
|
|
13
|
+
This is a **beta** package. Install individually.
|
|
12
14
|
|
|
13
15
|
For local development:
|
|
14
16
|
|
|
@@ -16,8 +18,6 @@ For local development:
|
|
|
16
18
|
pi install ./packages/supi-cache
|
|
17
19
|
```
|
|
18
20
|
|
|
19
|
-
After editing the source, run `/reload`.
|
|
20
|
-
|
|
21
21
|
## What you get
|
|
22
22
|
|
|
23
23
|
After install, the package does two things:
|
|
@@ -33,6 +33,8 @@ After install, the package does two things:
|
|
|
33
33
|
- groups findings into a few built-in query patterns
|
|
34
34
|
- keeps agent-facing results redacted to structural fingerprints instead of raw command text or file paths
|
|
35
35
|
|
|
36
|
+

|
|
37
|
+
|
|
36
38
|
## Commands and tool
|
|
37
39
|
|
|
38
40
|
### `/supi-cache-history`
|
|
@@ -64,6 +66,8 @@ Useful flags:
|
|
|
64
66
|
- `--pattern breakdown`
|
|
65
67
|
- `--min-drop 20`
|
|
66
68
|
|
|
69
|
+

|
|
70
|
+
|
|
67
71
|
### `supi_cache_forensics`
|
|
68
72
|
|
|
69
73
|
Adds one model-callable tool with the same four patterns: `hotspots`, `breakdown`, `correlate`, and `idle`.
|
|
@@ -1,29 +1,20 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
1
3
|
# @mrclrchtr/supi-core
|
|
2
4
|
|
|
3
5
|
Shared infrastructure for SuPi extensions.
|
|
4
6
|
|
|
5
|
-
This
|
|
7
|
+
This is a **pure library** — it does not register any pi commands or tools. The `/supi-settings` command is now available through `@mrclrchtr/supi-settings`.
|
|
6
8
|
|
|
7
9
|
## Install
|
|
8
10
|
|
|
9
|
-
### As a dependency for another extension
|
|
10
|
-
|
|
11
11
|
```bash
|
|
12
12
|
pnpm add @mrclrchtr/supi-core
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
### As a pi package
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
pi install npm:@mrclrchtr/supi-core
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
Installing it as a pi package adds the minimal `/supi-settings` extension surface.
|
|
22
|
-
|
|
23
15
|
## Package surfaces
|
|
24
16
|
|
|
25
17
|
- `@mrclrchtr/supi-core/api` — reusable helpers for other packages and extensions
|
|
26
|
-
- `@mrclrchtr/supi-core/extension` — minimal pi extension that registers `/supi-settings`
|
|
27
18
|
|
|
28
19
|
## What you get from the API
|
|
29
20
|
|
|
@@ -101,7 +92,6 @@ const message = wrapExtensionContext("my-extension", "hello", {
|
|
|
101
92
|
## Source
|
|
102
93
|
|
|
103
94
|
- `src/api.ts` — exported library surface
|
|
104
|
-
- `src/extension.ts` — minimal `/supi-settings` entrypoint
|
|
105
95
|
- `src/config.ts` — shared config loading and writing
|
|
106
96
|
- `src/config-settings.ts` — config-backed settings registration helper
|
|
107
97
|
- `src/settings-ui.ts` — shared settings overlay
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrclrchtr/supi-core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.1",
|
|
4
4
|
"description": "SuPi core — shared infrastructure for SuPi extensions (XML context tags, config system)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -37,12 +37,17 @@
|
|
|
37
37
|
"main": "src/api.ts",
|
|
38
38
|
"exports": {
|
|
39
39
|
"./api": "./src/api.ts",
|
|
40
|
-
"./
|
|
41
|
-
"./
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
"./config": "./src/config.ts",
|
|
41
|
+
"./context": "./src/context.ts",
|
|
42
|
+
"./debug": "./src/debug-registry.ts",
|
|
43
|
+
"./package.json": "./package.json",
|
|
44
|
+
"./path": "./src/path.ts",
|
|
45
|
+
"./project": "./src/project.ts",
|
|
46
|
+
"./session": "./src/session.ts",
|
|
47
|
+
"./settings": "./src/settings.ts",
|
|
48
|
+
"./settings-ui": "./src/settings-ui.ts",
|
|
49
|
+
"./terminal": "./src/terminal.ts",
|
|
50
|
+
"./tool-framework": "./src/tool-framework.ts",
|
|
51
|
+
"./types": "./src/types.ts"
|
|
47
52
|
}
|
|
48
53
|
}
|
|
@@ -1,96 +1,30 @@
|
|
|
1
1
|
// supi-core — shared infrastructure for SuPi extensions.
|
|
2
2
|
// Provides XML context tag wrapping, unified config system, context-message utilities,
|
|
3
3
|
// settings registry for supi-wide TUI settings, and a shared tool-spec/registration framework.
|
|
4
|
+
//
|
|
5
|
+
// Convenience barrel — re-exports all domain entry points.
|
|
6
|
+
// For lighter imports, use one of the domain subpaths directly
|
|
7
|
+
// (e.g. @mrclrchtr/supi-core/config, @mrclrchtr/supi-core/context).
|
|
4
8
|
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
export
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
registerContextProvider,
|
|
28
|
-
} from "./context/context-provider-registry.ts";
|
|
29
|
-
export { wrapExtensionContext } from "./context/context-tag.ts";
|
|
30
|
-
export type {
|
|
31
|
-
DebugAgentAccess,
|
|
32
|
-
DebugEvent,
|
|
33
|
-
DebugEventInput,
|
|
34
|
-
DebugEventQuery,
|
|
35
|
-
DebugEventQueryResult,
|
|
36
|
-
DebugEventView,
|
|
37
|
-
DebugLevel,
|
|
38
|
-
DebugNotifyLevel,
|
|
39
|
-
DebugRegistryConfig,
|
|
40
|
-
DebugSummary,
|
|
41
|
-
} from "./debug-registry.ts";
|
|
42
|
-
export {
|
|
43
|
-
clearDebugEvents,
|
|
44
|
-
configureDebugRegistry,
|
|
45
|
-
DEBUG_REGISTRY_DEFAULTS,
|
|
46
|
-
getDebugEvents,
|
|
47
|
-
getDebugRegistryConfig,
|
|
48
|
-
getDebugSummary,
|
|
49
|
-
recordDebugEvent,
|
|
50
|
-
redactDebugData,
|
|
51
|
-
resetDebugRegistry,
|
|
52
|
-
} from "./debug-registry.ts";
|
|
53
|
-
export { fileToUri, resolveToolPath, stripToolPathPrefix, uriToFile } from "./path-utils.ts";
|
|
54
|
-
export type { KnownRootEntry } from "./project-roots.ts";
|
|
55
|
-
export {
|
|
56
|
-
buildKnownRootsMap,
|
|
57
|
-
byPathDepth,
|
|
58
|
-
dedupeTopmostRoots,
|
|
59
|
-
findProjectRoot,
|
|
60
|
-
isWithin,
|
|
61
|
-
isWithinOrEqual,
|
|
62
|
-
mergeKnownRoots,
|
|
63
|
-
resolveKnownRoot,
|
|
64
|
-
segmentCount,
|
|
65
|
-
sortRootsBySpecificity,
|
|
66
|
-
walkProject,
|
|
67
|
-
} from "./project-roots.ts";
|
|
68
|
-
export { createRegistry, createSessionStateRegistry } from "./registry-utils.ts";
|
|
69
|
-
export { getActiveBranchEntries } from "./session-utils.ts";
|
|
70
|
-
export { registerSettingsCommand } from "./settings/settings-command.ts";
|
|
71
|
-
export type { SettingsScope, SettingsSection } from "./settings/settings-registry.ts";
|
|
72
|
-
export {
|
|
73
|
-
clearRegisteredSettings,
|
|
74
|
-
getRegisteredSettings,
|
|
75
|
-
registerSettings,
|
|
76
|
-
} from "./settings/settings-registry.ts";
|
|
77
|
-
export { createInputSubmenu, openSettingsOverlay } from "./settings/settings-ui.ts";
|
|
78
|
-
export type { TitleTarget } from "./terminal.ts";
|
|
79
|
-
export {
|
|
80
|
-
DONE_SYMBOL,
|
|
81
|
-
formatTitle,
|
|
82
|
-
signalBell,
|
|
83
|
-
signalDone,
|
|
84
|
-
signalWaiting,
|
|
85
|
-
WAITING_SYMBOL,
|
|
86
|
-
} from "./terminal.ts";
|
|
87
|
-
export type { SuiPiToolPromptSurface, SuiPiToolSpec, ToolExecuteFn } from "./tool-framework.ts";
|
|
88
|
-
export {
|
|
89
|
-
CharacterParam,
|
|
90
|
-
derivePromptSurface,
|
|
91
|
-
FileParam,
|
|
92
|
-
LineParam,
|
|
93
|
-
MaxResultsParam,
|
|
94
|
-
registerSuiPiTools,
|
|
95
|
-
SymbolParam,
|
|
96
|
-
} from "./tool-framework.ts";
|
|
9
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
10
|
+
export * from "./config.ts";
|
|
11
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
12
|
+
export * from "./context.ts";
|
|
13
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
14
|
+
export * from "./debug-registry.ts";
|
|
15
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
16
|
+
export * from "./path.ts";
|
|
17
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
18
|
+
export * from "./project.ts";
|
|
19
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
20
|
+
export * from "./session.ts";
|
|
21
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
22
|
+
export * from "./settings.ts";
|
|
23
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
24
|
+
export * from "./settings-ui.ts";
|
|
25
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
26
|
+
export * from "./terminal.ts";
|
|
27
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
28
|
+
export * from "./tool-framework.ts";
|
|
29
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
30
|
+
export * from "./types.ts";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// supi-core config domain — config loading and config-settings helpers.
|
|
2
|
+
export type { SupiConfigLocation, SupiConfigOptions } from "./config/config.ts";
|
|
3
|
+
export {
|
|
4
|
+
loadSupiConfig,
|
|
5
|
+
loadSupiConfigForScope,
|
|
6
|
+
readJsonFile,
|
|
7
|
+
removeSupiConfigKey,
|
|
8
|
+
writeSupiConfig,
|
|
9
|
+
} from "./config/config.ts";
|
|
10
|
+
export type { ConfigSettingsHelpers, ConfigSettingsOptions } from "./config/config-settings.ts";
|
|
11
|
+
export { registerConfigSettings } from "./config/config-settings.ts";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// supi-core context domain — context messages, providers, and XML tags.
|
|
2
|
+
export type { ContextMessageLike } from "./context/context-messages.ts";
|
|
3
|
+
export {
|
|
4
|
+
findLastUserMessageIndex,
|
|
5
|
+
getContextToken,
|
|
6
|
+
getPromptContent,
|
|
7
|
+
pruneAndReorderContextMessages,
|
|
8
|
+
restorePromptContent,
|
|
9
|
+
} from "./context/context-messages.ts";
|
|
10
|
+
export type { ContextProvider } from "./context/context-provider-registry.ts";
|
|
11
|
+
export {
|
|
12
|
+
clearRegisteredContextProviders,
|
|
13
|
+
getRegisteredContextProviders,
|
|
14
|
+
registerContextProvider,
|
|
15
|
+
} from "./context/context-provider-registry.ts";
|
|
16
|
+
export { wrapExtensionContext } from "./context/context-tag.ts";
|
|
@@ -1,96 +1,30 @@
|
|
|
1
1
|
// supi-core — shared infrastructure for SuPi extensions.
|
|
2
2
|
// Provides XML context tag wrapping, unified config system, context-message utilities,
|
|
3
3
|
// settings registry for supi-wide TUI settings, and a shared tool-spec/registration framework.
|
|
4
|
+
//
|
|
5
|
+
// Convenience barrel — re-exports all domain entry points.
|
|
6
|
+
// For lighter imports, use one of the domain subpaths directly
|
|
7
|
+
// (e.g. @mrclrchtr/supi-core/config, @mrclrchtr/supi-core/context).
|
|
4
8
|
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
export
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
registerContextProvider,
|
|
28
|
-
} from "./context/context-provider-registry.ts";
|
|
29
|
-
export { wrapExtensionContext } from "./context/context-tag.ts";
|
|
30
|
-
export type {
|
|
31
|
-
DebugAgentAccess,
|
|
32
|
-
DebugEvent,
|
|
33
|
-
DebugEventInput,
|
|
34
|
-
DebugEventQuery,
|
|
35
|
-
DebugEventQueryResult,
|
|
36
|
-
DebugEventView,
|
|
37
|
-
DebugLevel,
|
|
38
|
-
DebugNotifyLevel,
|
|
39
|
-
DebugRegistryConfig,
|
|
40
|
-
DebugSummary,
|
|
41
|
-
} from "./debug-registry.ts";
|
|
42
|
-
export {
|
|
43
|
-
clearDebugEvents,
|
|
44
|
-
configureDebugRegistry,
|
|
45
|
-
DEBUG_REGISTRY_DEFAULTS,
|
|
46
|
-
getDebugEvents,
|
|
47
|
-
getDebugRegistryConfig,
|
|
48
|
-
getDebugSummary,
|
|
49
|
-
recordDebugEvent,
|
|
50
|
-
redactDebugData,
|
|
51
|
-
resetDebugRegistry,
|
|
52
|
-
} from "./debug-registry.ts";
|
|
53
|
-
export { fileToUri, resolveToolPath, stripToolPathPrefix, uriToFile } from "./path-utils.ts";
|
|
54
|
-
export type { KnownRootEntry } from "./project-roots.ts";
|
|
55
|
-
export {
|
|
56
|
-
buildKnownRootsMap,
|
|
57
|
-
byPathDepth,
|
|
58
|
-
dedupeTopmostRoots,
|
|
59
|
-
findProjectRoot,
|
|
60
|
-
isWithin,
|
|
61
|
-
isWithinOrEqual,
|
|
62
|
-
mergeKnownRoots,
|
|
63
|
-
resolveKnownRoot,
|
|
64
|
-
segmentCount,
|
|
65
|
-
sortRootsBySpecificity,
|
|
66
|
-
walkProject,
|
|
67
|
-
} from "./project-roots.ts";
|
|
68
|
-
export { createRegistry, createSessionStateRegistry } from "./registry-utils.ts";
|
|
69
|
-
export { getActiveBranchEntries } from "./session-utils.ts";
|
|
70
|
-
export { registerSettingsCommand } from "./settings/settings-command.ts";
|
|
71
|
-
export type { SettingsScope, SettingsSection } from "./settings/settings-registry.ts";
|
|
72
|
-
export {
|
|
73
|
-
clearRegisteredSettings,
|
|
74
|
-
getRegisteredSettings,
|
|
75
|
-
registerSettings,
|
|
76
|
-
} from "./settings/settings-registry.ts";
|
|
77
|
-
export { createInputSubmenu, openSettingsOverlay } from "./settings/settings-ui.ts";
|
|
78
|
-
export type { TitleTarget } from "./terminal.ts";
|
|
79
|
-
export {
|
|
80
|
-
DONE_SYMBOL,
|
|
81
|
-
formatTitle,
|
|
82
|
-
signalBell,
|
|
83
|
-
signalDone,
|
|
84
|
-
signalWaiting,
|
|
85
|
-
WAITING_SYMBOL,
|
|
86
|
-
} from "./terminal.ts";
|
|
87
|
-
export type { SuiPiToolPromptSurface, SuiPiToolSpec, ToolExecuteFn } from "./tool-framework.ts";
|
|
88
|
-
export {
|
|
89
|
-
CharacterParam,
|
|
90
|
-
derivePromptSurface,
|
|
91
|
-
FileParam,
|
|
92
|
-
LineParam,
|
|
93
|
-
MaxResultsParam,
|
|
94
|
-
registerSuiPiTools,
|
|
95
|
-
SymbolParam,
|
|
96
|
-
} from "./tool-framework.ts";
|
|
9
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
10
|
+
export * from "./config.ts";
|
|
11
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
12
|
+
export * from "./context.ts";
|
|
13
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
14
|
+
export * from "./debug-registry.ts";
|
|
15
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
16
|
+
export * from "./path.ts";
|
|
17
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
18
|
+
export * from "./project.ts";
|
|
19
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
20
|
+
export * from "./session.ts";
|
|
21
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
22
|
+
export * from "./settings.ts";
|
|
23
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
24
|
+
export * from "./settings-ui.ts";
|
|
25
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
26
|
+
export * from "./terminal.ts";
|
|
27
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
28
|
+
export * from "./tool-framework.ts";
|
|
29
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
30
|
+
export * from "./types.ts";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// supi-core project domain — project root discovery and traversal.
|
|
2
|
+
export type { KnownRootEntry } from "./project-roots.ts";
|
|
3
|
+
export {
|
|
4
|
+
buildKnownRootsMap,
|
|
5
|
+
byPathDepth,
|
|
6
|
+
dedupeTopmostRoots,
|
|
7
|
+
findProjectRoot,
|
|
8
|
+
isWithin,
|
|
9
|
+
isWithinOrEqual,
|
|
10
|
+
mergeKnownRoots,
|
|
11
|
+
resolveKnownRoot,
|
|
12
|
+
segmentCount,
|
|
13
|
+
sortRootsBySpecificity,
|
|
14
|
+
walkProject,
|
|
15
|
+
} from "./project-roots.ts";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// supi-core settings domain — settings registry (lightweight, type-only pi-tui import).
|
|
2
|
+
|
|
3
|
+
export { registerSettingsCommand } from "./settings/settings-command.ts";
|
|
4
|
+
export type { SettingsScope, SettingsSection } from "./settings/settings-registry.ts";
|
|
5
|
+
export {
|
|
6
|
+
clearRegisteredSettings,
|
|
7
|
+
getRegisteredSettings,
|
|
8
|
+
registerSettings,
|
|
9
|
+
} from "./settings/settings-registry.ts";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** 0-based position used by LSP and code-intelligence internally. */
|
|
2
|
+
export interface CodePosition {
|
|
3
|
+
line: number;
|
|
4
|
+
character: number;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/** Normalized location — flat replacement for LSP's nested Location/range shape. */
|
|
8
|
+
export interface CodeLocation {
|
|
9
|
+
uri: string;
|
|
10
|
+
range: { start: CodePosition; end: CodePosition };
|
|
11
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrclrchtr/supi-cache",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.1",
|
|
4
4
|
"description": "SuPi Cache — prompt cache health monitoring and cross-session forensics",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"README.md"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@mrclrchtr/supi-core": "1.
|
|
23
|
+
"@mrclrchtr/supi-core": "1.8.1"
|
|
24
24
|
},
|
|
25
25
|
"bundledDependencies": [
|
|
26
26
|
"@mrclrchtr/supi-core"
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
},
|
|
48
48
|
"pi": {
|
|
49
49
|
"extensions": [
|
|
50
|
-
"./src/extension.ts"
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
"./src/extension.ts"
|
|
51
|
+
],
|
|
52
|
+
"image": "https://raw.githubusercontent.com/mrclrchtr/supi/main/packages/supi-cache/assets/logo.png"
|
|
53
53
|
},
|
|
54
54
|
"main": "src/api.ts",
|
|
55
55
|
"exports": {
|
package/src/config.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
// "idleThresholdMinutes": 5 // gap in minutes to classify as idle-time regression
|
|
9
9
|
// }
|
|
10
10
|
|
|
11
|
-
import { loadSupiConfig } from "@mrclrchtr/supi-core/
|
|
11
|
+
import { loadSupiConfig } from "@mrclrchtr/supi-core/config";
|
|
12
12
|
|
|
13
13
|
export interface CacheMonitorConfig {
|
|
14
14
|
/** Enable/disable cache monitoring. Default: true */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Forensics engine — scan pipeline for cross-session cache investigation.
|
|
2
2
|
|
|
3
3
|
import { SessionManager } from "@earendil-works/pi-coding-agent";
|
|
4
|
-
import { getActiveBranchEntries } from "@mrclrchtr/supi-core/
|
|
4
|
+
import { getActiveBranchEntries } from "@mrclrchtr/supi-core/session";
|
|
5
5
|
import { resolveTurnCause } from "../monitor/state.ts";
|
|
6
6
|
import {
|
|
7
7
|
extractCacheTurnEntries,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Cache-monitor settings registration for the supi settings registry.
|
|
2
2
|
|
|
3
|
-
import type { ConfigSettingsHelpers } from "@mrclrchtr/supi-core/
|
|
4
|
-
import { registerConfigSettings } from "@mrclrchtr/supi-core/
|
|
3
|
+
import type { ConfigSettingsHelpers } from "@mrclrchtr/supi-core/config";
|
|
4
|
+
import { registerConfigSettings } from "@mrclrchtr/supi-core/config";
|
|
5
5
|
import { CACHE_MONITOR_DEFAULTS } from "./config.ts";
|
|
6
6
|
|
|
7
7
|
const THRESHOLD_VALUES = ["5", "10", "15", "20", "25", "30", "35", "40", "45", "50"];
|
package/src/tool/guidance.ts
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
// Prompt guidance and tool description for the supi_cache_forensics tool.
|
|
2
2
|
|
|
3
3
|
export const toolDescription =
|
|
4
|
-
|
|
4
|
+
"Investigate prompt cache regressions across historical PI sessions. Patterns: hotspots, breakdown, correlate, and idle. Results use redacted shape fingerprints.";
|
|
5
5
|
|
|
6
6
|
export const promptSnippet =
|
|
7
|
-
"supi_cache_forensics — investigate historical
|
|
7
|
+
"supi_cache_forensics — investigate historical cache regressions and causes";
|
|
8
8
|
|
|
9
9
|
export const promptGuidelines = [
|
|
10
|
-
"Use supi_cache_forensics when the user asks about cache
|
|
11
|
-
'Use supi_cache_forensics with `pattern: "breakdown"` for
|
|
12
|
-
'Use supi_cache_forensics with `pattern: "
|
|
13
|
-
|
|
14
|
-
'Use supi_cache_forensics with `pattern: "correlate"` to see which tool-call shapes preceded regressions.',
|
|
15
|
-
"supi_cache_forensics returns shape fingerprints and parameter summaries, not raw file paths or command text.",
|
|
10
|
+
"Use supi_cache_forensics when the user asks about cache regressions, cache patterns, or what preceded a drop.",
|
|
11
|
+
'Use supi_cache_forensics with `pattern: "breakdown"` for cause totals, or `pattern: "hotspots"` with `minDrop` for the biggest drops.',
|
|
12
|
+
'Use supi_cache_forensics with `pattern: "idle"` for long-gap drops and `pattern: "correlate"` for preceding tool-call shapes.',
|
|
13
|
+
"Use supi_cache_forensics results as shape fingerprints and parameter summaries, not raw paths or command text.",
|
|
16
14
|
];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { registerSettingsCommand as default } from "./settings/settings-command.ts";
|