@cat-factory/app 0.6.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 +88 -0
- package/app/app.config.ts +8 -0
- package/app/app.vue +11 -0
- package/app/assets/css/main.css +100 -0
- package/app/components/auth/AuthGate.vue +24 -0
- package/app/components/auth/LoginScreen.vue +143 -0
- package/app/components/auth/UserMenu.vue +39 -0
- package/app/components/board/AddTaskModal.vue +444 -0
- package/app/components/board/AgentFailureCard.vue +97 -0
- package/app/components/board/AgentStopButton.vue +61 -0
- package/app/components/board/BoardCanvas.vue +183 -0
- package/app/components/board/ContextPicker.vue +367 -0
- package/app/components/board/RecurringPipelineModal.vue +219 -0
- package/app/components/board/TaskDependencyEdges.vue +132 -0
- package/app/components/board/nodes/AgentChip.vue +59 -0
- package/app/components/board/nodes/BlockNode.vue +433 -0
- package/app/components/board/nodes/DecisionBadge.vue +27 -0
- package/app/components/board/nodes/DraggableTask.vue +48 -0
- package/app/components/board/nodes/ModuleFrame.vue +97 -0
- package/app/components/board/nodes/TaskCard.vue +359 -0
- package/app/components/board/nodes/TaskPipelineMini.vue +159 -0
- package/app/components/bootstrap/BootstrapModal.vue +665 -0
- package/app/components/clarity/ClarityReviewWindow.vue +611 -0
- package/app/components/consensus/ConsensusSessionWindow.vue +210 -0
- package/app/components/documents/DocumentImportModal.vue +161 -0
- package/app/components/documents/DocumentSourceConnectModal.vue +127 -0
- package/app/components/documents/SpawnPreviewModal.vue +161 -0
- package/app/components/documents/TaskContextDocs.vue +83 -0
- package/app/components/focus/BlockFocusView.vue +171 -0
- package/app/components/fragments/FragmentLibraryPanel.vue +340 -0
- package/app/components/gates/GateResultView.vue +282 -0
- package/app/components/github/AddServiceFromRepoModal.vue +354 -0
- package/app/components/github/GitHubConnect.vue +183 -0
- package/app/components/github/GitHubOnboarding.vue +45 -0
- package/app/components/github/GitHubPanel.vue +584 -0
- package/app/components/github/RepoTreeBrowser.vue +171 -0
- package/app/components/layout/AccountTeamSettings.vue +237 -0
- package/app/components/layout/BoardSwitcher.vue +280 -0
- package/app/components/layout/BoardToolbar.vue +156 -0
- package/app/components/layout/CommandBar.vue +336 -0
- package/app/components/layout/GitHubPatBanner.vue +73 -0
- package/app/components/layout/NotificationsInbox.vue +175 -0
- package/app/components/layout/SideBar.vue +314 -0
- package/app/components/layout/SpendWarningBanner.vue +107 -0
- package/app/components/observability/StepMetricsBar.vue +102 -0
- package/app/components/palettes/AgentPalette.vue +86 -0
- package/app/components/panels/AgentStepDetail.vue +737 -0
- package/app/components/panels/DecisionModal.vue +71 -0
- package/app/components/panels/InspectorPanel.vue +465 -0
- package/app/components/panels/ObservabilityPanel.vue +351 -0
- package/app/components/panels/StepMetadataCard.vue +253 -0
- package/app/components/panels/StepRestartControl.vue +90 -0
- package/app/components/panels/StepResultViewHost.vue +40 -0
- package/app/components/panels/StepTestReport.vue +84 -0
- package/app/components/panels/inspector/ContainerSummary.vue +74 -0
- package/app/components/panels/inspector/RecurringScheduleSettings.vue +178 -0
- package/app/components/panels/inspector/ServiceFragments.vue +82 -0
- package/app/components/panels/inspector/ServiceTestConfig.vue +198 -0
- package/app/components/panels/inspector/TaskAgentConfig.vue +81 -0
- package/app/components/panels/inspector/TaskDependencies.vue +70 -0
- package/app/components/panels/inspector/TaskEstimateBadge.vue +56 -0
- package/app/components/panels/inspector/TaskExecution.vue +364 -0
- package/app/components/panels/inspector/TaskRunSettings.vue +187 -0
- package/app/components/panels/inspector/TaskStructure.vue +96 -0
- package/app/components/pipeline/AgentKindIcon.vue +30 -0
- package/app/components/pipeline/IterationCapPrompt.vue +70 -0
- package/app/components/pipeline/PipelineBuilder.vue +817 -0
- package/app/components/pipeline/PipelineProgress.vue +484 -0
- package/app/components/providers/ApiKeysSection.vue +273 -0
- package/app/components/providers/PersonalCredentialModal.vue +128 -0
- package/app/components/providers/PersonalSubscriptionSection.vue +225 -0
- package/app/components/providers/VendorCredentialsModal.vue +197 -0
- package/app/components/recurring/RecurrenceEditor.vue +124 -0
- package/app/components/requirements/RequirementsReviewWindow.vue +620 -0
- package/app/components/settings/DatadogPanel.vue +213 -0
- package/app/components/settings/LocalModelEndpointsPanel.vue +286 -0
- package/app/components/settings/MergeThresholdsPanel.vue +378 -0
- package/app/components/settings/ModelDefaultsPanel.vue +250 -0
- package/app/components/settings/ServiceFragmentDefaultsPanel.vue +124 -0
- package/app/components/settings/WorkspaceSettingsPanel.vue +142 -0
- package/app/components/slack/SlackPanel.vue +299 -0
- package/app/components/tasks/TaskContextIssues.vue +88 -0
- package/app/components/tasks/TaskImportModal.vue +207 -0
- package/app/components/tasks/TaskSourceConnectModal.vue +133 -0
- package/app/components/testing/TestReportWindow.vue +404 -0
- package/app/composables/api/accounts.ts +81 -0
- package/app/composables/api/auth.ts +45 -0
- package/app/composables/api/board.ts +101 -0
- package/app/composables/api/bootstrap.ts +62 -0
- package/app/composables/api/context.ts +25 -0
- package/app/composables/api/documents.ts +74 -0
- package/app/composables/api/execution.ts +127 -0
- package/app/composables/api/fragments.ts +71 -0
- package/app/composables/api/github.ts +131 -0
- package/app/composables/api/models.ts +127 -0
- package/app/composables/api/notifications.ts +23 -0
- package/app/composables/api/presets.ts +29 -0
- package/app/composables/api/recurring.ts +68 -0
- package/app/composables/api/releaseHealth.ts +43 -0
- package/app/composables/api/reviews.ts +146 -0
- package/app/composables/api/slack.ts +54 -0
- package/app/composables/api/tasks.ts +72 -0
- package/app/composables/api/workspaces.ts +36 -0
- package/app/composables/useApi.ts +89 -0
- package/app/composables/useBlockDrag.ts +90 -0
- package/app/composables/useBlockQueries.ts +154 -0
- package/app/composables/useBoardFlow.ts +11 -0
- package/app/composables/useContextLinking.ts +65 -0
- package/app/composables/useDepLabels.ts +26 -0
- package/app/composables/useFrameResize.ts +54 -0
- package/app/composables/useResultView.ts +48 -0
- package/app/composables/useReviewStage.ts +40 -0
- package/app/composables/useSemanticZoom.ts +31 -0
- package/app/composables/useStepApproval.ts +233 -0
- package/app/composables/useStepProse.ts +78 -0
- package/app/composables/useStepTimer.ts +63 -0
- package/app/composables/useTaskExpansion.ts +92 -0
- package/app/composables/useWorkspaceStream.ts +155 -0
- package/app/docs/architecture.md +31 -0
- package/app/pages/index.vue +141 -0
- package/app/stores/accounts.ts +152 -0
- package/app/stores/agentConfig.ts +35 -0
- package/app/stores/agentRuns.ts +122 -0
- package/app/stores/agents.ts +40 -0
- package/app/stores/apiKeys.ts +108 -0
- package/app/stores/auth.ts +166 -0
- package/app/stores/board.spec.ts +205 -0
- package/app/stores/board.ts +286 -0
- package/app/stores/bootstrap.ts +97 -0
- package/app/stores/clarity.ts +196 -0
- package/app/stores/consensus.ts +60 -0
- package/app/stores/documents.ts +176 -0
- package/app/stores/execution.ts +273 -0
- package/app/stores/fragmentLibrary.ts +147 -0
- package/app/stores/fragments.ts +40 -0
- package/app/stores/github.ts +305 -0
- package/app/stores/localModels.ts +51 -0
- package/app/stores/mergePresets.ts +58 -0
- package/app/stores/modelDefaults.ts +76 -0
- package/app/stores/models.ts +134 -0
- package/app/stores/notifications.ts +70 -0
- package/app/stores/observability.ts +144 -0
- package/app/stores/personalSubscriptions.ts +215 -0
- package/app/stores/pipelines.ts +327 -0
- package/app/stores/recurringPipelines.ts +112 -0
- package/app/stores/releaseHealth.ts +75 -0
- package/app/stores/requirements.spec.ts +94 -0
- package/app/stores/requirements.ts +208 -0
- package/app/stores/serviceFragmentDefaults.ts +29 -0
- package/app/stores/services.ts +87 -0
- package/app/stores/slack.ts +142 -0
- package/app/stores/taskExpansion.ts +36 -0
- package/app/stores/tasks.spec.ts +71 -0
- package/app/stores/tasks.ts +176 -0
- package/app/stores/tracker.ts +27 -0
- package/app/stores/ui.ts +434 -0
- package/app/stores/vendorCredentials.ts +54 -0
- package/app/stores/workspace.ts +215 -0
- package/app/stores/workspaceSettings.ts +36 -0
- package/app/types/accounts.ts +77 -0
- package/app/types/bootstrap.ts +83 -0
- package/app/types/clarity.ts +59 -0
- package/app/types/consensus.ts +91 -0
- package/app/types/documents.ts +104 -0
- package/app/types/domain.ts +495 -0
- package/app/types/execution.ts +383 -0
- package/app/types/fragments.ts +72 -0
- package/app/types/github.ts +173 -0
- package/app/types/localModels.ts +73 -0
- package/app/types/merge.ts +71 -0
- package/app/types/models.ts +157 -0
- package/app/types/notifications.ts +74 -0
- package/app/types/recurring.ts +69 -0
- package/app/types/releaseHealth.ts +31 -0
- package/app/types/requirements.ts +61 -0
- package/app/types/services.ts +27 -0
- package/app/types/slack.ts +57 -0
- package/app/types/tasks.ts +82 -0
- package/app/types/tracker.ts +18 -0
- package/app/utils/agentOutput.spec.ts +128 -0
- package/app/utils/agentOutput.ts +173 -0
- package/app/utils/catalog.spec.ts +112 -0
- package/app/utils/catalog.ts +455 -0
- package/app/utils/dnd.ts +29 -0
- package/app/utils/observability.ts +52 -0
- package/app/utils/pipelineRender.ts +151 -0
- package/nuxt.config.ts +55 -0
- package/package.json +45 -0
|
@@ -0,0 +1,495 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// Domain model for the Agent Architecture Board.
|
|
3
|
+
//
|
|
4
|
+
// These shapes mirror the `@cat-factory/contracts` wire schemas exactly, so a
|
|
5
|
+
// payload returned by the backend drops straight into the Pinia stores without
|
|
6
|
+
// translation. The board and its agent pipelines are owned by the backend; the
|
|
7
|
+
// frontend renders and mutates that state over the REST API.
|
|
8
|
+
//
|
|
9
|
+
// This module holds the core board vocabulary. Adjacent concerns live in
|
|
10
|
+
// sibling modules and are re-exported below so `~/types/domain` stays the single
|
|
11
|
+
// import surface:
|
|
12
|
+
// - execution model → ./execution
|
|
13
|
+
// - models/fragments → ./models
|
|
14
|
+
// - document sources → ./documents
|
|
15
|
+
// ---------------------------------------------------------------------------
|
|
16
|
+
|
|
17
|
+
import type { ExecutionInstance, LlmCallActivity } from './execution'
|
|
18
|
+
import type { BootstrapJob } from './bootstrap'
|
|
19
|
+
import type { Notification } from './notifications'
|
|
20
|
+
import type { RequirementReview } from './requirements'
|
|
21
|
+
import type { ConsensusSession, ConsensusStepConfig, StepGating, TaskEstimate } from './consensus'
|
|
22
|
+
import type { ClarityReview } from './clarity'
|
|
23
|
+
import type { MergeThresholdPreset } from './merge'
|
|
24
|
+
import type { PipelineSchedule } from './recurring'
|
|
25
|
+
import type { Service, WorkspaceMount } from './services'
|
|
26
|
+
import type { TrackerSettings } from './tracker'
|
|
27
|
+
|
|
28
|
+
/** Lifecycle of an architecture building block. */
|
|
29
|
+
export type BlockStatus =
|
|
30
|
+
| 'planned' // sketched, no dependencies satisfied yet
|
|
31
|
+
| 'ready' // dependencies done, can be implemented
|
|
32
|
+
| 'in_progress' // a pipeline is (visually) running against it
|
|
33
|
+
| 'blocked' // a pipeline step is waiting on a human decision
|
|
34
|
+
| 'pr_ready' // pipeline finished — a PR is open and awaiting merge
|
|
35
|
+
| 'done' // PR merged, implementation complete
|
|
36
|
+
|
|
37
|
+
/** Kind of architecture building block (drives icon + accent). */
|
|
38
|
+
export type BlockType =
|
|
39
|
+
| 'frontend'
|
|
40
|
+
| 'service'
|
|
41
|
+
| 'api'
|
|
42
|
+
| 'database'
|
|
43
|
+
| 'queue'
|
|
44
|
+
| 'integration'
|
|
45
|
+
| 'external'
|
|
46
|
+
| 'environment'
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Where a block sits in the granularity hierarchy. Both `frame` and `module`
|
|
50
|
+
* are containers ("frames") that hold draggable tasks:
|
|
51
|
+
* - `frame` a top-level Service; the only level rendered as a board node
|
|
52
|
+
* - `module` a sub-frame inside a service; created when a task assigned to a
|
|
53
|
+
* not-yet-existing module is implemented (tasks can also be dragged in)
|
|
54
|
+
* - `task` a draggable unit of work living inside a service or a module
|
|
55
|
+
*/
|
|
56
|
+
export type BlockLevel = 'frame' | 'module' | 'task'
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The kind of work a task represents, chosen at creation. Drives the card's badge/icon
|
|
60
|
+
* and the optional per-service running-task limit's bucketing. `recurring` tasks are
|
|
61
|
+
* created via a recurring-pipeline schedule, not the add-task form.
|
|
62
|
+
*/
|
|
63
|
+
export type TaskType = 'feature' | 'bug' | 'document' | 'spike' | 'recurring'
|
|
64
|
+
|
|
65
|
+
/** The task types selectable in the add-task form (recurring is created via a schedule). */
|
|
66
|
+
export type CreateTaskType = 'feature' | 'bug' | 'document' | 'spike'
|
|
67
|
+
|
|
68
|
+
/** Small, optional per-type fields collected on the add-task form. */
|
|
69
|
+
export interface TaskTypeFields {
|
|
70
|
+
/** bug: defect severity. */
|
|
71
|
+
severity?: 'low' | 'medium' | 'high' | 'critical'
|
|
72
|
+
/** bug: reproduction steps / observed-vs-expected. */
|
|
73
|
+
stepsToReproduce?: string
|
|
74
|
+
/** spike: the investigation time-box, in hours. */
|
|
75
|
+
timeboxHours?: number
|
|
76
|
+
/** document: what kind of document this task produces. */
|
|
77
|
+
docKind?: 'prd' | 'rfc' | 'runbook' | 'reference' | 'other'
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** A building block dropped on the board. */
|
|
81
|
+
export interface Block {
|
|
82
|
+
id: string
|
|
83
|
+
title: string
|
|
84
|
+
type: BlockType
|
|
85
|
+
description: string
|
|
86
|
+
/** position relative to the parent container (service or module). */
|
|
87
|
+
position: { x: number; y: number }
|
|
88
|
+
/**
|
|
89
|
+
* Explicit, user-dragged pixel size for a resizable frame (Miro-style border
|
|
90
|
+
* drag). Absent = the board auto-sizes the frame from its contents; present =
|
|
91
|
+
* the dragged size, never shrunk below the content's natural extent.
|
|
92
|
+
*/
|
|
93
|
+
size?: { w: number; h: number }
|
|
94
|
+
status: BlockStatus
|
|
95
|
+
/** 0..1 implementation progress, derived from the running execution. */
|
|
96
|
+
progress: number
|
|
97
|
+
/** ids of tasks that must be implemented before this one (drives arrows). */
|
|
98
|
+
dependsOn: string[]
|
|
99
|
+
/** id of the ExecutionInstance currently running against this block, if any. */
|
|
100
|
+
executionId: string | null
|
|
101
|
+
/** granularity level; absent on legacy/persisted data means `frame`. */
|
|
102
|
+
level: BlockLevel
|
|
103
|
+
/** parent container: service or module for a task, service for a module. */
|
|
104
|
+
parentId: string | null
|
|
105
|
+
/** task-only: 0..1 confidence produced when the pipeline finishes. */
|
|
106
|
+
confidence?: number
|
|
107
|
+
/** task-only: the task-estimator's triage (complexity/risk/impact); absent until it runs. */
|
|
108
|
+
estimate?: TaskEstimate | null
|
|
109
|
+
/** task-only: the module this task belongs to (created on implement if absent). */
|
|
110
|
+
moduleName?: string
|
|
111
|
+
/** task-only: the kind of work (feature/bug/document/spike/recurring); absent = feature. */
|
|
112
|
+
taskType?: TaskType
|
|
113
|
+
/** task-only: small per-type form fields (bug severity, spike timebox, …). */
|
|
114
|
+
taskTypeFields?: TaskTypeFields | null
|
|
115
|
+
/** ids of best-practice prompt fragments folded into this block's agent prompts. */
|
|
116
|
+
fragmentIds?: string[]
|
|
117
|
+
/**
|
|
118
|
+
* frame-only: the service's selected best-practice fragment ids. Folded into the
|
|
119
|
+
* prompt of every `code-aware` agent on tasks under this service. Seeded from the
|
|
120
|
+
* workspace default on new services; absent = none.
|
|
121
|
+
*/
|
|
122
|
+
serviceFragmentIds?: string[]
|
|
123
|
+
/** id of the model (from MODEL_CATALOG) to run this block's agents with; absent = default. */
|
|
124
|
+
modelId?: string
|
|
125
|
+
/** the PR the block's implementer agent opened for its work; absent = none yet. */
|
|
126
|
+
pullRequest?: PullRequestRef
|
|
127
|
+
/** task-only: selected merge threshold preset id; absent = workspace default. */
|
|
128
|
+
mergePresetId?: string
|
|
129
|
+
/** task-only: pinned default pipeline id picked at creation; absent = none. */
|
|
130
|
+
pipelineId?: string
|
|
131
|
+
/** task-only: agent-contributed config values (id→value), e.g. the Tester's environment. */
|
|
132
|
+
agentConfig?: Record<string, string>
|
|
133
|
+
/** service-only (frame): docker-compose path for the Tester's local infra; absent = none. */
|
|
134
|
+
testComposePath?: string
|
|
135
|
+
/** service-only (frame): the service has no infra dependencies to stand up. */
|
|
136
|
+
noInfraDependencies?: boolean
|
|
137
|
+
/** service-only (frame): cloud provider the service's jobs run on; absent = account default. */
|
|
138
|
+
cloudProvider?: CloudProvider
|
|
139
|
+
/** service-only (frame): abstract instance size for the service's jobs; absent = default. */
|
|
140
|
+
instanceSize?: InstanceSize
|
|
141
|
+
/** GitHub user id of the task's creator; drives "notify the task creator" routing. */
|
|
142
|
+
createdBy?: number | null
|
|
143
|
+
/**
|
|
144
|
+
* Internal user id (`usr_*`) of the responsible product person — an account member
|
|
145
|
+
* with the `product` role, notified when requirement review flags this task.
|
|
146
|
+
*/
|
|
147
|
+
responsibleProductUserId?: string | null
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* A lightweight link from a block to the pull request its implementer agent
|
|
152
|
+
* opened. Just enough to display the PR on the board and navigate to it; mirrors
|
|
153
|
+
* `PullRequestRef` in `@cat-factory/contracts`.
|
|
154
|
+
*/
|
|
155
|
+
export interface PullRequestRef {
|
|
156
|
+
/** The PR's web URL, opened when the user clicks through from the board. */
|
|
157
|
+
url: string
|
|
158
|
+
/** The PR number within the repo, shown as `#<number>` when known. */
|
|
159
|
+
number?: number
|
|
160
|
+
/** The head branch the agent pushed its work to, when known. */
|
|
161
|
+
branch?: string
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/** The cloud provider a service's container jobs run on (per service; account default otherwise). */
|
|
165
|
+
export type CloudProvider = 'cloudflare' | 'docker' | 'aws' | 'gcp' | 'azure' | 'custom'
|
|
166
|
+
|
|
167
|
+
/** Abstract, cloud-neutral instance size selectable per service. */
|
|
168
|
+
export type InstanceSize = 'small' | 'medium' | 'large' | 'xlarge'
|
|
169
|
+
|
|
170
|
+
/** One choice of a `select` agent-config descriptor. */
|
|
171
|
+
export interface AgentConfigOption {
|
|
172
|
+
value: string
|
|
173
|
+
label: string
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/** A task-level configuration parameter an agent kind contributes (see the snapshot catalog). */
|
|
177
|
+
export interface AgentConfigDescriptor {
|
|
178
|
+
id: string
|
|
179
|
+
agentKind: string
|
|
180
|
+
label: string
|
|
181
|
+
description: string
|
|
182
|
+
type: 'select'
|
|
183
|
+
options: AgentConfigOption[]
|
|
184
|
+
default: string
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/** Severity of a Tester-raised concern. */
|
|
188
|
+
export type TestConcernSeverity = 'low' | 'medium' | 'high' | 'critical'
|
|
189
|
+
|
|
190
|
+
/** A bug/risk the Tester surfaced. */
|
|
191
|
+
export interface TestConcern {
|
|
192
|
+
title: string
|
|
193
|
+
detail: string
|
|
194
|
+
severity: TestConcernSeverity
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/** A per-area Tester result. */
|
|
198
|
+
export interface TestOutcome {
|
|
199
|
+
name: string
|
|
200
|
+
status: 'passed' | 'failed' | 'skipped'
|
|
201
|
+
detail?: string
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/** A Tester's structured report (what was tested, outcomes, concerns, greenlight). */
|
|
205
|
+
export interface TestReport {
|
|
206
|
+
greenlight: boolean
|
|
207
|
+
summary: string
|
|
208
|
+
tested: string[]
|
|
209
|
+
outcomes: TestOutcome[]
|
|
210
|
+
concerns: TestConcern[]
|
|
211
|
+
environment?: 'local' | 'ephemeral'
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/** The kinds of agents available in the agent palette. */
|
|
215
|
+
export type AgentKind =
|
|
216
|
+
| 'requirements-review'
|
|
217
|
+
| 'architect'
|
|
218
|
+
| 'researcher'
|
|
219
|
+
| 'coder'
|
|
220
|
+
| 'tester'
|
|
221
|
+
// `reviewer` is the coder's companion: it rates the change and loops it back for
|
|
222
|
+
// automatic rework below the quality threshold (see companions below).
|
|
223
|
+
| 'reviewer'
|
|
224
|
+
| 'documenter'
|
|
225
|
+
| 'integrator'
|
|
226
|
+
| 'playwright'
|
|
227
|
+
| 'mocker'
|
|
228
|
+
| 'business-documenter'
|
|
229
|
+
| 'business-reviewer'
|
|
230
|
+
// Companion agents: they grade a prior producer step's output (0..1), loop it back
|
|
231
|
+
// for automatic rework below threshold, then raise the human gate on a pass.
|
|
232
|
+
| 'architect-companion'
|
|
233
|
+
| 'spec-companion'
|
|
234
|
+
// Engine-driven "system" kinds: not user-addable palette archetypes, but they
|
|
235
|
+
// appear in seeded pipelines and run timelines. The spec-writer (aggregates every
|
|
236
|
+
// task's clarified requirements + acceptance scenarios into the service's in-repo
|
|
237
|
+
// `spec/` document before the coder runs), the blueprint mapper, the conflicts gate
|
|
238
|
+
// + its resolver, the CI gate (a special non-LLM step that polls checks + loops the
|
|
239
|
+
// fixer) + its fixer, and the PR-scoring merger.
|
|
240
|
+
| 'spec-writer'
|
|
241
|
+
| 'blueprints'
|
|
242
|
+
| 'conflicts'
|
|
243
|
+
| 'conflict-resolver'
|
|
244
|
+
| 'ci'
|
|
245
|
+
| 'ci-fixer'
|
|
246
|
+
// The Tester's companion: dispatched within the tester gate to fix the bugs the
|
|
247
|
+
// Tester found, then the Tester re-runs (skipped when the tests pass).
|
|
248
|
+
| 'fixer'
|
|
249
|
+
| 'merger'
|
|
250
|
+
// The observability-gated post-release-health gate: not in any default pipeline and
|
|
251
|
+
// only addable once an observability integration is connected. Watches the released
|
|
252
|
+
// PR's monitors/SLOs and escalates to the on-call agent on a regression.
|
|
253
|
+
| 'post-release-health'
|
|
254
|
+
// Recurring tech-debt pipeline: read-only code `analysis`, then a special
|
|
255
|
+
// non-LLM `tracker` step that files a GitHub issue / Jira ticket.
|
|
256
|
+
| 'analysis'
|
|
257
|
+
| 'tracker'
|
|
258
|
+
// Pre-implementation triage: rates Complexity/Risk/Impact after requirements are
|
|
259
|
+
// clarified, used to gate the optional consensus mechanism (and shown as ratings).
|
|
260
|
+
| 'task-estimator'
|
|
261
|
+
// Bug-fix pipeline: the `clarity-review` gate triages the bug report (the analogue
|
|
262
|
+
// of `requirements-review`, with its own structured review window), then the
|
|
263
|
+
// read-only `bug-investigator` container agent enriches it into a prose report.
|
|
264
|
+
| 'clarity-review'
|
|
265
|
+
| 'bug-investigator'
|
|
266
|
+
|
|
267
|
+
/** A draggable agent definition shown in the agent palette. */
|
|
268
|
+
/** Palette grouping for the agent archetypes (collapsible sections in the builder). */
|
|
269
|
+
export type AgentCategory = 'review' | 'design' | 'build' | 'test' | 'docs' | 'gates'
|
|
270
|
+
|
|
271
|
+
export interface AgentArchetype {
|
|
272
|
+
kind: AgentKind
|
|
273
|
+
label: string
|
|
274
|
+
/** iconify name (lucide) */
|
|
275
|
+
icon: string
|
|
276
|
+
/** tailwind-ish accent token used across chips / borders */
|
|
277
|
+
color: string
|
|
278
|
+
description: string
|
|
279
|
+
/** Palette category this archetype is grouped under. Absent ⇒ ungrouped/system kind. */
|
|
280
|
+
category?: AgentCategory
|
|
281
|
+
/**
|
|
282
|
+
* Optional id of a DEDICATED result window this agent's step opens instead of the
|
|
283
|
+
* generic prose step-detail panel. Resolved through the result-view registry
|
|
284
|
+
* (`STEP_RESULT_VIEWS`) so any agent can declare a bespoke visualization without the
|
|
285
|
+
* renderer hardcoding a kind. Absent → the generic `AgentStepDetail` panel.
|
|
286
|
+
*/
|
|
287
|
+
resultView?: string
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/** A reusable, linear sequence of agents. */
|
|
291
|
+
export interface Pipeline {
|
|
292
|
+
id: string
|
|
293
|
+
name: string
|
|
294
|
+
/** ordered agent kinds — the chain executes left to right */
|
|
295
|
+
agentKinds: AgentKind[]
|
|
296
|
+
/**
|
|
297
|
+
* Per-step human approval gates, parallel to `agentKinds`: `gates[i]` true ⇒
|
|
298
|
+
* the run pauses after step `i` for a human to review/edit its proposal. Absent
|
|
299
|
+
* means no gates.
|
|
300
|
+
*/
|
|
301
|
+
gates?: boolean[]
|
|
302
|
+
/**
|
|
303
|
+
* Per-step companion quality thresholds (0..1), parallel to `agentKinds`. Only
|
|
304
|
+
* meaningful on companion steps; `null`/absent ⇒ use the companion's default bar.
|
|
305
|
+
*/
|
|
306
|
+
thresholds?: (number | null)[]
|
|
307
|
+
/**
|
|
308
|
+
* Per-step enable flags, parallel to `agentKinds`: `enabled[i] === false` keeps the
|
|
309
|
+
* step in the pipeline but skips it at run start. Absent/true ⇒ the step runs.
|
|
310
|
+
*/
|
|
311
|
+
enabled?: boolean[]
|
|
312
|
+
/**
|
|
313
|
+
* Per-step consensus config, parallel to `agentKinds`: when set (with `enabled`) and the
|
|
314
|
+
* step's kind carries a consensus trait, the step runs through the multi-model consensus
|
|
315
|
+
* mechanism. `null`/absent ⇒ standard single-actor agent.
|
|
316
|
+
*/
|
|
317
|
+
consensus?: (ConsensusStepConfig | null)[]
|
|
318
|
+
/**
|
|
319
|
+
* Per-step estimate gating, parallel to `agentKinds`: when set (with `enabled`) the step
|
|
320
|
+
* is skipped at runtime unless the task estimate meets the threshold. `null`/absent ⇒
|
|
321
|
+
* always run. Used to make a companion conditional on the task estimate.
|
|
322
|
+
*/
|
|
323
|
+
gating?: (StepGating | null)[]
|
|
324
|
+
/** Free-form organizational labels for the library (filter/search). */
|
|
325
|
+
labels?: string[]
|
|
326
|
+
/** True when archived: kept but hidden from the default library view. */
|
|
327
|
+
archived?: boolean
|
|
328
|
+
/**
|
|
329
|
+
* True for the curated built-in catalog pipelines. Built-ins are read-only
|
|
330
|
+
* templates — clone one to make an editable copy. Absent/false on custom pipelines.
|
|
331
|
+
*/
|
|
332
|
+
builtin?: boolean
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* Spend-safeguard status for the current billing period (a calendar month).
|
|
337
|
+
* Token usage is priced into a single currency and gated by a budget; once
|
|
338
|
+
* `exceeded`, runs are paused and the frontend shows a large warning.
|
|
339
|
+
*/
|
|
340
|
+
export interface SpendStatus {
|
|
341
|
+
/** Start of the current billing period (epoch ms). */
|
|
342
|
+
periodStart: number
|
|
343
|
+
inputTokens: number
|
|
344
|
+
outputTokens: number
|
|
345
|
+
/** Estimated spend this period, in `currency`. */
|
|
346
|
+
costSpent: number
|
|
347
|
+
/** Configured budget for one period, in `currency`. */
|
|
348
|
+
costLimit: number
|
|
349
|
+
/** ISO 4217 currency (e.g. 'EUR'). */
|
|
350
|
+
currency: string
|
|
351
|
+
/** True once the budget is reached: execution is paused. */
|
|
352
|
+
exceeded: boolean
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/** A board/project container owned by the backend. */
|
|
356
|
+
export interface Workspace {
|
|
357
|
+
id: string
|
|
358
|
+
name: string
|
|
359
|
+
/** Optional free-text description (null when unset). */
|
|
360
|
+
description: string | null
|
|
361
|
+
createdAt: number
|
|
362
|
+
/** The account this board belongs to, or null for a legacy/unscoped board. */
|
|
363
|
+
accountId: string | null
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
/** Full server-side state of a workspace, returned on load and after resets. */
|
|
367
|
+
export interface WorkspaceSnapshot {
|
|
368
|
+
workspace: Workspace
|
|
369
|
+
blocks: Block[]
|
|
370
|
+
pipelines: Pipeline[]
|
|
371
|
+
executions: ExecutionInstance[]
|
|
372
|
+
/** Bootstrap runs (the unified `agent_runs` bootstrap rows), so the board can
|
|
373
|
+
* render a bootstrap's live progress / failure + retry on load. Absent on
|
|
374
|
+
* older servers. */
|
|
375
|
+
bootstrapJobs?: BootstrapJob[]
|
|
376
|
+
/** Current spend-safeguard status; absent on older servers. */
|
|
377
|
+
spend?: SpendStatus
|
|
378
|
+
/** Open human-actionable notifications for the board inbox + badges. */
|
|
379
|
+
notifications?: Notification[]
|
|
380
|
+
/** The workspace's merge threshold presets (the task preset picker's options). */
|
|
381
|
+
mergePresets?: MergeThresholdPreset[]
|
|
382
|
+
/** Agent config-contribution descriptors (the task-level fields the board renders). */
|
|
383
|
+
agentConfigCatalog?: AgentConfigDescriptor[]
|
|
384
|
+
/** Per-agent-kind default model overrides for this workspace (agentKind → model id). */
|
|
385
|
+
modelDefaults?: ModelDefaults
|
|
386
|
+
/**
|
|
387
|
+
* The deployment's env-routing defaults as `provider:model` refs: the model a
|
|
388
|
+
* kind runs on when neither the task nor the workspace pins one. `default` is the
|
|
389
|
+
* global fallback; `byKind` carries kinds the operator routed specifically. Used
|
|
390
|
+
* to name the model behind "Deployment default" in the settings panel.
|
|
391
|
+
*/
|
|
392
|
+
deploymentModelDefaults?: { default: string; byKind: Record<string, string> }
|
|
393
|
+
/** The workspace's default service-fragment selection (ids new services inherit). */
|
|
394
|
+
serviceFragmentDefaults?: ServiceFragmentDefaults
|
|
395
|
+
/** The workspace's recurring pipelines (schedules shown on the board + inspector). */
|
|
396
|
+
recurringPipelines?: PipelineSchedule[]
|
|
397
|
+
/** The workspace's issue-tracker selection (where the tech-debt pipeline files tickets). */
|
|
398
|
+
trackerSettings?: TrackerSettings
|
|
399
|
+
/** In-org sharing: the services this workspace mounts (with per-board frame layout). */
|
|
400
|
+
mounts?: WorkspaceMount[]
|
|
401
|
+
/** In-org sharing: the org's services this board can mount from (with mount counts). */
|
|
402
|
+
serviceCatalog?: Service[]
|
|
403
|
+
/** The workspace's runtime settings (human-wait escalation threshold + task limit). */
|
|
404
|
+
settings?: WorkspaceSettings
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/** How the per-service running-task limit is bucketed. Mirrors `@cat-factory/contracts`. */
|
|
408
|
+
export type TaskLimitMode = 'off' | 'shared' | 'per_type'
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* A workspace's runtime settings: how long a run may wait for a human before its
|
|
412
|
+
* notification escalates yellow → red, and whether/how the number of tasks running
|
|
413
|
+
* concurrently under one service is capped. Mirrors `@cat-factory/contracts`.
|
|
414
|
+
*/
|
|
415
|
+
export interface WorkspaceSettings {
|
|
416
|
+
/** Minutes a run may wait for human input before its notification turns red. */
|
|
417
|
+
waitingEscalationMinutes: number
|
|
418
|
+
/** Whether/how the per-service running-task limit is enforced. */
|
|
419
|
+
taskLimitMode: TaskLimitMode
|
|
420
|
+
/** The shared cap, when `taskLimitMode` is `shared`. */
|
|
421
|
+
taskLimitShared: number | null
|
|
422
|
+
/** The per-type caps, when `taskLimitMode` is `per_type` (type → cap). */
|
|
423
|
+
taskLimitPerType: Partial<Record<CreateTaskType, number>> | null
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
/** Patch a workspace's settings (only the supplied fields change). */
|
|
427
|
+
export interface UpdateWorkspaceSettingsInput {
|
|
428
|
+
waitingEscalationMinutes?: number
|
|
429
|
+
taskLimitMode?: TaskLimitMode
|
|
430
|
+
taskLimitShared?: number | null
|
|
431
|
+
taskLimitPerType?: Partial<Record<CreateTaskType, number>> | null
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* A workspace's per-agent-kind default model choice. Keys are agent kinds, values
|
|
436
|
+
* are model catalog ids (`ModelOption.id`). A kind absent from the map falls back
|
|
437
|
+
* to the deployment's env-configured routing. Mirrors `@cat-factory/contracts`.
|
|
438
|
+
*/
|
|
439
|
+
export interface ModelDefaults {
|
|
440
|
+
defaults: Record<string, string>
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* A workspace's default service-fragment selection: the best-practice fragment ids
|
|
445
|
+
* new services inherit onto their `serviceFragmentIds`. Mirrors `@cat-factory/contracts`.
|
|
446
|
+
*/
|
|
447
|
+
export interface ServiceFragmentDefaults {
|
|
448
|
+
fragmentIds: string[]
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* Real-time events pushed over the workspace WebSocket stream (see
|
|
453
|
+
* `useWorkspaceStream`). Mirrors `WorkspaceEvent` in `@cat-factory/contracts`.
|
|
454
|
+
*/
|
|
455
|
+
export type WorkspaceEvent =
|
|
456
|
+
| { type: 'execution'; instance: ExecutionInstance; block: Block | null; at: number }
|
|
457
|
+
| { type: 'board'; reason: string; at: number }
|
|
458
|
+
| { type: 'bootstrap'; job: BootstrapJob; block: Block | null; at: number }
|
|
459
|
+
| { type: 'notification'; notification: Notification; at: number }
|
|
460
|
+
| { type: 'llmCall'; call: LlmCallActivity; at: number }
|
|
461
|
+
| { type: 'requirements'; review: RequirementReview; at: number }
|
|
462
|
+
| { type: 'consensus'; session: ConsensusSession; at: number }
|
|
463
|
+
| { type: 'clarity'; review: ClarityReview; at: number }
|
|
464
|
+
|
|
465
|
+
/** Level-of-detail buckets driven by the canvas zoom level. Shallow → deep:
|
|
466
|
+
* `far`/`mid`/`close` govern a service frame (chip → card → opened with tasks);
|
|
467
|
+
* `steps`/`subtasks` drill spatially into an individual task — revealing its
|
|
468
|
+
* build-pipeline steps, then each step's live todo breakdown. */
|
|
469
|
+
export type LodLevel = 'far' | 'mid' | 'close' | 'steps' | 'subtasks'
|
|
470
|
+
|
|
471
|
+
/** The signed-in GitHub user, as returned by the backend's /auth/me. */
|
|
472
|
+
export interface AuthUser {
|
|
473
|
+
/** GitHub user id (stable across renames). */
|
|
474
|
+
id: number
|
|
475
|
+
login: string
|
|
476
|
+
name: string | null
|
|
477
|
+
avatarUrl: string | null
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
// Re-export the adjacent domain modules so `~/types/domain` remains the single
|
|
481
|
+
// import surface for the whole frontend.
|
|
482
|
+
export type * from './execution'
|
|
483
|
+
export type * from './models'
|
|
484
|
+
export type * from './fragments'
|
|
485
|
+
export type * from './documents'
|
|
486
|
+
export type * from './tasks'
|
|
487
|
+
export type * from './bootstrap'
|
|
488
|
+
export type * from './github'
|
|
489
|
+
export type * from './accounts'
|
|
490
|
+
export type * from './notifications'
|
|
491
|
+
export type * from './slack'
|
|
492
|
+
export type * from './merge'
|
|
493
|
+
export type * from './services'
|
|
494
|
+
export type * from './recurring'
|
|
495
|
+
export type * from './tracker'
|