@wrongstack/cli 1.0.1 → 1.0.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/data/providers.json +21 -21
- package/dist/{acp-3LARESEO.js → acp-JK4ZQO3R.js} +4 -3
- package/dist/{auth-ZUMCDNE5.js → auth-XD3GN5RJ.js} +78 -54
- package/dist/auth-menu/index.d.ts +1 -0
- package/dist/auth-menu/oauth-menu.d.ts +3 -1
- package/dist/auth-menu/panel-service.d.ts +2 -0
- package/dist/auth-menu/provider-auth-login.d.ts +12 -0
- package/dist/auth-menu/types.d.ts +3 -0
- package/dist/auto-discover-providers-DXR25GTG.js +7 -0
- package/dist/boot/dispatch-webui.d.ts +1 -0
- package/dist/boot/system-prompt-builder.d.ts +7 -0
- package/dist/boot/system-prompt.d.ts +2 -1
- package/dist/chimera-reviewer-policy.d.ts +1 -1
- package/dist/{chunk-KHWDTNBZ.js → chunk-4NHD5OXJ.js} +2 -2
- package/dist/chunk-D5GB5MHA.js +87 -0
- package/dist/chunk-DAKVBMD4.js +36 -0
- package/dist/{chunk-ZSZ3EYWH.js → chunk-GMY45LO6.js} +9 -5
- package/dist/{chunk-D2VCUN7M.js → chunk-IUEKNHPT.js} +10 -10
- package/dist/{chunk-MNQQ4ZNF.js → chunk-ONOT5OJ2.js} +290 -687
- package/dist/chunk-SIGUWXAA.js +43 -0
- package/dist/{chunk-TEBMCYZN.js → chunk-SIS37L3W.js} +58 -2
- package/dist/{chunk-5IA5337I.js → chunk-U6KCWRMC.js} +4 -2
- package/dist/{cli-context-7X3M6U73.js → cli-context-Q6QP534K.js} +18 -7
- package/dist/{cli-main-53KG6HAV.js → cli-main-JQXCDZEA.js} +2909 -2277
- package/dist/execute-deps.d.ts +1 -0
- package/dist/{execution-MIBWBYB6.js → execution-KH7WJNAX.js} +11 -4
- package/dist/index.js +3 -3
- package/dist/live-settings-input.d.ts +2 -0
- package/dist/{mailbox-serve-VUCWZ2SJ.js → mailbox-serve-X3CR6VFW.js} +4 -3
- package/dist/{modeldiag-FMJT37SN.js → modeldiag-46CMWUNM.js} +31 -24
- package/dist/{plugin-usage-HFBI3TFT.js → plugin-usage-M6KET4OZ.js} +2 -2
- package/dist/{plugins-PZ2VZL7V.js → plugins-U7KGQAUG.js} +3 -3
- package/dist/{providers-models-YVMVYWRS.js → providers-models-6MOGAOVK.js} +2 -2
- package/dist/{short-circuit-flags-UREFSYBL.js → short-circuit-flags-ZNZX44MC.js} +2 -2
- package/dist/slash-commands/codebase-map.d.ts +11 -0
- package/dist/slash-commands/command-context.d.ts +7 -0
- package/dist/slash-commands/context.d.ts +10 -0
- package/dist/slash-commands/openai-quota.d.ts +31 -0
- package/dist/{subcommands-WJLBHVKC.js → subcommands-CUTGBDKP.js} +2 -2
- package/dist/{webui-server-5R35BHWZ.js → webui-server-QWBUT7BO.js} +19 -2
- package/dist/webui-server-options.d.ts +1 -0
- package/dist/wiring/atlas-prompt-contributor.d.ts +54 -0
- package/dist/wiring/cli-execute-builder.d.ts +1 -0
- package/dist/wiring/codebase-embeddings.d.ts +31 -0
- package/dist/wiring/command-host-state.d.ts +2 -0
- package/dist/wiring/concept-summarizer.d.ts +32 -0
- package/dist/wiring/external-plugins.d.ts +1 -0
- package/dist/wiring/lifecycle-plugins.d.ts +2 -1
- package/dist/wiring/plugins.d.ts +2 -1
- package/dist/wiring/provider.d.ts +2 -1
- package/package.json +29 -29
- package/dist/auto-discover-providers-VQU3IZMR.js +0 -7
- package/dist/chunk-52C7PD2H.js +0 -61
- package/dist/chunk-TNK6237M.js +0 -262
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
|
|
2
|
+
// src/auth-menu/openai-codex-oauth.ts
|
|
3
|
+
import { color } from "@wrongstack/core/utils";
|
|
4
|
+
import {
|
|
5
|
+
buildCodexAuthorizeUrl,
|
|
6
|
+
CODEX_BASE_URL,
|
|
7
|
+
CODEX_FALLBACK_REDIRECT_PORT,
|
|
8
|
+
CODEX_PROVIDER_ID,
|
|
9
|
+
CODEX_REDIRECT_HOST,
|
|
10
|
+
CODEX_REDIRECT_PATH,
|
|
11
|
+
CODEX_REDIRECT_PORT,
|
|
12
|
+
CODEX_SCOPE,
|
|
13
|
+
codexRedirectUri,
|
|
14
|
+
createState,
|
|
15
|
+
exchangeCodexAuthorizationCode,
|
|
16
|
+
extractAccountId,
|
|
17
|
+
generatePkce,
|
|
18
|
+
parseAuthorizationInput,
|
|
19
|
+
refreshCodexTokens,
|
|
20
|
+
resolveCodexModels
|
|
21
|
+
} from "@wrongstack/providers/oauth";
|
|
22
|
+
import {
|
|
23
|
+
CODEX_BASE_URL as CODEX_BASE_URL2,
|
|
24
|
+
CODEX_CATALOG_FAMILIES,
|
|
25
|
+
CODEX_PROVIDER_ID as CODEX_PROVIDER_ID2,
|
|
26
|
+
extractAccountId as extractAccountId2,
|
|
27
|
+
FALLBACK_CODEX_MODELS,
|
|
28
|
+
fallbackCodexModelIds,
|
|
29
|
+
fallbackCodexProviderModels,
|
|
30
|
+
fetchCodexModels,
|
|
31
|
+
filterCurrentCodexModelIds,
|
|
32
|
+
generatePkce as generatePkce2,
|
|
33
|
+
isCodexCatalogModel,
|
|
34
|
+
parseAuthorizationInput as parseAuthorizationInput2,
|
|
35
|
+
resolveCodexModels as resolveCodexModels2
|
|
36
|
+
} from "@wrongstack/providers/oauth";
|
|
37
|
+
|
|
38
|
+
export {
|
|
39
|
+
fallbackCodexProviderModels,
|
|
40
|
+
filterCurrentCodexModelIds,
|
|
41
|
+
isCodexCatalogModel
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=chunk-SIGUWXAA.js.map
|
|
@@ -13,6 +13,10 @@ import {
|
|
|
13
13
|
resolvePluginTarget,
|
|
14
14
|
verifyPluginTrust
|
|
15
15
|
} from "@wrongstack/core/plugin";
|
|
16
|
+
import { createHash } from "node:crypto";
|
|
17
|
+
import { readdir, stat } from "node:fs/promises";
|
|
18
|
+
import { basename, dirname, relative, sep } from "node:path";
|
|
19
|
+
import { readFile } from "node:fs/promises";
|
|
16
20
|
function resolveExternalPluginTrustMode(raw) {
|
|
17
21
|
if (raw === false) return "off";
|
|
18
22
|
if (raw === "required") return "required";
|
|
@@ -228,7 +232,7 @@ async function gateExternalPluginTrust(args) {
|
|
|
228
232
|
if (!store) return { ok: true, pinned: false };
|
|
229
233
|
let integrity;
|
|
230
234
|
try {
|
|
231
|
-
integrity = await
|
|
235
|
+
integrity = await hashPluginClosure(entryPath);
|
|
232
236
|
} catch (err) {
|
|
233
237
|
const message = err instanceof Error ? err.message : String(err);
|
|
234
238
|
if (mode === "required") {
|
|
@@ -271,6 +275,58 @@ async function gateExternalPluginTrust(args) {
|
|
|
271
275
|
log.error(`[plugins] REFUSING external plugin "${label}" \u2014 ${changedMessage}`);
|
|
272
276
|
return { ok: false, pinned: false };
|
|
273
277
|
}
|
|
278
|
+
var CLOSURE_HASH_LIMIT = 2e3;
|
|
279
|
+
var CLOSURE_FILE_LIMIT = 16 * 1024 * 1024;
|
|
280
|
+
async function hashPluginClosure(entryPath) {
|
|
281
|
+
const dir = dirname(entryPath);
|
|
282
|
+
let dirStat;
|
|
283
|
+
try {
|
|
284
|
+
dirStat = await stat(dir);
|
|
285
|
+
} catch {
|
|
286
|
+
return hashFileContents(entryPath);
|
|
287
|
+
}
|
|
288
|
+
if (!dirStat.isDirectory()) return hashFileContents(entryPath);
|
|
289
|
+
const entryBase = basename(entryPath);
|
|
290
|
+
const files = [];
|
|
291
|
+
async function walk(d) {
|
|
292
|
+
if (files.length > CLOSURE_HASH_LIMIT) return;
|
|
293
|
+
const entries = await readdir(d, { withFileTypes: true }).catch(() => []);
|
|
294
|
+
for (const e of entries) {
|
|
295
|
+
const full = d + sep + e.name;
|
|
296
|
+
if (e.isDirectory()) {
|
|
297
|
+
if (e.name === "node_modules" || e.name.startsWith(".")) continue;
|
|
298
|
+
await walk(full);
|
|
299
|
+
} else if (e.isFile()) {
|
|
300
|
+
files.push(full);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
await walk(dir);
|
|
305
|
+
files.sort();
|
|
306
|
+
const manifest = [];
|
|
307
|
+
for (const full of files) {
|
|
308
|
+
const rel = relative(dir, full).split(sep).join("/");
|
|
309
|
+
let bytes;
|
|
310
|
+
try {
|
|
311
|
+
const st = await stat(full);
|
|
312
|
+
if (!st.isFile() || st.size > CLOSURE_FILE_LIMIT) continue;
|
|
313
|
+
bytes = await readFile(full);
|
|
314
|
+
} catch {
|
|
315
|
+
continue;
|
|
316
|
+
}
|
|
317
|
+
const sha = createHash("sha256").update(bytes).digest("hex");
|
|
318
|
+
manifest.push(`${rel}\0${bytes.length}\0${sha}`);
|
|
319
|
+
}
|
|
320
|
+
if (!manifest.some((line) => line.startsWith(`${entryBase}\0`))) {
|
|
321
|
+
const entryBytes = await readFile(entryPath);
|
|
322
|
+
const entrySha = createHash("sha256").update(entryBytes).digest("hex");
|
|
323
|
+
manifest.push(`${entryBase}\0${entryBytes.length}\0${entrySha}`);
|
|
324
|
+
}
|
|
325
|
+
manifest.sort();
|
|
326
|
+
const outer = createHash("sha256");
|
|
327
|
+
outer.update(manifest.join("\n"));
|
|
328
|
+
return outer.digest("hex");
|
|
329
|
+
}
|
|
274
330
|
|
|
275
331
|
// src/plugin-management.ts
|
|
276
332
|
import { execFile } from "node:child_process";
|
|
@@ -1035,4 +1091,4 @@ export {
|
|
|
1035
1091
|
PLUGIN_AUDIT_ENTRIES,
|
|
1036
1092
|
runPluginManagementCommand
|
|
1037
1093
|
};
|
|
1038
|
-
//# sourceMappingURL=chunk-
|
|
1094
|
+
//# sourceMappingURL=chunk-SIS37L3W.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
PLUGIN_AUDIT_ENTRIES,
|
|
6
6
|
loadExternalPlugins
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-SIS37L3W.js";
|
|
8
8
|
|
|
9
9
|
// src/wiring/plugins.ts
|
|
10
10
|
import { join } from "node:path";
|
|
@@ -98,6 +98,7 @@ async function setupPlugins(params) {
|
|
|
98
98
|
events,
|
|
99
99
|
toolRegistry,
|
|
100
100
|
providerRegistry,
|
|
101
|
+
providerAuthRegistry,
|
|
101
102
|
slashCommandRegistry,
|
|
102
103
|
mcpRegistry,
|
|
103
104
|
log,
|
|
@@ -207,6 +208,7 @@ async function setupPlugins(params) {
|
|
|
207
208
|
pipelines,
|
|
208
209
|
toolRegistry,
|
|
209
210
|
providerRegistry,
|
|
211
|
+
providerAuthRegistry,
|
|
210
212
|
slashCommandRegistry,
|
|
211
213
|
mcpRegistry,
|
|
212
214
|
config: pluginConfig,
|
|
@@ -261,4 +263,4 @@ export {
|
|
|
261
263
|
BUILTIN_PLUGIN_FACTORIES,
|
|
262
264
|
setupPlugins
|
|
263
265
|
};
|
|
264
|
-
//# sourceMappingURL=chunk-
|
|
266
|
+
//# sourceMappingURL=chunk-U6KCWRMC.js.map
|
|
@@ -19,14 +19,14 @@ import {
|
|
|
19
19
|
} from "./chunk-EWKESL4L.js";
|
|
20
20
|
import {
|
|
21
21
|
subcommands
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-IUEKNHPT.js";
|
|
23
23
|
import {
|
|
24
24
|
renderDeepHelp,
|
|
25
25
|
renderFocusedHelp
|
|
26
26
|
} from "./chunk-MXEJEYT7.js";
|
|
27
27
|
import {
|
|
28
28
|
handleHelpVersionShortCircuit
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-4NHD5OXJ.js";
|
|
30
30
|
import {
|
|
31
31
|
DEFAULT_PORT
|
|
32
32
|
} from "./chunk-C2E24IXZ.js";
|
|
@@ -34,7 +34,7 @@ import "./chunk-HXJYHAR4.js";
|
|
|
34
34
|
import "./chunk-Q5GTM25S.js";
|
|
35
35
|
import {
|
|
36
36
|
discoverAndMergeProviders
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-D5GB5MHA.js";
|
|
38
38
|
import {
|
|
39
39
|
applyNodeEnvDefault,
|
|
40
40
|
applySessionShellDefault,
|
|
@@ -55,7 +55,7 @@ import {
|
|
|
55
55
|
runPicker,
|
|
56
56
|
saveToGlobalConfig,
|
|
57
57
|
theme
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-ONOT5OJ2.js";
|
|
59
59
|
import "./chunk-2VMJ3E5Z.js";
|
|
60
60
|
import "./chunk-B4JLSXZB.js";
|
|
61
61
|
import {
|
|
@@ -68,7 +68,7 @@ import {
|
|
|
68
68
|
import {
|
|
69
69
|
parseArgs
|
|
70
70
|
} from "./chunk-E6RFXHWD.js";
|
|
71
|
-
import "./chunk-
|
|
71
|
+
import "./chunk-DAKVBMD4.js";
|
|
72
72
|
import {
|
|
73
73
|
mutateConfigProviders,
|
|
74
74
|
normalizeKeys,
|
|
@@ -84,7 +84,7 @@ import "./chunk-YLQEGYV4.js";
|
|
|
84
84
|
// src/cli-context.ts
|
|
85
85
|
import { TOKENS as TOKENS3 } from "@wrongstack/core/kernel";
|
|
86
86
|
import { writeErr as writeErr2 } from "@wrongstack/core/utils";
|
|
87
|
-
import { setOAuthTokenPersister } from "@wrongstack/providers";
|
|
87
|
+
import { setOAuthTokenPersister, setProviderModelPersister } from "@wrongstack/providers";
|
|
88
88
|
|
|
89
89
|
// src/boot/container-wiring.ts
|
|
90
90
|
import { DefaultPathResolver } from "@wrongstack/core/infrastructure";
|
|
@@ -3095,6 +3095,17 @@ async function initializeCli(argv) {
|
|
|
3095
3095
|
}).catch(() => {
|
|
3096
3096
|
});
|
|
3097
3097
|
});
|
|
3098
|
+
setProviderModelPersister((providerId, models) => {
|
|
3099
|
+
if (models.length === 0) return;
|
|
3100
|
+
void mutateConfigProviders(profileConfigPath, vault, (all) => {
|
|
3101
|
+
const p = all[providerId];
|
|
3102
|
+
if (!p) return;
|
|
3103
|
+
const live = models.map((m) => m.id);
|
|
3104
|
+
if (p.models?.length === live.length && p.models.every((id, i) => id === live[i])) return;
|
|
3105
|
+
p.models = live;
|
|
3106
|
+
}).catch(() => {
|
|
3107
|
+
});
|
|
3108
|
+
});
|
|
3098
3109
|
const { events, container } = wireContainer({
|
|
3099
3110
|
config,
|
|
3100
3111
|
wpaths,
|
|
@@ -3117,4 +3128,4 @@ async function initializeCli(argv) {
|
|
|
3117
3128
|
export {
|
|
3118
3129
|
initializeCli
|
|
3119
3130
|
};
|
|
3120
|
-
//# sourceMappingURL=cli-context-
|
|
3131
|
+
//# sourceMappingURL=cli-context-Q6QP534K.js.map
|