@adoptai/genui-components 0.1.32
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/README.md +56 -0
- package/dist/builders/BuilderForm.d.ts +25 -0
- package/dist/builders/BuilderForm.d.ts.map +1 -0
- package/dist/builders/BuilderRecap.d.ts +12 -0
- package/dist/builders/BuilderRecap.d.ts.map +1 -0
- package/dist/builders/ContextSlot.d.ts +6 -0
- package/dist/builders/ContextSlot.d.ts.map +1 -0
- package/dist/builders/EscalationCard.d.ts +12 -0
- package/dist/builders/EscalationCard.d.ts.map +1 -0
- package/dist/builders/FieldRenderer.d.ts +12 -0
- package/dist/builders/FieldRenderer.d.ts.map +1 -0
- package/dist/builders/FormBuilder.d.ts +13 -0
- package/dist/builders/FormBuilder.d.ts.map +1 -0
- package/dist/builders/StepperBuilder.d.ts +20 -0
- package/dist/builders/StepperBuilder.d.ts.map +1 -0
- package/dist/builders/fields.d.ts +27 -0
- package/dist/builders/fields.d.ts.map +1 -0
- package/dist/builders/hooks.d.ts +22 -0
- package/dist/builders/hooks.d.ts.map +1 -0
- package/dist/builders/index.d.ts +20 -0
- package/dist/builders/index.d.ts.map +1 -0
- package/dist/builders/resolver.d.ts +10 -0
- package/dist/builders/resolver.d.ts.map +1 -0
- package/dist/builders/schemas.d.ts +130 -0
- package/dist/builders/schemas.d.ts.map +1 -0
- package/dist/builders/validateBuilder.d.ts +10 -0
- package/dist/builders/validateBuilder.d.ts.map +1 -0
- package/dist/composites/aging-report/resolver.cjs +339 -0
- package/dist/composites/aging-report/resolver.cjs.map +1 -0
- package/dist/composites/aging-report/resolver.d.ts +3 -0
- package/dist/composites/aging-report/resolver.d.ts.map +1 -0
- package/dist/composites/aging-report/resolver.js +337 -0
- package/dist/composites/aging-report/resolver.js.map +1 -0
- package/dist/composites/alert/resolver.cjs +510 -0
- package/dist/composites/alert/resolver.cjs.map +1 -0
- package/dist/composites/alert/resolver.d.ts +3 -0
- package/dist/composites/alert/resolver.d.ts.map +1 -0
- package/dist/composites/alert/resolver.js +508 -0
- package/dist/composites/alert/resolver.js.map +1 -0
- package/dist/composites/allocation-donut/resolver.cjs +363 -0
- package/dist/composites/allocation-donut/resolver.cjs.map +1 -0
- package/dist/composites/allocation-donut/resolver.d.ts +3 -0
- package/dist/composites/allocation-donut/resolver.d.ts.map +1 -0
- package/dist/composites/allocation-donut/resolver.js +361 -0
- package/dist/composites/allocation-donut/resolver.js.map +1 -0
- package/dist/composites/amortization-table/resolver.cjs +692 -0
- package/dist/composites/amortization-table/resolver.cjs.map +1 -0
- package/dist/composites/amortization-table/resolver.d.ts +3 -0
- package/dist/composites/amortization-table/resolver.d.ts.map +1 -0
- package/dist/composites/amortization-table/resolver.js +690 -0
- package/dist/composites/amortization-table/resolver.js.map +1 -0
- package/dist/composites/area-chart/resolver.cjs +334 -0
- package/dist/composites/area-chart/resolver.cjs.map +1 -0
- package/dist/composites/area-chart/resolver.d.ts +3 -0
- package/dist/composites/area-chart/resolver.d.ts.map +1 -0
- package/dist/composites/area-chart/resolver.js +332 -0
- package/dist/composites/area-chart/resolver.js.map +1 -0
- package/dist/composites/audit-trail/resolver.cjs +564 -0
- package/dist/composites/audit-trail/resolver.cjs.map +1 -0
- package/dist/composites/audit-trail/resolver.d.ts +3 -0
- package/dist/composites/audit-trail/resolver.d.ts.map +1 -0
- package/dist/composites/audit-trail/resolver.js +562 -0
- package/dist/composites/audit-trail/resolver.js.map +1 -0
- package/dist/composites/balance-sheet/resolver.cjs +475 -0
- package/dist/composites/balance-sheet/resolver.cjs.map +1 -0
- package/dist/composites/balance-sheet/resolver.d.ts +3 -0
- package/dist/composites/balance-sheet/resolver.d.ts.map +1 -0
- package/dist/composites/balance-sheet/resolver.js +469 -0
- package/dist/composites/balance-sheet/resolver.js.map +1 -0
- package/dist/composites/bullet-chart/resolver.cjs +300 -0
- package/dist/composites/bullet-chart/resolver.cjs.map +1 -0
- package/dist/composites/bullet-chart/resolver.d.ts +3 -0
- package/dist/composites/bullet-chart/resolver.d.ts.map +1 -0
- package/dist/composites/bullet-chart/resolver.js +298 -0
- package/dist/composites/bullet-chart/resolver.js.map +1 -0
- package/dist/composites/cash-flow-statement/resolver.cjs +757 -0
- package/dist/composites/cash-flow-statement/resolver.cjs.map +1 -0
- package/dist/composites/cash-flow-statement/resolver.d.ts +3 -0
- package/dist/composites/cash-flow-statement/resolver.d.ts.map +1 -0
- package/dist/composites/cash-flow-statement/resolver.js +751 -0
- package/dist/composites/cash-flow-statement/resolver.js.map +1 -0
- package/dist/composites/chart-of-accounts/resolver.cjs +603 -0
- package/dist/composites/chart-of-accounts/resolver.cjs.map +1 -0
- package/dist/composites/chart-of-accounts/resolver.d.ts +3 -0
- package/dist/composites/chart-of-accounts/resolver.d.ts.map +1 -0
- package/dist/composites/chart-of-accounts/resolver.js +601 -0
- package/dist/composites/chart-of-accounts/resolver.js.map +1 -0
- package/dist/composites/cited-answer/resolver.cjs +829 -0
- package/dist/composites/cited-answer/resolver.cjs.map +1 -0
- package/dist/composites/cited-answer/resolver.d.ts +3 -0
- package/dist/composites/cited-answer/resolver.d.ts.map +1 -0
- package/dist/composites/cited-answer/resolver.js +827 -0
- package/dist/composites/cited-answer/resolver.js.map +1 -0
- package/dist/composites/combo-chart/resolver.cjs +402 -0
- package/dist/composites/combo-chart/resolver.cjs.map +1 -0
- package/dist/composites/combo-chart/resolver.d.ts +3 -0
- package/dist/composites/combo-chart/resolver.d.ts.map +1 -0
- package/dist/composites/combo-chart/resolver.js +400 -0
- package/dist/composites/combo-chart/resolver.js.map +1 -0
- package/dist/composites/comparative-bar-chart/resolver.cjs +366 -0
- package/dist/composites/comparative-bar-chart/resolver.cjs.map +1 -0
- package/dist/composites/comparative-bar-chart/resolver.d.ts +3 -0
- package/dist/composites/comparative-bar-chart/resolver.d.ts.map +1 -0
- package/dist/composites/comparative-bar-chart/resolver.js +364 -0
- package/dist/composites/comparative-bar-chart/resolver.js.map +1 -0
- package/dist/composites/compliance-checklist/resolver.cjs +618 -0
- package/dist/composites/compliance-checklist/resolver.cjs.map +1 -0
- package/dist/composites/compliance-checklist/resolver.d.ts +3 -0
- package/dist/composites/compliance-checklist/resolver.d.ts.map +1 -0
- package/dist/composites/compliance-checklist/resolver.js +616 -0
- package/dist/composites/compliance-checklist/resolver.js.map +1 -0
- package/dist/composites/connect-integration/resolver.d.ts +3 -0
- package/dist/composites/connect-integration/resolver.d.ts.map +1 -0
- package/dist/composites/data-table/resolver.cjs +324 -0
- package/dist/composites/data-table/resolver.cjs.map +1 -0
- package/dist/composites/data-table/resolver.d.ts +3 -0
- package/dist/composites/data-table/resolver.d.ts.map +1 -0
- package/dist/composites/data-table/resolver.js +322 -0
- package/dist/composites/data-table/resolver.js.map +1 -0
- package/dist/composites/depreciation-schedule/resolver.cjs +726 -0
- package/dist/composites/depreciation-schedule/resolver.cjs.map +1 -0
- package/dist/composites/depreciation-schedule/resolver.d.ts +3 -0
- package/dist/composites/depreciation-schedule/resolver.d.ts.map +1 -0
- package/dist/composites/depreciation-schedule/resolver.js +724 -0
- package/dist/composites/depreciation-schedule/resolver.js.map +1 -0
- package/dist/composites/document-preview/ExcelViewer.d.ts +8 -0
- package/dist/composites/document-preview/ExcelViewer.d.ts.map +1 -0
- package/dist/composites/document-preview/PdfViewer.d.ts +10 -0
- package/dist/composites/document-preview/PdfViewer.d.ts.map +1 -0
- package/dist/composites/document-preview/resolver.cjs +1036 -0
- package/dist/composites/document-preview/resolver.cjs.map +1 -0
- package/dist/composites/document-preview/resolver.d.ts +3 -0
- package/dist/composites/document-preview/resolver.d.ts.map +1 -0
- package/dist/composites/document-preview/resolver.js +1011 -0
- package/dist/composites/document-preview/resolver.js.map +1 -0
- package/dist/composites/document-preview/useFullscreen.d.ts +8 -0
- package/dist/composites/document-preview/useFullscreen.d.ts.map +1 -0
- package/dist/composites/download-card/resolver.cjs +1831 -0
- package/dist/composites/download-card/resolver.cjs.map +1 -0
- package/dist/composites/download-card/resolver.d.ts +3 -0
- package/dist/composites/download-card/resolver.d.ts.map +1 -0
- package/dist/composites/download-card/resolver.js +1804 -0
- package/dist/composites/download-card/resolver.js.map +1 -0
- package/dist/composites/engagement-pipeline/resolver.cjs +834 -0
- package/dist/composites/engagement-pipeline/resolver.cjs.map +1 -0
- package/dist/composites/engagement-pipeline/resolver.d.ts +3 -0
- package/dist/composites/engagement-pipeline/resolver.d.ts.map +1 -0
- package/dist/composites/engagement-pipeline/resolver.js +828 -0
- package/dist/composites/engagement-pipeline/resolver.js.map +1 -0
- package/dist/composites/entity-card-grid/resolver.cjs +444 -0
- package/dist/composites/entity-card-grid/resolver.cjs.map +1 -0
- package/dist/composites/entity-card-grid/resolver.d.ts +3 -0
- package/dist/composites/entity-card-grid/resolver.d.ts.map +1 -0
- package/dist/composites/entity-card-grid/resolver.js +442 -0
- package/dist/composites/entity-card-grid/resolver.js.map +1 -0
- package/dist/composites/escalation-card/resolver.cjs +359 -0
- package/dist/composites/escalation-card/resolver.cjs.map +1 -0
- package/dist/composites/escalation-card/resolver.d.ts +3 -0
- package/dist/composites/escalation-card/resolver.d.ts.map +1 -0
- package/dist/composites/escalation-card/resolver.js +357 -0
- package/dist/composites/escalation-card/resolver.js.map +1 -0
- package/dist/composites/file-browser/resolver.cjs +440 -0
- package/dist/composites/file-browser/resolver.cjs.map +1 -0
- package/dist/composites/file-browser/resolver.d.ts +3 -0
- package/dist/composites/file-browser/resolver.d.ts.map +1 -0
- package/dist/composites/file-browser/resolver.js +438 -0
- package/dist/composites/file-browser/resolver.js.map +1 -0
- package/dist/composites/flow-canvas/DiagramStreamParser.d.ts +15 -0
- package/dist/composites/flow-canvas/DiagramStreamParser.d.ts.map +1 -0
- package/dist/composites/flow-canvas/ElementStreamParser.d.ts +19 -0
- package/dist/composites/flow-canvas/ElementStreamParser.d.ts.map +1 -0
- package/dist/composites/flow-canvas/ExcalidrawCanvas.d.ts +8 -0
- package/dist/composites/flow-canvas/ExcalidrawCanvas.d.ts.map +1 -0
- package/dist/composites/flow-canvas/FlowGraph.d.ts +11 -0
- package/dist/composites/flow-canvas/FlowGraph.d.ts.map +1 -0
- package/dist/composites/flow-canvas/layoutFlow.d.ts +18 -0
- package/dist/composites/flow-canvas/layoutFlow.d.ts.map +1 -0
- package/dist/composites/flow-canvas/parseMermaidFlow.d.ts +24 -0
- package/dist/composites/flow-canvas/parseMermaidFlow.d.ts.map +1 -0
- package/dist/composites/flow-canvas/resolver.cjs +1295 -0
- package/dist/composites/flow-canvas/resolver.cjs.map +1 -0
- package/dist/composites/flow-canvas/resolver.d.ts +12 -0
- package/dist/composites/flow-canvas/resolver.d.ts.map +1 -0
- package/dist/composites/flow-canvas/resolver.js +1287 -0
- package/dist/composites/flow-canvas/resolver.js.map +1 -0
- package/dist/composites/funnel-chart/resolver.cjs +315 -0
- package/dist/composites/funnel-chart/resolver.cjs.map +1 -0
- package/dist/composites/funnel-chart/resolver.d.ts +3 -0
- package/dist/composites/funnel-chart/resolver.d.ts.map +1 -0
- package/dist/composites/funnel-chart/resolver.js +313 -0
- package/dist/composites/funnel-chart/resolver.js.map +1 -0
- package/dist/composites/gauge-chart/resolver.cjs +294 -0
- package/dist/composites/gauge-chart/resolver.cjs.map +1 -0
- package/dist/composites/gauge-chart/resolver.d.ts +3 -0
- package/dist/composites/gauge-chart/resolver.d.ts.map +1 -0
- package/dist/composites/gauge-chart/resolver.js +292 -0
- package/dist/composites/gauge-chart/resolver.js.map +1 -0
- package/dist/composites/general-ledger/resolver.cjs +543 -0
- package/dist/composites/general-ledger/resolver.cjs.map +1 -0
- package/dist/composites/general-ledger/resolver.d.ts +3 -0
- package/dist/composites/general-ledger/resolver.d.ts.map +1 -0
- package/dist/composites/general-ledger/resolver.js +541 -0
- package/dist/composites/general-ledger/resolver.js.map +1 -0
- package/dist/composites/grouped-table/resolver.cjs +388 -0
- package/dist/composites/grouped-table/resolver.cjs.map +1 -0
- package/dist/composites/grouped-table/resolver.d.ts +3 -0
- package/dist/composites/grouped-table/resolver.d.ts.map +1 -0
- package/dist/composites/grouped-table/resolver.js +386 -0
- package/dist/composites/grouped-table/resolver.js.map +1 -0
- package/dist/composites/heatmap-table/resolver.cjs +380 -0
- package/dist/composites/heatmap-table/resolver.cjs.map +1 -0
- package/dist/composites/heatmap-table/resolver.d.ts +3 -0
- package/dist/composites/heatmap-table/resolver.d.ts.map +1 -0
- package/dist/composites/heatmap-table/resolver.js +378 -0
- package/dist/composites/heatmap-table/resolver.js.map +1 -0
- package/dist/composites/income-statement/resolver.cjs +583 -0
- package/dist/composites/income-statement/resolver.cjs.map +1 -0
- package/dist/composites/income-statement/resolver.d.ts +3 -0
- package/dist/composites/income-statement/resolver.d.ts.map +1 -0
- package/dist/composites/income-statement/resolver.js +577 -0
- package/dist/composites/income-statement/resolver.js.map +1 -0
- package/dist/composites/integrations-list/resolver.d.ts +3 -0
- package/dist/composites/integrations-list/resolver.d.ts.map +1 -0
- package/dist/composites/invoice-detail/resolver.cjs +1086 -0
- package/dist/composites/invoice-detail/resolver.cjs.map +1 -0
- package/dist/composites/invoice-detail/resolver.d.ts +3 -0
- package/dist/composites/invoice-detail/resolver.d.ts.map +1 -0
- package/dist/composites/invoice-detail/resolver.js +1084 -0
- package/dist/composites/invoice-detail/resolver.js.map +1 -0
- package/dist/composites/job-tracker/resolver.cjs +830 -0
- package/dist/composites/job-tracker/resolver.cjs.map +1 -0
- package/dist/composites/job-tracker/resolver.d.ts +3 -0
- package/dist/composites/job-tracker/resolver.d.ts.map +1 -0
- package/dist/composites/job-tracker/resolver.js +828 -0
- package/dist/composites/job-tracker/resolver.js.map +1 -0
- package/dist/composites/journal-entry/resolver.cjs +324 -0
- package/dist/composites/journal-entry/resolver.cjs.map +1 -0
- package/dist/composites/journal-entry/resolver.d.ts +3 -0
- package/dist/composites/journal-entry/resolver.d.ts.map +1 -0
- package/dist/composites/journal-entry/resolver.js +322 -0
- package/dist/composites/journal-entry/resolver.js.map +1 -0
- package/dist/composites/key-value-list/resolver.cjs +708 -0
- package/dist/composites/key-value-list/resolver.cjs.map +1 -0
- package/dist/composites/key-value-list/resolver.d.ts +3 -0
- package/dist/composites/key-value-list/resolver.d.ts.map +1 -0
- package/dist/composites/key-value-list/resolver.js +702 -0
- package/dist/composites/key-value-list/resolver.js.map +1 -0
- package/dist/composites/legal-test-result/resolver.cjs +666 -0
- package/dist/composites/legal-test-result/resolver.cjs.map +1 -0
- package/dist/composites/legal-test-result/resolver.d.ts +3 -0
- package/dist/composites/legal-test-result/resolver.d.ts.map +1 -0
- package/dist/composites/legal-test-result/resolver.js +664 -0
- package/dist/composites/legal-test-result/resolver.js.map +1 -0
- package/dist/composites/line-chart/resolver.cjs +344 -0
- package/dist/composites/line-chart/resolver.cjs.map +1 -0
- package/dist/composites/line-chart/resolver.d.ts +3 -0
- package/dist/composites/line-chart/resolver.d.ts.map +1 -0
- package/dist/composites/line-chart/resolver.js +342 -0
- package/dist/composites/line-chart/resolver.js.map +1 -0
- package/dist/composites/news-feed/resolver.cjs +539 -0
- package/dist/composites/news-feed/resolver.cjs.map +1 -0
- package/dist/composites/news-feed/resolver.d.ts +3 -0
- package/dist/composites/news-feed/resolver.d.ts.map +1 -0
- package/dist/composites/news-feed/resolver.js +537 -0
- package/dist/composites/news-feed/resolver.js.map +1 -0
- package/dist/composites/ops-dashboard/resolver.cjs +430 -0
- package/dist/composites/ops-dashboard/resolver.cjs.map +1 -0
- package/dist/composites/ops-dashboard/resolver.d.ts +3 -0
- package/dist/composites/ops-dashboard/resolver.d.ts.map +1 -0
- package/dist/composites/ops-dashboard/resolver.js +428 -0
- package/dist/composites/ops-dashboard/resolver.js.map +1 -0
- package/dist/composites/pipeline-preview/layout.d.ts +39 -0
- package/dist/composites/pipeline-preview/layout.d.ts.map +1 -0
- package/dist/composites/pipeline-preview/opMeta.d.ts +9 -0
- package/dist/composites/pipeline-preview/opMeta.d.ts.map +1 -0
- package/dist/composites/pipeline-preview/resolver.d.ts +3 -0
- package/dist/composites/pipeline-preview/resolver.d.ts.map +1 -0
- package/dist/composites/provenance-chain/resolver.cjs +797 -0
- package/dist/composites/provenance-chain/resolver.cjs.map +1 -0
- package/dist/composites/provenance-chain/resolver.d.ts +3 -0
- package/dist/composites/provenance-chain/resolver.d.ts.map +1 -0
- package/dist/composites/provenance-chain/resolver.js +795 -0
- package/dist/composites/provenance-chain/resolver.js.map +1 -0
- package/dist/composites/radar-chart/resolver.cjs +323 -0
- package/dist/composites/radar-chart/resolver.cjs.map +1 -0
- package/dist/composites/radar-chart/resolver.d.ts +3 -0
- package/dist/composites/radar-chart/resolver.d.ts.map +1 -0
- package/dist/composites/radar-chart/resolver.js +321 -0
- package/dist/composites/radar-chart/resolver.js.map +1 -0
- package/dist/composites/reconciliation-view/resolver.cjs +917 -0
- package/dist/composites/reconciliation-view/resolver.cjs.map +1 -0
- package/dist/composites/reconciliation-view/resolver.d.ts +3 -0
- package/dist/composites/reconciliation-view/resolver.d.ts.map +1 -0
- package/dist/composites/reconciliation-view/resolver.js +915 -0
- package/dist/composites/reconciliation-view/resolver.js.map +1 -0
- package/dist/composites/scatter-chart/resolver.cjs +357 -0
- package/dist/composites/scatter-chart/resolver.cjs.map +1 -0
- package/dist/composites/scatter-chart/resolver.d.ts +3 -0
- package/dist/composites/scatter-chart/resolver.d.ts.map +1 -0
- package/dist/composites/scatter-chart/resolver.js +355 -0
- package/dist/composites/scatter-chart/resolver.js.map +1 -0
- package/dist/composites/screener-table/resolver.cjs +372 -0
- package/dist/composites/screener-table/resolver.cjs.map +1 -0
- package/dist/composites/screener-table/resolver.d.ts +3 -0
- package/dist/composites/screener-table/resolver.d.ts.map +1 -0
- package/dist/composites/screener-table/resolver.js +370 -0
- package/dist/composites/screener-table/resolver.js.map +1 -0
- package/dist/composites/search-results/resolver.cjs +391 -0
- package/dist/composites/search-results/resolver.cjs.map +1 -0
- package/dist/composites/search-results/resolver.d.ts +3 -0
- package/dist/composites/search-results/resolver.d.ts.map +1 -0
- package/dist/composites/search-results/resolver.js +389 -0
- package/dist/composites/search-results/resolver.js.map +1 -0
- package/dist/composites/sparkline-table/resolver.cjs +361 -0
- package/dist/composites/sparkline-table/resolver.cjs.map +1 -0
- package/dist/composites/sparkline-table/resolver.d.ts +3 -0
- package/dist/composites/sparkline-table/resolver.d.ts.map +1 -0
- package/dist/composites/sparkline-table/resolver.js +359 -0
- package/dist/composites/sparkline-table/resolver.js.map +1 -0
- package/dist/composites/stacked-breakdown/resolver.cjs +397 -0
- package/dist/composites/stacked-breakdown/resolver.cjs.map +1 -0
- package/dist/composites/stacked-breakdown/resolver.d.ts +3 -0
- package/dist/composites/stacked-breakdown/resolver.d.ts.map +1 -0
- package/dist/composites/stacked-breakdown/resolver.js +395 -0
- package/dist/composites/stacked-breakdown/resolver.js.map +1 -0
- package/dist/composites/stat-grid/resolver.cjs +498 -0
- package/dist/composites/stat-grid/resolver.cjs.map +1 -0
- package/dist/composites/stat-grid/resolver.d.ts +3 -0
- package/dist/composites/stat-grid/resolver.d.ts.map +1 -0
- package/dist/composites/stat-grid/resolver.js +496 -0
- package/dist/composites/stat-grid/resolver.js.map +1 -0
- package/dist/composites/status-card/resolver.cjs +593 -0
- package/dist/composites/status-card/resolver.cjs.map +1 -0
- package/dist/composites/status-card/resolver.d.ts +3 -0
- package/dist/composites/status-card/resolver.d.ts.map +1 -0
- package/dist/composites/status-card/resolver.js +591 -0
- package/dist/composites/status-card/resolver.js.map +1 -0
- package/dist/composites/tabs-panel/resolver.cjs +564 -0
- package/dist/composites/tabs-panel/resolver.cjs.map +1 -0
- package/dist/composites/tabs-panel/resolver.d.ts +3 -0
- package/dist/composites/tabs-panel/resolver.d.ts.map +1 -0
- package/dist/composites/tabs-panel/resolver.js +562 -0
- package/dist/composites/tabs-panel/resolver.js.map +1 -0
- package/dist/composites/transaction-feed/resolver.cjs +830 -0
- package/dist/composites/transaction-feed/resolver.cjs.map +1 -0
- package/dist/composites/transaction-feed/resolver.d.ts +3 -0
- package/dist/composites/transaction-feed/resolver.d.ts.map +1 -0
- package/dist/composites/transaction-feed/resolver.js +828 -0
- package/dist/composites/transaction-feed/resolver.js.map +1 -0
- package/dist/composites/treemap-chart/resolver.cjs +323 -0
- package/dist/composites/treemap-chart/resolver.cjs.map +1 -0
- package/dist/composites/treemap-chart/resolver.d.ts +3 -0
- package/dist/composites/treemap-chart/resolver.d.ts.map +1 -0
- package/dist/composites/treemap-chart/resolver.js +321 -0
- package/dist/composites/treemap-chart/resolver.js.map +1 -0
- package/dist/composites/trial-balance/resolver.cjs +359 -0
- package/dist/composites/trial-balance/resolver.cjs.map +1 -0
- package/dist/composites/trial-balance/resolver.d.ts +3 -0
- package/dist/composites/trial-balance/resolver.d.ts.map +1 -0
- package/dist/composites/trial-balance/resolver.js +353 -0
- package/dist/composites/trial-balance/resolver.js.map +1 -0
- package/dist/composites/variance-analysis/resolver.cjs +310 -0
- package/dist/composites/variance-analysis/resolver.cjs.map +1 -0
- package/dist/composites/variance-analysis/resolver.d.ts +3 -0
- package/dist/composites/variance-analysis/resolver.d.ts.map +1 -0
- package/dist/composites/variance-analysis/resolver.js +308 -0
- package/dist/composites/variance-analysis/resolver.js.map +1 -0
- package/dist/composites/waterfall-chart/resolver.cjs +347 -0
- package/dist/composites/waterfall-chart/resolver.cjs.map +1 -0
- package/dist/composites/waterfall-chart/resolver.d.ts +3 -0
- package/dist/composites/waterfall-chart/resolver.d.ts.map +1 -0
- package/dist/composites/waterfall-chart/resolver.js +345 -0
- package/dist/composites/waterfall-chart/resolver.js.map +1 -0
- package/dist/index.cjs +18271 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +52 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18184 -0
- package/dist/index.js.map +1 -0
- package/dist/renderer.cjs +17092 -0
- package/dist/renderer.cjs.map +1 -0
- package/dist/renderer.d.ts +7 -0
- package/dist/renderer.d.ts.map +1 -0
- package/dist/renderer.js +17064 -0
- package/dist/renderer.js.map +1 -0
- package/dist/resolver.cjs +17061 -0
- package/dist/resolver.cjs.map +1 -0
- package/dist/resolver.d.ts +6 -0
- package/dist/resolver.d.ts.map +1 -0
- package/dist/resolver.js +17033 -0
- package/dist/resolver.js.map +1 -0
- package/dist/schemas/aging-report.d.ts +74 -0
- package/dist/schemas/aging-report.d.ts.map +1 -0
- package/dist/schemas/alert.d.ts +39 -0
- package/dist/schemas/alert.d.ts.map +1 -0
- package/dist/schemas/allocation-donut.d.ts +53 -0
- package/dist/schemas/allocation-donut.d.ts.map +1 -0
- package/dist/schemas/amortization-table.d.ts +102 -0
- package/dist/schemas/amortization-table.d.ts.map +1 -0
- package/dist/schemas/area-chart.d.ts +61 -0
- package/dist/schemas/area-chart.d.ts.map +1 -0
- package/dist/schemas/audit-trail.d.ts +88 -0
- package/dist/schemas/audit-trail.d.ts.map +1 -0
- package/dist/schemas/balance-sheet.d.ts +170 -0
- package/dist/schemas/balance-sheet.d.ts.map +1 -0
- package/dist/schemas/buildRenderUITool.d.ts +7 -0
- package/dist/schemas/buildRenderUITool.d.ts.map +1 -0
- package/dist/schemas/bullet-chart.d.ts +58 -0
- package/dist/schemas/bullet-chart.d.ts.map +1 -0
- package/dist/schemas/cash-flow-statement.d.ts +165 -0
- package/dist/schemas/cash-flow-statement.d.ts.map +1 -0
- package/dist/schemas/chart-of-accounts.d.ts +93 -0
- package/dist/schemas/chart-of-accounts.d.ts.map +1 -0
- package/dist/schemas/cited-answer.d.ts +76 -0
- package/dist/schemas/cited-answer.d.ts.map +1 -0
- package/dist/schemas/coercePayload.d.ts +16 -0
- package/dist/schemas/coercePayload.d.ts.map +1 -0
- package/dist/schemas/combo-chart.d.ts +111 -0
- package/dist/schemas/combo-chart.d.ts.map +1 -0
- package/dist/schemas/comparative-bar-chart.d.ts +83 -0
- package/dist/schemas/comparative-bar-chart.d.ts.map +1 -0
- package/dist/schemas/compliance-checklist.d.ts +91 -0
- package/dist/schemas/compliance-checklist.d.ts.map +1 -0
- package/dist/schemas/connect-integration.d.ts +47 -0
- package/dist/schemas/connect-integration.d.ts.map +1 -0
- package/dist/schemas/data-table.d.ts +63 -0
- package/dist/schemas/data-table.d.ts.map +1 -0
- package/dist/schemas/depreciation-schedule.d.ts +125 -0
- package/dist/schemas/depreciation-schedule.d.ts.map +1 -0
- package/dist/schemas/document-preview.d.ts +128 -0
- package/dist/schemas/document-preview.d.ts.map +1 -0
- package/dist/schemas/download-card.d.ts +62 -0
- package/dist/schemas/download-card.d.ts.map +1 -0
- package/dist/schemas/engagement-pipeline.d.ts +119 -0
- package/dist/schemas/engagement-pipeline.d.ts.map +1 -0
- package/dist/schemas/entity-card-grid.d.ts +101 -0
- package/dist/schemas/entity-card-grid.d.ts.map +1 -0
- package/dist/schemas/escalation-card.d.ts +44 -0
- package/dist/schemas/escalation-card.d.ts.map +1 -0
- package/dist/schemas/file-browser.d.ts +81 -0
- package/dist/schemas/file-browser.d.ts.map +1 -0
- package/dist/schemas/flow-canvas.d.ts +58 -0
- package/dist/schemas/flow-canvas.d.ts.map +1 -0
- package/dist/schemas/funnel-chart.d.ts +53 -0
- package/dist/schemas/funnel-chart.d.ts.map +1 -0
- package/dist/schemas/gauge-chart.d.ts +58 -0
- package/dist/schemas/gauge-chart.d.ts.map +1 -0
- package/dist/schemas/general-ledger.d.ts +120 -0
- package/dist/schemas/general-ledger.d.ts.map +1 -0
- package/dist/schemas/grouped-table.d.ts +101 -0
- package/dist/schemas/grouped-table.d.ts.map +1 -0
- package/dist/schemas/heatmap-table.d.ts +76 -0
- package/dist/schemas/heatmap-table.d.ts.map +1 -0
- package/dist/schemas/income-statement.d.ts +170 -0
- package/dist/schemas/income-statement.d.ts.map +1 -0
- package/dist/schemas/index.cjs +3509 -0
- package/dist/schemas/index.cjs.map +1 -0
- package/dist/schemas/index.d.ts +5030 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +3505 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/integrations-list.d.ts +62 -0
- package/dist/schemas/integrations-list.d.ts.map +1 -0
- package/dist/schemas/invoice-detail.d.ts +157 -0
- package/dist/schemas/invoice-detail.d.ts.map +1 -0
- package/dist/schemas/job-tracker.d.ts +114 -0
- package/dist/schemas/job-tracker.d.ts.map +1 -0
- package/dist/schemas/journal-entry.d.ts +90 -0
- package/dist/schemas/journal-entry.d.ts.map +1 -0
- package/dist/schemas/key-value-list.d.ts +108 -0
- package/dist/schemas/key-value-list.d.ts.map +1 -0
- package/dist/schemas/legal-test-result.d.ts +130 -0
- package/dist/schemas/legal-test-result.d.ts.map +1 -0
- package/dist/schemas/line-chart.d.ts +71 -0
- package/dist/schemas/line-chart.d.ts.map +1 -0
- package/dist/schemas/news-feed.d.ts +63 -0
- package/dist/schemas/news-feed.d.ts.map +1 -0
- package/dist/schemas/ops-dashboard.d.ts +92 -0
- package/dist/schemas/ops-dashboard.d.ts.map +1 -0
- package/dist/schemas/pipeline-preview.d.ts +209 -0
- package/dist/schemas/pipeline-preview.d.ts.map +1 -0
- package/dist/schemas/provenance-chain.d.ts +121 -0
- package/dist/schemas/provenance-chain.d.ts.map +1 -0
- package/dist/schemas/radar-chart.d.ts +70 -0
- package/dist/schemas/radar-chart.d.ts.map +1 -0
- package/dist/schemas/reconciliation-view.d.ts +156 -0
- package/dist/schemas/reconciliation-view.d.ts.map +1 -0
- package/dist/schemas/scatter-chart.d.ts +90 -0
- package/dist/schemas/scatter-chart.d.ts.map +1 -0
- package/dist/schemas/screener-table.d.ts +74 -0
- package/dist/schemas/screener-table.d.ts.map +1 -0
- package/dist/schemas/search-results.d.ts +87 -0
- package/dist/schemas/search-results.d.ts.map +1 -0
- package/dist/schemas/sparkline-table.d.ts +74 -0
- package/dist/schemas/sparkline-table.d.ts.map +1 -0
- package/dist/schemas/stacked-breakdown.d.ts +70 -0
- package/dist/schemas/stacked-breakdown.d.ts.map +1 -0
- package/dist/schemas/stat-grid.d.ts +55 -0
- package/dist/schemas/stat-grid.d.ts.map +1 -0
- package/dist/schemas/status-card.d.ts +84 -0
- package/dist/schemas/status-card.d.ts.map +1 -0
- package/dist/schemas/tabs-panel.d.ts +42 -0
- package/dist/schemas/tabs-panel.d.ts.map +1 -0
- package/dist/schemas/transaction-feed.d.ts +82 -0
- package/dist/schemas/transaction-feed.d.ts.map +1 -0
- package/dist/schemas/treemap-chart.d.ts +53 -0
- package/dist/schemas/treemap-chart.d.ts.map +1 -0
- package/dist/schemas/trial-balance.d.ts +85 -0
- package/dist/schemas/trial-balance.d.ts.map +1 -0
- package/dist/schemas/validatePayload.d.ts +10 -0
- package/dist/schemas/validatePayload.d.ts.map +1 -0
- package/dist/schemas/variance-analysis.d.ts +73 -0
- package/dist/schemas/variance-analysis.d.ts.map +1 -0
- package/dist/schemas/waterfall-chart.d.ts +53 -0
- package/dist/schemas/waterfall-chart.d.ts.map +1 -0
- package/dist/shared/ColumnSettingsPanel.d.ts +13 -0
- package/dist/shared/ColumnSettingsPanel.d.ts.map +1 -0
- package/dist/shared/ComponentActions.d.ts +20 -0
- package/dist/shared/ComponentActions.d.ts.map +1 -0
- package/dist/shared/FileCard.d.ts +35 -0
- package/dist/shared/FileCard.d.ts.map +1 -0
- package/dist/shared/Markdown.d.ts +22 -0
- package/dist/shared/Markdown.d.ts.map +1 -0
- package/dist/shared/PreviewModal.d.ts +19 -0
- package/dist/shared/PreviewModal.d.ts.map +1 -0
- package/dist/shared/ThemeContext.d.ts +18 -0
- package/dist/shared/ThemeContext.d.ts.map +1 -0
- package/dist/shared/brandIcons.d.ts +3 -0
- package/dist/shared/brandIcons.d.ts.map +1 -0
- package/dist/shared/downloadCSV.d.ts +5 -0
- package/dist/shared/downloadCSV.d.ts.map +1 -0
- package/dist/shared/fileType.d.ts +19 -0
- package/dist/shared/fileType.d.ts.map +1 -0
- package/dist/shared/theme.d.ts +48 -0
- package/dist/shared/theme.d.ts.map +1 -0
- package/dist/shared/useColumnVisibility.d.ts +13 -0
- package/dist/shared/useColumnVisibility.d.ts.map +1 -0
- package/dist/shared/useSeriesToggle.d.ts +8 -0
- package/dist/shared/useSeriesToggle.d.ts.map +1 -0
- package/dist/shared/viewers/CsvViewer.d.ts +13 -0
- package/dist/shared/viewers/CsvViewer.d.ts.map +1 -0
- package/dist/shared/viewers/DocxViewer.d.ts +8 -0
- package/dist/shared/viewers/DocxViewer.d.ts.map +1 -0
- package/dist/shared/viewers/PreviewHost.d.ts +17 -0
- package/dist/shared/viewers/PreviewHost.d.ts.map +1 -0
- package/dist/shared/viewers/TextViewer.d.ts +13 -0
- package/dist/shared/viewers/TextViewer.d.ts.map +1 -0
- package/dist/shared/viewers/decode.d.ts +14 -0
- package/dist/shared/viewers/decode.d.ts.map +1 -0
- package/dist/tool-definitions.json +4629 -0
- package/dist/types.d.ts +8 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +110 -0
- package/styles/contract.css +17 -0
|
@@ -0,0 +1,3509 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var zod = require('zod');
|
|
4
|
+
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __defProps = Object.defineProperties;
|
|
7
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
8
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
+
var __spreadValues = (a, b) => {
|
|
13
|
+
for (var prop in b || (b = {}))
|
|
14
|
+
if (__hasOwnProp.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
if (__getOwnPropSymbols)
|
|
17
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
+
if (__propIsEnum.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
20
|
+
}
|
|
21
|
+
return a;
|
|
22
|
+
};
|
|
23
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
+
var dataTableSchema = zod.z.object({
|
|
25
|
+
type: zod.z.literal("data-table"),
|
|
26
|
+
title: zod.z.string().optional(),
|
|
27
|
+
columns: zod.z.array(
|
|
28
|
+
zod.z.object({
|
|
29
|
+
key: zod.z.string(),
|
|
30
|
+
label: zod.z.string(),
|
|
31
|
+
align: zod.z.enum(["start", "center", "end"]).default("start")
|
|
32
|
+
})
|
|
33
|
+
).min(1).max(10),
|
|
34
|
+
rows: zod.z.array(
|
|
35
|
+
zod.z.record(zod.z.string(), zod.z.union([zod.z.string(), zod.z.number(), zod.z.boolean(), zod.z.null()]))
|
|
36
|
+
).max(100),
|
|
37
|
+
pagination: zod.z.boolean().default(false)
|
|
38
|
+
});
|
|
39
|
+
var dataTableTool = {
|
|
40
|
+
name: "render_data_table",
|
|
41
|
+
description: "Render a structured data table with labeled columns and rows",
|
|
42
|
+
input_schema: {
|
|
43
|
+
type: "object",
|
|
44
|
+
properties: {
|
|
45
|
+
type: { type: "string", enum: ["data-table"] },
|
|
46
|
+
title: { type: "string" },
|
|
47
|
+
columns: {
|
|
48
|
+
type: "array",
|
|
49
|
+
items: {
|
|
50
|
+
type: "object",
|
|
51
|
+
properties: {
|
|
52
|
+
key: { type: "string" },
|
|
53
|
+
label: { type: "string" },
|
|
54
|
+
align: { type: "string", enum: ["start", "center", "end"] }
|
|
55
|
+
},
|
|
56
|
+
required: ["key", "label"]
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
rows: {
|
|
60
|
+
type: "array",
|
|
61
|
+
items: { type: "object", additionalProperties: true }
|
|
62
|
+
},
|
|
63
|
+
pagination: { type: "boolean" }
|
|
64
|
+
},
|
|
65
|
+
required: ["type", "columns", "rows"]
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
var variantMap = {
|
|
69
|
+
outlined: "bordered",
|
|
70
|
+
outline: "bordered",
|
|
71
|
+
filled: "solid",
|
|
72
|
+
solid: "solid",
|
|
73
|
+
bordered: "bordered",
|
|
74
|
+
light: "light",
|
|
75
|
+
flat: "flat",
|
|
76
|
+
ghost: "ghost"
|
|
77
|
+
};
|
|
78
|
+
var colorMap = {
|
|
79
|
+
default: "default",
|
|
80
|
+
primary: "primary",
|
|
81
|
+
secondary: "secondary",
|
|
82
|
+
success: "success",
|
|
83
|
+
warning: "warning",
|
|
84
|
+
danger: "danger",
|
|
85
|
+
error: "danger",
|
|
86
|
+
info: "primary",
|
|
87
|
+
neutral: "default"
|
|
88
|
+
};
|
|
89
|
+
var statusCardSchema = zod.z.object({
|
|
90
|
+
type: zod.z.literal("status-card"),
|
|
91
|
+
title: zod.z.string(),
|
|
92
|
+
subtitle: zod.z.string().optional(),
|
|
93
|
+
status: zod.z.enum(["default", "success", "warning", "danger", "primary"]).default("default"),
|
|
94
|
+
fields: zod.z.array(
|
|
95
|
+
zod.z.object({
|
|
96
|
+
label: zod.z.string(),
|
|
97
|
+
value: zod.z.string(),
|
|
98
|
+
highlight: zod.z.boolean().default(false)
|
|
99
|
+
})
|
|
100
|
+
).max(12),
|
|
101
|
+
actions: zod.z.array(
|
|
102
|
+
zod.z.object({
|
|
103
|
+
label: zod.z.string(),
|
|
104
|
+
variant: zod.z.string().transform((v) => {
|
|
105
|
+
var _a;
|
|
106
|
+
return (_a = variantMap[v]) != null ? _a : "bordered";
|
|
107
|
+
}).default("bordered"),
|
|
108
|
+
color: zod.z.string().transform((v) => {
|
|
109
|
+
var _a;
|
|
110
|
+
return (_a = colorMap[v]) != null ? _a : "default";
|
|
111
|
+
}).default("default")
|
|
112
|
+
})
|
|
113
|
+
).max(3).optional()
|
|
114
|
+
});
|
|
115
|
+
var statusCardTool = {
|
|
116
|
+
name: "render_status_card",
|
|
117
|
+
description: "Render a card for a single entity \u2014 person, order, product, task",
|
|
118
|
+
input_schema: {
|
|
119
|
+
type: "object",
|
|
120
|
+
properties: {
|
|
121
|
+
type: { type: "string", enum: ["status-card"] },
|
|
122
|
+
title: { type: "string" },
|
|
123
|
+
subtitle: { type: "string" },
|
|
124
|
+
status: {
|
|
125
|
+
type: "string",
|
|
126
|
+
enum: ["default", "success", "warning", "danger", "primary"]
|
|
127
|
+
},
|
|
128
|
+
fields: {
|
|
129
|
+
type: "array",
|
|
130
|
+
items: {
|
|
131
|
+
type: "object",
|
|
132
|
+
properties: {
|
|
133
|
+
label: { type: "string" },
|
|
134
|
+
value: { type: "string" },
|
|
135
|
+
highlight: { type: "boolean" }
|
|
136
|
+
},
|
|
137
|
+
required: ["label", "value"]
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
actions: {
|
|
141
|
+
type: "array",
|
|
142
|
+
items: {
|
|
143
|
+
type: "object",
|
|
144
|
+
properties: {
|
|
145
|
+
label: { type: "string" },
|
|
146
|
+
variant: { type: "string" },
|
|
147
|
+
color: { type: "string" }
|
|
148
|
+
},
|
|
149
|
+
required: ["label"]
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
required: ["type", "title", "fields"]
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
var alertSchema = zod.z.object({
|
|
157
|
+
type: zod.z.literal("alert"),
|
|
158
|
+
color: zod.z.enum([
|
|
159
|
+
"default",
|
|
160
|
+
"primary",
|
|
161
|
+
"secondary",
|
|
162
|
+
"success",
|
|
163
|
+
"warning",
|
|
164
|
+
"danger"
|
|
165
|
+
]),
|
|
166
|
+
title: zod.z.string(),
|
|
167
|
+
description: zod.z.string().optional()
|
|
168
|
+
});
|
|
169
|
+
var alertTool = {
|
|
170
|
+
name: "render_alert",
|
|
171
|
+
description: "Render a short important message \u2014 success, warning, error, or info",
|
|
172
|
+
input_schema: {
|
|
173
|
+
type: "object",
|
|
174
|
+
properties: {
|
|
175
|
+
type: { type: "string", enum: ["alert"] },
|
|
176
|
+
color: {
|
|
177
|
+
type: "string",
|
|
178
|
+
enum: ["default", "primary", "secondary", "success", "warning", "danger"]
|
|
179
|
+
},
|
|
180
|
+
title: { type: "string" },
|
|
181
|
+
description: { type: "string" }
|
|
182
|
+
},
|
|
183
|
+
required: ["type", "color", "title"]
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
var statGridSchema = zod.z.object({
|
|
187
|
+
type: zod.z.literal("stat-grid"),
|
|
188
|
+
stats: zod.z.array(
|
|
189
|
+
zod.z.object({
|
|
190
|
+
label: zod.z.string(),
|
|
191
|
+
value: zod.z.string(),
|
|
192
|
+
change: zod.z.string().optional(),
|
|
193
|
+
changeType: zod.z.enum(["positive", "negative", "neutral"]).optional(),
|
|
194
|
+
description: zod.z.string().optional()
|
|
195
|
+
})
|
|
196
|
+
).min(2).max(4)
|
|
197
|
+
});
|
|
198
|
+
var statGridTool = {
|
|
199
|
+
name: "render_stat_grid",
|
|
200
|
+
description: "Render 2\u20134 KPI metric cards side by side",
|
|
201
|
+
input_schema: {
|
|
202
|
+
type: "object",
|
|
203
|
+
properties: {
|
|
204
|
+
type: { type: "string", enum: ["stat-grid"] },
|
|
205
|
+
stats: {
|
|
206
|
+
type: "array",
|
|
207
|
+
items: {
|
|
208
|
+
type: "object",
|
|
209
|
+
properties: {
|
|
210
|
+
label: { type: "string" },
|
|
211
|
+
value: { type: "string" },
|
|
212
|
+
change: { type: "string" },
|
|
213
|
+
changeType: {
|
|
214
|
+
type: "string",
|
|
215
|
+
enum: ["positive", "negative", "neutral"]
|
|
216
|
+
},
|
|
217
|
+
description: { type: "string" }
|
|
218
|
+
},
|
|
219
|
+
required: ["label", "value"]
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
required: ["type", "stats"]
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
var tabsPanelSchema = zod.z.object({
|
|
227
|
+
type: zod.z.literal("tabs-panel"),
|
|
228
|
+
tabs: zod.z.array(
|
|
229
|
+
zod.z.object({
|
|
230
|
+
key: zod.z.string(),
|
|
231
|
+
label: zod.z.string(),
|
|
232
|
+
content: zod.z.string()
|
|
233
|
+
})
|
|
234
|
+
).min(2).max(6)
|
|
235
|
+
});
|
|
236
|
+
var tabsPanelTool = {
|
|
237
|
+
name: "render_tabs_panel",
|
|
238
|
+
description: "Render multiple sections the user can switch between via tabs",
|
|
239
|
+
input_schema: {
|
|
240
|
+
type: "object",
|
|
241
|
+
properties: {
|
|
242
|
+
type: { type: "string", enum: ["tabs-panel"] },
|
|
243
|
+
tabs: {
|
|
244
|
+
type: "array",
|
|
245
|
+
items: {
|
|
246
|
+
type: "object",
|
|
247
|
+
properties: {
|
|
248
|
+
key: { type: "string" },
|
|
249
|
+
label: { type: "string" },
|
|
250
|
+
content: { type: "string" }
|
|
251
|
+
},
|
|
252
|
+
required: ["key", "label", "content"]
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
required: ["type", "tabs"]
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
var sparklineTableSchema = zod.z.object({
|
|
260
|
+
type: zod.z.literal("sparkline-table"),
|
|
261
|
+
title: zod.z.string().optional(),
|
|
262
|
+
sparklineLabel: zod.z.string().default("Trend"),
|
|
263
|
+
columns: zod.z.array(zod.z.object({ key: zod.z.string(), label: zod.z.string(), align: zod.z.enum(["start", "center", "end"]).default("start") })).min(1).max(12),
|
|
264
|
+
rows: zod.z.array(
|
|
265
|
+
zod.z.object({
|
|
266
|
+
sparkline: zod.z.array(zod.z.number()).min(2).max(60)
|
|
267
|
+
}).catchall(zod.z.union([zod.z.string(), zod.z.number(), zod.z.boolean(), zod.z.null()]))
|
|
268
|
+
).max(50)
|
|
269
|
+
});
|
|
270
|
+
var sparklineTableTool = {
|
|
271
|
+
name: "render_sparkline_table",
|
|
272
|
+
description: "Render a table where one column shows a 30-day sparkline trend per row \u2014 watchlist, holdings, options chain",
|
|
273
|
+
input_schema: {
|
|
274
|
+
type: "object",
|
|
275
|
+
properties: {
|
|
276
|
+
type: { type: "string", enum: ["sparkline-table"] },
|
|
277
|
+
title: { type: "string" },
|
|
278
|
+
sparklineLabel: { type: "string" },
|
|
279
|
+
columns: {
|
|
280
|
+
type: "array",
|
|
281
|
+
items: {
|
|
282
|
+
type: "object",
|
|
283
|
+
properties: { key: { type: "string" }, label: { type: "string" }, align: { type: "string", enum: ["start", "center", "end"] } },
|
|
284
|
+
required: ["key", "label"]
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
rows: {
|
|
288
|
+
type: "array",
|
|
289
|
+
items: {
|
|
290
|
+
type: "object",
|
|
291
|
+
properties: { sparkline: { type: "array", items: { type: "number" } } },
|
|
292
|
+
required: ["sparkline"],
|
|
293
|
+
additionalProperties: true
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
required: ["type", "columns", "rows"]
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
var heatmapCellSchema = zod.z.object({ value: zod.z.string(), zScore: zod.z.number() });
|
|
301
|
+
var heatmapTableSchema = zod.z.object({
|
|
302
|
+
type: zod.z.literal("heatmap-table"),
|
|
303
|
+
title: zod.z.string().optional(),
|
|
304
|
+
columns: zod.z.array(zod.z.object({ key: zod.z.string(), label: zod.z.string() })).min(1).max(12),
|
|
305
|
+
rows: zod.z.array(
|
|
306
|
+
zod.z.object({
|
|
307
|
+
rowLabel: zod.z.string(),
|
|
308
|
+
cells: zod.z.array(heatmapCellSchema)
|
|
309
|
+
})
|
|
310
|
+
).max(30)
|
|
311
|
+
});
|
|
312
|
+
var heatmapTableTool = {
|
|
313
|
+
name: "render_heatmap_table",
|
|
314
|
+
description: "Render a comparison table where cells are color-scaled by z-score \u2014 fund comparison, peer group, macro heatmap",
|
|
315
|
+
input_schema: {
|
|
316
|
+
type: "object",
|
|
317
|
+
properties: {
|
|
318
|
+
type: { type: "string", enum: ["heatmap-table"] },
|
|
319
|
+
title: { type: "string" },
|
|
320
|
+
columns: {
|
|
321
|
+
type: "array",
|
|
322
|
+
items: { type: "object", properties: { key: { type: "string" }, label: { type: "string" } }, required: ["key", "label"] }
|
|
323
|
+
},
|
|
324
|
+
rows: {
|
|
325
|
+
type: "array",
|
|
326
|
+
items: {
|
|
327
|
+
type: "object",
|
|
328
|
+
properties: {
|
|
329
|
+
rowLabel: { type: "string" },
|
|
330
|
+
cells: {
|
|
331
|
+
type: "array",
|
|
332
|
+
items: {
|
|
333
|
+
type: "object",
|
|
334
|
+
properties: { value: { type: "string" }, zScore: { type: "number" } },
|
|
335
|
+
required: ["value", "zScore"]
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
required: ["rowLabel", "cells"]
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
},
|
|
343
|
+
required: ["type", "columns", "rows"]
|
|
344
|
+
}
|
|
345
|
+
};
|
|
346
|
+
var screenerTableSchema = zod.z.object({
|
|
347
|
+
type: zod.z.literal("screener-table"),
|
|
348
|
+
title: zod.z.string().optional(),
|
|
349
|
+
columns: zod.z.array(
|
|
350
|
+
zod.z.object({
|
|
351
|
+
key: zod.z.string(),
|
|
352
|
+
label: zod.z.string(),
|
|
353
|
+
align: zod.z.enum(["start", "center", "end"]).default("start"),
|
|
354
|
+
meterKey: zod.z.boolean().default(false),
|
|
355
|
+
meterMax: zod.z.number().optional()
|
|
356
|
+
})
|
|
357
|
+
).min(1).max(10),
|
|
358
|
+
rows: zod.z.array(zod.z.record(zod.z.string(), zod.z.union([zod.z.string(), zod.z.number(), zod.z.boolean(), zod.z.null()]))).max(100),
|
|
359
|
+
activeFilters: zod.z.array(zod.z.string()).default([])
|
|
360
|
+
});
|
|
361
|
+
var screenerTableTool = {
|
|
362
|
+
name: "render_screener_table",
|
|
363
|
+
description: "Render a sortable table with inline meter bars for scores/ratings \u2014 stock screener, fund search, bond filter",
|
|
364
|
+
input_schema: {
|
|
365
|
+
type: "object",
|
|
366
|
+
properties: {
|
|
367
|
+
type: { type: "string", enum: ["screener-table"] },
|
|
368
|
+
title: { type: "string" },
|
|
369
|
+
columns: {
|
|
370
|
+
type: "array",
|
|
371
|
+
items: {
|
|
372
|
+
type: "object",
|
|
373
|
+
properties: {
|
|
374
|
+
key: { type: "string" },
|
|
375
|
+
label: { type: "string" },
|
|
376
|
+
align: { type: "string", enum: ["start", "center", "end"] },
|
|
377
|
+
meterKey: { type: "boolean" },
|
|
378
|
+
meterMax: { type: "number" }
|
|
379
|
+
},
|
|
380
|
+
required: ["key", "label"]
|
|
381
|
+
}
|
|
382
|
+
},
|
|
383
|
+
rows: { type: "array", items: { type: "object", additionalProperties: true } },
|
|
384
|
+
activeFilters: { type: "array", items: { type: "string" } }
|
|
385
|
+
},
|
|
386
|
+
required: ["type", "columns", "rows"]
|
|
387
|
+
}
|
|
388
|
+
};
|
|
389
|
+
var groupedRowSchema = zod.z.record(zod.z.string(), zod.z.union([zod.z.string(), zod.z.number(), zod.z.boolean(), zod.z.null()]));
|
|
390
|
+
var groupSchema = zod.z.object({
|
|
391
|
+
groupLabel: zod.z.string(),
|
|
392
|
+
rows: zod.z.array(groupedRowSchema).max(20),
|
|
393
|
+
subGroups: zod.z.array(zod.z.object({ groupLabel: zod.z.string(), rows: zod.z.array(groupedRowSchema).max(20) })).optional()
|
|
394
|
+
});
|
|
395
|
+
var groupedTableSchema = zod.z.object({
|
|
396
|
+
type: zod.z.literal("grouped-table"),
|
|
397
|
+
title: zod.z.string().optional(),
|
|
398
|
+
columns: zod.z.array(zod.z.object({
|
|
399
|
+
key: zod.z.string(),
|
|
400
|
+
label: zod.z.string(),
|
|
401
|
+
align: zod.z.string().transform((v) => {
|
|
402
|
+
var _a;
|
|
403
|
+
const map = { left: "start", right: "end", start: "start", center: "center", end: "end" };
|
|
404
|
+
return (_a = map[v]) != null ? _a : "start";
|
|
405
|
+
}).default("start")
|
|
406
|
+
})).min(1).max(10),
|
|
407
|
+
groups: zod.z.array(groupSchema).min(1).max(20)
|
|
408
|
+
});
|
|
409
|
+
var groupedTableTool = {
|
|
410
|
+
name: "render_grouped_table",
|
|
411
|
+
description: "Render a table with collapsible row groups \u2014 portfolio hierarchy, sleeve breakdown, consolidated view",
|
|
412
|
+
input_schema: {
|
|
413
|
+
type: "object",
|
|
414
|
+
properties: {
|
|
415
|
+
type: { type: "string", enum: ["grouped-table"] },
|
|
416
|
+
title: { type: "string" },
|
|
417
|
+
columns: {
|
|
418
|
+
type: "array",
|
|
419
|
+
items: { type: "object", properties: { key: { type: "string" }, label: { type: "string" }, align: { type: "string" } }, required: ["key", "label"] }
|
|
420
|
+
},
|
|
421
|
+
groups: {
|
|
422
|
+
type: "array",
|
|
423
|
+
items: {
|
|
424
|
+
type: "object",
|
|
425
|
+
properties: {
|
|
426
|
+
groupLabel: { type: "string" },
|
|
427
|
+
rows: { type: "array", items: { type: "object", additionalProperties: true } },
|
|
428
|
+
subGroups: {
|
|
429
|
+
type: "array",
|
|
430
|
+
items: {
|
|
431
|
+
type: "object",
|
|
432
|
+
properties: {
|
|
433
|
+
groupLabel: { type: "string" },
|
|
434
|
+
rows: { type: "array", items: { type: "object", additionalProperties: true } }
|
|
435
|
+
},
|
|
436
|
+
required: ["groupLabel", "rows"]
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
},
|
|
440
|
+
required: ["groupLabel", "rows"]
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
},
|
|
444
|
+
required: ["type", "columns", "groups"]
|
|
445
|
+
}
|
|
446
|
+
};
|
|
447
|
+
var newsFeedSchema = zod.z.object({
|
|
448
|
+
type: zod.z.literal("news-feed"),
|
|
449
|
+
title: zod.z.string().optional(),
|
|
450
|
+
items: zod.z.array(
|
|
451
|
+
zod.z.object({
|
|
452
|
+
headline: zod.z.string(),
|
|
453
|
+
source: zod.z.string(),
|
|
454
|
+
timestamp: zod.z.string(),
|
|
455
|
+
sentiment: zod.z.enum(["positive", "neutral", "negative"]),
|
|
456
|
+
summary: zod.z.string().optional(),
|
|
457
|
+
url: zod.z.string().optional()
|
|
458
|
+
})
|
|
459
|
+
).min(1).max(20)
|
|
460
|
+
});
|
|
461
|
+
var newsFeedTool = {
|
|
462
|
+
name: "render_news_feed",
|
|
463
|
+
description: "Render a list of news items with AI sentiment chips \u2014 news, catalysts, sentiment, macro",
|
|
464
|
+
input_schema: {
|
|
465
|
+
type: "object",
|
|
466
|
+
properties: {
|
|
467
|
+
type: { type: "string", enum: ["news-feed"] },
|
|
468
|
+
title: { type: "string" },
|
|
469
|
+
items: {
|
|
470
|
+
type: "array",
|
|
471
|
+
items: {
|
|
472
|
+
type: "object",
|
|
473
|
+
properties: {
|
|
474
|
+
headline: { type: "string" },
|
|
475
|
+
source: { type: "string" },
|
|
476
|
+
timestamp: { type: "string" },
|
|
477
|
+
sentiment: { type: "string", enum: ["positive", "neutral", "negative"] },
|
|
478
|
+
summary: { type: "string" },
|
|
479
|
+
url: { type: "string" }
|
|
480
|
+
},
|
|
481
|
+
required: ["headline", "source", "timestamp", "sentiment"]
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
},
|
|
485
|
+
required: ["type", "items"]
|
|
486
|
+
}
|
|
487
|
+
};
|
|
488
|
+
var areaChartSchema = zod.z.object({
|
|
489
|
+
type: zod.z.literal("area-chart"),
|
|
490
|
+
title: zod.z.string().optional(),
|
|
491
|
+
xKey: zod.z.string(),
|
|
492
|
+
series: zod.z.array(zod.z.object({ name: zod.z.string(), dataKey: zod.z.string(), color: zod.z.string() })).min(1).max(4),
|
|
493
|
+
data: zod.z.array(zod.z.record(zod.z.string(), zod.z.union([zod.z.string(), zod.z.number()]))).min(2).max(500)
|
|
494
|
+
});
|
|
495
|
+
var areaChartTool = {
|
|
496
|
+
name: "render_area_chart",
|
|
497
|
+
description: "Render a multi-series area chart for time series \u2014 cumulative return, benchmark comparison, drawdown",
|
|
498
|
+
input_schema: {
|
|
499
|
+
type: "object",
|
|
500
|
+
properties: {
|
|
501
|
+
type: { type: "string", enum: ["area-chart"] },
|
|
502
|
+
title: { type: "string" },
|
|
503
|
+
xKey: { type: "string", description: "The key in each data row used as the X-axis label (e.g. 'date')" },
|
|
504
|
+
series: {
|
|
505
|
+
type: "array",
|
|
506
|
+
items: {
|
|
507
|
+
type: "object",
|
|
508
|
+
properties: { name: { type: "string" }, dataKey: { type: "string" }, color: { type: "string", description: "CSS color, e.g. #6366f1" } },
|
|
509
|
+
required: ["name", "dataKey", "color"]
|
|
510
|
+
}
|
|
511
|
+
},
|
|
512
|
+
data: {
|
|
513
|
+
type: "array",
|
|
514
|
+
items: { type: "object", additionalProperties: true },
|
|
515
|
+
description: "Array of data rows. Each row must have xKey and all series dataKeys."
|
|
516
|
+
}
|
|
517
|
+
},
|
|
518
|
+
required: ["type", "xKey", "series", "data"]
|
|
519
|
+
}
|
|
520
|
+
};
|
|
521
|
+
var allocationDonutSchema = zod.z.object({
|
|
522
|
+
type: zod.z.literal("allocation-donut"),
|
|
523
|
+
title: zod.z.string().optional(),
|
|
524
|
+
slices: zod.z.array(
|
|
525
|
+
zod.z.object({
|
|
526
|
+
label: zod.z.string(),
|
|
527
|
+
value: zod.z.number(),
|
|
528
|
+
color: zod.z.string().optional(),
|
|
529
|
+
benchmark: zod.z.number().optional()
|
|
530
|
+
})
|
|
531
|
+
).min(2).max(12)
|
|
532
|
+
});
|
|
533
|
+
var allocationDonutTool = {
|
|
534
|
+
name: "render_allocation_donut",
|
|
535
|
+
description: "Render a donut chart with allocation breakdown table \u2014 portfolio, asset class, sector, geography",
|
|
536
|
+
input_schema: {
|
|
537
|
+
type: "object",
|
|
538
|
+
properties: {
|
|
539
|
+
type: { type: "string", enum: ["allocation-donut"] },
|
|
540
|
+
title: { type: "string" },
|
|
541
|
+
slices: {
|
|
542
|
+
type: "array",
|
|
543
|
+
items: {
|
|
544
|
+
type: "object",
|
|
545
|
+
properties: {
|
|
546
|
+
label: { type: "string" },
|
|
547
|
+
value: { type: "number", description: "Percentage 0-100" },
|
|
548
|
+
color: { type: "string", description: "Optional CSS color" },
|
|
549
|
+
benchmark: { type: "number", description: "Benchmark weight for over/underweight chip" }
|
|
550
|
+
},
|
|
551
|
+
required: ["label", "value"]
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
},
|
|
555
|
+
required: ["type", "slices"]
|
|
556
|
+
}
|
|
557
|
+
};
|
|
558
|
+
var waterfallChartSchema = zod.z.object({
|
|
559
|
+
type: zod.z.literal("waterfall-chart"),
|
|
560
|
+
title: zod.z.string().optional(),
|
|
561
|
+
bars: zod.z.array(
|
|
562
|
+
zod.z.object({
|
|
563
|
+
label: zod.z.string(),
|
|
564
|
+
value: zod.z.number(),
|
|
565
|
+
isTotal: zod.z.boolean().default(false)
|
|
566
|
+
})
|
|
567
|
+
).min(2).max(20),
|
|
568
|
+
unit: zod.z.string().default("%")
|
|
569
|
+
});
|
|
570
|
+
var waterfallChartTool = {
|
|
571
|
+
name: "render_waterfall_chart",
|
|
572
|
+
description: "Render a waterfall bar chart showing contribution of each factor to total return \u2014 factor attribution, P&L attribution",
|
|
573
|
+
input_schema: {
|
|
574
|
+
type: "object",
|
|
575
|
+
properties: {
|
|
576
|
+
type: { type: "string", enum: ["waterfall-chart"] },
|
|
577
|
+
title: { type: "string" },
|
|
578
|
+
bars: {
|
|
579
|
+
type: "array",
|
|
580
|
+
items: {
|
|
581
|
+
type: "object",
|
|
582
|
+
properties: {
|
|
583
|
+
label: { type: "string" },
|
|
584
|
+
value: { type: "number", description: "Positive or negative contribution" },
|
|
585
|
+
isTotal: { type: "boolean", description: "True for the total/net bar" }
|
|
586
|
+
},
|
|
587
|
+
required: ["label", "value"]
|
|
588
|
+
}
|
|
589
|
+
},
|
|
590
|
+
unit: { type: "string", description: "Unit label, e.g. '%' or 'bps'" }
|
|
591
|
+
},
|
|
592
|
+
required: ["type", "bars"]
|
|
593
|
+
}
|
|
594
|
+
};
|
|
595
|
+
var flowCanvasSchema = zod.z.object({
|
|
596
|
+
type: zod.z.literal("flow-canvas"),
|
|
597
|
+
// Stable identity. Re-send render_flow_canvas with the SAME id to update the
|
|
598
|
+
// existing card in place (e.g. as pipeline stages progress) instead of adding a
|
|
599
|
+
// new one.
|
|
600
|
+
id: zod.z.string().optional(),
|
|
601
|
+
title: zod.z.string().optional(),
|
|
602
|
+
description: zod.z.string().optional(),
|
|
603
|
+
diagram: zod.z.string().min(1),
|
|
604
|
+
// Per-node run status, keyed by Mermaid node id OR its label. Drives the
|
|
605
|
+
// pending/active/done/error styling + transition animation.
|
|
606
|
+
node_states: zod.z.record(zod.z.string(), zod.z.enum(["pending", "active", "done", "error"])).optional(),
|
|
607
|
+
// Auto-animate the flow running (loops) — for live demos. No on-screen controls.
|
|
608
|
+
autoplay: zod.z.boolean().optional()
|
|
609
|
+
});
|
|
610
|
+
var flowCanvasTool = {
|
|
611
|
+
name: "render_flow_canvas",
|
|
612
|
+
description: `Render a Mermaid diagram for user flows, workflows, system architecture, process maps, mind maps, ER diagrams, sequence diagrams, and any visual design artifact. Use when the user asks to visualize a process, flow, system, or diagram of any kind.`,
|
|
613
|
+
input_schema: {
|
|
614
|
+
type: "object",
|
|
615
|
+
properties: {
|
|
616
|
+
type: { type: "string", enum: ["flow-canvas"] },
|
|
617
|
+
id: {
|
|
618
|
+
type: "string",
|
|
619
|
+
description: "Stable id for this diagram. To UPDATE a previously shown flow (e.g. a pipeline as its stages progress), re-render with the SAME id and updated node_states \u2014 the existing card updates in place instead of a new one being added. Omit for one-off diagrams."
|
|
620
|
+
},
|
|
621
|
+
title: { type: "string", description: "Diagram title, shown above the canvas" },
|
|
622
|
+
description: { type: "string", description: "One-line description of what the diagram shows" },
|
|
623
|
+
node_states: {
|
|
624
|
+
type: "object",
|
|
625
|
+
description: "Optional per-node run status, keyed by the Mermaid node id or its label, value one of 'pending' | 'active' | 'done' | 'error'. Drives stage coloring + a paint animation. Update these (with the same id) as the workflow progresses.",
|
|
626
|
+
additionalProperties: { type: "string", enum: ["pending", "active", "done", "error"] }
|
|
627
|
+
},
|
|
628
|
+
autoplay: {
|
|
629
|
+
type: "boolean",
|
|
630
|
+
description: "When true, the flow auto-animates each node lighting up in sequence (loops) \u2014 use only to DEMO a workflow running when there is no real per-stage status to report."
|
|
631
|
+
},
|
|
632
|
+
diagram: {
|
|
633
|
+
type: "string",
|
|
634
|
+
description: `A valid Mermaid diagram string. Keep diagrams COMPACT \u2014 max 15 nodes, short labels (1-4 words each). No emojis anywhere.
|
|
635
|
+
|
|
636
|
+
flowchart TD (top-down flows and processes):
|
|
637
|
+
flowchart TD
|
|
638
|
+
A([Start]) --> B[Step One]
|
|
639
|
+
B --> C{Decision?}
|
|
640
|
+
C -->|Yes| D[Path A]
|
|
641
|
+
C -->|No| E[Path B]
|
|
642
|
+
D --> F([End])
|
|
643
|
+
E --> F
|
|
644
|
+
|
|
645
|
+
flowchart LR (left-right pipelines):
|
|
646
|
+
flowchart LR
|
|
647
|
+
A[Input] --> B[Process] --> C[Output]
|
|
648
|
+
|
|
649
|
+
sequenceDiagram (actor interactions):
|
|
650
|
+
sequenceDiagram
|
|
651
|
+
participant U as User
|
|
652
|
+
participant S as Server
|
|
653
|
+
U->>S: POST /login
|
|
654
|
+
S-->>U: 200 OK
|
|
655
|
+
|
|
656
|
+
erDiagram:
|
|
657
|
+
erDiagram
|
|
658
|
+
USER ||--o{ ORDER : places
|
|
659
|
+
ORDER ||--|{ LINE_ITEM : contains
|
|
660
|
+
|
|
661
|
+
classDiagram:
|
|
662
|
+
classDiagram
|
|
663
|
+
Animal <|-- Dog
|
|
664
|
+
Animal: +name string
|
|
665
|
+
|
|
666
|
+
RULES \u2014 follow these exactly:
|
|
667
|
+
- Max 15 nodes total. For complex topics, show the happy path only; omit edge cases
|
|
668
|
+
- Labels: 1-4 words, no punctuation other than / or &
|
|
669
|
+
- No emojis anywhere
|
|
670
|
+
- No inline style directives (style A fill:#...)
|
|
671
|
+
- Prefer TD for flows, LR for pipelines, sequence for interactions
|
|
672
|
+
- Use subgraph only when 2+ clear groups exist; max 2 subgraphs
|
|
673
|
+
- Do NOT wrap output in \`\`\`mermaid fences`
|
|
674
|
+
}
|
|
675
|
+
},
|
|
676
|
+
required: ["type", "diagram"]
|
|
677
|
+
}
|
|
678
|
+
};
|
|
679
|
+
var trialBalanceSchema = zod.z.object({
|
|
680
|
+
type: zod.z.literal("trial-balance"),
|
|
681
|
+
title: zod.z.string().optional(),
|
|
682
|
+
asOfDate: zod.z.string().optional(),
|
|
683
|
+
currency: zod.z.string().default("USD"),
|
|
684
|
+
groups: zod.z.array(
|
|
685
|
+
zod.z.object({
|
|
686
|
+
category: zod.z.enum(["assets", "liabilities", "equity", "revenue", "expenses", "other"]),
|
|
687
|
+
accounts: zod.z.array(
|
|
688
|
+
zod.z.object({
|
|
689
|
+
code: zod.z.string(),
|
|
690
|
+
name: zod.z.string(),
|
|
691
|
+
debit: zod.z.number().min(0).default(0),
|
|
692
|
+
credit: zod.z.number().min(0).default(0)
|
|
693
|
+
})
|
|
694
|
+
).min(1).max(30)
|
|
695
|
+
})
|
|
696
|
+
).min(1).max(6)
|
|
697
|
+
});
|
|
698
|
+
var trialBalanceTool = {
|
|
699
|
+
name: "render_trial_balance",
|
|
700
|
+
description: "Render a debit/credit trial balance grouped by account category \u2014 chart of accounts, balance verification",
|
|
701
|
+
input_schema: {
|
|
702
|
+
type: "object",
|
|
703
|
+
properties: {
|
|
704
|
+
type: { type: "string", enum: ["trial-balance"] },
|
|
705
|
+
title: { type: "string" },
|
|
706
|
+
asOfDate: { type: "string", description: "As-of date for the balance" },
|
|
707
|
+
currency: { type: "string", description: "ISO currency code, e.g. USD" },
|
|
708
|
+
groups: {
|
|
709
|
+
type: "array",
|
|
710
|
+
items: {
|
|
711
|
+
type: "object",
|
|
712
|
+
properties: {
|
|
713
|
+
category: {
|
|
714
|
+
type: "string",
|
|
715
|
+
enum: ["assets", "liabilities", "equity", "revenue", "expenses", "other"]
|
|
716
|
+
},
|
|
717
|
+
accounts: {
|
|
718
|
+
type: "array",
|
|
719
|
+
items: {
|
|
720
|
+
type: "object",
|
|
721
|
+
properties: {
|
|
722
|
+
code: { type: "string" },
|
|
723
|
+
name: { type: "string" },
|
|
724
|
+
debit: { type: "number", minimum: 0 },
|
|
725
|
+
credit: { type: "number", minimum: 0 }
|
|
726
|
+
},
|
|
727
|
+
required: ["code", "name"]
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
},
|
|
731
|
+
required: ["category", "accounts"]
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
},
|
|
735
|
+
required: ["type", "groups"]
|
|
736
|
+
}
|
|
737
|
+
};
|
|
738
|
+
var journalEntrySchema = zod.z.object({
|
|
739
|
+
type: zod.z.literal("journal-entry"),
|
|
740
|
+
title: zod.z.string().optional(),
|
|
741
|
+
entries: zod.z.array(
|
|
742
|
+
zod.z.object({
|
|
743
|
+
entryId: zod.z.string(),
|
|
744
|
+
date: zod.z.string(),
|
|
745
|
+
memo: zod.z.string().optional(),
|
|
746
|
+
status: zod.z.enum(["draft", "posted", "reversed", "pending-approval"]).default("posted"),
|
|
747
|
+
lines: zod.z.array(
|
|
748
|
+
zod.z.object({
|
|
749
|
+
account: zod.z.string(),
|
|
750
|
+
description: zod.z.string().optional(),
|
|
751
|
+
debit: zod.z.number().min(0).default(0),
|
|
752
|
+
credit: zod.z.number().min(0).default(0)
|
|
753
|
+
})
|
|
754
|
+
).min(2).max(20)
|
|
755
|
+
})
|
|
756
|
+
).min(1).max(10),
|
|
757
|
+
currency: zod.z.string().default("USD")
|
|
758
|
+
});
|
|
759
|
+
var journalEntryTool = {
|
|
760
|
+
name: "render_journal_entry",
|
|
761
|
+
description: "Render journal entries with debit/credit lines \u2014 transactions, adjusting entries, postings",
|
|
762
|
+
input_schema: {
|
|
763
|
+
type: "object",
|
|
764
|
+
properties: {
|
|
765
|
+
type: { type: "string", enum: ["journal-entry"] },
|
|
766
|
+
title: { type: "string" },
|
|
767
|
+
entries: {
|
|
768
|
+
type: "array",
|
|
769
|
+
items: {
|
|
770
|
+
type: "object",
|
|
771
|
+
properties: {
|
|
772
|
+
entryId: { type: "string" },
|
|
773
|
+
date: { type: "string", description: "ISO date" },
|
|
774
|
+
memo: { type: "string" },
|
|
775
|
+
status: { type: "string", enum: ["draft", "posted", "reversed", "pending-approval"] },
|
|
776
|
+
lines: {
|
|
777
|
+
type: "array",
|
|
778
|
+
items: {
|
|
779
|
+
type: "object",
|
|
780
|
+
properties: {
|
|
781
|
+
account: { type: "string" },
|
|
782
|
+
description: { type: "string" },
|
|
783
|
+
debit: { type: "number", minimum: 0 },
|
|
784
|
+
credit: { type: "number", minimum: 0 }
|
|
785
|
+
},
|
|
786
|
+
required: ["account"]
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
},
|
|
790
|
+
required: ["entryId", "date", "lines"]
|
|
791
|
+
}
|
|
792
|
+
},
|
|
793
|
+
currency: { type: "string" }
|
|
794
|
+
},
|
|
795
|
+
required: ["type", "entries"]
|
|
796
|
+
}
|
|
797
|
+
};
|
|
798
|
+
var agingReportSchema = zod.z.object({
|
|
799
|
+
type: zod.z.literal("aging-report"),
|
|
800
|
+
title: zod.z.string().optional(),
|
|
801
|
+
reportType: zod.z.enum(["receivable", "payable"]).default("receivable"),
|
|
802
|
+
asOfDate: zod.z.string().optional(),
|
|
803
|
+
currency: zod.z.string().default("USD"),
|
|
804
|
+
buckets: zod.z.array(zod.z.string()).min(2).max(7),
|
|
805
|
+
entities: zod.z.array(
|
|
806
|
+
zod.z.object({
|
|
807
|
+
name: zod.z.string(),
|
|
808
|
+
amounts: zod.z.array(zod.z.number()).min(2).max(7),
|
|
809
|
+
total: zod.z.number()
|
|
810
|
+
})
|
|
811
|
+
).min(1).max(50)
|
|
812
|
+
});
|
|
813
|
+
var agingReportTool = {
|
|
814
|
+
name: "render_aging_report",
|
|
815
|
+
description: "Render an AR/AP aging report with time buckets \u2014 overdue invoices, collections, payables aging",
|
|
816
|
+
input_schema: {
|
|
817
|
+
type: "object",
|
|
818
|
+
properties: {
|
|
819
|
+
type: { type: "string", enum: ["aging-report"] },
|
|
820
|
+
title: { type: "string" },
|
|
821
|
+
reportType: { type: "string", enum: ["receivable", "payable"] },
|
|
822
|
+
asOfDate: { type: "string" },
|
|
823
|
+
currency: { type: "string" },
|
|
824
|
+
buckets: {
|
|
825
|
+
type: "array",
|
|
826
|
+
items: { type: "string" },
|
|
827
|
+
description: "Aging bucket labels, e.g. ['Current','1-30','31-60','61-90','90+']"
|
|
828
|
+
},
|
|
829
|
+
entities: {
|
|
830
|
+
type: "array",
|
|
831
|
+
items: {
|
|
832
|
+
type: "object",
|
|
833
|
+
properties: {
|
|
834
|
+
name: { type: "string" },
|
|
835
|
+
amounts: { type: "array", items: { type: "number" }, description: "One amount per bucket" },
|
|
836
|
+
total: { type: "number" }
|
|
837
|
+
},
|
|
838
|
+
required: ["name", "amounts", "total"]
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
},
|
|
842
|
+
required: ["type", "buckets", "entities"]
|
|
843
|
+
}
|
|
844
|
+
};
|
|
845
|
+
var varianceAnalysisSchema = zod.z.object({
|
|
846
|
+
type: zod.z.literal("variance-analysis"),
|
|
847
|
+
title: zod.z.string().optional(),
|
|
848
|
+
currency: zod.z.string().default("USD"),
|
|
849
|
+
period: zod.z.string().optional(),
|
|
850
|
+
rows: zod.z.array(
|
|
851
|
+
zod.z.object({
|
|
852
|
+
lineItem: zod.z.string(),
|
|
853
|
+
budget: zod.z.number(),
|
|
854
|
+
actual: zod.z.number(),
|
|
855
|
+
isSubtotal: zod.z.boolean().default(false),
|
|
856
|
+
indent: zod.z.number().min(0).max(3).default(0)
|
|
857
|
+
})
|
|
858
|
+
).min(1).max(50),
|
|
859
|
+
favorableDirection: zod.z.enum(["higher", "lower"]).default("higher")
|
|
860
|
+
});
|
|
861
|
+
var varianceAnalysisTool = {
|
|
862
|
+
name: "render_variance_analysis",
|
|
863
|
+
description: "Render a budget vs actual table with variance columns \u2014 cost analysis, performance vs target",
|
|
864
|
+
input_schema: {
|
|
865
|
+
type: "object",
|
|
866
|
+
properties: {
|
|
867
|
+
type: { type: "string", enum: ["variance-analysis"] },
|
|
868
|
+
title: { type: "string" },
|
|
869
|
+
currency: { type: "string" },
|
|
870
|
+
period: { type: "string" },
|
|
871
|
+
rows: {
|
|
872
|
+
type: "array",
|
|
873
|
+
items: {
|
|
874
|
+
type: "object",
|
|
875
|
+
properties: {
|
|
876
|
+
lineItem: { type: "string" },
|
|
877
|
+
budget: { type: "number" },
|
|
878
|
+
actual: { type: "number" },
|
|
879
|
+
isSubtotal: { type: "boolean" },
|
|
880
|
+
indent: { type: "number", minimum: 0, maximum: 3 }
|
|
881
|
+
},
|
|
882
|
+
required: ["lineItem", "budget", "actual"]
|
|
883
|
+
}
|
|
884
|
+
},
|
|
885
|
+
favorableDirection: {
|
|
886
|
+
type: "string",
|
|
887
|
+
enum: ["higher", "lower"],
|
|
888
|
+
description: "Whether higher actual is favorable (revenue) or unfavorable (cost)"
|
|
889
|
+
}
|
|
890
|
+
},
|
|
891
|
+
required: ["type", "rows"]
|
|
892
|
+
}
|
|
893
|
+
};
|
|
894
|
+
var stackedBreakdownSchema = zod.z.object({
|
|
895
|
+
type: zod.z.literal("stacked-breakdown"),
|
|
896
|
+
title: zod.z.string().optional(),
|
|
897
|
+
currency: zod.z.string().default("USD"),
|
|
898
|
+
periods: zod.z.array(zod.z.string()).min(1).max(12),
|
|
899
|
+
categories: zod.z.array(
|
|
900
|
+
zod.z.object({
|
|
901
|
+
name: zod.z.string(),
|
|
902
|
+
color: zod.z.string().optional(),
|
|
903
|
+
values: zod.z.array(zod.z.number()).min(1).max(12)
|
|
904
|
+
})
|
|
905
|
+
).min(1).max(8),
|
|
906
|
+
totals: zod.z.array(zod.z.number()).optional()
|
|
907
|
+
});
|
|
908
|
+
var stackedBreakdownTool = {
|
|
909
|
+
name: "render_stacked_breakdown",
|
|
910
|
+
description: "Render a stacked bar chart with category breakdown across periods \u2014 cost breakdown, revenue by segment, liability composition, budget allocation",
|
|
911
|
+
input_schema: {
|
|
912
|
+
type: "object",
|
|
913
|
+
properties: {
|
|
914
|
+
type: { type: "string", enum: ["stacked-breakdown"] },
|
|
915
|
+
title: { type: "string" },
|
|
916
|
+
currency: { type: "string" },
|
|
917
|
+
periods: {
|
|
918
|
+
type: "array",
|
|
919
|
+
items: { type: "string" },
|
|
920
|
+
description: "Period labels, e.g. ['Q1 2024','Q2 2024']"
|
|
921
|
+
},
|
|
922
|
+
categories: {
|
|
923
|
+
type: "array",
|
|
924
|
+
items: {
|
|
925
|
+
type: "object",
|
|
926
|
+
properties: {
|
|
927
|
+
name: { type: "string" },
|
|
928
|
+
color: { type: "string" },
|
|
929
|
+
values: { type: "array", items: { type: "number" }, description: "One value per period" }
|
|
930
|
+
},
|
|
931
|
+
required: ["name", "values"]
|
|
932
|
+
}
|
|
933
|
+
},
|
|
934
|
+
totals: { type: "array", items: { type: "number" }, description: "Optional pre-computed totals per period" }
|
|
935
|
+
},
|
|
936
|
+
required: ["type", "periods", "categories"]
|
|
937
|
+
}
|
|
938
|
+
};
|
|
939
|
+
var comparativeBarChartSchema = zod.z.object({
|
|
940
|
+
type: zod.z.literal("comparative-bar-chart"),
|
|
941
|
+
title: zod.z.string().optional(),
|
|
942
|
+
mode: zod.z.enum(["grouped", "stacked"]).default("grouped"),
|
|
943
|
+
orientation: zod.z.enum(["vertical", "horizontal"]).default("vertical"),
|
|
944
|
+
xKey: zod.z.string(),
|
|
945
|
+
series: zod.z.array(
|
|
946
|
+
zod.z.object({
|
|
947
|
+
name: zod.z.string(),
|
|
948
|
+
dataKey: zod.z.string(),
|
|
949
|
+
color: zod.z.string().optional()
|
|
950
|
+
})
|
|
951
|
+
).min(1).max(6),
|
|
952
|
+
data: zod.z.array(zod.z.record(zod.z.string(), zod.z.union([zod.z.string(), zod.z.number()]))).min(1).max(24),
|
|
953
|
+
unit: zod.z.string().default(""),
|
|
954
|
+
showValues: zod.z.boolean().default(false)
|
|
955
|
+
});
|
|
956
|
+
var comparativeBarChartTool = {
|
|
957
|
+
name: "render_comparative_bar_chart",
|
|
958
|
+
description: "Render a grouped or stacked bar chart for comparisons \u2014 period-over-period, multi-entity benchmarks",
|
|
959
|
+
input_schema: {
|
|
960
|
+
type: "object",
|
|
961
|
+
properties: {
|
|
962
|
+
type: { type: "string", enum: ["comparative-bar-chart"] },
|
|
963
|
+
title: { type: "string" },
|
|
964
|
+
mode: { type: "string", enum: ["grouped", "stacked"] },
|
|
965
|
+
orientation: { type: "string", enum: ["vertical", "horizontal"] },
|
|
966
|
+
xKey: { type: "string", description: "Key in data objects for x-axis labels" },
|
|
967
|
+
series: {
|
|
968
|
+
type: "array",
|
|
969
|
+
items: {
|
|
970
|
+
type: "object",
|
|
971
|
+
properties: {
|
|
972
|
+
name: { type: "string" },
|
|
973
|
+
dataKey: { type: "string" },
|
|
974
|
+
color: { type: "string" }
|
|
975
|
+
},
|
|
976
|
+
required: ["name", "dataKey"]
|
|
977
|
+
}
|
|
978
|
+
},
|
|
979
|
+
data: { type: "array", items: { type: "object", additionalProperties: true } },
|
|
980
|
+
unit: { type: "string" },
|
|
981
|
+
showValues: { type: "boolean" }
|
|
982
|
+
},
|
|
983
|
+
required: ["type", "xKey", "series", "data"]
|
|
984
|
+
}
|
|
985
|
+
};
|
|
986
|
+
var complianceChecklistSchema = zod.z.object({
|
|
987
|
+
type: zod.z.literal("compliance-checklist"),
|
|
988
|
+
title: zod.z.string().optional(),
|
|
989
|
+
sections: zod.z.array(
|
|
990
|
+
zod.z.object({
|
|
991
|
+
sectionTitle: zod.z.string(),
|
|
992
|
+
items: zod.z.array(
|
|
993
|
+
zod.z.object({
|
|
994
|
+
id: zod.z.string(),
|
|
995
|
+
description: zod.z.string(),
|
|
996
|
+
status: zod.z.enum(["completed", "in-progress", "not-started", "overdue", "blocked", "na"]),
|
|
997
|
+
dueDate: zod.z.string().optional(),
|
|
998
|
+
assignee: zod.z.string().optional(),
|
|
999
|
+
notes: zod.z.string().optional(),
|
|
1000
|
+
priority: zod.z.enum(["critical", "high", "medium", "low"]).default("medium")
|
|
1001
|
+
})
|
|
1002
|
+
).min(1).max(25)
|
|
1003
|
+
})
|
|
1004
|
+
).min(1).max(10)
|
|
1005
|
+
});
|
|
1006
|
+
var complianceChecklistTool = {
|
|
1007
|
+
name: "render_compliance_checklist",
|
|
1008
|
+
description: "Render a regulatory checklist with status tracking \u2014 audit checklist, SOX, filing deadlines",
|
|
1009
|
+
input_schema: {
|
|
1010
|
+
type: "object",
|
|
1011
|
+
properties: {
|
|
1012
|
+
type: { type: "string", enum: ["compliance-checklist"] },
|
|
1013
|
+
title: { type: "string" },
|
|
1014
|
+
sections: {
|
|
1015
|
+
type: "array",
|
|
1016
|
+
items: {
|
|
1017
|
+
type: "object",
|
|
1018
|
+
properties: {
|
|
1019
|
+
sectionTitle: { type: "string" },
|
|
1020
|
+
items: {
|
|
1021
|
+
type: "array",
|
|
1022
|
+
items: {
|
|
1023
|
+
type: "object",
|
|
1024
|
+
properties: {
|
|
1025
|
+
id: { type: "string" },
|
|
1026
|
+
description: { type: "string" },
|
|
1027
|
+
status: {
|
|
1028
|
+
type: "string",
|
|
1029
|
+
enum: ["completed", "in-progress", "not-started", "overdue", "blocked", "na"]
|
|
1030
|
+
},
|
|
1031
|
+
dueDate: { type: "string" },
|
|
1032
|
+
assignee: { type: "string" },
|
|
1033
|
+
notes: { type: "string" },
|
|
1034
|
+
priority: { type: "string", enum: ["critical", "high", "medium", "low"] }
|
|
1035
|
+
},
|
|
1036
|
+
required: ["id", "description", "status"]
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
},
|
|
1040
|
+
required: ["sectionTitle", "items"]
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
},
|
|
1044
|
+
required: ["type", "sections"]
|
|
1045
|
+
}
|
|
1046
|
+
};
|
|
1047
|
+
var reconciliationViewSchema = zod.z.object({
|
|
1048
|
+
type: zod.z.literal("reconciliation-view"),
|
|
1049
|
+
title: zod.z.string().optional(),
|
|
1050
|
+
currency: zod.z.string().default("USD"),
|
|
1051
|
+
sourceA: zod.z.object({ label: zod.z.string() }),
|
|
1052
|
+
sourceB: zod.z.object({ label: zod.z.string() }),
|
|
1053
|
+
matched: zod.z.array(
|
|
1054
|
+
zod.z.object({
|
|
1055
|
+
date: zod.z.string(),
|
|
1056
|
+
description: zod.z.string(),
|
|
1057
|
+
amountA: zod.z.number(),
|
|
1058
|
+
amountB: zod.z.number(),
|
|
1059
|
+
reference: zod.z.string().optional()
|
|
1060
|
+
})
|
|
1061
|
+
).max(50).default([]),
|
|
1062
|
+
unmatchedA: zod.z.array(
|
|
1063
|
+
zod.z.object({
|
|
1064
|
+
date: zod.z.string(),
|
|
1065
|
+
description: zod.z.string(),
|
|
1066
|
+
amount: zod.z.number(),
|
|
1067
|
+
reference: zod.z.string().optional()
|
|
1068
|
+
})
|
|
1069
|
+
).max(30).default([]),
|
|
1070
|
+
unmatchedB: zod.z.array(
|
|
1071
|
+
zod.z.object({
|
|
1072
|
+
date: zod.z.string(),
|
|
1073
|
+
description: zod.z.string(),
|
|
1074
|
+
amount: zod.z.number(),
|
|
1075
|
+
reference: zod.z.string().optional()
|
|
1076
|
+
})
|
|
1077
|
+
).max(30).default([]),
|
|
1078
|
+
summary: zod.z.object({
|
|
1079
|
+
balanceA: zod.z.number(),
|
|
1080
|
+
balanceB: zod.z.number(),
|
|
1081
|
+
difference: zod.z.number()
|
|
1082
|
+
}).optional()
|
|
1083
|
+
});
|
|
1084
|
+
var reconciliationViewTool = {
|
|
1085
|
+
name: "render_reconciliation_view",
|
|
1086
|
+
description: "Render a side-by-side reconciliation of two sources \u2014 bank recon, intercompany matching",
|
|
1087
|
+
input_schema: {
|
|
1088
|
+
type: "object",
|
|
1089
|
+
properties: {
|
|
1090
|
+
type: { type: "string", enum: ["reconciliation-view"] },
|
|
1091
|
+
title: { type: "string" },
|
|
1092
|
+
currency: { type: "string" },
|
|
1093
|
+
sourceA: {
|
|
1094
|
+
type: "object",
|
|
1095
|
+
properties: { label: { type: "string" } },
|
|
1096
|
+
required: ["label"]
|
|
1097
|
+
},
|
|
1098
|
+
sourceB: {
|
|
1099
|
+
type: "object",
|
|
1100
|
+
properties: { label: { type: "string" } },
|
|
1101
|
+
required: ["label"]
|
|
1102
|
+
},
|
|
1103
|
+
matched: {
|
|
1104
|
+
type: "array",
|
|
1105
|
+
items: {
|
|
1106
|
+
type: "object",
|
|
1107
|
+
properties: {
|
|
1108
|
+
date: { type: "string" },
|
|
1109
|
+
description: { type: "string" },
|
|
1110
|
+
amountA: { type: "number" },
|
|
1111
|
+
amountB: { type: "number" },
|
|
1112
|
+
reference: { type: "string" }
|
|
1113
|
+
},
|
|
1114
|
+
required: ["date", "description", "amountA", "amountB"]
|
|
1115
|
+
}
|
|
1116
|
+
},
|
|
1117
|
+
unmatchedA: {
|
|
1118
|
+
type: "array",
|
|
1119
|
+
items: {
|
|
1120
|
+
type: "object",
|
|
1121
|
+
properties: {
|
|
1122
|
+
date: { type: "string" },
|
|
1123
|
+
description: { type: "string" },
|
|
1124
|
+
amount: { type: "number" },
|
|
1125
|
+
reference: { type: "string" }
|
|
1126
|
+
},
|
|
1127
|
+
required: ["date", "description", "amount"]
|
|
1128
|
+
}
|
|
1129
|
+
},
|
|
1130
|
+
unmatchedB: {
|
|
1131
|
+
type: "array",
|
|
1132
|
+
items: {
|
|
1133
|
+
type: "object",
|
|
1134
|
+
properties: {
|
|
1135
|
+
date: { type: "string" },
|
|
1136
|
+
description: { type: "string" },
|
|
1137
|
+
amount: { type: "number" },
|
|
1138
|
+
reference: { type: "string" }
|
|
1139
|
+
},
|
|
1140
|
+
required: ["date", "description", "amount"]
|
|
1141
|
+
}
|
|
1142
|
+
},
|
|
1143
|
+
summary: {
|
|
1144
|
+
type: "object",
|
|
1145
|
+
properties: {
|
|
1146
|
+
balanceA: { type: "number" },
|
|
1147
|
+
balanceB: { type: "number" },
|
|
1148
|
+
difference: { type: "number" }
|
|
1149
|
+
},
|
|
1150
|
+
required: ["balanceA", "balanceB", "difference"]
|
|
1151
|
+
}
|
|
1152
|
+
},
|
|
1153
|
+
required: ["type", "sourceA", "sourceB"]
|
|
1154
|
+
}
|
|
1155
|
+
};
|
|
1156
|
+
var auditTrailSchema = zod.z.object({
|
|
1157
|
+
type: zod.z.literal("audit-trail"),
|
|
1158
|
+
title: zod.z.string().optional(),
|
|
1159
|
+
entityName: zod.z.string().optional(),
|
|
1160
|
+
events: zod.z.array(
|
|
1161
|
+
zod.z.object({
|
|
1162
|
+
timestamp: zod.z.string(),
|
|
1163
|
+
actor: zod.z.string(),
|
|
1164
|
+
action: zod.z.enum([
|
|
1165
|
+
"created",
|
|
1166
|
+
"modified",
|
|
1167
|
+
"approved",
|
|
1168
|
+
"rejected",
|
|
1169
|
+
"deleted",
|
|
1170
|
+
"restored",
|
|
1171
|
+
"submitted",
|
|
1172
|
+
"commented"
|
|
1173
|
+
]),
|
|
1174
|
+
summary: zod.z.string(),
|
|
1175
|
+
changes: zod.z.array(
|
|
1176
|
+
zod.z.object({
|
|
1177
|
+
field: zod.z.string(),
|
|
1178
|
+
oldValue: zod.z.string().optional(),
|
|
1179
|
+
newValue: zod.z.string().optional()
|
|
1180
|
+
})
|
|
1181
|
+
).max(10).optional()
|
|
1182
|
+
})
|
|
1183
|
+
).min(1).max(50)
|
|
1184
|
+
});
|
|
1185
|
+
var auditTrailTool = {
|
|
1186
|
+
name: "render_audit_trail",
|
|
1187
|
+
description: "Render a chronological change log with diffs \u2014 revision history, modification tracking",
|
|
1188
|
+
input_schema: {
|
|
1189
|
+
type: "object",
|
|
1190
|
+
properties: {
|
|
1191
|
+
type: { type: "string", enum: ["audit-trail"] },
|
|
1192
|
+
title: { type: "string" },
|
|
1193
|
+
entityName: { type: "string" },
|
|
1194
|
+
events: {
|
|
1195
|
+
type: "array",
|
|
1196
|
+
items: {
|
|
1197
|
+
type: "object",
|
|
1198
|
+
properties: {
|
|
1199
|
+
timestamp: { type: "string", description: "ISO datetime" },
|
|
1200
|
+
actor: { type: "string" },
|
|
1201
|
+
action: {
|
|
1202
|
+
type: "string",
|
|
1203
|
+
enum: ["created", "modified", "approved", "rejected", "deleted", "restored", "submitted", "commented"]
|
|
1204
|
+
},
|
|
1205
|
+
summary: { type: "string" },
|
|
1206
|
+
changes: {
|
|
1207
|
+
type: "array",
|
|
1208
|
+
items: {
|
|
1209
|
+
type: "object",
|
|
1210
|
+
properties: {
|
|
1211
|
+
field: { type: "string" },
|
|
1212
|
+
oldValue: { type: "string" },
|
|
1213
|
+
newValue: { type: "string" }
|
|
1214
|
+
},
|
|
1215
|
+
required: ["field"]
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
},
|
|
1219
|
+
required: ["timestamp", "actor", "action", "summary"]
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
},
|
|
1223
|
+
required: ["type", "events"]
|
|
1224
|
+
}
|
|
1225
|
+
};
|
|
1226
|
+
var documentPreviewSchema = zod.z.object({
|
|
1227
|
+
type: zod.z.literal("document-preview"),
|
|
1228
|
+
title: zod.z.string().optional(),
|
|
1229
|
+
documentType: zod.z.enum(["pdf", "excel"]),
|
|
1230
|
+
source: zod.z.object({
|
|
1231
|
+
url: zod.z.string().optional(),
|
|
1232
|
+
base64: zod.z.string().optional(),
|
|
1233
|
+
filename: zod.z.string()
|
|
1234
|
+
}),
|
|
1235
|
+
pages: zod.z.array(
|
|
1236
|
+
zod.z.object({
|
|
1237
|
+
label: zod.z.string(),
|
|
1238
|
+
content: zod.z.string().optional(),
|
|
1239
|
+
imageUrl: zod.z.string().optional()
|
|
1240
|
+
})
|
|
1241
|
+
).min(1).max(100),
|
|
1242
|
+
metadata: zod.z.object({
|
|
1243
|
+
pageCount: zod.z.number().optional(),
|
|
1244
|
+
fileSize: zod.z.string().optional(),
|
|
1245
|
+
lastModified: zod.z.string().optional()
|
|
1246
|
+
}).optional(),
|
|
1247
|
+
highlights: zod.z.array(
|
|
1248
|
+
zod.z.object({
|
|
1249
|
+
pageIndex: zod.z.number(),
|
|
1250
|
+
text: zod.z.string(),
|
|
1251
|
+
color: zod.z.enum(["yellow", "red", "green", "blue"]).default("yellow"),
|
|
1252
|
+
note: zod.z.string().optional()
|
|
1253
|
+
})
|
|
1254
|
+
).max(50).optional()
|
|
1255
|
+
});
|
|
1256
|
+
var documentPreviewTool = {
|
|
1257
|
+
name: "render_document_preview",
|
|
1258
|
+
description: "Render a read-only document viewer for PDF/Excel \u2014 tax returns, financial statements, supporting docs. Demo files available: source.url='/demos/sample-tax-return.pdf' (3-page Q4 2024 tax return) and source.url='/demos/sample-budget.xlsx' (3-sheet Q4 2024 budget). When using a demo file, set source.url and provide pages with labels for fallback.",
|
|
1259
|
+
input_schema: {
|
|
1260
|
+
type: "object",
|
|
1261
|
+
properties: {
|
|
1262
|
+
type: { type: "string", enum: ["document-preview"] },
|
|
1263
|
+
title: { type: "string" },
|
|
1264
|
+
documentType: { type: "string", enum: ["pdf", "excel"] },
|
|
1265
|
+
source: {
|
|
1266
|
+
type: "object",
|
|
1267
|
+
properties: {
|
|
1268
|
+
url: { type: "string" },
|
|
1269
|
+
base64: { type: "string" },
|
|
1270
|
+
filename: { type: "string" }
|
|
1271
|
+
},
|
|
1272
|
+
required: ["filename"]
|
|
1273
|
+
},
|
|
1274
|
+
pages: {
|
|
1275
|
+
type: "array",
|
|
1276
|
+
items: {
|
|
1277
|
+
type: "object",
|
|
1278
|
+
properties: {
|
|
1279
|
+
label: { type: "string" },
|
|
1280
|
+
content: { type: "string", description: "Text content for accessibility" },
|
|
1281
|
+
imageUrl: { type: "string", description: "Pre-rendered page image URL" }
|
|
1282
|
+
},
|
|
1283
|
+
required: ["label"]
|
|
1284
|
+
}
|
|
1285
|
+
},
|
|
1286
|
+
metadata: {
|
|
1287
|
+
type: "object",
|
|
1288
|
+
properties: {
|
|
1289
|
+
pageCount: { type: "number" },
|
|
1290
|
+
fileSize: { type: "string" },
|
|
1291
|
+
lastModified: { type: "string" }
|
|
1292
|
+
}
|
|
1293
|
+
},
|
|
1294
|
+
highlights: {
|
|
1295
|
+
type: "array",
|
|
1296
|
+
items: {
|
|
1297
|
+
type: "object",
|
|
1298
|
+
properties: {
|
|
1299
|
+
pageIndex: { type: "number" },
|
|
1300
|
+
text: { type: "string" },
|
|
1301
|
+
color: { type: "string", enum: ["yellow", "red", "green", "blue"] },
|
|
1302
|
+
note: { type: "string" }
|
|
1303
|
+
},
|
|
1304
|
+
required: ["pageIndex", "text"]
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
},
|
|
1308
|
+
required: ["type", "documentType", "source", "pages"]
|
|
1309
|
+
}
|
|
1310
|
+
};
|
|
1311
|
+
var provenanceChainSchema = zod.z.object({
|
|
1312
|
+
type: zod.z.literal("provenance-chain"),
|
|
1313
|
+
title: zod.z.string().optional(),
|
|
1314
|
+
entity: zod.z.object({
|
|
1315
|
+
name: zod.z.string(),
|
|
1316
|
+
type: zod.z.string(),
|
|
1317
|
+
value: zod.z.string()
|
|
1318
|
+
}),
|
|
1319
|
+
steps: zod.z.array(
|
|
1320
|
+
zod.z.object({
|
|
1321
|
+
stepType: zod.z.enum(["source", "extraction", "rag-query", "reasoning", "computation"]),
|
|
1322
|
+
label: zod.z.string(),
|
|
1323
|
+
detail: zod.z.string(),
|
|
1324
|
+
source: zod.z.string().optional(),
|
|
1325
|
+
location: zod.z.string().optional(),
|
|
1326
|
+
confidence: zod.z.number().min(0).max(1).optional(),
|
|
1327
|
+
metadata: zod.z.record(zod.z.string(), zod.z.string()).optional()
|
|
1328
|
+
})
|
|
1329
|
+
).min(1).max(20),
|
|
1330
|
+
conclusion: zod.z.object({
|
|
1331
|
+
value: zod.z.string(),
|
|
1332
|
+
confidence: zod.z.number().min(0).max(1),
|
|
1333
|
+
status: zod.z.enum(["qualified", "partially-qualified", "not-qualified"])
|
|
1334
|
+
})
|
|
1335
|
+
});
|
|
1336
|
+
var provenanceChainTool = {
|
|
1337
|
+
name: "render_provenance_chain",
|
|
1338
|
+
description: "Render a provenance chain showing how a data value was derived \u2014 source documents, extractions, reasoning steps, confidence scores. Use for employee qualification traces, data lineage, audit provenance.",
|
|
1339
|
+
input_schema: {
|
|
1340
|
+
type: "object",
|
|
1341
|
+
properties: {
|
|
1342
|
+
type: { type: "string", enum: ["provenance-chain"] },
|
|
1343
|
+
title: { type: "string" },
|
|
1344
|
+
entity: {
|
|
1345
|
+
type: "object",
|
|
1346
|
+
properties: {
|
|
1347
|
+
name: { type: "string" },
|
|
1348
|
+
type: { type: "string" },
|
|
1349
|
+
value: { type: "string" }
|
|
1350
|
+
},
|
|
1351
|
+
required: ["name", "type", "value"]
|
|
1352
|
+
},
|
|
1353
|
+
steps: {
|
|
1354
|
+
type: "array",
|
|
1355
|
+
items: {
|
|
1356
|
+
type: "object",
|
|
1357
|
+
properties: {
|
|
1358
|
+
stepType: {
|
|
1359
|
+
type: "string",
|
|
1360
|
+
enum: ["source", "extraction", "rag-query", "reasoning", "computation"]
|
|
1361
|
+
},
|
|
1362
|
+
label: { type: "string" },
|
|
1363
|
+
detail: { type: "string" },
|
|
1364
|
+
source: { type: "string" },
|
|
1365
|
+
location: { type: "string" },
|
|
1366
|
+
confidence: { type: "number", minimum: 0, maximum: 1 },
|
|
1367
|
+
metadata: {
|
|
1368
|
+
type: "object",
|
|
1369
|
+
additionalProperties: { type: "string" }
|
|
1370
|
+
}
|
|
1371
|
+
},
|
|
1372
|
+
required: ["stepType", "label", "detail"]
|
|
1373
|
+
}
|
|
1374
|
+
},
|
|
1375
|
+
conclusion: {
|
|
1376
|
+
type: "object",
|
|
1377
|
+
properties: {
|
|
1378
|
+
value: { type: "string" },
|
|
1379
|
+
confidence: { type: "number", minimum: 0, maximum: 1 },
|
|
1380
|
+
status: {
|
|
1381
|
+
type: "string",
|
|
1382
|
+
enum: ["qualified", "partially-qualified", "not-qualified"]
|
|
1383
|
+
}
|
|
1384
|
+
},
|
|
1385
|
+
required: ["value", "confidence", "status"]
|
|
1386
|
+
}
|
|
1387
|
+
},
|
|
1388
|
+
required: ["type", "entity", "steps", "conclusion"]
|
|
1389
|
+
}
|
|
1390
|
+
};
|
|
1391
|
+
var searchResultsSchema = zod.z.object({
|
|
1392
|
+
type: zod.z.literal("search-results"),
|
|
1393
|
+
title: zod.z.string().optional(),
|
|
1394
|
+
query: zod.z.string(),
|
|
1395
|
+
totalResults: zod.z.number(),
|
|
1396
|
+
results: zod.z.array(zod.z.object({
|
|
1397
|
+
title: zod.z.string(),
|
|
1398
|
+
source: zod.z.string(),
|
|
1399
|
+
sourceType: zod.z.enum(["tech-memo", "questionnaire", "contract", "workpaper", "regulation", "other"]).optional(),
|
|
1400
|
+
relevance: zod.z.number().min(0).max(1),
|
|
1401
|
+
snippet: zod.z.string(),
|
|
1402
|
+
highlights: zod.z.array(zod.z.string()).optional(),
|
|
1403
|
+
location: zod.z.string().optional(),
|
|
1404
|
+
url: zod.z.string().optional()
|
|
1405
|
+
})).min(1).max(20)
|
|
1406
|
+
});
|
|
1407
|
+
var searchResultsTool = {
|
|
1408
|
+
name: "render_search_results",
|
|
1409
|
+
description: "Render ranked search results with relevance scores, source attribution, and content snippets \u2014 document search, regulatory search, knowledge base queries.",
|
|
1410
|
+
input_schema: {
|
|
1411
|
+
type: "object",
|
|
1412
|
+
properties: {
|
|
1413
|
+
type: { type: "string", enum: ["search-results"] },
|
|
1414
|
+
title: { type: "string" },
|
|
1415
|
+
query: { type: "string" },
|
|
1416
|
+
totalResults: { type: "number" },
|
|
1417
|
+
results: {
|
|
1418
|
+
type: "array",
|
|
1419
|
+
items: {
|
|
1420
|
+
type: "object",
|
|
1421
|
+
properties: {
|
|
1422
|
+
title: { type: "string" },
|
|
1423
|
+
source: { type: "string" },
|
|
1424
|
+
sourceType: {
|
|
1425
|
+
type: "string",
|
|
1426
|
+
enum: ["tech-memo", "questionnaire", "contract", "workpaper", "regulation", "other"]
|
|
1427
|
+
},
|
|
1428
|
+
relevance: { type: "number", minimum: 0, maximum: 1 },
|
|
1429
|
+
snippet: { type: "string" },
|
|
1430
|
+
highlights: { type: "array", items: { type: "string" } },
|
|
1431
|
+
location: { type: "string" },
|
|
1432
|
+
url: { type: "string" }
|
|
1433
|
+
},
|
|
1434
|
+
required: ["title", "source", "relevance", "snippet"]
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
},
|
|
1438
|
+
required: ["type", "query", "totalResults", "results"]
|
|
1439
|
+
}
|
|
1440
|
+
};
|
|
1441
|
+
var legalTestResultSchema = zod.z.object({
|
|
1442
|
+
type: zod.z.literal("legal-test-result"),
|
|
1443
|
+
title: zod.z.string().optional(),
|
|
1444
|
+
citation: zod.z.string().optional(),
|
|
1445
|
+
overallResult: zod.z.enum(["pass", "fail", "inconclusive", "partial"]),
|
|
1446
|
+
overallNarrative: zod.z.string().optional(),
|
|
1447
|
+
parts: zod.z.array(
|
|
1448
|
+
zod.z.object({
|
|
1449
|
+
partLabel: zod.z.string(),
|
|
1450
|
+
result: zod.z.enum(["pass", "fail", "inconclusive", "na"]),
|
|
1451
|
+
narrative: zod.z.string(),
|
|
1452
|
+
subRequirements: zod.z.array(
|
|
1453
|
+
zod.z.object({
|
|
1454
|
+
label: zod.z.string(),
|
|
1455
|
+
result: zod.z.enum(["pass", "fail", "inconclusive", "na"]),
|
|
1456
|
+
detail: zod.z.string().optional(),
|
|
1457
|
+
threshold: zod.z.string().optional(),
|
|
1458
|
+
evidence: zod.z.string().optional()
|
|
1459
|
+
})
|
|
1460
|
+
).max(10).optional(),
|
|
1461
|
+
examples: zod.z.array(
|
|
1462
|
+
zod.z.object({
|
|
1463
|
+
scenario: zod.z.string(),
|
|
1464
|
+
qualifies: zod.z.boolean(),
|
|
1465
|
+
explanation: zod.z.string()
|
|
1466
|
+
})
|
|
1467
|
+
).max(6).optional()
|
|
1468
|
+
})
|
|
1469
|
+
).min(1).max(8)
|
|
1470
|
+
});
|
|
1471
|
+
var legalTestResultTool = {
|
|
1472
|
+
name: "render_legal_test_result",
|
|
1473
|
+
description: "Render a hierarchical legal test result \u2014 IRC 41 four-part test, funded-research exclusion two-prong test, regulatory compliance determinations with pass/fail at each level, narrative reasoning, and evidence.",
|
|
1474
|
+
input_schema: {
|
|
1475
|
+
type: "object",
|
|
1476
|
+
properties: {
|
|
1477
|
+
type: { type: "string", enum: ["legal-test-result"] },
|
|
1478
|
+
title: { type: "string" },
|
|
1479
|
+
citation: { type: "string" },
|
|
1480
|
+
overallResult: {
|
|
1481
|
+
type: "string",
|
|
1482
|
+
enum: ["pass", "fail", "inconclusive", "partial"]
|
|
1483
|
+
},
|
|
1484
|
+
overallNarrative: { type: "string" },
|
|
1485
|
+
parts: {
|
|
1486
|
+
type: "array",
|
|
1487
|
+
items: {
|
|
1488
|
+
type: "object",
|
|
1489
|
+
properties: {
|
|
1490
|
+
partLabel: { type: "string" },
|
|
1491
|
+
result: {
|
|
1492
|
+
type: "string",
|
|
1493
|
+
enum: ["pass", "fail", "inconclusive", "na"]
|
|
1494
|
+
},
|
|
1495
|
+
narrative: { type: "string" },
|
|
1496
|
+
subRequirements: {
|
|
1497
|
+
type: "array",
|
|
1498
|
+
items: {
|
|
1499
|
+
type: "object",
|
|
1500
|
+
properties: {
|
|
1501
|
+
label: { type: "string" },
|
|
1502
|
+
result: {
|
|
1503
|
+
type: "string",
|
|
1504
|
+
enum: ["pass", "fail", "inconclusive", "na"]
|
|
1505
|
+
},
|
|
1506
|
+
detail: { type: "string" },
|
|
1507
|
+
threshold: { type: "string" },
|
|
1508
|
+
evidence: { type: "string" }
|
|
1509
|
+
},
|
|
1510
|
+
required: ["label", "result"]
|
|
1511
|
+
}
|
|
1512
|
+
},
|
|
1513
|
+
examples: {
|
|
1514
|
+
type: "array",
|
|
1515
|
+
items: {
|
|
1516
|
+
type: "object",
|
|
1517
|
+
properties: {
|
|
1518
|
+
scenario: { type: "string" },
|
|
1519
|
+
qualifies: { type: "boolean" },
|
|
1520
|
+
explanation: { type: "string" }
|
|
1521
|
+
},
|
|
1522
|
+
required: ["scenario", "qualifies", "explanation"]
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1525
|
+
},
|
|
1526
|
+
required: ["partLabel", "result", "narrative"]
|
|
1527
|
+
}
|
|
1528
|
+
}
|
|
1529
|
+
},
|
|
1530
|
+
required: ["type", "overallResult", "parts"]
|
|
1531
|
+
}
|
|
1532
|
+
};
|
|
1533
|
+
var engagementPipelineSchema = zod.z.object({
|
|
1534
|
+
type: zod.z.literal("engagement-pipeline"),
|
|
1535
|
+
title: zod.z.string().optional(),
|
|
1536
|
+
clientName: zod.z.string(),
|
|
1537
|
+
taxYear: zod.z.string(),
|
|
1538
|
+
currentPhase: zod.z.string(),
|
|
1539
|
+
phases: zod.z.array(
|
|
1540
|
+
zod.z.object({
|
|
1541
|
+
label: zod.z.string(),
|
|
1542
|
+
status: zod.z.enum(["completed", "in-progress", "pending", "blocked"]),
|
|
1543
|
+
completedDate: zod.z.string().optional(),
|
|
1544
|
+
progress: zod.z.number().min(0).max(100).optional(),
|
|
1545
|
+
milestones: zod.z.array(
|
|
1546
|
+
zod.z.object({
|
|
1547
|
+
label: zod.z.string(),
|
|
1548
|
+
completed: zod.z.boolean(),
|
|
1549
|
+
note: zod.z.string().optional()
|
|
1550
|
+
})
|
|
1551
|
+
).max(10).optional(),
|
|
1552
|
+
blockers: zod.z.array(zod.z.string()).max(5).optional()
|
|
1553
|
+
})
|
|
1554
|
+
).min(2).max(8),
|
|
1555
|
+
summary: zod.z.object({
|
|
1556
|
+
totalCredit: zod.z.string().optional(),
|
|
1557
|
+
daysRemaining: zod.z.number().optional(),
|
|
1558
|
+
lastActivity: zod.z.string().optional()
|
|
1559
|
+
}).optional()
|
|
1560
|
+
});
|
|
1561
|
+
var engagementPipelineTool = {
|
|
1562
|
+
name: "render_engagement_pipeline",
|
|
1563
|
+
description: "Render a multi-phase engagement pipeline with progress tracking \u2014 client engagement status, tax year progress, sequential workflow phases with milestones and blockers.",
|
|
1564
|
+
input_schema: {
|
|
1565
|
+
type: "object",
|
|
1566
|
+
properties: {
|
|
1567
|
+
type: { type: "string", enum: ["engagement-pipeline"] },
|
|
1568
|
+
title: { type: "string" },
|
|
1569
|
+
clientName: { type: "string" },
|
|
1570
|
+
taxYear: { type: "string" },
|
|
1571
|
+
currentPhase: { type: "string" },
|
|
1572
|
+
phases: {
|
|
1573
|
+
type: "array",
|
|
1574
|
+
items: {
|
|
1575
|
+
type: "object",
|
|
1576
|
+
properties: {
|
|
1577
|
+
label: { type: "string" },
|
|
1578
|
+
status: {
|
|
1579
|
+
type: "string",
|
|
1580
|
+
enum: ["completed", "in-progress", "pending", "blocked"]
|
|
1581
|
+
},
|
|
1582
|
+
completedDate: { type: "string" },
|
|
1583
|
+
progress: { type: "number", minimum: 0, maximum: 100 },
|
|
1584
|
+
milestones: {
|
|
1585
|
+
type: "array",
|
|
1586
|
+
items: {
|
|
1587
|
+
type: "object",
|
|
1588
|
+
properties: {
|
|
1589
|
+
label: { type: "string" },
|
|
1590
|
+
completed: { type: "boolean" },
|
|
1591
|
+
note: { type: "string" }
|
|
1592
|
+
},
|
|
1593
|
+
required: ["label", "completed"]
|
|
1594
|
+
}
|
|
1595
|
+
},
|
|
1596
|
+
blockers: { type: "array", items: { type: "string" } }
|
|
1597
|
+
},
|
|
1598
|
+
required: ["label", "status"]
|
|
1599
|
+
}
|
|
1600
|
+
},
|
|
1601
|
+
summary: {
|
|
1602
|
+
type: "object",
|
|
1603
|
+
properties: {
|
|
1604
|
+
totalCredit: { type: "string" },
|
|
1605
|
+
daysRemaining: { type: "number" },
|
|
1606
|
+
lastActivity: { type: "string" }
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1609
|
+
},
|
|
1610
|
+
required: ["type", "clientName", "taxYear", "currentPhase", "phases"]
|
|
1611
|
+
}
|
|
1612
|
+
};
|
|
1613
|
+
var entityCardGridSchema = zod.z.object({
|
|
1614
|
+
type: zod.z.literal("entity-card-grid"),
|
|
1615
|
+
title: zod.z.string().optional(),
|
|
1616
|
+
columns: zod.z.union([zod.z.literal(2), zod.z.literal(3), zod.z.literal(4)]).default(3),
|
|
1617
|
+
items: zod.z.array(
|
|
1618
|
+
zod.z.object({
|
|
1619
|
+
id: zod.z.string(),
|
|
1620
|
+
name: zod.z.string(),
|
|
1621
|
+
subtitle: zod.z.string().optional(),
|
|
1622
|
+
avatar: zod.z.string().optional(),
|
|
1623
|
+
badges: zod.z.array(
|
|
1624
|
+
zod.z.object({
|
|
1625
|
+
label: zod.z.string(),
|
|
1626
|
+
color: zod.z.enum(["green", "red", "amber", "blue", "purple", "gray"]).default("gray")
|
|
1627
|
+
})
|
|
1628
|
+
).optional(),
|
|
1629
|
+
fields: zod.z.array(zod.z.object({ label: zod.z.string(), value: zod.z.string() })).max(6).optional()
|
|
1630
|
+
})
|
|
1631
|
+
).min(1).max(24)
|
|
1632
|
+
});
|
|
1633
|
+
var entityCardGridTool = {
|
|
1634
|
+
name: "render_entity_card_grid",
|
|
1635
|
+
description: "Render a grid of entity cards for browsing collections \u2014 clients, contacts, products, teams, resources",
|
|
1636
|
+
input_schema: {
|
|
1637
|
+
type: "object",
|
|
1638
|
+
properties: {
|
|
1639
|
+
type: { type: "string", enum: ["entity-card-grid"] },
|
|
1640
|
+
title: { type: "string" },
|
|
1641
|
+
columns: { type: "number", enum: [2, 3, 4] },
|
|
1642
|
+
items: {
|
|
1643
|
+
type: "array",
|
|
1644
|
+
items: {
|
|
1645
|
+
type: "object",
|
|
1646
|
+
properties: {
|
|
1647
|
+
id: { type: "string" },
|
|
1648
|
+
name: { type: "string" },
|
|
1649
|
+
subtitle: { type: "string" },
|
|
1650
|
+
avatar: { type: "string" },
|
|
1651
|
+
badges: {
|
|
1652
|
+
type: "array",
|
|
1653
|
+
items: {
|
|
1654
|
+
type: "object",
|
|
1655
|
+
properties: {
|
|
1656
|
+
label: { type: "string" },
|
|
1657
|
+
color: {
|
|
1658
|
+
type: "string",
|
|
1659
|
+
enum: ["green", "red", "amber", "blue", "purple", "gray"]
|
|
1660
|
+
}
|
|
1661
|
+
},
|
|
1662
|
+
required: ["label"]
|
|
1663
|
+
}
|
|
1664
|
+
},
|
|
1665
|
+
fields: {
|
|
1666
|
+
type: "array",
|
|
1667
|
+
items: {
|
|
1668
|
+
type: "object",
|
|
1669
|
+
properties: {
|
|
1670
|
+
label: { type: "string" },
|
|
1671
|
+
value: { type: "string" }
|
|
1672
|
+
},
|
|
1673
|
+
required: ["label", "value"]
|
|
1674
|
+
}
|
|
1675
|
+
}
|
|
1676
|
+
},
|
|
1677
|
+
required: ["id", "name"]
|
|
1678
|
+
}
|
|
1679
|
+
}
|
|
1680
|
+
},
|
|
1681
|
+
required: ["type", "items"]
|
|
1682
|
+
}
|
|
1683
|
+
};
|
|
1684
|
+
var jobTrackerSchema = zod.z.object({
|
|
1685
|
+
type: zod.z.literal("job-tracker"),
|
|
1686
|
+
title: zod.z.string().optional(),
|
|
1687
|
+
jobId: zod.z.string(),
|
|
1688
|
+
status: zod.z.enum(["queued", "running", "completed", "failed", "cancelled"]),
|
|
1689
|
+
progress: zod.z.number().min(0).max(100).optional(),
|
|
1690
|
+
startedAt: zod.z.string().optional(),
|
|
1691
|
+
completedAt: zod.z.string().optional(),
|
|
1692
|
+
steps: zod.z.array(zod.z.object({
|
|
1693
|
+
label: zod.z.string(),
|
|
1694
|
+
status: zod.z.enum(["pending", "running", "completed", "failed", "skipped"]),
|
|
1695
|
+
duration: zod.z.string().optional()
|
|
1696
|
+
})).optional(),
|
|
1697
|
+
result: zod.z.object({
|
|
1698
|
+
summary: zod.z.string(),
|
|
1699
|
+
data: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
|
|
1700
|
+
}).optional(),
|
|
1701
|
+
error: zod.z.object({
|
|
1702
|
+
message: zod.z.string(),
|
|
1703
|
+
code: zod.z.string().optional()
|
|
1704
|
+
}).optional()
|
|
1705
|
+
});
|
|
1706
|
+
var jobTrackerTool = {
|
|
1707
|
+
name: "render_job_tracker",
|
|
1708
|
+
description: "Render a job or task status tracker with progress bar, steps, and result \u2014 for async operations, builds, imports, exports",
|
|
1709
|
+
input_schema: {
|
|
1710
|
+
type: "object",
|
|
1711
|
+
properties: {
|
|
1712
|
+
type: { type: "string", enum: ["job-tracker"] },
|
|
1713
|
+
title: { type: "string" },
|
|
1714
|
+
jobId: { type: "string" },
|
|
1715
|
+
status: { type: "string", enum: ["queued", "running", "completed", "failed", "cancelled"] },
|
|
1716
|
+
progress: { type: "number", minimum: 0, maximum: 100 },
|
|
1717
|
+
startedAt: { type: "string" },
|
|
1718
|
+
completedAt: { type: "string" },
|
|
1719
|
+
steps: {
|
|
1720
|
+
type: "array",
|
|
1721
|
+
items: {
|
|
1722
|
+
type: "object",
|
|
1723
|
+
properties: {
|
|
1724
|
+
label: { type: "string" },
|
|
1725
|
+
status: { type: "string", enum: ["pending", "running", "completed", "failed", "skipped"] },
|
|
1726
|
+
duration: { type: "string" }
|
|
1727
|
+
},
|
|
1728
|
+
required: ["label", "status"]
|
|
1729
|
+
}
|
|
1730
|
+
},
|
|
1731
|
+
result: {
|
|
1732
|
+
type: "object",
|
|
1733
|
+
properties: {
|
|
1734
|
+
summary: { type: "string" },
|
|
1735
|
+
data: { type: "object" }
|
|
1736
|
+
},
|
|
1737
|
+
required: ["summary"]
|
|
1738
|
+
},
|
|
1739
|
+
error: {
|
|
1740
|
+
type: "object",
|
|
1741
|
+
properties: {
|
|
1742
|
+
message: { type: "string" },
|
|
1743
|
+
code: { type: "string" }
|
|
1744
|
+
},
|
|
1745
|
+
required: ["message"]
|
|
1746
|
+
}
|
|
1747
|
+
},
|
|
1748
|
+
required: ["type", "jobId", "status"]
|
|
1749
|
+
}
|
|
1750
|
+
};
|
|
1751
|
+
var citedAnswerSchema = zod.z.object({
|
|
1752
|
+
type: zod.z.literal("cited-answer"),
|
|
1753
|
+
title: zod.z.string().optional(),
|
|
1754
|
+
answer: zod.z.string(),
|
|
1755
|
+
citations: zod.z.array(zod.z.object({
|
|
1756
|
+
id: zod.z.string(),
|
|
1757
|
+
label: zod.z.string(),
|
|
1758
|
+
source: zod.z.string(),
|
|
1759
|
+
sourceType: zod.z.string().optional(),
|
|
1760
|
+
snippet: zod.z.string(),
|
|
1761
|
+
url: zod.z.string().optional(),
|
|
1762
|
+
confidence: zod.z.number().min(0).max(1).optional()
|
|
1763
|
+
})).min(1).max(20),
|
|
1764
|
+
followUps: zod.z.array(zod.z.string()).max(5).optional()
|
|
1765
|
+
});
|
|
1766
|
+
var citedAnswerTool = {
|
|
1767
|
+
name: "render_cited_answer",
|
|
1768
|
+
description: "Render an AI-synthesized answer with inline numbered citations linking to source documents \u2014 for RAG answers, research synthesis, document Q&A",
|
|
1769
|
+
input_schema: {
|
|
1770
|
+
type: "object",
|
|
1771
|
+
properties: {
|
|
1772
|
+
type: { type: "string", enum: ["cited-answer"] },
|
|
1773
|
+
title: { type: "string" },
|
|
1774
|
+
answer: { type: "string", description: "Answer text with [n] citation markers" },
|
|
1775
|
+
citations: {
|
|
1776
|
+
type: "array",
|
|
1777
|
+
items: {
|
|
1778
|
+
type: "object",
|
|
1779
|
+
properties: {
|
|
1780
|
+
id: { type: "string" },
|
|
1781
|
+
label: { type: "string" },
|
|
1782
|
+
source: { type: "string" },
|
|
1783
|
+
sourceType: { type: "string" },
|
|
1784
|
+
snippet: { type: "string" },
|
|
1785
|
+
url: { type: "string" },
|
|
1786
|
+
confidence: { type: "number", minimum: 0, maximum: 1 }
|
|
1787
|
+
},
|
|
1788
|
+
required: ["id", "label", "source", "snippet"]
|
|
1789
|
+
}
|
|
1790
|
+
},
|
|
1791
|
+
followUps: { type: "array", items: { type: "string" } }
|
|
1792
|
+
},
|
|
1793
|
+
required: ["type", "answer", "citations"]
|
|
1794
|
+
}
|
|
1795
|
+
};
|
|
1796
|
+
var transactionFeedSchema = zod.z.object({
|
|
1797
|
+
type: zod.z.literal("transaction-feed"),
|
|
1798
|
+
title: zod.z.string().optional(),
|
|
1799
|
+
currency: zod.z.string().default("USD"),
|
|
1800
|
+
transactions: zod.z.array(zod.z.object({
|
|
1801
|
+
id: zod.z.string().optional(),
|
|
1802
|
+
date: zod.z.string(),
|
|
1803
|
+
description: zod.z.string(),
|
|
1804
|
+
amount: zod.z.number(),
|
|
1805
|
+
category: zod.z.string().optional(),
|
|
1806
|
+
counterparty: zod.z.string().optional(),
|
|
1807
|
+
balance: zod.z.number().optional(),
|
|
1808
|
+
status: zod.z.enum(["cleared", "pending", "reversed"]).default("cleared"),
|
|
1809
|
+
metadata: zod.z.record(zod.z.string(), zod.z.string()).optional()
|
|
1810
|
+
})).min(1).max(100)
|
|
1811
|
+
});
|
|
1812
|
+
var transactionFeedTool = {
|
|
1813
|
+
name: "render_transaction_feed",
|
|
1814
|
+
description: "Render a chronological transaction feed with amounts, categories, and running balance \u2014 for bank statements, ledger activity, order history",
|
|
1815
|
+
input_schema: {
|
|
1816
|
+
type: "object",
|
|
1817
|
+
properties: {
|
|
1818
|
+
type: { type: "string", enum: ["transaction-feed"] },
|
|
1819
|
+
title: { type: "string" },
|
|
1820
|
+
currency: { type: "string" },
|
|
1821
|
+
transactions: {
|
|
1822
|
+
type: "array",
|
|
1823
|
+
items: {
|
|
1824
|
+
type: "object",
|
|
1825
|
+
properties: {
|
|
1826
|
+
id: { type: "string" },
|
|
1827
|
+
date: { type: "string" },
|
|
1828
|
+
description: { type: "string" },
|
|
1829
|
+
amount: { type: "number" },
|
|
1830
|
+
category: { type: "string" },
|
|
1831
|
+
counterparty: { type: "string" },
|
|
1832
|
+
balance: { type: "number" },
|
|
1833
|
+
status: { type: "string", enum: ["cleared", "pending", "reversed"] },
|
|
1834
|
+
metadata: { type: "object", additionalProperties: { type: "string" } }
|
|
1835
|
+
},
|
|
1836
|
+
required: ["date", "description", "amount"]
|
|
1837
|
+
}
|
|
1838
|
+
}
|
|
1839
|
+
},
|
|
1840
|
+
required: ["type", "transactions"]
|
|
1841
|
+
}
|
|
1842
|
+
};
|
|
1843
|
+
var fileBrowserSchema = zod.z.object({
|
|
1844
|
+
type: zod.z.literal("file-browser"),
|
|
1845
|
+
title: zod.z.string().optional(),
|
|
1846
|
+
items: zod.z.array(zod.z.object({
|
|
1847
|
+
id: zod.z.string(),
|
|
1848
|
+
name: zod.z.string(),
|
|
1849
|
+
docType: zod.z.string().optional(),
|
|
1850
|
+
group: zod.z.string().optional(),
|
|
1851
|
+
size: zod.z.string().optional(),
|
|
1852
|
+
createdAt: zod.z.string().optional(),
|
|
1853
|
+
modifiedAt: zod.z.string().optional(),
|
|
1854
|
+
author: zod.z.string().optional(),
|
|
1855
|
+
tags: zod.z.array(zod.z.string()).optional(),
|
|
1856
|
+
// Optional: sandbox/agent-harness files often have no public URL. The
|
|
1857
|
+
// resolver falls back to read-only display when url is absent.
|
|
1858
|
+
url: zod.z.string().optional(),
|
|
1859
|
+
preview: zod.z.string().optional()
|
|
1860
|
+
})).min(1).max(50)
|
|
1861
|
+
});
|
|
1862
|
+
var fileBrowserTool = {
|
|
1863
|
+
name: "render_file_browser",
|
|
1864
|
+
description: "Render a document or file browser with type badges, grouping, and metadata \u2014 for document collections, file libraries, client documents",
|
|
1865
|
+
input_schema: {
|
|
1866
|
+
type: "object",
|
|
1867
|
+
properties: {
|
|
1868
|
+
type: { type: "string", enum: ["file-browser"] },
|
|
1869
|
+
title: { type: "string" },
|
|
1870
|
+
items: {
|
|
1871
|
+
type: "array",
|
|
1872
|
+
items: {
|
|
1873
|
+
type: "object",
|
|
1874
|
+
properties: {
|
|
1875
|
+
id: { type: "string" },
|
|
1876
|
+
name: { type: "string" },
|
|
1877
|
+
docType: { type: "string" },
|
|
1878
|
+
group: { type: "string" },
|
|
1879
|
+
size: { type: "string" },
|
|
1880
|
+
createdAt: { type: "string" },
|
|
1881
|
+
modifiedAt: { type: "string" },
|
|
1882
|
+
author: { type: "string" },
|
|
1883
|
+
tags: { type: "array", items: { type: "string" } },
|
|
1884
|
+
url: { type: "string" },
|
|
1885
|
+
preview: { type: "string" }
|
|
1886
|
+
},
|
|
1887
|
+
required: ["id", "name"]
|
|
1888
|
+
}
|
|
1889
|
+
}
|
|
1890
|
+
},
|
|
1891
|
+
required: ["type", "items"]
|
|
1892
|
+
}
|
|
1893
|
+
};
|
|
1894
|
+
var downloadCardSchema = zod.z.object({
|
|
1895
|
+
type: zod.z.literal("download-card"),
|
|
1896
|
+
title: zod.z.string().optional(),
|
|
1897
|
+
files: zod.z.array(zod.z.object({
|
|
1898
|
+
filename: zod.z.string(),
|
|
1899
|
+
url: zod.z.string(),
|
|
1900
|
+
fileType: zod.z.string().optional(),
|
|
1901
|
+
size: zod.z.string().optional(),
|
|
1902
|
+
expiresAt: zod.z.string().optional(),
|
|
1903
|
+
description: zod.z.string().optional(),
|
|
1904
|
+
// Opt out of inline preview for an otherwise-previewable type. Preview is
|
|
1905
|
+
// auto-enabled from the file type when the url is present; set false to
|
|
1906
|
+
// force download-only.
|
|
1907
|
+
preview: zod.z.boolean().optional()
|
|
1908
|
+
})).min(1).max(10)
|
|
1909
|
+
});
|
|
1910
|
+
var downloadCardTool = {
|
|
1911
|
+
name: "render_download_card",
|
|
1912
|
+
description: "Render download cards for files with filename, size, and download link \u2014 for export results, generated reports, file delivery",
|
|
1913
|
+
input_schema: {
|
|
1914
|
+
type: "object",
|
|
1915
|
+
properties: {
|
|
1916
|
+
type: { type: "string", enum: ["download-card"] },
|
|
1917
|
+
title: { type: "string" },
|
|
1918
|
+
files: {
|
|
1919
|
+
type: "array",
|
|
1920
|
+
items: {
|
|
1921
|
+
type: "object",
|
|
1922
|
+
properties: {
|
|
1923
|
+
filename: { type: "string" },
|
|
1924
|
+
url: { type: "string" },
|
|
1925
|
+
fileType: { type: "string" },
|
|
1926
|
+
size: { type: "string" },
|
|
1927
|
+
expiresAt: { type: "string" },
|
|
1928
|
+
description: { type: "string" },
|
|
1929
|
+
preview: { type: "boolean" }
|
|
1930
|
+
},
|
|
1931
|
+
required: ["filename", "url"]
|
|
1932
|
+
}
|
|
1933
|
+
}
|
|
1934
|
+
},
|
|
1935
|
+
required: ["type", "files"]
|
|
1936
|
+
}
|
|
1937
|
+
};
|
|
1938
|
+
var opsDashboardSchema = zod.z.object({
|
|
1939
|
+
type: zod.z.literal("ops-dashboard"),
|
|
1940
|
+
title: zod.z.string().optional(),
|
|
1941
|
+
items: zod.z.array(zod.z.object({
|
|
1942
|
+
id: zod.z.string(),
|
|
1943
|
+
name: zod.z.string(),
|
|
1944
|
+
state: zod.z.enum(["running", "paused", "stopped", "error"]),
|
|
1945
|
+
schedule: zod.z.string().optional(),
|
|
1946
|
+
lastRunAt: zod.z.string().optional(),
|
|
1947
|
+
nextRunAt: zod.z.string().optional(),
|
|
1948
|
+
metrics: zod.z.array(zod.z.object({ label: zod.z.string(), value: zod.z.string() })).max(4).optional(),
|
|
1949
|
+
health: zod.z.enum(["healthy", "degraded", "down"]).optional()
|
|
1950
|
+
})).min(1).max(12)
|
|
1951
|
+
});
|
|
1952
|
+
var opsDashboardTool = {
|
|
1953
|
+
name: "render_ops_dashboard",
|
|
1954
|
+
description: "Render an operational dashboard grid showing pipeline or service status cards \u2014 for monitoring pipelines, services, cron jobs, microservices",
|
|
1955
|
+
input_schema: {
|
|
1956
|
+
type: "object",
|
|
1957
|
+
properties: {
|
|
1958
|
+
type: { type: "string", enum: ["ops-dashboard"] },
|
|
1959
|
+
title: { type: "string" },
|
|
1960
|
+
items: {
|
|
1961
|
+
type: "array",
|
|
1962
|
+
items: {
|
|
1963
|
+
type: "object",
|
|
1964
|
+
properties: {
|
|
1965
|
+
id: { type: "string" },
|
|
1966
|
+
name: { type: "string" },
|
|
1967
|
+
state: { type: "string", enum: ["running", "paused", "stopped", "error"] },
|
|
1968
|
+
schedule: { type: "string" },
|
|
1969
|
+
lastRunAt: { type: "string" },
|
|
1970
|
+
nextRunAt: { type: "string" },
|
|
1971
|
+
metrics: { type: "array", items: { type: "object", properties: { label: { type: "string" }, value: { type: "string" } }, required: ["label", "value"] } },
|
|
1972
|
+
health: { type: "string", enum: ["healthy", "degraded", "down"] }
|
|
1973
|
+
},
|
|
1974
|
+
required: ["id", "name", "state"]
|
|
1975
|
+
}
|
|
1976
|
+
}
|
|
1977
|
+
},
|
|
1978
|
+
required: ["type", "items"]
|
|
1979
|
+
}
|
|
1980
|
+
};
|
|
1981
|
+
var kvItemSchema = zod.z.object({
|
|
1982
|
+
key: zod.z.string(),
|
|
1983
|
+
value: zod.z.string(),
|
|
1984
|
+
type: zod.z.enum(["text", "date", "url", "boolean", "code", "currency"]).default("text"),
|
|
1985
|
+
copyable: zod.z.boolean().default(false)
|
|
1986
|
+
});
|
|
1987
|
+
var keyValueListSchema = zod.z.object({
|
|
1988
|
+
type: zod.z.literal("key-value-list"),
|
|
1989
|
+
title: zod.z.string().optional(),
|
|
1990
|
+
groups: zod.z.array(zod.z.object({
|
|
1991
|
+
label: zod.z.string(),
|
|
1992
|
+
items: zod.z.array(kvItemSchema).min(1).max(20)
|
|
1993
|
+
})).optional(),
|
|
1994
|
+
items: zod.z.array(kvItemSchema).max(30).optional()
|
|
1995
|
+
});
|
|
1996
|
+
var keyValueListTool = {
|
|
1997
|
+
name: "render_key_value_list",
|
|
1998
|
+
description: "Render a structured key-value list with optional grouping and type-aware formatting \u2014 for API responses, config displays, metadata, extraction results",
|
|
1999
|
+
input_schema: {
|
|
2000
|
+
type: "object",
|
|
2001
|
+
properties: {
|
|
2002
|
+
type: { type: "string", enum: ["key-value-list"] },
|
|
2003
|
+
title: { type: "string" },
|
|
2004
|
+
groups: {
|
|
2005
|
+
type: "array",
|
|
2006
|
+
items: {
|
|
2007
|
+
type: "object",
|
|
2008
|
+
properties: {
|
|
2009
|
+
label: { type: "string" },
|
|
2010
|
+
items: {
|
|
2011
|
+
type: "array",
|
|
2012
|
+
items: {
|
|
2013
|
+
type: "object",
|
|
2014
|
+
properties: {
|
|
2015
|
+
key: { type: "string" },
|
|
2016
|
+
value: { type: "string" },
|
|
2017
|
+
type: { type: "string", enum: ["text", "date", "url", "boolean", "code", "currency"] },
|
|
2018
|
+
copyable: { type: "boolean" }
|
|
2019
|
+
},
|
|
2020
|
+
required: ["key", "value"]
|
|
2021
|
+
}
|
|
2022
|
+
}
|
|
2023
|
+
},
|
|
2024
|
+
required: ["label", "items"]
|
|
2025
|
+
}
|
|
2026
|
+
},
|
|
2027
|
+
items: {
|
|
2028
|
+
type: "array",
|
|
2029
|
+
items: {
|
|
2030
|
+
type: "object",
|
|
2031
|
+
properties: {
|
|
2032
|
+
key: { type: "string" },
|
|
2033
|
+
value: { type: "string" },
|
|
2034
|
+
type: { type: "string", enum: ["text", "date", "url", "boolean", "code", "currency"] },
|
|
2035
|
+
copyable: { type: "boolean" }
|
|
2036
|
+
},
|
|
2037
|
+
required: ["key", "value"]
|
|
2038
|
+
}
|
|
2039
|
+
}
|
|
2040
|
+
},
|
|
2041
|
+
required: ["type"]
|
|
2042
|
+
}
|
|
2043
|
+
};
|
|
2044
|
+
var totalLineSchema = zod.z.object({
|
|
2045
|
+
currentPeriod: zod.z.number(),
|
|
2046
|
+
priorPeriod: zod.z.number().optional()
|
|
2047
|
+
});
|
|
2048
|
+
var balanceSheetSchema = zod.z.object({
|
|
2049
|
+
type: zod.z.literal("balance-sheet"),
|
|
2050
|
+
title: zod.z.string().optional(),
|
|
2051
|
+
currency: zod.z.string().default("USD"),
|
|
2052
|
+
metadata: zod.z.object({
|
|
2053
|
+
companyName: zod.z.string().optional(),
|
|
2054
|
+
preparedBy: zod.z.string().optional(),
|
|
2055
|
+
reviewedBy: zod.z.string().optional(),
|
|
2056
|
+
approvedBy: zod.z.string().optional(),
|
|
2057
|
+
status: zod.z.enum(["draft", "pending-review", "approved", "filed"]).optional(),
|
|
2058
|
+
date: zod.z.string().optional()
|
|
2059
|
+
}).optional(),
|
|
2060
|
+
currentPeriodLabel: zod.z.string(),
|
|
2061
|
+
priorPeriodLabel: zod.z.string().optional(),
|
|
2062
|
+
sections: zod.z.array(
|
|
2063
|
+
zod.z.object({
|
|
2064
|
+
category: zod.z.enum(["assets", "liabilities", "equity"]),
|
|
2065
|
+
subsections: zod.z.array(
|
|
2066
|
+
zod.z.object({
|
|
2067
|
+
label: zod.z.string(),
|
|
2068
|
+
items: zod.z.array(
|
|
2069
|
+
zod.z.object({
|
|
2070
|
+
name: zod.z.string(),
|
|
2071
|
+
currentPeriod: zod.z.number(),
|
|
2072
|
+
priorPeriod: zod.z.number().optional()
|
|
2073
|
+
})
|
|
2074
|
+
).max(15),
|
|
2075
|
+
subtotal: totalLineSchema.optional()
|
|
2076
|
+
})
|
|
2077
|
+
).min(1).max(5),
|
|
2078
|
+
total: totalLineSchema.optional()
|
|
2079
|
+
})
|
|
2080
|
+
).min(1).max(3),
|
|
2081
|
+
totalLiabilitiesAndEquity: totalLineSchema.optional()
|
|
2082
|
+
});
|
|
2083
|
+
var balanceSheetTool = {
|
|
2084
|
+
name: "render_balance_sheet",
|
|
2085
|
+
description: "Render a balance sheet with assets, liabilities, and equity sections \u2014 statement of financial position, A = L + E comparison",
|
|
2086
|
+
input_schema: {
|
|
2087
|
+
type: "object",
|
|
2088
|
+
properties: {
|
|
2089
|
+
type: { type: "string", enum: ["balance-sheet"] },
|
|
2090
|
+
title: { type: "string" },
|
|
2091
|
+
currency: { type: "string", description: "ISO currency code, e.g. USD" },
|
|
2092
|
+
metadata: {
|
|
2093
|
+
type: "object",
|
|
2094
|
+
properties: {
|
|
2095
|
+
companyName: { type: "string" },
|
|
2096
|
+
preparedBy: { type: "string" },
|
|
2097
|
+
reviewedBy: { type: "string" },
|
|
2098
|
+
approvedBy: { type: "string" },
|
|
2099
|
+
status: { type: "string", enum: ["draft", "pending-review", "approved", "filed"] },
|
|
2100
|
+
date: { type: "string" }
|
|
2101
|
+
}
|
|
2102
|
+
},
|
|
2103
|
+
currentPeriodLabel: { type: "string", description: "Label for current period column, e.g. Dec 31, 2024" },
|
|
2104
|
+
priorPeriodLabel: { type: "string", description: "Label for prior period column, e.g. Dec 31, 2023" },
|
|
2105
|
+
sections: {
|
|
2106
|
+
type: "array",
|
|
2107
|
+
items: {
|
|
2108
|
+
type: "object",
|
|
2109
|
+
properties: {
|
|
2110
|
+
category: {
|
|
2111
|
+
type: "string",
|
|
2112
|
+
enum: ["assets", "liabilities", "equity"]
|
|
2113
|
+
},
|
|
2114
|
+
subsections: {
|
|
2115
|
+
type: "array",
|
|
2116
|
+
items: {
|
|
2117
|
+
type: "object",
|
|
2118
|
+
properties: {
|
|
2119
|
+
label: { type: "string", description: "Subsection label, e.g. Current Assets" },
|
|
2120
|
+
items: {
|
|
2121
|
+
type: "array",
|
|
2122
|
+
items: {
|
|
2123
|
+
type: "object",
|
|
2124
|
+
properties: {
|
|
2125
|
+
name: { type: "string" },
|
|
2126
|
+
currentPeriod: { type: "number" },
|
|
2127
|
+
priorPeriod: { type: "number" }
|
|
2128
|
+
},
|
|
2129
|
+
required: ["name", "currentPeriod"]
|
|
2130
|
+
}
|
|
2131
|
+
},
|
|
2132
|
+
subtotal: {
|
|
2133
|
+
type: "object",
|
|
2134
|
+
properties: {
|
|
2135
|
+
currentPeriod: { type: "number" },
|
|
2136
|
+
priorPeriod: { type: "number" }
|
|
2137
|
+
},
|
|
2138
|
+
required: ["currentPeriod"]
|
|
2139
|
+
}
|
|
2140
|
+
},
|
|
2141
|
+
required: ["label", "items"]
|
|
2142
|
+
}
|
|
2143
|
+
}
|
|
2144
|
+
},
|
|
2145
|
+
required: ["category", "subsections"]
|
|
2146
|
+
}
|
|
2147
|
+
},
|
|
2148
|
+
totalLiabilitiesAndEquity: {
|
|
2149
|
+
type: "object",
|
|
2150
|
+
properties: {
|
|
2151
|
+
currentPeriod: { type: "number" },
|
|
2152
|
+
priorPeriod: { type: "number" }
|
|
2153
|
+
},
|
|
2154
|
+
required: ["currentPeriod"]
|
|
2155
|
+
}
|
|
2156
|
+
},
|
|
2157
|
+
required: ["type", "currentPeriodLabel", "sections"]
|
|
2158
|
+
}
|
|
2159
|
+
};
|
|
2160
|
+
var incomeStatementSchema = zod.z.object({
|
|
2161
|
+
type: zod.z.literal("income-statement"),
|
|
2162
|
+
title: zod.z.string().optional(),
|
|
2163
|
+
currency: zod.z.string().default("USD"),
|
|
2164
|
+
metadata: zod.z.object({
|
|
2165
|
+
companyName: zod.z.string().optional(),
|
|
2166
|
+
preparedBy: zod.z.string().optional(),
|
|
2167
|
+
reviewedBy: zod.z.string().optional(),
|
|
2168
|
+
approvedBy: zod.z.string().optional(),
|
|
2169
|
+
status: zod.z.enum(["draft", "pending-review", "approved", "filed"]).optional(),
|
|
2170
|
+
date: zod.z.string().optional()
|
|
2171
|
+
}).optional(),
|
|
2172
|
+
periods: zod.z.array(zod.z.string()).min(1).max(8),
|
|
2173
|
+
showPercentOfRevenue: zod.z.boolean().default(false),
|
|
2174
|
+
sections: zod.z.array(
|
|
2175
|
+
zod.z.object({
|
|
2176
|
+
label: zod.z.string(),
|
|
2177
|
+
lineItems: zod.z.array(
|
|
2178
|
+
zod.z.object({
|
|
2179
|
+
name: zod.z.string(),
|
|
2180
|
+
amounts: zod.z.array(zod.z.number()),
|
|
2181
|
+
indent: zod.z.number().min(0).max(2).default(0),
|
|
2182
|
+
isSubtotal: zod.z.boolean().optional()
|
|
2183
|
+
})
|
|
2184
|
+
).max(20),
|
|
2185
|
+
sectionType: zod.z.enum(["detail", "subtotal"]).default("detail")
|
|
2186
|
+
})
|
|
2187
|
+
).min(1).max(10),
|
|
2188
|
+
calculatedTotals: zod.z.object({
|
|
2189
|
+
grossProfit: zod.z.array(zod.z.number()).optional(),
|
|
2190
|
+
operatingIncome: zod.z.array(zod.z.number()).optional(),
|
|
2191
|
+
netIncome: zod.z.array(zod.z.number())
|
|
2192
|
+
})
|
|
2193
|
+
});
|
|
2194
|
+
var incomeStatementTool = {
|
|
2195
|
+
name: "render_income_statement",
|
|
2196
|
+
description: "Render a multi-period income statement with revenue, COGS, gross profit, operating expenses, and net income \u2014 P&L, profit and loss",
|
|
2197
|
+
input_schema: {
|
|
2198
|
+
type: "object",
|
|
2199
|
+
properties: {
|
|
2200
|
+
type: { type: "string", enum: ["income-statement"] },
|
|
2201
|
+
title: { type: "string" },
|
|
2202
|
+
currency: { type: "string", description: "ISO currency code, e.g. USD" },
|
|
2203
|
+
metadata: {
|
|
2204
|
+
type: "object",
|
|
2205
|
+
properties: {
|
|
2206
|
+
companyName: { type: "string" },
|
|
2207
|
+
preparedBy: { type: "string" },
|
|
2208
|
+
reviewedBy: { type: "string" },
|
|
2209
|
+
approvedBy: { type: "string" },
|
|
2210
|
+
status: { type: "string", enum: ["draft", "pending-review", "approved", "filed"] },
|
|
2211
|
+
date: { type: "string" }
|
|
2212
|
+
}
|
|
2213
|
+
},
|
|
2214
|
+
periods: {
|
|
2215
|
+
type: "array",
|
|
2216
|
+
items: { type: "string" },
|
|
2217
|
+
minItems: 1,
|
|
2218
|
+
maxItems: 8,
|
|
2219
|
+
description: "Period labels, e.g. Q1 2024, Q2 2024"
|
|
2220
|
+
},
|
|
2221
|
+
showPercentOfRevenue: {
|
|
2222
|
+
type: "boolean",
|
|
2223
|
+
description: "Show each line item as a percentage of revenue"
|
|
2224
|
+
},
|
|
2225
|
+
sections: {
|
|
2226
|
+
type: "array",
|
|
2227
|
+
items: {
|
|
2228
|
+
type: "object",
|
|
2229
|
+
properties: {
|
|
2230
|
+
label: { type: "string" },
|
|
2231
|
+
lineItems: {
|
|
2232
|
+
type: "array",
|
|
2233
|
+
items: {
|
|
2234
|
+
type: "object",
|
|
2235
|
+
properties: {
|
|
2236
|
+
name: { type: "string" },
|
|
2237
|
+
amounts: {
|
|
2238
|
+
type: "array",
|
|
2239
|
+
items: { type: "number" },
|
|
2240
|
+
description: "One amount per period"
|
|
2241
|
+
},
|
|
2242
|
+
indent: {
|
|
2243
|
+
type: "number",
|
|
2244
|
+
minimum: 0,
|
|
2245
|
+
maximum: 2,
|
|
2246
|
+
description: "Indentation level 0-2"
|
|
2247
|
+
},
|
|
2248
|
+
isSubtotal: {
|
|
2249
|
+
type: "boolean",
|
|
2250
|
+
description: "True for a subtotal/total row (e.g. 'Total Revenue'). Excluded from the %-of-revenue base so it isn't double-counted."
|
|
2251
|
+
}
|
|
2252
|
+
},
|
|
2253
|
+
required: ["name", "amounts"]
|
|
2254
|
+
}
|
|
2255
|
+
},
|
|
2256
|
+
sectionType: {
|
|
2257
|
+
type: "string",
|
|
2258
|
+
enum: ["detail", "subtotal"]
|
|
2259
|
+
}
|
|
2260
|
+
},
|
|
2261
|
+
required: ["label", "lineItems"]
|
|
2262
|
+
}
|
|
2263
|
+
},
|
|
2264
|
+
calculatedTotals: {
|
|
2265
|
+
type: "object",
|
|
2266
|
+
properties: {
|
|
2267
|
+
grossProfit: {
|
|
2268
|
+
type: "array",
|
|
2269
|
+
items: { type: "number" },
|
|
2270
|
+
description: "Gross profit per period"
|
|
2271
|
+
},
|
|
2272
|
+
operatingIncome: {
|
|
2273
|
+
type: "array",
|
|
2274
|
+
items: { type: "number" },
|
|
2275
|
+
description: "Operating income per period"
|
|
2276
|
+
},
|
|
2277
|
+
netIncome: {
|
|
2278
|
+
type: "array",
|
|
2279
|
+
items: { type: "number" },
|
|
2280
|
+
description: "Net income per period"
|
|
2281
|
+
}
|
|
2282
|
+
},
|
|
2283
|
+
required: ["netIncome"]
|
|
2284
|
+
}
|
|
2285
|
+
},
|
|
2286
|
+
required: ["type", "periods", "sections", "calculatedTotals"]
|
|
2287
|
+
}
|
|
2288
|
+
};
|
|
2289
|
+
var cashFlowStatementSchema = zod.z.object({
|
|
2290
|
+
type: zod.z.literal("cash-flow-statement"),
|
|
2291
|
+
title: zod.z.string().optional(),
|
|
2292
|
+
currency: zod.z.string().default("USD"),
|
|
2293
|
+
metadata: zod.z.object({
|
|
2294
|
+
companyName: zod.z.string().optional(),
|
|
2295
|
+
preparedBy: zod.z.string().optional(),
|
|
2296
|
+
reviewedBy: zod.z.string().optional(),
|
|
2297
|
+
approvedBy: zod.z.string().optional(),
|
|
2298
|
+
status: zod.z.enum(["draft", "pending-review", "approved", "filed"]).optional(),
|
|
2299
|
+
date: zod.z.string().optional()
|
|
2300
|
+
}).optional(),
|
|
2301
|
+
periodLabel: zod.z.string().optional(),
|
|
2302
|
+
priorPeriodLabel: zod.z.string().optional(),
|
|
2303
|
+
activities: zod.z.array(
|
|
2304
|
+
zod.z.object({
|
|
2305
|
+
activityType: zod.z.enum(["operating", "investing", "financing"]),
|
|
2306
|
+
lineItems: zod.z.array(
|
|
2307
|
+
zod.z.object({
|
|
2308
|
+
name: zod.z.string(),
|
|
2309
|
+
amount: zod.z.number(),
|
|
2310
|
+
priorAmount: zod.z.number().optional(),
|
|
2311
|
+
indent: zod.z.number().min(0).max(2).default(0),
|
|
2312
|
+
isSubtotal: zod.z.boolean().default(false)
|
|
2313
|
+
})
|
|
2314
|
+
).min(1).max(20),
|
|
2315
|
+
netCash: zod.z.number(),
|
|
2316
|
+
priorNetCash: zod.z.number().optional()
|
|
2317
|
+
})
|
|
2318
|
+
).min(1).max(3),
|
|
2319
|
+
netChange: zod.z.number(),
|
|
2320
|
+
priorNetChange: zod.z.number().optional(),
|
|
2321
|
+
beginningCash: zod.z.number(),
|
|
2322
|
+
endingCash: zod.z.number(),
|
|
2323
|
+
priorBeginningCash: zod.z.number().optional(),
|
|
2324
|
+
priorEndingCash: zod.z.number().optional()
|
|
2325
|
+
});
|
|
2326
|
+
var cashFlowStatementTool = {
|
|
2327
|
+
name: "render_cash_flow_statement",
|
|
2328
|
+
description: "Render a cash flow statement with operating, investing, and financing activities \u2014 statement of cash flows, net change in cash",
|
|
2329
|
+
input_schema: {
|
|
2330
|
+
type: "object",
|
|
2331
|
+
properties: {
|
|
2332
|
+
type: { type: "string", enum: ["cash-flow-statement"] },
|
|
2333
|
+
title: { type: "string" },
|
|
2334
|
+
currency: { type: "string", description: "ISO currency code, e.g. USD" },
|
|
2335
|
+
metadata: {
|
|
2336
|
+
type: "object",
|
|
2337
|
+
properties: {
|
|
2338
|
+
companyName: { type: "string" },
|
|
2339
|
+
preparedBy: { type: "string" },
|
|
2340
|
+
reviewedBy: { type: "string" },
|
|
2341
|
+
approvedBy: { type: "string" },
|
|
2342
|
+
status: { type: "string", enum: ["draft", "pending-review", "approved", "filed"] },
|
|
2343
|
+
date: { type: "string" }
|
|
2344
|
+
}
|
|
2345
|
+
},
|
|
2346
|
+
periodLabel: {
|
|
2347
|
+
type: "string",
|
|
2348
|
+
description: "Label for the current period, e.g. Year Ended Dec 31, 2024"
|
|
2349
|
+
},
|
|
2350
|
+
priorPeriodLabel: {
|
|
2351
|
+
type: "string",
|
|
2352
|
+
description: "Label for the prior period, e.g. Year Ended Dec 31, 2023"
|
|
2353
|
+
},
|
|
2354
|
+
activities: {
|
|
2355
|
+
type: "array",
|
|
2356
|
+
minItems: 1,
|
|
2357
|
+
maxItems: 3,
|
|
2358
|
+
items: {
|
|
2359
|
+
type: "object",
|
|
2360
|
+
properties: {
|
|
2361
|
+
activityType: {
|
|
2362
|
+
type: "string",
|
|
2363
|
+
enum: ["operating", "investing", "financing"]
|
|
2364
|
+
},
|
|
2365
|
+
lineItems: {
|
|
2366
|
+
type: "array",
|
|
2367
|
+
minItems: 1,
|
|
2368
|
+
maxItems: 20,
|
|
2369
|
+
items: {
|
|
2370
|
+
type: "object",
|
|
2371
|
+
properties: {
|
|
2372
|
+
name: { type: "string" },
|
|
2373
|
+
amount: { type: "number" },
|
|
2374
|
+
priorAmount: { type: "number" },
|
|
2375
|
+
indent: {
|
|
2376
|
+
type: "number",
|
|
2377
|
+
minimum: 0,
|
|
2378
|
+
maximum: 2,
|
|
2379
|
+
description: "Indentation level 0-2"
|
|
2380
|
+
},
|
|
2381
|
+
isSubtotal: { type: "boolean" }
|
|
2382
|
+
},
|
|
2383
|
+
required: ["name", "amount"]
|
|
2384
|
+
}
|
|
2385
|
+
},
|
|
2386
|
+
netCash: { type: "number" },
|
|
2387
|
+
priorNetCash: { type: "number" }
|
|
2388
|
+
},
|
|
2389
|
+
required: ["activityType", "lineItems", "netCash"]
|
|
2390
|
+
}
|
|
2391
|
+
},
|
|
2392
|
+
netChange: { type: "number" },
|
|
2393
|
+
priorNetChange: { type: "number" },
|
|
2394
|
+
beginningCash: { type: "number" },
|
|
2395
|
+
endingCash: { type: "number" },
|
|
2396
|
+
priorBeginningCash: { type: "number" },
|
|
2397
|
+
priorEndingCash: { type: "number" }
|
|
2398
|
+
},
|
|
2399
|
+
required: ["type", "activities", "netChange", "beginningCash", "endingCash"]
|
|
2400
|
+
}
|
|
2401
|
+
};
|
|
2402
|
+
var generalLedgerSchema = zod.z.object({
|
|
2403
|
+
type: zod.z.literal("general-ledger"),
|
|
2404
|
+
title: zod.z.string().optional(),
|
|
2405
|
+
currency: zod.z.string().default("USD"),
|
|
2406
|
+
account: zod.z.object({
|
|
2407
|
+
code: zod.z.string(),
|
|
2408
|
+
name: zod.z.string(),
|
|
2409
|
+
accountType: zod.z.enum(["asset", "liability", "equity", "revenue", "expense"]).optional()
|
|
2410
|
+
}),
|
|
2411
|
+
dateRange: zod.z.object({
|
|
2412
|
+
from: zod.z.string(),
|
|
2413
|
+
to: zod.z.string()
|
|
2414
|
+
}).optional(),
|
|
2415
|
+
openingBalance: zod.z.number().default(0),
|
|
2416
|
+
transactions: zod.z.array(
|
|
2417
|
+
zod.z.object({
|
|
2418
|
+
date: zod.z.string(),
|
|
2419
|
+
description: zod.z.string(),
|
|
2420
|
+
reference: zod.z.string().optional(),
|
|
2421
|
+
source: zod.z.string().optional(),
|
|
2422
|
+
debit: zod.z.number().default(0),
|
|
2423
|
+
credit: zod.z.number().default(0),
|
|
2424
|
+
runningBalance: zod.z.number()
|
|
2425
|
+
})
|
|
2426
|
+
).min(1).max(100),
|
|
2427
|
+
closingBalance: zod.z.number()
|
|
2428
|
+
});
|
|
2429
|
+
var generalLedgerTool = {
|
|
2430
|
+
name: "render_general_ledger",
|
|
2431
|
+
description: "Render a general ledger with account-level transaction detail and running balance \u2014 GL detail, account ledger, ledger entries",
|
|
2432
|
+
input_schema: {
|
|
2433
|
+
type: "object",
|
|
2434
|
+
properties: {
|
|
2435
|
+
type: { type: "string", enum: ["general-ledger"] },
|
|
2436
|
+
title: { type: "string" },
|
|
2437
|
+
currency: { type: "string", description: "ISO currency code, e.g. USD" },
|
|
2438
|
+
account: {
|
|
2439
|
+
type: "object",
|
|
2440
|
+
properties: {
|
|
2441
|
+
code: { type: "string" },
|
|
2442
|
+
name: { type: "string" },
|
|
2443
|
+
accountType: {
|
|
2444
|
+
type: "string",
|
|
2445
|
+
enum: ["asset", "liability", "equity", "revenue", "expense"]
|
|
2446
|
+
}
|
|
2447
|
+
},
|
|
2448
|
+
required: ["code", "name"]
|
|
2449
|
+
},
|
|
2450
|
+
dateRange: {
|
|
2451
|
+
type: "object",
|
|
2452
|
+
properties: {
|
|
2453
|
+
from: { type: "string" },
|
|
2454
|
+
to: { type: "string" }
|
|
2455
|
+
},
|
|
2456
|
+
required: ["from", "to"]
|
|
2457
|
+
},
|
|
2458
|
+
openingBalance: { type: "number", description: "Opening balance for the period" },
|
|
2459
|
+
transactions: {
|
|
2460
|
+
type: "array",
|
|
2461
|
+
items: {
|
|
2462
|
+
type: "object",
|
|
2463
|
+
properties: {
|
|
2464
|
+
date: { type: "string" },
|
|
2465
|
+
description: { type: "string" },
|
|
2466
|
+
reference: { type: "string" },
|
|
2467
|
+
source: { type: "string", description: "Source document, e.g. JE-001, AP-INV-042" },
|
|
2468
|
+
debit: { type: "number" },
|
|
2469
|
+
credit: { type: "number" },
|
|
2470
|
+
runningBalance: { type: "number" }
|
|
2471
|
+
},
|
|
2472
|
+
required: ["date", "description", "runningBalance"]
|
|
2473
|
+
}
|
|
2474
|
+
},
|
|
2475
|
+
closingBalance: { type: "number" }
|
|
2476
|
+
},
|
|
2477
|
+
required: ["type", "account", "transactions", "closingBalance"]
|
|
2478
|
+
}
|
|
2479
|
+
};
|
|
2480
|
+
var chartOfAccountsSchema = zod.z.object({
|
|
2481
|
+
type: zod.z.literal("chart-of-accounts"),
|
|
2482
|
+
title: zod.z.string().optional(),
|
|
2483
|
+
currency: zod.z.string().default("USD"),
|
|
2484
|
+
showBalances: zod.z.boolean().default(false),
|
|
2485
|
+
accounts: zod.z.array(
|
|
2486
|
+
zod.z.object({
|
|
2487
|
+
code: zod.z.string(),
|
|
2488
|
+
name: zod.z.string(),
|
|
2489
|
+
accountType: zod.z.enum(["asset", "liability", "equity", "revenue", "expense"]),
|
|
2490
|
+
subType: zod.z.string().optional(),
|
|
2491
|
+
status: zod.z.enum(["active", "inactive"]).default("active"),
|
|
2492
|
+
indent: zod.z.number().min(0).max(3).default(0),
|
|
2493
|
+
isHeader: zod.z.boolean().default(false),
|
|
2494
|
+
balance: zod.z.number().optional()
|
|
2495
|
+
})
|
|
2496
|
+
).min(1).max(100)
|
|
2497
|
+
});
|
|
2498
|
+
var chartOfAccountsTool = {
|
|
2499
|
+
name: "render_chart_of_accounts",
|
|
2500
|
+
description: "Render a chart of accounts with account codes, types, hierarchy, and optional balances \u2014 COA, account structure, account directory",
|
|
2501
|
+
input_schema: {
|
|
2502
|
+
type: "object",
|
|
2503
|
+
properties: {
|
|
2504
|
+
type: { type: "string", enum: ["chart-of-accounts"] },
|
|
2505
|
+
title: { type: "string" },
|
|
2506
|
+
currency: { type: "string", description: "ISO currency code, e.g. USD" },
|
|
2507
|
+
showBalances: { type: "boolean", description: "Whether to show balance column" },
|
|
2508
|
+
accounts: {
|
|
2509
|
+
type: "array",
|
|
2510
|
+
items: {
|
|
2511
|
+
type: "object",
|
|
2512
|
+
properties: {
|
|
2513
|
+
code: { type: "string", description: "Account code, e.g. 1000" },
|
|
2514
|
+
name: { type: "string", description: "Account name" },
|
|
2515
|
+
accountType: {
|
|
2516
|
+
type: "string",
|
|
2517
|
+
enum: ["asset", "liability", "equity", "revenue", "expense"]
|
|
2518
|
+
},
|
|
2519
|
+
subType: { type: "string", description: "Sub-type, e.g. Current Asset, Fixed Asset, COGS" },
|
|
2520
|
+
status: { type: "string", enum: ["active", "inactive"] },
|
|
2521
|
+
indent: { type: "number", description: "Indentation level 0-3" },
|
|
2522
|
+
isHeader: { type: "boolean", description: "Whether this row is a section header" },
|
|
2523
|
+
balance: { type: "number", description: "Account balance" }
|
|
2524
|
+
},
|
|
2525
|
+
required: ["code", "name", "accountType"]
|
|
2526
|
+
}
|
|
2527
|
+
}
|
|
2528
|
+
},
|
|
2529
|
+
required: ["type", "accounts"]
|
|
2530
|
+
}
|
|
2531
|
+
};
|
|
2532
|
+
var invoiceDetailSchema = zod.z.object({
|
|
2533
|
+
type: zod.z.literal("invoice-detail"),
|
|
2534
|
+
invoiceNumber: zod.z.string(),
|
|
2535
|
+
status: zod.z.enum(["draft", "sent", "paid", "partial", "overdue", "void"]),
|
|
2536
|
+
issueDate: zod.z.string(),
|
|
2537
|
+
dueDate: zod.z.string(),
|
|
2538
|
+
currency: zod.z.string().default("USD"),
|
|
2539
|
+
client: zod.z.object({
|
|
2540
|
+
name: zod.z.string(),
|
|
2541
|
+
address: zod.z.string().optional(),
|
|
2542
|
+
email: zod.z.string().optional()
|
|
2543
|
+
}),
|
|
2544
|
+
lineItems: zod.z.array(
|
|
2545
|
+
zod.z.object({
|
|
2546
|
+
description: zod.z.string(),
|
|
2547
|
+
quantity: zod.z.number(),
|
|
2548
|
+
unitPrice: zod.z.number(),
|
|
2549
|
+
amount: zod.z.number()
|
|
2550
|
+
})
|
|
2551
|
+
).min(1).max(30),
|
|
2552
|
+
subtotal: zod.z.number(),
|
|
2553
|
+
taxLabel: zod.z.string().optional(),
|
|
2554
|
+
taxAmount: zod.z.number().default(0),
|
|
2555
|
+
discount: zod.z.number().default(0),
|
|
2556
|
+
total: zod.z.number(),
|
|
2557
|
+
amountPaid: zod.z.number().default(0),
|
|
2558
|
+
amountDue: zod.z.number(),
|
|
2559
|
+
payments: zod.z.array(
|
|
2560
|
+
zod.z.object({
|
|
2561
|
+
date: zod.z.string(),
|
|
2562
|
+
method: zod.z.string(),
|
|
2563
|
+
amount: zod.z.number(),
|
|
2564
|
+
reference: zod.z.string().optional()
|
|
2565
|
+
})
|
|
2566
|
+
).optional(),
|
|
2567
|
+
notes: zod.z.string().optional(),
|
|
2568
|
+
terms: zod.z.string().optional()
|
|
2569
|
+
});
|
|
2570
|
+
var invoiceDetailTool = {
|
|
2571
|
+
name: "render_invoice_detail",
|
|
2572
|
+
description: "Render a single invoice with line items, totals, tax, payments, and status \u2014 invoice detail, billing, AR invoice",
|
|
2573
|
+
input_schema: {
|
|
2574
|
+
type: "object",
|
|
2575
|
+
properties: {
|
|
2576
|
+
type: { type: "string", enum: ["invoice-detail"] },
|
|
2577
|
+
invoiceNumber: { type: "string" },
|
|
2578
|
+
status: {
|
|
2579
|
+
type: "string",
|
|
2580
|
+
enum: ["draft", "sent", "paid", "partial", "overdue", "void"]
|
|
2581
|
+
},
|
|
2582
|
+
issueDate: { type: "string" },
|
|
2583
|
+
dueDate: { type: "string" },
|
|
2584
|
+
currency: { type: "string" },
|
|
2585
|
+
client: {
|
|
2586
|
+
type: "object",
|
|
2587
|
+
properties: {
|
|
2588
|
+
name: { type: "string" },
|
|
2589
|
+
address: { type: "string" },
|
|
2590
|
+
email: { type: "string" }
|
|
2591
|
+
},
|
|
2592
|
+
required: ["name"]
|
|
2593
|
+
},
|
|
2594
|
+
lineItems: {
|
|
2595
|
+
type: "array",
|
|
2596
|
+
items: {
|
|
2597
|
+
type: "object",
|
|
2598
|
+
properties: {
|
|
2599
|
+
description: { type: "string" },
|
|
2600
|
+
quantity: { type: "number" },
|
|
2601
|
+
unitPrice: { type: "number" },
|
|
2602
|
+
amount: { type: "number" }
|
|
2603
|
+
},
|
|
2604
|
+
required: ["description", "quantity", "unitPrice", "amount"]
|
|
2605
|
+
}
|
|
2606
|
+
},
|
|
2607
|
+
subtotal: { type: "number" },
|
|
2608
|
+
taxLabel: { type: "string" },
|
|
2609
|
+
taxAmount: { type: "number" },
|
|
2610
|
+
discount: { type: "number" },
|
|
2611
|
+
total: { type: "number" },
|
|
2612
|
+
amountPaid: { type: "number" },
|
|
2613
|
+
amountDue: { type: "number" },
|
|
2614
|
+
payments: {
|
|
2615
|
+
type: "array",
|
|
2616
|
+
items: {
|
|
2617
|
+
type: "object",
|
|
2618
|
+
properties: {
|
|
2619
|
+
date: { type: "string" },
|
|
2620
|
+
method: { type: "string" },
|
|
2621
|
+
amount: { type: "number" },
|
|
2622
|
+
reference: { type: "string" }
|
|
2623
|
+
},
|
|
2624
|
+
required: ["date", "method", "amount"]
|
|
2625
|
+
}
|
|
2626
|
+
},
|
|
2627
|
+
notes: { type: "string" },
|
|
2628
|
+
terms: { type: "string" }
|
|
2629
|
+
},
|
|
2630
|
+
required: [
|
|
2631
|
+
"type",
|
|
2632
|
+
"invoiceNumber",
|
|
2633
|
+
"status",
|
|
2634
|
+
"issueDate",
|
|
2635
|
+
"dueDate",
|
|
2636
|
+
"client",
|
|
2637
|
+
"lineItems",
|
|
2638
|
+
"subtotal",
|
|
2639
|
+
"total",
|
|
2640
|
+
"amountDue"
|
|
2641
|
+
]
|
|
2642
|
+
}
|
|
2643
|
+
};
|
|
2644
|
+
var amortizationTableSchema = zod.z.object({
|
|
2645
|
+
type: zod.z.literal("amortization-table"),
|
|
2646
|
+
title: zod.z.string().optional(),
|
|
2647
|
+
currency: zod.z.string().default("USD"),
|
|
2648
|
+
summary: zod.z.object({
|
|
2649
|
+
originalAmount: zod.z.number(),
|
|
2650
|
+
interestRate: zod.z.string(),
|
|
2651
|
+
term: zod.z.string(),
|
|
2652
|
+
monthlyPayment: zod.z.number().optional(),
|
|
2653
|
+
totalInterest: zod.z.number().optional(),
|
|
2654
|
+
startDate: zod.z.string().optional()
|
|
2655
|
+
}).optional(),
|
|
2656
|
+
payments: zod.z.array(
|
|
2657
|
+
zod.z.object({
|
|
2658
|
+
period: zod.z.string(),
|
|
2659
|
+
paymentDate: zod.z.string().optional(),
|
|
2660
|
+
payment: zod.z.number(),
|
|
2661
|
+
principal: zod.z.number(),
|
|
2662
|
+
interest: zod.z.number(),
|
|
2663
|
+
balance: zod.z.number(),
|
|
2664
|
+
extra: zod.z.number().default(0)
|
|
2665
|
+
})
|
|
2666
|
+
).min(1).max(372)
|
|
2667
|
+
});
|
|
2668
|
+
var amortizationTableTool = {
|
|
2669
|
+
name: "render_amortization_table",
|
|
2670
|
+
description: "Render a loan or lease amortization schedule with principal, interest, and remaining balance \u2014 mortgage, lease payments, ASC 842, loan servicing",
|
|
2671
|
+
input_schema: {
|
|
2672
|
+
type: "object",
|
|
2673
|
+
properties: {
|
|
2674
|
+
type: { type: "string", enum: ["amortization-table"] },
|
|
2675
|
+
title: { type: "string" },
|
|
2676
|
+
currency: { type: "string", default: "USD" },
|
|
2677
|
+
summary: {
|
|
2678
|
+
type: "object",
|
|
2679
|
+
properties: {
|
|
2680
|
+
originalAmount: { type: "number" },
|
|
2681
|
+
interestRate: { type: "string" },
|
|
2682
|
+
term: { type: "string" },
|
|
2683
|
+
monthlyPayment: { type: "number" },
|
|
2684
|
+
totalInterest: { type: "number" },
|
|
2685
|
+
startDate: { type: "string" }
|
|
2686
|
+
},
|
|
2687
|
+
required: ["originalAmount", "interestRate", "term"]
|
|
2688
|
+
},
|
|
2689
|
+
payments: {
|
|
2690
|
+
type: "array",
|
|
2691
|
+
items: {
|
|
2692
|
+
type: "object",
|
|
2693
|
+
properties: {
|
|
2694
|
+
period: { type: "string" },
|
|
2695
|
+
paymentDate: { type: "string" },
|
|
2696
|
+
payment: { type: "number" },
|
|
2697
|
+
principal: { type: "number" },
|
|
2698
|
+
interest: { type: "number" },
|
|
2699
|
+
balance: { type: "number" },
|
|
2700
|
+
extra: { type: "number", default: 0 }
|
|
2701
|
+
},
|
|
2702
|
+
required: ["period", "payment", "principal", "interest", "balance"]
|
|
2703
|
+
},
|
|
2704
|
+
minItems: 1,
|
|
2705
|
+
maxItems: 372
|
|
2706
|
+
}
|
|
2707
|
+
},
|
|
2708
|
+
required: ["type", "payments"]
|
|
2709
|
+
}
|
|
2710
|
+
};
|
|
2711
|
+
var depreciationScheduleSchema = zod.z.object({
|
|
2712
|
+
type: zod.z.literal("depreciation-schedule"),
|
|
2713
|
+
title: zod.z.string().optional(),
|
|
2714
|
+
currency: zod.z.string().default("USD"),
|
|
2715
|
+
asOfDate: zod.z.string().optional(),
|
|
2716
|
+
method: zod.z.string().optional(),
|
|
2717
|
+
assets: zod.z.array(
|
|
2718
|
+
zod.z.object({
|
|
2719
|
+
id: zod.z.string(),
|
|
2720
|
+
name: zod.z.string(),
|
|
2721
|
+
category: zod.z.enum(["Buildings", "Equipment", "Vehicles", "Furniture"]).optional(),
|
|
2722
|
+
acquiredDate: zod.z.string(),
|
|
2723
|
+
cost: zod.z.number(),
|
|
2724
|
+
salvageValue: zod.z.number().default(0),
|
|
2725
|
+
usefulLife: zod.z.string().optional(),
|
|
2726
|
+
method: zod.z.string().optional(),
|
|
2727
|
+
currentYearDepreciation: zod.z.number(),
|
|
2728
|
+
accumulatedDepreciation: zod.z.number(),
|
|
2729
|
+
bookValue: zod.z.number()
|
|
2730
|
+
})
|
|
2731
|
+
).min(1).max(50),
|
|
2732
|
+
totals: zod.z.object({
|
|
2733
|
+
totalCost: zod.z.number(),
|
|
2734
|
+
totalCurrentYear: zod.z.number(),
|
|
2735
|
+
totalAccumulated: zod.z.number(),
|
|
2736
|
+
totalBookValue: zod.z.number()
|
|
2737
|
+
}).optional()
|
|
2738
|
+
});
|
|
2739
|
+
var depreciationScheduleTool = {
|
|
2740
|
+
name: "render_depreciation_schedule",
|
|
2741
|
+
description: "Render a fixed asset depreciation schedule with cost, useful life, method, annual depreciation, accumulated depreciation, and book value \u2014 asset register, MACRS, straight-line",
|
|
2742
|
+
input_schema: {
|
|
2743
|
+
type: "object",
|
|
2744
|
+
properties: {
|
|
2745
|
+
type: { type: "string", enum: ["depreciation-schedule"] },
|
|
2746
|
+
title: { type: "string" },
|
|
2747
|
+
currency: {
|
|
2748
|
+
type: "string",
|
|
2749
|
+
description: "ISO currency code, e.g. USD"
|
|
2750
|
+
},
|
|
2751
|
+
asOfDate: {
|
|
2752
|
+
type: "string",
|
|
2753
|
+
description: "As-of date for the schedule"
|
|
2754
|
+
},
|
|
2755
|
+
method: {
|
|
2756
|
+
type: "string",
|
|
2757
|
+
description: "Default depreciation method, e.g. Straight-Line, MACRS"
|
|
2758
|
+
},
|
|
2759
|
+
assets: {
|
|
2760
|
+
type: "array",
|
|
2761
|
+
items: {
|
|
2762
|
+
type: "object",
|
|
2763
|
+
properties: {
|
|
2764
|
+
id: { type: "string" },
|
|
2765
|
+
name: { type: "string" },
|
|
2766
|
+
category: {
|
|
2767
|
+
type: "string",
|
|
2768
|
+
enum: ["Buildings", "Equipment", "Vehicles", "Furniture"]
|
|
2769
|
+
},
|
|
2770
|
+
acquiredDate: { type: "string" },
|
|
2771
|
+
cost: { type: "number" },
|
|
2772
|
+
salvageValue: { type: "number" },
|
|
2773
|
+
usefulLife: {
|
|
2774
|
+
type: "string",
|
|
2775
|
+
description: "e.g. 5 years, 39 years"
|
|
2776
|
+
},
|
|
2777
|
+
method: {
|
|
2778
|
+
type: "string",
|
|
2779
|
+
description: "Per-asset depreciation method override"
|
|
2780
|
+
},
|
|
2781
|
+
currentYearDepreciation: { type: "number" },
|
|
2782
|
+
accumulatedDepreciation: { type: "number" },
|
|
2783
|
+
bookValue: { type: "number" }
|
|
2784
|
+
},
|
|
2785
|
+
required: [
|
|
2786
|
+
"id",
|
|
2787
|
+
"name",
|
|
2788
|
+
"acquiredDate",
|
|
2789
|
+
"cost",
|
|
2790
|
+
"currentYearDepreciation",
|
|
2791
|
+
"accumulatedDepreciation",
|
|
2792
|
+
"bookValue"
|
|
2793
|
+
]
|
|
2794
|
+
}
|
|
2795
|
+
},
|
|
2796
|
+
totals: {
|
|
2797
|
+
type: "object",
|
|
2798
|
+
properties: {
|
|
2799
|
+
totalCost: { type: "number" },
|
|
2800
|
+
totalCurrentYear: { type: "number" },
|
|
2801
|
+
totalAccumulated: { type: "number" },
|
|
2802
|
+
totalBookValue: { type: "number" }
|
|
2803
|
+
},
|
|
2804
|
+
required: [
|
|
2805
|
+
"totalCost",
|
|
2806
|
+
"totalCurrentYear",
|
|
2807
|
+
"totalAccumulated",
|
|
2808
|
+
"totalBookValue"
|
|
2809
|
+
]
|
|
2810
|
+
}
|
|
2811
|
+
},
|
|
2812
|
+
required: ["type", "assets"]
|
|
2813
|
+
}
|
|
2814
|
+
};
|
|
2815
|
+
var escalationCardSchema = zod.z.object({
|
|
2816
|
+
type: zod.z.literal("escalation-card"),
|
|
2817
|
+
title: zod.z.string().optional(),
|
|
2818
|
+
description: zod.z.string().optional(),
|
|
2819
|
+
url: zod.z.string(),
|
|
2820
|
+
ctaLabel: zod.z.string().optional(),
|
|
2821
|
+
priority: zod.z.enum(["low", "medium", "high"]).optional()
|
|
2822
|
+
});
|
|
2823
|
+
var escalationCardTool = {
|
|
2824
|
+
name: "render_escalation_card",
|
|
2825
|
+
description: "Render a human-in-the-loop (HITL) escalation card with a title, description, priority, and a deeplink CTA button to resolve it \u2014 use for review requests, low-confidence extractions, data conflicts, or any item needing manual resolution in the review portal",
|
|
2826
|
+
input_schema: {
|
|
2827
|
+
type: "object",
|
|
2828
|
+
properties: {
|
|
2829
|
+
type: { type: "string", enum: ["escalation-card"] },
|
|
2830
|
+
title: { type: "string" },
|
|
2831
|
+
description: { type: "string" },
|
|
2832
|
+
url: { type: "string" },
|
|
2833
|
+
ctaLabel: { type: "string" },
|
|
2834
|
+
priority: { type: "string", enum: ["low", "medium", "high"] }
|
|
2835
|
+
},
|
|
2836
|
+
required: ["type", "url"]
|
|
2837
|
+
}
|
|
2838
|
+
};
|
|
2839
|
+
var lineChartSchema = zod.z.object({
|
|
2840
|
+
type: zod.z.literal("line-chart"),
|
|
2841
|
+
title: zod.z.string().optional(),
|
|
2842
|
+
xKey: zod.z.string(),
|
|
2843
|
+
unit: zod.z.string().optional(),
|
|
2844
|
+
smooth: zod.z.boolean().optional(),
|
|
2845
|
+
series: zod.z.array(zod.z.object({ name: zod.z.string(), dataKey: zod.z.string(), color: zod.z.string().optional() })).min(1).max(6),
|
|
2846
|
+
data: zod.z.array(zod.z.record(zod.z.string(), zod.z.union([zod.z.string(), zod.z.number()]))).min(2).max(500)
|
|
2847
|
+
});
|
|
2848
|
+
var lineChartTool = {
|
|
2849
|
+
name: "render_line_chart",
|
|
2850
|
+
description: "Render a multi-series line chart for trends over time \u2014 net income trend, cash position, revenue vs expense, KPI over months/quarters. Use when comparing how one or more numeric measures move across an ordered axis (lines, not filled areas).",
|
|
2851
|
+
input_schema: {
|
|
2852
|
+
type: "object",
|
|
2853
|
+
properties: {
|
|
2854
|
+
type: { type: "string", enum: ["line-chart"] },
|
|
2855
|
+
title: { type: "string" },
|
|
2856
|
+
xKey: { type: "string", description: "Key in each data row for the X-axis label (e.g. 'month')" },
|
|
2857
|
+
unit: { type: "string", description: "Value unit/prefix, e.g. '$', '%', 'bps'" },
|
|
2858
|
+
smooth: { type: "boolean", description: "Use smooth (monotone) curves instead of straight segments" },
|
|
2859
|
+
series: {
|
|
2860
|
+
type: "array",
|
|
2861
|
+
items: {
|
|
2862
|
+
type: "object",
|
|
2863
|
+
properties: {
|
|
2864
|
+
name: { type: "string" },
|
|
2865
|
+
dataKey: { type: "string" },
|
|
2866
|
+
color: { type: "string", description: "Optional CSS color; auto-assigned from palette if omitted" }
|
|
2867
|
+
},
|
|
2868
|
+
required: ["name", "dataKey"]
|
|
2869
|
+
}
|
|
2870
|
+
},
|
|
2871
|
+
data: {
|
|
2872
|
+
type: "array",
|
|
2873
|
+
items: { type: "object", additionalProperties: true },
|
|
2874
|
+
description: "Data rows; each row has xKey and every series dataKey"
|
|
2875
|
+
}
|
|
2876
|
+
},
|
|
2877
|
+
required: ["type", "xKey", "series", "data"]
|
|
2878
|
+
}
|
|
2879
|
+
};
|
|
2880
|
+
var seriesRef = zod.z.object({
|
|
2881
|
+
name: zod.z.string(),
|
|
2882
|
+
dataKey: zod.z.string(),
|
|
2883
|
+
color: zod.z.string().optional(),
|
|
2884
|
+
axis: zod.z.enum(["left", "right"]).optional()
|
|
2885
|
+
});
|
|
2886
|
+
var comboChartSchema = zod.z.object({
|
|
2887
|
+
type: zod.z.literal("combo-chart"),
|
|
2888
|
+
title: zod.z.string().optional(),
|
|
2889
|
+
xKey: zod.z.string(),
|
|
2890
|
+
leftUnit: zod.z.string().optional(),
|
|
2891
|
+
rightUnit: zod.z.string().optional(),
|
|
2892
|
+
bars: zod.z.array(seriesRef).max(4).optional(),
|
|
2893
|
+
lines: zod.z.array(seriesRef).max(4).optional(),
|
|
2894
|
+
data: zod.z.array(zod.z.record(zod.z.string(), zod.z.union([zod.z.string(), zod.z.number()]))).min(2).max(500)
|
|
2895
|
+
}).refine((v) => {
|
|
2896
|
+
var _a, _b, _c, _d;
|
|
2897
|
+
return ((_b = (_a = v.bars) == null ? void 0 : _a.length) != null ? _b : 0) + ((_d = (_c = v.lines) == null ? void 0 : _c.length) != null ? _d : 0) >= 1;
|
|
2898
|
+
}, {
|
|
2899
|
+
message: "combo-chart needs at least one bar or line series"
|
|
2900
|
+
});
|
|
2901
|
+
var comboChartTool = {
|
|
2902
|
+
name: "render_combo_chart",
|
|
2903
|
+
description: "Render a combined bar + line chart with an optional secondary (right) Y-axis \u2014 revenue bars with a margin % line, actuals bars with a cumulative budget line, volume vs rate. Use when one measure is best shown as bars and another (often a %, ratio, or running total on a different scale) as a line.",
|
|
2904
|
+
input_schema: {
|
|
2905
|
+
type: "object",
|
|
2906
|
+
properties: {
|
|
2907
|
+
type: { type: "string", enum: ["combo-chart"] },
|
|
2908
|
+
title: { type: "string" },
|
|
2909
|
+
xKey: { type: "string", description: "Key in each data row for the X-axis label" },
|
|
2910
|
+
leftUnit: { type: "string", description: "Unit for the left Y-axis (e.g. '$')" },
|
|
2911
|
+
rightUnit: { type: "string", description: "Unit for the right Y-axis (e.g. '%')" },
|
|
2912
|
+
bars: {
|
|
2913
|
+
type: "array",
|
|
2914
|
+
items: {
|
|
2915
|
+
type: "object",
|
|
2916
|
+
properties: {
|
|
2917
|
+
name: { type: "string" },
|
|
2918
|
+
dataKey: { type: "string" },
|
|
2919
|
+
color: { type: "string" },
|
|
2920
|
+
axis: { type: "string", enum: ["left", "right"], description: "Which Y-axis; default left" }
|
|
2921
|
+
},
|
|
2922
|
+
required: ["name", "dataKey"]
|
|
2923
|
+
}
|
|
2924
|
+
},
|
|
2925
|
+
lines: {
|
|
2926
|
+
type: "array",
|
|
2927
|
+
items: {
|
|
2928
|
+
type: "object",
|
|
2929
|
+
properties: {
|
|
2930
|
+
name: { type: "string" },
|
|
2931
|
+
dataKey: { type: "string" },
|
|
2932
|
+
color: { type: "string" },
|
|
2933
|
+
axis: { type: "string", enum: ["left", "right"], description: "Which Y-axis; default right" }
|
|
2934
|
+
},
|
|
2935
|
+
required: ["name", "dataKey"]
|
|
2936
|
+
}
|
|
2937
|
+
},
|
|
2938
|
+
data: {
|
|
2939
|
+
type: "array",
|
|
2940
|
+
items: { type: "object", additionalProperties: true },
|
|
2941
|
+
description: "Data rows; each row has xKey and every bar/line dataKey"
|
|
2942
|
+
}
|
|
2943
|
+
},
|
|
2944
|
+
required: ["type", "xKey", "data"]
|
|
2945
|
+
}
|
|
2946
|
+
};
|
|
2947
|
+
var gaugeChartSchema = zod.z.object({
|
|
2948
|
+
type: zod.z.literal("gauge-chart"),
|
|
2949
|
+
title: zod.z.string().optional(),
|
|
2950
|
+
items: zod.z.array(
|
|
2951
|
+
zod.z.object({
|
|
2952
|
+
label: zod.z.string(),
|
|
2953
|
+
value: zod.z.number(),
|
|
2954
|
+
max: zod.z.number(),
|
|
2955
|
+
target: zod.z.number().optional(),
|
|
2956
|
+
unit: zod.z.string().optional()
|
|
2957
|
+
})
|
|
2958
|
+
).min(1).max(4)
|
|
2959
|
+
});
|
|
2960
|
+
var gaugeChartTool = {
|
|
2961
|
+
name: "render_gauge_chart",
|
|
2962
|
+
description: "Render one to four radial gauge dials showing a single KPI against its max and an optional target \u2014 budget utilization %, DSO/DPO vs target, collection rate, cash-runway months, capacity used. The arc colors green/amber/red relative to the target.",
|
|
2963
|
+
input_schema: {
|
|
2964
|
+
type: "object",
|
|
2965
|
+
properties: {
|
|
2966
|
+
type: { type: "string", enum: ["gauge-chart"] },
|
|
2967
|
+
title: { type: "string" },
|
|
2968
|
+
items: {
|
|
2969
|
+
type: "array",
|
|
2970
|
+
items: {
|
|
2971
|
+
type: "object",
|
|
2972
|
+
properties: {
|
|
2973
|
+
label: { type: "string" },
|
|
2974
|
+
value: { type: "number", description: "Current value" },
|
|
2975
|
+
max: { type: "number", description: "Full-scale value of the dial" },
|
|
2976
|
+
target: { type: "number", description: "Optional goal threshold; drives arc color" },
|
|
2977
|
+
unit: { type: "string", description: "e.g. '%', '$', 'days'" }
|
|
2978
|
+
},
|
|
2979
|
+
required: ["label", "value", "max"]
|
|
2980
|
+
}
|
|
2981
|
+
}
|
|
2982
|
+
},
|
|
2983
|
+
required: ["type", "items"]
|
|
2984
|
+
}
|
|
2985
|
+
};
|
|
2986
|
+
var treemapChartSchema = zod.z.object({
|
|
2987
|
+
type: zod.z.literal("treemap-chart"),
|
|
2988
|
+
title: zod.z.string().optional(),
|
|
2989
|
+
currency: zod.z.string().optional(),
|
|
2990
|
+
nodes: zod.z.array(
|
|
2991
|
+
zod.z.object({
|
|
2992
|
+
name: zod.z.string(),
|
|
2993
|
+
value: zod.z.number(),
|
|
2994
|
+
color: zod.z.string().optional()
|
|
2995
|
+
})
|
|
2996
|
+
).min(1).max(30)
|
|
2997
|
+
});
|
|
2998
|
+
var treemapChartTool = {
|
|
2999
|
+
name: "render_treemap_chart",
|
|
3000
|
+
description: "Render a treemap where each rectangle's area is proportional to its value \u2014 expense breakdown by GL account, revenue by segment or product, spend by cost center, asset mix. Use to show how a total decomposes into many parts ranked by magnitude.",
|
|
3001
|
+
input_schema: {
|
|
3002
|
+
type: "object",
|
|
3003
|
+
properties: {
|
|
3004
|
+
type: { type: "string", enum: ["treemap-chart"] },
|
|
3005
|
+
title: { type: "string" },
|
|
3006
|
+
currency: { type: "string", description: "Currency symbol/prefix for values, e.g. '$'" },
|
|
3007
|
+
nodes: {
|
|
3008
|
+
type: "array",
|
|
3009
|
+
items: {
|
|
3010
|
+
type: "object",
|
|
3011
|
+
properties: {
|
|
3012
|
+
name: { type: "string" },
|
|
3013
|
+
value: { type: "number", description: "Positive magnitude; sets rectangle area" },
|
|
3014
|
+
color: { type: "string", description: "Optional; auto-assigned from palette if omitted" }
|
|
3015
|
+
},
|
|
3016
|
+
required: ["name", "value"]
|
|
3017
|
+
}
|
|
3018
|
+
}
|
|
3019
|
+
},
|
|
3020
|
+
required: ["type", "nodes"]
|
|
3021
|
+
}
|
|
3022
|
+
};
|
|
3023
|
+
var radarChartSchema = zod.z.object({
|
|
3024
|
+
type: zod.z.literal("radar-chart"),
|
|
3025
|
+
title: zod.z.string().optional(),
|
|
3026
|
+
unit: zod.z.string().optional(),
|
|
3027
|
+
series: zod.z.array(zod.z.object({ name: zod.z.string(), dataKey: zod.z.string(), color: zod.z.string().optional() })).min(1).max(4),
|
|
3028
|
+
data: zod.z.array(
|
|
3029
|
+
zod.z.object({ metric: zod.z.string() }).catchall(zod.z.union([zod.z.string(), zod.z.number()]))
|
|
3030
|
+
).min(3).max(12)
|
|
3031
|
+
});
|
|
3032
|
+
var radarChartTool = {
|
|
3033
|
+
name: "render_radar_chart",
|
|
3034
|
+
description: "Render a radar (spider) chart comparing several entities or periods across the same set of metrics \u2014 financial-ratio profiles (liquidity, profitability, leverage, efficiency, coverage), scorecard comparison, multi-dimensional benchmarking. One axis per metric; one shape per series.",
|
|
3035
|
+
input_schema: {
|
|
3036
|
+
type: "object",
|
|
3037
|
+
properties: {
|
|
3038
|
+
type: { type: "string", enum: ["radar-chart"] },
|
|
3039
|
+
title: { type: "string" },
|
|
3040
|
+
unit: { type: "string", description: "Optional value unit, e.g. 'x', '%'" },
|
|
3041
|
+
series: {
|
|
3042
|
+
type: "array",
|
|
3043
|
+
items: {
|
|
3044
|
+
type: "object",
|
|
3045
|
+
properties: {
|
|
3046
|
+
name: { type: "string" },
|
|
3047
|
+
dataKey: { type: "string" },
|
|
3048
|
+
color: { type: "string", description: "Optional; auto-assigned from palette if omitted" }
|
|
3049
|
+
},
|
|
3050
|
+
required: ["name", "dataKey"]
|
|
3051
|
+
}
|
|
3052
|
+
},
|
|
3053
|
+
data: {
|
|
3054
|
+
type: "array",
|
|
3055
|
+
items: {
|
|
3056
|
+
type: "object",
|
|
3057
|
+
properties: { metric: { type: "string", description: "Axis label" } },
|
|
3058
|
+
required: ["metric"],
|
|
3059
|
+
additionalProperties: true
|
|
3060
|
+
},
|
|
3061
|
+
description: "One row per metric; each row has 'metric' and every series dataKey"
|
|
3062
|
+
}
|
|
3063
|
+
},
|
|
3064
|
+
required: ["type", "series", "data"]
|
|
3065
|
+
}
|
|
3066
|
+
};
|
|
3067
|
+
var funnelChartSchema = zod.z.object({
|
|
3068
|
+
type: zod.z.literal("funnel-chart"),
|
|
3069
|
+
title: zod.z.string().optional(),
|
|
3070
|
+
currency: zod.z.string().optional(),
|
|
3071
|
+
stages: zod.z.array(
|
|
3072
|
+
zod.z.object({
|
|
3073
|
+
label: zod.z.string(),
|
|
3074
|
+
value: zod.z.number(),
|
|
3075
|
+
color: zod.z.string().optional()
|
|
3076
|
+
})
|
|
3077
|
+
).min(2).max(8)
|
|
3078
|
+
});
|
|
3079
|
+
var funnelChartTool = {
|
|
3080
|
+
name: "render_funnel_chart",
|
|
3081
|
+
description: "Render a funnel chart showing how a quantity narrows across ordered stages \u2014 collections funnel (billed \u2192 collected \u2192 overdue \u2192 written off), quote \u2192 invoice \u2192 paid, lead \u2192 close. Use for stage-to-stage conversion or drop-off. Each stage shows its value and % of the prior stage.",
|
|
3082
|
+
input_schema: {
|
|
3083
|
+
type: "object",
|
|
3084
|
+
properties: {
|
|
3085
|
+
type: { type: "string", enum: ["funnel-chart"] },
|
|
3086
|
+
title: { type: "string" },
|
|
3087
|
+
currency: { type: "string", description: "Currency symbol/prefix, e.g. '$'" },
|
|
3088
|
+
stages: {
|
|
3089
|
+
type: "array",
|
|
3090
|
+
description: "Ordered widest \u2192 narrowest",
|
|
3091
|
+
items: {
|
|
3092
|
+
type: "object",
|
|
3093
|
+
properties: {
|
|
3094
|
+
label: { type: "string" },
|
|
3095
|
+
value: { type: "number" },
|
|
3096
|
+
color: { type: "string", description: "Optional; auto-assigned from palette if omitted" }
|
|
3097
|
+
},
|
|
3098
|
+
required: ["label", "value"]
|
|
3099
|
+
}
|
|
3100
|
+
}
|
|
3101
|
+
},
|
|
3102
|
+
required: ["type", "stages"]
|
|
3103
|
+
}
|
|
3104
|
+
};
|
|
3105
|
+
var bulletChartSchema = zod.z.object({
|
|
3106
|
+
type: zod.z.literal("bullet-chart"),
|
|
3107
|
+
title: zod.z.string().optional(),
|
|
3108
|
+
items: zod.z.array(
|
|
3109
|
+
zod.z.object({
|
|
3110
|
+
label: zod.z.string(),
|
|
3111
|
+
value: zod.z.number(),
|
|
3112
|
+
target: zod.z.number(),
|
|
3113
|
+
max: zod.z.number().optional(),
|
|
3114
|
+
unit: zod.z.string().optional()
|
|
3115
|
+
})
|
|
3116
|
+
).min(1).max(10)
|
|
3117
|
+
});
|
|
3118
|
+
var bulletChartTool = {
|
|
3119
|
+
name: "render_bullet_chart",
|
|
3120
|
+
description: "Render a compact bullet-chart scorecard: one horizontal row per KPI showing actual value vs target against a qualitative range \u2014 actual vs budget, vs forecast, vs prior year. Use for dense KPI-vs-target dashboards where each measure has its own target. The bar turns green/amber/red by how the value compares to its target.",
|
|
3121
|
+
input_schema: {
|
|
3122
|
+
type: "object",
|
|
3123
|
+
properties: {
|
|
3124
|
+
type: { type: "string", enum: ["bullet-chart"] },
|
|
3125
|
+
title: { type: "string" },
|
|
3126
|
+
items: {
|
|
3127
|
+
type: "array",
|
|
3128
|
+
items: {
|
|
3129
|
+
type: "object",
|
|
3130
|
+
properties: {
|
|
3131
|
+
label: { type: "string" },
|
|
3132
|
+
value: { type: "number", description: "Actual measured value" },
|
|
3133
|
+
target: { type: "number", description: "Goal / budget marker" },
|
|
3134
|
+
max: { type: "number", description: "Optional scale max; defaults to max(value,target)*1.25" },
|
|
3135
|
+
unit: { type: "string", description: "e.g. '$', '%', 'days'" }
|
|
3136
|
+
},
|
|
3137
|
+
required: ["label", "value", "target"]
|
|
3138
|
+
}
|
|
3139
|
+
}
|
|
3140
|
+
},
|
|
3141
|
+
required: ["type", "items"]
|
|
3142
|
+
}
|
|
3143
|
+
};
|
|
3144
|
+
var scatterChartSchema = zod.z.object({
|
|
3145
|
+
type: zod.z.literal("scatter-chart"),
|
|
3146
|
+
title: zod.z.string().optional(),
|
|
3147
|
+
xLabel: zod.z.string().optional(),
|
|
3148
|
+
yLabel: zod.z.string().optional(),
|
|
3149
|
+
xUnit: zod.z.string().optional(),
|
|
3150
|
+
yUnit: zod.z.string().optional(),
|
|
3151
|
+
series: zod.z.array(
|
|
3152
|
+
zod.z.object({
|
|
3153
|
+
name: zod.z.string(),
|
|
3154
|
+
color: zod.z.string().optional(),
|
|
3155
|
+
points: zod.z.array(
|
|
3156
|
+
zod.z.object({
|
|
3157
|
+
x: zod.z.number(),
|
|
3158
|
+
y: zod.z.number(),
|
|
3159
|
+
z: zod.z.number().optional(),
|
|
3160
|
+
label: zod.z.string().optional()
|
|
3161
|
+
})
|
|
3162
|
+
).min(1).max(200)
|
|
3163
|
+
})
|
|
3164
|
+
).min(1).max(4)
|
|
3165
|
+
});
|
|
3166
|
+
var scatterChartTool = {
|
|
3167
|
+
name: "render_scatter_chart",
|
|
3168
|
+
description: "Render a scatter / bubble chart plotting points on two numeric axes (optional bubble size as a third dimension) \u2014 AR aging days vs outstanding amount, account size vs activity, risk vs return, price vs volume. Use to reveal correlation, clustering, or outliers across accounts/entities.",
|
|
3169
|
+
input_schema: {
|
|
3170
|
+
type: "object",
|
|
3171
|
+
properties: {
|
|
3172
|
+
type: { type: "string", enum: ["scatter-chart"] },
|
|
3173
|
+
title: { type: "string" },
|
|
3174
|
+
xLabel: { type: "string" },
|
|
3175
|
+
yLabel: { type: "string" },
|
|
3176
|
+
xUnit: { type: "string", description: "e.g. 'days'" },
|
|
3177
|
+
yUnit: { type: "string", description: "e.g. '$'" },
|
|
3178
|
+
series: {
|
|
3179
|
+
type: "array",
|
|
3180
|
+
items: {
|
|
3181
|
+
type: "object",
|
|
3182
|
+
properties: {
|
|
3183
|
+
name: { type: "string" },
|
|
3184
|
+
color: { type: "string", description: "Optional; auto-assigned from palette if omitted" },
|
|
3185
|
+
points: {
|
|
3186
|
+
type: "array",
|
|
3187
|
+
items: {
|
|
3188
|
+
type: "object",
|
|
3189
|
+
properties: {
|
|
3190
|
+
x: { type: "number" },
|
|
3191
|
+
y: { type: "number" },
|
|
3192
|
+
z: { type: "number", description: "Optional magnitude \u2192 bubble size" },
|
|
3193
|
+
label: { type: "string", description: "Optional point name for tooltip" }
|
|
3194
|
+
},
|
|
3195
|
+
required: ["x", "y"]
|
|
3196
|
+
}
|
|
3197
|
+
}
|
|
3198
|
+
},
|
|
3199
|
+
required: ["name", "points"]
|
|
3200
|
+
}
|
|
3201
|
+
}
|
|
3202
|
+
},
|
|
3203
|
+
required: ["type", "series"]
|
|
3204
|
+
}
|
|
3205
|
+
};
|
|
3206
|
+
var connectIntegrationSchema = zod.z.object({
|
|
3207
|
+
type: zod.z.literal("connect-integration"),
|
|
3208
|
+
integrationName: zod.z.string(),
|
|
3209
|
+
description: zod.z.string().optional(),
|
|
3210
|
+
url: zod.z.string(),
|
|
3211
|
+
status: zod.z.enum(["connected", "not_connected"]).optional(),
|
|
3212
|
+
iconUrl: zod.z.string().optional(),
|
|
3213
|
+
ctaLabel: zod.z.string().optional()
|
|
3214
|
+
});
|
|
3215
|
+
var connectIntegrationTool = {
|
|
3216
|
+
name: "render_connect_integration",
|
|
3217
|
+
description: "Render a compact card for a single third-party integration (e.g. Gmail, Slack, Google Drive). Use it three ways via `status`: (1) status='not_connected' \u2014 prompt the user to connect it, the button deep-links to the connections settings page (set `url` to /settings/connections?integration=<id>); (2) status='connected' \u2014 show it as connected, the button is an Open deep-link into the integration or its settings; (3) as a plain deep-link to an external resource. `url` is the button target; `ctaLabel` overrides the button text (defaults: Connect when not connected, Open when connected).",
|
|
3218
|
+
input_schema: {
|
|
3219
|
+
type: "object",
|
|
3220
|
+
properties: {
|
|
3221
|
+
type: { type: "string", enum: ["connect-integration"] },
|
|
3222
|
+
integrationName: { type: "string" },
|
|
3223
|
+
description: { type: "string" },
|
|
3224
|
+
url: { type: "string" },
|
|
3225
|
+
status: { type: "string", enum: ["connected", "not_connected"] },
|
|
3226
|
+
iconUrl: { type: "string" },
|
|
3227
|
+
ctaLabel: { type: "string" }
|
|
3228
|
+
},
|
|
3229
|
+
required: ["type", "integrationName", "url"]
|
|
3230
|
+
}
|
|
3231
|
+
};
|
|
3232
|
+
var integrationsListSchema = zod.z.object({
|
|
3233
|
+
type: zod.z.literal("integrations-list"),
|
|
3234
|
+
title: zod.z.string().optional(),
|
|
3235
|
+
description: zod.z.string().optional(),
|
|
3236
|
+
integrations: zod.z.array(
|
|
3237
|
+
zod.z.object({
|
|
3238
|
+
name: zod.z.string(),
|
|
3239
|
+
status: zod.z.enum(["connected", "not_connected"]),
|
|
3240
|
+
capability: zod.z.string().optional(),
|
|
3241
|
+
connectUrl: zod.z.string().optional(),
|
|
3242
|
+
iconUrl: zod.z.string().optional()
|
|
3243
|
+
})
|
|
3244
|
+
)
|
|
3245
|
+
});
|
|
3246
|
+
var integrationsListTool = {
|
|
3247
|
+
name: "render_integrations_list",
|
|
3248
|
+
description: "Render a grouped list of multiple third-party integrations with their connection status (connected vs not connected) and a per-row Connect link for the ones that are not connected. Prefer this over multiple separate connect-integration cards whenever there are 2 or more integrations \u2014 e.g. to orient the user on what's available, or to offer several providers to connect (Gmail, Outlook, ...). Optional `description` is a one-line subtitle under the title.",
|
|
3249
|
+
input_schema: {
|
|
3250
|
+
type: "object",
|
|
3251
|
+
properties: {
|
|
3252
|
+
type: { type: "string", enum: ["integrations-list"] },
|
|
3253
|
+
title: { type: "string" },
|
|
3254
|
+
description: { type: "string" },
|
|
3255
|
+
integrations: {
|
|
3256
|
+
type: "array",
|
|
3257
|
+
items: {
|
|
3258
|
+
type: "object",
|
|
3259
|
+
properties: {
|
|
3260
|
+
name: { type: "string" },
|
|
3261
|
+
status: { type: "string", enum: ["connected", "not_connected"] },
|
|
3262
|
+
capability: { type: "string" },
|
|
3263
|
+
connectUrl: { type: "string" },
|
|
3264
|
+
iconUrl: { type: "string" }
|
|
3265
|
+
},
|
|
3266
|
+
required: ["name", "status"]
|
|
3267
|
+
}
|
|
3268
|
+
}
|
|
3269
|
+
},
|
|
3270
|
+
required: ["type", "integrations"]
|
|
3271
|
+
}
|
|
3272
|
+
};
|
|
3273
|
+
var pipelineStepSchema = zod.z.lazy(
|
|
3274
|
+
() => zod.z.object({
|
|
3275
|
+
id: zod.z.string(),
|
|
3276
|
+
operation: zod.z.string(),
|
|
3277
|
+
label: zod.z.string().optional(),
|
|
3278
|
+
description: zod.z.string().optional(),
|
|
3279
|
+
subSteps: zod.z.array(pipelineStepSchema).optional(),
|
|
3280
|
+
branches: zod.z.array(
|
|
3281
|
+
zod.z.object({
|
|
3282
|
+
label: zod.z.string(),
|
|
3283
|
+
condition: zod.z.string().optional(),
|
|
3284
|
+
steps: zod.z.array(pipelineStepSchema)
|
|
3285
|
+
})
|
|
3286
|
+
).optional()
|
|
3287
|
+
})
|
|
3288
|
+
);
|
|
3289
|
+
var pipelinePreviewSchema = zod.z.object({
|
|
3290
|
+
type: zod.z.literal("pipeline-preview"),
|
|
3291
|
+
name: zod.z.string(),
|
|
3292
|
+
description: zod.z.string().optional(),
|
|
3293
|
+
state: zod.z.enum(["draft", "running", "paused"]).optional(),
|
|
3294
|
+
source: zod.z.object({ name: zod.z.string(), kind: zod.z.string().optional() }).optional(),
|
|
3295
|
+
destinations: zod.z.array(zod.z.object({ name: zod.z.string(), kind: zod.z.string().optional() })).optional(),
|
|
3296
|
+
schedule: zod.z.object({
|
|
3297
|
+
type: zod.z.enum(["manual", "cron"]),
|
|
3298
|
+
cron: zod.z.string().optional(),
|
|
3299
|
+
label: zod.z.string().optional()
|
|
3300
|
+
}).optional(),
|
|
3301
|
+
steps: zod.z.array(pipelineStepSchema).min(1),
|
|
3302
|
+
workstreams: zod.z.array(zod.z.string()).optional(),
|
|
3303
|
+
cta: zod.z.object({ label: zod.z.string(), url: zod.z.string() }).optional()
|
|
3304
|
+
});
|
|
3305
|
+
var STEP_LEAF_PROPS = {
|
|
3306
|
+
id: { type: "string" },
|
|
3307
|
+
operation: { type: "string" },
|
|
3308
|
+
label: { type: "string" },
|
|
3309
|
+
description: { type: "string" }
|
|
3310
|
+
};
|
|
3311
|
+
var STEP_LEAF = {
|
|
3312
|
+
type: "object",
|
|
3313
|
+
properties: STEP_LEAF_PROPS,
|
|
3314
|
+
required: ["id", "operation"]
|
|
3315
|
+
};
|
|
3316
|
+
var BRANCH_LEAF = {
|
|
3317
|
+
type: "object",
|
|
3318
|
+
properties: {
|
|
3319
|
+
label: { type: "string" },
|
|
3320
|
+
condition: { type: "string" },
|
|
3321
|
+
steps: { type: "array", items: STEP_LEAF }
|
|
3322
|
+
},
|
|
3323
|
+
required: ["label", "steps"]
|
|
3324
|
+
};
|
|
3325
|
+
var STEP_NODE = {
|
|
3326
|
+
type: "object",
|
|
3327
|
+
properties: __spreadProps(__spreadValues({}, STEP_LEAF_PROPS), {
|
|
3328
|
+
subSteps: { type: "array", items: STEP_LEAF },
|
|
3329
|
+
branches: { type: "array", items: BRANCH_LEAF }
|
|
3330
|
+
}),
|
|
3331
|
+
required: ["id", "operation"]
|
|
3332
|
+
};
|
|
3333
|
+
var pipelinePreviewTool = {
|
|
3334
|
+
name: "render_pipeline_preview",
|
|
3335
|
+
description: "Render a read-only blueprint preview of a data pipeline / workflow \u2014 its name, source \u2192 destination(s), schedule, and the ordered flow of WDL operation steps (with nested FAN_OUT sub-steps and CONDITION branches) plus an optional deeplink CTA. Use to show a pipeline you designed or are proposing before it is created/activated. NOT for live run status (use job-tracker) or a grid of running services (use ops-dashboard).",
|
|
3336
|
+
input_schema: {
|
|
3337
|
+
type: "object",
|
|
3338
|
+
properties: {
|
|
3339
|
+
type: { type: "string", enum: ["pipeline-preview"] },
|
|
3340
|
+
name: { type: "string" },
|
|
3341
|
+
description: { type: "string" },
|
|
3342
|
+
state: { type: "string", enum: ["draft", "running", "paused"] },
|
|
3343
|
+
source: {
|
|
3344
|
+
type: "object",
|
|
3345
|
+
properties: {
|
|
3346
|
+
name: { type: "string" },
|
|
3347
|
+
kind: { type: "string" }
|
|
3348
|
+
},
|
|
3349
|
+
required: ["name"]
|
|
3350
|
+
},
|
|
3351
|
+
destinations: {
|
|
3352
|
+
type: "array",
|
|
3353
|
+
items: {
|
|
3354
|
+
type: "object",
|
|
3355
|
+
properties: {
|
|
3356
|
+
name: { type: "string" },
|
|
3357
|
+
kind: { type: "string" }
|
|
3358
|
+
},
|
|
3359
|
+
required: ["name"]
|
|
3360
|
+
}
|
|
3361
|
+
},
|
|
3362
|
+
schedule: {
|
|
3363
|
+
type: "object",
|
|
3364
|
+
properties: {
|
|
3365
|
+
type: { type: "string", enum: ["manual", "cron"] },
|
|
3366
|
+
cron: { type: "string" },
|
|
3367
|
+
label: { type: "string" }
|
|
3368
|
+
},
|
|
3369
|
+
required: ["type"]
|
|
3370
|
+
},
|
|
3371
|
+
steps: { type: "array", items: STEP_NODE },
|
|
3372
|
+
workstreams: { type: "array", items: { type: "string" } },
|
|
3373
|
+
cta: {
|
|
3374
|
+
type: "object",
|
|
3375
|
+
properties: {
|
|
3376
|
+
label: { type: "string" },
|
|
3377
|
+
url: { type: "string" }
|
|
3378
|
+
},
|
|
3379
|
+
required: ["label", "url"]
|
|
3380
|
+
}
|
|
3381
|
+
},
|
|
3382
|
+
required: ["type", "name", "steps"]
|
|
3383
|
+
}
|
|
3384
|
+
};
|
|
3385
|
+
|
|
3386
|
+
// src/schemas/buildRenderUITool.ts
|
|
3387
|
+
function buildRenderUITool(selectedSchemas) {
|
|
3388
|
+
const selected = selectedSchemas.filter((name) => name in schemaRegistry).map((name) => schemaRegistry[name].tool.input_schema);
|
|
3389
|
+
if (selected.length === 0) {
|
|
3390
|
+
throw new Error("buildRenderUITool: no valid schemas selected");
|
|
3391
|
+
}
|
|
3392
|
+
return {
|
|
3393
|
+
name: "render_ui",
|
|
3394
|
+
description: "Render a rich UI component for the user. Use this when the response benefits from structured visual presentation (tables, charts, metrics, cards) rather than plain text. The `type` field selects the component. You may call this tool multiple times in a single response to render multiple components.",
|
|
3395
|
+
input_schema: selected.length === 1 ? selected[0] : { type: "object", anyOf: selected }
|
|
3396
|
+
};
|
|
3397
|
+
}
|
|
3398
|
+
|
|
3399
|
+
// src/schemas/coercePayload.ts
|
|
3400
|
+
function coercePayload(data) {
|
|
3401
|
+
var _a, _b, _c;
|
|
3402
|
+
if (!data || typeof data !== "object" || Array.isArray(data)) return data;
|
|
3403
|
+
const obj = data;
|
|
3404
|
+
const type = obj.type;
|
|
3405
|
+
if (typeof type !== "string" || !(type in schemaRegistry)) return data;
|
|
3406
|
+
const props = (_c = (_b = (_a = schemaRegistry[type]) == null ? void 0 : _a.tool) == null ? void 0 : _b.input_schema) == null ? void 0 : _c.properties;
|
|
3407
|
+
if (!props || typeof props !== "object") return data;
|
|
3408
|
+
let out = null;
|
|
3409
|
+
for (const [key, propSchema] of Object.entries(props)) {
|
|
3410
|
+
const expected = propSchema == null ? void 0 : propSchema.type;
|
|
3411
|
+
if (expected !== "array" && expected !== "object") continue;
|
|
3412
|
+
const value = obj[key];
|
|
3413
|
+
if (typeof value !== "string") continue;
|
|
3414
|
+
const trimmed = value.trim();
|
|
3415
|
+
if (!trimmed || trimmed[0] !== "[" && trimmed[0] !== "{") continue;
|
|
3416
|
+
try {
|
|
3417
|
+
const parsed = JSON.parse(trimmed);
|
|
3418
|
+
const ok = expected === "array" ? Array.isArray(parsed) : parsed !== null && typeof parsed === "object" && !Array.isArray(parsed);
|
|
3419
|
+
if (ok) {
|
|
3420
|
+
if (!out) out = __spreadValues({}, obj);
|
|
3421
|
+
out[key] = parsed;
|
|
3422
|
+
}
|
|
3423
|
+
} catch (e) {
|
|
3424
|
+
}
|
|
3425
|
+
}
|
|
3426
|
+
return out != null ? out : data;
|
|
3427
|
+
}
|
|
3428
|
+
|
|
3429
|
+
// src/schemas/validatePayload.ts
|
|
3430
|
+
function validatePayload(schemaName, data) {
|
|
3431
|
+
if (!(schemaName in schemaRegistry)) {
|
|
3432
|
+
return { success: false, error: `Unknown schema: ${schemaName}` };
|
|
3433
|
+
}
|
|
3434
|
+
const { schema } = schemaRegistry[schemaName];
|
|
3435
|
+
const result = schema.safeParse(coercePayload(data));
|
|
3436
|
+
if (result.success) {
|
|
3437
|
+
return { success: true, data: result.data };
|
|
3438
|
+
}
|
|
3439
|
+
return {
|
|
3440
|
+
success: false,
|
|
3441
|
+
error: result.error.issues.map((i) => `${i.path.join(".")}: ${i.message}`).join("; ")
|
|
3442
|
+
};
|
|
3443
|
+
}
|
|
3444
|
+
|
|
3445
|
+
// src/schemas/index.ts
|
|
3446
|
+
var schemaRegistry = {
|
|
3447
|
+
"data-table": { schema: dataTableSchema, tool: dataTableTool },
|
|
3448
|
+
"status-card": { schema: statusCardSchema, tool: statusCardTool },
|
|
3449
|
+
"alert": { schema: alertSchema, tool: alertTool },
|
|
3450
|
+
"stat-grid": { schema: statGridSchema, tool: statGridTool },
|
|
3451
|
+
"tabs-panel": { schema: tabsPanelSchema, tool: tabsPanelTool },
|
|
3452
|
+
"sparkline-table": { schema: sparklineTableSchema, tool: sparklineTableTool },
|
|
3453
|
+
"heatmap-table": { schema: heatmapTableSchema, tool: heatmapTableTool },
|
|
3454
|
+
"screener-table": { schema: screenerTableSchema, tool: screenerTableTool },
|
|
3455
|
+
"grouped-table": { schema: groupedTableSchema, tool: groupedTableTool },
|
|
3456
|
+
"news-feed": { schema: newsFeedSchema, tool: newsFeedTool },
|
|
3457
|
+
"area-chart": { schema: areaChartSchema, tool: areaChartTool },
|
|
3458
|
+
"allocation-donut": { schema: allocationDonutSchema, tool: allocationDonutTool },
|
|
3459
|
+
"waterfall-chart": { schema: waterfallChartSchema, tool: waterfallChartTool },
|
|
3460
|
+
"flow-canvas": { schema: flowCanvasSchema, tool: flowCanvasTool },
|
|
3461
|
+
"trial-balance": { schema: trialBalanceSchema, tool: trialBalanceTool },
|
|
3462
|
+
"journal-entry": { schema: journalEntrySchema, tool: journalEntryTool },
|
|
3463
|
+
"aging-report": { schema: agingReportSchema, tool: agingReportTool },
|
|
3464
|
+
"variance-analysis": { schema: varianceAnalysisSchema, tool: varianceAnalysisTool },
|
|
3465
|
+
"stacked-breakdown": { schema: stackedBreakdownSchema, tool: stackedBreakdownTool },
|
|
3466
|
+
"comparative-bar-chart": { schema: comparativeBarChartSchema, tool: comparativeBarChartTool },
|
|
3467
|
+
"compliance-checklist": { schema: complianceChecklistSchema, tool: complianceChecklistTool },
|
|
3468
|
+
"reconciliation-view": { schema: reconciliationViewSchema, tool: reconciliationViewTool },
|
|
3469
|
+
"audit-trail": { schema: auditTrailSchema, tool: auditTrailTool },
|
|
3470
|
+
"document-preview": { schema: documentPreviewSchema, tool: documentPreviewTool },
|
|
3471
|
+
"provenance-chain": { schema: provenanceChainSchema, tool: provenanceChainTool },
|
|
3472
|
+
"search-results": { schema: searchResultsSchema, tool: searchResultsTool },
|
|
3473
|
+
"legal-test-result": { schema: legalTestResultSchema, tool: legalTestResultTool },
|
|
3474
|
+
"engagement-pipeline": { schema: engagementPipelineSchema, tool: engagementPipelineTool },
|
|
3475
|
+
"entity-card-grid": { schema: entityCardGridSchema, tool: entityCardGridTool },
|
|
3476
|
+
"job-tracker": { schema: jobTrackerSchema, tool: jobTrackerTool },
|
|
3477
|
+
"cited-answer": { schema: citedAnswerSchema, tool: citedAnswerTool },
|
|
3478
|
+
"transaction-feed": { schema: transactionFeedSchema, tool: transactionFeedTool },
|
|
3479
|
+
"file-browser": { schema: fileBrowserSchema, tool: fileBrowserTool },
|
|
3480
|
+
"download-card": { schema: downloadCardSchema, tool: downloadCardTool },
|
|
3481
|
+
"ops-dashboard": { schema: opsDashboardSchema, tool: opsDashboardTool },
|
|
3482
|
+
"key-value-list": { schema: keyValueListSchema, tool: keyValueListTool },
|
|
3483
|
+
"balance-sheet": { schema: balanceSheetSchema, tool: balanceSheetTool },
|
|
3484
|
+
"income-statement": { schema: incomeStatementSchema, tool: incomeStatementTool },
|
|
3485
|
+
"cash-flow-statement": { schema: cashFlowStatementSchema, tool: cashFlowStatementTool },
|
|
3486
|
+
"general-ledger": { schema: generalLedgerSchema, tool: generalLedgerTool },
|
|
3487
|
+
"chart-of-accounts": { schema: chartOfAccountsSchema, tool: chartOfAccountsTool },
|
|
3488
|
+
"invoice-detail": { schema: invoiceDetailSchema, tool: invoiceDetailTool },
|
|
3489
|
+
"amortization-table": { schema: amortizationTableSchema, tool: amortizationTableTool },
|
|
3490
|
+
"depreciation-schedule": { schema: depreciationScheduleSchema, tool: depreciationScheduleTool },
|
|
3491
|
+
"escalation-card": { schema: escalationCardSchema, tool: escalationCardTool },
|
|
3492
|
+
"line-chart": { schema: lineChartSchema, tool: lineChartTool },
|
|
3493
|
+
"combo-chart": { schema: comboChartSchema, tool: comboChartTool },
|
|
3494
|
+
"gauge-chart": { schema: gaugeChartSchema, tool: gaugeChartTool },
|
|
3495
|
+
"treemap-chart": { schema: treemapChartSchema, tool: treemapChartTool },
|
|
3496
|
+
"radar-chart": { schema: radarChartSchema, tool: radarChartTool },
|
|
3497
|
+
"funnel-chart": { schema: funnelChartSchema, tool: funnelChartTool },
|
|
3498
|
+
"bullet-chart": { schema: bulletChartSchema, tool: bulletChartTool },
|
|
3499
|
+
"scatter-chart": { schema: scatterChartSchema, tool: scatterChartTool },
|
|
3500
|
+
"connect-integration": { schema: connectIntegrationSchema, tool: connectIntegrationTool },
|
|
3501
|
+
"integrations-list": { schema: integrationsListSchema, tool: integrationsListTool },
|
|
3502
|
+
"pipeline-preview": { schema: pipelinePreviewSchema, tool: pipelinePreviewTool }
|
|
3503
|
+
};
|
|
3504
|
+
|
|
3505
|
+
exports.buildRenderUITool = buildRenderUITool;
|
|
3506
|
+
exports.schemaRegistry = schemaRegistry;
|
|
3507
|
+
exports.validatePayload = validatePayload;
|
|
3508
|
+
//# sourceMappingURL=index.cjs.map
|
|
3509
|
+
//# sourceMappingURL=index.cjs.map
|