@mrclrchtr/supi-lsp 2.0.6 → 2.2.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/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/README.md +32 -23
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/package.json +2 -1
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/config.ts +22 -8
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/prompt-surface.ts +357 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config.ts +2 -3
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +0 -5
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/prompt-surface.ts +4 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/scoped-settings-list.ts +372 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-action-menu.ts +101 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-command.ts +1 -1
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +55 -27
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-schema.ts +464 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-submenus.ts +124 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-ui.ts +72 -285
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +2 -5
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings.ts +27 -5
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/tool-framework.ts +10 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/package.json +2 -2
- package/node_modules/@mrclrchtr/supi-core/README.md +32 -23
- package/node_modules/@mrclrchtr/supi-core/package.json +2 -1
- package/node_modules/@mrclrchtr/supi-core/src/config/config.ts +22 -8
- package/node_modules/@mrclrchtr/supi-core/src/config/prompt-surface.ts +357 -0
- package/node_modules/@mrclrchtr/supi-core/src/config.ts +2 -3
- package/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +0 -5
- package/node_modules/@mrclrchtr/supi-core/src/prompt-surface.ts +4 -0
- package/node_modules/@mrclrchtr/supi-core/src/settings/scoped-settings-list.ts +372 -0
- package/node_modules/@mrclrchtr/supi-core/src/settings/settings-action-menu.ts +101 -0
- package/node_modules/@mrclrchtr/supi-core/src/settings/settings-command.ts +1 -1
- package/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +55 -27
- package/node_modules/@mrclrchtr/supi-core/src/settings/settings-schema.ts +464 -0
- package/node_modules/@mrclrchtr/supi-core/src/settings/settings-submenus.ts +124 -0
- package/node_modules/@mrclrchtr/supi-core/src/settings/settings-ui.ts +72 -285
- package/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +2 -5
- package/node_modules/@mrclrchtr/supi-core/src/settings.ts +27 -5
- package/node_modules/@mrclrchtr/supi-core/src/tool-framework.ts +10 -0
- package/package.json +3 -3
- package/src/config/lsp-settings.ts +1 -1
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/config-settings.ts +0 -188
- package/node_modules/@mrclrchtr/supi-core/src/config/config-settings.ts +0 -188
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
// Configurable tool prompt-surface overrides.
|
|
2
|
+
//
|
|
3
|
+
// Resolution order: package defaults ← global SuPi config ← trusted project SuPi config.
|
|
4
|
+
// Project overrides are trust-gated; they require PI project trust and a PI-recognized
|
|
5
|
+
// trust-requiring resource (e.g. .pi/settings.json).
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
type ExtensionContext,
|
|
9
|
+
hasTrustRequiringProjectResources,
|
|
10
|
+
} from "@earendil-works/pi-coding-agent";
|
|
11
|
+
import type { SuiPiToolPromptSurface } from "../tool-framework.ts";
|
|
12
|
+
import { loadSupiConfigSectionForScope, type SupiConfigOptions } from "./config.ts";
|
|
13
|
+
|
|
14
|
+
// ── Public types ───────────────────────────────────────────────────────────
|
|
15
|
+
|
|
16
|
+
export type ToolPromptSurfaceDiagnosticCode =
|
|
17
|
+
| "invalidPromptSurfaceConfig"
|
|
18
|
+
| "invalidPromptSurfaceField"
|
|
19
|
+
| "projectPromptSurfaceIgnored";
|
|
20
|
+
|
|
21
|
+
export interface ToolPromptSurfaceDiagnostic {
|
|
22
|
+
code: ToolPromptSurfaceDiagnosticCode;
|
|
23
|
+
scope: "global" | "project";
|
|
24
|
+
section: string;
|
|
25
|
+
toolName: string;
|
|
26
|
+
message: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface ResolveToolPromptSurfaceOptions extends SupiConfigOptions {
|
|
30
|
+
section: string;
|
|
31
|
+
toolName: string;
|
|
32
|
+
defaults: SuiPiToolPromptSurface;
|
|
33
|
+
ctx: Pick<ExtensionContext, "cwd" | "isProjectTrusted">;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface ResolveToolPromptSurfaceResult {
|
|
37
|
+
surface: SuiPiToolPromptSurface;
|
|
38
|
+
diagnostics: ToolPromptSurfaceDiagnostic[];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// ── Private types ──────────────────────────────────────────────────────────
|
|
42
|
+
|
|
43
|
+
type PromptSurfaceField = keyof SuiPiToolPromptSurface;
|
|
44
|
+
type PromptSurfaceScope = ToolPromptSurfaceDiagnostic["scope"];
|
|
45
|
+
|
|
46
|
+
const PROMPT_SURFACE_FIELDS = new Set<string>(["description", "promptSnippet", "promptGuidelines"]);
|
|
47
|
+
|
|
48
|
+
const PROMPT_SURFACE_DIAGNOSTICS_KEY = Symbol.for(
|
|
49
|
+
"@mrclrchtr/supi-core/tool-prompt-surface/notified-diagnostics",
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
// ── Resolution ─────────────────────────────────────────────────────────────
|
|
53
|
+
|
|
54
|
+
/** Resolve a tool's model-facing prompt surface from defaults + SuPi config overrides. */
|
|
55
|
+
export function resolveToolPromptSurface(
|
|
56
|
+
options: ResolveToolPromptSurfaceOptions,
|
|
57
|
+
): ResolveToolPromptSurfaceResult {
|
|
58
|
+
const diagnostics: ToolPromptSurfaceDiagnostic[] = [];
|
|
59
|
+
let surface = clonePromptSurface(options.defaults);
|
|
60
|
+
|
|
61
|
+
const globalSection = loadSupiConfigSectionForScope(options.section, options.ctx.cwd, {
|
|
62
|
+
scope: "global",
|
|
63
|
+
homeDir: options.homeDir,
|
|
64
|
+
});
|
|
65
|
+
surface = applyPromptSurfaceScope(surface, options, "global", globalSection, diagnostics);
|
|
66
|
+
|
|
67
|
+
const projectSection = loadSupiConfigSectionForScope(options.section, options.ctx.cwd, {
|
|
68
|
+
scope: "project",
|
|
69
|
+
homeDir: options.homeDir,
|
|
70
|
+
});
|
|
71
|
+
const projectPromptSurface = getPromptSurfaceConfig(projectSection, options.toolName, {
|
|
72
|
+
diagnostics,
|
|
73
|
+
options,
|
|
74
|
+
scope: "project",
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
if (projectPromptSurface) {
|
|
78
|
+
const hasTrustMarker = hasTrustRequiringProjectResources(options.ctx.cwd);
|
|
79
|
+
const projectTrusted = options.ctx.isProjectTrusted();
|
|
80
|
+
if (hasTrustMarker && projectTrusted) {
|
|
81
|
+
surface = applyPromptSurfaceConfig(
|
|
82
|
+
surface,
|
|
83
|
+
options.defaults,
|
|
84
|
+
projectPromptSurface,
|
|
85
|
+
options,
|
|
86
|
+
"project",
|
|
87
|
+
diagnostics,
|
|
88
|
+
);
|
|
89
|
+
} else {
|
|
90
|
+
diagnostics.push({
|
|
91
|
+
code: "projectPromptSurfaceIgnored",
|
|
92
|
+
scope: "project",
|
|
93
|
+
section: options.section,
|
|
94
|
+
toolName: options.toolName,
|
|
95
|
+
message: hasTrustMarker
|
|
96
|
+
? `Project prompt-surface overrides for ${options.toolName} were ignored because the project is not trusted in PI.`
|
|
97
|
+
: `Project prompt-surface overrides for ${options.toolName} were ignored because ${options.ctx.cwd}/.pi/supi/config.json is not PI trust-gated. Add .pi/settings.json and trust the project to enable them.`,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return { surface, diagnostics };
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** Notify prompt-surface diagnostics once per session/tool/diagnostic code. */
|
|
106
|
+
export function notifyToolPromptSurfaceDiagnostics(
|
|
107
|
+
ctx: Pick<ExtensionContext, "sessionManager" | "ui">,
|
|
108
|
+
diagnostics: readonly ToolPromptSurfaceDiagnostic[],
|
|
109
|
+
): void {
|
|
110
|
+
const globalRecord = globalThis as Record<symbol, Set<string> | undefined>;
|
|
111
|
+
const notified = globalRecord[PROMPT_SURFACE_DIAGNOSTICS_KEY] ?? new Set<string>();
|
|
112
|
+
globalRecord[PROMPT_SURFACE_DIAGNOSTICS_KEY] = notified;
|
|
113
|
+
const sessionId = ctx.sessionManager.getSessionId();
|
|
114
|
+
|
|
115
|
+
for (const diagnostic of diagnostics) {
|
|
116
|
+
const key = `${sessionId}:${diagnostic.section}:${diagnostic.toolName}:${diagnostic.code}`;
|
|
117
|
+
if (notified.has(key)) continue;
|
|
118
|
+
notified.add(key);
|
|
119
|
+
ctx.ui.notify(diagnostic.message, "warning");
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// ── Scope helpers ──────────────────────────────────────────────────────────
|
|
124
|
+
|
|
125
|
+
// biome-ignore lint/complexity/useMaxParams: resolver dispatch with diagnostics
|
|
126
|
+
function applyPromptSurfaceScope(
|
|
127
|
+
current: SuiPiToolPromptSurface,
|
|
128
|
+
options: ResolveToolPromptSurfaceOptions,
|
|
129
|
+
scope: PromptSurfaceScope,
|
|
130
|
+
sectionConfig: Record<string, unknown> | null,
|
|
131
|
+
diagnostics: ToolPromptSurfaceDiagnostic[],
|
|
132
|
+
): SuiPiToolPromptSurface {
|
|
133
|
+
const promptSurface = getPromptSurfaceConfig(sectionConfig, options.toolName, {
|
|
134
|
+
diagnostics,
|
|
135
|
+
options,
|
|
136
|
+
scope,
|
|
137
|
+
});
|
|
138
|
+
if (!promptSurface) return current;
|
|
139
|
+
return applyPromptSurfaceConfig(
|
|
140
|
+
current,
|
|
141
|
+
options.defaults,
|
|
142
|
+
promptSurface,
|
|
143
|
+
options,
|
|
144
|
+
scope,
|
|
145
|
+
diagnostics,
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// biome-ignore lint/complexity/useMaxParams: per-scope config merger with diagnostics
|
|
150
|
+
function applyPromptSurfaceConfig(
|
|
151
|
+
current: SuiPiToolPromptSurface,
|
|
152
|
+
defaults: SuiPiToolPromptSurface,
|
|
153
|
+
config: Record<string, unknown>,
|
|
154
|
+
options: ResolveToolPromptSurfaceOptions,
|
|
155
|
+
scope: PromptSurfaceScope,
|
|
156
|
+
diagnostics: ToolPromptSurfaceDiagnostic[],
|
|
157
|
+
): SuiPiToolPromptSurface {
|
|
158
|
+
let next = clonePromptSurface(current);
|
|
159
|
+
|
|
160
|
+
for (const field of getResetFields(config.$reset, options, scope, diagnostics)) {
|
|
161
|
+
next = { ...next, [field]: clonePromptSurfaceField(defaults[field]) };
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const description = getOptionalNonEmptyString(
|
|
165
|
+
config.description,
|
|
166
|
+
"description",
|
|
167
|
+
options,
|
|
168
|
+
scope,
|
|
169
|
+
diagnostics,
|
|
170
|
+
);
|
|
171
|
+
if (description !== undefined) next.description = description;
|
|
172
|
+
|
|
173
|
+
const promptSnippet = getOptionalNonEmptyString(
|
|
174
|
+
config.promptSnippet,
|
|
175
|
+
"promptSnippet",
|
|
176
|
+
options,
|
|
177
|
+
scope,
|
|
178
|
+
diagnostics,
|
|
179
|
+
);
|
|
180
|
+
if (promptSnippet !== undefined) next.promptSnippet = promptSnippet;
|
|
181
|
+
|
|
182
|
+
const promptGuidelines = getOptionalStringArray(
|
|
183
|
+
config.promptGuidelines,
|
|
184
|
+
"promptGuidelines",
|
|
185
|
+
options,
|
|
186
|
+
scope,
|
|
187
|
+
diagnostics,
|
|
188
|
+
);
|
|
189
|
+
if (promptGuidelines !== undefined) next.promptGuidelines = promptGuidelines;
|
|
190
|
+
|
|
191
|
+
const prepend = getOptionalStringArray(
|
|
192
|
+
config.prependPromptGuidelines,
|
|
193
|
+
"prependPromptGuidelines",
|
|
194
|
+
options,
|
|
195
|
+
scope,
|
|
196
|
+
diagnostics,
|
|
197
|
+
);
|
|
198
|
+
if (prepend !== undefined) next.promptGuidelines = [...prepend, ...next.promptGuidelines];
|
|
199
|
+
|
|
200
|
+
const append = getOptionalStringArray(
|
|
201
|
+
config.appendPromptGuidelines,
|
|
202
|
+
"appendPromptGuidelines",
|
|
203
|
+
options,
|
|
204
|
+
scope,
|
|
205
|
+
diagnostics,
|
|
206
|
+
);
|
|
207
|
+
if (append !== undefined) next.promptGuidelines = [...next.promptGuidelines, ...append];
|
|
208
|
+
|
|
209
|
+
return next;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// ── Config extraction ──────────────────────────────────────────────────────
|
|
213
|
+
|
|
214
|
+
function getPromptSurfaceConfig(
|
|
215
|
+
sectionConfig: Record<string, unknown> | null,
|
|
216
|
+
toolName: string,
|
|
217
|
+
deps: {
|
|
218
|
+
diagnostics: ToolPromptSurfaceDiagnostic[];
|
|
219
|
+
options: ResolveToolPromptSurfaceOptions;
|
|
220
|
+
scope: PromptSurfaceScope;
|
|
221
|
+
},
|
|
222
|
+
): Record<string, unknown> | null {
|
|
223
|
+
if (!sectionConfig) return null;
|
|
224
|
+
if (sectionConfig.tools === undefined) return null;
|
|
225
|
+
if (!isRecord(sectionConfig.tools)) {
|
|
226
|
+
pushInvalidConfig(deps, "tools must be an object.");
|
|
227
|
+
return null;
|
|
228
|
+
}
|
|
229
|
+
const toolConfig = sectionConfig.tools[toolName];
|
|
230
|
+
if (toolConfig === undefined) return null;
|
|
231
|
+
if (!isRecord(toolConfig)) {
|
|
232
|
+
pushInvalidConfig(deps, `tools.${toolName} must be an object.`);
|
|
233
|
+
return null;
|
|
234
|
+
}
|
|
235
|
+
if (toolConfig.promptSurface === undefined) return null;
|
|
236
|
+
if (!isRecord(toolConfig.promptSurface)) {
|
|
237
|
+
pushInvalidConfig(deps, `tools.${toolName}.promptSurface must be an object.`);
|
|
238
|
+
return null;
|
|
239
|
+
}
|
|
240
|
+
return toolConfig.promptSurface;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// ── Field validation ───────────────────────────────────────────────────────
|
|
244
|
+
|
|
245
|
+
function getResetFields(
|
|
246
|
+
value: unknown,
|
|
247
|
+
options: ResolveToolPromptSurfaceOptions,
|
|
248
|
+
scope: PromptSurfaceScope,
|
|
249
|
+
diagnostics: ToolPromptSurfaceDiagnostic[],
|
|
250
|
+
): PromptSurfaceField[] {
|
|
251
|
+
if (value === undefined) return [];
|
|
252
|
+
if (!Array.isArray(value)) {
|
|
253
|
+
pushInvalidField(options, scope, diagnostics, "$reset", "must be an array.");
|
|
254
|
+
return [];
|
|
255
|
+
}
|
|
256
|
+
const fields: PromptSurfaceField[] = [];
|
|
257
|
+
for (const item of value) {
|
|
258
|
+
if (typeof item === "string" && PROMPT_SURFACE_FIELDS.has(item)) {
|
|
259
|
+
fields.push(item as PromptSurfaceField);
|
|
260
|
+
} else {
|
|
261
|
+
pushInvalidField(
|
|
262
|
+
options,
|
|
263
|
+
scope,
|
|
264
|
+
diagnostics,
|
|
265
|
+
"$reset",
|
|
266
|
+
`contains unsupported field ${JSON.stringify(item)}.`,
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
return fields;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// biome-ignore lint/complexity/useMaxParams: validation helper with diagnostics
|
|
274
|
+
function getOptionalNonEmptyString(
|
|
275
|
+
value: unknown,
|
|
276
|
+
field: string,
|
|
277
|
+
options: ResolveToolPromptSurfaceOptions,
|
|
278
|
+
scope: PromptSurfaceScope,
|
|
279
|
+
diagnostics: ToolPromptSurfaceDiagnostic[],
|
|
280
|
+
): string | undefined {
|
|
281
|
+
if (value === undefined) return undefined;
|
|
282
|
+
if (typeof value === "string" && value.length > 0) return value;
|
|
283
|
+
pushInvalidField(options, scope, diagnostics, field, "must be a non-empty string.");
|
|
284
|
+
return undefined;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// biome-ignore lint/complexity/useMaxParams: validation helper with diagnostics
|
|
288
|
+
function getOptionalStringArray(
|
|
289
|
+
value: unknown,
|
|
290
|
+
field: string,
|
|
291
|
+
options: ResolveToolPromptSurfaceOptions,
|
|
292
|
+
scope: PromptSurfaceScope,
|
|
293
|
+
diagnostics: ToolPromptSurfaceDiagnostic[],
|
|
294
|
+
): string[] | undefined {
|
|
295
|
+
if (value === undefined) return undefined;
|
|
296
|
+
if (Array.isArray(value) && value.every((item) => typeof item === "string")) {
|
|
297
|
+
return [...value];
|
|
298
|
+
}
|
|
299
|
+
pushInvalidField(options, scope, diagnostics, field, "must be an array of strings.");
|
|
300
|
+
return undefined;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
// ── Diagnostics ────────────────────────────────────────────────────────────
|
|
304
|
+
|
|
305
|
+
function pushInvalidConfig(
|
|
306
|
+
deps: {
|
|
307
|
+
diagnostics: ToolPromptSurfaceDiagnostic[];
|
|
308
|
+
options: ResolveToolPromptSurfaceOptions;
|
|
309
|
+
scope: PromptSurfaceScope;
|
|
310
|
+
},
|
|
311
|
+
detail: string,
|
|
312
|
+
): void {
|
|
313
|
+
deps.diagnostics.push({
|
|
314
|
+
// biome-ignore lint/security/noSecrets: false positive on string constant
|
|
315
|
+
code: "invalidPromptSurfaceConfig",
|
|
316
|
+
scope: deps.scope,
|
|
317
|
+
section: deps.options.section,
|
|
318
|
+
toolName: deps.options.toolName,
|
|
319
|
+
message: `Invalid prompt-surface config for ${deps.options.section}.${deps.options.toolName}: ${detail}`,
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
// biome-ignore lint/complexity/useMaxParams: diagnostics utility with many fields
|
|
324
|
+
function pushInvalidField(
|
|
325
|
+
options: ResolveToolPromptSurfaceOptions,
|
|
326
|
+
scope: PromptSurfaceScope,
|
|
327
|
+
diagnostics: ToolPromptSurfaceDiagnostic[],
|
|
328
|
+
field: string,
|
|
329
|
+
detail: string,
|
|
330
|
+
): void {
|
|
331
|
+
diagnostics.push({
|
|
332
|
+
// biome-ignore lint/security/noSecrets: false positive on string constant
|
|
333
|
+
code: "invalidPromptSurfaceField",
|
|
334
|
+
scope,
|
|
335
|
+
section: options.section,
|
|
336
|
+
toolName: options.toolName,
|
|
337
|
+
message: `Invalid prompt-surface field ${field} for ${options.section}.${options.toolName}: ${detail}`,
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
// ── Cloning ────────────────────────────────────────────────────────────────
|
|
342
|
+
|
|
343
|
+
function clonePromptSurface(surface: SuiPiToolPromptSurface): SuiPiToolPromptSurface {
|
|
344
|
+
return {
|
|
345
|
+
description: surface.description,
|
|
346
|
+
promptSnippet: surface.promptSnippet,
|
|
347
|
+
promptGuidelines: [...surface.promptGuidelines],
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
function clonePromptSurfaceField<T extends string | string[]>(value: T): T {
|
|
352
|
+
return (Array.isArray(value) ? [...value] : value) as T;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
356
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
357
|
+
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
// supi-core config domain — config loading
|
|
1
|
+
// supi-core config domain — config loading.
|
|
2
2
|
export type { SupiConfigLocation, SupiConfigOptions } from "./config/config.ts";
|
|
3
3
|
export {
|
|
4
4
|
loadSectionConfig,
|
|
5
5
|
loadSupiConfig,
|
|
6
6
|
loadSupiConfigForScope,
|
|
7
|
+
loadSupiConfigSectionForScope,
|
|
7
8
|
readJsonFile,
|
|
8
9
|
removeSupiConfigKey,
|
|
9
10
|
writeSupiConfig,
|
|
10
11
|
} from "./config/config.ts";
|
|
11
|
-
export type { ConfigSettingsHelpers, ConfigSettingsOptions } from "./config/config-settings.ts";
|
|
12
|
-
export { registerConfigSettings } from "./config/config-settings.ts";
|
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
export type DebugLevel = "debug" | "info" | "warning" | "error";
|
|
8
8
|
export type DebugAgentAccess = "off" | "sanitized" | "raw";
|
|
9
|
-
export type DebugNotifyLevel = "off" | "warning" | "error";
|
|
10
|
-
|
|
11
9
|
export interface DebugRegistryConfig {
|
|
12
10
|
/** Whether producers should retain debug events. */
|
|
13
11
|
enabled: boolean;
|
|
@@ -15,15 +13,12 @@ export interface DebugRegistryConfig {
|
|
|
15
13
|
agentAccess: DebugAgentAccess;
|
|
16
14
|
/** Maximum number of session-local events to keep in memory. */
|
|
17
15
|
maxEvents: number;
|
|
18
|
-
/** Minimum level that should notify the user; interpreted by UI extensions. */
|
|
19
|
-
notifyLevel: DebugNotifyLevel;
|
|
20
16
|
}
|
|
21
17
|
|
|
22
18
|
export const DEBUG_REGISTRY_DEFAULTS: DebugRegistryConfig = {
|
|
23
19
|
enabled: false,
|
|
24
20
|
agentAccess: "sanitized",
|
|
25
21
|
maxEvents: 100,
|
|
26
|
-
notifyLevel: "off",
|
|
27
22
|
};
|
|
28
23
|
|
|
29
24
|
export interface DebugEventInput {
|