@volter/supercode-frontend-vscode 0.1.21 → 0.1.22

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 (2) hide show
  1. package/dist/view.js +18 -54
  2. package/package.json +1 -1
package/dist/view.js CHANGED
@@ -278,46 +278,6 @@ export function projectPendingRequests(requests, context) {
278
278
  */
279
279
  export function projectEvent(event, context) {
280
280
  const payload = payloadOf(event);
281
- // Hosted Codex 0.4.38 labels terminal polling/output notifications as tool
282
- // starts with null ids/names. The actual command item carries its identity,
283
- // command and final output; render that item rather than anonymous tool rows.
284
- const raw = payload.raw && typeof payload.raw === 'object' && !Array.isArray(payload.raw) ? payload.raw : {};
285
- if (event.kind === 'tool_call_started' && !payload.id && !payload.name &&
286
- ['item/commandExecution/terminalInteraction', 'item/commandExecution/outputDelta'].includes(text(raw.method)))
287
- return [];
288
- // Hosted harnesses retain transport metadata in replay. Known lifecycle
289
- // notices are not assistant prose; unknown events still use the bounded fallback.
290
- if (event.kind === 'native_event') {
291
- const object = (v) => v && typeof v === 'object' && !Array.isArray(v) ? v : {};
292
- const raw = object(payload.raw);
293
- const params = object(raw.params);
294
- const kind = text(payload.kind).toLowerCase();
295
- const item = object(params.item);
296
- if (['item/started', 'item/completed'].includes(kind) && item.type === 'commandExecution' && typeof item.id === 'string') {
297
- return projectEvent({ ...event, kind: kind === 'item/started' ? 'tool_call_started' : 'tool_call_completed', payload: {
298
- id: item.id, name: 'Shell', arguments: JSON.stringify({ command: item.command, cwd: item.cwd }),
299
- output: item.aggregatedOutput ?? '', is_error: typeof item.exitCode === 'number' && item.exitCode !== 0,
300
- } }, context);
301
- }
302
- if (['turn/started', 'thread/started', 'thread/status/changed', 'thread/tokenusage/updated', 'account/ratelimits/updated', 'remotecontrol/status/changed', 'thread/goal/cleared'].includes(kind))
303
- return [];
304
- if (['item/started', 'item/completed'].includes(kind) && ['userMessage', 'agentMessage', 'reasoning'].includes(text(object(params.item).type)))
305
- return [];
306
- if (kind === 'mcpserver/startupstatus/updated') {
307
- if (params.error)
308
- return [stable({ part: 'warning', value: text(params.error) })];
309
- if (['starting', 'ready'].includes(text(params.status)))
310
- return [];
311
- }
312
- if (kind === 'deprecationnotice')
313
- return [stable({ part: 'progress', value: text(params.summary, 'Harness deprecation notice') })];
314
- if (kind === 'system') {
315
- if (['init', 'hook_started', 'thinking_tokens'].includes(text(raw.subtype)))
316
- return [];
317
- if (raw.subtype === 'hook_response' && raw.exit_code === 0)
318
- return [];
319
- }
320
- }
321
281
  switch (event.kind) {
322
282
  // crates/harness/src/server.rs `submit_claimed` — the runtime's echo of the
323
283
  // prompt. VS Code already renders the request turn, so the live view drops
@@ -448,7 +408,7 @@ export function projectEvent(event, context) {
448
408
  // once pushed (`chatCommandContentPart` enables on `!isStale` and has no
449
409
  // used-state), so `supercode.frontend.respond` refuses a request that is
450
410
  // no longer pending and SAYS so instead of sending a stale answer.
451
- if (context.canRespond === false) {
411
+ if (context.canRespond === false || (request.payload && typeof request.payload === 'object' && !Array.isArray(request.payload) && request.payload.observe_only === true)) {
452
412
  return [stable({
453
413
  part: 'markdown',
454
414
  value: `\n\n**${title}**\n\n${summary}\n\n_This runtime answers its own requests; Volter Harness is observing._\n\n`,
@@ -534,17 +494,14 @@ export function projectEvent(event, context) {
534
494
  fallback: [{ part: 'markdown', value: `> ⚠ ${value}` }],
535
495
  }];
536
496
  }
537
- // crates/harness/src/runtime/hosted.rs `native_payload`, declared by the
538
- // hosted descriptor: a harness's own event that has no canonical
539
- // projection (pi's `agent_start`, `message_update`'s `text_start`, …).
540
- // What the turn says arrives beside it as `text_delta`/`tool_call_*`, so
541
- // it is a transient status line naming the harness's kind, never a JSON
542
- // block in the transcript.
497
+ // Raw protocol records are retained for diagnostics, not conversation.
498
+ // Each harness's core projector emits canonical content and warnings.
543
499
  case 'native_event':
544
- return [stable({
545
- part: 'progress',
546
- value: clamp(stripControls(text(payload.kind, 'native event')), VSCODE_CHAT_LIMITS.titleCharacters),
547
- })];
500
+ return [];
501
+ case 'status':
502
+ return [stable({ part: 'progress', value: clamp(stripControls(text(payload.message)), VSCODE_CHAT_LIMITS.partCharacters) })];
503
+ case 'warning':
504
+ return [stable({ part: 'warning', value: clamp(stripControls(text(payload.message)), VSCODE_CHAT_LIMITS.partCharacters) })];
548
505
  // Not in this runtime's declared set; read the way
549
506
  // crates/frontend-model/src/transcript.rs reads a donor that emits them.
550
507
  case 'reasoning':
@@ -699,6 +656,13 @@ export function projectHistory(history, granted, pendingToolNames = new Set()) {
699
656
  if (message.role === 'system')
700
657
  continue;
701
658
  if (message.role === 'assistant') {
659
+ if (Array.isArray(message.content)) {
660
+ for (const part of message.content) {
661
+ if (part && typeof part === 'object' && !Array.isArray(part) && part.type === 'reasoning') {
662
+ pushAssistant(resolveParts(projectEvent({ sequence: 0, kind: 'reasoning', payload: { text: part.text } }, { connectionId: 'history' }), granted));
663
+ }
664
+ }
665
+ }
702
666
  if (body) {
703
667
  pushAssistant([{ part: 'markdown', value: clamp(stripControls(body), VSCODE_CHAT_LIMITS.partCharacters) }]);
704
668
  }
@@ -744,9 +708,9 @@ export function projectHistory(history, granted, pendingToolNames = new Set()) {
744
708
  const output = clamp(stripControls(body), VSCODE_CHAT_LIMITS.partCharacters);
745
709
  if (row) {
746
710
  row.resultText = output;
747
- // Canonical ChatMessage has no general error flag. Only this known
748
- // synthetic marker establishes interruption; do not guess from prose.
749
- if (body === '[no tool result recorded — turn interrupted]')
711
+ // Structured native outcomes and the known interruption marker
712
+ // establish failure; do not guess from arbitrary result prose.
713
+ if (body === '[no tool result recorded — turn interrupted]' || (Array.isArray(message.content) && message.content.some(part => part && typeof part === 'object' && !Array.isArray(part) && part.is_error === true)))
750
714
  row.isError = true;
751
715
  toolRows.delete(message.tool_call_id);
752
716
  }
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.21",
4
+ "version": "0.1.22",
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",