github-llm-council 0.0.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Varun R
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,63 @@
1
+ # LLM Council (VS Code Extension)
2
+
3
+ Minimal, streaming “council” workflow using the VS Code Language Model API (e.g., Copilot models). Runs three stages, logs streams, and saves a markdown artifact per run.
4
+
5
+ Current state
6
+ - Command: `LLM Council` (editor context menu / `llmCouncil.run`).
7
+ - Flow: pick context (file/selection/none) → pick prompt template → edit prompt → pick models (defaults auto-resolved and remembered per workspace) → council runs (3 stages) with streaming output.
8
+ - Models: via `vscode.lm.selectChatModels`; defaults prefer `gpt-5.1`, `sonnet-4.5`, `gemini-pro-3` when available.
9
+ - Output: streams tagged by stage/model; a markdown artifact (with front matter + transcripts) is saved to the workspace root and opened in a new tab. History kept in global storage (`llmCouncil.historySize`).
10
+ - Tests: unit/integration via Vitest.
11
+
12
+ ## Installation
13
+ Prereqs: VS Code ≥1.84, VS Code CLI `code` on PATH, Copilot (or other LM API provider) with chat models enabled.
14
+
15
+ Dev/local install
16
+ ```bash
17
+ npm install # install deps
18
+ npm run package:vsix # builds dist/llm-council.vsix
19
+ code --install-extension dist/llm-council.vsix --force # install into VS Code
20
+ # Optional: npm pack # to produce github-llm-council-0.0.1.tgz
21
+ ```
22
+
23
+ User install after publish
24
+ ```bash
25
+ npm install -g github-llm-council # postinstall auto-installs the bundled VSIX via `code`
26
+ ```
27
+
28
+ Upgrade
29
+ ```bash
30
+ npm update -g github-llm-council # or npm install -g github-llm-council@latest
31
+ ```
32
+
33
+ Publish (maintainers)
34
+ ```bash
35
+ npm install
36
+ npm run package:vsix # produce dist/llm-council.vsix
37
+ npm pack # produce github-llm-council-0.0.1.tgz
38
+ npm publish # prepublishOnly rebuilds/package before publish
39
+ ```
40
+
41
+ ## Usage
42
+ 1) Right-click in an editor → `LLM Council` (or run via Command Palette).
43
+ 2) Choose context (file/selection/none).
44
+ 3) Pick a prompt template, then edit/enter your prompt.
45
+ 4) Confirm model selection (defaults pre-selected and remembered per workspace).
46
+ 5) Watch streaming output; a markdown artifact opens and saves to the workspace root.
47
+
48
+ Requires: VS Code with LM API-capable extension (e.g., GitHub Copilot) and access to chat models.
49
+
50
+ ## Configuration
51
+ - `llmCouncil.defaultModels` (array): preferred model ids; first available three are used when no stored selection exists.
52
+ - `llmCouncil.historySize` (number): maximum run summaries to retain.
53
+
54
+ ## Testing
55
+ ```bash
56
+ npm run lint
57
+ npm run test:unit
58
+ npm run test:integration
59
+ ```
60
+
61
+ ## Notes
62
+ - Model choices are remembered per workspace between runs.
63
+ - Prompts live in `src/prompts.ts`; edit and rebuild/package to distribute changes.
package/bin/install.js ADDED
@@ -0,0 +1,45 @@
1
+ #!/usr/bin/env node
2
+ /* eslint-disable no-console */
3
+ const { spawnSync } = require('child_process');
4
+ const fs = require('fs');
5
+ const path = require('path');
6
+
7
+ const pkgRoot = path.join(__dirname, '..');
8
+ const vsixPath = path.join(pkgRoot, 'dist', 'llm-council.vsix');
9
+ const codeCandidates = [
10
+ process.env.CODE_BIN,
11
+ process.env.VSCODE_BIN,
12
+ 'code',
13
+ 'code-insiders'
14
+ ].filter(Boolean);
15
+
16
+ function runCode(cmd, args) {
17
+ const res = spawnSync(cmd, args, { stdio: 'inherit' });
18
+ return res.status === 0;
19
+ }
20
+
21
+ function main() {
22
+ if (!fs.existsSync(vsixPath)) {
23
+ console.log(`[llm-council] VSIX not found at ${vsixPath}, skipping auto-install.`);
24
+ console.log('[llm-council] This is expected in dev; run `npm run package:vsix` before publishing.');
25
+ return;
26
+ }
27
+
28
+ const args = ['--install-extension', vsixPath, '--force'];
29
+
30
+ for (const candidate of codeCandidates) {
31
+ if (!candidate) continue;
32
+ console.log(`[llm-council] Installing via ${candidate} ${args.join(' ')}`);
33
+ if (runCode(candidate, args)) {
34
+ console.log('[llm-council] Extension installed successfully.');
35
+ return;
36
+ }
37
+ }
38
+
39
+ console.error('[llm-council] Failed to install extension. Ensure `code` (VS Code CLI) is on your PATH.');
40
+ console.error('On macOS: run "Shell Command: Install \'code\' command in PATH" from VS Code command palette.');
41
+ console.error('On Windows/Linux: ensure the VS Code bin directory is on PATH.');
42
+ process.exit(1);
43
+ }
44
+
45
+ main();
Binary file
package/package.json ADDED
@@ -0,0 +1,78 @@
1
+ {
2
+ "name": "github-llm-council",
3
+ "displayName": "LLM Council",
4
+ "description": "VS Code extension for running an LLM council via the LM API",
5
+ "version": "0.0.1",
6
+ "publisher": "varunr89",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/varunr89/github-llm-council.git"
10
+ },
11
+ "engines": {
12
+ "vscode": "^1.84.0"
13
+ },
14
+ "bin": {
15
+ "github-llm-council": "bin/install.js"
16
+ },
17
+ "activationEvents": [
18
+ "onCommand:llmCouncil.run"
19
+ ],
20
+ "main": "./out/extension.js",
21
+ "contributes": {
22
+ "commands": [
23
+ {
24
+ "command": "llmCouncil.run",
25
+ "title": "LLM Council"
26
+ }
27
+ ],
28
+ "menus": {
29
+ "editor/context": [
30
+ {
31
+ "command": "llmCouncil.run",
32
+ "group": "navigation"
33
+ }
34
+ ]
35
+ },
36
+ "configuration": {
37
+ "title": "LLM Council",
38
+ "properties": {
39
+ "llmCouncil.defaultModels": {
40
+ "type": "array",
41
+ "default": ["gpt-5.1", "sonnet-4.5", "gemini-pro-3"],
42
+ "description": "Preferred model ids for council; first available three are used."
43
+ },
44
+ "llmCouncil.historySize": {
45
+ "type": "number",
46
+ "default": 20,
47
+ "description": "Maximum number of run summaries to keep."
48
+ }
49
+ }
50
+ }
51
+ },
52
+ "scripts": {
53
+ "vscode:prepublish": "npm run compile",
54
+ "compile": "tsc -p ./",
55
+ "watch": "tsc -watch -p ./",
56
+ "test": "npm run compile && npm run test:unit && npm run test:integration",
57
+ "test:unit": "vitest run",
58
+ "test:integration": "vitest run src/test/unit/markdownArtifact.integration.test.ts",
59
+ "lint": "tsc -p ./ --noEmit",
60
+ "package:vsix": "npx vsce package --no-yarn --out dist/llm-council.vsix",
61
+ "prepublishOnly": "npm run compile && npm run package:vsix",
62
+ "postinstall": "node bin/install.js"
63
+ },
64
+ "devDependencies": {
65
+ "@types/glob": "^7.2.0",
66
+ "@types/mocha": "^10.0.0",
67
+ "@types/node": "^20.0.0",
68
+ "@types/vscode": "^1.84.0",
69
+ "@vscode/test-electron": "^2.4.0",
70
+ "eslint": "^8.0.0",
71
+ "glob": "^7.2.3",
72
+ "mocha": "^10.0.0",
73
+ "ts-node": "^10.9.2",
74
+ "typescript": "^5.0.0",
75
+ "vitest": "^1.6.1",
76
+ "@vscode/vsce": "^2.31.0"
77
+ }
78
+ }