copilot-usage-studio 0.2.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.
Files changed (38) hide show
  1. package/CHANGELOG.md +16 -1
  2. package/README.md +42 -13
  3. package/data/github-copilot-pricing.json +34 -6
  4. package/dist/copilot-usage-studio/browser/chunk-2SAR2Q6M.js +1 -0
  5. package/dist/copilot-usage-studio/browser/chunk-5JYQJM5G.js +1 -0
  6. package/dist/copilot-usage-studio/browser/chunk-7FKLWMFH.js +1 -0
  7. package/dist/copilot-usage-studio/browser/chunk-EWN3YOHT.js +1 -0
  8. package/dist/copilot-usage-studio/browser/{chunk-NXH37FKU.js → chunk-KS5W2HMH.js} +1 -1
  9. package/dist/copilot-usage-studio/browser/{chunk-TVSYR63W.js → chunk-OS2XPCVW.js} +2 -2
  10. package/dist/copilot-usage-studio/browser/{chunk-QQOFM3HF.js → chunk-U4H425LY.js} +1 -1
  11. package/dist/copilot-usage-studio/browser/chunk-VEKXIM47.js +1 -0
  12. package/dist/copilot-usage-studio/browser/chunk-WOIYAEKB.js +4 -0
  13. package/dist/copilot-usage-studio/browser/{chunk-J47KKACI.js → chunk-XHID4XVE.js} +1 -1
  14. package/dist/copilot-usage-studio/browser/index.html +2 -2
  15. package/dist/copilot-usage-studio/browser/main-OZIMQRXC.js +1 -0
  16. package/dist/copilot-usage-studio/browser/styles-7RDDQXQV.css +1 -0
  17. package/docs/local-deployment.md +67 -11
  18. package/docs/pricing.md +3 -3
  19. package/docs/scanner-api.md +28 -0
  20. package/lib/cli.mjs +15 -1
  21. package/lib/local-runtime.mjs +455 -19
  22. package/lib/scanner-worker.mjs +25 -0
  23. package/package.json +17 -1
  24. package/scripts/pricing-utils.mjs +5 -0
  25. package/scripts/scan-vscode-sessions.mjs +383 -1475
  26. package/scripts/scanner-customization-evidence.mjs +576 -0
  27. package/scripts/scanner-customization-inventory.mjs +1021 -0
  28. package/scripts/scanner-memory.mjs +229 -0
  29. package/scripts/scanner-session-parser.mjs +1237 -0
  30. package/scripts/scanner-traversal.mjs +203 -0
  31. package/scripts/scanner-workspace.mjs +209 -0
  32. package/dist/copilot-usage-studio/browser/chunk-CUKTUQ6W.js +0 -1
  33. package/dist/copilot-usage-studio/browser/chunk-EYAHOEVS.js +0 -1
  34. package/dist/copilot-usage-studio/browser/chunk-FXNLFSUB.js +0 -1
  35. package/dist/copilot-usage-studio/browser/chunk-HJNYITFH.js +0 -1
  36. package/dist/copilot-usage-studio/browser/chunk-KDAJN6DF.js +0 -4
  37. package/dist/copilot-usage-studio/browser/main-TL27ZSEQ.js +0 -1
  38. package/dist/copilot-usage-studio/browser/styles-GZOQ5QIH.css +0 -1
package/CHANGELOG.md CHANGED
@@ -10,10 +10,25 @@ All notable changes to Copilot Usage Studio are recorded here.
10
10
  - Show source-backed memory recall history from explicit VS Code `memory view` events, linked to the following model request without inventing memory-only cost.
11
11
  - Compact the Memory page into an IDE-style file browser with filename search, copy-content action, collapsed source view, and scope help.
12
12
  - Make startup loading a stable page state and clarify that the runtime URL shown during `npm start` is backend-only.
13
- - Add GitHub Actions CI for pull requests and pushes to `main`.
13
+ - Add GitHub Actions CI for pull requests, `main`, and pushed feature branches.
14
14
  - Add tag-driven npm Trusted Publishing with automatic provenance.
15
15
  - Create the matching GitHub Release from the same version tag.
16
16
  - Support safe workflow reruns and manual backfill of an existing tagged release.
17
+ - Add a VS Code extension preview for Usage, Sessions, Memory, Customizations preview, Compare, Insights, and Prices.
18
+ - Build and upload a VSIX artifact from CI for every pushed branch.
19
+ - Position the VS Code extension as the primary product path, with Marketplace publication planned after maintainer smoke testing.
20
+ - Generate detailed release notes from the changelog and commits for tagged releases.
21
+ - Tighten Customizations evidence wording around visible local-log text matches.
22
+ - Trust explicit VS Code customization file settings, directories, and globs for file kind while keeping scans bounded by safe file type.
23
+ - Add regression coverage for `copilot-instructions.md`, explicit configured customization files, and broad user-profile folders not being scanned by default.
24
+ - Compact global scan status so detailed workspace diagnostics stay behind `View details`.
25
+ - Report user-stopped scans as stopped while keeping the last valid snapshot visible.
26
+ - Make Customizations evidence rows quieter by keeping raw VS Code source fields inside `Proof details` and marking partial evidence as minimum counts.
27
+ - Preserve existing Customizations evidence when a normal top-right Refresh runs a quick scan that skips customization indexing.
28
+ - Mark Customizations as a preview surface in both docs and the app navigation.
29
+ - Purge public roadmap links from README and release-facing docs.
30
+ - Refresh GitHub Copilot model pricing from the July 5, 2026 GitHub Docs table, including Claude Sonnet 5, Claude Opus 4.8 fast mode, Kimi K2.7 Code, and updated model statuses.
31
+ - Add raw model-id alias support so newly observed VS Code ids can map to the matching GitHub pricing row without hidden fallback pricing.
17
32
 
18
33
  ## 0.1.0 - 2026-06-14
19
34
 
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Copilot Usage Studio
2
2
 
3
- Local-first usage, cost, and session insights for VS Code GitHub Copilot chat and agent sessions.
3
+ Extension-first usage, memory, customization, and cost insights for VS Code GitHub Copilot chat and agent sessions.
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/copilot-usage-studio.svg)](https://www.npmjs.com/package/copilot-usage-studio)
6
6
  [![CI](https://github.com/fortunes-guardian/copilot-usage-studio/actions/workflows/ci.yml/badge.svg)](https://github.com/fortunes-guardian/copilot-usage-studio/actions/workflows/ci.yml)
@@ -8,31 +8,43 @@ Local-first usage, cost, and session insights for VS Code GitHub Copilot chat an
8
8
 
9
9
  Independent open-source developer tool. Not affiliated with or endorsed by GitHub or Microsoft.
10
10
 
11
- Status: early local developer preview. Version `0.1.0` is available on npm.
11
+ Status: early VS Code extension preview. Test locally before relying on it for daily use.
12
12
 
13
13
  Supported scope today: VS Code GitHub Copilot Chat and Agent sessions on the local machine. This does not currently support Visual Studio, JetBrains IDEs, Copilot CLI, GitHub.com chat, or GitHub billing exports.
14
14
 
15
- Supported local VS Code storage locations:
15
+ Supported local VS Code storage locations for the standalone/npm host:
16
16
 
17
17
  - Windows: `%APPDATA%\Code\User`
18
18
  - macOS: `~/Library/Application Support/Code/User`
19
19
  - Linux: `~/.config/Code/User`
20
20
 
21
- VS Code Insiders paths are scanned too.
21
+ VS Code Insiders paths are scanned too by the standalone/npm host. The VS Code extension preview uses the VS Code user-data root for the VS Code installation it is running inside.
22
22
 
23
- The app helps answer two practical questions:
23
+ The app helps answer three practical questions:
24
24
 
25
25
  > How much GitHub Copilot usage did I burn today, this week, and this month?
26
26
  >
27
+ > Did Copilot actually send my local instructions, skills, prompts, hooks, or agents to the model?
28
+ >
27
29
  > Why did this Copilot run cost what it cost?
28
30
 
29
- It scans local VS Code data, uses GitHub source usage when VS Code logs it, falls back to GitHub published model prices when it has to, and shows which models, token categories, and model calls drove the usage. It also indexes Copilot's locally saved memories and plans so they are no longer hidden in VS Code storage.
31
+ It scans local VS Code data, uses GitHub source usage when VS Code logs it, falls back to GitHub published model prices when it has to, and shows which models, token categories, and model calls drove the usage. It also indexes Copilot's locally saved memories/plans. The Customizations page is a preview for inspecting local instructions, skills, prompts, hooks, and agents with evidence from visible VS Code request logs.
30
32
 
31
33
  ## Start Here
32
34
 
33
- Requirements: Node.js 22.5 or newer, npm, and local VS Code GitHub Copilot session data.
35
+ Recommended path: build and install the local VS Code extension preview.
36
+
37
+ Requirements for building the preview: Node.js 22.5 or newer, npm, VS Code, and local VS Code GitHub Copilot session data.
38
+
39
+ ```bash
40
+ npm install
41
+ npm run vscode:package
42
+ code --install-extension tmp/copilot-usage-studio-vscode-0.2.0.vsix --force
43
+ ```
44
+
45
+ Then run `Copilot Usage Studio: Open` from the VS Code command palette.
34
46
 
35
- Run the released app:
47
+ The npm/browser host remains available for development and fallback testing:
36
48
 
37
49
  ```bash
38
50
  npx copilot-usage-studio
@@ -43,7 +55,7 @@ Then open `http://127.0.0.1:4312/`.
43
55
  `npx` downloads the latest published package from npm. To run this exact release:
44
56
 
45
57
  ```bash
46
- npx copilot-usage-studio@0.1.0
58
+ npx copilot-usage-studio@0.2.0
47
59
  ```
48
60
 
49
61
  To contribute or run the current GitHub source:
@@ -67,11 +79,18 @@ Read [docs/how-to-read-the-app.md](docs/how-to-read-the-app.md) if the UI terms
67
79
 
68
80
  The packaged CLI stores its cache in the current user's application-data directory. It does not write session data into the npm installation and does not include the maintainer's generated session data in the package.
69
81
 
82
+ If startup appears stuck, keep the terminal open and check the loading screen diagnostics. The runtime now reports the current scan step, recent log lines, and a local log-file path. You can also run:
83
+
84
+ ```bash
85
+ npx copilot-usage-studio status
86
+ ```
87
+
70
88
  ## What Works Now
71
89
 
72
90
  - **Usage**: the default home for last session, today, this week, current calendar month, selected workspace/model scope, and recent daily usage in GitHub AI credits.
73
91
  - **Sessions**: selected-run debugging with Overview, Cost, Calls, and Trace views.
74
92
  - **Memory**: read-only search and inspection for global, repository, workspace, and session-scoped Copilot memories and saved plans.
93
+ - **Customizations preview**: read-only inventory and local-log text-match evidence for Copilot instructions, skills, prompts, hooks, and agents. Absence of a text match does not prove Copilot ignored a file.
75
94
  - **Cost**: source usage when VS Code logs it, fallback pricing when it does not, and separate normal input, cached input, cache write, and output buckets.
76
95
  - **Calls**: model-call timeline, context-load timeline, setup-footprint clues, and links back to the raw Trace event.
77
96
  - **Trace**: filterable raw log timeline with clickable event inspection.
@@ -95,6 +114,16 @@ npm run build
95
114
 
96
115
  See [docs/local-deployment.md](docs/local-deployment.md) for packaging options and why the app stays local-first.
97
116
 
117
+ Build the VS Code extension preview:
118
+
119
+ ```bash
120
+ npm run vscode:package
121
+ code --install-extension tmp/copilot-usage-studio-vscode-0.2.0.vsix --force
122
+ ```
123
+
124
+ The extension opens the full app inside VS Code: Usage, Sessions, Memory, Customizations preview, Compare, Insights, and Prices.
125
+ For pre-release testing, prefer the VSIX artifact produced by branch CI when available. After maintainer testing, the release target is the VS Code Marketplace so users can install without downloading a VSIX manually.
126
+
98
127
  ## Releasing
99
128
 
100
129
  Releases are tag-driven. After a change is merged to `main`, the maintainer bumps the version and pushes the generated tag:
@@ -104,7 +133,7 @@ npm version patch
104
133
  git push origin main --follow-tags
105
134
  ```
106
135
 
107
- Use `minor` or `major` instead of `patch` when appropriate. GitHub Actions then tests and packages that exact tagged commit, publishes it to npm, and creates the matching GitHub Release. See [docs/local-deployment.md](docs/local-deployment.md#automated-releases) for the one-time npm Trusted Publisher setup and the full release procedure.
136
+ Use `minor` or `major` instead of `patch` when appropriate. GitHub Actions tests and packages that exact tagged commit, builds the VS Code extension artifact, and creates release notes from `CHANGELOG.md`. See [docs/local-deployment.md](docs/local-deployment.md#automated-releases) for release mechanics.
108
137
 
109
138
  ## Current Boundaries
110
139
 
@@ -118,13 +147,13 @@ The app is a local developer visibility tool. It shows what can be understood fr
118
147
 
119
148
  - [docs/how-to-read-the-app.md](docs/how-to-read-the-app.md): plain-English guide to the UI.
120
149
  - [docs/pricing.md](docs/pricing.md): GitHub price source, calculation rules, AI-credit allowances, and real-world caveats.
121
- - [docs/local-deployment.md](docs/local-deployment.md): local run, build, and future packaging options.
150
+ - [docs/local-deployment.md](docs/local-deployment.md): local run, build, and release mechanics.
151
+ - [docs/vscode-extension.md](docs/vscode-extension.md): local VSIX preview architecture, build, and smoke-test flow.
122
152
  - [docs/scanner-api.md](docs/scanner-api.md): reusable Node scanner contract for local hosts, desktop packaging, and extensions.
123
153
  - [docs/data-ingestion.md](docs/data-ingestion.md): where the data comes from and what it means.
124
154
  - [docs/copilot-memory.md](docs/copilot-memory.md): observed Copilot memory storage, normalized fields, and evidence boundaries.
155
+ - [docs/customization-evidence.md](docs/customization-evidence.md): how instruction/skill evidence is detected and what it proves.
125
156
  - [docs/debug-log-schema.md](docs/debug-log-schema.md): observed VS Code Agent Debug Log schema and generated app data contract.
126
- - [docs/schema-change-workflow.md](docs/schema-change-workflow.md): weekly VS Code/Copilot update audit, compatibility gates, and baseline procedure.
127
- - [docs/roadmap.md](docs/roadmap.md): current state, completed work, and planned build order.
128
157
 
129
158
  ## License
130
159
 
@@ -1,9 +1,9 @@
1
1
  {
2
- "version": "github-copilot-usage-pricing-2026-06-14",
2
+ "version": "github-copilot-usage-pricing-2026-07-05",
3
3
  "sourceUrl": "https://docs.github.com/en/copilot/reference/copilot-billing/models-and-pricing",
4
4
  "sourceLabel": "GitHub Docs: Models and pricing for GitHub Copilot",
5
- "snapshotDate": "2026-06-14",
6
- "importedAt": "2026-06-14",
5
+ "snapshotDate": "2026-07-05",
6
+ "importedAt": "2026-07-05",
7
7
  "fallbackModel": "GPT-5.4",
8
8
  "models": {
9
9
  "GPT-5 mini": {
@@ -152,7 +152,17 @@
152
152
  "cacheWrite": 6.25,
153
153
  "output": 25
154
154
  },
155
- "Claude Fable 5": {
155
+ "Claude Sonnet 5": {
156
+ "provider": "Anthropic",
157
+ "releaseStatus": "GA",
158
+ "category": "Versatile",
159
+ "input": 2,
160
+ "cachedInput": 0.2,
161
+ "cacheWrite": 2.5,
162
+ "output": 10,
163
+ "note": "GitHub documents this promotional pricing through August 31, 2026."
164
+ },
165
+ "Claude Opus 4.8 (fast mode)": {
156
166
  "provider": "Anthropic",
157
167
  "releaseStatus": "GA",
158
168
  "category": "Powerful",
@@ -160,7 +170,17 @@
160
170
  "cachedInput": 1,
161
171
  "cacheWrite": 12.5,
162
172
  "output": 50,
163
- "note": "GitHub currently marks this model as unavailable"
173
+ "aliases": ["Claude Opus 4.8 fast", "claude-opus-4.8-fast"],
174
+ "note": "GitHub's table includes '(preview)' in the model label."
175
+ },
176
+ "Claude Fable 5": {
177
+ "provider": "Anthropic",
178
+ "releaseStatus": "GA",
179
+ "category": "Powerful",
180
+ "input": 10,
181
+ "cachedInput": 1,
182
+ "cacheWrite": 12.5,
183
+ "output": 50
164
184
  },
165
185
  "Gemini 2.5 Pro": {
166
186
  "provider": "Google",
@@ -209,7 +229,7 @@
209
229
  },
210
230
  "Raptor mini": {
211
231
  "provider": "Fine-tuned (GitHub)",
212
- "releaseStatus": "Public preview",
232
+ "releaseStatus": "GA",
213
233
  "category": "Versatile",
214
234
  "input": 0.25,
215
235
  "cachedInput": 0.025,
@@ -222,6 +242,14 @@
222
242
  "input": 0.75,
223
243
  "cachedInput": 0.075,
224
244
  "output": 4.5
245
+ },
246
+ "Kimi K2.7 Code": {
247
+ "provider": "Moonshot AI",
248
+ "releaseStatus": "GA",
249
+ "category": "Versatile",
250
+ "input": 0.95,
251
+ "cachedInput": 0.19,
252
+ "output": 4
225
253
  }
226
254
  }
227
255
  }
@@ -0,0 +1 @@
1
+ import{f as Q}from"./chunk-KS5W2HMH.js";import{i as S,r as U,s as W}from"./chunk-VEKXIM47.js";import{$a as f,Ca as P,Da as h,Ea as T,Fa as y,Ga as M,Ha as g,Ia as o,Ja as i,Ka as F,O as E,Oa as I,P as D,Qa as x,Sa as _,Ta as V,U as A,Ua as B,Va as s,Wa as m,Xa as N,Ya as w,Z as v,Za as z,_a as l,ab as b,db as C,ka as r,nb as L,ob as R,sa as $,sb as Y,ub as j,vb as H,wb as G,xb as q,yb as J,zb as K}from"./chunk-WOIYAEKB.js";var X=(n,t)=>t.id,ae=(n,t)=>t.key;function ie(n,t){if(n&1&&(o(0,"option",6),s(1),i()),n&2){let e=t.$implicit;g("value",e),r(),m(e==="all"?"All workspaces":e)}}function oe(n,t){if(n&1&&(o(0,"option",6),s(1),i()),n&2){let e=t.$implicit;g("value",e),r(),m(e==="all"?"All models":e)}}function re(n,t){if(n&1&&(o(0,"option",6),s(1),i()),n&2){let e=t.$implicit;g("value",e.id),r(),m(e.label)}}function se(n,t){if(n&1){let e=I();o(0,"button",17),x("click",function(){E(e);let p=_();return D(p.resetScope())}),s(1,"Reset scope"),i()}}function le(n,t){if(n&1&&(s(0),l(1,"number")),n&2){let e=_().$implicit;w(" \xB7 ",f(1,2,e.fallbackCount)," fallback",e.fallbackCount===1?"":"s"," ")}}function pe(n,t){if(n&1&&(o(0,"span",23),s(1),i()),n&2){let e=_().$implicit;r(),m(e.actionLabel)}}function ce(n,t){if(n&1){let e=I();o(0,"button",18),x("click",function(){let p=E(e).$implicit,c=_();return D(c.emitOpenSession(p.session))}),o(1,"span",19),s(2),i(),o(3,"strong"),s(4),l(5,"number"),i(),o(6,"em",20),s(7),i(),o(8,"em"),s(9),l(10,"number"),i(),o(11,"i",21),F(12,"b"),i(),o(13,"small",22)(14,"span"),s(15),l(16,"number"),P(17,le,2,4),i(),P(18,pe,2,1,"span",23),i()()}if(n&2){let e=t.$implicit,a=_();B("primary",e.id==="last-session")("can-open",a.canOpenSession&&e.session)("empty",!e.session),g("disabled",!a.canOpenSession||!e.session),r(2),m(e.label),r(2),N("",b(5,18,e.credits,"1.0-2")," credits"),r(3),m(e.period),r(2),w("$",b(10,21,e.usd,"1.2-4")," \xB7 ",e.detail),r(3),V("width",e.allowanceShare>100?100:e.allowanceShare,"%"),r(3),w(" ",b(16,24,e.allowanceShare,"1.0-1"),"% of ",a.selectedAllowance().shortLabel," "),r(2),h(e.fallbackCount?17:-1),r(),h(a.canOpenSession?18:-1)}}function de(n,t){if(n&1&&(o(0,"span"),s(1),l(2,"number"),l(3,"number"),i()),n&2){let e=t;r(),w("",f(2,2,e.sourceCount)," source \xB7 ",f(3,4,e.fallbackCount)," fallback")}}function ge(n,t){if(n&1&&(s(0),l(1,"number")),n&2){let e=_().$implicit;w(" \xB7 ",f(1,2,e.fallbackCount)," fallback",e.fallbackCount===1?"":"s"," ")}}function ue(n,t){if(n&1){let e=I();o(0,"button",24),x("click",function(){let p=E(e).$implicit,c=_();return D(c.emitOpenSession(p.topSession))}),o(1,"span"),s(2),l(3,"date"),i(),o(4,"strong"),s(5),l(6,"number"),i(),o(7,"em"),s(8),l(9,"number"),l(10,"number"),P(11,ge,2,4),i()()}if(n&2){let e=t.$implicit,a=_();B("can-open",a.canOpenSession&&e.topSession)("empty",!e.topSession),g("disabled",!a.canOpenSession||!e.topSession),r(2),m(b(3,11,e.date,"EEE, MMM d")),r(3),N("",b(6,14,e.credits,"1.0-2")," credits"),r(3),z(" ",f(9,17,e.count)," session",e.count===1?"":"s"," \xB7 $",b(10,19,e.usd,"1.2-4")," "),r(3),h(e.fallbackCount?11:-1)}}var Z=class n{sessionsInput=v([]);allowancePlanInput=v("business-standard");workspaceFilter=v("all");modelFilter=v("all");set sessions(t){this.sessionsInput.set(t??[])}set allowancePlan(t){this.allowancePlanInput.set(t??"business-standard")}canOpenSession=!0;allowancePlanChange=new A;openSession=new A;allowancePlans=S;help={scope:"Usage is calculated from imported local VS Code sessions. When VS Code reports Copilot usage units, the app uses those. Otherwise it estimates from token buckets and GitHub model prices.",allowance:"Compares your local imported usage with the included monthly AI credits for the selected Copilot plan."};selectedAllowance=C(()=>S.find(t=>t.id===this.allowancePlanInput())??S[0]);currentAllowancePlan=C(()=>this.selectedAllowance().id);workspaceOptions=C(()=>["all",...[...new Set(this.sessionsInput().map(t=>t.workspace).filter(Boolean))].sort()]);modelOptions=C(()=>["all",...[...new Set(this.sessionsInput().map(t=>t.model).filter(Boolean))].sort()]);scopedSessions=C(()=>this.sessionsInput().filter(t=>(this.workspaceFilter()==="all"||t.workspace===this.workspaceFilter())&&(this.modelFilter()==="all"||t.model===this.modelFilter())));scopeActive=C(()=>this.workspaceFilter()!=="all"||this.modelFilter()!=="all");usageWindows=C(()=>Q(this.scopedSessions(),this.selectedAllowance().creditsPerUserMonthly));dailyRows=C(()=>this.buildDailyRows(this.scopedSessions(),14));sourceCoverage=C(()=>{let t=this.scopedSessions(),e=t.filter(a=>a.sourceUsage).length;return{sourceCount:e,fallbackCount:t.length-e,total:t.length}});setAllowancePlan(t){if(!S.some(a=>a.id===t))return;let e=t;this.allowancePlanInput.set(e),this.allowancePlanChange.emit(e)}setWorkspaceFilter(t){this.workspaceFilter.set(t)}setModelFilter(t){this.modelFilter.set(t)}resetScope(){this.workspaceFilter.set("all"),this.modelFilter.set("all")}emitOpenSession(t){this.canOpenSession&&t&&this.openSession.emit(t)}buildDailyRows(t,e){let a=me(new Date);return Array.from({length:e},(p,c)=>{let k=ee(a,-c),te=ee(k,1),O=t.filter(d=>{let u=Date.parse(d.startedAt);return Number.isFinite(u)&&u>=k.getTime()&&u<te.getTime()}),ne=O.reduce((d,u)=>!d||U(u)>U(d)?u:d,null);return{date:k,key:Ce(k),credits:O.reduce((d,u)=>d+W(u),0),usd:O.reduce((d,u)=>d+U(u),0),count:O.length,topSession:ne,fallbackCount:O.filter(d=>!d.sourceUsage).length}})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=$({type:n,selectors:[["app-usage-page"]],inputs:{sessions:"sessions",allowancePlan:"allowancePlan",canOpenSession:"canOpenSession"},outputs:{allowancePlanChange:"allowancePlanChange",openSession:"openSession"},decls:55,vars:15,consts:[[1,"usage-page"],[1,"usage-header"],[1,"eyebrow"],["label","Explain usage scope",3,"text"],[1,"usage-controls"],[3,"ngModelChange","ngModel"],[3,"value"],["label","Explain allowance",3,"text"],[1,"usage-scope"],["type","button"],["aria-label","Usage answer cards",1,"usage-answer-grid"],["type","button",1,"usage-answer-card",3,"primary","can-open","empty","disabled"],[1,"usage-panels"],[1,"usage-panel"],[1,"panel-heading"],[1,"daily-usage-list"],["type","button",3,"can-open","empty","disabled"],["type","button",3,"click"],["type","button",1,"usage-answer-card",3,"click","disabled"],[1,"usage-card-label"],[1,"usage-card-period"],["aria-hidden","true"],[1,"usage-card-footer"],[1,"usage-card-action"],["type","button",3,"click","disabled"]],template:function(e,a){if(e&1&&(o(0,"section",0)(1,"header",1)(2,"div")(3,"p",2),s(4,"Usage home"),i(),o(5,"h2"),s(6,"Your Copilot usage"),i(),o(7,"p"),s(8," Today, this week, this month, and recent activity across imported VS Code sessions. "),F(9,"app-help-popover",3),i()(),o(10,"div",4)(11,"label")(12,"span"),s(13,"Workspace"),i(),o(14,"select",5),x("ngModelChange",function(c){return a.setWorkspaceFilter(c)}),y(15,ie,2,2,"option",6,T),i()(),o(17,"label")(18,"span"),s(19,"Model"),i(),o(20,"select",5),x("ngModelChange",function(c){return a.setModelFilter(c)}),y(21,oe,2,2,"option",6,T),i()(),o(23,"label")(24,"span"),s(25," Monthly allowance "),F(26,"app-help-popover",7),i(),o(27,"select",5),x("ngModelChange",function(c){return a.setAllowancePlan(c)}),y(28,re,2,2,"option",6,X),i()()()(),o(30,"div",8)(31,"span"),s(32),l(33,"number"),l(34,"number"),i(),o(35,"span"),s(36),i(),o(37,"span"),s(38),i(),P(39,se,2,0,"button",9),i(),o(40,"section",10),y(41,ce,19,27,"button",11,X),i(),o(43,"section",12)(44,"article",13)(45,"div",14)(46,"div")(47,"h3"),s(48,"Recent days"),i(),o(49,"p"),s(50,"Last 14 local calendar days from imported VS Code sessions."),i()(),P(51,de,4,6,"span"),i(),o(52,"div",15),y(53,ue,12,22,"button",16,ae),i()()()()),e&2){let p;r(9),g("text",a.help.scope),r(5),g("ngModel",a.workspaceFilter()),r(),M(a.workspaceOptions()),r(5),g("ngModel",a.modelFilter()),r(),M(a.modelOptions()),r(5),g("text",a.help.allowance),r(),g("ngModel",a.currentAllowancePlan()),r(),M(a.allowancePlans),r(4),w("",f(33,11,a.scopedSessions().length)," of ",f(34,13,a.sessionsInput().length)," sessions"),r(4),m(a.workspaceFilter()==="all"?"All workspaces":a.workspaceFilter()),r(2),m(a.modelFilter()==="all"?"All models":a.modelFilter()),r(),h(a.scopeActive()?39:-1),r(2),M(a.usageWindows()),r(10),h((p=a.sourceCoverage())?51:-1,p),r(2),M(a.dailyRows())}},dependencies:[K,q,J,G,j,H,Y,L,R],styles:["[_nghost-%COMP%]{display:block}.usage-page[_ngcontent-%COMP%]{display:grid;gap:12px}.usage-header[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;border:1px solid color-mix(in srgb,var(--accent-2) 24%,var(--line));border-radius:18px;padding:16px;background:var(--header-gradient);box-shadow:var(--shadow)}.eyebrow[_ngcontent-%COMP%]{margin:0;color:var(--muted-2);font-size:10px;font-weight:820;letter-spacing:.08em;text-transform:uppercase}.usage-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:3px 0 0;color:var(--text-strong);font-size:26px;font-weight:820;letter-spacing:0}.usage-header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{display:inline-flex;align-items:center;flex-wrap:wrap;gap:4px;max-width:720px;margin:7px 0 0;color:var(--muted);font-size:13px;line-height:1.45}.usage-controls[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,minmax(150px,1fr));gap:8px;width:min(720px,58vw)}.usage-controls[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:grid;gap:6px;min-width:0;color:var(--muted);font-size:11px;font-weight:760}.usage-controls[_ngcontent-%COMP%] label[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px}.usage-controls[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{width:100%;min-height:34px;border:1px solid var(--line);border-radius:9px;padding:7px 10px;background:var(--surface-soft);color:var(--text);font:inherit;font-size:13px;font-weight:760}.usage-scope[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:7px;color:var(--muted);font-size:11px}.usage-scope[_ngcontent-%COMP%] > span[_ngcontent-%COMP%], .usage-scope[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border:1px solid var(--line);border-radius:999px;padding:4px 8px;background:var(--surface-soft)}.usage-scope[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{color:var(--accent);font:inherit;font-weight:800;cursor:pointer}.usage-answer-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:9px}.usage-answer-card[_ngcontent-%COMP%], .usage-panel[_ngcontent-%COMP%]{border:1px solid var(--line);border-radius:15px;background:var(--surface);box-shadow:var(--shadow-soft)}.usage-answer-card[_ngcontent-%COMP%]{display:grid;gap:6px;min-width:0;padding:13px;color:var(--text);text-align:left;cursor:default}.usage-answer-card.primary[_ngcontent-%COMP%]{border-color:#0c9f8347;background:linear-gradient(135deg,#0c9f831f,#6f5cff0d),var(--surface)}.usage-answer-card.empty[_ngcontent-%COMP%]:disabled{cursor:default;opacity:.72}.usage-answer-card.can-open[_ngcontent-%COMP%]{cursor:pointer}.usage-answer-card.can-open[_ngcontent-%COMP%]:hover{border-color:color-mix(in srgb,var(--accent) 42%,var(--line));transform:translateY(-1px)}.usage-answer-card[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .usage-answer-card[_ngcontent-%COMP%] em[_ngcontent-%COMP%], .usage-answer-card[_ngcontent-%COMP%] small[_ngcontent-%COMP%], .daily-usage-list[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .daily-usage-list[_ngcontent-%COMP%] em[_ngcontent-%COMP%], .usage-panel[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .usage-panel[_ngcontent-%COMP%] li[_ngcontent-%COMP%], .panel-heading[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .panel-heading[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{color:var(--muted);font-size:12px;font-style:normal;line-height:1.35}.usage-answer-card[_ngcontent-%COMP%] .usage-card-label[_ngcontent-%COMP%]{color:var(--muted-2);font-size:10px;font-weight:820;letter-spacing:.08em;text-transform:uppercase}.usage-answer-card[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--text-strong);font-size:21px;font-weight:820;line-height:1.05;overflow-wrap:anywhere}.usage-card-period[_ngcontent-%COMP%]{color:var(--text)!important;font-size:12px!important;font-weight:760}.usage-answer-card[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{display:block;width:100%;height:5px;overflow:hidden;border-radius:999px;background:#61708524}.usage-answer-card[_ngcontent-%COMP%] b[_ngcontent-%COMP%]{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--accent),var(--accent-2))}.usage-card-footer[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:8px}.usage-card-footer[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{min-width:0}.usage-card-action[_ngcontent-%COMP%]{flex:0 0 auto;color:var(--accent-strong, var(--accent))!important;font-size:11px!important;font-weight:820}.usage-answer-card[_ngcontent-%COMP%]:disabled .usage-card-action[_ngcontent-%COMP%]{color:var(--muted-2)!important}.usage-panels[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr;gap:12px;align-items:start}.usage-panel[_ngcontent-%COMP%]{display:grid;gap:10px;padding:13px}.panel-heading[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.panel-heading[_ngcontent-%COMP%] h3[_ngcontent-%COMP%], .usage-panel[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;color:var(--text-strong);font-size:16px;font-weight:800}.panel-heading[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:3px 0 0}.panel-heading[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{flex:0 0 auto;border:1px solid var(--line);border-radius:999px;padding:4px 8px;background:var(--surface-soft);font-weight:760}.daily-usage-list[_ngcontent-%COMP%]{display:grid;gap:6px}.daily-usage-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(120px,.45fr) minmax(110px,.35fr) minmax(0,1fr);gap:10px;align-items:center;border:1px solid var(--line);border-radius:10px;padding:8px 10px;background:var(--surface-soft);color:var(--text);text-align:left;cursor:default}.daily-usage-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled{cursor:default}.daily-usage-list[_ngcontent-%COMP%] button.empty[_ngcontent-%COMP%]:disabled{opacity:.64}.daily-usage-list[_ngcontent-%COMP%] button.can-open[_ngcontent-%COMP%]{cursor:pointer}.daily-usage-list[_ngcontent-%COMP%] button.can-open[_ngcontent-%COMP%]:hover{border-color:var(--line-strong)}.daily-usage-list[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--text-strong);font-size:14px;font-weight:800}@media(max-width:1200px){.usage-answer-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:850px){.usage-header[_ngcontent-%COMP%], .panel-heading[_ngcontent-%COMP%]{display:grid}.usage-controls[_ngcontent-%COMP%]{grid-template-columns:1fr;width:100%}.usage-answer-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(2,minmax(0,1fr))}.daily-usage-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{grid-template-columns:1fr;gap:4px}}@media(max-width:560px){.usage-answer-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}"]})};function me(n){return new Date(n.getFullYear(),n.getMonth(),n.getDate())}function ee(n,t){let e=new Date(n);return e.setDate(e.getDate()+t),e}function Ce(n){let t=n.getFullYear(),e=String(n.getMonth()+1).padStart(2,"0"),a=String(n.getDate()).padStart(2,"0");return`${t}-${e}-${a}`}export{Z as UsagePageComponent};
@@ -0,0 +1 @@
1
+ import{a as N,d as D}from"./chunk-OS2XPCVW.js";import{$a as _,Ca as g,Da as u,Ea as F,Fa as O,Ga as S,Ha as h,Ia as i,J as k,Ja as n,Ka as T,O as y,Oa as b,P as M,Qa as x,Sa as c,U as E,Ua as V,Va as o,Wa as p,Xa as C,Ya as P,Z as f,_a as d,ab as w,db as v,ka as l,nb as z,ob as B,sa as I,sb as j,tb as q,ub as R,vb as $,wb as A,xb as L,yb as K,zb as W}from"./chunk-WOIYAEKB.js";var Q=(r,t)=>t.id;function G(r,t){if(r&1&&(i(0,"option",15),o(1),n()),r&2){let e=t.$implicit;h("value",e),l(),p(e==="all"?"All workspaces":e)}}function U(r,t){if(r&1){let e=b();i(0,"button",23),x("click",function(){y(e);let s=c(2);return M(s.resetFilters())}),o(1,"Reset"),n()}}function J(r,t){if(r&1&&(i(0,"em"),o(1),d(2,"number"),n()),r&2){let e=c().$implicit;l(),P(" ",_(2,2,e.recalls==null?null:e.recalls.length)," ",(e.recalls==null?null:e.recalls.length)===1?"read":"reads"," ")}}function X(r,t){if(r&1&&(i(0,"time"),o(1),d(2,"date"),n()),r&2){let e=c().$implicit;l(),p(w(2,1,e.modifiedAt,"MMM d"))}}function Y(r,t){if(r&1){let e=b();i(0,"button",24),x("click",function(){let s=y(e).$implicit,m=c(2);return M(m.selectMemory(s))}),i(1,"span",25),o(2),n(),i(3,"span",26)(4,"small"),o(5),n(),i(6,"strong"),o(7),n()(),i(8,"span",27)(9,"b"),o(10),n(),g(11,J,3,4,"em")(12,X,3,4,"time"),n()()}if(r&2){let e=t.$implicit,a=c(2);V("active",a.selectedMemory().id===e.id)("plan",e.kind==="plan"),l(2),C(" ",e.kind==="plan"?"P":"M"," "),l(3),p(a.fileName(e)),l(2),p(e.title),l(3),p(e.kind==="plan"?"Plan":a.scopeLabel(e.scope)),l(),u(e.recalls!=null&&e.recalls.length?11:12)}}function Z(r,t){if(r&1){let e=b();i(0,"button",23),x("click",function(){y(e);let s=c(2),m=c(2);return M(m.emitOpenSession(s))}),o(1),n()}if(r&2){let e=c();l(),C(" Created in: ",e.title," ")}}function ee(r,t){if(r&1&&(i(0,"span"),o(1),n()),r&2){let e=c();l(),C("Created in: ",e.title)}}function te(r,t){if(r&1&&g(0,Z,2,1,"button",20)(1,ee,2,1,"span"),r&2){let e=c(3);u(e.canOpenSession?0:1)}}function ne(r,t){if(r&1&&(i(0,"span"),o(1),n()),r&2){let e=c();l(),C("Session ",e.sessionId.slice(0,8))}}function oe(r,t){if(r&1&&(i(0,"p",34),o(1),n()),r&2){let e=c(3);l(),p(e.actionStatus())}}function ie(r,t){if(r&1){let e=b();i(0,"button",23),x("click",function(){y(e);let s=c(2).$implicit,m=c(4);return M(m.emitRecallSession(s.sessionId))}),o(1),n()}if(r&2){let e=c();l(),C(" ",e.title," ")}}function re(r,t){if(r&1&&(i(0,"span"),o(1),n()),r&2){let e=c();l(),p(e.title)}}function ae(r,t){if(r&1&&g(0,ie,2,1,"button",20)(1,re,2,1,"span"),r&2){let e=c(5);u(e.canOpenSession?0:1)}}function le(r,t){if(r&1&&(i(0,"span"),o(1),n()),r&2){let e=c().$implicit;l(),C("Session ",e.sessionId.slice(0,8))}}function se(r,t){if(r&1&&(o(0),d(1,"number")),r&2){let e=c();C(" \xB7 ",_(1,1,e.cachedInputTokens)," cached ")}}function ce(r,t){if(r&1&&(i(0,"span"),o(1),d(2,"number"),g(3,se,2,3),n()),r&2){let e=t,a=c().$implicit,s=c(4);l(),P(" ",s.recallRequestLabel(a)," \xB7 ",_(2,3,e.inputTokens)," input "),l(2),u(e.cachedInputTokens?3:-1)}}function me(r,t){if(r&1&&(i(0,"article",40)(1,"div")(2,"time"),o(3),d(4,"date"),n(),g(5,ae,2,1)(6,le,2,1,"span"),n(),i(7,"div",42)(8,"span"),o(9),d(10,"number"),n(),g(11,ce,4,5,"span"),n()()),r&2){let e,a,s=t.$implicit,m=c(4);l(3),p(w(4,4,s.timestamp,"medium")),l(2),u((e=m.recallSession(s.sessionId))?5:6,e),l(4),C("",_(10,7,s.returnedCharacterCount)," characters loaded"),l(2),u((a=s.followingModelCall)?11:-1,a)}}function pe(r,t){if(r&1&&(i(0,"section",35)(1,"header")(2,"div")(3,"span",29),o(4,"Observed use"),n(),i(5,"h4"),o(6),d(7,"number"),n()(),i(8,"p"),o(9,"These are explicit memory reads recorded by VS Code."),n()(),i(10,"div",39),O(11,me,12,9,"article",40,Q),n(),i(13,"p",41),o(14," Request totals include the complete prompt and context, not only this memory. "),n()()),r&2){let e=c();l(6),P(" Read ",_(7,2,e.recalls==null?null:e.recalls.length)," ",(e.recalls==null?null:e.recalls.length)===1?"time":"times"," "),l(5),S(e.recalls)}}function de(r,t){if(r&1){let e=b();i(0,"article",22)(1,"header",28)(2,"div")(3,"span",29),o(4),n(),i(5,"h3"),o(6),n(),i(7,"p"),o(8),d(9,"date"),n()(),i(10,"div",30)(11,"button",23),x("click",function(){let s=y(e),m=c(2);return M(m.copyContent(s))}),o(12,"Copy"),n(),i(13,"button",23),x("click",function(){let s=y(e),m=c(2);return M(m.runMemoryAction(s,"open"))}),o(14,"Open file"),n(),i(15,"button",23),x("click",function(){let s=y(e),m=c(2);return M(m.runMemoryAction(s,"reveal"))}),o(16,"Show in folder"),n(),i(17,"button",23),x("click",function(){let s=y(e),m=c(2);return M(m.copyPath(s))}),o(18,"Copy path"),n()()(),i(19,"div",31)(20,"span",32)(21,"b"),o(22),n(),o(23," scope "),T(24,"app-help-popover",33),n(),i(25,"span")(26,"b"),o(27),d(28,"number"),n(),o(29," characters"),n(),i(30,"span")(31,"b"),o(32),d(33,"number"),n(),o(34," lines"),n(),i(35,"span")(36,"b"),o(37),n()(),g(38,te,2,1)(39,ne,2,1,"span"),n(),g(40,oe,2,1,"p",34),g(41,pe,15,4,"section",35),i(42,"details",36)(43,"summary")(44,"span"),o(45,"Markdown source"),n(),i(46,"small"),o(47),d(48,"number"),d(49,"number"),n()(),i(50,"pre",37),o(51),n()(),i(52,"footer",38)(53,"span"),o(54,"Local file"),n(),i(55,"code"),o(56),n()()()}if(r&2){let e,a=t,s=c(2);l(4),C(" ",a.kind==="plan"?"Saved plan":s.scopeLabel(a.scope)+" memory"," "),l(2),p(a.title),l(2),P(" ",a.workspace||"Available across workspaces"," \xB7 updated ",w(9,16,a.modifiedAt,"medium")," "),l(14),p(s.scopeLabel(a.scope)),l(2),h("text",s.scopeHelp(a.scope)),l(3),p(_(28,19,a.characterCount)),l(5),p(_(33,21,a.lineCount)),l(5),p(s.fileName(a)),l(),u((e=s.linkedSession(a))?38:a.sessionId?39:-1,e),l(2),u(s.actionStatus()?40:-1),l(),u(a.recalls!=null&&a.recalls.length?41:-1),l(6),P("",_(48,23,a.lineCount)," lines \xB7 ",_(49,25,a.characterCount)," characters"),l(4),p(a.content),l(5),p(a.sourcePath)}}function _e(r,t){if(r&1&&(i(0,"section",16)(1,"aside",18)(2,"div",19)(3,"span"),o(4),d(5,"number"),n(),g(6,U,2,0,"button",20),n(),O(7,Y,13,9,"button",21,Q),n(),g(9,de,57,27,"article",22),n()),r&2){let e,a=c();l(4),C("",_(5,3,a.filteredMemories().length)," shown"),l(2),u(a.query()||a.scopeFilter()!=="all"||a.kindFilter()!=="all"||a.workspaceFilter()!=="all"?6:-1),l(),S(a.filteredMemories()),l(2),u((e=a.selectedMemory())?9:-1,e)}}function ge(r,t){if(r&1){let e=b();i(0,"button",23),x("click",function(){y(e);let s=c(2);return M(s.resetFilters())}),o(1,"Reset filters"),n()}}function ue(r,t){if(r&1&&(i(0,"section",17)(1,"h3"),o(2),n(),i(3,"p"),o(4),n(),g(5,ge,2,0,"button",20),n()),r&2){let e=c();l(2),p(e.memoriesInput().length?"No memories match these filters":"No Copilot memories found"),l(2),C(" ",e.memoriesInput().length?"Try a broader search or reset the filters.":"Create a saved memory or plan in VS Code, then refresh the local scan."," "),l(),u(e.memoriesInput().length?5:-1)}}var H=class r{http=k(N);memoriesInput=f([]);sessionsInput=f([]);query=f("");scopeFilter=f("all");kindFilter=f("all");workspaceFilter=f("all");selectedId=f(null);actionStatus=f("");set memories(t){let e=t??[];this.memoriesInput.set(e),(!this.selectedId()||!e.some(a=>a.id===this.selectedId()))&&this.selectedId.set(e[0]?.id??null)}set sessions(t){this.sessionsInput.set(t??[])}canOpenSession=!0;openSession=new E;workspaceOptions=v(()=>["all",...[...new Set(this.memoriesInput().map(t=>t.workspace).filter(Boolean))].sort()]);filteredMemories=v(()=>{let t=this.query().trim().toLowerCase();return this.memoriesInput().filter(e=>(!t||[e.title,e.excerpt,e.content,e.relativePath,e.sourcePath,this.fileName(e),e.workspace,e.scope,e.kind].join(" ").toLowerCase().includes(t))&&(this.scopeFilter()==="all"||e.scope===this.scopeFilter())&&(this.kindFilter()==="all"||e.kind===this.kindFilter())&&(this.workspaceFilter()==="all"||e.workspace===this.workspaceFilter()))});selectedMemory=v(()=>{let t=this.filteredMemories();return t.find(e=>e.id===this.selectedId())??t[0]??null});summary=v(()=>{let t=this.memoriesInput();return{total:t.length,plans:t.filter(e=>e.kind==="plan").length,recalls:t.reduce((e,a)=>e+(a.recalls?.length??0),0),repositories:new Set(t.map(e=>e.workspace).filter(Boolean)).size}});recallSession(t){return this.sessionsInput().find(e=>e.id===t)??null}emitRecallSession(t){let e=this.recallSession(t);this.canOpenSession&&e&&this.openSession.emit(e)}recallRequestLabel(t){let e=t.followingModelCall?.number,a=e?`request ${e}`:"request";return t.sourceLog==="main.jsonl"?`Before model ${a}`:`Before subagent model ${a}`}selectMemory(t){this.selectedId.set(t.id),this.actionStatus.set("")}setScopeFilter(t){this.scopeFilter.set(t),this.actionStatus.set(""),this.ensureVisibleSelection()}setKindFilter(t){this.kindFilter.set(t),this.actionStatus.set(""),this.ensureVisibleSelection()}setWorkspaceFilter(t){this.workspaceFilter.set(t),this.actionStatus.set(""),this.ensureVisibleSelection()}setQuery(t){this.query.set(t),this.actionStatus.set(""),this.ensureVisibleSelection()}resetFilters(){this.query.set(""),this.scopeFilter.set("all"),this.kindFilter.set("all"),this.workspaceFilter.set("all"),this.ensureVisibleSelection()}fileName(t){return(t.relativePath||t.sourcePath).split(/[\\/]+/).filter(Boolean).at(-1)??t.title}scopeHelp(t){return{session:"Session-scoped memory is tied to one Copilot session. It is useful for saved plans or temporary research from that run.",repository:"Repository memory is saved for a workspace repository and can be available to future Copilot sessions in that workspace.",workspace:"Workspace memory belongs to this VS Code workspace but is not clearly tied to one repository or session.",global:"Global memory is stored in VS Code user storage and can apply across workspaces on this machine."}[t]}ensureVisibleSelection(){let t=this.filteredMemories();if(!t.length){this.selectedId.set(null);return}t.some(e=>e.id===this.selectedId())||this.selectedId.set(t[0].id)}linkedSession(t){return t.sessionId?this.sessionsInput().find(e=>e.id===t.sessionId)??null:null}emitOpenSession(t){let e=this.linkedSession(t);this.canOpenSession&&e&&this.openSession.emit(e)}runMemoryAction(t,e){this.actionStatus.set(e==="open"?"Opening file\u2026":"Showing file\u2026"),this.http.post(D(`/api/memories/${t.id}/open`),{action:e}).subscribe({next:()=>this.actionStatus.set(e==="open"?"Opened file":"Shown in folder"),error:()=>this.actionStatus.set("File actions require the local runtime")})}async copyPath(t){try{await globalThis.navigator?.clipboard?.writeText(t.sourcePath),this.actionStatus.set("Path copied")}catch{this.actionStatus.set("Could not copy the path")}}async copyContent(t){try{await globalThis.navigator?.clipboard?.writeText(t.content),this.actionStatus.set("Memory copied")}catch{this.actionStatus.set("Could not copy the memory")}}scopeLabel(t){return{global:"Global",repository:"Repository",session:"Session",workspace:"Workspace"}[t]}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=I({type:r,selectors:[["app-memory-page"]],inputs:{memories:"memories",sessions:"sessions",canOpenSession:"canOpenSession"},outputs:{openSession:"openSession"},decls:69,vars:17,consts:[[1,"memory-page"],[1,"memory-header"],[1,"eyebrow"],["aria-label","Memory summary",1,"memory-header-meta"],["aria-label","Memory filters",1,"memory-controls"],[1,"memory-search"],["type","search","placeholder","Search title, filename, content, or path",3,"ngModelChange","ngModel"],[3,"ngModelChange","ngModel"],["value","all"],["value","memory"],["value","plan"],["value","global"],["value","repository"],["value","session"],["value","workspace"],[3,"value"],[1,"memory-workspace"],[1,"memory-empty"],["aria-label","Saved memories",1,"memory-list"],[1,"memory-list-heading"],["type","button"],["type","button",1,"memory-card",3,"active","plan"],[1,"memory-detail"],["type","button",3,"click"],["type","button",1,"memory-card",3,"click"],["aria-hidden","true",1,"memory-file-icon"],[1,"memory-card-main"],[1,"memory-card-side"],[1,"memory-detail-header"],[1,"memory-kicker"],[1,"memory-actions"],[1,"memory-facts"],[1,"scope-fact"],["label","Explain memory scope",3,"text"],["aria-live","polite",1,"memory-action-status"],["aria-label","Observed memory use",1,"memory-recalls"],[1,"memory-source"],[1,"memory-content"],[1,"memory-path"],[1,"memory-recall-list"],[1,"memory-recall-row"],[1,"memory-recall-note"],[1,"memory-recall-facts"]],template:function(e,a){e&1&&(i(0,"section",0)(1,"header",1)(2,"div")(3,"p",2),o(4,"Copilot memory"),n(),i(5,"h2"),o(6,"What Copilot remembers"),n(),i(7,"p"),o(8,"Saved plans and memories from local VS Code Copilot storage."),n()(),i(9,"div",3)(10,"span")(11,"strong"),o(12),d(13,"number"),n(),o(14," files"),n(),i(15,"span")(16,"strong"),o(17),d(18,"number"),n(),o(19," plans"),n(),i(20,"span")(21,"strong"),o(22),d(23,"number"),n(),o(24," reads"),n(),i(25,"span")(26,"strong"),o(27),d(28,"number"),n(),o(29," workspaces"),n(),i(30,"b"),o(31,"Read-only"),n()()(),i(32,"section",4)(33,"label",5)(34,"span"),o(35,"Search memories"),n(),i(36,"input",6),x("ngModelChange",function(m){return a.setQuery(m)}),n()(),i(37,"label")(38,"span"),o(39,"Type"),n(),i(40,"select",7),x("ngModelChange",function(m){return a.setKindFilter(m)}),i(41,"option",8),o(42,"Memories and plans"),n(),i(43,"option",9),o(44,"Memories"),n(),i(45,"option",10),o(46,"Plans"),n()()(),i(47,"label")(48,"span"),o(49,"Scope"),n(),i(50,"select",7),x("ngModelChange",function(m){return a.setScopeFilter(m)}),i(51,"option",8),o(52,"All scopes"),n(),i(53,"option",11),o(54,"Global"),n(),i(55,"option",12),o(56,"Repository"),n(),i(57,"option",13),o(58,"Session"),n(),i(59,"option",14),o(60,"Workspace"),n()()(),i(61,"label")(62,"span"),o(63,"Workspace"),n(),i(64,"select",7),x("ngModelChange",function(m){return a.setWorkspaceFilter(m)}),O(65,G,2,2,"option",15,F),n()()(),g(67,_e,10,5,"section",16)(68,ue,6,3,"section",17),n()),e&2&&(l(12),p(_(13,9,a.summary().total)),l(5),p(_(18,11,a.summary().plans)),l(5),p(_(23,13,a.summary().recalls)),l(5),p(_(28,15,a.summary().repositories)),l(9),h("ngModel",a.query()),l(4),h("ngModel",a.kindFilter()),l(10),h("ngModel",a.scopeFilter()),l(14),h("ngModel",a.workspaceFilter()),l(),S(a.workspaceOptions()),l(2),u(a.filteredMemories().length?67:68))},dependencies:[W,L,K,q,A,R,$,j,z,B],styles:['[_nghost-%COMP%]{display:block}.memory-page[_ngcontent-%COMP%]{display:grid;grid-template-rows:auto auto minmax(0,1fr);gap:8px;min-height:calc(100vh - 96px)}.memory-header[_ngcontent-%COMP%], .memory-controls[_ngcontent-%COMP%], .memory-list[_ngcontent-%COMP%], .memory-detail[_ngcontent-%COMP%], .memory-empty[_ngcontent-%COMP%]{border:1px solid var(--line);background:var(--surface);box-shadow:var(--shadow-soft)}.memory-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:14px;border-color:color-mix(in srgb,var(--accent-2) 18%,var(--line));border-radius:14px;padding:12px 14px;background:var(--header-gradient)}.eyebrow[_ngcontent-%COMP%], .memory-kicker[_ngcontent-%COMP%]{margin:0;color:var(--muted-2);font-size:9px;font-weight:820;letter-spacing:.08em;text-transform:uppercase}.memory-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], .memory-detail[_ngcontent-%COMP%] h3[_ngcontent-%COMP%], .memory-empty[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:2px 0 0;color:var(--text-strong);letter-spacing:0}.memory-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:21px;line-height:1.15}.memory-header[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .memory-detail-header[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .memory-empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:4px 0 0;color:var(--muted);font-size:12px;line-height:1.35}.memory-header-meta[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:5px}.memory-header-meta[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .memory-header-meta[_ngcontent-%COMP%] b[_ngcontent-%COMP%]{display:inline-flex;align-items:center;min-height:24px;border:1px solid var(--line);border-radius:999px;padding:3px 8px;background:color-mix(in srgb,var(--surface) 74%,transparent);color:var(--muted);font-size:11px;font-weight:720;white-space:nowrap}.memory-header-meta[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{margin-right:4px;color:var(--text-strong)}.memory-header-meta[_ngcontent-%COMP%] b[_ngcontent-%COMP%]{border-color:color-mix(in srgb,var(--accent) 28%,var(--line));color:var(--accent)}.memory-controls[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(260px,1.8fr) repeat(3,minmax(130px,.8fr));gap:7px;border-radius:12px;padding:8px}.memory-controls[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:grid;gap:4px}.memory-controls[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--muted);font-size:10px;font-weight:760}.memory-controls[_ngcontent-%COMP%] input[_ngcontent-%COMP%], .memory-controls[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{width:100%;min-height:32px;border:1px solid var(--line);border-radius:8px;padding:6px 9px;background:var(--surface-soft);color:var(--text);font:inherit;font-size:12px}.memory-workspace[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(320px,380px) minmax(0,1fr);gap:10px;align-items:start;min-height:0}.memory-list[_ngcontent-%COMP%], .memory-detail[_ngcontent-%COMP%], .memory-empty[_ngcontent-%COMP%]{border-radius:13px}.memory-list[_ngcontent-%COMP%]{position:sticky;top:70px;display:grid;align-content:start;gap:3px;max-height:calc(100vh - 150px);overflow:auto;padding:7px}.memory-list-heading[_ngcontent-%COMP%]{position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;min-height:28px;padding:2px 4px 5px;background:var(--surface);color:var(--muted);font-size:11px}.memory-list-heading[_ngcontent-%COMP%] button[_ngcontent-%COMP%], .memory-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%], .memory-facts[_ngcontent-%COMP%] button[_ngcontent-%COMP%], .memory-empty[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border:1px solid var(--line);border-radius:7px;padding:5px 8px;background:var(--surface-soft);color:var(--text);font:inherit;font-size:11px;font-weight:760;cursor:pointer}.memory-card[_ngcontent-%COMP%]{display:grid;grid-template-columns:22px minmax(0,1fr) auto;align-items:center;gap:8px;width:100%;min-height:47px;border:1px solid transparent;border-radius:8px;padding:7px 8px;background:transparent;color:var(--text);text-align:left;cursor:pointer}.memory-card[_ngcontent-%COMP%]:hover, .memory-card.active[_ngcontent-%COMP%]{border-color:color-mix(in srgb,var(--accent) 34%,var(--line));background:color-mix(in srgb,var(--accent) 6%,var(--surface-soft))}.memory-card.plan.active[_ngcontent-%COMP%]{border-color:color-mix(in srgb,var(--accent-2) 42%,var(--line));background:color-mix(in srgb,var(--accent-2) 7%,var(--surface-soft))}.memory-file-icon[_ngcontent-%COMP%]{display:grid;place-items:center;width:22px;height:22px;border-radius:6px;background:color-mix(in srgb,var(--accent) 12%,var(--surface-soft));color:var(--accent);font-size:10px;font-weight:850}.memory-card.plan[_ngcontent-%COMP%] .memory-file-icon[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--accent-2) 14%,var(--surface-soft));color:var(--accent-2)}.memory-card-main[_ngcontent-%COMP%], .memory-card-side[_ngcontent-%COMP%]{display:grid;gap:2px;min-width:0}.memory-card-main[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{overflow:hidden;color:var(--text-strong);font-size:13px;font-weight:760;line-height:1.22;text-overflow:ellipsis;white-space:nowrap}.memory-card-main[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{overflow:hidden;color:var(--muted-2);font-size:10px;line-height:1.15;text-overflow:ellipsis;white-space:nowrap}.memory-card-side[_ngcontent-%COMP%]{justify-items:end;color:var(--muted-2);font-size:10px;white-space:nowrap}.memory-card-side[_ngcontent-%COMP%] b[_ngcontent-%COMP%]{color:var(--muted);font-size:10px;text-transform:uppercase}.memory-card-side[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{border-radius:999px;padding:2px 6px;background:color-mix(in srgb,var(--accent) 10%,var(--surface));color:var(--accent);font-style:normal;font-weight:760}.memory-detail[_ngcontent-%COMP%]{min-width:0;padding:14px}.memory-detail-header[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:14px}.memory-detail[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font-size:20px;line-height:1.2}.memory-actions[_ngcontent-%COMP%], .memory-facts[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:6px}.memory-actions[_ngcontent-%COMP%]{justify-content:flex-end}.memory-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:first-child{border-color:var(--accent);background:var(--accent);color:#fff}.memory-facts[_ngcontent-%COMP%]{margin-top:10px}.memory-facts[_ngcontent-%COMP%] > span[_ngcontent-%COMP%], .memory-facts[_ngcontent-%COMP%] > button[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;min-height:25px;border:1px solid var(--line);border-radius:999px;padding:4px 8px;background:var(--surface-soft);color:var(--muted);font-size:11px}.memory-facts[_ngcontent-%COMP%] b[_ngcontent-%COMP%]{color:var(--text-strong)}.memory-facts[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{color:var(--accent)}.memory-action-status[_ngcontent-%COMP%]{margin:9px 0 0;color:var(--accent);font-size:11px}.memory-recalls[_ngcontent-%COMP%]{display:grid;gap:8px;margin-top:12px;border:1px solid color-mix(in srgb,var(--accent) 22%,var(--line));border-radius:10px;padding:10px;background:color-mix(in srgb,var(--accent) 4%,var(--surface-soft))}.memory-recalls[_ngcontent-%COMP%] > header[_ngcontent-%COMP%]{display:flex;align-items:end;justify-content:space-between;gap:10px}.memory-recalls[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin:2px 0 0;color:var(--text-strong);font-size:14px}.memory-recalls[_ngcontent-%COMP%] > header[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .memory-recall-note[_ngcontent-%COMP%]{margin:0;color:var(--muted);font-size:11px}.memory-recall-list[_ngcontent-%COMP%]{display:grid;gap:5px}.memory-recall-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(180px,.8fr) minmax(230px,1.2fr);gap:10px;border-top:1px solid var(--line);padding-top:7px}.memory-recall-row[_ngcontent-%COMP%] > div[_ngcontent-%COMP%], .memory-recall-facts[_ngcontent-%COMP%]{display:grid;gap:2px}.memory-recall-row[_ngcontent-%COMP%] time[_ngcontent-%COMP%], .memory-recall-row[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--muted);font-size:11px}.memory-recall-row[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:fit-content;border:0;padding:0;background:none;color:var(--accent);font:inherit;font-size:12px;font-weight:760;text-align:left;cursor:pointer}.memory-source[_ngcontent-%COMP%]{margin-top:12px;border:1px solid var(--line);border-radius:10px;background:var(--surface-soft)}.memory-source[_ngcontent-%COMP%] summary[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:38px;padding:8px 11px;color:var(--text-strong);cursor:pointer;list-style:none}.memory-source[_ngcontent-%COMP%] summary[_ngcontent-%COMP%]::-webkit-details-marker{display:none}.memory-source[_ngcontent-%COMP%] summary[_ngcontent-%COMP%]:before{content:"";flex:0 0 auto;width:7px;height:7px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(-45deg);transition:transform .14s ease}.memory-source[open][_ngcontent-%COMP%] summary[_ngcontent-%COMP%]:before{transform:rotate(45deg)}.memory-source[_ngcontent-%COMP%] summary[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1;font-size:12px;font-weight:780}.memory-source[_ngcontent-%COMP%] summary[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{color:var(--muted);font-size:11px}.memory-content[_ngcontent-%COMP%]{max-height:48vh;margin:0;border-top:1px solid var(--line);padding:14px;overflow:auto;color:var(--text);font-family:ui-monospace,SFMono-Regular,Consolas,Liberation Mono,monospace;font-size:12px;line-height:1.58;white-space:pre-wrap;overflow-wrap:anywhere}.memory-path[_ngcontent-%COMP%]{display:grid;gap:4px;margin-top:10px;color:var(--muted-2);font-size:10px;text-transform:uppercase}.memory-path[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{display:block;border:1px solid var(--line);border-radius:8px;padding:7px 9px;background:var(--surface-soft);color:var(--muted);font-size:11px;text-transform:none;overflow-wrap:anywhere;-webkit-user-select:text;user-select:text}.memory-empty[_ngcontent-%COMP%]{display:grid;justify-items:start;padding:28px}@media(max-width:1050px){.memory-controls[_ngcontent-%COMP%]{grid-template-columns:repeat(2,minmax(0,1fr))}.memory-search[_ngcontent-%COMP%]{grid-column:1 / -1}}@media(max-width:820px){.memory-page[_ngcontent-%COMP%]{min-height:auto}.memory-detail-header[_ngcontent-%COMP%]{display:grid}.memory-workspace[_ngcontent-%COMP%]{grid-template-columns:1fr}.memory-header[_ngcontent-%COMP%]{align-items:flex-start;padding:10px}.memory-header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{display:none}.memory-header-meta[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,max-content);justify-content:end;gap:4px}.memory-header-meta[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .memory-header-meta[_ngcontent-%COMP%] b[_ngcontent-%COMP%]{min-height:21px;padding:2px 6px;font-size:10px}.memory-controls[_ngcontent-%COMP%]{grid-template-columns:repeat(3,minmax(0,1fr))}.memory-search[_ngcontent-%COMP%]{grid-column:1 / -1}.memory-list[_ngcontent-%COMP%]{position:static;max-height:420px}.memory-actions[_ngcontent-%COMP%]{justify-content:flex-start}.memory-recalls[_ngcontent-%COMP%] > header[_ngcontent-%COMP%], .memory-recall-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr}}@media(max-width:480px){.memory-header[_ngcontent-%COMP%]{display:grid}.memory-header-meta[_ngcontent-%COMP%]{justify-content:start}.memory-controls[_ngcontent-%COMP%] input[_ngcontent-%COMP%], .memory-controls[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{padding-inline:6px;font-size:11px}.memory-controls[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:9px}}']})};export{H as MemoryPageComponent};
@@ -0,0 +1 @@
1
+ import{$a as P,Ba as k,Ca as p,Da as g,Ea as D,Fa as b,Ga as S,Ha as h,Ia as a,Ja as i,Ka as I,O as z,Oa as O,P as y,Qa as v,Sa as u,U as E,Ua as w,Va as s,Wa as m,Xa as C,Ya as T,Z as x,Za as V,_a as _,a as F,ab as N,b as $,db as f,ka as r,nb as A,ob as R,sa as q,sb as B,tb as j,ub as W,vb as K,wb as H,xb as Q,yb as G,zb as U}from"./chunk-WOIYAEKB.js";var J=(o,e)=>e.kind+":"+e.path,X=(o,e)=>e.id,Z=(o,e)=>e.sessionId,ee=(o,e)=>e.callNumber,te=(o,e)=>e.key,ne=(o,e)=>e.raw+e.label;function ie(o,e){if(o&1&&(a(0,"span"),s(1),i()),o&2){let t=u(2);r(),m(t.evidenceScanProgressLabel())}}function oe(o,e){if(o&1&&(a(0,"p",34),s(1),i()),o&2){let t=u(2);r(),m(t.activeScanStats())}}function ae(o,e){if(o&1&&(a(0,"span"),s(1),i()),o&2){let t=u(2);r(),C("Running ",t.elapsedScanLabel())}}function se(o,e){if(o&1&&(a(0,"span"),s(1),i()),o&2){let t=u(2);r(),C("Last update ",t.lastProgressLabel()," ago")}}function re(o,e){if(o&1&&(a(0,"div",32)(1,"div")(2,"strong"),s(3),i(),p(4,ie,2,1,"span"),i(),I(5,"progress",33),i(),p(6,oe,2,1,"p",34),a(7,"p",35),p(8,ae,2,1,"span"),p(9,se,2,1,"span"),i()),o&2){let t=u();r(3),m(t.evidenceScanProgressPercent()?t.evidenceScanProgressPercent()+"%":"Working"),r(),g(t.evidenceScanProgressLabel()?4:-1),r(),h("value",t.evidenceScanProgressPercent()||null),r(),g(t.activeScanStats()?6:-1),r(2),g(t.elapsedScanLabel()?8:-1),r(),g(t.lastProgressLabel()?9:-1)}}function ce(o,e){o&1&&(a(0,"p",7),s(1,"This is taking longer than expected. You can stop it; existing data will be kept."),i())}function le(o,e){o&1&&(a(0,"p",7),s(1,"No recent progress update has been received."),i())}function de(o,e){if(o&1){let t=O();a(0,"button",36),v("click",function(){z(t);let c=u();return y(c.cancelScan.emit())}),s(1,"Stop evidence scan"),i()}}function ue(o,e){o&1&&I(0,"span",11)}function me(o,e){if(o&1&&(a(0,"option",27),s(1),i()),o&2){let t=e.$implicit;h("value",t),r(),m(t==="all"?"All workspaces":t)}}function pe(o,e){if(o&1&&(a(0,"div")(1,"b"),s(2),i(),a(3,"code"),s(4),i()()),o&2){let t=e.$implicit,n=u(2);r(2),m(n.diagnosticKindLabel(t.kind)),r(2),m(t.path)}}function ge(o,e){o&1&&(a(0,"p",29),s(1,"Showing the first 80 recorded locations. Generated scan diagnostics are capped."),i())}function Ce(o,e){if(o&1&&(a(0,"div",37),b(1,pe,5,2,"div",null,J),i(),p(3,ge,2,0,"p",29)),o&2){let t=u();r(),S(t.scanDiagnostics().locations),r(2),g(t.scanDiagnostics().capped?3:-1)}}function ve(o,e){o&1&&(a(0,"p",29),s(1,"No source-location details were recorded for this scan. This does not mean no customization files were found."),i())}function xe(o,e){if(o&1){let t=O();a(0,"button",43),v("click",function(){z(t);let c=u(2);return y(c.resetFilters())}),s(1,"Reset"),i()}}function he(o,e){if(o&1){let t=O();a(0,"button",44),v("click",function(){let c=z(t).$implicit,l=u(2);return y(l.selectCustomization(c))}),a(1,"span",45),s(2),i(),a(3,"span",46)(4,"strong"),s(5),i(),a(6,"small"),s(7),i()(),a(8,"span",47)(9,"b"),s(10),i(),a(11,"em"),s(12),i()()()}if(o&2){let t=e.$implicit,n=u(2);w("active",n.selectedCustomizationId()===t.id)("sent",t.evidenceStatus==="sent")("listed",t.evidenceStatus==="listed")("discovered",t.evidenceStatus==="discovered"),r(2),C(" ",n.kindLabel(t.kind).slice(0,1)," "),r(3),m(t.title),r(2),T("",n.fileName(t)," \xB7 ",n.kindLabel(t.kind)),r(3),m(n.statusLabel(t.evidenceStatus)),r(2),m(n.evidenceCountLabel(t))}}function _e(o,e){if(o&1&&(a(0,"span")(1,"b"),s(2,"applyTo"),i(),s(3),i()),o&2){let t=u();r(3),C(" ",t.applyTo.join(", "))}}function fe(o,e){if(o&1&&(a(0,"span")(1,"b"),s(2,"trigger"),i(),s(3),i()),o&2){let t=u();r(3),C(" ",t.triggers.join(", "))}}function be(o,e){if(o&1&&(a(0,"div",54)(1,"span",49),s(2,"Matched customization text"),i(),a(3,"p",57),s(4),i()()),o&2){let t=u();r(4),m(t.description)}}function Se(o,e){if(o&1&&(a(0,"span",69),s(1),i()),o&2){let t=e.$implicit,n=u(6);w("sent",t.status==="sent")("listed",t.status==="listed")("discovered",t.status==="discovered"),k("aria-label",n.timelineMarkerLabel(t)),r(),C(" #",t.callNumber," ")}}function Pe(o,e){if(o&1&&(a(0,"span",68),s(1),i()),o&2){let t=u(2).$implicit,n=u(4);r(),C("+",n.timelineOverflow(t)," more")}}function Me(o,e){if(o&1&&(a(0,"span",63),b(1,Se,2,8,"span",67,ee),p(3,Pe,2,1,"span",68),i()),o&2){let t=u().$implicit,n=u(4);k("aria-label",n.sessionEvidenceLabel(t)),r(),S(n.timelineMarkers(t)),r(2),g(n.timelineOverflow(t)?3:-1)}}function ze(o,e){o&1&&(a(0,"span",64),s(1,"No file text found"),i())}function ye(o,e){if(o&1){let t=O();a(0,"button",43),v("click",function(){z(t);let c=u().$implicit,l=u(4);return y(l.emitOpenSession(c.sessionId))}),s(1,"Open run"),i()}}function Oe(o,e){if(o&1&&(a(0,"blockquote"),s(1),i()),o&2){let t=u().$implicit;r(),C(" ",t.matchedPreview[0]," ")}}function we(o,e){if(o&1&&(a(0,"li")(1,"b"),s(2),i(),a(3,"code"),s(4),i()()),o&2){let t=e.$implicit;r(2),m(t.label),r(2),m(t.raw)}}function Ee(o,e){if(o&1&&(a(0,"article",71)(1,"div",72)(2,"strong"),s(3),i(),a(4,"p"),s(5),i(),p(6,Oe,2,1,"blockquote"),a(7,"details",73)(8,"summary"),s(9),i(),a(10,"div")(11,"span"),s(12,"Visible VS Code log sources"),i(),a(13,"ul"),b(14,we,5,2,"li",null,ne),i()()()()()),o&2){let t=e.$implicit,n=u(6);w("sent",t.status==="sent"),r(3),m(n.callEvidenceTitle(t)),r(2),m(n.callEvidenceSummary(t)),r(),g(t.matchedPreview.length?6:-1),r(3),C("Proof details \xB7 ",n.evidenceDetailsSummary(t)),r(5),S(n.rawEvidenceSources(t))}}function ke(o,e){if(o&1&&(a(0,"div",66),b(1,Ee,16,6,"article",70,te),i()),o&2){let t=u().$implicit,n=u(4);r(),S(n.sentCallEvidence(t))}}function Ie(o,e){if(o&1&&(a(0,"details",60)(1,"summary")(2,"span",61)(3,"time"),s(4),_(5,"date"),i(),a(6,"b"),s(7),i(),a(8,"em"),s(9),i()(),a(10,"span",62),p(11,Me,4,2,"span",63)(12,ze,2,0,"span",64),a(13,"strong"),s(14),i()()(),a(15,"div",65)(16,"p"),s(17),i(),p(18,ye,2,0,"button",40),i(),p(19,ke,3,0,"div",66),i()),o&2){let t=e.$implicit,n=u(4);w("sent",t.bestStatus==="sent")("listed",t.bestStatus==="listed")("discovered",t.bestStatus==="discovered"),r(4),m(N(5,14,t.timestamp,"medium")),r(3),m(t.title),r(2),m(n.evidenceGroupSubtitle(t)),r(2),g(t.bestStatus==="sent"?11:12),r(3),m(n.sessionEvidenceLabel(t)),r(3),C(" ",n.groupDetailSummary(t)," "),r(),g(t.session?18:-1),r(),g(t.bestStatus==="sent"?19:-1)}}function Te(o,e){if(o&1&&(a(0,"section",55)(1,"header")(2,"span",49),s(3,"Where it appeared"),i(),a(4,"h4"),s(5),_(6,"number"),i()(),a(7,"p",58),s(8," Each row is one Copilot session. Open a row for request-level proof. "),i(),b(9,Ie,20,17,"details",59,Z),i()),o&2){let t=u(3);r(5),T("",P(6,2,t.selectedSessionEvidence().length)," session",t.selectedSessionEvidence().length===1?"":"s"),r(4),S(t.selectedSessionEvidence())}}function Le(o,e){if(o&1&&(a(0,"article",42)(1,"header",48)(2,"div")(3,"span",49),s(4),i(),a(5,"h3"),s(6),i(),a(7,"p"),s(8),i()(),a(9,"span",50),s(10),I(11,"app-help-popover",51),i()(),a(12,"div",52)(13,"span")(14,"b"),s(15),_(16,"number"),i(),s(17," characters"),i(),a(18,"span")(19,"b"),s(20),_(21,"number"),i(),s(22," lines"),i(),a(23,"span")(24,"b"),s(25,"updated"),i(),s(26),_(27,"date"),i(),p(28,_e,4,1,"span"),p(29,fe,4,1,"span"),i(),a(30,"section",53)(31,"div")(32,"span",49),s(33,"Detection result"),i(),a(34,"h4"),s(35),i(),a(36,"p"),s(37),i()(),p(38,be,5,1,"div",54),i(),p(39,Te,11,4,"section",55),a(40,"footer",56)(41,"span"),s(42,"Local file"),i(),a(43,"code"),s(44),i()()()),o&2){let t=e,n=u(2);r(4),m(n.kindLabel(t.kind)),r(2),m(t.title),r(2),T("",t.workspace||"Local"," \xB7 ",n.fileName(t)),r(),w("sent",t.evidenceStatus==="sent")("listed",t.evidenceStatus==="listed")("discovered",t.evidenceStatus==="discovered"),r(),C(" ",n.statusLabel(t.evidenceStatus)," "),r(),h("text",n.statusHelp(t.evidenceStatus)),r(4),m(P(16,22,t.characterCount)),r(5),m(P(21,24,t.lineCount)),r(6),C(" ",N(27,26,t.modifiedAt,"mediumDate")),r(2),g(t.applyTo.length?28:-1),r(),g(t.triggers.length?29:-1),r(6),m(n.statusHeadline(t.evidenceStatus)),r(2),m(n.statusHelp(t.evidenceStatus)),r(),g(t.description?38:-1),r(),g(t.matches.length?39:-1),r(5),m(t.sourcePath)}}function Ne(o,e){if(o&1&&(a(0,"section",30)(1,"aside",38)(2,"div",39)(3,"span"),s(4),_(5,"number"),i(),p(6,xe,2,0,"button",40),i(),b(7,he,13,14,"button",41,X),i(),p(9,Le,45,29,"article",42),i()),o&2){let t,n=u();r(4),C("",P(5,3,n.filteredCustomizations().length)," shown"),r(2),g(n.query()||n.kindFilter()!=="all"||n.statusFilter()!=="all"||n.workspaceFilter()!=="all"?6:-1),r(),S(n.filteredCustomizations()),r(2),g((t=n.selectedCustomization())?9:-1,t)}}function Fe(o,e){if(o&1){let t=O();a(0,"button",43),v("click",function(){z(t);let c=u(2);return y(c.resetFilters())}),s(1,"Reset filters"),i()}}function $e(o,e){if(o&1&&(a(0,"section",31)(1,"h3"),s(2),i(),a(3,"p"),s(4),i(),p(5,Fe,2,0,"button",40),i()),o&2){let t=u();r(2),m(t.customizationsInput().length?"No customizations match these filters":"No Copilot customization files found for this workspace"),r(2),C(" ",t.customizationsInput().length?"Try a broader search or reset the filters.":"The scanner checks known Copilot customization locations for the current workspace. Open Advanced scan coverage to inspect source locations."," "),r(),g(t.customizationsInput().length?5:-1)}}var Y=class o{customizationsInput=x([]);sessionsInput=x([]);ingestionInput=x(null);query=x("");kindFilter=x("all");statusFilter=x("all");workspaceFilter=x("all");selectedId=x(null);set customizations(e){let t=e??[];this.customizationsInput.set(t),(!this.selectedId()||!t.some(n=>n.id===this.selectedId()))&&this.selectedId.set(t[0]?.id??null)}set sessions(e){this.sessionsInput.set(e??[])}set ingestion(e){this.ingestionInput.set(e??null)}refreshState="idle";refreshMessage=null;runtimeStatus=null;scanEvidence=new E;cancelScan=new E;openSession=new E;workspaceOptions=f(()=>["all",...[...new Set(this.customizationsInput().map(e=>e.workspace).filter(Boolean))].sort()]);filteredCustomizations=f(()=>{let e=this.query().trim().toLowerCase(),t=this.kindFilter(),n=this.statusFilter(),c=this.workspaceFilter();return this.customizationsInput().filter(l=>(!e||[l.title,l.name,l.description,l.excerpt,l.relativePath,l.sourcePath,l.kind,l.evidenceStatus,l.workspace,...l.applyTo,...l.triggers].join(" ").toLowerCase().includes(e))&&(t==="all"||l.kind===t)&&(n==="all"||l.evidenceStatus===n)&&(c==="all"||l.workspace===c))});selectedCustomization=f(()=>{let e=this.filteredCustomizations();return e.find(t=>t.id===this.selectedId())??e[0]??null});selectedCustomizationId=f(()=>this.selectedCustomization()?.id??"");selectedSessionEvidence=f(()=>{let e=this.selectedCustomization();return e?this.groupMatchesBySession(e):[]});summary=f(()=>{let e=this.customizationsInput();return{total:e.length,sent:e.filter(t=>t.evidenceStatus==="sent").length,listed:e.filter(t=>t.evidenceStatus==="listed").length,discovered:e.filter(t=>t.evidenceStatus==="discovered").length}});scanDiagnostics=f(()=>{let e=this.ingestionInput(),t=(e?.scannedCustomizationLocations??[]).filter(n=>n.kind!=="candidate");return{roots:e?.scannedCustomizationRoots??0,files:e?.importedCustomizations??this.customizationsInput().length,locations:t.slice(0,80),locationCount:t.length,capped:t.length>=200}});customizationEvidenceSummary=f(()=>{let e=this.ingestionInput(),t=this.customizationsInput(),n=t.filter(d=>d.evidenceStatus==="sent").length,c=t.filter(d=>d.evidenceStatus==="listed").length,l=(e?.customizationEvidenceScannedSessions??0)>0;return{sent:n,notProved:c,hasScannedEvidence:l,label:l?`${n.toLocaleString()} text-matched \xB7 ${c.toLocaleString()} read/referenced`:"Detailed evidence skipped"}});scanActionLabel(){return this.refreshState==="refreshing"?"Scanning...":this.customizationEvidenceSummary().hasScannedEvidence?"Find usage evidence again":"Find usage evidence"}isEvidenceScanActive(){return this.refreshState==="refreshing"&&this.runtimeStatus?.activeScanMode==="customizations"}currentWorkspaceLabel(){let e=this.runtimeStatus?.scanProgress?.workspace||"";if(e)return e;let t=this.workspaceOptions().filter(n=>n!=="all");return this.workspaceFilter()!=="all"?this.workspaceFilter():t.length===1?t[0]:"Current VS Code workspace"}customizationFileCountLabel(){let e=this.summary().total;return`${e.toLocaleString()} customization file${e===1?"":"s"}`}requestTextCountLabel(){let e=this.customizationEvidenceSummary();if(this.isEvidenceScanActive())return"Checking recent requests";if(this.refreshState==="error")return"Scan failed";if(this.refreshMessage?.toLowerCase().includes("stopped"))return"Scan stopped";if(!e.hasScannedEvidence)return"Not checked yet";let t=e.sent;return t?`${t.toLocaleString()} file${t===1?"":"s"} with request text`:"No request text found"}evidenceResultText(){if(this.isEvidenceScanActive())return this.currentScanStep();if(this.refreshState==="error")return this.refreshMessage||"The usage evidence scan did not finish.";if(this.refreshMessage?.toLowerCase().includes("stopped"))return"Scan stopped. Existing customization data was kept.";if(this.customizationEvidenceSummary().hasScannedEvidence){let e=this.customizationEvidenceSummary().sent,t=this.evidenceSessionCount(),n=this.evidenceMatchCount();return e?`${n.toLocaleString()} text match${n===1?"":"es"} across ${t.toLocaleString()} Copilot session${t===1?"":"s"}.`:"Checked recent Copilot requests. No customization file text was found."}return"Run Find usage evidence to check whether these files appeared inside recent Copilot model requests."}evidenceMetricLabel(){return this.isEvidenceScanActive()?"Matches so far":"Last result"}evidenceMetricText(){let e=this.isEvidenceScanActive()?Number(this.runtimeStatus?.scanProgress?.matches??this.evidenceMatchCount()):this.evidenceMatchCount();return`${e.toLocaleString()} text match${e===1?"":"es"}`}activeScanStats(){if(!this.isEvidenceScanActive())return"";let e=this.runtimeStatus?.scanProgress,t=Number(e?.sessions??0),n=Number(e?.modelCalls??0);return[t>0?`${t.toLocaleString()} session${t===1?"":"s"} checked`:"",n>0?`${n.toLocaleString()} model call${n===1?"":"s"} checked`:"",this.evidenceMetricText()].filter(Boolean).join(" \xB7 ")}evidenceScanProgressPercent(){if(!this.isEvidenceScanActive())return 0;let e=this.runtimeStatus?.scanProgress,t=Number(e?.index??e?.workspaceIndex??0),n=Number(e?.total??e?.workspaceTotal??0);return t>0&&n>0?Math.max(1,Math.min(100,Math.round(t/n*100))):0}evidenceScanProgressLabel(){if(!this.isEvidenceScanActive())return"";let e=this.runtimeStatus?.scanProgress,t=Number(e?.index??0),n=Number(e?.total??0);return t>0&&n>0?`${t.toLocaleString()} of ${n.toLocaleString()} Copilot session folders checked`:"Preparing session list"}currentScanStep(){let e=this.runtimeStatus?.scanProgress?.stage??"";return e==="customizations"||e==="workspace"||e==="workspace-state"?"Step 1 of 3: Loading customization files":e==="customization-evidence"||e==="debug-logs"?"Step 2 of 3: Checking recent Copilot sessions":e==="complete"?"Step 3 of 3: Summarising matches":"Preparing current workspace scan"}elapsedScanLabel(){let e=this.runtimeStatus?.lastScanStartedAt;return!e||!this.isEvidenceScanActive()?"":this.durationLabel(Date.now()-Date.parse(e))}lastProgressLabel(){let e=this.runtimeStatus?.scanProgress?.updatedAt;return!e||!this.isEvidenceScanActive()?"":this.durationLabel(Date.now()-Date.parse(e))}isLongRunningScan(){let e=this.runtimeStatus?.lastScanStartedAt;return!e||!this.isEvidenceScanActive()?!1:Date.now()-Date.parse(e)>6e4}isStaleScan(){let e=this.runtimeStatus?.scanProgress?.updatedAt;return!e||!this.isEvidenceScanActive()?!1:Date.now()-Date.parse(e)>3e4}evidenceSessionCount(){return new Set(this.customizationsInput().flatMap(e=>e.matches.map(t=>t.sessionId))).size}evidenceMatchCount(){return this.customizationsInput().reduce((e,t)=>e+t.matches.filter(n=>n.status==="sent").length,0)}durationLabel(e){if(!Number.isFinite(e)||e<0)return"";let t=Math.max(0,Math.round(e/1e3));return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}selectCustomization(e){this.selectedId.set(e.id)}setQuery(e){this.query.set(e),this.ensureVisibleSelection()}setKindFilter(e){this.kindFilter.set(e),this.ensureVisibleSelection()}setStatusFilter(e){this.statusFilter.set(e),this.ensureVisibleSelection()}setWorkspaceFilter(e){this.workspaceFilter.set(e),this.ensureVisibleSelection()}resetFilters(){this.query.set(""),this.kindFilter.set("all"),this.statusFilter.set("all"),this.workspaceFilter.set("all"),this.ensureVisibleSelection()}fileName(e){return(e.relativePath||e.sourcePath).split(/[\\/]+/).filter(Boolean).at(-1)??e.title}kindLabel(e){return{instruction:"Instruction",skill:"Skill",prompt:"Prompt",hook:"Hook",agent:"Agent",other:"Other"}[e]}statusLabel(e){return{sent:"Text match found",listed:"Read by Copilot",discovered:"Discovered",not_seen:"Not seen"}[e]}statusHeadline(e){return{sent:"File text appeared in a model request",listed:"Copilot read or referenced this file",discovered:"Found locally, not seen in a request",not_seen:"No evidence in imported sessions"}[e]}statusHelp(e){return{sent:"We found distinctive text from this file inside local VS Code request logs. The text reached a model request, but it may have arrived as customization context or as manually attached file context.",listed:"Local logs show Copilot read or referenced this file, but did not show distinctive file text inside the model request.",discovered:"The file exists in a known customization location, but imported model requests did not show a text match.",not_seen:"The file exists locally, but imported sessions do not show local evidence for it yet."}[e]}evidenceCountLabel(e){let t=new Set(e.matches.map(n=>n.sessionId)).size;return e.matches.length?`${t.toLocaleString()} session${t===1?"":"s"}`:"No sessions"}evidenceGroupSubtitle(e){let t=e.modelCallNumbers.length;if(e.bestStatus==="sent"){let n=this.sentModelCallCount(e);return n?`${n.toLocaleString()} text-matched request${n===1?"":"s"}`:"Text match found"}return e.bestStatus==="listed"?t?"Read or referenced, but no file text found":"Read or referenced":e.bestStatus==="discovered"?"Found during setup or discovery":"No imported evidence"}sourceLabel(e){return/^system_prompt/i.test(e)?"Instructions":/^tools/i.test(e)?"Tool list":{inputMessages:"Complete request",userRequest:"User prompt",copilotFileRead:"File read"}[e]??e}sourceHelp(e){return/^system_prompt/i.test(e.raw)?"Matched inside the instruction/system part of a VS Code request. This is usually where custom instructions and skills appear.":/^tools/i.test(e.raw)?"Matched near the tool definitions included with the request. This can include tool or MCP schema material.":e.raw==="inputMessages"?"Matched somewhere in the full request payload visible in VS Code logs. This is useful as broad local confirmation that the text appeared.":e.raw==="userRequest"?"Matched in the user-facing prompt/request material for this model call.":e.raw==="copilotFileRead"?"VS Code logs show Copilot read this customization file. This is useful evidence, but it does not prove the file text was sent to the model.":"Matched in this VS Code debug-log source. Open the technical proof section if you need the raw field name."}rawSourceLabel(e){return String(e)}sessionEvidenceLabel(e){if(!e.modelCallNumbers.length)return e.bestStatus==="sent"?"Text match found":this.statusLabel(e.bestStatus);if(e.bestStatus!=="sent")return"Read or referenced";let n=this.sentModelCallCount(e),c=n===1?"request":"requests";return`${n.toLocaleString()} text-matched ${c}`}timelineMarkers(e){let t=new Map;for(let n of e.matches){if(!n.modelCallNumber)continue;let c=t.get(n.modelCallNumber)??"not_seen";t.set(n.modelCallNumber,this.strongerStatus(c,n.status))}return[...t.entries()].sort(([n],[c])=>n-c).filter(([,n])=>e.bestStatus!=="sent"||n==="sent").slice(0,18).map(([n,c])=>({callNumber:n,status:c}))}timelineOverflow(e){let t=new Set(e.matches.filter(n=>e.bestStatus!=="sent"||n.status==="sent").map(n=>n.modelCallNumber).filter(Boolean));return Math.max(0,t.size-18)}timelineMarkerLabel(e){return e.status==="sent"?`Model request #${e.callNumber}: this file's text was included`:`Model request #${e.callNumber}: file text not proved`}callEvidence(e){let t=new Map;for(let n of e.matches){let c=n.modelCallNumber?`call:${n.modelCallNumber}`:`event:${n.eventIndex}`,d=t.get(c)??{key:c,callNumber:n.modelCallNumber,eventIndex:n.eventIndex,status:n.status,matches:[],sources:[],matchedChunks:0,matchedCharacters:0,matchedPreview:[]};d.matches.push(n),d.status=this.strongerStatus(d.status,n.status),d.matchedChunks+=n.matchedChunks??0,d.matchedCharacters+=n.matchedCharacters??0;for(let M of n.matchedPreview??[])M&&!d.matchedPreview.includes(M)&&d.matchedPreview.push(M);let L={label:this.sourceLabel(n.source),raw:this.rawSourceLabel(n.source)};d.sources.some(M=>M.label===L.label&&M.raw===L.raw)||d.sources.push(L),t.set(c,d)}return[...t.values()].sort((n,c)=>n.callNumber!==c.callNumber?c.callNumber-n.callNumber:c.eventIndex-n.eventIndex)}sentCallEvidence(e){return this.callEvidence(e).filter(t=>t.status==="sent")}callEvidenceTitle(e){let t=e.callNumber?`Request #${e.callNumber}`:`Event #${e.eventIndex}`;return e.status==="sent"?`${t}: file text found`:e.status==="listed"?`${t}: read or referenced`:`${t}: ${this.statusLabel(e.status).toLowerCase()}`}callEvidenceSummary(e){return e.status==="sent"?"Distinctive file text appeared in this Copilot request.":e.status==="listed"?"Copilot read or referenced this file, but local logs did not show distinctive file text inside this model request.":"No request payload content was verified for this event."}groupDetailSummary(e){if(e.bestStatus==="sent"){let t=this.sentModelCallCount(e),n=t===1?"model request":"model requests";return`File text appeared in ${t.toLocaleString()} Copilot ${n}. This confirms the text was visible in local request logs.`}return e.bestStatus==="listed"?"Copilot read or referenced this file in this session, but imported model requests did not show distinctive file text.":e.bestStatus==="discovered"?"VS Code setup or discovery mentioned this file, but imported model requests did not show distinctive file text.":"No visible request evidence was imported for this session."}evidenceSourceLabels(e){return this.uniqueSources(e.sources).map(t=>t.label)}evidenceSources(e){return this.uniqueSources(e.sources)}rawEvidenceSources(e){return this.uniqueSources(e.sources)}evidenceDetailsSummary(e){let t=[];e.callNumber&&t.push(`request #${e.callNumber}`);let n=this.sourcePhrase(e.sources);return n&&t.push(n),e.matchedCharacters&&t.push(`${e.matchedCharacters.toLocaleString()} characters matched`),t.join(" \xB7 ")||"raw debug-log proof"}sourcePhrase(e){let t=this.uniqueSources(e).map(n=>n.label);return t.length?t.length===1?t[0].toLowerCase():t.length===2?`${t[0].toLowerCase()} and ${t[1].toLowerCase()}`:`${t.slice(0,-1).map(n=>n.toLowerCase()).join(", ")}, and ${t.at(-1)?.toLowerCase()}`:"the model request"}uniqueSources(e){let t=new Set,n=[];for(let c of e){let l=`${c.label}:${c.raw}`;t.has(l)||(t.add(l),n.push(c))}return n}sentModelCallCount(e){return new Set(e.matches.filter(t=>t.status==="sent").map(t=>t.modelCallNumber).filter(Boolean)).size}diagnosticKindLabel(e){return{candidate:"Candidate root",root:"Folder",file:"File","debug-reference":"Debug reference","debug-discovery-root":"VS Code discovery","vscode-setting-root":"VS Code setting","vscode-default-root":"VS Code default","vscode-user-setting-root":"User setting","vscode-workspace-setting-root":"Workspace setting","vscode-workspace-folder-setting-root":"Workspace-folder setting","vscode-parent-repo-default-root":"Parent repo default","user-default-root":"User default"}[e]??e}sessionForMatch(e){return this.sessionsInput().find(t=>t.id===e)??null}emitOpenSession(e){let t=this.sessionForMatch(e);t&&this.openSession.emit(t)}groupMatchesBySession(e){let t=new Map;for(let n of e.matches){let c=this.sessionForMatch(n.sessionId),d=t.get(n.sessionId)??{sessionId:n.sessionId,session:c,title:c?.title??`Session ${n.sessionId.slice(0,8)}`,timestamp:n.timestamp,bestStatus:n.status,matches:[],sentCount:0,listedCount:0,discoveredCount:0,modelCallNumbers:[],sources:[],matchedChunks:0,matchedCharacters:0};d.matches.push(n),d.bestStatus=this.strongerStatus(d.bestStatus,n.status),d.timestamp=[d.timestamp,n.timestamp].filter(Boolean).sort().at(-1)??d.timestamp,d.sentCount+=n.status==="sent"?1:0,d.listedCount+=n.status==="listed"?1:0,d.discoveredCount+=n.status==="discovered"?1:0,d.matchedChunks+=n.matchedChunks??0,d.matchedCharacters+=n.matchedCharacters??0,n.modelCallNumber&&!d.modelCallNumbers.includes(n.modelCallNumber)&&d.modelCallNumbers.push(n.modelCallNumber),n.source&&!d.sources.includes(n.source)&&d.sources.push(n.source),t.set(n.sessionId,d)}return[...t.values()].map(n=>$(F({},n),{modelCallNumbers:[...n.modelCallNumbers].sort((c,l)=>c-l),matches:[...n.matches].sort((c,l)=>l.timestamp.localeCompare(c.timestamp)||l.eventIndex-c.eventIndex)})).sort((n,c)=>c.timestamp.localeCompare(n.timestamp))}strongerStatus(e,t){let n={not_seen:0,discovered:1,listed:2,sent:3};return n[t]>n[e]?t:e}ensureVisibleSelection(){let e=this.filteredCustomizations();if(!e.length){this.selectedId.set(null);return}e.some(t=>t.id===this.selectedId())||this.selectedId.set(e[0].id)}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=q({type:o,selectors:[["app-customizations-page"]],inputs:{customizations:"customizations",sessions:"sessions",ingestion:"ingestion",refreshState:"refreshState",refreshMessage:"refreshMessage",runtimeStatus:"runtimeStatus"},outputs:{scanEvidence:"scanEvidence",cancelScan:"cancelScan",openSession:"openSession"},decls:86,vars:25,consts:[[1,"customizations-page"],[1,"customizations-header"],[1,"eyebrow"],[1,"preview-badge"],["aria-label","Customization scan status",1,"customizations-scan-status"],[1,"scan-status-body"],[1,"scan-summary-line"],[1,"scan-warning"],[1,"scan-status-actions"],["type","button",1,"secondary-scan-button"],["type","button",1,"evidence-scan-button",3,"click","disabled"],["aria-hidden","true",1,"button-spinner"],["aria-label","Customization filters",1,"customizations-controls"],[1,"customizations-search"],["type","search","placeholder","Search filename, title, description, applyTo, trigger",3,"ngModelChange","ngModel"],[3,"ngModelChange","ngModel"],["value","all"],["value","instruction"],["value","skill"],["value","prompt"],["value","hook"],["value","agent"],["value","other"],["value","sent"],["value","listed"],["value","discovered"],["value","not_seen"],[3,"value"],[1,"customizations-diagnostics"],[1,"diagnostic-note"],[1,"customizations-workspace"],[1,"customizations-empty"],["aria-label","Evidence scan progress",1,"scan-progress-meter"],["max","100",3,"value"],[1,"scan-progress-stats"],[1,"scan-progress-line"],["type","button",1,"secondary-scan-button",3,"click"],[1,"diagnostic-list"],["aria-label","Local customizations",1,"customizations-list"],[1,"customizations-list-heading"],["type","button"],["type","button",1,"customization-card",3,"active","sent","listed","discovered"],[1,"customization-detail"],["type","button",3,"click"],["type","button",1,"customization-card",3,"click"],["aria-hidden","true",1,"customization-file-icon"],[1,"customization-card-main"],[1,"customization-card-side"],[1,"customization-detail-header"],[1,"customization-kicker"],[1,"evidence-badge"],["label","Explain customization evidence",3,"text"],[1,"customization-facts"],[1,"evidence-summary"],[1,"matched-customization-text"],["aria-label","Customization evidence matches",1,"match-list"],[1,"customization-path"],[1,"description"],[1,"match-list-help"],[1,"match-group",3,"sent","listed","discovered"],[1,"match-group"],[1,"match-group-title"],[1,"match-group-status"],[1,"match-group-timeline"],[1,"match-group-weak"],[1,"match-group-detail-header"],[1,"match-events","call-events"],[1,"timeline-marker",3,"sent","listed","discovered"],[1,"timeline-overflow"],[1,"timeline-marker"],[1,"match-event","call-event",3,"sent"],[1,"match-event","call-event"],[1,"call-event-main"],[1,"raw-evidence-details"]],template:function(t,n){t&1&&(a(0,"section",0)(1,"header",1)(2,"div")(3,"p",2),s(4,"Customization evidence "),a(5,"span",3),s(6,"Preview"),i()(),a(7,"h2"),s(8,"Did your rules appear in Copilot requests?"),i(),a(9,"p"),s(10,"Browse local instructions, skills, prompts, hooks, and agents. Preview evidence is based on text visible in imported VS Code model requests."),i()()(),a(11,"section",4)(12,"div",5)(13,"div")(14,"p",6)(15,"strong"),s(16),i(),a(17,"span"),s(18),i(),a(19,"span"),s(20),i()(),a(21,"p"),s(22),i(),p(23,re,10,6),p(24,ce,2,0,"p",7),p(25,le,2,0,"p",7),i(),a(26,"div",8),p(27,de,2,0,"button",9),a(28,"button",10),v("click",function(){return n.scanEvidence.emit()}),p(29,ue,1,0,"span",11),s(30),i()()()(),a(31,"section",12)(32,"label",13)(33,"span"),s(34,"Search customizations"),i(),a(35,"input",14),v("ngModelChange",function(l){return n.setQuery(l)}),i()(),a(36,"label")(37,"span"),s(38,"Type"),i(),a(39,"select",15),v("ngModelChange",function(l){return n.setKindFilter(l)}),a(40,"option",16),s(41,"All types"),i(),a(42,"option",17),s(43,"Instructions"),i(),a(44,"option",18),s(45,"Skills"),i(),a(46,"option",19),s(47,"Prompts"),i(),a(48,"option",20),s(49,"Hooks"),i(),a(50,"option",21),s(51,"Agents"),i(),a(52,"option",22),s(53,"Other"),i()()(),a(54,"label")(55,"span"),s(56,"Evidence"),i(),a(57,"select",15),v("ngModelChange",function(l){return n.setStatusFilter(l)}),a(58,"option",16),s(59,"All evidence"),i(),a(60,"option",23),s(61,"Text match found"),i(),a(62,"option",24),s(63,"Read by Copilot"),i(),a(64,"option",25),s(65,"Discovered only"),i(),a(66,"option",26),s(67,"Not seen"),i()()(),a(68,"label")(69,"span"),s(70,"Workspace"),i(),a(71,"select",15),v("ngModelChange",function(l){return n.setWorkspaceFilter(l)}),b(72,me,2,2,"option",27,D),i()()(),a(74,"details",28)(75,"summary")(76,"span"),s(77,"Advanced scan coverage"),i(),a(78,"strong"),s(79),_(80,"number"),_(81,"number"),i()(),p(82,Ce,4,1)(83,ve,2,0,"p",29),i(),p(84,Ne,10,5,"section",30)(85,$e,6,3,"section",31),i()),t&2&&(r(16),m(n.currentWorkspaceLabel()),r(2),m(n.customizationFileCountLabel()),r(2),m(n.requestTextCountLabel()),r(2),m(n.evidenceResultText()),r(),g(n.isEvidenceScanActive()?23:-1),r(),g(n.isLongRunningScan()?24:-1),r(),g(n.isStaleScan()?25:-1),r(2),g(n.isEvidenceScanActive()?27:-1),r(),h("disabled",n.refreshState==="refreshing"),k("aria-busy",n.refreshState==="refreshing"),r(),g(n.isEvidenceScanActive()?29:-1),r(),C(" ",n.scanActionLabel()," "),r(5),h("ngModel",n.query()),r(4),h("ngModel",n.kindFilter()),r(18),h("ngModel",n.statusFilter()),r(14),h("ngModel",n.workspaceFilter()),r(),S(n.workspaceOptions()),r(7),V(" ",P(80,21,n.scanDiagnostics().roots)," folders/files checked \xB7 ",P(81,23,n.scanDiagnostics().files)," customization",n.scanDiagnostics().files===1?"":"s"," found "),r(3),g(n.scanDiagnostics().locations.length?82:83),r(2),g(n.filteredCustomizations().length?84:85))},dependencies:[U,Q,G,j,H,W,K,B,A,R],styles:['[_nghost-%COMP%]{display:block}.customizations-page[_ngcontent-%COMP%]{display:grid;grid-template-rows:auto auto auto auto minmax(0,1fr);gap:7px;min-height:calc(100vh - 96px)}.customizations-header[_ngcontent-%COMP%], .customizations-scan-status[_ngcontent-%COMP%], .customizations-controls[_ngcontent-%COMP%], .customizations-diagnostics[_ngcontent-%COMP%], .customizations-list[_ngcontent-%COMP%], .customization-detail[_ngcontent-%COMP%], .customizations-empty[_ngcontent-%COMP%]{border:1px solid var(--line);background:var(--surface);box-shadow:var(--shadow-soft)}.customizations-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:14px;border-color:color-mix(in srgb,var(--accent-2) 18%,var(--line));border-radius:13px;padding:10px 12px;background:var(--header-gradient)}.customizations-scan-status[_ngcontent-%COMP%]{display:grid;gap:4px;border-color:color-mix(in srgb,var(--accent) 22%,var(--line));border-radius:10px;padding:7px 9px;background:linear-gradient(135deg,color-mix(in srgb,var(--accent) 6%,transparent),transparent 50%),var(--surface)}.scan-status-body[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:12px}.scan-status-body[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;color:var(--muted);font-size:12px;line-height:1.4}.scan-summary-line[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:7px;color:var(--muted)!important}.scan-summary-line[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--text-strong);font-size:12px}.scan-summary-line[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px;color:var(--muted);font-size:11px}.scan-summary-line[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:before{width:3px;height:3px;border-radius:50%;background:color-mix(in srgb,var(--accent) 62%,var(--muted));content:""}.scan-progress-line[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:8px;margin-top:3px!important;color:var(--muted-2)!important;font-size:11px!important}.scan-progress-meter[_ngcontent-%COMP%]{display:grid;gap:5px;max-width:460px;margin-top:8px}.scan-progress-meter[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:10px;color:var(--muted);font-size:11px}.scan-progress-meter[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--text)}.scan-progress-meter[_ngcontent-%COMP%] progress[_ngcontent-%COMP%]{width:100%;height:7px;overflow:hidden;border:0;border-radius:999px;background:color-mix(in srgb,var(--surface-soft) 70%,transparent)}.scan-progress-meter[_ngcontent-%COMP%] progress[_ngcontent-%COMP%]::-webkit-progress-bar{border-radius:999px;background:color-mix(in srgb,var(--surface-soft) 70%,transparent)}.scan-progress-meter[_ngcontent-%COMP%] progress[_ngcontent-%COMP%]::-webkit-progress-value{border-radius:999px;background:linear-gradient(90deg,var(--accent),var(--accent-2))}.scan-progress-stats[_ngcontent-%COMP%]{margin-top:3px!important;color:var(--text)!important;font-size:11px!important;font-weight:720}.scan-warning[_ngcontent-%COMP%]{margin-top:4px!important;color:var(--warning)!important}.scan-status-actions[_ngcontent-%COMP%]{display:flex;flex:0 0 auto;align-items:center;gap:7px}.eyebrow[_ngcontent-%COMP%], .customization-kicker[_ngcontent-%COMP%]{margin:0;color:var(--muted-2);font-size:9px;font-weight:820;letter-spacing:.08em;text-transform:uppercase}.preview-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;min-height:17px;margin-left:6px;border:1px solid color-mix(in srgb,var(--accent) 42%,var(--line));border-radius:999px;padding:0 7px;background:color-mix(in srgb,var(--accent) 12%,transparent);color:var(--accent-strong, var(--accent));font-size:9px;letter-spacing:.08em}.customizations-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], .customization-detail[_ngcontent-%COMP%] h3[_ngcontent-%COMP%], .customizations-empty[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:2px 0 0;color:var(--text-strong);letter-spacing:0}.customizations-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:19px;line-height:1.15}.customizations-header[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .customization-detail-header[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .customizations-empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .evidence-summary[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:3px 0 0;color:var(--muted);font-size:12px;line-height:1.35}.evidence-scan-button[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:30px;border:1px solid color-mix(in srgb,var(--accent) 34%,var(--line));border-radius:999px;padding:6px 11px;background:color-mix(in srgb,var(--accent) 12%,var(--surface));color:var(--accent);font-size:11px;font-weight:780;cursor:pointer}.evidence-scan-button[_ngcontent-%COMP%]:disabled{cursor:wait;opacity:.68}.secondary-scan-button[_ngcontent-%COMP%]{min-height:30px;border:1px solid var(--line);border-radius:999px;padding:6px 11px;background:var(--surface-soft);color:var(--text);font-size:11px;font-weight:760;cursor:pointer}.button-spinner[_ngcontent-%COMP%]{width:12px;height:12px;border:2px solid color-mix(in srgb,var(--accent) 22%,transparent);border-top-color:var(--accent);border-radius:999px;animation:_ngcontent-%COMP%_spin .8s linear infinite}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}.customizations-controls[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(260px,1.8fr) repeat(3,minmax(130px,.8fr));gap:6px;align-items:end;border-radius:12px;padding:7px}.customizations-controls[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:grid;align-content:start;gap:4px;min-height:0}.customizations-controls[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--muted);font-size:10px;font-weight:760}.customizations-controls[_ngcontent-%COMP%] input[_ngcontent-%COMP%], .customizations-controls[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{width:100%;height:32px;min-height:32px;border:1px solid var(--line);border-radius:8px;padding:6px 9px;background:var(--surface-soft);color:var(--text);font:inherit;font-size:12px}.customizations-diagnostics[_ngcontent-%COMP%]{border-radius:12px;padding:0;overflow:hidden}.customizations-diagnostics[_ngcontent-%COMP%] summary[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:34px;padding:8px 10px;color:var(--muted);font-size:11px;font-weight:760;cursor:pointer}.customizations-diagnostics[_ngcontent-%COMP%] summary[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--text-strong);font-size:12px}.customizations-diagnostics[_ngcontent-%COMP%] summary[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--muted);font-size:11px;font-weight:760}.diagnostic-list[_ngcontent-%COMP%]{display:grid;gap:1px;max-height:240px;overflow:auto;border-top:1px solid var(--line);padding:6px;background:var(--surface-soft)}.diagnostic-list[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{display:grid;grid-template-columns:110px minmax(0,1fr);gap:8px;align-items:center;min-height:28px;border-radius:7px;padding:5px 7px}.diagnostic-list[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:nth-child(odd){background:color-mix(in srgb,var(--accent) 4%,transparent)}.diagnostic-list[_ngcontent-%COMP%] b[_ngcontent-%COMP%]{color:var(--muted-2);font-size:10px;text-transform:uppercase}.diagnostic-list[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{overflow-wrap:anywhere;color:var(--text);font-size:11px}.diagnostic-note[_ngcontent-%COMP%]{margin:0;border-top:1px solid var(--line);padding:8px 10px;color:var(--muted);font-size:11px;background:var(--surface-soft)}.customizations-workspace[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(360px,450px) minmax(0,1fr);gap:8px;align-items:start;min-height:0}.customizations-list[_ngcontent-%COMP%], .customization-detail[_ngcontent-%COMP%], .customizations-empty[_ngcontent-%COMP%]{border-radius:13px}.customizations-list[_ngcontent-%COMP%]{position:sticky;top:66px;display:grid;align-content:start;gap:2px;max-height:calc(100vh - 138px);overflow:auto;padding:6px}.customizations-list-heading[_ngcontent-%COMP%]{position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;min-height:28px;padding:2px 4px 5px;background:var(--surface);color:var(--muted);font-size:11px}.customizations-list-heading[_ngcontent-%COMP%] button[_ngcontent-%COMP%], .customizations-empty[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border:1px solid var(--line);border-radius:7px;padding:5px 8px;background:var(--surface-soft);color:var(--text);font:inherit;font-size:11px;font-weight:760;cursor:pointer}.customization-card[_ngcontent-%COMP%]{display:grid;grid-template-columns:22px minmax(0,1fr) auto;align-items:center;gap:7px;width:100%;min-height:44px;border:1px solid transparent;border-radius:9px;padding:6px 7px;background:transparent;color:var(--text);text-align:left;cursor:pointer}.customization-card[_ngcontent-%COMP%]:hover, .customization-card.active[_ngcontent-%COMP%]{border-color:color-mix(in srgb,var(--accent) 34%,var(--line));background:color-mix(in srgb,var(--accent) 6%,var(--surface-soft))}.customization-card.sent.active[_ngcontent-%COMP%]{border-color:color-mix(in srgb,var(--accent) 46%,var(--line));background:color-mix(in srgb,var(--accent) 8%,var(--surface-soft))}.customization-card.listed.active[_ngcontent-%COMP%]{border-color:color-mix(in srgb,var(--accent-2) 42%,var(--line));background:color-mix(in srgb,var(--accent-2) 7%,var(--surface-soft))}.customization-card.discovered.active[_ngcontent-%COMP%]{border-color:color-mix(in srgb,var(--warning) 38%,var(--line));background:color-mix(in srgb,var(--warning) 7%,var(--surface-soft))}.customization-file-icon[_ngcontent-%COMP%]{display:grid;place-items:center;width:22px;height:22px;border-radius:6px;background:color-mix(in srgb,var(--accent) 12%,var(--surface-soft));color:var(--accent);font-size:10px;font-weight:850}.customization-card-main[_ngcontent-%COMP%]{display:grid;gap:1px;min-width:0}.customization-card-main[_ngcontent-%COMP%] small[_ngcontent-%COMP%], .customization-card-side[_ngcontent-%COMP%] em[_ngcontent-%COMP%], .match-group[_ngcontent-%COMP%] time[_ngcontent-%COMP%], .customization-path[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--muted);font-size:10px;font-style:normal}.customization-card-main[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{overflow:hidden;color:var(--text-strong);font-size:12px;text-overflow:ellipsis;white-space:nowrap}.customization-card-side[_ngcontent-%COMP%]{display:grid;justify-items:end;gap:3px;color:var(--muted);font-size:10px}.customization-card-side[_ngcontent-%COMP%] b[_ngcontent-%COMP%]{color:var(--accent);font-size:10px}.customization-detail[_ngcontent-%COMP%]{display:grid;align-content:start;gap:9px;min-height:calc(100vh - 138px);padding:10px}.customization-detail-header[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.customization-detail-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font-size:19px;line-height:1.15}.evidence-badge[_ngcontent-%COMP%], .customization-facts[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;min-height:27px;border:1px solid var(--line);border-radius:999px;padding:4px 8px;background:var(--surface-soft);color:var(--text);font-size:11px;font-weight:760}.evidence-badge.sent[_ngcontent-%COMP%]{border-color:color-mix(in srgb,var(--accent) 44%,var(--line));background:color-mix(in srgb,var(--accent) 10%,var(--surface-soft));color:var(--accent)}.evidence-badge.listed[_ngcontent-%COMP%]{border-color:color-mix(in srgb,var(--accent-2) 44%,var(--line));background:color-mix(in srgb,var(--accent-2) 9%,var(--surface-soft));color:var(--accent-2)}.evidence-badge.discovered[_ngcontent-%COMP%]{color:var(--warning)}.customization-facts[_ngcontent-%COMP%]{display:flex;align-items:flex-start;flex-wrap:wrap;gap:6px}.customization-facts[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:0 0 auto;min-height:24px;padding:3px 8px}.customization-facts[_ngcontent-%COMP%] b[_ngcontent-%COMP%]{color:var(--text-strong)}.evidence-summary[_ngcontent-%COMP%], .match-list[_ngcontent-%COMP%], .customization-path[_ngcontent-%COMP%]{border:1px solid var(--line);border-radius:11px;padding:10px;background:var(--surface-soft)}.evidence-summary[_ngcontent-%COMP%]{display:grid;gap:10px}.evidence-summary[_ngcontent-%COMP%] h4[_ngcontent-%COMP%], .match-list[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin:0;color:var(--text-strong);font-size:15px}.evidence-summary[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{color:var(--text)}.matched-customization-text[_ngcontent-%COMP%]{border-top:1px solid var(--line);padding-top:9px}.match-list[_ngcontent-%COMP%]{display:grid;gap:5px}.match-list[_ngcontent-%COMP%] header[_ngcontent-%COMP%]{display:flex;align-items:baseline;justify-content:space-between;gap:10px}.match-list-help[_ngcontent-%COMP%]{margin:-2px 0 2px;color:var(--muted);font-size:11px;line-height:1.35}.match-group[_ngcontent-%COMP%]{border:1px solid var(--line);border-radius:8px;background:var(--surface);overflow:hidden}.match-group.sent[_ngcontent-%COMP%]{border-color:color-mix(in srgb,var(--accent) 34%,var(--line))}.match-group.listed[_ngcontent-%COMP%]{border-color:color-mix(in srgb,var(--accent-2) 30%,var(--line))}.match-group.discovered[_ngcontent-%COMP%]{border-color:color-mix(in srgb,var(--warning) 26%,var(--line))}.match-group[_ngcontent-%COMP%] summary[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(240px,1fr) auto;gap:10px;align-items:center;min-height:46px;padding:6px 10px;cursor:pointer}.match-group[_ngcontent-%COMP%] summary[_ngcontent-%COMP%]::marker{color:var(--accent)}.match-group-title[_ngcontent-%COMP%]{display:grid;gap:2px;min-width:0}.match-group-title[_ngcontent-%COMP%] time[_ngcontent-%COMP%]{color:var(--muted);font-size:10px}.match-group-title[_ngcontent-%COMP%] b[_ngcontent-%COMP%]{color:var(--text-strong);font-size:11px;line-height:1.2}.match-group-title[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{overflow:hidden;color:var(--muted);font-size:10px;font-style:normal;text-overflow:ellipsis;white-space:nowrap}.match-group-status[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:5px}.match-group-status[_ngcontent-%COMP%]{justify-content:flex-end;min-width:0}.match-group-status[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px;min-height:20px;border-radius:999px;padding:2px 7px;background:color-mix(in srgb,var(--accent) 7%,var(--surface-soft));color:var(--muted);font-size:10px;font-weight:720}.match-group-status[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--accent)}.match-group-timeline[_ngcontent-%COMP%]{display:flex;align-items:center;gap:3px;min-width:0}.timeline-marker[_ngcontent-%COMP%], .timeline-overflow[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;min-width:21px;height:18px;border:1px solid color-mix(in srgb,var(--line) 86%,transparent);border-radius:999px;padding:0 5px;background:color-mix(in srgb,var(--surface-soft) 88%,var(--surface));color:var(--muted);font-size:9px;font-weight:800;line-height:1}.timeline-marker.sent[_ngcontent-%COMP%]{border-color:color-mix(in srgb,var(--accent) 54%,var(--line));background:color-mix(in srgb,var(--accent) 18%,var(--surface));color:var(--accent-strong, var(--accent))}.timeline-marker.listed[_ngcontent-%COMP%]{border-color:color-mix(in srgb,var(--accent-2) 42%,var(--line));background:color-mix(in srgb,var(--accent-2) 13%,var(--surface));color:var(--accent-2)}.timeline-marker.discovered[_ngcontent-%COMP%]{border-color:color-mix(in srgb,var(--warning) 42%,var(--line));background:color-mix(in srgb,var(--warning) 12%,var(--surface));color:var(--warning)}.timeline-overflow[_ngcontent-%COMP%]{max-width:76px;border-style:dashed;white-space:nowrap}.match-group-weak[_ngcontent-%COMP%]{border:1px dashed color-mix(in srgb,var(--muted) 26%,var(--line));border-radius:999px;padding:2px 7px;color:var(--muted);font-size:10px;font-weight:760}.match-group-detail-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:12px;border-top:1px solid var(--line);padding:8px 10px}.match-group-detail-header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;color:var(--muted);font-size:11px}.match-group-detail-header[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{flex:0 0 auto;border:1px solid color-mix(in srgb,var(--accent) 30%,var(--line));border-radius:999px;padding:5px 9px;background:color-mix(in srgb,var(--accent) 8%,var(--surface));color:var(--accent);font-size:10px;font-weight:760;cursor:pointer}.match-events[_ngcontent-%COMP%]{display:grid;gap:1px;border-top:1px solid var(--line);background:var(--surface-soft)}.match-event[_ngcontent-%COMP%]{display:block;min-height:36px;padding:7px 10px}.match-event[_ngcontent-%COMP%] + .match-event[_ngcontent-%COMP%]{border-top:1px solid color-mix(in srgb,var(--line) 70%,transparent)}.call-event-main[_ngcontent-%COMP%]{display:grid;gap:3px;min-width:0}.call-event-main[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--accent-2);font-size:11px;font-weight:780}.call-event.sent[_ngcontent-%COMP%] .call-event-main[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--accent-strong, var(--accent))}.call-event-main[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;color:var(--muted);font-size:11px}.call-event-main[_ngcontent-%COMP%] blockquote[_ngcontent-%COMP%]{margin:0;border-left:2px solid color-mix(in srgb,var(--accent) 48%,var(--line));border-radius:6px;padding:4px 8px;background:color-mix(in srgb,var(--surface-soft) 84%,transparent);color:var(--text);font-size:11px;line-height:1.35}.raw-evidence-details[_ngcontent-%COMP%]{margin-top:5px}.raw-evidence-details[_ngcontent-%COMP%] summary[_ngcontent-%COMP%]{width:fit-content;color:var(--muted);font-size:10px;font-weight:760;cursor:pointer}.raw-evidence-details[_ngcontent-%COMP%] summary[_ngcontent-%COMP%]:hover{color:var(--text)}.raw-evidence-details[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{display:grid;gap:5px;margin-top:6px;border:1px solid color-mix(in srgb,var(--line) 82%,transparent);border-radius:8px;padding:7px 8px;background:color-mix(in srgb,var(--surface) 76%,transparent)}.raw-evidence-details[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--muted);font-size:10px;font-weight:820;letter-spacing:.08em;text-transform:uppercase}.raw-evidence-details[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{display:grid;gap:4px;margin:0;padding:0;list-style:none}.raw-evidence-details[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:6px;align-items:center;color:var(--muted);font-size:11px}.raw-evidence-details[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{border-radius:999px;padding:2px 6px;background:color-mix(in srgb,var(--surface-soft) 80%,transparent);color:var(--muted);font-size:10px}.customization-path[_ngcontent-%COMP%]{display:grid;gap:4px}.customization-path[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{overflow-wrap:anywhere;color:var(--text);font-size:11px}.customizations-empty[_ngcontent-%COMP%]{display:grid;place-items:center;min-height:190px;padding:18px;text-align:center}@media(max-width:980px){.customizations-controls[_ngcontent-%COMP%], .customizations-workspace[_ngcontent-%COMP%]{grid-template-columns:1fr}.customizations-list[_ngcontent-%COMP%]{position:static;max-height:420px}}@media(max-width:700px){.customizations-header[_ngcontent-%COMP%], .customizations-scan-status[_ngcontent-%COMP%], .customization-detail-header[_ngcontent-%COMP%]{display:grid}.scan-status-grid[_ngcontent-%COMP%]{grid-template-columns:1fr 1fr}.scan-status-body[_ngcontent-%COMP%]{display:grid}.match-group[_ngcontent-%COMP%] summary[_ngcontent-%COMP%], .match-event[_ngcontent-%COMP%]{grid-template-columns:1fr}.match-group-status[_ngcontent-%COMP%]{justify-content:flex-start}.match-group-weak[_ngcontent-%COMP%]{justify-self:start}.match-group-timeline[_ngcontent-%COMP%]{flex-wrap:wrap}}']})};export{Y as CustomizationsPageComponent};
@@ -0,0 +1 @@
1
+ import{a as H,b as $,c as W,d as V,e as j,f as q,g as J,h as K,i as y,m as Q,r as X,s as Y}from"./chunk-VEKXIM47.js";import{$a as O,Ca as f,Da as w,Fa as M,Ga as v,Ha as c,Ia as t,Ja as n,Ka as x,O as U,Oa as F,P as D,Qa as E,Sa as C,Ta as L,U as N,Ua as z,Va as i,Wa as s,Xa as d,Ya as T,Z as S,_a as p,a as b,ab as _,b as k,db as P,ja as A,ka as o,nb as G,ob as B,sa as R,sb as Z,ub as ee,vb as te,wb as ne,xb as ie,yb as ae,zb as oe}from"./chunk-WOIYAEKB.js";var re=(l,a)=>a.id,ce=(l,a)=>a.value,se=(l,a)=>a.model+":"+a.tier;function pe(l,a){if(l&1&&(t(0,"option",10),i(1),n()),l&2){let e=a.$implicit;c("value",e.id),o(),s(e.label)}}function de(l,a){if(l&1&&(t(0,"option",10),i(1),n()),l&2){let e=a.$implicit;c("value",e.value),o(),s(e.label)}}function ge(l,a){if(l&1){let e=F();t(0,"button",24),E("click",function(){let g=U(e).$implicit,m=C();return D(m.setSelectedAllowancePlan(g.id))}),t(1,"span"),i(2),n(),t(3,"strong"),i(4),p(5,"number"),n(),t(6,"em"),i(7),n()()}if(l&2){let e=a.$implicit,r=C();z("active",r.selectedAllowance().id===e.id),o(2),s(e.period),o(2),s(O(5,5,e.creditsPerUserMonthly)),o(3),d("",e.label," credits/user/month")}}function me(l,a){if(l&1&&(t(0,"em"),i(1),n()),l&2){let e=C().$implicit;o(),s(e.note)}}function ue(l,a){if(l&1&&(i(0),p(1,"number")),l&2){let e=C().$implicit;d(" $",_(1,1,e.cacheWrite,"1.0-3")," ")}}function he(l,a){l&1&&i(0," - ")}function xe(l,a){if(l&1&&(t(0,"span",26),i(1," Used by imports "),x(2,"app-help-popover",28),n()),l&2){let e=C(3);o(2),c("text",e.help.pricingFallback)}}function _e(l,a){if(l&1&&(t(0,"span",26),i(1," Estimate fallback "),x(2,"app-help-popover",28),n()),l&2){let e=C(3);o(2),c("text",e.help.pricingFallback)}}function Ce(l,a){l&1&&(t(0,"span",27),i(1,"Direct pricing"),n())}function Pe(l,a){if(l&1&&f(0,xe,3,1,"span",26)(1,_e,3,1,"span",26)(2,Ce,2,0,"span",27),l&2){let e=C().$implicit;w(e.usedDirectly&&e.usedAsFallback?0:e.usedAsFallback?1:2)}}function be(l,a){l&1&&(t(0,"span",25),i(1,"Not yet"),n())}function fe(l,a){if(l&1&&(t(0,"div",23)(1,"strong"),i(2),f(3,me,2,1,"em"),n(),t(4,"span"),i(5),n(),t(6,"span"),i(7),n(),t(8,"span"),i(9),n(),t(10,"span"),i(11),t(12,"em"),i(13),n()(),t(14,"span"),i(15),p(16,"number"),n(),t(17,"span"),i(18),p(19,"number"),n(),t(20,"span"),f(21,ue,2,4)(22,he,1,0),n(),t(23,"span"),i(24),p(25,"number"),n(),t(26,"span"),f(27,Pe,3,1)(28,be,2,0,"span",25),n()()),l&2){let e=a.$implicit;o(2),d(" ",e.model," "),o(),w(e.note?3:-1),o(2),s(e.provider),o(2),s(e.releaseStatus),o(2),s(e.category),o(2),d(" ",e.tier," "),o(2),s(e.threshold),o(2),d("$",_(16,12,e.input,"1.0-3")),o(3),d("$",_(19,15,e.cachedInput,"1.0-3")),o(3),w(e.cacheWrite?21:22),o(3),d("$",_(25,18,e.output,"1.0-3")),o(3),w(e.usedByImportedSessions?27:28)}}var le=class l{sessionsInput=S([]);selectedAllowancePlanInput=S("business-standard");usageTimeRange=S("all");set sessions(a){this.sessionsInput.set(a??[])}set selectedAllowancePlan(a){this.selectedAllowancePlanInput.set(a??"business-standard")}selectedAllowancePlanChange=new N;pricingVersion=H;pricingSourceLabel=W;pricingSourceUrl=$;pricingSnapshotDate=V;pricingImportedAt=j;allowanceSourceUrl=J;creditUsd=q;allowancePlans=y;usageTimeOptions=[{value:"all",label:"All imported sessions"},{value:"7d",label:"Last 7 days"},{value:"30d",label:"Last 30 days"},{value:"90d",label:"Last 90 days"}];help={inputTokens:"Normal, non-cached input/context tokens priced at the GitHub input rate. Raw VS Code inputTokens can be higher when cachedTokens are present.",outputTokens:"Generated model response tokens.",cachedInput:"Input/context tokens VS Code reported as cachedTokens. They are part of raw input, but priced with GitHub cached-input rates instead of normal input rates.",cacheWrite:"Provider cache creation tokens when the billing source exposes them. GitHub lists this mainly for Anthropic pricing rows.",pricingFallback:"The raw model name from VS Code did not match a GitHub price row in the local pricing table, so the estimate uses the displayed fallback price row. Treat this as an explicit estimate assumption.",allowance:"Included AI credits for Copilot Business and Enterprise are monthly per assigned license, but GitHub pools them at the organization or enterprise billing entity level.",credit:"GitHub states that 1 AI credit equals $0.01 USD. When VS Code logs GitHub source usage, the app uses that first; otherwise it converts the local token estimate into credits.",usageWindow:"This only filters the imported sessions used by the allowance meter. It does not change the GitHub price table below."};selectedAllowance=P(()=>y.find(a=>a.id===this.selectedAllowancePlanInput())??y[0]);allowanceSessions=P(()=>{let a=this.usageCutoff(this.sessionsInput(),this.usageTimeRange());return this.sessionsInput().filter(e=>!a||new Date(e.startedAt).getTime()>=a)});totalEstimateUsd=P(()=>this.allowanceSessions().reduce((a,e)=>a+X(e),0));totalEstimateCredits=P(()=>this.allowanceSessions().reduce((a,e)=>a+Y(e),0));selectedAllowanceUsage=P(()=>{let a=this.selectedAllowance(),e=this.totalEstimateCredits(),r=a.creditsPerUserMonthly>0?e/a.creditsPerUserMonthly*100:0;return{credits:e,share:r,perUserCredits:a.creditsPerUserMonthly,sessions:this.allowanceSessions().length,totalSessions:this.sessionsInput().length,windowLabel:this.usageTimeOptions.find(g=>g.value===this.usageTimeRange())?.label??"All imported sessions"}});pricingRows=P(()=>Object.entries(K).flatMap(([a,e])=>{let r=u=>{let I=this.sessionsInput().flatMap(h=>h.modelBreakdown).filter(h=>h.pricingModel===a&&(h.pricingTiers?.includes(u)??u===(e.tierLabel??"Default")));return{usedByImportedSessions:I.length>0,usedDirectly:I.some(h=>!this.usesPricingFallback(h.model,h.pricingModel)),usedAsFallback:I.some(h=>this.usesPricingFallback(h.model,h.pricingModel))}},g={model:a,provider:e.provider,releaseStatus:e.releaseStatus,category:e.category,note:e.note},m=e.tierLabel??"Default";return[k(b(b({},g),r(m)),{tier:m,threshold:e.tierThresholdLabel??"All request sizes",input:e.input,cachedInput:e.cachedInput,cacheWrite:e.cacheWrite??0,output:e.output}),...(e.tiers??[]).map(u=>k(b(b({},g),r(u.label)),{tier:u.label,threshold:u.thresholdLabel,input:u.input,cachedInput:u.cachedInput,cacheWrite:u.cacheWrite??e.cacheWrite??0,output:u.output}))]}));setSelectedAllowancePlan(a){if(!y.some(r=>r.id===a))return;let e=a;this.selectedAllowancePlanInput.set(e),this.selectedAllowancePlanChange.emit(e)}setUsageTimeRange(a){this.usageTimeOptions.some(e=>e.value===a)&&this.usageTimeRange.set(a)}usesPricingFallback=Q;usageCutoff(a,e){if(e==="all"||!a.length)return null;let r=e==="7d"?7:e==="30d"?30:90,g=Math.max(...a.map(m=>new Date(m.startedAt).getTime()).filter(Number.isFinite));return Number.isFinite(g)?g-r*24*60*60*1e3:null}static \u0275fac=function(e){return new(e||l)};static \u0275cmp=R({type:l,selectors:[["app-pricing-page"]],inputs:{sessions:"sessions",selectedAllowancePlan:"selectedAllowancePlan"},outputs:{selectedAllowancePlanChange:"selectedAllowancePlanChange"},decls:129,vars:46,consts:[[1,"pricing-page"],[1,"pricing-header"],[1,"eyebrow"],["target","_blank","rel","noreferrer",3,"href"],[1,"pricing-source"],["aria-label","GitHub Copilot AI credit allowance",1,"allowance-panel"],[1,"allowance-copy"],[1,"allowance-control"],["label","Explain AI credit allowance",3,"text"],[3,"ngModelChange","ngModel"],[3,"value"],["label","Explain usage window",3,"text"],[1,"allowance-meter"],["aria-hidden","true",1,"allowance-bar"],["aria-label","Available Copilot allowance plans",1,"allowance-grid"],["type","button",1,"allowance-card",3,"active"],[1,"pricing-note"],[1,"pricing-table"],[1,"pricing-row","pricing-row-heading"],["label","Explain normal input",3,"text"],["label","Explain cached input",3,"text"],["label","Explain cache write",3,"text"],["label","Explain output tokens",3,"text"],[1,"pricing-row"],["type","button",1,"allowance-card",3,"click"],[1,"muted"],[1,"used-pill","fallback-used"],[1,"used-pill"],["label","Explain fallback pricing",3,"text"]],template:function(e,r){e&1&&(t(0,"section",0)(1,"div",1)(2,"div")(3,"p",2),i(4,"Cost inputs"),n(),t(5,"h2"),i(6,"GitHub Copilot prices used by this app"),n(),t(7,"p"),i(8," Evidence page for the rate card, AI-credit conversion, source usage, and token-estimate fallback. "),n()(),t(9,"a",3),i(10,"Open GitHub source"),n()(),t(11,"section",4)(12,"div")(13,"span"),i(14,"Source"),n(),t(15,"strong"),i(16),n()(),t(17,"div")(18,"span"),i(19,"Pricing version"),n(),t(20,"strong"),i(21),n()(),t(22,"div")(23,"span"),i(24,"Source checked"),n(),t(25,"strong"),i(26),p(27,"date"),n()(),t(28,"div")(29,"span"),i(30,"Imported into app"),n(),t(31,"strong"),i(32),p(33,"date"),n()()(),t(34,"section",5)(35,"div",6)(36,"p",2),i(37,"License allowance"),n(),t(38,"h3"),i(39,"AI credits context"),n(),t(40,"p"),i(41," GitHub converts model usage into AI credits at "),t(42,"strong"),i(43),p(44,"number"),n(),i(45,". The meter below compares imported source usage, with token estimates as fallback, against the selected per-license allowance. "),n(),t(46,"a",3),i(47,"Open allowance source"),n()(),t(48,"div",7)(49,"label")(50,"span"),i(51," Selected plan "),x(52,"app-help-popover",8),n(),t(53,"select",9),E("ngModelChange",function(m){return r.setSelectedAllowancePlan(m)}),M(54,pe,2,2,"option",10,re),n()(),t(56,"label")(57,"span"),i(58," Usage window "),x(59,"app-help-popover",11),n(),t(60,"select",9),E("ngModelChange",function(m){return r.setUsageTimeRange(m)}),M(61,de,2,2,"option",10,ce),n()(),t(63,"div",12)(64,"div")(65,"span"),i(66),n(),t(67,"strong"),i(68),p(69,"number"),n(),t(70,"em"),i(71),p(72,"number"),p(73,"number"),n()(),t(74,"div")(75,"span"),i(76,"Monthly allowance"),n(),t(77,"strong"),i(78),p(79,"number"),n()(),t(80,"div")(81,"span"),i(82,"Allowance used"),n(),t(83,"strong"),i(84),p(85,"number"),n()()(),t(86,"div",13),x(87,"span"),n(),t(88,"p"),i(89),n()()(),t(90,"section",14),M(91,ge,8,7,"button",15,re),n(),t(93,"div",16)(94,"strong"),i(95,"Calculation rule"),n(),t(96,"p"),i(97," Per-1M-token GitHub rates are multiplied by imported VS Code token buckets. Normal input is "),t(98,"code"),i(99,"inputTokens - cachedTokens"),n(),i(100," when cached tokens are present. Estimates stay in USD because GitHub prices and AI credits are USD-native; cache write is only priced when a numeric cache-write field is imported. Long-context rates are selected independently for each model call from that call's normal plus cached input. "),n()(),t(101,"div",17)(102,"div",18)(103,"span"),i(104,"Model"),n(),t(105,"span"),i(106,"Provider"),n(),t(107,"span"),i(108,"Status"),n(),t(109,"span"),i(110,"Category"),n(),t(111,"span"),i(112,"Tier"),n(),t(113,"span"),i(114,"Normal input "),x(115,"app-help-popover",19),n(),t(116,"span"),i(117,"Cached input "),x(118,"app-help-popover",20),n(),t(119,"span"),i(120,"Cache write "),x(121,"app-help-popover",21),n(),t(122,"span"),i(123,"Output "),x(124,"app-help-popover",22),n(),t(125,"span"),i(126,"Used"),n()(),M(127,fe,29,21,"div",23,se),n()()),e&2&&(o(9),c("href",r.pricingSourceUrl,A),o(7),s(r.pricingSourceLabel),o(5),s(r.pricingVersion),o(5),s(_(27,25,r.pricingSnapshotDate,"MMM d, y")),o(6),s(_(33,28,r.pricingImportedAt,"MMM d, y")),o(11),d("1 credit = $",_(44,31,r.creditUsd,"1.2-2")," USD"),o(3),c("href",r.allowanceSourceUrl,A),o(6),c("text",r.help.allowance),o(),c("ngModel",r.selectedAllowance().id),o(),v(r.allowancePlans),o(5),c("text",r.help.usageWindow),o(),c("ngModel",r.usageTimeRange()),o(),v(r.usageTimeOptions),o(5),s(r.selectedAllowanceUsage().windowLabel),o(2),d("",_(69,34,r.selectedAllowanceUsage().credits,"1.0-1")," credits"),o(3),T("",O(72,37,r.selectedAllowanceUsage().sessions)," of ",O(73,39,r.selectedAllowanceUsage().totalSessions)," sessions"),o(7),d("",O(79,41,r.selectedAllowance().creditsPerUserMonthly)," credits/user"),o(6),d("",_(85,43,r.selectedAllowanceUsage().share,"1.0-1"),"%"),o(3),L("width",r.selectedAllowanceUsage().share>100?100:r.selectedAllowanceUsage().share,"%"),o(2),T("",r.selectedAllowance().period,". ",r.selectedAllowance().note),o(2),v(r.allowancePlans),o(24),c("text",r.help.inputTokens),o(3),c("text",r.help.cachedInput),o(3),c("text",r.help.cacheWrite),o(3),c("text",r.help.outputTokens),o(3),v(r.pricingRows()))},dependencies:[oe,ie,ae,ne,ee,te,Z,G,B],styles:["[_nghost-%COMP%]{display:block}.pricing-page[_ngcontent-%COMP%]{display:grid;gap:16px}.pricing-header[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.pricing-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;color:var(--text-strong);font-size:22px;font-weight:760;letter-spacing:0}.pricing-header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0}.pricing-header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]:not(.eyebrow){max-width:720px;margin-top:6px;color:var(--muted);font-size:12px;line-height:1.45}.pricing-header[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{border:1px solid var(--line-strong);border-radius:999px;padding:7px 10px;color:var(--text);font-size:12px;font-weight:720;text-decoration:none;white-space:nowrap}.pricing-source[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));overflow:hidden;border:1px solid var(--line);border-radius:12px;background:var(--surface);box-shadow:var(--shadow, 0 18px 50px rgba(0, 0, 0, .22))}.pricing-source[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{padding:12px;border-right:1px solid var(--line)}.pricing-source[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:last-child{border-right:0}.pricing-source[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .pricing-row[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .pricing-note[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:var(--muted);font-size:12px}.pricing-source[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{display:block;margin-top:5px;color:var(--text);font-weight:760}.pricing-note[_ngcontent-%COMP%]{border:1px solid var(--line);border-left:4px solid var(--accent-2);border-radius:12px;padding:12px 14px;background:var(--surface-soft)}.pricing-note[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--text-strong)}.pricing-note[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{max-width:940px;margin:4px 0 0;line-height:1.45}.allowance-panel[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(260px,.85fr) minmax(320px,1.15fr);gap:14px;border:1px solid var(--line);border-radius:14px;padding:14px;background:var(--header-gradient, linear-gradient(135deg, rgba(124, 92, 255, .16), rgba(31, 209, 165, .07)), var(--surface))}.allowance-copy[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;color:var(--text-strong);font-size:18px;font-weight:760}.allowance-copy[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .allowance-control[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .allowance-card[_ngcontent-%COMP%] em[_ngcontent-%COMP%], .allowance-card[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--muted);font-size:12px;line-height:1.45}.allowance-copy[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{display:inline-flex;margin-top:8px;color:var(--accent-2);font-size:12px;font-weight:760;text-decoration:none}.allowance-control[_ngcontent-%COMP%]{display:grid;align-content:start;gap:12px}.allowance-control[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:grid;gap:6px}.allowance-control[_ngcontent-%COMP%] label[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;color:var(--muted);font-size:12px;font-weight:760}.allowance-control[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{width:100%;border:1px solid var(--line-strong);border-radius:10px;padding:8px 10px;background:var(--control-bg, rgba(5, 12, 22, .55));color:var(--text);font:inherit;font-weight:720}.allowance-meter[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.allowance-meter[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{border:1px solid var(--line);border-radius:10px;padding:10px;background:var(--surface-soft)}.allowance-meter[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;color:var(--muted);font-size:11px}.allowance-meter[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{display:block;margin-top:3px;color:var(--muted);font-size:11px;font-style:normal}.allowance-meter[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{display:block;margin-top:3px;color:var(--text-strong);font-size:16px;font-weight:760}.allowance-bar[_ngcontent-%COMP%]{height:7px;overflow:hidden;border-radius:999px;background:#6170852e}.allowance-bar[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--accent-2),#ffba4a)}.allowance-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.allowance-card[_ngcontent-%COMP%]{display:grid;gap:3px;border:1px solid var(--line);border-radius:12px;padding:10px;background:var(--surface);color:inherit;font:inherit;text-align:left;cursor:pointer}.allowance-card.active[_ngcontent-%COMP%]{border-color:#1fd1a570;background:#1fd1a517;box-shadow:0 0 0 1px #1fd1a51f inset}.allowance-card[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--text-strong);font-size:20px;font-weight:760}.pricing-table[_ngcontent-%COMP%]{overflow-x:auto;border:1px solid var(--line);border-radius:12px;background:var(--surface)}.pricing-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(210px,1.35fr) repeat(3,minmax(100px,.65fr)) minmax(150px,.9fr) repeat(4,minmax(100px,.58fr)) minmax(124px,.7fr);min-width:1240px;border-bottom:1px solid var(--line)}.pricing-row[_ngcontent-%COMP%]:last-child{border-bottom:0}.pricing-row[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{padding:10px 12px}.pricing-row-heading[_ngcontent-%COMP%]{background:var(--surface-soft);color:var(--muted);font-size:11px;font-weight:720;text-transform:uppercase}.pricing-row[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--text);font-size:14px;font-weight:760}.pricing-row[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{display:block;margin-top:4px;color:var(--text);font-size:12px;font-style:normal;font-weight:600}.used-pill[_ngcontent-%COMP%]{display:inline-flex;border:1px solid rgba(31,209,165,.35);border-radius:999px;padding:4px 8px;background:#1fd1a51f;color:var(--success-text, #bbfff0)!important;font-size:12px;font-weight:900;white-space:nowrap}.used-pill.fallback-used[_ngcontent-%COMP%]{border-color:#ffba4a73;background:#ffba4a1f;color:var(--warning-text, #ffe0a0)!important}.muted[_ngcontent-%COMP%]{color:var(--muted)}.eyebrow[_ngcontent-%COMP%]{color:var(--accent-2);font-size:10px;font-weight:760;letter-spacing:.08em;text-transform:uppercase}@media(max-width:900px){.pricing-header[_ngcontent-%COMP%], .pricing-source[_ngcontent-%COMP%]{display:grid}.pricing-source[_ngcontent-%COMP%], .allowance-panel[_ngcontent-%COMP%], .allowance-grid[_ngcontent-%COMP%], .allowance-meter[_ngcontent-%COMP%]{grid-template-columns:1fr}.pricing-source[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{border-right:0;border-bottom:1px solid var(--line)}.pricing-source[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:last-child{border-bottom:0}}.used-pill[_ngcontent-%COMP%]{padding:3px 7px;font-size:11px;font-weight:760}@media(max-width:1100px){.allowance-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(2,minmax(0,1fr))}}.theme-light[_nghost-%COMP%] .pricing-source[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .pricing-source[_ngcontent-%COMP%], .theme-light[_nghost-%COMP%] .pricing-table[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .pricing-table[_ngcontent-%COMP%], .theme-light[_nghost-%COMP%] .pricing-note[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .pricing-note[_ngcontent-%COMP%], .theme-light[_nghost-%COMP%] .allowance-panel[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .allowance-panel[_ngcontent-%COMP%]{box-shadow:var(--shadow-soft)}.theme-light[_nghost-%COMP%] .pricing-source[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .pricing-source[_ngcontent-%COMP%]{background:linear-gradient(180deg,#ffffffc2,#ffffff75),var(--surface)}.theme-light[_nghost-%COMP%] .pricing-note[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .pricing-note[_ngcontent-%COMP%]{background:linear-gradient(135deg,#0c9f830b,#6f5cff05),var(--surface)}.theme-light[_nghost-%COMP%] .allowance-panel[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .allowance-panel[_ngcontent-%COMP%]{border-color:#bdcbdae6}.theme-light[_nghost-%COMP%] .allowance-card[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .allowance-card[_ngcontent-%COMP%], .theme-light[_nghost-%COMP%] .allowance-meter[_ngcontent-%COMP%] div[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .allowance-meter[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{background:#ffffffad}.theme-light[_nghost-%COMP%] .pricing-table[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .pricing-table[_ngcontent-%COMP%]{background:var(--surface)}"]})};export{le as PricingPageComponent};
@@ -1 +1 @@
1
- import{p as M,q as p,r as d,s as h,w as U}from"./chunk-FXNLFSUB.js";import{a as D,b as T}from"./chunk-KDAJN6DF.js";function P(t,r,o,e){let n=O(t,r);return t.filter(s=>{let i=new Date(s.startedAt).getTime();return n.start!==null&&i<n.start||n.end!==null&&i>=n.end||o!=="all"&&s.workspace!==o?!1:e==="all"||s.modelBreakdown.some(u=>u.pricingModel===e||u.model===e)})}function V(t,r){let o=new Map;for(let e of t)for(let n of e.modelBreakdown){let s=`${n.model}::${n.pricingModel}`,i=o.get(s)??{model:n.model,pricingModel:n.pricingModel,turns:0,sessions:new Set,tokens:0,input:0,cachedInput:0,cacheWrite:0,output:0,cost:0};i.turns+=n.turns,i.sessions.add(e.id),i.tokens+=M(n.tokens),i.input+=n.tokens.input,i.cachedInput+=n.tokens.cachedInput,i.cacheWrite+=n.tokens.cacheWrite,i.output+=n.tokens.output,i.cost+=n.cost.usd,o.set(s,i)}return[...o.values()].map(e=>T(D({},e),{sessionCount:e.sessions.size,costPer1k:e.tokens?e.cost/e.tokens*1e3:0,share:r>0?e.cost/r*100:0,usesFallbackPrice:U(e.model,e.pricingModel)})).sort((e,n)=>n.cost-e.cost)}function B(t,r){let o=new Map;for(let e of t){let n=W(e.startedAt,r),s=o.get(n.key)??T(D({},n),{count:0,tokens:0,cost:0,credits:0,topSession:null,topSessionCost:0});s.count+=1,s.tokens+=p(e);let i=d(e);s.cost+=i,s.credits+=h(e),(!s.topSession||i>s.topSessionCost)&&(s.topSession=e,s.topSessionCost=i),o.set(n.key,s)}return[...o.values()].sort((e,n)=>n.key.localeCompare(e.key)).slice(0,8)}function G(t,r){return["Small","Medium","Large","Very large"].map(e=>{let n=t.filter(a=>v(p(a))===e),s=n.reduce((a,c)=>a+p(c),0),i=n.reduce((a,c)=>a+d(c),0),u=n.reduce((a,c)=>a+h(c),0),l=S(n,a=>d(a));return{size:e,count:n.length,tokens:s,cost:i,share:r>0?i/r*100:0,credits:u,topSession:l,topSessionCost:l?d(l):0}})}function E(t,r,o){if(!t.length)return[];let e=F(t.map(s=>d(s))),n=F(t.map(s=>p(s)));return t.map(s=>{let i=p(s),u=e>0?(d(s)-r)/e:0,l=n>0?(i-o)/n:0,a=Math.max(u,l),c=I(s,u,l);return{session:s,tokens:i,score:a,reason:c}}).filter(s=>s.score>=1||t.length<=5).sort((s,i)=>i.score-s.score||d(i.session)-d(s.session)).slice(0,5)}function H(t,r,o=new Date){let e=Number.isFinite(o.getTime())?o:new Date,n=S(t,L=>Date.parse(L.startedAt)||0),s=$(e),i=b(s,1),u=N(e),l=b(s,1),a=R(e),c=Y(e),m=w(t,s,i),g=w(t,u,l),k=w(t,a,c),x=n?z(n.startedAt):null;return[f("last-session","Last session",n?[n]:[],r,n?.title??"No imported sessions",x?y(x):"No imported sessions"),f("today","Today",m,r,"Imported sessions from today",y(s)),f("week","This week",g,r,"Week so far",A(u,b(l,-1))),f("month","Calendar month",k,r,"Current calendar month",A(a,b(c,-1))),f("visible","Selected scope",t,r,"Sessions matching Usage filters","All imported dates in this view")]}function O(t,r){if(r==="all"||!t.length)return{start:null,end:null,anchor:null};let o=Math.max(...t.map(s=>new Date(s.startedAt).getTime()).filter(Number.isFinite));if(!Number.isFinite(o))return{start:null,end:null,anchor:null};let e=new Date(o);if(r==="current-month"||r==="previous-month"){let s=r==="current-month"?0:-1,i=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+s,1)),u=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+s+1,1));return{start:i.getTime(),end:u.getTime(),anchor:e}}return{start:o-(r==="7d"?7:r==="30d"?30:90)*24*60*60*1e3,end:null,anchor:e}}function W(t,r){let o=new Date(t);if(!Number.isFinite(o.getTime()))return{key:"unknown",label:"Unknown date"};let e=C(o);if(r==="day")return{key:e,label:e};if(r==="month")return{key:e.slice(0,7),label:e.slice(0,7)};let n=new Date(Date.UTC(o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate())),s=n.getUTCDay()||7;return n.setUTCDate(n.getUTCDate()-s+1),{key:C(n),label:`Week of ${C(n)}`}}function v(t){return t>=15e5?"Very large":t>=5e5?"Large":t>=1e5?"Medium":"Small"}function S(t,r){return t.reduce((o,e)=>!o||r(e)>r(o)?e:o,null)}function I(t,r,o){let e=p(t),n=t.tokens.input+t.tokens.cachedInput+t.tokens.cacheWrite,s=e?n/e*100:0,i=S(t.modelBreakdown,k=>k.cost.usd),u=d(t),l=i&&u>0?i.cost.usd/u*100:0,a=t.traceSummary.modelTurns,c=t.traceSummary.toolCalls,m=a+c;return Math.max(r,o)>=2&&m<=3&&e>=1e5?`Suspicious spike: ${e.toLocaleString()} tokens with only ${m.toLocaleString()} imported model/tool events. Inspect the largest model call and source log shape.`:s>=85&&n>=1e5?`Mostly input/context tokens (${s.toFixed(0)}% of imported tokens). Check prompt context, repo reads, prior conversation, and tool results.`:i&&l>=70?`${i.pricingModel} produced ${l.toFixed(0)}% of this run's estimate. Model mix is the first thing to inspect.`:c>=20?`${c.toLocaleString()} tool calls may have added results back into later model input.`:t.traceSummary.errors===0&&a>=8&&c>=8?`Large but plausible long agent run: ${a.toLocaleString()} model turns and ${c.toLocaleString()} tool calls with no imported errors. Inspect input/context and tool activity before treating it as waste.`:r>=o?`Cost is ${r.toFixed(1)} standard deviations above this cohort. Check model price rows and output mix.`:`Tokens are ${o.toFixed(1)} standard deviations above this cohort. Check input context and model-turn count.`}function f(t,r,o,e,n,s){let i=o.reduce((m,g)=>m+h(g),0),u=o.reduce((m,g)=>m+d(g),0),l=S(o,m=>d(m)),a=o.filter(m=>!m.sourceUsage).length,c=e>0?i/e*100:0;return{id:t,label:r,period:s,credits:i,usd:u,count:o.length,allowanceShare:c,fallbackCount:a,session:l,detail:o.length?`${o.length.toLocaleString()} session${o.length===1?"":"s"}`:n,actionLabel:l?t==="last-session"?"Open run":"Open top run":"No run to open"}}function w(t,r,o){let e=r.getTime(),n=o.getTime();return t.filter(s=>{let i=Date.parse(s.startedAt);return Number.isFinite(i)&&i>=e&&i<n})}function $(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate())}function N(t){let r=t.getDay()||7,o=$(t);return o.setDate(o.getDate()-r+1),o}function R(t){return new Date(t.getFullYear(),t.getMonth(),1)}function Y(t){return new Date(t.getFullYear(),t.getMonth()+1,1)}function b(t,r){let o=new Date(t);return o.setDate(o.getDate()+r),o}function z(t){let r=Date.parse(t);return Number.isFinite(r)?new Date(r):null}function y(t){return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(t)}function A(t,r){return t.getFullYear()===r.getFullYear()&&t.getMonth()===r.getMonth()?`${new Intl.DateTimeFormat("en-US",{month:"short"}).format(t)} ${t.getDate()}-${r.getDate()}, ${t.getFullYear()}`:`${y(t)} - ${y(r)}`}function F(t){if(t.length<2)return 0;let r=t.reduce((e,n)=>e+n,0)/t.length,o=t.reduce((e,n)=>e+(n-r)**2,0)/t.length;return Math.sqrt(o)}function C(t){return t.toISOString().slice(0,10)}export{P as a,V as b,B as c,G as d,E as e,H as f,S as g};
1
+ import{p as M,q as p,r as d,s as h,w as U}from"./chunk-VEKXIM47.js";import{a as D,b as T}from"./chunk-WOIYAEKB.js";function P(t,r,o,e){let n=O(t,r);return t.filter(s=>{let i=new Date(s.startedAt).getTime();return n.start!==null&&i<n.start||n.end!==null&&i>=n.end||o!=="all"&&s.workspace!==o?!1:e==="all"||s.modelBreakdown.some(u=>u.pricingModel===e||u.model===e)})}function V(t,r){let o=new Map;for(let e of t)for(let n of e.modelBreakdown){let s=`${n.model}::${n.pricingModel}`,i=o.get(s)??{model:n.model,pricingModel:n.pricingModel,turns:0,sessions:new Set,tokens:0,input:0,cachedInput:0,cacheWrite:0,output:0,cost:0};i.turns+=n.turns,i.sessions.add(e.id),i.tokens+=M(n.tokens),i.input+=n.tokens.input,i.cachedInput+=n.tokens.cachedInput,i.cacheWrite+=n.tokens.cacheWrite,i.output+=n.tokens.output,i.cost+=n.cost.usd,o.set(s,i)}return[...o.values()].map(e=>T(D({},e),{sessionCount:e.sessions.size,costPer1k:e.tokens?e.cost/e.tokens*1e3:0,share:r>0?e.cost/r*100:0,usesFallbackPrice:U(e.model,e.pricingModel)})).sort((e,n)=>n.cost-e.cost)}function B(t,r){let o=new Map;for(let e of t){let n=W(e.startedAt,r),s=o.get(n.key)??T(D({},n),{count:0,tokens:0,cost:0,credits:0,topSession:null,topSessionCost:0});s.count+=1,s.tokens+=p(e);let i=d(e);s.cost+=i,s.credits+=h(e),(!s.topSession||i>s.topSessionCost)&&(s.topSession=e,s.topSessionCost=i),o.set(n.key,s)}return[...o.values()].sort((e,n)=>n.key.localeCompare(e.key)).slice(0,8)}function G(t,r){return["Small","Medium","Large","Very large"].map(e=>{let n=t.filter(a=>v(p(a))===e),s=n.reduce((a,c)=>a+p(c),0),i=n.reduce((a,c)=>a+d(c),0),u=n.reduce((a,c)=>a+h(c),0),l=S(n,a=>d(a));return{size:e,count:n.length,tokens:s,cost:i,share:r>0?i/r*100:0,credits:u,topSession:l,topSessionCost:l?d(l):0}})}function E(t,r,o){if(!t.length)return[];let e=F(t.map(s=>d(s))),n=F(t.map(s=>p(s)));return t.map(s=>{let i=p(s),u=e>0?(d(s)-r)/e:0,l=n>0?(i-o)/n:0,a=Math.max(u,l),c=I(s,u,l);return{session:s,tokens:i,score:a,reason:c}}).filter(s=>s.score>=1||t.length<=5).sort((s,i)=>i.score-s.score||d(i.session)-d(s.session)).slice(0,5)}function H(t,r,o=new Date){let e=Number.isFinite(o.getTime())?o:new Date,n=S(t,L=>Date.parse(L.startedAt)||0),s=$(e),i=b(s,1),u=N(e),l=b(s,1),a=R(e),c=Y(e),m=w(t,s,i),g=w(t,u,l),k=w(t,a,c),x=n?z(n.startedAt):null;return[f("last-session","Last session",n?[n]:[],r,n?.title??"No imported sessions",x?y(x):"No imported sessions"),f("today","Today",m,r,"Imported sessions from today",y(s)),f("week","This week",g,r,"Week so far",A(u,b(l,-1))),f("month","Calendar month",k,r,"Current calendar month",A(a,b(c,-1))),f("visible","Selected scope",t,r,"Sessions matching Usage filters","All imported dates in this view")]}function O(t,r){if(r==="all"||!t.length)return{start:null,end:null,anchor:null};let o=Math.max(...t.map(s=>new Date(s.startedAt).getTime()).filter(Number.isFinite));if(!Number.isFinite(o))return{start:null,end:null,anchor:null};let e=new Date(o);if(r==="current-month"||r==="previous-month"){let s=r==="current-month"?0:-1,i=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+s,1)),u=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+s+1,1));return{start:i.getTime(),end:u.getTime(),anchor:e}}return{start:o-(r==="7d"?7:r==="30d"?30:90)*24*60*60*1e3,end:null,anchor:e}}function W(t,r){let o=new Date(t);if(!Number.isFinite(o.getTime()))return{key:"unknown",label:"Unknown date"};let e=C(o);if(r==="day")return{key:e,label:e};if(r==="month")return{key:e.slice(0,7),label:e.slice(0,7)};let n=new Date(Date.UTC(o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate())),s=n.getUTCDay()||7;return n.setUTCDate(n.getUTCDate()-s+1),{key:C(n),label:`Week of ${C(n)}`}}function v(t){return t>=15e5?"Very large":t>=5e5?"Large":t>=1e5?"Medium":"Small"}function S(t,r){return t.reduce((o,e)=>!o||r(e)>r(o)?e:o,null)}function I(t,r,o){let e=p(t),n=t.tokens.input+t.tokens.cachedInput+t.tokens.cacheWrite,s=e?n/e*100:0,i=S(t.modelBreakdown,k=>k.cost.usd),u=d(t),l=i&&u>0?i.cost.usd/u*100:0,a=t.traceSummary.modelTurns,c=t.traceSummary.toolCalls,m=a+c;return Math.max(r,o)>=2&&m<=3&&e>=1e5?`Suspicious spike: ${e.toLocaleString()} tokens with only ${m.toLocaleString()} imported model/tool events. Inspect the largest model call and source log shape.`:s>=85&&n>=1e5?`Mostly input/context tokens (${s.toFixed(0)}% of imported tokens). Check prompt context, repo reads, prior conversation, and tool results.`:i&&l>=70?`${i.pricingModel} produced ${l.toFixed(0)}% of this run's estimate. Model mix is the first thing to inspect.`:c>=20?`${c.toLocaleString()} tool calls may have added results back into later model input.`:t.traceSummary.errors===0&&a>=8&&c>=8?`Large but plausible long agent run: ${a.toLocaleString()} model turns and ${c.toLocaleString()} tool calls with no imported errors. Inspect input/context and tool activity before treating it as waste.`:r>=o?`Cost is ${r.toFixed(1)} standard deviations above this cohort. Check model price rows and output mix.`:`Tokens are ${o.toFixed(1)} standard deviations above this cohort. Check input context and model-turn count.`}function f(t,r,o,e,n,s){let i=o.reduce((m,g)=>m+h(g),0),u=o.reduce((m,g)=>m+d(g),0),l=S(o,m=>d(m)),a=o.filter(m=>!m.sourceUsage).length,c=e>0?i/e*100:0;return{id:t,label:r,period:s,credits:i,usd:u,count:o.length,allowanceShare:c,fallbackCount:a,session:l,detail:o.length?`${o.length.toLocaleString()} session${o.length===1?"":"s"}`:n,actionLabel:l?t==="last-session"?"Open run":"Open top run":"No run to open"}}function w(t,r,o){let e=r.getTime(),n=o.getTime();return t.filter(s=>{let i=Date.parse(s.startedAt);return Number.isFinite(i)&&i>=e&&i<n})}function $(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate())}function N(t){let r=t.getDay()||7,o=$(t);return o.setDate(o.getDate()-r+1),o}function R(t){return new Date(t.getFullYear(),t.getMonth(),1)}function Y(t){return new Date(t.getFullYear(),t.getMonth()+1,1)}function b(t,r){let o=new Date(t);return o.setDate(o.getDate()+r),o}function z(t){let r=Date.parse(t);return Number.isFinite(r)?new Date(r):null}function y(t){return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(t)}function A(t,r){return t.getFullYear()===r.getFullYear()&&t.getMonth()===r.getMonth()?`${new Intl.DateTimeFormat("en-US",{month:"short"}).format(t)} ${t.getDate()}-${r.getDate()}, ${t.getFullYear()}`:`${y(t)} - ${y(r)}`}function F(t){if(t.length<2)return 0;let r=t.reduce((e,n)=>e+n,0)/t.length,o=t.reduce((e,n)=>e+(n-r)**2,0)/t.length;return Math.sqrt(o)}function C(t){return t.toISOString().slice(0,10)}export{P as a,V as b,B as c,G as d,E as e,H as f,S as g};