@wrongstack/webui 0.265.1 → 0.268.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/dist/assets/index-BwJjYOM3.css +2 -0
- package/dist/assets/index-Dlznb4DM.js +121 -0
- package/dist/assets/{vendor-BX-wfDR9.js → vendor-BL9KT5LK.js} +286 -251
- package/dist/assets/{vendor-B2D6LvU3.css → vendor-BzqIVtlT.css} +1 -1
- package/dist/index.html +4 -4
- package/dist/index.js +6879 -5172
- package/dist/index.js.map +1 -1
- package/dist/server/entry.js +5290 -4185
- package/dist/server/entry.js.map +1 -1
- package/dist/server/index.d.ts +52 -24
- package/dist/server/index.js +4671 -3813
- package/dist/server/index.js.map +1 -1
- package/dist/types.d.ts +67 -0
- package/package.json +11 -5
- package/dist/assets/index-CC3KdGXG.js +0 -118
- package/dist/assets/index-CFHDQU3T.css +0 -2
package/dist/server/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { WebSocket } from 'ws';
|
|
2
|
-
import { Agent, EventBus, SessionStore, ToolRegistry, ModelsRegistry, ConfigStore, SecretVault, JournalEntry, Logger, MemoryStore,
|
|
2
|
+
import { Agent, EventBus, SessionStore, ToolRegistry, ModelsRegistry, ConfigStore, SecretVault, JournalEntry, Logger, MemoryStore, ProviderConfig, ProviderApiKey, Context, SkillLoader } from '@wrongstack/core';
|
|
3
3
|
import * as http from 'node:http';
|
|
4
|
+
import { MCPRegistry } from '@wrongstack/mcp';
|
|
4
5
|
import { SkillInstaller } from '@wrongstack/core/skills';
|
|
5
6
|
|
|
6
7
|
interface WSServerMessage {
|
|
@@ -402,6 +403,27 @@ declare function handleFilesList(ws: WebSocket, msg: unknown, projectRoot: strin
|
|
|
402
403
|
* directory yields an empty-but-valid payload.
|
|
403
404
|
*/
|
|
404
405
|
declare function handleGitInfo(ws: WebSocket, projectRoot: string): Promise<void>;
|
|
406
|
+
/**
|
|
407
|
+
* Read the working-tree change set (everything that differs from HEAD:
|
|
408
|
+
* staged, unstaged, and untracked) and broadcast a `git.changes` message.
|
|
409
|
+
*
|
|
410
|
+
* The file list comes from `git status --porcelain -z` (NUL-delimited so
|
|
411
|
+
* paths with spaces/unicode survive intact, and renames are unambiguous).
|
|
412
|
+
* Per-file line counts come from `--numstat` of both the unstaged and the
|
|
413
|
+
* staged diff, summed. Untracked files intentionally report 0/0 here so the
|
|
414
|
+
* list view does not read every untracked file; `git.diff` loads a selected
|
|
415
|
+
* file lazily on demand.
|
|
416
|
+
* Never throws — a non-repo yields an empty list.
|
|
417
|
+
*/
|
|
418
|
+
declare function handleGitChanges(ws: WebSocket, projectRoot: string): Promise<void>;
|
|
419
|
+
/**
|
|
420
|
+
* Resolve the before/after text for a single file and broadcast a `git.diff`
|
|
421
|
+
* message. `oldText` is the file at HEAD (`git show HEAD:<path>`), `newText`
|
|
422
|
+
* is the current working-tree content. New/untracked files have empty
|
|
423
|
+
* `oldText`; deleted files have empty `newText`. Binary or oversized files
|
|
424
|
+
* are reported with a flag instead of content so the client can show a notice.
|
|
425
|
+
*/
|
|
426
|
+
declare function handleGitDiff(ws: WebSocket, projectRoot: string, path: string): Promise<void>;
|
|
405
427
|
|
|
406
428
|
/**
|
|
407
429
|
* Shared memory-operation WebSocket handlers for both the standalone WebUI
|
|
@@ -431,30 +453,36 @@ declare function handleMemoryRemember(ws: WebSocket, msg: unknown, memoryStore:
|
|
|
431
453
|
declare function handleMemoryForget(ws: WebSocket, msg: unknown, memoryStore: MemoryStore): Promise<void>;
|
|
432
454
|
|
|
433
455
|
/**
|
|
434
|
-
* MCP management handlers for the WebUI server
|
|
435
|
-
*
|
|
456
|
+
* MCP management handlers for the WebUI server (both the standalone
|
|
457
|
+
* `wrongstack webui` server and the CLI's embedded `--webui` server).
|
|
458
|
+
*
|
|
459
|
+
* These are thin WebSocket translators over the shared, surface-agnostic
|
|
460
|
+
* management core in `@wrongstack/mcp` (`manage.ts`) — the SAME core the REPL
|
|
461
|
+
* `/mcp` command writes against (same config.json, same MCPRegistry). All the
|
|
462
|
+
* config IO, url/header persistence, and live registry start/stop logic lives
|
|
463
|
+
* there; here we only map structured results to WS events the browser expects.
|
|
436
464
|
*/
|
|
437
465
|
|
|
438
|
-
/**
|
|
439
|
-
declare function handleMcpList(ws: WebSocket, _msg: WSClientMessage,
|
|
440
|
-
/**
|
|
441
|
-
declare function handleMcpAdd(ws: WebSocket, msg: WSClientMessage,
|
|
442
|
-
/**
|
|
443
|
-
declare function
|
|
444
|
-
/**
|
|
445
|
-
declare function
|
|
446
|
-
/**
|
|
447
|
-
declare function
|
|
448
|
-
/**
|
|
449
|
-
declare function
|
|
450
|
-
/**
|
|
451
|
-
declare function
|
|
452
|
-
/**
|
|
453
|
-
declare function
|
|
454
|
-
/**
|
|
455
|
-
declare function
|
|
456
|
-
/**
|
|
457
|
-
declare function
|
|
466
|
+
/** mcp.list — configured servers merged with live registry status + tools. */
|
|
467
|
+
declare function handleMcpList(ws: WebSocket, _msg: WSClientMessage, globalConfigPath: string, mcpRegistry?: MCPRegistry): Promise<void>;
|
|
468
|
+
/** mcp.add — persist a new server (incl. url/headers) and start it if enabled. */
|
|
469
|
+
declare function handleMcpAdd(ws: WebSocket, msg: WSClientMessage, globalConfigPath: string, mcpRegistry?: MCPRegistry): Promise<void>;
|
|
470
|
+
/** mcp.update — re-persist config (incl. url/headers) and re-apply to registry. */
|
|
471
|
+
declare function handleMcpUpdate(ws: WebSocket, msg: WSClientMessage, globalConfigPath: string, mcpRegistry?: MCPRegistry): Promise<void>;
|
|
472
|
+
/** mcp.remove — stop the server and delete it from config. */
|
|
473
|
+
declare function handleMcpRemove(ws: WebSocket, msg: WSClientMessage, globalConfigPath: string, mcpRegistry?: MCPRegistry): Promise<void>;
|
|
474
|
+
/** mcp.enable — flip enabled:true in config and start the server. */
|
|
475
|
+
declare function handleMcpEnable(ws: WebSocket, msg: WSClientMessage, globalConfigPath: string, mcpRegistry?: MCPRegistry): Promise<void>;
|
|
476
|
+
/** mcp.disable — stop the server and flip enabled:false in config. */
|
|
477
|
+
declare function handleMcpDisable(ws: WebSocket, msg: WSClientMessage, globalConfigPath: string, mcpRegistry?: MCPRegistry): Promise<void>;
|
|
478
|
+
/** mcp.sleep — stop a running server (config stays enabled). */
|
|
479
|
+
declare function handleMcpSleep(ws: WebSocket, msg: WSClientMessage, globalConfigPath: string, mcpRegistry?: MCPRegistry): Promise<void>;
|
|
480
|
+
/** mcp.wake — restart a sleeping/stopped server from config. */
|
|
481
|
+
declare function handleMcpWake(ws: WebSocket, msg: WSClientMessage, globalConfigPath: string, mcpRegistry?: MCPRegistry): Promise<void>;
|
|
482
|
+
/** mcp.restart — stop + start a server. */
|
|
483
|
+
declare function handleMcpRestart(ws: WebSocket, msg: WSClientMessage, globalConfigPath: string, mcpRegistry?: MCPRegistry): Promise<void>;
|
|
484
|
+
/** mcp.discover — ensure the server is running and report its live tools. */
|
|
485
|
+
declare function handleMcpDiscover(ws: WebSocket, msg: WSClientMessage, globalConfigPath: string, mcpRegistry?: MCPRegistry): Promise<void>;
|
|
458
486
|
|
|
459
487
|
/**
|
|
460
488
|
* Custom context modes — user-defined presets that are loaded from disk,
|
|
@@ -754,4 +782,4 @@ declare function startWebUI(opts?: WebUIOptions & {
|
|
|
754
782
|
open?: boolean | undefined;
|
|
755
783
|
}): Promise<void>;
|
|
756
784
|
|
|
757
|
-
export { AutoPhaseWebSocketHandler, type BackendServices, type ConnectedClient, type ContextBreakdown, type CreateHttpServerOptions, type CustomContextMode, type CustomModeStore, type EternalBroadcast, type EternalSubscribe, type EternalSubscription, type KeyOpResult, type MessageTokenEntry, type ProvidersRecord, type ShellOpenRequest, type ShellOpenResult, type ShellOpenTarget, type SkillsContext, type ToolTokenEntry, type VerifyClientInput, type WSClientMessage, type WSServerMessage, type WebUIInstanceRecord, type WebUIOptions, addProvider, broadcast, browserOpenCommand, buildCspHeader, createCustomModeStore, createEternalSubscription, createHttpServer, createProviderConfigIO, defaultBaseDir, deleteKey, errMessage, estimateTokens, extractToken, findFreePort, formatInstances, generateAuthToken, handleFilesList, handleFilesRead, handleFilesTree, handleFilesWrite, handleGitInfo, handleMcpAdd, handleMcpDisable, handleMcpDiscover, handleMcpEnable, handleMcpList, handleMcpRemove, handleMcpRestart, handleMcpSleep, handleMcpUpdate, handleMcpWake, handleMemoryForget, handleMemoryList, handleMemoryRemember, handleShellOpen, handleSkillsContent, handleSkillsCreate, handleSkillsEdit, handleSkillsExport, handleSkillsInstall, handleSkillsUninstall, handleSkillsUpdate, hostHeaderOk, injectWsPort, isLoopbackBind, isLoopbackHostname, isPortFree, listInstances, loadSavedProviders, maskedKey, messagePreview, messageTokens, normalizeKeys, openBrowser, registerInstance, registryPath, removeProvider, saveProviders, send, sendResult, setActiveKey, startWebUI, stringifyContent, tokenMatches, unregisterInstance, upsertKey, verifyClient, writeKeysBack };
|
|
785
|
+
export { AutoPhaseWebSocketHandler, type BackendServices, type ConnectedClient, type ContextBreakdown, type CreateHttpServerOptions, type CustomContextMode, type CustomModeStore, type EternalBroadcast, type EternalSubscribe, type EternalSubscription, type KeyOpResult, type MessageTokenEntry, type ProvidersRecord, type ShellOpenRequest, type ShellOpenResult, type ShellOpenTarget, type SkillsContext, type ToolTokenEntry, type VerifyClientInput, type WSClientMessage, type WSServerMessage, type WebUIInstanceRecord, type WebUIOptions, addProvider, broadcast, browserOpenCommand, buildCspHeader, createCustomModeStore, createEternalSubscription, createHttpServer, createProviderConfigIO, defaultBaseDir, deleteKey, errMessage, estimateTokens, extractToken, findFreePort, formatInstances, generateAuthToken, handleFilesList, handleFilesRead, handleFilesTree, handleFilesWrite, handleGitChanges, handleGitDiff, handleGitInfo, handleMcpAdd, handleMcpDisable, handleMcpDiscover, handleMcpEnable, handleMcpList, handleMcpRemove, handleMcpRestart, handleMcpSleep, handleMcpUpdate, handleMcpWake, handleMemoryForget, handleMemoryList, handleMemoryRemember, handleShellOpen, handleSkillsContent, handleSkillsCreate, handleSkillsEdit, handleSkillsExport, handleSkillsInstall, handleSkillsUninstall, handleSkillsUpdate, hostHeaderOk, injectWsPort, isLoopbackBind, isLoopbackHostname, isPortFree, listInstances, loadSavedProviders, maskedKey, messagePreview, messageTokens, normalizeKeys, openBrowser, registerInstance, registryPath, removeProvider, saveProviders, send, sendResult, setActiveKey, startWebUI, stringifyContent, tokenMatches, unregisterInstance, upsertKey, verifyClient, writeKeysBack };
|