@yancyyu/openhermit 1.5.8
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/LICENSE +611 -0
- package/README.md +220 -0
- package/bin/hermit.mjs +364 -0
- package/bin/kill-dev.js +20 -0
- package/dist-renderer/assets/01-BApSFlV4.png +0 -0
- package/dist-renderer/assets/02-CRQGs29u.png +0 -0
- package/dist-renderer/assets/03-BFCM2jnD.png +0 -0
- package/dist-renderer/assets/04-B2FThbKO.png +0 -0
- package/dist-renderer/assets/05-D9p0Znkd.png +0 -0
- package/dist-renderer/assets/06-DZAfbDlP.png +0 -0
- package/dist-renderer/assets/07-B_PXWGCc.png +0 -0
- package/dist-renderer/assets/08-DGRMZ6sl.png +0 -0
- package/dist-renderer/assets/09-SGCQvc7U.png +0 -0
- package/dist-renderer/assets/10-Cve81Q3W.png +0 -0
- package/dist-renderer/assets/11-DGglolDW.png +0 -0
- package/dist-renderer/assets/12-C3lnu79c.png +0 -0
- package/dist-renderer/assets/13-M59meqdw.png +0 -0
- package/dist-renderer/assets/ProjectEditorOverlay-BNoDw9T1.js +57 -0
- package/dist-renderer/assets/TeamGraphOverlay-CfGRKQIu.js +1 -0
- package/dist-renderer/assets/_basePickBy-Ct8Hm5_h.js +1 -0
- package/dist-renderer/assets/_baseUniq-BofrAFBx.js +1 -0
- package/dist-renderer/assets/apl-B4CMkyY2.js +1 -0
- package/dist-renderer/assets/arc-AbJgatzR.js +1 -0
- package/dist-renderer/assets/architectureDiagram-VXUJARFQ-gpniCJVk.js +36 -0
- package/dist-renderer/assets/asciiarmor-Df11BRmG.js +1 -0
- package/dist-renderer/assets/asn1-EdZsLKOL.js +1 -0
- package/dist-renderer/assets/asterisk-B-8jnY81.js +1 -0
- package/dist-renderer/assets/blockDiagram-VD42YOAC-aBbbmONC.js +122 -0
- package/dist-renderer/assets/brainfuck-C4LP7Hcl.js +1 -0
- package/dist-renderer/assets/c4Diagram-YG6GDRKO-DJio1IsU.js +10 -0
- package/dist-renderer/assets/channel-CZ8sd5Xf.js +1 -0
- package/dist-renderer/assets/chunk-4BX2VUAB-D1_HKao2.js +1 -0
- package/dist-renderer/assets/chunk-55IACEB6-NAmVxF4k.js +1 -0
- package/dist-renderer/assets/chunk-B4BG7PRW-Ce829laz.js +165 -0
- package/dist-renderer/assets/chunk-DI55MBZ5-Ct2Le12y.js +220 -0
- package/dist-renderer/assets/chunk-FMBD7UC4-Cie3DzKk.js +15 -0
- package/dist-renderer/assets/chunk-QN33PNHL-4f5Yb50e.js +1 -0
- package/dist-renderer/assets/chunk-QZHKN3VN-D9ranl9c.js +1 -0
- package/dist-renderer/assets/chunk-TZMSLE5B-bdGZWlEy.js +1 -0
- package/dist-renderer/assets/classDiagram-2ON5EDUG-CMcfSKj5.js +1 -0
- package/dist-renderer/assets/classDiagram-v2-WZHVMYZB-CMcfSKj5.js +1 -0
- package/dist-renderer/assets/clike-B9uivgTg.js +1 -0
- package/dist-renderer/assets/clojure-BMjYHr_A.js +1 -0
- package/dist-renderer/assets/clone-CMuwA8RV.js +1 -0
- package/dist-renderer/assets/cmake-BQqOBYOt.js +1 -0
- package/dist-renderer/assets/cobol-CWcv1MsR.js +1 -0
- package/dist-renderer/assets/coffeescript-S37ZYGWr.js +1 -0
- package/dist-renderer/assets/commonlisp-DBKNyK5s.js +1 -0
- package/dist-renderer/assets/cose-bilkent-S5V4N54A-C6tvfcVi.js +1 -0
- package/dist-renderer/assets/crystal-SjHAIU92.js +1 -0
- package/dist-renderer/assets/css-BnMrqG3P.js +1 -0
- package/dist-renderer/assets/cypher-C_CwsFkJ.js +1 -0
- package/dist-renderer/assets/cytoscape.esm-DsxaTqgk.js +331 -0
- package/dist-renderer/assets/d-pRatUO7H.js +1 -0
- package/dist-renderer/assets/dagre-6UL2VRFP-B-4qcZam.js +4 -0
- package/dist-renderer/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/dist-renderer/assets/diagram-PSM6KHXK-CwT3TLjx.js +24 -0
- package/dist-renderer/assets/diagram-QEK2KX5R-BWH6-ZFd.js +43 -0
- package/dist-renderer/assets/diagram-S2PKOQOG-DfpPnfi1.js +24 -0
- package/dist-renderer/assets/diff-DbItnlRl.js +1 -0
- package/dist-renderer/assets/dockerfile-BKs6k2Af.js +1 -0
- package/dist-renderer/assets/dtd-DF_7sFjM.js +1 -0
- package/dist-renderer/assets/dylan-DwRh75JA.js +1 -0
- package/dist-renderer/assets/ebnf-CDyGwa7X.js +1 -0
- package/dist-renderer/assets/ecl-Cabwm37j.js +1 -0
- package/dist-renderer/assets/eiffel-CnydiIhH.js +1 -0
- package/dist-renderer/assets/elm-vLlmbW-K.js +1 -0
- package/dist-renderer/assets/erDiagram-Q2GNP2WA-BFbEFR4x.js +60 -0
- package/dist-renderer/assets/erlang-BNw1qcRV.js +1 -0
- package/dist-renderer/assets/factor-kuTfRLto.js +1 -0
- package/dist-renderer/assets/favicon-B8xY-GVk.png +0 -0
- package/dist-renderer/assets/fcl-Kvtd6kyn.js +1 -0
- package/dist-renderer/assets/flowDiagram-NV44I4VS-Dg3cf5hW.js +162 -0
- package/dist-renderer/assets/forth-Ffai-XNe.js +1 -0
- package/dist-renderer/assets/fortran-DYz_wnZ1.js +1 -0
- package/dist-renderer/assets/ganttDiagram-JELNMOA3-B21y55W5.js +267 -0
- package/dist-renderer/assets/gas-Bneqetm1.js +1 -0
- package/dist-renderer/assets/gherkin-heZmZLOM.js +1 -0
- package/dist-renderer/assets/gitGraphDiagram-V2S2FVAM-BDV3BJzn.js +65 -0
- package/dist-renderer/assets/graph-BfaZ4hZt.js +1 -0
- package/dist-renderer/assets/groovy-D9Dt4D0W.js +1 -0
- package/dist-renderer/assets/haskell-BWDZoCOh.js +1 -0
- package/dist-renderer/assets/haxe-H-WmDvRZ.js +1 -0
- package/dist-renderer/assets/http-DBlCnlav.js +1 -0
- package/dist-renderer/assets/idl-BEugSyMb.js +1 -0
- package/dist-renderer/assets/index-BMXHMpkG.js +1 -0
- package/dist-renderer/assets/index-CCqtDawH.js +1 -0
- package/dist-renderer/assets/index-CVMSpK8C.js +1 -0
- package/dist-renderer/assets/index-CZltVMDP.js +1844 -0
- package/dist-renderer/assets/index-CaG9mf8s.css +1 -0
- package/dist-renderer/assets/index-Ct0-y9TF.js +1 -0
- package/dist-renderer/assets/index-pMg_LlsS.js +1 -0
- package/dist-renderer/assets/infoDiagram-HS3SLOUP-DvMlS0CL.js +2 -0
- package/dist-renderer/assets/init-Gi6I4Gst.js +1 -0
- package/dist-renderer/assets/javascript-qCveANmP.js +1 -0
- package/dist-renderer/assets/journeyDiagram-XKPGCS4Q-DIyMluRv.js +139 -0
- package/dist-renderer/assets/julia-DuME0IfC.js +1 -0
- package/dist-renderer/assets/kanban-definition-3W4ZIXB7-CVOx8f-7.js +89 -0
- package/dist-renderer/assets/katex-DGN8GczM.js +261 -0
- package/dist-renderer/assets/layout-BPKIXUf4.js +1 -0
- package/dist-renderer/assets/linear-CScZGLr2.js +1 -0
- package/dist-renderer/assets/livescript-BwQOo05w.js +1 -0
- package/dist-renderer/assets/lua-BgMRiT3U.js +1 -0
- package/dist-renderer/assets/mathematica-DTrFuWx2.js +1 -0
- package/dist-renderer/assets/mbox-CNhZ1qSd.js +1 -0
- package/dist-renderer/assets/mindmap-definition-VGOIOE7T-CmDQ7Wo6.js +68 -0
- package/dist-renderer/assets/mirc-CjQqDB4T.js +1 -0
- package/dist-renderer/assets/mllike-CXdrOF99.js +1 -0
- package/dist-renderer/assets/modelica-Dc1JOy9r.js +1 -0
- package/dist-renderer/assets/mscgen-BA5vi2Kp.js +1 -0
- package/dist-renderer/assets/mumps-BT43cFF4.js +1 -0
- package/dist-renderer/assets/nginx-DdIZxoE0.js +1 -0
- package/dist-renderer/assets/nsis-LdVXkNf5.js +1 -0
- package/dist-renderer/assets/ntriples-BfvgReVJ.js +1 -0
- package/dist-renderer/assets/octave-Ck1zUtKM.js +1 -0
- package/dist-renderer/assets/ordinal-Cboi1Yqb.js +1 -0
- package/dist-renderer/assets/oz-BzwKVEFT.js +1 -0
- package/dist-renderer/assets/pascal--L3eBynH.js +1 -0
- package/dist-renderer/assets/perl-CdXCOZ3F.js +1 -0
- package/dist-renderer/assets/pieDiagram-ADFJNKIX-DbVClin-.js +30 -0
- package/dist-renderer/assets/pig-CevX1Tat.js +1 -0
- package/dist-renderer/assets/powershell-CFHJl5sT.js +1 -0
- package/dist-renderer/assets/properties-C78fOPTZ.js +1 -0
- package/dist-renderer/assets/protobuf-ChK-085T.js +1 -0
- package/dist-renderer/assets/pug-DukmZTjD.js +1 -0
- package/dist-renderer/assets/puppet-DMA9R1ak.js +1 -0
- package/dist-renderer/assets/python-BuPzkPfP.js +1 -0
- package/dist-renderer/assets/q-pXgVlZs6.js +1 -0
- package/dist-renderer/assets/quadrantDiagram-AYHSOK5B-CAB0MYcW.js +7 -0
- package/dist-renderer/assets/r-DUYO_cvP.js +1 -0
- package/dist-renderer/assets/requirementDiagram-UZGBJVZJ-w2Lfpg3T.js +64 -0
- package/dist-renderer/assets/rpm-CTu-6PCP.js +1 -0
- package/dist-renderer/assets/ruby-B2Rjki9n.js +1 -0
- package/dist-renderer/assets/sankeyDiagram-TZEHDZUN-kvG1QoKY.js +10 -0
- package/dist-renderer/assets/sas-B4kiWyti.js +1 -0
- package/dist-renderer/assets/scheme-C41bIUwD.js +1 -0
- package/dist-renderer/assets/sequenceDiagram-WL72ISMW-DCVBQ23J.js +145 -0
- package/dist-renderer/assets/shell-CjFT_Tl9.js +1 -0
- package/dist-renderer/assets/sieve-C3Gn_uJK.js +1 -0
- package/dist-renderer/assets/simple-mode-GW_nhZxv.js +1 -0
- package/dist-renderer/assets/smalltalk-CnHTOXQT.js +1 -0
- package/dist-renderer/assets/solr-DehyRSwq.js +1 -0
- package/dist-renderer/assets/sparql-DkYu6x3z.js +1 -0
- package/dist-renderer/assets/splashScene-C8lWNnm4.js +1 -0
- package/dist-renderer/assets/spreadsheet-BCZA_wO0.js +1 -0
- package/dist-renderer/assets/sql-D0XecflT.js +1 -0
- package/dist-renderer/assets/stateDiagram-FKZM4ZOC-ItZ0JBvq.js +1 -0
- package/dist-renderer/assets/stateDiagram-v2-4FDKWEC3-Hpmw4dMm.js +1 -0
- package/dist-renderer/assets/stex-C3f8Ysf7.js +1 -0
- package/dist-renderer/assets/stylus-B533Al4x.js +1 -0
- package/dist-renderer/assets/swift-BzpIVaGY.js +1 -0
- package/dist-renderer/assets/tcl-DVfN8rqt.js +1 -0
- package/dist-renderer/assets/textile-CnDTJFAw.js +1 -0
- package/dist-renderer/assets/tiddlywiki-DO-Gjzrf.js +1 -0
- package/dist-renderer/assets/tiki-DGYXhP31.js +1 -0
- package/dist-renderer/assets/timeline-definition-IT6M3QCI-BzSFaAjV.js +61 -0
- package/dist-renderer/assets/toml-Bm5Em-hy.js +1 -0
- package/dist-renderer/assets/treemap-GDKQZRPO-fSz4hQn0.js +162 -0
- package/dist-renderer/assets/troff-wAsdV37c.js +1 -0
- package/dist-renderer/assets/ttcn-CfJYG6tj.js +1 -0
- package/dist-renderer/assets/ttcn-cfg-B9xdYoR4.js +1 -0
- package/dist-renderer/assets/turtle-B1tBg_DP.js +1 -0
- package/dist-renderer/assets/vb-CmGdzxic.js +1 -0
- package/dist-renderer/assets/vbscript-BuJXcnF6.js +1 -0
- package/dist-renderer/assets/velocity-D8B20fx6.js +1 -0
- package/dist-renderer/assets/verilog-C6RDOZhf.js +1 -0
- package/dist-renderer/assets/vhdl-lSbBsy5d.js +1 -0
- package/dist-renderer/assets/webidl-ZXfAyPTL.js +1 -0
- package/dist-renderer/assets/xquery-CQfU5ijd.js +1 -0
- package/dist-renderer/assets/xychartDiagram-PRI3JC2R-CT1kaGlv.js +7 -0
- package/dist-renderer/assets/yacas-BJ4BC0dw.js +1 -0
- package/dist-renderer/assets/z80-Hz9HOZM7.js +1 -0
- package/dist-renderer/index.html +1274 -0
- package/package.json +181 -0
- package/src/features/README.md +24 -0
- package/src/features/agent-graph/README.md +21 -0
- package/src/features/agent-graph/STABLE_SLOT_LAYOUT_PLAN.md +2846 -0
- package/src/features/agent-graph/core/domain/buildInlineActivityEntries.ts +416 -0
- package/src/features/agent-graph/core/domain/collapseOverflowStacks.ts +126 -0
- package/src/features/agent-graph/core/domain/graphOwnerIdentity.ts +55 -0
- package/src/features/agent-graph/core/domain/taskGraphSemantics.ts +48 -0
- package/src/features/agent-graph/renderer/adapters/TeamGraphAdapter.ts +1400 -0
- package/src/features/agent-graph/renderer/hooks/useGraphActivityContext.ts +34 -0
- package/src/features/agent-graph/renderer/hooks/useGraphCreateTaskDialog.tsx +126 -0
- package/src/features/agent-graph/renderer/hooks/useGraphMemberPopoverContext.ts +34 -0
- package/src/features/agent-graph/renderer/hooks/useGraphSidebarVisibility.ts +52 -0
- package/src/features/agent-graph/renderer/hooks/useTeamGraphAdapter.ts +173 -0
- package/src/features/agent-graph/renderer/hooks/useTeamGraphSurfaceActions.ts +98 -0
- package/src/features/agent-graph/renderer/index.ts +14 -0
- package/src/features/agent-graph/renderer/ui/GraphActivityCard.tsx +96 -0
- package/src/features/agent-graph/renderer/ui/GraphActivityHud.tsx +498 -0
- package/src/features/agent-graph/renderer/ui/GraphBlockingEdgePopover.tsx +207 -0
- package/src/features/agent-graph/renderer/ui/GraphNodePopover.tsx +573 -0
- package/src/features/agent-graph/renderer/ui/GraphProvisioningHud.tsx +113 -0
- package/src/features/agent-graph/renderer/ui/GraphTaskCard.tsx +149 -0
- package/src/features/agent-graph/renderer/ui/GraphTransientHandoffHud.tsx +176 -0
- package/src/features/agent-graph/renderer/ui/TeamGraphOverlay.tsx +224 -0
- package/src/features/agent-graph/renderer/ui/TeamGraphTab.tsx +257 -0
- package/src/features/agent-graph/renderer/ui/buildTransientHandoffMessage.ts +70 -0
- package/src/features/recent-projects/contracts/api.ts +5 -0
- package/src/features/recent-projects/contracts/channels.ts +2 -0
- package/src/features/recent-projects/contracts/dto.ts +24 -0
- package/src/features/recent-projects/contracts/index.ts +4 -0
- package/src/features/recent-projects/contracts/normalize.ts +32 -0
- package/src/features/recent-projects/core/application/models/ListDashboardRecentProjectsResponse.ts +6 -0
- package/src/features/recent-projects/core/application/ports/ClockPort.ts +3 -0
- package/src/features/recent-projects/core/application/ports/ListDashboardRecentProjectsOutputPort.ts +5 -0
- package/src/features/recent-projects/core/application/ports/LoggerPort.ts +5 -0
- package/src/features/recent-projects/core/application/ports/RecentProjectsCachePort.ts +5 -0
- package/src/features/recent-projects/core/application/ports/RecentProjectsSourcePort.ts +14 -0
- package/src/features/recent-projects/core/application/use-cases/ListDashboardRecentProjectsUseCase.ts +191 -0
- package/src/features/recent-projects/core/domain/models/ProviderId.ts +1 -0
- package/src/features/recent-projects/core/domain/models/RecentProjectAggregate.ts +14 -0
- package/src/features/recent-projects/core/domain/models/RecentProjectCandidate.ts +14 -0
- package/src/features/recent-projects/core/domain/models/RecentProjectOpenTarget.ts +3 -0
- package/src/features/recent-projects/core/domain/policies/mergeRecentProjectCandidates.ts +88 -0
- package/src/features/recent-projects/main/adapters/input/http/registerRecentProjectsHttp.ts +30 -0
- package/src/features/recent-projects/main/adapters/output/presenters/DashboardRecentProjectsPresenter.ts +27 -0
- package/src/features/recent-projects/main/adapters/output/sources/ClaudeRecentProjectsSourceAdapter.ts +91 -0
- package/src/features/recent-projects/main/adapters/output/sources/CodexRecentProjectsSourceAdapter.ts +326 -0
- package/src/features/recent-projects/main/composition/createRecentProjectsFeature.ts +43 -0
- package/src/features/recent-projects/main/index.ts +3 -0
- package/src/features/recent-projects/main/infrastructure/cache/InMemoryRecentProjectsCache.ts +34 -0
- package/src/features/recent-projects/main/infrastructure/codex/CodexAppServerClient.ts +116 -0
- package/src/features/recent-projects/main/infrastructure/identity/RecentProjectIdentityResolver.ts +20 -0
- package/src/features/recent-projects/main/infrastructure/identity/normalizeIdentityPath.ts +10 -0
- package/src/features/recent-projects/renderer/adapters/RecentProjectsSectionAdapter.ts +132 -0
- package/src/features/recent-projects/renderer/hooks/useOpenRecentProject.ts +143 -0
- package/src/features/recent-projects/renderer/hooks/useRecentProjectsSection.ts +289 -0
- package/src/features/recent-projects/renderer/index.ts +2 -0
- package/src/features/recent-projects/renderer/ui/RecentProjectCard.tsx +221 -0
- package/src/features/recent-projects/renderer/ui/RecentProjectsSection.tsx +167 -0
- package/src/features/recent-projects/renderer/utils/activeProjectTeams.ts +48 -0
- package/src/features/recent-projects/renderer/utils/navigation.ts +65 -0
- package/src/features/recent-projects/renderer/utils/projectDecorations.ts +11 -0
- package/src/features/recent-projects/renderer/utils/recentProjectOpenHistory.ts +268 -0
- package/src/features/recent-projects/renderer/utils/recentProjectsClientCache.ts +78 -0
- package/src/main/constants/messageTags.ts +46 -0
- package/src/main/constants/worktreePatterns.ts +47 -0
- package/src/main/server.ts +3705 -0
- package/src/main/services/UpdateService.ts +166 -0
- package/src/main/services/ccConnect/CcConnectBridge.ts +313 -0
- package/src/main/services/ccConnect/CcConnectClient.ts +397 -0
- package/src/main/services/ccConnect/MessageBridge.ts +162 -0
- package/src/main/services/ccConnect/ProjectMappingStore.ts +148 -0
- package/src/main/services/ccConnect/index.ts +8 -0
- package/src/main/services/teams-mvp/TeamProvisioningService.ts +275 -0
- package/src/main/services/teams-mvp/TeamWorkspaceService.ts +404 -0
- package/src/main/services/teams-mvp/index.ts +26 -0
- package/src/main/types/chunks.ts +506 -0
- package/src/main/types/domain.ts +342 -0
- package/src/main/types/index.ts +24 -0
- package/src/main/types/jsonl.ts +355 -0
- package/src/main/types/messages.ts +395 -0
- package/src/renderer/App.tsx +287 -0
- package/src/renderer/api/httpClient.ts +2207 -0
- package/src/renderer/api/index.ts +19 -0
- package/src/renderer/api/providers.ts +77 -0
- package/src/renderer/assets/participant-avatars/01.png +0 -0
- package/src/renderer/assets/participant-avatars/02.png +0 -0
- package/src/renderer/assets/participant-avatars/03.png +0 -0
- package/src/renderer/assets/participant-avatars/04.png +0 -0
- package/src/renderer/assets/participant-avatars/05.png +0 -0
- package/src/renderer/assets/participant-avatars/06.png +0 -0
- package/src/renderer/assets/participant-avatars/07.png +0 -0
- package/src/renderer/assets/participant-avatars/08.png +0 -0
- package/src/renderer/assets/participant-avatars/09.png +0 -0
- package/src/renderer/assets/participant-avatars/10.png +0 -0
- package/src/renderer/assets/participant-avatars/11.png +0 -0
- package/src/renderer/assets/participant-avatars/12.png +0 -0
- package/src/renderer/assets/participant-avatars/13.png +0 -0
- package/src/renderer/components/chat/AIChatGroup.tsx +519 -0
- package/src/renderer/components/chat/ChatHistory.tsx +1115 -0
- package/src/renderer/components/chat/ChatHistoryEmptyState.tsx +15 -0
- package/src/renderer/components/chat/ChatHistoryItem.tsx +144 -0
- package/src/renderer/components/chat/ChatHistoryLoadingState.tsx +45 -0
- package/src/renderer/components/chat/CompactBoundary.tsx +169 -0
- package/src/renderer/components/chat/ContextBadge.tsx +582 -0
- package/src/renderer/components/chat/DisplayItemList.tsx +431 -0
- package/src/renderer/components/chat/LastOutputDisplay.tsx +259 -0
- package/src/renderer/components/chat/SessionContextPanel/DirectoryTree/DirectoryTreeNode.tsx +125 -0
- package/src/renderer/components/chat/SessionContextPanel/DirectoryTree/buildDirectoryTree.ts +47 -0
- package/src/renderer/components/chat/SessionContextPanel/DirectoryTree/types.ts +12 -0
- package/src/renderer/components/chat/SessionContextPanel/components/ClaudeMdFilesSection.tsx +90 -0
- package/src/renderer/components/chat/SessionContextPanel/components/ClaudeMdSection.tsx +86 -0
- package/src/renderer/components/chat/SessionContextPanel/components/CollapsibleSection.tsx +77 -0
- package/src/renderer/components/chat/SessionContextPanel/components/FlatInjectionList.tsx +248 -0
- package/src/renderer/components/chat/SessionContextPanel/components/MentionedFilesSection.tsx +50 -0
- package/src/renderer/components/chat/SessionContextPanel/components/RankedInjectionList.tsx +284 -0
- package/src/renderer/components/chat/SessionContextPanel/components/SessionContextHeader.tsx +290 -0
- package/src/renderer/components/chat/SessionContextPanel/components/SessionContextHelpTooltip.tsx +165 -0
- package/src/renderer/components/chat/SessionContextPanel/components/TaskCoordinationSection.tsx +47 -0
- package/src/renderer/components/chat/SessionContextPanel/components/ThinkingTextSection.tsx +47 -0
- package/src/renderer/components/chat/SessionContextPanel/components/ToolOutputsSection.tsx +47 -0
- package/src/renderer/components/chat/SessionContextPanel/components/UserMessagesSection.tsx +47 -0
- package/src/renderer/components/chat/SessionContextPanel/index.tsx +314 -0
- package/src/renderer/components/chat/SessionContextPanel/items/ClaudeMdItem.tsx +76 -0
- package/src/renderer/components/chat/SessionContextPanel/items/MentionedFileItem.tsx +91 -0
- package/src/renderer/components/chat/SessionContextPanel/items/TaskCoordinationItem.tsx +116 -0
- package/src/renderer/components/chat/SessionContextPanel/items/ThinkingTextItem.tsx +96 -0
- package/src/renderer/components/chat/SessionContextPanel/items/ToolBreakdownItem.tsx +38 -0
- package/src/renderer/components/chat/SessionContextPanel/items/ToolOutputItem.tsx +113 -0
- package/src/renderer/components/chat/SessionContextPanel/items/UserMessageItem.tsx +69 -0
- package/src/renderer/components/chat/SessionContextPanel/types.ts +96 -0
- package/src/renderer/components/chat/SessionContextPanel/utils/formatting.ts +6 -0
- package/src/renderer/components/chat/SessionContextPanel/utils/pathParsing.ts +23 -0
- package/src/renderer/components/chat/SystemChatGroup.tsx +60 -0
- package/src/renderer/components/chat/UserChatGroup.tsx +668 -0
- package/src/renderer/components/chat/items/BaseItem.tsx +213 -0
- package/src/renderer/components/chat/items/ExecutionTrace.tsx +279 -0
- package/src/renderer/components/chat/items/LinkedToolItem.tsx +235 -0
- package/src/renderer/components/chat/items/MetricsPill.tsx +215 -0
- package/src/renderer/components/chat/items/SlashItem.tsx +81 -0
- package/src/renderer/components/chat/items/SubagentItem.tsx +592 -0
- package/src/renderer/components/chat/items/TeammateMessageItem.tsx +261 -0
- package/src/renderer/components/chat/items/TextItem.tsx +82 -0
- package/src/renderer/components/chat/items/ThinkingItem.tsx +82 -0
- package/src/renderer/components/chat/items/baseItemHelpers.ts +42 -0
- package/src/renderer/components/chat/items/linkedTool/CollapsibleOutputSection.tsx +57 -0
- package/src/renderer/components/chat/items/linkedTool/DefaultToolViewer.tsx +56 -0
- package/src/renderer/components/chat/items/linkedTool/EditToolViewer.tsx +74 -0
- package/src/renderer/components/chat/items/linkedTool/ReadToolViewer.tsx +102 -0
- package/src/renderer/components/chat/items/linkedTool/SkillToolViewer.tsx +67 -0
- package/src/renderer/components/chat/items/linkedTool/ToolErrorDisplay.tsx +43 -0
- package/src/renderer/components/chat/items/linkedTool/WriteToolViewer.tsx +66 -0
- package/src/renderer/components/chat/items/linkedTool/index.ts +13 -0
- package/src/renderer/components/chat/items/linkedTool/renderHelpers.tsx +259 -0
- package/src/renderer/components/chat/markdownComponents.tsx +257 -0
- package/src/renderer/components/chat/markdownCopyUtils.ts +18 -0
- package/src/renderer/components/chat/searchHighlightUtils.ts +166 -0
- package/src/renderer/components/chat/viewers/CodeBlockViewer.tsx +244 -0
- package/src/renderer/components/chat/viewers/DiffViewer.tsx +459 -0
- package/src/renderer/components/chat/viewers/FileLink.tsx +182 -0
- package/src/renderer/components/chat/viewers/MarkdownViewer.tsx +1093 -0
- package/src/renderer/components/chat/viewers/MermaidDiagram.tsx +116 -0
- package/src/renderer/components/chat/viewers/index.ts +3 -0
- package/src/renderer/components/chat/viewers/syntaxHighlighter.ts +583 -0
- package/src/renderer/components/common/AppLogo.tsx +61 -0
- package/src/renderer/components/common/CliInstallWarningBanner.tsx +57 -0
- package/src/renderer/components/common/ConfirmDialog.tsx +176 -0
- package/src/renderer/components/common/ConnectionStatusBadge.tsx +56 -0
- package/src/renderer/components/common/ContextSwitchOverlay.tsx +38 -0
- package/src/renderer/components/common/CopyButton.tsx +85 -0
- package/src/renderer/components/common/CopyablePath.tsx +68 -0
- package/src/renderer/components/common/ErrorBoundary.tsx +211 -0
- package/src/renderer/components/common/ExportDropdown.tsx +142 -0
- package/src/renderer/components/common/FileTree.tsx +182 -0
- package/src/renderer/components/common/GlobalProviderStatusHeader.tsx +316 -0
- package/src/renderer/components/common/OngoingIndicator.tsx +67 -0
- package/src/renderer/components/common/ProviderBrandLogo.tsx +206 -0
- package/src/renderer/components/common/RepositoryDropdown.tsx +230 -0
- package/src/renderer/components/common/TokenUsageDisplay.tsx +581 -0
- package/src/renderer/components/common/WarningBanner.tsx +25 -0
- package/src/renderer/components/common/WorkspaceIndicator.tsx +183 -0
- package/src/renderer/components/common/WorktreeBadge.tsx +123 -0
- package/src/renderer/components/dashboard/CliStatusBanner.tsx +1845 -0
- package/src/renderer/components/dashboard/DashboardView.tsx +274 -0
- package/src/renderer/components/extensions/ExtensionStoreView.tsx +591 -0
- package/src/renderer/components/extensions/ExtensionsSubTabTrigger.tsx +52 -0
- package/src/renderer/components/extensions/apikeys/ApiKeyCard.tsx +143 -0
- package/src/renderer/components/extensions/apikeys/ApiKeyFormDialog.tsx +282 -0
- package/src/renderer/components/extensions/apikeys/ApiKeysPanel.tsx +280 -0
- package/src/renderer/components/extensions/common/InstallButton.tsx +186 -0
- package/src/renderer/components/extensions/common/InstallCountBadge.tsx +21 -0
- package/src/renderer/components/extensions/common/SearchInput.tsx +70 -0
- package/src/renderer/components/extensions/common/SourceBadge.tsx +31 -0
- package/src/renderer/components/extensions/mcp/CustomMcpServerDialog.tsx +560 -0
- package/src/renderer/components/extensions/mcp/McpServerCard.tsx +314 -0
- package/src/renderer/components/extensions/mcp/McpServerDetailDialog.tsx +669 -0
- package/src/renderer/components/extensions/mcp/McpServersPanel.tsx +543 -0
- package/src/renderer/components/extensions/plugins/CapabilityChips.tsx +70 -0
- package/src/renderer/components/extensions/plugins/CategoryChips.tsx +67 -0
- package/src/renderer/components/extensions/plugins/PluginCard.tsx +146 -0
- package/src/renderer/components/extensions/plugins/PluginDetailDialog.tsx +270 -0
- package/src/renderer/components/extensions/plugins/PluginsPanel.tsx +436 -0
- package/src/renderer/components/extensions/skills/SkillCodeEditor.tsx +117 -0
- package/src/renderer/components/extensions/skills/SkillDetailDialog.tsx +372 -0
- package/src/renderer/components/extensions/skills/SkillEditorDialog.tsx +856 -0
- package/src/renderer/components/extensions/skills/SkillImportDialog.tsx +343 -0
- package/src/renderer/components/extensions/skills/SkillReviewDialog.tsx +166 -0
- package/src/renderer/components/extensions/skills/SkillsPanel.tsx +784 -0
- package/src/renderer/components/extensions/skills/skillDraftUtils.ts +234 -0
- package/src/renderer/components/extensions/skills/skillFolderNameUtils.ts +19 -0
- package/src/renderer/components/extensions/skills/skillProjectUtils.ts +13 -0
- package/src/renderer/components/extensions/skills/skillValidationUtils.ts +31 -0
- package/src/renderer/components/layout/MiddlePanel.tsx +18 -0
- package/src/renderer/components/layout/MoreMenu.tsx +243 -0
- package/src/renderer/components/layout/PaneContainer.tsx +27 -0
- package/src/renderer/components/layout/PaneContent.tsx +84 -0
- package/src/renderer/components/layout/PaneResizeHandle.tsx +85 -0
- package/src/renderer/components/layout/PaneSplitDropZone.tsx +54 -0
- package/src/renderer/components/layout/PaneView.tsx +75 -0
- package/src/renderer/components/layout/SessionTabContent.tsx +102 -0
- package/src/renderer/components/layout/Sidebar.tsx +205 -0
- package/src/renderer/components/layout/SortableTab.tsx +261 -0
- package/src/renderer/components/layout/TabBar.tsx +354 -0
- package/src/renderer/components/layout/TabBarActions.tsx +176 -0
- package/src/renderer/components/layout/TabBarRow.tsx +99 -0
- package/src/renderer/components/layout/TabContextMenu.tsx +171 -0
- package/src/renderer/components/layout/TabbedLayout.tsx +186 -0
- package/src/renderer/components/layout/TeamTabSectionNav.tsx +146 -0
- package/src/renderer/components/notifications/NotificationRow.tsx +228 -0
- package/src/renderer/components/notifications/NotificationsView.tsx +371 -0
- package/src/renderer/components/report/AssessmentBadge.tsx +78 -0
- package/src/renderer/components/report/ReportSection.tsx +58 -0
- package/src/renderer/components/report/SessionReportTab.tsx +102 -0
- package/src/renderer/components/report/sections/CostSection.tsx +259 -0
- package/src/renderer/components/report/sections/ErrorSection.tsx +100 -0
- package/src/renderer/components/report/sections/FrictionSection.tsx +91 -0
- package/src/renderer/components/report/sections/GitSection.tsx +72 -0
- package/src/renderer/components/report/sections/InsightsSection.tsx +207 -0
- package/src/renderer/components/report/sections/KeyTakeawaysSection.tsx +55 -0
- package/src/renderer/components/report/sections/OverviewSection.tsx +64 -0
- package/src/renderer/components/report/sections/QualitySection.tsx +151 -0
- package/src/renderer/components/report/sections/SubagentSection.tsx +88 -0
- package/src/renderer/components/report/sections/TimelineSection.tsx +111 -0
- package/src/renderer/components/report/sections/TokenSection.tsx +116 -0
- package/src/renderer/components/report/sections/ToolSection.tsx +77 -0
- package/src/renderer/components/runtime/ProviderModelBadges.tsx +142 -0
- package/src/renderer/components/runtime/ProviderRuntimeBackendSelector.tsx +327 -0
- package/src/renderer/components/runtime/ProviderRuntimeSettingsDialog.tsx +288 -0
- package/src/renderer/components/runtime/providerConnectionUi.ts +408 -0
- package/src/renderer/components/schedules/SchedulesView.tsx +529 -0
- package/src/renderer/components/search/CommandPalette.tsx +610 -0
- package/src/renderer/components/search/SearchBar.tsx +171 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/components/AddTriggerForm.tsx +233 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/components/ColorPaletteSelector.tsx +144 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/components/DynamicConfigSection.tsx +189 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/components/GeneralInfoSection.tsx +68 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/components/IgnorePatternsSection.tsx +73 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/components/ModeSelector.tsx +45 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/components/RepositoryScopeSection.tsx +63 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/components/SectionHeader.tsx +15 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/components/TriggerCard.tsx +150 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/components/TriggerCardHeader.tsx +125 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/components/TriggerConfiguration.tsx +342 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/components/TriggerPreview.tsx +108 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/hooks/useAddTriggerFormHandlers.ts +218 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/hooks/useAddTriggerFormState.ts +135 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/hooks/useRepositoryLookup.ts +47 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/hooks/useTriggerCardState.ts +281 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/hooks/useTriggerForm.ts +185 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/index.tsx +87 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/types.ts +39 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/utils/constants.ts +50 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/utils/trigger.ts +113 -0
- package/src/renderer/components/settings/SettingsTabs.tsx +110 -0
- package/src/renderer/components/settings/SettingsView.tsx +153 -0
- package/src/renderer/components/settings/components/SettingRow.tsx +44 -0
- package/src/renderer/components/settings/components/SettingsSectionHeader.tsx +24 -0
- package/src/renderer/components/settings/components/SettingsSelect.tsx +100 -0
- package/src/renderer/components/settings/components/SettingsToggle.tsx +45 -0
- package/src/renderer/components/settings/components/index.ts +8 -0
- package/src/renderer/components/settings/hooks/index.ts +6 -0
- package/src/renderer/components/settings/hooks/useSettingsConfig.ts +270 -0
- package/src/renderer/components/settings/hooks/useSettingsHandlers.ts +468 -0
- package/src/renderer/components/settings/sections/AdvancedSection.tsx +234 -0
- package/src/renderer/components/settings/sections/CliStatusSection.tsx +930 -0
- package/src/renderer/components/settings/sections/ConfigEditorDialog.tsx +391 -0
- package/src/renderer/components/settings/sections/GeneralSection.tsx +665 -0
- package/src/renderer/components/settings/sections/HarnessSection.tsx +133 -0
- package/src/renderer/components/settings/sections/PlatformsSection.tsx +517 -0
- package/src/renderer/components/settings/sections/index.ts +8 -0
- package/src/renderer/components/sidebar/DateGroupedSessions.tsx +1115 -0
- package/src/renderer/components/sidebar/GlobalTaskList.tsx +853 -0
- package/src/renderer/components/sidebar/SessionContextMenu.tsx +182 -0
- package/src/renderer/components/sidebar/SessionFiltersPopover.tsx +115 -0
- package/src/renderer/components/sidebar/SessionItem.tsx +393 -0
- package/src/renderer/components/sidebar/SidebarSessions.tsx +542 -0
- package/src/renderer/components/sidebar/SidebarTaskItem.tsx +286 -0
- package/src/renderer/components/sidebar/TaskContextMenu.tsx +86 -0
- package/src/renderer/components/sidebar/TaskFiltersPopover.tsx +203 -0
- package/src/renderer/components/sidebar/WorkspaceBrowser.tsx +370 -0
- package/src/renderer/components/sidebar/dateGroupedSessionsSelection.ts +33 -0
- package/src/renderer/components/sidebar/projectGroupPagination.ts +89 -0
- package/src/renderer/components/sidebar/taskFiltersState.ts +82 -0
- package/src/renderer/components/splash/splashScene.ts +979 -0
- package/src/renderer/components/team/CcSessionsSection.tsx +202 -0
- package/src/renderer/components/team/ClaudeLogsDialog.tsx +71 -0
- package/src/renderer/components/team/ClaudeLogsFilterPopover.tsx +213 -0
- package/src/renderer/components/team/ClaudeLogsPanel.tsx +170 -0
- package/src/renderer/components/team/ClaudeLogsSection.tsx +154 -0
- package/src/renderer/components/team/CliLogsRichView.tsx +640 -0
- package/src/renderer/components/team/CollapsibleTeamSection.tsx +177 -0
- package/src/renderer/components/team/HarnessCards.ts +38 -0
- package/src/renderer/components/team/MemberBadge.tsx +117 -0
- package/src/renderer/components/team/ProcessesSection.tsx +193 -0
- package/src/renderer/components/team/ProvisioningProgressBlock.tsx +389 -0
- package/src/renderer/components/team/RoleSelect.tsx +171 -0
- package/src/renderer/components/team/StepProgressBar.tsx +165 -0
- package/src/renderer/components/team/TaskTooltip.tsx +197 -0
- package/src/renderer/components/team/TeamDetailView.tsx +3002 -0
- package/src/renderer/components/team/TeamEmptyState.tsx +102 -0
- package/src/renderer/components/team/TeamListFilterPopover.tsx +183 -0
- package/src/renderer/components/team/TeamListView.tsx +1336 -0
- package/src/renderer/components/team/TeamProvisioningBanner.tsx +16 -0
- package/src/renderer/components/team/TeamProvisioningPanel.tsx +115 -0
- package/src/renderer/components/team/TeamSessionsSection.tsx +267 -0
- package/src/renderer/components/team/ToolApprovalDiffPreview.tsx +206 -0
- package/src/renderer/components/team/ToolApprovalSheet.tsx +675 -0
- package/src/renderer/components/team/UnreadCommentsBadge.tsx +37 -0
- package/src/renderer/components/team/activity/ActiveTasksBlock.tsx +191 -0
- package/src/renderer/components/team/activity/ActivityItem.tsx +1649 -0
- package/src/renderer/components/team/activity/ActivityTimeline.tsx +959 -0
- package/src/renderer/components/team/activity/AnimatedHeightReveal.tsx +117 -0
- package/src/renderer/components/team/activity/LeadThoughtsGroup.tsx +1152 -0
- package/src/renderer/components/team/activity/MessageExpandDialog.tsx +213 -0
- package/src/renderer/components/team/activity/PendingRepliesBlock.tsx +275 -0
- package/src/renderer/components/team/activity/ReplyQuoteBlock.tsx +79 -0
- package/src/renderer/components/team/activity/ThoughtBodyContent.tsx +150 -0
- package/src/renderer/components/team/activity/activityMarkdown.ts +36 -0
- package/src/renderer/components/team/activity/activityMessageContext.ts +68 -0
- package/src/renderer/components/team/activity/collapseState.ts +66 -0
- package/src/renderer/components/team/activity/useNewItemKeys.ts +70 -0
- package/src/renderer/components/team/attachments/AttachmentDisplay.tsx +132 -0
- package/src/renderer/components/team/attachments/AttachmentPreviewItem.tsx +62 -0
- package/src/renderer/components/team/attachments/AttachmentPreviewList.tsx +193 -0
- package/src/renderer/components/team/attachments/AttachmentThumbnail.tsx +42 -0
- package/src/renderer/components/team/attachments/DropZoneOverlay.tsx +54 -0
- package/src/renderer/components/team/attachments/ImageLightbox.tsx +132 -0
- package/src/renderer/components/team/attachments/SourceMessageAttachments.tsx +70 -0
- package/src/renderer/components/team/dialogs/AddMemberDialog.tsx +222 -0
- package/src/renderer/components/team/dialogs/AdvancedCliSection.tsx +347 -0
- package/src/renderer/components/team/dialogs/AnthropicFastModeSelector.tsx +120 -0
- package/src/renderer/components/team/dialogs/CreateTaskDialog.tsx +489 -0
- package/src/renderer/components/team/dialogs/CreateTeamDialog.tsx +484 -0
- package/src/renderer/components/team/dialogs/EditTeamDialog.tsx +448 -0
- package/src/renderer/components/team/dialogs/EffortLevelSelector.tsx +69 -0
- package/src/renderer/components/team/dialogs/GlobalTaskDetailDialog.tsx +165 -0
- package/src/renderer/components/team/dialogs/LaunchTeamDialog.tsx +2859 -0
- package/src/renderer/components/team/dialogs/LimitContextCheckbox.tsx +57 -0
- package/src/renderer/components/team/dialogs/MembersJsonEditor.tsx +123 -0
- package/src/renderer/components/team/dialogs/OptionalSettingsSection.tsx +124 -0
- package/src/renderer/components/team/dialogs/PlatformManualForm.tsx +145 -0
- package/src/renderer/components/team/dialogs/PlatformSetupQR.tsx +289 -0
- package/src/renderer/components/team/dialogs/ProjectPathSelector.tsx +330 -0
- package/src/renderer/components/team/dialogs/ProvisioningProviderStatusList.tsx +744 -0
- package/src/renderer/components/team/dialogs/ReviewDialog.tsx +130 -0
- package/src/renderer/components/team/dialogs/SendMessageDialog.tsx +530 -0
- package/src/renderer/components/team/dialogs/SkipPermissionsCheckbox.tsx +62 -0
- package/src/renderer/components/team/dialogs/StatusHistoryTimeline.tsx +229 -0
- package/src/renderer/components/team/dialogs/TaskAttachments.tsx +394 -0
- package/src/renderer/components/team/dialogs/TaskCommentAwaitingReply.tsx +57 -0
- package/src/renderer/components/team/dialogs/TaskCommentInput.tsx +420 -0
- package/src/renderer/components/team/dialogs/TaskCommentsSection.tsx +620 -0
- package/src/renderer/components/team/dialogs/TaskDetailDialog.tsx +1480 -0
- package/src/renderer/components/team/dialogs/TeamModelSelector.tsx +560 -0
- package/src/renderer/components/team/dialogs/TeammateRuntimeCompatibilityNotice.tsx +60 -0
- package/src/renderer/components/team/dialogs/ToolApprovalSettingsPanel.tsx +173 -0
- package/src/renderer/components/team/dialogs/editTeamRuntimeChanges.ts +179 -0
- package/src/renderer/components/team/dialogs/globalTaskDetailDialogLoading.ts +34 -0
- package/src/renderer/components/team/dialogs/launchDialogPrefill.ts +125 -0
- package/src/renderer/components/team/dialogs/memberModelScope.ts +77 -0
- package/src/renderer/components/team/dialogs/platformMeta.ts +118 -0
- package/src/renderer/components/team/dialogs/projectPathOptions.ts +50 -0
- package/src/renderer/components/team/dialogs/providerPrepareDiagnostics.ts +222 -0
- package/src/renderer/components/team/dialogs/providerPrepareRequestSignature.ts +122 -0
- package/src/renderer/components/team/dialogs/provisioningMemberScope.ts +10 -0
- package/src/renderer/components/team/dialogs/provisioningModelIssues.ts +124 -0
- package/src/renderer/components/team/dialogs/teamNameSets.ts +67 -0
- package/src/renderer/components/team/dialogs/teamRelaunchFlow.ts +30 -0
- package/src/renderer/components/team/dialogs/teammateLaunchMode.ts +49 -0
- package/src/renderer/components/team/dialogs/teammateRuntimeCompatibility.tsx +101 -0
- package/src/renderer/components/team/editor/CodeMirrorEditor.tsx +506 -0
- package/src/renderer/components/team/editor/EditorBinaryPlaceholder.tsx +43 -0
- package/src/renderer/components/team/editor/EditorBinaryState.tsx +29 -0
- package/src/renderer/components/team/editor/EditorBreadcrumb.tsx +84 -0
- package/src/renderer/components/team/editor/EditorContextMenu.tsx +213 -0
- package/src/renderer/components/team/editor/EditorEmptyState.tsx +35 -0
- package/src/renderer/components/team/editor/EditorErrorBoundary.tsx +63 -0
- package/src/renderer/components/team/editor/EditorErrorState.tsx +41 -0
- package/src/renderer/components/team/editor/EditorFileTree.tsx +903 -0
- package/src/renderer/components/team/editor/EditorImagePreview.tsx +138 -0
- package/src/renderer/components/team/editor/EditorSearchPanel.tsx +508 -0
- package/src/renderer/components/team/editor/EditorSelectionMenu.tsx +112 -0
- package/src/renderer/components/team/editor/EditorShortcutsHelp.tsx +125 -0
- package/src/renderer/components/team/editor/EditorStatusBar.tsx +72 -0
- package/src/renderer/components/team/editor/EditorTabBar.tsx +265 -0
- package/src/renderer/components/team/editor/EditorTabContextMenu.tsx +88 -0
- package/src/renderer/components/team/editor/EditorToolbar.tsx +163 -0
- package/src/renderer/components/team/editor/FileIcon.tsx +66 -0
- package/src/renderer/components/team/editor/GitStatusBadge.tsx +47 -0
- package/src/renderer/components/team/editor/GoToLineDialog.tsx +186 -0
- package/src/renderer/components/team/editor/MarkdownPreviewPane.tsx +57 -0
- package/src/renderer/components/team/editor/MarkdownSplitView.tsx +127 -0
- package/src/renderer/components/team/editor/NewFileDialog.tsx +131 -0
- package/src/renderer/components/team/editor/ProjectEditorOverlay.tsx +924 -0
- package/src/renderer/components/team/editor/QuickOpenDialog.tsx +163 -0
- package/src/renderer/components/team/editor/SearchInFilesPanel.tsx +358 -0
- package/src/renderer/components/team/editor/fileIcons.ts +222 -0
- package/src/renderer/components/team/kanban/KanbanBoard.tsx +664 -0
- package/src/renderer/components/team/kanban/KanbanColumn.tsx +61 -0
- package/src/renderer/components/team/kanban/KanbanFilterPopover.tsx +210 -0
- package/src/renderer/components/team/kanban/KanbanGridLayout.tsx +460 -0
- package/src/renderer/components/team/kanban/KanbanSearchInput.tsx +284 -0
- package/src/renderer/components/team/kanban/KanbanSortPopover.tsx +140 -0
- package/src/renderer/components/team/kanban/KanbanTaskCard.test.tsx +199 -0
- package/src/renderer/components/team/kanban/KanbanTaskCard.tsx +446 -0
- package/src/renderer/components/team/kanban/TrashDialog.tsx +112 -0
- package/src/renderer/components/team/members/CurrentTaskIndicator.tsx +56 -0
- package/src/renderer/components/team/members/LeadModelRow.test.tsx +133 -0
- package/src/renderer/components/team/members/LeadModelRow.tsx +183 -0
- package/src/renderer/components/team/members/MemberCard.tsx +665 -0
- package/src/renderer/components/team/members/MemberDetailDialog.tsx +309 -0
- package/src/renderer/components/team/members/MemberDetailHeader.tsx +183 -0
- package/src/renderer/components/team/members/MemberDetailStats.tsx +80 -0
- package/src/renderer/components/team/members/MemberDraftRow.test.tsx +184 -0
- package/src/renderer/components/team/members/MemberDraftRow.tsx +515 -0
- package/src/renderer/components/team/members/MemberExecutionLog.tsx +224 -0
- package/src/renderer/components/team/members/MemberHoverCard.tsx +292 -0
- package/src/renderer/components/team/members/MemberLaunchDiagnosticsButton.tsx +60 -0
- package/src/renderer/components/team/members/MemberList.tsx +405 -0
- package/src/renderer/components/team/members/MemberLogsTab.tsx +958 -0
- package/src/renderer/components/team/members/MemberMessagesTab.tsx +251 -0
- package/src/renderer/components/team/members/MemberPresenceDot.tsx +28 -0
- package/src/renderer/components/team/members/MemberRoleEditor.tsx +84 -0
- package/src/renderer/components/team/members/MemberStatsTab.tsx +299 -0
- package/src/renderer/components/team/members/MemberTasksTab.tsx +87 -0
- package/src/renderer/components/team/members/MemberWorkspaceTab.tsx +141 -0
- package/src/renderer/components/team/members/MembersEditorSection.tsx +495 -0
- package/src/renderer/components/team/members/SubagentRecentMessagesPreview.tsx +125 -0
- package/src/renderer/components/team/members/TeamRosterEditorSection.tsx +153 -0
- package/src/renderer/components/team/members/memberActivityEntries.ts +42 -0
- package/src/renderer/components/team/members/memberDetailTypes.ts +3 -0
- package/src/renderer/components/team/members/memberNameSets.ts +65 -0
- package/src/renderer/components/team/members/membersEditorTypes.ts +21 -0
- package/src/renderer/components/team/members/membersEditorUtils.ts +267 -0
- package/src/renderer/components/team/messages/MessageComposer.tsx +939 -0
- package/src/renderer/components/team/messages/MessagesFilterPopover.tsx +228 -0
- package/src/renderer/components/team/messages/MessagesPanel.tsx +1508 -0
- package/src/renderer/components/team/messages/OpenCodeDeliveryWarning.tsx +151 -0
- package/src/renderer/components/team/messages/StatusBlock.tsx +126 -0
- package/src/renderer/components/team/provisioningSteps.ts +363 -0
- package/src/renderer/components/team/review/ChangeReviewDialog.tsx +133 -0
- package/src/renderer/components/team/schedule/CcCronScheduleDialog.tsx +218 -0
- package/src/renderer/components/team/schedule/CronScheduleInput.tsx +254 -0
- package/src/renderer/components/team/schedule/ScheduleEmptyState.tsx +15 -0
- package/src/renderer/components/team/schedule/ScheduleRunLogDialog.tsx +277 -0
- package/src/renderer/components/team/schedule/ScheduleRunRow.tsx +106 -0
- package/src/renderer/components/team/schedule/ScheduleSection.tsx +281 -0
- package/src/renderer/components/team/schedule/ScheduleStatusBadge.tsx +55 -0
- package/src/renderer/components/team/sidebar/TeamSidebarHost.tsx +76 -0
- package/src/renderer/components/team/sidebar/TeamSidebarPortalManager.ts +173 -0
- package/src/renderer/components/team/sidebar/TeamSidebarPortalSource.tsx +66 -0
- package/src/renderer/components/team/sidebar/TeamSidebarRail.tsx +68 -0
- package/src/renderer/components/team/sidebar/teamSidebarUiState.ts +136 -0
- package/src/renderer/components/team/taskLogs/ExactTaskLogCard.tsx +132 -0
- package/src/renderer/components/team/taskLogs/ExactTaskLogsSection.tsx +258 -0
- package/src/renderer/components/team/taskLogs/ExecutionSessionsSection.tsx +48 -0
- package/src/renderer/components/team/taskLogs/TaskActivityLinkedToolCard.tsx +31 -0
- package/src/renderer/components/team/taskLogs/TaskActivitySection.tsx +462 -0
- package/src/renderer/components/team/taskLogs/TaskLogStreamSection.tsx +375 -0
- package/src/renderer/components/team/taskLogs/TaskLogsPanel.tsx +294 -0
- package/src/renderer/components/team/taskLogs/featureGates.ts +22 -0
- package/src/renderer/components/team/tasks/TaskList.tsx +111 -0
- package/src/renderer/components/team/tasks/TaskRow.tsx +65 -0
- package/src/renderer/components/team/teamProjectSelection.ts +156 -0
- package/src/renderer/components/team/teamSessionFetchGuards.ts +26 -0
- package/src/renderer/components/team/useClaudeLogsController.ts +668 -0
- package/src/renderer/components/team/useTeamProvisioningPresentation.ts +54 -0
- package/src/renderer/components/terminal/TerminalLogPanel.tsx +37 -0
- package/src/renderer/components/ui/ChipInteractionLayer.tsx +255 -0
- package/src/renderer/components/ui/CodeChipBadge.tsx +37 -0
- package/src/renderer/components/ui/ExpandableContent.tsx +110 -0
- package/src/renderer/components/ui/MemberSelect.tsx +209 -0
- package/src/renderer/components/ui/MentionInteractionLayer.tsx +121 -0
- package/src/renderer/components/ui/MentionSuggestionList.tsx +274 -0
- package/src/renderer/components/ui/MentionableTextarea.tsx +1426 -0
- package/src/renderer/components/ui/SlashCommandInteractionLayer.tsx +88 -0
- package/src/renderer/components/ui/TaskReferenceInteractionLayer.tsx +101 -0
- package/src/renderer/components/ui/UrlInteractionLayer.tsx +102 -0
- package/src/renderer/components/ui/alert-dialog.tsx +127 -0
- package/src/renderer/components/ui/auto-resize-textarea.tsx +93 -0
- package/src/renderer/components/ui/badge.tsx +37 -0
- package/src/renderer/components/ui/button.tsx +54 -0
- package/src/renderer/components/ui/checkbox.tsx +29 -0
- package/src/renderer/components/ui/combobox.tsx +168 -0
- package/src/renderer/components/ui/context-menu.tsx +124 -0
- package/src/renderer/components/ui/dialog.tsx +114 -0
- package/src/renderer/components/ui/hover-card.tsx +30 -0
- package/src/renderer/components/ui/input.tsx +22 -0
- package/src/renderer/components/ui/label.tsx +21 -0
- package/src/renderer/components/ui/popover.tsx +31 -0
- package/src/renderer/components/ui/select.tsx +150 -0
- package/src/renderer/components/ui/tabs.tsx +52 -0
- package/src/renderer/components/ui/textarea.tsx +21 -0
- package/src/renderer/components/ui/tiptap/TiptapBubbleMenu.tsx +75 -0
- package/src/renderer/components/ui/tiptap/TiptapEditor.tsx +73 -0
- package/src/renderer/components/ui/tiptap/TiptapToolbar.tsx +269 -0
- package/src/renderer/components/ui/tiptap/index.ts +3 -0
- package/src/renderer/components/ui/tiptap/presets.ts +46 -0
- package/src/renderer/components/ui/tiptap/tiptapStyles.css +235 -0
- package/src/renderer/components/ui/tiptap/types.ts +32 -0
- package/src/renderer/components/ui/tiptap/useTiptapEditor.ts +94 -0
- package/src/renderer/components/ui/tooltip.tsx +32 -0
- package/src/renderer/constants/cssVariables.ts +226 -0
- package/src/renderer/constants/layout.ts +6 -0
- package/src/renderer/constants/teamColors.ts +397 -0
- package/src/renderer/constants/teamRoles.ts +41 -0
- package/src/renderer/contexts/TabUIContext.tsx +51 -0
- package/src/renderer/contexts/useTabUIContext.ts +18 -0
- package/src/renderer/favicon.png +0 -0
- package/src/renderer/features/CLAUDE.md +19 -0
- package/src/renderer/hooks/navigation/utils.ts +263 -0
- package/src/renderer/hooks/useAttachments.ts +312 -0
- package/src/renderer/hooks/useAutoScrollBottom.ts +285 -0
- package/src/renderer/hooks/useBranchSync.ts +105 -0
- package/src/renderer/hooks/useChipDraftPersistence.ts +172 -0
- package/src/renderer/hooks/useCliInstaller.ts +106 -0
- package/src/renderer/hooks/useCollapsedGroups.ts +71 -0
- package/src/renderer/hooks/useComposerDraft.ts +504 -0
- package/src/renderer/hooks/useContinuousScrollNav.ts +50 -0
- package/src/renderer/hooks/useCreateTeamDraft.ts +280 -0
- package/src/renderer/hooks/useDraftPersistence.ts +140 -0
- package/src/renderer/hooks/useEditorKeyboardShortcuts.ts +257 -0
- package/src/renderer/hooks/useEffectiveCliProviderStatus.ts +66 -0
- package/src/renderer/hooks/useExtensionsTabState.ts +206 -0
- package/src/renderer/hooks/useFileListCacheWarmer.ts +38 -0
- package/src/renderer/hooks/useFileSuggestions.ts +255 -0
- package/src/renderer/hooks/useKeyboardShortcuts.ts +363 -0
- package/src/renderer/hooks/useLazyFileContent.ts +150 -0
- package/src/renderer/hooks/useMarkCommentsRead.ts +27 -0
- package/src/renderer/hooks/useMarkdownScrollSync.ts +158 -0
- package/src/renderer/hooks/useMemberStats.ts +45 -0
- package/src/renderer/hooks/useMentionDetection.ts +375 -0
- package/src/renderer/hooks/usePersistedGridLayout.ts +109 -0
- package/src/renderer/hooks/useResizableColumns.ts +140 -0
- package/src/renderer/hooks/useResizablePanel.ts +144 -0
- package/src/renderer/hooks/useStableTeamMentionMeta.ts +68 -0
- package/src/renderer/hooks/useSyncedAnimationStyle.ts +29 -0
- package/src/renderer/hooks/useTabNavigationController.ts +524 -0
- package/src/renderer/hooks/useTabUI.ts +252 -0
- package/src/renderer/hooks/useTaskLocalState.ts +163 -0
- package/src/renderer/hooks/useTaskSuggestions.ts +131 -0
- package/src/renderer/hooks/useTeamMessagesExpanded.ts +34 -0
- package/src/renderer/hooks/useTeamMessagesRead.ts +52 -0
- package/src/renderer/hooks/useTeamSuggestions.ts +78 -0
- package/src/renderer/hooks/useTheme.ts +138 -0
- package/src/renderer/hooks/useToolApprovalDiff.ts +212 -0
- package/src/renderer/hooks/useUnreadCommentCount.ts +14 -0
- package/src/renderer/hooks/useViewedFiles.ts +74 -0
- package/src/renderer/hooks/useViewportCommentRead.ts +147 -0
- package/src/renderer/hooks/useViewportObserver.ts +138 -0
- package/src/renderer/hooks/useVisibleAIGroup.ts +122 -0
- package/src/renderer/hooks/useVisibleFileSection.ts +114 -0
- package/src/renderer/hooks/useZoomFactor.ts +36 -0
- package/src/renderer/index.css +1560 -0
- package/src/renderer/index.html +1293 -0
- package/src/renderer/lib/utils.ts +6 -0
- package/src/renderer/main.tsx +30 -0
- package/src/renderer/sentry.ts +104 -0
- package/src/renderer/services/__tests__/createTeamPreferences.test.ts +67 -0
- package/src/renderer/services/commentReadStorage.ts +349 -0
- package/src/renderer/services/composerDraftStorage.ts +271 -0
- package/src/renderer/services/contextStorage.ts +201 -0
- package/src/renderer/services/createTeamDraftStorage.ts +151 -0
- package/src/renderer/services/createTeamPreferences.ts +361 -0
- package/src/renderer/services/dashboardCliStatusBannerPreference.ts +20 -0
- package/src/renderer/services/draftStorage.ts +128 -0
- package/src/renderer/services/layout-system/BrowserGridLayoutRepository.ts +111 -0
- package/src/renderer/services/layout-system/GridLayoutRepository.ts +8 -0
- package/src/renderer/services/layout-system/gridLayoutSchema.ts +137 -0
- package/src/renderer/services/layout-system/gridLayoutTypes.ts +17 -0
- package/src/renderer/store/index.ts +1556 -0
- package/src/renderer/store/slices/changeReviewSlice.ts +1694 -0
- package/src/renderer/store/slices/cliInstallerSlice.ts +689 -0
- package/src/renderer/store/slices/configSlice.ts +111 -0
- package/src/renderer/store/slices/connectionSlice.ts +221 -0
- package/src/renderer/store/slices/contextSlice.ts +394 -0
- package/src/renderer/store/slices/conversationSlice.ts +510 -0
- package/src/renderer/store/slices/editorSlice.ts +1455 -0
- package/src/renderer/store/slices/extensionsSlice.ts +1415 -0
- package/src/renderer/store/slices/notificationSlice.ts +277 -0
- package/src/renderer/store/slices/paneSlice.ts +357 -0
- package/src/renderer/store/slices/projectSlice.ts +70 -0
- package/src/renderer/store/slices/repositorySlice.ts +165 -0
- package/src/renderer/store/slices/scheduleSlice.ts +246 -0
- package/src/renderer/store/slices/sessionDetailSlice.ts +755 -0
- package/src/renderer/store/slices/sessionSlice.ts +539 -0
- package/src/renderer/store/slices/subagentSlice.ts +145 -0
- package/src/renderer/store/slices/tabSlice.ts +842 -0
- package/src/renderer/store/slices/tabUISlice.ts +319 -0
- package/src/renderer/store/slices/teamSlice.ts +5080 -0
- package/src/renderer/store/slices/uiSlice.ts +45 -0
- package/src/renderer/store/types.ts +103 -0
- package/src/renderer/store/utils/paneHelpers.ts +134 -0
- package/src/renderer/store/utils/pathResolution.ts +121 -0
- package/src/renderer/store/utils/stateResetHelpers.ts +72 -0
- package/src/renderer/types/api.ts +8 -0
- package/src/renderer/types/claudeMd.ts +74 -0
- package/src/renderer/types/contextInjection.ts +309 -0
- package/src/renderer/types/data.ts +144 -0
- package/src/renderer/types/groups.ts +406 -0
- package/src/renderer/types/inlineChip.ts +110 -0
- package/src/renderer/types/mention.ts +38 -0
- package/src/renderer/types/notifications.ts +18 -0
- package/src/renderer/types/panes.ts +35 -0
- package/src/renderer/types/sessionReport.ts +386 -0
- package/src/renderer/types/tabs.ts +249 -0
- package/src/renderer/types/teamMessagesPanelMode.ts +1 -0
- package/src/renderer/utils/__tests__/teamEffortOptions.test.ts +217 -0
- package/src/renderer/utils/__tests__/teamModelAvailability.codexCatalog.test.ts +383 -0
- package/src/renderer/utils/agentMessageFormatting.ts +139 -0
- package/src/renderer/utils/aiGroupEnhancer.ts +78 -0
- package/src/renderer/utils/aiGroupHelpers.ts +208 -0
- package/src/renderer/utils/attachmentUtils.ts +60 -0
- package/src/renderer/utils/bootstrapPromptSanitizer.ts +225 -0
- package/src/renderer/utils/bugReportUtils.ts +157 -0
- package/src/renderer/utils/buildSelectionAction.ts +116 -0
- package/src/renderer/utils/chipUtils.ts +372 -0
- package/src/renderer/utils/claudeCodeOnlyProviders.ts +126 -0
- package/src/renderer/utils/claudeMdTracker.ts +644 -0
- package/src/renderer/utils/codemirrorLanguages.ts +141 -0
- package/src/renderer/utils/codemirrorSelectionInfo.ts +41 -0
- package/src/renderer/utils/codemirrorTheme.ts +138 -0
- package/src/renderer/utils/contextMath.ts +55 -0
- package/src/renderer/utils/contextTracker.ts +1100 -0
- package/src/renderer/utils/crossTeamPendingReplies.ts +92 -0
- package/src/renderer/utils/dateGrouping.ts +91 -0
- package/src/renderer/utils/diffViewedStorage.ts +120 -0
- package/src/renderer/utils/displayItemBuilder.ts +587 -0
- package/src/renderer/utils/displaySummary.ts +74 -0
- package/src/renderer/utils/editorBridge.ts +90 -0
- package/src/renderer/utils/fileTreeBuilder.ts +110 -0
- package/src/renderer/utils/formatAgentRole.ts +24 -0
- package/src/renderer/utils/formatters.ts +61 -0
- package/src/renderer/utils/groupTransformer.ts +744 -0
- package/src/renderer/utils/idleNotificationSemantics.ts +76 -0
- package/src/renderer/utils/keyboardUtils.ts +92 -0
- package/src/renderer/utils/lastOutputDetector.ts +150 -0
- package/src/renderer/utils/markdownPlugins.ts +60 -0
- package/src/renderer/utils/memberAvatarCatalog.ts +38 -0
- package/src/renderer/utils/memberHelpers.ts +858 -0
- package/src/renderer/utils/memberLaunchDiagnostics.ts +216 -0
- package/src/renderer/utils/memberRuntimeSummary.ts +122 -0
- package/src/renderer/utils/memberSpawnStatusPolling.ts +29 -0
- package/src/renderer/utils/mentionLinkify.ts +90 -0
- package/src/renderer/utils/mentionSuggestions.ts +34 -0
- package/src/renderer/utils/mergeTeamMessages.ts +27 -0
- package/src/renderer/utils/messageRenderEquality.ts +158 -0
- package/src/renderer/utils/modelExtractor.ts +90 -0
- package/src/renderer/utils/multimodelProviderVisibility.ts +32 -0
- package/src/renderer/utils/openCodeModelRecommendations.ts +1326 -0
- package/src/renderer/utils/openCodeRuntimeDeliveryDiagnostics.ts +79 -0
- package/src/renderer/utils/pathDisplay.ts +149 -0
- package/src/renderer/utils/pathNormalize.ts +61 -0
- package/src/renderer/utils/pathUtils.ts +47 -0
- package/src/renderer/utils/platformKeys.ts +24 -0
- package/src/renderer/utils/previewRegistry.ts +45 -0
- package/src/renderer/utils/projectColor.ts +54 -0
- package/src/renderer/utils/projectLookup.ts +64 -0
- package/src/renderer/utils/providerBackendIdentity.ts +43 -0
- package/src/renderer/utils/providerSlashCommands.ts +122 -0
- package/src/renderer/utils/quickOpenCache.ts +40 -0
- package/src/renderer/utils/refreshCliStatus.ts +17 -0
- package/src/renderer/utils/reportAssessments.ts +555 -0
- package/src/renderer/utils/reviewDecisionScope.ts +81 -0
- package/src/renderer/utils/reviewKey.ts +132 -0
- package/src/renderer/utils/runtimeDisplayName.ts +26 -0
- package/src/renderer/utils/scheduleFormatters.ts +45 -0
- package/src/renderer/utils/sessionAnalyzer.ts +1346 -0
- package/src/renderer/utils/sessionExporter.ts +427 -0
- package/src/renderer/utils/sessionTitleParser.ts +69 -0
- package/src/renderer/utils/skillCommandSuggestions.ts +77 -0
- package/src/renderer/utils/slashCommandExtractor.ts +154 -0
- package/src/renderer/utils/streamJsonParser.ts +393 -0
- package/src/renderer/utils/stringUtils.ts +50 -0
- package/src/renderer/utils/syntaxHighlighter.ts +158 -0
- package/src/renderer/utils/tabLabelDisambiguation.ts +99 -0
- package/src/renderer/utils/taskChangePresence.ts +19 -0
- package/src/renderer/utils/taskChangeRequest.ts +122 -0
- package/src/renderer/utils/taskCommentPendingReply.ts +74 -0
- package/src/renderer/utils/taskGrouping.ts +151 -0
- package/src/renderer/utils/taskReferenceUtils.ts +331 -0
- package/src/renderer/utils/teamEffortOptions.ts +150 -0
- package/src/renderer/utils/teamLaunchSummaryCopy.ts +17 -0
- package/src/renderer/utils/teamMessageExpandStorage.ts +39 -0
- package/src/renderer/utils/teamMessageFiltering.ts +95 -0
- package/src/renderer/utils/teamMessageKey.ts +14 -0
- package/src/renderer/utils/teamMessageReadStorage.ts +49 -0
- package/src/renderer/utils/teamModelAvailability.ts +465 -0
- package/src/renderer/utils/teamModelCatalog.ts +502 -0
- package/src/renderer/utils/teamModelContext.ts +34 -0
- package/src/renderer/utils/teamProvisioningPresentation.ts +772 -0
- package/src/renderer/utils/teamRuntimeSummary.ts +53 -0
- package/src/renderer/utils/toolLinkingEngine.ts +117 -0
- package/src/renderer/utils/toolRendering/index.ts +14 -0
- package/src/renderer/utils/toolRendering/toolContentChecks.ts +58 -0
- package/src/renderer/utils/toolRendering/toolSummaryHelpers.ts +276 -0
- package/src/renderer/utils/toolRendering/toolTokens.ts +57 -0
- package/src/renderer/utils/unwrapIpc.ts +31 -0
- package/src/renderer/utils/urlMatchUtils.ts +45 -0
- package/src/renderer/vite-env.d.ts +21 -0
- package/src/shared/constants/agentBlocks.ts +129 -0
- package/src/shared/constants/attachments.ts +175 -0
- package/src/shared/constants/cache.ts +12 -0
- package/src/shared/constants/cli.ts +15 -0
- package/src/shared/constants/crossTeam.ts +126 -0
- package/src/shared/constants/index.ts +15 -0
- package/src/shared/constants/kanban.ts +9 -0
- package/src/shared/constants/memberColors.ts +140 -0
- package/src/shared/constants/opencodeTaskLogAttribution.ts +1 -0
- package/src/shared/constants/teamLimits.ts +2 -0
- package/src/shared/constants/trafficLights.ts +60 -0
- package/src/shared/constants/triggerColors.ts +126 -0
- package/src/shared/constants/window.ts +12 -0
- package/src/shared/types/api.ts +1062 -0
- package/src/shared/types/ccConnect.ts +399 -0
- package/src/shared/types/cliInstaller.ts +335 -0
- package/src/shared/types/editor.ts +279 -0
- package/src/shared/types/extensions/api.ts +90 -0
- package/src/shared/types/extensions/apikey.ts +40 -0
- package/src/shared/types/extensions/common.ts +16 -0
- package/src/shared/types/extensions/index.ts +67 -0
- package/src/shared/types/extensions/mcp.ts +132 -0
- package/src/shared/types/extensions/plugin.ts +85 -0
- package/src/shared/types/extensions/skill.ts +173 -0
- package/src/shared/types/index.ts +48 -0
- package/src/shared/types/ipc.ts +5 -0
- package/src/shared/types/notifications.ts +407 -0
- package/src/shared/types/providers.ts +116 -0
- package/src/shared/types/review.ts +319 -0
- package/src/shared/types/schedule.ts +124 -0
- package/src/shared/types/team.ts +1726 -0
- package/src/shared/types/terminal.ts +49 -0
- package/src/shared/types/visualization.ts +60 -0
- package/src/shared/utils/__tests__/contextMetrics.test.ts +260 -0
- package/src/shared/utils/__tests__/ephemeralProjectPath.test.ts +42 -0
- package/src/shared/utils/__tests__/teamProvider.test.ts +29 -0
- package/src/shared/utils/agentLanguage.ts +122 -0
- package/src/shared/utils/anthropicLaunchModel.ts +96 -0
- package/src/shared/utils/anthropicModelDefaults.ts +3 -0
- package/src/shared/utils/apiErrorDetector.ts +13 -0
- package/src/shared/utils/boardTaskActivityLabels.ts +128 -0
- package/src/shared/utils/boardTaskActivityPresentation.ts +75 -0
- package/src/shared/utils/cliArgsParser.ts +129 -0
- package/src/shared/utils/contentSanitizer.ts +207 -0
- package/src/shared/utils/contextMetrics.ts +236 -0
- package/src/shared/utils/costFormatting.ts +45 -0
- package/src/shared/utils/diffContextHash.ts +22 -0
- package/src/shared/utils/effortLevels.ts +73 -0
- package/src/shared/utils/ephemeralProjectPath.ts +41 -0
- package/src/shared/utils/errorHandling.ts +26 -0
- package/src/shared/utils/extensionNormalizers.ts +336 -0
- package/src/shared/utils/idleNotificationSemantics.ts +86 -0
- package/src/shared/utils/inboxNoise.ts +158 -0
- package/src/shared/utils/leadDetection.ts +63 -0
- package/src/shared/utils/logger.ts +69 -0
- package/src/shared/utils/markdownTextSearch.ts +210 -0
- package/src/shared/utils/mcpScopes.ts +36 -0
- package/src/shared/utils/modelParser.ts +158 -0
- package/src/shared/utils/opencodeModelRef.ts +78 -0
- package/src/shared/utils/platformPath.ts +103 -0
- package/src/shared/utils/pricing.ts +129 -0
- package/src/shared/utils/providerBackend.ts +90 -0
- package/src/shared/utils/providerExtensionCapabilities.ts +92 -0
- package/src/shared/utils/providerModelSelection.ts +5 -0
- package/src/shared/utils/providerModelVisibility.ts +47 -0
- package/src/shared/utils/rateLimitDetector.ts +334 -0
- package/src/shared/utils/reviewState.ts +74 -0
- package/src/shared/utils/sentryConfig.ts +26 -0
- package/src/shared/utils/skillRoots.ts +93 -0
- package/src/shared/utils/slashCommands.ts +128 -0
- package/src/shared/utils/taskChangePresence.ts +35 -0
- package/src/shared/utils/taskChangeSince.ts +51 -0
- package/src/shared/utils/taskChangeState.ts +49 -0
- package/src/shared/utils/taskHistory.ts +82 -0
- package/src/shared/utils/taskIdentity.ts +32 -0
- package/src/shared/utils/teamGraphDefaultLayout.ts +97 -0
- package/src/shared/utils/teamMemberColors.ts +107 -0
- package/src/shared/utils/teamMemberName.ts +77 -0
- package/src/shared/utils/teamProvider.ts +73 -0
- package/src/shared/utils/teamStableOwnerId.ts +12 -0
- package/src/shared/utils/teammateMessageParser.ts +52 -0
- package/src/shared/utils/tokenFormatting.ts +91 -0
- package/src/shared/utils/toolSummary.ts +279 -0
- package/src/shared/utils/version.ts +29 -0
- package/src/types/agent-teams-controller.d.ts +163 -0
- package/src/types/node-pty.d.ts +22 -0
- package/src/types/pidusage.d.ts +23 -0
|
@@ -0,0 +1,1346 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session analyzer — TypeScript port of scripts/analyze-session.py.
|
|
3
|
+
*
|
|
4
|
+
* Takes a SessionDetail (already parsed by the main process) and produces
|
|
5
|
+
* a SessionReport with structured metrics, cost analysis, friction signals,
|
|
6
|
+
* conversation tree analysis, idle gap detection, and more.
|
|
7
|
+
*
|
|
8
|
+
* Runs entirely in the renderer process — no IPC needed.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import {
|
|
12
|
+
computeCacheEfficiencyAssessment,
|
|
13
|
+
computeCacheRatioAssessment,
|
|
14
|
+
computeCostPerCommitAssessment,
|
|
15
|
+
computeCostPerLineAssessment,
|
|
16
|
+
computeIdleAssessment,
|
|
17
|
+
computeOverheadAssessment,
|
|
18
|
+
computeRedundancyAssessment,
|
|
19
|
+
computeSubagentCostShareAssessment,
|
|
20
|
+
computeThrashingAssessment,
|
|
21
|
+
computeToolHealthAssessment,
|
|
22
|
+
detectModelMismatch,
|
|
23
|
+
detectSwitchPattern,
|
|
24
|
+
} from '@renderer/utils/reportAssessments';
|
|
25
|
+
import { calculateMessageCost } from '@shared/utils/pricing';
|
|
26
|
+
|
|
27
|
+
import type {
|
|
28
|
+
AgentTreeNode,
|
|
29
|
+
FrictionCorrection,
|
|
30
|
+
GitCommit,
|
|
31
|
+
IdleGap,
|
|
32
|
+
KeyEvent,
|
|
33
|
+
ModelSwitch,
|
|
34
|
+
ModelTokenStats,
|
|
35
|
+
OutOfScopeFindings,
|
|
36
|
+
SessionReport,
|
|
37
|
+
SkillInvocation,
|
|
38
|
+
SubagentBasicEntry,
|
|
39
|
+
SubagentEntry,
|
|
40
|
+
TestSnapshot,
|
|
41
|
+
ThinkingBlockAnalysis,
|
|
42
|
+
ToolError,
|
|
43
|
+
ToolSuccessRate,
|
|
44
|
+
UserQuestion,
|
|
45
|
+
} from '@renderer/types/sessionReport';
|
|
46
|
+
import type {
|
|
47
|
+
ContentBlock,
|
|
48
|
+
ParsedMessage,
|
|
49
|
+
Process,
|
|
50
|
+
SessionDetail,
|
|
51
|
+
TextContent,
|
|
52
|
+
ThinkingContent,
|
|
53
|
+
ToolCall,
|
|
54
|
+
} from '@shared/types';
|
|
55
|
+
|
|
56
|
+
// Re-export getDisplayPricing as getPricing for backward compat with CostSection
|
|
57
|
+
export { getDisplayPricing as getPricing } from '@shared/utils/pricing';
|
|
58
|
+
|
|
59
|
+
// =============================================================================
|
|
60
|
+
// Helpers
|
|
61
|
+
// =============================================================================
|
|
62
|
+
|
|
63
|
+
function isTextBlock(block: ContentBlock): block is TextContent {
|
|
64
|
+
return block.type === 'text';
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function isThinkingBlock(block: ContentBlock): block is ThinkingContent {
|
|
68
|
+
return block.type === 'thinking';
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function extractTextContent(msg: ParsedMessage): string {
|
|
72
|
+
const { content } = msg;
|
|
73
|
+
if (typeof content === 'string') return content;
|
|
74
|
+
if (Array.isArray(content)) {
|
|
75
|
+
return content
|
|
76
|
+
.filter(isTextBlock)
|
|
77
|
+
.map((block) => block.text)
|
|
78
|
+
.join(' ');
|
|
79
|
+
}
|
|
80
|
+
return '';
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function formatDuration(totalSeconds: number): string {
|
|
84
|
+
const h = Math.floor(totalSeconds / 3600);
|
|
85
|
+
const m = Math.floor((totalSeconds % 3600) / 60);
|
|
86
|
+
const s = Math.floor(totalSeconds % 60);
|
|
87
|
+
if (h > 0) return `${h}:${String(m).padStart(2, '0')}:${String(s).padStart(2, '0')}`;
|
|
88
|
+
return `${m}:${String(s).padStart(2, '0')}`;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Friction keyword patterns
|
|
92
|
+
const FRICTION_PATTERNS: [RegExp, string][] = [
|
|
93
|
+
[/\bno,/i, 'no,'],
|
|
94
|
+
[/\bwrong\b/i, 'wrong'],
|
|
95
|
+
[/\bactually\b/i, 'actually'],
|
|
96
|
+
[/\bundo\b/i, 'undo'],
|
|
97
|
+
[/\brevert\b/i, 'revert'],
|
|
98
|
+
[/that's not\b/i, "that's not"],
|
|
99
|
+
[/\binstead,/i, 'instead,'],
|
|
100
|
+
[/\bwait,/i, 'wait,'],
|
|
101
|
+
[/\bnevermind\b/i, 'nevermind'],
|
|
102
|
+
[/I don't want\b/i, "I don't want"],
|
|
103
|
+
];
|
|
104
|
+
|
|
105
|
+
// Permission denial keywords (case-insensitive substring match)
|
|
106
|
+
const PERMISSION_KEYWORDS = [
|
|
107
|
+
'permission denied',
|
|
108
|
+
'not allowed',
|
|
109
|
+
'requires approval',
|
|
110
|
+
'cannot execute',
|
|
111
|
+
'access denied',
|
|
112
|
+
'operation not permitted',
|
|
113
|
+
'eacces',
|
|
114
|
+
'eperm',
|
|
115
|
+
'user rejected',
|
|
116
|
+
'user denied',
|
|
117
|
+
'needs_user_approval',
|
|
118
|
+
];
|
|
119
|
+
|
|
120
|
+
function isPermissionDenial(text: string): boolean {
|
|
121
|
+
const lower = text.toLowerCase();
|
|
122
|
+
return PERMISSION_KEYWORDS.some((kw) => lower.includes(kw));
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Extract a number immediately before a keyword in text.
|
|
127
|
+
* E.g., extractNumberBefore("42 passed", "passed") => 42
|
|
128
|
+
*/
|
|
129
|
+
function extractNumberBefore(text: string, keyword: string): number | null {
|
|
130
|
+
const idx = text.toLowerCase().indexOf(keyword.toLowerCase());
|
|
131
|
+
if (idx <= 0) return null;
|
|
132
|
+
const before = text.slice(Math.max(0, idx - 15), idx).trim();
|
|
133
|
+
const parts = before.split(/\s+/);
|
|
134
|
+
const numStr = parts[parts.length - 1];
|
|
135
|
+
if (numStr && /^\d+$/.test(numStr)) return parseInt(numStr, 10);
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Parse test summary from command output.
|
|
141
|
+
* Returns [passed, failed] or null if no match.
|
|
142
|
+
*/
|
|
143
|
+
function parseTestSummary(text: string): [number, number] | null {
|
|
144
|
+
// Try "passed"/"failed" keywords — treat missing count as 0
|
|
145
|
+
// (runners often omit "0 failed" when all tests pass)
|
|
146
|
+
const passed = extractNumberBefore(text, ' passed');
|
|
147
|
+
const failed = extractNumberBefore(text, ' failed');
|
|
148
|
+
if (passed != null || failed != null) return [passed ?? 0, failed ?? 0];
|
|
149
|
+
|
|
150
|
+
// Try "passing"/"failing" keywords (mocha-style)
|
|
151
|
+
const passing = extractNumberBefore(text, ' passing');
|
|
152
|
+
const failing = extractNumberBefore(text, ' failing');
|
|
153
|
+
if (passing != null || failing != null) return [passing ?? 0, failing ?? 0];
|
|
154
|
+
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// Thinking block analysis signals
|
|
159
|
+
const THINKING_SIGNALS: Record<string, RegExp> = {
|
|
160
|
+
alternatives: /\balternative(?:ly|s)?\b|\binstead\b|\bother approach\b|\bcould also\b/i,
|
|
161
|
+
uncertainty: /\bnot sure\b|\buncertain\b|\bmight be\b|\bpossibly\b|\bI think\b.*\bbut\b/i,
|
|
162
|
+
errors_noticed: /\bbug\b|\berror\b|\bwrong\b|\bincorrect\b|\bfail\b|\bbroken\b/i,
|
|
163
|
+
planning: /\bfirst.*then\b|\bstep \d\b|\bplan\b|\bapproach\b|\bstrategy\b/i,
|
|
164
|
+
direction_change: /\bwait\b|\bactually\b|\bon second thought\b|\blet me reconsider\b|\bhmm\b/i,
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
// "Work" tools (non-Skill) for startup overhead detection
|
|
168
|
+
const NON_SKILL_TOOLS = new Set([
|
|
169
|
+
'Read',
|
|
170
|
+
'Write',
|
|
171
|
+
'Edit',
|
|
172
|
+
'Bash',
|
|
173
|
+
'Grep',
|
|
174
|
+
'Glob',
|
|
175
|
+
'Task',
|
|
176
|
+
'WebFetch',
|
|
177
|
+
'WebSearch',
|
|
178
|
+
'NotebookEdit',
|
|
179
|
+
]);
|
|
180
|
+
|
|
181
|
+
// =============================================================================
|
|
182
|
+
// Main Analyzer
|
|
183
|
+
// =============================================================================
|
|
184
|
+
|
|
185
|
+
export function analyzeSession(detail: SessionDetail): SessionReport {
|
|
186
|
+
const { session, messages } = detail;
|
|
187
|
+
|
|
188
|
+
// --- Session Overview ---
|
|
189
|
+
const timestamps = messages.filter((m) => m.timestamp).map((m) => m.timestamp);
|
|
190
|
+
const firstTs = timestamps.length > 0 ? timestamps[0] : null;
|
|
191
|
+
const lastTs = timestamps.length > 0 ? timestamps[timestamps.length - 1] : null;
|
|
192
|
+
const durationMs = firstTs && lastTs ? lastTs.getTime() - firstTs.getTime() : 0;
|
|
193
|
+
const durationSeconds = durationMs / 1000;
|
|
194
|
+
|
|
195
|
+
// Context consumption interpretation
|
|
196
|
+
const ctxConsumption = session.contextConsumption ?? 0;
|
|
197
|
+
let ctxConsumptionPct: number | null = null;
|
|
198
|
+
let ctxAssessment: 'critical' | 'high' | 'moderate' | 'healthy' | null = null;
|
|
199
|
+
if (ctxConsumption <= 1) {
|
|
200
|
+
ctxConsumptionPct = ctxConsumption ? Math.round(ctxConsumption * 1000) / 10 : 0;
|
|
201
|
+
if (ctxConsumption > 0.8) ctxAssessment = 'critical';
|
|
202
|
+
else if (ctxConsumption > 0.6) ctxAssessment = 'high';
|
|
203
|
+
else if (ctxConsumption > 0.4) ctxAssessment = 'moderate';
|
|
204
|
+
else ctxAssessment = 'healthy';
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// ===================================================================
|
|
208
|
+
// SINGLE-PASS ACCUMULATORS
|
|
209
|
+
// ===================================================================
|
|
210
|
+
|
|
211
|
+
// Token usage by model
|
|
212
|
+
const modelStats = new Map<string, ModelTokenStats>();
|
|
213
|
+
|
|
214
|
+
const getModelStats = (model: string): ModelTokenStats => {
|
|
215
|
+
let stats = modelStats.get(model);
|
|
216
|
+
if (!stats) {
|
|
217
|
+
stats = {
|
|
218
|
+
apiCalls: 0,
|
|
219
|
+
inputTokens: 0,
|
|
220
|
+
outputTokens: 0,
|
|
221
|
+
cacheCreation: 0,
|
|
222
|
+
cacheRead: 0,
|
|
223
|
+
costUsd: 0,
|
|
224
|
+
};
|
|
225
|
+
modelStats.set(model, stats);
|
|
226
|
+
}
|
|
227
|
+
return stats;
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
// Cache economics
|
|
231
|
+
let totalCacheCreation = 0;
|
|
232
|
+
let totalCacheRead = 0;
|
|
233
|
+
let coldStartDetected = false;
|
|
234
|
+
let firstAssistantWithUsageSeen = false;
|
|
235
|
+
|
|
236
|
+
// Message type counts
|
|
237
|
+
const typeCounts = new Map<string, number>();
|
|
238
|
+
|
|
239
|
+
// Tool usage counts
|
|
240
|
+
const toolCounts = new Map<string, number>();
|
|
241
|
+
|
|
242
|
+
// Tool call index: toolUseId -> [messageIndex, toolCall]
|
|
243
|
+
const toolCallIndex = new Map<string, [number, ToolCall]>();
|
|
244
|
+
|
|
245
|
+
// Tool errors
|
|
246
|
+
const errors: ToolError[] = [];
|
|
247
|
+
const errorsByTool = new Map<string, number>();
|
|
248
|
+
|
|
249
|
+
// Permission denials
|
|
250
|
+
const permissionDenials: ToolError[] = [];
|
|
251
|
+
|
|
252
|
+
// Key events
|
|
253
|
+
const keyEvents: KeyEvent[] = [];
|
|
254
|
+
|
|
255
|
+
// Thinking blocks
|
|
256
|
+
let thinkingCount = 0;
|
|
257
|
+
const thinkingAnalysis: ThinkingBlockAnalysis[] = [];
|
|
258
|
+
|
|
259
|
+
// Git branches
|
|
260
|
+
const branches = new Set<string>();
|
|
261
|
+
|
|
262
|
+
// Friction signals
|
|
263
|
+
const corrections: FrictionCorrection[] = [];
|
|
264
|
+
let userMessageCount = 0;
|
|
265
|
+
|
|
266
|
+
// Thrashing detection
|
|
267
|
+
const bashPrefixGroups = new Map<string, number>();
|
|
268
|
+
const fileEditIndices = new Map<string, number[]>();
|
|
269
|
+
|
|
270
|
+
// Startup overhead
|
|
271
|
+
let firstWorkToolSeen = false;
|
|
272
|
+
let startupMessages = 0;
|
|
273
|
+
let startupTokens = 0;
|
|
274
|
+
|
|
275
|
+
// Token density timeline
|
|
276
|
+
const assistantMsgData: [Date, number][] = [];
|
|
277
|
+
|
|
278
|
+
// Conversation tree
|
|
279
|
+
const uuidToIdx = new Map<string, number>();
|
|
280
|
+
const parentMap = new Map<string, string | null>();
|
|
281
|
+
let sidechainCount = 0;
|
|
282
|
+
const childrenMap = new Map<string, string[]>();
|
|
283
|
+
|
|
284
|
+
// Idle gap detection
|
|
285
|
+
let lastAssistantTs: Date | null = null;
|
|
286
|
+
const idleGaps: IdleGap[] = [];
|
|
287
|
+
const IDLE_THRESHOLD_SEC = 60;
|
|
288
|
+
|
|
289
|
+
// Model switch detection
|
|
290
|
+
let lastModel: string | null = null;
|
|
291
|
+
const modelSwitches: ModelSwitch[] = [];
|
|
292
|
+
|
|
293
|
+
// Working directory tracking
|
|
294
|
+
const cwdSet = new Set<string>();
|
|
295
|
+
const cwdChanges: { from: string; to: string; messageIndex: number }[] = [];
|
|
296
|
+
let lastCwd: string | null = null;
|
|
297
|
+
|
|
298
|
+
// Test progression
|
|
299
|
+
const testSnapshots: TestSnapshot[] = [];
|
|
300
|
+
|
|
301
|
+
// Cost tracking
|
|
302
|
+
let parentCost = 0;
|
|
303
|
+
|
|
304
|
+
// Git activity
|
|
305
|
+
const gitCommits: GitCommit[] = [];
|
|
306
|
+
let gitPushCount = 0;
|
|
307
|
+
const gitBranchCreations: string[] = [];
|
|
308
|
+
let linesAddedTotal = 0;
|
|
309
|
+
let linesRemovedTotal = 0;
|
|
310
|
+
|
|
311
|
+
// File read redundancy
|
|
312
|
+
const fileReadCounts = new Map<string, number>();
|
|
313
|
+
|
|
314
|
+
// First user message length
|
|
315
|
+
let firstUserMessageLength = 0;
|
|
316
|
+
let firstUserSeen = false;
|
|
317
|
+
|
|
318
|
+
// Skills invoked
|
|
319
|
+
const skillsInvoked: SkillInvocation[] = [];
|
|
320
|
+
|
|
321
|
+
// Bash commands
|
|
322
|
+
const bashCmds: string[] = [];
|
|
323
|
+
|
|
324
|
+
// Subagents list (backward compat)
|
|
325
|
+
const subagentsList: SubagentBasicEntry[] = [];
|
|
326
|
+
|
|
327
|
+
// Lifecycle tasks
|
|
328
|
+
const lifecycleTasks: string[] = [];
|
|
329
|
+
|
|
330
|
+
// User questions
|
|
331
|
+
const userQuestions: UserQuestion[] = [];
|
|
332
|
+
|
|
333
|
+
// Out-of-scope findings
|
|
334
|
+
const OUT_OF_SCOPE_KEYWORDS = [
|
|
335
|
+
'pre-existing',
|
|
336
|
+
'out of scope',
|
|
337
|
+
'tech debt',
|
|
338
|
+
'anti-pattern',
|
|
339
|
+
'existed before',
|
|
340
|
+
];
|
|
341
|
+
const outOfScopeFindings: OutOfScopeFindings[] = [];
|
|
342
|
+
|
|
343
|
+
// Agent tree metadata
|
|
344
|
+
const agentTreeNodes: AgentTreeNode[] = [];
|
|
345
|
+
|
|
346
|
+
// Compact summary count
|
|
347
|
+
|
|
348
|
+
let compactSummaryCount = 0;
|
|
349
|
+
|
|
350
|
+
// ===================================================================
|
|
351
|
+
// SINGLE PASS
|
|
352
|
+
// ===================================================================
|
|
353
|
+
|
|
354
|
+
for (let i = 0; i < messages.length; i++) {
|
|
355
|
+
const m = messages[i];
|
|
356
|
+
const msgType = m.type ?? 'unknown';
|
|
357
|
+
typeCounts.set(msgType, (typeCounts.get(msgType) ?? 0) + 1);
|
|
358
|
+
const msgUuid = m.uuid ?? '';
|
|
359
|
+
const msgParent = m.parentUuid ?? '';
|
|
360
|
+
const msgTs = m.timestamp;
|
|
361
|
+
|
|
362
|
+
// --- Conversation tree ---
|
|
363
|
+
if (msgUuid) {
|
|
364
|
+
uuidToIdx.set(msgUuid, i);
|
|
365
|
+
parentMap.set(msgUuid, msgParent || null);
|
|
366
|
+
if (msgParent) {
|
|
367
|
+
const children = childrenMap.get(msgParent);
|
|
368
|
+
if (children) children.push(msgUuid);
|
|
369
|
+
else childrenMap.set(msgParent, [msgUuid]);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
if (m.isSidechain) sidechainCount++;
|
|
374
|
+
|
|
375
|
+
// --- Working directory tracking ---
|
|
376
|
+
const msgCwd = m.cwd ?? '';
|
|
377
|
+
if (msgCwd) {
|
|
378
|
+
cwdSet.add(msgCwd);
|
|
379
|
+
if (lastCwd && msgCwd !== lastCwd) {
|
|
380
|
+
cwdChanges.push({ from: lastCwd, to: msgCwd, messageIndex: i });
|
|
381
|
+
}
|
|
382
|
+
lastCwd = msgCwd;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
// --- Token usage, cache economics, and cost ---
|
|
386
|
+
// Skip sidechain messages to avoid double-counting (subagent costs are
|
|
387
|
+
// accounted for separately via processSubagentCost).
|
|
388
|
+
if (m.usage && m.model && !m.isSidechain && m.model !== '<synthetic>') {
|
|
389
|
+
const model = m.model;
|
|
390
|
+
const u = m.usage;
|
|
391
|
+
const inpTok = u.input_tokens ?? 0;
|
|
392
|
+
const outTok = u.output_tokens ?? 0;
|
|
393
|
+
const cc = u.cache_creation_input_tokens ?? 0;
|
|
394
|
+
const cr = u.cache_read_input_tokens ?? 0;
|
|
395
|
+
|
|
396
|
+
const stats = getModelStats(model);
|
|
397
|
+
stats.apiCalls += 1;
|
|
398
|
+
stats.inputTokens += inpTok;
|
|
399
|
+
stats.outputTokens += outTok;
|
|
400
|
+
stats.cacheCreation += cc;
|
|
401
|
+
stats.cacheRead += cr;
|
|
402
|
+
|
|
403
|
+
const callCost = calculateMessageCost(model, inpTok, outTok, cr, cc);
|
|
404
|
+
stats.costUsd += callCost;
|
|
405
|
+
parentCost += callCost;
|
|
406
|
+
|
|
407
|
+
totalCacheCreation += cc;
|
|
408
|
+
totalCacheRead += cr;
|
|
409
|
+
|
|
410
|
+
// Cold start detection
|
|
411
|
+
if (msgType === 'assistant' && !firstAssistantWithUsageSeen) {
|
|
412
|
+
firstAssistantWithUsageSeen = true;
|
|
413
|
+
if (cc > 0 && cr === 0) coldStartDetected = true;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
// --- Git branches ---
|
|
418
|
+
if (m.gitBranch) branches.add(m.gitBranch);
|
|
419
|
+
|
|
420
|
+
// --- Compact summaries ---
|
|
421
|
+
if (m.isCompactSummary) compactSummaryCount++;
|
|
422
|
+
|
|
423
|
+
// --- Agent tree metadata ---
|
|
424
|
+
if (m.agentId) {
|
|
425
|
+
// agentType/teamName/parentToolUseId may exist on raw data but not typed in ParsedMessage
|
|
426
|
+
const raw = m as unknown as Record<string, unknown>;
|
|
427
|
+
agentTreeNodes.push({
|
|
428
|
+
agentId: m.agentId,
|
|
429
|
+
agentType: (raw.agentType as string) ?? 'unknown',
|
|
430
|
+
teamName: (raw.teamName as string) ?? '',
|
|
431
|
+
parentToolUseId: (raw.parentToolUseId as string) ?? '',
|
|
432
|
+
messageIndex: i,
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
// --- Thinking blocks (with content analysis) ---
|
|
437
|
+
if (Array.isArray(m.content)) {
|
|
438
|
+
for (const block of m.content) {
|
|
439
|
+
if (isThinkingBlock(block)) {
|
|
440
|
+
thinkingCount++;
|
|
441
|
+
const thinkText = block.thinking ?? '';
|
|
442
|
+
const signalsFound: Record<string, boolean> = {};
|
|
443
|
+
for (const [signalName, pattern] of Object.entries(THINKING_SIGNALS)) {
|
|
444
|
+
if (pattern.test(thinkText)) signalsFound[signalName] = true;
|
|
445
|
+
}
|
|
446
|
+
if (Object.keys(signalsFound).length > 0 || thinkingCount <= 5) {
|
|
447
|
+
thinkingAnalysis.push({
|
|
448
|
+
messageIndex: i,
|
|
449
|
+
preview: thinkText.slice(0, 200).replace(/\n/g, ' ').trim(),
|
|
450
|
+
charLength: thinkText.length,
|
|
451
|
+
signals: signalsFound,
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
// --- Model switch detection ---
|
|
459
|
+
if (msgType === 'assistant' && m.model) {
|
|
460
|
+
const currentModel = m.model;
|
|
461
|
+
if (lastModel && currentModel !== lastModel) {
|
|
462
|
+
modelSwitches.push({
|
|
463
|
+
from: lastModel,
|
|
464
|
+
to: currentModel,
|
|
465
|
+
messageIndex: i,
|
|
466
|
+
timestamp: msgTs ?? null,
|
|
467
|
+
});
|
|
468
|
+
}
|
|
469
|
+
lastModel = currentModel;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
// --- Idle gap detection ---
|
|
473
|
+
if (msgType === 'assistant' && msgTs) {
|
|
474
|
+
lastAssistantTs = msgTs;
|
|
475
|
+
}
|
|
476
|
+
if (msgType === 'user' && msgTs && lastAssistantTs) {
|
|
477
|
+
const gap = (msgTs.getTime() - lastAssistantTs.getTime()) / 1000;
|
|
478
|
+
if (gap > IDLE_THRESHOLD_SEC) {
|
|
479
|
+
idleGaps.push({
|
|
480
|
+
gapSeconds: Math.round(gap * 10) / 10,
|
|
481
|
+
gapHuman: formatDuration(Math.floor(gap)),
|
|
482
|
+
afterMessageIndex: i,
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
// --- First user message length (prompt quality) ---
|
|
488
|
+
if (msgType === 'user' && !firstUserSeen && !m.isMeta) {
|
|
489
|
+
const contentText = extractTextContent(m);
|
|
490
|
+
if (contentText.trim()) {
|
|
491
|
+
firstUserMessageLength = contentText.length;
|
|
492
|
+
firstUserSeen = true;
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
// --- Tool calls (assistant messages) ---
|
|
497
|
+
for (const tc of m.toolCalls) {
|
|
498
|
+
const toolName = tc.name;
|
|
499
|
+
toolCounts.set(toolName, (toolCounts.get(toolName) ?? 0) + 1);
|
|
500
|
+
if (tc.id) toolCallIndex.set(tc.id, [i, tc]);
|
|
501
|
+
const inp = tc.input ?? {};
|
|
502
|
+
|
|
503
|
+
// Bash commands
|
|
504
|
+
if (toolName === 'Bash') {
|
|
505
|
+
const cmd = typeof inp.command === 'string' ? inp.command : '';
|
|
506
|
+
const cmdTrunc = cmd.slice(0, 200);
|
|
507
|
+
bashCmds.push(cmdTrunc);
|
|
508
|
+
// Thrashing: bash prefix groups
|
|
509
|
+
const prefix = cmd.slice(0, 40);
|
|
510
|
+
bashPrefixGroups.set(prefix, (bashPrefixGroups.get(prefix) ?? 0) + 1);
|
|
511
|
+
|
|
512
|
+
// Git activity
|
|
513
|
+
if (cmd.includes('git commit')) {
|
|
514
|
+
const heredocMatch = /cat\s+<<['"]?EOF['"]?\n(.+?)(?:\n|$)/.exec(cmd);
|
|
515
|
+
let preview: string;
|
|
516
|
+
if (heredocMatch) {
|
|
517
|
+
preview = heredocMatch[1].trim().slice(0, 80);
|
|
518
|
+
} else {
|
|
519
|
+
const msgMatch = /-m\s+["'](.+?)["']/.exec(cmd);
|
|
520
|
+
preview = msgMatch ? msgMatch[1].slice(0, 80) : cmd.slice(0, 80);
|
|
521
|
+
}
|
|
522
|
+
gitCommits.push({ messagePreview: preview, messageIndex: i });
|
|
523
|
+
}
|
|
524
|
+
if (cmd.includes('git push')) gitPushCount++;
|
|
525
|
+
if (cmd.includes('git checkout -b') || cmd.includes('git switch -c')) {
|
|
526
|
+
const branchMatch = /git (?:checkout -b|switch -c)\s+(\S+)/.exec(cmd);
|
|
527
|
+
if (branchMatch) gitBranchCreations.push(branchMatch[1]);
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
// Skills
|
|
532
|
+
if (toolName === 'Skill') {
|
|
533
|
+
skillsInvoked.push({
|
|
534
|
+
skill: (inp.skill as string) ?? 'unknown',
|
|
535
|
+
argsPreview: (typeof inp.args === 'string'
|
|
536
|
+
? inp.args
|
|
537
|
+
: JSON.stringify(inp.args ?? '')
|
|
538
|
+
).slice(0, 120),
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
// Task (subagent list)
|
|
543
|
+
if (toolName === 'Task') {
|
|
544
|
+
subagentsList.push({
|
|
545
|
+
description: (inp.description as string) ?? 'unknown',
|
|
546
|
+
subagentType: (inp.subagent_type as string) ?? 'unknown',
|
|
547
|
+
model: (inp.model as string) ?? 'default (inherits parent)',
|
|
548
|
+
runInBackground: (inp.run_in_background as boolean) ?? false,
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
// TaskCreate
|
|
553
|
+
if (toolName === 'TaskCreate') {
|
|
554
|
+
lifecycleTasks.push((inp.subject as string) ?? 'unknown');
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
// AskUserQuestion
|
|
558
|
+
if (toolName === 'AskUserQuestion') {
|
|
559
|
+
const questions = inp.questions as { question?: string; options?: { label?: string }[] }[];
|
|
560
|
+
if (Array.isArray(questions)) {
|
|
561
|
+
for (const q of questions) {
|
|
562
|
+
userQuestions.push({
|
|
563
|
+
question: q.question ?? '',
|
|
564
|
+
options: Array.isArray(q.options) ? q.options.map((o) => o.label ?? '') : [],
|
|
565
|
+
});
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
// File reads
|
|
571
|
+
if (toolName === 'Read') {
|
|
572
|
+
const filePath = (inp.file_path as string) ?? '';
|
|
573
|
+
if (filePath) {
|
|
574
|
+
fileReadCounts.set(filePath, (fileReadCounts.get(filePath) ?? 0) + 1);
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
// Write/Edit for thrashing
|
|
579
|
+
if (toolName === 'Write' || toolName === 'Edit') {
|
|
580
|
+
const fp = (inp.file_path as string) ?? '';
|
|
581
|
+
if (fp) {
|
|
582
|
+
const indices = fileEditIndices.get(fp);
|
|
583
|
+
if (indices) indices.push(i);
|
|
584
|
+
else fileEditIndices.set(fp, [i]);
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
// Startup overhead: track first non-Skill tool call
|
|
589
|
+
if (!firstWorkToolSeen && NON_SKILL_TOOLS.has(toolName)) {
|
|
590
|
+
firstWorkToolSeen = true;
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
// --- Startup overhead: count assistant messages before first work tool ---
|
|
595
|
+
if (msgType === 'assistant' && !firstWorkToolSeen) {
|
|
596
|
+
startupMessages++;
|
|
597
|
+
if (m.usage) {
|
|
598
|
+
startupTokens += m.usage.output_tokens ?? 0;
|
|
599
|
+
startupTokens += m.usage.input_tokens ?? 0;
|
|
600
|
+
startupTokens += m.usage.cache_creation_input_tokens ?? 0;
|
|
601
|
+
startupTokens += m.usage.cache_read_input_tokens ?? 0;
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
// --- Token density timeline ---
|
|
606
|
+
if (msgType === 'assistant' && msgTs && m.usage) {
|
|
607
|
+
const totalMsgTokens =
|
|
608
|
+
(m.usage.input_tokens ?? 0) +
|
|
609
|
+
(m.usage.output_tokens ?? 0) +
|
|
610
|
+
(m.usage.cache_creation_input_tokens ?? 0) +
|
|
611
|
+
(m.usage.cache_read_input_tokens ?? 0);
|
|
612
|
+
assistantMsgData.push([msgTs, totalMsgTokens]);
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
// --- Timing / key events ---
|
|
616
|
+
if (msgTs) {
|
|
617
|
+
let label: string | null = null;
|
|
618
|
+
if (msgType === 'user' && typeof m.content === 'string') {
|
|
619
|
+
const content = m.content;
|
|
620
|
+
if (content.includes('start feature')) {
|
|
621
|
+
label = `User: ${content.slice(0, 60)}`;
|
|
622
|
+
} else if (content.includes('being continued')) {
|
|
623
|
+
label = 'Context compaction/continuation';
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
for (const tc of m.toolCalls) {
|
|
628
|
+
if (tc.name === 'Skill') {
|
|
629
|
+
label = `Skill: ${(tc.input.skill as string) ?? ''}`;
|
|
630
|
+
} else if (tc.name === 'Task') {
|
|
631
|
+
const inpTc = tc.input ?? {};
|
|
632
|
+
label = `Task: ${(inpTc.description as string) ?? ''} (${(inpTc.subagent_type as string) ?? ''})`;
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
if (label) {
|
|
637
|
+
keyEvents.push({ timestamp: msgTs, label });
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
// --- Friction signals (user messages) ---
|
|
642
|
+
if (msgType === 'user' && !m.isMeta) {
|
|
643
|
+
const contentText = extractTextContent(m);
|
|
644
|
+
if (contentText.trim()) {
|
|
645
|
+
userMessageCount++;
|
|
646
|
+
for (const [regex, keyword] of FRICTION_PATTERNS) {
|
|
647
|
+
if (regex.test(contentText)) {
|
|
648
|
+
corrections.push({
|
|
649
|
+
messageIndex: i,
|
|
650
|
+
keyword,
|
|
651
|
+
preview: contentText.slice(0, 120).replace(/\n/g, ' '),
|
|
652
|
+
});
|
|
653
|
+
break;
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
// --- Out-of-scope findings (assistant messages) ---
|
|
660
|
+
if (msgType === 'assistant') {
|
|
661
|
+
const contentText = extractTextContent(m);
|
|
662
|
+
const contentLower = contentText.toLowerCase();
|
|
663
|
+
for (const kw of OUT_OF_SCOPE_KEYWORDS) {
|
|
664
|
+
const kwIdx = contentLower.indexOf(kw.toLowerCase());
|
|
665
|
+
if (kwIdx >= 0) {
|
|
666
|
+
const start = Math.max(0, kwIdx - 80);
|
|
667
|
+
const end = Math.min(contentText.length, kwIdx + 300);
|
|
668
|
+
outOfScopeFindings.push({
|
|
669
|
+
keyword: kw,
|
|
670
|
+
messageIndex: i,
|
|
671
|
+
snippet: contentText.slice(start, end).replace(/\n/g, ' ').trim(),
|
|
672
|
+
});
|
|
673
|
+
break;
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
// --- Tool results ---
|
|
679
|
+
for (const tr of m.toolResults) {
|
|
680
|
+
const toolUseId = tr.toolUseId;
|
|
681
|
+
if (!toolUseId) continue;
|
|
682
|
+
const contentStr = typeof tr.content === 'string' ? tr.content : JSON.stringify(tr.content);
|
|
683
|
+
|
|
684
|
+
// Tool errors
|
|
685
|
+
if (tr.isError) {
|
|
686
|
+
let toolName = 'unknown';
|
|
687
|
+
let toolInput = '';
|
|
688
|
+
const indexed = toolCallIndex.get(toolUseId);
|
|
689
|
+
if (indexed) {
|
|
690
|
+
const [, tc] = indexed;
|
|
691
|
+
toolName = tc.name ?? 'unknown';
|
|
692
|
+
toolInput = JSON.stringify(tc.input ?? {}).slice(0, 300);
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
const errorEntry: ToolError = {
|
|
696
|
+
tool: toolName,
|
|
697
|
+
inputPreview: toolInput,
|
|
698
|
+
error: contentStr.slice(0, 500),
|
|
699
|
+
messageIndex: i,
|
|
700
|
+
isPermissionDenial: false,
|
|
701
|
+
};
|
|
702
|
+
|
|
703
|
+
if (isPermissionDenial(contentStr)) {
|
|
704
|
+
errorEntry.isPermissionDenial = true;
|
|
705
|
+
permissionDenials.push(errorEntry);
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
errors.push(errorEntry);
|
|
709
|
+
errorsByTool.set(toolName, (errorsByTool.get(toolName) ?? 0) + 1);
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
// Bash exit code errors
|
|
713
|
+
if (
|
|
714
|
+
!tr.isError &&
|
|
715
|
+
(contentStr.includes('Exit code 1') || contentStr.includes('Exit code 127'))
|
|
716
|
+
) {
|
|
717
|
+
const indexed = toolCallIndex.get(toolUseId);
|
|
718
|
+
if (indexed) {
|
|
719
|
+
const [, tc] = indexed;
|
|
720
|
+
if (tc.name === 'Bash') {
|
|
721
|
+
const bashError: ToolError = {
|
|
722
|
+
tool: 'Bash (non-zero exit)',
|
|
723
|
+
inputPreview: JSON.stringify(tc.input ?? {}).slice(0, 300),
|
|
724
|
+
error: contentStr.slice(0, 500),
|
|
725
|
+
messageIndex: i,
|
|
726
|
+
isPermissionDenial: false,
|
|
727
|
+
};
|
|
728
|
+
if (isPermissionDenial(contentStr)) {
|
|
729
|
+
bashError.isPermissionDenial = true;
|
|
730
|
+
permissionDenials.push(bashError);
|
|
731
|
+
}
|
|
732
|
+
errors.push(bashError);
|
|
733
|
+
errorsByTool.set(
|
|
734
|
+
'Bash (non-zero exit)',
|
|
735
|
+
(errorsByTool.get('Bash (non-zero exit)') ?? 0) + 1
|
|
736
|
+
);
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
// --- Test progression: parse test output from bash results ---
|
|
742
|
+
const indexedForTest = toolCallIndex.get(toolUseId);
|
|
743
|
+
if (indexedForTest) {
|
|
744
|
+
const [, tcOrig] = indexedForTest;
|
|
745
|
+
if (tcOrig.name === 'Bash') {
|
|
746
|
+
const testResult = parseTestSummary(contentStr);
|
|
747
|
+
if (testResult) {
|
|
748
|
+
const [passed, failed] = testResult;
|
|
749
|
+
testSnapshots.push({
|
|
750
|
+
messageIndex: i,
|
|
751
|
+
passed,
|
|
752
|
+
failed,
|
|
753
|
+
total: passed + failed,
|
|
754
|
+
raw: contentStr.slice(0, 200).replace(/\n/g, ' '),
|
|
755
|
+
});
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
// --- Lines changed: parse git diff --stat output ---
|
|
761
|
+
const indexedForDiff = toolCallIndex.get(toolUseId);
|
|
762
|
+
if (indexedForDiff) {
|
|
763
|
+
const [, tcOrig] = indexedForDiff;
|
|
764
|
+
if (tcOrig.name === 'Bash') {
|
|
765
|
+
const rawCmd = tcOrig.input?.command;
|
|
766
|
+
const cmdText = typeof rawCmd === 'string' ? rawCmd : '';
|
|
767
|
+
if (cmdText.includes('git diff') || cmdText.includes('git show')) {
|
|
768
|
+
const insertionIdx = contentStr.indexOf(' insertion');
|
|
769
|
+
const deletionIdx = contentStr.indexOf(' deletion');
|
|
770
|
+
if (insertionIdx > 0) {
|
|
771
|
+
const numStr = contentStr
|
|
772
|
+
.slice(Math.max(0, insertionIdx - 10), insertionIdx)
|
|
773
|
+
.trim()
|
|
774
|
+
.split(/\s+/)
|
|
775
|
+
.pop();
|
|
776
|
+
if (numStr && /^\d+$/.test(numStr)) linesAddedTotal += parseInt(numStr, 10);
|
|
777
|
+
}
|
|
778
|
+
if (deletionIdx > 0) {
|
|
779
|
+
const numStr = contentStr
|
|
780
|
+
.slice(Math.max(0, deletionIdx - 10), deletionIdx)
|
|
781
|
+
.trim()
|
|
782
|
+
.split(/\s+/)
|
|
783
|
+
.pop();
|
|
784
|
+
if (numStr && /^\d+$/.test(numStr)) linesRemovedTotal += parseInt(numStr, 10);
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
// ===================================================================
|
|
793
|
+
// POST-PASS AGGREGATION
|
|
794
|
+
// ===================================================================
|
|
795
|
+
|
|
796
|
+
// --- Token usage ---
|
|
797
|
+
let totalInputTokens = 0;
|
|
798
|
+
let totalOutputTokens = 0;
|
|
799
|
+
let totalCacheCreationTokens = 0;
|
|
800
|
+
let totalCacheReadTokens = 0;
|
|
801
|
+
|
|
802
|
+
const byModel: Record<string, ModelTokenStats> = {};
|
|
803
|
+
for (const [model, stats] of modelStats) {
|
|
804
|
+
stats.costUsd = Math.round(stats.costUsd * 10000) / 10000;
|
|
805
|
+
byModel[model] = stats;
|
|
806
|
+
totalInputTokens += stats.inputTokens;
|
|
807
|
+
totalOutputTokens += stats.outputTokens;
|
|
808
|
+
totalCacheCreationTokens += stats.cacheCreation;
|
|
809
|
+
totalCacheReadTokens += stats.cacheRead;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
let grandTotal =
|
|
813
|
+
totalInputTokens + totalOutputTokens + totalCacheCreationTokens + totalCacheReadTokens;
|
|
814
|
+
|
|
815
|
+
// --- Cost analysis ---
|
|
816
|
+
const commitCount = gitCommits.length;
|
|
817
|
+
const linesChanged = linesAddedTotal + linesRemovedTotal;
|
|
818
|
+
|
|
819
|
+
// --- Subagent metrics from detail.processes ---
|
|
820
|
+
const subagentEntries: SubagentEntry[] = detail.processes.map((proc: Process) => {
|
|
821
|
+
const desc = proc.description ?? 'unknown';
|
|
822
|
+
// Extract actual model from subagent messages (first assistant message with a model field)
|
|
823
|
+
const subagentModel =
|
|
824
|
+
proc.messages.find((m: ParsedMessage) => m.type === 'assistant' && m.model)?.model ??
|
|
825
|
+
'default (inherits parent)';
|
|
826
|
+
// Compute cost from subagent token breakdown (proc.metrics.costUsd is not populated upstream)
|
|
827
|
+
const computedCost = calculateMessageCost(
|
|
828
|
+
subagentModel,
|
|
829
|
+
proc.metrics.inputTokens,
|
|
830
|
+
proc.metrics.outputTokens,
|
|
831
|
+
proc.metrics.cacheReadTokens,
|
|
832
|
+
proc.metrics.cacheCreationTokens
|
|
833
|
+
);
|
|
834
|
+
return {
|
|
835
|
+
description: desc,
|
|
836
|
+
subagentType: proc.subagentType ?? 'unknown',
|
|
837
|
+
model: subagentModel,
|
|
838
|
+
totalTokens: proc.metrics.totalTokens,
|
|
839
|
+
totalDurationMs: proc.durationMs,
|
|
840
|
+
totalToolUseCount: proc.messages.reduce(
|
|
841
|
+
(sum: number, pm: ParsedMessage) => sum + pm.toolCalls.length,
|
|
842
|
+
0
|
|
843
|
+
),
|
|
844
|
+
costUsd: computedCost,
|
|
845
|
+
modelMismatch: detectModelMismatch(desc, subagentModel),
|
|
846
|
+
};
|
|
847
|
+
});
|
|
848
|
+
|
|
849
|
+
const saFromProcesses = {
|
|
850
|
+
count: subagentEntries.length,
|
|
851
|
+
totalTokens: subagentEntries.reduce((sum, a) => sum + a.totalTokens, 0),
|
|
852
|
+
totalDurationMs: subagentEntries.reduce((sum, a) => sum + a.totalDurationMs, 0),
|
|
853
|
+
totalToolUseCount: subagentEntries.reduce((sum, a) => sum + a.totalToolUseCount, 0),
|
|
854
|
+
totalCostUsd:
|
|
855
|
+
Math.round(subagentEntries.reduce((sum, a) => sum + a.costUsd, 0) * 10000) / 10000,
|
|
856
|
+
byAgent: subagentEntries,
|
|
857
|
+
};
|
|
858
|
+
|
|
859
|
+
// --- Tool usage with success rates ---
|
|
860
|
+
const toolSuccessRates: Record<string, ToolSuccessRate> = {};
|
|
861
|
+
const sortedToolCounts = [...toolCounts.entries()].sort((a, b) => b[1] - a[1]);
|
|
862
|
+
const countsRecord: Record<string, number> = {};
|
|
863
|
+
for (const [tool, count] of sortedToolCounts) {
|
|
864
|
+
countsRecord[tool] = count;
|
|
865
|
+
const errCount = errorsByTool.get(tool) ?? 0;
|
|
866
|
+
const successPct = count ? Math.round(((count - errCount) / count) * 1000) / 10 : 0;
|
|
867
|
+
toolSuccessRates[tool] = {
|
|
868
|
+
totalCalls: count,
|
|
869
|
+
errors: errCount,
|
|
870
|
+
successRatePct: successPct,
|
|
871
|
+
assessment: computeToolHealthAssessment(successPct),
|
|
872
|
+
};
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
// Overall tool health: worst assessment among tools with >5 calls
|
|
876
|
+
const significantTools = Object.values(toolSuccessRates).filter((t) => t.totalCalls > 5);
|
|
877
|
+
type THAssessment = 'healthy' | 'degraded' | 'unreliable';
|
|
878
|
+
const overallToolHealth: THAssessment =
|
|
879
|
+
significantTools.length > 0
|
|
880
|
+
? significantTools.reduce<THAssessment>((worst, t) => {
|
|
881
|
+
const order = { healthy: 0, degraded: 1, unreliable: 2 } as const;
|
|
882
|
+
return order[t.assessment] > order[worst] ? t.assessment : worst;
|
|
883
|
+
}, 'healthy')
|
|
884
|
+
: computeToolHealthAssessment(100);
|
|
885
|
+
|
|
886
|
+
// --- Key events timing ---
|
|
887
|
+
for (let j = 1; j < keyEvents.length; j++) {
|
|
888
|
+
const prevDt = keyEvents[j - 1].timestamp;
|
|
889
|
+
const currDt = keyEvents[j].timestamp;
|
|
890
|
+
const delta = (currDt.getTime() - prevDt.getTime()) / 1000;
|
|
891
|
+
keyEvents[j].deltaSeconds = Math.round(delta * 10) / 10;
|
|
892
|
+
keyEvents[j].deltaHuman = formatDuration(Math.floor(delta));
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
// --- Thinking blocks signal aggregation ---
|
|
896
|
+
const signalTotals: Record<string, number> = {};
|
|
897
|
+
for (const ta of thinkingAnalysis) {
|
|
898
|
+
for (const sig of Object.keys(ta.signals)) {
|
|
899
|
+
signalTotals[sig] = (signalTotals[sig] ?? 0) + 1;
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
// --- Cache economics ---
|
|
904
|
+
const cacheTotalCreationAndRead = totalCacheCreation + totalCacheRead;
|
|
905
|
+
const cacheEfficiency = cacheTotalCreationAndRead
|
|
906
|
+
? Math.round((totalCacheRead / cacheTotalCreationAndRead) * 10000) / 100
|
|
907
|
+
: 0;
|
|
908
|
+
const cacheRwRatio = totalCacheCreation
|
|
909
|
+
? Math.round((totalCacheRead / totalCacheCreation) * 10) / 10
|
|
910
|
+
: 0;
|
|
911
|
+
|
|
912
|
+
// --- File read redundancy ---
|
|
913
|
+
let totalReads = 0;
|
|
914
|
+
const redundantFiles: Record<string, number> = {};
|
|
915
|
+
for (const [path, count] of fileReadCounts) {
|
|
916
|
+
totalReads += count;
|
|
917
|
+
if (count > 2) redundantFiles[path] = count;
|
|
918
|
+
}
|
|
919
|
+
const uniqueFiles = fileReadCounts.size;
|
|
920
|
+
|
|
921
|
+
// --- Token density timeline ---
|
|
922
|
+
const quartiles: { q: number; avgTokens: number; messageCount: number }[] = [];
|
|
923
|
+
if (assistantMsgData.length > 0) {
|
|
924
|
+
const n = assistantMsgData.length;
|
|
925
|
+
const qSize = Math.max(1, Math.floor(n / 4));
|
|
926
|
+
for (let q = 0; q < 4; q++) {
|
|
927
|
+
const startIdx = q * qSize;
|
|
928
|
+
const endIdx = q === 3 ? n : (q + 1) * qSize;
|
|
929
|
+
const chunk = assistantMsgData.slice(startIdx, endIdx);
|
|
930
|
+
if (chunk.length > 0) {
|
|
931
|
+
const avgTokens = Math.round(chunk.reduce((sum, [, t]) => sum + t, 0) / chunk.length);
|
|
932
|
+
quartiles.push({ q: q + 1, avgTokens, messageCount: chunk.length });
|
|
933
|
+
} else {
|
|
934
|
+
quartiles.push({ q: q + 1, avgTokens: 0, messageCount: 0 });
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
} else {
|
|
938
|
+
for (let q = 0; q < 4; q++) {
|
|
939
|
+
quartiles.push({ q: q + 1, avgTokens: 0, messageCount: 0 });
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
// --- Conversation tree analysis ---
|
|
944
|
+
const depthMemo = new Map<string, number>();
|
|
945
|
+
function getDepth(uuid: string, visited = new Set<string>()): number {
|
|
946
|
+
if (depthMemo.has(uuid)) return depthMemo.get(uuid)!;
|
|
947
|
+
if (visited.has(uuid)) {
|
|
948
|
+
depthMemo.set(uuid, 0);
|
|
949
|
+
return 0;
|
|
950
|
+
}
|
|
951
|
+
visited.add(uuid);
|
|
952
|
+
const parent = parentMap.get(uuid);
|
|
953
|
+
if (!parent) {
|
|
954
|
+
depthMemo.set(uuid, 0);
|
|
955
|
+
return 0;
|
|
956
|
+
}
|
|
957
|
+
const depth = 1 + getDepth(parent, visited);
|
|
958
|
+
depthMemo.set(uuid, depth);
|
|
959
|
+
return depth;
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
let maxDepth = 0;
|
|
963
|
+
for (const uuid of parentMap.keys()) {
|
|
964
|
+
const d = getDepth(uuid);
|
|
965
|
+
if (d > maxDepth) maxDepth = d;
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
// Branch points: parents with multiple children
|
|
969
|
+
const branchPoints = new Map<string, string[]>();
|
|
970
|
+
for (const [parent, children] of childrenMap) {
|
|
971
|
+
if (children.length > 1) branchPoints.set(parent, children);
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
const branchDetails = [...branchPoints.entries()]
|
|
975
|
+
.sort((a, b) => b[1].length - a[1].length)
|
|
976
|
+
.slice(0, 10)
|
|
977
|
+
.map(([p, c]) => ({
|
|
978
|
+
parentUuid: p.slice(0, 12) + '...',
|
|
979
|
+
childCount: c.length,
|
|
980
|
+
parentMessageIndex: uuidToIdx.get(p),
|
|
981
|
+
}));
|
|
982
|
+
|
|
983
|
+
// --- Idle gap analysis ---
|
|
984
|
+
const totalIdle = idleGaps.reduce((sum, g) => sum + g.gapSeconds, 0);
|
|
985
|
+
const wallClock = durationSeconds;
|
|
986
|
+
const activeTime = wallClock > 0 ? wallClock - totalIdle : 0;
|
|
987
|
+
|
|
988
|
+
// --- Thrashing signals ---
|
|
989
|
+
const bashNearDuplicates = [...bashPrefixGroups.entries()]
|
|
990
|
+
.filter(([, count]) => count > 2)
|
|
991
|
+
.sort((a, b) => b[1] - a[1])
|
|
992
|
+
.map(([prefix, count]) => ({ prefix, count }));
|
|
993
|
+
|
|
994
|
+
const editReworkFiles = [...fileEditIndices.entries()]
|
|
995
|
+
.filter(([, indices]) => indices.length >= 3)
|
|
996
|
+
.map(([filePath, editIndices]) => ({ filePath, editIndices }));
|
|
997
|
+
|
|
998
|
+
// --- Model switches ---
|
|
999
|
+
const modelsUsed =
|
|
1000
|
+
modelSwitches.length > 0
|
|
1001
|
+
? [...new Set([...modelSwitches.map((s) => s.from), ...modelSwitches.map((s) => s.to)])]
|
|
1002
|
+
: [...modelStats.keys()];
|
|
1003
|
+
|
|
1004
|
+
// --- Test progression trajectory ---
|
|
1005
|
+
let trajectory: 'improving' | 'regressing' | 'stable' | 'insufficient_data' = 'insufficient_data';
|
|
1006
|
+
if (testSnapshots.length >= 2) {
|
|
1007
|
+
const first = testSnapshots[0];
|
|
1008
|
+
const last = testSnapshots[testSnapshots.length - 1];
|
|
1009
|
+
if (last.passed > first.passed) trajectory = 'improving';
|
|
1010
|
+
else if (last.passed < first.passed) trajectory = 'regressing';
|
|
1011
|
+
else trajectory = 'stable';
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
// --- Prompt quality assessment ---
|
|
1015
|
+
const correctionCount = corrections.length;
|
|
1016
|
+
const frictionRate = userMessageCount
|
|
1017
|
+
? Math.round((correctionCount / userMessageCount) * 10000) / 10000
|
|
1018
|
+
: 0;
|
|
1019
|
+
|
|
1020
|
+
type PromptAssessment =
|
|
1021
|
+
| 'underspecified'
|
|
1022
|
+
| 'verbose_but_unclear'
|
|
1023
|
+
| 'well_specified'
|
|
1024
|
+
| 'moderate_friction';
|
|
1025
|
+
|
|
1026
|
+
let assessment: PromptAssessment;
|
|
1027
|
+
let promptNote: string;
|
|
1028
|
+
|
|
1029
|
+
if (firstUserMessageLength < 100 && correctionCount >= 2) {
|
|
1030
|
+
assessment = 'underspecified';
|
|
1031
|
+
promptNote =
|
|
1032
|
+
'Short initial prompt with multiple corrections suggests the task needed more upfront specification.';
|
|
1033
|
+
} else if (firstUserMessageLength > 500 && correctionCount >= 3) {
|
|
1034
|
+
assessment = 'verbose_but_unclear';
|
|
1035
|
+
promptNote =
|
|
1036
|
+
'Initial prompt was detailed but still required corrections — consider restructuring for clarity.';
|
|
1037
|
+
} else if (correctionCount <= 1) {
|
|
1038
|
+
assessment = 'well_specified';
|
|
1039
|
+
promptNote = 'Low friction — initial prompt effectively communicated intent.';
|
|
1040
|
+
} else {
|
|
1041
|
+
assessment = 'moderate_friction';
|
|
1042
|
+
promptNote =
|
|
1043
|
+
'Moderate friction detected — review correction patterns for improvement opportunities.';
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
// --- Message types ---
|
|
1047
|
+
const messageTypes: Record<string, number> = {};
|
|
1048
|
+
for (const [type, count] of typeCounts) {
|
|
1049
|
+
messageTypes[type] = count;
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
// --- Subagent cost from processes ---
|
|
1053
|
+
const processSubagentCost = subagentEntries.reduce((sum, a) => sum + a.costUsd, 0);
|
|
1054
|
+
const totalCost = parentCost + processSubagentCost;
|
|
1055
|
+
|
|
1056
|
+
// Add aggregated subagent row to costByModel and byModel for the cost table
|
|
1057
|
+
if (subagentEntries.length > 0 && processSubagentCost > 0) {
|
|
1058
|
+
const subagentTokenStats: ModelTokenStats = {
|
|
1059
|
+
apiCalls: 0,
|
|
1060
|
+
inputTokens: 0,
|
|
1061
|
+
outputTokens: 0,
|
|
1062
|
+
cacheCreation: 0,
|
|
1063
|
+
cacheRead: 0,
|
|
1064
|
+
costUsd: 0,
|
|
1065
|
+
};
|
|
1066
|
+
for (const proc of detail.processes) {
|
|
1067
|
+
subagentTokenStats.inputTokens += proc.metrics.inputTokens;
|
|
1068
|
+
subagentTokenStats.outputTokens += proc.metrics.outputTokens;
|
|
1069
|
+
subagentTokenStats.cacheCreation += proc.metrics.cacheCreationTokens;
|
|
1070
|
+
subagentTokenStats.cacheRead += proc.metrics.cacheReadTokens;
|
|
1071
|
+
// Count assistant messages with usage as API calls
|
|
1072
|
+
subagentTokenStats.apiCalls += proc.messages.filter(
|
|
1073
|
+
(m: ParsedMessage) => m.type === 'assistant' && m.usage
|
|
1074
|
+
).length;
|
|
1075
|
+
}
|
|
1076
|
+
subagentTokenStats.costUsd = Math.round(processSubagentCost * 10000) / 10000;
|
|
1077
|
+
const subagentLabel = 'Subagents (combined)';
|
|
1078
|
+
byModel[subagentLabel] = subagentTokenStats;
|
|
1079
|
+
modelStats.set(subagentLabel, subagentTokenStats);
|
|
1080
|
+
|
|
1081
|
+
// Update totals to include subagent tokens so the footer row stays consistent
|
|
1082
|
+
totalInputTokens += subagentTokenStats.inputTokens;
|
|
1083
|
+
totalOutputTokens += subagentTokenStats.outputTokens;
|
|
1084
|
+
totalCacheCreationTokens += subagentTokenStats.cacheCreation;
|
|
1085
|
+
totalCacheReadTokens += subagentTokenStats.cacheRead;
|
|
1086
|
+
grandTotal =
|
|
1087
|
+
totalInputTokens + totalOutputTokens + totalCacheCreationTokens + totalCacheReadTokens;
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
// --- Assessment computations ---
|
|
1091
|
+
const costPerCommitVal =
|
|
1092
|
+
commitCount > 0 ? Math.round((totalCost / commitCount) * 10000) / 10000 : null;
|
|
1093
|
+
const costPerLineVal =
|
|
1094
|
+
linesChanged > 0 ? Math.round((totalCost / linesChanged) * 1000000) / 1000000 : null;
|
|
1095
|
+
const subagentCostSharePct =
|
|
1096
|
+
totalCost > 0 ? Math.round((processSubagentCost / totalCost) * 10000) / 100 : null;
|
|
1097
|
+
|
|
1098
|
+
const readsPerUniqueFile = uniqueFiles ? Math.round((totalReads / uniqueFiles) * 100) / 100 : 0;
|
|
1099
|
+
const startupPctOfTotal = grandTotal ? Math.round((startupTokens / grandTotal) * 10000) / 100 : 0;
|
|
1100
|
+
const idlePct = wallClock > 0 ? Math.round((totalIdle / wallClock) * 1000) / 10 : 0;
|
|
1101
|
+
const thrashingSignalCount = bashNearDuplicates.length + editReworkFiles.length;
|
|
1102
|
+
|
|
1103
|
+
// ===================================================================
|
|
1104
|
+
// BUILD REPORT
|
|
1105
|
+
// ===================================================================
|
|
1106
|
+
|
|
1107
|
+
const report: SessionReport = {
|
|
1108
|
+
overview: {
|
|
1109
|
+
sessionId: session.id,
|
|
1110
|
+
projectId: session.projectId ?? 'unknown',
|
|
1111
|
+
projectPath: session.projectPath ?? 'unknown',
|
|
1112
|
+
firstMessage: session.firstMessage ?? 'unknown',
|
|
1113
|
+
messageCount: session.messageCount ?? 0,
|
|
1114
|
+
hasSubagents: session.hasSubagents ?? false,
|
|
1115
|
+
contextConsumption: ctxConsumption,
|
|
1116
|
+
contextConsumptionPct: ctxConsumptionPct,
|
|
1117
|
+
contextAssessment: ctxAssessment,
|
|
1118
|
+
compactionCount: session.compactionCount ?? 0,
|
|
1119
|
+
gitBranch: session.gitBranch ?? 'unknown',
|
|
1120
|
+
startTime: firstTs,
|
|
1121
|
+
endTime: lastTs,
|
|
1122
|
+
durationSeconds,
|
|
1123
|
+
durationHuman: durationSeconds > 0 ? formatDuration(Math.floor(durationSeconds)) : 'unknown',
|
|
1124
|
+
totalMessages: messages.length,
|
|
1125
|
+
},
|
|
1126
|
+
|
|
1127
|
+
tokenUsage: {
|
|
1128
|
+
byModel,
|
|
1129
|
+
totals: {
|
|
1130
|
+
inputTokens: totalInputTokens,
|
|
1131
|
+
outputTokens: totalOutputTokens,
|
|
1132
|
+
cacheCreation: totalCacheCreationTokens,
|
|
1133
|
+
cacheRead: totalCacheReadTokens,
|
|
1134
|
+
grandTotal,
|
|
1135
|
+
cacheReadPct: grandTotal
|
|
1136
|
+
? Math.round((totalCacheReadTokens / grandTotal) * 10000) / 100
|
|
1137
|
+
: 0,
|
|
1138
|
+
},
|
|
1139
|
+
},
|
|
1140
|
+
|
|
1141
|
+
costAnalysis: {
|
|
1142
|
+
parentCostUsd: Math.round(parentCost * 10000) / 10000,
|
|
1143
|
+
subagentCostUsd: Math.round(processSubagentCost * 10000) / 10000,
|
|
1144
|
+
totalSessionCostUsd: Math.round(totalCost * 10000) / 10000,
|
|
1145
|
+
costByModel: Object.fromEntries(
|
|
1146
|
+
[...modelStats.entries()].map(([model, stats]) => [
|
|
1147
|
+
model,
|
|
1148
|
+
Math.round(stats.costUsd * 10000) / 10000,
|
|
1149
|
+
])
|
|
1150
|
+
),
|
|
1151
|
+
costPerCommit: costPerCommitVal,
|
|
1152
|
+
costPerLineChanged: costPerLineVal,
|
|
1153
|
+
costPerCommitAssessment:
|
|
1154
|
+
costPerCommitVal != null ? computeCostPerCommitAssessment(costPerCommitVal) : null,
|
|
1155
|
+
costPerLineAssessment:
|
|
1156
|
+
costPerLineVal != null ? computeCostPerLineAssessment(costPerLineVal) : null,
|
|
1157
|
+
subagentCostSharePct,
|
|
1158
|
+
subagentCostShareAssessment:
|
|
1159
|
+
subagentCostSharePct != null
|
|
1160
|
+
? computeSubagentCostShareAssessment(subagentCostSharePct)
|
|
1161
|
+
: null,
|
|
1162
|
+
},
|
|
1163
|
+
|
|
1164
|
+
cacheEconomics: {
|
|
1165
|
+
cacheRead: totalCacheRead,
|
|
1166
|
+
cacheEfficiencyPct: cacheEfficiency,
|
|
1167
|
+
coldStartDetected,
|
|
1168
|
+
cacheReadToWriteRatio: cacheRwRatio,
|
|
1169
|
+
cacheEfficiencyAssessment:
|
|
1170
|
+
cacheTotalCreationAndRead > 0 ? computeCacheEfficiencyAssessment(cacheEfficiency) : null,
|
|
1171
|
+
cacheRatioAssessment:
|
|
1172
|
+
totalCacheCreation > 0 ? computeCacheRatioAssessment(cacheRwRatio) : null,
|
|
1173
|
+
},
|
|
1174
|
+
|
|
1175
|
+
toolUsage: {
|
|
1176
|
+
counts: countsRecord,
|
|
1177
|
+
totalCalls: [...toolCounts.values()].reduce((sum, c) => sum + c, 0),
|
|
1178
|
+
successRates: toolSuccessRates,
|
|
1179
|
+
overallToolHealth,
|
|
1180
|
+
},
|
|
1181
|
+
|
|
1182
|
+
subagentMetrics: saFromProcesses,
|
|
1183
|
+
|
|
1184
|
+
subagentsList,
|
|
1185
|
+
|
|
1186
|
+
errors: {
|
|
1187
|
+
errors,
|
|
1188
|
+
permissionDenials: {
|
|
1189
|
+
count: permissionDenials.length,
|
|
1190
|
+
denials: permissionDenials,
|
|
1191
|
+
affectedTools: [...new Set(permissionDenials.map((d) => d.tool))],
|
|
1192
|
+
},
|
|
1193
|
+
},
|
|
1194
|
+
|
|
1195
|
+
gitActivity: {
|
|
1196
|
+
commitCount: gitCommits.length,
|
|
1197
|
+
commits: gitCommits,
|
|
1198
|
+
pushCount: gitPushCount,
|
|
1199
|
+
branchCreations: gitBranchCreations,
|
|
1200
|
+
linesAdded: linesAddedTotal,
|
|
1201
|
+
linesRemoved: linesRemovedTotal,
|
|
1202
|
+
linesChanged,
|
|
1203
|
+
},
|
|
1204
|
+
|
|
1205
|
+
frictionSignals: {
|
|
1206
|
+
correctionCount,
|
|
1207
|
+
corrections,
|
|
1208
|
+
frictionRate,
|
|
1209
|
+
},
|
|
1210
|
+
|
|
1211
|
+
thrashingSignals: {
|
|
1212
|
+
bashNearDuplicates,
|
|
1213
|
+
editReworkFiles,
|
|
1214
|
+
thrashingAssessment: computeThrashingAssessment(thrashingSignalCount),
|
|
1215
|
+
},
|
|
1216
|
+
|
|
1217
|
+
conversationTree: {
|
|
1218
|
+
totalNodes: uuidToIdx.size,
|
|
1219
|
+
maxDepth,
|
|
1220
|
+
sidechainCount,
|
|
1221
|
+
branchPoints: branchPoints.size,
|
|
1222
|
+
branchDetails,
|
|
1223
|
+
},
|
|
1224
|
+
|
|
1225
|
+
idleAnalysis: {
|
|
1226
|
+
idleThresholdSeconds: IDLE_THRESHOLD_SEC,
|
|
1227
|
+
idleGapCount: idleGaps.length,
|
|
1228
|
+
totalIdleSeconds: Math.round(totalIdle * 10) / 10,
|
|
1229
|
+
totalIdleHuman: formatDuration(Math.floor(totalIdle)),
|
|
1230
|
+
wallClockSeconds: Math.round(wallClock * 10) / 10,
|
|
1231
|
+
activeWorkingSeconds: Math.round(Math.max(activeTime, 0) * 10) / 10,
|
|
1232
|
+
activeWorkingHuman: formatDuration(Math.floor(Math.max(activeTime, 0))),
|
|
1233
|
+
idlePct,
|
|
1234
|
+
longestGaps: [...idleGaps].sort((a, b) => b.gapSeconds - a.gapSeconds).slice(0, 5),
|
|
1235
|
+
idleAssessment: computeIdleAssessment(idlePct),
|
|
1236
|
+
},
|
|
1237
|
+
|
|
1238
|
+
modelSwitches: {
|
|
1239
|
+
count: modelSwitches.length,
|
|
1240
|
+
switches: modelSwitches,
|
|
1241
|
+
modelsUsed,
|
|
1242
|
+
switchPattern: detectSwitchPattern(modelSwitches),
|
|
1243
|
+
},
|
|
1244
|
+
|
|
1245
|
+
workingDirectories: {
|
|
1246
|
+
uniqueDirectories: [...cwdSet],
|
|
1247
|
+
directoryCount: cwdSet.size,
|
|
1248
|
+
changes: cwdChanges,
|
|
1249
|
+
changeCount: cwdChanges.length,
|
|
1250
|
+
isMultiDirectory: cwdSet.size > 1,
|
|
1251
|
+
},
|
|
1252
|
+
|
|
1253
|
+
testProgression: {
|
|
1254
|
+
snapshotCount: testSnapshots.length,
|
|
1255
|
+
snapshots: testSnapshots,
|
|
1256
|
+
trajectory,
|
|
1257
|
+
firstSnapshot: testSnapshots.length > 0 ? testSnapshots[0] : null,
|
|
1258
|
+
lastSnapshot: testSnapshots.length > 0 ? testSnapshots[testSnapshots.length - 1] : null,
|
|
1259
|
+
},
|
|
1260
|
+
|
|
1261
|
+
startupOverhead: {
|
|
1262
|
+
messagesBeforeFirstWork: startupMessages,
|
|
1263
|
+
tokensBeforeFirstWork: startupTokens,
|
|
1264
|
+
pctOfTotal: startupPctOfTotal,
|
|
1265
|
+
overheadAssessment: computeOverheadAssessment(startupPctOfTotal),
|
|
1266
|
+
},
|
|
1267
|
+
|
|
1268
|
+
tokenDensityTimeline: { quartiles },
|
|
1269
|
+
|
|
1270
|
+
promptQuality: {
|
|
1271
|
+
firstMessageLengthChars: firstUserMessageLength,
|
|
1272
|
+
userMessageCount,
|
|
1273
|
+
correctionCount,
|
|
1274
|
+
frictionRate,
|
|
1275
|
+
assessment,
|
|
1276
|
+
note: promptNote,
|
|
1277
|
+
},
|
|
1278
|
+
|
|
1279
|
+
thinkingBlocks: {
|
|
1280
|
+
count: thinkingCount,
|
|
1281
|
+
analyzedCount: thinkingAnalysis.length,
|
|
1282
|
+
signalSummary: signalTotals,
|
|
1283
|
+
notableBlocks: thinkingAnalysis.slice(0, 20),
|
|
1284
|
+
},
|
|
1285
|
+
|
|
1286
|
+
keyEvents,
|
|
1287
|
+
|
|
1288
|
+
messageTypes,
|
|
1289
|
+
|
|
1290
|
+
fileReadRedundancy: {
|
|
1291
|
+
totalReads,
|
|
1292
|
+
uniqueFiles,
|
|
1293
|
+
readsPerUniqueFile,
|
|
1294
|
+
redundantFiles,
|
|
1295
|
+
redundancyAssessment: computeRedundancyAssessment(readsPerUniqueFile),
|
|
1296
|
+
},
|
|
1297
|
+
|
|
1298
|
+
compaction: {
|
|
1299
|
+
count: session.compactionCount ?? 0,
|
|
1300
|
+
compactSummaryCount,
|
|
1301
|
+
note:
|
|
1302
|
+
(session.compactionCount ?? 0) > 0
|
|
1303
|
+
? 'Session underwent compaction, which may have caused loss of earlier context. Check for repeated work after compaction events.'
|
|
1304
|
+
: 'No compaction occurred — session stayed within context limits.',
|
|
1305
|
+
},
|
|
1306
|
+
|
|
1307
|
+
gitBranches: [...branches],
|
|
1308
|
+
|
|
1309
|
+
skillsInvoked,
|
|
1310
|
+
|
|
1311
|
+
bashCommands: {
|
|
1312
|
+
total: bashCmds.length,
|
|
1313
|
+
unique: new Set(bashCmds).size,
|
|
1314
|
+
repeated: Object.fromEntries(
|
|
1315
|
+
[
|
|
1316
|
+
...bashCmds
|
|
1317
|
+
.reduce((acc, cmd) => acc.set(cmd, (acc.get(cmd) ?? 0) + 1), new Map<string, number>())
|
|
1318
|
+
.entries(),
|
|
1319
|
+
]
|
|
1320
|
+
.filter(([, count]) => count > 1)
|
|
1321
|
+
.sort((a, b) => b[1] - a[1])
|
|
1322
|
+
),
|
|
1323
|
+
},
|
|
1324
|
+
|
|
1325
|
+
lifecycleTasks,
|
|
1326
|
+
|
|
1327
|
+
userQuestions,
|
|
1328
|
+
|
|
1329
|
+
outOfScopeFindings,
|
|
1330
|
+
|
|
1331
|
+
agentTree: (() => {
|
|
1332
|
+
const uniqueAgents = new Map<string, AgentTreeNode>();
|
|
1333
|
+
for (const node of agentTreeNodes) {
|
|
1334
|
+
if (!uniqueAgents.has(node.agentId)) uniqueAgents.set(node.agentId, node);
|
|
1335
|
+
}
|
|
1336
|
+
return {
|
|
1337
|
+
agentCount: uniqueAgents.size,
|
|
1338
|
+
agents: [...uniqueAgents.values()],
|
|
1339
|
+
hasTeamMode: agentTreeNodes.some((n) => n.teamName),
|
|
1340
|
+
teamNames: [...new Set(agentTreeNodes.filter((n) => n.teamName).map((n) => n.teamName))],
|
|
1341
|
+
};
|
|
1342
|
+
})(),
|
|
1343
|
+
};
|
|
1344
|
+
|
|
1345
|
+
return report;
|
|
1346
|
+
}
|