@pennyfarthing/cyclist 10.4.0 → 11.0.0
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/dist/api/agent-load.d.ts +1 -2
- package/dist/api/agent-load.d.ts.map +1 -1
- package/dist/api/agent-load.js +2 -123
- package/dist/api/agent-load.js.map +1 -1
- package/dist/api/audit-log.d.ts +1 -17
- package/dist/api/audit-log.d.ts.map +1 -1
- package/dist/api/audit-log.js +2 -162
- package/dist/api/audit-log.js.map +1 -1
- package/dist/api/background-tasks.d.ts +1 -26
- package/dist/api/background-tasks.d.ts.map +1 -1
- package/dist/api/background-tasks.js +2 -55
- package/dist/api/background-tasks.js.map +1 -1
- package/dist/api/bell.d.ts +1 -18
- package/dist/api/bell.d.ts.map +1 -1
- package/dist/api/bell.js +2 -33
- package/dist/api/bell.js.map +1 -1
- package/dist/api/code-markers.d.ts +1 -8
- package/dist/api/code-markers.d.ts.map +1 -1
- package/dist/api/code-markers.js +2 -61
- package/dist/api/code-markers.js.map +1 -1
- package/dist/api/complexity.d.ts +1 -2
- package/dist/api/complexity.d.ts.map +1 -1
- package/dist/api/complexity.js +2 -46
- package/dist/api/complexity.js.map +1 -1
- package/dist/api/context.d.ts +1 -37
- package/dist/api/context.d.ts.map +1 -1
- package/dist/api/context.js +2 -143
- package/dist/api/context.js.map +1 -1
- package/dist/api/dead-code.d.ts +1 -2
- package/dist/api/dead-code.d.ts.map +1 -1
- package/dist/api/dead-code.js +2 -69
- package/dist/api/dead-code.js.map +1 -1
- package/dist/api/dependencies.d.ts +1 -2
- package/dist/api/dependencies.d.ts.map +1 -1
- package/dist/api/dependencies.js +2 -42
- package/dist/api/dependencies.js.map +1 -1
- package/dist/api/evaluation.d.ts +1 -19
- package/dist/api/evaluation.d.ts.map +1 -1
- package/dist/api/evaluation.js +2 -127
- package/dist/api/evaluation.js.map +1 -1
- package/dist/api/file-browser.d.ts +1 -8
- package/dist/api/file-browser.d.ts.map +1 -1
- package/dist/api/file-browser.js +2 -114
- package/dist/api/file-browser.js.map +1 -1
- package/dist/api/git.d.ts +1 -46
- package/dist/api/git.d.ts.map +1 -1
- package/dist/api/git.js +2 -354
- package/dist/api/git.js.map +1 -1
- package/dist/api/health-score.d.ts +1 -2
- package/dist/api/health-score.d.ts.map +1 -1
- package/dist/api/health-score.js +2 -46
- package/dist/api/health-score.js.map +1 -1
- package/dist/api/hook-request.d.ts +1 -40
- package/dist/api/hook-request.d.ts.map +1 -1
- package/dist/api/hook-request.js +2 -277
- package/dist/api/hook-request.js.map +1 -1
- package/dist/api/hotspots.d.ts +1 -2
- package/dist/api/hotspots.d.ts.map +1 -1
- package/dist/api/hotspots.js +2 -61
- package/dist/api/hotspots.js.map +1 -1
- package/dist/api/identity.d.ts +1 -16
- package/dist/api/identity.d.ts.map +1 -1
- package/dist/api/identity.js +2 -78
- package/dist/api/identity.js.map +1 -1
- package/dist/api/index.d.ts +1 -34
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +2 -44
- package/dist/api/index.js.map +1 -1
- package/dist/api/mode.d.ts +1 -22
- package/dist/api/mode.d.ts.map +1 -1
- package/dist/api/mode.js +2 -37
- package/dist/api/mode.js.map +1 -1
- package/dist/api/otlp.d.ts +1 -2
- package/dist/api/otlp.d.ts.map +1 -1
- package/dist/api/otlp.js +2 -46
- package/dist/api/otlp.js.map +1 -1
- package/dist/api/permissions.d.ts +1 -15
- package/dist/api/permissions.d.ts.map +1 -1
- package/dist/api/permissions.js +2 -66
- package/dist/api/permissions.js.map +1 -1
- package/dist/api/persona.d.ts +1 -8
- package/dist/api/persona.d.ts.map +1 -1
- package/dist/api/persona.js +2 -67
- package/dist/api/persona.js.map +1 -1
- package/dist/api/portrait.d.ts +1 -5
- package/dist/api/portrait.d.ts.map +1 -1
- package/dist/api/portrait.js +2 -27
- package/dist/api/portrait.js.map +1 -1
- package/dist/api/settings.d.ts +1 -53
- package/dist/api/settings.d.ts.map +1 -1
- package/dist/api/settings.js +2 -464
- package/dist/api/settings.js.map +1 -1
- package/dist/api/spans.d.ts +1 -16
- package/dist/api/spans.d.ts.map +1 -1
- package/dist/api/spans.js +2 -244
- package/dist/api/spans.js.map +1 -1
- package/dist/api/stats.d.ts +1 -12
- package/dist/api/stats.d.ts.map +1 -1
- package/dist/api/stats.js +2 -84
- package/dist/api/stats.js.map +1 -1
- package/dist/api/story.d.ts +1 -2
- package/dist/api/story.d.ts.map +1 -1
- package/dist/api/story.js +2 -14
- package/dist/api/story.js.map +1 -1
- package/dist/api/telemetry.d.ts +1 -18
- package/dist/api/telemetry.d.ts.map +1 -1
- package/dist/api/telemetry.js +2 -164
- package/dist/api/telemetry.js.map +1 -1
- package/dist/api/theme-agents.d.ts +1 -60
- package/dist/api/theme-agents.d.ts.map +1 -1
- package/dist/api/theme-agents.js +2 -213
- package/dist/api/theme-agents.js.map +1 -1
- package/dist/api/todos.d.ts +1 -32
- package/dist/api/todos.d.ts.map +1 -1
- package/dist/api/todos.js +2 -43
- package/dist/api/todos.js.map +1 -1
- package/dist/api/token-stats.d.ts +1 -7
- package/dist/api/token-stats.d.ts.map +1 -1
- package/dist/api/token-stats.js +2 -35
- package/dist/api/token-stats.js.map +1 -1
- package/dist/api/welcome.d.ts +1 -21
- package/dist/api/welcome.d.ts.map +1 -1
- package/dist/api/welcome.js +2 -34
- package/dist/api/welcome.js.map +1 -1
- package/dist/bikerack.js +2 -2
- package/dist/bikerack.js.map +1 -1
- package/dist/env.d.ts +6 -0
- package/dist/env.d.ts.map +1 -0
- package/dist/env.js +10 -0
- package/dist/env.js.map +1 -0
- package/dist/focus.d.ts +53 -0
- package/dist/focus.d.ts.map +1 -0
- package/dist/focus.js +122 -0
- package/dist/focus.js.map +1 -0
- package/dist/git-cache.d.ts +1 -0
- package/dist/git-cache.d.ts.map +1 -1
- package/dist/git-cache.js +3 -1
- package/dist/git-cache.js.map +1 -1
- package/dist/menu-builder.d.ts.map +1 -1
- package/dist/menu-builder.js +0 -1
- package/dist/menu-builder.js.map +1 -1
- package/dist/prime.d.ts +3 -3
- package/dist/prime.d.ts.map +1 -1
- package/dist/prime.js +38 -14
- package/dist/prime.js.map +1 -1
- package/dist/public/css/react.css +1 -1
- package/dist/public/js/react/react.js +53 -61
- package/dist/server.d.ts +18 -85
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +105 -405
- package/dist/server.js.map +1 -1
- package/dist/sprint-data.d.ts +1 -1
- package/dist/sprint-data.d.ts.map +1 -1
- package/dist/sprint-data.js +2 -2
- package/dist/sprint-data.js.map +1 -1
- package/dist/theme-metadata.d.ts +3 -3
- package/dist/theme-metadata.d.ts.map +1 -1
- package/dist/theme-metadata.js +4 -4
- package/dist/theme-metadata.js.map +1 -1
- package/dist/websocket.d.ts +2 -0
- package/dist/websocket.d.ts.map +1 -1
- package/dist/websocket.js +53 -75
- package/dist/websocket.js.map +1 -1
- package/package.json +2 -6
- package/portraits/hogans-heroes/large/burkhalter-35312.png +0 -0
- package/portraits/hogans-heroes/large/carter-34352.png +0 -0
- package/portraits/hogans-heroes/large/hochstetter-45314.png +0 -0
- package/portraits/hogans-heroes/large/hogan-44541.png +0 -0
- package/portraits/hogans-heroes/large/kinch-35241.png +0 -0
- package/portraits/hogans-heroes/large/klink-23434.png +0 -0
- package/portraits/hogans-heroes/large/lebeau-45443.png +0 -0
- package/portraits/hogans-heroes/large/marya-53543.png +0 -0
- package/portraits/hogans-heroes/large/newkirk-54432.png +0 -0
- package/portraits/hogans-heroes/large/schultz-42453.png +0 -0
- package/portraits/hogans-heroes/large/underground-55131.png +0 -0
- package/portraits/hogans-heroes/medium/burkhalter-35312.png +0 -0
- package/portraits/hogans-heroes/medium/carter-34352.png +0 -0
- package/portraits/hogans-heroes/medium/hochstetter-45314.png +0 -0
- package/portraits/hogans-heroes/medium/hogan-44541.png +0 -0
- package/portraits/hogans-heroes/medium/kinch-35241.png +0 -0
- package/portraits/hogans-heroes/medium/klink-23434.png +0 -0
- package/portraits/hogans-heroes/medium/lebeau-45443.png +0 -0
- package/portraits/hogans-heroes/medium/marya-53543.png +0 -0
- package/portraits/hogans-heroes/medium/newkirk-54432.png +0 -0
- package/portraits/hogans-heroes/medium/schultz-42453.png +0 -0
- package/portraits/hogans-heroes/medium/underground-55131.png +0 -0
- package/portraits/monty-python/large/announcer-44441.png +0 -0
- package/portraits/monty-python/large/arguer-35412.png +0 -0
- package/portraits/monty-python/large/bicycle-repair-man-35241.png +0 -0
- package/portraits/monty-python/large/colonel-35423.png +0 -0
- package/portraits/monty-python/large/counsellor-45341.png +0 -0
- package/portraits/monty-python/large/gumbys-23524.png +0 -0
- package/portraits/monty-python/large/nudge-43533.png +0 -0
- package/portraits/monty-python/large/praline-45413.png +0 -0
- package/portraits/monty-python/large/silly-walks-55322.png +0 -0
- package/portraits/monty-python/large/wensleydale-54451.png +0 -0
- package/portraits/monty-python/large/xim-nez-43534.png +0 -0
- package/portraits/monty-python/medium/announcer-44441.png +0 -0
- package/portraits/monty-python/medium/arguer-35412.png +0 -0
- package/portraits/monty-python/medium/bicycle-repair-man-35241.png +0 -0
- package/portraits/monty-python/medium/colonel-35423.png +0 -0
- package/portraits/monty-python/medium/counsellor-45341.png +0 -0
- package/portraits/monty-python/medium/gumbys-23524.png +0 -0
- package/portraits/monty-python/medium/nudge-43533.png +0 -0
- package/portraits/monty-python/medium/praline-45413.png +0 -0
- package/portraits/monty-python/medium/silly-walks-55322.png +0 -0
- package/portraits/monty-python/medium/wensleydale-54451.png +0 -0
- package/portraits/monty-python/medium/xim-nez-43534.png +0 -0
- package/portraits/stephen-king/large/andy-55231.png +0 -0
- package/portraits/stephen-king/large/christine-25112.png +0 -0
- package/portraits/stephen-king/large/danny-53243.png +0 -0
- package/portraits/stephen-king/large/flagg-55311.png +0 -0
- package/portraits/stephen-king/large/gaunt-54421.png +0 -0
- package/portraits/stephen-king/large/jack-44224.png +0 -0
- package/portraits/stephen-king/large/johnny-44353.png +0 -0
- package/portraits/stephen-king/large/margaret-15415.png +0 -0
- package/portraits/stephen-king/large/paul-45233.png +0 -0
- package/portraits/stephen-king/large/pennywise-54411.png +0 -0
- package/portraits/stephen-king/large/roland-35121.png +0 -0
- package/portraits/stephen-king/medium/andy-55231.png +0 -0
- package/portraits/stephen-king/medium/christine-25112.png +0 -0
- package/portraits/stephen-king/medium/danny-53243.png +0 -0
- package/portraits/stephen-king/medium/flagg-55311.png +0 -0
- package/portraits/stephen-king/medium/gaunt-54421.png +0 -0
- package/portraits/stephen-king/medium/jack-44224.png +0 -0
- package/portraits/stephen-king/medium/johnny-44353.png +0 -0
- package/portraits/stephen-king/medium/margaret-15415.png +0 -0
- package/portraits/stephen-king/medium/paul-45233.png +0 -0
- package/portraits/stephen-king/medium/pennywise-54411.png +0 -0
- package/portraits/stephen-king/medium/roland-35121.png +0 -0
- package/portraits/star-trek-tng/large/beverly-44352.png +0 -0
- package/portraits/star-trek-tng/large/data-55241.png +0 -0
- package/portraits/star-trek-tng/large/deanna-43353.png +0 -0
- package/portraits/star-trek-tng/large/geordi-54342.png +0 -0
- package/portraits/star-trek-tng/large/jean-luc-45342.png +0 -0
- package/portraits/star-trek-tng/large/kathryn-45332.png +0 -0
- package/portraits/star-trek-tng/large/miles-35342.png +0 -0
- package/portraits/star-trek-tng/large/q-53521.png +0 -0
- package/portraits/star-trek-tng/large/spock-45231.png +0 -0
- package/portraits/star-trek-tng/large/troi-44352.png +0 -0
- package/portraits/star-trek-tng/medium/beverly-44352.png +0 -0
- package/portraits/star-trek-tng/medium/data-55241.png +0 -0
- package/portraits/star-trek-tng/medium/deanna-43353.png +0 -0
- package/portraits/star-trek-tng/medium/geordi-54342.png +0 -0
- package/portraits/star-trek-tng/medium/jean-luc-45342.png +0 -0
- package/portraits/star-trek-tng/medium/kathryn-45332.png +0 -0
- package/portraits/star-trek-tng/medium/miles-35342.png +0 -0
- package/portraits/star-trek-tng/medium/q-53521.png +0 -0
- package/portraits/star-trek-tng/medium/spock-45231.png +0 -0
- package/portraits/star-trek-tng/medium/troi-44352.png +0 -0
- package/src/public/App.tsx +0 -340
- package/src/public/components/AgentLoadDialog.tsx +0 -202
- package/src/public/components/AgentPopup.tsx +0 -308
- package/src/public/components/ApprovalModal/ApprovalModal.css +0 -35
- package/src/public/components/ApprovalModal/index.tsx +0 -632
- package/src/public/components/BikeRackIndex.tsx +0 -54
- package/src/public/components/BikeRackWorkspace.tsx +0 -142
- package/src/public/components/CommandPalette.tsx +0 -555
- package/src/public/components/ConfirmDialog.tsx +0 -168
- package/src/public/components/ContextIndicator/ContextIndicator.css +0 -85
- package/src/public/components/ContextIndicator/index.tsx +0 -330
- package/src/public/components/ContextSparkline.tsx +0 -56
- package/src/public/components/ControlBar.tsx +0 -636
- package/src/public/components/DeadCodeDialog.tsx +0 -169
- package/src/public/components/DiffViewer.tsx +0 -585
- package/src/public/components/DockviewWorkspace.tsx +0 -737
- package/src/public/components/Editor.tsx +0 -630
- package/src/public/components/ErrorBoundary.tsx +0 -67
- package/src/public/components/FileTree.tsx +0 -379
- package/src/public/components/FontPicker/FontPicker.css +0 -276
- package/src/public/components/FontPicker/index.tsx +0 -430
- package/src/public/components/FullFileTree.tsx +0 -237
- package/src/public/components/HealthGauge.tsx +0 -181
- package/src/public/components/Message.tsx +0 -225
- package/src/public/components/MessageList.tsx +0 -98
- package/src/public/components/MessageView.tsx +0 -400
- package/src/public/components/ModeSwitch/ModeSwitch.css +0 -165
- package/src/public/components/ModeSwitch/index.tsx +0 -372
- package/src/public/components/PersonaHeader.tsx +0 -240
- package/src/public/components/QuickActions.tsx +0 -267
- package/src/public/components/SpanTimeline.tsx +0 -352
- package/src/public/components/StandalonePanel.tsx +0 -84
- package/src/public/components/StatsStrip.tsx +0 -162
- package/src/public/components/StreamingContent.tsx +0 -77
- package/src/public/components/SubagentSpan.tsx +0 -180
- package/src/public/components/TandemPortrait.tsx +0 -72
- package/src/public/components/ThemePalette/ThemePalette.css +0 -179
- package/src/public/components/ThemePalette/index.tsx +0 -326
- package/src/public/components/ToolCallBlock.tsx +0 -252
- package/src/public/components/ToolStack.tsx +0 -209
- package/src/public/components/ToolStatus.tsx +0 -57
- package/src/public/components/dialogs/CodeMarkersDialog.tsx +0 -169
- package/src/public/components/dialogs/ComplexityDialog.tsx +0 -163
- package/src/public/components/dialogs/DependenciesDialog.tsx +0 -120
- package/src/public/components/dialogs/HotspotsDialog.tsx +0 -451
- package/src/public/components/dialogs/ToolDialog.tsx +0 -43
- package/src/public/components/panel-registry.ts +0 -11
- package/src/public/components/panels/ACPanel.tsx +0 -93
- package/src/public/components/panels/AcceptanceCriteriaPanel.tsx +0 -104
- package/src/public/components/panels/AuditLogPanel.tsx +0 -465
- package/src/public/components/panels/BackgroundPanel.tsx +0 -115
- package/src/public/components/panels/BikeLanePanel.tsx +0 -214
- package/src/public/components/panels/ChangedPanel.tsx +0 -65
- package/src/public/components/panels/DebugPanel.tsx +0 -344
- package/src/public/components/panels/DiffsPanel.tsx +0 -155
- package/src/public/components/panels/GitPanel.tsx +0 -216
- package/src/public/components/panels/HotspotsPanel.tsx +0 -365
- package/src/public/components/panels/MessagePanel.tsx +0 -497
- package/src/public/components/panels/SettingsPanel.tsx +0 -453
- package/src/public/components/panels/SprintPanel.tsx +0 -670
- package/src/public/components/panels/TTYPanel.tsx +0 -299
- package/src/public/components/panels/TodoPanel.tsx +0 -142
- package/src/public/components/panels/WorkflowPanel.tsx +0 -224
- package/src/public/components/panels/index.ts +0 -24
- package/src/public/components/ui/alert-dialog.tsx +0 -139
- package/src/public/components/ui/badge.tsx +0 -36
- package/src/public/components/ui/button.tsx +0 -57
- package/src/public/components/ui/checkbox.tsx +0 -28
- package/src/public/components/ui/collapsible.tsx +0 -9
- package/src/public/components/ui/command.tsx +0 -151
- package/src/public/components/ui/dialog.tsx +0 -120
- package/src/public/components/ui/popover.tsx +0 -31
- package/src/public/components/ui/progress.tsx +0 -28
- package/src/public/components/ui/scroll-area.tsx +0 -46
- package/src/public/components/ui/select.tsx +0 -157
- package/src/public/components/ui/separator.tsx +0 -29
- package/src/public/components/ui/skeleton.tsx +0 -15
- package/src/public/components/ui/switch.tsx +0 -27
- package/src/public/components/ui/toggle-group.tsx +0 -59
- package/src/public/components/ui/toggle.tsx +0 -43
- package/src/public/components/ui/tooltip.tsx +0 -30
- package/src/public/contexts/ClaudeContext.tsx +0 -311
- package/src/public/contexts/MessageQueueContext.tsx +0 -143
- package/src/public/css/theme-browser.css +0 -550
- package/src/public/css/theme-system.css +0 -630
- package/src/public/hooks/index.ts +0 -49
- package/src/public/hooks/useAgentLoad.ts +0 -105
- package/src/public/hooks/useBackgroundTasks.ts +0 -131
- package/src/public/hooks/useClaude.ts +0 -234
- package/src/public/hooks/useCodeMarkers.ts +0 -101
- package/src/public/hooks/useColorScheme.ts +0 -42
- package/src/public/hooks/useCommandHistory.ts +0 -99
- package/src/public/hooks/useComplexity.ts +0 -80
- package/src/public/hooks/useDeadCode.ts +0 -99
- package/src/public/hooks/useDependencies.ts +0 -82
- package/src/public/hooks/useDiffs.ts +0 -143
- package/src/public/hooks/useFileBrowser.ts +0 -71
- package/src/public/hooks/useGitStatus.ts +0 -233
- package/src/public/hooks/useHealthScore.ts +0 -69
- package/src/public/hooks/useHotspots.ts +0 -123
- package/src/public/hooks/useLayoutPersistence.ts +0 -138
- package/src/public/hooks/useMarkdownParser.ts +0 -36
- package/src/public/hooks/useMarkerActions.ts +0 -234
- package/src/public/hooks/useMessageQueue.ts +0 -380
- package/src/public/hooks/useMessageStream.ts +0 -131
- package/src/public/hooks/usePersona.ts +0 -112
- package/src/public/hooks/usePlanModeExit.ts +0 -105
- package/src/public/hooks/useResponsiveLayout.ts +0 -173
- package/src/public/hooks/useSprint.ts +0 -147
- package/src/public/hooks/useStatsStrip.ts +0 -204
- package/src/public/hooks/useStory.ts +0 -135
- package/src/public/hooks/useSubagentHelper.ts +0 -64
- package/src/public/hooks/useSyntaxHighlighter.ts +0 -52
- package/src/public/hooks/useTabCompletion.ts +0 -124
- package/src/public/hooks/useTodos.ts +0 -93
- package/src/public/hooks/useUserAvatar.ts +0 -54
- package/src/public/index.tsx +0 -10
- package/src/public/lib/utils.ts +0 -6
- package/src/public/styles/dockview-theme.css +0 -459
- package/src/public/styles/tailwind.css +0 -4396
- package/src/public/types/electron.d.ts +0 -18
- package/src/public/types/message.ts +0 -51
- package/src/public/utils/avatar-service.ts +0 -73
- package/src/public/utils/color-presets.ts +0 -940
- package/src/public/utils/font-presets.ts +0 -362
- package/src/public/utils/formatDuration.ts +0 -14
- package/src/public/utils/markdown.ts +0 -249
- package/src/public/utils/messageFilters.ts +0 -128
- package/src/public/utils/slash-commands.ts +0 -353
- package/src/public/utils/subagent-display.ts +0 -146
- package/src/public/utils/syntax.ts +0 -219
- package/src/public/utils/toolIntentSummarizer.ts +0 -199
- package/src/public/utils/toolStackGrouper.ts +0 -106
- package/src/public/utils/toolTypeColors.ts +0 -45
package/dist/api/agent-load.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-load.d.ts","sourceRoot":"","sources":["../../src/api/agent-load.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agent-load.d.ts","sourceRoot":"","sources":["../../src/api/agent-load.ts"],"names":[],"mappings":"AACA,cAAc,mDAAmD,CAAC"}
|
package/dist/api/agent-load.js
CHANGED
|
@@ -1,124 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { join } from 'node:path';
|
|
4
|
-
import { getPrimeContextJson } from '../prime.js';
|
|
5
|
-
const PRIMARY_AGENTS = [
|
|
6
|
-
'sm', 'tea', 'dev', 'reviewer', 'architect',
|
|
7
|
-
'pm', 'tech-writer', 'ux-designer', 'devops', 'orchestrator', 'ba',
|
|
8
|
-
];
|
|
9
|
-
const VALID_SIDECAR_FILES = ['patterns.md', 'gotchas.md', 'decisions.md'];
|
|
10
|
-
const CACHE_TTL_MS = 60_000;
|
|
11
|
-
const UPPERCASE_SEGMENTS = new Set(['ux']);
|
|
12
|
-
function formatAgentName(agent) {
|
|
13
|
-
return agent.split('-').map((part) => UPPERCASE_SEGMENTS.has(part) ? part.toUpperCase() : part.charAt(0).toUpperCase() + part.slice(1)).join('-');
|
|
14
|
-
}
|
|
15
|
-
export function createAgentLoadRouter(getProjectDir) {
|
|
16
|
-
const router = Router();
|
|
17
|
-
let cache = null;
|
|
18
|
-
let cachedAtMs = 0;
|
|
19
|
-
router.get('/', async (_req, res) => {
|
|
20
|
-
const now = Date.now();
|
|
21
|
-
// Return cached if within TTL
|
|
22
|
-
if (cache && (now - cachedAtMs) < CACHE_TTL_MS) {
|
|
23
|
-
res.json(cache);
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
const projectDir = getProjectDir();
|
|
27
|
-
// Run all agents in parallel
|
|
28
|
-
const results = await Promise.all(PRIMARY_AGENTS.map(async (agent) => {
|
|
29
|
-
try {
|
|
30
|
-
const output = getPrimeContextJson(agent, projectDir, 'FULL');
|
|
31
|
-
if (!output) {
|
|
32
|
-
return {
|
|
33
|
-
agent,
|
|
34
|
-
totalTokens: null,
|
|
35
|
-
error: `Failed to load context for agent "${agent}"`,
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
// Strip context field — never expose full prompt text
|
|
39
|
-
const { context: _context, ...safe } = output;
|
|
40
|
-
return {
|
|
41
|
-
agent,
|
|
42
|
-
totalTokens: safe.totalTokens ?? 0,
|
|
43
|
-
tokenCounts: safe.tokenCounts,
|
|
44
|
-
components: safe.components,
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
catch (err) {
|
|
48
|
-
return {
|
|
49
|
-
agent,
|
|
50
|
-
totalTokens: null,
|
|
51
|
-
error: err instanceof Error ? err.message : `Unknown error for agent "${agent}"`,
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
}));
|
|
55
|
-
// Check if ALL agents failed
|
|
56
|
-
const allFailed = results.every((r) => r.totalTokens === null);
|
|
57
|
-
if (allFailed) {
|
|
58
|
-
res.status(500).json({
|
|
59
|
-
error: 'Failed to load agent context',
|
|
60
|
-
details: 'All agents returned null',
|
|
61
|
-
});
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
const totalAcrossAllAgents = results.reduce((sum, r) => sum + (r.totalTokens ?? 0), 0);
|
|
65
|
-
const response = {
|
|
66
|
-
agents: results,
|
|
67
|
-
cachedAt: new Date(now).toISOString(),
|
|
68
|
-
totalAcrossAllAgents,
|
|
69
|
-
};
|
|
70
|
-
// Store in cache
|
|
71
|
-
cache = response;
|
|
72
|
-
cachedAtMs = now;
|
|
73
|
-
res.json(response);
|
|
74
|
-
});
|
|
75
|
-
router.post('/prune-sidecar', async (req, res) => {
|
|
76
|
-
const { agent, file } = req.body;
|
|
77
|
-
// Validate input
|
|
78
|
-
if (!agent || !PRIMARY_AGENTS.includes(agent)) {
|
|
79
|
-
res.status(400).json({
|
|
80
|
-
success: false,
|
|
81
|
-
error: `Invalid agent. Must be one of: ${PRIMARY_AGENTS.join(', ')}`,
|
|
82
|
-
});
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
if (!file || !VALID_SIDECAR_FILES.includes(file)) {
|
|
86
|
-
res.status(400).json({
|
|
87
|
-
success: false,
|
|
88
|
-
error: `Invalid sidecar file. Must be one of: ${VALID_SIDECAR_FILES.join(', ')}`,
|
|
89
|
-
});
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
const projectDir = getProjectDir();
|
|
93
|
-
const sidecarPath = join(projectDir, '.pennyfarthing', 'sidecars', agent, file);
|
|
94
|
-
// Check sidecar exists
|
|
95
|
-
if (!fs.existsSync(sidecarPath)) {
|
|
96
|
-
res.status(404).json({
|
|
97
|
-
success: false,
|
|
98
|
-
error: `Sidecar file not found: .pennyfarthing/sidecars/${agent}/${file}`,
|
|
99
|
-
});
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
// Read current sidecar content
|
|
103
|
-
const oldContent = fs.readFileSync(sidecarPath, 'utf-8');
|
|
104
|
-
// Read template and substitute agent name
|
|
105
|
-
const templatePath = join(projectDir, 'pennyfarthing-dist', 'templates', 'sidecar', `${file}.template`);
|
|
106
|
-
const template = fs.readFileSync(templatePath, 'utf-8');
|
|
107
|
-
const agentName = formatAgentName(agent);
|
|
108
|
-
const newContent = template.replace(/\$\{AGENT_NAME\}/g, agentName);
|
|
109
|
-
// Write pruned content
|
|
110
|
-
fs.writeFileSync(sidecarPath, newContent, 'utf-8');
|
|
111
|
-
// Invalidate GET cache
|
|
112
|
-
cache = null;
|
|
113
|
-
cachedAtMs = 0;
|
|
114
|
-
const tokensFreed = Math.floor((oldContent.length - newContent.length) / 4);
|
|
115
|
-
res.json({
|
|
116
|
-
success: true,
|
|
117
|
-
tokensFreed,
|
|
118
|
-
agent,
|
|
119
|
-
file,
|
|
120
|
-
});
|
|
121
|
-
});
|
|
122
|
-
return router;
|
|
123
|
-
}
|
|
1
|
+
// Re-export from @pennyfarthing/core (Story 98-17)
|
|
2
|
+
export * from '@pennyfarthing/core/dist/server/api/agent-load.js';
|
|
124
3
|
//# sourceMappingURL=agent-load.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-load.js","sourceRoot":"","sources":["../../src/api/agent-load.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"agent-load.js","sourceRoot":"","sources":["../../src/api/agent-load.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,cAAc,mDAAmD,CAAC"}
|
package/dist/api/audit-log.d.ts
CHANGED
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Audit Log API Router
|
|
3
|
-
*
|
|
4
|
-
* REST API for tool execution audit log with filtering, stats, and export.
|
|
5
|
-
*
|
|
6
|
-
* Endpoints:
|
|
7
|
-
* - GET /api/audit-log - List all tool events (with filtering and pagination)
|
|
8
|
-
* - GET /api/audit-log/types - Get unique tool types
|
|
9
|
-
* - GET /api/audit-log/stats - Get audit log statistics
|
|
10
|
-
* - GET /api/audit-log/export - Export as JSON or CSV
|
|
11
|
-
* - DELETE /api/audit-log - Clear the audit log
|
|
12
|
-
*/
|
|
13
|
-
import { Router } from 'express';
|
|
14
|
-
/**
|
|
15
|
-
* Create audit log API router
|
|
16
|
-
*/
|
|
17
|
-
export declare function createAuditLogRouter(): Router;
|
|
1
|
+
export * from '@pennyfarthing/core/dist/server/api/audit-log.js';
|
|
18
2
|
//# sourceMappingURL=audit-log.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit-log.d.ts","sourceRoot":"","sources":["../../src/api/audit-log.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"audit-log.d.ts","sourceRoot":"","sources":["../../src/api/audit-log.ts"],"names":[],"mappings":"AACA,cAAc,kDAAkD,CAAC"}
|
package/dist/api/audit-log.js
CHANGED
|
@@ -1,163 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* REST API for tool execution audit log with filtering, stats, and export.
|
|
5
|
-
*
|
|
6
|
-
* Endpoints:
|
|
7
|
-
* - GET /api/audit-log - List all tool events (with filtering and pagination)
|
|
8
|
-
* - GET /api/audit-log/types - Get unique tool types
|
|
9
|
-
* - GET /api/audit-log/stats - Get audit log statistics
|
|
10
|
-
* - GET /api/audit-log/export - Export as JSON or CSV
|
|
11
|
-
* - DELETE /api/audit-log - Clear the audit log
|
|
12
|
-
*/
|
|
13
|
-
import { Router } from 'express';
|
|
14
|
-
import { getToolEventsFiltered, getToolTypes, getAuditLogStats, exportAuditLogAsJSON, exportAuditLogAsCSV, resetEventStore, } from '../otlp-receiver.js';
|
|
15
|
-
// =============================================================================
|
|
16
|
-
// Constants
|
|
17
|
-
// =============================================================================
|
|
18
|
-
const DEFAULT_LIMIT = 100;
|
|
19
|
-
const MAX_LIMIT = 1000;
|
|
20
|
-
// =============================================================================
|
|
21
|
-
// Router Factory
|
|
22
|
-
// =============================================================================
|
|
23
|
-
/**
|
|
24
|
-
* Create audit log API router
|
|
25
|
-
*/
|
|
26
|
-
export function createAuditLogRouter() {
|
|
27
|
-
const router = Router();
|
|
28
|
-
/**
|
|
29
|
-
* GET /api/audit-log
|
|
30
|
-
*
|
|
31
|
-
* Returns list of tool events with filtering and pagination.
|
|
32
|
-
*
|
|
33
|
-
* Query parameters:
|
|
34
|
-
* - toolType: Filter by tool type (e.g., "Bash", "Read")
|
|
35
|
-
* - status: Filter by status ("success" or "error")
|
|
36
|
-
* - offset: Pagination offset (default: 0)
|
|
37
|
-
* - limit: Pagination limit (default: 100, max: 1000)
|
|
38
|
-
*/
|
|
39
|
-
router.get('/', (req, res) => {
|
|
40
|
-
try {
|
|
41
|
-
const toolType = req.query.toolType;
|
|
42
|
-
const status = req.query.status;
|
|
43
|
-
// Get events (optionally filtered by tool type)
|
|
44
|
-
let events = getToolEventsFiltered(toolType);
|
|
45
|
-
// Filter by status if specified
|
|
46
|
-
if (status === 'success') {
|
|
47
|
-
events = events.filter(e => e.success);
|
|
48
|
-
}
|
|
49
|
-
else if (status === 'error') {
|
|
50
|
-
events = events.filter(e => !e.success);
|
|
51
|
-
}
|
|
52
|
-
// Parse pagination
|
|
53
|
-
let offset = 0;
|
|
54
|
-
let limit = DEFAULT_LIMIT;
|
|
55
|
-
if (req.query.offset !== undefined) {
|
|
56
|
-
offset = Math.max(0, Number(req.query.offset) || 0);
|
|
57
|
-
}
|
|
58
|
-
if (req.query.limit !== undefined) {
|
|
59
|
-
limit = Math.min(MAX_LIMIT, Math.max(1, Number(req.query.limit) || DEFAULT_LIMIT));
|
|
60
|
-
}
|
|
61
|
-
// Apply pagination (newest first)
|
|
62
|
-
const sorted = [...events].reverse();
|
|
63
|
-
const paginated = sorted.slice(offset, offset + limit);
|
|
64
|
-
res.json({
|
|
65
|
-
entries: paginated,
|
|
66
|
-
total: events.length,
|
|
67
|
-
offset,
|
|
68
|
-
limit,
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
catch (error) {
|
|
72
|
-
console.error('[AuditLog API] Error fetching entries:', error);
|
|
73
|
-
res.status(500).json({ error: 'Internal server error' });
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
/**
|
|
77
|
-
* GET /api/audit-log/types
|
|
78
|
-
*
|
|
79
|
-
* Returns list of unique tool types in the audit log.
|
|
80
|
-
*/
|
|
81
|
-
router.get('/types', (_req, res) => {
|
|
82
|
-
try {
|
|
83
|
-
const types = getToolTypes();
|
|
84
|
-
res.json({ types });
|
|
85
|
-
}
|
|
86
|
-
catch (error) {
|
|
87
|
-
console.error('[AuditLog API] Error fetching types:', error);
|
|
88
|
-
res.status(500).json({ error: 'Internal server error' });
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
/**
|
|
92
|
-
* GET /api/audit-log/stats
|
|
93
|
-
*
|
|
94
|
-
* Returns summary statistics for the audit log.
|
|
95
|
-
*/
|
|
96
|
-
router.get('/stats', (_req, res) => {
|
|
97
|
-
try {
|
|
98
|
-
const stats = getAuditLogStats();
|
|
99
|
-
res.json(stats);
|
|
100
|
-
}
|
|
101
|
-
catch (error) {
|
|
102
|
-
console.error('[AuditLog API] Error fetching stats:', error);
|
|
103
|
-
res.status(500).json({ error: 'Internal server error' });
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
/**
|
|
107
|
-
* GET /api/audit-log/export
|
|
108
|
-
*
|
|
109
|
-
* Export audit log as JSON or CSV.
|
|
110
|
-
*
|
|
111
|
-
* Query parameters:
|
|
112
|
-
* - format: "json" (default) or "csv"
|
|
113
|
-
* - toolType: Optional filter by tool type
|
|
114
|
-
* - download: If "true", sets Content-Disposition header
|
|
115
|
-
*/
|
|
116
|
-
router.get('/export', (req, res) => {
|
|
117
|
-
try {
|
|
118
|
-
const format = req.query.format || 'json';
|
|
119
|
-
const toolType = req.query.toolType;
|
|
120
|
-
const download = req.query.download === 'true';
|
|
121
|
-
let content;
|
|
122
|
-
let contentType;
|
|
123
|
-
let extension;
|
|
124
|
-
if (format === 'csv') {
|
|
125
|
-
content = exportAuditLogAsCSV(toolType);
|
|
126
|
-
contentType = 'text/csv';
|
|
127
|
-
extension = 'csv';
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
content = exportAuditLogAsJSON(toolType);
|
|
131
|
-
contentType = 'application/json';
|
|
132
|
-
extension = 'json';
|
|
133
|
-
}
|
|
134
|
-
if (download) {
|
|
135
|
-
const filename = `cyclist-audit-log-${new Date().toISOString().replace(/[:.]/g, '-')}.${extension}`;
|
|
136
|
-
res.setHeader('Content-Disposition', `attachment; filename="${filename}"`);
|
|
137
|
-
}
|
|
138
|
-
res.setHeader('Content-Type', contentType);
|
|
139
|
-
res.send(content);
|
|
140
|
-
}
|
|
141
|
-
catch (error) {
|
|
142
|
-
console.error('[AuditLog API] Error exporting:', error);
|
|
143
|
-
res.status(500).json({ error: 'Internal server error' });
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
/**
|
|
147
|
-
* DELETE /api/audit-log
|
|
148
|
-
*
|
|
149
|
-
* Clear the audit log.
|
|
150
|
-
*/
|
|
151
|
-
router.delete('/', (_req, res) => {
|
|
152
|
-
try {
|
|
153
|
-
resetEventStore();
|
|
154
|
-
res.json({ success: true });
|
|
155
|
-
}
|
|
156
|
-
catch (error) {
|
|
157
|
-
console.error('[AuditLog API] Error clearing:', error);
|
|
158
|
-
res.status(500).json({ error: 'Internal server error' });
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
return router;
|
|
162
|
-
}
|
|
1
|
+
// Re-export from @pennyfarthing/core (Story 98-17)
|
|
2
|
+
export * from '@pennyfarthing/core/dist/server/api/audit-log.js';
|
|
163
3
|
//# sourceMappingURL=audit-log.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit-log.js","sourceRoot":"","sources":["../../src/api/audit-log.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"audit-log.js","sourceRoot":"","sources":["../../src/api/audit-log.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,cAAc,kDAAkD,CAAC"}
|
|
@@ -1,27 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Background Tasks API (Story 35-16)
|
|
3
|
-
*
|
|
4
|
-
* REST endpoint for querying tracked background tasks.
|
|
5
|
-
* Integrates with otlp-receiver's background task tracking.
|
|
6
|
-
*/
|
|
7
|
-
import { Router } from 'express';
|
|
8
|
-
import { WebSocket } from 'ws';
|
|
9
|
-
import { BackgroundTask } from '../otlp-receiver.js';
|
|
10
|
-
/**
|
|
11
|
-
* Get background task WebSocket clients set
|
|
12
|
-
*/
|
|
13
|
-
export declare function getBackgroundTaskClients(): Set<WebSocket>;
|
|
14
|
-
/**
|
|
15
|
-
* Broadcast task event to all connected WebSocket clients
|
|
16
|
-
*/
|
|
17
|
-
export declare function broadcastBackgroundTaskEvent(type: 'task:started' | 'task:completed', task: BackgroundTask): void;
|
|
18
|
-
/**
|
|
19
|
-
* Initialize WebSocket broadcasts for background task events
|
|
20
|
-
* Call this after setting up the WebSocket server
|
|
21
|
-
*/
|
|
22
|
-
export declare function initBackgroundTaskBroadcast(): void;
|
|
23
|
-
/**
|
|
24
|
-
* Create Express router for background tasks API
|
|
25
|
-
*/
|
|
26
|
-
export declare function createBackgroundTasksRouter(): Router;
|
|
1
|
+
export * from '@pennyfarthing/core/dist/server/api/background-tasks.js';
|
|
27
2
|
//# sourceMappingURL=background-tasks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"background-tasks.d.ts","sourceRoot":"","sources":["../../src/api/background-tasks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"background-tasks.d.ts","sourceRoot":"","sources":["../../src/api/background-tasks.ts"],"names":[],"mappings":"AACA,cAAc,yDAAyD,CAAC"}
|
|
@@ -1,56 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* REST endpoint for querying tracked background tasks.
|
|
5
|
-
* Integrates with otlp-receiver's background task tracking.
|
|
6
|
-
*/
|
|
7
|
-
import { Router } from 'express';
|
|
8
|
-
import { WebSocket } from 'ws';
|
|
9
|
-
import { getBackgroundTasks, setBackgroundTaskStartCallback, setBackgroundTaskCallback } from '../otlp-receiver.js';
|
|
10
|
-
// WebSocket clients for real-time updates
|
|
11
|
-
const backgroundTaskClients = new Set();
|
|
12
|
-
/**
|
|
13
|
-
* Get background task WebSocket clients set
|
|
14
|
-
*/
|
|
15
|
-
export function getBackgroundTaskClients() {
|
|
16
|
-
return backgroundTaskClients;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Broadcast task event to all connected WebSocket clients
|
|
20
|
-
*/
|
|
21
|
-
export function broadcastBackgroundTaskEvent(type, task) {
|
|
22
|
-
const message = JSON.stringify({ type, task });
|
|
23
|
-
for (const client of backgroundTaskClients) {
|
|
24
|
-
if (client.readyState === WebSocket.OPEN) {
|
|
25
|
-
client.send(message);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Initialize WebSocket broadcasts for background task events
|
|
31
|
-
* Call this after setting up the WebSocket server
|
|
32
|
-
*/
|
|
33
|
-
export function initBackgroundTaskBroadcast() {
|
|
34
|
-
setBackgroundTaskStartCallback((task) => {
|
|
35
|
-
broadcastBackgroundTaskEvent('task:started', task);
|
|
36
|
-
});
|
|
37
|
-
setBackgroundTaskCallback((task) => {
|
|
38
|
-
broadcastBackgroundTaskEvent('task:completed', task);
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Create Express router for background tasks API
|
|
43
|
-
*/
|
|
44
|
-
export function createBackgroundTasksRouter() {
|
|
45
|
-
const router = Router();
|
|
46
|
-
/**
|
|
47
|
-
* GET /api/background-tasks
|
|
48
|
-
* Returns list of all tracked background tasks
|
|
49
|
-
*/
|
|
50
|
-
router.get('/', (_req, res) => {
|
|
51
|
-
const tasks = getBackgroundTasks();
|
|
52
|
-
res.json({ tasks });
|
|
53
|
-
});
|
|
54
|
-
return router;
|
|
55
|
-
}
|
|
1
|
+
// Re-export from @pennyfarthing/core (Story 98-17)
|
|
2
|
+
export * from '@pennyfarthing/core/dist/server/api/background-tasks.js';
|
|
56
3
|
//# sourceMappingURL=background-tasks.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"background-tasks.js","sourceRoot":"","sources":["../../src/api/background-tasks.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"background-tasks.js","sourceRoot":"","sources":["../../src/api/background-tasks.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,cAAc,yDAAyD,CAAC"}
|
package/dist/api/bell.d.ts
CHANGED
|
@@ -1,19 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Bell Mode API - WebSocket broadcast for message consumption
|
|
3
|
-
*
|
|
4
|
-
* When the PostToolUse hook consumes a queued message, it calls /api/bell-consumed.
|
|
5
|
-
* This module broadcasts to connected browsers so they can:
|
|
6
|
-
* 1. Dequeue the message from in-memory queue
|
|
7
|
-
* 2. Display the injected message in the conversation stream
|
|
8
|
-
*/
|
|
9
|
-
import { WebSocket } from 'ws';
|
|
10
|
-
/**
|
|
11
|
-
* Get bell clients set (for WebSocket setup)
|
|
12
|
-
*/
|
|
13
|
-
export declare function getBellClients(): Set<WebSocket>;
|
|
14
|
-
/**
|
|
15
|
-
* Broadcast bell consumed event to all connected browsers
|
|
16
|
-
* @param text - The message text that was injected into Claude's context
|
|
17
|
-
*/
|
|
18
|
-
export declare function broadcastBellConsumed(text: string): void;
|
|
1
|
+
export * from '@pennyfarthing/core/dist/server/api/bell.js';
|
|
19
2
|
//# sourceMappingURL=bell.d.ts.map
|
package/dist/api/bell.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bell.d.ts","sourceRoot":"","sources":["../../src/api/bell.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bell.d.ts","sourceRoot":"","sources":["../../src/api/bell.ts"],"names":[],"mappings":"AACA,cAAc,6CAA6C,CAAC"}
|
package/dist/api/bell.js
CHANGED
|
@@ -1,34 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* When the PostToolUse hook consumes a queued message, it calls /api/bell-consumed.
|
|
5
|
-
* This module broadcasts to connected browsers so they can:
|
|
6
|
-
* 1. Dequeue the message from in-memory queue
|
|
7
|
-
* 2. Display the injected message in the conversation stream
|
|
8
|
-
*/
|
|
9
|
-
import { WebSocket } from 'ws';
|
|
10
|
-
// Bell WebSocket clients
|
|
11
|
-
const bellClients = new Set();
|
|
12
|
-
/**
|
|
13
|
-
* Get bell clients set (for WebSocket setup)
|
|
14
|
-
*/
|
|
15
|
-
export function getBellClients() {
|
|
16
|
-
return bellClients;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Broadcast bell consumed event to all connected browsers
|
|
20
|
-
* @param text - The message text that was injected into Claude's context
|
|
21
|
-
*/
|
|
22
|
-
export function broadcastBellConsumed(text) {
|
|
23
|
-
const message = JSON.stringify({
|
|
24
|
-
type: 'bell-consumed',
|
|
25
|
-
text,
|
|
26
|
-
timestamp: Date.now(),
|
|
27
|
-
});
|
|
28
|
-
for (const client of bellClients) {
|
|
29
|
-
if (client.readyState === WebSocket.OPEN) {
|
|
30
|
-
client.send(message);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
1
|
+
// Re-export from @pennyfarthing/core (Story 98-17)
|
|
2
|
+
export * from '@pennyfarthing/core/dist/server/api/bell.js';
|
|
34
3
|
//# sourceMappingURL=bell.js.map
|
package/dist/api/bell.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bell.js","sourceRoot":"","sources":["../../src/api/bell.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"bell.js","sourceRoot":"","sources":["../../src/api/bell.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,cAAc,6CAA6C,CAAC"}
|
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Code Markers API route — Story 80-3 (MSSCI-14456)
|
|
3
|
-
*
|
|
4
|
-
* GET /api/code-markers?repo=pennyfarthing&days=90&type=all|stale|deprecated
|
|
5
|
-
* Thin wrapper calling Python codemarkers module via execFile.
|
|
6
|
-
*/
|
|
7
|
-
import { Router } from 'express';
|
|
8
|
-
export declare function createCodeMarkersRouter(getProjectDir: () => string): Router;
|
|
1
|
+
export * from '@pennyfarthing/core/dist/server/api/code-markers.js';
|
|
9
2
|
//# sourceMappingURL=code-markers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-markers.d.ts","sourceRoot":"","sources":["../../src/api/code-markers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"code-markers.d.ts","sourceRoot":"","sources":["../../src/api/code-markers.ts"],"names":[],"mappings":"AACA,cAAc,qDAAqD,CAAC"}
|
package/dist/api/code-markers.js
CHANGED
|
@@ -1,62 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* GET /api/code-markers?repo=pennyfarthing&days=90&type=all|stale|deprecated
|
|
5
|
-
* Thin wrapper calling Python codemarkers module via execFile.
|
|
6
|
-
*/
|
|
7
|
-
import { Router } from 'express';
|
|
8
|
-
import { execFile } from 'child_process';
|
|
9
|
-
import { join } from 'path';
|
|
10
|
-
export function createCodeMarkersRouter(getProjectDir) {
|
|
11
|
-
const router = Router();
|
|
12
|
-
router.get('/', (req, res) => {
|
|
13
|
-
const projectDir = getProjectDir();
|
|
14
|
-
const days = String(req.query.days || '90');
|
|
15
|
-
const repo = req.query.repo;
|
|
16
|
-
const type = req.query.type;
|
|
17
|
-
const args = [
|
|
18
|
-
'-m', 'pennyfarthing_scripts.codemarkers',
|
|
19
|
-
'analyze',
|
|
20
|
-
'--format', 'json',
|
|
21
|
-
'--days', days,
|
|
22
|
-
];
|
|
23
|
-
if (repo) {
|
|
24
|
-
args.push('--repo', repo);
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
args.push('--path', projectDir);
|
|
28
|
-
}
|
|
29
|
-
if (type) {
|
|
30
|
-
args.push('--type', type);
|
|
31
|
-
}
|
|
32
|
-
const pythonPath = join(projectDir, 'pennyfarthing');
|
|
33
|
-
execFile('python3', args, {
|
|
34
|
-
cwd: pythonPath,
|
|
35
|
-
env: { ...process.env, PYTHONPATH: pythonPath },
|
|
36
|
-
timeout: 30000,
|
|
37
|
-
maxBuffer: 10 * 1024 * 1024,
|
|
38
|
-
}, (err, stdout, stderr) => {
|
|
39
|
-
if (err) {
|
|
40
|
-
console.error('[CodeMarkers] Analysis failed:', stderr || err.message);
|
|
41
|
-
res.status(500).json({
|
|
42
|
-
success: false,
|
|
43
|
-
error: stderr || err.message,
|
|
44
|
-
});
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
try {
|
|
48
|
-
const data = JSON.parse(stdout);
|
|
49
|
-
res.json(data);
|
|
50
|
-
}
|
|
51
|
-
catch (parseErr) {
|
|
52
|
-
console.error('[CodeMarkers] JSON parse failed:', parseErr);
|
|
53
|
-
res.status(500).json({
|
|
54
|
-
success: false,
|
|
55
|
-
error: 'Failed to parse code markers analysis output',
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
return router;
|
|
61
|
-
}
|
|
1
|
+
// Re-export from @pennyfarthing/core (Story 98-17)
|
|
2
|
+
export * from '@pennyfarthing/core/dist/server/api/code-markers.js';
|
|
62
3
|
//# sourceMappingURL=code-markers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-markers.js","sourceRoot":"","sources":["../../src/api/code-markers.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"code-markers.js","sourceRoot":"","sources":["../../src/api/code-markers.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,cAAc,qDAAqD,CAAC"}
|
package/dist/api/complexity.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"complexity.d.ts","sourceRoot":"","sources":["../../src/api/complexity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"complexity.d.ts","sourceRoot":"","sources":["../../src/api/complexity.ts"],"names":[],"mappings":"AACA,cAAc,mDAAmD,CAAC"}
|