ompchamber 3.3.3 → 3.4.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/client/index.html +1 -1
- package/dist/client/index.js +275 -268
- package/dist/client/static/js/{index-8ejde0b7.js → index-h05z90mw.js} +581 -581
- package/package.json +1 -1
- package/src/client/components/settings/categories/AppearanceSettings.tsx +1 -1
- package/src/client/components/settings/categories/ChatSettings.tsx +1 -1
- package/src/client/components/workspace/btw-panel/AskCard.tsx +6 -1
- package/src/client/components/workspace/btw-panel/Messages.tsx +1 -1
- package/src/client/components/workspace/btw-panel/TopicMenu.tsx +1 -1
- package/src/client/components/workspace/btw-panel/index.tsx +20 -27
- package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.tsx +29 -18
- package/src/client/components/workspace/chat-timeline/chat-input/index.tsx +9 -39
- package/src/client/components/workspace/chat-timeline/chat-input/props.ts +62 -0
- package/src/client/hooks/chat/btw/index.ts +7 -73
- package/src/client/hooks/chat/btw/intercept.test.ts +80 -0
- package/src/client/hooks/chat/btw/intercept.ts +5 -2
- package/src/client/hooks/chat/btw/mode.ts +16 -76
- package/src/client/hooks/chat/timeline/actions.ts +22 -30
- package/src/client/hooks/chat/timeline/queue-actions.ts +88 -0
- package/src/client/hooks/chat/timeline/send.ts +8 -1
- package/src/client/hooks/chat/timeline/tui-only-guard.ts +58 -0
- package/src/server/lib/btw/child.server.test.ts +68 -0
- package/src/server/lib/btw/child.server.ts +17 -16
- package/src/server/lib/btw/frames.test.ts +3 -3
- package/src/server/lib/btw/frames.ts +1 -1
- package/src/server/lib/btw/lifecycle.server.test.ts +139 -0
- package/src/server/lib/btw/lifecycle.server.ts +41 -31
- package/src/server/lib/btw/prompt.ts +7 -11
- package/src/server/lib/btw/registry.server.ts +1 -9
- package/src/server/lib/btw/reply.ts +54 -0
- package/src/server/lib/btw/runtime.server.test.ts +128 -0
- package/src/server/lib/btw/runtime.server.ts +77 -86
- package/src/server/lib/btw/schema.server.test.ts +84 -0
- package/src/server/lib/btw/schema.server.ts +8 -0
- package/src/server/lib/btw/service.server.ts +47 -78
- package/src/server/lib/btw/store.server.ts +9 -20
- package/src/server/lib/omp/rpc/constants.ts +10 -0
- package/src/server/lib/omp/rpc/session-commands.ts +45 -0
- package/src/server/lib/omp/session/merge-stored-notices.test.ts +81 -0
- package/src/server/lib/omp/session/merge-stored.ts +70 -1
- package/src/server/lib/omp/session/messages.ts +27 -2
- package/src/server/routes/agent/command.ts +9 -1
- package/src/server/routes/btw/topics.ts +2 -59
- package/src/shared/lib/chat/btw/client.ts +0 -30
- package/src/shared/lib/chat/composer/tui-only.test.ts +90 -0
- package/src/shared/lib/chat/composer/tui-only.ts +138 -0
- package/src/shared/lib/chat/notice-text.ts +33 -0
- package/src/shared/lib/chat/omp/agent-events.ts +18 -37
- package/src/shared/lib/chat/omp/available-commands-cache.test.ts +66 -0
- package/src/shared/lib/chat/omp/command-output-ansi.test.ts +84 -0
- package/src/shared/lib/chat/omp/fold-deps.ts +48 -0
- package/src/shared/lib/chat/timeline/command-output.ts +65 -0
- package/src/shared/lib/chat/timeline/omp-callbacks.ts +4 -17
- package/src/shared/lib/omp/session/messages-map.ts +6 -1
- package/src/shared/types/btw.ts +13 -34
package/src/shared/types/btw.ts
CHANGED
|
@@ -13,18 +13,21 @@
|
|
|
13
13
|
* `btw_message` frames in the chat's own `ChatMessageData` shape, and the
|
|
14
14
|
* running turn is also carried in `BtwState.live` so a client attaching
|
|
15
15
|
* mid-turn renders the answer already produced.
|
|
16
|
+
*
|
|
17
|
+
* A side question runs WITHOUT tools and on the CHAT's model and thinking
|
|
18
|
+
* selector, so there is no per-topic model/access picker and no approval dialog
|
|
19
|
+
* to answer — the panel's composer is an input and a send button, exactly like
|
|
20
|
+
* the TUI's.
|
|
16
21
|
*/
|
|
17
22
|
|
|
18
|
-
import type { ApprovalMode } from '@/shared/lib/omp/config/access-mode';
|
|
19
23
|
import type { ChatMessageData } from '@/shared/types/chat';
|
|
20
|
-
import type { ExtensionUiDialogRequest } from '@/shared/types/omp/agent';
|
|
21
24
|
|
|
22
25
|
/** Lifecycle of one question/answer pair inside a topic. */
|
|
23
|
-
export type BtwTurnStatus = 'running' | 'complete' | 'cancelled' | '
|
|
26
|
+
export type BtwTurnStatus = 'running' | 'complete' | 'cancelled' | 'error' | 'interrupted';
|
|
24
27
|
|
|
25
28
|
/** Model a topic's side conversation runs on — the parent session's model,
|
|
26
|
-
*
|
|
27
|
-
*
|
|
29
|
+
* re-read from the chat's transcript at every ask (omp's `/btw` runs the side
|
|
30
|
+
* turn on `request.session.model`), so the panel offers no model picker. */
|
|
28
31
|
export interface BtwModel {
|
|
29
32
|
provider: string;
|
|
30
33
|
id: string;
|
|
@@ -63,17 +66,11 @@ export interface BtwTopic {
|
|
|
63
66
|
updatedAt: number;
|
|
64
67
|
model?: BtwModel;
|
|
65
68
|
/**
|
|
66
|
-
* Thinking
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
+
* Thinking SELECTOR the side child runs at (`auto` included), re-read from the
|
|
70
|
+
* chat's transcript at every ask so a level changed in the chat is mirrored.
|
|
71
|
+
* Undefined when the chat's transcript records none.
|
|
69
72
|
*/
|
|
70
73
|
thinkingLevel?: string;
|
|
71
|
-
/**
|
|
72
|
-
* Tool-approval mode the side child was SPAWNED with. omp exposes no RPC for
|
|
73
|
-
* this, so a change destroys and respawns an idle child — the same reconcile
|
|
74
|
-
* the chat session does (`reconcileSpawnApprovalMode`).
|
|
75
|
-
*/
|
|
76
|
-
approvalMode?: ApprovalMode;
|
|
77
74
|
/** Set once the topic was promoted into the chat as a session of its own. */
|
|
78
75
|
promotedSessionId?: string;
|
|
79
76
|
turns: BtwTurn[];
|
|
@@ -85,13 +82,12 @@ export interface BtwTopic {
|
|
|
85
82
|
* Part of the state rather than only a stream of frames: a client that attaches
|
|
86
83
|
* mid-turn (a reload, a second tab) would otherwise receive a `btw_state` whose
|
|
87
84
|
* running turn still has no persisted messages and would show an empty answer
|
|
88
|
-
* while the child streams on.
|
|
89
|
-
* comes again, so the state has to carry it.
|
|
85
|
+
* while the child streams on.
|
|
90
86
|
*/
|
|
91
87
|
export interface BtwLiveTurn {
|
|
92
88
|
topicId: string;
|
|
93
89
|
turnIndex: number;
|
|
94
|
-
/** Chat-shaped conversation so far (thinking
|
|
90
|
+
/** Chat-shaped conversation so far (thinking and prose). */
|
|
95
91
|
messages: ChatMessageData[];
|
|
96
92
|
/** Activity phrase for the panel's indicator; '' before the child reports one. */
|
|
97
93
|
activity: string;
|
|
@@ -105,23 +101,6 @@ export interface BtwState {
|
|
|
105
101
|
runningTopicId: string | null;
|
|
106
102
|
/** The running turn's live conversation, or null when nothing is in flight. */
|
|
107
103
|
live: BtwLiveTurn | null;
|
|
108
|
-
/**
|
|
109
|
-
* Dialogs a side child is blocked on right now, oldest first. Part of the
|
|
110
|
-
* state rather than its own frame so a reload (or a fresh panel) replays the
|
|
111
|
-
* modal a child is waiting on — omp never re-delivers the request, so a lost
|
|
112
|
-
* one leaves the turn blocked with nothing to answer.
|
|
113
|
-
*/
|
|
114
|
-
dialogs: BtwDialog[];
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* A dialog the side child is blocked on. The panel renders it with the chat's
|
|
119
|
-
* own `ExtensionDialog`; unlike the chat there is no tool card to host an `ask`
|
|
120
|
-
* inline, so every answerable request is a modal.
|
|
121
|
-
*/
|
|
122
|
-
export interface BtwDialog {
|
|
123
|
-
topicId: string;
|
|
124
|
-
request: ExtensionUiDialogRequest;
|
|
125
104
|
}
|
|
126
105
|
|
|
127
106
|
/** Server → client frames on `/api/btw/:sessionId/*` (WS and SSE alike). */
|