@wrongstack/cli 1.0.0 → 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.
Files changed (60) hide show
  1. package/data/providers.json +21 -21
  2. package/dist/{acp-3LARESEO.js → acp-JK4ZQO3R.js} +4 -3
  3. package/dist/{auth-KIBJZZIE.js → auth-XD3GN5RJ.js} +80 -56
  4. package/dist/auth-menu/index.d.ts +1 -0
  5. package/dist/auth-menu/oauth-menu.d.ts +3 -1
  6. package/dist/auth-menu/panel-service.d.ts +2 -0
  7. package/dist/auth-menu/provider-auth-login.d.ts +12 -0
  8. package/dist/auth-menu/types.d.ts +3 -0
  9. package/dist/auto-discover-providers-DXR25GTG.js +7 -0
  10. package/dist/boot/dispatch-webui.d.ts +1 -0
  11. package/dist/boot/system-prompt-builder.d.ts +7 -0
  12. package/dist/boot/system-prompt-menu.d.ts +7 -0
  13. package/dist/boot/system-prompt.d.ts +2 -1
  14. package/dist/chimera-reviewer-policy.d.ts +1 -1
  15. package/dist/{chunk-4HV5RKZH.js → chunk-4NHD5OXJ.js} +3 -3
  16. package/dist/chunk-D5GB5MHA.js +87 -0
  17. package/dist/chunk-DAKVBMD4.js +36 -0
  18. package/dist/{chunk-Z7A5MXKJ.js → chunk-E6RFXHWD.js} +1 -2
  19. package/dist/{chunk-ZSZ3EYWH.js → chunk-GMY45LO6.js} +9 -5
  20. package/dist/{chunk-ETYHZPXP.js → chunk-IUEKNHPT.js} +12 -10
  21. package/dist/{chunk-MNQQ4ZNF.js → chunk-ONOT5OJ2.js} +290 -687
  22. package/dist/chunk-SIGUWXAA.js +43 -0
  23. package/dist/{chunk-TEBMCYZN.js → chunk-SIS37L3W.js} +58 -2
  24. package/dist/{chunk-5IA5337I.js → chunk-U6KCWRMC.js} +4 -2
  25. package/dist/chunk-UQUYBDMG.js +51 -0
  26. package/dist/{cli-context-CYMKNOK3.js → cli-context-Q6QP534K.js} +20 -9
  27. package/dist/{cli-main-TTIVR4DI.js → cli-main-JQXCDZEA.js} +2979 -2279
  28. package/dist/config-transfer-2YF3CRTN.js +99 -0
  29. package/dist/execute-deps.d.ts +1 -0
  30. package/dist/{execution-3Y55IWBK.js → execution-KH7WJNAX.js} +26 -19
  31. package/dist/index.js +4 -4
  32. package/dist/live-settings-input.d.ts +2 -0
  33. package/dist/{mailbox-serve-VUCWZ2SJ.js → mailbox-serve-X3CR6VFW.js} +4 -3
  34. package/dist/{modeldiag-FMJT37SN.js → modeldiag-46CMWUNM.js} +31 -24
  35. package/dist/{plugin-usage-HFBI3TFT.js → plugin-usage-M6KET4OZ.js} +2 -2
  36. package/dist/{plugins-PZ2VZL7V.js → plugins-U7KGQAUG.js} +3 -3
  37. package/dist/{providers-models-YVMVYWRS.js → providers-models-6MOGAOVK.js} +2 -2
  38. package/dist/settings-behavior-sections.d.ts +20 -0
  39. package/dist/{short-circuit-flags-6PSP56L7.js → short-circuit-flags-ZNZX44MC.js} +3 -3
  40. package/dist/slash-commands/codebase-map.d.ts +11 -0
  41. package/dist/slash-commands/command-context.d.ts +7 -0
  42. package/dist/slash-commands/context.d.ts +10 -0
  43. package/dist/slash-commands/openai-quota.d.ts +31 -0
  44. package/dist/subcommands/handlers/config-transfer.d.ts +6 -0
  45. package/dist/{subcommands-HZQKA4G2.js → subcommands-CUTGBDKP.js} +2 -2
  46. package/dist/{webui-server-T6AMOXJJ.js → webui-server-QWBUT7BO.js} +22 -5
  47. package/dist/webui-server-options.d.ts +1 -0
  48. package/dist/wiring/atlas-prompt-contributor.d.ts +54 -0
  49. package/dist/wiring/cli-execute-builder.d.ts +1 -0
  50. package/dist/wiring/codebase-embeddings.d.ts +31 -0
  51. package/dist/wiring/command-host-state.d.ts +2 -0
  52. package/dist/wiring/concept-summarizer.d.ts +32 -0
  53. package/dist/wiring/external-plugins.d.ts +1 -0
  54. package/dist/wiring/lifecycle-plugins.d.ts +2 -1
  55. package/dist/wiring/plugins.d.ts +2 -1
  56. package/dist/wiring/provider.d.ts +2 -1
  57. package/package.json +29 -29
  58. package/dist/auto-discover-providers-VQU3IZMR.js +0 -7
  59. package/dist/chunk-52C7PD2H.js +0 -61
  60. package/dist/chunk-TNK6237M.js +0 -262
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  createHqCommandDispatcher
3
3
  } from "./chunk-IMWXXF4J.js";
4
- import {
5
- WEBUI_SESSION_CHILD_CAPABILITIES
6
- } from "./chunk-GPPRNAKW.js";
7
4
  import {
8
5
  createKanbanRunMirror
9
6
  } from "./chunk-VCYZ3WZV.js";
7
+ import {
8
+ WEBUI_SESSION_CHILD_CAPABILITIES
9
+ } from "./chunk-GPPRNAKW.js";
10
10
  import {
11
11
  startCliHqConnection
12
12
  } from "./chunk-TE3Q32JP.js";
@@ -46,6 +46,7 @@ import {
46
46
  toSessionHistoryEntries
47
47
  } from "@wrongstack/webui-server";
48
48
  import { WebSocketServer } from "ws";
49
+ import { verifyClient as verifyWsClient2 } from "@wrongstack/webui-server/server/ws-auth";
49
50
 
50
51
  // src/webui-server/client-registration.ts
51
52
  import { mailboxSessionTag } from "@wrongstack/core/coordination";
@@ -1495,7 +1496,22 @@ async function runWebUI(opts) {
1495
1496
  ...opts.getVectorMemoryStore ? { getVectorMemoryStore: opts.getVectorMemoryStore } : {},
1496
1497
  ...opts.vectorMemoryModelCacheDir ? { vectorMemoryModelCacheDir: opts.vectorMemoryModelCacheDir } : {}
1497
1498
  });
1498
- const wss = httpServer ? new WebSocketServer({ server: httpServer.server, maxPayload: 20 * 1024 * 1024 }) : new WebSocketServer({ port: httpPort, host, maxPayload: 20 * 1024 * 1024 });
1499
+ const verifyClient = (info) => verifyWsClient2({
1500
+ origin: info.origin,
1501
+ url: info.req.url ?? "",
1502
+ hostHeader: info.req.headers.host,
1503
+ remoteAddress: info.req.socket.remoteAddress,
1504
+ cookieHeader: info.req.headers.cookie,
1505
+ wsHost: host,
1506
+ expectedToken: wsToken,
1507
+ requireToken,
1508
+ allowedHostnames: [publicUrl, publicWsUrl].filter(
1509
+ (value) => Boolean(value)
1510
+ ),
1511
+ allowBrowserUrlToken: Boolean(publicWsUrl),
1512
+ allowCrossPortLoopbackCookie: process.env["WRONGSTACK_WEBUI_DEV_CROSS_PORT_WS"] === "1"
1513
+ });
1514
+ const wss = httpServer ? new WebSocketServer({ server: httpServer.server, verifyClient, maxPayload: 20 * 1024 * 1024 }) : new WebSocketServer({ port: httpPort, host, verifyClient, maxPayload: 20 * 1024 * 1024 });
1499
1515
  wss.on("error", (err) => {
1500
1516
  console.error(
1501
1517
  JSON.stringify({
@@ -1625,6 +1641,7 @@ async function runWebUI(opts) {
1625
1641
  () => opts.appConfig?.providers ?? {}
1626
1642
  ),
1627
1643
  modelsRegistry: opts.modelsRegistry,
1644
+ providerAuthRegistry: opts.providerAuthRegistry,
1628
1645
  send,
1629
1646
  broadcast,
1630
1647
  log: (m) => console.log(m)
@@ -1951,4 +1968,4 @@ async function runWebUI(opts) {
1951
1968
  export {
1952
1969
  runWebUI
1953
1970
  };
1954
- //# sourceMappingURL=webui-server-T6AMOXJJ.js.map
1971
+ //# sourceMappingURL=webui-server-QWBUT7BO.js.map
@@ -117,6 +117,7 @@ export interface CliWebUIOptions {
117
117
  webuiInstanceRegistered: boolean;
118
118
  }) => void;
119
119
  modelsRegistry?: ModelsRegistry | undefined;
120
+ providerAuthRegistry?: import('@wrongstack/core/registry').ProviderAuthRegistry | undefined;
120
121
  globalConfigPath?: string | undefined;
121
122
  /** Resolved profile config path: ~/.wrongstack/profiles/<activeProfile>/config.json */
122
123
  profileConfigPath: string;
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Atlas boot-prompt contributor — the repository's shape, put in front of the
3
+ * agent instead of left to be rediscovered.
4
+ *
5
+ * Without this, every session begins the same way: a handful of searches to
6
+ * work out which packages exist, which files everything depends on, and where
7
+ * the entry points are. The index has known all of that since it was built.
8
+ * A few hundred tokens spends once what a dozen tool calls spend every time.
9
+ *
10
+ * Contract, matching `wrongtrace-prompt-contributor.ts`:
11
+ * - **Fail-open.** No index, no ranks, a throw, a timeout → `[]`. Orientation
12
+ * is a convenience; it must never be the reason a session cannot start.
13
+ * - **Bounded.** The brief is read behind a deadline, because the store lives
14
+ * on disk and a cold or busy index must not stall the first prompt.
15
+ * - **Cached per process.** The brief only changes when the index does, and
16
+ * rebuilding it on every prompt build would read SQLite on every turn.
17
+ * - **Cache-safe.** Contributor blocks are tagged `'contributor'`, which
18
+ * `EPOCH_VOLATILE_SOURCES` moves out of the wire `system` block and into
19
+ * the live-context tail — so this does not invalidate the prompt cache
20
+ * prefix the way a system-prompt edit would.
21
+ *
22
+ * It is deliberately *not* routed through SAGE. That pipeline is for episodic
23
+ * memory and gates on relevance thresholds a repository map would fail; the
24
+ * map is not a memory, it is a fact about the checkout.
25
+ */
26
+ import type { SystemPromptContributor, TokenSavingTier } from '@wrongstack/core/types';
27
+ import { type AtlasBrief } from '@wrongstack/tools';
28
+ /** Default hard ceiling on the rendered block. */
29
+ export declare const DEFAULT_BRIEF_MAX_TOKENS = 800;
30
+ /**
31
+ * Render the brief, trimming from the bottom until it fits.
32
+ *
33
+ * The order of the sections is the order of their value to somebody who knows
34
+ * nothing about the repository: what it is made of, what everything depends
35
+ * on, and — last, because it is the least load-bearing — what each subsystem
36
+ * does in prose. Trimming from the bottom therefore degrades gracefully
37
+ * instead of losing the hubs.
38
+ */
39
+ export declare function renderAtlasBrief(brief: AtlasBrief, maxTokens: number): string;
40
+ export interface AtlasPromptContributorOptions {
41
+ projectRoot: string;
42
+ indexDir?: string | undefined;
43
+ /** `indexing.atlas.injectOnSessionStart`. Default true. */
44
+ enabled?: boolean | undefined;
45
+ /** `indexing.atlas.briefMaxTokens`. Default {@link DEFAULT_BRIEF_MAX_TOKENS}. */
46
+ maxTokens?: number | undefined;
47
+ tokenSavingMode?: TokenSavingTier | boolean | undefined;
48
+ }
49
+ /**
50
+ * Build the contributor. One instance per prompt-builder binding; the brief
51
+ * cache lives on the closure, so it is per process, like the builder.
52
+ */
53
+ export declare function createAtlasPromptContributor(options: AtlasPromptContributorOptions): SystemPromptContributor;
54
+ //# sourceMappingURL=atlas-prompt-contributor.d.ts.map
@@ -73,6 +73,7 @@ export declare function runCliExecution(params: {
73
73
  agentMonitor?: X['fleet']['agentTranscripts'];
74
74
  vault: AUP['vault'];
75
75
  profileConfigPath: string;
76
+ providerAuthRegistry: NonNullable<AUP['providerAuthRegistry']>;
76
77
  onPanelOpen: X['fleet']['onPanelOpen'];
77
78
  interruptController: RC['interruptController'];
78
79
  enhanceController: RC['enhanceController'];
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Host-side wiring for the codebase index's semantic embeddings.
3
+ *
4
+ * The model is `packages/vector-memory`'s transformers-backed provider, which
5
+ * already emits 384-dimensional vectors — the width `file_vectors` stores. It
6
+ * arrives here rather than inside `packages/tools` for two reasons:
7
+ *
8
+ * - `@huggingface/transformers` is an **optional** dependency. A repository
9
+ * that never enables semantic search should not have to install a model
10
+ * runtime, and `packages/tools` must stay importable without one.
11
+ * - A function cannot cross the project daemon's IPC boundary. The daemon
12
+ * compares vectors; the host produces them. That also keeps a ~90 MB model
13
+ * out of every per-project daemon process.
14
+ *
15
+ * Everything here is best-effort. When the optional dependency is absent, the
16
+ * model cannot load, or the config leaves embeddings off, the port is simply
17
+ * `undefined` and retrieval stays lexical — which is the behaviour that
18
+ * shipped before embeddings existed.
19
+ */
20
+ import type { IndexingEmbeddingsConfig } from '@wrongstack/core/types';
21
+ import type { EmbeddingPort } from '@wrongstack/tools';
22
+ /**
23
+ * Build the embedding port, or `undefined` when semantic search is off or
24
+ * unavailable.
25
+ *
26
+ * The dynamic import is what keeps `@huggingface/transformers` optional: a
27
+ * missing package throws here and is reported as "unavailable", never as a
28
+ * startup failure.
29
+ */
30
+ export declare function createCodebaseEmbeddingPort(settings: IndexingEmbeddingsConfig | undefined): Promise<EmbeddingPort | undefined>;
31
+ //# sourceMappingURL=codebase-embeddings.d.ts.map
@@ -77,6 +77,7 @@ export declare function setupCommandHostState(input: CommandHostStateInput): Pro
77
77
  project?: import("@wrongstack/core/statusline").StatuslineLine;
78
78
  prompt_variant?: import("@wrongstack/core/statusline").StatuslineLine;
79
79
  queue?: import("@wrongstack/core/statusline").StatuslineLine;
80
+ quota?: import("@wrongstack/core/statusline").StatuslineLine;
80
81
  sessions?: import("@wrongstack/core/statusline").StatuslineLine;
81
82
  side_effects?: import("@wrongstack/core/statusline").StatuslineLine;
82
83
  state?: import("@wrongstack/core/statusline").StatuslineLine;
@@ -122,6 +123,7 @@ export declare function setupCommandHostState(input: CommandHostStateInput): Pro
122
123
  project?: import("@wrongstack/core/statusline").StatuslineDensity;
123
124
  prompt_variant?: import("@wrongstack/core/statusline").StatuslineDensity;
124
125
  queue?: import("@wrongstack/core/statusline").StatuslineDensity;
126
+ quota?: import("@wrongstack/core/statusline").StatuslineDensity;
125
127
  sessions?: import("@wrongstack/core/statusline").StatuslineDensity;
126
128
  side_effects?: import("@wrongstack/core/statusline").StatuslineDensity;
127
129
  state?: import("@wrongstack/core/statusline").StatuslineDensity;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Host-side implementation of the codebase index's {@link SummarizerPort}.
3
+ *
4
+ * `packages/tools` defines what a summariser must answer; producing that answer
5
+ * needs a configured provider and the model-tier policy, both of which live
6
+ * here. The port is therefore injected rather than imported, the same way SAGE
7
+ * takes `getLlmCall` — a host that supplies nothing simply gets no concept
8
+ * layer, and the index carries on working without one.
9
+ *
10
+ * ## Cost shape
11
+ *
12
+ * One call per file, and only for files whose bytes changed since the last
13
+ * pass. Enrichment is the one part of the index that spends money, so the model
14
+ * is resolved through the tier layer at its cheapest configured level unless
15
+ * the caller pins one, and both the token ceiling and the timeout are small.
16
+ */
17
+ import { OneShotOrchestrator } from '@wrongstack/core/execution';
18
+ import type { Config } from '@wrongstack/core/types';
19
+ import type { SummarizerPort } from '@wrongstack/tools';
20
+ type OrchestratorOptions = ConstructorParameters<typeof OneShotOrchestrator>[0];
21
+ export interface ConceptSummarizerDeps {
22
+ buildProvider: OrchestratorOptions['buildProvider'];
23
+ getConfig: () => Config;
24
+ fallbackProfileManager: OrchestratorOptions['fallbackProfileManager'];
25
+ statusTracker?: OrchestratorOptions['statusTracker'];
26
+ wrapProviderCall?: OrchestratorOptions['wrapProviderCall'];
27
+ /** Explicit model override; otherwise the configured budget tier decides. */
28
+ model?: string | undefined;
29
+ }
30
+ export declare function createConceptSummarizer(deps: ConceptSummarizerDeps): SummarizerPort;
31
+ export {};
32
+ //# sourceMappingURL=concept-summarizer.d.ts.map
@@ -64,5 +64,6 @@ interface LoadExternalPluginsContext {
64
64
  importModule?: ((url: string) => Promise<unknown>) | undefined;
65
65
  }
66
66
  export declare function loadExternalPlugins(ctx: LoadExternalPluginsContext, hooks: ExternalPluginHooks): Promise<Plugin[]>;
67
+ export declare function hashPluginClosure(entryPath: string): Promise<string>;
67
68
  export {};
68
69
  //# sourceMappingURL=external-plugins.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import { type RemoteMailbox } from '@wrongstack/core/coordination';
2
2
  import { HookRegistry, HookRunner } from '@wrongstack/core/hooks';
3
3
  import type { PluginHostHandle } from '@wrongstack/core/plugin';
4
- import { type ProviderRegistry, SlashCommandRegistry, type ToolRegistry } from '@wrongstack/core/registry';
4
+ import { type ProviderAuthRegistry, type ProviderRegistry, SlashCommandRegistry, type ToolRegistry } from '@wrongstack/core/registry';
5
5
  import type { Config, HealthRegistry, Logger, MetricsRuntimeStatus, ModelsRegistry, PromptLoader, Provider, ProviderConfig, SecretVault, SessionWriter, SkillLoader } from '@wrongstack/core/types';
6
6
  import type { WstackPaths } from '@wrongstack/core/utils';
7
7
  import { MCPRegistry } from '@wrongstack/mcp';
@@ -27,6 +27,7 @@ interface LifecyclePluginsDeps {
27
27
  wpaths: WstackPaths;
28
28
  toolRegistry: ToolRegistry;
29
29
  providerRegistry: ProviderRegistry;
30
+ providerAuthRegistry: ProviderAuthRegistry;
30
31
  configStore: any;
31
32
  eventWiring: EventWiring;
32
33
  healthRegistry: HealthRegistry | undefined;
@@ -2,7 +2,7 @@ import type { AgentPipelines } from '@wrongstack/core/agent';
2
2
  import type { ExtensionRegistry } from '@wrongstack/core/extension';
3
3
  import type { Container, EventBus } from '@wrongstack/core/kernel';
4
4
  import type { PluginAPIInit, PluginHostHandle } from '@wrongstack/core/plugin';
5
- import type { ProviderRegistry, SlashCommandRegistry, ToolRegistry } from '@wrongstack/core/registry';
5
+ import type { ProviderAuthRegistry, ProviderRegistry, SlashCommandRegistry, ToolRegistry } from '@wrongstack/core/registry';
6
6
  import type { Config, ConfigStore, HealthRegistry, Logger, MetricsRuntimeStatus, MetricsSinkView, ModelsRegistry, Plugin, PromptLoader, SessionWriter, SkillLoader } from '@wrongstack/core/types';
7
7
  import type { MCPRegistry } from '@wrongstack/mcp';
8
8
  export declare const DEPRECATED_PLUGIN_NAMES: Record<string, string>;
@@ -34,6 +34,7 @@ export interface PluginsWiringDeps {
34
34
  pipelines: AgentPipelines;
35
35
  toolRegistry: ToolRegistry;
36
36
  providerRegistry: ProviderRegistry;
37
+ providerAuthRegistry?: ProviderAuthRegistry | undefined;
37
38
  slashCommandRegistry: SlashCommandRegistry;
38
39
  mcpRegistry: MCPRegistry;
39
40
  log: Logger;
@@ -1,10 +1,11 @@
1
- import { ProviderRegistry } from '@wrongstack/core/registry';
1
+ import { ProviderAuthRegistry, ProviderRegistry } from '@wrongstack/core/registry';
2
2
  import type { ResolvedProvider } from '@wrongstack/core/types';
3
3
  import { type Config, type Logger, type ModelsRegistry } from '@wrongstack/core/types';
4
4
  interface ProviderSetupResult {
5
5
  resolvedProvider: ResolvedProvider | undefined;
6
6
  provider: ReturnType<ProviderRegistry['create']>;
7
7
  providerRegistry: ProviderRegistry;
8
+ providerAuthRegistry: ProviderAuthRegistry;
8
9
  }
9
10
  export declare function setupProvider(params: {
10
11
  config: Config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrongstack/cli",
3
- "version": "1.0.0",
3
+ "version": "1.0.3",
4
4
  "license": "MIT",
5
5
  "description": "WrongStack CLI — terminal AI coding agent with provider catalog from models.dev. Provides `wrongstack` and `wstack` binaries.",
6
6
  "keywords": [
@@ -41,36 +41,36 @@
41
41
  "data"
42
42
  ],
43
43
  "dependencies": {
44
- "@wrongstack/acp": "1.0.0",
45
- "@wrongstack/bench": "1.0.0",
46
- "@wrongstack/core": "1.0.0",
47
- "@wrongstack/primitives": "1.0.0",
48
- "@wrongstack/kanban": "1.0.0",
49
- "@wrongstack/mcp": "1.0.0",
50
- "@wrongstack/persistence": "1.0.0",
51
- "@wrongstack/plug-lsp": "1.0.0",
52
- "@wrongstack/plugins": "1.0.0",
53
- "@wrongstack/providers": "1.0.0",
54
- "@wrongstack/requirement-intake": "1.0.0",
55
- "@wrongstack/runtime": "1.0.0",
56
- "@wrongstack/sage": "1.0.0",
57
- "@wrongstack/sdd": "1.0.0",
58
- "@wrongstack/security-scanner": "1.0.0",
59
- "@wrongstack/simpleui": "1.0.0",
60
- "@wrongstack/techstack": "1.0.0",
61
- "@wrongstack/telegram": "1.0.0",
62
- "@wrongstack/tools": "1.0.0",
63
- "@wrongstack/tui": "1.0.0",
64
- "@wrongstack/vector-memory": "1.0.0",
65
- "@wrongstack/webui": "1.0.0",
66
- "@wrongstack/webui-hq": "1.0.0",
67
- "@wrongstack/webui-protocol": "1.0.0",
68
- "@wrongstack/wrongtrace": "1.0.0",
69
- "@wrongstack/webui-server": "1.0.0",
44
+ "@wrongstack/acp": "1.0.3",
45
+ "@wrongstack/bench": "1.0.3",
46
+ "@wrongstack/core": "1.0.3",
47
+ "@wrongstack/primitives": "1.0.3",
48
+ "@wrongstack/kanban": "1.0.3",
49
+ "@wrongstack/mcp": "1.0.3",
50
+ "@wrongstack/persistence": "1.0.3",
51
+ "@wrongstack/plug-lsp": "1.0.3",
52
+ "@wrongstack/plugins": "1.0.3",
53
+ "@wrongstack/providers": "1.0.3",
54
+ "@wrongstack/requirement-intake": "1.0.3",
55
+ "@wrongstack/runtime": "1.0.3",
56
+ "@wrongstack/sage": "1.0.3",
57
+ "@wrongstack/sdd": "1.0.3",
58
+ "@wrongstack/security-scanner": "1.0.3",
59
+ "@wrongstack/simpleui": "1.0.3",
60
+ "@wrongstack/techstack": "1.0.3",
61
+ "@wrongstack/telegram": "1.0.3",
62
+ "@wrongstack/tools": "1.0.3",
63
+ "@wrongstack/tui": "1.0.3",
64
+ "@wrongstack/vector-memory": "1.0.3",
65
+ "@wrongstack/webui": "1.0.3",
66
+ "@wrongstack/webui-hq": "1.0.3",
67
+ "@wrongstack/webui-protocol": "1.0.3",
68
+ "@wrongstack/wrongtrace": "1.0.3",
69
+ "@wrongstack/webui-server": "1.0.3",
70
70
  "ws": "^8.21.3"
71
71
  },
72
72
  "optionalDependencies": {
73
- "@wrongstack/desktop": "1.0.0"
73
+ "@wrongstack/desktop": "1.0.3"
74
74
  },
75
75
  "devDependencies": {
76
76
  "@types/node": "^26.2.0",
@@ -83,7 +83,7 @@
83
83
  },
84
84
  "scripts": {
85
85
  "build": "node ../../scripts/build-package.mjs",
86
- "typecheck": "pnpm --filter @wrongstack/tools run build && pnpm --filter @wrongstack/tui run build && tsc --noEmit && tsc --noEmit -p tsconfig.test.json",
86
+ "typecheck": "pnpm --filter @wrongstack/tools run build && pnpm --filter @wrongstack/tui run build && pnpm --filter @wrongstack/webui-server run build && tsc --noEmit && tsc --noEmit -p tsconfig.test.json",
87
87
  "test": "vitest run",
88
88
  "test:hqdash": "vitest run --config vitest.hqdash.config.ts",
89
89
  "clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\""
@@ -1,7 +0,0 @@
1
- import {
2
- discoverAndMergeProviders
3
- } from "./chunk-52C7PD2H.js";
4
- export {
5
- discoverAndMergeProviders
6
- };
7
- //# sourceMappingURL=auto-discover-providers-VQU3IZMR.js.map
@@ -1,61 +0,0 @@
1
-
2
- // src/boot/auto-discover-providers.ts
3
- import * as fs from "node:fs/promises";
4
- import * as path from "node:path";
5
- import { discoverOpenAICompatibleModels, resolveDiscoveryTargets } from "@wrongstack/providers";
6
- async function readCache(file) {
7
- try {
8
- return JSON.parse(await fs.readFile(file, "utf8"));
9
- } catch {
10
- return {};
11
- }
12
- }
13
- async function discoverAndMergeProviders(opts) {
14
- const targets = resolveDiscoveryTargets(opts.config);
15
- if (targets.length === 0) return;
16
- const cacheFile = path.join(opts.cacheDir, "discovered-models-cache.json");
17
- const cache = await readCache(cacheFile);
18
- let cacheDirty = false;
19
- await Promise.all(
20
- targets.map(async ({ id, cfg, baseUrl, apiKey, cacheKey }) => {
21
- const provider = await discoverOpenAICompatibleModels(id, {
22
- baseUrl,
23
- apiKey,
24
- headers: cfg.headers,
25
- providerName: id,
26
- fetchImpl: opts.fetchImpl
27
- });
28
- if (provider) {
29
- cache[cacheKey] = { fetchedAt: (/* @__PURE__ */ new Date()).toISOString(), provider };
30
- cacheDirty = true;
31
- opts.registry.mergeOverlay({ [id]: provider });
32
- opts.logger?.info(
33
- `auto-discovered ${Object.keys(provider.models).length} models for "${id}" from ${baseUrl}`
34
- );
35
- return;
36
- }
37
- const cached = cache[cacheKey];
38
- if (cached) {
39
- opts.registry.mergeOverlay({ [id]: cached.provider });
40
- opts.logger?.warn(
41
- `auto-discovery for "${id}" failed; using ${Object.keys(cached.provider.models).length} cached models from ${cached.fetchedAt}`
42
- );
43
- } else {
44
- opts.logger?.warn(
45
- `auto-discovery for "${id}" failed and no cache available (server at ${baseUrl} unreachable?)`
46
- );
47
- }
48
- })
49
- );
50
- if (cacheDirty) {
51
- try {
52
- await fs.writeFile(cacheFile, JSON.stringify(cache), "utf8");
53
- } catch {
54
- }
55
- }
56
- }
57
-
58
- export {
59
- discoverAndMergeProviders
60
- };
61
- //# sourceMappingURL=chunk-52C7PD2H.js.map