@volter/supercode-frontend-vscode 0.1.31 → 0.1.33

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/README.md CHANGED
@@ -48,8 +48,13 @@ retried, and closing a terminal never counts as successful authentication.
48
48
  While setup is not ready, Chat refreshes `/state` every three seconds and exposes
49
49
  **Check again**. When the host returns a ready runtime connection, it attaches
50
50
  and reveals that conversation without a reload. Polling only finishes after both
51
- attachment and the host's native reveal command succeed for that same session
52
- and runtime URL. A transient attach/reveal failure stays pending and is retried;
51
+ attachment and the host's guarded readiness reveal command succeed for that same
52
+ session and runtime URL. Readiness/connection work completes before awaiting the
53
+ native reveal, which may call back into activation. The optional
54
+ `revealReadySessionCommand` checks the observed native conversation throughout
55
+ queued navigation; a newer draft or selection cancels that automatic reveal.
56
+ Hosts without that capability leave the handoff incomplete and direct the person
57
+ to open the conversation from history. A transient attach/reveal failure stays pending and is retried;
53
58
  **Check again** retries that handoff even when the host already reports ready.
54
59
  Changed inventory updates welcome metadata in place, without opening another
55
60
  session or moving focus. Ready connections clear the welcome and reveal the
package/dist/extension.js CHANGED
@@ -447,14 +447,21 @@ export async function activate(context) {
447
447
  && setupHandoff.baseUrl === controls?.state.connection?.SUPERCODE_FRONTEND_URL
448
448
  && connection?.baseUrl === setupHandoff.baseUrl && connection.session.connection === 'connected');
449
449
  };
450
- const revealManaged = async () => {
451
- const id = controls?.state.activeSession;
452
- if (!id || !controls?.state.openSessionCommand)
453
- throw new Error('The host cannot reveal this conversation.');
454
- await vscode.commands.executeCommand(controls.state.openSessionCommand, vscode.Uri.from({ scheme: SESSION_SCHEME, authority: id, path: '/conversation' }).toString());
450
+ const revealManaged = async (expected, readinessFocus) => {
451
+ const id = expected?.id ?? controls?.state.activeSession;
452
+ const baseUrl = expected?.baseUrl ?? controls?.state.connection?.SUPERCODE_FRONTEND_URL;
453
+ const command = readinessFocus ? controls?.state.revealReadySessionCommand : controls?.state.openSessionCommand;
454
+ if (!id || !baseUrl || !controls || !command)
455
+ throw new Error(readinessFocus
456
+ ? 'The host does not support a guarded readiness reveal. Open the conversation from history.'
457
+ : 'The host cannot reveal this conversation.');
458
+ if (controls.state.activeSession !== id || controls.state.connection?.SUPERCODE_FRONTEND_URL !== baseUrl) {
459
+ throw new vscode.CancellationError();
460
+ }
461
+ await vscode.commands.executeCommand(command, vscode.Uri.from({ scheme: SESSION_SCHEME, authority: id, path: '/conversation' }).toString(), ...(readinessFocus ? [readinessFocus.resource] : []));
455
462
  const connection = frontends.get(id);
456
463
  if (controls.state.activeSession !== id || !connection || connection.session.connection !== 'connected'
457
- || connection.baseUrl !== controls.state.connection?.SUPERCODE_FRONTEND_URL) {
464
+ || connection.baseUrl !== baseUrl || controls.state.connection?.SUPERCODE_FRONTEND_URL !== baseUrl) {
458
465
  throw new Error('The conversation changed or disconnected before setup could reveal it.');
459
466
  }
460
467
  // Host readiness alone is not completion: the native reveal must succeed too.
@@ -476,28 +483,46 @@ export async function activate(context) {
476
483
  const pending = applying.then(async () => {
477
484
  if (!controls)
478
485
  return;
486
+ const generation = focusGeneration;
487
+ const focusResource = focusedResource?.toString() ?? null;
479
488
  // Discover and publish readiness even while a blank chat holds a draft.
480
489
  // Only the automatic reveal is suppressed; discovery must never stall.
481
490
  await controls.refresh();
482
491
  const state = controls.state;
483
492
  controlsChanged.fire();
484
- const preserveDraft = focusedResource?.path.startsWith('/untitled-');
485
- if (state.setup?.ready) {
493
+ if (state.setup?.ready || (!state.setup && state.connection?.SUPERCODE_FRONTEND_URL)) {
486
494
  setupRevealed = false;
487
- await connectManaged(state);
495
+ const connection = await connectManaged(state);
488
496
  controlsChanged.fire();
489
- if (!preserveDraft && !setupHandoffComplete())
490
- await revealManaged();
497
+ return { kind: 'managed', id: connection.id, baseUrl: connection.baseUrl, generation, focusResource };
491
498
  }
492
499
  else {
493
500
  setupHandoff = undefined;
494
501
  controlsChanged.fire();
495
- if (!preserveDraft)
496
- await revealSetup();
502
+ return { kind: 'setup', generation };
503
+ }
504
+ });
505
+ // Native reveal awaits activation through connectionFor, which queues behind
506
+ // applying. Release this connection stage before asking the native view to open.
507
+ const applied = pending.then(() => undefined, () => undefined);
508
+ applying = applied;
509
+ const revealed = pending.then(async (target) => {
510
+ if (!target || !controls || applying !== applied || target.generation !== focusGeneration
511
+ || focusedResource?.path.startsWith('/untitled-'))
512
+ return;
513
+ if (target.kind === 'managed') {
514
+ if ((controls.state.setup && !controls.state.setup.ready) || controls.state.activeSession !== target.id
515
+ || controls.state.connection?.SUPERCODE_FRONTEND_URL !== target.baseUrl)
516
+ return;
517
+ if (!setupHandoffComplete())
518
+ await revealManaged(target, { resource: target.focusResource });
519
+ }
520
+ else if (!controls.state.setup?.ready) {
521
+ await revealSetup();
497
522
  }
498
523
  });
499
- applying = pending.then(() => undefined, () => undefined);
500
- refreshingSetup = pending.finally(() => { refreshingSetup = undefined; });
524
+ // Coalesce Check again/polling through actual reveal completion or refusal.
525
+ refreshingSetup = revealed.finally(() => { refreshingSetup = undefined; });
501
526
  return refreshingSetup;
502
527
  };
503
528
  const setupTerminals = new Map();
@@ -1206,16 +1231,7 @@ export async function activate(context) {
1206
1231
  if (!granted.has('chatSessionsProvider'))
1207
1232
  return;
1208
1233
  if (controls) {
1209
- if (controls.state.setup && !controls.state.setup.ready) {
1210
- await revealSetup();
1211
- return;
1212
- }
1213
- try {
1214
- await revealManaged();
1215
- }
1216
- catch (error) {
1217
- log.error(`Could not open the saved conversation: ${String(error)}`);
1218
- }
1234
+ await refreshSetup();
1219
1235
  return;
1220
1236
  }
1221
1237
  const connection = frontends.all.find((entry) => Boolean(controls) || entry.session.history.length > 0 ||
@@ -36,6 +36,8 @@ export interface HostState {
36
36
  historyTruncated?: boolean;
37
37
  activeSession: string | null;
38
38
  openSessionCommand?: string;
39
+ /** Automatic ready-session reveal checks the observed native focus through its queued commit. */
40
+ revealReadySessionCommand?: string;
39
41
  sessions: ManagedChatSession[];
40
42
  selection: ChatSelection;
41
43
  connection?: Record<string, string>;
package/dist/view.js CHANGED
@@ -386,9 +386,9 @@ export function projectEvent(event, context) {
386
386
  const summary = requestSummary(request);
387
387
  const answers = requestAnswers(request, context.connectionId);
388
388
  const subject = requestSubject(request);
389
- const title = subject
390
- ? `Approve ${subject}`
391
- : `${request.kind === 'approval' ? 'Approval' : 'Assistant'} request #${request.id}`;
389
+ const title = request.kind === 'approval'
390
+ ? 'Approval required'
391
+ : subject ? `Approve ${subject}` : `Assistant request #${request.id}`;
392
392
  // Command buttons, and MEASURED rather than assumed. Two richer
393
393
  // mechanisms were tried against a live runtime in the editor's own Chat
394
394
  // view and both failed, so neither ships:
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@volter/supercode-frontend-vscode",
3
3
  "displayName": "Volter Harness",
4
- "version": "0.1.31",
4
+ "version": "0.1.33",
5
5
  "type": "module",
6
6
  "description": "VS Code chat-view frontend for an existing Volter Harness SDK runtime",
7
7
  "publisher": "volter-ai-dev",