@wrongstack/webui 0.306.4 → 0.307.1
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/AgentRosterView-Bb5m_XjZ.js +9 -0
- package/dist/assets/AnalyticsDashboard-lqPCAo9u.js +1 -0
- package/dist/assets/AudienceMemoryPanel-putWTq5V.js +3 -0
- package/dist/assets/{ChangesView-DplR2Twb.js → ChangesView-Cw-qvOLA.js} +1 -1
- package/dist/assets/ChronicleDashboard-DQdMkTLQ.js +1 -0
- package/dist/assets/CodeEditor-BAv2f4se.js +2 -0
- package/dist/assets/CodeMap-BB1WETLd.js +1 -0
- package/dist/assets/ConfirmModal-LBZaZgsG.js +1 -0
- package/dist/assets/CronJobsPanel-DE5CVuSW.js +1 -0
- package/dist/assets/{DeadCodeScanPanel-Dp6vW6pV.js → DeadCodeScanPanel-nlQ9nL3Y.js} +1 -1
- package/dist/assets/{DebugDashboard-d4ETqxOe.js → DebugDashboard-CgRH9SvC.js} +1 -1
- package/dist/assets/{DesignGalleryView-3jRTmgzx.js → DesignGalleryView-Uwo3JXyu.js} +1 -1
- package/dist/assets/GoalView-Cc4B-0Qd.js +1 -0
- package/dist/assets/KanbanView-CK4bvZfi.js +3 -0
- package/dist/assets/MailboxDetailView-CGwtSBcH.js +1 -0
- package/dist/assets/{MemoryDrawer-DIrEAQNI.js → MemoryDrawer-Cw1IiFCO.js} +1 -1
- package/dist/assets/MemoryManager-l0R8JBzL.js +1 -0
- package/dist/assets/{ModelPicker-OSfUtS6_.js → ModelPicker-DC-XCx0f.js} +1 -1
- package/dist/assets/OfficeMapPanel-CUI0PJBI.js +4 -0
- package/dist/assets/{ProcessMonitor-SLnEEbRY.js → ProcessMonitor-DLD6PrVx.js} +1 -1
- package/dist/assets/PromptJournalView-Cf1szLLw.js +1 -0
- package/dist/assets/{QueuePanel-BszNSrlq.js → QueuePanel-O7IsaKUs.js} +1 -1
- package/dist/assets/{RefreshDebugView-DA6cPIhw.js → RefreshDebugView-CuKbgI-T.js} +1 -1
- package/dist/assets/RequirementIntakeView-Bg8ZoV7J.js +1 -0
- package/dist/assets/{SageTabs-BR09lBUK.js → SageTabs-Bk8VDMmR.js} +2 -2
- package/dist/assets/SddFlowGraph-DdYgCVM_.js +1 -0
- package/dist/assets/SddHub-tQztZlHf.js +2 -0
- package/dist/assets/{SessionInspectView-Bf3X0qK8.js → SessionInspectView-BnoD3YER.js} +1 -1
- package/dist/assets/SessionList-BRbF7FVS.js +1 -0
- package/dist/assets/{SessionsDashboard-CwuOKWQc.js → SessionsDashboard-7heYIhHQ.js} +1 -1
- package/dist/assets/SetupScreen-CQW-6bhj.js +1 -0
- package/dist/assets/SkillDetailView-DdxB0JI4.js +3 -0
- package/dist/assets/{SpecsView-Do8eQuTN.js → SpecsView-BAnFfPPH.js} +1 -1
- package/dist/assets/TechStackView-DJeNOZE9.js +2 -0
- package/dist/assets/{TerminalPanel-Pq97A882.js → TerminalPanel-v3SC9LTq.js} +1 -1
- package/dist/assets/Toaster-wXvKXbbS.js +1 -0
- package/dist/assets/{activity-Dr_u3dOm.js → activity-C0qPnCbW.js} +2 -2
- package/dist/assets/{activity-Dzgvt4Nh.js → activity-DTSVEiLK.js} +2 -2
- package/dist/assets/{activity-L2_b8Uan.js → activity-DWHlYL9x.js} +2 -2
- package/dist/assets/{activity-gB90peLu.js → activity-DjnYvN9C.js} +2 -2
- package/dist/assets/{activity-Dg9Q9kwt.js → activity-fdbTRXeg.js} +3 -3
- package/dist/assets/{activity-BI4XyF_x.js → activity-jL8-j1D0.js} +2 -2
- package/dist/assets/{activity-IttuV5ar.js → activity-phJuGuf4.js} +2 -2
- package/dist/assets/{button-DvHe5h9X.js → button-DvpRpKkt.js} +1 -1
- package/dist/assets/{chat-CdiY7G6Z.js → chat-CzaGXz_W.js} +1 -1
- package/dist/assets/chat-store-c0pGYczr.js +17 -0
- package/dist/assets/codemap-activity-store-BH7Mh4k9.js +1 -0
- package/dist/assets/codemap-index-store-BFm1TzVW.js +1 -0
- package/dist/assets/{commandPalette-DpaemFux.js → commandPalette-BovBiPec.js} +1 -1
- package/dist/assets/common-BBHmIHQW.js +1 -0
- package/dist/assets/common-C3PzxyXg.js +1 -0
- package/dist/assets/common-CUWL8eNX.js +1 -0
- package/dist/assets/common-CvSB5NM3.js +1 -0
- package/dist/assets/common-DT2FL9xN.js +1 -0
- package/dist/assets/common-DuR5FTPN.js +1 -0
- package/dist/assets/common-xPePelft.js +1 -0
- package/dist/assets/{css.worker-B1A7g9RU.js → css.worker-DRH2OcAG.js} +14 -14
- package/dist/assets/{dialog-jbs7gu-q.js → dialog-BJjDUqb3.js} +1 -1
- package/dist/assets/{empty-state-D-ojp6Gp.js → empty-state-Cefmzojx.js} +1 -1
- package/dist/assets/{html.worker-NdFMIQdB.js → html.worker-DQLddT9h.js} +17 -17
- package/dist/assets/i18n-CDoHRskt.js +2 -0
- package/dist/assets/index-BRJ_UrGk.js +133 -0
- package/dist/assets/index-BRs425Ir.css +1 -0
- package/dist/assets/{input-oJ0Gehqp.js → input-BtoHcCl9.js} +1 -1
- package/dist/assets/json.worker-D_Dqrls5.js +62 -0
- package/dist/assets/mailbox-store-bF96Ih2G.js +1 -0
- package/dist/assets/markdown-CIRD7kOg.js +44 -0
- package/dist/assets/monaco-BCqJp2xW.js +1236 -0
- package/dist/assets/{monaco-theme-DSeCDzQy.js → monaco-theme-CR1QvFi2.js} +1 -1
- package/dist/assets/{rolldown-runtime-QTnfLwEv.js → rolldown-runtime-hePW80VL.js} +1 -1
- package/dist/assets/{roster-ws-DobwmzEj.js → roster-ws-CK52jAnG.js} +1 -1
- package/dist/assets/session-store-BgiP4PnQ.js +1 -0
- package/dist/assets/{settings-t7_uBgp_.js → settings-CbtB0i7o.js} +1 -1
- package/dist/assets/{setup-BFcmn89w.js → setup-DfcCCvUO.js} +1 -1
- package/dist/assets/{shared-CiaNczO0.js → shared-B3czc2Dj.js} +1 -1
- package/dist/assets/stores-DSGsI875.js +7 -0
- package/dist/assets/{toasts-BL_8kH4B.js → toasts-DOfXc7Rt.js} +1 -1
- package/dist/assets/{ts.worker-XonqDHUu.js → ts.worker-DkYoA6bF.js} +45 -45
- package/dist/assets/ui-store-xx1NssJI.js +1 -0
- package/dist/assets/useWebSocket-BFFntyS4.js +29 -0
- package/dist/assets/utils-tsZEnrBH.js +1 -0
- package/dist/assets/vendor-C_zEzV4N.js +139 -0
- package/dist/assets/{view-navigation-D-afwlSZ.js → view-navigation-CZKugncK.js} +1 -1
- package/dist/assets/ws-client-B3MVz75-.js +1 -0
- package/dist/assets/xterm-BWzBEEhg.js +18 -0
- package/dist/components/ChatInput/composer-button-bar.d.ts +24 -0
- package/dist/components/ChatInput/next-steps-helpers.d.ts +19 -0
- package/dist/components/ChatInput/use-chat-input-mcp.d.ts +8 -0
- package/dist/components/ChatInput/use-refine-timeout.d.ts +9 -0
- package/dist/components/ChatView/ChatDisplayToggles.d.ts +18 -0
- package/dist/components/ChatView/ChatHeader.d.ts +60 -0
- package/dist/components/ChatView/ChatRowView.d.ts +9 -0
- package/dist/components/ChatView/ToggleSwitch.d.ts +6 -0
- package/dist/components/ChatView/useChatViewState.d.ts +80 -0
- package/dist/components/ContextBar.d.ts +15 -2
- package/dist/components/FileExplorer/FileExplorerModals.d.ts +44 -0
- package/dist/components/FileExplorer/TreeRow.d.ts +23 -0
- package/dist/components/FileExplorer/tree-helpers.d.ts +16 -0
- package/dist/components/FileExplorer/types.d.ts +19 -0
- package/dist/components/MemoryManager/MemoryDrawerToolbar.d.ts +8 -0
- package/dist/components/MemoryManager/MemoryManagerHeader.d.ts +7 -0
- package/dist/components/MemoryManager/MemoryManagerStatsBar.d.ts +8 -0
- package/dist/components/MemoryManager/useMemoryManagerState.d.ts +85 -0
- package/dist/components/PromptJournalView.d.ts +2 -0
- package/dist/components/SddWizard.d.ts +0 -6
- package/dist/components/SettingsPanel/AgentSettingsTab.d.ts +5 -0
- package/dist/components/SettingsPanel/ContextSettingsTab.d.ts +4 -0
- package/dist/components/SettingsPanel/ExecutionSettingsTab.d.ts +6 -0
- package/dist/components/SettingsPanel/LogsSettingsTab.d.ts +4 -0
- package/dist/components/TechStackView/shared.d.ts +1 -0
- package/dist/components/self-learning/SelfLearningAgentList.d.ts +9 -0
- package/dist/components/self-learning/SelfLearningDetail.d.ts +39 -0
- package/dist/components/self-learning/types.d.ts +30 -0
- package/dist/components/self-learning/use-self-learning-state.d.ts +46 -0
- package/dist/hooks/ws-handlers/files-mailbox-handlers.d.ts +19 -0
- package/dist/hooks/ws-handlers/session-context-handlers.d.ts +18 -0
- package/dist/hooks/ws-handlers/session-execution-handlers.d.ts +24 -0
- package/dist/hooks/ws-handlers/session-handlers.d.ts +3 -36
- package/dist/hooks/ws-handlers/session-replay-handlers.d.ts +22 -0
- package/dist/index.html +31 -31
- package/dist/index.js +18021 -15149
- package/dist/lib/view-navigation.d.ts +1 -1
- package/dist/lib/ws-client-domain-methods.d.ts +86 -0
- package/dist/lib/ws-client.d.ts +2 -83
- package/dist/stores/chat-queue-helpers.d.ts +9 -0
- package/dist/stores/chat-retention.d.ts +14 -0
- package/dist/stores/chat-store-types.d.ts +106 -0
- package/dist/stores/chat-store.d.ts +6 -183
- package/dist/stores/file-store.d.ts +72 -3
- package/dist/stores/session-store.d.ts +20 -0
- package/dist/stores/ui-store.d.ts +3 -3
- package/dist/types/client-message.d.ts +51 -0
- package/dist/types/protocol-core.d.ts +2 -0
- package/dist/types/runtime.d.ts +1 -0
- package/dist/types/server-message.d.ts +76 -0
- package/package.json +20 -20
- package/dist/assets/AgentRosterView-X4NWBm16.js +0 -9
- package/dist/assets/AnalyticsDashboard-CvEY3lEY.js +0 -1
- package/dist/assets/AudienceMemoryPanel-ChhQVsbD.js +0 -3
- package/dist/assets/ChronicleDashboard-BpykJceZ.js +0 -1
- package/dist/assets/CodeEditor-DQDKQlAo.js +0 -1
- package/dist/assets/CodeMap-CnlnHM8P.js +0 -1
- package/dist/assets/ConfirmModal-BD6pUkAB.js +0 -1
- package/dist/assets/CronJobsPanel-Dp9xc7vb.js +0 -1
- package/dist/assets/GoalView-CoMRM0Vo.js +0 -1
- package/dist/assets/KanbanView-BMHq13vg.js +0 -3
- package/dist/assets/MailboxDetailView-C0n5fMGN.js +0 -1
- package/dist/assets/MemoryManager-CEfDQuV9.js +0 -1
- package/dist/assets/OfficeMapPanel-TIRw1a9O.js +0 -4
- package/dist/assets/RequirementIntakeView-CN7Yympd.js +0 -1
- package/dist/assets/SddFlowGraph-B-5J7zOV.js +0 -1
- package/dist/assets/SddHub-CkjrCykN.js +0 -2
- package/dist/assets/SessionList-cAmzxd3Z.js +0 -1
- package/dist/assets/SetupScreen-DZUvrhr0.js +0 -1
- package/dist/assets/SkillDetailView-CULufBnT.js +0 -3
- package/dist/assets/TechStackView-B2v5LoJp.js +0 -1
- package/dist/assets/Toaster-Dic3369l.js +0 -1
- package/dist/assets/chat-store-BgCgMMd0.js +0 -17
- package/dist/assets/codemap-activity-store-DBdfN0ix.js +0 -1
- package/dist/assets/codemap-index-store-45CkVCxN.js +0 -1
- package/dist/assets/common-BXJbu5Y-.js +0 -1
- package/dist/assets/common-BiNu_WzQ.js +0 -1
- package/dist/assets/common-COVxQ0FV.js +0 -1
- package/dist/assets/common-Ch7JihXD.js +0 -1
- package/dist/assets/common-DPaTeTls.js +0 -1
- package/dist/assets/common-DdGpRh8j.js +0 -1
- package/dist/assets/common-pI6fYZW3.js +0 -1
- package/dist/assets/i18n-nlW2iAya.js +0 -2
- package/dist/assets/index-eK0iH6jY.js +0 -133
- package/dist/assets/index-mNf-KFcC.css +0 -1
- package/dist/assets/json.worker-Ax0gao5O.js +0 -62
- package/dist/assets/mailbox-store-BuLRsYu3.js +0 -1
- package/dist/assets/markdown-sSmz-Ua_.js +0 -44
- package/dist/assets/monaco-BLUV5g0U.js +0 -1236
- package/dist/assets/session-store-DkPaOIhe.js +0 -1
- package/dist/assets/stores-BpVw7ENx.js +0 -7
- package/dist/assets/ui-store-FVcXVdRC.js +0 -1
- package/dist/assets/useWebSocket-Dh-clEvj.js +0 -29
- package/dist/assets/utils-D1fGupR8.js +0 -1
- package/dist/assets/vendor-AeHpGMaG.js +0 -139
- package/dist/assets/ws-client-B7j8isQb.js +0 -1
- package/dist/assets/xterm-DUBp1lnG.js +0 -35
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Activity } from '@/stores/ui-store';
|
|
2
2
|
export type PanelMainView = 'chat' | 'files' | 'skill' | 'officemap' | 'changes' | 'mailbox' | 'design-gallery';
|
|
3
|
-
export type MainView = 'goal' | 'kanban' | 'sddhub' | 'settings' | 'memory' | 'roster' | 'codemap' | 'techstack' | 'chronicle' | 'intake';
|
|
3
|
+
export type MainView = 'goal' | 'kanban' | 'sddhub' | 'settings' | 'memory' | 'roster' | 'codemap' | 'techstack' | 'chronicle' | 'intake' | 'prompts';
|
|
4
4
|
export type AppView = PanelMainView | MainView | 'sessions' | 'session-inspect' | 'setup' | 'debug' | 'refresh-debug' | 'analytics';
|
|
5
5
|
export declare const PANEL_VIEW_BY_ACTIVITY: Record<Activity, PanelMainView>;
|
|
6
6
|
export declare const VIEW_ACTIVITY: Partial<Record<AppView, Activity>>;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { WSClientMessage } from '../types';
|
|
2
|
+
import type { ProviderCustomModelWire } from '../types/client-message';
|
|
3
|
+
import type { ContextEditorMessage, ContextEditorRemoval } from '../types/runtime';
|
|
4
|
+
import type { WSSendOptions } from './ws-client-contracts';
|
|
5
|
+
export interface WsClientDomainHost {
|
|
6
|
+
send(message: WSClientMessage, options?: WSSendOptions): boolean;
|
|
7
|
+
withSession<T extends Record<string, unknown>>(payload: T): T & {
|
|
8
|
+
sessionId?: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export declare const domainMethods: {
|
|
12
|
+
getGitInfo(this: WsClientDomainHost): void;
|
|
13
|
+
getGitChanges(this: WsClientDomainHost): void;
|
|
14
|
+
getGitDiff(this: WsClientDomainHost, path: string): void;
|
|
15
|
+
getProviderStatus(this: WsClientDomainHost): void;
|
|
16
|
+
retryProviderModel(this: WsClientDomainHost, providerId: string, model: string): void;
|
|
17
|
+
clearProviderStatus(this: WsClientDomainHost, providerId: string, model: string): void;
|
|
18
|
+
newSession(this: WsClientDomainHost): void;
|
|
19
|
+
listProviders(this: WsClientDomainHost): void;
|
|
20
|
+
listProviderModels(this: WsClientDomainHost, providerId: string): void;
|
|
21
|
+
listSavedProviders(this: WsClientDomainHost): void;
|
|
22
|
+
searchProviderModels(this: WsClientDomainHost, query: string, limit?: number): void;
|
|
23
|
+
addKey(this: WsClientDomainHost, providerId: string, label: string, apiKey: string): void;
|
|
24
|
+
updateKey(this: WsClientDomainHost, providerId: string, label: string, apiKey: string): void;
|
|
25
|
+
deleteKey(this: WsClientDomainHost, providerId: string, label: string): void;
|
|
26
|
+
setActiveKey(this: WsClientDomainHost, providerId: string, label: string): void;
|
|
27
|
+
addProvider(this: WsClientDomainHost, id: string, family: string, baseUrl?: string | undefined, apiKey?: string, models?: string[] | undefined, customModels?: Record<string, ProviderCustomModelWire> | undefined): void;
|
|
28
|
+
removeProvider(this: WsClientDomainHost, providerId: string): void;
|
|
29
|
+
startOAuth(this: WsClientDomainHost, kind: 'chatgpt' | 'claude' | 'copilot', providerId?: string): void;
|
|
30
|
+
submitOAuthCode(this: WsClientDomainHost, kind: 'chatgpt' | 'claude' | 'copilot', input: string): void;
|
|
31
|
+
cancelOAuth(this: WsClientDomainHost, kind: 'chatgpt' | 'claude' | 'copilot'): void;
|
|
32
|
+
probeProvider(this: WsClientDomainHost, providerId: string, timeoutMs?: number): void;
|
|
33
|
+
clearProviderModels(this: WsClientDomainHost, providerId: string): void;
|
|
34
|
+
undoProviderClear(this: WsClientDomainHost, providerId: string, previousModels: string[]): void;
|
|
35
|
+
setCustomModel(this: WsClientDomainHost, providerId: string, modelId: string, customModel: ProviderCustomModelWire): void;
|
|
36
|
+
removeCustomModel(this: WsClientDomainHost, providerId: string, modelId: string): void;
|
|
37
|
+
updateProvider(this: WsClientDomainHost, payload: {
|
|
38
|
+
id: string;
|
|
39
|
+
family?: string | undefined;
|
|
40
|
+
baseUrl?: string | undefined;
|
|
41
|
+
envVars?: string[] | undefined;
|
|
42
|
+
models?: string[] | undefined;
|
|
43
|
+
customModels?: Record<string, ProviderCustomModelWire> | undefined;
|
|
44
|
+
}): void;
|
|
45
|
+
clearContext(this: WsClientDomainHost): void;
|
|
46
|
+
compactContext(this: WsClientDomainHost, aggressive?: boolean): void;
|
|
47
|
+
repairContext(this: WsClientDomainHost): void;
|
|
48
|
+
openContextEditor(this: WsClientDomainHost): void;
|
|
49
|
+
validateContextEditor(this: WsClientDomainHost, baseRevision: string, messages: ContextEditorMessage[], removals: ContextEditorRemoval[], allowRepair: boolean): void;
|
|
50
|
+
applyContextEditor(this: WsClientDomainHost, baseRevision: string, messages: ContextEditorMessage[], removals: ContextEditorRemoval[], allowRepair: boolean): void;
|
|
51
|
+
debugContext(this: WsClientDomainHost, options?: WSSendOptions): void;
|
|
52
|
+
listContextModes(this: WsClientDomainHost): void;
|
|
53
|
+
switchContextMode(this: WsClientDomainHost, id: string): void;
|
|
54
|
+
createContextMode(this: WsClientDomainHost, mode: {
|
|
55
|
+
id: string;
|
|
56
|
+
name: string;
|
|
57
|
+
description: string;
|
|
58
|
+
thresholds: {
|
|
59
|
+
warn: number;
|
|
60
|
+
soft: number;
|
|
61
|
+
hard: number;
|
|
62
|
+
};
|
|
63
|
+
preserveK: number;
|
|
64
|
+
eliseThreshold: number;
|
|
65
|
+
}): void;
|
|
66
|
+
updateContextMode(this: WsClientDomainHost, id: string, patch: {
|
|
67
|
+
name?: string | undefined;
|
|
68
|
+
description?: string | undefined;
|
|
69
|
+
thresholds?: {
|
|
70
|
+
warn?: number | undefined;
|
|
71
|
+
soft?: number | undefined;
|
|
72
|
+
hard?: number | undefined;
|
|
73
|
+
} | undefined;
|
|
74
|
+
preserveK?: number | undefined;
|
|
75
|
+
eliseThreshold?: number | undefined;
|
|
76
|
+
}): void;
|
|
77
|
+
deleteContextMode(this: WsClientDomainHost, id: string): void;
|
|
78
|
+
switchAutonomy(this: WsClientDomainHost, mode: string): void;
|
|
79
|
+
updatePrefs(this: WsClientDomainHost, prefs: Record<string, unknown>): void;
|
|
80
|
+
getPrefs(this: WsClientDomainHost): void;
|
|
81
|
+
};
|
|
82
|
+
export declare function installWsClientDomainMethods(ctor: {
|
|
83
|
+
prototype: any;
|
|
84
|
+
}): void;
|
|
85
|
+
export type WsClientDomainMethods = typeof domainMethods;
|
|
86
|
+
//# sourceMappingURL=ws-client-domain-methods.d.ts.map
|
package/dist/lib/ws-client.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { WSClientMessage, WSModelSwitchResult, WSServerMessage, WSUserMessageImage } from '../types';
|
|
2
|
-
import type { ProviderCustomModelWire } from '../types/client-message';
|
|
3
|
-
import type { ContextEditorMessage, ContextEditorRemoval } from '../types/runtime';
|
|
4
2
|
import { type WsClientActionMethods } from './ws-client-actions';
|
|
3
|
+
import { type WsClientDomainMethods } from './ws-client-domain-methods';
|
|
5
4
|
import type { WSSendOptions } from './ws-client-contracts';
|
|
6
5
|
import { type EventHandler, type WsStatus } from './ws-client-utils';
|
|
7
6
|
export type { WSSendOptions } from './ws-client-contracts';
|
|
@@ -148,96 +147,16 @@ declare class WrongStackWebSocketClientBase {
|
|
|
148
147
|
* to a target agent/role. Returns the requestId for response tracking. */
|
|
149
148
|
sendMailboxMessage(opts: WSMailboxSendOptions): string;
|
|
150
149
|
sendAbort(): void;
|
|
151
|
-
getGitInfo(): void;
|
|
152
|
-
/** Request the working-tree change set (file list for the Changes panel). */
|
|
153
|
-
getGitChanges(): void;
|
|
154
|
-
/** Request the before/after content for one changed file. */
|
|
155
|
-
getGitDiff(path: string): void;
|
|
156
150
|
sendConfirm(id: string, decision: 'yes' | 'no' | 'always' | 'deny'): void;
|
|
157
151
|
switchModel(provider: string, model: string, timeoutMs?: number): Promise<WSModelSwitchResult['payload']>;
|
|
158
|
-
getProviderStatus(): void;
|
|
159
|
-
retryProviderModel(providerId: string, model: string): void;
|
|
160
|
-
clearProviderStatus(providerId: string, model: string): void;
|
|
161
|
-
newSession(): void;
|
|
162
152
|
shutdownCodebaseIndexServer(timeoutMs?: number): Promise<Extract<WSServerMessage, {
|
|
163
153
|
type: 'codebase.index.server.shutdown_result';
|
|
164
154
|
}>['payload']>;
|
|
165
|
-
listProviders(): void;
|
|
166
|
-
listProviderModels(providerId: string): void;
|
|
167
|
-
listSavedProviders(): void;
|
|
168
|
-
searchProviderModels(query: string, limit?: number): void;
|
|
169
|
-
addKey(providerId: string, label: string, apiKey: string): void;
|
|
170
|
-
updateKey(providerId: string, label: string, apiKey: string): void;
|
|
171
|
-
deleteKey(providerId: string, label: string): void;
|
|
172
|
-
setActiveKey(providerId: string, label: string): void;
|
|
173
|
-
addProvider(id: string, family: string, baseUrl?: string | undefined, apiKey?: string, models?: string[] | undefined, customModels?: Record<string, ProviderCustomModelWire> | undefined): void;
|
|
174
|
-
removeProvider(providerId: string): void;
|
|
175
|
-
/** Begin a subscription sign-in; progress arrives as `auth.oauth.status`. */
|
|
176
|
-
startOAuth(kind: 'chatgpt' | 'claude' | 'copilot', providerId?: string): void;
|
|
177
|
-
/** Manual-paste fallback for loopback flows (port busy / remote browser). */
|
|
178
|
-
submitOAuthCode(kind: 'chatgpt' | 'claude' | 'copilot', input: string): void;
|
|
179
|
-
/** Cancel an in-flight subscription sign-in. */
|
|
180
|
-
cancelOAuth(kind: 'chatgpt' | 'claude' | 'copilot'): void;
|
|
181
|
-
/** Run a health probe against a saved provider's `/v1/models`. */
|
|
182
|
-
probeProvider(providerId: string, timeoutMs?: number): void;
|
|
183
|
-
/** Remove the saved model allowlist for a provider. */
|
|
184
|
-
clearProviderModels(providerId: string): void;
|
|
185
|
-
/** Restore a previously-cleared model allowlist (pairs with clear). */
|
|
186
|
-
undoProviderClear(providerId: string, previousModels: string[]): void;
|
|
187
|
-
/** Set/update a single custom model definition (ME-3). */
|
|
188
|
-
setCustomModel(providerId: string, modelId: string, customModel: ProviderCustomModelWire): void;
|
|
189
|
-
/** Remove a single custom model entry (ME-3). */
|
|
190
|
-
removeCustomModel(providerId: string, modelId: string): void;
|
|
191
|
-
/** Update a saved provider's wire config (family / baseUrl / envVars / models / customModels). */
|
|
192
|
-
updateProvider(payload: {
|
|
193
|
-
id: string;
|
|
194
|
-
family?: string | undefined;
|
|
195
|
-
baseUrl?: string | undefined;
|
|
196
|
-
envVars?: string[] | undefined;
|
|
197
|
-
models?: string[] | undefined;
|
|
198
|
-
customModels?: Record<string, ProviderCustomModelWire> | undefined;
|
|
199
|
-
}): void;
|
|
200
|
-
clearContext(): void;
|
|
201
|
-
compactContext(aggressive?: boolean): void;
|
|
202
|
-
repairContext(): void;
|
|
203
|
-
openContextEditor(): void;
|
|
204
|
-
validateContextEditor(baseRevision: string, messages: ContextEditorMessage[], removals: ContextEditorRemoval[], allowRepair: boolean): void;
|
|
205
|
-
applyContextEditor(baseRevision: string, messages: ContextEditorMessage[], removals: ContextEditorRemoval[], allowRepair: boolean): void;
|
|
206
|
-
debugContext(options?: WSSendOptions): void;
|
|
207
|
-
listContextModes(): void;
|
|
208
|
-
switchContextMode(id: string): void;
|
|
209
|
-
createContextMode(mode: {
|
|
210
|
-
id: string;
|
|
211
|
-
name: string;
|
|
212
|
-
description: string;
|
|
213
|
-
thresholds: {
|
|
214
|
-
warn: number;
|
|
215
|
-
soft: number;
|
|
216
|
-
hard: number;
|
|
217
|
-
};
|
|
218
|
-
preserveK: number;
|
|
219
|
-
eliseThreshold: number;
|
|
220
|
-
}): void;
|
|
221
|
-
updateContextMode(id: string, patch: {
|
|
222
|
-
name?: string | undefined;
|
|
223
|
-
description?: string | undefined;
|
|
224
|
-
thresholds?: {
|
|
225
|
-
warn?: number | undefined;
|
|
226
|
-
soft?: number | undefined;
|
|
227
|
-
hard?: number | undefined;
|
|
228
|
-
} | undefined;
|
|
229
|
-
preserveK?: number | undefined;
|
|
230
|
-
eliseThreshold?: number | undefined;
|
|
231
|
-
}): void;
|
|
232
|
-
deleteContextMode(id: string): void;
|
|
233
|
-
switchAutonomy(mode: string): void;
|
|
234
|
-
updatePrefs(prefs: Record<string, unknown>): void;
|
|
235
|
-
getPrefs(): void;
|
|
236
155
|
disconnect(): void;
|
|
237
156
|
get isConnected(): boolean;
|
|
238
157
|
get currentSessionId(): string | null;
|
|
239
158
|
}
|
|
240
|
-
export type WrongStackWebSocketClient = WrongStackWebSocketClientBase & WsClientActionMethods;
|
|
159
|
+
export type WrongStackWebSocketClient = WrongStackWebSocketClientBase & WsClientActionMethods & WsClientDomainMethods;
|
|
241
160
|
interface WrongStackWebSocketClientConstructor {
|
|
242
161
|
new (url?: string): WrongStackWebSocketClient;
|
|
243
162
|
readonly prototype: WrongStackWebSocketClient;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { QueuedItem } from './chat-store-types';
|
|
2
|
+
export declare const dispatchedGraceTimers: Map<number, NodeJS.Timeout>;
|
|
3
|
+
export declare function cancelDispatchedGraceTimer(itemId: number): void;
|
|
4
|
+
export declare let enqueueSequence: number;
|
|
5
|
+
export declare function setEnqueueSequence(seq: number): void;
|
|
6
|
+
export declare function nextQueueItemId(): number;
|
|
7
|
+
export declare function normalizeQueuedItem(value: unknown): QueuedItem | null;
|
|
8
|
+
export declare const BTW_DISPATCH_GRACE_MS = 1800;
|
|
9
|
+
//# sourceMappingURL=chat-queue-helpers.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ChatRetentionBudget } from './chat-store-types';
|
|
2
|
+
import type { ChatMessage } from './types.js';
|
|
3
|
+
export declare function dedupeRepeatedBlocks(text: string): string;
|
|
4
|
+
export declare const MAX_CHAT_MESSAGES = 1000;
|
|
5
|
+
export declare const MAX_PERSISTED_MESSAGES = 200;
|
|
6
|
+
export declare const MAX_CHAT_RETAINED_BYTES: number;
|
|
7
|
+
export declare const MAX_CHAT_FIELD_CHARS: number;
|
|
8
|
+
export declare function boundChatField(text: string, maxChars?: number): string;
|
|
9
|
+
export declare function estimateUnknownBytes(value: unknown): number;
|
|
10
|
+
export declare function normalizeRetainedMessage(message: ChatMessage, maxFieldChars: number): ChatMessage;
|
|
11
|
+
export declare function retainedChatMessageBytes(message: ChatMessage): number;
|
|
12
|
+
export declare function retainWebChatMessages(messages: readonly ChatMessage[], budget?: ChatRetentionBudget): ChatMessage[];
|
|
13
|
+
export declare function indexToolMessages(messages: readonly ChatMessage[]): Map<string, string>;
|
|
14
|
+
//# sourceMappingURL=chat-retention.d.ts.map
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { ChatMessage } from './types.js';
|
|
2
|
+
export type QueueMode = 'btw' | 'steer' | 'queue';
|
|
3
|
+
export interface QueuedItem {
|
|
4
|
+
text: string;
|
|
5
|
+
mode: QueueMode;
|
|
6
|
+
addedAt: number;
|
|
7
|
+
itemId: number;
|
|
8
|
+
alreadyDispatched?: boolean | undefined;
|
|
9
|
+
bubbleAdded?: boolean | undefined;
|
|
10
|
+
images?: Array<{
|
|
11
|
+
id: string;
|
|
12
|
+
dataUrl: string;
|
|
13
|
+
mediaType: string;
|
|
14
|
+
bytes: number;
|
|
15
|
+
name?: string | undefined;
|
|
16
|
+
}> | undefined;
|
|
17
|
+
}
|
|
18
|
+
export interface ToolExecution {
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
input?: unknown | undefined;
|
|
22
|
+
output?: string | undefined;
|
|
23
|
+
durationMs?: number | undefined;
|
|
24
|
+
ok: boolean;
|
|
25
|
+
startedAt: number;
|
|
26
|
+
completedAt?: number | undefined;
|
|
27
|
+
}
|
|
28
|
+
export interface ChatRetentionBudget {
|
|
29
|
+
maxMessages?: number;
|
|
30
|
+
maxBytes?: number;
|
|
31
|
+
maxFieldChars?: number;
|
|
32
|
+
}
|
|
33
|
+
export interface ChatState {
|
|
34
|
+
messages: ChatMessage[];
|
|
35
|
+
currentAssistantMessageId: string | null;
|
|
36
|
+
currentToolId: string | null;
|
|
37
|
+
isLoading: boolean;
|
|
38
|
+
abortController: AbortController | null;
|
|
39
|
+
executions: Map<string, ToolExecution>;
|
|
40
|
+
toolMessageIdsByUseId: Map<string, string>;
|
|
41
|
+
queue: QueuedItem[];
|
|
42
|
+
runStart: {
|
|
43
|
+
at: number;
|
|
44
|
+
cost: number;
|
|
45
|
+
} | null;
|
|
46
|
+
refining: boolean;
|
|
47
|
+
pendingRefinement: {
|
|
48
|
+
text: string;
|
|
49
|
+
images: Array<{
|
|
50
|
+
data: string;
|
|
51
|
+
mime: string;
|
|
52
|
+
}>;
|
|
53
|
+
mode: QueueMode;
|
|
54
|
+
} | null;
|
|
55
|
+
thinkingBuffer: string;
|
|
56
|
+
thinkingStartedAt: number | null;
|
|
57
|
+
thinkingLogBuffer: string;
|
|
58
|
+
thinkingLogStartedAt: number | null;
|
|
59
|
+
boundSessionId: string | null;
|
|
60
|
+
addMessage: (msg: Omit<ChatMessage, 'id' | 'timestamp'> & {
|
|
61
|
+
id?: string;
|
|
62
|
+
timestamp?: number;
|
|
63
|
+
}) => string;
|
|
64
|
+
setMessages: (messages: ChatMessage[]) => void;
|
|
65
|
+
updateMessage: (id: string, updates: Partial<ChatMessage>) => void;
|
|
66
|
+
appendToMessage: (id: string, text: string) => void;
|
|
67
|
+
finalizeMessage: (id: string, opts?: {
|
|
68
|
+
final?: boolean;
|
|
69
|
+
}) => void;
|
|
70
|
+
setToolResult: (id: string, result: string, ok: boolean) => void;
|
|
71
|
+
appendToolProgress: (id: string, line: string) => void;
|
|
72
|
+
appendToolProgressLines: (id: string, lines: string[]) => void;
|
|
73
|
+
getToolMessageId: (toolUseId: string) => string | undefined;
|
|
74
|
+
setToolResultByUseId: (toolUseId: string, result: string, ok: boolean) => void;
|
|
75
|
+
appendToolProgressLinesByUseId: (toolUseId: string, lines: string[]) => void;
|
|
76
|
+
setLoading: (loading: boolean) => void;
|
|
77
|
+
setAbortController: (ctrl: AbortController | null) => void;
|
|
78
|
+
clearMessages: () => void;
|
|
79
|
+
setBoundSessionId: (id: string | null) => void;
|
|
80
|
+
setCurrentAssistantMessage: (id: string | null) => void;
|
|
81
|
+
setCurrentToolId: (id: string | null) => void;
|
|
82
|
+
truncateAfter: (id: string) => void;
|
|
83
|
+
addExecution: (exec: ToolExecution) => void;
|
|
84
|
+
updateExecution: (id: string, updates: Partial<ToolExecution>) => void;
|
|
85
|
+
enqueue: (text: string, mode?: QueueMode, images?: QueuedItem['images'], alreadyDispatched?: boolean) => void;
|
|
86
|
+
dequeue: () => QueuedItem | null;
|
|
87
|
+
dequeueDrainable: () => QueuedItem | null;
|
|
88
|
+
removeQueued: (idx: number) => void;
|
|
89
|
+
clearQueue: () => void;
|
|
90
|
+
setRefining: (v: boolean) => void;
|
|
91
|
+
setPendingRefinement: (text: string | null, images?: Array<{
|
|
92
|
+
data: string;
|
|
93
|
+
mime: string;
|
|
94
|
+
}>, mode?: QueueMode) => void;
|
|
95
|
+
removeMessage: (id: string) => void;
|
|
96
|
+
updateLastUserMessage: (text: string) => void;
|
|
97
|
+
setRunStart: (s: {
|
|
98
|
+
at: number;
|
|
99
|
+
cost: number;
|
|
100
|
+
} | null) => void;
|
|
101
|
+
appendThinking: (text: string) => void;
|
|
102
|
+
clearThinking: () => void;
|
|
103
|
+
flushThinkingLog: (iteration: number) => void;
|
|
104
|
+
clearThinkingLog: () => void;
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=chat-store-types.d.ts.map
|
|
@@ -1,185 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* queue → SENT → leave-screen transition instead of the chip getting
|
|
8
|
-
* stuck until the next `run.result` lands. UX spec (2026-08): "shortly
|
|
9
|
-
* after it is processed, the message should leave my screen".
|
|
10
|
-
*/
|
|
11
|
-
export declare const BTW_DISPATCH_GRACE_MS = 1800;
|
|
12
|
-
export declare const MAX_CHAT_FIELD_CHARS: number;
|
|
13
|
-
interface ChatRetentionBudget {
|
|
14
|
-
maxMessages?: number;
|
|
15
|
-
maxBytes?: number;
|
|
16
|
-
maxFieldChars?: number;
|
|
17
|
-
}
|
|
18
|
-
export declare function boundChatField(text: string, maxChars?: number): string;
|
|
19
|
-
/** Count limits alone do not protect against giant tool/replay/vision rows. */
|
|
20
|
-
export declare function retainWebChatMessages(messages: readonly ChatMessage[], budget?: ChatRetentionBudget): ChatMessage[];
|
|
21
|
-
/** Submit mode for a queued/typed message. Drives whether the message
|
|
22
|
-
* interrupts the running agent (`steer`), rides alongside without
|
|
23
|
-
* interrupting (`btw`), or is held for after the run completes (`queue`). */
|
|
24
|
-
export type QueueMode = 'btw' | 'steer' | 'queue';
|
|
25
|
-
/** One entry in the message queue — the text plus how it was added.
|
|
26
|
-
* `addedAt` powers the optional sort-by-newest toggle.
|
|
27
|
-
* `itemId` is a monotonic per-store counter stamped by `enqueue`;
|
|
28
|
-
* the dispatched-chip grace-timer map and queue-filter operations
|
|
29
|
-
* key on it instead of `addedAt` so two enqueues sharing the same
|
|
30
|
-
* millisecond cannot cross-cancel each other. */
|
|
31
|
-
export interface QueuedItem {
|
|
32
|
-
text: string;
|
|
33
|
-
mode: QueueMode;
|
|
34
|
-
addedAt: number;
|
|
35
|
-
itemId: number;
|
|
36
|
-
/** True once a `btw` item has already been wire-sent via the mailbox
|
|
37
|
-
* (immediate mid-run dispatch). The run.result drain must skip re-sending
|
|
38
|
-
* these — they remain in the queue only as a visible "dispatched" chip. */
|
|
39
|
-
alreadyDispatched?: boolean | undefined;
|
|
40
|
-
/** Idempotency latch for the drain path. Set by
|
|
41
|
-
* `addBubbleFor` in chat-handlers.handleRunResult (drain emits
|
|
42
|
-
* a bubble for the popped front chip) and by `dequeueDrainable`
|
|
43
|
-
* (drain emits bubbles for every leading dispatched chip it skips
|
|
44
|
-
* past). The grace timer callback in `enqueue` *reads* this flag
|
|
45
|
-
* to gate bubble emission (`target.bubbleAdded !== true`) — without
|
|
46
|
-
* this gate, a second `run.result` landing inside the grace window
|
|
47
|
-
* would call `addBubbleFor(front)` a second time and emit a duplicate
|
|
48
|
-
* user bubble for the same chip. Reset implicitly on a fresh
|
|
49
|
-
* `enqueue` (the chip is constructed with `bubbleAdded` undefined).
|
|
50
|
-
* The flag is the idempotency latch for the drain path; the timer
|
|
51
|
-
* path reads it but does not write it. */
|
|
52
|
-
bubbleAdded?: boolean | undefined;
|
|
53
|
-
/** Image attachments riding with the queued message. Kept as full data
|
|
54
|
-
* URLs so the drain path can rebuild the wire payload + local bubble. */
|
|
55
|
-
images?: Array<{
|
|
56
|
-
id: string;
|
|
57
|
-
dataUrl: string;
|
|
58
|
-
mediaType: string;
|
|
59
|
-
bytes: number;
|
|
60
|
-
name?: string | undefined;
|
|
61
|
-
}> | undefined;
|
|
62
|
-
}
|
|
63
|
-
interface ChatState {
|
|
64
|
-
messages: ChatMessage[];
|
|
65
|
-
currentAssistantMessageId: string | null;
|
|
66
|
-
currentToolId: string | null;
|
|
67
|
-
isLoading: boolean;
|
|
68
|
-
abortController: AbortController | null;
|
|
69
|
-
executions: Map<string, ToolExecution>;
|
|
70
|
-
toolMessageIdsByUseId: Map<string, string>;
|
|
71
|
-
/** Messages typed while the agent was running. Drained one-at-a-time
|
|
72
|
-
* after run.result lands so the user can stack up follow-ups without
|
|
73
|
-
* waiting for each turn to finish. Each item carries the submit mode
|
|
74
|
-
* so the queue panel can render the appropriate label. */
|
|
75
|
-
queue: QueuedItem[];
|
|
76
|
-
/** Snapshot taken at the start of the current run (first iteration.started
|
|
77
|
-
* after idle). Used by run.result to compute the per-turn summary —
|
|
78
|
-
* duration is now-at minus this `at`, cost delta is the difference
|
|
79
|
-
* between the session's current cost and the cost captured here. Null
|
|
80
|
-
* while idle. */
|
|
81
|
-
runStart: {
|
|
82
|
-
at: number;
|
|
83
|
-
cost: number;
|
|
84
|
-
} | null;
|
|
85
|
-
/** True while a queued message is being refined (goal-refiner running).
|
|
86
|
-
* The UI shows a "Refining..." indicator instead of "loading". */
|
|
87
|
-
refining: boolean;
|
|
88
|
-
/** Text and images of a message being refined before entering the queue.
|
|
89
|
-
* Set by ChatInput.sendMsg before calling model.refine; consumed by
|
|
90
|
-
* handleModelRefineResult to open the RefinePanel for user approval.
|
|
91
|
-
* Null when idle or refinement completed. */
|
|
92
|
-
pendingRefinement: {
|
|
93
|
-
text: string;
|
|
94
|
-
images: Array<{
|
|
95
|
-
data: string;
|
|
96
|
-
mime: string;
|
|
97
|
-
}>;
|
|
98
|
-
mode: QueueMode;
|
|
99
|
-
} | null;
|
|
100
|
-
/** Transient extended-thinking buffer. Populated by provider.thinking_delta
|
|
101
|
-
* events and shown as a soft, ephemeral bubble below the chat tail while
|
|
102
|
-
* the model is reasoning. Cleared the moment the model produces user-
|
|
103
|
-
* facing output (text_delta) or starts a tool — and at provider.response /
|
|
104
|
-
* run.result. The archive buffer below is what eventually lands in
|
|
105
|
-
* `messages`; this live buffer is only for the temporary bubble. */
|
|
106
|
-
thinkingBuffer: string;
|
|
107
|
-
/** Wall-clock ms when the current thinking burst started, for the chip's
|
|
108
|
-
* elapsed timer. Reset alongside `thinkingBuffer`. */
|
|
109
|
-
thinkingStartedAt: number | null;
|
|
110
|
-
/** Full thinking text accumulated for the current iteration. Unlike the
|
|
111
|
-
* live chip buffer, this survives text/tool events until iteration end. */
|
|
112
|
-
thinkingLogBuffer: string;
|
|
113
|
-
/** Wall-clock ms when the archived thinking text for this iteration began. */
|
|
114
|
-
thinkingLogStartedAt: number | null;
|
|
115
|
-
/** Id of the session whose transcript is currently in `messages`. The
|
|
116
|
-
* verifier view compares this to the server-reported active session id
|
|
117
|
-
* on every `session.start` — a mismatch means the user switched sessions
|
|
118
|
-
* without an explicit clear, and we drop the local transcript rather
|
|
119
|
-
* than render it. Persisted alongside `messages` so the cross-session
|
|
120
|
-
* bleed check survives F5. */
|
|
121
|
-
boundSessionId: string | null;
|
|
122
|
-
addMessage: (msg: Omit<ChatMessage, 'id' | 'timestamp'> & {
|
|
123
|
-
timestamp?: number;
|
|
124
|
-
}) => string;
|
|
125
|
-
setMessages: (messages: ChatMessage[]) => void;
|
|
126
|
-
updateMessage: (id: string, updates: Partial<ChatMessage>) => void;
|
|
127
|
-
appendToMessage: (id: string, text: string) => void;
|
|
128
|
-
/** `opts.final` — whether this finalize ends the turn. Pass `false` when the
|
|
129
|
-
* message is being closed because a tool call follows: the `<nextsteps>`
|
|
130
|
-
* block is still stripped from the body, but the parsed steps are not
|
|
131
|
-
* persisted, so no suggestion bar appears mid-turn. Defaults to `true`. */
|
|
132
|
-
finalizeMessage: (id: string, opts?: {
|
|
133
|
-
final?: boolean;
|
|
134
|
-
}) => void;
|
|
135
|
-
setToolResult: (id: string, result: string, ok: boolean) => void;
|
|
136
|
-
appendToolProgress: (id: string, line: string) => void;
|
|
137
|
-
appendToolProgressLines: (id: string, lines: string[]) => void;
|
|
138
|
-
getToolMessageId: (toolUseId: string) => string | undefined;
|
|
139
|
-
setToolResultByUseId: (toolUseId: string, result: string, ok: boolean) => void;
|
|
140
|
-
appendToolProgressLinesByUseId: (toolUseId: string, lines: string[]) => void;
|
|
141
|
-
setLoading: (loading: boolean) => void;
|
|
142
|
-
setAbortController: (ctrl: AbortController | null) => void;
|
|
143
|
-
clearMessages: () => void;
|
|
144
|
-
/** Bind the current transcript to a session id. See boundSessionId above
|
|
145
|
-
* for why this is a separate action. */
|
|
146
|
-
setBoundSessionId: (id: string | null) => void;
|
|
147
|
-
setCurrentAssistantMessage: (id: string | null) => void;
|
|
148
|
-
setCurrentToolId: (id: string | null) => void;
|
|
149
|
-
truncateAfter: (id: string) => void;
|
|
150
|
-
addExecution: (exec: ToolExecution) => void;
|
|
151
|
-
updateExecution: (id: string, updates: Partial<ToolExecution>) => void;
|
|
152
|
-
enqueue: (text: string, mode?: QueueMode, images?: QueuedItem['images'], alreadyDispatched?: boolean) => void;
|
|
153
|
-
dequeue: () => QueuedItem | null;
|
|
154
|
-
dequeueDrainable: () => QueuedItem | null;
|
|
155
|
-
removeQueued: (idx: number) => void;
|
|
156
|
-
clearQueue: () => void;
|
|
157
|
-
setRefining: (v: boolean) => void;
|
|
158
|
-
setPendingRefinement: (text: string | null, images?: Array<{
|
|
159
|
-
data: string;
|
|
160
|
-
mime: string;
|
|
161
|
-
}>, mode?: QueueMode) => void;
|
|
162
|
-
removeMessage: (id: string) => void;
|
|
163
|
-
updateLastUserMessage: (text: string) => void;
|
|
164
|
-
setRunStart: (s: {
|
|
165
|
-
at: number;
|
|
166
|
-
cost: number;
|
|
167
|
-
} | null) => void;
|
|
168
|
-
appendThinking: (text: string) => void;
|
|
169
|
-
clearThinking: () => void;
|
|
170
|
-
flushThinkingLog: (iteration: number) => void;
|
|
171
|
-
clearThinkingLog: () => void;
|
|
172
|
-
}
|
|
173
|
-
interface ToolExecution {
|
|
174
|
-
id: string;
|
|
175
|
-
name: string;
|
|
176
|
-
input?: unknown | undefined;
|
|
177
|
-
output?: string | undefined;
|
|
178
|
-
durationMs?: number | undefined;
|
|
179
|
-
ok: boolean;
|
|
180
|
-
startedAt: number;
|
|
181
|
-
completedAt?: number | undefined;
|
|
182
|
-
}
|
|
1
|
+
import type { ChatState } from './chat-store-types';
|
|
2
|
+
export declare const MAX_CHAT_MESSAGES = 1000;
|
|
3
|
+
export declare const MAX_PERSISTED_MESSAGES = 200;
|
|
4
|
+
export * from './chat-store-types';
|
|
5
|
+
export { boundChatField, dedupeRepeatedBlocks, indexToolMessages, MAX_CHAT_FIELD_CHARS, MAX_CHAT_RETAINED_BYTES, retainWebChatMessages, } from './chat-retention';
|
|
6
|
+
export { BTW_DISPATCH_GRACE_MS } from './chat-queue-helpers';
|
|
183
7
|
export declare const useChatStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<ChatState>, "persist" | "setState"> & {
|
|
184
8
|
setState(partial: ChatState | Partial<ChatState> | ((state: ChatState) => ChatState | Partial<ChatState>), replace?: false | undefined): unknown;
|
|
185
9
|
setState(state: ChatState | ((state: ChatState) => ChatState), replace: true): unknown;
|
|
@@ -203,5 +27,4 @@ export declare const useChatStore: import("zustand").UseBoundStore<Omit<import("
|
|
|
203
27
|
}, unknown>>;
|
|
204
28
|
};
|
|
205
29
|
}>;
|
|
206
|
-
export {};
|
|
207
30
|
//# sourceMappingURL=chat-store.d.ts.map
|
|
@@ -3,6 +3,10 @@ export interface TreeNode {
|
|
|
3
3
|
path: string;
|
|
4
4
|
type: 'file' | 'directory';
|
|
5
5
|
children?: TreeNode[];
|
|
6
|
+
/** File size in bytes (files only; undefined for directories). */
|
|
7
|
+
size?: number;
|
|
8
|
+
/** Last-modified timestamp in milliseconds since epoch. */
|
|
9
|
+
lastModified?: number;
|
|
6
10
|
}
|
|
7
11
|
export interface OpenFile {
|
|
8
12
|
path: string;
|
|
@@ -12,7 +16,7 @@ export interface OpenFile {
|
|
|
12
16
|
/** The content last known to be on disk — used for dirty detection. */
|
|
13
17
|
savedContent: string;
|
|
14
18
|
}
|
|
15
|
-
interface FileStoreState {
|
|
19
|
+
export interface FileStoreState {
|
|
16
20
|
/** The project root path as reported by the server. */
|
|
17
21
|
projectRoot: string;
|
|
18
22
|
/** The directory tree structure. */
|
|
@@ -25,16 +29,81 @@ interface FileStoreState {
|
|
|
25
29
|
treeLoading: boolean;
|
|
26
30
|
/** Last error message, if any. */
|
|
27
31
|
error: string | null;
|
|
32
|
+
/** Target line to jump to in the active editor. */
|
|
33
|
+
targetLine: {
|
|
34
|
+
line: number;
|
|
35
|
+
col?: number | undefined;
|
|
36
|
+
} | null;
|
|
28
37
|
setTree: (root: string, tree: TreeNode[]) => void;
|
|
29
38
|
openFile: (filePath: string, content: string) => void;
|
|
30
39
|
closeFile: (filePath: string) => void;
|
|
31
40
|
setActiveFile: (filePath: string | null) => void;
|
|
41
|
+
jumpToLine: (line: number, col?: number) => void;
|
|
42
|
+
clearTargetLine: () => void;
|
|
32
43
|
updateContent: (filePath: string, content: string) => void;
|
|
33
44
|
/** Mark a file as saved (synced with disk). */
|
|
34
45
|
markSaved: (filePath: string) => void;
|
|
35
46
|
setTreeLoading: (loading: boolean) => void;
|
|
36
47
|
setError: (error: string | null) => void;
|
|
48
|
+
/** Drop all open tabs (used when the server switches to a different project). */
|
|
49
|
+
clearOpenTabs: () => void;
|
|
50
|
+
/**
|
|
51
|
+
* Canonical absolute project root as reported by the server environment
|
|
52
|
+
* (working_dir.changed / session env). Distinct from `projectRoot`, which
|
|
53
|
+
* holds the tree-response display label and can be a cwd-relative label
|
|
54
|
+
* ("subdir", ".") when browsing a subdirectory — never use that for
|
|
55
|
+
* identity comparisons.
|
|
56
|
+
*/
|
|
57
|
+
projectIdentity: string;
|
|
58
|
+
/** Record the canonical absolute project root (env events only). */
|
|
59
|
+
setProjectIdentity: (root: string) => void;
|
|
60
|
+
/** Paths whose rehydrated stub content is currently being fetched. */
|
|
61
|
+
hydratingPaths: ReadonlySet<string>;
|
|
62
|
+
/**
|
|
63
|
+
* Apply fetched content to a rehydrated stub tab. Only applies while the
|
|
64
|
+
* path is still hydrating AND the tab is still a pristine stub — never
|
|
65
|
+
* overwrites content the user has started editing, never steals focus.
|
|
66
|
+
* Returns true when the content was applied.
|
|
67
|
+
*/
|
|
68
|
+
hydrateFileContent: (filePath: string, content: string) => boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Handle a failed hydration read (file deleted or renamed on disk while
|
|
71
|
+
* the page was closed). Removes the path from hydration tracking and
|
|
72
|
+
* closes the tab when it is still a pristine stub — leaving it open would
|
|
73
|
+
* let the next save resurrect a deleted file. A tab the user has started
|
|
74
|
+
* editing is kept; its save recreates the file intentionally.
|
|
75
|
+
*/
|
|
76
|
+
hydrateFileFailed: (filePath: string) => void;
|
|
37
77
|
}
|
|
38
|
-
|
|
39
|
-
export {
|
|
78
|
+
/** Shape written to localStorage — tabs are paths only, never content. */
|
|
79
|
+
export interface PersistedFileStoreState {
|
|
80
|
+
openFilePaths: string[];
|
|
81
|
+
activeFilePath: string | null;
|
|
82
|
+
/** Canonical absolute project root (env identity), not the display label. */
|
|
83
|
+
projectIdentity: string;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Merge persisted (path-only) tab state into the live store on rehydration.
|
|
87
|
+
*
|
|
88
|
+
* Tabs are restored as empty-content stubs: trusting cached content across a
|
|
89
|
+
* reload would silently overwrite changes made on disk while the page was
|
|
90
|
+
* closed the next time the user saves. The empty stubs are re-fetched via
|
|
91
|
+
* `files.read` once the server environment is known (see
|
|
92
|
+
* `reconcileFileTabsAfterEnvChange` in the ws handlers). Exported as a pure
|
|
93
|
+
* function so the merge contract is unit-testable without zustand internals.
|
|
94
|
+
*/
|
|
95
|
+
export declare function mergePersistedFileStore(persisted: unknown, current: FileStoreState): FileStoreState;
|
|
96
|
+
export declare const useFileStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<FileStoreState>, "persist" | "setState"> & {
|
|
97
|
+
setState(partial: FileStoreState | Partial<FileStoreState> | ((state: FileStoreState) => FileStoreState | Partial<FileStoreState>), replace?: false | undefined): unknown;
|
|
98
|
+
setState(state: FileStoreState | ((state: FileStoreState) => FileStoreState), replace: true): unknown;
|
|
99
|
+
persist: {
|
|
100
|
+
setOptions: (options: Partial<import("zustand/middleware").PersistOptions<FileStoreState, PersistedFileStoreState, unknown>>) => void;
|
|
101
|
+
clearStorage: () => void;
|
|
102
|
+
rehydrate: () => Promise<void> | void;
|
|
103
|
+
hasHydrated: () => boolean;
|
|
104
|
+
onHydrate: (fn: (state: FileStoreState) => void) => () => void;
|
|
105
|
+
onFinishHydration: (fn: (state: FileStoreState) => void) => () => void;
|
|
106
|
+
getOptions: () => Partial<import("zustand/middleware").PersistOptions<FileStoreState, PersistedFileStoreState, unknown>>;
|
|
107
|
+
};
|
|
108
|
+
}>;
|
|
40
109
|
//# sourceMappingURL=file-store.d.ts.map
|