@wrongstack/cli 1.0.10 → 1.0.12
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/{acp-CXLANMEZ.js → acp-IJ55NBMJ.js} +5 -3
- package/dist/acp-mcp-servers.d.ts +2 -0
- package/dist/arg-parser.d.ts +6 -0
- package/dist/{auth-3K6EN5JP.js → auth-YXK3EDUL.js} +9 -3
- package/dist/{chunk-EK2P53GL.js → chunk-C3Z4N6A6.js} +23 -3
- package/dist/{chunk-7K3IJGWC.js → chunk-OJR7K3OI.js} +8 -8
- package/dist/{chunk-SXJTVNWF.js → chunk-OWNC7LMD.js} +2 -2
- package/dist/{chunk-FSZ5QU3M.js → chunk-RDHFXOJM.js} +153 -69
- package/dist/{chunk-5VPDKQDH.js → chunk-TNZBQG45.js} +3 -3
- package/dist/{chunk-7FPN3QTH.js → chunk-YRC3I3LE.js} +172 -15
- package/dist/{cli-context-6GMXUOXD.js → cli-context-5IF7ZYEY.js} +7 -7
- package/dist/{cli-main-BU5DEHDO.js → cli-main-6LMQSS66.js} +84 -42
- package/dist/{diag-doctor-PCER6KHH.js → diag-doctor-ANPRUYFM.js} +13 -3
- package/dist/{execution-4RXQLDAF.js → execution-EXDRBS4F.js} +2 -2
- package/dist/{hq-DQTUE7RC.js → hq-NO2NWGU4.js} +153 -5
- package/dist/hq-server/auth-state.d.ts +11 -0
- package/dist/hq-server/mailbox-gateway-health.d.ts +67 -0
- package/dist/hq-server/mailbox-gateway-manager.d.ts +38 -0
- package/dist/hq-server/routes/system-handlers.d.ts +27 -0
- package/dist/hq-server/routes.d.ts +11 -0
- package/dist/hq-server/snapshot.d.ts +14 -1
- package/dist/hq-server/upgrade-handler.d.ts +7 -0
- package/dist/{hq-server-JJFGFWI5.js → hq-server-KE5YDNGG.js} +2 -2
- package/dist/index.js +4 -4
- package/dist/{mcp-FX7TKPTV.js → mcp-DC5WSBOO.js} +28 -10
- package/dist/mcp-serve.d.ts +9 -0
- package/dist/services/mcp-management.d.ts +0 -6
- package/dist/{short-circuit-flags-LHUNLCZY.js → short-circuit-flags-72E77TJI.js} +3 -3
- package/dist/{subcommands-UXWY3OPC.js → subcommands-EJI7DBQS.js} +2 -2
- package/dist/wiring/codebase-index.d.ts +8 -0
- package/package.json +28 -28
|
@@ -231,7 +231,8 @@ async function connectAcpSessionMcpServers(opts) {
|
|
|
231
231
|
// this call. A lazily registered tool would exist in the registry but be
|
|
232
232
|
// absent from the very first turn's provider payload.
|
|
233
233
|
lazyMode: false,
|
|
234
|
-
...opts.cacheDir ? { cacheDir: opts.cacheDir } : {}
|
|
234
|
+
...opts.cacheDir ? { cacheDir: opts.cacheDir } : {},
|
|
235
|
+
...opts.cwd ? { cwd: opts.cwd } : {}
|
|
235
236
|
});
|
|
236
237
|
for (const server of opts.servers) {
|
|
237
238
|
try {
|
|
@@ -446,7 +447,8 @@ function buildAcpServerAgentFactory(deps, options = {}) {
|
|
|
446
447
|
toolRegistry: tools,
|
|
447
448
|
events,
|
|
448
449
|
logger,
|
|
449
|
-
...wpaths.cacheDir ? { cacheDir: wpaths.cacheDir } : {}
|
|
450
|
+
...wpaths.cacheDir ? { cacheDir: wpaths.cacheDir } : {},
|
|
451
|
+
cwd
|
|
450
452
|
});
|
|
451
453
|
if (mcp) sessionMcp.set(sessionId, mcp);
|
|
452
454
|
}
|
|
@@ -1165,4 +1167,4 @@ ${renderAcpBenchText(result)}
|
|
|
1165
1167
|
export {
|
|
1166
1168
|
acpCmd
|
|
1167
1169
|
};
|
|
1168
|
-
//# sourceMappingURL=acp-
|
|
1170
|
+
//# sourceMappingURL=acp-IJ55NBMJ.js.map
|
|
@@ -36,6 +36,8 @@ export interface AcpSessionMcpOptions {
|
|
|
36
36
|
events: EventBus;
|
|
37
37
|
logger: Logger;
|
|
38
38
|
cacheDir?: string | undefined;
|
|
39
|
+
/** The ACP session's cwd — each session names its own, unrelated to the process cwd. */
|
|
40
|
+
cwd?: string | undefined;
|
|
39
41
|
}
|
|
40
42
|
/**
|
|
41
43
|
* Connect the session's MCP servers and register their tools.
|
package/dist/arg-parser.d.ts
CHANGED
|
@@ -16,6 +16,12 @@ export interface AuthFlags {
|
|
|
16
16
|
family?: import('@wrongstack/core/types').WireFamily | undefined;
|
|
17
17
|
baseUrl?: string | undefined;
|
|
18
18
|
envVars?: string[] | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* `--audit [target]` — `true` for a bare flag (stdout), otherwise the
|
|
21
|
+
* target: `'stdout'`, `'stderr'`, or a file path. Consumed by
|
|
22
|
+
* `resolveAuditSink` in `auth-menu/auth-menu-audit.ts`.
|
|
23
|
+
*/
|
|
24
|
+
audit?: boolean | string | undefined;
|
|
19
25
|
}
|
|
20
26
|
/** Parse `wstack auth <provider> [--label ...] [--family ...] [...]` flags. */
|
|
21
27
|
export declare function parseAuthFlags(args: string[]): AuthFlags;
|
|
@@ -3,18 +3,20 @@ import {
|
|
|
3
3
|
addFromCatalog,
|
|
4
4
|
addKeyForProvider,
|
|
5
5
|
confirm,
|
|
6
|
+
createAuthAuditLogger,
|
|
6
7
|
loadProviders,
|
|
7
8
|
providerAuthStrategiesFor,
|
|
8
9
|
readKeyInput,
|
|
9
10
|
renderActions,
|
|
10
11
|
renderProviderHeader,
|
|
11
12
|
renderTopMenu,
|
|
13
|
+
resolveAuditSink,
|
|
12
14
|
resolveOAuthKind,
|
|
13
15
|
runAuthLocal,
|
|
14
16
|
runOAuthLoginKind,
|
|
15
17
|
runOAuthLoginMenu,
|
|
16
18
|
validateFamily
|
|
17
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-RDHFXOJM.js";
|
|
18
20
|
import {
|
|
19
21
|
renderAuthLocalHelpToString,
|
|
20
22
|
wantsLocalHelp
|
|
@@ -29,7 +31,7 @@ import {
|
|
|
29
31
|
} from "./chunk-YMXXOOFN.js";
|
|
30
32
|
import {
|
|
31
33
|
parseAuthFlags
|
|
32
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-C3Z4N6A6.js";
|
|
33
35
|
import "./chunk-SIGUWXAA.js";
|
|
34
36
|
import "./chunk-DAKVBMD4.js";
|
|
35
37
|
import {
|
|
@@ -398,6 +400,7 @@ var authCmd = async (args, deps) => {
|
|
|
398
400
|
"probe-only",
|
|
399
401
|
"model",
|
|
400
402
|
"m",
|
|
403
|
+
"audit",
|
|
401
404
|
"help",
|
|
402
405
|
"h"
|
|
403
406
|
]);
|
|
@@ -436,6 +439,9 @@ var authCmd = async (args, deps) => {
|
|
|
436
439
|
skipKey: has("no-key", "skip-key"),
|
|
437
440
|
noProbe: has("no-probe", "skip-probe"),
|
|
438
441
|
probeOnly: has("probe-only"),
|
|
442
|
+
// `--audit [target]` → the documented JSONL sink (stdout / stderr /
|
|
443
|
+
// file). Absent → the no-op logger, so the default stays silent.
|
|
444
|
+
audit: createAuthAuditLogger(resolveAuditSink(flags.audit)),
|
|
439
445
|
// Bare `--model` (no value, or followed by another flag) clears the
|
|
440
446
|
// allowlist, which is why an empty string is meaningful here.
|
|
441
447
|
...modelIdx >= 0 ? { models: args[modelIdx + 1]?.startsWith("-") ? "" : args[modelIdx + 1] ?? "" } : {}
|
|
@@ -619,4 +625,4 @@ async function runAuthRemove(deps, providerId) {
|
|
|
619
625
|
export {
|
|
620
626
|
authCmd
|
|
621
627
|
};
|
|
622
|
-
//# sourceMappingURL=auth-
|
|
628
|
+
//# sourceMappingURL=auth-YXK3EDUL.js.map
|
|
@@ -140,7 +140,12 @@ function parseArgs(argv) {
|
|
|
140
140
|
} else if (a.startsWith("-") && a.length === 2) {
|
|
141
141
|
const short = a.slice(1);
|
|
142
142
|
const expand = { v: "verbose", y: "yes", h: "help" };
|
|
143
|
-
|
|
143
|
+
const name = expand[short] ?? short;
|
|
144
|
+
if (!BOOLEAN_FLAGS.has(name) && i + 1 < argv.length && !(argv[i + 1] ?? "").startsWith("-")) {
|
|
145
|
+
flags[name] = argv[++i] ?? "";
|
|
146
|
+
} else {
|
|
147
|
+
flags[name] = true;
|
|
148
|
+
}
|
|
144
149
|
} else {
|
|
145
150
|
positional.push(a);
|
|
146
151
|
}
|
|
@@ -193,7 +198,22 @@ function parseAuthFlags(args) {
|
|
|
193
198
|
const v = inlineVal !== void 0 ? inlineVal : args[++i];
|
|
194
199
|
if (v)
|
|
195
200
|
out.envVars = v.split(",").map((s) => s.trim()).filter(Boolean);
|
|
196
|
-
} else if (
|
|
201
|
+
} else if (key === "--audit") {
|
|
202
|
+
const next = args[i + 1];
|
|
203
|
+
if (inlineVal !== void 0) {
|
|
204
|
+
if (inlineVal) out.audit = inlineVal;
|
|
205
|
+
} else if (next === void 0 || next.startsWith("-")) {
|
|
206
|
+
out.audit = true;
|
|
207
|
+
} else {
|
|
208
|
+
out.audit = args[++i] ?? "";
|
|
209
|
+
}
|
|
210
|
+
} else if (a.startsWith("-")) {
|
|
211
|
+
const name = a.replace(/^-+/, "").split("=")[0] ?? "";
|
|
212
|
+
const isBoolean = name === "" || BOOLEAN_FLAGS.has(name);
|
|
213
|
+
if (!isBoolean && inlineVal === void 0 && i + 1 < args.length && !(args[i + 1] ?? "").startsWith("-")) {
|
|
214
|
+
i++;
|
|
215
|
+
}
|
|
216
|
+
} else {
|
|
197
217
|
out.positional.push(a);
|
|
198
218
|
}
|
|
199
219
|
}
|
|
@@ -238,4 +258,4 @@ export {
|
|
|
238
258
|
parseAuthFlags,
|
|
239
259
|
parseSpawnFlags
|
|
240
260
|
};
|
|
241
|
-
//# sourceMappingURL=chunk-
|
|
261
|
+
//# sourceMappingURL=chunk-C3Z4N6A6.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
2
|
// src/subcommands/index.ts
|
|
3
3
|
var loaders = {
|
|
4
|
-
acp: async () => (await import("./acp-
|
|
4
|
+
acp: async () => (await import("./acp-IJ55NBMJ.js")).acpCmd,
|
|
5
5
|
init: async () => (await import("./init-DRMMFG2G.js")).initCmd,
|
|
6
|
-
auth: async () => (await import("./auth-
|
|
6
|
+
auth: async () => (await import("./auth-YXK3EDUL.js")).authCmd,
|
|
7
7
|
update: async () => (await import("./update-5DPB4YD4.js")).updateCmd,
|
|
8
8
|
sessions: async () => (await import("./sessions-config-UL45XKX7.js")).sessionsCmd,
|
|
9
9
|
config: async () => (await import("./sessions-config-UL45XKX7.js")).configCmd,
|
|
@@ -16,12 +16,12 @@ var loaders = {
|
|
|
16
16
|
skills: async () => (await import("./tools-skills-GH24UCBY.js")).skillsCmd,
|
|
17
17
|
providers: async () => (await import("./providers-models-LFNZ5WI7.js")).providersCmd,
|
|
18
18
|
models: async () => (await import("./providers-models-LFNZ5WI7.js")).modelsCmd,
|
|
19
|
-
mcp: async () => (await import("./mcp-
|
|
19
|
+
mcp: async () => (await import("./mcp-DC5WSBOO.js")).mcpCmd,
|
|
20
20
|
plugin: async () => (await import("./plugin-usage-M6KET4OZ.js")).pluginCmd,
|
|
21
21
|
plugins: async () => (await import("./plugin-usage-M6KET4OZ.js")).pluginCmd,
|
|
22
|
-
diag: async () => (await import("./diag-doctor-
|
|
23
|
-
doctor: async () => (await import("./diag-doctor-
|
|
24
|
-
"proxy-status": async () => (await import("./diag-doctor-
|
|
22
|
+
diag: async () => (await import("./diag-doctor-ANPRUYFM.js")).diagCmd,
|
|
23
|
+
doctor: async () => (await import("./diag-doctor-ANPRUYFM.js")).doctorCmd,
|
|
24
|
+
"proxy-status": async () => (await import("./diag-doctor-ANPRUYFM.js")).proxyCmd,
|
|
25
25
|
export: async () => (await import("./export-VVRIOWFV.js")).exportCmd,
|
|
26
26
|
usage: async () => (await import("./plugin-usage-M6KET4OZ.js")).usageCmd,
|
|
27
27
|
version: async () => (await import("./version-help-WXI42PZ3.js")).versionCmd,
|
|
@@ -31,7 +31,7 @@ var loaders = {
|
|
|
31
31
|
quick: async () => (await import("./quick-CNB4Z3HS.js")).quickCmd,
|
|
32
32
|
bench: async () => (await import("./bench-YBU6BVQP.js")).benchCmd,
|
|
33
33
|
chronicle: async () => (await import("./chronicle-UTFETHP6.js")).chronicleCmd,
|
|
34
|
-
hq: async () => (await import("./hq-
|
|
34
|
+
hq: async () => (await import("./hq-NO2NWGU4.js")).hqCmd,
|
|
35
35
|
mailbox: async () => (await import("./mailbox-serve-X3CR6VFW.js")).mailboxServeCmd,
|
|
36
36
|
permissions: async () => (await import("./permissions-CFDLXETM.js")).permissionsCmd,
|
|
37
37
|
project: async () => (await import("./project-AOQI5XTK.js")).projectCmd,
|
|
@@ -51,4 +51,4 @@ export {
|
|
|
51
51
|
subcommands,
|
|
52
52
|
subcommandNames
|
|
53
53
|
};
|
|
54
|
-
//# sourceMappingURL=chunk-
|
|
54
|
+
//# sourceMappingURL=chunk-OJR7K3OI.js.map
|
|
@@ -58,7 +58,7 @@ async function runGit(args, cwd) {
|
|
|
58
58
|
child.on("error", (err) => {
|
|
59
59
|
reject(new Error(`Failed to run git: ${err.message}`));
|
|
60
60
|
});
|
|
61
|
-
child.on("close", (code) => resolve({ stdout, stderr, code: code ??
|
|
61
|
+
child.on("close", (code) => resolve({ stdout, stderr, code: code ?? 1 }));
|
|
62
62
|
});
|
|
63
63
|
} catch (err) {
|
|
64
64
|
throw new Error(toErrorMessage(err));
|
|
@@ -75,4 +75,4 @@ export {
|
|
|
75
75
|
normalizeTuiThinkingWord,
|
|
76
76
|
runGit
|
|
77
77
|
};
|
|
78
|
-
//# sourceMappingURL=chunk-
|
|
78
|
+
//# sourceMappingURL=chunk-OWNC7LMD.js.map
|
|
@@ -20,6 +20,156 @@ import {
|
|
|
20
20
|
writeKeysBack
|
|
21
21
|
} from "./chunk-DR2OXU46.js";
|
|
22
22
|
|
|
23
|
+
// src/auth-menu/auth-menu-audit.ts
|
|
24
|
+
import { appendFileSync } from "node:fs";
|
|
25
|
+
import { DefaultSecretScrubber } from "@wrongstack/core/security";
|
|
26
|
+
function defaultStdoutSink() {
|
|
27
|
+
return {
|
|
28
|
+
write(line) {
|
|
29
|
+
process.stdout.write(`${line}
|
|
30
|
+
`);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function defaultStderrSink() {
|
|
35
|
+
return {
|
|
36
|
+
write(line) {
|
|
37
|
+
process.stderr.write(`${line}
|
|
38
|
+
`);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function fileAuditSink(path) {
|
|
43
|
+
return {
|
|
44
|
+
write(line) {
|
|
45
|
+
appendFileSync(path, `${line}
|
|
46
|
+
`, { encoding: "utf8", mode: 384 });
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function resolveAuditSink(flag) {
|
|
51
|
+
if (flag === void 0) return void 0;
|
|
52
|
+
if (flag === true || flag === "stdout") return defaultStdoutSink();
|
|
53
|
+
if (flag === "stderr") return defaultStderrSink();
|
|
54
|
+
if (typeof flag !== "string") return void 0;
|
|
55
|
+
return fileAuditSink(flag);
|
|
56
|
+
}
|
|
57
|
+
var NOOP_AUDIT_LOGGER = {
|
|
58
|
+
emit: () => {
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
function createAuthAuditLogger(sink, scrubber = new DefaultSecretScrubber()) {
|
|
62
|
+
if (!sink) return NOOP_AUDIT_LOGGER;
|
|
63
|
+
return {
|
|
64
|
+
emit(event) {
|
|
65
|
+
const scrubbed = scrubEvent(event, scrubber);
|
|
66
|
+
sink.write(JSON.stringify(scrubbed));
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function scrubEvent(event, scrubber) {
|
|
71
|
+
switch (event.type) {
|
|
72
|
+
case "auth.local.add":
|
|
73
|
+
return {
|
|
74
|
+
type: "auth.local.add",
|
|
75
|
+
providerId: scrubber.scrub(event.providerId),
|
|
76
|
+
baseUrl: scrubber.scrub(event.baseUrl),
|
|
77
|
+
models: event.models.map((m) => scrubber.scrub(m)),
|
|
78
|
+
...event.keyLabel !== void 0 ? { keyLabel: scrubber.scrub(event.keyLabel) } : {}
|
|
79
|
+
};
|
|
80
|
+
case "auth.local.clear":
|
|
81
|
+
return {
|
|
82
|
+
type: "auth.local.clear",
|
|
83
|
+
providerId: scrubber.scrub(event.providerId),
|
|
84
|
+
baseUrl: scrubber.scrub(event.baseUrl),
|
|
85
|
+
previousModels: event.previousModels.map((m) => scrubber.scrub(m))
|
|
86
|
+
};
|
|
87
|
+
case "auth.local.undo":
|
|
88
|
+
return {
|
|
89
|
+
type: "auth.local.undo",
|
|
90
|
+
providerId: scrubber.scrub(event.providerId),
|
|
91
|
+
baseUrl: scrubber.scrub(event.baseUrl),
|
|
92
|
+
restoredModels: event.restoredModels.map((m) => scrubber.scrub(m))
|
|
93
|
+
};
|
|
94
|
+
case "auth.local.probe_skip":
|
|
95
|
+
return {
|
|
96
|
+
type: "auth.local.probe_skip",
|
|
97
|
+
providerId: scrubber.scrub(event.providerId),
|
|
98
|
+
baseUrl: scrubber.scrub(event.baseUrl),
|
|
99
|
+
requestedShape: scrubber.scrub(event.requestedShape)
|
|
100
|
+
};
|
|
101
|
+
case "auth.local.probe_failed_save":
|
|
102
|
+
return {
|
|
103
|
+
type: "auth.local.probe_failed_save",
|
|
104
|
+
providerId: scrubber.scrub(event.providerId),
|
|
105
|
+
baseUrl: scrubber.scrub(event.baseUrl),
|
|
106
|
+
probeStatus: scrubber.scrub(event.probeStatus),
|
|
107
|
+
...event.probeDetail !== void 0 ? { probeDetail: scrubber.scrub(event.probeDetail) } : {}
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function decideAuthLocalEvents(opts) {
|
|
112
|
+
const events = [];
|
|
113
|
+
if (opts.probeSkip) {
|
|
114
|
+
events.push({
|
|
115
|
+
type: "auth.local.probe_skip",
|
|
116
|
+
providerId: opts.providerId,
|
|
117
|
+
baseUrl: opts.baseUrl,
|
|
118
|
+
requestedShape: opts.probeSkip.shape
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
if (opts.probeFailedSave) {
|
|
122
|
+
events.push({
|
|
123
|
+
type: "auth.local.probe_failed_save",
|
|
124
|
+
providerId: opts.providerId,
|
|
125
|
+
baseUrl: opts.baseUrl,
|
|
126
|
+
probeStatus: opts.probeFailedSave.status,
|
|
127
|
+
...opts.probeFailedSave.detail !== void 0 ? { probeDetail: opts.probeFailedSave.detail } : {}
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
if (opts.newModels === null) return events;
|
|
131
|
+
const hadPriorAllowlist = opts.previousModels !== void 0 && opts.previousModels.length > 0;
|
|
132
|
+
if (hadPriorAllowlist && opts.newModels.length === 0) {
|
|
133
|
+
events.push({
|
|
134
|
+
type: "auth.local.clear",
|
|
135
|
+
providerId: opts.providerId,
|
|
136
|
+
baseUrl: opts.baseUrl,
|
|
137
|
+
previousModels: opts.previousModels
|
|
138
|
+
});
|
|
139
|
+
return events;
|
|
140
|
+
}
|
|
141
|
+
if (!hadPriorAllowlist && opts.newModels.length > 0) {
|
|
142
|
+
if (opts.previousModels !== void 0) {
|
|
143
|
+
events.push({
|
|
144
|
+
type: "auth.local.undo",
|
|
145
|
+
providerId: opts.providerId,
|
|
146
|
+
baseUrl: opts.baseUrl,
|
|
147
|
+
restoredModels: [...opts.newModels]
|
|
148
|
+
});
|
|
149
|
+
} else {
|
|
150
|
+
events.push({
|
|
151
|
+
type: "auth.local.add",
|
|
152
|
+
providerId: opts.providerId,
|
|
153
|
+
baseUrl: opts.baseUrl,
|
|
154
|
+
models: [...opts.newModels],
|
|
155
|
+
...opts.keyLabel !== void 0 ? { keyLabel: opts.keyLabel } : {}
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
return events;
|
|
159
|
+
}
|
|
160
|
+
if (hadPriorAllowlist && opts.newModels.length > 0) {
|
|
161
|
+
events.push({
|
|
162
|
+
type: "auth.local.add",
|
|
163
|
+
providerId: opts.providerId,
|
|
164
|
+
baseUrl: opts.baseUrl,
|
|
165
|
+
models: [...opts.newModels],
|
|
166
|
+
...opts.keyLabel !== void 0 ? { keyLabel: opts.keyLabel } : {}
|
|
167
|
+
});
|
|
168
|
+
return events;
|
|
169
|
+
}
|
|
170
|
+
return events;
|
|
171
|
+
}
|
|
172
|
+
|
|
23
173
|
// src/auth-menu/provider-auth-login.ts
|
|
24
174
|
import { color } from "@wrongstack/core/utils";
|
|
25
175
|
import {
|
|
@@ -139,74 +289,6 @@ import { DefaultSecretScrubber as DefaultSecretScrubber2 } from "@wrongstack/cor
|
|
|
139
289
|
import { color as color3 } from "@wrongstack/core/utils";
|
|
140
290
|
import { probeLocalLlm } from "@wrongstack/runtime/probe";
|
|
141
291
|
|
|
142
|
-
// src/auth-menu/auth-menu-audit.ts
|
|
143
|
-
import { DefaultSecretScrubber } from "@wrongstack/core/security";
|
|
144
|
-
var NOOP_AUDIT_LOGGER = {
|
|
145
|
-
emit: () => {
|
|
146
|
-
}
|
|
147
|
-
};
|
|
148
|
-
function decideAuthLocalEvents(opts) {
|
|
149
|
-
const events = [];
|
|
150
|
-
if (opts.probeSkip) {
|
|
151
|
-
events.push({
|
|
152
|
-
type: "auth.local.probe_skip",
|
|
153
|
-
providerId: opts.providerId,
|
|
154
|
-
baseUrl: opts.baseUrl,
|
|
155
|
-
requestedShape: opts.probeSkip.shape
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
if (opts.probeFailedSave) {
|
|
159
|
-
events.push({
|
|
160
|
-
type: "auth.local.probe_failed_save",
|
|
161
|
-
providerId: opts.providerId,
|
|
162
|
-
baseUrl: opts.baseUrl,
|
|
163
|
-
probeStatus: opts.probeFailedSave.status,
|
|
164
|
-
...opts.probeFailedSave.detail !== void 0 ? { probeDetail: opts.probeFailedSave.detail } : {}
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
if (opts.newModels === null) return events;
|
|
168
|
-
const hadPriorAllowlist = opts.previousModels !== void 0 && opts.previousModels.length > 0;
|
|
169
|
-
if (hadPriorAllowlist && opts.newModels.length === 0) {
|
|
170
|
-
events.push({
|
|
171
|
-
type: "auth.local.clear",
|
|
172
|
-
providerId: opts.providerId,
|
|
173
|
-
baseUrl: opts.baseUrl,
|
|
174
|
-
previousModels: opts.previousModels
|
|
175
|
-
});
|
|
176
|
-
return events;
|
|
177
|
-
}
|
|
178
|
-
if (!hadPriorAllowlist && opts.newModels.length > 0) {
|
|
179
|
-
if (opts.previousModels !== void 0) {
|
|
180
|
-
events.push({
|
|
181
|
-
type: "auth.local.undo",
|
|
182
|
-
providerId: opts.providerId,
|
|
183
|
-
baseUrl: opts.baseUrl,
|
|
184
|
-
restoredModels: [...opts.newModels]
|
|
185
|
-
});
|
|
186
|
-
} else {
|
|
187
|
-
events.push({
|
|
188
|
-
type: "auth.local.add",
|
|
189
|
-
providerId: opts.providerId,
|
|
190
|
-
baseUrl: opts.baseUrl,
|
|
191
|
-
models: [...opts.newModels],
|
|
192
|
-
...opts.keyLabel !== void 0 ? { keyLabel: opts.keyLabel } : {}
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
return events;
|
|
196
|
-
}
|
|
197
|
-
if (hadPriorAllowlist && opts.newModels.length > 0) {
|
|
198
|
-
events.push({
|
|
199
|
-
type: "auth.local.add",
|
|
200
|
-
providerId: opts.providerId,
|
|
201
|
-
baseUrl: opts.baseUrl,
|
|
202
|
-
models: [...opts.newModels],
|
|
203
|
-
...opts.keyLabel !== void 0 ? { keyLabel: opts.keyLabel } : {}
|
|
204
|
-
});
|
|
205
|
-
return events;
|
|
206
|
-
}
|
|
207
|
-
return events;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
292
|
// src/auth-menu/helpers.ts
|
|
211
293
|
async function loadProviders(deps) {
|
|
212
294
|
return loadConfigProviders(deps.profileConfigPath, deps.vault, {
|
|
@@ -1785,6 +1867,8 @@ async function promptForLabel(deps, usedLabels) {
|
|
|
1785
1867
|
}
|
|
1786
1868
|
|
|
1787
1869
|
export {
|
|
1870
|
+
resolveAuditSink,
|
|
1871
|
+
createAuthAuditLogger,
|
|
1788
1872
|
loadProviders,
|
|
1789
1873
|
renderProviderHeader,
|
|
1790
1874
|
renderActions,
|
|
@@ -1813,4 +1897,4 @@ export {
|
|
|
1813
1897
|
addCustomProvider,
|
|
1814
1898
|
addKeyForProvider
|
|
1815
1899
|
};
|
|
1816
|
-
//# sourceMappingURL=chunk-
|
|
1900
|
+
//# sourceMappingURL=chunk-RDHFXOJM.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-6WRKAACA.js";
|
|
5
5
|
import {
|
|
6
6
|
parseArgs
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-C3Z4N6A6.js";
|
|
8
8
|
|
|
9
9
|
// src/boot/short-circuit-flags.ts
|
|
10
10
|
async function handleHelpVersionShortCircuit(argv) {
|
|
@@ -22,7 +22,7 @@ async function handleHelpVersionShortCircuit(argv) {
|
|
|
22
22
|
}
|
|
23
23
|
if (earlyFlags["help"] === true) {
|
|
24
24
|
if (positional.length > 0) {
|
|
25
|
-
const { subcommandNames } = await import("./subcommands-
|
|
25
|
+
const { subcommandNames } = await import("./subcommands-EJI7DBQS.js");
|
|
26
26
|
if (subcommandNames.includes(positional[0])) {
|
|
27
27
|
const first = positional[0];
|
|
28
28
|
const deep = positional[1];
|
|
@@ -43,4 +43,4 @@ async function handleHelpVersionShortCircuit(argv) {
|
|
|
43
43
|
export {
|
|
44
44
|
handleHelpVersionShortCircuit
|
|
45
45
|
};
|
|
46
|
-
//# sourceMappingURL=chunk-
|
|
46
|
+
//# sourceMappingURL=chunk-TNZBQG45.js.map
|