@pellux/goodvibes-sdk 0.21.12 → 0.21.15

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.
@@ -211,9 +211,12 @@ async function handlePostSharedSessionMessage(context, sessionId, req) {
211
211
  context: `shared-session:${followUpSubmission.session.id}`,
212
212
  });
213
213
  }
214
- // kind='message' — route like TUI input: call submitMessage(), allow agent to spawn or queue
215
- // based on session state, stream turn events back to both TUI and companion over SSE.
216
- // Note: also appends the companion message to the session log before submitting.
214
+ // kind='message' — companion main-chat send. Persist + publish COMPANION_MESSAGE_RECEIVED
215
+ // on the runtime bus; TUI's bootstrap-core subscriber delegates to
216
+ // orchestrator.handleUserInput() which fires a real LLM turn (same entry as TUI input
217
+ // box). Turn events stream to both TUI and companion over SSE automatically.
218
+ // Deliberately short-circuits BEFORE sessionBroker.submitMessage() to avoid the
219
+ // buildContinuationTask WRFC engineer-chain spawn path.
217
220
  if (kind === 'message') {
218
221
  const session = context.sessionBroker.getSession(sessionId);
219
222
  if (!session) {
@@ -239,6 +242,18 @@ async function handlePostSharedSessionMessage(context, sessionId, req) {
239
242
  source: 'companion-followup',
240
243
  timestamp,
241
244
  });
245
+ // Return immediately. appendCompanionMessage persists the message and
246
+ // publishConversationFollowup emits COMPANION_MESSAGE_RECEIVED on the runtime bus.
247
+ // The TUI's bootstrap-core.ts COMPANION_MESSAGE_RECEIVED subscriber delegates to
248
+ // orchestrator.handleUserInput(), which adds the user message to the conversation
249
+ // view and fires a real LLM turn whose events stream to both TUI and companion SSE.
250
+ // The { routedTo: 'conversation' } shape signals the companion app that the message
251
+ // was received and persisted (isConversationRouteResult check).
252
+ return context.recordApiResponse(req, `/api/sessions/${sessionId}/messages`, Response.json({
253
+ messageId,
254
+ routedTo: 'conversation',
255
+ sessionId,
256
+ }, { status: 202 }));
242
257
  }
243
258
  const submission = await context.sessionBroker.submitMessage(buildSharedSessionMessageInput(sessionId, body, message));
244
259
  return await respondToSessionSubmission(context, req, submission, message, `/api/sessions/${sessionId}/messages`, 'DaemonServer.handlePostSharedSessionMessage', {
@@ -1,6 +1,6 @@
1
1
  import { readFileSync } from 'node:fs';
2
2
  import { join } from 'node:path';
3
- let version = '0.21.12';
3
+ let version = '0.21.15';
4
4
  try {
5
5
  const pkg = JSON.parse(readFileSync(join(import.meta.dir, '..', '..', 'package.json'), 'utf-8'));
6
6
  version = pkg.version ?? version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pellux/goodvibes-sdk",
3
- "version": "0.21.12",
3
+ "version": "0.21.15",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/mgd34msu/goodvibes-sdk.git"