@winspan/claude-forge 8.51.1 → 8.54.3
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/DEVELOPMENT.md +290 -221
- package/README.md +50 -8
- package/dist/cli/commands/skills.d.ts.map +1 -1
- package/dist/cli/commands/skills.js +121 -2
- package/dist/cli/commands/skills.js.map +1 -1
- package/dist/cli/init/hook-manager.d.ts +1 -1
- package/dist/cli/init/hook-manager.d.ts.map +1 -1
- package/dist/cli/init/hook-manager.js +1 -0
- package/dist/cli/init/hook-manager.js.map +1 -1
- package/dist/core/constants.d.ts +2 -0
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/core/constants.js +4 -0
- package/dist/core/constants.js.map +1 -1
- package/dist/core/storage/events.d.ts.map +1 -1
- package/dist/core/storage/events.js +0 -1
- package/dist/core/storage/events.js.map +1 -1
- package/dist/core/storage/maintenance.d.ts +25 -3
- package/dist/core/storage/maintenance.d.ts.map +1 -1
- package/dist/core/storage/maintenance.js +33 -4
- package/dist/core/storage/maintenance.js.map +1 -1
- package/dist/core/storage/routing.d.ts +4 -0
- package/dist/core/storage/routing.d.ts.map +1 -1
- package/dist/core/storage/routing.js +10 -4
- package/dist/core/storage/routing.js.map +1 -1
- package/dist/core/storage/sessions.d.ts +17 -0
- package/dist/core/storage/sessions.d.ts.map +1 -1
- package/dist/core/storage/sessions.js +64 -0
- package/dist/core/storage/sessions.js.map +1 -1
- package/dist/core/storage/skills.d.ts +4 -0
- package/dist/core/storage/skills.d.ts.map +1 -1
- package/dist/core/storage/skills.js +10 -2
- package/dist/core/storage/skills.js.map +1 -1
- package/dist/core/storage/sqlite.d.ts +5 -0
- package/dist/core/storage/sqlite.d.ts.map +1 -1
- package/dist/core/storage/sqlite.js +6 -0
- package/dist/core/storage/sqlite.js.map +1 -1
- package/dist/core/storage/tasks.d.ts.map +1 -1
- package/dist/core/storage/tasks.js +2 -0
- package/dist/core/storage/tasks.js.map +1 -1
- package/dist/core/types.d.ts +7 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/daemon/index.d.ts.map +1 -1
- package/dist/daemon/index.js +30 -5
- package/dist/daemon/index.js.map +1 -1
- package/dist/daemon/skill-sync.d.ts +21 -0
- package/dist/daemon/skill-sync.d.ts.map +1 -0
- package/dist/daemon/skill-sync.js +75 -0
- package/dist/daemon/skill-sync.js.map +1 -0
- package/dist/hooks/notification.sh +1 -1
- package/dist/hooks/post-tool-use.sh +1 -1
- package/dist/hooks/pre-tool-use.sh +1 -1
- package/dist/hooks/stop.sh +1 -1
- package/dist/hooks/user-prompt-submit.sh +1 -1
- package/dist/skills/official/code-simplifier.md +37 -1
- package/dist/skills/official/find-skills.md +120 -1
- package/dist/skills/official/official-api-design.md +14 -1
- package/dist/skills/official/official-architecture-decision.md +22 -1
- package/dist/skills/official/official-db-schema-design.md +19 -1
- package/dist/skills/official/official-debug.md +9 -1
- package/dist/skills/official/official-pr-review.md +1 -1
- package/dist/skills/official/official-security-hardening.md +7 -1
- package/dist/skills/official/planning-with-files.md +206 -2
- package/dist/skills/official/ui-ux-pro-max.md +88 -1
- package/dist/skills/official/webapp-testing.md +85 -1
- package/dist/skills/registry.d.ts +1 -1
- package/dist/skills/registry.d.ts.map +1 -1
- package/dist/skills/registry.js +15 -4
- package/dist/skills/registry.js.map +1 -1
- package/dist/skills/semantic-matcher.d.ts +4 -3
- package/dist/skills/semantic-matcher.d.ts.map +1 -1
- package/dist/skills/semantic-matcher.js +20 -22
- package/dist/skills/semantic-matcher.js.map +1 -1
- package/dist/skills/upgrade-engine.d.ts +93 -0
- package/dist/skills/upgrade-engine.d.ts.map +1 -0
- package/dist/skills/upgrade-engine.js +447 -0
- package/dist/skills/upgrade-engine.js.map +1 -0
- package/dist/skills/upgrade-prompt.d.ts +20 -0
- package/dist/skills/upgrade-prompt.d.ts.map +1 -0
- package/dist/skills/upgrade-prompt.js +75 -0
- package/dist/skills/upgrade-prompt.js.map +1 -0
- package/dist/web/analytics/weekly-report.d.ts.map +1 -1
- package/dist/web/analytics/weekly-report.js +21 -29
- package/dist/web/analytics/weekly-report.js.map +1 -1
- package/dist/web/routes/patch.d.ts.map +1 -1
- package/dist/web/routes/patch.js +32 -2
- package/dist/web/routes/patch.js.map +1 -1
- package/dist/web/routes/sessions.d.ts.map +1 -1
- package/dist/web/routes/sessions.js +9 -7
- package/dist/web/routes/sessions.js.map +1 -1
- package/dist/web/routes/trace.d.ts.map +1 -1
- package/dist/web/routes/trace.js +2 -3
- package/dist/web/routes/trace.js.map +1 -1
- package/dist/web/server.d.ts.map +1 -1
- package/dist/web/server.js +3 -2
- package/dist/web/server.js.map +1 -1
- package/package.json +12 -2
- package/scripts/postinstall.cjs +21 -0
- package/.claude/CLAUDE.md +0 -17
- package/.eslintrc.js +0 -23
- package/.prettierrc +0 -8
- package/ARCHITECTURE_ISSUES.md +0 -249
- package/CLAUDE.md +0 -265
- package/CLAUDE.md.backup +0 -488
- package/docs/concurrent-agents.md +0 -129
- package/docs/design/architecture-review-20260516.md +0 -232
- package/docs/design/fix-skills-data-and-set-leak-spec-20260516-1300.md +0 -219
- package/docs/design/h1-storage-aggregation-spec-20260518-1121.md +0 -299
- package/docs/design/h2-getdatabase-encapsulation-spec-20260518-1450.md +0 -191
- package/docs/design/h3-fallback-removal-spec-20260518-1245.md +0 -76
- package/docs/design/h4-index-dedup-spec-20260518-1230.md +0 -109
- package/docs/design/h6-services-migration-spec-20260518-1355.md +0 -82
- package/docs/design/hook-failure-queue-spec-20260516-1530.md +0 -204
- package/docs/design/l1-swarm-protocol-extract-spec-20260518-1605.md +0 -106
- package/docs/design/m10-forge-paths-spec-20260518-1320.md +0 -121
- package/docs/design/m2-m3-tool-input-spec-20260518-1425.md +0 -131
- package/docs/design/m7-routing-event-association-spec-20260518-1545.md +0 -103
- package/docs/design/project-path-gitroot-spec-20260518-1715.md +0 -134
- package/docs/design/refactor-phase1-spec-20260515-1600.md +0 -543
- package/docs/design/refactor-phase2-spec-20260515-1700.md +0 -424
- package/docs/design/task-active-gc-spec-20260518-1745.md +0 -146
- package/docs/design/tasks-list-filter-pagination-spec-20260518-0930.md +0 -208
- package/docs/implementation/fix-skills-data-and-set-leak-changelog-20260516-1300.md +0 -104
- package/docs/implementation/h1-storage-aggregation-changelog-20260518-1121.md +0 -82
- package/docs/implementation/h2-final-changelog-20260518-1530.md +0 -61
- package/docs/implementation/h2-phase1-safety-net-changelog-20260518-1450.md +0 -70
- package/docs/implementation/h2-phase2-operations-changelog-20260518-1450.md +0 -120
- package/docs/implementation/h2-phase3-callsites-changelog-20260518-1450.md +0 -71
- package/docs/implementation/h3-fallback-removal-changelog-20260518-1245.md +0 -71
- package/docs/implementation/h4-index-dedup-changelog-20260518-1230.md +0 -60
- package/docs/implementation/h6-services-migration-changelog-20260518-1355.md +0 -46
- package/docs/implementation/h7-m9-defaults-changelog-20260518-1300.md +0 -46
- package/docs/implementation/hook-failure-queue-changelog-20260516-1530.md +0 -196
- package/docs/implementation/hotfix-daemon-event-reject-20260516-1430.md +0 -56
- package/docs/implementation/l1-swarm-protocol-extract-changelog-20260518-1605.md +0 -45
- package/docs/implementation/l3-l4-daemon-perf-changelog-20260518-1410.md +0 -63
- package/docs/implementation/l6-l8-final-cleanup-changelog-20260518-1640.md +0 -38
- package/docs/implementation/m1-m4-m5-l7-cleanup-changelog-20260518-1310.md +0 -58
- package/docs/implementation/m10-forge-paths-changelog-20260518-1320.md +0 -60
- package/docs/implementation/m2-m3-tool-input-changelog-20260518-1425.md +0 -43
- package/docs/implementation/m6-m8-naming-shutdown-changelog-20260518-1340.md +0 -56
- package/docs/implementation/m7-routing-association-changelog-20260518-1545.md +0 -69
- package/docs/implementation/project-path-gitroot-changelog-20260518-1715.md +0 -63
- package/docs/implementation/refactor-phase1-changelog-20260515-1630.md +0 -354
- package/docs/implementation/refactor-phase2-changelog-20260515-1705.md +0 -421
- package/docs/implementation/task-active-gc-changelog-20260518-1745.md +0 -35
- package/docs/implementation/task-title-summary-changelog-20260518-1130.md +0 -39
- package/docs/implementation/tasks-detail-back-loses-filters-changelog-20260518-1100.md +0 -22
- package/docs/implementation/tasks-list-filter-pagination-changelog-20260518-0930.md +0 -72
- package/docs/implementation/tasks-page-white-screen-hotfix-changelog-20260518-1015.md +0 -56
- package/docs/reviews/claudemd-template-sync.md +0 -54
- package/docs/reviews/task-title-summary.md +0 -92
- package/docs/reviews/tasks-detail-back-loses-filters.md +0 -58
- package/docs/reviews/tasks-filter-pagination.md +0 -80
- package/docs/reviews/tasks-page-white-screen-hotfix.md +0 -126
- package/docs/ruflo-learning-strategy.md +0 -322
- package/docs/skills-deduplication-analysis.md +0 -83
- package/docs/skills-multiformat-support.md +0 -177
- package/docs/skills-third-party.md +0 -183
- package/docs/testing/tasks-filter-pagination-test-report.md +0 -86
- package/forge +0 -321
- package/playwright.config.ts +0 -40
- package/scripts/demo-v2.ts +0 -91
- package/scripts/dev-daemon.sh +0 -232
- package/scripts/dev-web.ts +0 -109
- package/scripts/e2e-mcp-link.ts +0 -423
- package/scripts/e2e-methodology-quality.ts +0 -253
- package/scripts/e2e-routing.ts +0 -456
- package/scripts/e2e-user-methodology.ts +0 -326
- package/scripts/e2e-web-workflows.ts +0 -299
- package/scripts/migrate-legacy-to-dynamic.sql +0 -108
- package/scripts/regenerate-execution-docs.ts +0 -116
- package/scripts/sync-agent-skills.ts +0 -193
- package/scripts/test-hook.sh +0 -71
- package/scripts/verify-skill-loading.ts +0 -62
- package/src/claudemd/claudemd-generator.ts +0 -568
- package/src/claudemd/convention-extractor.ts +0 -69
- package/src/claudemd/index.ts +0 -35
- package/src/claudemd/persona-manager.ts +0 -88
- package/src/claudemd/resume-manager.ts +0 -236
- package/src/claudemd/tech-detector.ts +0 -220
- package/src/claudemd/templates/swarm-protocol.md +0 -222
- package/src/cli/commands/claudemd.ts +0 -84
- package/src/cli/commands/config.ts +0 -46
- package/src/cli/commands/daemon.ts +0 -310
- package/src/cli/commands/executions.ts +0 -115
- package/src/cli/commands/init.ts +0 -204
- package/src/cli/commands/logs.ts +0 -181
- package/src/cli/commands/mcp.ts +0 -242
- package/src/cli/commands/menu.ts +0 -357
- package/src/cli/commands/skills.ts +0 -185
- package/src/cli/commands/stats.ts +0 -73
- package/src/cli/commands/status.ts +0 -69
- package/src/cli/commands/template.ts +0 -77
- package/src/cli/commands/trace.ts +0 -148
- package/src/cli/index.ts +0 -42
- package/src/cli/init/hook-manager.ts +0 -132
- package/src/core/ai/provider.ts +0 -308
- package/src/core/ai/types.ts +0 -51
- package/src/core/config.ts +0 -124
- package/src/core/constants.ts +0 -62
- package/src/core/event-fields.ts +0 -32
- package/src/core/queue/index.ts +0 -192
- package/src/core/storage/base.ts +0 -302
- package/src/core/storage/events.ts +0 -434
- package/src/core/storage/injections.ts +0 -78
- package/src/core/storage/maintenance.ts +0 -59
- package/src/core/storage/migrations/002_add_skill_tracking.sql +0 -6
- package/src/core/storage/migrations/003_add_skill_invocations.sql +0 -23
- package/src/core/storage/performance-indexes.sql +0 -23
- package/src/core/storage/routing.ts +0 -322
- package/src/core/storage/rows.ts +0 -112
- package/src/core/storage/schema.sql +0 -224
- package/src/core/storage/sessions.ts +0 -168
- package/src/core/storage/skills.ts +0 -233
- package/src/core/storage/sqlite.ts +0 -293
- package/src/core/storage/tasks.ts +0 -318
- package/src/core/storage/token-usage.ts +0 -93
- package/src/core/types.ts +0 -181
- package/src/core/utils/error-handler.ts +0 -257
- package/src/core/utils/forge-resume-block.ts +0 -74
- package/src/core/utils/format.ts +0 -69
- package/src/core/utils/git.ts +0 -23
- package/src/core/utils/logger.ts +0 -134
- package/src/core/utils/lru-cache.ts +0 -54
- package/src/core/utils/path.ts +0 -19
- package/src/core/utils/session.ts +0 -26
- package/src/core/utils/time.ts +0 -37
- package/src/core/utils/token-tracker.ts +0 -97
- package/src/daemon/event-parser.ts +0 -36
- package/src/daemon/handlers/history-exporter.ts +0 -117
- package/src/daemon/handlers/post-tool-use.ts +0 -54
- package/src/daemon/handlers/stop.ts +0 -208
- package/src/daemon/handlers/user-prompt.ts +0 -178
- package/src/daemon/hook-sync.ts +0 -91
- package/src/daemon/index.ts +0 -302
- package/src/daemon/launchd/com.claude-forge.daemon.plist.template +0 -47
- package/src/daemon/launchd-installer.ts +0 -260
- package/src/daemon/lifecycle.ts +0 -128
- package/src/daemon/router.ts +0 -40
- package/src/daemon/server.ts +0 -196
- package/src/daemon/services/task-segmenter.ts +0 -112
- package/src/hooks/hook-lib.sh +0 -118
- package/src/hooks/notification.sh +0 -35
- package/src/hooks/post-tool-use.sh +0 -61
- package/src/hooks/pre-tool-use.sh +0 -63
- package/src/hooks/stop.sh +0 -43
- package/src/hooks/user-prompt-submit.sh +0 -69
- package/src/mcp/server.ts +0 -322
- package/src/skills/index.ts +0 -2
- package/src/skills/invocation-guard.ts +0 -177
- package/src/skills/matcher.ts +0 -148
- package/src/skills/official/code-simplifier.md +0 -16
- package/src/skills/official/find-skills.md +0 -23
- package/src/skills/official/official-api-design.md +0 -17
- package/src/skills/official/official-architecture-decision.md +0 -20
- package/src/skills/official/official-bmad.md +0 -118
- package/src/skills/official/official-db-schema-design.md +0 -16
- package/src/skills/official/official-debug.md +0 -17
- package/src/skills/official/official-doc-driven.md +0 -31
- package/src/skills/official/official-harness-engineering.md +0 -108
- package/src/skills/official/official-performance-optimization.md +0 -30
- package/src/skills/official/official-pr-review.md +0 -35
- package/src/skills/official/official-release-checklist.md +0 -30
- package/src/skills/official/official-security-hardening.md +0 -26
- package/src/skills/official/official-spec-driven-design.md +0 -31
- package/src/skills/official/planning-with-files.md +0 -37
- package/src/skills/official/ui-ux-pro-max.md +0 -18
- package/src/skills/official/webapp-testing.md +0 -12
- package/src/skills/official-skills.ts +0 -89
- package/src/skills/registry.ts +0 -355
- package/src/skills/semantic-matcher.ts +0 -231
- package/src/skills/tools/pipeline-suggest.ts +0 -226
- package/src/skills/tools/skill-invoke.ts +0 -168
- package/src/skills/tools/skill-list.ts +0 -59
- package/src/templates/go.yaml +0 -53
- package/src/templates/python.yaml +0 -59
- package/src/templates/react.yaml +0 -55
- package/src/templates/template-manager.ts +0 -170
- package/src/web/analytics/anti-pattern-detector.ts +0 -367
- package/src/web/analytics/drift-detector.ts +0 -219
- package/src/web/analytics/weekly-report.ts +0 -431
- package/src/web/auth-middleware.ts +0 -54
- package/src/web/routes/_helpers.ts +0 -34
- package/src/web/routes/ai.ts +0 -204
- package/src/web/routes/auth.ts +0 -22
- package/src/web/routes/drift.ts +0 -25
- package/src/web/routes/error-handler.ts +0 -120
- package/src/web/routes/events.ts +0 -47
- package/src/web/routes/insights.ts +0 -43
- package/src/web/routes/patch.ts +0 -117
- package/src/web/routes/reports.ts +0 -34
- package/src/web/routes/rules.ts +0 -76
- package/src/web/routes/sessions.ts +0 -250
- package/src/web/routes/skill-stats.ts +0 -92
- package/src/web/routes/skills.ts +0 -350
- package/src/web/routes/static.ts +0 -67
- package/src/web/routes/stats.ts +0 -50
- package/src/web/routes/status.ts +0 -30
- package/src/web/routes/tasks.ts +0 -193
- package/src/web/routes/token-usage.ts +0 -20
- package/src/web/routes/trace.ts +0 -126
- package/src/web/routes/types.ts +0 -57
- package/src/web/server.ts +0 -134
- package/src/web/ssrf-guard.ts +0 -112
- package/src/web/static/index.html +0 -3251
- package/src/web/static/vendor/chart.umd.min.js +0 -20
- package/tests/e2e/dashboard.spec.ts +0 -205
- package/tests/e2e/routing-skill-e2e.test.ts +0 -39
- package/tests/helpers/mock-ai.ts +0 -92
- package/tests/helpers/mock-storage.ts +0 -159
- package/tests/integration/claudemd-generator.test.ts +0 -90
- package/tests/integration/queue-replay.integration.test.ts +0 -193
- package/tests/integration/tasks-filter.integration.test.ts +0 -154
- package/tests/integration/web-analytics.integration.test.ts +0 -133
- package/tests/integration/web-stats.integration.test.ts +0 -135
- package/tests/integration/web-trace.integration.test.ts +0 -175
- package/tests/performance/database.benchmark.ts +0 -161
- package/tests/semantic-matcher.test.ts +0 -99
- package/tests/skill-matcher.test.ts +0 -110
- package/tests/unit/ai-provider-retry.test.ts +0 -194
- package/tests/unit/ai-provider-vision.test.ts +0 -224
- package/tests/unit/claudemd-generator.test.ts +0 -68
- package/tests/unit/cli-mcp.test.ts +0 -141
- package/tests/unit/core/forge-paths.test.ts +0 -99
- package/tests/unit/daemon/hook-sync.test.ts +0 -71
- package/tests/unit/daemon/post-tool-use.test.ts +0 -121
- package/tests/unit/daemon/stop-handler-behavior-summary.test.ts +0 -202
- package/tests/unit/daemon/task-segmenter-recover.test.ts +0 -84
- package/tests/unit/event-fields.test.ts +0 -88
- package/tests/unit/event-parser.test.ts +0 -55
- package/tests/unit/handlers.test.ts +0 -171
- package/tests/unit/hooks/resolve-project-path.test.ts +0 -122
- package/tests/unit/invocation-guard.test.ts +0 -125
- package/tests/unit/queue.test.ts +0 -272
- package/tests/unit/router.test.ts +0 -138
- package/tests/unit/security.test.ts +0 -128
- package/tests/unit/skill-invocations-workflow.test.ts +0 -495
- package/tests/unit/skill-registry.test.ts +0 -94
- package/tests/unit/skills/invocation-guard-ttl.test.ts +0 -211
- package/tests/unit/skills/official-skills-loader.test.ts +0 -126
- package/tests/unit/skills/registry-multiformat.test.ts +0 -92
- package/tests/unit/socket-server.test.ts +0 -183
- package/tests/unit/storage/event-operations-aggregates.test.ts +0 -342
- package/tests/unit/storage/migration-idempotent.test.ts +0 -304
- package/tests/unit/storage/routing-aggregates.test.ts +0 -276
- package/tests/unit/storage/routing.test.ts +0 -117
- package/tests/unit/storage/schema-missing.test.ts +0 -81
- package/tests/unit/storage/session-operations-aggregates.test.ts +0 -120
- package/tests/unit/storage/sessions-aggregate.test.ts +0 -435
- package/tests/unit/storage/skill-operations-counts.test.ts +0 -106
- package/tests/unit/storage/skills-aggregates.test.ts +0 -104
- package/tests/unit/storage/sqlite-refactor-harness.test.ts +0 -314
- package/tests/unit/storage/task-operations-counts.test.ts +0 -46
- package/tests/unit/storage/tasks-getById.test.ts +0 -343
- package/tests/unit/storage/tasks-stale-gc.test.ts +0 -86
- package/tests/unit/storage.test.ts +0 -172
- package/tests/unit/token-usage.test.ts +0 -144
- package/tests/unit/type-guards.test.ts +0 -201
- package/tests/unit/utils/format.test.ts +0 -189
- package/tests/unit/utils/session.test.ts +0 -89
- package/tests/unit/utils/time.test.ts +0 -112
- package/tests/unit/web/navigation-back-contract.test.ts +0 -134
- package/tests/unit/web/routes-auth.test.ts +0 -93
- package/tests/unit/web/routes-events.test.ts +0 -101
- package/tests/unit/web/routes-rules.test.ts +0 -182
- package/tests/unit/web/routes-sessions.test.ts +0 -181
- package/tests/unit/web/routes-skill-stats.test.ts +0 -179
- package/tests/unit/web/routes-stats.test.ts +0 -92
- package/tests/unit/web/routes-tasks.test.ts +0 -385
- package/tests/unit/web/task-title-contract.test.ts +0 -210
- package/tests/unit/web/tasks-component-contract.test.ts +0 -179
- package/tsconfig.json +0 -22
- package/vitest.config.ts +0 -21
- package/vitest.integration.config.ts +0 -16
- package/web/CLAUDE.md +0 -20
- package/web/index.html +0 -13
- package/web/package-lock.json +0 -4854
- package/web/package.json +0 -35
- package/web/postcss.config.js +0 -6
- package/web/src/App.tsx +0 -110
- package/web/src/components/CodeBlock.tsx +0 -31
- package/web/src/components/Confirm.tsx +0 -96
- package/web/src/components/Drawer.tsx +0 -60
- package/web/src/components/Layout.tsx +0 -145
- package/web/src/components/MarkdownRenderer.tsx +0 -77
- package/web/src/components/SearchInput.tsx +0 -31
- package/web/src/components/SessionDetailContent.tsx +0 -157
- package/web/src/components/Toast.tsx +0 -92
- package/web/src/index.css +0 -19
- package/web/src/main.tsx +0 -31
- package/web/src/pages/AIConfig.tsx +0 -233
- package/web/src/pages/Dashboard.tsx +0 -572
- package/web/src/pages/Events.tsx +0 -271
- package/web/src/pages/Reports.tsx +0 -428
- package/web/src/pages/SessionDetail.tsx +0 -162
- package/web/src/pages/Sessions.tsx +0 -205
- package/web/src/pages/Skills.tsx +0 -180
- package/web/src/pages/TaskDetail.tsx +0 -515
- package/web/src/pages/Tasks.tsx +0 -415
- package/web/src/utils/auth.ts +0 -59
- package/web/src/utils/export.ts +0 -54
- package/web/src/utils/navigation.ts +0 -25
- package/web/src/utils/task-title.ts +0 -49
- package/web/src/utils/time.ts +0 -13
- package/web/tailwind.config.js +0 -11
- package/web/tsconfig.json +0 -21
- package/web/tsconfig.node.json +0 -10
- package/web/vite.config.ts +0 -76
- package/winspan-claude-forge-8.43.0.tgz +0 -0
|
@@ -1,515 +0,0 @@
|
|
|
1
|
-
import { useParams, Link, useLocation } from 'react-router-dom'
|
|
2
|
-
import { useQuery } from '@tanstack/react-query'
|
|
3
|
-
import { useState } from 'react'
|
|
4
|
-
import { format } from 'date-fns'
|
|
5
|
-
import { parseUTC } from '../utils/time'
|
|
6
|
-
import { resolveBackTo } from '../utils/navigation'
|
|
7
|
-
import {
|
|
8
|
-
ArrowLeft,
|
|
9
|
-
Clock,
|
|
10
|
-
CheckCircle2,
|
|
11
|
-
Loader2,
|
|
12
|
-
ChevronDown,
|
|
13
|
-
ChevronRight,
|
|
14
|
-
FileText,
|
|
15
|
-
Terminal,
|
|
16
|
-
FileEdit,
|
|
17
|
-
Bot,
|
|
18
|
-
BookOpen,
|
|
19
|
-
Syringe,
|
|
20
|
-
FolderOpen,
|
|
21
|
-
Eye,
|
|
22
|
-
Pencil,
|
|
23
|
-
Search,
|
|
24
|
-
Globe,
|
|
25
|
-
MessageSquare,
|
|
26
|
-
} from 'lucide-react'
|
|
27
|
-
import clsx from 'clsx'
|
|
28
|
-
import { normalizeTaskTitle } from '../utils/task-title'
|
|
29
|
-
|
|
30
|
-
interface Injection {
|
|
31
|
-
id: string
|
|
32
|
-
injection_type: 'systemMessage' | 'additionalContext'
|
|
33
|
-
source_handler: string
|
|
34
|
-
content: string
|
|
35
|
-
timestamp: string
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
interface TimelineEvent {
|
|
39
|
-
id: string
|
|
40
|
-
timestamp: string
|
|
41
|
-
tool_name: string
|
|
42
|
-
hook_type: string
|
|
43
|
-
input: unknown
|
|
44
|
-
output: unknown
|
|
45
|
-
is_agent_call: boolean
|
|
46
|
-
agent_detail?: {
|
|
47
|
-
subagent_type?: string
|
|
48
|
-
name?: string
|
|
49
|
-
prompt?: string
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
interface SkillInvocation {
|
|
54
|
-
id: string
|
|
55
|
-
skill_id: string
|
|
56
|
-
reason: string
|
|
57
|
-
workflow?: string
|
|
58
|
-
phase?: string
|
|
59
|
-
timestamp: string
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
interface UserPrompt {
|
|
63
|
-
timestamp: string
|
|
64
|
-
content: string
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
interface TaskDetailData {
|
|
68
|
-
id: string
|
|
69
|
-
title: string
|
|
70
|
-
status: 'active' | 'completed' | 'abandoned'
|
|
71
|
-
start_time: string
|
|
72
|
-
end_time?: string
|
|
73
|
-
event_count: number
|
|
74
|
-
session_id: string
|
|
75
|
-
userPrompts: UserPrompt[]
|
|
76
|
-
injections: Injection[]
|
|
77
|
-
timeline: TimelineEvent[]
|
|
78
|
-
skillInvocations: SkillInvocation[]
|
|
79
|
-
artifacts: string[]
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
async function fetchTaskDetail(taskId: string): Promise<TaskDetailData> {
|
|
83
|
-
const res = await fetch(`/api/tasks/${taskId}`)
|
|
84
|
-
if (!res.ok) throw new Error('Failed to fetch task detail')
|
|
85
|
-
const raw = await res.json()
|
|
86
|
-
// API returns { task: {...}, injections, timeline, skillInvocations, artifacts }
|
|
87
|
-
// Flatten task fields into top level for component consumption
|
|
88
|
-
return {
|
|
89
|
-
...raw.task,
|
|
90
|
-
userPrompts: raw.userPrompts ?? [],
|
|
91
|
-
injections: raw.injections ?? [],
|
|
92
|
-
timeline: (raw.timeline ?? []).map((e: any, idx: number) => ({
|
|
93
|
-
id: `${e.timestamp}-${e.tool_name}-${idx}`,
|
|
94
|
-
timestamp: e.timestamp,
|
|
95
|
-
tool_name: e.tool_name,
|
|
96
|
-
hook_type: e.hook_type,
|
|
97
|
-
input: e.input,
|
|
98
|
-
output: e.output,
|
|
99
|
-
is_agent_call: e.is_agent_call,
|
|
100
|
-
agent_detail: e.agent_detail,
|
|
101
|
-
})),
|
|
102
|
-
skillInvocations: raw.skillInvocations ?? [],
|
|
103
|
-
artifacts: raw.artifacts ?? [],
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
function getToolIcon(toolName: string) {
|
|
108
|
-
switch (toolName) {
|
|
109
|
-
case 'Read':
|
|
110
|
-
return <Eye className="h-4 w-4 text-gray-500" />
|
|
111
|
-
case 'Edit':
|
|
112
|
-
return <Pencil className="h-4 w-4 text-amber-600" />
|
|
113
|
-
case 'Write':
|
|
114
|
-
return <FileEdit className="h-4 w-4 text-green-600" />
|
|
115
|
-
case 'Bash':
|
|
116
|
-
return <Terminal className="h-4 w-4 text-orange-600" />
|
|
117
|
-
case 'Agent':
|
|
118
|
-
case 'Task':
|
|
119
|
-
return <Bot className="h-4 w-4 text-blue-600" />
|
|
120
|
-
case 'Grep':
|
|
121
|
-
case 'Glob':
|
|
122
|
-
return <Search className="h-4 w-4 text-purple-500" />
|
|
123
|
-
case 'WebSearch':
|
|
124
|
-
case 'WebFetch':
|
|
125
|
-
return <Globe className="h-4 w-4 text-cyan-600" />
|
|
126
|
-
default:
|
|
127
|
-
return <Terminal className="h-4 w-4 text-gray-400" />
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
function getRelativeTime(eventTime: string, startTime: string): string {
|
|
132
|
-
const diff = parseUTC(eventTime).getTime() - parseUTC(startTime).getTime()
|
|
133
|
-
if (diff < 1000) return '+0s'
|
|
134
|
-
if (diff < 60000) return `+${Math.floor(diff / 1000)}s`
|
|
135
|
-
if (diff < 3600000) return `+${Math.floor(diff / 60000)}m${Math.floor((diff % 60000) / 1000)}s`
|
|
136
|
-
return `+${Math.floor(diff / 3600000)}h${Math.floor((diff % 3600000) / 60000)}m`
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
export default function TaskDetail() {
|
|
140
|
-
const { taskId } = useParams<{ taskId: string }>()
|
|
141
|
-
const location = useLocation()
|
|
142
|
-
const backTo = resolveBackTo(location.state)
|
|
143
|
-
const [expandedInjections, setExpandedInjections] = useState<Set<string>>(new Set())
|
|
144
|
-
const [expandedEvents, setExpandedEvents] = useState<Set<number>>(new Set())
|
|
145
|
-
const [showInjections, setShowInjections] = useState(true)
|
|
146
|
-
|
|
147
|
-
const { data, isLoading, error } = useQuery({
|
|
148
|
-
queryKey: ['task-detail', taskId],
|
|
149
|
-
queryFn: () => fetchTaskDetail(taskId!),
|
|
150
|
-
enabled: !!taskId,
|
|
151
|
-
refetchInterval: 10000,
|
|
152
|
-
})
|
|
153
|
-
|
|
154
|
-
if (isLoading) {
|
|
155
|
-
return (
|
|
156
|
-
<div className="bg-white rounded-lg shadow p-6">
|
|
157
|
-
<p className="text-gray-600">加载中...</p>
|
|
158
|
-
</div>
|
|
159
|
-
)
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
if (error || !data) {
|
|
163
|
-
return (
|
|
164
|
-
<div>
|
|
165
|
-
<Link to={backTo} className="inline-flex items-center text-sm text-gray-500 hover:text-gray-700 mb-4">
|
|
166
|
-
<ArrowLeft className="h-4 w-4 mr-1" />返回
|
|
167
|
-
</Link>
|
|
168
|
-
<div className="bg-white rounded-lg shadow p-6">
|
|
169
|
-
<p className="text-red-600">加载失败: {(error as Error)?.message || '未知错误'}</p>
|
|
170
|
-
</div>
|
|
171
|
-
</div>
|
|
172
|
-
)
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
const toggleInjection = (id: string) => {
|
|
176
|
-
setExpandedInjections(prev => {
|
|
177
|
-
const next = new Set(prev)
|
|
178
|
-
if (next.has(id)) next.delete(id)
|
|
179
|
-
else next.add(id)
|
|
180
|
-
return next
|
|
181
|
-
})
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
const toggleEvent = (idx: number) => {
|
|
185
|
-
setExpandedEvents(prev => {
|
|
186
|
-
const next = new Set(prev)
|
|
187
|
-
if (next.has(idx)) next.delete(idx)
|
|
188
|
-
else next.add(idx)
|
|
189
|
-
return next
|
|
190
|
-
})
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
const duration = data.end_time
|
|
194
|
-
? `${Math.round((parseUTC(data.end_time).getTime() - parseUTC(data.start_time).getTime()) / 1000)}s`
|
|
195
|
-
: '进行中'
|
|
196
|
-
|
|
197
|
-
return (
|
|
198
|
-
<div>
|
|
199
|
-
<Link to={backTo} className="inline-flex items-center text-sm text-gray-500 hover:text-gray-700 mb-4">
|
|
200
|
-
<ArrowLeft className="h-4 w-4 mr-1" />返回任务列表
|
|
201
|
-
</Link>
|
|
202
|
-
|
|
203
|
-
{/* 区域 1:任务概览 */}
|
|
204
|
-
<div className="bg-white rounded-lg shadow p-6 mb-6">
|
|
205
|
-
<div className="flex items-start justify-between mb-4">
|
|
206
|
-
<h1 className="text-xl font-bold text-gray-900">{normalizeTaskTitle(data.title, data.userPrompts[0]?.content)}</h1>
|
|
207
|
-
<span className={clsx(
|
|
208
|
-
'px-2 py-1 text-xs font-medium rounded-full',
|
|
209
|
-
data.status === 'completed' && 'bg-green-100 text-green-700',
|
|
210
|
-
data.status === 'active' && 'bg-blue-100 text-blue-700',
|
|
211
|
-
data.status === 'abandoned' && 'bg-gray-100 text-gray-600'
|
|
212
|
-
)}>
|
|
213
|
-
{data.status === 'completed' && <CheckCircle2 className="h-3 w-3 inline mr-1" />}
|
|
214
|
-
{data.status === 'active' && <Loader2 className="h-3 w-3 inline mr-1 animate-spin" />}
|
|
215
|
-
{data.status}
|
|
216
|
-
</span>
|
|
217
|
-
</div>
|
|
218
|
-
<div className="grid grid-cols-4 gap-4 text-sm">
|
|
219
|
-
<div>
|
|
220
|
-
<div className="text-xs text-gray-500 mb-1">开始时间</div>
|
|
221
|
-
<div className="text-gray-900">
|
|
222
|
-
{format(parseUTC(data.start_time), 'MM-dd HH:mm:ss')}
|
|
223
|
-
</div>
|
|
224
|
-
</div>
|
|
225
|
-
<div>
|
|
226
|
-
<div className="text-xs text-gray-500 mb-1">结束时间</div>
|
|
227
|
-
<div className="text-gray-900">
|
|
228
|
-
{data.end_time ? format(parseUTC(data.end_time), 'MM-dd HH:mm:ss') : '-'}
|
|
229
|
-
</div>
|
|
230
|
-
</div>
|
|
231
|
-
<div>
|
|
232
|
-
<div className="text-xs text-gray-500 mb-1">持续时间</div>
|
|
233
|
-
<div className="text-gray-900">{duration}</div>
|
|
234
|
-
</div>
|
|
235
|
-
<div>
|
|
236
|
-
<div className="text-xs text-gray-500 mb-1">事件数</div>
|
|
237
|
-
<div className="text-gray-900">{data.event_count}</div>
|
|
238
|
-
</div>
|
|
239
|
-
</div>
|
|
240
|
-
</div>
|
|
241
|
-
|
|
242
|
-
{/* 区域 1.5:用户消息 */}
|
|
243
|
-
{data.userPrompts.length > 0 && (
|
|
244
|
-
<div className="bg-white rounded-lg shadow p-6 mb-6">
|
|
245
|
-
<h2 className="text-base font-semibold text-gray-900 mb-4 flex items-center gap-2">
|
|
246
|
-
<MessageSquare className="h-4 w-4 text-purple-500" />
|
|
247
|
-
用户消息
|
|
248
|
-
<span className="text-xs text-gray-500 bg-gray-100 px-2 py-0.5 rounded-full">
|
|
249
|
-
{data.userPrompts.length}
|
|
250
|
-
</span>
|
|
251
|
-
</h2>
|
|
252
|
-
<div className="space-y-3">
|
|
253
|
-
{data.userPrompts.map((up, idx) => (
|
|
254
|
-
<div key={idx} className="bg-purple-50 border border-purple-100 rounded-lg p-3">
|
|
255
|
-
<div className="text-xs text-gray-500 mb-1 font-mono">
|
|
256
|
-
{format(parseUTC(up.timestamp), 'HH:mm:ss')}
|
|
257
|
-
</div>
|
|
258
|
-
<div className="text-sm text-gray-800 whitespace-pre-wrap break-all">{up.content}</div>
|
|
259
|
-
</div>
|
|
260
|
-
))}
|
|
261
|
-
</div>
|
|
262
|
-
</div>
|
|
263
|
-
)}
|
|
264
|
-
|
|
265
|
-
{/* 空状态:所有详情区块都为空时的兜底提示 */}
|
|
266
|
-
{data.userPrompts.length === 0 &&
|
|
267
|
-
data.injections.length === 0 &&
|
|
268
|
-
data.timeline.length === 0 &&
|
|
269
|
-
data.skillInvocations.length === 0 &&
|
|
270
|
-
data.artifacts.length === 0 && (
|
|
271
|
-
<div className="bg-white rounded-lg shadow p-12 text-center">
|
|
272
|
-
<Clock className="h-12 w-12 text-gray-300 mx-auto mb-3" />
|
|
273
|
-
<p className="text-sm text-gray-500">该任务暂无可展示的执行内容</p>
|
|
274
|
-
<p className="text-xs text-gray-400 mt-1">事件可能仍在记录中,稍后刷新查看</p>
|
|
275
|
-
</div>
|
|
276
|
-
)}
|
|
277
|
-
|
|
278
|
-
{/* 区域 2:注入内容 */}
|
|
279
|
-
{data.injections.length > 0 && (
|
|
280
|
-
<div className="bg-white rounded-lg shadow mb-6">
|
|
281
|
-
<button
|
|
282
|
-
onClick={() => setShowInjections(!showInjections)}
|
|
283
|
-
className="w-full flex items-center justify-between p-4 text-left hover:bg-gray-50 rounded-t-lg"
|
|
284
|
-
>
|
|
285
|
-
<div className="flex items-center gap-2">
|
|
286
|
-
<Syringe className="h-4 w-4 text-gray-500" />
|
|
287
|
-
<h2 className="text-base font-semibold text-gray-900">注入内容</h2>
|
|
288
|
-
<span className="text-xs text-gray-500 bg-gray-100 px-2 py-0.5 rounded-full">
|
|
289
|
-
{data.injections.length}
|
|
290
|
-
</span>
|
|
291
|
-
</div>
|
|
292
|
-
{showInjections ? <ChevronDown className="h-4 w-4 text-gray-400" /> : <ChevronRight className="h-4 w-4 text-gray-400" />}
|
|
293
|
-
</button>
|
|
294
|
-
{showInjections && (
|
|
295
|
-
<div className="px-4 pb-4 space-y-2">
|
|
296
|
-
{data.injections.map((inj) => (
|
|
297
|
-
<div key={inj.id} className="bg-gray-50 rounded-lg border border-gray-100">
|
|
298
|
-
<button
|
|
299
|
-
onClick={() => toggleInjection(inj.id)}
|
|
300
|
-
className="w-full flex items-center justify-between p-3 text-left"
|
|
301
|
-
>
|
|
302
|
-
<div className="flex items-center gap-2 text-sm">
|
|
303
|
-
<span className={clsx(
|
|
304
|
-
'px-1.5 py-0.5 text-xs rounded font-mono',
|
|
305
|
-
inj.injection_type === 'systemMessage' ? 'bg-blue-50 text-blue-700' : 'bg-amber-50 text-amber-700'
|
|
306
|
-
)}>
|
|
307
|
-
{inj.injection_type}
|
|
308
|
-
</span>
|
|
309
|
-
<span className="text-gray-600">{inj.source_handler}</span>
|
|
310
|
-
</div>
|
|
311
|
-
{expandedInjections.has(inj.id) ? <ChevronDown className="h-3 w-3 text-gray-400" /> : <ChevronRight className="h-3 w-3 text-gray-400" />}
|
|
312
|
-
</button>
|
|
313
|
-
{expandedInjections.has(inj.id) && (
|
|
314
|
-
<div className="px-3 pb-3">
|
|
315
|
-
<pre className="text-xs text-gray-700 bg-white border border-gray-200 rounded p-3 overflow-x-auto max-h-64 overflow-y-auto whitespace-pre-wrap">
|
|
316
|
-
{inj.content}
|
|
317
|
-
</pre>
|
|
318
|
-
</div>
|
|
319
|
-
)}
|
|
320
|
-
</div>
|
|
321
|
-
))}
|
|
322
|
-
</div>
|
|
323
|
-
)}
|
|
324
|
-
</div>
|
|
325
|
-
)}
|
|
326
|
-
|
|
327
|
-
{/* 区域 3:执行时间线 */}
|
|
328
|
-
{data.timeline.length > 0 && (
|
|
329
|
-
<div className="bg-white rounded-lg shadow p-6 mb-6">
|
|
330
|
-
<h2 className="text-base font-semibold text-gray-900 mb-4 flex items-center gap-2">
|
|
331
|
-
<Clock className="h-4 w-4 text-gray-500" />
|
|
332
|
-
执行时间线
|
|
333
|
-
<span className="text-xs text-gray-500 bg-gray-100 px-2 py-0.5 rounded-full">
|
|
334
|
-
{data.timeline.length}
|
|
335
|
-
</span>
|
|
336
|
-
</h2>
|
|
337
|
-
<div className="relative">
|
|
338
|
-
{/* 竖线 */}
|
|
339
|
-
<div className="absolute left-[19px] top-2 bottom-2 w-px bg-gray-200" />
|
|
340
|
-
<div className="space-y-0">
|
|
341
|
-
{data.timeline.map((event, idx) => {
|
|
342
|
-
const isAgent = event.is_agent_call
|
|
343
|
-
const isFileOp = event.tool_name === 'Edit' || event.tool_name === 'Write'
|
|
344
|
-
const isExpanded = expandedEvents.has(idx)
|
|
345
|
-
const input = event.input as Record<string, unknown> | null
|
|
346
|
-
const filePath = input?.file_path as string | undefined
|
|
347
|
-
const description = (input?.description || input?.command) as string | undefined
|
|
348
|
-
|
|
349
|
-
return (
|
|
350
|
-
<div key={event.id || idx} className={clsx(
|
|
351
|
-
'relative flex items-start gap-3 py-2 px-2 rounded-md cursor-pointer hover:bg-gray-50 transition-colors',
|
|
352
|
-
isAgent && 'bg-blue-50 hover:bg-blue-100',
|
|
353
|
-
)}
|
|
354
|
-
onClick={() => toggleEvent(idx)}
|
|
355
|
-
>
|
|
356
|
-
<div className="relative z-10 flex-shrink-0 w-10 flex justify-center">
|
|
357
|
-
<div className={clsx(
|
|
358
|
-
'w-8 h-8 rounded-full flex items-center justify-center',
|
|
359
|
-
isAgent ? 'bg-blue-100' : 'bg-white border border-gray-200'
|
|
360
|
-
)}>
|
|
361
|
-
{getToolIcon(event.tool_name)}
|
|
362
|
-
</div>
|
|
363
|
-
</div>
|
|
364
|
-
<div className="flex-1 min-w-0 pt-1">
|
|
365
|
-
<div className="flex items-center gap-2">
|
|
366
|
-
<span className={clsx(
|
|
367
|
-
'text-sm font-medium',
|
|
368
|
-
isAgent ? 'text-blue-700' : 'text-gray-900'
|
|
369
|
-
)}>
|
|
370
|
-
{event.tool_name}
|
|
371
|
-
</span>
|
|
372
|
-
{event.agent_detail?.subagent_type && (
|
|
373
|
-
<span className="text-xs bg-blue-100 text-blue-700 px-1.5 py-0.5 rounded font-mono">
|
|
374
|
-
{event.agent_detail.subagent_type}
|
|
375
|
-
</span>
|
|
376
|
-
)}
|
|
377
|
-
{event.agent_detail?.name && (
|
|
378
|
-
<span className="text-xs text-blue-600">
|
|
379
|
-
{event.agent_detail.name}
|
|
380
|
-
</span>
|
|
381
|
-
)}
|
|
382
|
-
<span className="text-xs text-gray-400 font-mono ml-auto flex items-center gap-1">
|
|
383
|
-
{getRelativeTime(event.timestamp, data.start_time)}
|
|
384
|
-
{isExpanded ? <ChevronDown className="h-3 w-3" /> : <ChevronRight className="h-3 w-3" />}
|
|
385
|
-
</span>
|
|
386
|
-
</div>
|
|
387
|
-
{!isExpanded && isFileOp && filePath && (
|
|
388
|
-
<p className="text-xs text-green-700 font-mono mt-0.5 truncate" title={filePath}>
|
|
389
|
-
{filePath}
|
|
390
|
-
</p>
|
|
391
|
-
)}
|
|
392
|
-
{!isExpanded && !isFileOp && description && (
|
|
393
|
-
<p className="text-xs text-gray-500 mt-0.5 truncate">{description}</p>
|
|
394
|
-
)}
|
|
395
|
-
{/* 展开的详细内容 */}
|
|
396
|
-
{isExpanded && (
|
|
397
|
-
<div className="mt-2 space-y-2 text-xs" onClick={e => e.stopPropagation()}>
|
|
398
|
-
{/* Agent 调用详情 */}
|
|
399
|
-
{isAgent && event.agent_detail && (
|
|
400
|
-
<div className="bg-blue-50 border border-blue-200 rounded-lg p-3 space-y-2">
|
|
401
|
-
{event.agent_detail.subagent_type && (
|
|
402
|
-
<div>
|
|
403
|
-
<span className="text-blue-600 font-medium">subagent_type: </span>
|
|
404
|
-
<span className="font-mono text-blue-800">{event.agent_detail.subagent_type}</span>
|
|
405
|
-
</div>
|
|
406
|
-
)}
|
|
407
|
-
{event.agent_detail.name && (
|
|
408
|
-
<div>
|
|
409
|
-
<span className="text-blue-600 font-medium">name: </span>
|
|
410
|
-
<span className="font-mono text-blue-800">{event.agent_detail.name}</span>
|
|
411
|
-
</div>
|
|
412
|
-
)}
|
|
413
|
-
{event.agent_detail.prompt && (
|
|
414
|
-
<div>
|
|
415
|
-
<span className="text-blue-600 font-medium">prompt:</span>
|
|
416
|
-
<pre className="mt-1 p-2 bg-white rounded border border-blue-100 text-gray-800 whitespace-pre-wrap break-words max-h-60 overflow-y-auto">
|
|
417
|
-
{event.agent_detail.prompt}
|
|
418
|
-
</pre>
|
|
419
|
-
</div>
|
|
420
|
-
)}
|
|
421
|
-
</div>
|
|
422
|
-
)}
|
|
423
|
-
{/* 文件操作详情 */}
|
|
424
|
-
{isFileOp && filePath && (
|
|
425
|
-
<div className="bg-green-50 border border-green-200 rounded-lg p-3">
|
|
426
|
-
<span className="text-green-700 font-medium">file: </span>
|
|
427
|
-
<span className="font-mono text-green-800">{filePath}</span>
|
|
428
|
-
</div>
|
|
429
|
-
)}
|
|
430
|
-
{/* 通用工具详情 */}
|
|
431
|
-
{!isAgent && description && (
|
|
432
|
-
<div className="bg-gray-50 border border-gray-200 rounded-lg p-3">
|
|
433
|
-
<pre className="text-gray-700 whitespace-pre-wrap break-words max-h-40 overflow-y-auto">
|
|
434
|
-
{description}
|
|
435
|
-
</pre>
|
|
436
|
-
</div>
|
|
437
|
-
)}
|
|
438
|
-
{/* 文件路径(非文件操作工具,如 Read) */}
|
|
439
|
-
{!isAgent && !isFileOp && filePath && (
|
|
440
|
-
<div className="text-gray-500">
|
|
441
|
-
<span className="font-medium">path: </span>
|
|
442
|
-
<span className="font-mono">{filePath}</span>
|
|
443
|
-
</div>
|
|
444
|
-
)}
|
|
445
|
-
</div>
|
|
446
|
-
)}
|
|
447
|
-
</div>
|
|
448
|
-
</div>
|
|
449
|
-
)
|
|
450
|
-
})}
|
|
451
|
-
</div>
|
|
452
|
-
</div>
|
|
453
|
-
</div>
|
|
454
|
-
)}
|
|
455
|
-
|
|
456
|
-
{/* 区域 4:Skill 调用 */}
|
|
457
|
-
{data.skillInvocations.length > 0 && (
|
|
458
|
-
<div className="bg-white rounded-lg shadow p-6 mb-6">
|
|
459
|
-
<h2 className="text-base font-semibold text-gray-900 mb-4 flex items-center gap-2">
|
|
460
|
-
<BookOpen className="h-4 w-4 text-purple-500" />
|
|
461
|
-
Skill 调用
|
|
462
|
-
<span className="text-xs text-gray-500 bg-gray-100 px-2 py-0.5 rounded-full">
|
|
463
|
-
{data.skillInvocations.length}
|
|
464
|
-
</span>
|
|
465
|
-
</h2>
|
|
466
|
-
<div className="space-y-3">
|
|
467
|
-
{data.skillInvocations.map((skill) => (
|
|
468
|
-
<div key={skill.id} className="border border-purple-100 bg-purple-50 rounded-lg p-4">
|
|
469
|
-
<div className="flex items-center gap-2 mb-2">
|
|
470
|
-
<span className="text-sm font-medium text-purple-800 font-mono">
|
|
471
|
-
{skill.skill_id}
|
|
472
|
-
</span>
|
|
473
|
-
{skill.workflow && (
|
|
474
|
-
<span className="text-xs bg-purple-100 text-purple-700 px-1.5 py-0.5 rounded">
|
|
475
|
-
{skill.workflow}
|
|
476
|
-
</span>
|
|
477
|
-
)}
|
|
478
|
-
{skill.phase && (
|
|
479
|
-
<span className="text-xs bg-purple-100 text-purple-700 px-1.5 py-0.5 rounded">
|
|
480
|
-
phase: {skill.phase}
|
|
481
|
-
</span>
|
|
482
|
-
)}
|
|
483
|
-
</div>
|
|
484
|
-
<p className="text-xs text-purple-700">{skill.reason}</p>
|
|
485
|
-
</div>
|
|
486
|
-
))}
|
|
487
|
-
</div>
|
|
488
|
-
</div>
|
|
489
|
-
)}
|
|
490
|
-
|
|
491
|
-
{/* 区域 5:产物 */}
|
|
492
|
-
{data.artifacts.length > 0 && (
|
|
493
|
-
<div className="bg-white rounded-lg shadow p-6 mb-6">
|
|
494
|
-
<h2 className="text-base font-semibold text-gray-900 mb-4 flex items-center gap-2">
|
|
495
|
-
<FolderOpen className="h-4 w-4 text-green-600" />
|
|
496
|
-
产物
|
|
497
|
-
<span className="text-xs text-gray-500 bg-gray-100 px-2 py-0.5 rounded-full">
|
|
498
|
-
{data.artifacts.length} 个文件
|
|
499
|
-
</span>
|
|
500
|
-
</h2>
|
|
501
|
-
<div className="space-y-1">
|
|
502
|
-
{data.artifacts.map((filePath) => (
|
|
503
|
-
<div key={filePath} className="flex items-center gap-2 py-1.5 px-3 rounded hover:bg-green-50">
|
|
504
|
-
<FileText className="h-4 w-4 text-green-600 flex-shrink-0" />
|
|
505
|
-
<span className="text-sm text-gray-800 font-mono truncate" title={filePath}>
|
|
506
|
-
{filePath}
|
|
507
|
-
</span>
|
|
508
|
-
</div>
|
|
509
|
-
))}
|
|
510
|
-
</div>
|
|
511
|
-
</div>
|
|
512
|
-
)}
|
|
513
|
-
</div>
|
|
514
|
-
)
|
|
515
|
-
}
|