orbital-command 0.1.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/LICENSE +21 -0
- package/README.md +396 -0
- package/bin/orbital.js +362 -0
- package/dist/assets/WorkflowVisualizer-BZ21PIIF.js +84 -0
- package/dist/assets/WorkflowVisualizer-BZV40eAE.css +1 -0
- package/dist/assets/charts-D__PA1zp.js +72 -0
- package/dist/assets/index-D1G6i0nS.css +1 -0
- package/dist/assets/index-DpItvKpf.js +419 -0
- package/dist/assets/ui-BvF022GT.js +53 -0
- package/dist/assets/vendor-Dzv9lrRc.js +59 -0
- package/dist/index.html +19 -0
- package/dist/scanner-sweep.png +0 -0
- package/dist/server/server/adapters/index.js +34 -0
- package/dist/server/server/adapters/iterm2-adapter.js +29 -0
- package/dist/server/server/adapters/subprocess-adapter.js +21 -0
- package/dist/server/server/adapters/terminal-adapter.js +1 -0
- package/dist/server/server/config.js +156 -0
- package/dist/server/server/database.js +90 -0
- package/dist/server/server/index.js +372 -0
- package/dist/server/server/init.js +811 -0
- package/dist/server/server/parsers/event-parser.js +64 -0
- package/dist/server/server/parsers/scope-parser.js +188 -0
- package/dist/server/server/routes/config-routes.js +163 -0
- package/dist/server/server/routes/data-routes.js +461 -0
- package/dist/server/server/routes/dispatch-routes.js +215 -0
- package/dist/server/server/routes/git-routes.js +92 -0
- package/dist/server/server/routes/scope-routes.js +215 -0
- package/dist/server/server/routes/sprint-routes.js +116 -0
- package/dist/server/server/routes/version-routes.js +130 -0
- package/dist/server/server/routes/workflow-routes.js +185 -0
- package/dist/server/server/schema.js +90 -0
- package/dist/server/server/services/batch-orchestrator.js +253 -0
- package/dist/server/server/services/claude-session-service.js +352 -0
- package/dist/server/server/services/config-service.js +132 -0
- package/dist/server/server/services/deploy-service.js +51 -0
- package/dist/server/server/services/event-service.js +63 -0
- package/dist/server/server/services/gate-service.js +83 -0
- package/dist/server/server/services/git-service.js +309 -0
- package/dist/server/server/services/github-service.js +145 -0
- package/dist/server/server/services/readiness-service.js +184 -0
- package/dist/server/server/services/scope-cache.js +72 -0
- package/dist/server/server/services/scope-service.js +424 -0
- package/dist/server/server/services/sprint-orchestrator.js +312 -0
- package/dist/server/server/services/sprint-service.js +293 -0
- package/dist/server/server/services/workflow-service.js +397 -0
- package/dist/server/server/utils/cc-hooks-parser.js +49 -0
- package/dist/server/server/utils/dispatch-utils.js +305 -0
- package/dist/server/server/utils/logger.js +86 -0
- package/dist/server/server/utils/terminal-launcher.js +388 -0
- package/dist/server/server/utils/worktree-manager.js +98 -0
- package/dist/server/server/watchers/event-watcher.js +81 -0
- package/dist/server/server/watchers/scope-watcher.js +33 -0
- package/dist/server/shared/api-types.js +5 -0
- package/dist/server/shared/default-workflow.json +616 -0
- package/dist/server/shared/workflow-config.js +44 -0
- package/dist/server/shared/workflow-engine.js +353 -0
- package/index.html +15 -0
- package/package.json +110 -0
- package/postcss.config.js +6 -0
- package/schemas/orbital.config.schema.json +83 -0
- package/scripts/postinstall.js +24 -0
- package/scripts/start.sh +20 -0
- package/server/adapters/index.ts +41 -0
- package/server/adapters/iterm2-adapter.ts +37 -0
- package/server/adapters/subprocess-adapter.ts +25 -0
- package/server/adapters/terminal-adapter.ts +24 -0
- package/server/config.ts +234 -0
- package/server/database.ts +107 -0
- package/server/index.ts +452 -0
- package/server/init.ts +891 -0
- package/server/parsers/event-parser.ts +74 -0
- package/server/parsers/scope-parser.ts +240 -0
- package/server/routes/config-routes.ts +182 -0
- package/server/routes/data-routes.ts +548 -0
- package/server/routes/dispatch-routes.ts +275 -0
- package/server/routes/git-routes.ts +112 -0
- package/server/routes/scope-routes.ts +262 -0
- package/server/routes/sprint-routes.ts +142 -0
- package/server/routes/version-routes.ts +156 -0
- package/server/routes/workflow-routes.ts +198 -0
- package/server/schema.ts +90 -0
- package/server/services/batch-orchestrator.ts +286 -0
- package/server/services/claude-session-service.ts +441 -0
- package/server/services/config-service.ts +151 -0
- package/server/services/deploy-service.ts +98 -0
- package/server/services/event-service.ts +98 -0
- package/server/services/gate-service.ts +126 -0
- package/server/services/git-service.ts +391 -0
- package/server/services/github-service.ts +183 -0
- package/server/services/readiness-service.ts +250 -0
- package/server/services/scope-cache.ts +81 -0
- package/server/services/scope-service.ts +476 -0
- package/server/services/sprint-orchestrator.ts +361 -0
- package/server/services/sprint-service.ts +415 -0
- package/server/services/workflow-service.ts +461 -0
- package/server/utils/cc-hooks-parser.ts +70 -0
- package/server/utils/dispatch-utils.ts +395 -0
- package/server/utils/logger.ts +109 -0
- package/server/utils/terminal-launcher.ts +462 -0
- package/server/utils/worktree-manager.ts +104 -0
- package/server/watchers/event-watcher.ts +100 -0
- package/server/watchers/scope-watcher.ts +38 -0
- package/shared/api-types.ts +20 -0
- package/shared/default-workflow.json +616 -0
- package/shared/workflow-config.ts +170 -0
- package/shared/workflow-engine.ts +427 -0
- package/src/App.tsx +33 -0
- package/src/components/AgentBadge.tsx +40 -0
- package/src/components/BatchPreflightModal.tsx +115 -0
- package/src/components/CardDisplayToggle.tsx +74 -0
- package/src/components/ColumnHeaderActions.tsx +55 -0
- package/src/components/ColumnMenu.tsx +99 -0
- package/src/components/DeployHistory.tsx +141 -0
- package/src/components/DispatchModal.tsx +164 -0
- package/src/components/DispatchPopover.tsx +139 -0
- package/src/components/DragOverlay.tsx +25 -0
- package/src/components/DriftSidebar.tsx +140 -0
- package/src/components/EnvironmentStrip.tsx +88 -0
- package/src/components/ErrorBoundary.tsx +62 -0
- package/src/components/FilterChip.tsx +105 -0
- package/src/components/GateIndicator.tsx +33 -0
- package/src/components/IdeaDetailModal.tsx +190 -0
- package/src/components/IdeaFormDialog.tsx +113 -0
- package/src/components/KanbanColumn.tsx +201 -0
- package/src/components/MarkdownRenderer.tsx +114 -0
- package/src/components/NeonGrid.tsx +128 -0
- package/src/components/PromotionQueue.tsx +89 -0
- package/src/components/ScopeCard.tsx +234 -0
- package/src/components/ScopeDetailModal.tsx +255 -0
- package/src/components/ScopeFilterBar.tsx +152 -0
- package/src/components/SearchInput.tsx +102 -0
- package/src/components/SessionPanel.tsx +335 -0
- package/src/components/SprintContainer.tsx +303 -0
- package/src/components/SprintDependencyDialog.tsx +78 -0
- package/src/components/SprintPreflightModal.tsx +138 -0
- package/src/components/StatusBar.tsx +168 -0
- package/src/components/SwimCell.tsx +67 -0
- package/src/components/SwimLaneRow.tsx +94 -0
- package/src/components/SwimlaneBoardView.tsx +108 -0
- package/src/components/VersionBadge.tsx +139 -0
- package/src/components/ViewModeSelector.tsx +114 -0
- package/src/components/config/AgentChip.tsx +53 -0
- package/src/components/config/AgentCreateDialog.tsx +321 -0
- package/src/components/config/AgentEditor.tsx +175 -0
- package/src/components/config/DirectoryTree.tsx +582 -0
- package/src/components/config/FileEditor.tsx +550 -0
- package/src/components/config/HookChip.tsx +50 -0
- package/src/components/config/StageCard.tsx +198 -0
- package/src/components/config/TransitionZone.tsx +173 -0
- package/src/components/config/UnifiedWorkflowPipeline.tsx +216 -0
- package/src/components/config/WorkflowPipeline.tsx +161 -0
- package/src/components/source-control/BranchList.tsx +93 -0
- package/src/components/source-control/BranchPanel.tsx +105 -0
- package/src/components/source-control/CommitLog.tsx +100 -0
- package/src/components/source-control/CommitRow.tsx +47 -0
- package/src/components/source-control/GitHubPanel.tsx +110 -0
- package/src/components/source-control/GitHubSetupGuide.tsx +52 -0
- package/src/components/source-control/GitOverviewBar.tsx +101 -0
- package/src/components/source-control/PullRequestList.tsx +69 -0
- package/src/components/source-control/WorktreeList.tsx +80 -0
- package/src/components/ui/badge.tsx +41 -0
- package/src/components/ui/button.tsx +55 -0
- package/src/components/ui/card.tsx +78 -0
- package/src/components/ui/dialog.tsx +94 -0
- package/src/components/ui/popover.tsx +33 -0
- package/src/components/ui/scroll-area.tsx +54 -0
- package/src/components/ui/separator.tsx +28 -0
- package/src/components/ui/tabs.tsx +52 -0
- package/src/components/ui/toggle-switch.tsx +35 -0
- package/src/components/ui/tooltip.tsx +27 -0
- package/src/components/workflow/AddEdgeDialog.tsx +217 -0
- package/src/components/workflow/AddListDialog.tsx +201 -0
- package/src/components/workflow/ChecklistEditor.tsx +239 -0
- package/src/components/workflow/CommandPrefixManager.tsx +118 -0
- package/src/components/workflow/ConfigSettingsPanel.tsx +189 -0
- package/src/components/workflow/DirectionSelector.tsx +133 -0
- package/src/components/workflow/DispatchConfigPanel.tsx +180 -0
- package/src/components/workflow/EdgeDetailPanel.tsx +236 -0
- package/src/components/workflow/EdgePropertyEditor.tsx +251 -0
- package/src/components/workflow/EditToolbar.tsx +138 -0
- package/src/components/workflow/HookDetailPanel.tsx +250 -0
- package/src/components/workflow/HookExecutionLog.tsx +24 -0
- package/src/components/workflow/HookSourceModal.tsx +129 -0
- package/src/components/workflow/HooksDashboard.tsx +363 -0
- package/src/components/workflow/ListPropertyEditor.tsx +251 -0
- package/src/components/workflow/MigrationPreviewDialog.tsx +237 -0
- package/src/components/workflow/MovementRulesPanel.tsx +188 -0
- package/src/components/workflow/NodeDetailPanel.tsx +245 -0
- package/src/components/workflow/PresetSelector.tsx +414 -0
- package/src/components/workflow/SkillCommandBuilder.tsx +174 -0
- package/src/components/workflow/WorkflowEdgeComponent.tsx +145 -0
- package/src/components/workflow/WorkflowNode.tsx +147 -0
- package/src/components/workflow/graphLayout.ts +186 -0
- package/src/components/workflow/mergeHooks.ts +85 -0
- package/src/components/workflow/useEditHistory.ts +88 -0
- package/src/components/workflow/useWorkflowEditor.ts +262 -0
- package/src/components/workflow/validateConfig.ts +70 -0
- package/src/hooks/useActiveDispatches.ts +198 -0
- package/src/hooks/useBoardSettings.ts +170 -0
- package/src/hooks/useCardDisplay.ts +57 -0
- package/src/hooks/useCcHooks.ts +24 -0
- package/src/hooks/useConfigTree.ts +51 -0
- package/src/hooks/useEnforcementRules.ts +46 -0
- package/src/hooks/useEvents.ts +59 -0
- package/src/hooks/useFileEditor.ts +165 -0
- package/src/hooks/useGates.ts +57 -0
- package/src/hooks/useIdeaActions.ts +53 -0
- package/src/hooks/useKanbanDnd.ts +410 -0
- package/src/hooks/useOrbitalConfig.ts +54 -0
- package/src/hooks/usePipeline.ts +47 -0
- package/src/hooks/usePipelineData.ts +338 -0
- package/src/hooks/useReconnect.ts +25 -0
- package/src/hooks/useScopeFilters.ts +125 -0
- package/src/hooks/useScopeSessions.ts +44 -0
- package/src/hooks/useScopes.ts +67 -0
- package/src/hooks/useSearch.ts +67 -0
- package/src/hooks/useSettings.tsx +187 -0
- package/src/hooks/useSocket.ts +25 -0
- package/src/hooks/useSourceControl.ts +105 -0
- package/src/hooks/useSprintPreflight.ts +55 -0
- package/src/hooks/useSprints.ts +154 -0
- package/src/hooks/useStatusBarHighlight.ts +18 -0
- package/src/hooks/useSwimlaneBoardSettings.ts +104 -0
- package/src/hooks/useTheme.ts +9 -0
- package/src/hooks/useTransitionReadiness.ts +53 -0
- package/src/hooks/useVersion.ts +155 -0
- package/src/hooks/useViolations.ts +65 -0
- package/src/hooks/useWorkflow.tsx +125 -0
- package/src/hooks/useZoomModifier.ts +19 -0
- package/src/index.css +797 -0
- package/src/layouts/DashboardLayout.tsx +113 -0
- package/src/lib/collisionDetection.ts +20 -0
- package/src/lib/scope-fields.ts +61 -0
- package/src/lib/swimlane.ts +146 -0
- package/src/lib/utils.ts +15 -0
- package/src/main.tsx +19 -0
- package/src/socket.ts +11 -0
- package/src/types/index.ts +497 -0
- package/src/views/AgentFeed.tsx +339 -0
- package/src/views/DeployPipeline.tsx +59 -0
- package/src/views/EnforcementView.tsx +378 -0
- package/src/views/PrimitivesConfig.tsx +500 -0
- package/src/views/QualityGates.tsx +1012 -0
- package/src/views/ScopeBoard.tsx +454 -0
- package/src/views/SessionTimeline.tsx +516 -0
- package/src/views/Settings.tsx +183 -0
- package/src/views/SourceControl.tsx +95 -0
- package/src/views/WorkflowVisualizer.tsx +382 -0
- package/tailwind.config.js +161 -0
- package/templates/agents/AUTO-INVOKE.md +180 -0
- package/templates/agents/CONFLICT-RESOLUTION.md +128 -0
- package/templates/agents/QUICK-REFERENCE.md +122 -0
- package/templates/agents/README.md +188 -0
- package/templates/agents/SKILL-TRIGGERS.md +100 -0
- package/templates/agents/blue-team/frontend-designer.md +424 -0
- package/templates/agents/green-team/architect.md +526 -0
- package/templates/agents/green-team/rules-enforcer.md +131 -0
- package/templates/agents/red-team/attacker-learned.md +24 -0
- package/templates/agents/red-team/attacker.md +486 -0
- package/templates/agents/red-team/chaos.md +548 -0
- package/templates/agents/reference/component-registry.md +82 -0
- package/templates/agents/workflows/full-mode.md +218 -0
- package/templates/agents/workflows/quick-mode.md +118 -0
- package/templates/agents/workflows/security-mode.md +283 -0
- package/templates/anti-patterns/dangerous-shortcuts.md +427 -0
- package/templates/config/agent-triggers.json +92 -0
- package/templates/hooks/agent-team-gate.sh +31 -0
- package/templates/hooks/agent-trigger.sh +97 -0
- package/templates/hooks/block-push.sh +66 -0
- package/templates/hooks/block-workarounds.sh +61 -0
- package/templates/hooks/blocker-check.sh +28 -0
- package/templates/hooks/completion-checklist.sh +28 -0
- package/templates/hooks/decision-capture.sh +15 -0
- package/templates/hooks/dependency-check.sh +27 -0
- package/templates/hooks/end-session.sh +31 -0
- package/templates/hooks/exploration-logger.sh +37 -0
- package/templates/hooks/files-changed-summary.sh +37 -0
- package/templates/hooks/get-session-id.sh +49 -0
- package/templates/hooks/git-commit-guard.sh +34 -0
- package/templates/hooks/init-session.sh +93 -0
- package/templates/hooks/orbital-emit.sh +79 -0
- package/templates/hooks/orbital-report-deploy.sh +78 -0
- package/templates/hooks/orbital-report-gates.sh +40 -0
- package/templates/hooks/orbital-report-violation.sh +36 -0
- package/templates/hooks/orbital-scope-update.sh +53 -0
- package/templates/hooks/phase-verify-reminder.sh +26 -0
- package/templates/hooks/review-gate-check.sh +82 -0
- package/templates/hooks/scope-commit-logger.sh +37 -0
- package/templates/hooks/scope-create-cleanup.sh +36 -0
- package/templates/hooks/scope-create-gate.sh +80 -0
- package/templates/hooks/scope-create-tracker.sh +17 -0
- package/templates/hooks/scope-file-sync.sh +53 -0
- package/templates/hooks/scope-gate.sh +35 -0
- package/templates/hooks/scope-helpers.sh +188 -0
- package/templates/hooks/scope-lifecycle-gate.sh +139 -0
- package/templates/hooks/scope-prepare.sh +244 -0
- package/templates/hooks/scope-transition.sh +172 -0
- package/templates/hooks/session-enforcer.sh +143 -0
- package/templates/hooks/time-tracker.sh +33 -0
- package/templates/lessons-learned.md +15 -0
- package/templates/orbital.config.json +35 -0
- package/templates/presets/development.json +42 -0
- package/templates/presets/gitflow.json +712 -0
- package/templates/presets/minimal.json +23 -0
- package/templates/quick/rules.md +218 -0
- package/templates/scopes/_template.md +255 -0
- package/templates/settings-hooks.json +98 -0
- package/templates/skills/git-commit/SKILL.md +85 -0
- package/templates/skills/git-dev/SKILL.md +99 -0
- package/templates/skills/git-hotfix/SKILL.md +223 -0
- package/templates/skills/git-main/SKILL.md +84 -0
- package/templates/skills/git-production/SKILL.md +165 -0
- package/templates/skills/git-staging/SKILL.md +112 -0
- package/templates/skills/scope-create/SKILL.md +81 -0
- package/templates/skills/scope-fix-review/SKILL.md +168 -0
- package/templates/skills/scope-implement/SKILL.md +110 -0
- package/templates/skills/scope-post-review/SKILL.md +144 -0
- package/templates/skills/scope-pre-review/SKILL.md +211 -0
- package/templates/skills/scope-verify/SKILL.md +201 -0
- package/templates/skills/session-init/SKILL.md +62 -0
- package/templates/skills/session-resume/SKILL.md +201 -0
- package/templates/skills/test-checks/SKILL.md +171 -0
- package/templates/skills/test-code-review/SKILL.md +252 -0
- package/tsconfig.json +25 -0
- package/vite.config.ts +38 -0
|
@@ -0,0 +1,497 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
SprintStatus, SprintScopeStatus, GroupType,
|
|
3
|
+
GateStatus, DeployStatus, DeployEnvironment, AgentConfig,
|
|
4
|
+
} from '../../shared/api-types.js';
|
|
5
|
+
|
|
6
|
+
// Re-export shared types so existing imports from '@/types' keep working
|
|
7
|
+
export type { SprintStatus, SprintScopeStatus, GroupType, GateStatus, DeployStatus, DeployEnvironment, AgentConfig };
|
|
8
|
+
|
|
9
|
+
// ─── Scope Types ───────────────────────────────────────────
|
|
10
|
+
|
|
11
|
+
// ScopeStatus is a dynamic string — runtime validation via engine.isValidStatus()
|
|
12
|
+
export type ScopeStatus = string;
|
|
13
|
+
|
|
14
|
+
export type ScopePriority = 'critical' | 'high' | 'medium' | 'low';
|
|
15
|
+
|
|
16
|
+
export interface Scope {
|
|
17
|
+
id: number;
|
|
18
|
+
title: string;
|
|
19
|
+
status: ScopeStatus;
|
|
20
|
+
is_ghost?: boolean;
|
|
21
|
+
priority: ScopePriority | null;
|
|
22
|
+
effort_estimate: string | null;
|
|
23
|
+
category: string | null;
|
|
24
|
+
tags: string[];
|
|
25
|
+
blocked_by: number[];
|
|
26
|
+
blocks: number[];
|
|
27
|
+
file_path: string;
|
|
28
|
+
created_at: string | null;
|
|
29
|
+
updated_at: string | null;
|
|
30
|
+
raw_content: string | null;
|
|
31
|
+
sessions: Record<string, string[]>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// ─── Card Display Types ────────────────────────────────────
|
|
35
|
+
|
|
36
|
+
export interface CardDisplayConfig {
|
|
37
|
+
effort: boolean;
|
|
38
|
+
category: boolean;
|
|
39
|
+
priority: boolean;
|
|
40
|
+
tags: boolean;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// ─── Filter Types ──────────────────────────────────────────
|
|
44
|
+
|
|
45
|
+
export type FilterField = 'priority' | 'category' | 'tags' | 'effort' | 'dependencies';
|
|
46
|
+
|
|
47
|
+
export type ViewMode = 'kanban' | 'swimlane';
|
|
48
|
+
export type SwimGroupField = 'priority' | 'category' | 'tags' | 'effort' | 'dependencies';
|
|
49
|
+
|
|
50
|
+
export type ScopeFilterState = Record<FilterField, Set<string>>;
|
|
51
|
+
|
|
52
|
+
export const PRIORITY_OPTIONS = ['critical', 'high', 'medium', 'low'] as const;
|
|
53
|
+
|
|
54
|
+
// Default categories — overridden at runtime by /api/orbital/config
|
|
55
|
+
export const CATEGORY_OPTIONS = [
|
|
56
|
+
'feature', 'bugfix', 'refactor', 'infrastructure', 'docs',
|
|
57
|
+
] as const;
|
|
58
|
+
|
|
59
|
+
export const EFFORT_BUCKETS = ['<1H', '1-4H', '4H+', 'TBD'] as const;
|
|
60
|
+
|
|
61
|
+
export const DEPENDENCY_OPTIONS = ['has-blockers', 'blocks-others', 'no-deps'] as const;
|
|
62
|
+
|
|
63
|
+
// ─── Event Types ───────────────────────────────────────────
|
|
64
|
+
|
|
65
|
+
export type EventType =
|
|
66
|
+
| 'SESSION_START'
|
|
67
|
+
| 'SESSION_END'
|
|
68
|
+
| 'CHECKPOINT_SAVED'
|
|
69
|
+
| 'HANDOFF_CREATED'
|
|
70
|
+
| 'SKILL_INVOKED'
|
|
71
|
+
| 'SKILL_COMPLETED'
|
|
72
|
+
| 'AGENT_STARTED'
|
|
73
|
+
| 'AGENT_FINDING'
|
|
74
|
+
| 'AGENT_COMPLETED'
|
|
75
|
+
| 'AGENT_CONSENSUS'
|
|
76
|
+
| 'GATE_STARTED'
|
|
77
|
+
| 'GATE_PASSED'
|
|
78
|
+
| 'GATE_FAILED'
|
|
79
|
+
| 'ALL_GATES_PASSED'
|
|
80
|
+
| 'FILE_MODIFIED'
|
|
81
|
+
| 'BUILD_COMPLETED'
|
|
82
|
+
| 'TESTS_COMPLETED'
|
|
83
|
+
| 'BRANCH_CREATED'
|
|
84
|
+
| 'COMMIT_CREATED'
|
|
85
|
+
| 'PR_CREATED'
|
|
86
|
+
| 'PR_MERGED'
|
|
87
|
+
| 'DEPLOY_STARTED'
|
|
88
|
+
| 'DEPLOY_HEALTHY'
|
|
89
|
+
| 'DEPLOY_FAILED'
|
|
90
|
+
| 'ROLLBACK_INITIATED'
|
|
91
|
+
| 'SCOPE_CREATED'
|
|
92
|
+
| 'SCOPE_STATUS_CHANGED'
|
|
93
|
+
| 'SCOPE_COMPLETED'
|
|
94
|
+
| 'VIOLATION'
|
|
95
|
+
| 'OVERRIDE'
|
|
96
|
+
| 'PATTERN_DETECTED'
|
|
97
|
+
| 'RULE_PROPOSED'
|
|
98
|
+
| 'SCOPE_TRANSITION'
|
|
99
|
+
| 'COMMIT'
|
|
100
|
+
| 'DISPATCH';
|
|
101
|
+
|
|
102
|
+
export interface OrbitalEvent {
|
|
103
|
+
id: string;
|
|
104
|
+
type: EventType;
|
|
105
|
+
scope_id: number | null;
|
|
106
|
+
session_id: string | null;
|
|
107
|
+
agent: string | null;
|
|
108
|
+
data: Record<string, unknown>;
|
|
109
|
+
timestamp: string;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// ─── Quality Gate Types ────────────────────────────────────
|
|
113
|
+
|
|
114
|
+
export interface QualityGate {
|
|
115
|
+
id: number;
|
|
116
|
+
scope_id: number | null;
|
|
117
|
+
gate_name: string;
|
|
118
|
+
status: GateStatus;
|
|
119
|
+
details: string | null;
|
|
120
|
+
duration_ms: number | null;
|
|
121
|
+
run_at: string;
|
|
122
|
+
commit_sha: string | null;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// ─── Transition Readiness Types ───────────────────────────
|
|
126
|
+
|
|
127
|
+
export type HookReadiness = 'pass' | 'fail' | 'unknown';
|
|
128
|
+
|
|
129
|
+
export interface HookStatus {
|
|
130
|
+
id: string;
|
|
131
|
+
label: string;
|
|
132
|
+
category: import('../../shared/workflow-config').HookCategory;
|
|
133
|
+
enforcement: import('../../shared/workflow-config').HookEnforcement;
|
|
134
|
+
status: HookReadiness;
|
|
135
|
+
reason: string | null;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export interface TransitionReadiness {
|
|
139
|
+
from: string;
|
|
140
|
+
to: string;
|
|
141
|
+
edge: import('../../shared/workflow-config').WorkflowEdge;
|
|
142
|
+
hooks: HookStatus[];
|
|
143
|
+
gates: Array<{
|
|
144
|
+
gate_name: string;
|
|
145
|
+
status: GateStatus;
|
|
146
|
+
details: string | null;
|
|
147
|
+
duration_ms: number | null;
|
|
148
|
+
run_at: string;
|
|
149
|
+
}>;
|
|
150
|
+
ready: boolean;
|
|
151
|
+
blockers: string[];
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export interface ScopeReadiness {
|
|
155
|
+
scope_id: number;
|
|
156
|
+
current_status: string;
|
|
157
|
+
transitions: TransitionReadiness[];
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// ─── Enforcement Rules Types ─────────────────────────────
|
|
161
|
+
|
|
162
|
+
export interface EnforcementRuleStats {
|
|
163
|
+
violations: number;
|
|
164
|
+
overrides: number;
|
|
165
|
+
last_triggered: string | null;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export interface EnforcementRule {
|
|
169
|
+
hook: import('../../shared/workflow-config').WorkflowHook;
|
|
170
|
+
enforcement: import('../../shared/workflow-config').HookEnforcement;
|
|
171
|
+
edges: Array<{ from: string; to: string; label: string }>;
|
|
172
|
+
stats: EnforcementRuleStats;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export interface EnforcementRulesData {
|
|
176
|
+
summary: { guards: number; gates: number; lifecycle: number; observers: number };
|
|
177
|
+
rules: EnforcementRule[];
|
|
178
|
+
totalEdges: number;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export interface ViolationTrendPoint {
|
|
182
|
+
day: string;
|
|
183
|
+
rule: string;
|
|
184
|
+
count: number;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// ─── Deployment Types ──────────────────────────────────────
|
|
188
|
+
|
|
189
|
+
export interface Deployment {
|
|
190
|
+
id: number;
|
|
191
|
+
environment: DeployEnvironment;
|
|
192
|
+
status: DeployStatus;
|
|
193
|
+
commit_sha: string | null;
|
|
194
|
+
branch: string | null;
|
|
195
|
+
pr_number: number | null;
|
|
196
|
+
health_check_url: string | null;
|
|
197
|
+
started_at: string | null;
|
|
198
|
+
completed_at: string | null;
|
|
199
|
+
details: Record<string, unknown> | null;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// ─── Pipeline Drift Types ─────────────────────────────────
|
|
203
|
+
|
|
204
|
+
export interface DriftCommit {
|
|
205
|
+
sha: string;
|
|
206
|
+
message: string;
|
|
207
|
+
author: string;
|
|
208
|
+
date: string; // ISO 8601
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export interface BranchHead {
|
|
212
|
+
sha: string;
|
|
213
|
+
date: string;
|
|
214
|
+
message: string;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export interface PipelineDrift {
|
|
218
|
+
devToStaging: { count: number; commits: DriftCommit[]; oldestDate: string | null };
|
|
219
|
+
stagingToMain: { count: number; commits: DriftCommit[]; oldestDate: string | null };
|
|
220
|
+
heads: { dev: BranchHead; staging: BranchHead; main: BranchHead };
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export interface DeployFrequencyWeek {
|
|
224
|
+
week: string;
|
|
225
|
+
staging: number;
|
|
226
|
+
production: number;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// ─── Session Types ─────────────────────────────────────────
|
|
230
|
+
|
|
231
|
+
export interface Session {
|
|
232
|
+
id: string;
|
|
233
|
+
scope_id: number | null;
|
|
234
|
+
claude_session_id: string | null;
|
|
235
|
+
action: string | null;
|
|
236
|
+
started_at: string | null;
|
|
237
|
+
ended_at: string | null;
|
|
238
|
+
handoff_file: string | null;
|
|
239
|
+
summary: string | null;
|
|
240
|
+
discoveries: string[];
|
|
241
|
+
next_steps: string[];
|
|
242
|
+
progress_pct: number | null;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// ─── Agent Types ───────────────────────────────────────────
|
|
246
|
+
|
|
247
|
+
// AgentName is now a dynamic string — validated at runtime against config
|
|
248
|
+
export type AgentName = string;
|
|
249
|
+
|
|
250
|
+
// Default agents — overridden at runtime by /api/orbital/config
|
|
251
|
+
const DEFAULT_AGENTS: AgentConfig[] = [
|
|
252
|
+
{ id: 'frontend-designer', label: 'Frontend Designer', emoji: '\u{1F3A8}', color: '#EC4899' },
|
|
253
|
+
{ id: 'architect', label: 'Architect', emoji: '\u{1F3D7}\u{FE0F}', color: '#536dfe' },
|
|
254
|
+
{ id: 'rules-enforcer', label: 'Rules Enforcer', emoji: '\u{1F4CB}', color: '#6B7280' },
|
|
255
|
+
];
|
|
256
|
+
|
|
257
|
+
/** Build emoji map from agent config array */
|
|
258
|
+
export function buildAgentEmoji(agents?: AgentConfig[]): Record<string, string> {
|
|
259
|
+
const list = agents ?? DEFAULT_AGENTS;
|
|
260
|
+
return Object.fromEntries(list.map(a => [a.id, a.emoji]));
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/** Build color map from agent config array */
|
|
264
|
+
export function buildAgentColor(agents?: AgentConfig[]): Record<string, string> {
|
|
265
|
+
const list = agents ?? DEFAULT_AGENTS;
|
|
266
|
+
return Object.fromEntries(list.map(a => [a.id, a.color]));
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// Legacy compatibility — static defaults for initial render before config loads
|
|
270
|
+
export const AGENT_EMOJI: Record<string, string> = buildAgentEmoji();
|
|
271
|
+
export const AGENT_COLOR: Record<string, string> = buildAgentColor();
|
|
272
|
+
|
|
273
|
+
// ─── Board Column Config ───────────────────────────────────
|
|
274
|
+
|
|
275
|
+
export interface BoardColumn {
|
|
276
|
+
id: string;
|
|
277
|
+
label: string;
|
|
278
|
+
color: string;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// ─── Sprint / Batch Types ─────────────────────────────────
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
export interface BatchDispatchResult {
|
|
285
|
+
commit_sha?: string;
|
|
286
|
+
pr_url?: string;
|
|
287
|
+
pr_number?: number;
|
|
288
|
+
dispatched_at?: string;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export interface Sprint {
|
|
292
|
+
id: number;
|
|
293
|
+
name: string;
|
|
294
|
+
status: SprintStatus;
|
|
295
|
+
concurrency_cap: number;
|
|
296
|
+
group_type: GroupType;
|
|
297
|
+
target_column: string;
|
|
298
|
+
dispatch_result: BatchDispatchResult | null;
|
|
299
|
+
scope_ids: number[];
|
|
300
|
+
scopes: SprintScope[];
|
|
301
|
+
layers: number[][] | null;
|
|
302
|
+
progress: { pending: number; in_progress: number; completed: number; failed: number; skipped: number };
|
|
303
|
+
created_at: string;
|
|
304
|
+
updated_at: string;
|
|
305
|
+
dispatched_at: string | null;
|
|
306
|
+
completed_at: string | null;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
export interface SprintScope {
|
|
310
|
+
scope_id: number;
|
|
311
|
+
title: string;
|
|
312
|
+
scope_status: string;
|
|
313
|
+
effort_estimate: string | null;
|
|
314
|
+
layer: number | null;
|
|
315
|
+
dispatch_status: SprintScopeStatus;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
// ─── Socket Events ─────────────────────────────────────────
|
|
319
|
+
|
|
320
|
+
export interface DispatchResolvedPayload {
|
|
321
|
+
event_id: string;
|
|
322
|
+
scope_id: number | null;
|
|
323
|
+
scope_ids?: number[] | null;
|
|
324
|
+
outcome: 'completed' | 'failed' | 'abandoned';
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
export interface ServerToClientEvents {
|
|
328
|
+
'scope:updated': (scope: Scope) => void;
|
|
329
|
+
'scope:created': (scope: Scope) => void;
|
|
330
|
+
'scope:deleted': (scopeId: number) => void;
|
|
331
|
+
'event:new': (event: OrbitalEvent) => void;
|
|
332
|
+
'dispatch:resolved': (payload: DispatchResolvedPayload) => void;
|
|
333
|
+
'gate:updated': (gate: QualityGate) => void;
|
|
334
|
+
'deploy:updated': (deployment: Deployment) => void;
|
|
335
|
+
'session:updated': (session: Session) => void;
|
|
336
|
+
'sprint:created': (sprint: Sprint) => void;
|
|
337
|
+
'sprint:updated': (sprint: Sprint) => void;
|
|
338
|
+
'sprint:deleted': (payload: { id: number }) => void;
|
|
339
|
+
'sprint:completed': (sprint: Sprint) => void;
|
|
340
|
+
'workflow:changed': () => void;
|
|
341
|
+
'git:status:changed': () => void;
|
|
342
|
+
'config:agents:changed': (payload: { action: string; path: string }) => void;
|
|
343
|
+
'config:skills:changed': (payload: { action: string; path: string }) => void;
|
|
344
|
+
'config:hooks:changed': (payload: { action: string; path: string }) => void;
|
|
345
|
+
'version:updating': (payload: { stage: 'pulling' | 'installing' }) => void;
|
|
346
|
+
'version:updated': (payload: { success: true } | { success: false; error: string }) => void;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
export interface ClientToServerEvents {
|
|
350
|
+
'subscribe': (channel: string) => void;
|
|
351
|
+
'unsubscribe': (channel: string) => void;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
// ─── Config Primitives Types ──────────────────────────────
|
|
355
|
+
|
|
356
|
+
export type ConfigPrimitiveType = 'agents' | 'skills' | 'hooks';
|
|
357
|
+
|
|
358
|
+
export interface ConfigFileNode {
|
|
359
|
+
name: string;
|
|
360
|
+
path: string;
|
|
361
|
+
type: 'file' | 'folder';
|
|
362
|
+
children?: ConfigFileNode[];
|
|
363
|
+
frontmatter?: Record<string, unknown>;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
// ─── Source Control Types ─────────────────────────────────
|
|
367
|
+
|
|
368
|
+
export interface GitOverview {
|
|
369
|
+
branchingMode: 'trunk' | 'worktree';
|
|
370
|
+
currentBranch: string;
|
|
371
|
+
dirty: boolean;
|
|
372
|
+
detached: boolean;
|
|
373
|
+
mainHead: { sha: string; message: string; date: string } | null;
|
|
374
|
+
aheadBehind: { ahead: number; behind: number } | null;
|
|
375
|
+
worktreeCount: number;
|
|
376
|
+
featureBranchCount: number;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
export interface CommitEntry {
|
|
380
|
+
sha: string;
|
|
381
|
+
shortSha: string;
|
|
382
|
+
message: string;
|
|
383
|
+
author: string;
|
|
384
|
+
date: string;
|
|
385
|
+
branch: string;
|
|
386
|
+
scopeId: number | null;
|
|
387
|
+
refs: string[];
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
export interface BranchInfoData {
|
|
391
|
+
name: string;
|
|
392
|
+
isRemote: boolean;
|
|
393
|
+
isCurrent: boolean;
|
|
394
|
+
headSha: string;
|
|
395
|
+
headMessage: string;
|
|
396
|
+
headDate: string;
|
|
397
|
+
aheadBehind: { ahead: number; behind: number } | null;
|
|
398
|
+
scopeId: number | null;
|
|
399
|
+
isStale: boolean;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
export interface WorktreeDetail {
|
|
403
|
+
path: string;
|
|
404
|
+
branch: string;
|
|
405
|
+
head: string;
|
|
406
|
+
scopeId: number | null;
|
|
407
|
+
scopeTitle: string | null;
|
|
408
|
+
scopeStatus: string | null;
|
|
409
|
+
dirty: boolean;
|
|
410
|
+
aheadBehind: { ahead: number; behind: number } | null;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
export interface GitHubStatus {
|
|
414
|
+
connected: boolean;
|
|
415
|
+
authUser: string | null;
|
|
416
|
+
repo: {
|
|
417
|
+
owner: string;
|
|
418
|
+
name: string;
|
|
419
|
+
fullName: string;
|
|
420
|
+
defaultBranch: string;
|
|
421
|
+
visibility: string;
|
|
422
|
+
url: string;
|
|
423
|
+
} | null;
|
|
424
|
+
openPRs: number;
|
|
425
|
+
error: string | null;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
export interface PullRequestInfo {
|
|
429
|
+
number: number;
|
|
430
|
+
title: string;
|
|
431
|
+
author: string;
|
|
432
|
+
branch: string;
|
|
433
|
+
baseBranch: string;
|
|
434
|
+
state: string;
|
|
435
|
+
url: string;
|
|
436
|
+
createdAt: string;
|
|
437
|
+
scopeIds: number[];
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
export interface DriftPair {
|
|
441
|
+
from: string;
|
|
442
|
+
to: string;
|
|
443
|
+
count: number;
|
|
444
|
+
commits: Array<{ sha: string; message: string; author: string; date: string }>;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
// ─── Pipeline Display Types ──────────────────────────────
|
|
448
|
+
|
|
449
|
+
export interface ResolvedHook {
|
|
450
|
+
id: string;
|
|
451
|
+
label: string;
|
|
452
|
+
category: import('../../shared/workflow-config').HookCategory;
|
|
453
|
+
enforcement: import('../../shared/workflow-config').HookEnforcement;
|
|
454
|
+
filePath: string | null;
|
|
455
|
+
timing: 'before' | 'after';
|
|
456
|
+
blocking: boolean;
|
|
457
|
+
description?: string;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
export interface ResolvedAgent {
|
|
461
|
+
id: string;
|
|
462
|
+
label: string;
|
|
463
|
+
emoji: string;
|
|
464
|
+
color: string;
|
|
465
|
+
team?: string;
|
|
466
|
+
filePath: string | null;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
export interface ReviewTeam {
|
|
470
|
+
skillCommand: string;
|
|
471
|
+
skillPath: string | null;
|
|
472
|
+
agents: ResolvedAgent[];
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
export interface EdgeData {
|
|
476
|
+
edge: import('../../shared/workflow-config').WorkflowEdge;
|
|
477
|
+
skillPath: string | null;
|
|
478
|
+
edgeHooks: ResolvedHook[];
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
export interface StageData {
|
|
482
|
+
list: import('../../shared/workflow-config').WorkflowList;
|
|
483
|
+
stageHooks: ResolvedHook[];
|
|
484
|
+
alwaysOnAgents: ResolvedAgent[];
|
|
485
|
+
reviewTeams: ReviewTeam[];
|
|
486
|
+
forwardEdges: EdgeData[];
|
|
487
|
+
backwardEdges: import('../../shared/workflow-config').WorkflowEdge[];
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
export interface PipelineData {
|
|
491
|
+
globalHooks: ResolvedHook[];
|
|
492
|
+
stages: StageData[];
|
|
493
|
+
skillPathMap: Map<string, string>;
|
|
494
|
+
hookPathMap: Map<string, string>;
|
|
495
|
+
agentPathMap: Map<string, string>;
|
|
496
|
+
orchestratesMap: Map<string, string[]>;
|
|
497
|
+
}
|