copilot-usage-studio 0.1.0 → 0.2.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/CHANGELOG.md +29 -4
- package/README.md +206 -150
- package/data/github-copilot-pricing.json +34 -6
- package/dist/copilot-usage-studio/browser/chunk-2SAR2Q6M.js +1 -0
- package/dist/copilot-usage-studio/browser/chunk-5JYQJM5G.js +1 -0
- package/dist/copilot-usage-studio/browser/chunk-7FKLWMFH.js +1 -0
- package/dist/copilot-usage-studio/browser/chunk-EWN3YOHT.js +1 -0
- package/dist/copilot-usage-studio/browser/chunk-KS5W2HMH.js +1 -0
- package/dist/copilot-usage-studio/browser/chunk-OS2XPCVW.js +2 -0
- package/dist/copilot-usage-studio/browser/chunk-U4H425LY.js +1 -0
- package/dist/copilot-usage-studio/browser/chunk-VEKXIM47.js +1 -0
- package/dist/copilot-usage-studio/browser/chunk-WOIYAEKB.js +4 -0
- package/dist/copilot-usage-studio/browser/chunk-XHID4XVE.js +1 -0
- package/dist/copilot-usage-studio/browser/index.html +11 -11
- package/dist/copilot-usage-studio/browser/main-OZIMQRXC.js +1 -0
- package/dist/copilot-usage-studio/browser/styles-7RDDQXQV.css +1 -0
- package/docs/copilot-memory.md +91 -0
- package/docs/local-deployment.md +119 -13
- package/docs/pricing.md +3 -3
- package/docs/scanner-api.md +32 -3
- package/lib/cli.mjs +15 -1
- package/lib/local-runtime.mjs +530 -19
- package/lib/scanner-worker.mjs +25 -0
- package/package.json +95 -78
- package/scripts/pricing-utils.mjs +5 -0
- package/scripts/scan-vscode-sessions.mjs +418 -1204
- package/scripts/scanner-customization-evidence.mjs +576 -0
- package/scripts/scanner-customization-inventory.mjs +1021 -0
- package/scripts/scanner-memory.mjs +229 -0
- package/scripts/scanner-session-parser.mjs +1237 -0
- package/scripts/scanner-traversal.mjs +203 -0
- package/scripts/scanner-workspace.mjs +209 -0
- package/dist/copilot-usage-studio/browser/chunk-C6VWIY5S.js +0 -1
- package/dist/copilot-usage-studio/browser/chunk-DLWQO3VR.js +0 -1
- package/dist/copilot-usage-studio/browser/chunk-F6TIG2GE.js +0 -4
- package/dist/copilot-usage-studio/browser/chunk-JIP7ONRZ.js +0 -1
- package/dist/copilot-usage-studio/browser/chunk-RNKEPBEU.js +0 -1
- package/dist/copilot-usage-studio/browser/chunk-Z3XIAKMM.js +0 -1
- package/dist/copilot-usage-studio/browser/main-C6XOJRSH.js +0 -2
- package/dist/copilot-usage-studio/browser/styles-GZOQ5QIH.css +0 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { scanVsCodeSessions } from './scanner-api.mjs';
|
|
2
|
+
|
|
3
|
+
process.on('message', async (message) => {
|
|
4
|
+
if (!message || typeof message !== 'object' || message.type !== 'scan') {
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
try {
|
|
9
|
+
const sessionData = await scanVsCodeSessions({
|
|
10
|
+
...(message.options ?? {}),
|
|
11
|
+
onProgress: (event) => {
|
|
12
|
+
process.send?.({ type: 'progress', event });
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
process.send?.({ type: 'result', sessionData });
|
|
16
|
+
} catch (error) {
|
|
17
|
+
process.send?.({
|
|
18
|
+
type: 'error',
|
|
19
|
+
error: {
|
|
20
|
+
message: error instanceof Error ? error.message : String(error),
|
|
21
|
+
stack: error instanceof Error ? error.stack : '',
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
});
|
package/package.json
CHANGED
|
@@ -1,54 +1,68 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "copilot-usage-studio",
|
|
3
|
-
"version": "0.1
|
|
4
|
-
"description": "Local VS Code GitHub Copilot usage, cost, and session insights.",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"bin": {
|
|
7
|
-
"copilot-usage-studio": "bin/copilot-usage-studio.mjs"
|
|
8
|
-
},
|
|
9
|
-
"files": [
|
|
10
|
-
"CHANGELOG.md",
|
|
11
|
-
"bin/",
|
|
12
|
-
"data/github-copilot-pricing.json",
|
|
13
|
-
"dist/copilot-usage-studio/browser/",
|
|
14
|
-
"docs/local-deployment.md",
|
|
15
|
-
"docs/
|
|
16
|
-
"docs/
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"scripts/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"
|
|
51
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "copilot-usage-studio",
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "Local VS Code GitHub Copilot usage, cost, and session insights.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"copilot-usage-studio": "bin/copilot-usage-studio.mjs"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"CHANGELOG.md",
|
|
11
|
+
"bin/",
|
|
12
|
+
"data/github-copilot-pricing.json",
|
|
13
|
+
"dist/copilot-usage-studio/browser/",
|
|
14
|
+
"docs/local-deployment.md",
|
|
15
|
+
"docs/copilot-memory.md",
|
|
16
|
+
"docs/pricing.md",
|
|
17
|
+
"docs/scanner-api.md",
|
|
18
|
+
"lib/",
|
|
19
|
+
"scripts/pricing-utils.mjs",
|
|
20
|
+
"scripts/scanner-customization-evidence.mjs",
|
|
21
|
+
"scripts/scanner-customization-inventory.mjs",
|
|
22
|
+
"scripts/scanner-memory.mjs",
|
|
23
|
+
"scripts/scanner-session-parser.mjs",
|
|
24
|
+
"scripts/scanner-traversal.mjs",
|
|
25
|
+
"scripts/scanner-workspace.mjs",
|
|
26
|
+
"scripts/scan-vscode-sessions.mjs"
|
|
27
|
+
],
|
|
28
|
+
"scripts": {
|
|
29
|
+
"ng": "ng",
|
|
30
|
+
"start": "node scripts/start-local-dev.mjs",
|
|
31
|
+
"start:angular": "ng serve --proxy-config proxy.conf.json",
|
|
32
|
+
"start:clean": "npm run clean:ng-cache && node scripts/start-local-dev.mjs",
|
|
33
|
+
"runtime": "node scripts/local-runtime.mjs",
|
|
34
|
+
"preview:local": "npm run build && node scripts/local-runtime.mjs",
|
|
35
|
+
"cli": "node bin/copilot-usage-studio.mjs",
|
|
36
|
+
"prebuild": "node scripts/clean-dist.mjs",
|
|
37
|
+
"build": "ng build",
|
|
38
|
+
"watch": "ng build --watch --configuration development",
|
|
39
|
+
"test": "ng test",
|
|
40
|
+
"test:scripts": "node --test scripts/*.test.mjs",
|
|
41
|
+
"clean:ng-cache": "ng cache clean",
|
|
42
|
+
"refresh:data": "npm run scan && npm run verify:data",
|
|
43
|
+
"scan": "node scripts/scan-vscode-sessions.mjs",
|
|
44
|
+
"verify:data": "node scripts/verify-session-data.mjs",
|
|
45
|
+
"schema:audit": "node scripts/audit-vscode-schema.mjs",
|
|
46
|
+
"schema:accept": "node scripts/audit-vscode-schema.mjs --accept",
|
|
47
|
+
"vscode:typecheck": "tsc -p vscode-extension/tsconfig.json --noEmit",
|
|
48
|
+
"vscode:compile": "npm run vscode:typecheck && node scripts/build-vscode-extension.mjs --extension-only",
|
|
49
|
+
"vscode:build": "npm run build && npm run vscode:typecheck && node scripts/build-vscode-extension.mjs",
|
|
50
|
+
"vscode:verify": "npm run vscode:build && node scripts/verify-vscode-extension.mjs",
|
|
51
|
+
"vscode:vsix:dry-run": "npm run vscode:verify && cd vscode-extension && vsce ls --tree",
|
|
52
|
+
"vscode:package": "npm run vscode:verify && node scripts/package-vscode-extension.mjs",
|
|
53
|
+
"verify:package": "node scripts/verify-package.mjs",
|
|
54
|
+
"release:notes": "node scripts/generate-release-notes.mjs",
|
|
55
|
+
"release:check": "npm run test:scripts && npm test -- --watch=false && npm run build && npm run verify:package",
|
|
56
|
+
"prepack": "npm run build"
|
|
57
|
+
},
|
|
58
|
+
"exports": {
|
|
59
|
+
".": "./lib/cli.mjs",
|
|
60
|
+
"./scanner": "./lib/scanner-api.mjs",
|
|
61
|
+
"./local-runtime": "./lib/local-runtime.mjs"
|
|
62
|
+
},
|
|
63
|
+
"engines": {
|
|
64
|
+
"node": ">=22.5.0"
|
|
65
|
+
},
|
|
52
66
|
"repository": {
|
|
53
67
|
"type": "git",
|
|
54
68
|
"url": "git+https://github.com/fortunes-guardian/copilot-usage-studio.git"
|
|
@@ -57,30 +71,33 @@
|
|
|
57
71
|
"url": "https://github.com/fortunes-guardian/copilot-usage-studio/issues"
|
|
58
72
|
},
|
|
59
73
|
"homepage": "https://github.com/fortunes-guardian/copilot-usage-studio#readme",
|
|
60
|
-
"keywords": [
|
|
61
|
-
"github-copilot",
|
|
62
|
-
"vscode",
|
|
63
|
-
"ai-usage",
|
|
64
|
-
"token-cost",
|
|
65
|
-
"developer-tools"
|
|
66
|
-
],
|
|
67
|
-
"license": "MIT",
|
|
68
|
-
"packageManager": "npm@11.11.0",
|
|
69
|
-
"devDependencies": {
|
|
70
|
-
"@angular/build": "^21.2.9",
|
|
71
|
-
"@angular/cli": "^21.2.9",
|
|
72
|
-
"@angular/common": "^21.2.0",
|
|
73
|
-
"@angular/compiler": "^21.2.0",
|
|
74
|
-
"@angular/compiler-cli": "^21.2.0",
|
|
75
|
-
"@angular/core": "^21.2.0",
|
|
76
|
-
"@angular/forms": "^21.2.0",
|
|
77
|
-
"@angular/platform-browser": "^21.2.0",
|
|
78
|
-
"@angular/router": "^21.2.0",
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
|
|
86
|
-
|
|
74
|
+
"keywords": [
|
|
75
|
+
"github-copilot",
|
|
76
|
+
"vscode",
|
|
77
|
+
"ai-usage",
|
|
78
|
+
"token-cost",
|
|
79
|
+
"developer-tools"
|
|
80
|
+
],
|
|
81
|
+
"license": "MIT",
|
|
82
|
+
"packageManager": "npm@11.11.0",
|
|
83
|
+
"devDependencies": {
|
|
84
|
+
"@angular/build": "^21.2.9",
|
|
85
|
+
"@angular/cli": "^21.2.9",
|
|
86
|
+
"@angular/common": "^21.2.0",
|
|
87
|
+
"@angular/compiler": "^21.2.0",
|
|
88
|
+
"@angular/compiler-cli": "^21.2.0",
|
|
89
|
+
"@angular/core": "^21.2.0",
|
|
90
|
+
"@angular/forms": "^21.2.0",
|
|
91
|
+
"@angular/platform-browser": "^21.2.0",
|
|
92
|
+
"@angular/router": "^21.2.0",
|
|
93
|
+
"@types/node": "^26.0.0",
|
|
94
|
+
"@types/vscode": "^1.125.0",
|
|
95
|
+
"@vscode/vsce": "^3.9.2",
|
|
96
|
+
"jsdom": "^28.0.0",
|
|
97
|
+
"prettier": "^3.8.1",
|
|
98
|
+
"rxjs": "~7.8.0",
|
|
99
|
+
"tslib": "^2.3.0",
|
|
100
|
+
"typescript": "~5.9.2",
|
|
101
|
+
"vitest": "^4.0.8"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -13,10 +13,15 @@ export function normalizeModel(model, pricing) {
|
|
|
13
13
|
.trim();
|
|
14
14
|
const key = modelKey(raw);
|
|
15
15
|
const knownModels = Object.keys(pricing);
|
|
16
|
+
const knownAliases = knownModels.flatMap((name) =>
|
|
17
|
+
(pricing[name].aliases ?? []).map((alias) => ({ name, aliasKey: modelKey(alias) })),
|
|
18
|
+
);
|
|
16
19
|
|
|
17
20
|
return (
|
|
18
21
|
knownModels.find((name) => modelKey(name) === key) ??
|
|
22
|
+
knownAliases.find(({ aliasKey }) => aliasKey === key)?.name ??
|
|
19
23
|
knownModels.find((name) => key.includes(modelKey(name))) ??
|
|
24
|
+
knownAliases.find(({ aliasKey }) => key.includes(aliasKey))?.name ??
|
|
20
25
|
(raw || 'Unknown model')
|
|
21
26
|
);
|
|
22
27
|
}
|