@volter/supercode-frontend-vscode 0.1.30 → 0.1.32

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
@@ -391,11 +391,12 @@ export async function activate(context) {
391
391
  const id = `${selection.harness}/${encodeURIComponent(model.id || '__default__')}`;
392
392
  modelSelections.set(id, { ...selection, model: model.id });
393
393
  const provider = runtimeIdentity(selection.harness, selection.model).provider;
394
- return { id, name: model.name, family: selection.harness, version: '1',
394
+ const name = model.id ? model.name : runtimeIdentity(selection.harness, model.id).name;
395
+ return { id, name, family: selection.harness, version: '1',
395
396
  statusIcon: new vscode.ThemeIcon(provider === 'anthropic' ? 'claude' : provider === 'openai' ? 'openai' : provider === 'google' ? 'google-gemini' : 'sparkle'),
396
397
  maxInputTokens: 0, maxOutputTokens: 0, capabilities: {},
397
398
  targetChatSessionType: SESSION_SCHEME, isUserSelectable: true, isDefault: model.id === selection.model,
398
- tooltip: `${model.name} via ${harnessDisplayName(selection.harness)}${selection.effort ? ` · ${selection.effort} reasoning` : ''}. Model is fixed for this conversation. Use Model settings to choose model and reasoning for a new conversation.`,
399
+ tooltip: `${name} via ${harnessDisplayName(selection.harness)}${selection.effort ? ` · ${selection.effort} reasoning` : ''}. Model is fixed for this conversation. Use Model settings to choose model and reasoning for a new conversation.`,
399
400
  };
400
401
  });
401
402
  },
@@ -446,14 +447,21 @@ export async function activate(context) {
446
447
  && setupHandoff.baseUrl === controls?.state.connection?.SUPERCODE_FRONTEND_URL
447
448
  && connection?.baseUrl === setupHandoff.baseUrl && connection.session.connection === 'connected');
448
449
  };
449
- const revealManaged = async () => {
450
- const id = controls?.state.activeSession;
451
- if (!id || !controls?.state.openSessionCommand)
452
- throw new Error('The host cannot reveal this conversation.');
453
- 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] : []));
454
462
  const connection = frontends.get(id);
455
463
  if (controls.state.activeSession !== id || !connection || connection.session.connection !== 'connected'
456
- || connection.baseUrl !== controls.state.connection?.SUPERCODE_FRONTEND_URL) {
464
+ || connection.baseUrl !== baseUrl || controls.state.connection?.SUPERCODE_FRONTEND_URL !== baseUrl) {
457
465
  throw new Error('The conversation changed or disconnected before setup could reveal it.');
458
466
  }
459
467
  // Host readiness alone is not completion: the native reveal must succeed too.
@@ -475,28 +483,46 @@ export async function activate(context) {
475
483
  const pending = applying.then(async () => {
476
484
  if (!controls)
477
485
  return;
486
+ const generation = focusGeneration;
487
+ const focusResource = focusedResource?.toString() ?? null;
478
488
  // Discover and publish readiness even while a blank chat holds a draft.
479
489
  // Only the automatic reveal is suppressed; discovery must never stall.
480
490
  await controls.refresh();
481
491
  const state = controls.state;
482
492
  controlsChanged.fire();
483
- const preserveDraft = focusedResource?.path.startsWith('/untitled-');
484
- if (state.setup?.ready) {
493
+ if (state.setup?.ready || (!state.setup && state.connection?.SUPERCODE_FRONTEND_URL)) {
485
494
  setupRevealed = false;
486
- await connectManaged(state);
495
+ const connection = await connectManaged(state);
487
496
  controlsChanged.fire();
488
- if (!preserveDraft && !setupHandoffComplete())
489
- await revealManaged();
497
+ return { kind: 'managed', id: connection.id, baseUrl: connection.baseUrl, generation, focusResource };
490
498
  }
491
499
  else {
492
500
  setupHandoff = undefined;
493
501
  controlsChanged.fire();
494
- if (!preserveDraft)
495
- 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();
496
522
  }
497
523
  });
498
- applying = pending.then(() => undefined, () => undefined);
499
- refreshingSetup = pending.finally(() => { refreshingSetup = undefined; });
524
+ // Coalesce Check again/polling through actual reveal completion or refusal.
525
+ refreshingSetup = revealed.finally(() => { refreshingSetup = undefined; });
500
526
  return refreshingSetup;
501
527
  };
502
528
  const setupTerminals = new Map();
@@ -1205,16 +1231,7 @@ export async function activate(context) {
1205
1231
  if (!granted.has('chatSessionsProvider'))
1206
1232
  return;
1207
1233
  if (controls) {
1208
- if (controls.state.setup && !controls.state.setup.ready) {
1209
- await revealSetup();
1210
- return;
1211
- }
1212
- try {
1213
- await revealManaged();
1214
- }
1215
- catch (error) {
1216
- log.error(`Could not open the saved conversation: ${String(error)}`);
1217
- }
1234
+ await refreshSetup();
1218
1235
  return;
1219
1236
  }
1220
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/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.30",
4
+ "version": "0.1.32",
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",