sillyspec 3.20.3 → 3.20.4
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/.claude/skills/sillyspec-archive/SKILL.md +21 -17
- package/.claude/skills/sillyspec-auto/SKILL.md +83 -77
- package/.claude/skills/sillyspec-brainstorm/SKILL.md +44 -17
- package/.claude/skills/sillyspec-commit/SKILL.md +106 -105
- package/.claude/skills/sillyspec-continue/SKILL.md +45 -44
- package/.claude/skills/sillyspec-doctor/SKILL.md +31 -22
- package/.claude/skills/sillyspec-execute/SKILL.md +30 -17
- package/.claude/skills/sillyspec-explore/SKILL.md +109 -96
- package/.claude/skills/sillyspec-knowledge/SKILL.md +270 -0
- package/.claude/skills/sillyspec-plan/SKILL.md +21 -52
- package/.claude/skills/sillyspec-propose/SKILL.md +21 -17
- package/.claude/skills/sillyspec-quick/SKILL.md +21 -17
- package/.claude/skills/sillyspec-resume/SKILL.md +68 -111
- package/.claude/skills/sillyspec-scan/SKILL.md +21 -17
- package/.claude/skills/sillyspec-state/SKILL.md +54 -54
- package/.claude/skills/sillyspec-status/SKILL.md +21 -17
- package/.claude/skills/sillyspec-verify/SKILL.md +21 -17
- package/.claude/skills/sillyspec-workspace/SKILL.md +157 -149
- package/.husky/pre-push +13 -0
- package/CLAUDE.md +18 -0
- package/README.md +198 -186
- package/SKILL.md +90 -87
- package/bin/sillyspec.js +2 -2
- package/docs/brainstorm-plan-contract.md +64 -0
- package/docs/plan-execute-contract.md +123 -0
- package/docs/platform-scan-protocol.md +298 -0
- package/docs/revision-mode.md +115 -0
- package/docs/sillyspec/file-lifecycle/known-implementation-gaps.md +99 -0
- package/docs/sillyspec/file-lifecycle/platform-workflows-sync.md +218 -0
- package/docs/sillyspec/file-lifecycle/stage-artifacts.md +167 -0
- package/docs/sillyspec/file-lifecycle/storage-and-state.md +148 -0
- package/docs/sillyspec/file-lifecycle/worktree-and-guard.md +211 -0
- package/docs/sillyspec/file-lifecycle.md +125 -0
- package/docs/workflow-contract-regression.md +106 -0
- package/docs/worktree-isolation.md +252 -0
- package/package.json +40 -34
- package/packages/dashboard/dist/assets/{index-D1EVTLmc.js → index-Bq_Z2hne.js} +7446 -7446
- package/packages/dashboard/dist/assets/index-O2W5RV4z.css +1 -0
- package/packages/dashboard/dist/index.html +16 -16
- package/packages/dashboard/dist/prototype-dashboard.html +836 -0
- package/packages/dashboard/dist/prototype-overview.html +256 -0
- package/packages/dashboard/index.html +15 -15
- package/packages/dashboard/package-lock.json +2384 -2384
- package/packages/dashboard/package.json +25 -25
- package/packages/dashboard/public/prototype-dashboard.html +836 -0
- package/packages/dashboard/public/prototype-overview.html +256 -0
- package/packages/dashboard/server/executor.js +86 -86
- package/packages/dashboard/server/index.js +588 -508
- package/packages/dashboard/server/parser.js +526 -458
- package/packages/dashboard/server/watcher.js +350 -342
- package/packages/dashboard/src/App.vue +558 -325
- package/packages/dashboard/src/components/ActionBar.vue +93 -84
- package/packages/dashboard/src/components/CommandPalette.vue +96 -92
- package/packages/dashboard/src/components/DetailPanel.vue +137 -137
- package/packages/dashboard/src/components/DocPreview.vue +105 -8
- package/packages/dashboard/src/components/DocTree.vue +75 -19
- package/packages/dashboard/src/components/HResizeHandle.vue +48 -0
- package/packages/dashboard/src/components/LogStream.vue +65 -65
- package/packages/dashboard/src/components/PipelineStage.vue +95 -75
- package/packages/dashboard/src/components/PipelineView.vue +156 -129
- package/packages/dashboard/src/components/ProjectCard.vue +187 -0
- package/packages/dashboard/src/components/ProjectList.vue +210 -210
- package/packages/dashboard/src/components/ProjectOverview.vue +113 -139
- package/packages/dashboard/src/components/StageBadge.vue +67 -53
- package/packages/dashboard/src/components/StepCard.vue +94 -89
- package/packages/dashboard/src/components/VResizeHandle.vue +61 -0
- package/packages/dashboard/src/components/detail/DocsDetail.vue +48 -48
- package/packages/dashboard/src/components/detail/GitDetail.vue +61 -61
- package/packages/dashboard/src/components/detail/TechDetail.vue +43 -43
- package/packages/dashboard/src/composables/useDashboard.js +192 -164
- package/packages/dashboard/src/composables/useKeyboard.js +119 -119
- package/packages/dashboard/src/composables/useLayout.js +131 -0
- package/packages/dashboard/src/composables/useWebSocket.js +129 -129
- package/packages/dashboard/src/main.js +8 -8
- package/packages/dashboard/src/style.css +132 -132
- package/packages/dashboard/vite.config.js +18 -18
- package/src/brainstorm-postcheck.js +158 -0
- package/src/change-list.js +52 -0
- package/src/change-risk-profile.js +352 -0
- package/src/classify-change.js +73 -0
- package/src/constants.js +70 -0
- package/src/contract-matrix.js +278 -0
- package/src/db.js +201 -0
- package/src/endpoint-extractor.js +315 -0
- package/src/hooks/claude-pre-tool-use.cjs +125 -0
- package/src/hooks/worktree-guard.js +761 -0
- package/src/index.js +922 -252
- package/src/init.js +431 -375
- package/src/knowledge-match.js +130 -0
- package/src/migrate.js +117 -117
- package/src/modules.js +482 -0
- package/src/progress.js +1734 -508
- package/src/run.js +3465 -652
- package/src/scan-postcheck.js +387 -0
- package/src/setup.js +398 -460
- package/src/stage-contract.js +700 -0
- package/src/stages/archive.js +160 -54
- package/src/stages/brainstorm-auto.js +229 -0
- package/src/stages/brainstorm.js +645 -239
- package/src/stages/doctor.js +365 -312
- package/src/stages/execute.js +625 -264
- package/src/stages/explore.js +34 -0
- package/src/stages/index.js +29 -35
- package/src/stages/knowledge.js +498 -0
- package/src/stages/plan-postcheck.js +511 -0
- package/src/stages/plan.js +582 -279
- package/src/stages/propose.js +174 -115
- package/src/stages/quick.js +102 -63
- package/src/stages/scan.js +558 -141
- package/src/stages/status.js +65 -65
- package/src/stages/verify.js +322 -135
- package/src/sync.js +497 -0
- package/src/task-review.js +346 -0
- package/src/workflow.js +785 -0
- package/src/worktree-apply.js +549 -0
- package/src/worktree-deps.js +185 -0
- package/src/worktree.js +982 -0
- package/templates/workflows/archive-impact.yaml +79 -0
- package/templates/workflows/scan-docs.yaml +132 -0
- package/test/brainstorm-plan-contract.test.mjs +273 -0
- package/test/check-syntax.mjs +26 -0
- package/test/cli-top-level-aliases.test.mjs +174 -0
- package/test/contract-artifacts.test.mjs +323 -0
- package/test/decision-supersede.test.mjs +277 -0
- package/test/knowledge-match.test.mjs +231 -0
- package/test/plan-execute-contract.test.mjs +330 -0
- package/test/plan-optimization.test.mjs +572 -0
- package/test/platform-artifacts.test.mjs +190 -0
- package/test/platform-failure-samples.test.mjs +199 -0
- package/test/platform-recovery-chain.test.mjs +179 -0
- package/test/platform-recovery.test.mjs +167 -0
- package/test/platform-scan-p0.test.mjs +175 -0
- package/test/revision-v1.test.mjs +1145 -0
- package/test/run-sanitize-project-name.test.mjs +51 -0
- package/test/run-scan-postcheck-fail.test.mjs +64 -0
- package/test/run-scan-project-parse.test.mjs +200 -0
- package/test/run-tests.mjs +48 -0
- package/test/scan-docs-yaml-placeholders.test.mjs +84 -0
- package/test/scan-knowledge.test.mjs +175 -0
- package/test/scan-paths.test.mjs +68 -0
- package/test/scan-postcheck-project-priority.test.mjs +85 -0
- package/test/scan-postcheck.test.mjs +197 -0
- package/test/scan-workflow-anyfailed-block.test.mjs +52 -0
- package/test/spec-dir.test.mjs +206 -0
- package/test/stage-contract-failed-post-check.test.mjs +102 -0
- package/test/stage-contract.test.mjs +299 -0
- package/test/stage-definitions.test.mjs +39 -0
- package/test/wait-gates.test.mjs +501 -0
- package/test/workflow-spec-base.test.mjs +142 -0
- package/test/worktree-deps-provision.test.mjs +148 -0
- package/test/worktree-guard.test.mjs +136 -0
- package/test/worktree-native-overlay.test.mjs +188 -0
- package/.sillyspec/changes/archive/2026-04-08-derive-state/design.md +0 -97
- package/.sillyspec/changes/archive/2026-04-08-derive-state/plan.md +0 -51
- package/.sillyspec/changes/archive/2026-04-08-derive-state/proposal.md +0 -29
- package/.sillyspec/changes/archive/2026-04-08-derive-state/requirements.md +0 -34
- package/.sillyspec/changes/archive/2026-04-08-derive-state/tasks.md +0 -13
- package/.sillyspec/changes/archive/2026-04-08-derive-state/verify-result.md +0 -43
- package/.sillyspec/changes/auto-mode/design.md +0 -50
- package/.sillyspec/changes/auto-mode/proposal.md +0 -19
- package/.sillyspec/changes/auto-mode/requirements.md +0 -21
- package/.sillyspec/changes/auto-mode/tasks.md +0 -7
- package/.sillyspec/changes/brainstorm-archive/2026-04-05-dashboard-design.md +0 -206
- package/.sillyspec/changes/brainstorm-archive/2026-04-05-unified-docs-design.md +0 -199
- package/.sillyspec/changes/dashboard/design.md +0 -219
- package/.sillyspec/changes/dashboard/design.md.braindraft +0 -206
- package/.sillyspec/changes/run-command-design/design.md +0 -1230
- package/.sillyspec/changes/unified-docs-design/design.md +0 -199
- package/.sillyspec/docs/sillyspec/scan/.gitkeep +0 -0
- package/.sillyspec/knowledge/INDEX.md +0 -8
- package/.sillyspec/knowledge/uncategorized.md +0 -3
- package/.sillyspec/plans/2026-04-05-dashboard.md +0 -737
- package/.sillyspec/projects/sillyspec.yaml +0 -3
- package/dist/steps/brainstorm/01-load-context.md +0 -30
- package/dist/steps/brainstorm/02-reuse-check.md +0 -6
- package/dist/steps/brainstorm/03-prototype-analysis.md +0 -11
- package/dist/steps/brainstorm/04-module-split.md +0 -23
- package/dist/steps/brainstorm/05-dialog-explore.md +0 -8
- package/dist/steps/brainstorm/06-propose-approaches.md +0 -3
- package/dist/steps/brainstorm/07-present-design.md +0 -3
- package/dist/steps/brainstorm/08-write-design.md +0 -21
- package/dist/steps/brainstorm/09-self-review.md +0 -15
- package/dist/steps/brainstorm/10-user-confirm.md +0 -3
- package/dist/steps/brainstorm/11-output-spec.md +0 -7
- package/dist/steps/brainstorm/manifest.yaml +0 -26
- package/dist/steps/execute/01-load-context.md +0 -41
- package/dist/steps/execute/02-scan-conventions.md +0 -47
- package/dist/steps/execute/03-skill-mcp.md +0 -19
- package/dist/steps/execute/04-assign-task.md +0 -22
- package/dist/steps/execute/04b-prompt-template.md +0 -54
- package/dist/steps/execute/05-write-test.md +0 -7
- package/dist/steps/execute/06-write-code.md +0 -8
- package/dist/steps/execute/07-run-test.md +0 -26
- package/dist/steps/execute/08-fix-issues.md +0 -28
- package/dist/steps/execute/09-next-task.md +0 -33
- package/dist/steps/execute/manifest.yaml +0 -28
- package/dist/steps/plan/01-load-context.md +0 -22
- package/dist/steps/plan/02-anchor-confirm.md +0 -1
- package/dist/steps/plan/03-expand-tasks.md +0 -33
- package/dist/steps/plan/04-mark-order.md +0 -15
- package/dist/steps/plan/05-e2e-planning.md +0 -17
- package/dist/steps/plan/06-self-check.md +0 -16
- package/dist/steps/plan/07-save.md +0 -1
- package/dist/steps/plan/manifest.yaml +0 -18
- package/dist/steps/scan/01-env-detect.md +0 -51
- package/dist/steps/scan/02-tech-stack.md +0 -16
- package/dist/steps/scan/03-conventions.md +0 -16
- package/dist/steps/scan/04-structure.md +0 -19
- package/dist/steps/scan/05-quality.md +0 -18
- package/dist/steps/scan/06-complete.md +0 -49
- package/dist/steps/scan/manifest.yaml +0 -16
- package/dist/steps/verify/01-load-specs.md +0 -28
- package/dist/steps/verify/02-check-tasks.md +0 -1
- package/dist/steps/verify/03-check-design.md +0 -6
- package/dist/steps/verify/04-run-tests.md +0 -7
- package/dist/steps/verify/05-e2e-tests.md +0 -27
- package/dist/steps/verify/05b-e2e-fix.md +0 -33
- package/dist/steps/verify/06-code-quality.md +0 -25
- package/dist/steps/verify/07-lint-check.md +0 -27
- package/dist/steps/verify/08-output-report.md +0 -14
- package/dist/steps/verify/manifest.yaml +0 -22
- package/packages/dashboard/dist/assets/index-DGe8CqeP.css +0 -1
- package/src/derive.js +0 -147
- package/src/step.js +0 -543
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="flex flex-col h-full" style="background: #F5F5F7;">
|
|
3
|
-
<!-- Header -->
|
|
4
|
-
<div class="px-3 py-2 flex items-center gap-2" style="border-bottom: 1px solid #F0F0F3;">
|
|
5
|
-
<n-input v-model:value="searchQuery" size="tiny" placeholder="过滤日志..." clearable style="flex: 1;" />
|
|
6
|
-
<n-button size="tiny" @click="clearLogs">清空</n-button>
|
|
7
|
-
<n-button size="tiny" :type="autoScroll ? 'primary' : 'default'" @click="toggleAutoScroll">
|
|
8
|
-
{{ autoScroll ? '自动' : '暂停' }}
|
|
9
|
-
</n-button>
|
|
10
|
-
</div>
|
|
11
|
-
|
|
12
|
-
<!-- Log output -->
|
|
13
|
-
<div ref="logContainer" class="flex-1 overflow-y-auto px-2 py-1.5 font-mono-log text-[10px]" style="background: #F0F0F3;" @scroll="handleScroll">
|
|
14
|
-
<div v-if="filteredLogs.length === 0" class="flex items-center justify-center h-full">
|
|
15
|
-
<span class="font-mono-log" style="color: #E5E5EA;">{{ logs.length === 0 ? '暂无日志' : '无匹配' }}</span>
|
|
16
|
-
</div>
|
|
17
|
-
<div v-else class="space-y-px">
|
|
18
|
-
<div v-for="log in filteredLogs" :key="log.id" class="px-1.5 py-px rounded-sm" :style="{ background: logBg(log.type) }">
|
|
19
|
-
<span style="color: #D1D1D6;" class="select-none">[{{ formatTime(log.timestamp) }}]</span>
|
|
20
|
-
<span :style="{ color: logColor(log.type) }">{{ escapeHtml(log.content) }}</span>
|
|
21
|
-
</div>
|
|
22
|
-
</div>
|
|
23
|
-
</div>
|
|
24
|
-
|
|
25
|
-
<!-- Footer -->
|
|
26
|
-
<div class="px-3 py-1 flex items-center justify-between text-[9px] font-mono-log" style="border-top: 1px solid #F0F0F3; background: #F5F5F7; color: #D1D1D6;">
|
|
27
|
-
<span>{{ filteredLogs.length }}/{{ logs.length }}</span>
|
|
28
|
-
<span v-if="!autoScroll" style="color: #EA580C;">已暂停</span>
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
</template>
|
|
32
|
-
|
|
33
|
-
<script setup>
|
|
34
|
-
import { ref, computed, watch, nextTick } from 'vue'
|
|
35
|
-
|
|
36
|
-
const props = defineProps({ logs: { type: Array, default: () => [] } })
|
|
37
|
-
const emit = defineEmits(['clear'])
|
|
38
|
-
|
|
39
|
-
const searchQuery = ref('')
|
|
40
|
-
const autoScroll = ref(true)
|
|
41
|
-
const logContainer = ref(null)
|
|
42
|
-
|
|
43
|
-
const filteredLogs = computed(() => {
|
|
44
|
-
if (!searchQuery.value) return props.logs
|
|
45
|
-
const q = searchQuery.value.toLowerCase()
|
|
46
|
-
return props.logs.filter(l => l.content.toLowerCase().includes(q))
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
function formatTime(ts) { if (!ts) return ''; const d = new Date(ts); return d.toLocaleTimeString('zh-CN', { hour12: false }) }
|
|
50
|
-
function escapeHtml(t) { if (!t) return ''; return t.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>') }
|
|
51
|
-
function logBg(t) { return t === 'error' ? 'rgba(239,68,68,0.05)' : t === 'warn' ? 'rgba(251,146,60,0.05)' : 'transparent' }
|
|
52
|
-
function logColor(t) { return t === 'error' ? '#DC2626' : t === 'warn' ? '#EA580C' : t === 'debug' ? '#6B7280' : '#636366' }
|
|
53
|
-
function clearLogs() { emit('clear') }
|
|
54
|
-
function toggleAutoScroll() { autoScroll.value = !autoScroll.value; if (autoScroll.value) scrollToBottom() }
|
|
55
|
-
function handleScroll() {
|
|
56
|
-
if (!logContainer.value) return
|
|
57
|
-
const { scrollTop, scrollHeight, clientHeight } = logContainer.value
|
|
58
|
-
const atBottom = scrollHeight - scrollTop - clientHeight < 50
|
|
59
|
-
if (!atBottom && autoScroll.value) autoScroll.value = false
|
|
60
|
-
else if (atBottom && !autoScroll.value) autoScroll.value = true
|
|
61
|
-
}
|
|
62
|
-
function scrollToBottom() { nextTick(() => { if (logContainer.value && autoScroll.value) logContainer.value.scrollTop = logContainer.value.scrollHeight }) }
|
|
63
|
-
watch(() => props.logs.length, () => { scrollToBottom() }, { flush: 'post' })
|
|
64
|
-
watch(logContainer, () => { scrollToBottom() }, { once: true })
|
|
65
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex flex-col h-full" style="background: #F5F5F7;">
|
|
3
|
+
<!-- Header -->
|
|
4
|
+
<div class="px-3 py-2 flex items-center gap-2" style="border-bottom: 1px solid #F0F0F3;">
|
|
5
|
+
<n-input v-model:value="searchQuery" size="tiny" placeholder="过滤日志..." clearable style="flex: 1;" />
|
|
6
|
+
<n-button size="tiny" @click="clearLogs">清空</n-button>
|
|
7
|
+
<n-button size="tiny" :type="autoScroll ? 'primary' : 'default'" @click="toggleAutoScroll">
|
|
8
|
+
{{ autoScroll ? '自动' : '暂停' }}
|
|
9
|
+
</n-button>
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
<!-- Log output -->
|
|
13
|
+
<div ref="logContainer" class="flex-1 overflow-y-auto px-2 py-1.5 font-mono-log text-[10px]" style="background: #F0F0F3;" @scroll="handleScroll">
|
|
14
|
+
<div v-if="filteredLogs.length === 0" class="flex items-center justify-center h-full">
|
|
15
|
+
<span class="font-mono-log" style="color: #E5E5EA;">{{ logs.length === 0 ? '暂无日志' : '无匹配' }}</span>
|
|
16
|
+
</div>
|
|
17
|
+
<div v-else class="space-y-px">
|
|
18
|
+
<div v-for="log in filteredLogs" :key="log.id" class="px-1.5 py-px rounded-sm" :style="{ background: logBg(log.type) }">
|
|
19
|
+
<span style="color: #D1D1D6;" class="select-none">[{{ formatTime(log.timestamp) }}]</span>
|
|
20
|
+
<span :style="{ color: logColor(log.type) }">{{ escapeHtml(log.content) }}</span>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<!-- Footer -->
|
|
26
|
+
<div class="px-3 py-1 flex items-center justify-between text-[9px] font-mono-log" style="border-top: 1px solid #F0F0F3; background: #F5F5F7; color: #D1D1D6;">
|
|
27
|
+
<span>{{ filteredLogs.length }}/{{ logs.length }}</span>
|
|
28
|
+
<span v-if="!autoScroll" style="color: #EA580C;">已暂停</span>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<script setup>
|
|
34
|
+
import { ref, computed, watch, nextTick } from 'vue'
|
|
35
|
+
|
|
36
|
+
const props = defineProps({ logs: { type: Array, default: () => [] } })
|
|
37
|
+
const emit = defineEmits(['clear'])
|
|
38
|
+
|
|
39
|
+
const searchQuery = ref('')
|
|
40
|
+
const autoScroll = ref(true)
|
|
41
|
+
const logContainer = ref(null)
|
|
42
|
+
|
|
43
|
+
const filteredLogs = computed(() => {
|
|
44
|
+
if (!searchQuery.value) return props.logs
|
|
45
|
+
const q = searchQuery.value.toLowerCase()
|
|
46
|
+
return props.logs.filter(l => l.content.toLowerCase().includes(q))
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
function formatTime(ts) { if (!ts) return ''; const d = new Date(ts); return d.toLocaleTimeString('zh-CN', { hour12: false }) }
|
|
50
|
+
function escapeHtml(t) { if (!t) return ''; return t.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>') }
|
|
51
|
+
function logBg(t) { return t === 'error' ? 'rgba(239,68,68,0.05)' : t === 'warn' ? 'rgba(251,146,60,0.05)' : 'transparent' }
|
|
52
|
+
function logColor(t) { return t === 'error' ? '#DC2626' : t === 'warn' ? '#EA580C' : t === 'debug' ? '#6B7280' : '#636366' }
|
|
53
|
+
function clearLogs() { emit('clear') }
|
|
54
|
+
function toggleAutoScroll() { autoScroll.value = !autoScroll.value; if (autoScroll.value) scrollToBottom() }
|
|
55
|
+
function handleScroll() {
|
|
56
|
+
if (!logContainer.value) return
|
|
57
|
+
const { scrollTop, scrollHeight, clientHeight } = logContainer.value
|
|
58
|
+
const atBottom = scrollHeight - scrollTop - clientHeight < 50
|
|
59
|
+
if (!atBottom && autoScroll.value) autoScroll.value = false
|
|
60
|
+
else if (atBottom && !autoScroll.value) autoScroll.value = true
|
|
61
|
+
}
|
|
62
|
+
function scrollToBottom() { nextTick(() => { if (logContainer.value && autoScroll.value) logContainer.value.scrollTop = logContainer.value.scrollHeight }) }
|
|
63
|
+
watch(() => props.logs.length, () => { scrollToBottom() }, { flush: 'post' })
|
|
64
|
+
watch(logContainer, () => { scrollToBottom() }, { once: true })
|
|
65
|
+
</script>
|
|
@@ -1,75 +1,95 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="relative">
|
|
3
|
-
<div class="flex items-start gap-3">
|
|
4
|
-
<!-- Node indicator -->
|
|
5
|
-
<div class="flex flex-col items-center flex-shrink-0 pt-1.5">
|
|
6
|
-
<div
|
|
7
|
-
class="w-2 h-2 transition-colors duration-200"
|
|
8
|
-
:style="nodeStyle"
|
|
9
|
-
:class="{ 'animate-pulse-dot': isActive || status === 'in-progress' }"
|
|
10
|
-
/>
|
|
11
|
-
</div>
|
|
12
|
-
|
|
13
|
-
<!-- Content -->
|
|
14
|
-
<div class="flex-1 min-w-0 -mt-0.5">
|
|
15
|
-
<!-- Stage Header -->
|
|
16
|
-
<div class="flex items-center gap-2.5 mb-3">
|
|
17
|
-
<span
|
|
18
|
-
class="text-[12px] font-semibold font-[JetBrains_Mono,monospace] tracking-tight"
|
|
19
|
-
:style="{ color: isActive ? '#D97706' : '#1C1C1E' }"
|
|
20
|
-
>
|
|
21
|
-
{{ title }}
|
|
22
|
-
</span>
|
|
23
|
-
<StageBadge :status="status" />
|
|
24
|
-
</div>
|
|
25
|
-
|
|
26
|
-
<!-- Steps -->
|
|
27
|
-
<div class="
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div class="relative">
|
|
3
|
+
<div class="flex items-start gap-3">
|
|
4
|
+
<!-- Node indicator -->
|
|
5
|
+
<div class="flex flex-col items-center flex-shrink-0 pt-1.5">
|
|
6
|
+
<div
|
|
7
|
+
class="w-2 h-2 transition-colors duration-200"
|
|
8
|
+
:style="nodeStyle"
|
|
9
|
+
:class="{ 'animate-pulse-dot': isActive || status === 'in-progress' }"
|
|
10
|
+
/>
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
<!-- Content -->
|
|
14
|
+
<div class="flex-1 min-w-0 -mt-0.5">
|
|
15
|
+
<!-- Stage Header -->
|
|
16
|
+
<div class="flex items-center gap-2.5 mb-3">
|
|
17
|
+
<span
|
|
18
|
+
class="text-[12px] font-semibold font-[JetBrains_Mono,monospace] tracking-tight"
|
|
19
|
+
:style="{ color: isActive ? '#D97706' : '#1C1C1E' }"
|
|
20
|
+
>
|
|
21
|
+
{{ title }}
|
|
22
|
+
</span>
|
|
23
|
+
<StageBadge :status="status" />
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<!-- Steps -->
|
|
27
|
+
<div v-if="status === 'stale' && staleReason" class="mb-2 text-[10px] italic" style="color: #CA8A04;">
|
|
28
|
+
⚠️ {{ staleReason }}
|
|
29
|
+
<span v-if="name === 'archive'">(已有归档文件保留但不再可信)</span>
|
|
30
|
+
</div>
|
|
31
|
+
<div v-if="status === 'revising' && revisionInfo" class="mb-2 text-[10px]" style="color: #7C3AED;">
|
|
32
|
+
🔧 {{ revisionInfo }}
|
|
33
|
+
</div>
|
|
34
|
+
<div class="space-y-1">
|
|
35
|
+
<div v-if="steps.length === 0" class="text-[11px] italic py-1" style="color: #6B7280;">
|
|
36
|
+
No steps yet
|
|
37
|
+
</div>
|
|
38
|
+
<StepCard
|
|
39
|
+
v-for="step in steps"
|
|
40
|
+
:key="step.id || step.name"
|
|
41
|
+
:step="step"
|
|
42
|
+
:is-active="isActiveStep(step)"
|
|
43
|
+
@select="$emit('select-step', $event)"
|
|
44
|
+
/>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</template>
|
|
50
|
+
|
|
51
|
+
<script setup>
|
|
52
|
+
import { computed } from 'vue'
|
|
53
|
+
import StageBadge from './StageBadge.vue'
|
|
54
|
+
import StepCard from './StepCard.vue'
|
|
55
|
+
|
|
56
|
+
const props = defineProps({
|
|
57
|
+
name: { type: String, required: true },
|
|
58
|
+
title: { type: String, required: true },
|
|
59
|
+
steps: { type: Array, default: () => [] },
|
|
60
|
+
status: { type: String, default: 'pending' },
|
|
61
|
+
isActive: { type: Boolean, default: false },
|
|
62
|
+
activeStep: { type: Object, default: null },
|
|
63
|
+
staleReason: { type: String, default: '' },
|
|
64
|
+
revision: { type: Number, default: 0 },
|
|
65
|
+
reopenedFromStep: { type: String, default: '' },
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
const emit = defineEmits(['select-step'])
|
|
69
|
+
|
|
70
|
+
const revisionInfo = computed(() => {
|
|
71
|
+
if (!props.revision) return ''
|
|
72
|
+
const parts = [`revision ${props.revision}`]
|
|
73
|
+
if (props.reopenedFromStep) parts.push(`from: ${props.reopenedFromStep}`)
|
|
74
|
+
return parts.join(', ')
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
const nodeStyle = computed(() => {
|
|
78
|
+
if (props.isActive) return { background: '#D97706', boxShadow: '0 0 8px rgba(251,191,36,0.4)' }
|
|
79
|
+
const colors = {
|
|
80
|
+
'completed': '#16A34A',
|
|
81
|
+
'in-progress': '#D97706',
|
|
82
|
+
'blocked': '#EA580C',
|
|
83
|
+
'failed': '#DC2626',
|
|
84
|
+
'pending': '#E5E5EA',
|
|
85
|
+
'revising': '#7C3AED',
|
|
86
|
+
'stale': '#CA8A04',
|
|
87
|
+
'waiting': '#2563EB',
|
|
88
|
+
}
|
|
89
|
+
return { background: colors[props.status] || colors.pending }
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
function isActiveStep(step) {
|
|
93
|
+
return props.activeStep?.id === step.id || props.activeStep?.name === step.name
|
|
94
|
+
}
|
|
95
|
+
</script>
|
|
@@ -1,129 +1,156 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="flex flex-col h-full" style="background: #F5F5F7;">
|
|
3
|
-
<!-- Header with Tabs -->
|
|
4
|
-
<div class="px-6 pt-4 pb-0" style="border-bottom: 1px solid #F0F0F3;">
|
|
5
|
-
<div class="flex items-center gap-6">
|
|
6
|
-
<h2 class="text-[11px] font-semibold uppercase tracking-[0.2em] font-[JetBrains_Mono,monospace]" style="color: #6B7280;">
|
|
7
|
-
{{ project?.name || '项目' }}
|
|
8
|
-
</h2>
|
|
9
|
-
<n-tabs :value="activeTab" type="segment" size="small" @update:value="$emit('switch-tab', $event)" style="max-width: 200px;">
|
|
10
|
-
<n-tab name="pipeline">流水线</n-tab>
|
|
11
|
-
<n-tab name="docs">文档</n-tab>
|
|
12
|
-
</n-tabs>
|
|
13
|
-
</div>
|
|
14
|
-
</div>
|
|
15
|
-
|
|
16
|
-
<!-- Pipeline Tab -->
|
|
17
|
-
<div v-if="activeTab === 'pipeline'" class="flex flex-col flex-1 overflow-hidden">
|
|
18
|
-
<div v-if="project && currentStage" class="px-6 pt-4 pb-2">
|
|
19
|
-
<p class="text-[12px] font-[JetBrains_Mono,monospace]" style="color: #636366;">
|
|
20
|
-
<span style="color: #D97706;">{{ currentStage }}</span>
|
|
21
|
-
</p>
|
|
22
|
-
</div>
|
|
23
|
-
|
|
24
|
-
<!-- Empty state -->
|
|
25
|
-
<n-empty v-if="!project || !project.state" description="选择一个项目查看流水线" style="margin: auto;" />
|
|
26
|
-
|
|
27
|
-
<!-- Stages -->
|
|
28
|
-
<div v-else class="flex-1 overflow-y-auto px-6 pb-5 space-y-5">
|
|
29
|
-
<PipelineStage name="
|
|
30
|
-
<div v-if="hasStage('
|
|
31
|
-
<PipelineStage name="
|
|
32
|
-
<div v-if="hasStage('
|
|
33
|
-
<PipelineStage name="
|
|
34
|
-
<div v-if="hasStage('
|
|
35
|
-
<PipelineStage name="
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
<div class="px-6
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
})
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}
|
|
128
|
-
function
|
|
129
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex flex-col h-full" style="background: #F5F5F7;">
|
|
3
|
+
<!-- Header with Tabs -->
|
|
4
|
+
<div class="px-6 pt-4 pb-0" style="border-bottom: 1px solid #F0F0F3;">
|
|
5
|
+
<div class="flex items-center gap-6">
|
|
6
|
+
<h2 class="text-[11px] font-semibold uppercase tracking-[0.2em] font-[JetBrains_Mono,monospace]" style="color: #6B7280;">
|
|
7
|
+
{{ project?.name || '项目' }}
|
|
8
|
+
</h2>
|
|
9
|
+
<n-tabs :value="activeTab" type="segment" size="small" @update:value="$emit('switch-tab', $event)" style="max-width: 200px;">
|
|
10
|
+
<n-tab name="pipeline">流水线</n-tab>
|
|
11
|
+
<n-tab name="docs">文档</n-tab>
|
|
12
|
+
</n-tabs>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<!-- Pipeline Tab -->
|
|
17
|
+
<div v-if="activeTab === 'pipeline'" class="flex flex-col flex-1 overflow-hidden">
|
|
18
|
+
<div v-if="project && currentStage" class="px-6 pt-4 pb-2">
|
|
19
|
+
<p class="text-[12px] font-[JetBrains_Mono,monospace]" style="color: #636366;">
|
|
20
|
+
<span style="color: #D97706;">{{ currentStage }}</span>
|
|
21
|
+
</p>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<!-- Empty state -->
|
|
25
|
+
<n-empty v-if="!project || !project.state" description="选择一个项目查看流水线" style="margin: auto;" />
|
|
26
|
+
|
|
27
|
+
<!-- Stages -->
|
|
28
|
+
<div v-else class="flex-1 overflow-y-auto px-6 pb-5 space-y-5">
|
|
29
|
+
<PipelineStage name="scan" title="代码扫描" :steps="getStageSteps('scan')" :status="getStageStatus('scan')" :is-active="currentStage === 'scan'" :active-step="activeStep" @select-step="handleSelectStep" />
|
|
30
|
+
<div v-if="hasStage('brainstorm')" class="flex items-center pl-[3px]"><div class="w-px h-4" style="background: #F0F0F3;" /></div>
|
|
31
|
+
<PipelineStage name="brainstorm" title="头脑风暴" :steps="getStageSteps('brainstorm')" :status="getStageStatus('brainstorm')" :is-active="currentStage === 'brainstorm'" :active-step="activeStep" @select-step="handleSelectStep" />
|
|
32
|
+
<div v-if="hasStage('plan')" class="flex items-center pl-[3px]"><div class="w-px h-4" style="background: #F0F0F3;" /></div>
|
|
33
|
+
<PipelineStage name="plan" title="规划" :steps="getStageSteps('plan')" :status="getStageStatus('plan')" :is-active="currentStage === 'plan'" :active-step="activeStep" @select-step="handleSelectStep" />
|
|
34
|
+
<div v-if="hasStage('execute')" class="flex items-center pl-[3px]"><div class="w-px h-4" style="background: #F0F0F3;" /></div>
|
|
35
|
+
<PipelineStage name="execute" title="执行" :steps="getStageSteps('execute')" :status="getStageStatus('execute')" :is-active="currentStage === 'execute'" :active-step="activeStep" @select-step="handleSelectStep" />
|
|
36
|
+
<div v-if="hasStage('verify')" class="flex items-center pl-[3px]"><div class="w-px h-4" style="background: #F0F0F3;" /></div>
|
|
37
|
+
<PipelineStage name="verify" title="验证" :steps="getStageSteps('verify')" :status="getStageStatus('verify')" :is-active="currentStage === 'verify'" :active-step="activeStep" @select-step="handleSelectStep" />
|
|
38
|
+
<div v-if="hasStage('archive')" class="flex items-center pl-[3px]"><div class="w-px h-4" style="background: #F0F0F3;" /></div>
|
|
39
|
+
<PipelineStage name="archive" title="归档" :steps="getStageSteps('archive')" :status="getStageStatus('archive')" :is-active="currentStage === 'archive'" :active-step="activeStep" :stale-reason="getStageStaleReason('archive')" :revision="getStageRevision('archive')" :reopened-from-step="getStageReopenedFromStep('archive')" @select-step="handleSelectStep" />
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<!-- Activity Log -->
|
|
43
|
+
<div v-if="project?.state?.progress" style="border-top: 1px solid #F0F0F3; background: rgba(0,0,0,0.03);">
|
|
44
|
+
<div class="px-6 py-2.5 flex items-center justify-between">
|
|
45
|
+
<div class="text-[9px] font-semibold uppercase tracking-[0.25em] font-[JetBrains_Mono,monospace]" style="color: #6B7280;">活动日志</div>
|
|
46
|
+
<div class="text-[10px] font-mono-log" style="color: #D1D1D6;">{{ activityLogs.length }}</div>
|
|
47
|
+
</div>
|
|
48
|
+
<div class="px-6 pb-3 max-h-32 overflow-y-auto">
|
|
49
|
+
<n-timeline size="small">
|
|
50
|
+
<n-timeline-item
|
|
51
|
+
v-for="(log, i) in activityLogs"
|
|
52
|
+
:key="i"
|
|
53
|
+
:type="log.status === 'completed' ? 'success' : (log.status === 'stale' ? 'warning' : (log.status === 'revising' ? 'info' : 'default'))"
|
|
54
|
+
>
|
|
55
|
+
<template #default>
|
|
56
|
+
<span class="text-[11px]" style="color: #636366;">{{ log.description }}</span>
|
|
57
|
+
</template>
|
|
58
|
+
<template #time>
|
|
59
|
+
<span class="text-[10px] font-mono-log" style="color: #D1D1D6;">{{ log.time }}</span>
|
|
60
|
+
</template>
|
|
61
|
+
</n-timeline-item>
|
|
62
|
+
</n-timeline>
|
|
63
|
+
<div v-if="activityLogs.length === 0" class="text-[10px] py-1" style="color: #D1D1D6;">暂无活动记录</div>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
<!-- Docs Tab -->
|
|
69
|
+
<div v-if="activeTab === 'docs'" class="docs-panel flex-1 flex overflow-hidden">
|
|
70
|
+
<div class="docs-tree-pane flex-shrink-0 overflow-hidden" style="border-right: 1px solid #F0F0F3;">
|
|
71
|
+
<DocTree :groups="docs.groups" :selected-file="selectedDocFile" @select-file="$emit('select-doc-file', $event)" />
|
|
72
|
+
</div>
|
|
73
|
+
<div class="flex-1 overflow-hidden">
|
|
74
|
+
<DocPreview :content="docContent" :loading="docLoading" :selected-file="selectedDocFile" />
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
</template>
|
|
79
|
+
|
|
80
|
+
<script setup>
|
|
81
|
+
import { computed } from 'vue'
|
|
82
|
+
import PipelineStage from './PipelineStage.vue'
|
|
83
|
+
import DocTree from './DocTree.vue'
|
|
84
|
+
import DocPreview from './DocPreview.vue'
|
|
85
|
+
|
|
86
|
+
const props = defineProps({
|
|
87
|
+
project: { type: Object, default: null },
|
|
88
|
+
activeStep: { type: Object, default: null },
|
|
89
|
+
activeTab: { type: String, default: 'pipeline' },
|
|
90
|
+
docs: { type: Object, default: () => ({ groups: [] }) },
|
|
91
|
+
selectedDocFile: { type: Object, default: null },
|
|
92
|
+
docContent: { type: String, default: '' },
|
|
93
|
+
docLoading: { type: Boolean, default: false }
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
const emit = defineEmits(['select-step', 'switch-tab', 'select-doc-file'])
|
|
97
|
+
|
|
98
|
+
const currentStage = computed(() => props.project?.state?.currentStage || '')
|
|
99
|
+
const progress = computed(() => props.project?.state?.progress || {})
|
|
100
|
+
const stages = computed(() => progress.value.stages || {})
|
|
101
|
+
|
|
102
|
+
const stageNameMap = {
|
|
103
|
+
scan: '代码扫描',
|
|
104
|
+
brainstorm: '头脑风暴',
|
|
105
|
+
plan: '规划',
|
|
106
|
+
execute: '执行',
|
|
107
|
+
verify: '验证',
|
|
108
|
+
archive: '归档',
|
|
109
|
+
quick: '快速任务',
|
|
110
|
+
explore: '自由探索'
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const activityLogs = computed(() => {
|
|
114
|
+
if (!props.project?.state) return []
|
|
115
|
+
const logs = []
|
|
116
|
+
for (const [name, data] of Object.entries(progress.value.stages || {})) {
|
|
117
|
+
const label = stageNameMap[name] || name
|
|
118
|
+
if (data.status === 'completed') logs.push({ time: data.completedAt ? formatTime(data.completedAt) : '--:--', status: 'completed', description: `${label} 已完成` })
|
|
119
|
+
else if (data.status === 'in-progress') logs.push({ time: '--:--', status: 'in-progress', description: `${label} 运行中` })
|
|
120
|
+
else if (data.status === 'revising') logs.push({ time: '--:--', status: 'revising', description: `${label} 修订中 (revision ${data.revision || 1})` })
|
|
121
|
+
else if (data.status === 'stale') logs.push({ time: '--:--', status: 'stale', description: `${label} 已失效:${data.staleReason || '上游修订'}` })
|
|
122
|
+
}
|
|
123
|
+
return logs.reverse()
|
|
124
|
+
})
|
|
125
|
+
|
|
126
|
+
function formatTime(iso) { try { const d = new Date(iso); return `${String(d.getHours()).padStart(2,'0')}:${String(d.getMinutes()).padStart(2,'0')}` } catch { return '--:--' } }
|
|
127
|
+
function hasStage(n) { return !!stages.value[n] }
|
|
128
|
+
function getStageSteps(n) { return stages.value[n]?.steps || [] }
|
|
129
|
+
function getStageStatus(n) {
|
|
130
|
+
const s = stages.value[n]; if (!s) return 'pending'
|
|
131
|
+
// 优先用 stage 自身的 status(支持 revising/stale)
|
|
132
|
+
if (s.status === 'revising' || s.status === 'stale') return s.status
|
|
133
|
+
// 没有明确 status 时从 step 推导
|
|
134
|
+
const steps = s.steps || []
|
|
135
|
+
if (steps.some(x => x.status === 'failed')) return 'failed'
|
|
136
|
+
if (steps.some(x => x.status === 'blocked')) return 'blocked'
|
|
137
|
+
if (steps.some(x => x.status === 'in-progress')) return 'in-progress'
|
|
138
|
+
if (steps.every(x => x.status === 'completed')) return 'completed'
|
|
139
|
+
return 'pending'
|
|
140
|
+
}
|
|
141
|
+
function getStageStaleReason(n) { return stages.value[n]?.staleReason || '' }
|
|
142
|
+
function getStageRevision(n) { return stages.value[n]?.revision || 0 }
|
|
143
|
+
function getStageReopenedFromStep(n) { return stages.value[n]?.reopenedFromStep || '' }
|
|
144
|
+
function handleSelectStep(step) { emit('select-step', step) }
|
|
145
|
+
</script>
|
|
146
|
+
|
|
147
|
+
<style scoped>
|
|
148
|
+
.docs-panel {
|
|
149
|
+
min-height: 0;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.docs-tree-pane {
|
|
153
|
+
width: clamp(220px, 42%, 320px);
|
|
154
|
+
min-width: 180px;
|
|
155
|
+
}
|
|
156
|
+
</style>
|