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.
Files changed (55) hide show
  1. package/dist/client/index.html +1 -1
  2. package/dist/client/index.js +275 -268
  3. package/dist/client/static/js/{index-8ejde0b7.js → index-h05z90mw.js} +581 -581
  4. package/package.json +1 -1
  5. package/src/client/components/settings/categories/AppearanceSettings.tsx +1 -1
  6. package/src/client/components/settings/categories/ChatSettings.tsx +1 -1
  7. package/src/client/components/workspace/btw-panel/AskCard.tsx +6 -1
  8. package/src/client/components/workspace/btw-panel/Messages.tsx +1 -1
  9. package/src/client/components/workspace/btw-panel/TopicMenu.tsx +1 -1
  10. package/src/client/components/workspace/btw-panel/index.tsx +20 -27
  11. package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.tsx +29 -18
  12. package/src/client/components/workspace/chat-timeline/chat-input/index.tsx +9 -39
  13. package/src/client/components/workspace/chat-timeline/chat-input/props.ts +62 -0
  14. package/src/client/hooks/chat/btw/index.ts +7 -73
  15. package/src/client/hooks/chat/btw/intercept.test.ts +80 -0
  16. package/src/client/hooks/chat/btw/intercept.ts +5 -2
  17. package/src/client/hooks/chat/btw/mode.ts +16 -76
  18. package/src/client/hooks/chat/timeline/actions.ts +22 -30
  19. package/src/client/hooks/chat/timeline/queue-actions.ts +88 -0
  20. package/src/client/hooks/chat/timeline/send.ts +8 -1
  21. package/src/client/hooks/chat/timeline/tui-only-guard.ts +58 -0
  22. package/src/server/lib/btw/child.server.test.ts +68 -0
  23. package/src/server/lib/btw/child.server.ts +17 -16
  24. package/src/server/lib/btw/frames.test.ts +3 -3
  25. package/src/server/lib/btw/frames.ts +1 -1
  26. package/src/server/lib/btw/lifecycle.server.test.ts +139 -0
  27. package/src/server/lib/btw/lifecycle.server.ts +41 -31
  28. package/src/server/lib/btw/prompt.ts +7 -11
  29. package/src/server/lib/btw/registry.server.ts +1 -9
  30. package/src/server/lib/btw/reply.ts +54 -0
  31. package/src/server/lib/btw/runtime.server.test.ts +128 -0
  32. package/src/server/lib/btw/runtime.server.ts +77 -86
  33. package/src/server/lib/btw/schema.server.test.ts +84 -0
  34. package/src/server/lib/btw/schema.server.ts +8 -0
  35. package/src/server/lib/btw/service.server.ts +47 -78
  36. package/src/server/lib/btw/store.server.ts +9 -20
  37. package/src/server/lib/omp/rpc/constants.ts +10 -0
  38. package/src/server/lib/omp/rpc/session-commands.ts +45 -0
  39. package/src/server/lib/omp/session/merge-stored-notices.test.ts +81 -0
  40. package/src/server/lib/omp/session/merge-stored.ts +70 -1
  41. package/src/server/lib/omp/session/messages.ts +27 -2
  42. package/src/server/routes/agent/command.ts +9 -1
  43. package/src/server/routes/btw/topics.ts +2 -59
  44. package/src/shared/lib/chat/btw/client.ts +0 -30
  45. package/src/shared/lib/chat/composer/tui-only.test.ts +90 -0
  46. package/src/shared/lib/chat/composer/tui-only.ts +138 -0
  47. package/src/shared/lib/chat/notice-text.ts +33 -0
  48. package/src/shared/lib/chat/omp/agent-events.ts +18 -37
  49. package/src/shared/lib/chat/omp/available-commands-cache.test.ts +66 -0
  50. package/src/shared/lib/chat/omp/command-output-ansi.test.ts +84 -0
  51. package/src/shared/lib/chat/omp/fold-deps.ts +48 -0
  52. package/src/shared/lib/chat/timeline/command-output.ts +65 -0
  53. package/src/shared/lib/chat/timeline/omp-callbacks.ts +4 -17
  54. package/src/shared/lib/omp/session/messages-map.ts +6 -1
  55. package/src/shared/types/btw.ts +13 -34
@@ -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' | 'failed' | 'interrupted';
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
- * captured when the topic was created (omp's `/btw` uses the active model),
27
- * then re-targeted by the panel's own model dropdown. */
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 level the side child runs at, or undefined for omp's own default.
67
- * The panel's thinking dropdown writes it, and a change is applied with
68
- * `set_thinking_level` on the live child.
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. Same reasoning as `dialogs` — the request never
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, tool calls, prose). */
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). */