@volter/supercode-frontend-vscode 0.1.11

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 (39) hide show
  1. package/NOTICE.md +19 -0
  2. package/README.md +293 -0
  3. package/dist/bindings.d.ts +7 -0
  4. package/dist/bindings.js +5 -0
  5. package/dist/client.d.ts +11 -0
  6. package/dist/client.js +5 -0
  7. package/dist/context.d.ts +6 -0
  8. package/dist/context.js +14 -0
  9. package/dist/credential.d.ts +17 -0
  10. package/dist/credential.js +53 -0
  11. package/dist/extension.d.ts +39 -0
  12. package/dist/extension.js +1131 -0
  13. package/dist/host-controls.d.ts +58 -0
  14. package/dist/host-controls.js +66 -0
  15. package/dist/index.d.ts +6 -0
  16. package/dist/index.js +5 -0
  17. package/dist/native-session.d.ts +6 -0
  18. package/dist/native-session.js +41 -0
  19. package/dist/proposals.d.ts +24 -0
  20. package/dist/proposals.js +54 -0
  21. package/dist/session.d.ts +154 -0
  22. package/dist/session.js +431 -0
  23. package/dist/view.d.ts +176 -0
  24. package/dist/view.js +717 -0
  25. package/media/anthropic.svg +1 -0
  26. package/media/google.svg +1 -0
  27. package/media/icon.png +0 -0
  28. package/media/openai.svg +1 -0
  29. package/package.json +200 -0
  30. package/scripts/pack-extension.mjs +63 -0
  31. package/vendor/supercode-frontend/README.md +22 -0
  32. package/vendor/supercode-frontend/client.d.mts +106 -0
  33. package/vendor/supercode-frontend/client.mjs +300 -0
  34. package/vendor/supercode-frontend/contract.json +289 -0
  35. package/vendor/supercode-frontend/generated-client.d.mts +18 -0
  36. package/vendor/supercode-frontend/generated-client.mjs +20 -0
  37. package/vendor/supercode-frontend/generated.d.mts +146 -0
  38. package/vendor/supercode-frontend/generated.mjs +19 -0
  39. package/vendor/supercode-frontend/package.json +20 -0
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="-1 3.5 26 18" fill="#d97757"><path fill-rule="evenodd" d="M20.998 10.949H24v3.102h-3v3.028h-1.487V20H18v-2.921h-1.487V20H15v-2.921H9V20H7.488v-2.921H6V20H4.487v-2.921H3V14.05H0V10.95h3V5h17.998v5.949zM6 10.949h1.488V8.102H6v2.847zm10.51 0H18V8.102h-1.49v2.847z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#8b8df8"><path fill-rule="evenodd" d="M12 24C12 17.373 6.627 12 0 12 6.627 12 12 6.627 12 0c0 6.627 5.373 12 12 12-6.627 0-12 5.373-12 12z"/></svg>
package/media/icon.png ADDED
Binary file
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="-1 -1 26 26" fill="#aaaaaa"><path fill-rule="evenodd" d="M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"/></svg>
package/package.json ADDED
@@ -0,0 +1,200 @@
1
+ {
2
+ "name": "@volter/supercode-frontend-vscode",
3
+ "displayName": "Volter Harness",
4
+ "version": "0.1.11",
5
+ "type": "module",
6
+ "description": "VS Code chat-view frontend for an existing Volter Harness SDK runtime",
7
+ "publisher": "volter-ai-dev",
8
+ "icon": "media/icon.png",
9
+ "main": "./dist/extension.js",
10
+ "exports": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js"
13
+ },
14
+ "types": "./dist/index.d.ts",
15
+ "files": [
16
+ "dist",
17
+ "vendor/supercode-frontend",
18
+ "scripts/pack-extension.mjs",
19
+ "README.md",
20
+ "NOTICE.md",
21
+ "media"
22
+ ],
23
+ "scripts": {
24
+ "build": "node scripts/sync-sdk.mjs && node scripts/fetch-icon.mjs && tsc -p tsconfig.build.json",
25
+ "test": "npm run build && node --test test/*.test.mjs",
26
+ "typecheck": "tsc -p test/tsconfig.json --noEmit",
27
+ "extension": "npm run build && node scripts/pack-extension.mjs",
28
+ "prepack": "npm run build"
29
+ },
30
+ "engines": {
31
+ "node": ">=20",
32
+ "vscode": "^1.138.0"
33
+ },
34
+ "categories": [
35
+ "Chat",
36
+ "Other"
37
+ ],
38
+ "extensionKind": [
39
+ "workspace",
40
+ "ui"
41
+ ],
42
+ "activationEvents": [
43
+ "onStartupFinished"
44
+ ],
45
+ "enabledApiProposals": [
46
+ "defaultChatParticipant",
47
+ "chatParticipantPrivate",
48
+ "chatParticipantAdditions",
49
+ "chatSessionsProvider",
50
+ "chatProvider"
51
+ ],
52
+ "contributes": {
53
+ "chatParticipants": [
54
+ {
55
+ "id": "supercode.chat",
56
+ "name": "supercode",
57
+ "fullName": "Assistant",
58
+ "description": "Ask a question or describe a task",
59
+ "when": "!supercodeChatDefaultParticipant",
60
+ "sampleRequest": "list the files here"
61
+ },
62
+ {
63
+ "id": "supercode.chat.default",
64
+ "name": "supercode",
65
+ "fullName": "Assistant",
66
+ "description": "Ask a question or describe a task",
67
+ "isDefault": true,
68
+ "when": "supercodeChatDefaultParticipant",
69
+ "sampleRequest": "list the files here",
70
+ "locations": [
71
+ "panel"
72
+ ],
73
+ "modes": [
74
+ "agent",
75
+ "ask"
76
+ ]
77
+ }
78
+ ],
79
+ "chatSessions": [
80
+ {
81
+ "type": "supercode",
82
+ "name": "supercode-runtime",
83
+ "displayName": "Harness",
84
+ "description": "Conversations with your AI assistant",
85
+ "icon": "$(server-process)",
86
+ "welcomeTitle": "Chat",
87
+ "welcomeMessage": "Ask a question or continue a saved conversation.",
88
+ "inputPlaceholder": "Ask a question or describe a task",
89
+ "order": 1,
90
+ "capabilities": {
91
+ "supportsFileAttachments": true,
92
+ "supportsToolAttachments": false,
93
+ "supportsImageAttachments": false
94
+ },
95
+ "canDelegate": false,
96
+ "supportsAutoModel": false,
97
+ "requiresCustomModels": true
98
+ }
99
+ ],
100
+ "chatViewsWelcome": [
101
+ {
102
+ "icon": "$(server-process)",
103
+ "title": "Volter Harness",
104
+ "content": "Volter Harness is not attached to a runtime.\n[Set runtime token](command:supercode.frontend.setToken)\n[Attach](command:supercode.frontend.connect)",
105
+ "when": "!supercodeAttached"
106
+ }
107
+ ],
108
+ "commands": [
109
+ {
110
+ "command": "supercode.frontend.setToken",
111
+ "title": "Set Runtime Token",
112
+ "category": "Volter Harness"
113
+ },
114
+ {
115
+ "command": "supercode.frontend.connect",
116
+ "title": "Attach to Runtime",
117
+ "category": "Volter Harness"
118
+ },
119
+ {
120
+ "command": "supercode.frontend.disconnect",
121
+ "title": "Detach from Runtime",
122
+ "category": "Volter Harness"
123
+ },
124
+ {
125
+ "command": "supercode.frontend.status",
126
+ "title": "Show Runtime Status",
127
+ "category": "Volter Harness"
128
+ },
129
+ {
130
+ "command": "supercode.frontend.newSession",
131
+ "title": "New Volter Harness Runtime Session",
132
+ "category": "Volter Harness",
133
+ "icon": "$(server-process)"
134
+ },
135
+ {
136
+ "command": "supercode.frontend.respond",
137
+ "title": "Answer Runtime Request",
138
+ "category": "Volter Harness",
139
+ "enablement": "false"
140
+ },
141
+ {
142
+ "command": "supercode.frontend.configure",
143
+ "title": "New Chat: Choose Harness, Model and Reasoning",
144
+ "category": "Chat",
145
+ "icon": "$(add)"
146
+ }
147
+ ],
148
+ "configuration": {
149
+ "title": "Volter Harness",
150
+ "properties": {
151
+ "supercode.frontend.baseUrl": {
152
+ "type": "string",
153
+ "default": "",
154
+ "description": "Base URL of an already-running Volter Harness SDK runtime (`supercode serve` prints it). The runtime credential is NEVER a setting \u2014 run `Volter Harness: Set Runtime Token`, which stores it in SecretStorage."
155
+ },
156
+ "supercode.frontend.permissions": {
157
+ "type": "array",
158
+ "default": [
159
+ "observe"
160
+ ],
161
+ "items": {
162
+ "type": "string",
163
+ "enum": [
164
+ "observe",
165
+ "interact",
166
+ "approve",
167
+ "terminate"
168
+ ]
169
+ },
170
+ "description": "Permissions to request when attaching. `observe` is always included; every control is still rendered only when the runtime's own descriptor advertises the matching action."
171
+ }
172
+ }
173
+ },
174
+ "menus": {
175
+ "chatSessions/newSession": [
176
+ {
177
+ "command": "supercode.frontend.newSession",
178
+ "when": "chatSessionType == supercode"
179
+ }
180
+ ]
181
+ },
182
+ "languageModelChatProviders": [
183
+ {
184
+ "vendor": "supercode-runtime",
185
+ "displayName": "Runtime models"
186
+ }
187
+ ]
188
+ },
189
+ "devDependencies": {
190
+ "@types/node": "22.10.0",
191
+ "@types/vscode": "1.138.0",
192
+ "typescript": "5.6.3"
193
+ },
194
+ "supercodeFrontendContract": {
195
+ "name": "@volter/supercode-frontend",
196
+ "version": "0.2.4",
197
+ "mode": "generated-artifact"
198
+ },
199
+ "license": "MIT OR Apache-2.0"
200
+ }
@@ -0,0 +1,63 @@
1
+ #!/usr/bin/env node
2
+ // Emit the VS Code extension folder for this npm package.
3
+ //
4
+ // One `package.json` cannot be both: npm wants the scoped
5
+ // `@volter/supercode-frontend-vscode`, while VS Code builds an extension
6
+ // id as `${publisher}.${name}` and a scope would put an `@` and a `/` in it.
7
+ // So the npm manifest is the source of truth and this writes the extension's
8
+ // manifest beside the same built files, with the plain name that resolves to
9
+ // `volter-ai-dev.supercode-frontend-vscode`. `--vsix` then runs the stock
10
+ // packer over that folder; the folder itself is what `--extensions-dir` wants.
11
+ //
12
+ // node scripts/pack-extension.mjs [--out <dir>] [--no-proposals] [--vsix]
13
+ //
14
+ // `--no-proposals` drops `enabledApiProposals`, which is exactly the manifest a
15
+ // host that grants nothing leaves behind (the workbench nulls the list it did
16
+ // not allow). It is how the stable-parts-only degrade is exercised.
17
+ import {cp, mkdir, readFile, rm, writeFile} from 'node:fs/promises';
18
+ import {existsSync} from 'node:fs';
19
+ import path from 'node:path';
20
+ import {fileURLToPath} from 'node:url';
21
+ import {spawnSync} from 'node:child_process';
22
+
23
+ const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
24
+ const args = process.argv.slice(2);
25
+ const outIndex = args.indexOf('--out');
26
+ const out = path.resolve(root, outIndex >= 0 ? args[outIndex + 1] : '.extension');
27
+ const withoutProposals = args.includes('--no-proposals');
28
+
29
+ const manifest = JSON.parse(await readFile(path.join(root, 'package.json'), 'utf8'));
30
+ const extensionName = manifest.name.replace(/^@[^/]+\//, '');
31
+
32
+ const extensionManifest = {
33
+ ...manifest,
34
+ name: extensionName,
35
+ scripts: undefined,
36
+ devDependencies: undefined,
37
+ files: undefined,
38
+ supercodeFrontendContract: manifest.supercodeFrontendContract,
39
+ };
40
+ if (withoutProposals) delete extensionManifest.enabledApiProposals;
41
+ for (const key of Object.keys(extensionManifest)) {
42
+ if (extensionManifest[key] === undefined) delete extensionManifest[key];
43
+ }
44
+
45
+ // media/icon.png is fetched by the build (scripts/fetch-icon.mjs), which `extension` runs first.
46
+
47
+ await rm(out, {recursive: true, force: true});
48
+ await mkdir(out, {recursive: true});
49
+ await writeFile(path.join(out, 'package.json'), `${JSON.stringify(extensionManifest, null, 2)}\n`);
50
+ for (const entry of ['dist', 'vendor', 'media', 'README.md', 'NOTICE.md']) {
51
+ const source = path.join(root, entry);
52
+ if (existsSync(source)) await cp(source, path.join(out, entry), {recursive: true});
53
+ }
54
+
55
+ if (args.includes('--vsix')) {
56
+ const result = spawnSync('npx', ['--yes', '@vscode/vsce', 'package', '--no-dependencies', '--allow-missing-repository'], {
57
+ cwd: out,
58
+ stdio: 'inherit',
59
+ });
60
+ if (result.status !== 0) process.exit(result.status ?? 1);
61
+ }
62
+
63
+ process.stdout.write(`${path.relative(root, out)}${withoutProposals ? ' (no proposals requested)' : ''}\n`);
@@ -0,0 +1,22 @@
1
+ # `@volter/supercode-frontend`
2
+
3
+ This package is the generated, presentation-free attachment facade for one
4
+ already-running Volter Harness SDK runtime. It describes and attaches to canonical
5
+ history, consumes cursor-safe sequenced events, and sends semantic SDK actions.
6
+ It does not import sessions, select providers/models/reduction policies, start
7
+ agents, or own persistence.
8
+
9
+ The checked-in `contract.json` is the self-contained versioned
10
+ language-neutral IDL: it defines every wire object, tagged union, request,
11
+ event, action, result, error, and opaque-extension boundary without referring
12
+ to Rust or TypeScript types. Run `npm run check` to prove the typed Rust and
13
+ TypeScript clients are byte-identical to generator output. The HTTP client
14
+ opens SSE before taking its attachment snapshot, closing the history/live
15
+ race; HTTP uses bearer authentication plus an opaque client id and permission
16
+ narrowing. Dropping or detaching this client never closes the runtime;
17
+ `close()` is a separate terminate-authorized action.
18
+
19
+ `FrontendWebSocketClient.connect()` requires a header-capable socket factory
20
+ and passes the bearer token only in `Authorization`. It deliberately has no
21
+ query-token fallback: browser clients that cannot set upgrade headers use the
22
+ HTTP/SSE binding until a separately approved credential bootstrap exists.
@@ -0,0 +1,106 @@
1
+ import type {
2
+ FrontendAttachSnapshot,
3
+ FrontendEvent,
4
+ FrontendOperationInvocation,
5
+ FrontendOperationResult,
6
+ FrontendResponse,
7
+ FrontendRuntimeDescriptor,
8
+ RuntimeLeaseSnapshot,
9
+ } from './generated.mjs';
10
+ import { GeneratedFrontendClient } from './generated-client.mjs';
11
+
12
+ export * from './generated.mjs';
13
+ export { GeneratedFrontendClient } from './generated-client.mjs';
14
+ export const FRONTEND_SCHEMA: 'supercode.frontend.contract.v2';
15
+ export const FRONTEND_METHODS: Readonly<Record<import('./generated.mjs').FrontendMethodId, import('./generated.mjs').FrontendWireMethod>>;
16
+ export const FRONTEND_EVENT_METHOD: 'frontend.v2.event';
17
+
18
+ export interface FrontendClientOptions {
19
+ baseUrl: string;
20
+ token: string;
21
+ clientId?: string;
22
+ permissions?: Array<'observe' | 'interact' | 'approve' | 'terminate'>;
23
+ fetch?: typeof globalThis.fetch;
24
+ }
25
+ export interface RequestOptions { signal?: AbortSignal; }
26
+
27
+ export class FrontendClientError extends Error {
28
+ code: number | null;
29
+ operation: string | null;
30
+ permission: string | null;
31
+ holder: string | null;
32
+ expiresAtMs: number | null;
33
+ extensions: Record<string, unknown>;
34
+ }
35
+
36
+ export class FrontendClient extends GeneratedFrontendClient<RequestOptions> {
37
+ constructor(options: FrontendClientOptions);
38
+ readonly clientId: string;
39
+ readonly lastSequence: number;
40
+ headers(): Record<string, string>;
41
+ rpc(method: import('./generated.mjs').FrontendWireMethod, params?: Record<string, unknown>, options?: RequestOptions): Promise<unknown>;
42
+ describe(options?: RequestOptions): Promise<FrontendRuntimeDescriptor>;
43
+ attach(limit?: number, options?: RequestOptions & {afterSequence?: number}): Promise<FrontendAttachSnapshot>;
44
+ sendInput(prompt: string, options?: RequestOptions): Promise<{accepted:boolean}>;
45
+ submit(prompt: string, options?: RequestOptions): Promise<{reply:string}>;
46
+ interrupt(options?: RequestOptions): Promise<{interrupted:boolean}>;
47
+ steer(prompt: string, options?: RequestOptions): Promise<{queued:boolean}>;
48
+ respond(response: FrontendResponse, options?: RequestOptions): Promise<{accepted:boolean}>;
49
+ invoke(operation: FrontendOperationInvocation, options?: RequestOptions): Promise<FrontendOperationResult>;
50
+ lease(options?: RequestOptions): Promise<RuntimeLeaseSnapshot>;
51
+ takeControl(options?: RequestOptions): Promise<RuntimeLeaseSnapshot>;
52
+ heartbeat(options?: RequestOptions): Promise<RuntimeLeaseSnapshot>;
53
+ startEvents(options?: {afterSequence?:number;signal?:AbortSignal}): Promise<void>;
54
+ stopEvents(): void;
55
+ detach(options?: RequestOptions): Promise<RuntimeLeaseSnapshot>;
56
+ close(options?: RequestOptions): Promise<{closed:boolean}>;
57
+ on(event: 'event', listener: (event: FrontendEvent) => void): this;
58
+ on(event: 'disconnect', listener: () => void): this;
59
+ off(event: 'event', listener: (event: FrontendEvent) => void): this;
60
+ off(event: 'disconnect', listener: () => void): this;
61
+ once(event: 'event', listener: (event: FrontendEvent) => void): this;
62
+ once(event: 'disconnect', listener: () => void): this;
63
+ }
64
+
65
+ export interface FrontendWebSocketLike {
66
+ send(data: string): void;
67
+ close(): void;
68
+ addEventListener(event: 'message', listener: (event: {data:string|ArrayBuffer|ArrayBufferView}) => void): void;
69
+ addEventListener(event: 'close'|'error', listener: () => void): void;
70
+ }
71
+ export interface FrontendWebSocketConnectOptions {
72
+ url: string;
73
+ token: string;
74
+ clientId?: string;
75
+ permissions?: Array<'observe'|'interact'|'approve'|'terminate'>;
76
+ webSocketFactory(options:{url:string;headers:Record<string,string>}): FrontendWebSocketLike | Promise<FrontendWebSocketLike>;
77
+ }
78
+ export class FrontendWebSocketClient extends GeneratedFrontendClient<Record<string, never>> {
79
+ constructor(socket:FrontendWebSocketLike);
80
+ static connect(options:FrontendWebSocketConnectOptions):Promise<FrontendWebSocketClient>;
81
+ readonly lastSequence:number;
82
+ rpc(method:import('./generated.mjs').FrontendWireMethod,params?:Record<string,unknown>):Promise<unknown>;
83
+ describe():Promise<FrontendRuntimeDescriptor>;
84
+ attach(limit?:number,options?:{afterSequence?:number}):Promise<FrontendAttachSnapshot>;
85
+ sendInput(prompt:string):Promise<{accepted:boolean}>;
86
+ submit(prompt:string):Promise<{reply:string}>;
87
+ interrupt():Promise<{interrupted:boolean}>;
88
+ steer(prompt:string):Promise<{queued:boolean}>;
89
+ respond(response:FrontendResponse):Promise<{accepted:boolean}>;
90
+ invoke(operation:FrontendOperationInvocation):Promise<FrontendOperationResult>;
91
+ lease():Promise<RuntimeLeaseSnapshot>;
92
+ takeControl():Promise<RuntimeLeaseSnapshot>;
93
+ heartbeat():Promise<RuntimeLeaseSnapshot>;
94
+ detach():Promise<RuntimeLeaseSnapshot>;
95
+ close():Promise<{closed:boolean}>;
96
+ closeTransport():void;
97
+ on(event:'event',listener:(event:FrontendEvent)=>void):this;
98
+ on(event:'disconnect',listener:()=>void):this;
99
+ on(event:'protocolError',listener:(error:Error)=>void):this;
100
+ off(event:'event',listener:(event:FrontendEvent)=>void):this;
101
+ off(event:'disconnect',listener:()=>void):this;
102
+ off(event:'protocolError',listener:(error:Error)=>void):this;
103
+ once(event:'event',listener:(event:FrontendEvent)=>void):this;
104
+ once(event:'disconnect',listener:()=>void):this;
105
+ once(event:'protocolError',listener:(error:Error)=>void):this;
106
+ }