@shepai/cli 1.147.0 → 1.148.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/apis/json-schema/Attachment.yaml +3 -0
- package/dist/packages/core/src/domain/generated/output.d.ts +4 -0
- package/dist/packages/core/src/domain/generated/output.d.ts.map +1 -1
- package/dist/src/presentation/web/app/actions/compose-user-input.d.ts +1 -0
- package/dist/src/presentation/web/app/actions/compose-user-input.d.ts.map +1 -1
- package/dist/src/presentation/web/app/actions/compose-user-input.js +3 -1
- package/dist/src/presentation/web/app/actions/create-feature.d.ts +1 -0
- package/dist/src/presentation/web/app/actions/create-feature.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/attachment-chip/attachment-chip.d.ts +5 -1
- package/dist/src/presentation/web/components/common/attachment-chip/attachment-chip.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/attachment-chip/attachment-chip.js +6 -3
- package/dist/src/presentation/web/components/common/attachment-chip/attachment-chip.stories.d.ts +2 -0
- package/dist/src/presentation/web/components/common/attachment-chip/attachment-chip.stories.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/attachment-chip/attachment-chip.stories.js +20 -0
- package/dist/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.js +5 -1
- package/dist/src/presentation/web/components/common/drawer-action-bar/drawer-action-bar-config.d.ts +2 -0
- package/dist/src/presentation/web/components/common/drawer-action-bar/drawer-action-bar-config.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/drawer-action-bar/drawer-action-bar.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/drawer-action-bar/drawer-action-bar.js +4 -1
- package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.d.ts +2 -0
- package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.js +4 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/build-manifest.json +2 -2
- package/web/.next/fallback-build-manifest.json +2 -2
- package/web/.next/prerender-manifest.json +3 -3
- package/web/.next/required-server-files.js +2 -2
- package/web/.next/required-server-files.json +2 -2
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +36 -36
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +36 -36
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +36 -36
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +36 -36
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/_not-found/page/server-reference-manifest.json +3 -3
- package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/settings/page/server-reference-manifest.json +8 -8
- package/web/.next/server/app/settings/page.js.nft.json +1 -1
- package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/skills/page/server-reference-manifest.json +8 -8
- package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/tools/page/server-reference-manifest.json +8 -8
- package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/version/page/server-reference-manifest.json +3 -3
- package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__c6e32a23._.js.map +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__cd67a84c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0b150ddf._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__2138fa7e._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__2138fa7e._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__29580090._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__29580090._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__357d99f9._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__3ef34e4c._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__43f51aa6._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__43f51aa6._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__815546bd._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__815546bd._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js +5 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c094882b._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c094882b._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__d48c5b11._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__d48c5b11._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__dac5dbf1._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__dac5dbf1._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__df7c1cd3._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__df7c1cd3._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__fae8b355._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__fae8b355._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_05c23ad9._.js +1 -1
- package/web/.next/server/chunks/ssr/_05c23ad9._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_0c5f56e3._.js +2 -2
- package/web/.next/server/chunks/ssr/_0c5f56e3._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_16eb4fec._.js +1 -1
- package/web/.next/server/chunks/ssr/_16eb4fec._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_1b719e7f._.js +1 -1
- package/web/.next/server/chunks/ssr/_1b719e7f._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_37e8548b._.js +1 -1
- package/web/.next/server/chunks/ssr/_37e8548b._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_5a50254c._.js → _4533d6f8._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_5a50254c._.js.map → _4533d6f8._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_55d763e2._.js +1 -1
- package/web/.next/server/chunks/ssr/_55d763e2._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_6256a985._.js +1 -1
- package/web/.next/server/chunks/ssr/_6256a985._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_64bdfc6f._.js +2 -2
- package/web/.next/server/chunks/ssr/_64bdfc6f._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_8fcc39d4._.js +1 -1
- package/web/.next/server/chunks/ssr/_8fcc39d4._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_b71645b4._.js +1 -1
- package/web/.next/server/chunks/ssr/_b71645b4._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_d4b20e29._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_d8575088._.js +1 -1
- package/web/.next/server/chunks/ssr/_d8575088._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_fe63a7f9._.js +3 -0
- package/web/.next/server/chunks/ssr/{_b839d4f1._.js.map → _fe63a7f9._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{src_presentation_web_523768ca._.js → src_presentation_web_7b2fda40._.js} +2 -2
- package/web/.next/server/chunks/ssr/{src_presentation_web_523768ca._.js.map → src_presentation_web_7b2fda40._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1b176e3c.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1b176e3c.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_bd9f0dda.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_bd9f0dda.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
- package/web/.next/server/pages/500.html +2 -2
- package/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/server/server-reference-manifest.json +44 -44
- package/web/.next/static/chunks/0137d4850cab3c45.js +5 -0
- package/web/.next/static/chunks/{a0ab3aee9a5e3d02.js → 04869f1d3f5d9071.js} +1 -1
- package/web/.next/static/chunks/063a24b49d9818a0.js +1 -0
- package/web/.next/static/chunks/21e82fee1a7e1668.js +1 -0
- package/web/.next/static/chunks/{9fd5c3ecc8c5eb07.js → 48850e202dd814ac.js} +1 -1
- package/web/.next/static/chunks/49057cf8cd37e262.js +1 -0
- package/web/.next/static/chunks/{28f5e2d65510526a.js → 682563e4503cbd58.js} +1 -1
- package/web/.next/static/chunks/{0539e93ac218f442.js → 683b1d85e789c2eb.js} +2 -2
- package/web/.next/static/chunks/{0ddea46ed4ba1621.js → 6f76e63ead3fac2e.js} +1 -1
- package/web/.next/static/chunks/{a63c16171b149d2d.js → 7c5131e33516a325.js} +1 -1
- package/web/.next/static/chunks/9b8678597fa1db84.css +1 -0
- package/web/.next/static/chunks/{8923825cdb21cf1c.js → 9dad6769d10a32df.js} +1 -1
- package/web/.next/static/chunks/{63f412a89bde2484.js → c731682077fbac4f.js} +1 -1
- package/web/.next/static/chunks/{ebbc5dd20e227e3d.js → d62ae5e449d87057.js} +1 -1
- package/web/.next/server/chunks/ssr/_b839d4f1._.js +0 -3
- package/web/.next/static/chunks/79984461b85f1e4e.js +0 -1
- package/web/.next/static/chunks/7ab5c32984198a7e.js +0 -2
- package/web/.next/static/chunks/869ae48ca73fa328.js +0 -1
- package/web/.next/static/chunks/d61c239df26c61fd.css +0 -1
- package/web/.next/static/chunks/fa556c575c788679.js +0 -1
- /package/web/.next/static/{41QsWn4e2sGnQCNBIar6W → zYKuE1zbe1UWwAJv5EVwg}/_buildManifest.js +0 -0
- /package/web/.next/static/{41QsWn4e2sGnQCNBIar6W → zYKuE1zbe1UWwAJv5EVwg}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{41QsWn4e2sGnQCNBIar6W → zYKuE1zbe1UWwAJv5EVwg}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/presentation/web/lib/server-container.ts","../../../../../../packages/core/src/domain/generated/output.ts","../../../../../../packages/core/src/infrastructure/services/process/is-process-alive.ts"],"sourcesContent":["/**\n * Server Container Accessor\n *\n * Provides a `resolve()` helper for server components and API routes to\n * obtain DI-managed instances. The tsyringe container is placed on globalThis\n * by the CLI bootstrap (`shep ui`) or the dev-server (`pnpm dev:web`).\n */\n\nimport type { DependencyContainer, InjectionToken } from 'tsyringe';\n\nconst CONTAINER_KEY = '__shepContainer';\n\n/**\n * Resolve a dependency from the DI container.\n *\n * Usage in server components / API routes:\n * ```ts\n * import { resolve } from '@/lib/server-container';\n * import { ListFeaturesUseCase } from '@shepai/core/application/use-cases/features/list-features.use-case';\n *\n * const features = await resolve(ListFeaturesUseCase).execute();\n * ```\n */\nexport function resolve<T>(token: InjectionToken<T>): T {\n const container = (globalThis as Record<string, unknown>)[CONTAINER_KEY] as\n | DependencyContainer\n | undefined;\n\n if (!container) {\n throw new Error(\n 'DI container not available. Ensure the CLI bootstrap or dev-server has initialized it.'\n );\n }\n\n return container.resolve(token);\n}\n","export type UUID = string;\n\n/**\n * Base model providing identity and timestamp fields for all domain entities\n */\nexport type BaseEntity = {\n /**\n * Unique identifier for this entity (UUID v4 format)\n */\n id: UUID;\n /**\n * Timestamp when this entity was created (read-only, set by system)\n */\n createdAt: any;\n /**\n * Timestamp when this entity was last updated (read-only, set by system)\n */\n updatedAt: any;\n};\n\n/**\n * Entity that supports soft deletion with a deletedAt timestamp\n */\nexport type SoftDeletableEntity = BaseEntity & {\n /**\n * Timestamp when this entity was soft-deleted (null if not deleted)\n */\n deletedAt?: any;\n};\n\n/**\n * Entity with audit trail tracking who created and modified it\n */\nexport type AuditableEntity = BaseEntity & {\n /**\n * UUID of the user who created this entity (null for system-created)\n */\n createdBy?: UUID;\n /**\n * UUID of the user who last updated this entity (null for system-updated)\n */\n updatedBy?: UUID;\n};\n\n/**\n * Request model for conversational AI interactions\n */\nexport type AskRequest = {\n /**\n * The natural language query to be processed by the AI agent\n */\n query: string;\n};\n\n/**\n * Response model for conversational AI interactions\n */\nexport type AskResponse = {\n /**\n * The AI-generated response content (typically Markdown-formatted)\n */\n content: string;\n /**\n * Whether the operation completed successfully\n */\n success: boolean;\n};\n\n/**\n * Acceptance criterion for validating completion of an action item\n */\nexport type AcceptanceCriteria = BaseEntity & {\n /**\n * Description of what must be true for this criterion to be satisfied\n */\n description: string;\n /**\n * Whether this criterion has been verified as complete\n */\n verified: boolean;\n};\n\n/**\n * Granular, atomic step within a Task representing a single unit of work\n */\nexport type ActionItem = BaseEntity & {\n /**\n * Short name describing the action (verb-noun pattern recommended)\n */\n name: string;\n /**\n * Detailed description of the work to be performed\n */\n description: string;\n /**\n * Git branch name where this action item's work is performed\n */\n branch: string;\n /**\n * Action items that must complete before this one can start\n */\n dependsOn: ActionItem[];\n /**\n * Acceptance criteria for verifying completion of this action item\n */\n acceptanceCriteria: AcceptanceCriteria[];\n};\nexport enum ArtifactCategory {\n PRD = 'PRD',\n API = 'API',\n Design = 'Design',\n Other = 'Other',\n}\nexport enum ArtifactFormat {\n Markdown = 'md',\n Text = 'txt',\n Yaml = 'yaml',\n Other = 'Other',\n}\nexport enum ArtifactState {\n Todo = 'Todo',\n Elaborating = 'Elaborating',\n Done = 'Done',\n}\n\n/**\n * Generated document or file attached to a Feature\n */\nexport type Artifact = BaseEntity & {\n /**\n * Human-readable name identifying this artifact\n */\n name: string;\n /**\n * Type description providing additional context (e.g., 'documentation', 'api-spec')\n */\n type: string;\n /**\n * Category classification (PRD, API, Design, or Other)\n */\n category: ArtifactCategory;\n /**\n * File format for the artifact content\n */\n format: ArtifactFormat;\n /**\n * Brief summary of the artifact's content and purpose\n */\n summary: string;\n /**\n * Relative file path where the artifact is stored\n */\n path: string;\n /**\n * Current state in the artifact generation lifecycle\n */\n state: ArtifactState;\n};\nexport enum MessageRole {\n Assistant = 'assistant',\n User = 'user',\n}\n\n/**\n * A message in a conversation thread between user and AI assistant\n */\nexport type Message = BaseEntity & {\n /**\n * Role of the message sender (User or Assistant)\n */\n role: MessageRole;\n /**\n * The text content of the message\n */\n content: string;\n /**\n * Optional choices presented to the user for selection\n */\n options?: string[];\n /**\n * Optional user's freeform text answer\n */\n answer?: string;\n /**\n * Optional index of the selected option from the options array (0-based)\n */\n selectedOption?: number;\n};\nexport enum RequirementType {\n Functional = 'Functional',\n NonFunctional = 'NonFunctional',\n}\nexport enum ResearchState {\n NotStarted = 'NotStarted',\n Running = 'Running',\n Finished = 'Finished',\n}\n\n/**\n * A research topic exploration for gathering technical information\n */\nexport type Research = BaseEntity & {\n /**\n * The topic or subject being researched\n */\n topic: string;\n /**\n * Current state of the research activity (NotStarted, Running, Finished)\n */\n state: ResearchState;\n /**\n * Summary of research findings and recommendations\n */\n summary: string;\n /**\n * Artifacts produced during the research activity\n */\n artifacts: Artifact[];\n};\n\n/**\n * A user or inferred requirement attached to a feature\n */\nexport type Requirement = BaseEntity & {\n /**\n * URL-friendly short identifier for the requirement\n */\n slug: string;\n /**\n * The original user query that generated this requirement\n */\n userQuery: string;\n /**\n * Classification type of the requirement (Functional or NonFunctional)\n */\n type: RequirementType;\n /**\n * Research activities conducted to clarify or validate this requirement\n */\n researches: Research[];\n};\n\n/**\n * AI model configuration for the SDLC agent\n */\nexport type ModelConfiguration = {\n /**\n * Default model identifier for all agents\n */\n default: string;\n};\n\n/**\n * User profile information\n */\nexport type UserProfile = {\n /**\n * User's display name (optional)\n */\n name?: string;\n /**\n * User's email address (optional)\n */\n email?: string;\n /**\n * GitHub username (optional, for PR attribution)\n */\n githubUsername?: string;\n};\nexport enum EditorType {\n VsCode = 'vscode',\n Cursor = 'cursor',\n Windsurf = 'windsurf',\n Zed = 'zed',\n Antigravity = 'antigravity',\n}\nexport enum TerminalType {\n System = 'system',\n Warp = 'warp',\n ITerm2 = 'iterm2',\n Alacritty = 'alacritty',\n Kitty = 'kitty',\n}\n\n/**\n * Environment and tooling preferences\n */\nexport type EnvironmentConfig = {\n /**\n * Preferred code editor\n */\n defaultEditor: EditorType;\n /**\n * Preferred shell\n */\n shellPreference: string;\n /**\n * Preferred terminal emulator\n */\n terminalPreference: TerminalType;\n /**\n * Default directory for cloning GitHub repositories (e.g. ~/repos)\n */\n defaultCloneDirectory?: string;\n};\n\n/**\n * System configuration\n */\nexport type SystemConfig = {\n /**\n * CLI auto-update preference\n */\n autoUpdate: boolean;\n /**\n * Log level for CLI output\n */\n logLevel: string;\n};\n\n/**\n * Default approval gate settings for new features\n */\nexport type ApprovalGateDefaults = {\n /**\n * Auto-approve requirements phase (default: false)\n */\n allowPrd: boolean;\n /**\n * Auto-approve planning phase (default: false)\n */\n allowPlan: boolean;\n /**\n * Auto-approve merge phase (default: false)\n */\n allowMerge: boolean;\n /**\n * Push branch to remote on implementation complete (default: false)\n */\n pushOnImplementationComplete: boolean;\n};\n\n/**\n * Per-stage timeout overrides for the feature agent workflow (all values in milliseconds)\n */\nexport type StageTimeouts = {\n /**\n * Timeout for the analyze stage (default: 600000)\n */\n analyzeMs?: number;\n /**\n * Timeout for the requirements stage (default: 600000)\n */\n requirementsMs?: number;\n /**\n * Timeout for the research stage (default: 600000)\n */\n researchMs?: number;\n /**\n * Timeout for the plan stage (default: 600000)\n */\n planMs?: number;\n /**\n * Timeout for the implement stage (default: 600000)\n */\n implementMs?: number;\n /**\n * Timeout for the merge stage (default: 600000)\n */\n mergeMs?: number;\n};\n\n/**\n * Timeout overrides for the analyze-repository agent (all values in milliseconds)\n */\nexport type AnalyzeRepoTimeouts = {\n /**\n * Timeout for the repository analysis stage (default: 600000)\n */\n analyzeMs?: number;\n};\n\n/**\n * Global workflow configuration defaults\n */\nexport type WorkflowConfig = {\n /**\n * Create PR on implementation complete (default: false)\n */\n openPrOnImplementationComplete: boolean;\n /**\n * Default approval gate preferences for new features\n */\n approvalGateDefaults: ApprovalGateDefaults;\n /**\n * Enable CI watch/fix loop after push (default: true)\n */\n ciWatchEnabled: boolean;\n /**\n * Maximum number of CI fix/push/watch iterations before giving up (default: 3)\n */\n ciMaxFixAttempts?: number;\n /**\n * Timeout in milliseconds for watching a CI run (default: 600000 = 10 minutes)\n */\n ciWatchTimeoutMs?: number;\n /**\n * Maximum characters of CI failure logs to pass to the executor (default: 50000)\n */\n ciLogMaxChars?: number;\n /**\n * Poll interval in seconds for gh run watch (default: 30)\n */\n ciWatchPollIntervalSeconds?: number;\n /**\n * Per-stage timeout overrides for the feature agent (default: 600000 = 10 minutes per stage)\n */\n stageTimeouts?: StageTimeouts;\n /**\n * Timeout overrides for the analyze-repository agent (default: 600000 = 10 minutes)\n */\n analyzeRepoTimeouts?: AnalyzeRepoTimeouts;\n /**\n * Enable evidence collection after implementation (default: false)\n */\n enableEvidence: boolean;\n /**\n * Commit evidence to PR (default: false, requires enableEvidence)\n */\n commitEvidence: boolean;\n /**\n * Maximum number of evidence collection retry attempts when validation fails (default: 3)\n */\n evidenceRetries?: number;\n /**\n * Hide CI status badges from UI (default: true)\n */\n hideCiStatus?: boolean;\n};\nexport enum AgentType {\n ClaudeCode = 'claude-code',\n GeminiCli = 'gemini-cli',\n Aider = 'aider',\n Continue = 'continue',\n Cursor = 'cursor',\n Dev = 'dev',\n}\nexport enum AgentAuthMethod {\n Session = 'session',\n Token = 'token',\n}\n\n/**\n * AI coding agent configuration\n */\nexport type AgentConfig = {\n /**\n * Selected AI coding agent\n */\n type: AgentType;\n /**\n * Authentication method for the agent\n */\n authMethod: AgentAuthMethod;\n /**\n * API token for token-based auth (optional)\n */\n token?: string;\n};\n\n/**\n * Notification channel enable/disable configuration\n */\nexport type NotificationChannelConfig = {\n /**\n * Whether this notification channel is enabled\n */\n enabled: boolean;\n};\n\n/**\n * Notification event type filters\n */\nexport type NotificationEventConfig = {\n /**\n * Notify when agent starts running\n */\n agentStarted: boolean;\n /**\n * Notify when agent completes a workflow phase\n */\n phaseCompleted: boolean;\n /**\n * Notify when agent is waiting for human approval\n */\n waitingApproval: boolean;\n /**\n * Notify when agent completes successfully\n */\n agentCompleted: boolean;\n /**\n * Notify when agent execution fails\n */\n agentFailed: boolean;\n /**\n * Notify when a pull request is merged on GitHub\n */\n prMerged: boolean;\n /**\n * Notify when a pull request is closed without merging on GitHub\n */\n prClosed: boolean;\n /**\n * Notify when pull request CI checks pass\n */\n prChecksPassed: boolean;\n /**\n * Notify when pull request CI checks fail\n */\n prChecksFailed: boolean;\n /**\n * Notify when pull request has merge conflicts\n */\n prBlocked: boolean;\n /**\n * Notify when feature is ready for merge review\n */\n mergeReviewReady: boolean;\n};\n\n/**\n * Notification preferences for agent lifecycle events\n */\nexport type NotificationPreferences = {\n /**\n * In-app toast notification channel (Sonner)\n */\n inApp: NotificationChannelConfig;\n /**\n * Browser push notification channel (Web Notifications API)\n */\n browser: NotificationChannelConfig;\n /**\n * Desktop OS notification channel (node-notifier)\n */\n desktop: NotificationChannelConfig;\n /**\n * Which event types trigger notifications\n */\n events: NotificationEventConfig;\n};\n\n/**\n * Feature flag toggles for runtime feature control\n */\nexport type FeatureFlags = {\n /**\n * Enable Skills navigation and functionality in the web UI\n */\n skills: boolean;\n /**\n * Enable environment deployment features in the web UI\n */\n envDeploy: boolean;\n /**\n * Enable debug UI elements and verbose client-side logging\n */\n debug: boolean;\n /**\n * Enable GitHub repository import in the web UI\n */\n githubImport: boolean;\n /**\n * Enable adopt branch feature to import existing branches as tracked features\n */\n adoptBranch: boolean;\n /**\n * Enable git rebase-on-main and sync-main operations in the web UI\n */\n gitRebaseSync: boolean;\n /**\n * Use the built-in React file manager instead of the native OS folder picker\n */\n reactFileManager: boolean;\n};\n\n/**\n * Global Shep platform settings (singleton)\n */\nexport type Settings = BaseEntity & {\n /**\n * AI model configuration for different agents\n */\n models: ModelConfiguration;\n /**\n * User profile information\n */\n user: UserProfile;\n /**\n * Environment and tooling preferences\n */\n environment: EnvironmentConfig;\n /**\n * System-level parameters\n */\n system: SystemConfig;\n /**\n * AI coding agent selection and authentication\n */\n agent: AgentConfig;\n /**\n * Notification preferences for agent lifecycle events\n */\n notifications: NotificationPreferences;\n /**\n * Global workflow configuration defaults\n */\n workflow: WorkflowConfig;\n /**\n * Feature flag toggles for runtime feature control\n */\n featureFlags?: FeatureFlags;\n /**\n * Whether first-run onboarding has been completed (default: false)\n */\n onboardingComplete: boolean;\n};\nexport enum TaskState {\n Todo = 'Todo',\n WIP = 'Work in Progress',\n Done = 'Done',\n Review = 'Review',\n}\n\n/**\n * A discrete unit of work within an implementation plan\n */\nexport type Task = BaseEntity & {\n /**\n * Optional human-readable title for the task\n */\n title?: string;\n /**\n * Optional detailed description of what the task entails\n */\n description?: string;\n /**\n * Tasks that must be completed before this task can begin\n */\n dependsOn: Task[];\n /**\n * Granular action items that comprise this task\n */\n actionItems: ActionItem[];\n /**\n * The base branch from which this task's working branch was created\n */\n baseBranch: string;\n /**\n * Current state of task execution (Todo, WIP, Review, Done)\n */\n state: TaskState;\n /**\n * Git branch where work for this task is performed\n */\n branch: string;\n};\n\n/**\n * A significant event in the feature's timeline tracking user interactions and milestones\n */\nexport type TimelineEvent = BaseEntity & {\n /**\n * The user query or action that triggered this timeline event\n */\n userQuery: string;\n /**\n * Timestamp when this event occurred (read-only, set by system)\n */\n timestamp: any;\n};\nexport enum PlanState {\n Requirements = 'Requirements',\n ClarificationRequired = 'ClarificationRequired',\n Ready = 'Ready',\n}\n\n/**\n * Individual task representation within a Gantt chart visualization\n */\nexport type GanttTask = {\n /**\n * Unique identifier for the Gantt task\n */\n id: UUID;\n /**\n * Display name of the task shown in the Gantt chart\n */\n name: string;\n /**\n * Scheduled start time for the task\n */\n start: any;\n /**\n * Scheduled end time for the task\n */\n end: any;\n /**\n * IDs of tasks that this task depends on (must complete before this task can start)\n */\n dependencies: UUID[];\n /**\n * Completion progress as a fraction (0.0 = not started, 1.0 = complete)\n */\n progress: number;\n};\n\n/**\n * Container for Gantt chart visualization data including tasks and time bounds\n */\nexport type GanttViewData = {\n /**\n * Collection of tasks to display in the Gantt chart\n */\n tasks: GanttTask[];\n /**\n * Start date of the overall work plan (left boundary of the chart)\n */\n startDate: any;\n /**\n * End date of the overall work plan (right boundary of the chart)\n */\n endDate: any;\n};\n\n/**\n * Implementation plan for a feature containing tasks, artifacts, and requirements\n */\nexport type Plan = BaseEntity & {\n /**\n * High-level overview describing the implementation approach\n */\n overview: string;\n /**\n * User and inferred requirements that this plan addresses\n */\n requirements: Requirement[];\n /**\n * Documents and artifacts to be produced as part of this plan\n */\n artifacts: Artifact[];\n /**\n * Work items (tasks) that comprise this implementation plan\n */\n tasks: Task[];\n /**\n * Current state of the plan execution lifecycle\n */\n state: PlanState;\n /**\n * Optional Gantt chart visualization data for work scheduling\n */\n workPlan?: GanttViewData;\n};\nexport enum SdlcLifecycle {\n Started = 'Started',\n Analyze = 'Analyze',\n Requirements = 'Requirements',\n Research = 'Research',\n Planning = 'Planning',\n Implementation = 'Implementation',\n Review = 'Review',\n Maintain = 'Maintain',\n Blocked = 'Blocked',\n Pending = 'Pending',\n Deleting = 'Deleting',\n AwaitingUpstream = 'AwaitingUpstream',\n Archived = 'Archived',\n}\n\n/**\n * Configuration for human-in-the-loop approval gates\n */\nexport type ApprovalGates = {\n /**\n * Skip human review after requirements phase\n */\n allowPrd: boolean;\n /**\n * Skip human review after plan phase\n */\n allowPlan: boolean;\n /**\n * Skip human review after merge phase\n */\n allowMerge: boolean;\n};\nexport enum PrStatus {\n Open = 'Open',\n Merged = 'Merged',\n Closed = 'Closed',\n}\nexport enum CiStatus {\n Pending = 'Pending',\n Success = 'Success',\n Failure = 'Failure',\n}\n\n/**\n * Record of one CI fix attempt in the watch/fix loop\n */\nexport type CiFixRecord = {\n /**\n * 1-based attempt number\n */\n attempt: number;\n /**\n * ISO timestamp when this attempt started\n */\n startedAt: string;\n /**\n * First 500 chars of failure logs for this attempt\n */\n failureSummary: string;\n /**\n * Outcome of this attempt: fixed, failed, or timeout\n */\n outcome: string;\n};\n\n/**\n * Pull request tracking data for a feature\n */\nexport type PullRequest = {\n /**\n * GitHub PR URL\n */\n url: string;\n /**\n * GitHub PR number\n */\n number: number;\n /**\n * Current PR status\n */\n status: PrStatus;\n /**\n * Final commit SHA after push\n */\n commitHash?: string;\n /**\n * CI pipeline status\n */\n ciStatus?: CiStatus;\n /**\n * Number of CI fix attempts made\n */\n ciFixAttempts?: number;\n /**\n * History of CI fix attempts\n */\n ciFixHistory?: CiFixRecord[];\n /**\n * Whether the PR can be merged (false = merge conflicts)\n */\n mergeable?: boolean;\n /**\n * URL of the PR created on the upstream repo (fork-and-PR flow only)\n */\n upstreamPrUrl?: string;\n /**\n * PR number on the upstream repo\n */\n upstreamPrNumber?: number;\n /**\n * Status of the upstream PR\n */\n upstreamPrStatus?: PrStatus;\n};\n\n/**\n * File attachment metadata for a feature (value object, embedded in Feature)\n */\nexport type Attachment = {\n /**\n * Unique identifier for this attachment (UUID v4)\n */\n id: UUID;\n /**\n * Original filename of the attached file\n */\n name: string;\n /**\n * File size in bytes\n */\n size: bigint;\n /**\n * MIME type of the file (e.g. image/png, application/pdf)\n */\n mimeType: string;\n /**\n * File path relative to the repository root\n */\n path: string;\n /**\n * Timestamp when the attachment was created\n */\n createdAt: any;\n};\n\n/**\n * Central entity tracking a piece of work through the SDLC lifecycle (Aggregate Root)\n */\nexport type Feature = SoftDeletableEntity & {\n /**\n * Human-readable name identifying this feature\n */\n name: string;\n /**\n * The exact user input that initiated this feature, preserved verbatim\n */\n userQuery: string;\n /**\n * URL-friendly identifier derived from name (unique within repository)\n */\n slug: string;\n /**\n * Detailed description explaining the feature's purpose and scope\n */\n description: string;\n /**\n * Absolute file system path to the repository\n */\n repositoryPath: string;\n /**\n * Git branch name where this feature's work is performed\n */\n branch: string;\n /**\n * Current stage in the SDLC lifecycle\n */\n lifecycle: SdlcLifecycle;\n /**\n * Conversation history with the AI assistant\n */\n messages: Message[];\n /**\n * Implementation plan containing tasks, artifacts, and requirements (optional)\n */\n plan?: Plan;\n /**\n * Generated documents and artifacts attached to this feature\n */\n relatedArtifacts: Artifact[];\n /**\n * Associated agent run ID for process tracking (optional)\n */\n agentRunId?: string;\n /**\n * Absolute path to the feature spec directory inside the worktree\n */\n specPath?: string;\n /**\n * ID of the Repository entity this feature belongs to\n */\n repositoryId?: UUID;\n /**\n * When true, SDLC phases were skipped and the feature was implemented directly from the prompt\n */\n fast: boolean;\n /**\n * Push branch to remote after implementation (default: false)\n */\n push: boolean;\n /**\n * Create PR after implementation (default: false)\n */\n openPr: boolean;\n /**\n * Fork repo and create PR to upstream at merge time (default: false)\n */\n forkAndPr: boolean;\n /**\n * Commit specs/evidences into the repo (defaults false when forkAndPr is enabled)\n */\n commitSpecs: boolean;\n /**\n * Enable CI watch/fix loop after push (default: true)\n */\n ciWatchEnabled: boolean;\n /**\n * Enable evidence collection after implementation (default: false)\n */\n enableEvidence: boolean;\n /**\n * Commit evidence to PR (default: false, requires enableEvidence)\n */\n commitEvidence: boolean;\n /**\n * Approval gates configuration (embedded value object)\n */\n approvalGates: ApprovalGates;\n /**\n * Absolute path to the git worktree for this feature\n */\n worktreePath?: string;\n /**\n * Pull request data (null until PR created)\n */\n pr?: PullRequest;\n /**\n * Parent feature ID for dependency tracking (optional)\n */\n parentId?: UUID;\n /**\n * Lifecycle state prior to archiving, used to restore on unarchive (only set when lifecycle is Archived)\n */\n previousLifecycle?: SdlcLifecycle;\n /**\n * Files attached by the user when creating or messaging this feature\n */\n attachments?: Attachment[];\n};\n\n/**\n * External link with title and URL\n */\nexport type RelatedLink = {\n /**\n * Human-readable title describing the linked resource\n */\n title: string;\n /**\n * URL to the external documentation, reference, or resource\n */\n url: string;\n};\n\n/**\n * Option for resolving an open question\n */\nexport type QuestionOption = {\n /**\n * The option text describing the potential approach or answer\n */\n option: string;\n /**\n * Description explaining this option's benefits and approach\n */\n description: string;\n /**\n * Whether this option was the one ultimately selected\n */\n selected: boolean;\n};\n\n/**\n * Open question with resolution via options or direct answer\n */\nexport type OpenQuestion = {\n /**\n * The question text that needs to be answered\n */\n question: string;\n /**\n * Whether this question has been resolved (false = blocking)\n */\n resolved: boolean;\n /**\n * Structured options for resolving this question (spec.yaml pattern)\n */\n options?: QuestionOption[];\n /**\n * Rationale explaining which option was selected and why\n */\n selectionRationale?: string;\n /**\n * Free-text answer or resolution (research.yaml pattern)\n */\n answer?: string;\n};\n\n/**\n * Base entity for spec artifacts with common metadata fields\n */\nexport type SpecArtifactBase = BaseEntity & {\n /**\n * Artifact title / feature name\n */\n name: string;\n /**\n * Short description of the artifact's purpose\n */\n summary: string;\n /**\n * Raw Markdown body containing the human-written spec content\n */\n content: string;\n /**\n * Key technologies mentioned or evaluated in this artifact\n */\n technologies: string[];\n /**\n * References to other spec IDs (e.g., '008-agent-configuration')\n */\n relatedFeatures: string[];\n /**\n * URLs to external documentation, references, or comparisons\n */\n relatedLinks: RelatedLink[];\n /**\n * Structured open questions for validation gate checks\n */\n openQuestions: OpenQuestion[];\n};\n\n/**\n * Technology or approach decision with rationale\n */\nexport type TechDecision = {\n /**\n * Title or name of the decision being made\n */\n title: string;\n /**\n * The chosen technology, library, or approach\n */\n chosen: string;\n /**\n * Alternative options that were considered but rejected\n */\n rejected: string[];\n /**\n * Rationale explaining why the chosen option was selected\n */\n rationale: string;\n};\n\n/**\n * Rejection feedback entry for iteration tracking\n */\nexport type RejectionFeedbackEntry = {\n /**\n * Iteration number (1-based)\n */\n iteration: number;\n /**\n * User's feedback message explaining what needs to change\n */\n message: string;\n /**\n * Which phase was rejected (e.g. 'requirements', 'plan')\n */\n phase?: string;\n /**\n * When the rejection occurred\n */\n timestamp: any;\n /**\n * File attachment paths included with the rejection feedback\n */\n attachments?: string[];\n};\n\n/**\n * Implementation phase grouping related tasks\n */\nexport type PlanPhase = {\n /**\n * Unique identifier for this phase (e.g., 'phase-1')\n */\n id: string;\n /**\n * Display name of the phase\n */\n name: string;\n /**\n * Description of what this phase accomplishes and why it's ordered this way\n */\n description?: string;\n /**\n * Whether tasks in this phase can be executed in parallel\n */\n parallel: boolean;\n /**\n * Task IDs belonging to this phase (e.g., ['task-1', 'task-2']). Optional — not present in plan.yaml phases.\n */\n taskIds?: string[];\n};\n\n/**\n * Test-Driven Development cycle phases for a task\n */\nexport type TddCycle = {\n /**\n * RED phase: tests to write FIRST (before implementation)\n */\n red: string[];\n /**\n * GREEN phase: minimal implementation to pass tests\n */\n green: string[];\n /**\n * REFACTOR phase: code improvements while keeping tests green\n */\n refactor: string[];\n};\n\n/**\n * Task definition within a spec's task breakdown\n */\nexport type SpecTask = {\n /**\n * Unique identifier for this task (e.g., 'task-1')\n */\n id: string;\n /**\n * ID of the phase this task belongs to (e.g., 'phase-1')\n */\n phaseId: string;\n /**\n * Task title or name\n */\n title: string;\n /**\n * Detailed description of what this task accomplishes\n */\n description: string;\n /**\n * Current state of the task\n */\n state: TaskState;\n /**\n * IDs of other SpecTasks that must complete before this task starts\n */\n dependencies: string[];\n /**\n * List of acceptance criteria that define task completion\n */\n acceptanceCriteria: string[];\n /**\n * TDD cycle definition for this task (if applicable)\n */\n tdd?: TddCycle;\n /**\n * Estimated effort (e.g., '2 hours', '1 day')\n */\n estimatedEffort: string;\n};\n\n/**\n * Feature specification artifact (PRD) defining requirements and scope\n */\nexport type FeatureArtifact = SpecArtifactBase & {\n /**\n * Spec number (e.g., 11 for spec 011)\n */\n number: number;\n /**\n * Git branch name for this feature (e.g., 'feat/011-feature-name')\n */\n branch: string;\n /**\n * One-line description of the feature\n */\n oneLiner: string;\n /**\n * Current phase in the SDLC lifecycle\n */\n phase: SdlcLifecycle;\n /**\n * Size estimate: XS, S, M, L, or XL\n */\n sizeEstimate: string;\n /**\n * Rejection feedback history for PRD iterations (append-only)\n */\n rejectionFeedback?: RejectionFeedbackEntry[];\n};\n\n/**\n * Research artifact documenting technical analysis and decisions\n */\nexport type ResearchArtifact = SpecArtifactBase & {\n /**\n * Structured technology decisions with rationale\n */\n decisions: TechDecision[];\n};\n\n/**\n * Technical implementation plan artifact defining strategy and file changes\n */\nexport type TechnicalPlanArtifact = SpecArtifactBase & {\n /**\n * Structured implementation phases\n */\n phases: PlanPhase[];\n /**\n * New files planned to be created\n */\n filesToCreate: string[];\n /**\n * Existing files planned to be modified\n */\n filesToModify: string[];\n};\n\n/**\n * Task breakdown artifact defining implementation tasks grouped into phases\n */\nexport type TasksArtifact = SpecArtifactBase & {\n /**\n * Structured task list with acceptance criteria and TDD phases\n */\n tasks: SpecTask[];\n /**\n * Overall effort estimate for all tasks combined\n */\n totalEstimate: string;\n};\n\n/**\n * Feature identity metadata in feature.yaml\n */\nexport type FeatureIdentity = {\n /**\n * Feature ID slug (e.g., '012-autonomous-pr-review-loop')\n */\n id: string;\n /**\n * Human-readable feature name\n */\n name: string;\n /**\n * Feature number (e.g., 12)\n */\n number: number;\n /**\n * Git branch for this feature\n */\n branch: string;\n /**\n * Current lifecycle phase (e.g., 'research', 'implementation', 'complete')\n */\n lifecycle: string;\n /**\n * When the feature was created\n */\n createdAt: string;\n};\n\n/**\n * Task completion progress counters\n */\nexport type FeatureStatusProgress = {\n /**\n * Number of completed tasks\n */\n completed: number;\n /**\n * Total number of tasks\n */\n total: number;\n /**\n * Completion percentage (0-100)\n */\n percentage: number;\n};\n\n/**\n * Feature execution status\n */\nexport type FeatureStatusInfo = {\n /**\n * Current SDLC phase\n */\n phase: string;\n /**\n * Phases that have been completed\n */\n completedPhases?: string[];\n /**\n * Task completion progress\n */\n progress: FeatureStatusProgress;\n /**\n * ID of the task currently being executed (null if none)\n */\n currentTask?: string;\n /**\n * ISO timestamp of last status update\n */\n lastUpdated: string;\n /**\n * Agent or skill that last updated the status\n */\n lastUpdatedBy: string;\n};\n\n/**\n * Validation gate results\n */\nexport type FeatureValidation = {\n /**\n * ISO timestamp of last validation run (null if never run)\n */\n lastRun?: string;\n /**\n * Names of validation gates that passed\n */\n gatesPassed: string[];\n /**\n * Descriptions of auto-fixes that were applied\n */\n autoFixesApplied: string[];\n};\n\n/**\n * Task execution tracking state\n */\nexport type FeatureTaskTracking = {\n /**\n * ID of the task currently being worked on (null if none)\n */\n current?: string;\n /**\n * IDs of tasks blocked by unmet dependencies\n */\n blocked: string[];\n /**\n * IDs of tasks that failed execution\n */\n failed: string[];\n};\n\n/**\n * Milestone checkpoint for phase completion\n */\nexport type FeatureCheckpoint = {\n /**\n * Phase name (e.g., 'feature-created', 'research-complete')\n */\n phase: string;\n /**\n * ISO timestamp when this checkpoint was reached\n */\n completedAt: string;\n /**\n * Agent or skill that completed this phase\n */\n completedBy: string;\n};\n\n/**\n * Error tracking for feature execution\n */\nexport type FeatureErrors = {\n /**\n * Current error message (null if no active error)\n */\n current?: string;\n /**\n * History of past error messages\n */\n history: string[];\n};\n\n/**\n * Feature status tracking artifact (feature.yaml)\n */\nexport type FeatureStatus = BaseEntity & {\n /**\n * Feature identity metadata\n */\n feature: FeatureIdentity;\n /**\n * Current execution status and progress\n */\n status: FeatureStatusInfo;\n /**\n * PR URL if a pull request has been created\n */\n prUrl?: string;\n /**\n * ISO timestamp when the feature was merged\n */\n mergedAt?: string;\n /**\n * Validation gate results\n */\n validation: FeatureValidation;\n /**\n * Task execution tracking\n */\n tasks: FeatureTaskTracking;\n /**\n * Milestone checkpoints recording phase completions\n */\n checkpoints: FeatureCheckpoint[];\n /**\n * Error tracking state\n */\n errors: FeatureErrors;\n};\nexport enum ToolType {\n VsCode = 'vscode',\n Cursor = 'cursor',\n Windsurf = 'windsurf',\n Zed = 'zed',\n Antigravity = 'antigravity',\n CursorCli = 'cursor-cli',\n ClaudeCode = 'claude-code',\n}\n\n/**\n * IDE or CLI tool entity with installation tracking\n */\nexport type Tool = BaseEntity & {\n /**\n * Display name of the tool\n */\n toolName: string;\n /**\n * Tool type classification\n */\n type: ToolType;\n /**\n * Installed version number\n */\n installedVersion?: string;\n /**\n * Tool installation timestamp\n */\n installedAt?: any;\n};\nexport enum NotificationEventType {\n AgentStarted = 'agent_started',\n PhaseCompleted = 'phase_completed',\n WaitingApproval = 'waiting_approval',\n AgentCompleted = 'agent_completed',\n AgentFailed = 'agent_failed',\n PrMerged = 'pr_merged',\n PrClosed = 'pr_closed',\n PrChecksPassed = 'pr_checks_passed',\n PrChecksFailed = 'pr_checks_failed',\n PrBlocked = 'pr_blocked',\n MergeReviewReady = 'merge_review_ready',\n}\nexport enum NotificationSeverity {\n Info = 'info',\n Warning = 'warning',\n Success = 'success',\n Error = 'error',\n}\n\n/**\n * Notification event emitted for agent lifecycle transitions\n */\nexport type NotificationEvent = {\n /**\n * Type of lifecycle event\n */\n eventType: NotificationEventType;\n /**\n * ID of the agent run that triggered this event\n */\n agentRunId: string;\n /**\n * ID of the feature that triggered this event\n */\n featureId: string;\n /**\n * Human-readable feature name\n */\n featureName: string;\n /**\n * Phase name (only for phaseCompleted events)\n */\n phaseName?: string;\n /**\n * Human-readable event description\n */\n message: string;\n /**\n * Display severity for notification rendering\n */\n severity: NotificationSeverity;\n /**\n * When the event occurred\n */\n timestamp: any;\n};\n\n/**\n * A code repository tracked by the Shep platform\n */\nexport type Repository = SoftDeletableEntity & {\n /**\n * Human-readable name for the repository (typically the directory name)\n */\n name: string;\n /**\n * Absolute file system path to the repository root (unique)\n */\n path: string;\n /**\n * Remote GitHub URL this repository was cloned from (normalized: lowercase, no .git suffix)\n */\n remoteUrl?: string;\n};\n\n/**\n * Single installation suggestion for a tool\n */\nexport type InstallationSuggestion = {\n /**\n * Package manager or installation method\n */\n packageManager: string;\n /**\n * Installation command\n */\n command: string;\n /**\n * Official documentation URL\n */\n documentationUrl: string;\n /**\n * Additional notes for installation\n */\n notes?: string;\n};\n\n/**\n * Installation status and suggestions for a tool\n */\nexport type ToolInstallationStatus = {\n /**\n * Current installation status\n */\n status: 'available' | 'missing' | 'error';\n /**\n * Tool name\n */\n toolName: string;\n /**\n * Error message if status is error\n */\n errorMessage?: string;\n /**\n * Installation suggestions\n */\n suggestions?: InstallationSuggestion[];\n};\n\n/**\n * Executable installation command for a tool\n */\nexport type ToolInstallCommand = {\n /**\n * Shell command string to execute\n */\n command: string;\n /**\n * Target platform identifier\n */\n platform: string;\n /**\n * Execution timeout in milliseconds\n */\n timeout: number;\n /**\n * Tool name\n */\n toolName: string;\n /**\n * Package manager identifier\n */\n packageManager: string;\n};\nexport enum EvidenceType {\n Screenshot = 'Screenshot',\n Video = 'Video',\n TestOutput = 'TestOutput',\n TerminalRecording = 'TerminalRecording',\n}\n\n/**\n * Record of evidence captured to prove task completion\n */\nexport type Evidence = {\n /**\n * Category of evidence captured\n */\n type: EvidenceType;\n /**\n * ISO 8601 timestamp when the evidence was captured\n */\n capturedAt: string;\n /**\n * Human-readable description of what this evidence proves\n */\n description: string;\n /**\n * Path relative to repo root for GitHub rendering\n */\n relativePath: string;\n /**\n * Optional reference to the task this evidence proves\n */\n taskRef?: string;\n};\nexport enum AgentStatus {\n Idle = 'Idle',\n Running = 'Running',\n Paused = 'Paused',\n Stopped = 'Stopped',\n}\n\n/**\n * A running agent instance that processes work and responds to queries\n */\nexport type AgentInstance = {\n /**\n * Unique identifier for this agent instance\n */\n id: UUID;\n /**\n * Git branch this agent is operating on for code changes\n */\n branch: string;\n /**\n * Current operational status of the agent (Idle, Running, Paused, or Stopped)\n */\n status: AgentStatus;\n /**\n * Timestamp when this agent instance was created\n */\n createdAt: any;\n};\n\n/**\n * Deployment target wrapping a single ActionItem for granular deployments\n */\nexport type DeployTargetActionItem = {\n /**\n * Discriminator indicating this is an action item target\n */\n kind: 'actionItem';\n /**\n * The action item to deploy - represents an atomic unit of work\n */\n actionItem: ActionItem;\n};\n\n/**\n * Deployment target wrapping a single Task for task-level deployments\n */\nexport type DeployTargetTask = {\n /**\n * Discriminator indicating this is a task target\n */\n kind: 'task';\n /**\n * The task to deploy - includes all action items within the task\n */\n task: Task;\n};\n\n/**\n * Deployment target wrapping multiple Tasks for batch deployments\n */\nexport type DeployTargetTasks = {\n /**\n * Discriminator indicating this is a multi-task target\n */\n kind: 'tasks';\n /**\n * The tasks to deploy - enables batch deployment of related work\n */\n tasks: Task[];\n};\nexport enum FeatureAgentState {\n GatheringRequirements = 'GatheringRequirements',\n ClarificationsRequired = 'ClarificationsRequired',\n DoingResearch = 'DoingResearch',\n AwaitingReview = 'AwaitingReview',\n ExecutingWorkPlan = 'ExecutingWorkPlan',\n Ready = 'Ready',\n}\n\n/**\n * Main orchestrating agent - the 'brain' that manages the complete SDLC workflow for a feature\n */\nexport type FeatureAgent = {\n /**\n * Unique identifier for this feature agent instance\n */\n id: UUID;\n /**\n * The feature being managed by this agent throughout its lifecycle\n */\n feature: Feature;\n /**\n * Sub-agents spawned to handle specific tasks within the workflow\n */\n agents: AgentInstance[];\n /**\n * Current operational state determining what the agent is doing\n */\n state: FeatureAgentState;\n /**\n * Timestamp when this feature agent was created\n */\n createdAt: any;\n};\n\n/**\n * Agent for handling local deployment of features, tasks, or action items\n */\nexport type LocalDeployAgent = {\n /**\n * Unique identifier for this deployment agent instance\n */\n id: UUID;\n /**\n * URL where the deployment is accessible once available (null before deployment)\n */\n url?: string;\n /**\n * Timestamp when this deployment agent was created\n */\n createdAt: any;\n};\nexport enum PortProtocol {\n TCP = 'TCP',\n UDP = 'UDP',\n}\n\n/**\n * Port mapping configuration for exposing container services to the network\n */\nexport type PortMap = {\n /**\n * Service name identifier (e.g., 'web', 'api', 'db', 'redis')\n */\n name: string;\n /**\n * Port number to expose on the host or container network\n */\n port: number;\n /**\n * Network protocol for the port (defaults to TCP if not specified)\n */\n protocol?: PortProtocol;\n};\nexport enum DeployMethod {\n DockerCompose = 'DockerCompose',\n Docker = 'Docker',\n Kubernetes = 'Kubernetes',\n Script = 'Script',\n Manual = 'Manual',\n}\n\n/**\n * Configuration defining how to deploy an application with method and instructions\n */\nexport type DeploySkill = {\n /**\n * Unique identifier for the deployment skill configuration\n */\n id: UUID;\n /**\n * List of port mappings for services to expose when deployed\n */\n ports: PortMap[];\n /**\n * Method to use for deployment (DockerCompose, Docker, Kubernetes, Script, or Manual)\n */\n method: DeployMethod;\n /**\n * Deployment instructions or commands to execute for this deployment method\n */\n instructions: string;\n /**\n * Timestamp when the deployment skill was created\n */\n createdAt: any;\n};\nexport enum DeploymentState {\n Booting = 'Booting',\n Ready = 'Ready',\n Stopped = 'Stopped',\n}\n\n/**\n * A running deployment instance with network configuration and lifecycle management\n */\nexport type Deployment = {\n /**\n * Unique identifier for the deployment instance\n */\n id: UUID;\n /**\n * Current state of the deployment (Booting, Ready, or Stopped)\n */\n state: DeploymentState;\n /**\n * URL where the deployment is accessible (e.g., 'http://localhost:30100/' or 'http://172.33.0.20:5173')\n */\n url: string;\n /**\n * List of port mappings for services exposed by this deployment\n */\n ports: PortMap[];\n /**\n * Timestamp when the deployment was created\n */\n createdAt: any;\n /**\n * Timestamp when the deployment was stopped (only present when state is Stopped)\n */\n stoppedAt?: any;\n};\nexport enum AgentRunStatus {\n pending = 'pending',\n running = 'running',\n completed = 'completed',\n failed = 'failed',\n interrupted = 'interrupted',\n cancelled = 'cancelled',\n waitingApproval = 'waiting_approval',\n}\n\n/**\n * Agent execution run record\n */\nexport type AgentRun = BaseEntity & {\n /**\n * Agent executor type used (claude-code, gemini-cli, etc.)\n */\n agentType: AgentType;\n /**\n * Agent workflow name (analyze-repository, requirements, etc.)\n */\n agentName: string;\n /**\n * Current execution status\n */\n status: AgentRunStatus;\n /**\n * Input prompt sent to agent executor\n */\n prompt: string;\n /**\n * Final result output (optional, populated on completion)\n */\n result?: string;\n /**\n * Executor session ID for resumption (optional)\n */\n sessionId?: string;\n /**\n * LangGraph thread_id for checkpoint lookup and crash resume\n */\n threadId: string;\n /**\n * Process ID for crash recovery (optional)\n */\n pid?: number;\n /**\n * Last heartbeat timestamp for crash detection (optional)\n */\n lastHeartbeat?: any;\n /**\n * Execution start timestamp (optional)\n */\n startedAt?: any;\n /**\n * Execution completion timestamp (optional)\n */\n completedAt?: any;\n /**\n * Error message if execution failed (optional)\n */\n error?: string;\n /**\n * Associated feature ID for feature agent runs (optional)\n */\n featureId?: string;\n /**\n * Repository path for context scoping (optional)\n */\n repositoryPath?: string;\n /**\n * Approval gate configuration for human-in-the-loop review (optional)\n */\n approvalGates?: ApprovalGates;\n /**\n * LLM model identifier used for this run (optional, set at creation)\n */\n modelId?: string;\n};\n\n/**\n * Streaming event emitted during agent execution\n */\nexport type AgentRunEvent = {\n /**\n * Event type: progress, result, or error\n */\n type: 'progress' | 'result' | 'error';\n /**\n * Event content\n */\n content: string;\n /**\n * Event timestamp\n */\n timestamp: any;\n};\n\n/**\n * Agent workflow registration metadata\n */\nexport type AgentDefinition = {\n /**\n * Unique agent workflow name (e.g., analyze-repository)\n */\n name: string;\n /**\n * Human-readable description of what this agent does\n */\n description: string;\n};\nexport type float = any;\nexport type float64 = float;\n\n/**\n * Execution record for a single agent graph node. Tracks timing, prompt, token usage, and outcome.\n */\nexport type PhaseTiming = BaseEntity & {\n /**\n * Agent run this timing belongs to\n */\n agentRunId: string;\n /**\n * Graph node name: analyze, requirements, research, plan, implement\n */\n phase: string;\n /**\n * When the phase started executing\n */\n startedAt: any;\n /**\n * When the phase finished executing (null if still running)\n */\n completedAt?: any;\n /**\n * Duration in milliseconds (computed on completion)\n */\n durationMs?: bigint;\n /**\n * When the phase started waiting for user approval (null if no approval needed)\n */\n waitingApprovalAt?: any;\n /**\n * Duration in milliseconds the phase waited for user approval (null if no approval needed)\n */\n approvalWaitMs?: bigint;\n /**\n * The composed prompt sent to the agent for this phase\n */\n prompt?: string;\n /**\n * Model identifier used for this phase execution\n */\n modelId?: string;\n /**\n * Agent executor type: claude-code, cursor, gemini-cli\n */\n agentType?: string;\n /**\n * Number of input tokens consumed (prompt + context)\n */\n inputTokens?: bigint;\n /**\n * Number of output tokens generated by the agent\n */\n outputTokens?: bigint;\n /**\n * Tokens used to populate the prompt cache (cache misses)\n */\n cacheCreationInputTokens?: bigint;\n /**\n * Tokens served from the prompt cache (cache hits)\n */\n cacheReadInputTokens?: bigint;\n /**\n * Estimated cost in USD for this phase execution\n */\n costUsd?: float64;\n /**\n * Number of agentic turns (tool-call round-trips) in this phase\n */\n numTurns?: number;\n /**\n * Time spent waiting for the API (excludes tool execution)\n */\n durationApiMs?: bigint;\n /**\n * Execution outcome: success, error, timeout, interrupted\n */\n exitCode?: string;\n /**\n * Error details when exitCode is not success\n */\n errorMessage?: string;\n};\n\n/**\n * Change to a question's selected option during PRD review\n */\nexport type QuestionSelectionChange = {\n /**\n * ID of the open question being changed (the question text)\n */\n questionId: string;\n /**\n * The option text that the user selected\n */\n selectedOption: string;\n};\n\n/**\n * Payload sent when user approves a PRD with optional selection changes\n */\nexport type PrdApprovalPayload = {\n /**\n * Always true for approval payloads\n */\n approved: boolean;\n /**\n * List of selection changes the user made during review (empty if no changes)\n */\n changedSelections?: QuestionSelectionChange[];\n};\n\n/**\n * Payload sent when user rejects a PRD with feedback for iteration\n */\nexport type PrdRejectionPayload = {\n /**\n * Always true for rejection payloads\n */\n rejected: boolean;\n /**\n * User's feedback explaining what needs to change\n */\n feedback: string;\n /**\n * Iteration number (1-based, derived from PhaseTiming row count)\n */\n iteration: number;\n /**\n * File attachment paths included with the rejection feedback\n */\n attachments?: string[];\n};\n\n/**\n * A single question with its options as presented in the review TUI\n */\nexport type ReviewQuestion = {\n /**\n * The question text\n */\n question: string;\n /**\n * Available options with selection state\n */\n options: QuestionOption[];\n /**\n * The option text that was selected by the user\n */\n selectedOption: string;\n /**\n * Whether the user changed the selection from the AI default\n */\n changed: boolean;\n};\n\n/**\n * Result of the PRD review TUI interaction\n */\nexport type PrdReviewResult = {\n /**\n * All questions with their final selection state\n */\n questions: ReviewQuestion[];\n /**\n * User action: approve or reject\n */\n action: string;\n /**\n * Rejection feedback (only present when action is 'reject')\n */\n feedback?: string;\n};\n\n/**\n * A single message within an agent provider CLI session\n */\nexport type AgentSessionMessage = {\n /**\n * Provider-native message UUID\n */\n uuid: string;\n /**\n * Message role — user turn or assistant turn\n */\n role: 'user' | 'assistant';\n /**\n * Normalized message content as plain text (tool calls and thinking blocks excluded)\n */\n content: string;\n /**\n * Timestamp when the message was recorded\n */\n timestamp: any;\n};\n\n/**\n * An agent provider CLI session (conversation record read from provider local storage)\n */\nexport type AgentSession = BaseEntity & {\n /**\n * Agent executor type that owns this session (e.g. claude-code)\n */\n agentType: AgentType;\n /**\n * Tilde-abbreviated working directory path for the session (e.g. ~/repos/my-project)\n */\n projectPath: string;\n /**\n * Total number of user and assistant messages in the session\n */\n messageCount: number;\n /**\n * Truncated first user message text used as a session summary preview (optional)\n */\n preview?: string;\n /**\n * Conversation messages — populated only in the detail view (shep session show)\n */\n messages?: AgentSessionMessage[];\n /**\n * Timestamp of the first message in the session (optional)\n */\n firstMessageAt?: any;\n /**\n * Timestamp of the most recent message in the session (optional)\n */\n lastMessageAt?: any;\n};\n\n/**\n * A selectable option within a PRD questionnaire question\n */\nexport type PrdOption = {\n /**\n * Unique identifier for this option\n */\n id: string;\n /**\n * Display label for this option\n */\n label: string;\n /**\n * Explanation of why this option is relevant\n */\n rationale: string;\n /**\n * Whether this option is recommended by AI analysis\n */\n recommended?: boolean;\n /**\n * Whether this option was newly added after refinement\n */\n isNew?: boolean;\n};\n\n/**\n * A single question in the PRD questionnaire with selectable options\n */\nexport type PrdQuestion = {\n /**\n * Unique identifier for this question\n */\n id: string;\n /**\n * The question text displayed to the user\n */\n question: string;\n /**\n * Question interaction type (currently only single-select)\n */\n type: 'select';\n /**\n * Available options for this question\n */\n options: PrdOption[];\n};\n\n/**\n * Configuration for the final action button in the questionnaire\n */\nexport type PrdFinalAction = {\n /**\n * Unique identifier for this action\n */\n id: string;\n /**\n * Button label text\n */\n label: string;\n /**\n * Description of what this action does\n */\n description: string;\n};\n\n/**\n * Complete data for rendering a PRD questionnaire\n */\nexport type PrdQuestionnaireData = {\n /**\n * Header title text for the questionnaire\n */\n question: string;\n /**\n * Header context/description text\n */\n context: string;\n /**\n * Array of questions to display\n */\n questions: PrdQuestion[];\n /**\n * Configuration for the finalize/approve action button\n */\n finalAction: PrdFinalAction;\n};\nexport enum AgentFeature {\n sessionResume = 'session-resume',\n streaming = 'streaming',\n toolScoping = 'tool-scoping',\n structuredOutput = 'structured-output',\n systemPrompt = 'system-prompt',\n sessionListing = 'session-listing',\n}\nexport type DeployTarget = DeployTargetActionItem | DeployTargetTask | DeployTargetTasks;\n\nexport type Askable = {\n Ask(request: AskRequest): AskResponse;\n};\n\nexport type FeatureAgentOperations = {\n NewFeatureWizard(): Feature;\n GatherRequirements(): Requirement[];\n DoResearch(): Research;\n CreatePlan(): Plan;\n BeginImplementation(): void;\n Ask(query: string): AskResponse;\n};\n\nexport type LocalDeployAgentOperations = {\n Deploy(target: DeployTarget, skill: DeploySkill): Deployment;\n Analyze(repositoryPath: string): DeploySkill;\n Ask(query: string): AskResponse;\n};\n","/**\n * Check whether a process with the given PID is still running.\n *\n * Uses `process.kill(pid, 0)` which sends signal 0 (no-op) to test existence.\n * Returns false when the PID does not exist or belongs to a zombie.\n */\nexport function isProcessAlive(pid: number): boolean {\n try {\n process.kill(pid, 0);\n return true;\n } catch {\n return false;\n }\n}\n"],"names":[],"mappings":"g0BAuBO,SAAS,EAAW,CAAwB,EACjD,IAAM,EAAa,UAAsC,CAAC,AAdtC,eAcoD,CAIxE,GAAI,CAAC,EACH,MAAM,AAAI,GADI,GAEZ,0FAIJ,OAAO,EAAU,OAAO,CAAC,EAC3B,ixBCglBO,IAxgBK,EAMA,EAMA,EAuCA,EA8BA,EAIA,EA6EA,EAOA,EAmKA,EAQA,IA0OA,EAmFA,IAsCA,EA+rBA,EA+BA,EAaA,gBAqyBA,EA/rDA,IAAA,2EAAA,sGAyIL,IAAK,8TAAA,IAiCA,kRAmuBL,IAAK,sWAAA,GAaA,8EAAA,IAoIA,iHAgCA,6EAsEA,iOAoDA,6BAsBA,qHAiCA,4DAmCL,IAAK,IAAA,+KAAA,GC/3DL,SAAS,EAAe,CAAW,EACxC,GAAI,CAEF,OADA,QAAQ,IAAI,CAAC,EAAK,IACX,CACT,CAAE,KAAM,CACN,OAAO,CACT,CACF"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/presentation/web/lib/server-container.ts","../../../../../../packages/core/src/domain/generated/output.ts","../../../../../../packages/core/src/infrastructure/services/process/is-process-alive.ts"],"sourcesContent":["/**\n * Server Container Accessor\n *\n * Provides a `resolve()` helper for server components and API routes to\n * obtain DI-managed instances. The tsyringe container is placed on globalThis\n * by the CLI bootstrap (`shep ui`) or the dev-server (`pnpm dev:web`).\n */\n\nimport type { DependencyContainer, InjectionToken } from 'tsyringe';\n\nconst CONTAINER_KEY = '__shepContainer';\n\n/**\n * Resolve a dependency from the DI container.\n *\n * Usage in server components / API routes:\n * ```ts\n * import { resolve } from '@/lib/server-container';\n * import { ListFeaturesUseCase } from '@shepai/core/application/use-cases/features/list-features.use-case';\n *\n * const features = await resolve(ListFeaturesUseCase).execute();\n * ```\n */\nexport function resolve<T>(token: InjectionToken<T>): T {\n const container = (globalThis as Record<string, unknown>)[CONTAINER_KEY] as\n | DependencyContainer\n | undefined;\n\n if (!container) {\n throw new Error(\n 'DI container not available. Ensure the CLI bootstrap or dev-server has initialized it.'\n );\n }\n\n return container.resolve(token);\n}\n","export type UUID = string;\n\n/**\n * Base model providing identity and timestamp fields for all domain entities\n */\nexport type BaseEntity = {\n /**\n * Unique identifier for this entity (UUID v4 format)\n */\n id: UUID;\n /**\n * Timestamp when this entity was created (read-only, set by system)\n */\n createdAt: any;\n /**\n * Timestamp when this entity was last updated (read-only, set by system)\n */\n updatedAt: any;\n};\n\n/**\n * Entity that supports soft deletion with a deletedAt timestamp\n */\nexport type SoftDeletableEntity = BaseEntity & {\n /**\n * Timestamp when this entity was soft-deleted (null if not deleted)\n */\n deletedAt?: any;\n};\n\n/**\n * Entity with audit trail tracking who created and modified it\n */\nexport type AuditableEntity = BaseEntity & {\n /**\n * UUID of the user who created this entity (null for system-created)\n */\n createdBy?: UUID;\n /**\n * UUID of the user who last updated this entity (null for system-updated)\n */\n updatedBy?: UUID;\n};\n\n/**\n * Request model for conversational AI interactions\n */\nexport type AskRequest = {\n /**\n * The natural language query to be processed by the AI agent\n */\n query: string;\n};\n\n/**\n * Response model for conversational AI interactions\n */\nexport type AskResponse = {\n /**\n * The AI-generated response content (typically Markdown-formatted)\n */\n content: string;\n /**\n * Whether the operation completed successfully\n */\n success: boolean;\n};\n\n/**\n * Acceptance criterion for validating completion of an action item\n */\nexport type AcceptanceCriteria = BaseEntity & {\n /**\n * Description of what must be true for this criterion to be satisfied\n */\n description: string;\n /**\n * Whether this criterion has been verified as complete\n */\n verified: boolean;\n};\n\n/**\n * Granular, atomic step within a Task representing a single unit of work\n */\nexport type ActionItem = BaseEntity & {\n /**\n * Short name describing the action (verb-noun pattern recommended)\n */\n name: string;\n /**\n * Detailed description of the work to be performed\n */\n description: string;\n /**\n * Git branch name where this action item's work is performed\n */\n branch: string;\n /**\n * Action items that must complete before this one can start\n */\n dependsOn: ActionItem[];\n /**\n * Acceptance criteria for verifying completion of this action item\n */\n acceptanceCriteria: AcceptanceCriteria[];\n};\nexport enum ArtifactCategory {\n PRD = 'PRD',\n API = 'API',\n Design = 'Design',\n Other = 'Other',\n}\nexport enum ArtifactFormat {\n Markdown = 'md',\n Text = 'txt',\n Yaml = 'yaml',\n Other = 'Other',\n}\nexport enum ArtifactState {\n Todo = 'Todo',\n Elaborating = 'Elaborating',\n Done = 'Done',\n}\n\n/**\n * Generated document or file attached to a Feature\n */\nexport type Artifact = BaseEntity & {\n /**\n * Human-readable name identifying this artifact\n */\n name: string;\n /**\n * Type description providing additional context (e.g., 'documentation', 'api-spec')\n */\n type: string;\n /**\n * Category classification (PRD, API, Design, or Other)\n */\n category: ArtifactCategory;\n /**\n * File format for the artifact content\n */\n format: ArtifactFormat;\n /**\n * Brief summary of the artifact's content and purpose\n */\n summary: string;\n /**\n * Relative file path where the artifact is stored\n */\n path: string;\n /**\n * Current state in the artifact generation lifecycle\n */\n state: ArtifactState;\n};\nexport enum MessageRole {\n Assistant = 'assistant',\n User = 'user',\n}\n\n/**\n * A message in a conversation thread between user and AI assistant\n */\nexport type Message = BaseEntity & {\n /**\n * Role of the message sender (User or Assistant)\n */\n role: MessageRole;\n /**\n * The text content of the message\n */\n content: string;\n /**\n * Optional choices presented to the user for selection\n */\n options?: string[];\n /**\n * Optional user's freeform text answer\n */\n answer?: string;\n /**\n * Optional index of the selected option from the options array (0-based)\n */\n selectedOption?: number;\n};\nexport enum RequirementType {\n Functional = 'Functional',\n NonFunctional = 'NonFunctional',\n}\nexport enum ResearchState {\n NotStarted = 'NotStarted',\n Running = 'Running',\n Finished = 'Finished',\n}\n\n/**\n * A research topic exploration for gathering technical information\n */\nexport type Research = BaseEntity & {\n /**\n * The topic or subject being researched\n */\n topic: string;\n /**\n * Current state of the research activity (NotStarted, Running, Finished)\n */\n state: ResearchState;\n /**\n * Summary of research findings and recommendations\n */\n summary: string;\n /**\n * Artifacts produced during the research activity\n */\n artifacts: Artifact[];\n};\n\n/**\n * A user or inferred requirement attached to a feature\n */\nexport type Requirement = BaseEntity & {\n /**\n * URL-friendly short identifier for the requirement\n */\n slug: string;\n /**\n * The original user query that generated this requirement\n */\n userQuery: string;\n /**\n * Classification type of the requirement (Functional or NonFunctional)\n */\n type: RequirementType;\n /**\n * Research activities conducted to clarify or validate this requirement\n */\n researches: Research[];\n};\n\n/**\n * AI model configuration for the SDLC agent\n */\nexport type ModelConfiguration = {\n /**\n * Default model identifier for all agents\n */\n default: string;\n};\n\n/**\n * User profile information\n */\nexport type UserProfile = {\n /**\n * User's display name (optional)\n */\n name?: string;\n /**\n * User's email address (optional)\n */\n email?: string;\n /**\n * GitHub username (optional, for PR attribution)\n */\n githubUsername?: string;\n};\nexport enum EditorType {\n VsCode = 'vscode',\n Cursor = 'cursor',\n Windsurf = 'windsurf',\n Zed = 'zed',\n Antigravity = 'antigravity',\n}\nexport enum TerminalType {\n System = 'system',\n Warp = 'warp',\n ITerm2 = 'iterm2',\n Alacritty = 'alacritty',\n Kitty = 'kitty',\n}\n\n/**\n * Environment and tooling preferences\n */\nexport type EnvironmentConfig = {\n /**\n * Preferred code editor\n */\n defaultEditor: EditorType;\n /**\n * Preferred shell\n */\n shellPreference: string;\n /**\n * Preferred terminal emulator\n */\n terminalPreference: TerminalType;\n /**\n * Default directory for cloning GitHub repositories (e.g. ~/repos)\n */\n defaultCloneDirectory?: string;\n};\n\n/**\n * System configuration\n */\nexport type SystemConfig = {\n /**\n * CLI auto-update preference\n */\n autoUpdate: boolean;\n /**\n * Log level for CLI output\n */\n logLevel: string;\n};\n\n/**\n * Default approval gate settings for new features\n */\nexport type ApprovalGateDefaults = {\n /**\n * Auto-approve requirements phase (default: false)\n */\n allowPrd: boolean;\n /**\n * Auto-approve planning phase (default: false)\n */\n allowPlan: boolean;\n /**\n * Auto-approve merge phase (default: false)\n */\n allowMerge: boolean;\n /**\n * Push branch to remote on implementation complete (default: false)\n */\n pushOnImplementationComplete: boolean;\n};\n\n/**\n * Per-stage timeout overrides for the feature agent workflow (all values in milliseconds)\n */\nexport type StageTimeouts = {\n /**\n * Timeout for the analyze stage (default: 600000)\n */\n analyzeMs?: number;\n /**\n * Timeout for the requirements stage (default: 600000)\n */\n requirementsMs?: number;\n /**\n * Timeout for the research stage (default: 600000)\n */\n researchMs?: number;\n /**\n * Timeout for the plan stage (default: 600000)\n */\n planMs?: number;\n /**\n * Timeout for the implement stage (default: 600000)\n */\n implementMs?: number;\n /**\n * Timeout for the merge stage (default: 600000)\n */\n mergeMs?: number;\n};\n\n/**\n * Timeout overrides for the analyze-repository agent (all values in milliseconds)\n */\nexport type AnalyzeRepoTimeouts = {\n /**\n * Timeout for the repository analysis stage (default: 600000)\n */\n analyzeMs?: number;\n};\n\n/**\n * Global workflow configuration defaults\n */\nexport type WorkflowConfig = {\n /**\n * Create PR on implementation complete (default: false)\n */\n openPrOnImplementationComplete: boolean;\n /**\n * Default approval gate preferences for new features\n */\n approvalGateDefaults: ApprovalGateDefaults;\n /**\n * Enable CI watch/fix loop after push (default: true)\n */\n ciWatchEnabled: boolean;\n /**\n * Maximum number of CI fix/push/watch iterations before giving up (default: 3)\n */\n ciMaxFixAttempts?: number;\n /**\n * Timeout in milliseconds for watching a CI run (default: 600000 = 10 minutes)\n */\n ciWatchTimeoutMs?: number;\n /**\n * Maximum characters of CI failure logs to pass to the executor (default: 50000)\n */\n ciLogMaxChars?: number;\n /**\n * Poll interval in seconds for gh run watch (default: 30)\n */\n ciWatchPollIntervalSeconds?: number;\n /**\n * Per-stage timeout overrides for the feature agent (default: 600000 = 10 minutes per stage)\n */\n stageTimeouts?: StageTimeouts;\n /**\n * Timeout overrides for the analyze-repository agent (default: 600000 = 10 minutes)\n */\n analyzeRepoTimeouts?: AnalyzeRepoTimeouts;\n /**\n * Enable evidence collection after implementation (default: false)\n */\n enableEvidence: boolean;\n /**\n * Commit evidence to PR (default: false, requires enableEvidence)\n */\n commitEvidence: boolean;\n /**\n * Maximum number of evidence collection retry attempts when validation fails (default: 3)\n */\n evidenceRetries?: number;\n /**\n * Hide CI status badges from UI (default: true)\n */\n hideCiStatus?: boolean;\n};\nexport enum AgentType {\n ClaudeCode = 'claude-code',\n GeminiCli = 'gemini-cli',\n Aider = 'aider',\n Continue = 'continue',\n Cursor = 'cursor',\n Dev = 'dev',\n}\nexport enum AgentAuthMethod {\n Session = 'session',\n Token = 'token',\n}\n\n/**\n * AI coding agent configuration\n */\nexport type AgentConfig = {\n /**\n * Selected AI coding agent\n */\n type: AgentType;\n /**\n * Authentication method for the agent\n */\n authMethod: AgentAuthMethod;\n /**\n * API token for token-based auth (optional)\n */\n token?: string;\n};\n\n/**\n * Notification channel enable/disable configuration\n */\nexport type NotificationChannelConfig = {\n /**\n * Whether this notification channel is enabled\n */\n enabled: boolean;\n};\n\n/**\n * Notification event type filters\n */\nexport type NotificationEventConfig = {\n /**\n * Notify when agent starts running\n */\n agentStarted: boolean;\n /**\n * Notify when agent completes a workflow phase\n */\n phaseCompleted: boolean;\n /**\n * Notify when agent is waiting for human approval\n */\n waitingApproval: boolean;\n /**\n * Notify when agent completes successfully\n */\n agentCompleted: boolean;\n /**\n * Notify when agent execution fails\n */\n agentFailed: boolean;\n /**\n * Notify when a pull request is merged on GitHub\n */\n prMerged: boolean;\n /**\n * Notify when a pull request is closed without merging on GitHub\n */\n prClosed: boolean;\n /**\n * Notify when pull request CI checks pass\n */\n prChecksPassed: boolean;\n /**\n * Notify when pull request CI checks fail\n */\n prChecksFailed: boolean;\n /**\n * Notify when pull request has merge conflicts\n */\n prBlocked: boolean;\n /**\n * Notify when feature is ready for merge review\n */\n mergeReviewReady: boolean;\n};\n\n/**\n * Notification preferences for agent lifecycle events\n */\nexport type NotificationPreferences = {\n /**\n * In-app toast notification channel (Sonner)\n */\n inApp: NotificationChannelConfig;\n /**\n * Browser push notification channel (Web Notifications API)\n */\n browser: NotificationChannelConfig;\n /**\n * Desktop OS notification channel (node-notifier)\n */\n desktop: NotificationChannelConfig;\n /**\n * Which event types trigger notifications\n */\n events: NotificationEventConfig;\n};\n\n/**\n * Feature flag toggles for runtime feature control\n */\nexport type FeatureFlags = {\n /**\n * Enable Skills navigation and functionality in the web UI\n */\n skills: boolean;\n /**\n * Enable environment deployment features in the web UI\n */\n envDeploy: boolean;\n /**\n * Enable debug UI elements and verbose client-side logging\n */\n debug: boolean;\n /**\n * Enable GitHub repository import in the web UI\n */\n githubImport: boolean;\n /**\n * Enable adopt branch feature to import existing branches as tracked features\n */\n adoptBranch: boolean;\n /**\n * Enable git rebase-on-main and sync-main operations in the web UI\n */\n gitRebaseSync: boolean;\n /**\n * Use the built-in React file manager instead of the native OS folder picker\n */\n reactFileManager: boolean;\n};\n\n/**\n * Global Shep platform settings (singleton)\n */\nexport type Settings = BaseEntity & {\n /**\n * AI model configuration for different agents\n */\n models: ModelConfiguration;\n /**\n * User profile information\n */\n user: UserProfile;\n /**\n * Environment and tooling preferences\n */\n environment: EnvironmentConfig;\n /**\n * System-level parameters\n */\n system: SystemConfig;\n /**\n * AI coding agent selection and authentication\n */\n agent: AgentConfig;\n /**\n * Notification preferences for agent lifecycle events\n */\n notifications: NotificationPreferences;\n /**\n * Global workflow configuration defaults\n */\n workflow: WorkflowConfig;\n /**\n * Feature flag toggles for runtime feature control\n */\n featureFlags?: FeatureFlags;\n /**\n * Whether first-run onboarding has been completed (default: false)\n */\n onboardingComplete: boolean;\n};\nexport enum TaskState {\n Todo = 'Todo',\n WIP = 'Work in Progress',\n Done = 'Done',\n Review = 'Review',\n}\n\n/**\n * A discrete unit of work within an implementation plan\n */\nexport type Task = BaseEntity & {\n /**\n * Optional human-readable title for the task\n */\n title?: string;\n /**\n * Optional detailed description of what the task entails\n */\n description?: string;\n /**\n * Tasks that must be completed before this task can begin\n */\n dependsOn: Task[];\n /**\n * Granular action items that comprise this task\n */\n actionItems: ActionItem[];\n /**\n * The base branch from which this task's working branch was created\n */\n baseBranch: string;\n /**\n * Current state of task execution (Todo, WIP, Review, Done)\n */\n state: TaskState;\n /**\n * Git branch where work for this task is performed\n */\n branch: string;\n};\n\n/**\n * A significant event in the feature's timeline tracking user interactions and milestones\n */\nexport type TimelineEvent = BaseEntity & {\n /**\n * The user query or action that triggered this timeline event\n */\n userQuery: string;\n /**\n * Timestamp when this event occurred (read-only, set by system)\n */\n timestamp: any;\n};\nexport enum PlanState {\n Requirements = 'Requirements',\n ClarificationRequired = 'ClarificationRequired',\n Ready = 'Ready',\n}\n\n/**\n * Individual task representation within a Gantt chart visualization\n */\nexport type GanttTask = {\n /**\n * Unique identifier for the Gantt task\n */\n id: UUID;\n /**\n * Display name of the task shown in the Gantt chart\n */\n name: string;\n /**\n * Scheduled start time for the task\n */\n start: any;\n /**\n * Scheduled end time for the task\n */\n end: any;\n /**\n * IDs of tasks that this task depends on (must complete before this task can start)\n */\n dependencies: UUID[];\n /**\n * Completion progress as a fraction (0.0 = not started, 1.0 = complete)\n */\n progress: number;\n};\n\n/**\n * Container for Gantt chart visualization data including tasks and time bounds\n */\nexport type GanttViewData = {\n /**\n * Collection of tasks to display in the Gantt chart\n */\n tasks: GanttTask[];\n /**\n * Start date of the overall work plan (left boundary of the chart)\n */\n startDate: any;\n /**\n * End date of the overall work plan (right boundary of the chart)\n */\n endDate: any;\n};\n\n/**\n * Implementation plan for a feature containing tasks, artifacts, and requirements\n */\nexport type Plan = BaseEntity & {\n /**\n * High-level overview describing the implementation approach\n */\n overview: string;\n /**\n * User and inferred requirements that this plan addresses\n */\n requirements: Requirement[];\n /**\n * Documents and artifacts to be produced as part of this plan\n */\n artifacts: Artifact[];\n /**\n * Work items (tasks) that comprise this implementation plan\n */\n tasks: Task[];\n /**\n * Current state of the plan execution lifecycle\n */\n state: PlanState;\n /**\n * Optional Gantt chart visualization data for work scheduling\n */\n workPlan?: GanttViewData;\n};\nexport enum SdlcLifecycle {\n Started = 'Started',\n Analyze = 'Analyze',\n Requirements = 'Requirements',\n Research = 'Research',\n Planning = 'Planning',\n Implementation = 'Implementation',\n Review = 'Review',\n Maintain = 'Maintain',\n Blocked = 'Blocked',\n Pending = 'Pending',\n Deleting = 'Deleting',\n AwaitingUpstream = 'AwaitingUpstream',\n Archived = 'Archived',\n}\n\n/**\n * Configuration for human-in-the-loop approval gates\n */\nexport type ApprovalGates = {\n /**\n * Skip human review after requirements phase\n */\n allowPrd: boolean;\n /**\n * Skip human review after plan phase\n */\n allowPlan: boolean;\n /**\n * Skip human review after merge phase\n */\n allowMerge: boolean;\n};\nexport enum PrStatus {\n Open = 'Open',\n Merged = 'Merged',\n Closed = 'Closed',\n}\nexport enum CiStatus {\n Pending = 'Pending',\n Success = 'Success',\n Failure = 'Failure',\n}\n\n/**\n * Record of one CI fix attempt in the watch/fix loop\n */\nexport type CiFixRecord = {\n /**\n * 1-based attempt number\n */\n attempt: number;\n /**\n * ISO timestamp when this attempt started\n */\n startedAt: string;\n /**\n * First 500 chars of failure logs for this attempt\n */\n failureSummary: string;\n /**\n * Outcome of this attempt: fixed, failed, or timeout\n */\n outcome: string;\n};\n\n/**\n * Pull request tracking data for a feature\n */\nexport type PullRequest = {\n /**\n * GitHub PR URL\n */\n url: string;\n /**\n * GitHub PR number\n */\n number: number;\n /**\n * Current PR status\n */\n status: PrStatus;\n /**\n * Final commit SHA after push\n */\n commitHash?: string;\n /**\n * CI pipeline status\n */\n ciStatus?: CiStatus;\n /**\n * Number of CI fix attempts made\n */\n ciFixAttempts?: number;\n /**\n * History of CI fix attempts\n */\n ciFixHistory?: CiFixRecord[];\n /**\n * Whether the PR can be merged (false = merge conflicts)\n */\n mergeable?: boolean;\n /**\n * URL of the PR created on the upstream repo (fork-and-PR flow only)\n */\n upstreamPrUrl?: string;\n /**\n * PR number on the upstream repo\n */\n upstreamPrNumber?: number;\n /**\n * Status of the upstream PR\n */\n upstreamPrStatus?: PrStatus;\n};\n\n/**\n * File attachment metadata for a feature (value object, embedded in Feature)\n */\nexport type Attachment = {\n /**\n * Unique identifier for this attachment (UUID v4)\n */\n id: UUID;\n /**\n * Original filename of the attached file\n */\n name: string;\n /**\n * File size in bytes\n */\n size: bigint;\n /**\n * MIME type of the file (e.g. image/png, application/pdf)\n */\n mimeType: string;\n /**\n * File path relative to the repository root\n */\n path: string;\n /**\n * Timestamp when the attachment was created\n */\n createdAt: any;\n /**\n * Optional user notes or annotations for this attachment\n */\n notes?: string;\n};\n\n/**\n * Central entity tracking a piece of work through the SDLC lifecycle (Aggregate Root)\n */\nexport type Feature = SoftDeletableEntity & {\n /**\n * Human-readable name identifying this feature\n */\n name: string;\n /**\n * The exact user input that initiated this feature, preserved verbatim\n */\n userQuery: string;\n /**\n * URL-friendly identifier derived from name (unique within repository)\n */\n slug: string;\n /**\n * Detailed description explaining the feature's purpose and scope\n */\n description: string;\n /**\n * Absolute file system path to the repository\n */\n repositoryPath: string;\n /**\n * Git branch name where this feature's work is performed\n */\n branch: string;\n /**\n * Current stage in the SDLC lifecycle\n */\n lifecycle: SdlcLifecycle;\n /**\n * Conversation history with the AI assistant\n */\n messages: Message[];\n /**\n * Implementation plan containing tasks, artifacts, and requirements (optional)\n */\n plan?: Plan;\n /**\n * Generated documents and artifacts attached to this feature\n */\n relatedArtifacts: Artifact[];\n /**\n * Associated agent run ID for process tracking (optional)\n */\n agentRunId?: string;\n /**\n * Absolute path to the feature spec directory inside the worktree\n */\n specPath?: string;\n /**\n * ID of the Repository entity this feature belongs to\n */\n repositoryId?: UUID;\n /**\n * When true, SDLC phases were skipped and the feature was implemented directly from the prompt\n */\n fast: boolean;\n /**\n * Push branch to remote after implementation (default: false)\n */\n push: boolean;\n /**\n * Create PR after implementation (default: false)\n */\n openPr: boolean;\n /**\n * Fork repo and create PR to upstream at merge time (default: false)\n */\n forkAndPr: boolean;\n /**\n * Commit specs/evidences into the repo (defaults false when forkAndPr is enabled)\n */\n commitSpecs: boolean;\n /**\n * Enable CI watch/fix loop after push (default: true)\n */\n ciWatchEnabled: boolean;\n /**\n * Enable evidence collection after implementation (default: false)\n */\n enableEvidence: boolean;\n /**\n * Commit evidence to PR (default: false, requires enableEvidence)\n */\n commitEvidence: boolean;\n /**\n * Approval gates configuration (embedded value object)\n */\n approvalGates: ApprovalGates;\n /**\n * Absolute path to the git worktree for this feature\n */\n worktreePath?: string;\n /**\n * Pull request data (null until PR created)\n */\n pr?: PullRequest;\n /**\n * Parent feature ID for dependency tracking (optional)\n */\n parentId?: UUID;\n /**\n * Lifecycle state prior to archiving, used to restore on unarchive (only set when lifecycle is Archived)\n */\n previousLifecycle?: SdlcLifecycle;\n /**\n * Files attached by the user when creating or messaging this feature\n */\n attachments?: Attachment[];\n};\n\n/**\n * External link with title and URL\n */\nexport type RelatedLink = {\n /**\n * Human-readable title describing the linked resource\n */\n title: string;\n /**\n * URL to the external documentation, reference, or resource\n */\n url: string;\n};\n\n/**\n * Option for resolving an open question\n */\nexport type QuestionOption = {\n /**\n * The option text describing the potential approach or answer\n */\n option: string;\n /**\n * Description explaining this option's benefits and approach\n */\n description: string;\n /**\n * Whether this option was the one ultimately selected\n */\n selected: boolean;\n};\n\n/**\n * Open question with resolution via options or direct answer\n */\nexport type OpenQuestion = {\n /**\n * The question text that needs to be answered\n */\n question: string;\n /**\n * Whether this question has been resolved (false = blocking)\n */\n resolved: boolean;\n /**\n * Structured options for resolving this question (spec.yaml pattern)\n */\n options?: QuestionOption[];\n /**\n * Rationale explaining which option was selected and why\n */\n selectionRationale?: string;\n /**\n * Free-text answer or resolution (research.yaml pattern)\n */\n answer?: string;\n};\n\n/**\n * Base entity for spec artifacts with common metadata fields\n */\nexport type SpecArtifactBase = BaseEntity & {\n /**\n * Artifact title / feature name\n */\n name: string;\n /**\n * Short description of the artifact's purpose\n */\n summary: string;\n /**\n * Raw Markdown body containing the human-written spec content\n */\n content: string;\n /**\n * Key technologies mentioned or evaluated in this artifact\n */\n technologies: string[];\n /**\n * References to other spec IDs (e.g., '008-agent-configuration')\n */\n relatedFeatures: string[];\n /**\n * URLs to external documentation, references, or comparisons\n */\n relatedLinks: RelatedLink[];\n /**\n * Structured open questions for validation gate checks\n */\n openQuestions: OpenQuestion[];\n};\n\n/**\n * Technology or approach decision with rationale\n */\nexport type TechDecision = {\n /**\n * Title or name of the decision being made\n */\n title: string;\n /**\n * The chosen technology, library, or approach\n */\n chosen: string;\n /**\n * Alternative options that were considered but rejected\n */\n rejected: string[];\n /**\n * Rationale explaining why the chosen option was selected\n */\n rationale: string;\n};\n\n/**\n * Rejection feedback entry for iteration tracking\n */\nexport type RejectionFeedbackEntry = {\n /**\n * Iteration number (1-based)\n */\n iteration: number;\n /**\n * User's feedback message explaining what needs to change\n */\n message: string;\n /**\n * Which phase was rejected (e.g. 'requirements', 'plan')\n */\n phase?: string;\n /**\n * When the rejection occurred\n */\n timestamp: any;\n /**\n * File attachment paths included with the rejection feedback\n */\n attachments?: string[];\n};\n\n/**\n * Implementation phase grouping related tasks\n */\nexport type PlanPhase = {\n /**\n * Unique identifier for this phase (e.g., 'phase-1')\n */\n id: string;\n /**\n * Display name of the phase\n */\n name: string;\n /**\n * Description of what this phase accomplishes and why it's ordered this way\n */\n description?: string;\n /**\n * Whether tasks in this phase can be executed in parallel\n */\n parallel: boolean;\n /**\n * Task IDs belonging to this phase (e.g., ['task-1', 'task-2']). Optional — not present in plan.yaml phases.\n */\n taskIds?: string[];\n};\n\n/**\n * Test-Driven Development cycle phases for a task\n */\nexport type TddCycle = {\n /**\n * RED phase: tests to write FIRST (before implementation)\n */\n red: string[];\n /**\n * GREEN phase: minimal implementation to pass tests\n */\n green: string[];\n /**\n * REFACTOR phase: code improvements while keeping tests green\n */\n refactor: string[];\n};\n\n/**\n * Task definition within a spec's task breakdown\n */\nexport type SpecTask = {\n /**\n * Unique identifier for this task (e.g., 'task-1')\n */\n id: string;\n /**\n * ID of the phase this task belongs to (e.g., 'phase-1')\n */\n phaseId: string;\n /**\n * Task title or name\n */\n title: string;\n /**\n * Detailed description of what this task accomplishes\n */\n description: string;\n /**\n * Current state of the task\n */\n state: TaskState;\n /**\n * IDs of other SpecTasks that must complete before this task starts\n */\n dependencies: string[];\n /**\n * List of acceptance criteria that define task completion\n */\n acceptanceCriteria: string[];\n /**\n * TDD cycle definition for this task (if applicable)\n */\n tdd?: TddCycle;\n /**\n * Estimated effort (e.g., '2 hours', '1 day')\n */\n estimatedEffort: string;\n};\n\n/**\n * Feature specification artifact (PRD) defining requirements and scope\n */\nexport type FeatureArtifact = SpecArtifactBase & {\n /**\n * Spec number (e.g., 11 for spec 011)\n */\n number: number;\n /**\n * Git branch name for this feature (e.g., 'feat/011-feature-name')\n */\n branch: string;\n /**\n * One-line description of the feature\n */\n oneLiner: string;\n /**\n * Current phase in the SDLC lifecycle\n */\n phase: SdlcLifecycle;\n /**\n * Size estimate: XS, S, M, L, or XL\n */\n sizeEstimate: string;\n /**\n * Rejection feedback history for PRD iterations (append-only)\n */\n rejectionFeedback?: RejectionFeedbackEntry[];\n};\n\n/**\n * Research artifact documenting technical analysis and decisions\n */\nexport type ResearchArtifact = SpecArtifactBase & {\n /**\n * Structured technology decisions with rationale\n */\n decisions: TechDecision[];\n};\n\n/**\n * Technical implementation plan artifact defining strategy and file changes\n */\nexport type TechnicalPlanArtifact = SpecArtifactBase & {\n /**\n * Structured implementation phases\n */\n phases: PlanPhase[];\n /**\n * New files planned to be created\n */\n filesToCreate: string[];\n /**\n * Existing files planned to be modified\n */\n filesToModify: string[];\n};\n\n/**\n * Task breakdown artifact defining implementation tasks grouped into phases\n */\nexport type TasksArtifact = SpecArtifactBase & {\n /**\n * Structured task list with acceptance criteria and TDD phases\n */\n tasks: SpecTask[];\n /**\n * Overall effort estimate for all tasks combined\n */\n totalEstimate: string;\n};\n\n/**\n * Feature identity metadata in feature.yaml\n */\nexport type FeatureIdentity = {\n /**\n * Feature ID slug (e.g., '012-autonomous-pr-review-loop')\n */\n id: string;\n /**\n * Human-readable feature name\n */\n name: string;\n /**\n * Feature number (e.g., 12)\n */\n number: number;\n /**\n * Git branch for this feature\n */\n branch: string;\n /**\n * Current lifecycle phase (e.g., 'research', 'implementation', 'complete')\n */\n lifecycle: string;\n /**\n * When the feature was created\n */\n createdAt: string;\n};\n\n/**\n * Task completion progress counters\n */\nexport type FeatureStatusProgress = {\n /**\n * Number of completed tasks\n */\n completed: number;\n /**\n * Total number of tasks\n */\n total: number;\n /**\n * Completion percentage (0-100)\n */\n percentage: number;\n};\n\n/**\n * Feature execution status\n */\nexport type FeatureStatusInfo = {\n /**\n * Current SDLC phase\n */\n phase: string;\n /**\n * Phases that have been completed\n */\n completedPhases?: string[];\n /**\n * Task completion progress\n */\n progress: FeatureStatusProgress;\n /**\n * ID of the task currently being executed (null if none)\n */\n currentTask?: string;\n /**\n * ISO timestamp of last status update\n */\n lastUpdated: string;\n /**\n * Agent or skill that last updated the status\n */\n lastUpdatedBy: string;\n};\n\n/**\n * Validation gate results\n */\nexport type FeatureValidation = {\n /**\n * ISO timestamp of last validation run (null if never run)\n */\n lastRun?: string;\n /**\n * Names of validation gates that passed\n */\n gatesPassed: string[];\n /**\n * Descriptions of auto-fixes that were applied\n */\n autoFixesApplied: string[];\n};\n\n/**\n * Task execution tracking state\n */\nexport type FeatureTaskTracking = {\n /**\n * ID of the task currently being worked on (null if none)\n */\n current?: string;\n /**\n * IDs of tasks blocked by unmet dependencies\n */\n blocked: string[];\n /**\n * IDs of tasks that failed execution\n */\n failed: string[];\n};\n\n/**\n * Milestone checkpoint for phase completion\n */\nexport type FeatureCheckpoint = {\n /**\n * Phase name (e.g., 'feature-created', 'research-complete')\n */\n phase: string;\n /**\n * ISO timestamp when this checkpoint was reached\n */\n completedAt: string;\n /**\n * Agent or skill that completed this phase\n */\n completedBy: string;\n};\n\n/**\n * Error tracking for feature execution\n */\nexport type FeatureErrors = {\n /**\n * Current error message (null if no active error)\n */\n current?: string;\n /**\n * History of past error messages\n */\n history: string[];\n};\n\n/**\n * Feature status tracking artifact (feature.yaml)\n */\nexport type FeatureStatus = BaseEntity & {\n /**\n * Feature identity metadata\n */\n feature: FeatureIdentity;\n /**\n * Current execution status and progress\n */\n status: FeatureStatusInfo;\n /**\n * PR URL if a pull request has been created\n */\n prUrl?: string;\n /**\n * ISO timestamp when the feature was merged\n */\n mergedAt?: string;\n /**\n * Validation gate results\n */\n validation: FeatureValidation;\n /**\n * Task execution tracking\n */\n tasks: FeatureTaskTracking;\n /**\n * Milestone checkpoints recording phase completions\n */\n checkpoints: FeatureCheckpoint[];\n /**\n * Error tracking state\n */\n errors: FeatureErrors;\n};\nexport enum ToolType {\n VsCode = 'vscode',\n Cursor = 'cursor',\n Windsurf = 'windsurf',\n Zed = 'zed',\n Antigravity = 'antigravity',\n CursorCli = 'cursor-cli',\n ClaudeCode = 'claude-code',\n}\n\n/**\n * IDE or CLI tool entity with installation tracking\n */\nexport type Tool = BaseEntity & {\n /**\n * Display name of the tool\n */\n toolName: string;\n /**\n * Tool type classification\n */\n type: ToolType;\n /**\n * Installed version number\n */\n installedVersion?: string;\n /**\n * Tool installation timestamp\n */\n installedAt?: any;\n};\nexport enum NotificationEventType {\n AgentStarted = 'agent_started',\n PhaseCompleted = 'phase_completed',\n WaitingApproval = 'waiting_approval',\n AgentCompleted = 'agent_completed',\n AgentFailed = 'agent_failed',\n PrMerged = 'pr_merged',\n PrClosed = 'pr_closed',\n PrChecksPassed = 'pr_checks_passed',\n PrChecksFailed = 'pr_checks_failed',\n PrBlocked = 'pr_blocked',\n MergeReviewReady = 'merge_review_ready',\n}\nexport enum NotificationSeverity {\n Info = 'info',\n Warning = 'warning',\n Success = 'success',\n Error = 'error',\n}\n\n/**\n * Notification event emitted for agent lifecycle transitions\n */\nexport type NotificationEvent = {\n /**\n * Type of lifecycle event\n */\n eventType: NotificationEventType;\n /**\n * ID of the agent run that triggered this event\n */\n agentRunId: string;\n /**\n * ID of the feature that triggered this event\n */\n featureId: string;\n /**\n * Human-readable feature name\n */\n featureName: string;\n /**\n * Phase name (only for phaseCompleted events)\n */\n phaseName?: string;\n /**\n * Human-readable event description\n */\n message: string;\n /**\n * Display severity for notification rendering\n */\n severity: NotificationSeverity;\n /**\n * When the event occurred\n */\n timestamp: any;\n};\n\n/**\n * A code repository tracked by the Shep platform\n */\nexport type Repository = SoftDeletableEntity & {\n /**\n * Human-readable name for the repository (typically the directory name)\n */\n name: string;\n /**\n * Absolute file system path to the repository root (unique)\n */\n path: string;\n /**\n * Remote GitHub URL this repository was cloned from (normalized: lowercase, no .git suffix)\n */\n remoteUrl?: string;\n};\n\n/**\n * Single installation suggestion for a tool\n */\nexport type InstallationSuggestion = {\n /**\n * Package manager or installation method\n */\n packageManager: string;\n /**\n * Installation command\n */\n command: string;\n /**\n * Official documentation URL\n */\n documentationUrl: string;\n /**\n * Additional notes for installation\n */\n notes?: string;\n};\n\n/**\n * Installation status and suggestions for a tool\n */\nexport type ToolInstallationStatus = {\n /**\n * Current installation status\n */\n status: 'available' | 'missing' | 'error';\n /**\n * Tool name\n */\n toolName: string;\n /**\n * Error message if status is error\n */\n errorMessage?: string;\n /**\n * Installation suggestions\n */\n suggestions?: InstallationSuggestion[];\n};\n\n/**\n * Executable installation command for a tool\n */\nexport type ToolInstallCommand = {\n /**\n * Shell command string to execute\n */\n command: string;\n /**\n * Target platform identifier\n */\n platform: string;\n /**\n * Execution timeout in milliseconds\n */\n timeout: number;\n /**\n * Tool name\n */\n toolName: string;\n /**\n * Package manager identifier\n */\n packageManager: string;\n};\nexport enum EvidenceType {\n Screenshot = 'Screenshot',\n Video = 'Video',\n TestOutput = 'TestOutput',\n TerminalRecording = 'TerminalRecording',\n}\n\n/**\n * Record of evidence captured to prove task completion\n */\nexport type Evidence = {\n /**\n * Category of evidence captured\n */\n type: EvidenceType;\n /**\n * ISO 8601 timestamp when the evidence was captured\n */\n capturedAt: string;\n /**\n * Human-readable description of what this evidence proves\n */\n description: string;\n /**\n * Path relative to repo root for GitHub rendering\n */\n relativePath: string;\n /**\n * Optional reference to the task this evidence proves\n */\n taskRef?: string;\n};\nexport enum AgentStatus {\n Idle = 'Idle',\n Running = 'Running',\n Paused = 'Paused',\n Stopped = 'Stopped',\n}\n\n/**\n * A running agent instance that processes work and responds to queries\n */\nexport type AgentInstance = {\n /**\n * Unique identifier for this agent instance\n */\n id: UUID;\n /**\n * Git branch this agent is operating on for code changes\n */\n branch: string;\n /**\n * Current operational status of the agent (Idle, Running, Paused, or Stopped)\n */\n status: AgentStatus;\n /**\n * Timestamp when this agent instance was created\n */\n createdAt: any;\n};\n\n/**\n * Deployment target wrapping a single ActionItem for granular deployments\n */\nexport type DeployTargetActionItem = {\n /**\n * Discriminator indicating this is an action item target\n */\n kind: 'actionItem';\n /**\n * The action item to deploy - represents an atomic unit of work\n */\n actionItem: ActionItem;\n};\n\n/**\n * Deployment target wrapping a single Task for task-level deployments\n */\nexport type DeployTargetTask = {\n /**\n * Discriminator indicating this is a task target\n */\n kind: 'task';\n /**\n * The task to deploy - includes all action items within the task\n */\n task: Task;\n};\n\n/**\n * Deployment target wrapping multiple Tasks for batch deployments\n */\nexport type DeployTargetTasks = {\n /**\n * Discriminator indicating this is a multi-task target\n */\n kind: 'tasks';\n /**\n * The tasks to deploy - enables batch deployment of related work\n */\n tasks: Task[];\n};\nexport enum FeatureAgentState {\n GatheringRequirements = 'GatheringRequirements',\n ClarificationsRequired = 'ClarificationsRequired',\n DoingResearch = 'DoingResearch',\n AwaitingReview = 'AwaitingReview',\n ExecutingWorkPlan = 'ExecutingWorkPlan',\n Ready = 'Ready',\n}\n\n/**\n * Main orchestrating agent - the 'brain' that manages the complete SDLC workflow for a feature\n */\nexport type FeatureAgent = {\n /**\n * Unique identifier for this feature agent instance\n */\n id: UUID;\n /**\n * The feature being managed by this agent throughout its lifecycle\n */\n feature: Feature;\n /**\n * Sub-agents spawned to handle specific tasks within the workflow\n */\n agents: AgentInstance[];\n /**\n * Current operational state determining what the agent is doing\n */\n state: FeatureAgentState;\n /**\n * Timestamp when this feature agent was created\n */\n createdAt: any;\n};\n\n/**\n * Agent for handling local deployment of features, tasks, or action items\n */\nexport type LocalDeployAgent = {\n /**\n * Unique identifier for this deployment agent instance\n */\n id: UUID;\n /**\n * URL where the deployment is accessible once available (null before deployment)\n */\n url?: string;\n /**\n * Timestamp when this deployment agent was created\n */\n createdAt: any;\n};\nexport enum PortProtocol {\n TCP = 'TCP',\n UDP = 'UDP',\n}\n\n/**\n * Port mapping configuration for exposing container services to the network\n */\nexport type PortMap = {\n /**\n * Service name identifier (e.g., 'web', 'api', 'db', 'redis')\n */\n name: string;\n /**\n * Port number to expose on the host or container network\n */\n port: number;\n /**\n * Network protocol for the port (defaults to TCP if not specified)\n */\n protocol?: PortProtocol;\n};\nexport enum DeployMethod {\n DockerCompose = 'DockerCompose',\n Docker = 'Docker',\n Kubernetes = 'Kubernetes',\n Script = 'Script',\n Manual = 'Manual',\n}\n\n/**\n * Configuration defining how to deploy an application with method and instructions\n */\nexport type DeploySkill = {\n /**\n * Unique identifier for the deployment skill configuration\n */\n id: UUID;\n /**\n * List of port mappings for services to expose when deployed\n */\n ports: PortMap[];\n /**\n * Method to use for deployment (DockerCompose, Docker, Kubernetes, Script, or Manual)\n */\n method: DeployMethod;\n /**\n * Deployment instructions or commands to execute for this deployment method\n */\n instructions: string;\n /**\n * Timestamp when the deployment skill was created\n */\n createdAt: any;\n};\nexport enum DeploymentState {\n Booting = 'Booting',\n Ready = 'Ready',\n Stopped = 'Stopped',\n}\n\n/**\n * A running deployment instance with network configuration and lifecycle management\n */\nexport type Deployment = {\n /**\n * Unique identifier for the deployment instance\n */\n id: UUID;\n /**\n * Current state of the deployment (Booting, Ready, or Stopped)\n */\n state: DeploymentState;\n /**\n * URL where the deployment is accessible (e.g., 'http://localhost:30100/' or 'http://172.33.0.20:5173')\n */\n url: string;\n /**\n * List of port mappings for services exposed by this deployment\n */\n ports: PortMap[];\n /**\n * Timestamp when the deployment was created\n */\n createdAt: any;\n /**\n * Timestamp when the deployment was stopped (only present when state is Stopped)\n */\n stoppedAt?: any;\n};\nexport enum AgentRunStatus {\n pending = 'pending',\n running = 'running',\n completed = 'completed',\n failed = 'failed',\n interrupted = 'interrupted',\n cancelled = 'cancelled',\n waitingApproval = 'waiting_approval',\n}\n\n/**\n * Agent execution run record\n */\nexport type AgentRun = BaseEntity & {\n /**\n * Agent executor type used (claude-code, gemini-cli, etc.)\n */\n agentType: AgentType;\n /**\n * Agent workflow name (analyze-repository, requirements, etc.)\n */\n agentName: string;\n /**\n * Current execution status\n */\n status: AgentRunStatus;\n /**\n * Input prompt sent to agent executor\n */\n prompt: string;\n /**\n * Final result output (optional, populated on completion)\n */\n result?: string;\n /**\n * Executor session ID for resumption (optional)\n */\n sessionId?: string;\n /**\n * LangGraph thread_id for checkpoint lookup and crash resume\n */\n threadId: string;\n /**\n * Process ID for crash recovery (optional)\n */\n pid?: number;\n /**\n * Last heartbeat timestamp for crash detection (optional)\n */\n lastHeartbeat?: any;\n /**\n * Execution start timestamp (optional)\n */\n startedAt?: any;\n /**\n * Execution completion timestamp (optional)\n */\n completedAt?: any;\n /**\n * Error message if execution failed (optional)\n */\n error?: string;\n /**\n * Associated feature ID for feature agent runs (optional)\n */\n featureId?: string;\n /**\n * Repository path for context scoping (optional)\n */\n repositoryPath?: string;\n /**\n * Approval gate configuration for human-in-the-loop review (optional)\n */\n approvalGates?: ApprovalGates;\n /**\n * LLM model identifier used for this run (optional, set at creation)\n */\n modelId?: string;\n};\n\n/**\n * Streaming event emitted during agent execution\n */\nexport type AgentRunEvent = {\n /**\n * Event type: progress, result, or error\n */\n type: 'progress' | 'result' | 'error';\n /**\n * Event content\n */\n content: string;\n /**\n * Event timestamp\n */\n timestamp: any;\n};\n\n/**\n * Agent workflow registration metadata\n */\nexport type AgentDefinition = {\n /**\n * Unique agent workflow name (e.g., analyze-repository)\n */\n name: string;\n /**\n * Human-readable description of what this agent does\n */\n description: string;\n};\nexport type float = any;\nexport type float64 = float;\n\n/**\n * Execution record for a single agent graph node. Tracks timing, prompt, token usage, and outcome.\n */\nexport type PhaseTiming = BaseEntity & {\n /**\n * Agent run this timing belongs to\n */\n agentRunId: string;\n /**\n * Graph node name: analyze, requirements, research, plan, implement\n */\n phase: string;\n /**\n * When the phase started executing\n */\n startedAt: any;\n /**\n * When the phase finished executing (null if still running)\n */\n completedAt?: any;\n /**\n * Duration in milliseconds (computed on completion)\n */\n durationMs?: bigint;\n /**\n * When the phase started waiting for user approval (null if no approval needed)\n */\n waitingApprovalAt?: any;\n /**\n * Duration in milliseconds the phase waited for user approval (null if no approval needed)\n */\n approvalWaitMs?: bigint;\n /**\n * The composed prompt sent to the agent for this phase\n */\n prompt?: string;\n /**\n * Model identifier used for this phase execution\n */\n modelId?: string;\n /**\n * Agent executor type: claude-code, cursor, gemini-cli\n */\n agentType?: string;\n /**\n * Number of input tokens consumed (prompt + context)\n */\n inputTokens?: bigint;\n /**\n * Number of output tokens generated by the agent\n */\n outputTokens?: bigint;\n /**\n * Tokens used to populate the prompt cache (cache misses)\n */\n cacheCreationInputTokens?: bigint;\n /**\n * Tokens served from the prompt cache (cache hits)\n */\n cacheReadInputTokens?: bigint;\n /**\n * Estimated cost in USD for this phase execution\n */\n costUsd?: float64;\n /**\n * Number of agentic turns (tool-call round-trips) in this phase\n */\n numTurns?: number;\n /**\n * Time spent waiting for the API (excludes tool execution)\n */\n durationApiMs?: bigint;\n /**\n * Execution outcome: success, error, timeout, interrupted\n */\n exitCode?: string;\n /**\n * Error details when exitCode is not success\n */\n errorMessage?: string;\n};\n\n/**\n * Change to a question's selected option during PRD review\n */\nexport type QuestionSelectionChange = {\n /**\n * ID of the open question being changed (the question text)\n */\n questionId: string;\n /**\n * The option text that the user selected\n */\n selectedOption: string;\n};\n\n/**\n * Payload sent when user approves a PRD with optional selection changes\n */\nexport type PrdApprovalPayload = {\n /**\n * Always true for approval payloads\n */\n approved: boolean;\n /**\n * List of selection changes the user made during review (empty if no changes)\n */\n changedSelections?: QuestionSelectionChange[];\n};\n\n/**\n * Payload sent when user rejects a PRD with feedback for iteration\n */\nexport type PrdRejectionPayload = {\n /**\n * Always true for rejection payloads\n */\n rejected: boolean;\n /**\n * User's feedback explaining what needs to change\n */\n feedback: string;\n /**\n * Iteration number (1-based, derived from PhaseTiming row count)\n */\n iteration: number;\n /**\n * File attachment paths included with the rejection feedback\n */\n attachments?: string[];\n};\n\n/**\n * A single question with its options as presented in the review TUI\n */\nexport type ReviewQuestion = {\n /**\n * The question text\n */\n question: string;\n /**\n * Available options with selection state\n */\n options: QuestionOption[];\n /**\n * The option text that was selected by the user\n */\n selectedOption: string;\n /**\n * Whether the user changed the selection from the AI default\n */\n changed: boolean;\n};\n\n/**\n * Result of the PRD review TUI interaction\n */\nexport type PrdReviewResult = {\n /**\n * All questions with their final selection state\n */\n questions: ReviewQuestion[];\n /**\n * User action: approve or reject\n */\n action: string;\n /**\n * Rejection feedback (only present when action is 'reject')\n */\n feedback?: string;\n};\n\n/**\n * A single message within an agent provider CLI session\n */\nexport type AgentSessionMessage = {\n /**\n * Provider-native message UUID\n */\n uuid: string;\n /**\n * Message role — user turn or assistant turn\n */\n role: 'user' | 'assistant';\n /**\n * Normalized message content as plain text (tool calls and thinking blocks excluded)\n */\n content: string;\n /**\n * Timestamp when the message was recorded\n */\n timestamp: any;\n};\n\n/**\n * An agent provider CLI session (conversation record read from provider local storage)\n */\nexport type AgentSession = BaseEntity & {\n /**\n * Agent executor type that owns this session (e.g. claude-code)\n */\n agentType: AgentType;\n /**\n * Tilde-abbreviated working directory path for the session (e.g. ~/repos/my-project)\n */\n projectPath: string;\n /**\n * Total number of user and assistant messages in the session\n */\n messageCount: number;\n /**\n * Truncated first user message text used as a session summary preview (optional)\n */\n preview?: string;\n /**\n * Conversation messages — populated only in the detail view (shep session show)\n */\n messages?: AgentSessionMessage[];\n /**\n * Timestamp of the first message in the session (optional)\n */\n firstMessageAt?: any;\n /**\n * Timestamp of the most recent message in the session (optional)\n */\n lastMessageAt?: any;\n};\n\n/**\n * A selectable option within a PRD questionnaire question\n */\nexport type PrdOption = {\n /**\n * Unique identifier for this option\n */\n id: string;\n /**\n * Display label for this option\n */\n label: string;\n /**\n * Explanation of why this option is relevant\n */\n rationale: string;\n /**\n * Whether this option is recommended by AI analysis\n */\n recommended?: boolean;\n /**\n * Whether this option was newly added after refinement\n */\n isNew?: boolean;\n};\n\n/**\n * A single question in the PRD questionnaire with selectable options\n */\nexport type PrdQuestion = {\n /**\n * Unique identifier for this question\n */\n id: string;\n /**\n * The question text displayed to the user\n */\n question: string;\n /**\n * Question interaction type (currently only single-select)\n */\n type: 'select';\n /**\n * Available options for this question\n */\n options: PrdOption[];\n};\n\n/**\n * Configuration for the final action button in the questionnaire\n */\nexport type PrdFinalAction = {\n /**\n * Unique identifier for this action\n */\n id: string;\n /**\n * Button label text\n */\n label: string;\n /**\n * Description of what this action does\n */\n description: string;\n};\n\n/**\n * Complete data for rendering a PRD questionnaire\n */\nexport type PrdQuestionnaireData = {\n /**\n * Header title text for the questionnaire\n */\n question: string;\n /**\n * Header context/description text\n */\n context: string;\n /**\n * Array of questions to display\n */\n questions: PrdQuestion[];\n /**\n * Configuration for the finalize/approve action button\n */\n finalAction: PrdFinalAction;\n};\nexport enum AgentFeature {\n sessionResume = 'session-resume',\n streaming = 'streaming',\n toolScoping = 'tool-scoping',\n structuredOutput = 'structured-output',\n systemPrompt = 'system-prompt',\n sessionListing = 'session-listing',\n}\nexport type DeployTarget = DeployTargetActionItem | DeployTargetTask | DeployTargetTasks;\n\nexport type Askable = {\n Ask(request: AskRequest): AskResponse;\n};\n\nexport type FeatureAgentOperations = {\n NewFeatureWizard(): Feature;\n GatherRequirements(): Requirement[];\n DoResearch(): Research;\n CreatePlan(): Plan;\n BeginImplementation(): void;\n Ask(query: string): AskResponse;\n};\n\nexport type LocalDeployAgentOperations = {\n Deploy(target: DeployTarget, skill: DeploySkill): Deployment;\n Analyze(repositoryPath: string): DeploySkill;\n Ask(query: string): AskResponse;\n};\n","/**\n * Check whether a process with the given PID is still running.\n *\n * Uses `process.kill(pid, 0)` which sends signal 0 (no-op) to test existence.\n * Returns false when the PID does not exist or belongs to a zombie.\n */\nexport function isProcessAlive(pid: number): boolean {\n try {\n process.kill(pid, 0);\n return true;\n } catch {\n return false;\n }\n}\n"],"names":[],"mappings":"g0BAuBO,SAAS,EAAW,CAAwB,EACjD,IAAM,EAAa,UAAsC,CAAC,AAdtC,eAcoD,CAIxE,GAAI,CAAC,EACH,MAAM,AAAI,GADI,GAEZ,0FAIJ,OAAO,EAAU,OAAO,CAAC,EAC3B,ixBCglBO,IAxgBK,EAMA,EAMA,EAuCA,EA8BA,EAIA,EA6EA,EAOA,EAmKA,EAQA,IA0OA,EAmFA,IAsCA,EAmsBA,EA+BA,EAaA,gBAqyBA,EAnsDA,IAAA,2EAAA,sGAyIL,IAAK,8TAAA,IAiCA,kRAuuBL,IAAK,sWAAA,GAaA,8EAAA,IAoIA,iHAgCA,6EAsEA,iOAoDA,6BAsBA,qHAiCA,4DAmCL,IAAK,IAAA,+KAAA,GCn4DL,SAAS,EAAe,CAAW,EACxC,GAAI,CAEF,OADA,QAAQ,IAAI,CAAC,EAAK,IACX,CACT,CAAE,KAAM,CACN,OAAO,CACT,CACF"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[93995,a=>{"use strict";var b=a.i(10973),c=a.i(96960),d=a.i(69845),e=a.i(52313),f=a.i(25674);let g=(0,f.createServerReference)("40bd32064e14b3c0585965cb05c5415833c6ee7bd6",f.callServer,void 0,f.findSourceMapURL,"createFeature");var h=a.i(45242),i=a.i(14177),j=a.i(10606),k=a.i(3942),l=a.i(46168),m=a.i(42527),n=a.i(88064);let o=(0,a.i(25700).default)("git-fork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);var p=a.i(62147),q=a.i(85536),r=a.i(19884);a.i(78454);var s=a.i(24255),t=a.i(2824),u=a.i(18948),v=a.i(90920),w=a.i(79620),x=a.i(584),y=a.i(58339),z=a.i(80646),A=a.i(96867),B=a.i(82934),C=a.i(96213);a.i(307);var D=a.i(30931),E=a.i(61781),F=a.i(13126),G=a.i(1377);a.i(21434);var H=a.i(34379),I=a.i(21333),J=a.i(40742),K=a.i(39116);let L=new Set([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp",".ico",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".txt",".md",".csv",".json",".yaml",".yml",".xml",".ts",".tsx",".js",".jsx",".py",".rb",".go",".rs",".java",".c",".cpp",".h",".hpp",".cs",".swift",".kt",".html",".css",".scss",".less",".sh",".bash",".zsh",".fish",".toml",".ini",".cfg",".conf",".env",".zip",".tar",".gz",".log"]),M=[{id:"allowPrd",label:"PRD",description:"Auto-approve requirements move to planning."},{id:"allowPlan",label:"Plan",description:"Auto-approve planning move to implementation."},{id:"allowMerge",label:"Merge",description:"Auto-approve merge move to Done."}],N={allowPrd:!1,allowPlan:!1,allowMerge:!1};function O({open:a,onClose:d,onSubmit:e,repositoryPath:f,isSubmitting:g=!1,workflowDefaults:i,features:j,repositories:m,initialParentId:n,currentAgentType:v,currentModel:z,initialDescription:F}){let G=(0,r.useSoundAction)("create"),H=f&&(!m||0===m.length||m.some(a=>a.path===f))?f:"",I=i?.approvalGates??N,J=i?.push??!1,O=i?.openPr??!1,R=i?.ciWatchEnabled!==!1,S=i?.enableEvidence??!1,T=i?.commitEvidence??!1,[U,V]=(0,c.useState)(F??"");(0,c.useEffect)(()=>{F&&V(F)},[F]);let[W,X]=(0,c.useState)([]),[Y,Z]=(0,c.useState)({...I}),[$,_]=(0,c.useState)(J),[aa,ab]=(0,c.useState)(O),[ac,ad]=(0,c.useState)(i?.ciWatchEnabled!==!1),[ae,af]=(0,c.useState)(S),[ag,ah]=(0,c.useState)(T),[ai,aj]=(0,c.useState)(void 0),[ak,al]=(0,c.useState)(!1),[am,an]=(0,c.useState)(!1),[ao,ap]=(0,c.useState)(!1),[aq,ar]=(0,c.useState)(!0),[as,at]=(0,c.useState)(void 0),[au,av]=(0,c.useState)(void 0),[aw,ax]=(0,c.useState)(H||void 0),[ay,az]=(0,c.useState)(m??[]),[aA,aB]=(0,c.useState)(!1),[aC,aD]=(0,c.useState)(null),[aE,aF]=(0,c.useState)(!1),aG=(0,c.useRef)(crypto.randomUUID()),aH=(0,c.useRef)(0),aI=(0,c.useRef)(null);(0,c.useEffect)(()=>{i&&(Z({...i.approvalGates}),_(i.push),ab(i.openPr),ad(!1!==i.ciWatchEnabled),af(i.enableEvidence),ah(i.commitEvidence))},[i]),(0,c.useEffect)(()=>{az(m??[])},[m]),(0,c.useEffect)(()=>{a&&n&&aj(n)},[a,n]);let aJ=(0,c.useCallback)(()=>{V(""),X([]),Z({...I}),_(J),ab(O),ad(R),af(S),ah(T),aj(void 0),ax(H||void 0),az(m??[]),al(!1),an(!1),ap(!1),ar(!0),at(void 0),av(void 0),aD(null),aH.current=0,aB(!1)},[I,J,O,S,R,T,H,m]),aK=""!==U.trim()||W.length>0,{attemptClose:aL}=(0,C.useGuardedDrawerClose)({open:a,isDirty:aK,onClose:d,onReset:aJ}),aM=(0,c.useCallback)(async a=>{for(let b of(aD(null),a)){if(b.size>0xa00000)return void aD(`"${b.name}" exceeds 10 MB limit`);let a=function(a){let b=a.lastIndexOf(".");return b>=0?a.slice(b).toLowerCase():""}(b.name);if(a&&!L.has(a))return void aD(`File type "${a}" is not allowed`)}for(let b of a){let a=crypto.randomUUID();X(c=>[...c,{id:a,name:b.name,size:b.size,mimeType:b.type||"application/octet-stream",path:"",loading:!0}]);try{let c=new FormData;c.append("file",b),c.append("sessionId",aG.current);let d=await fetch("/api/attachments/upload",{method:"POST",body:c});if(!d.ok){let b=await d.json().catch(()=>({error:"Upload failed"}));X(b=>b.filter(b=>b.id!==a)),aD(b.error??"Upload failed");return}let e=await d.json();X(b=>b.some(b=>b.id!==a&&b.path===e.path)?b.filter(b=>b.id!==a):b.map(b=>b.id===a?{...e,id:a,loading:!1}:b))}catch{X(b=>b.filter(b=>b.id!==a)),aD("Upload failed")}}},[]),aN=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),aH.current+=1,1===aH.current&&aB(!0)},[]),aO=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),aH.current-=1,0===aH.current&&aB(!1)},[]),aP=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation()},[]),aQ=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),aH.current=0,aB(!1);let b=Array.from(a.dataTransfer.files);b.length>0&&aM(b)},[aM]),aR=(0,c.useCallback)(a=>{let b=a.clipboardData?.items;if(!b)return;let c=[];for(let a of Array.from(b))if("file"===a.kind){let b=a.getAsFile();b&&c.push(b)}c.length>0&&(a.preventDefault(),aM(c))},[aM]),aS=(0,c.useCallback)(a=>{if(a.preventDefault(),!U.trim())return;let b=aw??H;b&&(G.play(),e({description:U.trim(),attachments:W.filter(a=>!a.loading),repositoryPath:b,approvalGates:{allowPrd:Y.allowPrd??!1,allowPlan:Y.allowPlan??!1,allowMerge:Y.allowMerge??!1},push:!!ao||$||aa,openPr:!!ao||aa,ciWatchEnabled:ac,enableEvidence:ae,commitEvidence:ag,fast:ak,forkAndPr:ao,commitSpecs:aq,...am?{pending:am}:{},...as?{agentType:as}:{},...au?{model:au}:{},...ai?{parentId:ai}:{},sessionId:aG.current}),aJ())},[U,W,Y,aw,H,e,$,aa,ae,ac,ag,ak,ao,aq,am,as,au,ai,G,aJ]),aT=(0,c.useCallback)(async()=>{try{let a=await (0,K.pickFiles)();if(!a)return;for(let b of a){let a=crypto.randomUUID();X(c=>[...c,{id:a,name:b.name,size:b.size,mimeType:"application/octet-stream",path:"",loading:!0}]);try{let c=await fetch("/api/attachments/upload-from-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:b.path,sessionId:aG.current})});if(!c.ok){let b=await c.json().catch(()=>({error:"Upload failed"}));X(b=>b.filter(b=>b.id!==a)),aD(b.error??"Upload failed");return}let d=await c.json();X(b=>b.some(b=>b.id!==a&&b.path===d.path)?b.filter(b=>b.id!==a):b.map(b=>b.id===a?{...d,id:a,loading:!1}:b))}catch{X(b=>b.filter(b=>b.id!==a)),aD("Upload failed")}}}catch{}},[]),aU=(0,c.useCallback)(a=>{X(b=>b.filter(b=>b.id!==a))},[]),aV=(0,c.useRef)(null),aW=(0,c.useCallback)(a=>{(a.ctrlKey||a.metaKey)&&"Enter"===a.key&&(a.preventDefault(),aV.current?.requestSubmit())},[]),aX=(0,c.useCallback)(()=>{aF(!0)},[]),aY=(0,c.useCallback)(()=>{setTimeout(()=>{let a=aI.current?.contains(document.activeElement),b=aI.current?.querySelector('[aria-expanded="true"]')!==null;a||b||aF(!1)},0)},[]),aZ=j&&j.length>0,a$=!H&&!aw,a_=!H&&void 0!==m;return(0,b.jsx)(s.BaseDrawer,{open:a,onClose:aL,size:"md",modal:!1,dismissOnOutsideClick:!0,"data-testid":"feature-create-drawer",header:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("div",{className:"h-2.5 w-2.5 shrink-0 rounded-full bg-blue-500"}),(0,b.jsx)(t.DrawerTitle,{children:"NEW FEATURE"})]}),g?(0,b.jsx)(t.DrawerDescription,{asChild:!0,children:(0,b.jsx)("div",{children:(0,b.jsx)(y.Badge,{variant:"secondary",children:"Creating..."})})}):null]}),footer:(0,b.jsxs)("div",{className:"flex flex-row justify-end gap-2",children:[(0,b.jsx)(u.Button,{variant:"outline",onClick:aL,disabled:g,children:"Cancel"}),(0,b.jsx)(u.Button,{type:"submit",form:"create-feature-form",disabled:!U.trim()||g||a$,children:g?"Creating...":"+ Create Feature"})]}),children:(0,b.jsx)("div",{className:"overflow-y-auto p-4",children:(0,b.jsx)(B.TooltipProvider,{delayDuration:400,children:(0,b.jsxs)("form",{ref:aV,id:"create-feature-form",onSubmit:aS,onKeyDown:aW,className:"flex flex-col gap-4",children:[a_?(0,b.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-selector-section",children:[(0,b.jsx)(x.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"REPOSITORY"}),(0,b.jsx)(Q,{repositories:ay,value:aw,onChange:ax,onAddRepository:a=>{az(b=>[...b,a]),ax(a.path)},disabled:g})]}):H?(0,b.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-readonly-section",children:[(0,b.jsx)(x.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"REPOSITORY"}),(0,b.jsx)("p",{className:"text-sm","data-testid":"repo-readonly-label",children:m?.find(a=>a.path===H)?.name??H.split("/").pop()})]}):null,(0,b.jsxs)("div",{role:"region","aria-label":"File drop zone","data-drag-over":aA?"true":"false",onDragEnter:aN,onDragLeave:aO,onDragOver:aP,onDrop:aQ,className:(0,q.cn)("flex flex-col gap-1.5 rounded-md border-2 border-transparent p-1 transition-colors",aA&&"border-primary/50 bg-primary/5"),children:[(0,b.jsx)(x.Label,{htmlFor:"feature-description",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"DESCRIBE YOUR FEATURE"}),(0,b.jsxs)("div",{ref:aI,onFocus:aX,onBlur:aY,className:(0,q.cn)("border-input flex h-56 flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow]",aE&&"ring-ring/50 border-ring ring-[3px]"),children:[(0,b.jsx)(w.Textarea,{id:"feature-description",placeholder:"e.g. Add GitHub OAuth login with callback handling and token refresh...",value:U,onChange:a=>V(a.target.value),onPaste:aR,required:!0,disabled:g,className:"min-h-0 flex-1 resize-none rounded-none border-0 shadow-none focus-visible:ring-0"}),W.length>0&&(0,b.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:W.map(a=>(0,b.jsx)(D.AttachmentChip,{name:a.name,size:a.size,mimeType:a.mimeType,path:a.path,onRemove:()=>aU(a.id),disabled:g,loading:a.loading},a.id))}),aC?(0,b.jsx)("p",{className:"text-destructive px-3 pb-2 text-xs",children:aC}):null,(0,b.jsxs)("div",{className:"border-input flex items-center gap-3 border-t px-3 py-1.5",children:[(0,b.jsx)(E.AgentModelPicker,{initialAgentType:as??v??"claude-code",initialModel:au??z??"claude-sonnet-4-6",mode:"override",onAgentModelChange:(a,b)=>{at(a),av(b)},disabled:g,className:"w-55"}),(0,b.jsxs)(B.Tooltip,{children:[(0,b.jsx)(B.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"ml-auto flex cursor-pointer items-center gap-2",children:[(0,b.jsx)(A.Switch,{id:"pending-mode",checked:am,onCheckedChange:an,disabled:g}),(0,b.jsxs)(x.Label,{htmlFor:"pending-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,b.jsx)(l.Clock,{className:"h-3.5 w-3.5"}),"Pending"]})]})}),(0,b.jsx)(B.TooltipContent,{side:"bottom",children:"Create without starting — start manually later."})]}),(0,b.jsxs)(B.Tooltip,{children:[(0,b.jsx)(B.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-2",children:[(0,b.jsx)(A.Switch,{id:"fast-mode",checked:ak,onCheckedChange:al,disabled:g}),(0,b.jsxs)(x.Label,{htmlFor:"fast-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,b.jsx)(k.Zap,{className:"h-3.5 w-3.5"}),"Fast Mode"]})]})}),(0,b.jsx)(B.TooltipContent,{side:"bottom",children:"Skip SDLC phases and implement directly from your prompt."})]}),(0,b.jsxs)(B.Tooltip,{children:[(0,b.jsx)(B.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",onClick:aT,disabled:g,"aria-label":"Attach files",className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,b.jsx)(h.PaperclipIcon,{className:"h-4 w-4"})})}),(0,b.jsx)(B.TooltipContent,{side:"bottom",children:"Attach files"})]})]})]})]}),aZ&&void 0!==n?(0,b.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,b.jsx)(x.Label,{htmlFor:"parent-feature",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"PARENT FEATURE"}),(0,b.jsx)(P,{features:j,value:ai,onChange:aj,disabled:g})]}):null,(0,b.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,b.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,b.jsxs)(B.Tooltip,{children:[(0,b.jsx)(B.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:"APPROVE"})}),(0,b.jsx)(B.TooltipContent,{side:"bottom",children:"Auto-approve phase transitions without manual review."})]}),(0,b.jsx)("div",{className:"flex flex-1 items-center gap-4",children:M.map(a=>(0,b.jsxs)(B.Tooltip,{children:[(0,b.jsx)(B.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(A.Switch,{id:`approve-${a.id}`,size:"sm",checked:Y[a.id]??!1,onCheckedChange:b=>Z(c=>({...c,[a.id]:b})),disabled:g||ak&&("allowPrd"===a.id||"allowPlan"===a.id)}),(0,b.jsx)(x.Label,{htmlFor:`approve-${a.id}`,className:"cursor-pointer text-xs font-medium",children:a.label})]})}),(0,b.jsx)(B.TooltipContent,{side:"bottom",children:ak&&("allowPrd"===a.id||"allowPlan"===a.id)?"Skipped in Fast Mode":a.description})]},a.id))}),(0,b.jsxs)(B.Tooltip,{children:[(0,b.jsx)(B.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",onClick:()=>{let a=M.every(a=>Y[a.id]),b={};for(let c of M)b[c.id]=!a;Z(b)},disabled:g,className:(0,q.cn)("text-muted-foreground hover:text-foreground cursor-pointer rounded px-1.5 py-0.5 text-[10px] font-semibold tracking-wider uppercase transition-colors",M.every(a=>Y[a.id])&&"text-primary"),children:"All"})}),(0,b.jsx)(B.TooltipContent,{side:"bottom",children:"Toggle all approval gates"})]})]}),(0,b.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,b.jsxs)(B.Tooltip,{children:[(0,b.jsx)(B.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:"EVIDENCE"})}),(0,b.jsx)(B.TooltipContent,{side:"bottom",children:"Collect and attach evidence after implementation."})]}),(0,b.jsxs)("div",{className:"flex flex-1 items-center gap-4",children:[(0,b.jsxs)(B.Tooltip,{children:[(0,b.jsx)(B.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(A.Switch,{id:"enable-evidence",size:"sm",checked:ae,onCheckedChange:a=>{af(a),a||ah(!1)},disabled:g}),(0,b.jsx)(x.Label,{htmlFor:"enable-evidence",className:"cursor-pointer text-xs font-medium",children:"Collect"})]})}),(0,b.jsx)(B.TooltipContent,{side:"bottom",children:"Capture screenshots and artifacts after implementation."})]}),(0,b.jsxs)(B.Tooltip,{children:[(0,b.jsx)(B.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(A.Switch,{id:"commit-evidence",size:"sm",checked:ag,onCheckedChange:ah,disabled:g||!ae||!aa&&!ao}),(0,b.jsx)(x.Label,{htmlFor:"commit-evidence",className:(0,q.cn)("cursor-pointer text-xs font-medium",(!ae||!aa&&!ao)&&"opacity-50"),children:"Add to PR"})]})}),(0,b.jsx)(B.TooltipContent,{side:"bottom",children:aa||ao?ae?"Include evidence in the pull request body.":"Requires evidence collection to be enabled":"Requires PR to be enabled"})]})]})]}),(0,b.jsxs)("div",{className:"border-input flex items-start gap-4 rounded-md border px-3 py-2.5",children:[(0,b.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 pt-0.5 text-xs font-semibold tracking-wider",children:"GIT"}),(0,b.jsxs)("div",{className:"flex flex-1 flex-wrap items-center gap-4",children:[(0,b.jsxs)(B.Tooltip,{children:[(0,b.jsx)(B.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(A.Switch,{id:"push",size:"sm",checked:!!ao||$||aa,onCheckedChange:a=>{_(a),!a&&aa&&ab(!1)},disabled:g||ao}),(0,b.jsx)(x.Label,{htmlFor:"push",className:(0,q.cn)("cursor-pointer text-xs font-medium",ao&&"opacity-50"),children:"Push"})]})}),(0,b.jsx)(B.TooltipContent,{side:"bottom",children:ao?"Enabled — contributing to upstream":"Push branch to remote after implementation."})]}),(0,b.jsxs)(B.Tooltip,{children:[(0,b.jsx)(B.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(A.Switch,{id:"open-pr",size:"sm",checked:!!ao||aa,onCheckedChange:a=>{ab(a),a||ah(!1)},disabled:g||ao}),(0,b.jsx)(x.Label,{htmlFor:"open-pr",className:(0,q.cn)("cursor-pointer text-xs font-medium",ao&&"opacity-50"),children:"PR"})]})}),(0,b.jsx)(B.TooltipContent,{side:"bottom",children:ao?"Enabled — contributing to upstream":"Open a pull request after pushing."})]}),(0,b.jsxs)(B.Tooltip,{children:[(0,b.jsx)(B.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(A.Switch,{id:"ci-watch",size:"sm",checked:ac,onCheckedChange:ad,disabled:g}),(0,b.jsx)(x.Label,{htmlFor:"ci-watch",className:"cursor-pointer text-xs font-medium",children:"Watch"})]})}),(0,b.jsx)(B.TooltipContent,{side:"bottom",children:"Watch CI and auto-fix after push."})]}),(0,b.jsx)("div",{className:"bg-border h-4 w-px shrink-0"}),(0,b.jsxs)(B.Tooltip,{children:[(0,b.jsx)(B.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(A.Switch,{id:"commit-specs",size:"sm",checked:aq,onCheckedChange:ar,disabled:g}),(0,b.jsxs)(x.Label,{htmlFor:"commit-specs",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,b.jsx)(p.FileText,{className:"h-3 w-3"}),"Commit Specs"]})]})}),(0,b.jsx)(B.TooltipContent,{side:"bottom",children:"Commit specs to repository."})]}),(0,b.jsxs)(B.Tooltip,{children:[(0,b.jsx)(B.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(A.Switch,{id:"fork-and-pr",size:"sm",checked:ao,onCheckedChange:a=>{ap(a),a&&ar(!1)},disabled:g}),(0,b.jsxs)(x.Label,{htmlFor:"fork-and-pr",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,b.jsx)(o,{className:"h-3 w-3"}),"Fork & PR"]})]})}),(0,b.jsx)(B.TooltipContent,{side:"bottom",children:"Contribute via fork (PR to upstream)."})]})]})]})]})]})})})})}function P({features:a,value:d,onChange:e,disabled:f}){let[g,h]=(0,c.useState)(!1),[k,l]=(0,c.useState)(""),m=(0,c.useRef)(null),n=a.find(a=>a.id===d),o=k.trim()?a.filter(a=>a.name.toLowerCase().includes(k.toLowerCase())||a.id.toLowerCase().includes(k.toLowerCase())):a,p=(0,c.useCallback)(a=>{e(a),h(!1),l("")},[e]);return(0,c.useEffect)(()=>{g?setTimeout(()=>m.current?.focus(),0):l("")},[g]),(0,b.jsxs)(z.Popover,{open:g,onOpenChange:h,children:[(0,b.jsx)(z.PopoverTrigger,{asChild:!0,children:(0,b.jsxs)("button",{id:"parent-feature",type:"button",role:"combobox","aria-expanded":g,"aria-label":"Parent Feature",disabled:f,"data-testid":"parent-feature-combobox",className:(0,q.cn)("border-input bg-background ring-offset-background focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",!n&&"text-muted-foreground"),children:[(0,b.jsx)("span",{className:"truncate",children:n?`${n.name} (${n.id.slice(0,8)})`:"Select parent feature..."}),(0,b.jsx)(i.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,b.jsx)(z.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"parent-feature-combobox-content",children:(0,b.jsxs)("div",{className:"flex flex-col",children:[(0,b.jsx)("div",{className:"border-b p-2",children:(0,b.jsx)(v.Input,{ref:m,placeholder:"Search features...",value:k,onChange:a=>l(a.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"parent-feature-search"})}),(0,b.jsxs)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Features",children:[(0,b.jsxs)("button",{type:"button",role:"option","aria-selected":void 0===d,onClick:()=>p(void 0),className:(0,q.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",void 0===d&&"bg-accent/50"),"data-testid":"parent-feature-option-none",children:[(0,b.jsx)(j.CheckIcon,{className:(0,q.cn)("h-4 w-4 shrink-0",void 0!==d&&"invisible")}),(0,b.jsx)("span",{className:"text-muted-foreground italic",children:"No parent"})]}),0===o.length&&k?(0,b.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:"No features found."}):o.map(a=>(0,b.jsxs)("button",{type:"button",role:"option","aria-selected":d===a.id,onClick:()=>p(a.id),className:(0,q.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",d===a.id&&"bg-accent/50"),"data-testid":`parent-feature-option-${a.id}`,children:[(0,b.jsx)(j.CheckIcon,{className:(0,q.cn)("h-4 w-4 shrink-0",d!==a.id&&"invisible")}),(0,b.jsxs)("span",{className:"truncate",children:[a.name," ",(0,b.jsxs)("span",{className:"text-muted-foreground font-mono text-xs",children:["(",a.id.slice(0,8),")"]})]})]},a.id))]})]})})]})}function Q({repositories:a,value:d,onChange:e,onAddRepository:f,disabled:g}){let[h,k]=(0,c.useState)(!1),[l,o]=(0,c.useState)(""),[p,r]=(0,c.useState)(!1),[s,t]=(0,c.useState)(null),[u,w]=(0,c.useState)(!1),x=(0,c.useRef)(null),{reactFileManager:y}=(0,I.useFeatureFlags)(),A=a.find(a=>a.path===d),B=l.trim()?a.filter(a=>a.name.toLowerCase().includes(l.toLowerCase())||a.path.toLowerCase().includes(l.toLowerCase())):a,C=(0,c.useCallback)(a=>{e(a),k(!1),o("")},[e]),D=(0,c.useCallback)(async a=>{let b=await (0,J.addRepository)({path:a});if(b.error){t(b.error),r(!1);return}if(b.repository){let a={id:b.repository.id,name:b.repository.name,path:b.repository.path};f?.(a),e(a.path),k(!1),o("")}},[f,e]),E=(0,c.useCallback)(async()=>{if(!p){if(y)return void w(!0);r(!0),t(null);try{let a=await (0,G.pickFolder)();if(!a)return void r(!1);await D(a)}catch{w(!0)}finally{r(!1)}}},[p,y,D]),K=(0,c.useCallback)(async a=>{if(w(!1),a){r(!0),t(null);try{await D(a)}catch(a){t(a instanceof Error?a.message:"Failed to add repository")}finally{r(!1)}}},[D]);return(0,c.useEffect)(()=>{h?setTimeout(()=>x.current?.focus(),0):o("")},[h]),(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(z.Popover,{open:h,onOpenChange:k,children:[(0,b.jsx)(z.PopoverTrigger,{asChild:!0,children:(0,b.jsxs)("button",{type:"button",role:"combobox","aria-expanded":h,"aria-label":"Repository",disabled:g,"data-testid":"repository-combobox",className:(0,q.cn)("border-input bg-background ring-offset-background focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",!A&&"text-muted-foreground"),children:[(0,b.jsx)("span",{className:"truncate",children:A?A.name:"Select repository..."}),(0,b.jsx)(i.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,b.jsx)(z.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"repository-combobox-content",children:(0,b.jsxs)("div",{className:"flex flex-col",children:[(0,b.jsx)("div",{className:"border-b p-2",children:(0,b.jsx)(v.Input,{ref:x,placeholder:"Search repositories...",value:l,onChange:a=>o(a.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"repository-search"})}),(0,b.jsx)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Repositories",children:0===B.length?(0,b.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm","data-testid":"repository-empty",children:"No repositories found."}):B.map(a=>(0,b.jsxs)("button",{type:"button",role:"option","aria-selected":d===a.path,onClick:()=>C(a.path),className:(0,q.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",d===a.path&&"bg-accent/50"),"data-testid":`repository-option-${a.id}`,children:[(0,b.jsx)(j.CheckIcon,{className:(0,q.cn)("h-4 w-4 shrink-0",d!==a.path&&"invisible")}),(0,b.jsxs)("span",{className:"flex flex-col items-start truncate",children:[(0,b.jsx)("span",{className:"truncate",children:a.name}),(0,b.jsx)("span",{className:"text-muted-foreground truncate text-xs",children:a.path})]})]},a.id))}),(0,b.jsx)(F.Separator,{}),(0,b.jsxs)("button",{type:"button",onClick:E,disabled:p,className:"hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm","data-testid":"add-repository-item",children:[p?(0,b.jsx)(n.Loader2,{className:"h-4 w-4 shrink-0 animate-spin"}):(0,b.jsx)(m.FolderPlus,{className:"h-4 w-4 shrink-0"}),(0,b.jsx)("span",{children:"Add new repository..."})]}),s?(0,b.jsx)("p",{className:"px-3 pb-2 text-xs text-red-500","data-testid":"add-repository-error",children:s}):null]})})]}),(0,b.jsx)(H.ReactFileManagerDialog,{open:u,onOpenChange:a=>{a||w(!1)},onSelect:K})]})}function R({repositoryPath:a,initialParentId:f,initialDescription:h,features:i,repositories:j,workflowDefaults:k,currentAgentType:l,currentModel:m}){let n=(0,d.useRouter)(),[o,p]=(0,c.useState)(!1),q=(0,d.usePathname)().startsWith("/create"),r=!o&&q;(0,c.useEffect)(()=>{!q&&o&&p(!1)},[q,o]);let s=(0,c.useCallback)(()=>{n.push("/")},[n]),t=(0,c.useCallback)(a=>{p(!0),n.push("/"),g(a).then(b=>{b.error?e.toast.error(b.error):window.dispatchEvent(new CustomEvent("shep:feature-created",{detail:{featureId:b.feature.id,name:b.feature.name,description:b.feature.description,repositoryPath:b.feature.repositoryPath,parentId:a.parentId}}))}).catch(()=>{e.toast.error("Failed to create feature"),p(!1)})},[n]);return(0,b.jsx)(O,{open:r,onClose:s,onSubmit:t,repositoryPath:a,features:i,repositories:j,workflowDefaults:k,initialParentId:f,initialDescription:h,isSubmitting:o,currentAgentType:l,currentModel:m})}a.s(["CreateDrawerClient",()=>R],93995)}];
|
|
1
|
+
module.exports=[93995,a=>{"use strict";var b=a.i(10973),c=a.i(96960),d=a.i(69845),e=a.i(52313),f=a.i(25674);let g=(0,f.createServerReference)("4068ae940d58753e3446571954575b271692a59bf4",f.callServer,void 0,f.findSourceMapURL,"createFeature");var h=a.i(45242),i=a.i(14177),j=a.i(10606),k=a.i(3942),l=a.i(46168),m=a.i(42527),n=a.i(88064);let o=(0,a.i(25700).default)("git-fork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);var p=a.i(62147),q=a.i(85536),r=a.i(19884);a.i(78454);var s=a.i(24255),t=a.i(2824),u=a.i(18948),v=a.i(90920),w=a.i(79620),x=a.i(584),y=a.i(58339),z=a.i(80646),A=a.i(96867),B=a.i(82934),C=a.i(96213);a.i(307);var D=a.i(30931),E=a.i(61781),F=a.i(13126),G=a.i(1377);a.i(21434);var H=a.i(34379),I=a.i(21333),J=a.i(6935),K=a.i(39116);let L=new Set([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp",".ico",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".txt",".md",".csv",".json",".yaml",".yml",".xml",".ts",".tsx",".js",".jsx",".py",".rb",".go",".rs",".java",".c",".cpp",".h",".hpp",".cs",".swift",".kt",".html",".css",".scss",".less",".sh",".bash",".zsh",".fish",".toml",".ini",".cfg",".conf",".env",".zip",".tar",".gz",".log"]),M=[{id:"allowPrd",label:"PRD",description:"Auto-approve requirements move to planning."},{id:"allowPlan",label:"Plan",description:"Auto-approve planning move to implementation."},{id:"allowMerge",label:"Merge",description:"Auto-approve merge move to Done."}],N={allowPrd:!1,allowPlan:!1,allowMerge:!1};function O({open:a,onClose:d,onSubmit:e,repositoryPath:f,isSubmitting:g=!1,workflowDefaults:i,features:j,repositories:m,initialParentId:n,currentAgentType:v,currentModel:z,initialDescription:F}){let G=(0,r.useSoundAction)("create"),H=f&&(!m||0===m.length||m.some(a=>a.path===f))?f:"",I=i?.approvalGates??N,J=i?.push??!1,O=i?.openPr??!1,R=i?.ciWatchEnabled!==!1,S=i?.enableEvidence??!1,T=i?.commitEvidence??!1,[U,V]=(0,c.useState)(F??"");(0,c.useEffect)(()=>{F&&V(F)},[F]);let[W,X]=(0,c.useState)([]),[Y,Z]=(0,c.useState)({...I}),[$,_]=(0,c.useState)(J),[aa,ab]=(0,c.useState)(O),[ac,ad]=(0,c.useState)(i?.ciWatchEnabled!==!1),[ae,af]=(0,c.useState)(S),[ag,ah]=(0,c.useState)(T),[ai,aj]=(0,c.useState)(void 0),[ak,al]=(0,c.useState)(!1),[am,an]=(0,c.useState)(!1),[ao,ap]=(0,c.useState)(!1),[aq,ar]=(0,c.useState)(!0),[as,at]=(0,c.useState)(void 0),[au,av]=(0,c.useState)(void 0),[aw,ax]=(0,c.useState)(H||void 0),[ay,az]=(0,c.useState)(m??[]),[aA,aB]=(0,c.useState)(!1),[aC,aD]=(0,c.useState)(null),[aE,aF]=(0,c.useState)(!1),aG=(0,c.useRef)(crypto.randomUUID()),aH=(0,c.useRef)(0),aI=(0,c.useRef)(null);(0,c.useEffect)(()=>{i&&(Z({...i.approvalGates}),_(i.push),ab(i.openPr),ad(!1!==i.ciWatchEnabled),af(i.enableEvidence),ah(i.commitEvidence))},[i]),(0,c.useEffect)(()=>{az(m??[])},[m]),(0,c.useEffect)(()=>{a&&n&&aj(n)},[a,n]);let aJ=(0,c.useCallback)(()=>{V(""),X([]),Z({...I}),_(J),ab(O),ad(R),af(S),ah(T),aj(void 0),ax(H||void 0),az(m??[]),al(!1),an(!1),ap(!1),ar(!0),at(void 0),av(void 0),aD(null),aH.current=0,aB(!1)},[I,J,O,S,R,T,H,m]),aK=""!==U.trim()||W.length>0,{attemptClose:aL}=(0,C.useGuardedDrawerClose)({open:a,isDirty:aK,onClose:d,onReset:aJ}),aM=(0,c.useCallback)(async a=>{for(let b of(aD(null),a)){if(b.size>0xa00000)return void aD(`"${b.name}" exceeds 10 MB limit`);let a=function(a){let b=a.lastIndexOf(".");return b>=0?a.slice(b).toLowerCase():""}(b.name);if(a&&!L.has(a))return void aD(`File type "${a}" is not allowed`)}for(let b of a){let a=crypto.randomUUID();X(c=>[...c,{id:a,name:b.name,size:b.size,mimeType:b.type||"application/octet-stream",path:"",loading:!0}]);try{let c=new FormData;c.append("file",b),c.append("sessionId",aG.current);let d=await fetch("/api/attachments/upload",{method:"POST",body:c});if(!d.ok){let b=await d.json().catch(()=>({error:"Upload failed"}));X(b=>b.filter(b=>b.id!==a)),aD(b.error??"Upload failed");return}let e=await d.json();X(b=>b.some(b=>b.id!==a&&b.path===e.path)?b.filter(b=>b.id!==a):b.map(b=>b.id===a?{...e,id:a,loading:!1}:b))}catch{X(b=>b.filter(b=>b.id!==a)),aD("Upload failed")}}},[]),aN=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),aH.current+=1,1===aH.current&&aB(!0)},[]),aO=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),aH.current-=1,0===aH.current&&aB(!1)},[]),aP=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation()},[]),aQ=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),aH.current=0,aB(!1);let b=Array.from(a.dataTransfer.files);b.length>0&&aM(b)},[aM]),aR=(0,c.useCallback)(a=>{let b=a.clipboardData?.items;if(!b)return;let c=[];for(let a of Array.from(b))if("file"===a.kind){let b=a.getAsFile();b&&c.push(b)}c.length>0&&(a.preventDefault(),aM(c))},[aM]),aS=(0,c.useCallback)(a=>{if(a.preventDefault(),!U.trim())return;let b=aw??H;b&&(G.play(),e({description:U.trim(),attachments:W.filter(a=>!a.loading),repositoryPath:b,approvalGates:{allowPrd:Y.allowPrd??!1,allowPlan:Y.allowPlan??!1,allowMerge:Y.allowMerge??!1},push:!!ao||$||aa,openPr:!!ao||aa,ciWatchEnabled:ac,enableEvidence:ae,commitEvidence:ag,fast:ak,forkAndPr:ao,commitSpecs:aq,...am?{pending:am}:{},...as?{agentType:as}:{},...au?{model:au}:{},...ai?{parentId:ai}:{},sessionId:aG.current}),aJ())},[U,W,Y,aw,H,e,$,aa,ae,ac,ag,ak,ao,aq,am,as,au,ai,G,aJ]),aT=(0,c.useCallback)(async()=>{try{let a=await (0,K.pickFiles)();if(!a)return;for(let b of a){let a=crypto.randomUUID();X(c=>[...c,{id:a,name:b.name,size:b.size,mimeType:"application/octet-stream",path:"",loading:!0}]);try{let c=await fetch("/api/attachments/upload-from-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:b.path,sessionId:aG.current})});if(!c.ok){let b=await c.json().catch(()=>({error:"Upload failed"}));X(b=>b.filter(b=>b.id!==a)),aD(b.error??"Upload failed");return}let d=await c.json();X(b=>b.some(b=>b.id!==a&&b.path===d.path)?b.filter(b=>b.id!==a):b.map(b=>b.id===a?{...d,id:a,loading:!1}:b))}catch{X(b=>b.filter(b=>b.id!==a)),aD("Upload failed")}}}catch{}},[]),aU=(0,c.useCallback)(a=>{X(b=>b.filter(b=>b.id!==a))},[]),aV=(0,c.useCallback)((a,b)=>{X(c=>c.map(c=>c.id===a?{...c,notes:b}:c))},[]),aW=(0,c.useRef)(null),aX=(0,c.useCallback)(a=>{(a.ctrlKey||a.metaKey)&&"Enter"===a.key&&(a.preventDefault(),aW.current?.requestSubmit())},[]),aY=(0,c.useCallback)(()=>{aF(!0)},[]),aZ=(0,c.useCallback)(()=>{setTimeout(()=>{let a=aI.current?.contains(document.activeElement),b=aI.current?.querySelector('[aria-expanded="true"]')!==null;a||b||aF(!1)},0)},[]),a$=j&&j.length>0,a_=!H&&!aw,a0=!H&&void 0!==m;return(0,b.jsx)(s.BaseDrawer,{open:a,onClose:aL,size:"md",modal:!1,dismissOnOutsideClick:!0,"data-testid":"feature-create-drawer",header:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("div",{className:"h-2.5 w-2.5 shrink-0 rounded-full bg-blue-500"}),(0,b.jsx)(t.DrawerTitle,{children:"NEW FEATURE"})]}),g?(0,b.jsx)(t.DrawerDescription,{asChild:!0,children:(0,b.jsx)("div",{children:(0,b.jsx)(y.Badge,{variant:"secondary",children:"Creating..."})})}):null]}),footer:(0,b.jsxs)("div",{className:"flex flex-row justify-end gap-2",children:[(0,b.jsx)(u.Button,{variant:"outline",onClick:aL,disabled:g,children:"Cancel"}),(0,b.jsx)(u.Button,{type:"submit",form:"create-feature-form",disabled:!U.trim()||g||a_,children:g?"Creating...":"+ Create Feature"})]}),children:(0,b.jsx)("div",{className:"overflow-y-auto p-4",children:(0,b.jsx)(B.TooltipProvider,{delayDuration:400,children:(0,b.jsxs)("form",{ref:aW,id:"create-feature-form",onSubmit:aS,onKeyDown:aX,className:"flex flex-col gap-4",children:[a0?(0,b.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-selector-section",children:[(0,b.jsx)(x.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"REPOSITORY"}),(0,b.jsx)(Q,{repositories:ay,value:aw,onChange:ax,onAddRepository:a=>{az(b=>[...b,a]),ax(a.path)},disabled:g})]}):H?(0,b.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-readonly-section",children:[(0,b.jsx)(x.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"REPOSITORY"}),(0,b.jsx)("p",{className:"text-sm","data-testid":"repo-readonly-label",children:m?.find(a=>a.path===H)?.name??H.split("/").pop()})]}):null,(0,b.jsxs)("div",{role:"region","aria-label":"File drop zone","data-drag-over":aA?"true":"false",onDragEnter:aN,onDragLeave:aO,onDragOver:aP,onDrop:aQ,className:(0,q.cn)("flex flex-col gap-1.5 rounded-md border-2 border-transparent p-1 transition-colors",aA&&"border-primary/50 bg-primary/5"),children:[(0,b.jsx)(x.Label,{htmlFor:"feature-description",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"DESCRIBE YOUR FEATURE"}),(0,b.jsxs)("div",{ref:aI,onFocus:aY,onBlur:aZ,className:(0,q.cn)("border-input flex h-56 flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow]",aE&&"ring-ring/50 border-ring ring-[3px]"),children:[(0,b.jsx)(w.Textarea,{id:"feature-description",placeholder:"e.g. Add GitHub OAuth login with callback handling and token refresh...",value:U,onChange:a=>V(a.target.value),onPaste:aR,required:!0,disabled:g,className:"min-h-0 flex-1 resize-none rounded-none border-0 shadow-none focus-visible:ring-0"}),W.length>0&&(0,b.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:W.map(a=>(0,b.jsx)(D.AttachmentChip,{name:a.name,size:a.size,mimeType:a.mimeType,path:a.path,onRemove:()=>aU(a.id),disabled:g,loading:a.loading,notes:a.notes,onNotesChange:b=>aV(a.id,b)},a.id))}),aC?(0,b.jsx)("p",{className:"text-destructive px-3 pb-2 text-xs",children:aC}):null,(0,b.jsxs)("div",{className:"border-input flex items-center gap-3 border-t px-3 py-1.5",children:[(0,b.jsx)(E.AgentModelPicker,{initialAgentType:as??v??"claude-code",initialModel:au??z??"claude-sonnet-4-6",mode:"override",onAgentModelChange:(a,b)=>{at(a),av(b)},disabled:g,className:"w-55"}),(0,b.jsxs)(B.Tooltip,{children:[(0,b.jsx)(B.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"ml-auto flex cursor-pointer items-center gap-2",children:[(0,b.jsx)(A.Switch,{id:"pending-mode",checked:am,onCheckedChange:an,disabled:g}),(0,b.jsxs)(x.Label,{htmlFor:"pending-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,b.jsx)(l.Clock,{className:"h-3.5 w-3.5"}),"Pending"]})]})}),(0,b.jsx)(B.TooltipContent,{side:"bottom",children:"Create without starting — start manually later."})]}),(0,b.jsxs)(B.Tooltip,{children:[(0,b.jsx)(B.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-2",children:[(0,b.jsx)(A.Switch,{id:"fast-mode",checked:ak,onCheckedChange:al,disabled:g}),(0,b.jsxs)(x.Label,{htmlFor:"fast-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,b.jsx)(k.Zap,{className:"h-3.5 w-3.5"}),"Fast Mode"]})]})}),(0,b.jsx)(B.TooltipContent,{side:"bottom",children:"Skip SDLC phases and implement directly from your prompt."})]}),(0,b.jsxs)(B.Tooltip,{children:[(0,b.jsx)(B.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",onClick:aT,disabled:g,"aria-label":"Attach files",className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,b.jsx)(h.PaperclipIcon,{className:"h-4 w-4"})})}),(0,b.jsx)(B.TooltipContent,{side:"bottom",children:"Attach files"})]})]})]})]}),a$&&void 0!==n?(0,b.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,b.jsx)(x.Label,{htmlFor:"parent-feature",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"PARENT FEATURE"}),(0,b.jsx)(P,{features:j,value:ai,onChange:aj,disabled:g})]}):null,(0,b.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,b.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,b.jsxs)(B.Tooltip,{children:[(0,b.jsx)(B.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:"APPROVE"})}),(0,b.jsx)(B.TooltipContent,{side:"bottom",children:"Auto-approve phase transitions without manual review."})]}),(0,b.jsx)("div",{className:"flex flex-1 items-center gap-4",children:M.map(a=>(0,b.jsxs)(B.Tooltip,{children:[(0,b.jsx)(B.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(A.Switch,{id:`approve-${a.id}`,size:"sm",checked:Y[a.id]??!1,onCheckedChange:b=>Z(c=>({...c,[a.id]:b})),disabled:g||ak&&("allowPrd"===a.id||"allowPlan"===a.id)}),(0,b.jsx)(x.Label,{htmlFor:`approve-${a.id}`,className:"cursor-pointer text-xs font-medium",children:a.label})]})}),(0,b.jsx)(B.TooltipContent,{side:"bottom",children:ak&&("allowPrd"===a.id||"allowPlan"===a.id)?"Skipped in Fast Mode":a.description})]},a.id))}),(0,b.jsxs)(B.Tooltip,{children:[(0,b.jsx)(B.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",onClick:()=>{let a=M.every(a=>Y[a.id]),b={};for(let c of M)b[c.id]=!a;Z(b)},disabled:g,className:(0,q.cn)("text-muted-foreground hover:text-foreground cursor-pointer rounded px-1.5 py-0.5 text-[10px] font-semibold tracking-wider uppercase transition-colors",M.every(a=>Y[a.id])&&"text-primary"),children:"All"})}),(0,b.jsx)(B.TooltipContent,{side:"bottom",children:"Toggle all approval gates"})]})]}),(0,b.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,b.jsxs)(B.Tooltip,{children:[(0,b.jsx)(B.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:"EVIDENCE"})}),(0,b.jsx)(B.TooltipContent,{side:"bottom",children:"Collect and attach evidence after implementation."})]}),(0,b.jsxs)("div",{className:"flex flex-1 items-center gap-4",children:[(0,b.jsxs)(B.Tooltip,{children:[(0,b.jsx)(B.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(A.Switch,{id:"enable-evidence",size:"sm",checked:ae,onCheckedChange:a=>{af(a),a||ah(!1)},disabled:g}),(0,b.jsx)(x.Label,{htmlFor:"enable-evidence",className:"cursor-pointer text-xs font-medium",children:"Collect"})]})}),(0,b.jsx)(B.TooltipContent,{side:"bottom",children:"Capture screenshots and artifacts after implementation."})]}),(0,b.jsxs)(B.Tooltip,{children:[(0,b.jsx)(B.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(A.Switch,{id:"commit-evidence",size:"sm",checked:ag,onCheckedChange:ah,disabled:g||!ae||!aa&&!ao}),(0,b.jsx)(x.Label,{htmlFor:"commit-evidence",className:(0,q.cn)("cursor-pointer text-xs font-medium",(!ae||!aa&&!ao)&&"opacity-50"),children:"Add to PR"})]})}),(0,b.jsx)(B.TooltipContent,{side:"bottom",children:aa||ao?ae?"Include evidence in the pull request body.":"Requires evidence collection to be enabled":"Requires PR to be enabled"})]})]})]}),(0,b.jsxs)("div",{className:"border-input flex items-start gap-4 rounded-md border px-3 py-2.5",children:[(0,b.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 pt-0.5 text-xs font-semibold tracking-wider",children:"GIT"}),(0,b.jsxs)("div",{className:"flex flex-1 flex-wrap items-center gap-4",children:[(0,b.jsxs)(B.Tooltip,{children:[(0,b.jsx)(B.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(A.Switch,{id:"push",size:"sm",checked:!!ao||$||aa,onCheckedChange:a=>{_(a),!a&&aa&&ab(!1)},disabled:g||ao}),(0,b.jsx)(x.Label,{htmlFor:"push",className:(0,q.cn)("cursor-pointer text-xs font-medium",ao&&"opacity-50"),children:"Push"})]})}),(0,b.jsx)(B.TooltipContent,{side:"bottom",children:ao?"Enabled — contributing to upstream":"Push branch to remote after implementation."})]}),(0,b.jsxs)(B.Tooltip,{children:[(0,b.jsx)(B.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(A.Switch,{id:"open-pr",size:"sm",checked:!!ao||aa,onCheckedChange:a=>{ab(a),a||ah(!1)},disabled:g||ao}),(0,b.jsx)(x.Label,{htmlFor:"open-pr",className:(0,q.cn)("cursor-pointer text-xs font-medium",ao&&"opacity-50"),children:"PR"})]})}),(0,b.jsx)(B.TooltipContent,{side:"bottom",children:ao?"Enabled — contributing to upstream":"Open a pull request after pushing."})]}),(0,b.jsxs)(B.Tooltip,{children:[(0,b.jsx)(B.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(A.Switch,{id:"ci-watch",size:"sm",checked:ac,onCheckedChange:ad,disabled:g}),(0,b.jsx)(x.Label,{htmlFor:"ci-watch",className:"cursor-pointer text-xs font-medium",children:"Watch"})]})}),(0,b.jsx)(B.TooltipContent,{side:"bottom",children:"Watch CI and auto-fix after push."})]}),(0,b.jsx)("div",{className:"bg-border h-4 w-px shrink-0"}),(0,b.jsxs)(B.Tooltip,{children:[(0,b.jsx)(B.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(A.Switch,{id:"commit-specs",size:"sm",checked:aq,onCheckedChange:ar,disabled:g}),(0,b.jsxs)(x.Label,{htmlFor:"commit-specs",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,b.jsx)(p.FileText,{className:"h-3 w-3"}),"Commit Specs"]})]})}),(0,b.jsx)(B.TooltipContent,{side:"bottom",children:"Commit specs to repository."})]}),(0,b.jsxs)(B.Tooltip,{children:[(0,b.jsx)(B.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(A.Switch,{id:"fork-and-pr",size:"sm",checked:ao,onCheckedChange:a=>{ap(a),a&&ar(!1)},disabled:g}),(0,b.jsxs)(x.Label,{htmlFor:"fork-and-pr",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,b.jsx)(o,{className:"h-3 w-3"}),"Fork & PR"]})]})}),(0,b.jsx)(B.TooltipContent,{side:"bottom",children:"Contribute via fork (PR to upstream)."})]})]})]})]})]})})})})}function P({features:a,value:d,onChange:e,disabled:f}){let[g,h]=(0,c.useState)(!1),[k,l]=(0,c.useState)(""),m=(0,c.useRef)(null),n=a.find(a=>a.id===d),o=k.trim()?a.filter(a=>a.name.toLowerCase().includes(k.toLowerCase())||a.id.toLowerCase().includes(k.toLowerCase())):a,p=(0,c.useCallback)(a=>{e(a),h(!1),l("")},[e]);return(0,c.useEffect)(()=>{g?setTimeout(()=>m.current?.focus(),0):l("")},[g]),(0,b.jsxs)(z.Popover,{open:g,onOpenChange:h,children:[(0,b.jsx)(z.PopoverTrigger,{asChild:!0,children:(0,b.jsxs)("button",{id:"parent-feature",type:"button",role:"combobox","aria-expanded":g,"aria-label":"Parent Feature",disabled:f,"data-testid":"parent-feature-combobox",className:(0,q.cn)("border-input bg-background ring-offset-background focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",!n&&"text-muted-foreground"),children:[(0,b.jsx)("span",{className:"truncate",children:n?`${n.name} (${n.id.slice(0,8)})`:"Select parent feature..."}),(0,b.jsx)(i.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,b.jsx)(z.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"parent-feature-combobox-content",children:(0,b.jsxs)("div",{className:"flex flex-col",children:[(0,b.jsx)("div",{className:"border-b p-2",children:(0,b.jsx)(v.Input,{ref:m,placeholder:"Search features...",value:k,onChange:a=>l(a.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"parent-feature-search"})}),(0,b.jsxs)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Features",children:[(0,b.jsxs)("button",{type:"button",role:"option","aria-selected":void 0===d,onClick:()=>p(void 0),className:(0,q.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",void 0===d&&"bg-accent/50"),"data-testid":"parent-feature-option-none",children:[(0,b.jsx)(j.CheckIcon,{className:(0,q.cn)("h-4 w-4 shrink-0",void 0!==d&&"invisible")}),(0,b.jsx)("span",{className:"text-muted-foreground italic",children:"No parent"})]}),0===o.length&&k?(0,b.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:"No features found."}):o.map(a=>(0,b.jsxs)("button",{type:"button",role:"option","aria-selected":d===a.id,onClick:()=>p(a.id),className:(0,q.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",d===a.id&&"bg-accent/50"),"data-testid":`parent-feature-option-${a.id}`,children:[(0,b.jsx)(j.CheckIcon,{className:(0,q.cn)("h-4 w-4 shrink-0",d!==a.id&&"invisible")}),(0,b.jsxs)("span",{className:"truncate",children:[a.name," ",(0,b.jsxs)("span",{className:"text-muted-foreground font-mono text-xs",children:["(",a.id.slice(0,8),")"]})]})]},a.id))]})]})})]})}function Q({repositories:a,value:d,onChange:e,onAddRepository:f,disabled:g}){let[h,k]=(0,c.useState)(!1),[l,o]=(0,c.useState)(""),[p,r]=(0,c.useState)(!1),[s,t]=(0,c.useState)(null),[u,w]=(0,c.useState)(!1),x=(0,c.useRef)(null),{reactFileManager:y}=(0,I.useFeatureFlags)(),A=a.find(a=>a.path===d),B=l.trim()?a.filter(a=>a.name.toLowerCase().includes(l.toLowerCase())||a.path.toLowerCase().includes(l.toLowerCase())):a,C=(0,c.useCallback)(a=>{e(a),k(!1),o("")},[e]),D=(0,c.useCallback)(async a=>{let b=await (0,J.addRepository)({path:a});if(b.error){t(b.error),r(!1);return}if(b.repository){let a={id:b.repository.id,name:b.repository.name,path:b.repository.path};f?.(a),e(a.path),k(!1),o("")}},[f,e]),E=(0,c.useCallback)(async()=>{if(!p){if(y)return void w(!0);r(!0),t(null);try{let a=await (0,G.pickFolder)();if(!a)return void r(!1);await D(a)}catch{w(!0)}finally{r(!1)}}},[p,y,D]),K=(0,c.useCallback)(async a=>{if(w(!1),a){r(!0),t(null);try{await D(a)}catch(a){t(a instanceof Error?a.message:"Failed to add repository")}finally{r(!1)}}},[D]);return(0,c.useEffect)(()=>{h?setTimeout(()=>x.current?.focus(),0):o("")},[h]),(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(z.Popover,{open:h,onOpenChange:k,children:[(0,b.jsx)(z.PopoverTrigger,{asChild:!0,children:(0,b.jsxs)("button",{type:"button",role:"combobox","aria-expanded":h,"aria-label":"Repository",disabled:g,"data-testid":"repository-combobox",className:(0,q.cn)("border-input bg-background ring-offset-background focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",!A&&"text-muted-foreground"),children:[(0,b.jsx)("span",{className:"truncate",children:A?A.name:"Select repository..."}),(0,b.jsx)(i.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,b.jsx)(z.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"repository-combobox-content",children:(0,b.jsxs)("div",{className:"flex flex-col",children:[(0,b.jsx)("div",{className:"border-b p-2",children:(0,b.jsx)(v.Input,{ref:x,placeholder:"Search repositories...",value:l,onChange:a=>o(a.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"repository-search"})}),(0,b.jsx)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Repositories",children:0===B.length?(0,b.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm","data-testid":"repository-empty",children:"No repositories found."}):B.map(a=>(0,b.jsxs)("button",{type:"button",role:"option","aria-selected":d===a.path,onClick:()=>C(a.path),className:(0,q.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",d===a.path&&"bg-accent/50"),"data-testid":`repository-option-${a.id}`,children:[(0,b.jsx)(j.CheckIcon,{className:(0,q.cn)("h-4 w-4 shrink-0",d!==a.path&&"invisible")}),(0,b.jsxs)("span",{className:"flex flex-col items-start truncate",children:[(0,b.jsx)("span",{className:"truncate",children:a.name}),(0,b.jsx)("span",{className:"text-muted-foreground truncate text-xs",children:a.path})]})]},a.id))}),(0,b.jsx)(F.Separator,{}),(0,b.jsxs)("button",{type:"button",onClick:E,disabled:p,className:"hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm","data-testid":"add-repository-item",children:[p?(0,b.jsx)(n.Loader2,{className:"h-4 w-4 shrink-0 animate-spin"}):(0,b.jsx)(m.FolderPlus,{className:"h-4 w-4 shrink-0"}),(0,b.jsx)("span",{children:"Add new repository..."})]}),s?(0,b.jsx)("p",{className:"px-3 pb-2 text-xs text-red-500","data-testid":"add-repository-error",children:s}):null]})})]}),(0,b.jsx)(H.ReactFileManagerDialog,{open:u,onOpenChange:a=>{a||w(!1)},onSelect:K})]})}function R({repositoryPath:a,initialParentId:f,initialDescription:h,features:i,repositories:j,workflowDefaults:k,currentAgentType:l,currentModel:m}){let n=(0,d.useRouter)(),[o,p]=(0,c.useState)(!1),q=(0,d.usePathname)().startsWith("/create"),r=!o&&q;(0,c.useEffect)(()=>{!q&&o&&p(!1)},[q,o]);let s=(0,c.useCallback)(()=>{n.push("/")},[n]),t=(0,c.useCallback)(a=>{p(!0),n.push("/"),g(a).then(b=>{b.error?e.toast.error(b.error):window.dispatchEvent(new CustomEvent("shep:feature-created",{detail:{featureId:b.feature.id,name:b.feature.name,description:b.feature.description,repositoryPath:b.feature.repositoryPath,parentId:a.parentId}}))}).catch(()=>{e.toast.error("Failed to create feature"),p(!1)})},[n]);return(0,b.jsx)(O,{open:r,onClose:s,onSubmit:t,repositoryPath:a,features:i,repositories:j,workflowDefaults:k,initialParentId:f,initialDescription:h,isSubmitting:o,currentAgentType:l,currentModel:m})}a.s(["CreateDrawerClient",()=>R],93995)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map
|