pi-jev-guard 0.1.2 → 0.1.3
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/package.json +1 -1
- package/src/commands.ts +33 -0
package/package.json
CHANGED
package/src/commands.ts
CHANGED
|
@@ -125,6 +125,37 @@ export function registerJevCommand(pi: ExtensionAPI, deps: JevCommandDeps) {
|
|
|
125
125
|
guardedAuth = "sconosciuto";
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
+
// Registrato? Visibile nel picker? Selezionato? — le tre domande
|
|
129
|
+
// che spiegano ogni "non lo vedo nella lista" dopo un reload.
|
|
130
|
+
let twinScope = "—";
|
|
131
|
+
if (gate.active && gate.twin) {
|
|
132
|
+
try {
|
|
133
|
+
const scoped = ctx.scopedModels ?? [];
|
|
134
|
+
if (scoped.length === 0) {
|
|
135
|
+
twinScope = "visibile (nessun filtro modelli)";
|
|
136
|
+
} else {
|
|
137
|
+
const inScope = scoped.some(
|
|
138
|
+
(s) => `${s.model.provider}/${s.model.id}` === gate.twin,
|
|
139
|
+
);
|
|
140
|
+
twinScope = inScope
|
|
141
|
+
? "visibile nel picker"
|
|
142
|
+
: "FILTRATO FUORI — abilitalo con /scoped-models";
|
|
143
|
+
}
|
|
144
|
+
} catch {
|
|
145
|
+
twinScope = "sconosciuto";
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
let currentModel = "—";
|
|
149
|
+
try {
|
|
150
|
+
const m = ctx.model as { provider?: string; id?: string } | undefined;
|
|
151
|
+
if (m?.provider && m?.id) {
|
|
152
|
+
const ref = `${m.provider}/${m.id}`;
|
|
153
|
+
currentModel =
|
|
154
|
+
gate.active && ref === gate.twin ? `${ref} (twin: enforcement attivo)` : ref;
|
|
155
|
+
}
|
|
156
|
+
} catch {
|
|
157
|
+
currentModel = "sconosciuto";
|
|
158
|
+
}
|
|
128
159
|
ctx.ui.notify(
|
|
129
160
|
[
|
|
130
161
|
`Modalità: ${cfg.mode}`,
|
|
@@ -134,6 +165,8 @@ export function registerJevCommand(pi: ExtensionAPI, deps: JevCommandDeps) {
|
|
|
134
165
|
`Policy: ${cfg.policy.revision} pass<=${cfg.policy.passMaxFlawProbability} block>=${cfg.policy.blockMinFlawProbability}`,
|
|
135
166
|
`Chiave presente: ${resolved.apiKeyPresent ? "sì" : "no"} (${resolved.keySource})`,
|
|
136
167
|
`Gate: ${gate.active ? `attivo (twin ${gate.twin}, stessa auth di ${authProvider})` : `non attivo (${gate.reason})`}`,
|
|
168
|
+
`Twin nel picker: ${twinScope}`,
|
|
169
|
+
`Modello corrente: ${currentModel}`,
|
|
137
170
|
`Ultimo upstream salvato: ${cfg.automatic.upstreamProvider}/${cfg.automatic.upstreamModel}`,
|
|
138
171
|
`Auth guarded: ${guardedAuth}`,
|
|
139
172
|
`Tool policy: ${cfg.toolsPolicy.enabled ? "attiva in automatic (bash/powershell/write/edit)" : "disattiva (config)"}`,
|