43 lines
1.9 KiB
Markdown
43 lines
1.9 KiB
Markdown
# GooseFactory — Shared Package
|
|
|
|
**Owner:** Architect (maintained by all agents)
|
|
|
|
Canonical TypeScript types, constants, and Zod validation schemas. Every type in this package is derived from `CONTRACTS.md`.
|
|
|
|
## Rules
|
|
1. **This package is the SINGLE source of TypeScript types.**
|
|
2. All other packages import from `@goosefactory/shared`.
|
|
3. If you need a new type that crosses package boundaries, add it HERE first.
|
|
4. Never define the same type in two packages.
|
|
|
|
## Structure
|
|
```
|
|
src/
|
|
├── types/
|
|
│ ├── pipeline.ts # Pipeline, PipelineStage, PipelineStatus
|
|
│ ├── task.ts # Task, TaskType, TaskStatus, TaskDecision
|
|
│ ├── approval.ts # Approval, ApprovalType, ApprovalStatus
|
|
│ ├── agent.ts # Agent, AgentType, AgentHealth
|
|
│ ├── asset.ts # Asset, AssetType
|
|
│ ├── feedback.ts # FeedbackEvent, FeedbackPayload, all feedback subtypes
|
|
│ ├── modal.ts # ModalMessage, ModalResponse, ModalMetrics
|
|
│ ├── api.ts # ApiResponse, ApiError, PaginationParams
|
|
│ ├── ws.ts # WsEvent, WsChannel, all event payloads
|
|
│ └── index.ts # Re-exports everything
|
|
├── constants/
|
|
│ ├── stages.ts # KANBAN_STAGES, stage order, stage transitions
|
|
│ ├── errors.ts # ErrorCode values
|
|
│ └── sla.ts # Default SLA durations
|
|
└── schemas/
|
|
├── feedback.schema.ts # Zod schema for FeedbackEvent validation
|
|
├── pipeline.schema.ts # Zod schema for Pipeline validation
|
|
└── task.schema.ts # Zod schema for Task validation
|
|
```
|
|
|
|
## Usage
|
|
```typescript
|
|
import type { Pipeline, Task, FeedbackEvent } from "@goosefactory/shared";
|
|
import { KANBAN_STAGES, DEFAULT_SLA } from "@goosefactory/shared/constants";
|
|
import { feedbackSchema } from "@goosefactory/shared/schemas";
|
|
```
|