p-backlog 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +1 -1
- package/README.ru.md +1 -1
- package/dist/cli.js +29 -38
- package/dist/web/assets/CodeTab-Bn0Zl7PI.js +1 -0
- package/dist/web/assets/{CostTab-DAg9JKi5.js → CostTab-BBsTM7es.js} +1 -1
- package/dist/web/assets/EffectTab-gDz3Omnz.js +1 -0
- package/dist/web/assets/Figure-DAdnR-Fu.js +1 -0
- package/dist/web/assets/OverviewTab-CkZ7dCcx.js +1 -0
- package/dist/web/assets/{QualityTab-BwxhR0Ug.js → QualityTab-Bkxkcnh2.js} +1 -1
- package/dist/web/assets/ShareBar-CoTArw6Q.js +1 -0
- package/dist/web/assets/{StatsPage-DxV4wLv5.js → StatsPage-B-sQM9n_.js} +1 -1
- package/dist/web/assets/{StatsTabState-UUAoUbji.js → StatsTabState-BauB3xdU.js} +1 -1
- package/dist/web/assets/{StatsTable-Cgps5a7q.js → StatsTable-Dg0CrPof.js} +1 -1
- package/dist/web/assets/UnavailableRepos-BTMsOBI-.js +1 -0
- package/dist/web/assets/cx-CutaZ2Ho.js +55 -0
- package/dist/web/assets/{index-B94Cizd8.js → index-CM8tBSED.js} +2 -2
- package/dist/web/assets/{start-C3ACBbJw.css → start-CbHSVk3k.css} +1 -1
- package/dist/web/assets/start-Cm2kfqW8.js +41 -0
- package/dist/web/assets/{use-grain-panel-BGlDN-LS.js → use-grain-panel-BczBScgN.js} +3 -3
- package/dist/web/assets/{value-dot-CtJcBhqS.js → value-dot-Dy8YzPPT.js} +1 -1
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
- package/dist/web/assets/CodeTab-Bxau23jK.js +0 -1
- package/dist/web/assets/EffectTab-DOyEtT1Y.js +0 -1
- package/dist/web/assets/Figure-C7wdv_hC.js +0 -1
- package/dist/web/assets/OverviewTab-O4vRhy4D.js +0 -1
- package/dist/web/assets/ShareBar-r80rkujo.js +0 -1
- package/dist/web/assets/UnavailableRepos-Dzu7etxJ.js +0 -1
- package/dist/web/assets/cx-D_DWAtWj.js +0 -55
- package/dist/web/assets/start-B1ddmC3G.js +0 -41
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.8.1
|
|
4
|
+
|
|
5
|
+
- Effect counts every task recorded as `incidental` again, including tasks recorded by earlier versions, where
|
|
6
|
+
`incidental` was the default. Without such tasks the tab explains why there is nothing to measure, and the share of
|
|
7
|
+
unrelated edits shows "—" instead of 0 %.
|
|
8
|
+
|
|
3
9
|
## 0.8.0
|
|
4
10
|
|
|
5
11
|
- The task list no longer says "No tasks yet" while the project list is loading or after it failed to load: it shows
|
package/README.md
CHANGED
|
@@ -148,7 +148,7 @@ The retention window isn't configurable.
|
|
|
148
148
|
|
|
149
149
|
| Command | What it does |
|
|
150
150
|
|---|---|
|
|
151
|
-
| `backlog new --title <t> --category <category> [--type task\|epic] [--priority low\|medium\|high\|critical] [--tags a,b] [--found incidental\|review\|manual] [--source file:line] [--epic ID] [--blocked-by ID,…] [--related ID,…] [--project id] [--force] [--json]` | Creates a task, the description is read from stdin; a similar open task refuses the command (code 3), `--force` creates it anyway; `--found`: `incidental` — the agent noticed it in passing (only these
|
|
151
|
+
| `backlog new --title <t> --category <category> [--type task\|epic] [--priority low\|medium\|high\|critical] [--tags a,b] [--found incidental\|review\|manual] [--source file:line] [--epic ID] [--blocked-by ID,…] [--related ID,…] [--project id] [--force] [--json]` | Creates a task, the description is read from stdin; a similar open task refuses the command (code 3), `--force` creates it anyway; `--found`: `incidental` — the agent noticed it in passing (only these count in Effect), `review` — a review finding, `manual` — recorded at the user's request (the default) |
|
|
152
152
|
| `backlog list [--query q] [--status s,…] [--tag t,…] [--project id \| --all-projects] [--json]` | Lists tasks, by default the open tasks of the current project |
|
|
153
153
|
| `backlog show <ID> [--json]` | The full task: links, blockers, warnings |
|
|
154
154
|
| `backlog take <ID> [--force] [--json]` \| `--next [--project id] [--json]` | Takes a task into progress, checking blockers |
|
package/README.ru.md
CHANGED
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
|
|
147
147
|
| Команда | Что делает |
|
|
148
148
|
|---|---|
|
|
149
|
-
| `backlog new --title <t> --category <категория> [--type task\|epic] [--priority low\|medium\|high\|critical] [--tags a,b] [--found incidental\|review\|manual] [--source файл:строка] [--epic ID] [--blocked-by ID,…] [--related ID,…] [--project id] [--force] [--json]` | Создаёт задачу, описание читается из stdin; похожая открытая задача — отказ (код 3), `--force` создаёт всё равно; `--found`: `incidental` — агент заметил попутно (в «Эффекте» считаются только
|
|
149
|
+
| `backlog new --title <t> --category <категория> [--type task\|epic] [--priority low\|medium\|high\|critical] [--tags a,b] [--found incidental\|review\|manual] [--source файл:строка] [--epic ID] [--blocked-by ID,…] [--related ID,…] [--project id] [--force] [--json]` | Создаёт задачу, описание читается из stdin; похожая открытая задача — отказ (код 3), `--force` создаёт всё равно; `--found`: `incidental` — агент заметил попутно (в «Эффекте» считаются только такие), `review` — находка ревью, `manual` — заведена по просьбе пользователя (по умолчанию) |
|
|
150
150
|
| `backlog list [--query q] [--status s,…] [--tag t,…] [--project id \| --all-projects] [--json]` | Список задач, по умолчанию открытые задачи текущего проекта |
|
|
151
151
|
| `backlog show <ID> [--json]` | Задача целиком: связи, блокеры, предупреждения |
|
|
152
152
|
| `backlog take <ID> [--force] [--json]` \| `--next [--project id] [--json]` | Берёт задачу в работу, проверяя блокеры |
|
package/dist/cli.js
CHANGED
|
@@ -22,6 +22,9 @@ function formatLocalIso(date) {
|
|
|
22
22
|
function roundToTenth(value) {
|
|
23
23
|
return Math.round(value * 10) / 10;
|
|
24
24
|
}
|
|
25
|
+
function sum(values) {
|
|
26
|
+
return values.reduce((total, value) => total + value, 0);
|
|
27
|
+
}
|
|
25
28
|
|
|
26
29
|
// src/core/api/memory.ts
|
|
27
30
|
var BYTES_PER_MEGABYTE = 1024 * 1024;
|
|
@@ -303,7 +306,7 @@ async function release({ lock, token }) {
|
|
|
303
306
|
if (await readTextOrNull(lock) === token) await rm2(lock, { force: true });
|
|
304
307
|
}
|
|
305
308
|
|
|
306
|
-
// src/core/
|
|
309
|
+
// src/core/model/history-window.ts
|
|
307
310
|
var STATS_WEEKS = 12;
|
|
308
311
|
var STATS_HISTORY_DAYS = STATS_WEEKS * DAYS_PER_WEEK;
|
|
309
312
|
var HISTORY_SLACK_DAYS = 7;
|
|
@@ -1414,7 +1417,6 @@ var journalEventSchema = z7.discriminatedUnion("kind", [
|
|
|
1414
1417
|
epic: z7.string().optional(),
|
|
1415
1418
|
category: recordedEnum(TASK_CATEGORIES).optional(),
|
|
1416
1419
|
found: recordedEnum(FOUND_HOW).optional(),
|
|
1417
|
-
foundExplicit: z7.literal(true).optional().catch(void 0),
|
|
1418
1420
|
origin: z7.object({ branch: z7.string().optional(), commit: z7.string().min(1) }).optional()
|
|
1419
1421
|
}),
|
|
1420
1422
|
z7.object({ ...eventBase, kind: z7.literal("status"), from: z7.enum(TASK_STATUSES), to: z7.enum(TASK_STATUSES), resolution: recordedEnum(RESOLUTIONS).optional() }),
|
|
@@ -1470,7 +1472,6 @@ function createdEvent(task, now, via, provenance = {}) {
|
|
|
1470
1472
|
epic: task.epic,
|
|
1471
1473
|
category: task.category,
|
|
1472
1474
|
found: provenance.found,
|
|
1473
|
-
foundExplicit: provenance.foundExplicit,
|
|
1474
1475
|
origin: provenance.origin
|
|
1475
1476
|
};
|
|
1476
1477
|
}
|
|
@@ -1682,7 +1683,6 @@ function historyOf(id, { projectId, final, created, categoryEvents, priorityEven
|
|
|
1682
1683
|
priority: final?.priority ?? [...priorityEvents].sort((a, b) => a.at - b.at).at(-1)?.to ?? created?.priority,
|
|
1683
1684
|
category: categoryOf(final, created, categoryEvents),
|
|
1684
1685
|
found: created?.found,
|
|
1685
|
-
foundExplicit: created?.foundExplicit === true,
|
|
1686
1686
|
branch: created?.origin?.branch,
|
|
1687
1687
|
candidates: [...candidates].sort((a, b) => a.at - b.at),
|
|
1688
1688
|
verifications: [...verifications].sort((a, b) => a - b),
|
|
@@ -3612,9 +3612,6 @@ function nearestRank(values, fraction) {
|
|
|
3612
3612
|
const sorted = [...values].sort((a, b) => a - b);
|
|
3613
3613
|
return sorted[Math.ceil(fraction * sorted.length) - 1] ?? null;
|
|
3614
3614
|
}
|
|
3615
|
-
function sum(values) {
|
|
3616
|
-
return values.reduce((total, value) => total + value, 0);
|
|
3617
|
-
}
|
|
3618
3615
|
function smallest(values) {
|
|
3619
3616
|
return values.reduce((least, value) => least === null || value < least ? value : least, null);
|
|
3620
3617
|
}
|
|
@@ -3946,7 +3943,7 @@ function claudeProjectsDir(env, home2) {
|
|
|
3946
3943
|
var AGENTS = ["claude", "codex", "cursor"];
|
|
3947
3944
|
var AGENT_HOOKS_FILE = "hooks.json";
|
|
3948
3945
|
var claudeSettings = ({ env, home: home2 }) => claudeSettingsPath(env, home2);
|
|
3949
|
-
function hooksJsonAgent(label, homeDir, {
|
|
3946
|
+
function hooksJsonAgent(label, homeDir, { hookApprovalCommand }) {
|
|
3950
3947
|
return {
|
|
3951
3948
|
label,
|
|
3952
3949
|
homeDir,
|
|
@@ -3956,7 +3953,7 @@ function hooksJsonAgent(label, homeDir, { hookNeedsApproval }) {
|
|
|
3956
3953
|
pluginSettingsPath: null,
|
|
3957
3954
|
alwaysInstalled: false,
|
|
3958
3955
|
skillOnLanguageChange: "relinkExisting",
|
|
3959
|
-
|
|
3956
|
+
hookApprovalCommand
|
|
3960
3957
|
};
|
|
3961
3958
|
}
|
|
3962
3959
|
var AGENT_SPECS = {
|
|
@@ -3969,10 +3966,10 @@ var AGENT_SPECS = {
|
|
|
3969
3966
|
pluginSettingsPath: claudeSettings,
|
|
3970
3967
|
alwaysInstalled: true,
|
|
3971
3968
|
skillOnLanguageChange: "link",
|
|
3972
|
-
|
|
3969
|
+
hookApprovalCommand: null
|
|
3973
3970
|
},
|
|
3974
|
-
codex: hooksJsonAgent("Codex", ({ env, home: home2 }) => env.CODEX_HOME || join21(home2, ".codex"), {
|
|
3975
|
-
cursor: hooksJsonAgent("Cursor", ({ home: home2 }) => join21(home2, ".cursor"), {
|
|
3971
|
+
codex: hooksJsonAgent("Codex", ({ env, home: home2 }) => env.CODEX_HOME || join21(home2, ".codex"), { hookApprovalCommand: "/hooks" }),
|
|
3972
|
+
cursor: hooksJsonAgent("Cursor", ({ home: home2 }) => join21(home2, ".cursor"), { hookApprovalCommand: null })
|
|
3976
3973
|
};
|
|
3977
3974
|
async function detectAgents(places) {
|
|
3978
3975
|
const detection = { found: [], missing: [] };
|
|
@@ -4064,7 +4061,7 @@ var cliEn = {
|
|
|
4064
4061
|
installHookExists: (settingsPath) => `Stop hook is already present in ${settingsPath}`,
|
|
4065
4062
|
installHookAdded: (settingsPath) => `Stop hook added to ${settingsPath}`,
|
|
4066
4063
|
installHookUpdated: (settingsPath) => `Stop hook updated in ${settingsPath}`,
|
|
4067
|
-
|
|
4064
|
+
hookApproval: (agent, command) => `approve the hook in ${agent}: ${command}`,
|
|
4068
4065
|
installHookConfigUnreadable: (path, detail) => `Could not read ${path} (${detail}), Stop hook not added.`,
|
|
4069
4066
|
installHookConfigInvalid: (path) => `${path} is not a JSON object, Stop hook not added. Fix the file and try again.`,
|
|
4070
4067
|
agentNotFound: (dir) => `not found (${dir})`,
|
|
@@ -4243,7 +4240,7 @@ var cliRu = {
|
|
|
4243
4240
|
installHookExists: (settingsPath) => `\u0425\u0443\u043A Stop \u0443\u0436\u0435 \u0435\u0441\u0442\u044C \u0432 ${settingsPath}`,
|
|
4244
4241
|
installHookAdded: (settingsPath) => `\u0425\u0443\u043A Stop \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D \u0432 ${settingsPath}`,
|
|
4245
4242
|
installHookUpdated: (settingsPath) => `\u0425\u0443\u043A Stop \u043E\u0431\u043D\u043E\u0432\u043B\u0451\u043D \u0432 ${settingsPath}`,
|
|
4246
|
-
|
|
4243
|
+
hookApproval: (agent, command) => `\u043E\u0434\u043E\u0431\u0440\u0438\u0442\u0435 \u0445\u0443\u043A \u0432 ${agent}: ${command}`,
|
|
4247
4244
|
installHookConfigUnreadable: (path, detail) => `${path} \u043D\u0435 \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C (${detail}), \u0445\u0443\u043A Stop \u043D\u0435 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D.`,
|
|
4248
4245
|
installHookConfigInvalid: (path) => `${path} \u2014 \u043D\u0435 \u043E\u0431\u044A\u0435\u043A\u0442 JSON, \u0445\u0443\u043A Stop \u043D\u0435 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D. \u0418\u0441\u043F\u0440\u0430\u0432\u044C\u0442\u0435 \u0444\u0430\u0439\u043B \u0438 \u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435.`,
|
|
4249
4246
|
agentNotFound: (dir) => `\u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D (${dir})`,
|
|
@@ -5084,9 +5081,9 @@ async function linkAgentSkill(agent, site, link2) {
|
|
|
5084
5081
|
const skillsDir = AGENT_SPECS[agent].skillsDir(site);
|
|
5085
5082
|
const target = skillLinkPath(skillsDir);
|
|
5086
5083
|
try {
|
|
5087
|
-
return { target, result: await link2({ skillsDir, packageRoot: site.packageRoot, platform: site.platform }) };
|
|
5084
|
+
return { target, ok: true, result: await link2({ skillsDir, packageRoot: site.packageRoot, platform: site.platform }) };
|
|
5088
5085
|
} catch (error) {
|
|
5089
|
-
return { target,
|
|
5086
|
+
return { target, ok: false, failed: errorCodeOrText(error) };
|
|
5090
5087
|
}
|
|
5091
5088
|
}
|
|
5092
5089
|
|
|
@@ -5149,9 +5146,9 @@ async function relinkSkill(agent, language, io) {
|
|
|
5149
5146
|
return;
|
|
5150
5147
|
}
|
|
5151
5148
|
const relink = spec.skillOnLanguageChange === "link" ? linkSkillFor : relinkExistingSkill;
|
|
5152
|
-
const
|
|
5153
|
-
if (
|
|
5154
|
-
if (
|
|
5149
|
+
const link2 = await linkAgentSkill(agent, io, (options) => relink(language, options));
|
|
5150
|
+
if (!link2.ok) io.warn(`${label}: ${cli.installSkillLinkFailed(link2.target, link2.failed)}`);
|
|
5151
|
+
else if (link2.result === "foreign") io.warn(`${label}: ${cli.skillForeign(link2.target)}`);
|
|
5155
5152
|
}
|
|
5156
5153
|
|
|
5157
5154
|
// src/cli/apply-all.ts
|
|
@@ -5388,7 +5385,7 @@ async function runNew(args, io) {
|
|
|
5388
5385
|
existingTasks: loaded.tasks,
|
|
5389
5386
|
now: io.now(),
|
|
5390
5387
|
via: "cli",
|
|
5391
|
-
provenance: { found,
|
|
5388
|
+
provenance: { found, origin: cwdBelongsTo(project, loaded.projects, io) ? await readOrigin(io.cwd) : void 0 }
|
|
5392
5389
|
});
|
|
5393
5390
|
if (!result.ok) {
|
|
5394
5391
|
for (const problem3 of result.problems) io.warn(io.core.problem(problem3));
|
|
@@ -5527,7 +5524,6 @@ var serverEn = {
|
|
|
5527
5524
|
serverStarted: (port, root) => `p-backlog: http://localhost:${port}
|
|
5528
5525
|
Backlog directory: ${root}`,
|
|
5529
5526
|
settingsFileInvalid: (path) => `${path} could not be parsed, the language for this run was detected automatically. The file was not changed \u2014 fix it manually.`,
|
|
5530
|
-
maintenanceFailed: (detail) => `Backlog maintenance stopped: ${detail}`,
|
|
5531
5527
|
closedEpics: (ids) => `Closed completed epics: ${ids}`,
|
|
5532
5528
|
reopenedEpics: (ids) => `Reopened epics that got an open task again: ${ids}`,
|
|
5533
5529
|
epicsBlockedByFiles: (paths) => `Epics will not close until these files are fixed: ${paths}`,
|
|
@@ -5564,7 +5560,6 @@ var serverRu = {
|
|
|
5564
5560
|
serverStarted: (port, root) => `p-backlog: http://localhost:${port}
|
|
5565
5561
|
\u041A\u0430\u0442\u0430\u043B\u043E\u0433 \u0431\u0435\u043A\u043B\u043E\u0433\u0430: ${root}`,
|
|
5566
5562
|
settingsFileInvalid: (path) => `${path} \u043D\u0435 \u0440\u0430\u0437\u043E\u0431\u0440\u0430\u043D, \u044F\u0437\u044B\u043A \u0434\u043B\u044F \u044D\u0442\u043E\u0433\u043E \u0437\u0430\u043F\u0443\u0441\u043A\u0430 \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0451\u043D \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438. \u0424\u0430\u0439\u043B \u043D\u0435 \u0438\u0437\u043C\u0435\u043D\u0451\u043D \u2014 \u043F\u043E\u043F\u0440\u0430\u0432\u044C\u0442\u0435 \u0435\u0433\u043E \u0432\u0440\u0443\u0447\u043D\u0443\u044E.`,
|
|
5567
|
-
maintenanceFailed: (detail) => `\u041E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u043D\u0438\u0435 \u0431\u0435\u043A\u043B\u043E\u0433\u0430 \u043F\u0440\u0435\u0440\u0432\u0430\u043B\u043E\u0441\u044C: ${detail}`,
|
|
5568
5563
|
closedEpics: (ids) => `\u0417\u0430\u043A\u0440\u044B\u0442\u044B \u0437\u0430\u0432\u0435\u0440\u0448\u0451\u043D\u043D\u044B\u0435 \u044D\u043F\u0438\u043A\u0438: ${ids}`,
|
|
5569
5564
|
reopenedEpics: (ids) => `\u0421\u043D\u043E\u0432\u0430 \u043E\u0442\u043A\u0440\u044B\u0442\u044B \u044D\u043F\u0438\u043A\u0438, \u0432 \u043A\u043E\u0442\u043E\u0440\u044B\u0445 \u043E\u0442\u043A\u0440\u044B\u043B\u0438 \u0437\u0430\u0434\u0430\u0447\u0443: ${ids}`,
|
|
5570
5565
|
epicsBlockedByFiles: (paths) => `\u042D\u043F\u0438\u043A\u0438 \u043D\u0435 \u0437\u0430\u043A\u0440\u044B\u0432\u0430\u044E\u0442\u0441\u044F, \u043F\u043E\u043A\u0430 \u043D\u0435 \u0440\u0430\u0437\u043E\u0431\u0440\u0430\u043D\u044B \u0444\u0430\u0439\u043B\u044B: ${paths}`,
|
|
@@ -6554,7 +6549,7 @@ function effectReport({ code, ...input }, base = reportBase(input), wholeBacklog
|
|
|
6554
6549
|
const { histories } = base;
|
|
6555
6550
|
const statsWindow = statsPeriod(now);
|
|
6556
6551
|
const projects = code.projects.filter((project) => project.repos.length > 0 && (projectId === void 0 || project.projectId === projectId));
|
|
6557
|
-
const deferredByAgent = histories.filter((history) => history.found === "incidental" &&
|
|
6552
|
+
const deferredByAgent = histories.filter((history) => history.found === "incidental" && statsWindow.contains(history.createdAt));
|
|
6558
6553
|
const deferred = buildDeferred(deferredByAgent, retainedFixes(histories, now), code);
|
|
6559
6554
|
const estimate = estimator(estimateSamples(retainedFixes(wholeBacklog.histories, now), code));
|
|
6560
6555
|
const adoptionStart = (id) => {
|
|
@@ -6643,7 +6638,7 @@ function totalsOf2(deferred, units, estimate) {
|
|
|
6643
6638
|
estimatedLines,
|
|
6644
6639
|
deferredLines,
|
|
6645
6640
|
deferredTestLines: sum(fixed.map((item) => item.testLines)) + (estimated?.testLines ?? 0),
|
|
6646
|
-
noiseShare: realLines === 0 || estimatedLines === null && open3.length > 0 ? null : Math.min(1, deferredLines / denominator)
|
|
6641
|
+
noiseShare: realLines === 0 || deferred.length === 0 || estimatedLines === null && open3.length > 0 ? null : Math.min(1, deferredLines / denominator)
|
|
6647
6642
|
};
|
|
6648
6643
|
}
|
|
6649
6644
|
function byKind(deferred) {
|
|
@@ -7382,13 +7377,8 @@ function createMemorySampler({ intervalMs = MEMORY_SAMPLE_INTERVAL_MS, capacity
|
|
|
7382
7377
|
function startSweeper({ maintain, intervalMs, log: log2, warn: warn2, messages }) {
|
|
7383
7378
|
let current = Promise.resolve();
|
|
7384
7379
|
const run = async () => {
|
|
7385
|
-
const
|
|
7386
|
-
|
|
7387
|
-
(error) => ({ error })
|
|
7388
|
-
);
|
|
7389
|
-
const texts = await messages();
|
|
7390
|
-
if (!("report" in outcome)) warn2(texts.maintenanceFailed(errorText(outcome.error)));
|
|
7391
|
-
else if (outcome.report !== null) logReport(outcome.report, texts, log2);
|
|
7380
|
+
const report = await maintain();
|
|
7381
|
+
if (report !== null) logReport(report, await messages(), log2);
|
|
7392
7382
|
};
|
|
7393
7383
|
const trigger = () => {
|
|
7394
7384
|
current = run().catch((error) => warn2(errorText(error)));
|
|
@@ -8724,21 +8714,22 @@ async function setUpAgent(agent, io) {
|
|
|
8724
8714
|
if (!await installAgentSkill(agent, io, voice)) return false;
|
|
8725
8715
|
const hook = await installAgentHook(agent, io);
|
|
8726
8716
|
const reported = reportHook(hook, AGENT_SPECS[agent].hookConfigPath(io), io, voice);
|
|
8727
|
-
|
|
8717
|
+
const { label, hookApprovalCommand } = AGENT_SPECS[agent];
|
|
8718
|
+
if (hookApprovalCommand !== null && (hook === "added" || hook === "updated")) voice.print(io.cli.hookApproval(label, hookApprovalCommand));
|
|
8728
8719
|
return reported;
|
|
8729
8720
|
}
|
|
8730
8721
|
async function installAgentSkill(agent, io, voice) {
|
|
8731
8722
|
const source = skillSourceDir(io.packageRoot, io.language);
|
|
8732
|
-
const
|
|
8733
|
-
if (
|
|
8734
|
-
voice.warn(io.cli.installSkillLinkFailed(target, link2.failed));
|
|
8723
|
+
const link2 = await linkAgentSkill(agent, io, (options) => linkSkillFor(io.language, options));
|
|
8724
|
+
if (!link2.ok) {
|
|
8725
|
+
voice.warn(io.cli.installSkillLinkFailed(link2.target, link2.failed));
|
|
8735
8726
|
return false;
|
|
8736
8727
|
}
|
|
8737
|
-
if (link2 === "foreign") {
|
|
8738
|
-
voice.warn(io.cli.installSkillForeign(target, source));
|
|
8728
|
+
if (link2.result === "foreign") {
|
|
8729
|
+
voice.warn(io.cli.installSkillForeign(link2.target, source));
|
|
8739
8730
|
return false;
|
|
8740
8731
|
}
|
|
8741
|
-
voice.print(link2 === "linked" ? io.cli.installSkillLinked(target, source) : io.cli.installSkillKept(target));
|
|
8732
|
+
voice.print(link2.result === "linked" ? io.cli.installSkillLinked(link2.target, source) : io.cli.installSkillKept(link2.target));
|
|
8742
8733
|
await removeLegacySkillLinks(agent, io, voice);
|
|
8743
8734
|
return true;
|
|
8744
8735
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as e,ft as t,i as n,k as r}from"./cx-CutaZ2Ho.js";import{a as i,i as a,n as o,r as s}from"./StatsTabState-BauB3xdU.js";import{t as c}from"./ShareBar-CoTArw6Q.js";import{t as l}from"./StatsPage.module-DxtnhZOJ.js";import{t as u}from"./UnavailableRepos-BTMsOBI-.js";var d={churnRow:`_churnRow_ledt8_1`,densityRow:`_densityRow_ledt8_8`},f=e();function p({churn:e,period:t}){let{stats:n}=r(),o=a(),l=e[0]?.score??1;return(0,f.jsxs)(i,{title:n.churnTitle,period:o.of(`churn`,t),children:[(0,f.jsx)(`p`,{className:s.muted,children:n.churnHint}),e.length===0?(0,f.jsx)(`p`,{className:s.muted,children:n.churnEmpty}):(0,f.jsx)(`ul`,{className:s.rows,children:e.map(e=>(0,f.jsxs)(`li`,{className:d.churnRow,children:[(0,f.jsx)(`code`,{className:s.rowLabel,children:e.label}),(0,f.jsx)(`span`,{className:s.rowValue,children:n.commits(e.commits)}),(0,f.jsx)(`span`,{className:s.rowValue,children:n.churnTasks(e.tasks,e.weight)}),(0,f.jsx)(c,{share:e.score/l})]},e.label))})]})}function m({density:e}){let{stats:t}=r();return(0,f.jsx)(i,{title:t.densityTitle,period:t.periodNow,children:e.projects.length===0?(0,f.jsx)(`p`,{className:s.muted,children:t.noCodeData}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(h,{rows:e.projects.map(e=>({key:e.projectId,label:e.name,row:e}))}),e.folders.length>0&&(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`h3`,{className:s.subTitle,children:t.folders}),(0,f.jsx)(h,{rows:e.folders.map(e=>({key:e.label,label:(0,f.jsx)(`code`,{children:e.label}),row:e}))})]})]})})}function h({rows:e}){let{stats:t,core:n}=r();return(0,f.jsx)(`ul`,{className:s.rows,children:e.map(({key:e,label:r,row:i})=>(0,f.jsxs)(`li`,{className:d.densityRow,children:[(0,f.jsx)(`span`,{className:s.rowLabel,children:r}),(0,f.jsx)(`span`,{className:s.rowValue,children:n.count(i.lines,`line`)}),(0,f.jsx)(`span`,{className:s.rowValue,children:n.count(i.open,`task`)}),(0,f.jsx)(`span`,{className:s.rowValue,children:i.perKloc===null?`—`:t.perKloc(i.perKloc)})]},e))})}function g(){let{projectId:e}=t(),r=n(e);return(0,f.jsx)(o,{query:r,children:e=>(0,f.jsx)(_,{report:e})})}function _({report:e}){let{stats:t}=r();return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(u,{repos:e.unavailableRepos}),(0,f.jsxs)(`div`,{className:l.blocks,children:[(0,f.jsx)(`div`,{className:s.wide,children:(0,f.jsx)(p,{churn:e.churn,period:e.periods.churn})}),(0,f.jsx)(m,{density:e.density})]}),(0,f.jsx)(`p`,{className:l.note,children:t.codeNote})]})}export{g as CodeTab};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{B as t,F as n,I as r,O as i,a,c as o,k as s,ln as c,pt as l,un as u}from"./cx-D_DWAtWj.js";import{_ as d,d as f,h as p}from"./index-B94Cizd8.js";import{a as m,i as h,r as g,t as _}from"./StatsTabState-UUAoUbji.js";import{t as v}from"./StatsPage.module-DxtnhZOJ.js";import{n as y,t as b}from"./Figure-C7wdv_hC.js";import{t as x}from"./StatsTable-Cgps5a7q.js";import{A as S,B as C,C as w,D as ee,Dt as T,E as te,F as ne,G as re,H as ie,I as ae,J as oe,K as se,L as ce,M as le,N as ue,O as de,P as fe,Q as pe,R as me,St as he,T as ge,Tt as _e,U as ve,V as ye,X as be,Y as xe,Z as Se,_ as Ce,_t as E,a as we,at as Te,b as Ee,bt as De,c as Oe,ct as ke,d as Ae,dt as je,et as D,f as Me,ft as O,g as Ne,h as k,ht as Pe,i as A,it as Fe,j as Ie,k as Le,kt as Re,l as ze,lt as Be,m as Ve,mt as He,n as Ue,nt as j,o as We,ot as Ge,p as Ke,pt as M,q as qe,r as Je,rt as Ye,s as Xe,st as Ze,t as Qe,tt as $e,u as et,ut as N,v as P,vt as tt,wt as F,x as nt,xt as I,y as L,yt as rt,z as it}from"./use-grain-panel-BGlDN-LS.js";import{a as at,i as ot,n as st,o as ct,r as lt,t as R}from"./value-dot-CtJcBhqS.js";function z(e,t){return t===null?`—`:n(p(e,t))}var B=c();function ut({totals:e,period:t}){let{stats:n}=s(),a=i(),o=h(),c=e=>r(a,e);return(0,B.jsxs)(y,{period:o.of(`lastWeek`,t),children:[(0,B.jsx)(b,{label:n.backlogTokens,value:c(e.tokens),note:n.backlogTokensNote(c(e.hookTokens),c(e.cliTokens))}),(0,B.jsx)(b,{label:n.apiPrice,value:z(a,e.cost),note:e.hasUnpricedTokens?n.unpricedNote:void 0}),(0,B.jsx)(b,{label:n.hookTurns,value:c(e.hookTurns),note:n.hookRunsNote(c(e.hookRuns))}),(0,B.jsx)(b,{label:n.cliCalls,value:c(e.cliRuns)})]})}function dt({models:e,period:t}){let{stats:n}=s(),a=i(),o=h();return(0,B.jsx)(m,{title:n.byModel,period:o.of(`costDays`,t),children:e.length===0?(0,B.jsx)(`p`,{className:g.muted,children:n.noModels}):(0,B.jsx)(x,{label:n.byModel,head:n.modelsHead,rows:e.map(e=>({key:`${e.model}:${e.fast}`,cells:[e.fast?n.fastModel(e.model):e.model,r(a,e.tokens),p(a,e.cost)]}))})})}function ft({commands:e,period:t}){let{stats:n}=s(),a=i(),o=h();return(0,B.jsx)(m,{title:n.commandsTitle,period:o.of(`costDays`,t),children:e.length===0?(0,B.jsx)(`p`,{className:g.muted,children:n.noCommands}):(0,B.jsx)(x,{label:n.commandsTitle,head:n.commandsHead,rows:e.map(e=>({key:e.command,cells:[e.command,r(a,e.runs),n.milliseconds(e.avgMs),n.megabytes(e.avgRssMb),n.megabytes(e.maxRssMb)]}))})})}var pt=(e,t,n)=>re(e,`xAxis`,P(e,t),n),mt=(e,t,n)=>qe(e,`xAxis`,P(e,t),n),ht=(e,t,n)=>re(e,`yAxis`,L(e,t),n),gt=(e,t,n)=>qe(e,`yAxis`,L(e,t),n),_t=M([j,pt,ht,mt,gt],(e,t,n,r,i)=>je(e,`xAxis`)?Ge(t,r,!1):Ge(n,i,!1)),V=M([oe,(e,t)=>t],(e,t)=>e.filter(e=>e.type===`area`).find(e=>e.id===t)),vt=e=>{var t=j(e);return je(t,`xAxis`)?`yAxis`:`xAxis`},yt=(e,t)=>vt(e)===`yAxis`?L(e,t):P(e,t),bt=(e,t,n)=>se(e,vt(e),yt(e,t),n),xt=M([V,bt],(e,t)=>{if(e!=null&&t!=null){var n=e.stackId,r=xe(e);if(n!=null&&r!=null){var i=(t[n]?.stackedData)?.find(e=>e.key===r);if(i!=null)return i.map(e=>[e[0],e[1]])}}}),St=M([V,bt],(e,t)=>{if(e!=null&&e.stackId!=null&&t!=null){var n=t[e.stackId];if(n!=null)return n.graphicalItems.map(e=>e.dataKey).filter(rt)}}),Ct=M([j,pt,ht,mt,gt,xt,pe,_t,V,Se,St],(e,t,n,r,i,a,o,s,c,l,u)=>{var d=o.chartData,f=o.dataStartIndex,p=o.dataEndIndex;if(!(c==null||e!==`horizontal`&&e!==`vertical`||t==null||n==null||r==null||i==null||r.length===0||i.length===0||s==null)){var m=c.data,h=m&&m.length>0?m:d?.slice(f,p+1);if(h!=null)return Qt({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:f,areaSettings:c,stackedData:a,displayedData:h,chartBaseValue:l,bandSize:s,stackDataKeys:u})}}),H=e(u()),wt=[`animationElapsedTime`,`isAnimating`,`isEntrance`,`layout`,`isRange`,`stroke`,`connectNulls`],Tt=[`id`,`baseLine`];function U(){return U=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},U.apply(null,arguments)}function Et(e,t){if(e==null)return{};var n,r,i=Dt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Dt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Ot(e){var t=e.alpha,n=e.baseLine,r=e.points,i=e.strokeWidth,a=r[0]?.x,o=r[r.length-1]?.x;if(!O(a)||!O(o))return null;var s=t*Math.abs(a-o),c=Math.max(...r.map(e=>e.y||0));return I(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(e=>e.y||0),c)),I(c)?H.createElement(`rect`,{x:a<o?a:a-s,y:0,width:s,height:Math.floor(c+(i?parseInt(`${i}`,10):1))}):null}function kt(e){var t=e.alpha,n=e.baseLine,r=e.points,i=e.strokeWidth,a=r[0]?.y,o=r[r.length-1]?.y;if(!O(a)||!O(o))return null;var s=t*Math.abs(a-o),c=Math.max(...r.map(e=>e.x||0));return I(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(e=>e.x||0),c)),I(c)?H.createElement(`rect`,{x:0,y:a<o?a:a-s,width:c+(i?parseInt(`${i}`,10):1),height:Math.floor(s)}):null}function At(e){var t=e.alpha,n=e.layout,r=e.points,i=e.baseLine,a=e.strokeWidth;return n===`vertical`?H.createElement(kt,{alpha:t,points:r,baseLine:i,strokeWidth:a}):H.createElement(Ot,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function jt(e){var t=e.animationElapsedTime,n=t===void 0?1:t,r=e.isAnimating,i=r!==void 0&&r,a=e.isEntrance,o=a!==void 0&&a,s=e.layout,c=e.isRange,l=e.stroke,u=e.connectNulls,d=Et(e,wt),f=s===`vertical`?`vertical`:`horizontal`,p=u??!1,m=de(),h=d.id,g=d.baseLine,_=Et(d,Tt),v=T(_),y=H.createElement(D,U({},d,{id:h,baseLine:g,connectNulls:p,stroke:`none`,className:`recharts-area-area`,layout:f})),b=l!==`none`&&H.createElement(D,U({},v,{className:`recharts-area-curve`,layout:f,type:d.type,connectNulls:p,fill:`none`,stroke:l,points:d.points})),x=l!==`none`&&c&&Array.isArray(g)&&H.createElement(D,U({},v,{className:`recharts-area-curve`,layout:f,type:d.type,connectNulls:p,fill:`none`,stroke:l,points:g}));return o&&(i||n<1)?H.createElement(F,null,H.createElement(`defs`,null,H.createElement(`clipPath`,{id:m},H.createElement(At,{alpha:n,points:d.points??[],baseLine:g,layout:f,strokeWidth:d.strokeWidth}))),H.createElement(F,{clipPath:`url(#${m})`},y,b,x)):H.createElement(H.Fragment,null,y,b,x)}var Mt=[`id`],Nt=[`activeDot`,`animationBegin`,`animationDuration`,`animationEasing`,`connectNulls`,`dot`,`fill`,`fillOpacity`,`hide`,`isAnimationActive`,`legendType`,`stroke`,`xAxisId`,`yAxisId`];function W(){return W=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},W.apply(null,arguments)}function Pt(e,t){if(e==null)return{};var n,r,i=Ft(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ft(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function It(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function G(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?It(Object(n),!0).forEach(function(t){Lt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):It(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Lt(e,t,n){return(t=Rt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rt(e){var t=zt(e,`string`);return typeof t==`symbol`?t:t+``}function zt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Bt={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:`ease`,animationMatchBy:ue,animationInterpolateFn:(e,t)=>e==null?[]:t===1?e.flatMap(e=>e.status===`removed`?[]:[e.next]):e.flatMap(e=>e.status===`matched`?[G(G({},e.next),{},{x:E(e.prev.x,e.next.x,t),y:E(e.prev.y,e.next.y,t)})]:e.status===`added`?[e.next]:[]),connectNulls:!1,dot:!1,fill:`#3182bd`,fillOpacity:.6,hide:!1,isAnimationActive:`auto`,legendType:`line`,stroke:`#3182bd`,strokeWidth:1,type:`linear`,label:!1,shape:jt,xAxisId:0,yAxisId:0,zIndex:be.area};function K(e,t){return e&&e!==`none`?e:t}var Vt=e=>{var t=e.dataKey,n=e.name,r=e.stroke,i=e.fill,a=e.legendType;return[{inactive:e.hide,dataKey:t,type:a,color:K(r,i),value:Be(n,t),payload:e}]},Ht=H.memo(e=>{var t=e.dataKey,n=e.data,r=e.stroke,i=e.strokeWidth,a=e.fill,o=e.name,s=e.hide,c=e.unit,l=e.formatter,u=e.tooltipType,d=e.id,f={dataDefinedOnItem:n,getPosition:he,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:Be(o,t),hide:s,type:u,color:K(r,a),unit:c,formatter:l,graphicalItemId:d}};return H.createElement(ne,{tooltipEntrySettings:f})});function Ut(e){var t=e.clipPathId,n=e.points,r=e.props,i=r.needClip,a=r.dot,o=r.dataKey,s=T(r);return H.createElement(ct,{points:n,dot:a,className:`recharts-area-dots`,dotClassName:`recharts-area-dot`,dataKey:o,baseProps:s,needClip:i,clipPathId:t})}function Wt(e){var t=e.showLabels,n=e.children,r=e.points.map(e=>{var t={x:e.x??0,y:e.y??0,width:0,lowerWidth:0,upperWidth:0,height:0};return G(G({},t),{},{value:e.value,payload:e.payload,parentViewBox:void 0,viewBox:t,fill:void 0})});return H.createElement(me,{value:t?r:void 0},n)}function Gt(e){var t=e.points,n=e.baseLine,r=e.needClip,i=e.clipPathId,a=e.props,o=e.animationElapsedTime,s=e.isAnimating,c=e.isEntrance,l=a.layout,u=a.type,d=a.stroke,f=a.connectNulls,p=a.isRange,m=a.shape,h=a.id,g=Pt(a,Mt),_=G(G({},_e(g)),{},{id:h,points:t,connectNulls:f,type:u,baseLine:n,layout:l,stroke:d,isRange:p,animationElapsedTime:o,isAnimating:s,isEntrance:c});return H.createElement(H.Fragment,null,t?.length>1&&H.createElement(F,{clipPath:r?`url(#clipPath-${i})`:void 0},H.createElement(ae,{option:m,DefaultShape:Bt.shape,shapeProps:_})),H.createElement(Ut,{points:t,props:g,clipPathId:i}))}function Kt(e,t,n){if(I(e)){var r=I(t)?t:void 0;return E(r,e,n)}if(De(e)||tt(e)){var i=I(t)?t:void 0;return E(i,0,n)}return e}function qt(e){var t=e.needClip,n=e.clipPathId,r=e.props,i=e.previousPointsRef,a=e.previousBaselineRef,o=r.points,s=r.baseLine,c=r.isAnimationActive,l=r.animationBegin,u=r.animationDuration,d=r.animationEasing,f=r.animationMatchBy,p=r.animationInterpolateFn,m=(0,H.useMemo)(()=>({points:o,baseLine:s}),[o,s]),h=Ie(m,a),g=Ye(),_=S(r.onAnimationStart,r.onAnimationEnd),v=_.isAnimating,y=_.handleAnimationStart,b=_.handleAnimationEnd,x=h.startValue;if(g==null)return null;var C=Array.isArray(s)&&Array.isArray(x)?le(x,s,f):Array.isArray(s)?le(null,s,f):null;return H.createElement(Le,{animationInput:m,animationIdPrefix:`recharts-area-`,items:o,previousItemsRef:i,isAnimationActive:c,animationBegin:l,animationDuration:u,animationEasing:d,onAnimationStart:y,onAnimationEnd:b,animationInterpolateFn:p,animationMatchBy:f,layout:g},(e,i,a)=>{var c=i===1?s:Array.isArray(s)?p(C,i,g):a?s:Kt(s,x,i);return h.syncStepValue(c,i),H.createElement(Wt,{showLabels:!v,points:o},r.children,H.createElement(Gt,{points:e,baseLine:c,needClip:t,clipPathId:n,props:r,animationElapsedTime:i,isAnimating:v||i<1,isEntrance:a}),H.createElement(it,{label:r.label}))})}function Jt(e){var t=e.needClip,n=e.clipPathId,r=e.props,i=(0,H.useRef)(null),a=(0,H.useRef)();return H.createElement(qt,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}var Yt=class extends H.PureComponent{render(){var e=this.props,t=e.hide,n=e.dot,r=e.points,i=e.className,a=e.top,o=e.left,s=e.needClip,c=e.xAxisId,l=e.yAxisId,u=e.width,d=e.height,f=e.id,p=e.baseLine,m=e.zIndex;if(t)return null;var h=Re(`recharts-area`,i),g=f,_=ot(n),v=_.r,y=_.strokeWidth,b=ce(n),x=v*2+y,S=s?`url(#clipPath-${b?``:`dots-`}${g})`:void 0;return H.createElement(ie,{zIndex:m},H.createElement(F,{className:h},s&&H.createElement(`defs`,null,H.createElement(Ee,{clipPathId:g,xAxisId:c,yAxisId:l}),!b&&H.createElement(`clipPath`,{id:`clipPath-dots-${g}`},H.createElement(`rect`,{x:o-x/2,y:a-x/2,width:u+x,height:d+x}))),H.createElement(Jt,{needClip:s,clipPathId:g,props:this.props})),H.createElement(at,{points:r,mainColor:K(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:S}),this.props.isRange&&Array.isArray(p)&&H.createElement(at,{points:p,mainColor:K(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:S}))}};function Xt(e){var t=e.activeDot,n=e.animationBegin,r=e.animationDuration,i=e.animationEasing,a=e.connectNulls,o=e.dot,s=e.fill,c=e.fillOpacity,l=e.hide,u=e.isAnimationActive,d=e.legendType,f=e.stroke,p=e.xAxisId,m=e.yAxisId,h=Pt(e,Nt),g=Fe(),_=ve(),v=nt(p,m).needClip,y=Te(),b=He(t=>Ct(t,e.id,y))??{},x=b.points,S=b.isRange,C=b.baseLine,w=ge();if(g!==`horizontal`&&g!==`vertical`||w==null||_!==`AreaChart`&&_!==`ComposedChart`)return null;var ee=w.height,T=w.width,te=w.x,ne=w.y;return!x||!x.length?null:H.createElement(Yt,W({},h,{activeDot:t,animationBegin:n,animationDuration:r,animationEasing:i,baseLine:C,connectNulls:a,dot:o,fill:s,fillOpacity:c,height:ee,hide:l,layout:g,isAnimationActive:u,isRange:S,legendType:d,needClip:v,points:x,stroke:f,width:T,left:te,top:ne,xAxisId:p,yAxisId:m}))}var Zt=(e,t,n,r,i)=>{var a=n??t;if(I(a))return a;var o=e===`horizontal`?i:r,s=o.scale.domain();if(o.type===`number`){var c=Math.max(s[0],s[1]),l=Math.min(s[0],s[1]);return a===`dataMin`?l:a===`dataMax`||c<0?c:Math.max(Math.min(s[0],s[1]),0)}return a===`dataMin`?s[0]:a===`dataMax`?s[1]:s[0]};function Qt(e){var t=e.areaSettings,n=t.connectNulls,r=t.baseValue,i=t.dataKey,a=e.stackedData,o=e.layout,s=e.chartBaseValue,c=e.xAxis,l=e.yAxis,u=e.displayedData,d=e.dataStartIndex,f=e.xAxisTicks,p=e.yAxisTicks,m=e.bandSize,h=e.stackDataKeys,g=a&&a.length,_=Zt(o,s,r,c,l),v=o===`horizontal`,y=!1,b=u.map((e,t)=>{var r;if(g)r=a[d+t];else{var o=N(e,i);Array.isArray(o)?(r=o,y=!0):r=[_,o]}var s=r?.[1]??null,u=N(e,i),b=g&&u==null&&h!=null&&h.length>0&&h.every(t=>N(e,t)==null),x=s==null||g&&!n&&u==null||b;return v?{x:Ze({axis:c,ticks:f,bandSize:m,entry:e,index:t}),y:x?null:l.scale.map(s)??null,value:r,payload:e}:{x:x?null:c.scale.map(s)??null,y:Ze({axis:l,ticks:p,bandSize:m,entry:e,index:t}),value:r,payload:e}});return{points:b,baseLine:(g||y?b.map(e=>{var t=Array.isArray(e.value)?e.value[0]:null;return v?{x:e.x,y:t!=null&&e.y!=null?l.scale.map(t)??null:null,payload:e.payload}:{x:t==null?null:c.scale.map(t)??null,y:e.y,payload:e.payload}}):v?l.scale.map(_):c.scale.map(_))??0,isRange:y}}function $t(e){var t=Pe(e,Bt),n=Te();return H.createElement(ee,{id:t.id,type:`area`},e=>H.createElement(H.Fragment,null,H.createElement(fe,{legendPayload:Vt(t)}),H.createElement(Ht,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,formatter:t.formatter,tooltipType:t.tooltipType,id:e}),H.createElement(te,{type:`area`,id:e,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:ke(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),H.createElement(Xt,W({},t,{id:e}))))}var q=H.memo($t,$e);q.displayName=`Area`;var en=[`axis`],tn=(0,H.forwardRef)((e,t)=>H.createElement(Ve,{chartName:`AreaChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:en,tooltipPayloadSearcher:ye,categoricalChartProps:e,ref:t})),J=`var(--chart-line-bright)`,Y=`var(--chart-line-blue)`;function nn(e,t){return Ue(n=>({title:Me(t,n.at),rows:[{label:e.processMemory,value:e.megabytes(n.rssMb),shape:`line`,color:J},{label:e.jsHeap,value:e.megabytes(n.heapUsedMb),shape:`dashed`,color:Y}]}))}function rn(){let{stats:e}=s(),t=i(),n=(0,H.useMemo)(()=>nn(e,t),[e,t]),r=[{label:e.processMemory,shape:`line`,color:J},{label:e.jsHeap,shape:`dashed`,color:Y}],a=o().data?.samples??[],c=a.at(-1)?.rssMb??null,l=a.length===0?null:Math.max(...a.map(e=>e.rssMb));return(0,B.jsxs)(m,{title:e.serverMemory,children:[(0,B.jsx)(`p`,{className:g.muted,children:e.memoryRestartNote}),(0,B.jsx)(Ke,{summary:e.memorySummary(e.megabytes(c),e.megabytes(l)),legend:r,children:(0,B.jsxs)(tn,{data:a,margin:We,"aria-label":e.chartLabel(e.serverMemory,`sample`),children:[(0,B.jsx)(w,{vertical:!1}),(0,B.jsx)(Ne,{dataKey:`at`,tickFormatter:e=>et(t,e),...Xe}),(0,B.jsx)(k,{tickFormatter:t=>e.megabytes(t),width:60,...A}),(0,B.jsx)(C,{content:n,...Oe,cursor:{stroke:`var(--line-strong)`}}),(0,B.jsx)(q,{dataKey:`rssMb`,stroke:J,strokeWidth:3,fill:J,fillOpacity:Je,dot:!1,isAnimationActive:!1}),(0,B.jsx)(q,{dataKey:`heapUsedMb`,stroke:Y,strokeWidth:2,strokeDasharray:`5 4`,fill:`none`,dot:!1,isAnimationActive:!1})]})})]})}var X=`var(--chart-bar-warm)`,Z=`var(--chart-bar-neutral)`,Q=`var(--chart-line-green)`,$=`var(--chart-line-yellow)`;function an(e,t,n){return Ue(i=>({title:e.periodOf(n,f(t,i.start)),rows:[{label:e.hookTurnsTooltip,value:e.tokens(i.hookTokens),shape:`bar`,color:X},{label:e.cliOutput,value:e.tokens(i.cliTokens),shape:`bar`,color:Z},{label:e.apiPriceTooltip,value:i.hasUnpricedTokens&&i.cost!==null?`${z(t,i.cost)} (${e.unpricedNote})`:z(t,i.cost)},{label:e.hookRuns,value:r(t,i.hookRuns),shape:`line`,color:Q},{label:e.otherCommands,value:r(t,i.cliRuns),shape:`dashed`,color:$}]}))}function on({day:e,...t}){return{start:e,...t}}function sn({weeks:e,days:t,windows:n}){let{stats:r}=s(),a=i(),o=(0,H.useMemo)(()=>t.map(on),[t]),{grain:c,periods:l,period:u,toggle:d}=Qe(`spend`,`day`,{week:e,day:o},n),f=(0,H.useMemo)(()=>an(r,a,c),[r,a,c]),p=r.spendBy[c],h=[{label:r.hookTurnTokens,shape:`bar`,color:X},{label:r.cliOutputTokens,shape:`bar`,color:Z},{label:r.hookRuns,shape:`line`,color:Q},{label:r.otherCommands,shape:`dashed`,color:$}],g=e=>Ae(a,e);return(0,B.jsx)(m,{title:p,period:u,aside:d,children:(0,B.jsx)(Ke,{summary:cn(r,a,c,l),legend:h,children:(0,B.jsxs)(st,{data:l,margin:We,"aria-label":r.chartLabel(p,c),children:[(0,B.jsx)(w,{vertical:!1}),(0,B.jsx)(Ne,{dataKey:`start`,tickFormatter:e=>ze(a,e),...Xe}),(0,B.jsx)(k,{yAxisId:`tokens`,tickFormatter:g,width:60,...A}),(0,B.jsx)(k,{yAxisId:`runs`,orientation:`right`,allowDecimals:!1,tickFormatter:g,width:60,...A}),(0,B.jsx)(C,{content:f,...Oe}),(0,B.jsx)(Ce,{yAxisId:`tokens`,dataKey:`hookTokens`,stackId:`tokens`,fill:X,isAnimationActive:!1}),(0,B.jsx)(Ce,{yAxisId:`tokens`,dataKey:`cliTokens`,stackId:`tokens`,fill:Z,radius:we,isAnimationActive:!1}),(0,B.jsx)(lt,{yAxisId:`runs`,dataKey:`hookRuns`,stroke:Q,strokeWidth:3,dot:R(Q),isAnimationActive:!1}),(0,B.jsx)(lt,{yAxisId:`runs`,dataKey:`cliRuns`,stroke:$,strokeWidth:2,strokeDasharray:`5 4`,dot:R($),isAnimationActive:!1})]})})})}function cn(e,n,i,a){let o=e=>t(a.map(e)),s=e=>r(n,e);return e.spendSummary({grain:i,periodCount:a.length,hookTokens:o(e=>e.hookTokens),cliTokens:s(o(e=>e.cliTokens)),money:p(n,ln(a)),hookRuns:s(o(e=>e.hookRuns)),cliRuns:s(o(e=>e.cliRuns))})}function ln(e){return e.every(e=>e.cost===null)?null:t(e.map(e=>e.cost??0))}function un(){let{projectId:e}=l(),t=a(e),{stats:n}=s();return(0,B.jsx)(_,{query:t,children:e=>(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(dn,{scan:e.scan}),(0,B.jsx)(pn,{report:e}),(0,B.jsx)(`p`,{className:v.note,children:n.costNote})]})})}function dn({scan:e}){let{stats:t}=s(),n=fn(t,e);return(0,B.jsx)(`p`,{className:n===null?`visually-hidden`:v.warning,role:`status`,children:n})}function fn(e,t){return t.listed?t.filesTotal===0?e.noTranscripts:t.bytesLeft>0?e.scanProgress(t.filesDone,t.filesTotal):null:e.scanStarting}function pn({report:e}){let{stats:t}=s(),n=i(),r=mn(e);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(ut,{totals:e.totals,period:e.periods.totals}),r!==null&&(0,B.jsx)(`p`,{className:v.note,children:t.costSince(f(n,r))}),(0,B.jsxs)(`div`,{className:v.blocks,children:[(0,B.jsx)(`div`,{className:g.wide,children:(0,B.jsx)(sn,{weeks:e.weeks,days:e.days,windows:e.periods})}),(0,B.jsx)(dt,{models:e.models,period:e.periods.days}),(0,B.jsx)(rn,{}),(0,B.jsx)(`div`,{className:g.wide,children:(0,B.jsx)(ft,{commands:e.commands,period:e.periods.days})})]})]})}function mn({since:e,periods:t}){return e!==null&&d(e)>d(t.weeks.from)?e:null}export{un as CostTab};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{F as t,I as n,O as r,a as i,c as a,cn as o,ft as s,k as c,ln as l}from"./cx-CutaZ2Ho.js";import{_ as u,d,h as f,x as p}from"./index-CM8tBSED.js";import{a as m,i as h,r as g,t as _}from"./StatsTabState-BauB3xdU.js";import{t as v}from"./StatsPage.module-DxtnhZOJ.js";import{n as y,t as b}from"./Figure-DAdnR-Fu.js";import{t as x}from"./StatsTable-Dg0CrPof.js";import{A as S,B as C,C as w,D as ee,Dt as T,E as te,F as ne,G as re,H as ie,I as ae,J as oe,K as se,L as ce,M as le,N as ue,O as de,P as fe,Q as pe,R as me,St as he,T as ge,Tt as _e,U as ve,V as ye,X as be,Y as xe,Z as Se,_ as Ce,_t as E,a as we,at as Te,b as Ee,bt as De,c as Oe,ct as ke,d as Ae,dt as je,et as D,f as Me,ft as O,g as Ne,h as k,ht as Pe,i as A,it as Fe,j as Ie,k as Le,kt as Re,l as ze,lt as Be,m as Ve,mt as He,n as Ue,nt as j,o as We,ot as Ge,p as Ke,pt as M,q as qe,r as Je,rt as Ye,s as Xe,st as Ze,t as Qe,tt as $e,u as et,ut as N,v as P,vt as tt,wt as F,x as nt,xt as I,y as L,yt as rt,z as it}from"./use-grain-panel-BczBScgN.js";import{a as at,i as ot,n as st,o as ct,r as lt,t as R}from"./value-dot-Dy8YzPPT.js";function z(e,n){return n===null?`—`:t(f(e,n))}var B=o();function ut({totals:e,period:t}){let{stats:i}=c(),a=r(),o=h(),s=e=>n(a,e);return(0,B.jsxs)(y,{period:o.of(`lastWeek`,t),children:[(0,B.jsx)(b,{label:i.backlogTokens,value:s(e.tokens),note:i.backlogTokensNote(s(e.hookTokens),s(e.cliTokens))}),(0,B.jsx)(b,{label:i.apiPrice,value:z(a,e.cost),note:e.hasUnpricedTokens?i.unpricedNote:void 0}),(0,B.jsx)(b,{label:i.hookTurns,value:s(e.hookTurns),note:i.hookRunsNote(s(e.hookRuns))}),(0,B.jsx)(b,{label:i.cliCalls,value:s(e.cliRuns)})]})}function dt({models:e,period:t}){let{stats:i}=c(),a=r(),o=h();return(0,B.jsx)(m,{title:i.byModel,period:o.of(`costDays`,t),children:e.length===0?(0,B.jsx)(`p`,{className:g.muted,children:i.noModels}):(0,B.jsx)(x,{label:i.byModel,head:i.modelsHead,rows:e.map(e=>({key:`${e.model}:${e.fast}`,cells:[e.fast?i.fastModel(e.model):e.model,n(a,e.tokens),f(a,e.cost)]}))})})}function ft({commands:e,period:t}){let{stats:i}=c(),a=r(),o=h();return(0,B.jsx)(m,{title:i.commandsTitle,period:o.of(`costDays`,t),children:e.length===0?(0,B.jsx)(`p`,{className:g.muted,children:i.noCommands}):(0,B.jsx)(x,{label:i.commandsTitle,head:i.commandsHead,rows:e.map(e=>({key:e.command,cells:[e.command,n(a,e.runs),i.milliseconds(e.avgMs),i.megabytes(e.avgRssMb),i.megabytes(e.maxRssMb)]}))})})}var pt=(e,t,n)=>re(e,`xAxis`,P(e,t),n),mt=(e,t,n)=>qe(e,`xAxis`,P(e,t),n),ht=(e,t,n)=>re(e,`yAxis`,L(e,t),n),gt=(e,t,n)=>qe(e,`yAxis`,L(e,t),n),_t=M([j,pt,ht,mt,gt],(e,t,n,r,i)=>je(e,`xAxis`)?Ge(t,r,!1):Ge(n,i,!1)),V=M([oe,(e,t)=>t],(e,t)=>e.filter(e=>e.type===`area`).find(e=>e.id===t)),vt=e=>{var t=j(e);return je(t,`xAxis`)?`yAxis`:`xAxis`},yt=(e,t)=>vt(e)===`yAxis`?L(e,t):P(e,t),bt=(e,t,n)=>se(e,vt(e),yt(e,t),n),xt=M([V,bt],(e,t)=>{if(e!=null&&t!=null){var n=e.stackId,r=xe(e);if(n!=null&&r!=null){var i=(t[n]?.stackedData)?.find(e=>e.key===r);if(i!=null)return i.map(e=>[e[0],e[1]])}}}),St=M([V,bt],(e,t)=>{if(e!=null&&e.stackId!=null&&t!=null){var n=t[e.stackId];if(n!=null)return n.graphicalItems.map(e=>e.dataKey).filter(rt)}}),Ct=M([j,pt,ht,mt,gt,xt,pe,_t,V,Se,St],(e,t,n,r,i,a,o,s,c,l,u)=>{var d=o.chartData,f=o.dataStartIndex,p=o.dataEndIndex;if(!(c==null||e!==`horizontal`&&e!==`vertical`||t==null||n==null||r==null||i==null||r.length===0||i.length===0||s==null)){var m=c.data,h=m&&m.length>0?m:d?.slice(f,p+1);if(h!=null)return Qt({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:f,areaSettings:c,stackedData:a,displayedData:h,chartBaseValue:l,bandSize:s,stackDataKeys:u})}}),H=e(l()),wt=[`animationElapsedTime`,`isAnimating`,`isEntrance`,`layout`,`isRange`,`stroke`,`connectNulls`],Tt=[`id`,`baseLine`];function U(){return U=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},U.apply(null,arguments)}function Et(e,t){if(e==null)return{};var n,r,i=Dt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Dt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Ot(e){var t=e.alpha,n=e.baseLine,r=e.points,i=e.strokeWidth,a=r[0]?.x,o=r[r.length-1]?.x;if(!O(a)||!O(o))return null;var s=t*Math.abs(a-o),c=Math.max(...r.map(e=>e.y||0));return I(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(e=>e.y||0),c)),I(c)?H.createElement(`rect`,{x:a<o?a:a-s,y:0,width:s,height:Math.floor(c+(i?parseInt(`${i}`,10):1))}):null}function kt(e){var t=e.alpha,n=e.baseLine,r=e.points,i=e.strokeWidth,a=r[0]?.y,o=r[r.length-1]?.y;if(!O(a)||!O(o))return null;var s=t*Math.abs(a-o),c=Math.max(...r.map(e=>e.x||0));return I(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(e=>e.x||0),c)),I(c)?H.createElement(`rect`,{x:0,y:a<o?a:a-s,width:c+(i?parseInt(`${i}`,10):1),height:Math.floor(s)}):null}function At(e){var t=e.alpha,n=e.layout,r=e.points,i=e.baseLine,a=e.strokeWidth;return n===`vertical`?H.createElement(kt,{alpha:t,points:r,baseLine:i,strokeWidth:a}):H.createElement(Ot,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function jt(e){var t=e.animationElapsedTime,n=t===void 0?1:t,r=e.isAnimating,i=r!==void 0&&r,a=e.isEntrance,o=a!==void 0&&a,s=e.layout,c=e.isRange,l=e.stroke,u=e.connectNulls,d=Et(e,wt),f=s===`vertical`?`vertical`:`horizontal`,p=u??!1,m=de(),h=d.id,g=d.baseLine,_=Et(d,Tt),v=T(_),y=H.createElement(D,U({},d,{id:h,baseLine:g,connectNulls:p,stroke:`none`,className:`recharts-area-area`,layout:f})),b=l!==`none`&&H.createElement(D,U({},v,{className:`recharts-area-curve`,layout:f,type:d.type,connectNulls:p,fill:`none`,stroke:l,points:d.points})),x=l!==`none`&&c&&Array.isArray(g)&&H.createElement(D,U({},v,{className:`recharts-area-curve`,layout:f,type:d.type,connectNulls:p,fill:`none`,stroke:l,points:g}));return o&&(i||n<1)?H.createElement(F,null,H.createElement(`defs`,null,H.createElement(`clipPath`,{id:m},H.createElement(At,{alpha:n,points:d.points??[],baseLine:g,layout:f,strokeWidth:d.strokeWidth}))),H.createElement(F,{clipPath:`url(#${m})`},y,b,x)):H.createElement(H.Fragment,null,y,b,x)}var Mt=[`id`],Nt=[`activeDot`,`animationBegin`,`animationDuration`,`animationEasing`,`connectNulls`,`dot`,`fill`,`fillOpacity`,`hide`,`isAnimationActive`,`legendType`,`stroke`,`xAxisId`,`yAxisId`];function W(){return W=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},W.apply(null,arguments)}function Pt(e,t){if(e==null)return{};var n,r,i=Ft(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ft(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function It(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function G(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?It(Object(n),!0).forEach(function(t){Lt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):It(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Lt(e,t,n){return(t=Rt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rt(e){var t=zt(e,`string`);return typeof t==`symbol`?t:t+``}function zt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Bt={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:`ease`,animationMatchBy:ue,animationInterpolateFn:(e,t)=>e==null?[]:t===1?e.flatMap(e=>e.status===`removed`?[]:[e.next]):e.flatMap(e=>e.status===`matched`?[G(G({},e.next),{},{x:E(e.prev.x,e.next.x,t),y:E(e.prev.y,e.next.y,t)})]:e.status===`added`?[e.next]:[]),connectNulls:!1,dot:!1,fill:`#3182bd`,fillOpacity:.6,hide:!1,isAnimationActive:`auto`,legendType:`line`,stroke:`#3182bd`,strokeWidth:1,type:`linear`,label:!1,shape:jt,xAxisId:0,yAxisId:0,zIndex:be.area};function K(e,t){return e&&e!==`none`?e:t}var Vt=e=>{var t=e.dataKey,n=e.name,r=e.stroke,i=e.fill,a=e.legendType;return[{inactive:e.hide,dataKey:t,type:a,color:K(r,i),value:Be(n,t),payload:e}]},Ht=H.memo(e=>{var t=e.dataKey,n=e.data,r=e.stroke,i=e.strokeWidth,a=e.fill,o=e.name,s=e.hide,c=e.unit,l=e.formatter,u=e.tooltipType,d=e.id,f={dataDefinedOnItem:n,getPosition:he,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:Be(o,t),hide:s,type:u,color:K(r,a),unit:c,formatter:l,graphicalItemId:d}};return H.createElement(ne,{tooltipEntrySettings:f})});function Ut(e){var t=e.clipPathId,n=e.points,r=e.props,i=r.needClip,a=r.dot,o=r.dataKey,s=T(r);return H.createElement(ct,{points:n,dot:a,className:`recharts-area-dots`,dotClassName:`recharts-area-dot`,dataKey:o,baseProps:s,needClip:i,clipPathId:t})}function Wt(e){var t=e.showLabels,n=e.children,r=e.points.map(e=>{var t={x:e.x??0,y:e.y??0,width:0,lowerWidth:0,upperWidth:0,height:0};return G(G({},t),{},{value:e.value,payload:e.payload,parentViewBox:void 0,viewBox:t,fill:void 0})});return H.createElement(me,{value:t?r:void 0},n)}function Gt(e){var t=e.points,n=e.baseLine,r=e.needClip,i=e.clipPathId,a=e.props,o=e.animationElapsedTime,s=e.isAnimating,c=e.isEntrance,l=a.layout,u=a.type,d=a.stroke,f=a.connectNulls,p=a.isRange,m=a.shape,h=a.id,g=Pt(a,Mt),_=G(G({},_e(g)),{},{id:h,points:t,connectNulls:f,type:u,baseLine:n,layout:l,stroke:d,isRange:p,animationElapsedTime:o,isAnimating:s,isEntrance:c});return H.createElement(H.Fragment,null,t?.length>1&&H.createElement(F,{clipPath:r?`url(#clipPath-${i})`:void 0},H.createElement(ae,{option:m,DefaultShape:Bt.shape,shapeProps:_})),H.createElement(Ut,{points:t,props:g,clipPathId:i}))}function Kt(e,t,n){if(I(e)){var r=I(t)?t:void 0;return E(r,e,n)}if(De(e)||tt(e)){var i=I(t)?t:void 0;return E(i,0,n)}return e}function qt(e){var t=e.needClip,n=e.clipPathId,r=e.props,i=e.previousPointsRef,a=e.previousBaselineRef,o=r.points,s=r.baseLine,c=r.isAnimationActive,l=r.animationBegin,u=r.animationDuration,d=r.animationEasing,f=r.animationMatchBy,p=r.animationInterpolateFn,m=(0,H.useMemo)(()=>({points:o,baseLine:s}),[o,s]),h=Ie(m,a),g=Ye(),_=S(r.onAnimationStart,r.onAnimationEnd),v=_.isAnimating,y=_.handleAnimationStart,b=_.handleAnimationEnd,x=h.startValue;if(g==null)return null;var C=Array.isArray(s)&&Array.isArray(x)?le(x,s,f):Array.isArray(s)?le(null,s,f):null;return H.createElement(Le,{animationInput:m,animationIdPrefix:`recharts-area-`,items:o,previousItemsRef:i,isAnimationActive:c,animationBegin:l,animationDuration:u,animationEasing:d,onAnimationStart:y,onAnimationEnd:b,animationInterpolateFn:p,animationMatchBy:f,layout:g},(e,i,a)=>{var c=i===1?s:Array.isArray(s)?p(C,i,g):a?s:Kt(s,x,i);return h.syncStepValue(c,i),H.createElement(Wt,{showLabels:!v,points:o},r.children,H.createElement(Gt,{points:e,baseLine:c,needClip:t,clipPathId:n,props:r,animationElapsedTime:i,isAnimating:v||i<1,isEntrance:a}),H.createElement(it,{label:r.label}))})}function Jt(e){var t=e.needClip,n=e.clipPathId,r=e.props,i=(0,H.useRef)(null),a=(0,H.useRef)();return H.createElement(qt,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}var Yt=class extends H.PureComponent{render(){var e=this.props,t=e.hide,n=e.dot,r=e.points,i=e.className,a=e.top,o=e.left,s=e.needClip,c=e.xAxisId,l=e.yAxisId,u=e.width,d=e.height,f=e.id,p=e.baseLine,m=e.zIndex;if(t)return null;var h=Re(`recharts-area`,i),g=f,_=ot(n),v=_.r,y=_.strokeWidth,b=ce(n),x=v*2+y,S=s?`url(#clipPath-${b?``:`dots-`}${g})`:void 0;return H.createElement(ie,{zIndex:m},H.createElement(F,{className:h},s&&H.createElement(`defs`,null,H.createElement(Ee,{clipPathId:g,xAxisId:c,yAxisId:l}),!b&&H.createElement(`clipPath`,{id:`clipPath-dots-${g}`},H.createElement(`rect`,{x:o-x/2,y:a-x/2,width:u+x,height:d+x}))),H.createElement(Jt,{needClip:s,clipPathId:g,props:this.props})),H.createElement(at,{points:r,mainColor:K(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:S}),this.props.isRange&&Array.isArray(p)&&H.createElement(at,{points:p,mainColor:K(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:S}))}};function Xt(e){var t=e.activeDot,n=e.animationBegin,r=e.animationDuration,i=e.animationEasing,a=e.connectNulls,o=e.dot,s=e.fill,c=e.fillOpacity,l=e.hide,u=e.isAnimationActive,d=e.legendType,f=e.stroke,p=e.xAxisId,m=e.yAxisId,h=Pt(e,Nt),g=Fe(),_=ve(),v=nt(p,m).needClip,y=Te(),b=He(t=>Ct(t,e.id,y))??{},x=b.points,S=b.isRange,C=b.baseLine,w=ge();if(g!==`horizontal`&&g!==`vertical`||w==null||_!==`AreaChart`&&_!==`ComposedChart`)return null;var ee=w.height,T=w.width,te=w.x,ne=w.y;return!x||!x.length?null:H.createElement(Yt,W({},h,{activeDot:t,animationBegin:n,animationDuration:r,animationEasing:i,baseLine:C,connectNulls:a,dot:o,fill:s,fillOpacity:c,height:ee,hide:l,layout:g,isAnimationActive:u,isRange:S,legendType:d,needClip:v,points:x,stroke:f,width:T,left:te,top:ne,xAxisId:p,yAxisId:m}))}var Zt=(e,t,n,r,i)=>{var a=n??t;if(I(a))return a;var o=e===`horizontal`?i:r,s=o.scale.domain();if(o.type===`number`){var c=Math.max(s[0],s[1]),l=Math.min(s[0],s[1]);return a===`dataMin`?l:a===`dataMax`||c<0?c:Math.max(Math.min(s[0],s[1]),0)}return a===`dataMin`?s[0]:a===`dataMax`?s[1]:s[0]};function Qt(e){var t=e.areaSettings,n=t.connectNulls,r=t.baseValue,i=t.dataKey,a=e.stackedData,o=e.layout,s=e.chartBaseValue,c=e.xAxis,l=e.yAxis,u=e.displayedData,d=e.dataStartIndex,f=e.xAxisTicks,p=e.yAxisTicks,m=e.bandSize,h=e.stackDataKeys,g=a&&a.length,_=Zt(o,s,r,c,l),v=o===`horizontal`,y=!1,b=u.map((e,t)=>{var r;if(g)r=a[d+t];else{var o=N(e,i);Array.isArray(o)?(r=o,y=!0):r=[_,o]}var s=r?.[1]??null,u=N(e,i),b=g&&u==null&&h!=null&&h.length>0&&h.every(t=>N(e,t)==null),x=s==null||g&&!n&&u==null||b;return v?{x:Ze({axis:c,ticks:f,bandSize:m,entry:e,index:t}),y:x?null:l.scale.map(s)??null,value:r,payload:e}:{x:x?null:c.scale.map(s)??null,y:Ze({axis:l,ticks:p,bandSize:m,entry:e,index:t}),value:r,payload:e}});return{points:b,baseLine:(g||y?b.map(e=>{var t=Array.isArray(e.value)?e.value[0]:null;return v?{x:e.x,y:t!=null&&e.y!=null?l.scale.map(t)??null:null,payload:e.payload}:{x:t==null?null:c.scale.map(t)??null,y:e.y,payload:e.payload}}):v?l.scale.map(_):c.scale.map(_))??0,isRange:y}}function $t(e){var t=Pe(e,Bt),n=Te();return H.createElement(ee,{id:t.id,type:`area`},e=>H.createElement(H.Fragment,null,H.createElement(fe,{legendPayload:Vt(t)}),H.createElement(Ht,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,formatter:t.formatter,tooltipType:t.tooltipType,id:e}),H.createElement(te,{type:`area`,id:e,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:ke(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),H.createElement(Xt,W({},t,{id:e}))))}var q=H.memo($t,$e);q.displayName=`Area`;var en=[`axis`],tn=(0,H.forwardRef)((e,t)=>H.createElement(Ve,{chartName:`AreaChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:en,tooltipPayloadSearcher:ye,categoricalChartProps:e,ref:t})),J=`var(--chart-line-bright)`,Y=`var(--chart-line-blue)`;function nn(e,t){return Ue(n=>({title:Me(t,n.at),rows:[{label:e.processMemory,value:e.megabytes(n.rssMb),shape:`line`,color:J},{label:e.jsHeap,value:e.megabytes(n.heapUsedMb),shape:`dashed`,color:Y}]}))}function rn(){let{stats:e}=c(),t=r(),n=(0,H.useMemo)(()=>nn(e,t),[e,t]),i=[{label:e.processMemory,shape:`line`,color:J},{label:e.jsHeap,shape:`dashed`,color:Y}],o=a().data?.samples??[],s=o.at(-1)?.rssMb??null,l=o.length===0?null:Math.max(...o.map(e=>e.rssMb));return(0,B.jsxs)(m,{title:e.serverMemory,children:[(0,B.jsx)(`p`,{className:g.muted,children:e.memoryRestartNote}),(0,B.jsx)(Ke,{summary:e.memorySummary(e.megabytes(s),e.megabytes(l)),legend:i,children:(0,B.jsxs)(tn,{data:o,margin:We,"aria-label":e.chartLabel(e.serverMemory,`sample`),children:[(0,B.jsx)(w,{vertical:!1}),(0,B.jsx)(Ne,{dataKey:`at`,tickFormatter:e=>et(t,e),...Xe}),(0,B.jsx)(k,{tickFormatter:t=>e.megabytes(t),width:60,...A}),(0,B.jsx)(C,{content:n,...Oe,cursor:{stroke:`var(--line-strong)`}}),(0,B.jsx)(q,{dataKey:`rssMb`,stroke:J,strokeWidth:3,fill:J,fillOpacity:Je,dot:!1,isAnimationActive:!1}),(0,B.jsx)(q,{dataKey:`heapUsedMb`,stroke:Y,strokeWidth:2,strokeDasharray:`5 4`,fill:`none`,dot:!1,isAnimationActive:!1})]})})]})}var X=`var(--chart-bar-warm)`,Z=`var(--chart-bar-neutral)`,Q=`var(--chart-line-green)`,$=`var(--chart-line-yellow)`;function an(e,t,r){return Ue(i=>({title:e.periodOf(r,d(t,i.start)),rows:[{label:e.hookTurnsTooltip,value:e.tokens(i.hookTokens),shape:`bar`,color:X},{label:e.cliOutput,value:e.tokens(i.cliTokens),shape:`bar`,color:Z},{label:e.apiPriceTooltip,value:i.hasUnpricedTokens&&i.cost!==null?`${z(t,i.cost)} (${e.unpricedNote})`:z(t,i.cost)},{label:e.hookRuns,value:n(t,i.hookRuns),shape:`line`,color:Q},{label:e.otherCommands,value:n(t,i.cliRuns),shape:`dashed`,color:$}]}))}function on({day:e,...t}){return{start:e,...t}}function sn({weeks:e,days:t,windows:n}){let{stats:i}=c(),a=r(),o=(0,H.useMemo)(()=>t.map(on),[t]),{grain:s,periods:l,period:u,toggle:d}=Qe(`spend`,`day`,{week:e,day:o},n),f=(0,H.useMemo)(()=>an(i,a,s),[i,a,s]),p=i.spendBy[s],h=[{label:i.hookTurnTokens,shape:`bar`,color:X},{label:i.cliOutputTokens,shape:`bar`,color:Z},{label:i.hookRuns,shape:`line`,color:Q},{label:i.otherCommands,shape:`dashed`,color:$}],g=e=>Ae(a,e);return(0,B.jsx)(m,{title:p,period:u,aside:d,children:(0,B.jsx)(Ke,{summary:cn(i,a,s,l),legend:h,children:(0,B.jsxs)(st,{data:l,margin:We,"aria-label":i.chartLabel(p,s),children:[(0,B.jsx)(w,{vertical:!1}),(0,B.jsx)(Ne,{dataKey:`start`,tickFormatter:e=>ze(a,e),...Xe}),(0,B.jsx)(k,{yAxisId:`tokens`,tickFormatter:g,width:60,...A}),(0,B.jsx)(k,{yAxisId:`runs`,orientation:`right`,allowDecimals:!1,tickFormatter:g,width:60,...A}),(0,B.jsx)(C,{content:f,...Oe}),(0,B.jsx)(Ce,{yAxisId:`tokens`,dataKey:`hookTokens`,stackId:`tokens`,fill:X,isAnimationActive:!1}),(0,B.jsx)(Ce,{yAxisId:`tokens`,dataKey:`cliTokens`,stackId:`tokens`,fill:Z,radius:we,isAnimationActive:!1}),(0,B.jsx)(lt,{yAxisId:`runs`,dataKey:`hookRuns`,stroke:Q,strokeWidth:3,dot:R(Q),isAnimationActive:!1}),(0,B.jsx)(lt,{yAxisId:`runs`,dataKey:`cliRuns`,stroke:$,strokeWidth:2,strokeDasharray:`5 4`,dot:R($),isAnimationActive:!1})]})})})}function cn(e,t,r,i){let a=e=>p(i.map(e)),o=e=>n(t,e);return e.spendSummary({grain:r,periodCount:i.length,hookTokens:a(e=>e.hookTokens),cliTokens:o(a(e=>e.cliTokens)),money:f(t,ln(i)),hookRuns:o(a(e=>e.hookRuns)),cliRuns:o(a(e=>e.cliRuns))})}function ln(e){return e.every(e=>e.cost===null)?null:p(e.map(e=>e.cost??0))}function un(){let{projectId:e}=s(),t=i(e),{stats:n}=c();return(0,B.jsx)(_,{query:t,children:e=>(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(dn,{scan:e.scan}),(0,B.jsx)(pn,{report:e}),(0,B.jsx)(`p`,{className:v.note,children:n.costNote})]})})}function dn({scan:e}){let{stats:t}=c(),n=fn(t,e);return(0,B.jsx)(`p`,{className:n===null?`visually-hidden`:v.warning,role:`status`,children:n})}function fn(e,t){return t.listed?t.filesTotal===0?e.noTranscripts:t.bytesLeft>0?e.scanProgress(t.filesDone,t.filesTotal):null:e.scanStarting}function pn({report:e}){let{stats:t}=c(),n=r(),i=mn(e);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(ut,{totals:e.totals,period:e.periods.totals}),i!==null&&(0,B.jsx)(`p`,{className:v.note,children:t.costSince(d(n,i))}),(0,B.jsxs)(`div`,{className:v.blocks,children:[(0,B.jsx)(`div`,{className:g.wide,children:(0,B.jsx)(sn,{weeks:e.weeks,days:e.days,windows:e.periods})}),(0,B.jsx)(dt,{models:e.models,period:e.periods.days}),(0,B.jsx)(rn,{}),(0,B.jsx)(`div`,{className:g.wide,children:(0,B.jsx)(ft,{commands:e.commands,period:e.periods.days})})]})]})}function mn({since:e,periods:t}){return e!==null&&u(e)>u(t.weeks.from)?e:null}export{un as CostTab};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{A as t,I as n,M as r,O as i,cn as a,ft as o,j as s,k as c,ln as l,s as u}from"./cx-CutaZ2Ho.js";import{d,x as f}from"./index-CM8tBSED.js";import{a as p,i as m,n as h,r as g}from"./StatsTabState-BauB3xdU.js";import{t as _}from"./StatsPage.module-DxtnhZOJ.js";import{t as v}from"./UnavailableRepos-BTMsOBI-.js";import{n as y,t as b}from"./Figure-DAdnR-Fu.js";import{t as ee}from"./StatsTable-Dg0CrPof.js";import{B as x,C as S,V as C,_ as w,a as T,c as E,d as D,g as O,h as k,i as A,l as j,m as M,n as N,o as P,p as F,s as I,t as L}from"./use-grain-panel-BczBScgN.js";var R=e(l()),z=[`axis`,`item`],B=(0,R.forwardRef)((e,t)=>R.createElement(M,{chartName:`BarChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:z,tooltipPayloadSearcher:C,categoricalChartProps:e,ref:t})),V={steps:`_steps_advmo_1`,now:`_now_advmo_13`},H=a();function U({totals:e}){let{stats:t}=c(),n=i();return(0,H.jsx)(p,{title:t.explainerTitle,children:(0,H.jsxs)(`ol`,{className:V.steps,children:[(0,H.jsx)(`li`,{children:t.explainerTask}),(0,H.jsxs)(`li`,{children:[t.explainerFixed,(0,H.jsx)(W,{children:t.fixedNow(e.fixedTasks,e.fixedLines)})]}),(0,H.jsxs)(`li`,{children:[t.explainerPending,(0,H.jsx)(W,{children:G(t,e)})]}),(0,H.jsxs)(`li`,{children:[t.explainerTests,(0,H.jsx)(W,{children:t.codeAndTests(e)})]}),(0,H.jsxs)(`li`,{children:[t.explainerNoise,(0,H.jsx)(W,{children:K(t,n,e)})]})]})})}function W({children:e}){let{stats:t}=c();return(0,H.jsxs)(`span`,{className:V.now,children:[t.now,` `,e]})}function G(e,t){return t.openTasks===0?e.noPending:t.estimatedLines===null?e.pendingWithoutEstimate(t.openTasks):e.pendingEstimated(t.openTasks,t.estimatedLines,t.estimatedLines/t.openTasks)}function K(e,i,a){if(a.estimatedLines===null&&a.openTasks>0)return e.estimateLater;if(a.noiseShare===null)return e.noCommitsSinceAdoption;let o=a.estimatedLines??0,c=r(a.estimatedLines);return e.noiseFormula(t(i,a.deferredLines,c),n(i,a.realLines),t(i,o,c),s(a.noiseShare))}var q=`var(--chart-bar-neutral)`,J=`var(--accent-ink)`,Y=6,X=3;function Z(e,n,r,i){let a=e=>t(r,e,Math.round(e)>0);return N(t=>({title:e.periodOf(i,d(r,t.start)),rows:[{label:e.onTopicSeries,value:n.count(Math.round(t.onTopicLines),`line`),shape:`bar`,color:q},{label:e.deferredSeries,value:a(t.deferredLines),shape:`hatch`,color:J},{label:e.codeLines,value:a(t.deferredLines-t.deferredTestLines)},{label:e.testLines,value:a(t.deferredTestLines)},{label:e.deferredTasks,value:String(t.deferredTasks)}]}))}function Q({periods:e,totals:t,grain:n}){let{stats:r,core:a}=c(),o=i(),s=(0,R.useMemo)(()=>Z(r,a,o,n),[r,a,o,n]),l=(0,R.useId)(),u=[{label:r.onTopicSeries,shape:`bar`,color:q},{label:r.deferredSeries,shape:`hatch`,color:J}];return(0,H.jsx)(F,{summary:$(r,n,e,t),legend:u,children:(0,H.jsxs)(B,{data:e,margin:P,"aria-label":r.chartLabel(r.effectTitle,n),children:[(0,H.jsx)(`defs`,{children:(0,H.jsxs)(`pattern`,{id:l,width:Y,height:Y,patternUnits:`userSpaceOnUse`,patternTransform:`rotate(45)`,children:[(0,H.jsx)(`rect`,{width:Y,height:Y,fill:`var(--surface-raised)`}),(0,H.jsx)(`line`,{x1:0,y1:0,x2:0,y2:Y,stroke:J,strokeWidth:X})]})}),(0,H.jsx)(S,{vertical:!1}),(0,H.jsx)(O,{dataKey:`start`,tickFormatter:e=>j(o,e),...I}),(0,H.jsx)(k,{tickFormatter:e=>D(o,e),width:60,...A}),(0,H.jsx)(x,{content:s,...E}),(0,H.jsx)(w,{dataKey:`onTopicLines`,stackId:`lines`,fill:q,isAnimationActive:!1}),(0,H.jsx)(w,{dataKey:`deferredLines`,stackId:`lines`,fill:`url(#${l})`,radius:T,isAnimationActive:!1})]})})}function $(e,t,n,i){let a=r(i.estimatedLines);if(t===`week`)return e.effectSummary(i.realLines,e.linesText(i.deferredLines,a),s(i.noiseShare));let o=Math.round(f(n.map(e=>e.onTopicLines)));return e.effectDaysSummary(n.length,o,e.linesText(f(n.map(e=>e.deferredLines)),a))}function te({totals:e,period:t}){let{stats:r}=c(),a=i(),o=m();return(0,H.jsxs)(y,{period:o.labelled(r.effectWindow,t),children:[(0,H.jsx)(b,{label:r.keptOut,value:ne(r,e),note:`${re(r,a,e)} · ${r.codeAndTests(e)}`}),(0,H.jsx)(b,{label:r.noiseWithoutBacklog,value:s(e.noiseShare),note:r.noiseNote}),(0,H.jsx)(b,{label:r.deferredToBacklog,value:String(e.fixedTasks+e.openTasks),note:r.deferredNote(e.fixedTasks,e.openTasks)}),(0,H.jsx)(b,{label:r.pullRequestLines,value:n(a,e.realLines)})]})}function ne(e,t){return t.estimatedLines===null?e.linesText(t.fixedLines,!1):e.linesText(t.deferredLines,r(t.estimatedLines))}function re(e,i,a){let o=n(i,a.fixedLines);return a.estimatedLines===null?e.keptOutPending(o):e.keptOutEstimated(o,t(i,a.estimatedLines,r(a.estimatedLines)))}function ie({weeks:e,days:t,windows:n,totals:r}){let{stats:i}=c(),{grain:a,periods:o,period:s,toggle:l}=L(`effect`,`week`,{week:e,day:t},n);return(0,H.jsx)(p,{title:i.effectTitle,period:s,aside:l,children:(0,H.jsx)(Q,{periods:o,totals:r,grain:a})})}function ae({projects:e,period:a}){let{stats:o}=c(),l=i(),u=m();return(0,H.jsx)(p,{title:o.byProject,period:u.labelled(o.effectWindow,a),children:e.length===0?(0,H.jsx)(`p`,{className:g.muted,children:o.noCodeData}):(0,H.jsx)(ee,{label:o.byProject,head:o.projectsHead,rows:e.map(e=>({key:e.projectId,cells:[e.name,e.deferredTasks,n(l,e.fixedLines),e.estimatedLines===null?`—`:t(l,e.estimatedLines,r(e.estimatedLines)),n(l,e.realLines),s(e.noiseShare)]}))})})}function oe(){let{projectId:e}=o(),t=u(e);return(0,H.jsx)(h,{query:t,children:e=>(0,H.jsx)(se,{report:e})})}function se({report:e}){let{stats:t}=c(),n=e.totals.fixedTasks+e.totals.openTasks===0;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(v,{repos:e.unavailableRepos}),n&&(0,H.jsx)(`p`,{className:_.note,children:t.noDeferredTasks}),(0,H.jsx)(te,{totals:e.totals,period:e.periods.weeks}),(0,H.jsxs)(`div`,{className:_.blocks,children:[(0,H.jsx)(`div`,{className:g.wide,children:(0,H.jsx)(ie,{weeks:e.weeks,days:e.days,windows:e.periods,totals:e.totals})}),(0,H.jsx)(`div`,{className:g.wide,children:(0,H.jsx)(ae,{projects:e.projects,period:e.periods.weeks})}),(0,H.jsx)(`div`,{className:g.wide,children:(0,H.jsx)(U,{totals:e.totals})})]})]})}export{oe as EffectTab};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{cn as t,ln as n,t as r}from"./cx-CutaZ2Ho.js";import{t as i}from"./StatsPage.module-DxtnhZOJ.js";var a=e(n(),1),o=t(),s={growth:i.growth,decline:i.decline};function c({label:e,value:t,note:n,tone:c,trend:l}){let u=(0,a.useId)();return(0,o.jsxs)(`div`,{className:i.figure,role:`group`,"aria-labelledby":u,children:[(0,o.jsx)(`span`,{id:u,className:i.figureLabel,children:e}),(0,o.jsx)(`span`,{className:r(i.figureValue,c!==void 0&&s[c]),children:t}),l!==void 0&&(0,o.jsxs)(`span`,{className:r(i.figureTrend,s[l.tone]),children:[(0,o.jsx)(`span`,{"aria-hidden":`true`,children:l.text}),(0,o.jsx)(`span`,{className:`visually-hidden`,children:l.speech})]}),n!==void 0&&(0,o.jsx)(`span`,{className:i.figureNote,children:n})]})}function l({period:e,children:t}){let n=(0,a.useId)();return(0,o.jsxs)(`div`,{role:`group`,"aria-labelledby":n,className:i.figureGroup,children:[(0,o.jsx)(`p`,{id:n,className:i.note,children:e}),(0,o.jsx)(`div`,{className:i.totals,children:t})]})}export{l as n,c as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{B as t,L as n,O as r,R as i,cn as a,ft as o,h as s,k as c,ln as l,t as u}from"./cx-CutaZ2Ho.js";import{d,x as f}from"./index-CM8tBSED.js";import{c as p,u as m}from"./start-Cm2kfqW8.js";import{a as h,i as g,n as _,r as v}from"./StatsTabState-BauB3xdU.js";import{t as ee}from"./ShareBar-CoTArw6Q.js";import{t as y}from"./StatsPage.module-DxtnhZOJ.js";import{t as b}from"./Figure-DAdnR-Fu.js";import{B as x,C as S,_ as C,a as w,c as T,d as E,g as D,h as O,i as k,l as A,n as j,o as M,p as N,s as P,t as F}from"./use-grain-panel-BczBScgN.js";import{n as I,r as L,t as te}from"./value-dot-Dy8YzPPT.js";var R={columns:`_columns_1m2da_1`,countList:`_countList_1m2da_7`,ageRows:`_ageRows_1m2da_11`,ageRow:`_ageRow_1m2da_11`,ageLabel:`_ageLabel_1m2da_25`,ageTrack:`_ageTrack_1m2da_29`,ageSegment:`_ageSegment_1m2da_37`,legend:`_legend_1m2da_41`,legendItem:`_legendItem_1m2da_50`,share:`_share_1m2da_61`,critical:`_critical_1m2da_65`,high:`_high_1m2da_69`,medium:`_medium_1m2da_73`,low:`_low_1m2da_77`,done:`_done_1m2da_81`,fixed:`_fixed_1m2da_85`,obsolete:`_obsolete_1m2da_89`,duplicate:`_duplicate_1m2da_93`,cancelled:`_cancelled_1m2da_97`,unknown:`_unknown_1m2da_101`,shareBar:`_shareBar_1m2da_105`,alarm:`_alarm_1m2da_117`,alarmOn:`_alarmOn_1m2da_123`},z=a();function ne(e,n){let r=[...t].reverse().filter(e=>n[e]>0).map(t=>`${e.priorityCounts[t]} ${n[t]}`);return r.length===0?``:` (${r.join(`, `)})`}function B({age:e}){let{stats:n,core:r}=c(),i=e.buckets.map(({bucket:e,byPriority:n})=>({bucket:e,total:f(t.map(e=>n[e])),byPriority:n})),a=Math.max(1,...i.map(({total:e})=>e)),o=i.map(({bucket:e,total:t,byPriority:r})=>`${n.ageBuckets[e]}: ${t}${ne(n,r)}`).join(`; `);return(0,z.jsxs)(h,{title:n.openAge,period:n.periodNow,children:[(0,z.jsx)(`div`,{role:`img`,"aria-label":o,className:R.ageRows,children:i.map(({bucket:e,total:r,byPriority:i})=>(0,z.jsxs)(`div`,{className:R.ageRow,"aria-hidden":`true`,children:[(0,z.jsx)(`span`,{className:R.ageLabel,children:n.ageBuckets[e]}),(0,z.jsx)(`span`,{className:R.ageTrack,children:t.map(e=>(0,z.jsx)(`span`,{className:u(R.ageSegment,R[e]),style:{width:`${i[e]/a*100}%`}},e))}),(0,z.jsx)(`span`,{className:v.rowValue,children:r})]},e))}),(0,z.jsx)(`p`,{className:R.legend,children:[...t].reverse().map(e=>(0,z.jsx)(`span`,{className:u(R.legendItem,R[e]),children:r.priorityLabel(e)},e))}),(0,z.jsx)(`p`,{className:u(R.alarm,e.urgentStale>0&&R.alarmOn),children:n.urgentStale(e.urgentStale)})]})}var V=[`done`,`fixed`,`obsolete`,`duplicate`,`cancelled`,`unknown`];function H(e,{stats:t,core:n}){return e===`done`||e===`cancelled`||e===`unknown`?t.closingReasons[e]:n.resolutionLabel(e)}function re({closing:e,period:t}){let r=c(),i=g(),{stats:a}=r,o=f(V.map(t=>e.byReason[t])),s=V.map(t=>`${H(t,r)}: ${e.byReason[t]}`).join(`; `);return(0,z.jsxs)(h,{title:a.closing,period:i.of(`weeks`,t),children:[(0,z.jsx)(`div`,{role:`img`,"aria-label":s,className:R.shareBar,children:V.map(t=>(0,z.jsx)(`span`,{className:u(R.share,R[t]),style:{width:o===0?0:`${e.byReason[t]/o*100}%`}},t))}),(0,z.jsx)(`ul`,{className:v.rows,children:V.map(t=>(0,z.jsxs)(`li`,{className:v.row,children:[(0,z.jsx)(`span`,{className:u(R.legendItem,R[t]),children:H(t,r)}),(0,z.jsx)(`span`,{className:v.rowValue,children:e.byReason[t]})]},t))}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`h3`,{className:v.subTitle,children:a.noiseAndReopens}),(0,z.jsxs)(`ul`,{className:v.rows,children:[(0,z.jsx)(U,{label:a.duplicatesAmongClosed,value:n(e.duplicateShare)}),(0,z.jsx)(U,{label:a.noSourceAmongCreated,value:n(e.withoutSourceShare)}),(0,z.jsx)(U,{label:a.reopened,value:e.reopened})]})]})]})}function U({label:e,value:t}){return(0,z.jsxs)(`li`,{className:v.row,children:[(0,z.jsx)(`span`,{className:v.rowLabel,children:e}),(0,z.jsx)(`span`,{className:v.rowValue,children:t})]})}var ie=`↓`,W=`↑`;function G(e,t,n){if(t===null||n===null)return;let r=t-n;if(r===0)return;let i=r<0,a=String(Math.abs(r));return{text:e.weekTrend(i?ie:W,a),speech:e.weekTrendSpeech(a,i),tone:i?`decline`:`growth`}}function K({hotspots:e,listPath:t}){let{stats:n}=c();return(0,z.jsx)(h,{title:n.hotspots,period:n.periodNow,children:(0,z.jsxs)(`div`,{className:R.columns,children:[(0,z.jsx)(q,{title:n.folders,empty:n.noSourceFolders,items:e.folders.map(({label:e,count:t})=>({key:e,label:(0,z.jsx)(`code`,{children:e}),count:t}))}),(0,z.jsx)(q,{title:n.tags,empty:n.noTags,items:e.tags.map(({tag:e,count:n})=>({key:e,label:(0,z.jsxs)(m,{to:{pathname:t,search:`tag=${encodeURIComponent(e)}`},children:[`#`,e]}),count:n}))})]})})}function q({title:e,empty:t,items:n}){let r=Math.max(1,...n.map(e=>e.count));return(0,z.jsxs)(`div`,{className:R.countList,children:[(0,z.jsx)(`h3`,{className:v.subTitle,children:e}),n.length===0?(0,z.jsx)(`p`,{className:v.muted,children:t}):(0,z.jsx)(`ul`,{className:v.rows,children:n.map(e=>(0,z.jsxs)(`li`,{className:v.countRow,children:[(0,z.jsx)(`span`,{className:v.rowLabel,children:e.label}),(0,z.jsx)(`span`,{className:v.rowValue,children:e.count}),(0,z.jsx)(ee,{share:e.count/r})]},e.key))})]})}var J=e(l(),1),Y=`var(--chart-bar-neutral)`,X=`var(--chart-bar-green)`,Z=`var(--chart-line-bright)`;function ae(e,t,n){return j(r=>({title:e.periodOf(n,d(t,r.start)),rows:[{label:e.flowCreated,value:String(r.created),shape:`bar`,color:Y},{label:e.flowClosed,value:String(r.closed),shape:`bar`,color:X},{label:e.flowOpen,value:String(r.openAtEnd),shape:`line`,color:Z}]}))}function oe({weeks:e,days:t,windows:n}){let{stats:i}=c(),a=r(),{grain:o,periods:s,period:l,toggle:u}=F(`flow`,`week`,{week:e,day:t},n),d=(0,J.useMemo)(()=>ae(i,a,o),[i,a,o]),p=[{label:i.flowCreated,shape:`bar`,color:Y},{label:i.flowClosed,shape:`bar`,color:X},{label:i.flowOpenAtEnd[o],shape:`line`,color:Z}],m=i.debtBy[o],g=i.flowSummary({grain:o,periodCount:s.length,created:f(s.map(e=>e.created)),closed:f(s.map(e=>e.closed)),openNow:s.at(-1)?.openAtEnd??0}),_=e=>E(a,e);return(0,z.jsx)(h,{title:m,period:l,aside:u,children:(0,z.jsx)(N,{summary:g,legend:p,children:(0,z.jsxs)(I,{data:s,margin:M,"aria-label":i.chartLabel(m,o),children:[(0,z.jsx)(S,{vertical:!1}),(0,z.jsx)(D,{dataKey:`start`,tickFormatter:e=>A(a,e),...P}),(0,z.jsx)(O,{yAxisId:`flow`,allowDecimals:!1,tickFormatter:_,width:60,...k}),(0,z.jsx)(O,{yAxisId:`open`,orientation:`right`,allowDecimals:!1,tickFormatter:_,width:60,...k}),(0,z.jsx)(x,{content:d,...T}),(0,z.jsx)(C,{yAxisId:`flow`,dataKey:`created`,fill:Y,radius:w,isAnimationActive:!1}),(0,z.jsx)(C,{yAxisId:`flow`,dataKey:`closed`,fill:X,radius:w,isAnimationActive:!1}),(0,z.jsx)(L,{yAxisId:`open`,dataKey:`openAtEnd`,stroke:Z,strokeWidth:3,dot:te(Z),isAnimationActive:!1})]})})})}var Q=`var(--chart-bar-warm)`;function se(e,t,n,r){return j(i=>({title:e.periodOf(r,d(n,i.start)),rows:[{label:e.flowCreated,value:t.count(i.created,`task`),shape:`bar`,color:Q}]}))}function $({weeks:e,days:t,windows:n}){let{stats:i,core:a}=c(),o=r(),{grain:s,periods:l,period:u,toggle:d}=F(`intake`,`day`,{week:e,day:t},n),p=(0,J.useMemo)(()=>se(i,a,o,s),[i,a,o,s]),m=[{label:i.createdTasks,shape:`bar`,color:Q}],g=i.createdBy[s];return(0,z.jsx)(h,{title:g,period:u,aside:d,children:(0,z.jsx)(N,{summary:i.intakeSummary(s,l.length,f(l.map(e=>e.created))),legend:m,children:(0,z.jsxs)(I,{data:l,margin:M,"aria-label":i.chartLabel(g,s),children:[(0,z.jsx)(S,{vertical:!1}),(0,z.jsx)(D,{dataKey:`start`,tickFormatter:e=>A(o,e),...P}),(0,z.jsx)(O,{allowDecimals:!1,tickFormatter:e=>E(o,e),width:60,...k}),(0,z.jsx)(x,{content:p,...T}),(0,z.jsx)(C,{dataKey:`created`,fill:Q,radius:w,isAnimationActive:!1})]})})})}function ce(){let{projectId:e}=o(),t=s(e);return(0,z.jsx)(_,{query:t,children:t=>(0,z.jsx)(le,{report:t,taskListPath:p(e)})})}function le({report:e,taskListPath:t}){return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(ue,{totals:e.totals}),(0,z.jsxs)(`div`,{className:y.blocks,children:[(0,z.jsx)(oe,{weeks:e.weeks,days:e.days,windows:e.periods}),(0,z.jsx)($,{weeks:e.weeks,days:e.days,windows:e.periods}),(0,z.jsx)(K,{hotspots:e.hotspots,listPath:t}),(0,z.jsx)(B,{age:e.age}),(0,z.jsx)(re,{closing:e.closing,period:e.periods.weeks})]})]})}function ue({totals:e}){let{stats:t}=c(),n=e.createdLastWeek-e.closedLastWeek,r=e.previous;return(0,z.jsxs)(`div`,{className:u(y.totals,y.totalsPair),children:[(0,z.jsx)(b,{label:t.tasksToday,value:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`span`,{className:e.createdToday>0?y.growth:void 0,children:[`+`,e.createdToday]}),` `,(0,z.jsxs)(`span`,{className:e.closedToday>0?y.decline:void 0,children:[`−`,e.closedToday]})]}),note:t.createdAndClosed}),(0,z.jsx)(b,{label:t.thisWeek,value:i(n),tone:de(n),note:t.weekNote(e.createdLastWeek,e.closedLastWeek),trend:G(t,n,r?.net??null)})]})}function de(e){if(e>0)return`growth`;if(e<0)return`decline`}export{ce as OverviewTab};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{L as t,O as n,cn as r,ft as i,k as a,ln as o,u as s}from"./cx-CutaZ2Ho.js";import{d as c,x as l}from"./index-CM8tBSED.js";import{a as u,i as d,n as f,r as p}from"./StatsTabState-BauB3xdU.js";import{t as m}from"./StatsPage.module-DxtnhZOJ.js";import{t as h}from"./StatsTable-Dg0CrPof.js";import{B as g,C as _,_ as v,a as y,c as b,g as x,h as S,i as C,l as w,n as T,o as E,p as D,s as O,t as k}from"./use-grain-panel-BczBScgN.js";import{n as A,r as j,t as M}from"./value-dot-Dy8YzPPT.js";var N=e(o(),1),P=r(),F=`var(--chart-bar-neutral)`,I=`var(--chart-line-green)`;function L(e,n,r){return T(i=>({title:e.periodOf(r,c(n,i.start)),rows:[{label:e.decidedCandidates,value:String(i.decided),shape:`bar`,color:F},{label:e.precision,value:t(i.precision),shape:`line`,color:I}]}))}function R({periods:e,grain:r}){let{stats:i}=a(),o=n(),s=(0,N.useMemo)(()=>L(i,o,r),[i,o,r]),c=[{label:i.decidedCandidates,shape:`bar`,color:F},{label:i.precision,shape:`line`,color:I}],u=l(e.map(e=>e.decided)),d=e.filter(e=>e.precision!==null).at(-1),f=i.accuracySummary({grain:r,periodCount:e.length,decided:u,latestPrecision:d===void 0?null:t(d.precision)});return(0,P.jsx)(D,{summary:f,legend:c,children:(0,P.jsxs)(A,{data:e,margin:E,"aria-label":i.chartLabel(i.accuracyTitle,r),children:[(0,P.jsx)(_,{vertical:!1}),(0,P.jsx)(x,{dataKey:`start`,tickFormatter:e=>w(o,e),...O}),(0,P.jsx)(S,{yAxisId:`decided`,allowDecimals:!1,width:60,...C}),(0,P.jsx)(S,{yAxisId:`precision`,orientation:`right`,domain:[0,1],tickFormatter:t,width:60,...C}),(0,P.jsx)(g,{content:s,...b}),(0,P.jsx)(v,{yAxisId:`decided`,dataKey:`decided`,fill:F,radius:y,isAnimationActive:!1}),(0,P.jsx)(j,{yAxisId:`precision`,type:`monotone`,dataKey:`precision`,stroke:I,strokeWidth:3,connectNulls:!0,dot:M(I),isAnimationActive:!1})]})})}function z({rows:e,weeks:n,days:r,windows:i,methodRows:o,matchRows:s}){let{stats:c,core:l}=a(),f=d(),{grain:m,periods:g,period:_,toggle:v}=k(`accuracy`,`week`,{week:n,day:r},i),y=f.of(`weeks`,i.weeks),b=e=>e===`source-changed`?o.map(e=>B(c,e,e.by===`unknown`?c.beforeMethodRecorded:c.checkedBy(l.checkMethodLabel(e.by)))):e===`duplicate`?s.map(e=>B(c,e,e.by===`unknown`?c.beforeMatchRecorded:c.matchedBy(l.duplicateMatchLabel(e.by)))):[];return(0,P.jsx)(u,{title:c.accuracyTitle,period:_,aside:e.length===0?void 0:v,children:e.length===0?(0,P.jsx)(`p`,{className:p.muted,children:c.noCandidates}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`p`,{className:p.muted,children:c.accuracyHint}),(0,P.jsx)(R,{periods:g,grain:m}),(0,P.jsx)(`p`,{className:p.muted,children:y}),(0,P.jsx)(h,{label:c.accuracyTable(y),head:c.accuracyHead,rows:e.flatMap(e=>[{key:e.evidence,tone:e.evidence===`total`?`total`:void 0,cells:[l.evidenceLabel(e.evidence),e.candidates,e.closed,e.verified,e.open,t(e.precision)]},...b(e.evidence).map(t=>({...t,key:`${e.evidence}-${t.key}`}))])})]})})}function B(e,n,r){return{key:n.by,tone:`child`,cells:[e.splitRow(r),n.candidates,n.closed,n.verified,n.open,t(n.precision)]}}function V({graph:e,period:t}){let{stats:n,core:r}=a(),i=d(),{projects:o,filter:s}=e;return s.filtered===0&&o.every(e=>e.state===`none`)?(0,P.jsx)(u,{title:n.graphTitle,children:(0,P.jsx)(`p`,{className:p.muted,children:n.graphMissing(e=>(0,P.jsx)(`code`,{children:e},e))})}):(0,P.jsxs)(u,{title:n.graphTitle,children:[(0,P.jsx)(`p`,{className:p.muted,children:n.graphHint}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h3`,{className:p.subTitle,children:i.labelled(n.filteredTitle,t)}),s.filtered===0?(0,P.jsx)(`p`,{className:p.muted,children:n.nothingFiltered}):(0,P.jsx)(h,{label:n.filteredTable,head:n.filteredHead,rows:[{key:`filtered`,cells:[n.filteredByGraph,s.filtered]},{key:`caught`,cells:[n.filteredCaught,s.caught]},{key:`missed`,cells:[n.filteredMissed,s.missed]},{key:`quiet`,cells:[n.filteredQuiet,s.quiet]}]})]}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h3`,{className:p.subTitle,children:n.periodCaption(n.projects,n.periodNow)}),(0,P.jsx)(h,{label:n.graphByProject,head:n.graphHead,rows:o.map(e=>({key:e.projectId,cells:[e.name,r.graphStateLabel(e.state),e.pinned,H(e)]}))})]})]})}function H({state:e,pinned:n,resolved:r}){return e===`none`||e===`unreadable`?`—`:`${r} (${t(n===0?null:r/n)})`}function U({rows:e,period:t}){let{stats:n,core:r}=a(),i=d(),o=e=>e.category===`unknown`?n.categoryUnknown:r.categoryLabel(e.category??void 0);return(0,P.jsx)(u,{title:n.categoriesTitle,period:i.of(`weeks`,t),children:e.length===0?(0,P.jsx)(`p`,{className:p.muted,children:n.categoriesEmpty}):(0,P.jsx)(h,{label:n.categoriesTitle,head:n.categoriesHead,rows:e.map(e=>({key:e.category??`none`,cells:[o(e),e.open,e.weight,e.created,e.closed]}))})})}function W({found:e,branches:t,period:n}){let{stats:r}=a(),i=d(),o=e=>e.found===null?r.foundNotRecorded:e.found===`unknown`?r.foundUnknown:r.foundLabels[e.found];return(0,P.jsxs)(u,{title:r.originTitle,period:i.of(`weeks`,n),children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h3`,{className:p.subTitle,children:r.foundTitle}),(0,P.jsx)(h,{label:r.foundTitle,head:r.foundHead,rows:e.map(e=>({key:e.found??`not-recorded`,cells:[o(e),e.created,e.open,e.fixed]}))})]}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h3`,{className:p.subTitle,children:r.branchesTitle}),t.length===0?(0,P.jsx)(`p`,{className:p.muted,children:r.branchesEmpty}):(0,P.jsx)(h,{label:r.branchesTitle,head:r.branchesHead,rows:t.map(e=>({key:e.label,cells:[(0,P.jsx)(`code`,{children:e.label}),e.created,e.open]}))})]})]})}function G(){let{projectId:e}=i(),t=s(e);return(0,P.jsx)(f,{query:t,children:e=>(0,P.jsx)(K,{report:e})})}function K({report:e}){return(0,P.jsxs)(`div`,{className:m.blocks,children:[(0,P.jsx)(`div`,{className:p.wide,children:(0,P.jsx)(z,{rows:e.accuracy,weeks:e.accuracyWeeks,days:e.accuracyDays,windows:e.periods,methodRows:e.methodAccuracy,matchRows:e.matchAccuracy})}),(0,P.jsx)(`div`,{className:p.wide,children:(0,P.jsx)(V,{graph:e.graph,period:e.periods.weeks})}),(0,P.jsx)(`div`,{className:p.wide,children:(0,P.jsx)(U,{rows:e.categories,period:e.periods.weeks})}),(0,P.jsx)(`div`,{className:p.wide,children:(0,P.jsx)(W,{found:e.found,branches:e.branches,period:e.periods.weeks})})]})}export{G as QualityTab};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as e}from"./cx-CutaZ2Ho.js";import{r as t}from"./StatsTabState-BauB3xdU.js";var n=e();function r({share:e}){return(0,n.jsx)(`span`,{className:t.track,"aria-hidden":`true`,children:(0,n.jsx)(`span`,{className:t.fill,style:{transform:`scaleX(${e})`}})})}export{r as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{Ft as t,cn as n,ft as r,k as i,l as a,ln as o,lt as s,m as c,ot as l,t as u}from"./cx-CutaZ2Ho.js";import{a as d,d as f,i as p,l as m,o as h,t as g,u as _}from"./start-Cm2kfqW8.js";import{t as v}from"./StatsPage.module-DxtnhZOJ.js";var y=e(o(),1),b=n();function x(){let{projectId:e}=r(),{pathname:n}=l(),o=a(),x=c(e),{app:S,core:C,stats:w}=i(),T=e===void 0?w.projects:d(o.data,e),E=w.heading(T),D=m(e),O=e=>e===``?D:`${D}/${e}`,k=(e,n)=>t({path:O(e),end:!0},n)!==null,A=g.find(e=>e.segment!==``&&k(e.segment,n))??g[0],j=s().location?.pathname,M=(0,y.useRef)(null),N=j===void 0?void 0:g.find(e=>k(e.segment,j)),P=w.docTitle(A.segment===``?E:`${w.tabs[A.key]} · ${E}`);return p(P),(0,b.jsxs)(`main`,{id:`content`,tabIndex:-1,className:v.page,"aria-busy":N!==void 0||void 0,children:[(0,b.jsx)(`h1`,{ref:M,tabIndex:-1,className:v.heading,children:E}),e===void 0&&o.data!==void 0&&(0,b.jsx)(`p`,{className:v.scopeNote,children:h(o.data,S)}),(x.data?.signals.length??0)>0&&(0,b.jsxs)(`div`,{className:v.signals,role:`status`,"aria-labelledby":`stats-signals-heading`,children:[(0,b.jsx)(`strong`,{id:`stats-signals-heading`,className:v.signalsTitle,children:w.alerts}),(0,b.jsx)(`ul`,{children:x.data?.signals.map(e=>(0,b.jsx)(`li`,{children:C.signal(e)},e.kind))})]}),(0,b.jsx)(`nav`,{className:v.tabs,"aria-label":w.tabsLabel,children:g.map(e=>(0,b.jsx)(_,{to:O(e.segment),className:u(v.tab,e===A&&v.tabActive,e===N&&v.tabPending),"aria-current":e===A?`page`:void 0,children:w.tabs[e.key]},e.key))}),(0,b.jsx)(f,{context:{heading:M}})]})}export{x as StatsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{O as t,T as n,
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{O as t,T as n,cn as r,dt as i,k as a,ln as o,t as s}from"./cx-CutaZ2Ho.js";import{l as c,p as l}from"./index-CM8tBSED.js";import{r as u,s as d}from"./start-Cm2kfqW8.js";import{t as f}from"./StatsPage.module-DxtnhZOJ.js";var p=e(o(),1),m={panel:`_panel_1n3ez_1`,head:`_head_1n3ez_14`,heading:`_heading_1n3ez_22`,period:`_period_1n3ez_29`,title:`_title_1n3ez_35`},h=r();function g({title:e,period:t,aside:n,children:r}){let i=(0,p.useId)(),a=(0,p.useId)();return(0,h.jsxs)(`section`,{className:m.panel,"aria-labelledby":i,"aria-describedby":t===void 0?void 0:a,children:[(0,h.jsxs)(`div`,{className:m.head,children:[(0,h.jsxs)(`div`,{className:m.heading,children:[(0,h.jsx)(`h2`,{id:i,className:m.title,children:e}),t!==void 0&&(0,h.jsx)(`p`,{id:a,className:m.period,children:t})]}),n]}),r]})}function _(){let{stats:e}=a(),n=t(),r=(t,r)=>e.periodCaption(t,l(n,r.from,r.to)),i=(t,n)=>r(e.periodWindows[t],n);return{of:i,ofGrain:(e,t)=>e===`week`?i(`weeks`,t.weeks):i(`days`,t.days),labelled:r}}var v={muted:`_muted_14ll2_1`,subTitle:`_subTitle_14ll2_7`,rows:`_rows_14ll2_14`,countRow:`_countRow_14ll2_28`,row:`_row_14ll2_14`,rowLabel:`_rowLabel_14ll2_41`,rowValue:`_rowValue_14ll2_58`,wide:`_wide_14ll2_64`,track:`_track_14ll2_68`,fill:`_fill_14ll2_75`,grain:`_grain_14ll2_82`};function y({query:e,empty:t,children:r}){let{stats:o}=a(),{error:c,data:l,isFetching:p}=e,m=l!==void 0,g=c instanceof n&&c.status===404,_=g?null:c,v=c===null&&!m,y=l!==void 0&&t!==void 0&&t.isEmpty(l),b=x(o,c,g,m,y?t.message:null),{status:S,keepFocus:C}=u(b===null&&_===null,i()?.heading);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(`div`,{ref:S,tabIndex:-1,role:`status`,"aria-live":`polite`,className:b===null&&_===null?`visually-hidden`:s(f.hint,v&&f.hintLoading),children:[b!==null&&(0,h.jsx)(`p`,{children:b}),_!==null&&(0,h.jsx)(d,{error:_,fetching:p,onRetry:()=>{C(),e.refetch()}})]}),!g&&l!==void 0&&!y&&(0,h.jsx)(`div`,{className:f.content,children:r(l)})]})}function b({query:e,children:n}){let{stats:r}=a(),i=t(),o=e.data?.invalidJournalLines??0,s=e.data?.unknownJournalLines??0,c=e.data?.unparsedTasks??0,l=[o>0?r.invalidJournalLines(o):null,s>0?r.unknownJournalLines(s):null,c>0?r.unparsedTasks(c):null].filter(e=>e!==null);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`p`,{className:l.length>0?f.warning:`visually-hidden`,role:`status`,children:l.join(` `)}),(0,h.jsx)(y,{query:e,empty:{isEmpty:e=>e.taskCount===0,message:r.noTasks},children:e=>(0,h.jsxs)(h.Fragment,{children:[n(e),(0,h.jsx)(`p`,{className:f.note,children:S(r,i,e.journalSince)})]})})]})}function x(e,t,n,r,i){return n?e.projectNotFound:t===null?r?i:e.loading:null}function S(e,t,n){return n===null?e.journalEmpty:e.journalSince(c(t,n))}export{g as a,_ as i,b as n,v as r,y as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{O as e,
|
|
1
|
+
import{O as e,cn as t,k as n}from"./cx-CutaZ2Ho.js";import{g as r}from"./index-CM8tBSED.js";var i={scroll:`_scroll_14ae0_1`,table:`_table_14ae0_14`,child:`_child_14ae0_45`,total:`_total_14ae0_49`},a=t();function o({label:t,head:o,rows:s}){let{stats:c}=n(),l=e(),u=e=>typeof e==`number`?r(l,e):e;return(0,a.jsx)(`div`,{className:i.scroll,tabIndex:0,role:`region`,"aria-label":c.tableLabel(t),children:(0,a.jsxs)(`table`,{className:i.table,children:[(0,a.jsx)(`thead`,{children:(0,a.jsx)(`tr`,{children:o.map(e=>(0,a.jsx)(`th`,{scope:`col`,children:e},e))})}),(0,a.jsx)(`tbody`,{children:s.map(e=>(0,a.jsx)(`tr`,{className:e.tone&&i[e.tone],children:e.cells.map((e,t)=>t===0?(0,a.jsx)(`th`,{scope:`row`,children:u(e)},o[t]):(0,a.jsx)(`td`,{children:u(e)},o[t]))},e.key))})]})})}export{o as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as e,k as t}from"./cx-CutaZ2Ho.js";import{t as n}from"./StatsPage.module-DxtnhZOJ.js";var r=e();function i({repos:e}){let{stats:i}=t();return e.map(e=>(0,r.jsx)(`p`,{className:n.warning,role:`status`,children:i.unavailableRepo(e)},e))}export{i as t};
|