@volter/supercode-frontend-vscode 0.1.20 → 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.
package/dist/view.js CHANGED
@@ -1,4 +1,3 @@
1
- import { typedRequestContent } from './request-schema.js';
2
1
  /**
3
2
  * The bounded projection this presentation package renders. Mirrors
4
3
  * `@volter/supercode-frontend-browser`'s rule: the view is size-bounded
@@ -192,7 +191,7 @@ export function typedAnswer(request, reply) {
192
191
  return { kind, request_id: request.id, action: 'cancel' };
193
192
  if (['decline', 'no'].includes(normalized))
194
193
  return { kind, request_id: request.id, action: 'decline' };
195
- return { kind, request_id: request.id, action: 'accept', content: typedRequestContent(request, reply) };
194
+ return { kind, request_id: request.id, action: 'accept', content: reply };
196
195
  }
197
196
  /** The decisions a runtime said its harness accepts, when it said so. */
198
197
  export function acceptedDecisions(request) {
@@ -279,46 +278,6 @@ export function projectPendingRequests(requests, context) {
279
278
  */
280
279
  export function projectEvent(event, context) {
281
280
  const payload = payloadOf(event);
282
- // Hosted Codex 0.4.38 labels terminal polling/output notifications as tool
283
- // starts with null ids/names. The actual command item carries its identity,
284
- // command and final output; render that item rather than anonymous tool rows.
285
- const raw = payload.raw && typeof payload.raw === 'object' && !Array.isArray(payload.raw) ? payload.raw : {};
286
- if (event.kind === 'tool_call_started' && !payload.id && !payload.name &&
287
- ['item/commandExecution/terminalInteraction', 'item/commandExecution/outputDelta'].includes(text(raw.method)))
288
- return [];
289
- // Hosted harnesses retain transport metadata in replay. Known lifecycle
290
- // notices are not assistant prose; unknown events still use the bounded fallback.
291
- if (event.kind === 'native_event') {
292
- const object = (v) => v && typeof v === 'object' && !Array.isArray(v) ? v : {};
293
- const raw = object(payload.raw);
294
- const params = object(raw.params);
295
- const kind = text(payload.kind).toLowerCase();
296
- const item = object(params.item);
297
- if (['item/started', 'item/completed'].includes(kind) && item.type === 'commandExecution' && typeof item.id === 'string') {
298
- return projectEvent({ ...event, kind: kind === 'item/started' ? 'tool_call_started' : 'tool_call_completed', payload: {
299
- id: item.id, name: 'Shell', arguments: JSON.stringify({ command: item.command, cwd: item.cwd }),
300
- output: item.aggregatedOutput ?? '', is_error: typeof item.exitCode === 'number' && item.exitCode !== 0,
301
- } }, context);
302
- }
303
- if (['turn/started', 'thread/started', 'thread/status/changed', 'thread/tokenusage/updated', 'account/ratelimits/updated', 'remotecontrol/status/changed', 'thread/goal/cleared'].includes(kind))
304
- return [];
305
- if (['item/started', 'item/completed'].includes(kind) && ['userMessage', 'agentMessage', 'reasoning'].includes(text(object(params.item).type)))
306
- return [];
307
- if (kind === 'mcpserver/startupstatus/updated') {
308
- if (params.error)
309
- return [stable({ part: 'warning', value: text(params.error) })];
310
- if (['starting', 'ready'].includes(text(params.status)))
311
- return [];
312
- }
313
- if (kind === 'deprecationnotice')
314
- return [stable({ part: 'progress', value: text(params.summary, 'Harness deprecation notice') })];
315
- if (kind === 'system') {
316
- if (['init', 'hook_started', 'thinking_tokens'].includes(text(raw.subtype)))
317
- return [];
318
- if (raw.subtype === 'hook_response' && raw.exit_code === 0)
319
- return [];
320
- }
321
- }
322
281
  switch (event.kind) {
323
282
  // crates/harness/src/server.rs `submit_claimed` — the runtime's echo of the
324
283
  // prompt. VS Code already renders the request turn, so the live view drops
@@ -449,7 +408,7 @@ export function projectEvent(event, context) {
449
408
  // once pushed (`chatCommandContentPart` enables on `!isStale` and has no
450
409
  // used-state), so `supercode.frontend.respond` refuses a request that is
451
410
  // no longer pending and SAYS so instead of sending a stale answer.
452
- if (context.canRespond === false) {
411
+ if (context.canRespond === false || (request.payload && typeof request.payload === 'object' && !Array.isArray(request.payload) && request.payload.observe_only === true)) {
453
412
  return [stable({
454
413
  part: 'markdown',
455
414
  value: `\n\n**${title}**\n\n${summary}\n\n_This runtime answers its own requests; Volter Harness is observing._\n\n`,
@@ -535,17 +494,14 @@ export function projectEvent(event, context) {
535
494
  fallback: [{ part: 'markdown', value: `> ⚠ ${value}` }],
536
495
  }];
537
496
  }
538
- // crates/harness/src/runtime/hosted.rs `native_payload`, declared by the
539
- // hosted descriptor: a harness's own event that has no canonical
540
- // projection (pi's `agent_start`, `message_update`'s `text_start`, …).
541
- // What the turn says arrives beside it as `text_delta`/`tool_call_*`, so
542
- // it is a transient status line naming the harness's kind, never a JSON
543
- // 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.
544
499
  case 'native_event':
545
- return [stable({
546
- part: 'progress',
547
- value: clamp(stripControls(text(payload.kind, 'native event')), VSCODE_CHAT_LIMITS.titleCharacters),
548
- })];
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) })];
549
505
  // Not in this runtime's declared set; read the way
550
506
  // crates/frontend-model/src/transcript.rs reads a donor that emits them.
551
507
  case 'reasoning':
@@ -700,6 +656,13 @@ export function projectHistory(history, granted, pendingToolNames = new Set()) {
700
656
  if (message.role === 'system')
701
657
  continue;
702
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
+ }
703
666
  if (body) {
704
667
  pushAssistant([{ part: 'markdown', value: clamp(stripControls(body), VSCODE_CHAT_LIMITS.partCharacters) }]);
705
668
  }
@@ -745,9 +708,9 @@ export function projectHistory(history, granted, pendingToolNames = new Set()) {
745
708
  const output = clamp(stripControls(body), VSCODE_CHAT_LIMITS.partCharacters);
746
709
  if (row) {
747
710
  row.resultText = output;
748
- // Canonical ChatMessage has no general error flag. Only this known
749
- // synthetic marker establishes interruption; do not guess from prose.
750
- 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)))
751
714
  row.isError = true;
752
715
  toolRows.delete(message.tool_call_id);
753
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.20",
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",
@@ -23,7 +23,7 @@
23
23
  "media"
24
24
  ],
25
25
  "scripts": {
26
- "build": "node scripts/sync-sdk.mjs && node scripts/fetch-icon.mjs && tsc -p tsconfig.build.json && node scripts/build-request-schema.mjs",
26
+ "build": "node -e \"require('node:fs').rmSync('dist', {recursive:true, force:true})\" && node scripts/sync-sdk.mjs && node scripts/fetch-icon.mjs && tsc -p tsconfig.build.json",
27
27
  "extension": "npm run build && node scripts/pack-extension.mjs",
28
28
  "prepack": "npm run build"
29
29
  },
@@ -194,14 +194,8 @@
194
194
  "devDependencies": {
195
195
  "@types/node": "22.10.0",
196
196
  "@types/vscode": "1.138.0",
197
- "ajv": "8.18.0",
198
- "ajv-formats": "3.0.1",
199
- "esbuild": "0.28.2",
200
197
  "typescript": "5.6.3"
201
198
  },
202
- "supercodeFrontendWelcome": {
203
- "starterIntroduction": "Choose an idea to edit before sending:"
204
- },
205
199
  "supercodeFrontendContract": {
206
200
  "name": "@volter/supercode-frontend",
207
201
  "version": "0.2.7",
@@ -1,157 +0,0 @@
1
- ajv
2
-
3
- The MIT License (MIT)
4
-
5
- Copyright (c) 2015-2021 Evgeny Poberezkin
6
-
7
- Permission is hereby granted, free of charge, to any person obtaining a copy
8
- of this software and associated documentation files (the "Software"), to deal
9
- in the Software without restriction, including without limitation the rights
10
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- copies of the Software, and to permit persons to whom the Software is
12
- furnished to do so, subject to the following conditions:
13
-
14
- The above copyright notice and this permission notice shall be included in all
15
- copies or substantial portions of the Software.
16
-
17
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
- SOFTWARE.
24
-
25
-
26
-
27
- ajv-formats
28
-
29
- MIT License
30
-
31
- Copyright (c) 2020 Evgeny Poberezkin
32
-
33
- Permission is hereby granted, free of charge, to any person obtaining a copy
34
- of this software and associated documentation files (the "Software"), to deal
35
- in the Software without restriction, including without limitation the rights
36
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
37
- copies of the Software, and to permit persons to whom the Software is
38
- furnished to do so, subject to the following conditions:
39
-
40
- The above copyright notice and this permission notice shall be included in all
41
- copies or substantial portions of the Software.
42
-
43
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
44
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
45
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
46
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
47
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
48
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
49
- SOFTWARE.
50
-
51
-
52
- fast-deep-equal
53
-
54
- MIT License
55
-
56
- Copyright (c) 2017 Evgeny Poberezkin
57
-
58
- Permission is hereby granted, free of charge, to any person obtaining a copy
59
- of this software and associated documentation files (the "Software"), to deal
60
- in the Software without restriction, including without limitation the rights
61
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
62
- copies of the Software, and to permit persons to whom the Software is
63
- furnished to do so, subject to the following conditions:
64
-
65
- The above copyright notice and this permission notice shall be included in all
66
- copies or substantial portions of the Software.
67
-
68
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
69
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
70
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
71
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
72
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
73
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
74
- SOFTWARE.
75
-
76
-
77
- fast-uri
78
-
79
- Copyright (c) 2011-2021, Gary Court until https://github.com/garycourt/uri-js/commit/a1acf730b4bba3f1097c9f52e7d9d3aba8cdcaae
80
- Copyright (c) 2021-present The Fastify team <https://github.com/fastify/fastify#team>
81
- All rights reserved.
82
-
83
- Redistribution and use in source and binary forms, with or without
84
- modification, are permitted provided that the following conditions are met:
85
- * Redistributions of source code must retain the above copyright
86
- notice, this list of conditions and the following disclaimer.
87
- * Redistributions in binary form must reproduce the above copyright
88
- notice, this list of conditions and the following disclaimer in the
89
- documentation and/or other materials provided with the distribution.
90
- * The names of any contributors may not be used to endorse or promote
91
- products derived from this software without specific prior written
92
- permission.
93
-
94
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
95
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
96
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
97
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY
98
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
99
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
100
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
101
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
102
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
103
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
104
-
105
- * * *
106
-
107
- The complete list of contributors can be found at:
108
- - https://github.com/garycourt/uri-js/graphs/contributors
109
-
110
- json-schema-traverse
111
-
112
- MIT License
113
-
114
- Copyright (c) 2017 Evgeny Poberezkin
115
-
116
- Permission is hereby granted, free of charge, to any person obtaining a copy
117
- of this software and associated documentation files (the "Software"), to deal
118
- in the Software without restriction, including without limitation the rights
119
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
120
- copies of the Software, and to permit persons to whom the Software is
121
- furnished to do so, subject to the following conditions:
122
-
123
- The above copyright notice and this permission notice shall be included in all
124
- copies or substantial portions of the Software.
125
-
126
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
127
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
128
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
129
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
130
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
131
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
132
- SOFTWARE.
133
-
134
-
135
- require-from-string
136
-
137
- The MIT License (MIT)
138
-
139
- Copyright (c) Vsevolod Strukchinsky <floatdrop@gmail.com> (github.com/floatdrop)
140
-
141
- Permission is hereby granted, free of charge, to any person obtaining a copy
142
- of this software and associated documentation files (the "Software"), to deal
143
- in the Software without restriction, including without limitation the rights
144
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
145
- copies of the Software, and to permit persons to whom the Software is
146
- furnished to do so, subject to the following conditions:
147
-
148
- The above copyright notice and this permission notice shall be included in
149
- all copies or substantial portions of the Software.
150
-
151
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
152
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
153
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
154
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
155
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
156
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
157
- THE SOFTWARE.
@@ -1,22 +0,0 @@
1
- import type { FrontendRequest, JsonValue } from '../vendor/supercode-frontend/generated.mjs';
2
- export declare function objectValue(value: JsonValue | undefined): Record<string, JsonValue> | undefined;
3
- /** Adapt only Codex's typed MCP form schema. Other modes carry arbitrary JSON Schema. */
4
- export declare function adaptRequestSchema(schema: JsonValue, mode: JsonValue | undefined): JsonValue;
5
- /** Validate without changing answers, filling defaults, or fetching external refs. */
6
- export declare function requestValidator(schema: JsonValue): (value: JsonValue) => string | undefined;
7
- /** Plain-text and single-question responses retain their exact text. */
8
- export declare function typedRequestContent(request: FrontendRequest, reply: string): JsonValue;
9
- export interface FieldChoice {
10
- label: string;
11
- value: JsonValue;
12
- }
13
- export type FieldControl = {
14
- kind: 'select';
15
- choices: FieldChoice[];
16
- multiple: boolean;
17
- } | {
18
- kind: 'text';
19
- type: 'string' | 'number' | 'integer';
20
- };
21
- /** Only known shapes get native controls; everything else keeps its full schema. */
22
- export declare function fieldControl(field: Record<string, JsonValue>): FieldControl | undefined;