@mrclrchtr/supi-review 4.5.1 → 4.7.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/README.md +30 -3
- package/node_modules/@mrclrchtr/supi-code-intelligence/README.md +1 -3
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-code-runtime/README.md +1 -1
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/README.md +1 -3
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/package.json +2 -2
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +49 -12
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-code-runtime/package.json +3 -3
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-core/README.md +1 -3
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-core/package.json +2 -2
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +49 -12
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/README.md +1 -3
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/README.md +1 -1
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/README.md +1 -3
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/package.json +2 -2
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +49 -12
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/package.json +3 -3
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/README.md +1 -3
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/package.json +2 -2
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +49 -12
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/package.json +4 -4
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-tree-sitter/README.md +1 -3
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/README.md +1 -1
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/README.md +1 -3
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/package.json +2 -2
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +49 -12
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/package.json +3 -3
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/README.md +1 -3
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/package.json +2 -2
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +49 -12
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-tree-sitter/package.json +4 -4
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/outline-html-sql.ts +1 -1
- package/node_modules/@mrclrchtr/supi-code-intelligence/package.json +6 -6
- package/node_modules/@mrclrchtr/supi-core/README.md +1 -3
- package/node_modules/@mrclrchtr/supi-core/package.json +2 -2
- package/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +49 -12
- package/package.json +4 -4
- package/src/git.ts +23 -11
- package/src/review-input.ts +53 -6
- package/src/review-limits.ts +6 -0
- package/src/review-result.ts +24 -3
- package/src/review.ts +29 -2
- package/src/target/packet.ts +59 -21
- package/src/target/resolve.ts +75 -0
- package/src/target/snapshot-match.ts +37 -0
- package/src/tool/agent-review-schemas.ts +46 -4
- package/src/tool/agent-review-tools.ts +33 -12
- package/src/tool/child-session-runner.ts +4 -0
- package/src/tool/criteria-only-scope.ts +31 -0
- package/src/tool/output-page.ts +13 -0
- package/src/tool/planner-runner.ts +3 -2
- package/src/tool/review-audit-tool.ts +2 -12
- package/src/tool/review-debug-summary.ts +64 -0
- package/src/tool/review-execution.ts +22 -0
- package/src/tool/review-format.ts +19 -11
- package/src/tool/review-output-tool.ts +8 -15
- package/src/tool/review-runner.ts +9 -1
- package/src/tool/review-system-prompt.ts +7 -3
- package/src/tool/review-workflow.ts +35 -32
- package/src/tool/schemas.ts +52 -2
- package/src/tool/session-lifecycle.ts +1 -0
- package/src/tui/common.ts +22 -0
- package/src/tui/prepare.ts +31 -12
- package/src/tui/run.ts +39 -11
- package/src/types.ts +35 -6
- package/src/workspace/review-workspace.ts +36 -7
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# @mrclrchtr/supi-review — Code Review for Pi
|
|
8
8
|
|
|
9
|
-
Code review extension for the [Pi coding agent](https://github.com/earendil-works/pi) that runs parallel, isolated review tasks against a working tree, branch, or
|
|
9
|
+
Code review extension for the [Pi coding agent](https://github.com/earendil-works/pi) that runs parallel, isolated review tasks against a working tree, branch, commit, or the complete current filesystem state.
|
|
10
10
|
|
|
11
11
|
## Install
|
|
12
12
|
|
|
@@ -53,6 +53,28 @@ Preparation is optional. Skills and agents that already know how to review shoul
|
|
|
53
53
|
|
|
54
54
|
One to four tasks share a reviewer model and one frozen Review Workspace. Direct and Prepared adapters use the same canonical packet compiler; every task result includes the SHA-256 of the exact packet bytes and nested-model usage when reported.
|
|
55
55
|
|
|
56
|
+
Tasks may identify authoritative Review Criteria Sources whose summaries travel in the packet:
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"direct": {
|
|
61
|
+
"target": { "currentState": { "paths": ["packages/supi-review"] } },
|
|
62
|
+
"tasks": [
|
|
63
|
+
{
|
|
64
|
+
"id": "spec",
|
|
65
|
+
"instructions": "Review the current state against issue #123.",
|
|
66
|
+
"criteriaSources": [
|
|
67
|
+
{ "reference": "#123", "summary": "Acceptance criteria: A, B, C." },
|
|
68
|
+
{ "reference": "docs/adr/0012.md", "summary": "Current-State Audit semantics." }
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
`currentState` audits one frozen filesystem state without Git-change attribution, so tasks must omit `findingScope`; the engine fixes `criteria-only`. `paths` is an optional advisory focus whose entries must exist in the frozen state.
|
|
77
|
+
|
|
56
78
|
## Prepared Review
|
|
57
79
|
|
|
58
80
|
Preparation returns a session-scoped `planId` and optional Planner Draft. Planner failure returns a usable no-draft plan. Before a Prepared Review runs, the engine re-resolves the target and compares its exact Review Snapshot; drift invalidates the plan. A batch with at least one completed task consumes its plan, while an all-non-completed batch releases it for retry.
|
|
@@ -75,6 +97,7 @@ The Review Engine resolves the Git worktree root once and pins commit identities
|
|
|
75
97
|
- `working-tree` — net current filesystem plus non-ignored untracked files against `HEAD`, or `merge-base(baseCommit, HEAD)`; the caller index is not evidence
|
|
76
98
|
- `comparison` — merge base of `baseCommit` and captured `HEAD` to captured `HEAD`
|
|
77
99
|
- `commit` — first parent (or empty tree) to `commit`
|
|
100
|
+
- `currentState` — the complete current filesystem, including uncommitted and untracked work, reviewed as one state against Review Criteria
|
|
78
101
|
|
|
79
102
|
A Working-Tree Review Workspace checks out its pinned baseline and stages the exact canonical patch, so `git diff HEAD` shows the complete target. Comparison and Commit workspaces check out their pinned after commit. Before Reviewer Sessions start, the engine re-compiles the target patch from the linked workspace and verifies its hash, expected checkout commit, and changed-path count. Every completed batch includes that compact Workspace receipt, so later caller edits cannot change the in-flight target.
|
|
80
103
|
|
|
@@ -90,7 +113,9 @@ Reviewers receive:
|
|
|
90
113
|
|
|
91
114
|
They use ordinary Git and direct reads in the frozen Review Workspace. Before-side content remains available through the packet's pinned Git revision. Code Intelligence runs in a headless inspection profile; an unavailable profile produces a Reviewer Capability Warning, while the built-in inspection tools remain available.
|
|
92
115
|
|
|
93
|
-
Each Review Task may set `findingScope` to `change-only` (the default) or `boy-scout`. Change-only findings must be attributable to the selected change, including omitted or partial required behavior and acceptance-relevant scope creep. Boy Scout scope may additionally report pre-existing issues in changed files or symbols the reviewer judges directly affected; purely pre-existing findings are advisory unless the change worsens or newly exposes them. Repository standards and specifications requested by a task are Review Criteria, but repository content can never override the fixed Reviewer Protocol or task.
|
|
116
|
+
Each Git-change Review Task may set `findingScope` to `change-only` (the default) or `boy-scout`. Change-only findings must be attributable to the selected change, including omitted or partial required behavior and acceptance-relevant scope creep. Boy Scout scope may additionally report pre-existing issues in changed files or symbols the reviewer judges directly affected; purely pre-existing findings are advisory unless the change worsens or newly exposes them. Current-State Audit uses fixed `criteria-only` scope: any finding relevant to the Review Criteria may block acceptance, regardless of when it was introduced. Repository standards and specifications requested by a task are Review Criteria, but repository content can never override the fixed Reviewer Protocol or task.
|
|
117
|
+
|
|
118
|
+
Before alleging a documented-rule breach, reviewers check that rule's documented exceptions; covered candidates are omitted and submitted breach findings state why no exception applies. Test verification means inspecting test source, coverage, and requirement mapping; runtime checks stay with the containing Agent. When a task lists `criteriaSources`, reviewers use the supplied summaries first and may retrieve an identified source read-only when its summary is insufficient; unavailable required detail produces an incomplete Criteria Coverage statement rather than a false pass.
|
|
94
119
|
|
|
95
120
|
Inspection-only is behavioral protocol, not access control. The surrounding Sandboxed Pi Environment is the security boundary and must contain only files and credentials acceptable for reviewer-model access. When `review.bootstrapCommand` is configured, the Review Engine runs its shell command once after workspace verification and before reviewer fan-out; reviewers then receive no Dependency Bootstrap instruction. When it is empty, reviewers may choose a Dependency Bootstrap command when local dependencies limit Code Intelligence. They must not intentionally mutate Target Evidence or Git history, and must not run tests, builds, linters, runtime experiments, services, nested Pi sessions, or nested reviews.
|
|
96
121
|
|
|
@@ -98,7 +123,9 @@ Reviewer Sessions replace Pi's generic coding prompt with the package-owned Revi
|
|
|
98
123
|
|
|
99
124
|
## Results and continuation
|
|
100
125
|
|
|
101
|
-
Each successful task returns a summary, ordered findings, and structured counts by blocking status and impact. Parent-facing task output identifies the effective Finding Scope. Findings contain `blocksAcceptance`, `impact`, `effort`, `confidence`, and an optional target-relative location. The Review Engine derives `
|
|
126
|
+
Each successful task returns a summary, ordered findings, required Criteria Coverage, and structured counts by blocking status and impact. Parent-facing task output identifies the effective Finding Scope. Findings contain `blocksAcceptance`, `impact`, `effort`, `confidence`, and an optional target-relative location. The Review Engine derives `issues` when any finding blocks acceptance, otherwise `incomplete` when Criteria Coverage is incomplete, otherwise `pass_with_findings` for advisory-only findings and `pass` for none; it never aggregates or reranks tasks.
|
|
127
|
+
|
|
128
|
+
When SuPi debugging is enabled, every finished task records a compact `review-task` Debug Event with trustworthy lifecycle, usage, outcome, and capability metrics (packet bytes, duration, turns, tool calls/errors, cache hit rate, verdict, and Reviewer Extension Set status).
|
|
102
129
|
|
|
103
130
|
Capability and cleanup warnings are execution provenance, not findings. By default, non-success diagnostics retain only bounded lifecycle metadata and redacted provider-owned error summaries; reviewer conversation, shell commands, tool arguments/results, and repository evidence are never retained.
|
|
104
131
|
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
<a href="https://github.com/mrclrchtr/supi/tree/main/packages/supi-code-intelligence">
|
|
3
|
-
<
|
|
4
|
-
<img src="https://raw.githubusercontent.com/mrclrchtr/supi/main/packages/supi-code-intelligence/assets/social-preview.png" alt="SuPi Code Intelligence" width="100%">
|
|
5
|
-
</picture>
|
|
3
|
+
<img src="https://raw.githubusercontent.com/mrclrchtr/supi/main/packages/supi-code-intelligence/assets/social-preview.png" alt="SuPi Code Intelligence" width="100%">
|
|
6
4
|
</a>
|
|
7
5
|
</div>
|
|
8
6
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
Shared workspace context, capability contracts, and canonical types for the SuPi code-understanding stack.
|
|
10
10
|
|
|
11
|
-
This is a **library-only package** — it has no pi extension surface, no user-facing tools, and no UI. It
|
|
11
|
+
This is a **library-only package** — it has no pi extension surface, no user-facing tools, and no UI. It is not installed directly — `supi-lsp`, `supi-tree-sitter`, and `supi-code-intelligence` bundle it and use its shared abstractions to communicate capability availability.
|
|
12
12
|
|
|
13
13
|
## Package surfaces
|
|
14
14
|
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
<a href="https://github.com/mrclrchtr/supi/tree/main/packages/supi-core">
|
|
3
|
-
<
|
|
4
|
-
<img src="https://raw.githubusercontent.com/mrclrchtr/supi/main/packages/supi-core/assets/social-preview.png" alt="SuPi Core" width="100%">
|
|
5
|
-
</picture>
|
|
3
|
+
<img src="https://raw.githubusercontent.com/mrclrchtr/supi/main/packages/supi-core/assets/social-preview.png" alt="SuPi Core" width="100%">
|
|
6
4
|
</a>
|
|
7
5
|
</div>
|
|
8
6
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrclrchtr/supi-core",
|
|
3
|
-
"version": "4.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "4.7.0",
|
|
4
|
+
"description": "Shared settings, configuration, reporting, and session infrastructure",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -64,6 +64,9 @@ export interface DebugEventQueryResult {
|
|
|
64
64
|
rawAccessDenied: boolean;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
/** Receives a sanitized event whenever the registry records one. */
|
|
68
|
+
export type DebugEventListener = (event: DebugEventView) => void;
|
|
69
|
+
|
|
67
70
|
export interface DebugSummary {
|
|
68
71
|
total: number;
|
|
69
72
|
byLevel: Partial<Record<DebugLevel, number>>;
|
|
@@ -73,6 +76,7 @@ export interface DebugSummary {
|
|
|
73
76
|
interface DebugRegistryState {
|
|
74
77
|
config: DebugRegistryConfig;
|
|
75
78
|
events: DebugEvent[];
|
|
79
|
+
listeners: Set<DebugEventListener>;
|
|
76
80
|
nextId: number;
|
|
77
81
|
}
|
|
78
82
|
|
|
@@ -97,10 +101,14 @@ function getState(): DebugRegistryState {
|
|
|
97
101
|
state = {
|
|
98
102
|
config: cloneConfig(DEBUG_REGISTRY_DEFAULTS),
|
|
99
103
|
events: [],
|
|
104
|
+
listeners: new Set(),
|
|
100
105
|
nextId: 1,
|
|
101
106
|
};
|
|
102
107
|
(globalThis as Record<symbol, unknown>)[REGISTRY_KEY] = state;
|
|
103
108
|
}
|
|
109
|
+
// Keep the shared registry compatible with extension reloads that reuse an
|
|
110
|
+
// instance created before listeners existed.
|
|
111
|
+
if (!state.listeners) state.listeners = new Set();
|
|
104
112
|
return state;
|
|
105
113
|
}
|
|
106
114
|
|
|
@@ -119,7 +127,16 @@ function trimToMaxEvents(state: DebugRegistryState): void {
|
|
|
119
127
|
state.events.splice(0, state.events.length - maxEvents);
|
|
120
128
|
}
|
|
121
129
|
|
|
122
|
-
|
|
130
|
+
/** Return whether a debug level is recognized by the registry. */
|
|
131
|
+
export function isDebugLevel(value: unknown): value is DebugLevel {
|
|
132
|
+
return value === "debug" || value === "info" || value === "warning" || value === "error";
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/** Match a debug event against the supported source, level, and category filters. */
|
|
136
|
+
export function matchesDebugEventQuery(
|
|
137
|
+
event: Pick<DebugEventView, "source" | "level" | "category">,
|
|
138
|
+
query: Pick<DebugEventQuery, "source" | "level" | "category">,
|
|
139
|
+
): boolean {
|
|
123
140
|
if (query.source && event.source !== query.source) return false;
|
|
124
141
|
if (query.level && event.level !== query.level) return false;
|
|
125
142
|
if (query.category && event.category !== query.category) return false;
|
|
@@ -168,6 +185,26 @@ export function redactDebugData<T>(value: T): T {
|
|
|
168
185
|
return redactValue(value, 8) as T;
|
|
169
186
|
}
|
|
170
187
|
|
|
188
|
+
function toSanitizedView(event: DebugEvent): DebugEventView {
|
|
189
|
+
return {
|
|
190
|
+
id: event.id,
|
|
191
|
+
timestamp: event.timestamp,
|
|
192
|
+
source: event.source,
|
|
193
|
+
level: event.level,
|
|
194
|
+
category: event.category,
|
|
195
|
+
message: event.message,
|
|
196
|
+
cwd: event.cwd,
|
|
197
|
+
data: event.data,
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/** Subscribe to sanitized events. Listeners are isolated so diagnostics cannot disrupt producers. */
|
|
202
|
+
export function subscribeDebugEvents(listener: DebugEventListener): () => void {
|
|
203
|
+
const state = getState();
|
|
204
|
+
state.listeners.add(listener);
|
|
205
|
+
return () => state.listeners.delete(listener);
|
|
206
|
+
}
|
|
207
|
+
|
|
171
208
|
/** Record a session-local debug event if debugging is enabled. */
|
|
172
209
|
export function recordDebugEvent(input: DebugEventInput): DebugEvent | null {
|
|
173
210
|
const state = getState();
|
|
@@ -183,6 +220,14 @@ export function recordDebugEvent(input: DebugEventInput): DebugEvent | null {
|
|
|
183
220
|
};
|
|
184
221
|
state.events.push(event);
|
|
185
222
|
trimToMaxEvents(state);
|
|
223
|
+
const view = toSanitizedView(event);
|
|
224
|
+
for (const listener of state.listeners) {
|
|
225
|
+
try {
|
|
226
|
+
listener(view);
|
|
227
|
+
} catch {
|
|
228
|
+
// Debug-event consumers must not alter producer behavior.
|
|
229
|
+
}
|
|
230
|
+
}
|
|
186
231
|
return { ...event };
|
|
187
232
|
}
|
|
188
233
|
|
|
@@ -196,21 +241,12 @@ export function getDebugEvents(query: DebugEventQuery = {}): DebugEventQueryResu
|
|
|
196
241
|
const limit = query.limit && query.limit > 0 ? Math.floor(query.limit) : state.config.maxEvents;
|
|
197
242
|
|
|
198
243
|
const events = state.events
|
|
199
|
-
.filter((event) =>
|
|
244
|
+
.filter((event) => matchesDebugEventQuery(event, query))
|
|
200
245
|
.slice()
|
|
201
246
|
.reverse()
|
|
202
247
|
.slice(0, limit)
|
|
203
248
|
.map((event): DebugEventView => {
|
|
204
|
-
const view
|
|
205
|
-
id: event.id,
|
|
206
|
-
timestamp: event.timestamp,
|
|
207
|
-
source: event.source,
|
|
208
|
-
level: event.level,
|
|
209
|
-
category: event.category,
|
|
210
|
-
message: event.message,
|
|
211
|
-
cwd: event.cwd,
|
|
212
|
-
data: event.data,
|
|
213
|
-
};
|
|
249
|
+
const view = toSanitizedView(event);
|
|
214
250
|
if (allowRaw && event.rawData !== undefined) {
|
|
215
251
|
view.rawData = event.rawData;
|
|
216
252
|
}
|
|
@@ -246,5 +282,6 @@ export function resetDebugRegistry(): void {
|
|
|
246
282
|
const state = getState();
|
|
247
283
|
state.config = cloneConfig(DEBUG_REGISTRY_DEFAULTS);
|
|
248
284
|
state.events = [];
|
|
285
|
+
state.listeners.clear();
|
|
249
286
|
state.nextId = 1;
|
|
250
287
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrclrchtr/supi-code-runtime",
|
|
3
|
-
"version": "4.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "4.7.0",
|
|
4
|
+
"description": "Shared workspace context and capability contracts for code intelligence",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"!__tests__"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@mrclrchtr/supi-core": "4.
|
|
32
|
+
"@mrclrchtr/supi-core": "4.7.0"
|
|
33
33
|
},
|
|
34
34
|
"bundledDependencies": [
|
|
35
35
|
"@mrclrchtr/supi-core"
|
package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-core/README.md
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
<a href="https://github.com/mrclrchtr/supi/tree/main/packages/supi-core">
|
|
3
|
-
<
|
|
4
|
-
<img src="https://raw.githubusercontent.com/mrclrchtr/supi/main/packages/supi-core/assets/social-preview.png" alt="SuPi Core" width="100%">
|
|
5
|
-
</picture>
|
|
3
|
+
<img src="https://raw.githubusercontent.com/mrclrchtr/supi/main/packages/supi-core/assets/social-preview.png" alt="SuPi Core" width="100%">
|
|
6
4
|
</a>
|
|
7
5
|
</div>
|
|
8
6
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrclrchtr/supi-core",
|
|
3
|
-
"version": "4.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "4.7.0",
|
|
4
|
+
"description": "Shared settings, configuration, reporting, and session infrastructure",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -64,6 +64,9 @@ export interface DebugEventQueryResult {
|
|
|
64
64
|
rawAccessDenied: boolean;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
/** Receives a sanitized event whenever the registry records one. */
|
|
68
|
+
export type DebugEventListener = (event: DebugEventView) => void;
|
|
69
|
+
|
|
67
70
|
export interface DebugSummary {
|
|
68
71
|
total: number;
|
|
69
72
|
byLevel: Partial<Record<DebugLevel, number>>;
|
|
@@ -73,6 +76,7 @@ export interface DebugSummary {
|
|
|
73
76
|
interface DebugRegistryState {
|
|
74
77
|
config: DebugRegistryConfig;
|
|
75
78
|
events: DebugEvent[];
|
|
79
|
+
listeners: Set<DebugEventListener>;
|
|
76
80
|
nextId: number;
|
|
77
81
|
}
|
|
78
82
|
|
|
@@ -97,10 +101,14 @@ function getState(): DebugRegistryState {
|
|
|
97
101
|
state = {
|
|
98
102
|
config: cloneConfig(DEBUG_REGISTRY_DEFAULTS),
|
|
99
103
|
events: [],
|
|
104
|
+
listeners: new Set(),
|
|
100
105
|
nextId: 1,
|
|
101
106
|
};
|
|
102
107
|
(globalThis as Record<symbol, unknown>)[REGISTRY_KEY] = state;
|
|
103
108
|
}
|
|
109
|
+
// Keep the shared registry compatible with extension reloads that reuse an
|
|
110
|
+
// instance created before listeners existed.
|
|
111
|
+
if (!state.listeners) state.listeners = new Set();
|
|
104
112
|
return state;
|
|
105
113
|
}
|
|
106
114
|
|
|
@@ -119,7 +127,16 @@ function trimToMaxEvents(state: DebugRegistryState): void {
|
|
|
119
127
|
state.events.splice(0, state.events.length - maxEvents);
|
|
120
128
|
}
|
|
121
129
|
|
|
122
|
-
|
|
130
|
+
/** Return whether a debug level is recognized by the registry. */
|
|
131
|
+
export function isDebugLevel(value: unknown): value is DebugLevel {
|
|
132
|
+
return value === "debug" || value === "info" || value === "warning" || value === "error";
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/** Match a debug event against the supported source, level, and category filters. */
|
|
136
|
+
export function matchesDebugEventQuery(
|
|
137
|
+
event: Pick<DebugEventView, "source" | "level" | "category">,
|
|
138
|
+
query: Pick<DebugEventQuery, "source" | "level" | "category">,
|
|
139
|
+
): boolean {
|
|
123
140
|
if (query.source && event.source !== query.source) return false;
|
|
124
141
|
if (query.level && event.level !== query.level) return false;
|
|
125
142
|
if (query.category && event.category !== query.category) return false;
|
|
@@ -168,6 +185,26 @@ export function redactDebugData<T>(value: T): T {
|
|
|
168
185
|
return redactValue(value, 8) as T;
|
|
169
186
|
}
|
|
170
187
|
|
|
188
|
+
function toSanitizedView(event: DebugEvent): DebugEventView {
|
|
189
|
+
return {
|
|
190
|
+
id: event.id,
|
|
191
|
+
timestamp: event.timestamp,
|
|
192
|
+
source: event.source,
|
|
193
|
+
level: event.level,
|
|
194
|
+
category: event.category,
|
|
195
|
+
message: event.message,
|
|
196
|
+
cwd: event.cwd,
|
|
197
|
+
data: event.data,
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/** Subscribe to sanitized events. Listeners are isolated so diagnostics cannot disrupt producers. */
|
|
202
|
+
export function subscribeDebugEvents(listener: DebugEventListener): () => void {
|
|
203
|
+
const state = getState();
|
|
204
|
+
state.listeners.add(listener);
|
|
205
|
+
return () => state.listeners.delete(listener);
|
|
206
|
+
}
|
|
207
|
+
|
|
171
208
|
/** Record a session-local debug event if debugging is enabled. */
|
|
172
209
|
export function recordDebugEvent(input: DebugEventInput): DebugEvent | null {
|
|
173
210
|
const state = getState();
|
|
@@ -183,6 +220,14 @@ export function recordDebugEvent(input: DebugEventInput): DebugEvent | null {
|
|
|
183
220
|
};
|
|
184
221
|
state.events.push(event);
|
|
185
222
|
trimToMaxEvents(state);
|
|
223
|
+
const view = toSanitizedView(event);
|
|
224
|
+
for (const listener of state.listeners) {
|
|
225
|
+
try {
|
|
226
|
+
listener(view);
|
|
227
|
+
} catch {
|
|
228
|
+
// Debug-event consumers must not alter producer behavior.
|
|
229
|
+
}
|
|
230
|
+
}
|
|
186
231
|
return { ...event };
|
|
187
232
|
}
|
|
188
233
|
|
|
@@ -196,21 +241,12 @@ export function getDebugEvents(query: DebugEventQuery = {}): DebugEventQueryResu
|
|
|
196
241
|
const limit = query.limit && query.limit > 0 ? Math.floor(query.limit) : state.config.maxEvents;
|
|
197
242
|
|
|
198
243
|
const events = state.events
|
|
199
|
-
.filter((event) =>
|
|
244
|
+
.filter((event) => matchesDebugEventQuery(event, query))
|
|
200
245
|
.slice()
|
|
201
246
|
.reverse()
|
|
202
247
|
.slice(0, limit)
|
|
203
248
|
.map((event): DebugEventView => {
|
|
204
|
-
const view
|
|
205
|
-
id: event.id,
|
|
206
|
-
timestamp: event.timestamp,
|
|
207
|
-
source: event.source,
|
|
208
|
-
level: event.level,
|
|
209
|
-
category: event.category,
|
|
210
|
-
message: event.message,
|
|
211
|
-
cwd: event.cwd,
|
|
212
|
-
data: event.data,
|
|
213
|
-
};
|
|
249
|
+
const view = toSanitizedView(event);
|
|
214
250
|
if (allowRaw && event.rawData !== undefined) {
|
|
215
251
|
view.rawData = event.rawData;
|
|
216
252
|
}
|
|
@@ -246,5 +282,6 @@ export function resetDebugRegistry(): void {
|
|
|
246
282
|
const state = getState();
|
|
247
283
|
state.config = cloneConfig(DEBUG_REGISTRY_DEFAULTS);
|
|
248
284
|
state.events = [];
|
|
285
|
+
state.listeners.clear();
|
|
249
286
|
state.nextId = 1;
|
|
250
287
|
}
|
package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/README.md
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
<a href="https://github.com/mrclrchtr/supi/tree/main/packages/supi-lsp">
|
|
3
|
-
<
|
|
4
|
-
<img src="https://raw.githubusercontent.com/mrclrchtr/supi/main/packages/supi-lsp/assets/social-preview.png" alt="SuPi LSP" width="100%">
|
|
5
|
-
</picture>
|
|
3
|
+
<img src="https://raw.githubusercontent.com/mrclrchtr/supi/main/packages/supi-lsp/assets/social-preview.png" alt="SuPi LSP" width="100%">
|
|
6
4
|
</a>
|
|
7
5
|
</div>
|
|
8
6
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
Shared workspace context, capability contracts, and canonical types for the SuPi code-understanding stack.
|
|
10
10
|
|
|
11
|
-
This is a **library-only package** — it has no pi extension surface, no user-facing tools, and no UI. It
|
|
11
|
+
This is a **library-only package** — it has no pi extension surface, no user-facing tools, and no UI. It is not installed directly — `supi-lsp`, `supi-tree-sitter`, and `supi-code-intelligence` bundle it and use its shared abstractions to communicate capability availability.
|
|
12
12
|
|
|
13
13
|
## Package surfaces
|
|
14
14
|
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
<a href="https://github.com/mrclrchtr/supi/tree/main/packages/supi-core">
|
|
3
|
-
<
|
|
4
|
-
<img src="https://raw.githubusercontent.com/mrclrchtr/supi/main/packages/supi-core/assets/social-preview.png" alt="SuPi Core" width="100%">
|
|
5
|
-
</picture>
|
|
3
|
+
<img src="https://raw.githubusercontent.com/mrclrchtr/supi/main/packages/supi-core/assets/social-preview.png" alt="SuPi Core" width="100%">
|
|
6
4
|
</a>
|
|
7
5
|
</div>
|
|
8
6
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrclrchtr/supi-core",
|
|
3
|
-
"version": "4.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "4.7.0",
|
|
4
|
+
"description": "Shared settings, configuration, reporting, and session infrastructure",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -64,6 +64,9 @@ export interface DebugEventQueryResult {
|
|
|
64
64
|
rawAccessDenied: boolean;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
/** Receives a sanitized event whenever the registry records one. */
|
|
68
|
+
export type DebugEventListener = (event: DebugEventView) => void;
|
|
69
|
+
|
|
67
70
|
export interface DebugSummary {
|
|
68
71
|
total: number;
|
|
69
72
|
byLevel: Partial<Record<DebugLevel, number>>;
|
|
@@ -73,6 +76,7 @@ export interface DebugSummary {
|
|
|
73
76
|
interface DebugRegistryState {
|
|
74
77
|
config: DebugRegistryConfig;
|
|
75
78
|
events: DebugEvent[];
|
|
79
|
+
listeners: Set<DebugEventListener>;
|
|
76
80
|
nextId: number;
|
|
77
81
|
}
|
|
78
82
|
|
|
@@ -97,10 +101,14 @@ function getState(): DebugRegistryState {
|
|
|
97
101
|
state = {
|
|
98
102
|
config: cloneConfig(DEBUG_REGISTRY_DEFAULTS),
|
|
99
103
|
events: [],
|
|
104
|
+
listeners: new Set(),
|
|
100
105
|
nextId: 1,
|
|
101
106
|
};
|
|
102
107
|
(globalThis as Record<symbol, unknown>)[REGISTRY_KEY] = state;
|
|
103
108
|
}
|
|
109
|
+
// Keep the shared registry compatible with extension reloads that reuse an
|
|
110
|
+
// instance created before listeners existed.
|
|
111
|
+
if (!state.listeners) state.listeners = new Set();
|
|
104
112
|
return state;
|
|
105
113
|
}
|
|
106
114
|
|
|
@@ -119,7 +127,16 @@ function trimToMaxEvents(state: DebugRegistryState): void {
|
|
|
119
127
|
state.events.splice(0, state.events.length - maxEvents);
|
|
120
128
|
}
|
|
121
129
|
|
|
122
|
-
|
|
130
|
+
/** Return whether a debug level is recognized by the registry. */
|
|
131
|
+
export function isDebugLevel(value: unknown): value is DebugLevel {
|
|
132
|
+
return value === "debug" || value === "info" || value === "warning" || value === "error";
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/** Match a debug event against the supported source, level, and category filters. */
|
|
136
|
+
export function matchesDebugEventQuery(
|
|
137
|
+
event: Pick<DebugEventView, "source" | "level" | "category">,
|
|
138
|
+
query: Pick<DebugEventQuery, "source" | "level" | "category">,
|
|
139
|
+
): boolean {
|
|
123
140
|
if (query.source && event.source !== query.source) return false;
|
|
124
141
|
if (query.level && event.level !== query.level) return false;
|
|
125
142
|
if (query.category && event.category !== query.category) return false;
|
|
@@ -168,6 +185,26 @@ export function redactDebugData<T>(value: T): T {
|
|
|
168
185
|
return redactValue(value, 8) as T;
|
|
169
186
|
}
|
|
170
187
|
|
|
188
|
+
function toSanitizedView(event: DebugEvent): DebugEventView {
|
|
189
|
+
return {
|
|
190
|
+
id: event.id,
|
|
191
|
+
timestamp: event.timestamp,
|
|
192
|
+
source: event.source,
|
|
193
|
+
level: event.level,
|
|
194
|
+
category: event.category,
|
|
195
|
+
message: event.message,
|
|
196
|
+
cwd: event.cwd,
|
|
197
|
+
data: event.data,
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/** Subscribe to sanitized events. Listeners are isolated so diagnostics cannot disrupt producers. */
|
|
202
|
+
export function subscribeDebugEvents(listener: DebugEventListener): () => void {
|
|
203
|
+
const state = getState();
|
|
204
|
+
state.listeners.add(listener);
|
|
205
|
+
return () => state.listeners.delete(listener);
|
|
206
|
+
}
|
|
207
|
+
|
|
171
208
|
/** Record a session-local debug event if debugging is enabled. */
|
|
172
209
|
export function recordDebugEvent(input: DebugEventInput): DebugEvent | null {
|
|
173
210
|
const state = getState();
|
|
@@ -183,6 +220,14 @@ export function recordDebugEvent(input: DebugEventInput): DebugEvent | null {
|
|
|
183
220
|
};
|
|
184
221
|
state.events.push(event);
|
|
185
222
|
trimToMaxEvents(state);
|
|
223
|
+
const view = toSanitizedView(event);
|
|
224
|
+
for (const listener of state.listeners) {
|
|
225
|
+
try {
|
|
226
|
+
listener(view);
|
|
227
|
+
} catch {
|
|
228
|
+
// Debug-event consumers must not alter producer behavior.
|
|
229
|
+
}
|
|
230
|
+
}
|
|
186
231
|
return { ...event };
|
|
187
232
|
}
|
|
188
233
|
|
|
@@ -196,21 +241,12 @@ export function getDebugEvents(query: DebugEventQuery = {}): DebugEventQueryResu
|
|
|
196
241
|
const limit = query.limit && query.limit > 0 ? Math.floor(query.limit) : state.config.maxEvents;
|
|
197
242
|
|
|
198
243
|
const events = state.events
|
|
199
|
-
.filter((event) =>
|
|
244
|
+
.filter((event) => matchesDebugEventQuery(event, query))
|
|
200
245
|
.slice()
|
|
201
246
|
.reverse()
|
|
202
247
|
.slice(0, limit)
|
|
203
248
|
.map((event): DebugEventView => {
|
|
204
|
-
const view
|
|
205
|
-
id: event.id,
|
|
206
|
-
timestamp: event.timestamp,
|
|
207
|
-
source: event.source,
|
|
208
|
-
level: event.level,
|
|
209
|
-
category: event.category,
|
|
210
|
-
message: event.message,
|
|
211
|
-
cwd: event.cwd,
|
|
212
|
-
data: event.data,
|
|
213
|
-
};
|
|
249
|
+
const view = toSanitizedView(event);
|
|
214
250
|
if (allowRaw && event.rawData !== undefined) {
|
|
215
251
|
view.rawData = event.rawData;
|
|
216
252
|
}
|
|
@@ -246,5 +282,6 @@ export function resetDebugRegistry(): void {
|
|
|
246
282
|
const state = getState();
|
|
247
283
|
state.config = cloneConfig(DEBUG_REGISTRY_DEFAULTS);
|
|
248
284
|
state.events = [];
|
|
285
|
+
state.listeners.clear();
|
|
249
286
|
state.nextId = 1;
|
|
250
287
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrclrchtr/supi-code-runtime",
|
|
3
|
-
"version": "4.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "4.7.0",
|
|
4
|
+
"description": "Shared workspace context and capability contracts for code intelligence",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"!__tests__"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@mrclrchtr/supi-core": "4.
|
|
32
|
+
"@mrclrchtr/supi-core": "4.7.0"
|
|
33
33
|
},
|
|
34
34
|
"bundledDependencies": [
|
|
35
35
|
"@mrclrchtr/supi-core"
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
<a href="https://github.com/mrclrchtr/supi/tree/main/packages/supi-core">
|
|
3
|
-
<
|
|
4
|
-
<img src="https://raw.githubusercontent.com/mrclrchtr/supi/main/packages/supi-core/assets/social-preview.png" alt="SuPi Core" width="100%">
|
|
5
|
-
</picture>
|
|
3
|
+
<img src="https://raw.githubusercontent.com/mrclrchtr/supi/main/packages/supi-core/assets/social-preview.png" alt="SuPi Core" width="100%">
|
|
6
4
|
</a>
|
|
7
5
|
</div>
|
|
8
6
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrclrchtr/supi-core",
|
|
3
|
-
"version": "4.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "4.7.0",
|
|
4
|
+
"description": "Shared settings, configuration, reporting, and session infrastructure",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|