@nuvin/components 0.1.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/MarkdownBody-XBNXK6P4.js +121 -0
- package/dist/app/App.d.ts +24 -0
- package/dist/app/App.d.ts.map +1 -0
- package/dist/app/AppShell.d.ts +13 -0
- package/dist/app/AppShell.d.ts.map +1 -0
- package/dist/app/Header.d.ts +11 -0
- package/dist/app/Header.d.ts.map +1 -0
- package/dist/app/SessionSubHeader.d.ts +15 -0
- package/dist/app/SessionSubHeader.d.ts.map +1 -0
- package/dist/app/WorkspacePanel.d.ts +15 -0
- package/dist/app/WorkspacePanel.d.ts.map +1 -0
- package/dist/app/app-shell.styles.d.ts +11 -0
- package/dist/app/app-shell.styles.d.ts.map +1 -0
- package/dist/app/route-components.d.ts +46 -0
- package/dist/app/route-components.d.ts.map +1 -0
- package/dist/app/routes.d.ts +11 -0
- package/dist/app/routes.d.ts.map +1 -0
- package/dist/assets/fonts/inter-latin-400-normal.woff2 +0 -0
- package/dist/assets/fonts/inter-latin-500-normal.woff2 +0 -0
- package/dist/assets/fonts/inter-latin-600-normal.woff2 +0 -0
- package/dist/assets/fonts/inter-latin-700-normal.woff2 +0 -0
- package/dist/assets/fonts/jetbrains-mono-latin-400-normal.woff2 +0 -0
- package/dist/assets/fonts/jetbrains-mono-latin-500-normal.woff2 +0 -0
- package/dist/assets/fonts/jetbrains-mono-latin-600-normal.woff2 +0 -0
- package/dist/assets/fonts/jetbrains-mono-latin-700-normal.woff2 +0 -0
- package/dist/chunk-TLWTUPOJ.js +10 -0
- package/dist/features/account/auth-gate.d.ts +17 -0
- package/dist/features/account/auth-gate.d.ts.map +1 -0
- package/dist/features/account/index.d.ts +3 -0
- package/dist/features/account/index.d.ts.map +1 -0
- package/dist/features/composer/Composer.d.ts +39 -0
- package/dist/features/composer/Composer.d.ts.map +1 -0
- package/dist/features/composer/QuestionCard.d.ts +21 -0
- package/dist/features/composer/QuestionCard.d.ts.map +1 -0
- package/dist/features/composer/context-status.d.ts +6 -0
- package/dist/features/composer/context-status.d.ts.map +1 -0
- package/dist/features/composer/index.d.ts +2 -0
- package/dist/features/composer/index.d.ts.map +1 -0
- package/dist/features/config/CloudProviderSetup.d.ts +12 -0
- package/dist/features/config/CloudProviderSetup.d.ts.map +1 -0
- package/dist/features/config/OnboardingGate.d.ts +22 -0
- package/dist/features/config/OnboardingGate.d.ts.map +1 -0
- package/dist/features/config/ProviderManager.d.ts +15 -0
- package/dist/features/config/ProviderManager.d.ts.map +1 -0
- package/dist/features/config/WorkspaceManager.d.ts +13 -0
- package/dist/features/config/WorkspaceManager.d.ts.map +1 -0
- package/dist/features/config/config-client.d.ts +49 -0
- package/dist/features/config/config-client.d.ts.map +1 -0
- package/dist/features/config/index.d.ts +10 -0
- package/dist/features/config/index.d.ts.map +1 -0
- package/dist/features/config/protocol-config-client.d.ts +22 -0
- package/dist/features/config/protocol-config-client.d.ts.map +1 -0
- package/dist/features/config/rest-config-client.d.ts +4 -0
- package/dist/features/config/rest-config-client.d.ts.map +1 -0
- package/dist/features/config/use-provider-status.d.ts +8 -0
- package/dist/features/config/use-provider-status.d.ts.map +1 -0
- package/dist/features/daemon-switcher/DaemonAvatar.d.ts +16 -0
- package/dist/features/daemon-switcher/DaemonAvatar.d.ts.map +1 -0
- package/dist/features/daemon-switcher/DaemonRail.d.ts +18 -0
- package/dist/features/daemon-switcher/DaemonRail.d.ts.map +1 -0
- package/dist/features/daemon-switcher/DaemonSwitcher.d.ts +17 -0
- package/dist/features/daemon-switcher/DaemonSwitcher.d.ts.map +1 -0
- package/dist/features/daemon-switcher/index.d.ts +7 -0
- package/dist/features/daemon-switcher/index.d.ts.map +1 -0
- package/dist/features/diff/DiffView.d.ts +13 -0
- package/dist/features/diff/DiffView.d.ts.map +1 -0
- package/dist/features/diff/diff.d.ts +23 -0
- package/dist/features/diff/diff.d.ts.map +1 -0
- package/dist/features/diff/index.d.ts +4 -0
- package/dist/features/diff/index.d.ts.map +1 -0
- package/dist/features/launcher/SessionItem.d.ts +12 -0
- package/dist/features/launcher/SessionItem.d.ts.map +1 -0
- package/dist/features/launcher/SessionSidebar.d.ts +24 -0
- package/dist/features/launcher/SessionSidebar.d.ts.map +1 -0
- package/dist/features/launcher/index.d.ts +5 -0
- package/dist/features/launcher/index.d.ts.map +1 -0
- package/dist/features/launcher/session-sidebar-model.d.ts +77 -0
- package/dist/features/launcher/session-sidebar-model.d.ts.map +1 -0
- package/dist/features/launcher/session-status.d.ts +9 -0
- package/dist/features/launcher/session-status.d.ts.map +1 -0
- package/dist/features/launcher/use-daemon-history.d.ts +17 -0
- package/dist/features/launcher/use-daemon-history.d.ts.map +1 -0
- package/dist/features/new-session/StartScreen.d.ts +31 -0
- package/dist/features/new-session/StartScreen.d.ts.map +1 -0
- package/dist/features/new-session/index.d.ts +3 -0
- package/dist/features/new-session/index.d.ts.map +1 -0
- package/dist/features/new-session/start-screen.styles.d.ts +46 -0
- package/dist/features/new-session/start-screen.styles.d.ts.map +1 -0
- package/dist/features/picker/Picker.d.ts +23 -0
- package/dist/features/picker/Picker.d.ts.map +1 -0
- package/dist/features/picker/PickerSession.d.ts +8 -0
- package/dist/features/picker/PickerSession.d.ts.map +1 -0
- package/dist/features/picker/index.d.ts +6 -0
- package/dist/features/picker/index.d.ts.map +1 -0
- package/dist/features/picker/picker-model.d.ts +31 -0
- package/dist/features/picker/picker-model.d.ts.map +1 -0
- package/dist/features/tabs/Tab.d.ts +8 -0
- package/dist/features/tabs/Tab.d.ts.map +1 -0
- package/dist/features/tabs/TabBar.d.ts +7 -0
- package/dist/features/tabs/TabBar.d.ts.map +1 -0
- package/dist/features/tabs/index.d.ts +8 -0
- package/dist/features/tabs/index.d.ts.map +1 -0
- package/dist/features/tabs/tab-model.d.ts +39 -0
- package/dist/features/tabs/tab-model.d.ts.map +1 -0
- package/dist/features/tabs/tab.styles.d.ts +9 -0
- package/dist/features/tabs/tab.styles.d.ts.map +1 -0
- package/dist/features/theme/ThemeToggle.d.ts +8 -0
- package/dist/features/theme/ThemeToggle.d.ts.map +1 -0
- package/dist/features/theme/index.d.ts +5 -0
- package/dist/features/theme/index.d.ts.map +1 -0
- package/dist/features/theme/themes.d.ts +13 -0
- package/dist/features/theme/themes.d.ts.map +1 -0
- package/dist/features/theme/use-theme-mode.d.ts +3 -0
- package/dist/features/theme/use-theme-mode.d.ts.map +1 -0
- package/dist/features/transcript/components/AssistantMessage.d.ts +21 -0
- package/dist/features/transcript/components/AssistantMessage.d.ts.map +1 -0
- package/dist/features/transcript/components/ChildMessagesContext.d.ts +27 -0
- package/dist/features/transcript/components/ChildMessagesContext.d.ts.map +1 -0
- package/dist/features/transcript/components/CodeBlock.d.ts +5 -0
- package/dist/features/transcript/components/CodeBlock.d.ts.map +1 -0
- package/dist/features/transcript/components/MarkdownBody.d.ts +17 -0
- package/dist/features/transcript/components/MarkdownBody.d.ts.map +1 -0
- package/dist/features/transcript/components/MessageList.d.ts +24 -0
- package/dist/features/transcript/components/MessageList.d.ts.map +1 -0
- package/dist/features/transcript/components/NestedMessageListContext.d.ts +18 -0
- package/dist/features/transcript/components/NestedMessageListContext.d.ts.map +1 -0
- package/dist/features/transcript/components/ProcessingIndicator.d.ts +5 -0
- package/dist/features/transcript/components/ProcessingIndicator.d.ts.map +1 -0
- package/dist/features/transcript/components/styles-test-utils.d.ts +6 -0
- package/dist/features/transcript/components/styles-test-utils.d.ts.map +1 -0
- package/dist/features/transcript/components/tool-display/BareLine.d.ts +14 -0
- package/dist/features/transcript/components/tool-display/BareLine.d.ts.map +1 -0
- package/dist/features/transcript/components/tool-display/Card.d.ts +31 -0
- package/dist/features/transcript/components/tool-display/Card.d.ts.map +1 -0
- package/dist/features/transcript/components/tool-display/Turn.d.ts +15 -0
- package/dist/features/transcript/components/tool-display/Turn.d.ts.map +1 -0
- package/dist/features/transcript/components/tool-display/index.d.ts +3 -0
- package/dist/features/transcript/components/tool-display/index.d.ts.map +1 -0
- package/dist/features/transcript/components/tool-display/renderers/AskUserRenderer.d.ts +4 -0
- package/dist/features/transcript/components/tool-display/renderers/AskUserRenderer.d.ts.map +1 -0
- package/dist/features/transcript/components/tool-display/renderers/AssignTaskRenderer.d.ts +9 -0
- package/dist/features/transcript/components/tool-display/renderers/AssignTaskRenderer.d.ts.map +1 -0
- package/dist/features/transcript/components/tool-display/renderers/BareToolRenderer.d.ts +8 -0
- package/dist/features/transcript/components/tool-display/renderers/BareToolRenderer.d.ts.map +1 -0
- package/dist/features/transcript/components/tool-display/renderers/BashRenderer.d.ts +11 -0
- package/dist/features/transcript/components/tool-display/renderers/BashRenderer.d.ts.map +1 -0
- package/dist/features/transcript/components/tool-display/renderers/FileEditRenderer.d.ts +4 -0
- package/dist/features/transcript/components/tool-display/renderers/FileEditRenderer.d.ts.map +1 -0
- package/dist/features/transcript/components/tool-display/renderers/FileNewRenderer.d.ts +4 -0
- package/dist/features/transcript/components/tool-display/renderers/FileNewRenderer.d.ts.map +1 -0
- package/dist/features/transcript/components/tool-display/renderers/TodoWriteRenderer.d.ts +4 -0
- package/dist/features/transcript/components/tool-display/renderers/TodoWriteRenderer.d.ts.map +1 -0
- package/dist/features/transcript/components/tool-display/renderers/UnknownRenderer.d.ts +4 -0
- package/dist/features/transcript/components/tool-display/renderers/UnknownRenderer.d.ts.map +1 -0
- package/dist/features/transcript/components/tool-display/tool-icon.d.ts +4 -0
- package/dist/features/transcript/components/tool-display/tool-icon.d.ts.map +1 -0
- package/dist/features/transcript/components/tool-display/tool-meta.d.ts +9 -0
- package/dist/features/transcript/components/tool-display/tool-meta.d.ts.map +1 -0
- package/dist/features/transcript/components/tool-display/tool-variants.d.ts +8 -0
- package/dist/features/transcript/components/tool-display/tool-variants.d.ts.map +1 -0
- package/dist/features/transcript/components/tool-display/types.d.ts +11 -0
- package/dist/features/transcript/components/tool-display/types.d.ts.map +1 -0
- package/dist/features/transcript/hooks/use-live-tick.d.ts +8 -0
- package/dist/features/transcript/hooks/use-live-tick.d.ts.map +1 -0
- package/dist/features/transcript/hooks/use-revealed-text.d.ts +28 -0
- package/dist/features/transcript/hooks/use-revealed-text.d.ts.map +1 -0
- package/dist/features/transcript/index.d.ts +6 -0
- package/dist/features/transcript/index.d.ts.map +1 -0
- package/dist/features/transcript/lib/message-groups.d.ts +9 -0
- package/dist/features/transcript/lib/message-groups.d.ts.map +1 -0
- package/dist/features/transcript/lib/preview-lines.d.ts +27 -0
- package/dist/features/transcript/lib/preview-lines.d.ts.map +1 -0
- package/dist/features/transcript/lib/processing-state.d.ts +16 -0
- package/dist/features/transcript/lib/processing-state.d.ts.map +1 -0
- package/dist/features/transcript/lib/reasoning-label.d.ts +9 -0
- package/dist/features/transcript/lib/reasoning-label.d.ts.map +1 -0
- package/dist/features/transcript/lib/tool-format-utils.d.ts +29 -0
- package/dist/features/transcript/lib/tool-format-utils.d.ts.map +1 -0
- package/dist/features/transcript/lib/tool-formatters.d.ts +45 -0
- package/dist/features/transcript/lib/tool-formatters.d.ts.map +1 -0
- package/dist/features/transcript/lib/tool-status.d.ts +39 -0
- package/dist/features/transcript/lib/tool-status.d.ts.map +1 -0
- package/dist/features/transcript/lib/transcript-rows.d.ts +15 -0
- package/dist/features/transcript/lib/transcript-rows.d.ts.map +1 -0
- package/dist/features/transcript/lib/turn-groups.d.ts +20 -0
- package/dist/features/transcript/lib/turn-groups.d.ts.map +1 -0
- package/dist/features/transcript/lib/turn-summary.d.ts +11 -0
- package/dist/features/transcript/lib/turn-summary.d.ts.map +1 -0
- package/dist/features/workflows/WorkflowsPanel.d.ts +11 -0
- package/dist/features/workflows/WorkflowsPanel.d.ts.map +1 -0
- package/dist/features/workflows/index.d.ts +3 -0
- package/dist/features/workflows/index.d.ts.map +1 -0
- package/dist/index.d.ts +45 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7877 -0
- package/dist/session/client-commands.d.ts +26 -0
- package/dist/session/client-commands.d.ts.map +1 -0
- package/dist/session/commands.d.ts +9 -0
- package/dist/session/commands.d.ts.map +1 -0
- package/dist/session/directory-source.d.ts +101 -0
- package/dist/session/directory-source.d.ts.map +1 -0
- package/dist/session/directory-status.d.ts +8 -0
- package/dist/session/directory-status.d.ts.map +1 -0
- package/dist/session/directory.d.ts +41 -0
- package/dist/session/directory.d.ts.map +1 -0
- package/dist/session/index.d.ts +16 -0
- package/dist/session/index.d.ts.map +1 -0
- package/dist/session/snapshot.d.ts +11 -0
- package/dist/session/snapshot.d.ts.map +1 -0
- package/dist/session/store.d.ts +96 -0
- package/dist/session/store.d.ts.map +1 -0
- package/dist/session/tool-timing.d.ts +14 -0
- package/dist/session/tool-timing.d.ts.map +1 -0
- package/dist/session/transport.d.ts +187 -0
- package/dist/session/transport.d.ts.map +1 -0
- package/dist/session/types.d.ts +73 -0
- package/dist/session/types.d.ts.map +1 -0
- package/dist/session/use-directory.d.ts +54 -0
- package/dist/session/use-directory.d.ts.map +1 -0
- package/dist/session/use-session-transport.d.ts +10 -0
- package/dist/session/use-session-transport.d.ts.map +1 -0
- package/dist/shared/hooks/use-stick-to-bottom-sentinel.d.ts +64 -0
- package/dist/shared/hooks/use-stick-to-bottom-sentinel.d.ts.map +1 -0
- package/dist/shared/lib/navigation.d.ts +20 -0
- package/dist/shared/lib/navigation.d.ts.map +1 -0
- package/dist/shared/lib/toast.d.ts +35 -0
- package/dist/shared/lib/toast.d.ts.map +1 -0
- package/dist/shared/lib/utils.d.ts +3 -0
- package/dist/shared/lib/utils.d.ts.map +1 -0
- package/dist/shared/ui/CopyButton.d.ts +6 -0
- package/dist/shared/ui/CopyButton.d.ts.map +1 -0
- package/dist/shared/ui/avatar.d.ts +9 -0
- package/dist/shared/ui/avatar.d.ts.map +1 -0
- package/dist/shared/ui/badge.d.ts +8 -0
- package/dist/shared/ui/badge.d.ts.map +1 -0
- package/dist/shared/ui/button.d.ts +11 -0
- package/dist/shared/ui/button.d.ts.map +1 -0
- package/dist/shared/ui/command.d.ts +10 -0
- package/dist/shared/ui/command.d.ts.map +1 -0
- package/dist/shared/ui/confirm-dialog.d.ts +17 -0
- package/dist/shared/ui/confirm-dialog.d.ts.map +1 -0
- package/dist/shared/ui/dropdown-menu.d.ts +9 -0
- package/dist/shared/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/shared/ui/input.d.ts +3 -0
- package/dist/shared/ui/input.d.ts.map +1 -0
- package/dist/shared/ui/kbd.d.ts +3 -0
- package/dist/shared/ui/kbd.d.ts.map +1 -0
- package/dist/shared/ui/popover.d.ts +7 -0
- package/dist/shared/ui/popover.d.ts.map +1 -0
- package/dist/shared/ui/scroll-area.d.ts +5 -0
- package/dist/shared/ui/scroll-area.d.ts.map +1 -0
- package/dist/shared/ui/tabs.d.ts +7 -0
- package/dist/shared/ui/tabs.d.ts.map +1 -0
- package/dist/shared/ui/toast.d.ts +7 -0
- package/dist/shared/ui/toast.d.ts.map +1 -0
- package/dist/shared/ui/tooltip.d.ts +7 -0
- package/dist/shared/ui/tooltip.d.ts.map +1 -0
- package/dist/styles/base.css +49 -0
- package/dist/styles/components.css +206 -0
- package/dist/styles/effects.css +76 -0
- package/dist/styles/fonts.css +49 -0
- package/dist/styles/index.css +14 -0
- package/dist/styles/styles.test.ts +45 -0
- package/dist/styles/themes.css +33 -0
- package/dist/styles/tokens.css +245 -0
- package/dist/styles/tokens.test.ts +113 -0
- package/dist/test-setup.d.ts +29 -0
- package/dist/test-setup.d.ts.map +1 -0
- package/package.json +71 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client-handled slash commands for the web surface — intercepted in App.tsx
|
|
3
|
+
* BEFORE the wire (mirrors the TUI's client-slash-commands.ts). These never
|
|
4
|
+
* round-trip to the host; everything else is routed to `client.runSlashCommand`.
|
|
5
|
+
*/
|
|
6
|
+
import type { SlashCommandDescriptor } from "@nuvin/session/protocol";
|
|
7
|
+
/** Actions the web client-side slash commands drive. */
|
|
8
|
+
export type WebClientActions = {
|
|
9
|
+
/** `/theme` — toggle light/dark via the existing useThemeMode toggler. */
|
|
10
|
+
toggleTheme(): void;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Descriptors for client-handled web slash commands. Merged with
|
|
14
|
+
* `snapshot.serverCommands` for Composer autocomplete. `/new` is intentionally
|
|
15
|
+
* absent — on web it is a SERVER command and already appears in serverCommands().
|
|
16
|
+
*/
|
|
17
|
+
export declare function webClientCommandDescriptors(_actions: WebClientActions): SlashCommandDescriptor[];
|
|
18
|
+
/**
|
|
19
|
+
* Attempt to handle `raw` as a client-side slash command.
|
|
20
|
+
*
|
|
21
|
+
* Returns `true` when the command was consumed (caller must NOT forward to
|
|
22
|
+
* `client.runSlashCommand`). Returns `false` for unknown commands so the caller
|
|
23
|
+
* can route them to the server.
|
|
24
|
+
*/
|
|
25
|
+
export declare function handleWebClientSlashCommand(raw: string, actions: WebClientActions): boolean;
|
|
26
|
+
//# sourceMappingURL=client-commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-commands.d.ts","sourceRoot":"","sources":["../../src/session/client-commands.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEtE,wDAAwD;AACxD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,0EAA0E;IAC1E,WAAW,IAAI,IAAI,CAAC;CACrB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,gBAAgB,GAAG,sBAAsB,EAAE,CAEhG;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAW3F"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AskUserAnswers } from "@nuvin/agent-core/shared";
|
|
2
|
+
import type { WebApprovalDecision } from "./types";
|
|
3
|
+
export declare function sendSubmit(text: string, tabKey?: string): void;
|
|
4
|
+
export declare function sendApproval(decision: WebApprovalDecision, comment?: string, tabKey?: string): void;
|
|
5
|
+
export declare function sendAnswer(answers: AskUserAnswers, tabKey?: string): void;
|
|
6
|
+
export declare function sendAbort(tabKey?: string): void;
|
|
7
|
+
export declare function sendDequeue(queuedId: string, tabKey?: string): void;
|
|
8
|
+
export declare function sendNewSession(tabKey?: string): void;
|
|
9
|
+
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/session/commands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAW9D;AAED,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,mBAAmB,EAC7B,OAAO,CAAC,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,MAAM,GACd,IAAI,CAQN;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,cAAc,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAMzE;AAED,wBAAgB,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAI/C;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAInE;AAED,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAIpD"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { GetEndpoint } from "@nuvin/session/client";
|
|
2
|
+
import type { HistoryPage, SessionDescriptor, SessionSnapshot, WorkspaceSummary } from "@nuvin/session/protocol";
|
|
3
|
+
/** Display-only daemon metadata (cloud): human name + presence (web spec §6). */
|
|
4
|
+
export type DaemonMeta = {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
online: boolean;
|
|
8
|
+
lastSeenAt: string | null;
|
|
9
|
+
/**
|
|
10
|
+
* Live sessions from the REST snapshot (spec §4.3/§5.1); [] when none / local mode.
|
|
11
|
+
* OPTIONAL so existing `DaemonMeta` literals (e.g. `use-directory.test.tsx`
|
|
12
|
+
* mock-source fixtures) stay valid and out of this phase's scope; every reader
|
|
13
|
+
* uses `m?.activeSessions ?? []`.
|
|
14
|
+
*/
|
|
15
|
+
activeSessions?: SessionDescriptor[];
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* A daemon entry the browser directory can dial: static {url,token} (local)
|
|
19
|
+
* or an endpoint provider (cloud relay). Structurally DirectoryServerConfig
|
|
20
|
+
* minus socketFactory (the browser supplies its own). WebServerEntry
|
|
21
|
+
* (required url+token) is assignable to this, so the local source is unchanged.
|
|
22
|
+
*/
|
|
23
|
+
export type WebDirectoryEntry = {
|
|
24
|
+
name: string;
|
|
25
|
+
url?: string;
|
|
26
|
+
token?: string;
|
|
27
|
+
getEndpoint?: GetEndpoint;
|
|
28
|
+
};
|
|
29
|
+
export type DirectorySnapshot = {
|
|
30
|
+
entries: WebDirectoryEntry[];
|
|
31
|
+
meta?: Map<string, DaemonMeta>;
|
|
32
|
+
defaultSessionId?: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Directory re-sourcing seam (web spec §6/§9): the composition root picks the
|
|
36
|
+
* implementation — local GET /api/servers vs cloud GET /api/daemons — and
|
|
37
|
+
* connectDirectory/refreshDirectory stay implementation-blind.
|
|
38
|
+
*/
|
|
39
|
+
export interface DirectorySource {
|
|
40
|
+
load(): Promise<DirectorySnapshot>;
|
|
41
|
+
/**
|
|
42
|
+
* Read-only transcript of a cold session over REST (spec §5.1). Present on the
|
|
43
|
+
* cloud source (GET /api/daemons/:id/transcript/:historyId); absent on the
|
|
44
|
+
* local/mock sources until Phase 7. Readers guard `source?.fetchTranscript`.
|
|
45
|
+
*/
|
|
46
|
+
fetchTranscript?(server: string, historyId: string, opts?: {
|
|
47
|
+
workspace?: string;
|
|
48
|
+
profile?: string;
|
|
49
|
+
}): Promise<SessionSnapshot>;
|
|
50
|
+
/**
|
|
51
|
+
* Delete a session (live or cold) over REST (spec §5.1/§5.5). Present on the
|
|
52
|
+
* cloud source (DELETE /api/daemons/:id/sessions/:historyId); absent on the
|
|
53
|
+
* local/mock sources until Phase 7. Readers guard `source?.deleteSession`.
|
|
54
|
+
*/
|
|
55
|
+
deleteSession?(server: string, historyId: string, opts?: {
|
|
56
|
+
workspace?: string;
|
|
57
|
+
profile?: string;
|
|
58
|
+
}): Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* Paginated cold-history over REST (spec §5.1). Present on the cloud source
|
|
61
|
+
* (GET /api/daemons/:id/history); absent on local/mock until Phase 7. Readers
|
|
62
|
+
* guard `source?.fetchHistory`.
|
|
63
|
+
*/
|
|
64
|
+
fetchHistory?(server: string, opts?: {
|
|
65
|
+
profile?: string;
|
|
66
|
+
cwd?: string;
|
|
67
|
+
limit?: number;
|
|
68
|
+
cursor?: string;
|
|
69
|
+
}): Promise<HistoryPage>;
|
|
70
|
+
/**
|
|
71
|
+
* List the daemon's workspaces over REST (spec §5.1/§7). Present on the cloud
|
|
72
|
+
* source (GET /api/daemons/:id/workspaces); absent on the local/mock sources
|
|
73
|
+
* until Phase 7. Readers guard `source?.listWorkspaces`. Mirrors the WS
|
|
74
|
+
* directory client's listWorkspaces so the App wiring swaps cleanly.
|
|
75
|
+
*/
|
|
76
|
+
listWorkspaces?(server: string, opts?: {
|
|
77
|
+
profile?: string;
|
|
78
|
+
}): Promise<WorkspaceSummary[]>;
|
|
79
|
+
/**
|
|
80
|
+
* Create a workspace over REST (spec §5.1/§7 — list + create only). Present on
|
|
81
|
+
* the cloud source (POST /api/daemons/:id/workspaces); absent on local/mock
|
|
82
|
+
* until Phase 7. Readers guard `source?.createWorkspace`.
|
|
83
|
+
*/
|
|
84
|
+
createWorkspace?(server: string, opts: {
|
|
85
|
+
name: string;
|
|
86
|
+
root?: string;
|
|
87
|
+
profile?: string;
|
|
88
|
+
}): Promise<WorkspaceSummary>;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Local source: same-origin GET /api/servers for the directory, plus the SAME
|
|
92
|
+
* read-only/management REST methods the cloud source has (spec §4.5). The methods
|
|
93
|
+
* dial the daemon's own HTTP base (derived from the entry ws url) with the entry
|
|
94
|
+
* token as a bearer — the browser reaches the daemon directly, exactly as it does
|
|
95
|
+
* for the ws attach. `getActiveSource()` therefore carries these in local mode,
|
|
96
|
+
* so every Phase 3/5/6 consumer takes the REST path uniformly with cloud.
|
|
97
|
+
*/
|
|
98
|
+
export declare function createLocalDirectorySource(deps?: {
|
|
99
|
+
fetchImpl?: typeof fetch;
|
|
100
|
+
}): DirectorySource;
|
|
101
|
+
//# sourceMappingURL=directory-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"directory-source.d.ts","sourceRoot":"","sources":["../../src/session/directory-source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EACV,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AAIjC,iFAAiF;AACjF,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;;;;;OAKG;IACH,cAAc,CAAC,EAAE,iBAAiB,EAAE,CAAC;CACtC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IAC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,CACd,MAAM,EAAE,MAAM,EACd,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GACtD,OAAO,CAAC,gBAAgB,CAAC,CAAC;CAC9B;AASD;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,IAAI,GAAE;IAAE,SAAS,CAAC,EAAE,OAAO,KAAK,CAAA;CAAO,GACtC,eAAe,CAoHjB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DirectoryView } from "@nuvin/session/client";
|
|
2
|
+
/**
|
|
3
|
+
* Returns true iff the named server exists in `view` and its status.state is
|
|
4
|
+
* "online". Used by the StartScreen guard to disable autocomplete and block
|
|
5
|
+
* Start when the target server is offline or still connecting.
|
|
6
|
+
*/
|
|
7
|
+
export declare function isServerOnline(view: DirectoryView, server: string): boolean;
|
|
8
|
+
//# sourceMappingURL=directory-status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"directory-status.d.ts","sourceRoot":"","sources":["../../src/session/directory-status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAM3D;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAG3E"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type ServerDirectory, type TransportSocket } from "@nuvin/session/client";
|
|
2
|
+
import type { WebDirectoryEntry } from "./directory-source";
|
|
3
|
+
/**
|
|
4
|
+
* Serializable daemon entry handed to the browser by GET /api/servers
|
|
5
|
+
* (the CLI's WebServerEntry, spec §1). Structurally a DirectoryServerConfig
|
|
6
|
+
* WITHOUT a socketFactory — the browser supplies its own (browserSocketFactory).
|
|
7
|
+
* The token rides the hello frame, never the URL.
|
|
8
|
+
*/
|
|
9
|
+
export type WebServerEntry = {
|
|
10
|
+
name: string;
|
|
11
|
+
url: string;
|
|
12
|
+
token: string;
|
|
13
|
+
};
|
|
14
|
+
/** Parsed GET /api/servers payload. */
|
|
15
|
+
export type ServersResponse = {
|
|
16
|
+
servers: WebServerEntry[];
|
|
17
|
+
/** Pre-provisioned Local session for first-paint attach (later phase). */
|
|
18
|
+
defaultSessionId?: string;
|
|
19
|
+
};
|
|
20
|
+
export declare function isServersResponse(value: unknown): value is ServersResponse;
|
|
21
|
+
/**
|
|
22
|
+
* Fetch the daemon directory over same-origin HTTP (localhost-gated by the CLI).
|
|
23
|
+
* Mirrors fetchCredentials: no-store, ok-guard, structural validation. The
|
|
24
|
+
* bearer tokens it returns are only safe because the endpoint is origin-gated.
|
|
25
|
+
*/
|
|
26
|
+
export declare function fetchServers(): Promise<ServersResponse>;
|
|
27
|
+
/** The browser's per-server socket factory: a native WHATWG WebSocket (spec §2). */
|
|
28
|
+
export declare function browserSocketFactory(url: string): TransportSocket;
|
|
29
|
+
export type BuildBrowserDirectoryOptions = {
|
|
30
|
+
/** Test seam / override; defaults to browserSocketFactory. */
|
|
31
|
+
socketFactory?: (url: string) => TransportSocket;
|
|
32
|
+
connectTimeoutMs?: number;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Build a browser ServerDirectory from the resolved /api/servers entries. Each
|
|
36
|
+
* entry has no per-server socketFactory, so the directory falls back to the
|
|
37
|
+
* supplied (WHATWG) factory for every server — one persistent daemon socket
|
|
38
|
+
* each, surviving session switches (the session attach is a separate socket).
|
|
39
|
+
*/
|
|
40
|
+
export declare function buildBrowserDirectory(servers: WebDirectoryEntry[], options?: BuildBrowserDirectoryOptions): ServerDirectory;
|
|
41
|
+
//# sourceMappingURL=directory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"directory.d.ts","sourceRoot":"","sources":["../../src/session/directory.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,eAAe,EACrB,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAQ5D;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1E,uCAAuC;AACvC,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,0EAA0E;IAC1E,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAYF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe,CAO1E;AAED;;;;GAIG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,eAAe,CAAC,CAU7D;AAED,oFAAoF;AACpF,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,CAEjE;AAED,MAAM,MAAM,4BAA4B,GAAG;IACzC,8DAA8D;IAC9D,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,eAAe,CAAC;IACjD,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,iBAAiB,EAAE,EAC5B,OAAO,GAAE,4BAAiC,GACzC,eAAe,CAQjB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type { WorkflowViewState } from "@nuvin/session/protocol";
|
|
2
|
+
export type { WebClientActions } from "./client-commands";
|
|
3
|
+
export { handleWebClientSlashCommand, webClientCommandDescriptors } from "./client-commands";
|
|
4
|
+
export { sendAbort, sendAnswer, sendApproval, sendDequeue, sendNewSession, sendSubmit, } from "./commands";
|
|
5
|
+
export { type BuildBrowserDirectoryOptions, browserSocketFactory, buildBrowserDirectory, fetchServers, type ServersResponse, type WebServerEntry, } from "./directory";
|
|
6
|
+
export type { DaemonMeta, DirectorySnapshot, DirectorySource, WebDirectoryEntry, } from "./directory-source";
|
|
7
|
+
export { createLocalDirectorySource } from "./directory-source";
|
|
8
|
+
export { snapshotFromSessionState } from "./snapshot";
|
|
9
|
+
export type { TabState } from "./store";
|
|
10
|
+
export { createDraftTab, ensureDraftTab, setForegroundKey, swapTabKey, useSessionStore, useTab, useTabDraft, } from "./store";
|
|
11
|
+
export type { SessionRouteDeps, StartSessionOptions } from "./transport";
|
|
12
|
+
export { attachedTabKeys, attachSession, connectedClient, connectTransport, createSessionThenSwitch, detachTab, disconnectTransport, ensureAttached, focusTab, getResumedHistoryIds, openColdTranscript, reportError, resetEnsureAttachedForTests, resolveSessionRoute, resumeColdViewingTab, resumeThenSwitch, startSession, switchSession, } from "./transport";
|
|
13
|
+
export type { BasicWebMessage, JsonObject, JsonValue, ToolMessageStatus, ToolWebMessage, WebApprovalDecision, WebApprovalSnapshot, WebMessage, WebSessionCredentials, WebSessionSnapshot, } from "./types";
|
|
14
|
+
export { acquireDirectoryLink, connectDirectory, desiredLinkNames, disconnectDirectory, getActiveSource, getDaemonMeta, getDefaultSessionId, getDirectory, getDirectoryError, getServerEntries, getServerEntry, isServerOnline, refreshDirectory, useAllDirectoryLinks, useDaemonMeta, useDirectory, useDirectoryLink, usePickerPoll, } from "./use-directory";
|
|
15
|
+
export { type UseSessionTransportOptions, useSessionTransport } from "./use-session-transport";
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/session/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EACL,SAA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ACd,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,KAAK,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SessionViewState, SlashCommandDescriptor } from "@nuvin/session/protocol";
|
|
2
|
+
import type { WebSessionSnapshot } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Project the replicated SessionViewState (built by the shared
|
|
5
|
+
* reduceSessionEvent — parity by construction) into the view shape the web
|
|
6
|
+
* components render. Tool rows hidden by the anti-flash reducer (a pending
|
|
7
|
+
* approval's sole representation is the approval card, and rejected tools
|
|
8
|
+
* never ran — spec §4.5) are filtered out of the transcript.
|
|
9
|
+
*/
|
|
10
|
+
export declare function snapshotFromSessionState(state: SessionViewState, serverCommands?: SlashCommandDescriptor[]): WebSessionSnapshot;
|
|
11
|
+
//# sourceMappingURL=snapshot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot.d.ts","sourceRoot":"","sources":["../../src/session/snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAExF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,gBAAgB,EACvB,cAAc,GAAE,sBAAsB,EAAO,GAC5C,kBAAkB,CA0BpB"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { WebSessionSnapshot } from "./types";
|
|
2
|
+
export interface TabState {
|
|
3
|
+
server: string;
|
|
4
|
+
sessionId: string;
|
|
5
|
+
title: string;
|
|
6
|
+
snapshot: WebSessionSnapshot | null;
|
|
7
|
+
connected: boolean;
|
|
8
|
+
error: string | null;
|
|
9
|
+
unread: number;
|
|
10
|
+
lastViewedAt: number;
|
|
11
|
+
isDraft?: boolean;
|
|
12
|
+
draftCwd?: string;
|
|
13
|
+
coldHistoryId?: string;
|
|
14
|
+
/**
|
|
15
|
+
* True when this tab is a read-only REST transcript (spec §5.2): no socket,
|
|
16
|
+
* `connected: false`, composer enabled, never in the LRU attach set. Cleared
|
|
17
|
+
* when the tab is promoted to live via swapTabKey.
|
|
18
|
+
*/
|
|
19
|
+
coldViewing?: boolean;
|
|
20
|
+
unreachable?: boolean;
|
|
21
|
+
}
|
|
22
|
+
type SessionStore = {
|
|
23
|
+
tabs: Map<string, TabState>;
|
|
24
|
+
/**
|
|
25
|
+
* Composer drafts, keyed by tabKey — deliberately a SEPARATE slice from
|
|
26
|
+
* `tabs` (A2). Typing mutates only this Map, so the `tabs` Map that App/TabBar
|
|
27
|
+
* subscribe to stays referentially stable and the whole shell no longer
|
|
28
|
+
* re-renders on every keystroke. Cleaned up alongside the tab in
|
|
29
|
+
* removeTab/swapTabKey.
|
|
30
|
+
*/
|
|
31
|
+
drafts: Map<string, string>;
|
|
32
|
+
foregroundKey: string | null;
|
|
33
|
+
sidebarCollapsed: boolean;
|
|
34
|
+
setSidebarCollapsed: (value: boolean) => void;
|
|
35
|
+
draft: string;
|
|
36
|
+
setDraft: (draft: string) => void;
|
|
37
|
+
upsertTab: (tabKey: string, init: Pick<TabState, "server" | "sessionId"> & Partial<TabState>) => void;
|
|
38
|
+
removeTab: (tabKey: string) => void;
|
|
39
|
+
setForegroundKey: (tabKey: string | null) => void;
|
|
40
|
+
setTabSnapshot: (tabKey: string, s: WebSessionSnapshot | ((p: WebSessionSnapshot | null) => WebSessionSnapshot)) => void;
|
|
41
|
+
setTabConnected: (tabKey: string, c: boolean) => void;
|
|
42
|
+
setTabError: (tabKey: string, e: string | null) => void;
|
|
43
|
+
setTabDraft: (tabKey: string, text: string) => void;
|
|
44
|
+
bumpTabViewed: (tabKey: string) => void;
|
|
45
|
+
createDraftTab: (server: string, opts?: {
|
|
46
|
+
cwd?: string;
|
|
47
|
+
}) => string;
|
|
48
|
+
swapTabKey: (oldKey: string, next: {
|
|
49
|
+
server: string;
|
|
50
|
+
sessionId: string;
|
|
51
|
+
}) => string;
|
|
52
|
+
};
|
|
53
|
+
export declare const useSessionStore: import("zustand").UseBoundStore<import("zustand").StoreApi<SessionStore>>;
|
|
54
|
+
/**
|
|
55
|
+
* Standalone export so callers (route components, ensureAttached, index.ts) can
|
|
56
|
+
* set the URL-derived foreground key without reaching through the store action.
|
|
57
|
+
*/
|
|
58
|
+
export declare function setForegroundKey(key: string | null): void;
|
|
59
|
+
/**
|
|
60
|
+
* Standalone export so callers (and index.ts) can import createDraftTab without
|
|
61
|
+
* going through the store action directly. Delegates to the store action.
|
|
62
|
+
*/
|
|
63
|
+
export declare function createDraftTab(server: string, opts?: {
|
|
64
|
+
cwd?: string;
|
|
65
|
+
}): string;
|
|
66
|
+
/**
|
|
67
|
+
* Standalone export so callers (and index.ts) can import swapTabKey without
|
|
68
|
+
* going through the store action directly. Delegates to the store action.
|
|
69
|
+
*/
|
|
70
|
+
export declare function swapTabKey(oldKey: string, next: {
|
|
71
|
+
server: string;
|
|
72
|
+
sessionId: string;
|
|
73
|
+
}): string;
|
|
74
|
+
/**
|
|
75
|
+
* Return the tabKey of `server`'s current draft tab (most recently viewed),
|
|
76
|
+
* creating one when none exists. <DraftView> resolves /d/:daemon/new through
|
|
77
|
+
* this: one addressable draft per daemon; a page reload starts a fresh draft
|
|
78
|
+
* because the tabs map is rebuilt empty.
|
|
79
|
+
*/
|
|
80
|
+
export declare function ensureDraftTab(server: string, opts?: {
|
|
81
|
+
cwd?: string;
|
|
82
|
+
}): string;
|
|
83
|
+
/**
|
|
84
|
+
* Reactive accessor for a single pool row by URL id (spec §6). Returns the
|
|
85
|
+
* TabState for `${daemon}::${sessionId}`, or undefined. Replaces the deleted
|
|
86
|
+
* global facade: components read THEIR session by the URL's params.
|
|
87
|
+
*/
|
|
88
|
+
export declare function useTab(daemon: string | null | undefined, sessionId: string | null | undefined): TabState | undefined;
|
|
89
|
+
/**
|
|
90
|
+
* Reactive accessor for a single tab's composer draft (A2). Reads the dedicated
|
|
91
|
+
* `drafts` slice, so a keystroke re-renders only the subscribing Composer — not
|
|
92
|
+
* the `tabs`-Map subscribers (App, TabBar).
|
|
93
|
+
*/
|
|
94
|
+
export declare function useTabDraft(tabKey: string | null): string;
|
|
95
|
+
export {};
|
|
96
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/session/store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACpC,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,KAAK,YAAY,GAAG;IAClB,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC5B;;;;;;OAMG;IACH,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAG7B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,mBAAmB,EAAE,CAAC,KA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;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAEzD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAE9E;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAE9F;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAa9E;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CACpB,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACjC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GACnC,QAAQ,GAAG,SAAS,CAGtB;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAEzD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { WebSessionSnapshot } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Tracks per-tool-call start/complete timestamps as snapshots arrive from the
|
|
4
|
+
* server. Mutates and re-emits a snapshot where each tool message has its
|
|
5
|
+
* `startedAt` / `completedAt` fields populated.
|
|
6
|
+
*
|
|
7
|
+
* The tracker is stateful across snapshots so timestamps remain stable.
|
|
8
|
+
*/
|
|
9
|
+
export declare function createTimingTracker(now?: () => number): {
|
|
10
|
+
annotate: (snapshot: WebSessionSnapshot) => WebSessionSnapshot;
|
|
11
|
+
reset: () => void;
|
|
12
|
+
};
|
|
13
|
+
export type TimingTracker = ReturnType<typeof createTimingTracker>;
|
|
14
|
+
//# sourceMappingURL=tool-timing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-timing.d.ts","sourceRoot":"","sources":["../../src/session/tool-timing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiC,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAOjF;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,GAAE,MAAM,MAAiB;yBAOlC,kBAAkB,KAAG,kBAAkB;iBAJjD,IAAI;EAkEvB;AAED,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { type SessionClient, type WebSocketClientTransport } from "@nuvin/session/client";
|
|
2
|
+
import type { DirectorySource } from "./directory-source";
|
|
3
|
+
import type { WebSessionCredentials } from "./types";
|
|
4
|
+
/** Option shape for startSession — matches directory.createSession's create-time knobs (R1). */
|
|
5
|
+
export type StartSessionOptions = {
|
|
6
|
+
cwd: string;
|
|
7
|
+
workspace?: string;
|
|
8
|
+
profile?: string;
|
|
9
|
+
};
|
|
10
|
+
/** Per-connection registry entry (replaces the module-level singletons). */
|
|
11
|
+
interface Connection {
|
|
12
|
+
client: SessionClient;
|
|
13
|
+
transport: WebSocketClientTransport;
|
|
14
|
+
/** Bumped each time this tabKey's connection is replaced or closed. Stale callbacks no-op. */
|
|
15
|
+
generation: number;
|
|
16
|
+
server: string;
|
|
17
|
+
sessionId: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Returns a snapshot copy of the in-session resumedHistoryIds map so callers
|
|
21
|
+
* cannot mutate the module-level map.
|
|
22
|
+
*/
|
|
23
|
+
export declare function getResumedHistoryIds(): Map<string, string>;
|
|
24
|
+
/**
|
|
25
|
+
* Test-only accessor — returns the set of tabKeys currently in the registry.
|
|
26
|
+
* Exported so transport.test.ts can assert LRU sweep counts without reaching into internals.
|
|
27
|
+
*/
|
|
28
|
+
export declare function attachedTabKeys(): Map<string, Connection>;
|
|
29
|
+
export declare function reportError(error: unknown, tabKey?: string): void;
|
|
30
|
+
/**
|
|
31
|
+
* Attach (or re-attach) to a given session. Closes any existing connection
|
|
32
|
+
* for this tab before opening the next; switching NEVER kills the prior
|
|
33
|
+
* session on the daemon (detach ≠ stop).
|
|
34
|
+
* Derives tabKey, opens/swaps the connection, upserts the tab row, sets it active.
|
|
35
|
+
* After opening, runs the LRU sweep to cap attached connections at MAX_ATTACHED.
|
|
36
|
+
*/
|
|
37
|
+
export declare function attachSession(credentials: WebSessionCredentials & {
|
|
38
|
+
server?: string;
|
|
39
|
+
}, opts?: {
|
|
40
|
+
activate?: boolean;
|
|
41
|
+
}): void;
|
|
42
|
+
/**
|
|
43
|
+
* Focus a tab by tabKey. If the tab has a live connection (non-stale), just
|
|
44
|
+
* flips foregroundKey (no re-attach). If the tab is stale (row exists but no
|
|
45
|
+
* registry connection), re-opens the connection via attachSession so the daemon
|
|
46
|
+
* re-sends the snapshot (replay). Resolves {url,token} from the retained server
|
|
47
|
+
* entries (populated by connectTransport). Per spec §3: no kill-session on focus.
|
|
48
|
+
*/
|
|
49
|
+
export declare function focusTab(tabKey: string): void;
|
|
50
|
+
/**
|
|
51
|
+
* Bootstrap the browser from GET /api/servers (replaces the old /api/session
|
|
52
|
+
* connectTransport). Builds the Phase-3 directory with ZERO links; mounted route
|
|
53
|
+
* components (<Picker>/<DaemonLayout>) acquire the links they need. Does NOT
|
|
54
|
+
* auto-attach any session: the picker (home view) is the landing screen, and
|
|
55
|
+
* reload restores only the URL's session (spec §8). Idempotent: returns
|
|
56
|
+
* immediately if a session client or directory already exist.
|
|
57
|
+
*/
|
|
58
|
+
export declare function connectTransport(source?: DirectorySource): void;
|
|
59
|
+
/**
|
|
60
|
+
* Disconnect all session connections AND tear down the directory.
|
|
61
|
+
* Clears the entire registry + tabs + foregroundKey.
|
|
62
|
+
*/
|
|
63
|
+
export declare function disconnectTransport(): void;
|
|
64
|
+
/**
|
|
65
|
+
* Switch to a different session on the named server. Resolves {url,token} from
|
|
66
|
+
* the retained server entries (populated by connectTransport). Does NOT send
|
|
67
|
+
* kill-session — switching detaches locally but never kills the prior session
|
|
68
|
+
* on the daemon.
|
|
69
|
+
*/
|
|
70
|
+
export declare function switchSession(server: string, sessionId: string): void;
|
|
71
|
+
/**
|
|
72
|
+
* Create a new session via the directory, then attach to it. The directory
|
|
73
|
+
* uses its own daemon socket; this opens a fresh session-attach socket.
|
|
74
|
+
* Rejects if the directory is not yet bootstrapped.
|
|
75
|
+
*/
|
|
76
|
+
export declare function createSessionThenSwitch(server: string, options: {
|
|
77
|
+
cwd: string;
|
|
78
|
+
name?: string;
|
|
79
|
+
workspace?: string;
|
|
80
|
+
}): Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* Resume an existing session via the directory, then attach to it. Resume is
|
|
83
|
+
* idempotent daemon-side (de-dupes an already-live session), so calling this
|
|
84
|
+
* on an already-live session resolves the existing descriptor and switches to
|
|
85
|
+
* it — no duplicate session.
|
|
86
|
+
*
|
|
87
|
+
* R8: records historyId → descriptor.id in the in-session resumedHistoryIds map
|
|
88
|
+
* so the launcher can dedup cold rows that have already been resumed into a live tab.
|
|
89
|
+
*/
|
|
90
|
+
export declare function resumeThenSwitch(server: string, historyId: string, options: {
|
|
91
|
+
cwd: string;
|
|
92
|
+
name?: string;
|
|
93
|
+
workspace?: string;
|
|
94
|
+
}): Promise<void>;
|
|
95
|
+
/**
|
|
96
|
+
* Open a COLD session's transcript READ-ONLY over REST (spec §5.2): fetch the
|
|
97
|
+
* snapshot via the active DirectorySource, project it, and upsert a cold-viewing
|
|
98
|
+
* tab (no socket, connected:false, composer enabled). Never opens an attach
|
|
99
|
+
* connection, so it never counts toward the LRU attach cap. Both local and cloud
|
|
100
|
+
* sources serve read-only transcripts over REST now (spec §4.5); a missing
|
|
101
|
+
* method means a mock/uninitialised source, and the fetch itself may fail.
|
|
102
|
+
*/
|
|
103
|
+
export declare function openColdTranscript(server: string, historyId: string, opts?: {
|
|
104
|
+
workspace?: string;
|
|
105
|
+
profile?: string;
|
|
106
|
+
}): Promise<void>;
|
|
107
|
+
/**
|
|
108
|
+
* Promote a cold-viewing tab to live on composer submit (spec §5.2): resume the
|
|
109
|
+
* cold session, swap the cold-viewing tab to the resumed session's NEW id, open
|
|
110
|
+
* the attach connection, replace the URL, and deliver the queued composer input
|
|
111
|
+
* once connected. Rejects if the directory is not connected or the server is
|
|
112
|
+
* unknown (the caller keeps the typed input + stays read-only on rejection).
|
|
113
|
+
*/
|
|
114
|
+
export declare function resumeColdViewingTab(server: string, historyId: string, text: string, options: {
|
|
115
|
+
cwd: string;
|
|
116
|
+
workspace?: string;
|
|
117
|
+
}): Promise<void>;
|
|
118
|
+
/**
|
|
119
|
+
* Detach a tab: close its registry connection if present, then remove the tab
|
|
120
|
+
* row from the store. Does NOT send kill-session — detach ≠ stop (spec §5/D2).
|
|
121
|
+
*/
|
|
122
|
+
export declare function detachTab(tabKey: string): void;
|
|
123
|
+
export declare function connectedClient(tabKey?: string): SessionClient | null;
|
|
124
|
+
/**
|
|
125
|
+
* Lazily create a session and attach to it.
|
|
126
|
+
*
|
|
127
|
+
* If `opts.replaceDraftKey` is provided, the draft tab at that key is swapped
|
|
128
|
+
* to the new sessionId (preserving bar position + active pointer) BEFORE the
|
|
129
|
+
* attach connection is opened — so there is never a transient double-tab.
|
|
130
|
+
* The caller is responsible for any first-prompt `sendSubmit` (R2 — no import
|
|
131
|
+
* from commands.ts).
|
|
132
|
+
*
|
|
133
|
+
* Returns `{ tabKey, sessionId }` so the caller can route `sendSubmit`.
|
|
134
|
+
*/
|
|
135
|
+
export declare function startSession(server: string, options: StartSessionOptions, opts?: {
|
|
136
|
+
replaceDraftKey?: string;
|
|
137
|
+
}): Promise<{
|
|
138
|
+
tabKey: string;
|
|
139
|
+
sessionId: string;
|
|
140
|
+
}>;
|
|
141
|
+
/** Session-branch resolution inputs (mirrors route-sync's applyRoute deps, session-only). */
|
|
142
|
+
export type SessionRouteDeps = {
|
|
143
|
+
status: "loading" | "error" | "ready";
|
|
144
|
+
serverNames: ReadonlySet<string>;
|
|
145
|
+
/** Live sessions from the connected socket view (empty while connecting). */
|
|
146
|
+
liveSessionIds: ReadonlySet<string>;
|
|
147
|
+
/** REST-snapshot presence; "absent" in local mode (no daemon meta). */
|
|
148
|
+
presence: "online" | "offline" | "absent";
|
|
149
|
+
/**
|
|
150
|
+
* The daemon's directory-link connection state (spec §5.3 — local liveness
|
|
151
|
+
* comes from the socket, not REST meta). "absent" = no link in the view yet
|
|
152
|
+
* (unacquired, or the acquire's coalescing microtask hasn't reconciled). Used
|
|
153
|
+
* to hold instead of bounce mid-connect, and to detect a local (meta-less)
|
|
154
|
+
* online link that means COLD.
|
|
155
|
+
*/
|
|
156
|
+
linkState: "connecting" | "online" | "offline" | "absent";
|
|
157
|
+
/** REST-snapshot active-session ids (authoritative before the socket connects). */
|
|
158
|
+
activeSessionIds: ReadonlySet<string>;
|
|
159
|
+
hasTab: boolean;
|
|
160
|
+
focusTab: () => void;
|
|
161
|
+
switchSession: () => void;
|
|
162
|
+
beginColdResolve: () => void;
|
|
163
|
+
navigate: (to: string, opts: {
|
|
164
|
+
replace: boolean;
|
|
165
|
+
toast?: string;
|
|
166
|
+
}) => void;
|
|
167
|
+
};
|
|
168
|
+
/**
|
|
169
|
+
* Pure session-route decision table (spec §5.1). A warm pool hit (hasTab)
|
|
170
|
+
* focuses instantly regardless of directory status; otherwise resolve against
|
|
171
|
+
* the authoritative REST snapshot (union with the live socket) into
|
|
172
|
+
* attach / cold-read-only / unreachable-gate / not-found-bounce.
|
|
173
|
+
*/
|
|
174
|
+
export declare function resolveSessionRoute(daemon: string, sessionId: string, deps: SessionRouteDeps): void;
|
|
175
|
+
/** Test-only: clear the in-flight cold-resolve guard between tests. */
|
|
176
|
+
export declare function resetEnsureAttachedForTests(): void;
|
|
177
|
+
/**
|
|
178
|
+
* Resolve the session URL (spec §5.1). Called by <SessionView> on mount / param
|
|
179
|
+
* change (and re-run when the directory view / meta updates). Reads the live
|
|
180
|
+
* directory view + REST daemon meta + the store, then drives resolveSessionRoute.
|
|
181
|
+
* The attach path is idempotent: attachSession upserts the tab synchronously, so
|
|
182
|
+
* a StrictMode second invoke hits the hasTab → focusTab branch (one dial); the
|
|
183
|
+
* cold path is idempotent via coldResolveInFlight (one fetch).
|
|
184
|
+
*/
|
|
185
|
+
export declare function ensureAttached(daemon: string, sessionId: string): void;
|
|
186
|
+
export {};
|
|
187
|
+
//# sourceMappingURL=transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/session/transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,aAAa,EAElB,KAAK,wBAAwB,EAC9B,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,EAAE,eAAe,EAAqB,MAAM,oBAAoB,CAAC;AAG7E,OAAO,KAAK,EAAE,qBAAqB,EAAsB,MAAM,SAAS,CAAC;AA+BzE,gGAAgG;AAChG,MAAM,MAAM,mBAAmB,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AA6BxF,4EAA4E;AAC5E,UAAU,UAAU;IAClB,MAAM,EAAE,aAAa,CAAC;IACtB,SAAS,EAAE,wBAAwB,CAAC;IACpC,8FAA8F;IAC9F,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAyBD;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAE1D;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAEzD;AA8CD,wBAAgB,WAAW,CAAC,KAA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,EAAE,MAAM,IAAI,CAAC;IAC1B,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAC5E,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,gBAAgB,GACrB,IAAI,CA2CN;AAUD,uEAAuE;AACvE,wBAAgB,2BAA2B,IAAI,IAAI,CAElD;AA6BD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAiDtE"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { GetEndpoint } from "@nuvin/session/client";
|
|
2
|
+
import type { ApprovalDescriptor, QuestionDescriptor, QueuedMessageView, SlashCommandDescriptor, WorkflowViewState } from "@nuvin/session/protocol";
|
|
3
|
+
import type { ToolMessageStatus as SessionToolMessageStatus, ToolTuiMessage, TuiMessage } from "@nuvin/session/state";
|
|
4
|
+
export interface JsonObject {
|
|
5
|
+
[key: string]: JsonValue;
|
|
6
|
+
}
|
|
7
|
+
export type JsonValue = JsonObject | JsonValue[] | boolean | null | number | string;
|
|
8
|
+
export type ToolMessageStatus = SessionToolMessageStatus;
|
|
9
|
+
export type WebMessage = TuiMessage;
|
|
10
|
+
export type ToolWebMessage = ToolTuiMessage;
|
|
11
|
+
export type BasicWebMessage = Exclude<TuiMessage, ToolTuiMessage>;
|
|
12
|
+
export type WebApprovalDecision = "a" | "n" | "y";
|
|
13
|
+
export interface WebApprovalSnapshot {
|
|
14
|
+
active: ApprovalDescriptor | null;
|
|
15
|
+
pendingCount: number;
|
|
16
|
+
}
|
|
17
|
+
export interface WebSessionSnapshot {
|
|
18
|
+
approval: WebApprovalSnapshot;
|
|
19
|
+
approvalMode: string;
|
|
20
|
+
busy: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Count of messages queued for auto-send, mirrored from the wire (the
|
|
23
|
+
* controller owns the queue; see `turn-status.queuedCount`). The web UI now
|
|
24
|
+
* renders the actual `queued` list as a composer tray rather than this count,
|
|
25
|
+
* but the field stays projected for parity (the TUI consumes it). Absent ⇒ 0.
|
|
26
|
+
*/
|
|
27
|
+
queuedCount?: number;
|
|
28
|
+
/** Messages waiting in the auto-send queue, in send order. Absent ⇒ []. */
|
|
29
|
+
queued?: QueuedMessageView[];
|
|
30
|
+
/** Total context-window token budget for the active model, when known. */
|
|
31
|
+
contextWindowLimit?: number;
|
|
32
|
+
/** Fraction (0–1) of the context window used by the latest model response. */
|
|
33
|
+
contextWindowUsage?: number;
|
|
34
|
+
/** Token count of the latest model response, when known. */
|
|
35
|
+
currentTokens?: number;
|
|
36
|
+
cwd: string;
|
|
37
|
+
messages: WebMessage[];
|
|
38
|
+
modelName: string;
|
|
39
|
+
/** Active main-agent persona id; `"default"` for the built-in coordinator. */
|
|
40
|
+
persona: string;
|
|
41
|
+
/** Active config profile; rendered as a header indicator. Absent ⇒ "default". */
|
|
42
|
+
profile?: string;
|
|
43
|
+
/** Active workspace name; rendered as a header indicator. Absent ⇒ hidden. */
|
|
44
|
+
workspace?: string;
|
|
45
|
+
question: {
|
|
46
|
+
active: QuestionDescriptor | null;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Server-executed slash command descriptors from the attach snapshot. Merged
|
|
50
|
+
* with web client-side commands for Composer autocomplete. Empty when the host
|
|
51
|
+
* registers none.
|
|
52
|
+
*/
|
|
53
|
+
serverCommands: SlashCommandDescriptor[];
|
|
54
|
+
/**
|
|
55
|
+
* Reduced live summaries of background workflow runs (spec §8.2, D8). UI-only;
|
|
56
|
+
* NEVER agent context. Projected from `SessionViewState.workflows`.
|
|
57
|
+
*/
|
|
58
|
+
workflows: WorkflowViewState[];
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Session-attach credentials. Static {url, token} (local/LAN, unchanged) or an
|
|
62
|
+
* endpoint provider that resolves a fresh relay channel + grant per connection
|
|
63
|
+
* attempt (web spec §6). Credentials ride the hello frame, never the URL.
|
|
64
|
+
*/
|
|
65
|
+
export type WebSessionCredentials = {
|
|
66
|
+
sessionId: string;
|
|
67
|
+
} & ({
|
|
68
|
+
url: string;
|
|
69
|
+
token: string;
|
|
70
|
+
} | {
|
|
71
|
+
getEndpoint: GetEndpoint;
|
|
72
|
+
});
|
|
73
|
+
//# sourceMappingURL=types.d.ts.map
|