2026-08-08 23:37:40 +00:00
|
|
|
{
|
|
|
|
|
"name": "mega-infrastructure-dashboard",
|
|
|
|
|
"version": "1.0.0",
|
|
|
|
|
"private": true,
|
|
|
|
|
"scripts": {
|
2026-08-18 22:14:47 +00:00
|
|
|
"dev": "next dev -H 0.0.0.0 -p 6004 --webpack",
|
2026-08-30 20:22:42 +00:00
|
|
|
"build": "npm run icons && npm run og-image && next build --webpack",
|
|
|
|
|
"icons": "node scripts/build-icons.mjs",
|
2026-08-09 18:01:13 +00:00
|
|
|
"og-image": "node scripts/build-og-image.mjs",
|
2026-08-08 23:37:40 +00:00
|
|
|
"start": "next start -H 0.0.0.0 -p 3000",
|
2026-09-25 20:04:08 +00:00
|
|
|
"lint": "eslint .",
|
2026-08-08 23:37:40 +00:00
|
|
|
"typecheck": "tsc --noEmit",
|
2026-08-19 00:21:36 +00:00
|
|
|
"test": "vitest",
|
|
|
|
|
"test:run": "vitest run",
|
2026-08-29 18:25:39 +00:00
|
|
|
"mcp": "tsx --env-file=.env.local src/mcp/server.ts",
|
2026-08-08 23:37:40 +00:00
|
|
|
"postinstall": "node scripts/patch-next-dev-blocker.cjs"
|
|
|
|
|
},
|
|
|
|
|
"dependencies": {
|
2026-08-29 18:41:30 +00:00
|
|
|
"@anthropic-ai/sdk": "^0.122.0",
|
2026-08-08 23:37:40 +00:00
|
|
|
"@ducanh2912/next-pwa": "^10.2.9",
|
2026-08-29 18:25:39 +00:00
|
|
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
2026-08-26 13:33:30 +00:00
|
|
|
"@n8n/workflow-sdk": "^0.29.3",
|
2026-08-08 23:37:40 +00:00
|
|
|
"@radix-ui/react-dialog": "^1.1.4",
|
|
|
|
|
"@radix-ui/react-dropdown-menu": "^2.1.4",
|
|
|
|
|
"@radix-ui/react-label": "^2.1.1",
|
|
|
|
|
"@radix-ui/react-select": "^2.1.4",
|
|
|
|
|
"@radix-ui/react-slot": "^1.1.1",
|
|
|
|
|
"@radix-ui/react-tabs": "^1.1.2",
|
|
|
|
|
"@radix-ui/react-tooltip": "^1.1.6",
|
|
|
|
|
"@tanstack/react-table": "^8.20.6",
|
|
|
|
|
"class-variance-authority": "^0.7.1",
|
|
|
|
|
"clsx": "^2.1.1",
|
|
|
|
|
"date-fns": "^4.1.0",
|
fix: harden workforce, plant and financials
Improve workforce scanning, site transfers and timesheet exports.
Audit plant imports, duplicate identities, rates and dashboard totals.
Repair delivery PO selection, periodic rechecks and receiving guards.
Align financial ledgers, supplier periods and mobile layouts.
Add the site map preview, shared theme controls and audit evidence.
Verify 3,455 application tests, six fuel export tests, TypeScript and
an optimized production build. Clean up a leaked test timer and keep
local worktrees and generated reports out of ESLint traversal.
Changed-file lint passes; repository-wide lint retains 33 existing
errors in unchanged files.
2026-10-19 11:18:31 +00:00
|
|
|
"exceljs": "^4.4.0",
|
2026-09-11 22:13:13 +00:00
|
|
|
"jsqr": "^1.4.0",
|
2026-09-22 19:39:25 +00:00
|
|
|
"leaflet": "^1.9.4",
|
|
|
|
|
"leaflet.markercluster": "^1.5.3",
|
2026-08-08 23:37:40 +00:00
|
|
|
"lucide-react": "^0.469.0",
|
|
|
|
|
"next": "^16",
|
2026-08-29 18:41:30 +00:00
|
|
|
"openai": "^7.8.0",
|
2026-08-08 23:37:40 +00:00
|
|
|
"papaparse": "^5.4.1",
|
2026-09-17 11:42:11 +00:00
|
|
|
"pdf-lib": "^1.17.1",
|
feat(reports): add a real, server-side PDF builder
Replaces Ask's screenshot-then-wrap PDFs with an actual PDF pipeline
that runs in plain Node (no Chromium/Puppeteer, Alpine-safe): pdfmake
draws real text, real tables (zebra rows, right-aligned numbers, a
repeated header row across a page break) and vector charts (bar,
stacked bar, line, area, donut) built from ChartSpec as hand-rolled
SVG, using pdfkit's standard 14 fonts so no font files ship at all.
Chosen over @react-pdf/renderer for its native repeated-table-header
support, which that library only gets via manual pagination.
- chart-svg.ts: ChartSpec -> drawing plan (bar count, axis max) -> SVG.
- markdown-blocks.ts: GFM markdown -> headings/paragraphs/lists/tables.
- table-content.ts / kpi-content.ts / chart-content.ts / image-content.ts:
the pdfmake content nodes for each piece.
- chrome.ts: masthead + running header + "Page n of N" footer.
- resolve-section-table.ts: a report section's table, preferring the
cached query_records result (table: { resultId }) so figures are
never hand-copied.
- build.ts: assembles either an answer's markdown or a make_pdf_report
structured document into one PDF.
Verified against real pdftotext/pdftoppm output, including the header
repeating across a page break.
Adds pdfmake, unified, remark-parse (+ @types/pdfmake, @types/pdfkit);
drops html-to-image, whose only caller is removed in a later commit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-27 07:16:20 +00:00
|
|
|
"pdfmake": "^0.2.23",
|
2026-08-18 22:14:47 +00:00
|
|
|
"pocketbase": "^0.27.3",
|
2026-09-11 18:56:29 +00:00
|
|
|
"qrcode": "^1.5.4",
|
2026-08-08 23:37:40 +00:00
|
|
|
"react": "^19.0.0",
|
|
|
|
|
"react-dom": "^19.0.0",
|
2026-09-22 19:39:25 +00:00
|
|
|
"react-leaflet": "^5.0.0",
|
|
|
|
|
"react-leaflet-cluster": "^4.1.3",
|
feat(chat): render answers as dashboard-grade markdown
The models return GFM — tables of vehicles, bold figures, lists — and
the view rendered it as preformatted text, so users saw raw pipes and
asterisks.
Answers now render through react-markdown with every element mapped to
this app's own conventions: tables get the borders, muted header and
hover of components/ui/table.tsx, and numeric columns get tabular-nums
so rand figures line up as they do on the fuel and sites pages.
Alignment is computed per COLUMN, not per cell — the table inspects its
own rows, decides which columns are numeric, and publishes that through
context so a header never ranges left above a right-ranged figure.
Layout: questions are compact chips, answers are full-width documents
with a thin amber rule. Bubbles fight tables. Each answer carries a
provenance strip naming the tools it used — for a tool whose value is
that its numbers reconcile with the dashboard, the source is part of the
answer.
Motion is limited to a streaming caret and the running-tool pulse, both
disabled under motion-reduce.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-29 19:00:35 +00:00
|
|
|
"react-markdown": "^10.1.0",
|
2026-08-08 23:37:40 +00:00
|
|
|
"recharts": "^2.15.0",
|
feat(chat): render answers as dashboard-grade markdown
The models return GFM — tables of vehicles, bold figures, lists — and
the view rendered it as preformatted text, so users saw raw pipes and
asterisks.
Answers now render through react-markdown with every element mapped to
this app's own conventions: tables get the borders, muted header and
hover of components/ui/table.tsx, and numeric columns get tabular-nums
so rand figures line up as they do on the fuel and sites pages.
Alignment is computed per COLUMN, not per cell — the table inspects its
own rows, decides which columns are numeric, and publishes that through
context so a header never ranges left above a right-ranged figure.
Layout: questions are compact chips, answers are full-width documents
with a thin amber rule. Bubbles fight tables. Each answer carries a
provenance strip naming the tools it used — for a tool whose value is
that its numbers reconcile with the dashboard, the source is part of the
answer.
Motion is limited to a streaming caret and the running-tool pulse, both
disabled under motion-reduce.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-29 19:00:35 +00:00
|
|
|
"remark-gfm": "^4.0.1",
|
feat(reports): add a real, server-side PDF builder
Replaces Ask's screenshot-then-wrap PDFs with an actual PDF pipeline
that runs in plain Node (no Chromium/Puppeteer, Alpine-safe): pdfmake
draws real text, real tables (zebra rows, right-aligned numbers, a
repeated header row across a page break) and vector charts (bar,
stacked bar, line, area, donut) built from ChartSpec as hand-rolled
SVG, using pdfkit's standard 14 fonts so no font files ship at all.
Chosen over @react-pdf/renderer for its native repeated-table-header
support, which that library only gets via manual pagination.
- chart-svg.ts: ChartSpec -> drawing plan (bar count, axis max) -> SVG.
- markdown-blocks.ts: GFM markdown -> headings/paragraphs/lists/tables.
- table-content.ts / kpi-content.ts / chart-content.ts / image-content.ts:
the pdfmake content nodes for each piece.
- chrome.ts: masthead + running header + "Page n of N" footer.
- resolve-section-table.ts: a report section's table, preferring the
cached query_records result (table: { resultId }) so figures are
never hand-copied.
- build.ts: assembles either an answer's markdown or a make_pdf_report
structured document into one PDF.
Verified against real pdftotext/pdftoppm output, including the header
repeating across a page break.
Adds pdfmake, unified, remark-parse (+ @types/pdfmake, @types/pdfkit);
drops html-to-image, whose only caller is removed in a later commit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-27 07:16:20 +00:00
|
|
|
"remark-parse": "^11.0.0",
|
2026-09-18 17:07:52 +00:00
|
|
|
"sharp": "^0.35.4",
|
feat(fuel): drop-in xlsx/csv import for pump sheets
The Aug 2026 pump sheet from The Hills (and any future sheet from
the same source) uses different column names and a different date
format than the legacy CSV the import route was built for. Adapts
the route so the same endpoint accepts either Excel (.xlsx) or CSV,
maps the new column names onto the existing FUEL_LOGS schema, and
persists their 'Latest Consumption' column verbatim.
What's new
• SheetJS (xlsx) replaces PapaParse for parsing. Single code path
handles both .xlsx and .csv uploads.
• Resolves columns case-insensitively against an alias table so
legacy CSVs (vehicle_description, odo_reading) still work
alongside the new shape (Date Logged, Vehicle QR, Km's/ Hours,
Litres Pumped, Current Site, Latest Consumption).
• Date parser: DD/MM/YYYY first (with leading-space tolerance),
falls back to YYYY-MM-DD, then to Excel serial numbers.
• Vehicle match: QR code first (clean identifier in the source
data), falls back to description text for legacy CSV.
• Site match: by sites.name (one round-trip, cached for the
import). project_code is derived from the resolved site; falls
back to the vehicle's project_code.
• Latest Consumption persisted as a new FUEL_LOGS field
(latest_consumption, number, optional). Empty source cells
stay empty rather than getting coerced to 0.
PocketBase change
• scripts/migrations/2026-08-24-fuel-logs-latest-consumption.py
adds the new field. Idempotent; follows the pattern of the
2026-08-19 migration. Run it with PB_ADMIN_EMAIL +
PB_ADMIN_PASSWORD before importing the new sheets, or the
import will fail with 'latest_consumption is not a field'.
UI
• Import button now accepts .xlsx and CSV; SAMPLE_HEADERS +
SAMPLE_OPTIONAL show the new column expectations and the
DD/MM/YYYY date format hint.
• fuel-view.tsx shows a 'Consumption (src)' column on the row
table so operators can eyeball what their fuel team sent
against the app's recomputed variance.
Out of scope (intentionally untouched)
• vehicles, sites, data_import_batches and every other
collection — no schema changes there.
• PO / timesheets / delivery-notes imports.
• fuel/page.tsx business logic (variance calc, vehicle summaries).
Verified
• Dry-run against 'The Hills Diesel 1-24 August.xlsx': 134/134
rows parse cleanly, 0 errors. 12/134 rows correctly carry an
empty Latest Consumption (matches the source).
• vitest: 20/20 fuel-import-parse + 35/35 PO-schema tests pass.
• tsc --noEmit clean.
• One pre-existing failure in
src/app/api/purchase-orders/process-batch/route.test.ts
unrelated to fuel; confirmed failing on main before this change.
2026-08-24 20:03:08 +00:00
|
|
|
"tailwind-merge": "^2.6.0",
|
2026-10-14 05:12:32 +00:00
|
|
|
"three": "0.160.0",
|
feat(reports): add a real, server-side PDF builder
Replaces Ask's screenshot-then-wrap PDFs with an actual PDF pipeline
that runs in plain Node (no Chromium/Puppeteer, Alpine-safe): pdfmake
draws real text, real tables (zebra rows, right-aligned numbers, a
repeated header row across a page break) and vector charts (bar,
stacked bar, line, area, donut) built from ChartSpec as hand-rolled
SVG, using pdfkit's standard 14 fonts so no font files ship at all.
Chosen over @react-pdf/renderer for its native repeated-table-header
support, which that library only gets via manual pagination.
- chart-svg.ts: ChartSpec -> drawing plan (bar count, axis max) -> SVG.
- markdown-blocks.ts: GFM markdown -> headings/paragraphs/lists/tables.
- table-content.ts / kpi-content.ts / chart-content.ts / image-content.ts:
the pdfmake content nodes for each piece.
- chrome.ts: masthead + running header + "Page n of N" footer.
- resolve-section-table.ts: a report section's table, preferring the
cached query_records result (table: { resultId }) so figures are
never hand-copied.
- build.ts: assembles either an answer's markdown or a make_pdf_report
structured document into one PDF.
Verified against real pdftotext/pdftoppm output, including the header
repeating across a page break.
Adds pdfmake, unified, remark-parse (+ @types/pdfmake, @types/pdfkit);
drops html-to-image, whose only caller is removed in a later commit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-27 07:16:20 +00:00
|
|
|
"unified": "^11.0.5",
|
2026-10-27 08:53:29 +00:00
|
|
|
"unpdf": "1.8.1",
|
2026-08-29 18:25:39 +00:00
|
|
|
"xlsx": "^0.18.5",
|
2026-08-29 18:41:30 +00:00
|
|
|
"zod": "^3.25.76",
|
|
|
|
|
"zod-to-json-schema": "^3.25.2"
|
2026-08-08 23:37:40 +00:00
|
|
|
},
|
|
|
|
|
"devDependencies": {
|
2026-08-18 22:14:47 +00:00
|
|
|
"@tailwindcss/postcss": "^4.0.0",
|
feat(management): store planning data in PocketBase with editable income, add job and forecast vs actual chart
Move the Management planning snapshots into PocketBase collections
(plans, projects, per-year project plans, retention, edit log), loaded
with a bundled-JSON fallback. Admins can double-click an income cell to
enter forecast and actual, edit awarded jobs' planned amounts, change
status and costs, and add jobs, with revision checks and an audit trail.
Income chart now shows forecast and invoiced bars with not-yet-started
money stacked in red; Income is in the sidebar. Adds schema and import
scripts, and jsdom/Testing Library dev dependencies for UI tests.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-20 01:04:01 +00:00
|
|
|
"@testing-library/jest-dom": "^7.0.1",
|
|
|
|
|
"@testing-library/react": "^16.3.3",
|
|
|
|
|
"@testing-library/user-event": "^14.6.8",
|
2026-09-22 19:39:25 +00:00
|
|
|
"@types/leaflet": "^1.9.22",
|
2026-08-08 23:37:40 +00:00
|
|
|
"@types/node": "^22.10.5",
|
|
|
|
|
"@types/papaparse": "^5.3.15",
|
feat(reports): add a real, server-side PDF builder
Replaces Ask's screenshot-then-wrap PDFs with an actual PDF pipeline
that runs in plain Node (no Chromium/Puppeteer, Alpine-safe): pdfmake
draws real text, real tables (zebra rows, right-aligned numbers, a
repeated header row across a page break) and vector charts (bar,
stacked bar, line, area, donut) built from ChartSpec as hand-rolled
SVG, using pdfkit's standard 14 fonts so no font files ship at all.
Chosen over @react-pdf/renderer for its native repeated-table-header
support, which that library only gets via manual pagination.
- chart-svg.ts: ChartSpec -> drawing plan (bar count, axis max) -> SVG.
- markdown-blocks.ts: GFM markdown -> headings/paragraphs/lists/tables.
- table-content.ts / kpi-content.ts / chart-content.ts / image-content.ts:
the pdfmake content nodes for each piece.
- chrome.ts: masthead + running header + "Page n of N" footer.
- resolve-section-table.ts: a report section's table, preferring the
cached query_records result (table: { resultId }) so figures are
never hand-copied.
- build.ts: assembles either an answer's markdown or a make_pdf_report
structured document into one PDF.
Verified against real pdftotext/pdftoppm output, including the header
repeating across a page break.
Adds pdfmake, unified, remark-parse (+ @types/pdfmake, @types/pdfkit);
drops html-to-image, whose only caller is removed in a later commit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-27 07:16:20 +00:00
|
|
|
"@types/pdfkit": "^0.17.6",
|
|
|
|
|
"@types/pdfmake": "^0.3.3",
|
2026-09-11 18:56:29 +00:00
|
|
|
"@types/qrcode": "^1.5.6",
|
2026-08-08 23:37:40 +00:00
|
|
|
"@types/react": "^19.0.2",
|
|
|
|
|
"@types/react-dom": "^19.0.2",
|
2026-10-14 05:12:32 +00:00
|
|
|
"@types/three": "0.160.0",
|
2026-08-08 23:37:40 +00:00
|
|
|
"eslint": "^9.17.0",
|
|
|
|
|
"eslint-config-next": "^16",
|
feat(management): store planning data in PocketBase with editable income, add job and forecast vs actual chart
Move the Management planning snapshots into PocketBase collections
(plans, projects, per-year project plans, retention, edit log), loaded
with a bundled-JSON fallback. Admins can double-click an income cell to
enter forecast and actual, edit awarded jobs' planned amounts, change
status and costs, and add jobs, with revision checks and an audit trail.
Income chart now shows forecast and invoiced bars with not-yet-started
money stacked in red; Income is in the sidebar. Adds schema and import
scripts, and jsdom/Testing Library dev dependencies for UI tests.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-20 01:04:01 +00:00
|
|
|
"jsdom": "^30.1.3",
|
2026-08-08 23:37:40 +00:00
|
|
|
"postcss": "^8.4.49",
|
|
|
|
|
"tailwindcss": "^4.0.0",
|
2026-08-29 18:25:39 +00:00
|
|
|
"tsx": "^4.23.12",
|
2026-08-19 00:21:36 +00:00
|
|
|
"typescript": "^5.7.2",
|
|
|
|
|
"vitest": "^2.1.9"
|
2026-08-08 23:37:40 +00:00
|
|
|
}
|
|
|
|
|
}
|