@wrongstack/webui 0.265.1 → 0.267.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-UZtAQH-v.css +2 -0
- package/dist/assets/index-q6W9UOEF.js +121 -0
- package/dist/assets/{vendor-BX-wfDR9.js → vendor-HxGAEBey.js} +230 -230
- package/dist/index.html +3 -3
- package/dist/index.js +3331 -2562
- package/dist/index.js.map +1 -1
- package/dist/server/entry.js +493 -365
- package/dist/server/entry.js.map +1 -1
- package/dist/server/index.d.ts +50 -24
- package/dist/server/index.js +512 -382
- package/dist/server/index.js.map +1 -1
- package/dist/types.d.ts +29 -0
- package/package.json +6 -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,25 @@ 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 count their own lines as additions.
|
|
414
|
+
* Never throws — a non-repo yields an empty list.
|
|
415
|
+
*/
|
|
416
|
+
declare function handleGitChanges(ws: WebSocket, projectRoot: string): Promise<void>;
|
|
417
|
+
/**
|
|
418
|
+
* Resolve the before/after text for a single file and broadcast a `git.diff`
|
|
419
|
+
* message. `oldText` is the file at HEAD (`git show HEAD:<path>`), `newText`
|
|
420
|
+
* is the current working-tree content. New/untracked files have empty
|
|
421
|
+
* `oldText`; deleted files have empty `newText`. Binary or oversized files
|
|
422
|
+
* are reported with a flag instead of content so the client can show a notice.
|
|
423
|
+
*/
|
|
424
|
+
declare function handleGitDiff(ws: WebSocket, projectRoot: string, path: string): Promise<void>;
|
|
405
425
|
|
|
406
426
|
/**
|
|
407
427
|
* Shared memory-operation WebSocket handlers for both the standalone WebUI
|
|
@@ -431,30 +451,36 @@ declare function handleMemoryRemember(ws: WebSocket, msg: unknown, memoryStore:
|
|
|
431
451
|
declare function handleMemoryForget(ws: WebSocket, msg: unknown, memoryStore: MemoryStore): Promise<void>;
|
|
432
452
|
|
|
433
453
|
/**
|
|
434
|
-
* MCP management handlers for the WebUI server
|
|
435
|
-
*
|
|
454
|
+
* MCP management handlers for the WebUI server (both the standalone
|
|
455
|
+
* `wrongstack webui` server and the CLI's embedded `--webui` server).
|
|
456
|
+
*
|
|
457
|
+
* These are thin WebSocket translators over the shared, surface-agnostic
|
|
458
|
+
* management core in `@wrongstack/mcp` (`manage.ts`) — the SAME core the REPL
|
|
459
|
+
* `/mcp` command writes against (same config.json, same MCPRegistry). All the
|
|
460
|
+
* config IO, url/header persistence, and live registry start/stop logic lives
|
|
461
|
+
* there; here we only map structured results to WS events the browser expects.
|
|
436
462
|
*/
|
|
437
463
|
|
|
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
|
|
464
|
+
/** mcp.list — configured servers merged with live registry status + tools. */
|
|
465
|
+
declare function handleMcpList(ws: WebSocket, _msg: WSClientMessage, globalConfigPath: string, mcpRegistry?: MCPRegistry): Promise<void>;
|
|
466
|
+
/** mcp.add — persist a new server (incl. url/headers) and start it if enabled. */
|
|
467
|
+
declare function handleMcpAdd(ws: WebSocket, msg: WSClientMessage, globalConfigPath: string, mcpRegistry?: MCPRegistry): Promise<void>;
|
|
468
|
+
/** mcp.update — re-persist config (incl. url/headers) and re-apply to registry. */
|
|
469
|
+
declare function handleMcpUpdate(ws: WebSocket, msg: WSClientMessage, globalConfigPath: string, mcpRegistry?: MCPRegistry): Promise<void>;
|
|
470
|
+
/** mcp.remove — stop the server and delete it from config. */
|
|
471
|
+
declare function handleMcpRemove(ws: WebSocket, msg: WSClientMessage, globalConfigPath: string, mcpRegistry?: MCPRegistry): Promise<void>;
|
|
472
|
+
/** mcp.enable — flip enabled:true in config and start the server. */
|
|
473
|
+
declare function handleMcpEnable(ws: WebSocket, msg: WSClientMessage, globalConfigPath: string, mcpRegistry?: MCPRegistry): Promise<void>;
|
|
474
|
+
/** mcp.disable — stop the server and flip enabled:false in config. */
|
|
475
|
+
declare function handleMcpDisable(ws: WebSocket, msg: WSClientMessage, globalConfigPath: string, mcpRegistry?: MCPRegistry): Promise<void>;
|
|
476
|
+
/** mcp.sleep — stop a running server (config stays enabled). */
|
|
477
|
+
declare function handleMcpSleep(ws: WebSocket, msg: WSClientMessage, globalConfigPath: string, mcpRegistry?: MCPRegistry): Promise<void>;
|
|
478
|
+
/** mcp.wake — restart a sleeping/stopped server from config. */
|
|
479
|
+
declare function handleMcpWake(ws: WebSocket, msg: WSClientMessage, globalConfigPath: string, mcpRegistry?: MCPRegistry): Promise<void>;
|
|
480
|
+
/** mcp.restart — stop + start a server. */
|
|
481
|
+
declare function handleMcpRestart(ws: WebSocket, msg: WSClientMessage, globalConfigPath: string, mcpRegistry?: MCPRegistry): Promise<void>;
|
|
482
|
+
/** mcp.discover — ensure the server is running and report its live tools. */
|
|
483
|
+
declare function handleMcpDiscover(ws: WebSocket, msg: WSClientMessage, globalConfigPath: string, mcpRegistry?: MCPRegistry): Promise<void>;
|
|
458
484
|
|
|
459
485
|
/**
|
|
460
486
|
* Custom context modes — user-defined presets that are loaded from disk,
|
|
@@ -754,4 +780,4 @@ declare function startWebUI(opts?: WebUIOptions & {
|
|
|
754
780
|
open?: boolean | undefined;
|
|
755
781
|
}): Promise<void>;
|
|
756
782
|
|
|
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 };
|
|
783
|
+
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 };
|