@happyvertical/smrt-projects 0.57.33 → 0.57.34
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/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +1 -1
- package/dist/smrt-knowledge.json +3 -3
- package/package.json +12 -12
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/__smrt-register__.ts","../src/collections/Comments.ts","../src/models/DevelopmentRequestHistory.ts","../src/collections/DevelopmentRequestHistories.ts","../src/models/DevelopmentRequest.ts","../src/collections/DevelopmentRequests.ts","../src/collections/Issues.ts","../src/models/project-governance-validation.ts","../src/models/ProjectDecision.ts","../src/collections/ProjectDecisions.ts","../src/models/ProjectGovernanceEvent.ts","../src/collections/ProjectGovernanceEvents.ts","../src/models/ProjectIntegrationAudit.ts","../src/collections/ProjectIntegrationAudits.ts","../src/models/ProjectIntegration.ts","../src/collections/ProjectIntegrations.ts","../src/models/ProjectQuestion.ts","../src/collections/ProjectQuestions.ts","../src/models/ProjectSpecification.ts","../src/collections/ProjectSpecifications.ts","../src/models/Project.ts","../src/collections/Projects.ts","../src/collections/PullRequests.ts","../src/models/Repository.ts","../src/collections/Repositories.ts","../src/models/delivery-control-plane.ts","../src/services/delivery-service.ts","../src/services/project-board-service.ts","../src/managed-client.ts","../src/migrations/moneyMinorUnits.ts","../src/models/Label.ts","../src/project-governance-types.ts","../src/recipes.ts","../src/services/assistance-request-service.ts","../src/services/participant-development-request-service.ts","../src/services/development-request-service.ts","../src/services/project-governance-service.ts","../src/services/project-specification-service.ts","../src/services/subscription-commercial-resolver.ts"],"sourcesContent":["// Generated by @happyvertical/smrt-core smrtPlugin at library build time.\n// The package manifest is inlined so self-registration cannot miss when a\n// downstream bundler relocates this module away from dist/manifest.json\n// (https://github.com/happyvertical/smrt/issues/1506,\n// https://github.com/happyvertical/smrt/issues/1507).\nimport { ObjectRegistry } from '@happyvertical/smrt-core';\n\nObjectRegistry.registerPackageManifest(JSON.parse(\"{\\\"version\\\":\\\"1.0.0\\\",\\\"timestamp\\\":0,\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"packageVersion\\\":\\\"0.57.33\\\",\\\"objects\\\":{\\\"@happyvertical/smrt-projects:CommentCollection\\\":{\\\"name\\\":\\\"commentcollection\\\",\\\"className\\\":\\\"CommentCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:CommentCollection\\\",\\\"collection\\\":\\\"comments\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/collections/Comments.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"api\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"]},\\\"mcp\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"]},\\\"cli\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"]}},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"Comment\\\",\\\"exportName\\\":\\\"CommentCollection\\\",\\\"collectionExportName\\\":\\\"CommentCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"comments\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"comments\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"issue_id\\\\\\\" UUID,\\\\n \\\\\\\"comment_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"body\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"author\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"url\\\\\\\" TEXT DEFAULT ''\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"issue_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"issues\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"comment_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"author\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"}},\\\"indexes\\\":[{\\\"name\\\":\\\"comments_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"comments_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"comments_issue_id_idx\\\",\\\"columns\\\":[\\\"issue_id\\\"]}],\\\"version\\\":\\\"ffcc1937\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:DevelopmentRequestHistoryCollection\\\":{\\\"name\\\":\\\"developmentrequesthistorycollection\\\",\\\"className\\\":\\\"DevelopmentRequestHistoryCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:DevelopmentRequestHistoryCollection\\\",\\\"collection\\\":\\\"developmentrequesthistories\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/collections/DevelopmentRequestHistories.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{},\\\"methods\\\":{\\\"listForRequest\\\":{\\\"name\\\":\\\"listForRequest\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"tenantId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"requestId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<DevelopmentRequestHistory[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"development_request_histories\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"DevelopmentRequestHistory\\\",\\\"exportName\\\":\\\"DevelopmentRequestHistoryCollection\\\",\\\"collectionExportName\\\":\\\"DevelopmentRequestHistoryCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"development_request_histories\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"development_request_histories\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"request_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"from_status\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"to_status\\\\\\\" TEXT DEFAULT 'submitted',\\\\n \\\\\\\"actor_type\\\\\\\" TEXT DEFAULT 'system',\\\\n \\\\\\\"actor_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"note\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"request_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"development_requests\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"from_status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"to_status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"submitted\\\"},\\\"actor_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"system\\\"},\\\"actor_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"note\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"development_request_histories_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"development_request_histories_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"development_request_histories_request_id_idx\\\",\\\"columns\\\":[\\\"request_id\\\"]}],\\\"version\\\":\\\"67389678\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:DevelopmentRequestCollection\\\":{\\\"name\\\":\\\"developmentrequestcollection\\\",\\\"className\\\":\\\"DevelopmentRequestCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:DevelopmentRequestCollection\\\",\\\"collection\\\":\\\"developmentrequests\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/collections/DevelopmentRequests.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{},\\\"methods\\\":{\\\"createManaged\\\":{\\\"name\\\":\\\"createManaged\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"input\\\",\\\"type\\\":\\\"any\\\",\\\"optional\\\":false,\\\"typeUnresolved\\\":true}],\\\"returnType\\\":\\\"Promise<DevelopmentRequest>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"listByIntegrationRequester\\\":{\\\"name\\\":\\\"listByIntegrationRequester\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"input\\\",\\\"type\\\":\\\"object\\\",\\\"optional\\\":false,\\\"memberTypes\\\":[\\\"string\\\"]}],\\\"returnType\\\":\\\"Promise<DevelopmentRequest[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"transitionStatus\\\":{\\\"name\\\":\\\"transitionStatus\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"tenantId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"requestId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"transition\\\",\\\"type\\\":\\\"DevelopmentRequestTransitionInput\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<DevelopmentRequest>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"listForProject\\\":{\\\"name\\\":\\\"listForProject\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"tenantId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"projectId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"status\\\",\\\"type\\\":\\\"DevelopmentRequestStatus\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<DevelopmentRequest[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"development_requests\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"DevelopmentRequest\\\",\\\"exportName\\\":\\\"DevelopmentRequestCollection\\\",\\\"collectionExportName\\\":\\\"DevelopmentRequestCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"development_requests\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"development_requests\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"project_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"integration_id\\\\\\\" UUID,\\\\n \\\\\\\"requester_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"participant_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"type\\\\\\\" TEXT DEFAULT 'feature',\\\\n \\\\\\\"description\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"evidence\\\\\\\" TEXT DEFAULT '[]',\\\\n \\\\\\\"visibility\\\\\\\" TEXT DEFAULT 'requester',\\\\n \\\\\\\"origin\\\\\\\" TEXT DEFAULT 'managed-app',\\\\n \\\\\\\"discussion\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'submitted'\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"project_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"integration_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"project_integrations\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"requester_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"participant_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"feature\\\"},\\\"description\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"evidence\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"[]\\\"},\\\"visibility\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"requester\\\"},\\\"origin\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"managed-app\\\"},\\\"discussion\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"submitted\\\"}},\\\"indexes\\\":[{\\\"name\\\":\\\"development_requests_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"development_requests_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"development_requests_integration_id_idx\\\",\\\"columns\\\":[\\\"integration_id\\\"]}],\\\"version\\\":\\\"2f7f7c8a\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:IssueCollection\\\":{\\\"name\\\":\\\"issuecollection\\\",\\\"className\\\":\\\"IssueCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:IssueCollection\\\",\\\"collection\\\":\\\"issues\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/collections/Issues.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{},\\\"methods\\\":{\\\"discover\\\":{\\\"name\\\":\\\"discover\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"object\\\",\\\"optional\\\":false,\\\"memberTypes\\\":[\\\"Repository\\\",\\\"SearchFilters\\\"]}],\\\"returnType\\\":\\\"Promise<Issue[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findByProject\\\":{\\\"name\\\":\\\"findByProject\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"projectId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Issue[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findByRepository\\\":{\\\"name\\\":\\\"findByRepository\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"repositoryId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Issue[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findOpen\\\":{\\\"name\\\":\\\"findOpen\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"repositoryId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<Issue[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findByLabel\\\":{\\\"name\\\":\\\"findByLabel\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"label\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"repositoryId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<Issue[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findByAssignee\\\":{\\\"name\\\":\\\"findByAssignee\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"assignee\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"repositoryId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<Issue[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findNeedingReview\\\":{\\\"name\\\":\\\"findNeedingReview\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"repositoryId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<Issue[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findByNumber\\\":{\\\"name\\\":\\\"findByNumber\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"repositoryId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"number\\\",\\\"type\\\":\\\"number\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Issue | null>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findWithUnincorporatedFeedback\\\":{\\\"name\\\":\\\"findWithUnincorporatedFeedback\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"repositoryId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<Issue[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"batchSync\\\":{\\\"name\\\":\\\"batchSync\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"repository\\\",\\\"type\\\":\\\"Repository\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"object\\\",\\\"optional\\\":true,\\\"memberTypes\\\":[\\\"boolean\\\"]}],\\\"returnType\\\":\\\"Promise<Issue[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findByTenant\\\":{\\\"name\\\":\\\"findByTenant\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"tenantId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Issue[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findGlobal\\\":{\\\"name\\\":\\\"findGlobal\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<Issue[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findWithGlobals\\\":{\\\"name\\\":\\\"findWithGlobals\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"tenantId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Issue[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"api\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"create\\\",\\\"update\\\"]},\\\"mcp\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"]},\\\"cli\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"],\\\"skipApiCheck\\\":true}},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"Issue\\\",\\\"exportName\\\":\\\"IssueCollection\\\",\\\"collectionExportName\\\":\\\"IssueCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"issues\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"issues\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"repository_id\\\\\\\" UUID,\\\\n \\\\\\\"project_id\\\\\\\" UUID,\\\\n \\\\\\\"number\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"node_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"title\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"body\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"state\\\\\\\" TEXT DEFAULT 'open',\\\\n \\\\\\\"author\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"labels\\\\\\\" JSON DEFAULT '[]',\\\\n \\\\\\\"assignees\\\\\\\" JSON DEFAULT '[]',\\\\n \\\\\\\"comments_count\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"last_synced_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"original_body\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"synthesis_count\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"head_ref\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"base_ref\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"merged\\\\\\\" BOOLEAN DEFAULT FALSE,\\\\n \\\\\\\"merged_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"mergeable\\\\\\\" BOOLEAN DEFAULT TRUE,\\\\n \\\\\\\"draft\\\\\\\" BOOLEAN DEFAULT FALSE,\\\\n \\\\\\\"additions\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"deletions\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"changed_files\\\\\\\" INTEGER DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"repository_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"repositories\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"project_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"projects\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"number\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"node_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"state\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"open\\\"},\\\"author\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"labels\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false,\\\"default\\\":[]},\\\"assignees\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false,\\\"default\\\":[]},\\\"comments_count\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"last_synced_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false},\\\"original_body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"synthesis_count\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"head_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"base_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"merged\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":false,\\\"default\\\":false},\\\"merged_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false},\\\"mergeable\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":false,\\\"default\\\":true},\\\"draft\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":false,\\\"default\\\":false},\\\"additions\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"deletions\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"changed_files\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"issues_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"issues_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"issues_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"issues_repository_id_idx\\\",\\\"columns\\\":[\\\"repository_id\\\"]},{\\\"name\\\":\\\"issues_project_id_idx\\\",\\\"columns\\\":[\\\"project_id\\\"]}],\\\"version\\\":\\\"83fb5e05\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:ProjectDecisionCollection\\\":{\\\"name\\\":\\\"projectdecisioncollection\\\",\\\"className\\\":\\\"ProjectDecisionCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:ProjectDecisionCollection\\\",\\\"collection\\\":\\\"projectdecisions\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/collections/ProjectDecisions.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{},\\\"methods\\\":{\\\"listForProject\\\":{\\\"name\\\":\\\"listForProject\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"scope\\\",\\\"type\\\":\\\"ProjectGovernanceScope\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"status\\\",\\\"type\\\":\\\"ProjectDecisionStatus\\\",\\\"optional\\\":true},{\\\"name\\\":\\\"visibility\\\",\\\"type\\\":\\\"ProjectGovernanceVisibility\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<ProjectDecision[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getForProject\\\":{\\\"name\\\":\\\"getForProject\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"scope\\\",\\\"type\\\":\\\"ProjectGovernanceScope\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"id\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<ProjectDecision | null>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"project_decisions\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"ProjectDecision\\\",\\\"exportName\\\":\\\"ProjectDecisionCollection\\\",\\\"collectionExportName\\\":\\\"ProjectDecisionCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"project_decisions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"project_decisions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"meta_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"role\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"question\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"decision_options\\\\\\\" TEXT,\\\\n \\\\\\\"outcome\\\\\\\" TEXT,\\\\n \\\\\\\"rationale\\\\\\\" TEXT,\\\\n \\\\\\\"status\\\\\\\" TEXT NOT NULL DEFAULT 'open',\\\\n \\\\\\\"owner_type\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"owner_id\\\\\\\" TEXT,\\\\n \\\\\\\"visibility\\\\\\\" TEXT DEFAULT 'internal',\\\\n \\\\\\\"context_references\\\\\\\" TEXT,\\\\n \\\\\\\"revision\\\\\\\" INTEGER NOT NULL DEFAULT 1,\\\\n \\\\\\\"decided_at\\\\\\\" TIMESTAMP\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"meta_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"role\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":0},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"question\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"decision_options\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"outcome\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"rationale\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"open\\\"},\\\"owner_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"owner_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"visibility\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"internal\\\"},\\\"context_references\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"revision\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":1},\\\"decided_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"project_decisions_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"project_decisions_project_status_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"meta_type\\\",\\\"meta_id\\\",\\\"status\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"project_decisions_owner_status_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"owner_type\\\",\\\"owner_id\\\",\\\"status\\\"]},{\\\"name\\\":\\\"project_decisions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"project_decisions_meta_type_meta_id_idx\\\",\\\"columns\\\":[\\\"meta_type\\\",\\\"meta_id\\\"]}],\\\"version\\\":\\\"34ed60f9\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:ProjectGovernanceEventCollection\\\":{\\\"name\\\":\\\"projectgovernanceeventcollection\\\",\\\"className\\\":\\\"ProjectGovernanceEventCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:ProjectGovernanceEventCollection\\\",\\\"collection\\\":\\\"projectgovernanceevents\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/collections/ProjectGovernanceEvents.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{},\\\"methods\\\":{\\\"listForRecord\\\":{\\\"name\\\":\\\"listForRecord\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"input\\\",\\\"type\\\":\\\"object\\\",\\\"optional\\\":false,\\\"memberTypes\\\":[\\\"string\\\"]}],\\\"returnType\\\":\\\"Promise<ProjectGovernanceEvent[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"project_governance_events\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"ProjectGovernanceEvent\\\",\\\"exportName\\\":\\\"ProjectGovernanceEventCollection\\\",\\\"collectionExportName\\\":\\\"ProjectGovernanceEventCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"project_governance_events\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"project_governance_events\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"meta_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"role\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"record_kind\\\\\\\" TEXT NOT NULL DEFAULT 'question',\\\\n \\\\\\\"action\\\\\\\" TEXT NOT NULL DEFAULT 'created',\\\\n \\\\\\\"actor_type\\\\\\\" TEXT NOT NULL DEFAULT 'system',\\\\n \\\\\\\"actor_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"from_status\\\\\\\" TEXT,\\\\n \\\\\\\"to_status\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"note\\\\\\\" TEXT,\\\\n \\\\\\\"value\\\\\\\" TEXT,\\\\n \\\\\\\"rationale\\\\\\\" TEXT,\\\\n \\\\\\\"answer_selection\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"revision\\\\\\\" INTEGER NOT NULL DEFAULT 1,\\\\n \\\\\\\"from_owner_type\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"from_owner_id\\\\\\\" TEXT,\\\\n \\\\\\\"to_owner_type\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"to_owner_id\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"meta_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"role\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":0},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"record_kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"question\\\"},\\\"action\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"created\\\"},\\\"actor_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"system\\\"},\\\"actor_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"from_status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"to_status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"note\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"value\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"rationale\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"answer_selection\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"revision\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":1},\\\"from_owner_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"from_owner_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"to_owner_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"to_owner_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"project_governance_events_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"project_governance_events_record_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"meta_type\\\",\\\"meta_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"project_governance_events_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"project_governance_events_meta_type_meta_id_idx\\\",\\\"columns\\\":[\\\"meta_type\\\",\\\"meta_id\\\"]}],\\\"version\\\":\\\"e903aea4\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:ProjectIntegrationAuditCollection\\\":{\\\"name\\\":\\\"projectintegrationauditcollection\\\",\\\"className\\\":\\\"ProjectIntegrationAuditCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:ProjectIntegrationAuditCollection\\\",\\\"collection\\\":\\\"projectintegrationaudits\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/collections/ProjectIntegrationAudits.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{},\\\"methods\\\":{\\\"listForIntegration\\\":{\\\"name\\\":\\\"listForIntegration\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"tenantId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"integrationId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<ProjectIntegrationAudit[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"project_integration_audits\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"ProjectIntegrationAudit\\\",\\\"exportName\\\":\\\"ProjectIntegrationAuditCollection\\\",\\\"collectionExportName\\\":\\\"ProjectIntegrationAuditCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"project_integration_audits\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"project_integration_audits\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"integration_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"action\\\\\\\" TEXT DEFAULT 'created',\\\\n \\\\\\\"note\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"integration_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"project_integrations\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"action\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"created\\\"},\\\"note\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"project_integration_audits_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"project_integration_audits_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"project_integration_audits_integration_id_idx\\\",\\\"columns\\\":[\\\"integration_id\\\"]}],\\\"version\\\":\\\"03cc10a2\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:ProjectIntegrationCollection\\\":{\\\"name\\\":\\\"projectintegrationcollection\\\",\\\"className\\\":\\\"ProjectIntegrationCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:ProjectIntegrationCollection\\\",\\\"collection\\\":\\\"projectintegrations\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/collections/ProjectIntegrations.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{},\\\"methods\\\":{\\\"provision\\\":{\\\"name\\\":\\\"provision\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"input\\\",\\\"type\\\":\\\"object\\\",\\\"optional\\\":false,\\\"memberTypes\\\":[\\\"string\\\",\\\"ProjectIntegrationCapability[]\\\"]}],\\\"returnType\\\":\\\"Promise<object>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"rotate\\\":{\\\"name\\\":\\\"rotate\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"tenantId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"integrationId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<object>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"revoke\\\":{\\\"name\\\":\\\"revoke\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"tenantId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"integrationId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<ProjectIntegration>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"authenticate\\\":{\\\"name\\\":\\\"authenticate\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"credential\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<ProjectIntegration | null>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"listForProject\\\":{\\\"name\\\":\\\"listForProject\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"tenantId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"projectId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<ProjectIntegration[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findActive\\\":{\\\"name\\\":\\\"findActive\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"tenantId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"integrationId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<ProjectIntegration | null>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"project_integrations\\\",\\\"api\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"]},\\\"mcp\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"]},\\\"cli\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"]}},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"ProjectIntegration\\\",\\\"exportName\\\":\\\"ProjectIntegrationCollection\\\",\\\"collectionExportName\\\":\\\"ProjectIntegrationCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"project_integrations\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"project_integrations\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"project_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"name\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"credential_hash\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"capabilities\\\\\\\" JSON DEFAULT '[]',\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'active',\\\\n \\\\\\\"revoked_at\\\\\\\" TIMESTAMP\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"project_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"name\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"credential_hash\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"capabilities\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":[]},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"active\\\"},\\\"revoked_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"project_integrations_tenant_id_project_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"project_id\\\",\\\"name\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"project_integrations_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"project_integrations_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"bfbaa783\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:ProjectQuestionCollection\\\":{\\\"name\\\":\\\"projectquestioncollection\\\",\\\"className\\\":\\\"ProjectQuestionCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:ProjectQuestionCollection\\\",\\\"collection\\\":\\\"projectquestions\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/collections/ProjectQuestions.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{},\\\"methods\\\":{\\\"listForProject\\\":{\\\"name\\\":\\\"listForProject\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"scope\\\",\\\"type\\\":\\\"ProjectGovernanceScope\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"status\\\",\\\"type\\\":\\\"ProjectQuestionStatus\\\",\\\"optional\\\":true},{\\\"name\\\":\\\"visibility\\\",\\\"type\\\":\\\"ProjectGovernanceVisibility\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<ProjectQuestion[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getForProject\\\":{\\\"name\\\":\\\"getForProject\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"scope\\\",\\\"type\\\":\\\"ProjectGovernanceScope\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"id\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<ProjectQuestion | null>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"project_questions\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"ProjectQuestion\\\",\\\"exportName\\\":\\\"ProjectQuestionCollection\\\",\\\"collectionExportName\\\":\\\"ProjectQuestionCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"project_questions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"project_questions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"meta_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"role\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"prompt\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"answer\\\\\\\" TEXT,\\\\n \\\\\\\"question_options\\\\\\\" TEXT DEFAULT '[]',\\\\n \\\\\\\"selected_option_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"status\\\\\\\" TEXT NOT NULL DEFAULT 'open',\\\\n \\\\\\\"owner_type\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"owner_id\\\\\\\" TEXT,\\\\n \\\\\\\"visibility\\\\\\\" TEXT DEFAULT 'internal',\\\\n \\\\\\\"context_references\\\\\\\" TEXT,\\\\n \\\\\\\"revision\\\\\\\" INTEGER NOT NULL DEFAULT 1,\\\\n \\\\\\\"answered_at\\\\\\\" TIMESTAMP\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"meta_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"role\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":0},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"prompt\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"answer\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"question_options\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"[]\\\"},\\\"selected_option_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"open\\\"},\\\"owner_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"owner_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"visibility\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"internal\\\"},\\\"context_references\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"revision\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":1},\\\"answered_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"project_questions_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"project_questions_project_status_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"meta_type\\\",\\\"meta_id\\\",\\\"status\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"project_questions_owner_status_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"owner_type\\\",\\\"owner_id\\\",\\\"status\\\"]},{\\\"name\\\":\\\"project_questions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"project_questions_meta_type_meta_id_idx\\\",\\\"columns\\\":[\\\"meta_type\\\",\\\"meta_id\\\"]}],\\\"version\\\":\\\"9bf3b915\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:ProjectSpecificationCollection\\\":{\\\"name\\\":\\\"projectspecificationcollection\\\",\\\"className\\\":\\\"ProjectSpecificationCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:ProjectSpecificationCollection\\\",\\\"collection\\\":\\\"projectspecifications\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/collections/ProjectSpecifications.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{},\\\"methods\\\":{\\\"getForProject\\\":{\\\"name\\\":\\\"getForProject\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"scope\\\",\\\"type\\\":\\\"ProjectGovernanceScope\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<ProjectSpecification | null>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"project_specifications\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"ProjectSpecification\\\",\\\"exportName\\\":\\\"ProjectSpecificationCollection\\\",\\\"collectionExportName\\\":\\\"ProjectSpecificationCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"project_specifications\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"project_specifications\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"meta_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"role\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"title\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"summary\\\\\\\" TEXT,\\\\n \\\\\\\"cookbook\\\\\\\" TEXT,\\\\n \\\\\\\"revision\\\\\\\" INTEGER NOT NULL DEFAULT 1,\\\\n \\\\\\\"actor_type\\\\\\\" TEXT,\\\\n \\\\\\\"actor_id\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"meta_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"role\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":0},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"summary\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"cookbook\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"revision\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":1},\\\"actor_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"actor_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"project_specifications_tenant_id_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"meta_type\\\",\\\"meta_id\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"project_specifications_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"project_specifications_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"project_specifications_meta_type_meta_id_idx\\\",\\\"columns\\\":[\\\"meta_type\\\",\\\"meta_id\\\"]}],\\\"version\\\":\\\"d3d39d7f\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:ProjectCollection\\\":{\\\"name\\\":\\\"projectcollection\\\",\\\"className\\\":\\\"ProjectCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:ProjectCollection\\\",\\\"collection\\\":\\\"projects\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/collections/Projects.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{},\\\"methods\\\":{\\\"findByTitle\\\":{\\\"name\\\":\\\"findByTitle\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"title\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Project | null>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findByOwner\\\":{\\\"name\\\":\\\"findByOwner\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"owner\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Project[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findByProvider\\\":{\\\"name\\\":\\\"findByProvider\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"providerType\\\",\\\"type\\\":\\\"ProjectProviderType\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Project[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getOrCreate\\\":{\\\"name\\\":\\\"getOrCreate\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"projectId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"object\\\",\\\"optional\\\":true,\\\"memberTypes\\\":[\\\"string\\\",\\\"ProjectProviderType\\\",\\\"Record<string, string>\\\"]}],\\\"returnType\\\":\\\"Promise<Project>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"syncAll\\\":{\\\"name\\\":\\\"syncAll\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"object\\\",\\\"optional\\\":true,\\\"memberTypes\\\":[\\\"boolean\\\"]}],\\\"returnType\\\":\\\"Promise<Project[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findWithItemsInStatus\\\":{\\\"name\\\":\\\"findWithItemsInStatus\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"status\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Project[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getStatistics\\\":{\\\"name\\\":\\\"getStatistics\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"projectId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<object>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findByTenant\\\":{\\\"name\\\":\\\"findByTenant\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"tenantId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Project[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findGlobal\\\":{\\\"name\\\":\\\"findGlobal\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<Project[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findWithGlobals\\\":{\\\"name\\\":\\\"findWithGlobals\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"tenantId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Project[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"api\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"create\\\",\\\"update\\\"]},\\\"mcp\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"]},\\\"cli\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"],\\\"skipApiCheck\\\":true}},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"Project\\\",\\\"exportName\\\":\\\"ProjectCollection\\\",\\\"collectionExportName\\\":\\\"ProjectCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"projects\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"projects\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"project_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"project_number\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"title\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"description\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"owner\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"url\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"provider_type\\\\\\\" TEXT DEFAULT 'github',\\\\n \\\\\\\"token_config_key\\\\\\\" TEXT DEFAULT 'GITHUB_TOKEN',\\\\n \\\\\\\"statuses\\\\\\\" JSON DEFAULT '[]',\\\\n \\\\\\\"fields\\\\\\\" JSON DEFAULT '[]',\\\\n \\\\\\\"status_field_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"status_options\\\\\\\" JSON DEFAULT '{}',\\\\n \\\\\\\"last_synced_at\\\\\\\" TIMESTAMP\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"project_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"project_number\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":0},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"description\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"owner\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"provider_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"github\\\"},\\\"token_config_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"GITHUB_TOKEN\\\"},\\\"statuses\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":[]},\\\"fields\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":[]},\\\"status_field_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"status_options\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":{}},\\\"last_synced_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"projects_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"projects_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"2e8c344a\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:PullRequestCollection\\\":{\\\"name\\\":\\\"pullrequestcollection\\\",\\\"className\\\":\\\"PullRequestCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:PullRequestCollection\\\",\\\"collection\\\":\\\"issues\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/collections/PullRequests.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{},\\\"methods\\\":{\\\"discover\\\":{\\\"name\\\":\\\"discover\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"object\\\",\\\"optional\\\":false,\\\"memberTypes\\\":[\\\"Repository\\\",\\\"SearchFilters\\\"]}],\\\"returnType\\\":\\\"Promise<PullRequest[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findByRepository\\\":{\\\"name\\\":\\\"findByRepository\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"repositoryId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<PullRequest[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findOpen\\\":{\\\"name\\\":\\\"findOpen\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"repositoryId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<PullRequest[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findDrafts\\\":{\\\"name\\\":\\\"findDrafts\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"repositoryId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<PullRequest[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findReadyToMerge\\\":{\\\"name\\\":\\\"findReadyToMerge\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"repositoryId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<PullRequest[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findByBranch\\\":{\\\"name\\\":\\\"findByBranch\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"branch\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"repositoryId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<PullRequest[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findByNumber\\\":{\\\"name\\\":\\\"findByNumber\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"repositoryId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"number\\\",\\\"type\\\":\\\"number\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<PullRequest | null>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findAIReadyToMerge\\\":{\\\"name\\\":\\\"findAIReadyToMerge\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"repositoryId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<PullRequest[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findBySize\\\":{\\\"name\\\":\\\"findBySize\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"size\\\",\\\"type\\\":\\\"'xs' | 's' | 'm' | 'l' | 'xl'\\\",\\\"optional\\\":false,\\\"unionBranches\\\":[{\\\"type\\\":\\\"'xs'\\\"},{\\\"type\\\":\\\"'s'\\\"},{\\\"type\\\":\\\"'m'\\\"},{\\\"type\\\":\\\"'l'\\\"},{\\\"type\\\":\\\"'xl'\\\"}]},{\\\"name\\\":\\\"repositoryId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<PullRequest[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"batchSync\\\":{\\\"name\\\":\\\"batchSync\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"repository\\\",\\\"type\\\":\\\"Repository\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"object\\\",\\\"optional\\\":true,\\\"memberTypes\\\":[\\\"boolean\\\"]}],\\\"returnType\\\":\\\"Promise<PullRequest[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findByTenant\\\":{\\\"name\\\":\\\"findByTenant\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"tenantId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<PullRequest[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findGlobal\\\":{\\\"name\\\":\\\"findGlobal\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<PullRequest[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findWithGlobals\\\":{\\\"name\\\":\\\"findWithGlobals\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"tenantId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<PullRequest[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"issues\\\",\\\"api\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"create\\\",\\\"update\\\"]},\\\"mcp\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"]},\\\"cli\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"],\\\"skipApiCheck\\\":true}},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"PullRequest\\\",\\\"exportName\\\":\\\"PullRequestCollection\\\",\\\"collectionExportName\\\":\\\"PullRequestCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"issues\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"issues\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"repository_id\\\\\\\" UUID,\\\\n \\\\\\\"project_id\\\\\\\" UUID,\\\\n \\\\\\\"number\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"node_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"title\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"body\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"state\\\\\\\" TEXT DEFAULT 'open',\\\\n \\\\\\\"author\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"labels\\\\\\\" JSON DEFAULT '[]',\\\\n \\\\\\\"assignees\\\\\\\" JSON DEFAULT '[]',\\\\n \\\\\\\"comments_count\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"last_synced_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"original_body\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"synthesis_count\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"head_ref\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"base_ref\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"merged\\\\\\\" BOOLEAN DEFAULT FALSE,\\\\n \\\\\\\"merged_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"mergeable\\\\\\\" BOOLEAN DEFAULT TRUE,\\\\n \\\\\\\"draft\\\\\\\" BOOLEAN DEFAULT FALSE,\\\\n \\\\\\\"additions\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"deletions\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"changed_files\\\\\\\" INTEGER DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"repository_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"repositories\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"project_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"projects\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"number\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"node_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"state\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"open\\\"},\\\"author\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"labels\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false,\\\"default\\\":[]},\\\"assignees\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false,\\\"default\\\":[]},\\\"comments_count\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"last_synced_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false},\\\"original_body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"synthesis_count\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"head_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"base_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"merged\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":false,\\\"default\\\":false},\\\"merged_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false},\\\"mergeable\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":false,\\\"default\\\":true},\\\"draft\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":false,\\\"default\\\":false},\\\"additions\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"deletions\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"changed_files\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"issues_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"issues_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"issues_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"issues_repository_id_idx\\\",\\\"columns\\\":[\\\"repository_id\\\"]},{\\\"name\\\":\\\"issues_project_id_idx\\\",\\\"columns\\\":[\\\"project_id\\\"]}],\\\"version\\\":\\\"0ebf6fbd\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:RepositoryCollection\\\":{\\\"name\\\":\\\"repositorycollection\\\",\\\"className\\\":\\\"RepositoryCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:RepositoryCollection\\\",\\\"collection\\\":\\\"repositories\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/collections/Repositories.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{},\\\"methods\\\":{\\\"findByFullName\\\":{\\\"name\\\":\\\"findByFullName\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"owner\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"name\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Repository | null>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findByOwner\\\":{\\\"name\\\":\\\"findByOwner\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"owner\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Repository[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findByProvider\\\":{\\\"name\\\":\\\"findByProvider\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"providerType\\\",\\\"type\\\":\\\"RepositoryProviderType\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Repository[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getOrCreate\\\":{\\\"name\\\":\\\"getOrCreate\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"owner\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"name\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"object\\\",\\\"optional\\\":true,\\\"memberTypes\\\":[\\\"RepositoryProviderType\\\",\\\"string\\\"]}],\\\"returnType\\\":\\\"Promise<Repository>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"syncAll\\\":{\\\"name\\\":\\\"syncAll\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"object\\\",\\\"optional\\\":true,\\\"memberTypes\\\":[\\\"boolean\\\"]}],\\\"returnType\\\":\\\"Promise<Repository[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findWithOpenIssues\\\":{\\\"name\\\":\\\"findWithOpenIssues\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<Repository[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findByTenant\\\":{\\\"name\\\":\\\"findByTenant\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"tenantId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Repository[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findGlobal\\\":{\\\"name\\\":\\\"findGlobal\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<Repository[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findWithGlobals\\\":{\\\"name\\\":\\\"findWithGlobals\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"tenantId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Repository[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"api\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"create\\\",\\\"update\\\"]},\\\"mcp\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"]},\\\"cli\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"create\\\"],\\\"skipApiCheck\\\":true}},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"Repository\\\",\\\"exportName\\\":\\\"RepositoryCollection\\\",\\\"collectionExportName\\\":\\\"RepositoryCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"repositories\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"repositories\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"owner\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"name\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"full_name\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"description\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"default_branch\\\\\\\" TEXT DEFAULT 'main',\\\\n \\\\\\\"is_private\\\\\\\" BOOLEAN DEFAULT FALSE,\\\\n \\\\\\\"provider_type\\\\\\\" TEXT DEFAULT 'github',\\\\n \\\\\\\"base_url\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"token_config_key\\\\\\\" TEXT DEFAULT 'GITHUB_TOKEN',\\\\n \\\\\\\"last_synced_at\\\\\\\" TIMESTAMP\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"owner\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"name\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"full_name\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"description\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"default_branch\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"main\\\"},\\\"is_private\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":false},\\\"provider_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"github\\\"},\\\"base_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"token_config_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"GITHUB_TOKEN\\\"},\\\"last_synced_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"repositories_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"repositories_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"c302a5e5\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:Comment\\\":{\\\"name\\\":\\\"comment\\\",\\\"className\\\":\\\"Comment\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:Comment\\\",\\\"collection\\\":\\\"comments\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/Comment.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"nullable\\\":true,\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":false,\\\"autoPopulate\\\":true,\\\"nullable\\\":true,\\\"mode\\\":\\\"optional\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"issueId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"Issue\\\",\\\"description\\\":\\\"The issue this comment is on.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"The issue this comment is on.\\\"}},\\\"commentId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"body\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"description\\\":\\\"The comment text.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"The comment text.\\\"}},\\\"author\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"description\\\":\\\"Who wrote it.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"Who wrote it.\\\"}},\\\"createdAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"updatedAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"url\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"}},\\\"methods\\\":{\\\"isQuestion\\\":{\\\"name\\\":\\\"isQuestion\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<boolean>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"isApproval\\\":{\\\"name\\\":\\\"isApproval\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<boolean>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"requestsChanges\\\":{\\\"name\\\":\\\"requestsChanges\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<boolean>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"extractActionItems\\\":{\\\"name\\\":\\\"extractActionItems\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<string[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"summarize\\\":{\\\"name\\\":\\\"summarize\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<string>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getSentiment\\\":{\\\"name\\\":\\\"getSentiment\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<CommentSentiment>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"api\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"]},\\\"mcp\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"]},\\\"cli\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"]},\\\"tenantScoped\\\":{\\\"mode\\\":\\\"optional\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"Comment\\\",\\\"collectionExportName\\\":\\\"CommentCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"comments\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"comments\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"issue_id\\\\\\\" UUID,\\\\n \\\\\\\"comment_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"body\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"author\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"url\\\\\\\" TEXT DEFAULT ''\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"issue_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"issues\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"comment_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"author\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"}},\\\"indexes\\\":[{\\\"name\\\":\\\"comments_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"comments_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"comments_issue_id_idx\\\",\\\"columns\\\":[\\\"issue_id\\\"]}],\\\"version\\\":\\\"ffcc1937\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:DevelopmentRequest\\\":{\\\"name\\\":\\\"developmentrequest\\\",\\\"className\\\":\\\"DevelopmentRequest\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:DevelopmentRequest\\\",\\\"collection\\\":\\\"developmentrequests\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/DevelopmentRequest.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"projectId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"integrationId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"ProjectIntegration\\\"},\\\"requesterId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"participantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"type\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"feature\\\"},\\\"description\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"evidence\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"[]\\\"},\\\"visibility\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"requester\\\",\\\"enum\\\":[\\\"requester\\\",\\\"workspace\\\",\\\"public\\\",\\\"project_team\\\",\\\"internal\\\"]},\\\"origin\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"managed-app\\\"},\\\"discussion\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"status\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"submitted\\\",\\\"enum\\\":[\\\"submitted\\\",\\\"triaged\\\",\\\"planned\\\",\\\"in_progress\\\",\\\"completed\\\",\\\"declined\\\"]}},\\\"methods\\\":{\\\"initialize\\\":{\\\"name\\\":\\\"initialize\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getEvidence\\\":{\\\"name\\\":\\\"getEvidence\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"DevelopmentRequestEvidence[]\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"setEvidence\\\":{\\\"name\\\":\\\"setEvidence\\\",\\\"async\\\":false,\\\"parameters\\\":[{\\\"name\\\":\\\"value\\\",\\\"type\\\":\\\"DevelopmentRequestEvidence[] | string\\\",\\\"optional\\\":false,\\\"unionBranches\\\":[{\\\"type\\\":\\\"DevelopmentRequestEvidence[]\\\"},{\\\"type\\\":\\\"string\\\"}]}],\\\"returnType\\\":\\\"void\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"development_requests\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"DevelopmentRequest\\\",\\\"collectionExportName\\\":\\\"DevelopmentRequestCollection\\\",\\\"validationRules\\\":[],\\\"schema\\\":{\\\"tableName\\\":\\\"development_requests\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"development_requests\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"project_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"integration_id\\\\\\\" UUID,\\\\n \\\\\\\"requester_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"participant_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"type\\\\\\\" TEXT DEFAULT 'feature',\\\\n \\\\\\\"description\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"evidence\\\\\\\" TEXT DEFAULT '[]',\\\\n \\\\\\\"visibility\\\\\\\" TEXT DEFAULT 'requester',\\\\n \\\\\\\"origin\\\\\\\" TEXT DEFAULT 'managed-app',\\\\n \\\\\\\"discussion\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'submitted'\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"project_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"integration_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"project_integrations\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"requester_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"participant_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"feature\\\"},\\\"description\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"evidence\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"[]\\\"},\\\"visibility\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"requester\\\"},\\\"origin\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"managed-app\\\"},\\\"discussion\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"submitted\\\"}},\\\"indexes\\\":[{\\\"name\\\":\\\"development_requests_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"development_requests_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"development_requests_integration_id_idx\\\",\\\"columns\\\":[\\\"integration_id\\\"]}],\\\"version\\\":\\\"2f7f7c8a\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:DevelopmentRequestHistory\\\":{\\\"name\\\":\\\"developmentrequesthistory\\\",\\\"className\\\":\\\"DevelopmentRequestHistory\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:DevelopmentRequestHistory\\\",\\\"collection\\\":\\\"developmentrequesthistories\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/DevelopmentRequestHistory.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"requestId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"DevelopmentRequest\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"fromStatus\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"toStatus\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"submitted\\\",\\\"enum\\\":[\\\"submitted\\\",\\\"triaged\\\",\\\"planned\\\",\\\"in_progress\\\",\\\"completed\\\",\\\"declined\\\"]},\\\"actorType\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"system\\\",\\\"enum\\\":[\\\"integration\\\",\\\"participant\\\",\\\"system\\\"]},\\\"actorId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"note\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"development_request_histories\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"DevelopmentRequestHistory\\\",\\\"collectionExportName\\\":\\\"DevelopmentRequestHistoryCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"requestId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"development_request_histories\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"development_request_histories\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"request_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"from_status\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"to_status\\\\\\\" TEXT DEFAULT 'submitted',\\\\n \\\\\\\"actor_type\\\\\\\" TEXT DEFAULT 'system',\\\\n \\\\\\\"actor_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"note\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"request_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"development_requests\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"from_status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"to_status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"submitted\\\"},\\\"actor_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"system\\\"},\\\"actor_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"note\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"development_request_histories_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"development_request_histories_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"development_request_histories_request_id_idx\\\",\\\"columns\\\":[\\\"request_id\\\"]}],\\\"version\\\":\\\"67389678\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:Issue\\\":{\\\"name\\\":\\\"issue\\\",\\\"className\\\":\\\"Issue\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:Issue\\\",\\\"collection\\\":\\\"issues\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/Issue.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"created_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"updated_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"nullable\\\":true,\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":false,\\\"autoPopulate\\\":true,\\\"nullable\\\":true,\\\"mode\\\":\\\"optional\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"repositoryId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"Repository\\\"},\\\"projectId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"Project\\\",\\\"description\\\":\\\"The project this issue belongs to.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"The project this issue belongs to.\\\"}},\\\"number\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"default\\\":0},\\\"nodeId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"title\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"description\\\":\\\"A short summary of the issue.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"A short summary of the issue.\\\"}},\\\"body\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"description\\\":\\\"The full description.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"The full description.\\\"}},\\\"state\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"open\\\",\\\"description\\\":\\\"open or closed.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"open or closed.\\\"},\\\"enum\\\":[\\\"open\\\",\\\"closed\\\"]},\\\"author\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"description\\\":\\\"Who raised the issue.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"Who raised the issue.\\\"}},\\\"labels\\\":{\\\"type\\\":\\\"json\\\",\\\"required\\\":false,\\\"default\\\":[],\\\"description\\\":\\\"The labels attached to the issue.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"The labels attached to the issue.\\\"}},\\\"assignees\\\":{\\\"type\\\":\\\"json\\\",\\\"required\\\":false,\\\"default\\\":[],\\\"description\\\":\\\"The people working on it.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"The people working on it.\\\"}},\\\"commentsCount\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"default\\\":0},\\\"lastSyncedAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"originalBody\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"synthesisCount\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"default\\\":0}},\\\"methods\\\":{\\\"hasRepository\\\":{\\\"name\\\":\\\"hasRepository\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"boolean\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getRepository\\\":{\\\"name\\\":\\\"getRepository\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<Repository>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getClient\\\":{\\\"name\\\":\\\"getClient\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<IRepository>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"clearCache\\\":{\\\"name\\\":\\\"clearCache\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"void\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"sync\\\":{\\\"name\\\":\\\"sync\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SyncOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getComments\\\":{\\\"name\\\":\\\"getComments\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<Comment[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"addComment\\\":{\\\"name\\\":\\\"addComment\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"body\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Comment>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"incorporateFeedback\\\":{\\\"name\\\":\\\"incorporateFeedback\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"IncorporateFeedbackOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<IncorporateFeedbackResult>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"rollback\\\":{\\\"name\\\":\\\"rollback\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<object>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"needsReview\\\":{\\\"name\\\":\\\"needsReview\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<boolean>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"isBugReport\\\":{\\\"name\\\":\\\"isBugReport\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<boolean>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"isFeatureRequest\\\":{\\\"name\\\":\\\"isFeatureRequest\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<boolean>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"suggestLabels\\\":{\\\"name\\\":\\\"suggestLabels\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"vocabulary\\\",\\\"type\\\":\\\"IssueLabelVocabulary\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<string[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"close\\\":{\\\"name\\\":\\\"close\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"addLabels\\\":{\\\"name\\\":\\\"addLabels\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"labels\\\",\\\"type\\\":\\\"string[]\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"removeLabel\\\":{\\\"name\\\":\\\"removeLabel\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"label\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"assign\\\":{\\\"name\\\":\\\"assign\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"assignees\\\",\\\"type\\\":\\\"string[]\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getUrl\\\":{\\\"name\\\":\\\"getUrl\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"string\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableStrategy\\\":\\\"sti\\\",\\\"api\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"create\\\",\\\"update\\\"]},\\\"mcp\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"sync\\\",\\\"incorporateFeedback\\\"]},\\\"cli\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"sync\\\",\\\"incorporateFeedback\\\",\\\"rollback\\\"],\\\"skipApiCheck\\\":true},\\\"tenantScoped\\\":{\\\"mode\\\":\\\"optional\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"Issue\\\",\\\"collectionExportName\\\":\\\"IssueCollection\\\",\\\"displayLabelField\\\":\\\"title\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"issues\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"issues\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"repository_id\\\\\\\" UUID,\\\\n \\\\\\\"project_id\\\\\\\" UUID,\\\\n \\\\\\\"number\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"node_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"title\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"body\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"state\\\\\\\" TEXT DEFAULT 'open',\\\\n \\\\\\\"author\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"labels\\\\\\\" JSON DEFAULT '[]',\\\\n \\\\\\\"assignees\\\\\\\" JSON DEFAULT '[]',\\\\n \\\\\\\"comments_count\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"last_synced_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"original_body\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"synthesis_count\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"head_ref\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"base_ref\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"merged\\\\\\\" BOOLEAN DEFAULT FALSE,\\\\n \\\\\\\"merged_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"mergeable\\\\\\\" BOOLEAN DEFAULT TRUE,\\\\n \\\\\\\"draft\\\\\\\" BOOLEAN DEFAULT FALSE,\\\\n \\\\\\\"additions\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"deletions\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"changed_files\\\\\\\" INTEGER DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"repository_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"repositories\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"project_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"projects\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"number\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"node_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"state\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"open\\\"},\\\"author\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"labels\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false,\\\"default\\\":[]},\\\"assignees\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false,\\\"default\\\":[]},\\\"comments_count\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"last_synced_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false},\\\"original_body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"synthesis_count\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"head_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"base_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"merged\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":false,\\\"default\\\":false},\\\"merged_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false},\\\"mergeable\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":false,\\\"default\\\":true},\\\"draft\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":false,\\\"default\\\":false},\\\"additions\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"deletions\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"changed_files\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"issues_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"issues_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"issues_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"issues_repository_id_idx\\\",\\\"columns\\\":[\\\"repository_id\\\"]},{\\\"name\\\":\\\"issues_project_id_idx\\\",\\\"columns\\\":[\\\"project_id\\\"]}],\\\"version\\\":\\\"83fb5e05\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:Label\\\":{\\\"name\\\":\\\"label\\\",\\\"className\\\":\\\"Label\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:Label\\\",\\\"collection\\\":\\\"labels\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/Label.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"repositoryId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"Repository\\\"},\\\"projectId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"Project\\\",\\\"description\\\":\\\"The project this label belongs to.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"The project this label belongs to.\\\"}},\\\"name\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"description\\\":\\\"The label's name, for example bug.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"The label's name, for example bug.\\\"}},\\\"color\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"description\\\":\\\"The label's colour.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"The label's colour.\\\"}},\\\"description\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"description\\\":\\\"What the label means.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"What the label means.\\\"}}},\\\"methods\\\":{\\\"isTypeLabel\\\":{\\\"name\\\":\\\"isTypeLabel\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"boolean\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"isPriorityLabel\\\":{\\\"name\\\":\\\"isPriorityLabel\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"boolean\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"isStatusLabel\\\":{\\\"name\\\":\\\"isStatusLabel\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"boolean\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getCategory\\\":{\\\"name\\\":\\\"getCategory\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"'type' | 'priority' | 'status' | 'area' | 'other'\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getPriorityLevel\\\":{\\\"name\\\":\\\"getPriorityLevel\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"number | null\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getHexColor\\\":{\\\"name\\\":\\\"getHexColor\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"string\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"createInRepository\\\":{\\\"name\\\":\\\"createInRepository\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"updateInRepository\\\":{\\\"name\\\":\\\"updateInRepository\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"api\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"create\\\",\\\"update\\\",\\\"delete\\\"]},\\\"mcp\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"create\\\"]},\\\"cli\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"create\\\",\\\"update\\\",\\\"delete\\\"]}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"Label\\\",\\\"collectionExportName\\\":\\\"LabelCollection\\\",\\\"displayLabelField\\\":\\\"name\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"labels\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"labels\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"repository_id\\\\\\\" UUID,\\\\n \\\\\\\"project_id\\\\\\\" UUID,\\\\n \\\\\\\"name\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"color\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"description\\\\\\\" TEXT DEFAULT ''\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"repository_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"repositories\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"project_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"projects\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"name\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"color\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"description\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"}},\\\"indexes\\\":[{\\\"name\\\":\\\"labels_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"labels_created_at_idx\\\",\\\"columns\\\":[\\\"created_at\\\"]},{\\\"name\\\":\\\"labels_repository_id_idx\\\",\\\"columns\\\":[\\\"repository_id\\\"]},{\\\"name\\\":\\\"labels_project_id_idx\\\",\\\"columns\\\":[\\\"project_id\\\"]}],\\\"version\\\":\\\"664f110a\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:Project\\\":{\\\"name\\\":\\\"project\\\",\\\"className\\\":\\\"Project\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:Project\\\",\\\"collection\\\":\\\"projects\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/Project.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"nullable\\\":true,\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":false,\\\"autoPopulate\\\":true,\\\"nullable\\\":true,\\\"mode\\\":\\\"optional\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"projectId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"projectNumber\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"default\\\":0},\\\"title\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"description\\\":\\\"The project's name.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"The project's name.\\\"}},\\\"description\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"description\\\":\\\"What the project is about.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"What the project is about.\\\"}},\\\"owner\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"description\\\":\\\"Who owns or runs the project.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"Who owns or runs the project.\\\"}},\\\"url\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"description\\\":\\\"A link to the project elsewhere.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"A link to the project elsewhere.\\\"}},\\\"providerType\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"github\\\",\\\"enum\\\":[\\\"github\\\",\\\"jira\\\",\\\"linear\\\",\\\"zenhub\\\"]},\\\"tokenConfigKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"GITHUB_TOKEN\\\"},\\\"statuses\\\":{\\\"type\\\":\\\"json\\\",\\\"required\\\":false,\\\"default\\\":[]},\\\"fields\\\":{\\\"type\\\":\\\"json\\\",\\\"required\\\":false,\\\"default\\\":[]},\\\"statusFieldId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"statusOptions\\\":{\\\"type\\\":\\\"json\\\",\\\"required\\\":false,\\\"default\\\":{}},\\\"lastSyncedAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"getClient\\\":{\\\"name\\\":\\\"getClient\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<IProject>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"clearClient\\\":{\\\"name\\\":\\\"clearClient\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"void\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"sync\\\":{\\\"name\\\":\\\"sync\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SyncOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"addItem\\\":{\\\"name\\\":\\\"addItem\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"item\\\",\\\"type\\\":\\\"Issue | PullRequest\\\",\\\"optional\\\":false,\\\"unionBranches\\\":[{\\\"type\\\":\\\"Issue\\\"},{\\\"type\\\":\\\"PullRequest\\\"}]}],\\\"returnType\\\":\\\"Promise<ProjectItem>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"removeItem\\\":{\\\"name\\\":\\\"removeItem\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"itemId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getItem\\\":{\\\"name\\\":\\\"getItem\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"itemId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<ProjectItem | null>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"listItems\\\":{\\\"name\\\":\\\"listItems\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"filters\\\",\\\"type\\\":\\\"ItemFilters\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<ProjectItem[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"updateItemStatus\\\":{\\\"name\\\":\\\"updateItemStatus\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"itemId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"status\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"updateItemField\\\":{\\\"name\\\":\\\"updateItemField\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"itemId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"fieldId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"value\\\",\\\"type\\\":\\\"unknown\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getStatuses\\\":{\\\"name\\\":\\\"getStatuses\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<ProjectStatus[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getFields\\\":{\\\"name\\\":\\\"getFields\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<ProjectField[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getItemsByStatus\\\":{\\\"name\\\":\\\"getItemsByStatus\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"status\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<ProjectItem[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"moveItem\\\":{\\\"name\\\":\\\"moveItem\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"item\\\",\\\"type\\\":\\\"Issue | PullRequest\\\",\\\"optional\\\":false,\\\"unionBranches\\\":[{\\\"type\\\":\\\"Issue\\\"},{\\\"type\\\":\\\"PullRequest\\\"}]},{\\\"name\\\":\\\"status\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"analyzeHealth\\\":{\\\"name\\\":\\\"analyzeHealth\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<string>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getByTitle\\\":{\\\"name\\\":\\\"getByTitle\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"title\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtObjectOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<Project | null>\\\",\\\"isStatic\\\":true,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"api\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"create\\\",\\\"update\\\"]},\\\"mcp\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"sync\\\",\\\"addItem\\\",\\\"updateItemStatus\\\"]},\\\"cli\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"sync\\\",\\\"addItem\\\",\\\"updateItemStatus\\\",\\\"listItems\\\"],\\\"skipApiCheck\\\":true},\\\"tenantScoped\\\":{\\\"mode\\\":\\\"optional\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"Project\\\",\\\"collectionExportName\\\":\\\"ProjectCollection\\\",\\\"displayLabelField\\\":\\\"title\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"projects\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"projects\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"project_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"project_number\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"title\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"description\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"owner\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"url\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"provider_type\\\\\\\" TEXT DEFAULT 'github',\\\\n \\\\\\\"token_config_key\\\\\\\" TEXT DEFAULT 'GITHUB_TOKEN',\\\\n \\\\\\\"statuses\\\\\\\" JSON DEFAULT '[]',\\\\n \\\\\\\"fields\\\\\\\" JSON DEFAULT '[]',\\\\n \\\\\\\"status_field_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"status_options\\\\\\\" JSON DEFAULT '{}',\\\\n \\\\\\\"last_synced_at\\\\\\\" TIMESTAMP\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"project_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"project_number\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":0},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"description\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"owner\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"provider_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"github\\\"},\\\"token_config_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"GITHUB_TOKEN\\\"},\\\"statuses\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":[]},\\\"fields\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":[]},\\\"status_field_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"status_options\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":{}},\\\"last_synced_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"projects_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"projects_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"2e8c344a\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:ProjectDecision\\\":{\\\"name\\\":\\\"projectdecision\\\",\\\"className\\\":\\\"ProjectDecision\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:ProjectDecision\\\",\\\"collection\\\":\\\"projectdecisions\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/ProjectDecision.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"metaType\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"metaId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"role\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"sortOrder\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"default\\\":0},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"question\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"decisionOptions\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"outcome\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"rationale\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"status\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"default\\\":\\\"open\\\",\\\"_meta\\\":{\\\"required\\\":true},\\\"enum\\\":[\\\"open\\\",\\\"decided\\\",\\\"deferred\\\",\\\"superseded\\\"]},\\\"ownerType\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"enum\\\":[\\\"user\\\",\\\"agent\\\",\\\"system\\\",\\\"\\\"]},\\\"ownerId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"visibility\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"internal\\\",\\\"enum\\\":[\\\"internal\\\",\\\"client\\\"]},\\\"contextReferences\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"revision\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":1},\\\"decidedAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"nullable\\\":true}}},\\\"methods\\\":{\\\"hydrate\\\":{\\\"name\\\":\\\"hydrate\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<T | null>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getOptions\\\":{\\\"name\\\":\\\"getOptions\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"ProjectDecisionOption[]\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"setOptions\\\":{\\\"name\\\":\\\"setOptions\\\",\\\"async\\\":false,\\\"parameters\\\":[{\\\"name\\\":\\\"value\\\",\\\"type\\\":\\\"ProjectDecisionOption[]\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"void\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getContextReferences\\\":{\\\"name\\\":\\\"getContextReferences\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"ProjectContextReference[]\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"setContextReferences\\\":{\\\"name\\\":\\\"setContextReferences\\\",\\\"async\\\":false,\\\"parameters\\\":[{\\\"name\\\":\\\"value\\\",\\\"type\\\":\\\"ProjectContextReference[]\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"void\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"project_decisions\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"indexes\\\":[{\\\"name\\\":\\\"project_decisions_project_status_idx\\\",\\\"columns\\\":[\\\"tenantId\\\",\\\"metaType\\\",\\\"metaId\\\",\\\"status\\\",\\\"createdAt\\\"]},{\\\"name\\\":\\\"project_decisions_owner_status_idx\\\",\\\"columns\\\":[\\\"tenantId\\\",\\\"ownerType\\\",\\\"ownerId\\\",\\\"status\\\"]}],\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtPolymorphicAssociation\\\",\\\"exportName\\\":\\\"ProjectDecision\\\",\\\"collectionExportName\\\":\\\"ProjectDecisionCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"metaType\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"metaId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"role\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"question\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"status\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"revision\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"project_decisions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"project_decisions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"meta_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"role\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"question\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"decision_options\\\\\\\" TEXT,\\\\n \\\\\\\"outcome\\\\\\\" TEXT,\\\\n \\\\\\\"rationale\\\\\\\" TEXT,\\\\n \\\\\\\"status\\\\\\\" TEXT NOT NULL DEFAULT 'open',\\\\n \\\\\\\"owner_type\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"owner_id\\\\\\\" TEXT,\\\\n \\\\\\\"visibility\\\\\\\" TEXT DEFAULT 'internal',\\\\n \\\\\\\"context_references\\\\\\\" TEXT,\\\\n \\\\\\\"revision\\\\\\\" INTEGER NOT NULL DEFAULT 1,\\\\n \\\\\\\"decided_at\\\\\\\" TIMESTAMP\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"meta_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"role\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":0},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"question\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"decision_options\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"outcome\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"rationale\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"open\\\"},\\\"owner_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"owner_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"visibility\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"internal\\\"},\\\"context_references\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"revision\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":1},\\\"decided_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"project_decisions_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"project_decisions_project_status_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"meta_type\\\",\\\"meta_id\\\",\\\"status\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"project_decisions_owner_status_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"owner_type\\\",\\\"owner_id\\\",\\\"status\\\"]},{\\\"name\\\":\\\"project_decisions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"project_decisions_meta_type_meta_id_idx\\\",\\\"columns\\\":[\\\"meta_type\\\",\\\"meta_id\\\"]}],\\\"version\\\":\\\"34ed60f9\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:ProjectGovernanceEvent\\\":{\\\"name\\\":\\\"projectgovernanceevent\\\",\\\"className\\\":\\\"ProjectGovernanceEvent\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:ProjectGovernanceEvent\\\",\\\"collection\\\":\\\"projectgovernanceevents\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/ProjectGovernanceEvent.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"metaType\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"metaId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"role\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"sortOrder\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"default\\\":0},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"recordKind\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"default\\\":\\\"question\\\",\\\"_meta\\\":{\\\"required\\\":true},\\\"enum\\\":[\\\"question\\\",\\\"decision\\\"]},\\\"action\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"default\\\":\\\"created\\\",\\\"_meta\\\":{\\\"required\\\":true},\\\"enum\\\":[\\\"created\\\",\\\"assigned\\\",\\\"answered\\\",\\\"decided\\\",\\\"deferred\\\",\\\"reopened\\\",\\\"superseded\\\"]},\\\"actorType\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"default\\\":\\\"system\\\",\\\"_meta\\\":{\\\"required\\\":true},\\\"enum\\\":[\\\"user\\\",\\\"agent\\\",\\\"system\\\"]},\\\"actorId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"fromStatus\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"toStatus\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"note\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"value\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"rationale\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"answerSelection\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"_meta\\\":{\\\"default\\\":\\\"\\\"}},\\\"revision\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":1},\\\"fromOwnerType\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"enum\\\":[\\\"user\\\",\\\"agent\\\",\\\"system\\\",\\\"\\\"]},\\\"fromOwnerId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"toOwnerType\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"enum\\\":[\\\"user\\\",\\\"agent\\\",\\\"system\\\",\\\"\\\"]},\\\"toOwnerId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"hydrate\\\":{\\\"name\\\":\\\"hydrate\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<T | null>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getAnswerSelection\\\":{\\\"name\\\":\\\"getAnswerSelection\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"ProjectQuestionAnswerSelection | null\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"beforeDelete\\\":{\\\"name\\\":\\\"beforeDelete\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"project_governance_events\\\",\\\"hooks\\\":{\\\"beforeDelete\\\":\\\"beforeDelete\\\"},\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"indexes\\\":[{\\\"name\\\":\\\"project_governance_events_record_idx\\\",\\\"columns\\\":[\\\"tenantId\\\",\\\"metaType\\\",\\\"metaId\\\",\\\"createdAt\\\"]}],\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtPolymorphicAssociation\\\",\\\"exportName\\\":\\\"ProjectGovernanceEvent\\\",\\\"collectionExportName\\\":\\\"ProjectGovernanceEventCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"metaType\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"metaId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"role\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"recordKind\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"action\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"actorType\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"actorId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"toStatus\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"revision\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"project_governance_events\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"project_governance_events\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"meta_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"role\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"record_kind\\\\\\\" TEXT NOT NULL DEFAULT 'question',\\\\n \\\\\\\"action\\\\\\\" TEXT NOT NULL DEFAULT 'created',\\\\n \\\\\\\"actor_type\\\\\\\" TEXT NOT NULL DEFAULT 'system',\\\\n \\\\\\\"actor_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"from_status\\\\\\\" TEXT,\\\\n \\\\\\\"to_status\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"note\\\\\\\" TEXT,\\\\n \\\\\\\"value\\\\\\\" TEXT,\\\\n \\\\\\\"rationale\\\\\\\" TEXT,\\\\n \\\\\\\"answer_selection\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"revision\\\\\\\" INTEGER NOT NULL DEFAULT 1,\\\\n \\\\\\\"from_owner_type\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"from_owner_id\\\\\\\" TEXT,\\\\n \\\\\\\"to_owner_type\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"to_owner_id\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"meta_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"role\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":0},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"record_kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"question\\\"},\\\"action\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"created\\\"},\\\"actor_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"system\\\"},\\\"actor_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"from_status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"to_status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"note\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"value\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"rationale\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"answer_selection\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"revision\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":1},\\\"from_owner_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"from_owner_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"to_owner_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"to_owner_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"project_governance_events_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"project_governance_events_record_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"meta_type\\\",\\\"meta_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"project_governance_events_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"project_governance_events_meta_type_meta_id_idx\\\",\\\"columns\\\":[\\\"meta_type\\\",\\\"meta_id\\\"]}],\\\"version\\\":\\\"e903aea4\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:ProjectIntegration\\\":{\\\"name\\\":\\\"projectintegration\\\",\\\"className\\\":\\\"ProjectIntegration\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:ProjectIntegration\\\",\\\"collection\\\":\\\"projectintegrations\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/ProjectIntegration.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"projectId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"name\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"credentialHash\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"_meta\\\":{\\\"sensitive\\\":true},\\\"sensitive\\\":true},\\\"capabilities\\\":{\\\"type\\\":\\\"json\\\",\\\"required\\\":false,\\\"default\\\":[]},\\\"status\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"active\\\",\\\"enum\\\":[\\\"active\\\",\\\"revoked\\\"]},\\\"revokedAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"hasCapability\\\":{\\\"name\\\":\\\"hasCapability\\\",\\\"async\\\":false,\\\"parameters\\\":[{\\\"name\\\":\\\"capability\\\",\\\"type\\\":\\\"ProjectIntegrationCapability\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"boolean\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"isActive\\\":{\\\"name\\\":\\\"isActive\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"boolean\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"project_integrations\\\",\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"project_id\\\",\\\"name\\\"],\\\"api\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"]},\\\"mcp\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"]},\\\"cli\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"]},\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"ProjectIntegration\\\",\\\"collectionExportName\\\":\\\"ProjectIntegrationCollection\\\",\\\"displayLabelField\\\":\\\"name\\\",\\\"validationRules\\\":[],\\\"schema\\\":{\\\"tableName\\\":\\\"project_integrations\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"project_integrations\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"project_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"name\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"credential_hash\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"capabilities\\\\\\\" JSON DEFAULT '[]',\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'active',\\\\n \\\\\\\"revoked_at\\\\\\\" TIMESTAMP\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"project_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"name\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"credential_hash\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"capabilities\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":[]},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"active\\\"},\\\"revoked_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"project_integrations_tenant_id_project_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"project_id\\\",\\\"name\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"project_integrations_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"project_integrations_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"bfbaa783\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:ProjectIntegrationAudit\\\":{\\\"name\\\":\\\"projectintegrationaudit\\\",\\\"className\\\":\\\"ProjectIntegrationAudit\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:ProjectIntegrationAudit\\\",\\\"collection\\\":\\\"projectintegrationaudits\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/ProjectIntegrationAudit.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"integrationId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"ProjectIntegration\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"action\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"created\\\",\\\"enum\\\":[\\\"created\\\",\\\"rotated\\\",\\\"revoked\\\"]},\\\"note\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"project_integration_audits\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"ProjectIntegrationAudit\\\",\\\"collectionExportName\\\":\\\"ProjectIntegrationAuditCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"integrationId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"project_integration_audits\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"project_integration_audits\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"integration_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"action\\\\\\\" TEXT DEFAULT 'created',\\\\n \\\\\\\"note\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"integration_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"project_integrations\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"action\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"created\\\"},\\\"note\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"project_integration_audits_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"project_integration_audits_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"project_integration_audits_integration_id_idx\\\",\\\"columns\\\":[\\\"integration_id\\\"]}],\\\"version\\\":\\\"03cc10a2\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:ProjectQuestion\\\":{\\\"name\\\":\\\"projectquestion\\\",\\\"className\\\":\\\"ProjectQuestion\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:ProjectQuestion\\\",\\\"collection\\\":\\\"projectquestions\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/ProjectQuestion.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"metaType\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"metaId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"role\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"sortOrder\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"default\\\":0},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"prompt\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"answer\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"questionOptions\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"[]\\\",\\\"_meta\\\":{\\\"default\\\":\\\"[]\\\"}},\\\"selectedOptionId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"_meta\\\":{\\\"default\\\":\\\"\\\"}},\\\"status\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"default\\\":\\\"open\\\",\\\"_meta\\\":{\\\"required\\\":true},\\\"enum\\\":[\\\"open\\\",\\\"answered\\\",\\\"deferred\\\",\\\"superseded\\\"]},\\\"ownerType\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"enum\\\":[\\\"user\\\",\\\"agent\\\",\\\"system\\\",\\\"\\\"]},\\\"ownerId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"visibility\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"internal\\\",\\\"enum\\\":[\\\"internal\\\",\\\"client\\\"]},\\\"contextReferences\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"revision\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":1},\\\"answeredAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"nullable\\\":true}}},\\\"methods\\\":{\\\"hydrate\\\":{\\\"name\\\":\\\"hydrate\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<T | null>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getOptions\\\":{\\\"name\\\":\\\"getOptions\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"ProjectQuestionOption[]\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"setOptions\\\":{\\\"name\\\":\\\"setOptions\\\",\\\"async\\\":false,\\\"parameters\\\":[{\\\"name\\\":\\\"value\\\",\\\"type\\\":\\\"ProjectQuestionOption[]\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"void\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getContextReferences\\\":{\\\"name\\\":\\\"getContextReferences\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"ProjectContextReference[]\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"setContextReferences\\\":{\\\"name\\\":\\\"setContextReferences\\\",\\\"async\\\":false,\\\"parameters\\\":[{\\\"name\\\":\\\"value\\\",\\\"type\\\":\\\"ProjectContextReference[]\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"void\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"project_questions\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"indexes\\\":[{\\\"name\\\":\\\"project_questions_project_status_idx\\\",\\\"columns\\\":[\\\"tenantId\\\",\\\"metaType\\\",\\\"metaId\\\",\\\"status\\\",\\\"createdAt\\\"]},{\\\"name\\\":\\\"project_questions_owner_status_idx\\\",\\\"columns\\\":[\\\"tenantId\\\",\\\"ownerType\\\",\\\"ownerId\\\",\\\"status\\\"]}],\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtPolymorphicAssociation\\\",\\\"exportName\\\":\\\"ProjectQuestion\\\",\\\"collectionExportName\\\":\\\"ProjectQuestionCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"metaType\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"metaId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"role\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"prompt\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"status\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"revision\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"project_questions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"project_questions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"meta_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"role\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"prompt\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"answer\\\\\\\" TEXT,\\\\n \\\\\\\"question_options\\\\\\\" TEXT DEFAULT '[]',\\\\n \\\\\\\"selected_option_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"status\\\\\\\" TEXT NOT NULL DEFAULT 'open',\\\\n \\\\\\\"owner_type\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"owner_id\\\\\\\" TEXT,\\\\n \\\\\\\"visibility\\\\\\\" TEXT DEFAULT 'internal',\\\\n \\\\\\\"context_references\\\\\\\" TEXT,\\\\n \\\\\\\"revision\\\\\\\" INTEGER NOT NULL DEFAULT 1,\\\\n \\\\\\\"answered_at\\\\\\\" TIMESTAMP\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"meta_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"role\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":0},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"prompt\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"answer\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"question_options\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"[]\\\"},\\\"selected_option_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"open\\\"},\\\"owner_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"owner_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"visibility\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"internal\\\"},\\\"context_references\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"revision\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":1},\\\"answered_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"project_questions_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"project_questions_project_status_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"meta_type\\\",\\\"meta_id\\\",\\\"status\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"project_questions_owner_status_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"owner_type\\\",\\\"owner_id\\\",\\\"status\\\"]},{\\\"name\\\":\\\"project_questions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"project_questions_meta_type_meta_id_idx\\\",\\\"columns\\\":[\\\"meta_type\\\",\\\"meta_id\\\"]}],\\\"version\\\":\\\"9bf3b915\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:ProjectSpecification\\\":{\\\"name\\\":\\\"projectspecification\\\",\\\"className\\\":\\\"ProjectSpecification\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:ProjectSpecification\\\",\\\"collection\\\":\\\"projectspecifications\\\",\\\"description\\\":\\\"Canonical project requirements and their portable application cookbook.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/ProjectSpecification.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"metaType\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"metaId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"role\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"sortOrder\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"default\\\":0},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"title\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"summary\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"cookbook\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"revision\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":1},\\\"actorType\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"actorId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"hydrate\\\":{\\\"name\\\":\\\"hydrate\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<T | null>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getCookbook\\\":{\\\"name\\\":\\\"getCookbook\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Cookbook\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"project_specifications\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"meta_type\\\",\\\"meta_id\\\"],\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtPolymorphicAssociation\\\",\\\"exportName\\\":\\\"ProjectSpecification\\\",\\\"collectionExportName\\\":\\\"ProjectSpecificationCollection\\\",\\\"displayLabelField\\\":\\\"title\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"metaType\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"metaId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"role\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"title\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"revision\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"project_specifications\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"project_specifications\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"meta_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"role\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"title\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"summary\\\\\\\" TEXT,\\\\n \\\\\\\"cookbook\\\\\\\" TEXT,\\\\n \\\\\\\"revision\\\\\\\" INTEGER NOT NULL DEFAULT 1,\\\\n \\\\\\\"actor_type\\\\\\\" TEXT,\\\\n \\\\\\\"actor_id\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"meta_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"role\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":0},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"summary\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"cookbook\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"revision\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":1},\\\"actor_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"actor_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"project_specifications_tenant_id_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"meta_type\\\",\\\"meta_id\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"project_specifications_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"project_specifications_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"project_specifications_meta_type_meta_id_idx\\\",\\\"columns\\\":[\\\"meta_type\\\",\\\"meta_id\\\"]}],\\\"version\\\":\\\"d3d39d7f\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:PullRequest\\\":{\\\"name\\\":\\\"pullrequest\\\",\\\"className\\\":\\\"PullRequest\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:PullRequest\\\",\\\"collection\\\":\\\"issues\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/PullRequest.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"created_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"updated_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"nullable\\\":true,\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":false,\\\"autoPopulate\\\":true,\\\"nullable\\\":true,\\\"mode\\\":\\\"optional\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"repositoryId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"Repository\\\"},\\\"projectId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"Project\\\",\\\"description\\\":\\\"The project this issue belongs to.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"The project this issue belongs to.\\\"}},\\\"number\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"default\\\":0},\\\"nodeId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"title\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"description\\\":\\\"A short summary of the issue.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"A short summary of the issue.\\\"}},\\\"body\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"description\\\":\\\"The full description.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"The full description.\\\"}},\\\"state\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"open\\\",\\\"description\\\":\\\"open or closed.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"open or closed.\\\"},\\\"enum\\\":[\\\"open\\\",\\\"closed\\\"]},\\\"author\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"description\\\":\\\"Who raised the issue.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"Who raised the issue.\\\"}},\\\"labels\\\":{\\\"type\\\":\\\"json\\\",\\\"required\\\":false,\\\"default\\\":[],\\\"description\\\":\\\"The labels attached to the issue.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"The labels attached to the issue.\\\"}},\\\"assignees\\\":{\\\"type\\\":\\\"json\\\",\\\"required\\\":false,\\\"default\\\":[],\\\"description\\\":\\\"The people working on it.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"The people working on it.\\\"}},\\\"commentsCount\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"default\\\":0},\\\"lastSyncedAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"originalBody\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"synthesisCount\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"default\\\":0},\\\"headRef\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"baseRef\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"merged\\\":{\\\"type\\\":\\\"boolean\\\",\\\"required\\\":false,\\\"default\\\":false},\\\"mergedAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"mergeable\\\":{\\\"type\\\":\\\"boolean\\\",\\\"required\\\":false,\\\"default\\\":true},\\\"draft\\\":{\\\"type\\\":\\\"boolean\\\",\\\"required\\\":false,\\\"default\\\":false},\\\"additions\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"default\\\":0},\\\"deletions\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"default\\\":0},\\\"changedFiles\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"default\\\":0}},\\\"methods\\\":{\\\"hasRepository\\\":{\\\"name\\\":\\\"hasRepository\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"boolean\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getRepository\\\":{\\\"name\\\":\\\"getRepository\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<Repository>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getClient\\\":{\\\"name\\\":\\\"getClient\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<IRepository>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"clearCache\\\":{\\\"name\\\":\\\"clearCache\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"void\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"sync\\\":{\\\"name\\\":\\\"sync\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SyncOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getComments\\\":{\\\"name\\\":\\\"getComments\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<Comment[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"addComment\\\":{\\\"name\\\":\\\"addComment\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"body\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Comment>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"incorporateFeedback\\\":{\\\"name\\\":\\\"incorporateFeedback\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"IncorporateFeedbackOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<IncorporateFeedbackResult>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"rollback\\\":{\\\"name\\\":\\\"rollback\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<object>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"needsReview\\\":{\\\"name\\\":\\\"needsReview\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<boolean>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"isBugReport\\\":{\\\"name\\\":\\\"isBugReport\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<boolean>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"isFeatureRequest\\\":{\\\"name\\\":\\\"isFeatureRequest\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<boolean>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"suggestLabels\\\":{\\\"name\\\":\\\"suggestLabels\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"vocabulary\\\",\\\"type\\\":\\\"IssueLabelVocabulary\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<string[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"close\\\":{\\\"name\\\":\\\"close\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"addLabels\\\":{\\\"name\\\":\\\"addLabels\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"labels\\\",\\\"type\\\":\\\"string[]\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"removeLabel\\\":{\\\"name\\\":\\\"removeLabel\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"label\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"assign\\\":{\\\"name\\\":\\\"assign\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"assignees\\\",\\\"type\\\":\\\"string[]\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getUrl\\\":{\\\"name\\\":\\\"getUrl\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"string\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"summarize\\\":{\\\"name\\\":\\\"summarize\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<string>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"merge\\\":{\\\"name\\\":\\\"merge\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"method\\\",\\\"type\\\":\\\"MergeMethod\\\",\\\"optional\\\":true,\\\"default\\\":\\\"squash\\\"}],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"markReady\\\":{\\\"name\\\":\\\"markReady\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"convertToDraft\\\":{\\\"name\\\":\\\"convertToDraft\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"requestReviewers\\\":{\\\"name\\\":\\\"requestReviewers\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"reviewers\\\",\\\"type\\\":\\\"string[]\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findLinkedIssue\\\":{\\\"name\\\":\\\"findLinkedIssue\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<Issue | null>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"isReadyToMerge\\\":{\\\"name\\\":\\\"isReadyToMerge\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<boolean>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"suggestReviewers\\\":{\\\"name\\\":\\\"suggestReviewers\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<string[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getChangeSize\\\":{\\\"name\\\":\\\"getChangeSize\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"'xs' | 's' | 'm' | 'l' | 'xl'\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"api\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"create\\\",\\\"update\\\"]},\\\"mcp\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"sync\\\",\\\"summarize\\\",\\\"merge\\\"]},\\\"cli\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"sync\\\",\\\"summarize\\\",\\\"merge\\\",\\\"markReady\\\"],\\\"skipApiCheck\\\":true},\\\"tenantScoped\\\":{\\\"mode\\\":\\\"optional\\\"},\\\"tableName\\\":\\\"issues\\\",\\\"tableStrategy\\\":\\\"sti\\\"},\\\"extends\\\":\\\"Issue\\\",\\\"exportName\\\":\\\"PullRequest\\\",\\\"collectionExportName\\\":\\\"PullRequestCollection\\\",\\\"displayLabelField\\\":\\\"title\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"issues\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"issues\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"repository_id\\\\\\\" UUID,\\\\n \\\\\\\"project_id\\\\\\\" UUID,\\\\n \\\\\\\"number\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"node_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"title\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"body\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"state\\\\\\\" TEXT DEFAULT 'open',\\\\n \\\\\\\"author\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"labels\\\\\\\" JSON DEFAULT '[]',\\\\n \\\\\\\"assignees\\\\\\\" JSON DEFAULT '[]',\\\\n \\\\\\\"comments_count\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"last_synced_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"original_body\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"synthesis_count\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"head_ref\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"base_ref\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"merged\\\\\\\" BOOLEAN DEFAULT FALSE,\\\\n \\\\\\\"merged_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"mergeable\\\\\\\" BOOLEAN DEFAULT TRUE,\\\\n \\\\\\\"draft\\\\\\\" BOOLEAN DEFAULT FALSE,\\\\n \\\\\\\"additions\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"deletions\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"changed_files\\\\\\\" INTEGER DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"repository_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"repositories\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"project_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"projects\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"number\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"node_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"state\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"open\\\"},\\\"author\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"labels\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false,\\\"default\\\":[]},\\\"assignees\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false,\\\"default\\\":[]},\\\"comments_count\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"last_synced_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false},\\\"original_body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"synthesis_count\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"head_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"base_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"merged\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":false,\\\"default\\\":false},\\\"merged_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false},\\\"mergeable\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":false,\\\"default\\\":true},\\\"draft\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":false,\\\"default\\\":false},\\\"additions\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"deletions\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"changed_files\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"issues_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"issues_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"issues_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"issues_repository_id_idx\\\",\\\"columns\\\":[\\\"repository_id\\\"]},{\\\"name\\\":\\\"issues_project_id_idx\\\",\\\"columns\\\":[\\\"project_id\\\"]}],\\\"version\\\":\\\"0ebf6fbd\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:Repository\\\":{\\\"name\\\":\\\"repository\\\",\\\"className\\\":\\\"Repository\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:Repository\\\",\\\"collection\\\":\\\"repositories\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/Repository.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"nullable\\\":true,\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":false,\\\"autoPopulate\\\":true,\\\"nullable\\\":true,\\\"mode\\\":\\\"optional\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"owner\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"name\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"fullName\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"description\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"defaultBranch\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"main\\\"},\\\"isPrivate\\\":{\\\"type\\\":\\\"boolean\\\",\\\"required\\\":false,\\\"default\\\":false},\\\"providerType\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"github\\\",\\\"enum\\\":[\\\"github\\\",\\\"gitlab\\\",\\\"bitbucket\\\",\\\"azure\\\"]},\\\"baseUrl\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"tokenConfigKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"GITHUB_TOKEN\\\"},\\\"lastSyncedAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"getClient\\\":{\\\"name\\\":\\\"getClient\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<IRepository>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"clearClient\\\":{\\\"name\\\":\\\"clearClient\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"void\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"sync\\\":{\\\"name\\\":\\\"sync\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SyncOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getIssues\\\":{\\\"name\\\":\\\"getIssues\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"filters\\\",\\\"type\\\":\\\"SearchFilters\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<Issue[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getPullRequests\\\":{\\\"name\\\":\\\"getPullRequests\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"filters\\\",\\\"type\\\":\\\"SearchFilters\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<PullRequest[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"createIssue\\\":{\\\"name\\\":\\\"createIssue\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"data\\\",\\\"type\\\":\\\"CreateIssueInput\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Issue>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"createPullRequest\\\":{\\\"name\\\":\\\"createPullRequest\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"data\\\",\\\"type\\\":\\\"CreatePRInput\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<PullRequest>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"hasOpenIssuesMatching\\\":{\\\"name\\\":\\\"hasOpenIssuesMatching\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"criteria\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<boolean>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"summarizeActivity\\\":{\\\"name\\\":\\\"summarizeActivity\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<string>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getByFullName\\\":{\\\"name\\\":\\\"getByFullName\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"owner\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"name\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtObjectOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<Repository | null>\\\",\\\"isStatic\\\":true,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"api\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"create\\\",\\\"update\\\"]},\\\"mcp\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"sync\\\"]},\\\"cli\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"sync\\\",\\\"create\\\"],\\\"skipApiCheck\\\":true},\\\"tenantScoped\\\":{\\\"mode\\\":\\\"optional\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"Repository\\\",\\\"collectionExportName\\\":\\\"RepositoryCollection\\\",\\\"displayLabelField\\\":\\\"name\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"repositories\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"repositories\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"owner\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"name\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"full_name\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"description\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"default_branch\\\\\\\" TEXT DEFAULT 'main',\\\\n \\\\\\\"is_private\\\\\\\" BOOLEAN DEFAULT FALSE,\\\\n \\\\\\\"provider_type\\\\\\\" TEXT DEFAULT 'github',\\\\n \\\\\\\"base_url\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"token_config_key\\\\\\\" TEXT DEFAULT 'GITHUB_TOKEN',\\\\n \\\\\\\"last_synced_at\\\\\\\" TIMESTAMP\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"owner\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"name\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"full_name\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"description\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"default_branch\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"main\\\"},\\\"is_private\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":false},\\\"provider_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"github\\\"},\\\"base_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"token_config_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"GITHUB_TOKEN\\\"},\\\"last_synced_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"repositories_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"repositories_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"c302a5e5\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:DevelopmentRequestWorkLink\\\":{\\\"name\\\":\\\"developmentrequestworklink\\\",\\\"className\\\":\\\"DevelopmentRequestWorkLink\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:DevelopmentRequestWorkLink\\\",\\\"collection\\\":\\\"developmentrequestworklinks\\\",\\\"description\\\":\\\"Provider-neutral connection from a Development Request to canonical work.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/delivery-control-plane.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"requestId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"DevelopmentRequest\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"workItemType\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"workItemId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"canonicalStatus\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"providerRef\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"metadata\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"lastProjectedAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false}},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"development_request_work_links\\\",\\\"conflictColumns\\\":[\\\"request_id\\\",\\\"work_item_type\\\",\\\"work_item_id\\\"],\\\"api\\\":false,\\\"cli\\\":false,\\\"mcp\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"DevelopmentRequestWorkLink\\\",\\\"collectionExportName\\\":\\\"DevelopmentRequestWorkLinkCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"requestId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"development_request_work_links\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"development_request_work_links\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"request_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"work_item_type\\\\\\\" TEXT,\\\\n \\\\\\\"work_item_id\\\\\\\" TEXT,\\\\n \\\\\\\"canonical_status\\\\\\\" TEXT,\\\\n \\\\\\\"provider_ref\\\\\\\" TEXT,\\\\n \\\\\\\"metadata\\\\\\\" TEXT,\\\\n \\\\\\\"last_projected_at\\\\\\\" TIMESTAMP\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"request_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"development_requests\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"work_item_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"work_item_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"canonical_status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"provider_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"metadata\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"last_projected_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"development_request_work_links_request_id_work_item_type_idx\\\",\\\"columns\\\":[\\\"request_id\\\",\\\"work_item_type\\\",\\\"work_item_id\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"development_request_work_links_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"development_request_work_links_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"adcbaa21\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:ProjectDeliveryEvent\\\":{\\\"name\\\":\\\"projectdeliveryevent\\\",\\\"className\\\":\\\"ProjectDeliveryEvent\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:ProjectDeliveryEvent\\\",\\\"collection\\\":\\\"projectdeliveryevents\\\",\\\"description\\\":\\\"Ordered, idempotent delivery update emitted by the control plane.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/delivery-control-plane.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"integrationId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"ProjectIntegration\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"requestId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"DevelopmentRequest\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"idempotencyKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"sequence\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"default\\\":0},\\\"type\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{},\\\"enum\\\":[\\\"work_linked\\\",\\\"branch\\\",\\\"pull_request\\\",\\\"ci\\\",\\\"preview\\\",\\\"approval\\\",\\\"deployment\\\",\\\"completed\\\",\\\"rejected\\\"]},\\\"payload\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"occurredAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"deliveredAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"deliveryAttempts\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"default\\\":0},\\\"lastDeliveryError\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}}},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"project_delivery_events\\\",\\\"conflictColumns\\\":[\\\"integration_id\\\",\\\"idempotency_key\\\"],\\\"api\\\":false,\\\"cli\\\":false,\\\"mcp\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"ProjectDeliveryEvent\\\",\\\"collectionExportName\\\":\\\"ProjectDeliveryEventCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"integrationId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"requestId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"project_delivery_events\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"project_delivery_events\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"integration_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"request_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"idempotency_key\\\\\\\" TEXT,\\\\n \\\\\\\"sequence\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"type\\\\\\\" TEXT,\\\\n \\\\\\\"payload\\\\\\\" TEXT,\\\\n \\\\\\\"occurred_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"delivered_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"delivery_attempts\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"last_delivery_error\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"integration_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"project_integrations\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"request_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"development_requests\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"idempotency_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"sequence\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":0},\\\"type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"payload\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"occurred_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"delivered_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"delivery_attempts\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":0},\\\"last_delivery_error\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"project_delivery_events_integration_id_idempotency_key_idx\\\",\\\"columns\\\":[\\\"integration_id\\\",\\\"idempotency_key\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"project_delivery_events_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"project_delivery_events_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"project_delivery_events_request_id_idx\\\",\\\"columns\\\":[\\\"request_id\\\"]}],\\\"version\\\":\\\"99b9e301\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:PreviewApproval\\\":{\\\"name\\\":\\\"previewapproval\\\",\\\"className\\\":\\\"PreviewApproval\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:PreviewApproval\\\",\\\"collection\\\":\\\"previewapprovals\\\",\\\"description\\\":\\\"Client decision state for one preview produced during delivery.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/delivery-control-plane.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"requestId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"DevelopmentRequest\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"previewId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"previewUrl\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"status\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{},\\\"enum\\\":[\\\"pending\\\",\\\"approved\\\",\\\"rejected\\\",\\\"stale\\\"]},\\\"decidedByRef\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"reason\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"createdAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"decidedAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"staleAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false}},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"preview_approvals\\\",\\\"conflictColumns\\\":[\\\"request_id\\\",\\\"preview_id\\\"],\\\"api\\\":false,\\\"cli\\\":false,\\\"mcp\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"PreviewApproval\\\",\\\"collectionExportName\\\":\\\"PreviewApprovalCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"requestId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"preview_approvals\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"preview_approvals\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"request_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"preview_id\\\\\\\" TEXT,\\\\n \\\\\\\"preview_url\\\\\\\" TEXT,\\\\n \\\\\\\"status\\\\\\\" TEXT,\\\\n \\\\\\\"decided_by_ref\\\\\\\" TEXT,\\\\n \\\\\\\"reason\\\\\\\" TEXT,\\\\n \\\\\\\"decided_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"stale_at\\\\\\\" TIMESTAMP\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"request_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"development_requests\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"preview_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"preview_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"decided_by_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"reason\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"decided_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"stale_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"preview_approvals_request_id_preview_id_idx\\\",\\\"columns\\\":[\\\"request_id\\\",\\\"preview_id\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"preview_approvals_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"preview_approvals_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"ec7b2b14\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:AssistanceRequest\\\":{\\\"name\\\":\\\"assistancerequest\\\",\\\"className\\\":\\\"AssistanceRequest\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:AssistanceRequest\\\",\\\"collection\\\":\\\"assistancerequests\\\",\\\"description\\\":\\\"Lossless conversational intake before support/development classification.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/delivery-control-plane.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"integrationId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"ProjectIntegration\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"requesterId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"subject\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"applicationContext\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"conversation\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"evidence\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"classification\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{},\\\"enum\\\":[\\\"unclassified\\\",\\\"support\\\",\\\"development\\\",\\\"both\\\"]},\\\"supportCaseId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"developmentRequestId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"deliveryHandoffLinkedAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"createdAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false}},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"assistance_requests\\\",\\\"api\\\":false,\\\"cli\\\":false,\\\"mcp\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"AssistanceRequest\\\",\\\"collectionExportName\\\":\\\"AssistanceRequestCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"integrationId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"assistance_requests\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"assistance_requests\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"integration_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"requester_id\\\\\\\" TEXT,\\\\n \\\\\\\"subject\\\\\\\" TEXT,\\\\n \\\\\\\"application_context\\\\\\\" TEXT,\\\\n \\\\\\\"conversation\\\\\\\" TEXT,\\\\n \\\\\\\"evidence\\\\\\\" TEXT,\\\\n \\\\\\\"classification\\\\\\\" TEXT,\\\\n \\\\\\\"support_case_id\\\\\\\" TEXT,\\\\n \\\\\\\"development_request_id\\\\\\\" TEXT,\\\\n \\\\\\\"delivery_handoff_linked_at\\\\\\\" TIMESTAMP\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"integration_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"project_integrations\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"requester_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"subject\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"application_context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"conversation\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"evidence\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"classification\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"support_case_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"development_request_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"delivery_handoff_linked_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"assistance_requests_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"assistance_requests_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"assistance_requests_integration_id_idx\\\",\\\"columns\\\":[\\\"integration_id\\\"]}],\\\"version\\\":\\\"d1653259\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:AssistanceRequestEvent\\\":{\\\"name\\\":\\\"assistancerequestevent\\\",\\\"className\\\":\\\"AssistanceRequestEvent\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:AssistanceRequestEvent\\\",\\\"collection\\\":\\\"assistancerequestevents\\\",\\\"description\\\":\\\"Append-only explanation of Assistance Request routing decisions.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/delivery-control-plane.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"assistanceRequestId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"AssistanceRequest\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"priorClassification\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{},\\\"enum\\\":[\\\"unclassified\\\",\\\"support\\\",\\\"development\\\",\\\"both\\\"]},\\\"resultingClassification\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{},\\\"enum\\\":[\\\"unclassified\\\",\\\"support\\\",\\\"development\\\",\\\"both\\\"]},\\\"actorRef\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"reason\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"resultingLinks\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"occurredAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false}},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"assistance_request_events\\\",\\\"api\\\":false,\\\"cli\\\":false,\\\"mcp\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"AssistanceRequestEvent\\\",\\\"collectionExportName\\\":\\\"AssistanceRequestEventCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"assistanceRequestId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"assistance_request_events\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"assistance_request_events\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"assistance_request_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"prior_classification\\\\\\\" TEXT,\\\\n \\\\\\\"resulting_classification\\\\\\\" TEXT,\\\\n \\\\\\\"actor_ref\\\\\\\" TEXT,\\\\n \\\\\\\"reason\\\\\\\" TEXT,\\\\n \\\\\\\"resulting_links\\\\\\\" TEXT,\\\\n \\\\\\\"occurred_at\\\\\\\" TIMESTAMP\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"assistance_request_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"assistance_requests\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"prior_classification\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"resulting_classification\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"actor_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"reason\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"resulting_links\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"occurred_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"assistance_request_events_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"assistance_request_events_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"assistance_request_events_assistance_request_id_idx\\\",\\\"columns\\\":[\\\"assistance_request_id\\\"]}],\\\"version\\\":\\\"bcc95ebe\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:DevelopmentRequestWorkLinkCollection\\\":{\\\"name\\\":\\\"developmentrequestworklinkcollection\\\",\\\"className\\\":\\\"DevelopmentRequestWorkLinkCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:DevelopmentRequestWorkLinkCollection\\\",\\\"collection\\\":\\\"developmentrequestworklinks\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/delivery-control-plane.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"development_request_work_links\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"DevelopmentRequestWorkLink\\\",\\\"exportName\\\":\\\"DevelopmentRequestWorkLinkCollection\\\",\\\"collectionExportName\\\":\\\"DevelopmentRequestWorkLinkCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"development_request_work_links\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"development_request_work_links\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"request_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"work_item_type\\\\\\\" TEXT,\\\\n \\\\\\\"work_item_id\\\\\\\" TEXT,\\\\n \\\\\\\"canonical_status\\\\\\\" TEXT,\\\\n \\\\\\\"provider_ref\\\\\\\" TEXT,\\\\n \\\\\\\"metadata\\\\\\\" TEXT,\\\\n \\\\\\\"last_projected_at\\\\\\\" TIMESTAMP\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"request_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"development_requests\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"work_item_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"work_item_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"canonical_status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"provider_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"metadata\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"last_projected_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"development_request_work_links_request_id_work_item_type_idx\\\",\\\"columns\\\":[\\\"request_id\\\",\\\"work_item_type\\\",\\\"work_item_id\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"development_request_work_links_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"development_request_work_links_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"adcbaa21\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:ProjectDeliveryEventCollection\\\":{\\\"name\\\":\\\"projectdeliveryeventcollection\\\",\\\"className\\\":\\\"ProjectDeliveryEventCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:ProjectDeliveryEventCollection\\\",\\\"collection\\\":\\\"projectdeliveryevents\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/delivery-control-plane.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"project_delivery_events\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"ProjectDeliveryEvent\\\",\\\"exportName\\\":\\\"ProjectDeliveryEventCollection\\\",\\\"collectionExportName\\\":\\\"ProjectDeliveryEventCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"project_delivery_events\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"project_delivery_events\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"integration_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"request_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"idempotency_key\\\\\\\" TEXT,\\\\n \\\\\\\"sequence\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"type\\\\\\\" TEXT,\\\\n \\\\\\\"payload\\\\\\\" TEXT,\\\\n \\\\\\\"occurred_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"delivered_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"delivery_attempts\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"last_delivery_error\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"integration_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"project_integrations\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"request_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"development_requests\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"idempotency_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"sequence\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":0},\\\"type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"payload\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"occurred_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"delivered_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"delivery_attempts\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":0},\\\"last_delivery_error\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"project_delivery_events_integration_id_idempotency_key_idx\\\",\\\"columns\\\":[\\\"integration_id\\\",\\\"idempotency_key\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"project_delivery_events_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"project_delivery_events_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"project_delivery_events_request_id_idx\\\",\\\"columns\\\":[\\\"request_id\\\"]}],\\\"version\\\":\\\"99b9e301\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:PreviewApprovalCollection\\\":{\\\"name\\\":\\\"previewapprovalcollection\\\",\\\"className\\\":\\\"PreviewApprovalCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:PreviewApprovalCollection\\\",\\\"collection\\\":\\\"previewapprovals\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/delivery-control-plane.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"preview_approvals\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"PreviewApproval\\\",\\\"exportName\\\":\\\"PreviewApprovalCollection\\\",\\\"collectionExportName\\\":\\\"PreviewApprovalCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"preview_approvals\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"preview_approvals\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"request_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"preview_id\\\\\\\" TEXT,\\\\n \\\\\\\"preview_url\\\\\\\" TEXT,\\\\n \\\\\\\"status\\\\\\\" TEXT,\\\\n \\\\\\\"decided_by_ref\\\\\\\" TEXT,\\\\n \\\\\\\"reason\\\\\\\" TEXT,\\\\n \\\\\\\"decided_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"stale_at\\\\\\\" TIMESTAMP\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"request_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"development_requests\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"preview_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"preview_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"decided_by_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"reason\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"decided_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"stale_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"preview_approvals_request_id_preview_id_idx\\\",\\\"columns\\\":[\\\"request_id\\\",\\\"preview_id\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"preview_approvals_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"preview_approvals_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"ec7b2b14\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:AssistanceRequestCollection\\\":{\\\"name\\\":\\\"assistancerequestcollection\\\",\\\"className\\\":\\\"AssistanceRequestCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:AssistanceRequestCollection\\\",\\\"collection\\\":\\\"assistancerequests\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/delivery-control-plane.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"assistance_requests\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"AssistanceRequest\\\",\\\"exportName\\\":\\\"AssistanceRequestCollection\\\",\\\"collectionExportName\\\":\\\"AssistanceRequestCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"assistance_requests\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"assistance_requests\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"integration_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"requester_id\\\\\\\" TEXT,\\\\n \\\\\\\"subject\\\\\\\" TEXT,\\\\n \\\\\\\"application_context\\\\\\\" TEXT,\\\\n \\\\\\\"conversation\\\\\\\" TEXT,\\\\n \\\\\\\"evidence\\\\\\\" TEXT,\\\\n \\\\\\\"classification\\\\\\\" TEXT,\\\\n \\\\\\\"support_case_id\\\\\\\" TEXT,\\\\n \\\\\\\"development_request_id\\\\\\\" TEXT,\\\\n \\\\\\\"delivery_handoff_linked_at\\\\\\\" TIMESTAMP\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"integration_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"project_integrations\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"requester_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"subject\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"application_context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"conversation\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"evidence\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"classification\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"support_case_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"development_request_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"delivery_handoff_linked_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"assistance_requests_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"assistance_requests_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"assistance_requests_integration_id_idx\\\",\\\"columns\\\":[\\\"integration_id\\\"]}],\\\"version\\\":\\\"d1653259\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:AssistanceRequestEventCollection\\\":{\\\"name\\\":\\\"assistancerequesteventcollection\\\",\\\"className\\\":\\\"AssistanceRequestEventCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:AssistanceRequestEventCollection\\\",\\\"collection\\\":\\\"assistancerequestevents\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/delivery-control-plane.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"assistance_request_events\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"AssistanceRequestEvent\\\",\\\"exportName\\\":\\\"AssistanceRequestEventCollection\\\",\\\"collectionExportName\\\":\\\"AssistanceRequestEventCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"assistance_request_events\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"assistance_request_events\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"assistance_request_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"prior_classification\\\\\\\" TEXT,\\\\n \\\\\\\"resulting_classification\\\\\\\" TEXT,\\\\n \\\\\\\"actor_ref\\\\\\\" TEXT,\\\\n \\\\\\\"reason\\\\\\\" TEXT,\\\\n \\\\\\\"resulting_links\\\\\\\" TEXT,\\\\n \\\\\\\"occurred_at\\\\\\\" TIMESTAMP\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"assistance_request_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"assistance_requests\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"prior_classification\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"resulting_classification\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"actor_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"reason\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"resulting_links\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"occurred_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"assistance_request_events_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"assistance_request_events_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"assistance_request_events_assistance_request_id_idx\\\",\\\"columns\\\":[\\\"assistance_request_id\\\"]}],\\\"version\\\":\\\"bcc95ebe\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"}},\\\"moduleType\\\":\\\"smrt\\\",\\\"recipes\\\":[{\\\"id\\\":\\\"projects.tracker\\\",\\\"className\\\":\\\"ProjectTrackerRecipe\\\",\\\"label\\\":\\\"Projects\\\",\\\"summary\\\":\\\"Track projects and the issues, labels and comments inside them.\\\",\\\"synonyms\\\":[\\\"issues\\\",\\\"tasks\\\",\\\"tickets\\\",\\\"bugs\\\",\\\"kanban\\\"],\\\"models\\\":[\\\"@happyvertical/smrt-projects:Project\\\",\\\"@happyvertical/smrt-projects:Issue\\\",\\\"@happyvertical/smrt-projects:Label\\\",\\\"@happyvertical/smrt-projects:Comment\\\"],\\\"nav\\\":[{\\\"label\\\":\\\"All projects\\\",\\\"model\\\":\\\"@happyvertical/smrt-projects:Project\\\",\\\"icon\\\":\\\"folder\\\",\\\"description\\\":\\\"Bigger jobs broken into steps you can follow.\\\"},{\\\"label\\\":\\\"Issues\\\",\\\"model\\\":\\\"@happyvertical/smrt-projects:Issue\\\",\\\"icon\\\":\\\"wrench\\\",\\\"description\\\":\\\"Problems and to-dos to track until they are done.\\\"},{\\\"label\\\":\\\"Labels\\\",\\\"model\\\":\\\"@happyvertical/smrt-projects:Label\\\",\\\"icon\\\":\\\"tag\\\",\\\"description\\\":\\\"Tags to sort your projects and issues your way.\\\"}],\\\"requires\\\":[],\\\"section\\\":{\\\"id\\\":\\\"projects\\\",\\\"label\\\":\\\"Projects\\\",\\\"icon\\\":\\\"briefcase\\\",\\\"description\\\":\\\"Projects, their issues, labels and comments.\\\"},\\\"options\\\":{\\\"@happyvertical/smrt-projects:Project\\\":{\\\"fields\\\":{\\\"projectId\\\":{\\\"visibility\\\":\\\"hidden\\\"},\\\"projectNumber\\\":{\\\"visibility\\\":\\\"hidden\\\"},\\\"providerType\\\":{\\\"visibility\\\":\\\"hidden\\\"},\\\"tokenConfigKey\\\":{\\\"visibility\\\":\\\"hidden\\\"},\\\"statuses\\\":{\\\"visibility\\\":\\\"hidden\\\"},\\\"fields\\\":{\\\"visibility\\\":\\\"hidden\\\"},\\\"statusFieldId\\\":{\\\"visibility\\\":\\\"hidden\\\"},\\\"statusOptions\\\":{\\\"visibility\\\":\\\"hidden\\\"},\\\"lastSyncedAt\\\":{\\\"visibility\\\":\\\"hidden\\\"}}},\\\"@happyvertical/smrt-projects:Issue\\\":{\\\"fields\\\":{\\\"nodeId\\\":{\\\"visibility\\\":\\\"hidden\\\"},\\\"originalBody\\\":{\\\"visibility\\\":\\\"hidden\\\"},\\\"synthesisCount\\\":{\\\"visibility\\\":\\\"hidden\\\"},\\\"lastSyncedAt\\\":{\\\"visibility\\\":\\\"hidden\\\"},\\\"commentsCount\\\":{\\\"visibility\\\":\\\"hidden\\\"},\\\"repositoryId\\\":{\\\"visibility\\\":\\\"hidden\\\"},\\\"number\\\":{\\\"visibility\\\":\\\"hidden\\\"}}},\\\"@happyvertical/smrt-projects:Comment\\\":{\\\"fields\\\":{\\\"commentId\\\":{\\\"visibility\\\":\\\"hidden\\\"},\\\"url\\\":{\\\"visibility\\\":\\\"hidden\\\"}}},\\\"@happyvertical/smrt-projects:Label\\\":{\\\"fields\\\":{\\\"repositoryId\\\":{\\\"visibility\\\":\\\"hidden\\\"}}}},\\\"help\\\":{\\\"markdown\\\":\\\"## Overview\\\\n\\\\nProjects tracks the work you are planning: projects, the issues in them, and\\\\nthe labels and comments that organise them.\\\\n\\\\n## Tasks\\\\n\\\\n### Start a project\\\\n\\\\n1. Create a new project.\\\\n2. Give it a **{field:title}** and a **{field:description}**.\\\\n\\\\n### Log an issue\\\\n\\\\n1. Create a new issue and pick the **{field:projectId}**.\\\\n2. Write a **{field:title}** and a **{field:body}**.\\\\n3. Close it by setting **{field:state}** to closed. Comments are attached to the\\\\n issue.\\\\n\\\",\\\"fieldRefs\\\":[\\\"body\\\",\\\"description\\\",\\\"projectId\\\",\\\"state\\\",\\\"title\\\"]},\\\"demo\\\":{\\\"mode\\\":\\\"server\\\",\\\"reasons\\\":[\\\"Needs a server because its package does not build for a browser: node:crypto/async_hooks; core migrations; repos and ai SDKs; and its package depends on @happyvertical/smrt-profiles, @happyvertical/smrt-subscriptions, @happyvertical/smrt-tenancy, @happyvertical/smrt-timesheets, @happyvertical/smrt-users, which do not build for a browser (#3617, #3624, #3626, #3627).\\\"]}}],\\\"smrtDependencies\\\":[\\\"@happyvertical/smrt-core\\\",\\\"@happyvertical/smrt-prompts\\\",\\\"@happyvertical/smrt-subscriptions\\\",\\\"@happyvertical/smrt-tenancy\\\",\\\"@happyvertical/smrt-timesheets\\\"],\\\"browser\\\":{\\\"status\\\":\\\"server-only\\\",\\\"issues\\\":[\\\"#3617\\\",\\\"#3624\\\",\\\"#3626\\\",\\\"#3627\\\"],\\\"reason\\\":\\\"node:crypto/async_hooks; core migrations; repos and ai SDKs\\\",\\\"via\\\":[\\\"@happyvertical/smrt-profiles\\\",\\\"@happyvertical/smrt-subscriptions\\\",\\\"@happyvertical/smrt-tenancy\\\",\\\"@happyvertical/smrt-timesheets\\\",\\\"@happyvertical/smrt-users\\\"]},\\\"stampsConstructors\\\":true}\"));\n","/**\n * CommentCollection - Collection manager for Comment objects\n */\n\nimport { SmrtCollection } from '@happyvertical/smrt-core';\nimport { Comment } from '../models/Comment';\n\nexport class CommentCollection extends SmrtCollection<Comment> {\n static readonly _itemClass = Comment;\n}\n","import {\n foreignKey,\n SmrtObject,\n type SmrtObjectOptions,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport type { DevelopmentRequestStatus } from '../types';\n\nexport interface DevelopmentRequestHistoryOptions extends SmrtObjectOptions {\n tenantId?: string;\n requestId?: string;\n fromStatus?: string;\n toStatus?: DevelopmentRequestStatus;\n actorType?: 'integration' | 'participant' | 'system';\n actorId?: string;\n note?: string | null;\n}\n\n@TenantScoped({ mode: 'required' })\n@smrt({\n tableName: 'development_request_histories',\n api: false,\n mcp: false,\n cli: false,\n})\nexport class DevelopmentRequestHistory extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-projects\";\n @tenantId()\n tenantId: string = '';\n\n @foreignKey('DevelopmentRequest', { required: true })\n requestId: string = '';\n\n fromStatus: string = '';\n\n toStatus: DevelopmentRequestStatus = 'submitted';\n\n actorType: 'integration' | 'participant' | 'system' = 'system';\n\n actorId: string = '';\n\n note: string | null = null;\n\n constructor(options: DevelopmentRequestHistoryOptions = {}) {\n super(options);\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n if (options.requestId !== undefined) this.requestId = options.requestId;\n if (options.fromStatus !== undefined) this.fromStatus = options.fromStatus;\n if (options.toStatus !== undefined) this.toStatus = options.toStatus;\n if (options.actorType !== undefined) this.actorType = options.actorType;\n if (options.actorId !== undefined) this.actorId = options.actorId;\n if (options.note !== undefined) this.note = options.note;\n }\n}\n","import { SmrtCollection } from '@happyvertical/smrt-core';\nimport { withTenant } from '@happyvertical/smrt-tenancy';\nimport { DevelopmentRequestHistory } from '../models/DevelopmentRequestHistory';\n\nexport class DevelopmentRequestHistoryCollection extends SmrtCollection<DevelopmentRequestHistory> {\n static readonly _itemClass = DevelopmentRequestHistory;\n\n async listForRequest(\n tenantId: string,\n requestId: string,\n ): Promise<DevelopmentRequestHistory[]> {\n return withTenant({ tenantId }, () =>\n this.list({\n where: { tenantId, requestId },\n orderBy: 'createdAt ASC',\n }),\n );\n }\n}\n","import {\n foreignKey,\n SmrtObject,\n type SmrtObjectOptions,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport type {\n DevelopmentRequestEvidence,\n DevelopmentRequestOrigin,\n DevelopmentRequestStatus,\n DevelopmentRequestType,\n DevelopmentRequestVisibility,\n} from '../types';\n\nexport interface DevelopmentRequestOptions extends SmrtObjectOptions {\n tenantId?: string;\n projectId?: string;\n integrationId?: string | null;\n requesterId?: string;\n participantId?: string;\n type?: DevelopmentRequestType;\n description?: string;\n evidence?: DevelopmentRequestEvidence[] | string;\n visibility?: DevelopmentRequestVisibility;\n origin?: DevelopmentRequestOrigin;\n discussion?: string;\n status?: DevelopmentRequestStatus;\n}\n\nfunction parseEvidence(raw: unknown): DevelopmentRequestEvidence[] {\n if (!raw) return [];\n if (Array.isArray(raw)) return normalizeEvidence(raw);\n if (typeof raw !== 'string') return [];\n\n try {\n const parsed = JSON.parse(raw);\n return Array.isArray(parsed) ? normalizeEvidence(parsed) : [];\n } catch {\n return [];\n }\n}\n\nfunction normalizeEvidence(raw: unknown[]): DevelopmentRequestEvidence[] {\n return raw\n .filter(\n (entry): entry is Record<string, unknown> =>\n !!entry && typeof entry === 'object' && !Array.isArray(entry),\n )\n .map((entry) => ({\n url: typeof entry.url === 'string' ? entry.url.trim() : '',\n ...(typeof entry.label === 'string' && entry.label.trim().length > 0\n ? { label: entry.label.trim() }\n : {}),\n }))\n .filter((entry) => entry.url.length > 0);\n}\n\nfunction stringifyEvidence(items: DevelopmentRequestEvidence[]): string {\n return JSON.stringify(\n items.map((item) => ({\n url: item.url.trim(),\n ...(item.label?.trim() ? { label: item.label.trim() } : {}),\n })),\n );\n}\n\n@TenantScoped({ mode: 'required' })\n@smrt({\n tableName: 'development_requests',\n // Managed requests must flow through ManagedProjectClient so capability,\n // integration, project, and requester scoping cannot be bypassed.\n api: false,\n mcp: false,\n cli: false,\n})\nexport class DevelopmentRequest extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-projects\";\n @tenantId()\n tenantId: string = '';\n\n projectId: string = '';\n\n // Participant-origin requests have no managed integration credential.\n @foreignKey('ProjectIntegration')\n integrationId: string | null = null;\n\n requesterId: string = '';\n\n participantId: string = '';\n\n type: DevelopmentRequestType = 'feature';\n\n description: string = '';\n\n evidence: string = '[]';\n\n visibility: DevelopmentRequestVisibility = 'requester';\n\n origin: DevelopmentRequestOrigin = 'managed-app';\n\n discussion: string = '';\n\n status: DevelopmentRequestStatus = 'submitted';\n\n constructor(options: DevelopmentRequestOptions = {}) {\n super(options);\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n if (options.projectId !== undefined) this.projectId = options.projectId;\n if (options.integrationId !== undefined)\n this.integrationId = options.integrationId;\n if (options.requesterId !== undefined)\n this.requesterId = options.requesterId;\n if (options.participantId !== undefined)\n this.participantId = options.participantId;\n if (options.type !== undefined) this.type = options.type;\n if (options.description !== undefined)\n this.description = options.description;\n if (options.evidence !== undefined) this.setEvidence(options.evidence);\n if (options.visibility !== undefined) this.visibility = options.visibility;\n if (options.origin !== undefined) this.origin = options.origin;\n if (options.discussion !== undefined) this.discussion = options.discussion;\n if (options.status !== undefined) this.status = options.status;\n }\n\n public override async initialize(): Promise<this> {\n await super.initialize();\n if ((this as unknown as { evidence?: unknown }).evidence == null) {\n this.evidence = '[]';\n } else if (typeof this.evidence !== 'string') {\n this.setEvidence(\n this.evidence as unknown as DevelopmentRequestEvidence[],\n );\n }\n return this;\n }\n\n getEvidence(): DevelopmentRequestEvidence[] {\n return parseEvidence(this.evidence);\n }\n\n setEvidence(value: DevelopmentRequestEvidence[] | string): void {\n this.evidence =\n typeof value === 'string' ? value : stringifyEvidence(value);\n }\n}\n","import { SmrtCollection } from '@happyvertical/smrt-core';\nimport { withTenant } from '@happyvertical/smrt-tenancy';\nimport { DevelopmentRequest } from '../models/DevelopmentRequest';\nimport type {\n DevelopmentRequestStatus,\n DevelopmentRequestTransitionInput,\n ManagedDevelopmentRequestCreateInput,\n} from '../types';\nimport { DevelopmentRequestHistoryCollection } from './DevelopmentRequestHistories';\n\nexport class DevelopmentRequestCollection extends SmrtCollection<DevelopmentRequest> {\n static readonly _itemClass = DevelopmentRequest;\n\n async createManaged(\n input: {\n tenantId: string;\n projectId: string;\n integrationId: string;\n } & ManagedDevelopmentRequestCreateInput,\n ): Promise<DevelopmentRequest> {\n if (!input.integrationId?.trim())\n throw new TypeError('Managed requests require an integration.');\n const request = await withTenant({ tenantId: input.tenantId }, () =>\n this.create({\n tenantId: input.tenantId,\n projectId: input.projectId,\n integrationId: input.integrationId,\n requesterId: input.requesterId,\n participantId: input.participantId ?? '',\n type: input.type,\n description: input.description,\n evidence: JSON.stringify(input.evidence ?? []),\n visibility: input.visibility ?? 'requester',\n origin: input.origin ?? 'managed-app',\n discussion: input.discussion ?? '',\n status: 'submitted',\n }),\n );\n await withTenant({ tenantId: input.tenantId }, () => request.save());\n await this.recordHistory(request, {\n status: 'submitted',\n actorType: 'integration',\n actorId: input.integrationId,\n note: input.discussion ?? '',\n });\n return request;\n }\n\n async listByIntegrationRequester(input: {\n tenantId: string;\n integrationId: string;\n requesterId: string;\n }): Promise<DevelopmentRequest[]> {\n return withTenant({ tenantId: input.tenantId }, () =>\n this.list({\n where: {\n tenantId: input.tenantId,\n integrationId: input.integrationId,\n requesterId: input.requesterId,\n },\n orderBy: 'createdAt ASC',\n }),\n );\n }\n\n async transitionStatus(\n tenantId: string,\n requestId: string,\n transition: DevelopmentRequestTransitionInput,\n ): Promise<DevelopmentRequest> {\n const request = await withTenant({ tenantId }, () =>\n this.findOne({ where: { id: requestId, tenantId } }),\n );\n if (!request) {\n throw new Error(`DevelopmentRequest ${requestId} not found`);\n }\n const fromStatus = request.status;\n request.status = transition.status;\n await withTenant({ tenantId: request.tenantId }, () => request.save());\n await this.recordHistory(request, transition, fromStatus);\n return request;\n }\n\n async listForProject(\n tenantId: string,\n projectId: string,\n status?: DevelopmentRequestStatus,\n ): Promise<DevelopmentRequest[]> {\n return withTenant({ tenantId }, () =>\n this.list({\n where: status\n ? { tenantId, projectId, status }\n : { tenantId, projectId },\n orderBy: 'createdAt ASC',\n }),\n );\n }\n\n private async recordHistory(\n request: DevelopmentRequest,\n transition: DevelopmentRequestTransitionInput,\n fromStatus = '',\n ): Promise<void> {\n const histories = await DevelopmentRequestHistoryCollection.create(\n this.options,\n );\n const entry = await withTenant({ tenantId: request.tenantId }, () =>\n histories.create({\n tenantId: request.tenantId,\n requestId: request.id as string,\n fromStatus,\n toStatus: transition.status,\n actorType: transition.actorType,\n actorId: transition.actorId ?? '',\n note: transition.note ?? '',\n }),\n );\n await withTenant({ tenantId: request.tenantId }, () => entry.save());\n }\n}\n","/**\n * IssueCollection - Collection manager for Issue objects\n *\n * Provides querying and discovery operations for Issue entities.\n */\n\nimport { SmrtCollection } from '@happyvertical/smrt-core';\nimport { queryGlobal, queryWithGlobals } from '@happyvertical/smrt-tenancy';\nimport { Issue } from '../models/Issue';\nimport type { Repository } from '../models/Repository';\nimport type { SearchFilters } from '../types';\n\nexport class IssueCollection extends SmrtCollection<Issue> {\n static readonly _itemClass = Issue;\n\n /**\n * Discover issues from a repository and sync to database\n *\n * This method:\n * 1. Fetches issues from the provider via SDK\n * 2. Creates/updates SMRT Issue records in the database\n * 3. Returns the synced Issue objects\n *\n * @param options - Discovery options\n * @returns Array of Issue objects\n */\n async discover(options: {\n repository: Repository;\n filters?: SearchFilters;\n }): Promise<Issue[]> {\n const { repository, filters } = options;\n const repositoryId = repository.id ?? undefined;\n\n if (!repositoryId) {\n throw new Error('Repository must be saved before discovering issues');\n }\n\n const repoClient = await repository.getClient();\n\n // Fetch issues from provider\n const remoteIssues = await repoClient.searchIssues('', filters);\n\n const issues: Issue[] = [];\n\n for (const remote of remoteIssues) {\n // Find existing issue by repository + number\n let issue = await this.findOne({\n where: {\n repositoryId,\n number: remote.number,\n },\n });\n\n if (!issue) {\n // Create new issue\n issue = await this.create({\n repositoryId,\n number: remote.number,\n nodeId: remote.id,\n title: remote.title,\n body: remote.body,\n state: remote.state,\n author: remote.author.login,\n labels: remote.labels.map((l) => l.name),\n assignees: remote.assignees.map((a) => a.login),\n commentsCount: remote.commentsCount,\n lastSyncedAt: new Date(),\n });\n } else {\n // Update existing issue\n issue.nodeId = remote.id;\n issue.title = remote.title;\n issue.body = remote.body;\n issue.state = remote.state;\n issue.author = remote.author.login;\n issue.labels = remote.labels.map((l) => l.name);\n issue.assignees = remote.assignees.map((a) => a.login);\n issue.commentsCount = remote.commentsCount;\n issue.lastSyncedAt = new Date();\n }\n\n await issue.save();\n issues.push(issue);\n }\n\n return issues;\n }\n\n /**\n * Find issues belonging to a project (repository-backed or project-native)\n *\n * @param projectId - Project ID\n */\n async findByProject(projectId: string): Promise<Issue[]> {\n return await this.list({ where: { projectId } });\n }\n\n /**\n * Find issues by repository\n *\n * @param repositoryId - Repository ID\n * @returns Array of issues\n */\n async findByRepository(repositoryId: string): Promise<Issue[]> {\n return await this.list({\n where: { repositoryId },\n });\n }\n\n /**\n * Find open issues\n *\n * @param repositoryId - Optional repository filter\n * @returns Array of open issues\n */\n async findOpen(repositoryId?: string): Promise<Issue[]> {\n const where: Record<string, unknown> = { state: 'open' };\n if (repositoryId) {\n where.repositoryId = repositoryId;\n }\n return await this.list({ where });\n }\n\n /**\n * Find issues by label\n *\n * @param label - Label name\n * @param repositoryId - Optional repository filter\n * @returns Array of issues with the label\n */\n async findByLabel(label: string, repositoryId?: string): Promise<Issue[]> {\n const issues = await this.list({\n where: repositoryId ? { repositoryId } : {},\n });\n\n // Filter by label (JSON array search)\n return issues.filter((issue) => issue.labels.includes(label));\n }\n\n /**\n * Find issues by assignee\n *\n * @param assignee - Assignee login\n * @param repositoryId - Optional repository filter\n * @returns Array of issues assigned to the user\n */\n async findByAssignee(\n assignee: string,\n repositoryId?: string,\n ): Promise<Issue[]> {\n const issues = await this.list({\n where: repositoryId ? { repositoryId } : {},\n });\n\n // Filter by assignee (JSON array search)\n return issues.filter((issue) => issue.assignees.includes(assignee));\n }\n\n /**\n * Find issues needing review (AI-powered)\n *\n * @param repositoryId - Optional repository filter\n * @returns Array of issues that need review\n */\n async findNeedingReview(repositoryId?: string): Promise<Issue[]> {\n const openIssues = await this.findOpen(repositoryId);\n const needingReview: Issue[] = [];\n\n for (const issue of openIssues) {\n if (await issue.needsReview()) {\n needingReview.push(issue);\n }\n }\n\n return needingReview;\n }\n\n /**\n * Find issue by number in a repository\n *\n * @param repositoryId - Repository ID\n * @param number - Issue number\n * @returns Issue or null\n */\n async findByNumber(\n repositoryId: string,\n number: number,\n ): Promise<Issue | null> {\n const results = await this.list({\n where: { repositoryId, number },\n limit: 1,\n });\n return results[0] || null;\n }\n\n /**\n * Get issues with unincorporated feedback\n *\n * Issues that have comments but haven't had feedback incorporated\n *\n * @param repositoryId - Optional repository filter\n * @returns Array of issues\n */\n async findWithUnincorporatedFeedback(\n repositoryId?: string,\n ): Promise<Issue[]> {\n const issues = await this.findOpen(repositoryId);\n\n return issues.filter(\n (issue) => issue.commentsCount > 0 && issue.synthesisCount === 0,\n );\n }\n\n /**\n * Batch sync issues from repository\n *\n * @param repository - Repository to sync from\n * @param options - Sync options\n * @returns Array of synced issues\n */\n async batchSync(\n repository: Repository,\n options: { force?: boolean } = {},\n ): Promise<Issue[]> {\n const issues = await this.findByRepository(repository.id as string);\n const synced: Issue[] = [];\n\n for (const issue of issues) {\n await issue.sync(options);\n synced.push(issue);\n }\n\n return synced;\n }\n\n /**\n * Find issues by tenant ID\n *\n * @param tenantId - Tenant ID to filter by\n * @returns Array of issues for the tenant\n */\n async findByTenant(tenantId: string): Promise<Issue[]> {\n return this.list({ where: { tenantId } });\n }\n\n /**\n * Find all global issues (no tenant association).\n *\n * Routes through the shared tenant-global helper so it does not throw under\n * an active tenant context (an explicit `tenant_id IS NULL` filter would be\n * flagged as an isolation violation). (#1600)\n *\n * @returns Array of global issues\n */\n async findGlobal(): Promise<Issue[]> {\n return queryGlobal<Issue>(this);\n }\n\n /**\n * Find issues for a tenant plus all global issues.\n *\n * Fails closed if an active tenant context requests a different tenant's\n * rows; the admin/system path keeps the cross-tenant capability. (#1600)\n *\n * @param tenantId - Tenant ID to filter by\n * @returns Array of tenant and global issues\n */\n async findWithGlobals(tenantId: string): Promise<Issue[]> {\n return queryWithGlobals<Issue>(this, tenantId, 'Issue.findWithGlobals');\n }\n}\n","import type {\n ProjectContextReference,\n ProjectDecisionOption,\n ProjectQuestionOption,\n} from '../project-governance-types.js';\n\nconst CONTEXT_KINDS = new Set([\n 'spec',\n 'cookbook',\n 'conversation',\n 'asset',\n 'url',\n 'other',\n]);\n\nexport function parseContextReferences(\n value: string,\n): ProjectContextReference[] {\n let parsed: unknown;\n try {\n parsed = JSON.parse(value);\n } catch {\n throw new TypeError('Project context references must be valid JSON.');\n }\n if (!Array.isArray(parsed) || parsed.length > 100)\n throw new TypeError(\n 'Project context references must be an array of at most 100 items.',\n );\n return parsed.map((entry) => {\n if (!entry || typeof entry !== 'object')\n throw new TypeError('Invalid project context reference.');\n const item = entry as Record<string, unknown>;\n const kind = typeof item.kind === 'string' ? item.kind : '';\n const ref = typeof item.ref === 'string' ? item.ref.trim() : '';\n const label =\n typeof item.label === 'string' ? item.label.trim() : undefined;\n if (!CONTEXT_KINDS.has(kind) || !ref)\n throw new TypeError('Invalid project context reference.');\n return {\n kind,\n ref,\n ...(label ? { label } : {}),\n } as ProjectContextReference;\n });\n}\n\nexport function serializeContextReferences(\n value: readonly ProjectContextReference[],\n): string {\n return JSON.stringify(parseContextReferences(JSON.stringify(value)));\n}\n\nexport function parseDecisionOptions(value: string): ProjectDecisionOption[] {\n let parsed: unknown;\n try {\n parsed = JSON.parse(value);\n } catch {\n throw new TypeError('Project decision options must be valid JSON.');\n }\n if (!Array.isArray(parsed) || parsed.length > 50)\n throw new TypeError(\n 'Project decision options must be an array of at most 50 items.',\n );\n const seen = new Set<string>();\n return parsed.map((entry) => {\n if (!entry || typeof entry !== 'object')\n throw new TypeError('Invalid project decision option.');\n const item = entry as Record<string, unknown>;\n const id = typeof item.id === 'string' ? item.id.trim() : '';\n const label = typeof item.label === 'string' ? item.label.trim() : '';\n const description =\n typeof item.description === 'string'\n ? item.description.trim()\n : undefined;\n if (!id || !label || seen.has(id))\n throw new TypeError(\n 'Project decision option ids and labels must be unique and non-empty.',\n );\n seen.add(id);\n return { id, label, ...(description ? { description } : {}) };\n });\n}\n\nexport function serializeDecisionOptions(\n value: readonly ProjectDecisionOption[],\n): string {\n return JSON.stringify(parseDecisionOptions(JSON.stringify(value)));\n}\n\n/** Normalize authored choices; the reserved Other entry is never caller-authored. */\nexport function parseQuestionOptions(value: string): ProjectQuestionOption[] {\n const options = parseDecisionOptions(value);\n const raw = JSON.parse(value) as Record<string, unknown>[];\n return options.map((option, index) => {\n if (option.id.toLowerCase() === 'other')\n throw new TypeError('Project question option id \"other\" is reserved.');\n if (\n raw[index].recommended !== undefined &&\n typeof raw[index].recommended !== 'boolean'\n )\n throw new TypeError(\n 'Project question option recommended must be boolean.',\n );\n if (\n raw[index].description !== undefined &&\n typeof raw[index].description !== 'string'\n )\n throw new TypeError('Project question option description must be text.');\n return {\n ...option,\n ...(raw[index].recommended === undefined\n ? {}\n : { recommended: raw[index].recommended as boolean }),\n };\n });\n}\n\nexport function serializeQuestionOptions(\n value: readonly ProjectQuestionOption[],\n): string {\n return JSON.stringify(parseQuestionOptions(JSON.stringify(value)));\n}\n","import {\n field,\n SmrtPolymorphicAssociation,\n type SmrtPolymorphicAssociationOptions,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport type {\n ProjectContextReference,\n ProjectDecisionOption,\n ProjectDecisionStatus,\n ProjectGovernanceActorType,\n ProjectGovernanceVisibility,\n} from '../project-governance-types.js';\nimport {\n parseContextReferences,\n parseDecisionOptions,\n serializeContextReferences,\n serializeDecisionOptions,\n} from './project-governance-validation.js';\n\nexport interface ProjectDecisionOptions\n extends SmrtPolymorphicAssociationOptions {\n tenantId?: string;\n visibility?: ProjectGovernanceVisibility;\n question?: string;\n decisionOptions?: ProjectDecisionOption[] | string;\n outcome?: string;\n rationale?: string;\n status?: ProjectDecisionStatus;\n ownerType?: ProjectGovernanceActorType | '';\n ownerId?: string;\n contextReferences?: ProjectContextReference[] | string;\n revision?: number;\n decidedAt?: Date | null;\n}\n\n@TenantScoped({ mode: 'required' })\n@smrt({\n tableName: 'project_decisions',\n api: false,\n mcp: false,\n cli: false,\n indexes: [\n {\n name: 'project_decisions_project_status_idx',\n columns: ['tenantId', 'metaType', 'metaId', 'status', 'createdAt'],\n },\n {\n name: 'project_decisions_owner_status_idx',\n columns: ['tenantId', 'ownerType', 'ownerId', 'status'],\n },\n ],\n})\nexport class ProjectDecision extends SmrtPolymorphicAssociation { static __smrtPackage__ = \"@happyvertical/smrt-projects\";\n @tenantId()\n tenantId = '';\n\n @field({ required: true })\n question = '';\n\n /** JSON array; use getOptions()/setOptions(). */\n decisionOptions = '[]';\n\n outcome = '';\n\n rationale = '';\n\n @field({ required: true })\n status: ProjectDecisionStatus = 'open';\n\n ownerType: ProjectGovernanceActorType | '' = '';\n\n ownerId = '';\n\n visibility: ProjectGovernanceVisibility = 'internal';\n\n /** JSON array; use getContextReferences()/setContextReferences(). */\n contextReferences = '[]';\n\n revision = 1;\n\n @field({ type: 'datetime', nullable: true })\n decidedAt: Date | null = null;\n\n constructor(options: ProjectDecisionOptions = {}) {\n super({ ...options, role: 'decision' });\n if (options.visibility !== undefined) this.visibility = options.visibility;\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n if (options.question !== undefined) this.question = options.question;\n if (options.decisionOptions !== undefined) {\n this.decisionOptions = Array.isArray(options.decisionOptions)\n ? serializeDecisionOptions(options.decisionOptions)\n : options.decisionOptions;\n }\n if (options.outcome !== undefined) this.outcome = options.outcome;\n if (options.rationale !== undefined) this.rationale = options.rationale;\n if (options.status !== undefined) this.status = options.status;\n if (options.ownerType !== undefined) this.ownerType = options.ownerType;\n if (options.ownerId !== undefined) this.ownerId = options.ownerId;\n if (options.contextReferences !== undefined) {\n this.contextReferences = Array.isArray(options.contextReferences)\n ? serializeContextReferences(options.contextReferences)\n : options.contextReferences;\n }\n if (options.revision !== undefined) this.revision = options.revision;\n if (options.decidedAt !== undefined) this.decidedAt = options.decidedAt;\n }\n\n getOptions(): ProjectDecisionOption[] {\n return parseDecisionOptions(this.decisionOptions);\n }\n\n setOptions(value: ProjectDecisionOption[]): void {\n this.decisionOptions = serializeDecisionOptions(value);\n }\n\n getContextReferences(): ProjectContextReference[] {\n return parseContextReferences(this.contextReferences);\n }\n\n setContextReferences(value: ProjectContextReference[]): void {\n this.contextReferences = serializeContextReferences(value);\n }\n\n protected override async validateBeforeSave(): Promise<void> {\n this.question = this.question.trim();\n this.outcome = this.outcome.trim();\n this.rationale = this.rationale.trim();\n this.ownerId = this.ownerId.trim();\n if (!['internal', 'client'].includes(this.visibility))\n throw new TypeError('Invalid project governance visibility.');\n if (!this.question)\n throw new TypeError('Project decision question is required.');\n if (!['open', 'decided', 'deferred', 'superseded'].includes(this.status))\n throw new TypeError('Invalid project decision status.');\n if (this.ownerType && !['user', 'agent', 'system'].includes(this.ownerType))\n throw new TypeError('Invalid project decision owner type.');\n if ((this.ownerType && !this.ownerId) || (!this.ownerType && this.ownerId))\n throw new TypeError(\n 'Project decision owner type and id must be set together.',\n );\n const options = parseDecisionOptions(this.decisionOptions);\n if (this.status === 'decided' && !this.outcome)\n throw new TypeError('A decided project decision requires an outcome.');\n if (\n this.status === 'decided' &&\n options.length > 0 &&\n !options.some((option) => option.id === this.outcome)\n )\n throw new TypeError('Project decision outcome must match an option id.');\n if (!Number.isSafeInteger(this.revision) || this.revision < 1)\n throw new TypeError(\n 'Project decision revision must be a positive integer.',\n );\n this.decisionOptions = serializeDecisionOptions(options);\n this.contextReferences = serializeContextReferences(\n parseContextReferences(this.contextReferences),\n );\n await super.validateBeforeSave();\n }\n}\n","import { SmrtCollection } from '@happyvertical/smrt-core';\nimport {\n assertTenantReadAllowed,\n withTenant,\n} from '@happyvertical/smrt-tenancy';\nimport { ProjectDecision } from '../models/ProjectDecision.js';\nimport type {\n ProjectDecisionStatus,\n ProjectGovernanceScope,\n ProjectGovernanceVisibility,\n} from '../project-governance-types.js';\n\nexport class ProjectDecisionCollection extends SmrtCollection<ProjectDecision> {\n static readonly _itemClass = ProjectDecision;\n\n async listForProject(\n scope: ProjectGovernanceScope,\n status?: ProjectDecisionStatus,\n visibility?: ProjectGovernanceVisibility,\n ): Promise<ProjectDecision[]> {\n assertTenantReadAllowed(scope.tenantId, 'ProjectGovernanceCollection');\n return withTenant({ tenantId: scope.tenantId }, () =>\n this.list({\n where: {\n tenantId: scope.tenantId,\n metaType: scope.projectType,\n metaId: scope.projectId,\n ...(status ? { status } : {}),\n ...(visibility ? { visibility } : {}),\n },\n orderBy: 'createdAt ASC',\n }),\n );\n }\n\n async getForProject(\n scope: ProjectGovernanceScope,\n id: string,\n ): Promise<ProjectDecision | null> {\n assertTenantReadAllowed(scope.tenantId, 'ProjectGovernanceCollection');\n return withTenant({ tenantId: scope.tenantId }, () =>\n this.findOne({\n where: {\n id,\n tenantId: scope.tenantId,\n metaType: scope.projectType,\n metaId: scope.projectId,\n },\n }),\n );\n }\n}\n","import {\n field,\n SmrtPolymorphicAssociation,\n type SmrtPolymorphicAssociationOptions,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport type {\n ProjectGovernanceAction,\n ProjectGovernanceActorType,\n ProjectGovernanceRecordKind,\n ProjectQuestionAnswerSelection,\n} from '../project-governance-types.js';\n\nexport interface ProjectGovernanceEventOptions\n extends SmrtPolymorphicAssociationOptions {\n tenantId?: string;\n recordKind?: ProjectGovernanceRecordKind;\n action?: ProjectGovernanceAction;\n actorType?: ProjectGovernanceActorType;\n actorId?: string;\n fromStatus?: string;\n toStatus?: string;\n note?: string;\n value?: string;\n rationale?: string;\n answerSelection?: string;\n revision?: number;\n fromOwnerType?: ProjectGovernanceActorType | '';\n fromOwnerId?: string;\n toOwnerType?: ProjectGovernanceActorType | '';\n toOwnerId?: string;\n}\n\n@TenantScoped({ mode: 'required' })\n@smrt({\n tableName: 'project_governance_events',\n hooks: { beforeDelete: 'beforeDelete' },\n api: false,\n mcp: false,\n cli: false,\n indexes: [\n {\n name: 'project_governance_events_record_idx',\n columns: ['tenantId', 'metaType', 'metaId', 'createdAt'],\n },\n ],\n})\nexport class ProjectGovernanceEvent extends SmrtPolymorphicAssociation { static __smrtPackage__ = \"@happyvertical/smrt-projects\";\n @tenantId()\n tenantId = '';\n\n @field({ required: true })\n recordKind: ProjectGovernanceRecordKind = 'question';\n\n @field({ required: true })\n action: ProjectGovernanceAction = 'created';\n\n @field({ required: true })\n actorType: ProjectGovernanceActorType = 'system';\n\n @field({ required: true })\n actorId = '';\n\n fromStatus = '';\n\n @field({ required: true })\n toStatus = 'open';\n\n note = '';\n\n value = '';\n\n rationale = '';\n\n /** JSON answer snapshot; empty for events written before structured questions. */\n @field({ default: '' })\n answerSelection = '';\n\n revision = 1;\n\n fromOwnerType: ProjectGovernanceActorType | '' = '';\n fromOwnerId = '';\n toOwnerType: ProjectGovernanceActorType | '' = '';\n toOwnerId = '';\n\n constructor(options: ProjectGovernanceEventOptions = {}) {\n super({ ...options, role: 'history' });\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n if (options.recordKind !== undefined) this.recordKind = options.recordKind;\n if (options.action !== undefined) this.action = options.action;\n if (options.actorType !== undefined) this.actorType = options.actorType;\n if (options.actorId !== undefined) this.actorId = options.actorId;\n if (options.fromStatus !== undefined) this.fromStatus = options.fromStatus;\n if (options.toStatus !== undefined) this.toStatus = options.toStatus;\n if (options.note !== undefined) this.note = options.note;\n if (options.value !== undefined) this.value = options.value;\n if (options.answerSelection !== undefined)\n this.answerSelection = options.answerSelection;\n if (options.rationale !== undefined) this.rationale = options.rationale;\n if (options.revision !== undefined) this.revision = options.revision;\n if (options.fromOwnerType !== undefined)\n this.fromOwnerType = options.fromOwnerType;\n if (options.fromOwnerId !== undefined)\n this.fromOwnerId = options.fromOwnerId;\n if (options.toOwnerType !== undefined)\n this.toOwnerType = options.toOwnerType;\n if (options.toOwnerId !== undefined) this.toOwnerId = options.toOwnerId;\n }\n\n getAnswerSelection(): ProjectQuestionAnswerSelection | null {\n if (!this.answerSelection) return null;\n const value = JSON.parse(this.answerSelection);\n if (\n !value ||\n typeof value !== 'object' ||\n typeof value.answer !== 'string' ||\n !Number.isSafeInteger(value.expectedRevision) ||\n value.expectedRevision < 1 ||\n (value.selectedOptionId !== undefined &&\n typeof value.selectedOptionId !== 'string') ||\n (value.optionLabel !== undefined &&\n typeof value.optionLabel !== 'string') ||\n (value.idempotencyKey !== undefined &&\n typeof value.idempotencyKey !== 'string')\n )\n throw new TypeError('Invalid project question answer snapshot.');\n return value;\n }\n\n async beforeDelete(): Promise<void> {\n throw new TypeError('Project governance history is append-only.');\n }\n\n protected override async validateBeforeSave(): Promise<void> {\n if (this.isPersisted)\n throw new TypeError('Project governance history is append-only.');\n this.getAnswerSelection();\n this.actorId = this.actorId.trim();\n if (!this.actorId)\n throw new TypeError('Project governance event actor id is required.');\n if (!Number.isSafeInteger(this.revision) || this.revision < 1)\n throw new TypeError(\n 'Project governance event revision must be a positive integer.',\n );\n await super.validateBeforeSave();\n }\n}\n","import { SmrtCollection } from '@happyvertical/smrt-core';\nimport {\n assertTenantReadAllowed,\n withTenant,\n} from '@happyvertical/smrt-tenancy';\nimport { ProjectGovernanceEvent } from '../models/ProjectGovernanceEvent.js';\n\nexport class ProjectGovernanceEventCollection extends SmrtCollection<ProjectGovernanceEvent> {\n static readonly _itemClass = ProjectGovernanceEvent;\n\n async listForRecord(input: {\n tenantId: string;\n recordType: string;\n recordId: string;\n }): Promise<ProjectGovernanceEvent[]> {\n assertTenantReadAllowed(input.tenantId, 'ProjectGovernanceEventCollection');\n return withTenant({ tenantId: input.tenantId }, () =>\n this.list({\n where: {\n tenantId: input.tenantId,\n metaType: input.recordType,\n metaId: input.recordId,\n },\n orderBy: 'revision ASC',\n }),\n );\n }\n}\n","import {\n foreignKey,\n SmrtObject,\n type SmrtObjectOptions,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport type { ProjectIntegrationAuditAction } from '../types';\n\nexport interface ProjectIntegrationAuditOptions extends SmrtObjectOptions {\n tenantId?: string;\n integrationId?: string;\n action?: ProjectIntegrationAuditAction;\n note?: string | null;\n}\n\n@TenantScoped({ mode: 'required' })\n@smrt({\n tableName: 'project_integration_audits',\n api: false,\n mcp: false,\n cli: false,\n})\nexport class ProjectIntegrationAudit extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-projects\";\n @tenantId()\n tenantId: string = '';\n\n @foreignKey('ProjectIntegration', { required: true })\n integrationId: string = '';\n\n action: ProjectIntegrationAuditAction = 'created';\n\n note: string | null = null;\n\n constructor(options: ProjectIntegrationAuditOptions = {}) {\n super(options);\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n if (options.integrationId !== undefined)\n this.integrationId = options.integrationId;\n if (options.action !== undefined) this.action = options.action;\n if (options.note !== undefined) this.note = options.note;\n }\n}\n","import { SmrtCollection } from '@happyvertical/smrt-core';\nimport { withTenant } from '@happyvertical/smrt-tenancy';\nimport { ProjectIntegrationAudit } from '../models/ProjectIntegrationAudit';\n\nexport class ProjectIntegrationAuditCollection extends SmrtCollection<ProjectIntegrationAudit> {\n static readonly _itemClass = ProjectIntegrationAudit;\n\n async listForIntegration(\n tenantId: string,\n integrationId: string,\n ): Promise<ProjectIntegrationAudit[]> {\n return withTenant({ tenantId }, () =>\n this.list({\n where: { tenantId, integrationId },\n orderBy: 'createdAt ASC',\n }),\n );\n }\n}\n","import {\n field,\n SmrtObject,\n type SmrtObjectOptions,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport type {\n ProjectIntegrationCapability,\n ProjectIntegrationStatus,\n} from '../types';\n\nexport interface ProjectIntegrationOptions extends SmrtObjectOptions {\n tenantId?: string;\n projectId?: string;\n name?: string;\n credentialHash?: string;\n capabilities?: ProjectIntegrationCapability[];\n status?: ProjectIntegrationStatus;\n revokedAt?: Date | null;\n}\n\n@TenantScoped({ mode: 'required' })\n@smrt({\n tableName: 'project_integrations',\n conflictColumns: ['tenant_id', 'project_id', 'name'],\n api: { include: ['list', 'get'] },\n mcp: { include: ['list', 'get'] },\n cli: { include: ['list', 'get'] },\n})\nexport class ProjectIntegration extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-projects\";\n @tenantId()\n tenantId: string = '';\n\n projectId: string = '';\n\n name: string = '';\n\n @field({ sensitive: true })\n credentialHash: string = '';\n\n capabilities: ProjectIntegrationCapability[] = [];\n\n status: ProjectIntegrationStatus = 'active';\n\n revokedAt: Date | null = null;\n\n constructor(options: ProjectIntegrationOptions = {}) {\n super(options);\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n if (options.projectId !== undefined) this.projectId = options.projectId;\n if (options.name !== undefined) this.name = options.name;\n if (options.credentialHash !== undefined)\n this.credentialHash = options.credentialHash;\n if (options.capabilities !== undefined)\n this.capabilities = [...options.capabilities];\n if (options.status !== undefined) this.status = options.status;\n if (options.revokedAt !== undefined) this.revokedAt = options.revokedAt;\n }\n\n hasCapability(capability: ProjectIntegrationCapability): boolean {\n return this.capabilities.includes(capability);\n }\n\n isActive(): boolean {\n return this.status === 'active' && this.revokedAt === null;\n }\n}\n","import { createHash, randomBytes } from 'node:crypto';\nimport { SmrtCollection } from '@happyvertical/smrt-core';\nimport { withTenant } from '@happyvertical/smrt-tenancy';\nimport { ProjectIntegration } from '../models/ProjectIntegration';\nimport type { ProjectIntegrationCapability } from '../types';\nimport { ProjectIntegrationAuditCollection } from './ProjectIntegrationAudits';\n\nexport class ProjectIntegrationCollection extends SmrtCollection<ProjectIntegration> {\n static readonly _itemClass = ProjectIntegration;\n\n async provision(input: {\n tenantId: string;\n projectId: string;\n name: string;\n capabilities: ProjectIntegrationCapability[];\n }): Promise<{ integration: ProjectIntegration; credential: string }> {\n const credential = issueProjectIntegrationCredential(input.tenantId);\n const integration = await withTenant({ tenantId: input.tenantId }, () =>\n this.create({\n tenantId: input.tenantId,\n projectId: input.projectId,\n name: input.name,\n capabilities: [...input.capabilities],\n credentialHash: hashProjectIntegrationCredential(credential),\n status: 'active',\n revokedAt: null,\n }),\n );\n await withTenant({ tenantId: input.tenantId }, () => integration.save());\n await this.recordAudit(integration, 'created');\n return { integration, credential };\n }\n\n async rotate(\n tenantId: string,\n integrationId: string,\n ): Promise<{ integration: ProjectIntegration; credential: string }> {\n const integration = await this.requireActive(tenantId, integrationId);\n const credential = issueProjectIntegrationCredential(integration.tenantId);\n integration.credentialHash = hashProjectIntegrationCredential(credential);\n await withTenant({ tenantId: integration.tenantId }, () =>\n integration.save(),\n );\n await this.recordAudit(integration, 'rotated');\n return { integration, credential };\n }\n\n async revoke(\n tenantId: string,\n integrationId: string,\n ): Promise<ProjectIntegration> {\n const integration = await this.requireExisting(tenantId, integrationId);\n integration.status = 'revoked';\n integration.revokedAt = new Date();\n integration.credentialHash = '';\n await withTenant({ tenantId: integration.tenantId }, () =>\n integration.save(),\n );\n await this.recordAudit(integration, 'revoked');\n return integration;\n }\n\n async authenticate(credential: string): Promise<ProjectIntegration | null> {\n const tenantId = parseCredentialTenant(credential);\n if (!tenantId) return null;\n const credentialHash = hashProjectIntegrationCredential(credential);\n const integrations = await withTenant({ tenantId }, () =>\n this.list({ where: { tenantId, status: 'active' } }),\n );\n const integration = integrations.find(\n (candidate) => candidate.credentialHash === credentialHash,\n );\n return integration?.isActive() ? integration : null;\n }\n\n async listForProject(\n tenantId: string,\n projectId: string,\n ): Promise<ProjectIntegration[]> {\n return withTenant({ tenantId }, () =>\n this.list({\n where: { tenantId, projectId },\n orderBy: 'name ASC',\n }),\n );\n }\n\n async findActive(\n tenantId: string,\n integrationId: string,\n ): Promise<ProjectIntegration | null> {\n const integration = await withTenant({ tenantId }, () =>\n this.findOne({ where: { id: integrationId, tenantId } }),\n );\n return integration?.isActive() ? integration : null;\n }\n\n private async requireExisting(\n tenantId: string,\n integrationId: string,\n ): Promise<ProjectIntegration> {\n const integration = await withTenant({ tenantId }, () =>\n this.findOne({ where: { id: integrationId, tenantId } }),\n );\n if (!integration) {\n throw new Error(`ProjectIntegration ${integrationId} not found`);\n }\n return integration;\n }\n\n private async requireActive(\n tenantId: string,\n integrationId: string,\n ): Promise<ProjectIntegration> {\n const integration = await this.requireExisting(tenantId, integrationId);\n if (!integration.isActive()) {\n throw new Error(`ProjectIntegration ${integrationId} is not active`);\n }\n return integration;\n }\n\n private async recordAudit(\n integration: ProjectIntegration,\n action: 'created' | 'rotated' | 'revoked',\n ): Promise<void> {\n const audits = await ProjectIntegrationAuditCollection.create(this.options);\n const entry = await withTenant({ tenantId: integration.tenantId }, () =>\n audits.create({\n tenantId: integration.tenantId,\n integrationId: integration.id as string,\n action,\n }),\n );\n await withTenant({ tenantId: integration.tenantId }, () => entry.save());\n }\n}\n\nexport function hashProjectIntegrationCredential(credential: string): string {\n return createHash('sha256').update(credential).digest('hex');\n}\n\nfunction issueProjectIntegrationCredential(tenantId: string): string {\n const tenant = Buffer.from(tenantId, 'utf8').toString('base64url');\n return `smrt_pi_${tenant}_${randomBytes(24).toString('hex')}`;\n}\n\nfunction parseCredentialTenant(credential: string): string | null {\n const match = /^smrt_pi_([A-Za-z0-9_-]+)_[a-f0-9]{48}$/.exec(credential);\n if (!match) return null;\n try {\n const tenantId = Buffer.from(match[1], 'base64url').toString('utf8');\n return tenantId.length > 0 ? tenantId : null;\n } catch {\n return null;\n }\n}\n","import {\n field,\n SmrtPolymorphicAssociation,\n type SmrtPolymorphicAssociationOptions,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport type {\n ProjectContextReference,\n ProjectGovernanceActorType,\n ProjectGovernanceVisibility,\n ProjectQuestionOption,\n ProjectQuestionStatus,\n} from '../project-governance-types.js';\nimport {\n parseContextReferences,\n parseQuestionOptions,\n serializeContextReferences,\n serializeQuestionOptions,\n} from './project-governance-validation.js';\n\nexport interface ProjectQuestionOptions\n extends SmrtPolymorphicAssociationOptions {\n tenantId?: string;\n visibility?: ProjectGovernanceVisibility;\n prompt?: string;\n answer?: string;\n questionOptions?: ProjectQuestionOption[] | string;\n selectedOptionId?: string;\n status?: ProjectQuestionStatus;\n ownerType?: ProjectGovernanceActorType | '';\n ownerId?: string;\n contextReferences?: ProjectContextReference[] | string;\n revision?: number;\n answeredAt?: Date | null;\n}\n\n@TenantScoped({ mode: 'required' })\n@smrt({\n tableName: 'project_questions',\n api: false,\n mcp: false,\n cli: false,\n indexes: [\n {\n name: 'project_questions_project_status_idx',\n columns: ['tenantId', 'metaType', 'metaId', 'status', 'createdAt'],\n },\n {\n name: 'project_questions_owner_status_idx',\n columns: ['tenantId', 'ownerType', 'ownerId', 'status'],\n },\n ],\n})\nexport class ProjectQuestion extends SmrtPolymorphicAssociation { static __smrtPackage__ = \"@happyvertical/smrt-projects\";\n @tenantId()\n tenantId = '';\n\n @field({ required: true })\n prompt = '';\n\n answer = '';\n\n /** JSON authored choices; getOptions() includes implicit Other. */\n @field({ default: '[]' })\n questionOptions = '[]';\n\n @field({ default: '' })\n selectedOptionId = '';\n\n @field({ required: true })\n status: ProjectQuestionStatus = 'open';\n\n ownerType: ProjectGovernanceActorType | '' = '';\n\n ownerId = '';\n\n visibility: ProjectGovernanceVisibility = 'internal';\n\n /** JSON array; use getContextReferences()/setContextReferences(). */\n contextReferences = '[]';\n\n revision = 1;\n\n @field({ type: 'datetime', nullable: true })\n answeredAt: Date | null = null;\n\n constructor(options: ProjectQuestionOptions = {}) {\n super({ ...options, role: 'question' });\n if (options.visibility !== undefined) this.visibility = options.visibility;\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n if (options.prompt !== undefined) this.prompt = options.prompt;\n if (options.answer !== undefined) this.answer = options.answer;\n if (options.questionOptions !== undefined)\n this.questionOptions = Array.isArray(options.questionOptions)\n ? serializeQuestionOptions(options.questionOptions)\n : options.questionOptions;\n if (options.selectedOptionId !== undefined)\n this.selectedOptionId = options.selectedOptionId;\n if (options.status !== undefined) this.status = options.status;\n if (options.ownerType !== undefined) this.ownerType = options.ownerType;\n if (options.ownerId !== undefined) this.ownerId = options.ownerId;\n if (options.contextReferences !== undefined) {\n this.contextReferences = Array.isArray(options.contextReferences)\n ? serializeContextReferences(options.contextReferences)\n : options.contextReferences;\n }\n if (options.revision !== undefined) this.revision = options.revision;\n if (options.answeredAt !== undefined) this.answeredAt = options.answeredAt;\n }\n\n getOptions(): ProjectQuestionOption[] {\n const options = parseQuestionOptions(this.questionOptions);\n return options.length ? [...options, { id: 'other', label: 'Other' }] : [];\n }\n\n setOptions(value: ProjectQuestionOption[]): void {\n this.questionOptions = serializeQuestionOptions(value);\n }\n\n getContextReferences(): ProjectContextReference[] {\n return parseContextReferences(this.contextReferences);\n }\n\n setContextReferences(value: ProjectContextReference[]): void {\n this.contextReferences = serializeContextReferences(value);\n }\n\n protected override async validateBeforeSave(): Promise<void> {\n this.questionOptions = serializeQuestionOptions(\n parseQuestionOptions(this.questionOptions),\n );\n if (typeof this.selectedOptionId !== 'string')\n throw new TypeError('Project question selected option id must be text.');\n if (\n this.selectedOptionId &&\n !this.getOptions().some((option) => option.id === this.selectedOptionId)\n )\n throw new TypeError('Project question answer must match an option id.');\n this.prompt = this.prompt.trim();\n this.answer = this.answer.trim();\n this.ownerId = this.ownerId.trim();\n if (!['internal', 'client'].includes(this.visibility))\n throw new TypeError('Invalid project governance visibility.');\n if (!this.prompt)\n throw new TypeError('Project question prompt is required.');\n if (!['open', 'answered', 'deferred', 'superseded'].includes(this.status))\n throw new TypeError('Invalid project question status.');\n if (this.ownerType && !['user', 'agent', 'system'].includes(this.ownerType))\n throw new TypeError('Invalid project question owner type.');\n if ((this.ownerType && !this.ownerId) || (!this.ownerType && this.ownerId))\n throw new TypeError(\n 'Project question owner type and id must be set together.',\n );\n if (this.status === 'answered' && !this.answer)\n throw new TypeError('An answered project question requires an answer.');\n if (!Number.isSafeInteger(this.revision) || this.revision < 1)\n throw new TypeError(\n 'Project question revision must be a positive integer.',\n );\n this.contextReferences = serializeContextReferences(\n parseContextReferences(this.contextReferences),\n );\n await super.validateBeforeSave();\n }\n}\n","import { SmrtCollection } from '@happyvertical/smrt-core';\nimport {\n assertTenantReadAllowed,\n withTenant,\n} from '@happyvertical/smrt-tenancy';\nimport { ProjectQuestion } from '../models/ProjectQuestion.js';\nimport type {\n ProjectGovernanceScope,\n ProjectGovernanceVisibility,\n ProjectQuestionStatus,\n} from '../project-governance-types.js';\n\nexport class ProjectQuestionCollection extends SmrtCollection<ProjectQuestion> {\n static readonly _itemClass = ProjectQuestion;\n\n async listForProject(\n scope: ProjectGovernanceScope,\n status?: ProjectQuestionStatus,\n visibility?: ProjectGovernanceVisibility,\n ): Promise<ProjectQuestion[]> {\n assertTenantReadAllowed(scope.tenantId, 'ProjectGovernanceCollection');\n return withTenant({ tenantId: scope.tenantId }, () =>\n this.list({\n where: {\n tenantId: scope.tenantId,\n metaType: scope.projectType,\n metaId: scope.projectId,\n ...(status ? { status } : {}),\n ...(visibility ? { visibility } : {}),\n },\n orderBy: 'createdAt ASC',\n }),\n );\n }\n\n async getForProject(\n scope: ProjectGovernanceScope,\n id: string,\n ): Promise<ProjectQuestion | null> {\n assertTenantReadAllowed(scope.tenantId, 'ProjectGovernanceCollection');\n return withTenant({ tenantId: scope.tenantId }, () =>\n this.findOne({\n where: {\n id,\n tenantId: scope.tenantId,\n metaType: scope.projectType,\n metaId: scope.projectId,\n },\n }),\n );\n }\n}\n","import {\n field,\n SmrtPolymorphicAssociation,\n type SmrtPolymorphicAssociationOptions,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { validateCookbook } from '@happyvertical/smrt-core/cookbook';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport type { Cookbook } from '@happyvertical/smrt-types';\n\nexport interface ProjectSpecificationOptions\n extends SmrtPolymorphicAssociationOptions {\n tenantId?: string;\n title?: string;\n summary?: string;\n cookbook?: string;\n revision?: number;\n actorType?: string;\n actorId?: string;\n}\n\n/** Canonical project requirements and their portable application cookbook. */\n@TenantScoped({ mode: 'required' })\n@smrt({\n tableName: 'project_specifications',\n api: false,\n mcp: false,\n cli: false,\n conflictColumns: ['tenant_id', 'meta_type', 'meta_id'],\n})\nexport class ProjectSpecification extends SmrtPolymorphicAssociation { static __smrtPackage__ = \"@happyvertical/smrt-projects\";\n @tenantId()\n tenantId = '';\n @field({ required: true })\n title = '';\n summary = '';\n /** Canonical Cookbook v1 JSON; use getCookbook(). */\n cookbook = '{}';\n revision = 1;\n actorType = '';\n actorId = '';\n\n constructor(options: ProjectSpecificationOptions = {}) {\n super({ ...options, role: 'specification' });\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n if (options.title !== undefined) this.title = options.title;\n if (options.summary !== undefined) this.summary = options.summary;\n if (options.cookbook !== undefined) this.cookbook = options.cookbook;\n if (options.revision !== undefined) this.revision = options.revision;\n if (options.actorType !== undefined) this.actorType = options.actorType;\n if (options.actorId !== undefined) this.actorId = options.actorId;\n }\n\n getCookbook(): Cookbook {\n const result = validateCookbook(JSON.parse(this.cookbook));\n if (!result.ok) throw new TypeError(result.errors.join('; '));\n return result.cookbook;\n }\n\n protected override async validateBeforeSave(): Promise<void> {\n this.title = this.title.trim();\n if (!this.title)\n throw new TypeError('Project specification title is required.');\n if (!Number.isSafeInteger(this.revision) || this.revision < 1)\n throw new TypeError(\n 'Project specification revision must be a positive integer.',\n );\n if (\n !['user', 'agent', 'system'].includes(this.actorType) ||\n !this.actorId.trim()\n )\n throw new TypeError('Project specification actor is required.');\n this.cookbook = JSON.stringify(this.getCookbook());\n await super.validateBeforeSave();\n }\n}\n","import { SmrtCollection } from '@happyvertical/smrt-core';\nimport {\n assertTenantReadAllowed,\n withTenant,\n} from '@happyvertical/smrt-tenancy';\nimport { ProjectSpecification } from '../models/ProjectSpecification.js';\nimport type { ProjectGovernanceScope } from '../project-governance-types.js';\n\nexport class ProjectSpecificationCollection extends SmrtCollection<ProjectSpecification> {\n static readonly _itemClass = ProjectSpecification;\n\n async getForProject(\n scope: ProjectGovernanceScope,\n ): Promise<ProjectSpecification | null> {\n assertTenantReadAllowed(scope.tenantId, 'ProjectSpecificationCollection');\n return withTenant({ tenantId: scope.tenantId }, () =>\n this.findOne({\n where: {\n tenantId: scope.tenantId,\n metaType: scope.projectType,\n metaId: scope.projectId,\n },\n }),\n );\n }\n}\n","/**\n * Project model - SMRT wrapper for project board operations\n *\n * Provides persistent project tracking with provider-agnostic operations.\n * Uses @happyvertical/projects SDK for actual API calls.\n */\n\nimport { getProject } from '@happyvertical/projects';\nimport { getModuleConfig } from '@happyvertical/smrt-config';\nimport {\n field,\n SmrtObject,\n type SmrtObjectOptions,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport { SYNC_THROTTLE_MS } from '../constants';\nimport type {\n IProject,\n ItemFilters,\n ProjectField,\n ProjectItem,\n ProjectProviderType,\n ProjectStatus,\n SDKProject,\n SyncOptions,\n} from '../types';\nimport type { Issue } from './Issue';\nimport type { PullRequest } from './PullRequest';\n\nexport interface ProjectOptions extends SmrtObjectOptions {\n projectId?: string;\n projectNumber?: number;\n title?: string;\n description?: string;\n owner?: string;\n url?: string;\n providerType?: ProjectProviderType;\n tokenConfigKey?: string;\n statuses?: ProjectStatus[];\n fields?: ProjectField[];\n statusFieldId?: string;\n statusOptions?: Record<string, string>;\n tenantId?: string | null;\n}\n\n@TenantScoped({ mode: 'optional' })\n@smrt({\n api: { include: ['list', 'get', 'create', 'update'] },\n mcp: { include: ['list', 'get', 'sync', 'addItem', 'updateItemStatus'] },\n // sync/addItem/updateItemStatus/listItems are operator commands invoked\n // in-process via the CLI; they intentionally aren't exposed over HTTP today.\n cli: {\n include: [\n 'list',\n 'get',\n 'sync',\n 'addItem',\n 'updateItemStatus',\n 'listItems',\n ],\n skipApiCheck: true,\n },\n})\nexport class Project extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-projects\";\n /**\n * Tenant ID for multi-tenant isolation\n */\n @tenantId({ nullable: true })\n tenantId: string | null = null;\n\n /**\n * Provider-specific project ID (e.g., GitHub GraphQL node ID)\n */\n projectId: string = '';\n\n /**\n * Human-readable project number\n */\n projectNumber: number = 0;\n\n /**\n * Project title\n */\n @field({ description: \"The project's name.\" })\n title: string = '';\n\n /**\n * Project description\n */\n @field({ description: 'What the project is about.' })\n description: string = '';\n\n /**\n * Project owner (organization or user)\n */\n @field({ description: 'Who owns or runs the project.' })\n owner: string = '';\n\n /**\n * Project URL\n */\n @field({ description: 'A link to the project elsewhere.' })\n url: string = '';\n\n /**\n * Project provider type\n */\n providerType: ProjectProviderType = 'github';\n\n /**\n * Environment variable name or config key for token resolution\n */\n tokenConfigKey: string = 'GITHUB_TOKEN';\n\n /**\n * Available statuses (columns) in the project\n */\n statuses: ProjectStatus[] = [];\n\n /**\n * Custom fields defined in the project\n */\n fields: ProjectField[] = [];\n\n /**\n * Status field ID for GitHub Projects V2\n */\n statusFieldId: string = '';\n\n /**\n * Maps status name to option ID (for GitHub Projects V2)\n */\n statusOptions: Record<string, string> = {};\n\n /**\n * Last sync timestamp\n */\n lastSyncedAt: Date | null = null;\n\n /**\n * Transient: Cached project client (not persisted)\n */\n private _client?: IProject;\n\n constructor(options: ProjectOptions = {}) {\n super(options);\n if (options.projectId !== undefined) this.projectId = options.projectId;\n if (options.projectNumber !== undefined)\n this.projectNumber = options.projectNumber;\n if (options.title !== undefined) this.title = options.title;\n if (options.description !== undefined)\n this.description = options.description;\n if (options.owner !== undefined) this.owner = options.owner;\n if (options.url !== undefined) this.url = options.url;\n if (options.providerType !== undefined)\n this.providerType = options.providerType;\n if (options.tokenConfigKey !== undefined)\n this.tokenConfigKey = options.tokenConfigKey;\n if (options.statuses !== undefined) this.statuses = options.statuses;\n if (options.fields !== undefined) this.fields = options.fields;\n if (options.statusFieldId !== undefined)\n this.statusFieldId = options.statusFieldId;\n if (options.statusOptions !== undefined)\n this.statusOptions = options.statusOptions;\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n }\n\n /**\n * Get the project client, resolving token from config\n *\n * @returns Project client for API operations\n * @throws Error if token cannot be resolved\n */\n async getClient(): Promise<IProject> {\n if (this._client) {\n return this._client;\n }\n\n // Resolve token from environment or config\n const token =\n process.env[this.tokenConfigKey] ||\n (getModuleConfig<Record<string, string>>('smrt-projects', {})[\n this.tokenConfigKey\n ] as string);\n\n if (!token) {\n throw new Error(\n `Token not found for key '${this.tokenConfigKey}'. ` +\n `Set the ${this.tokenConfigKey} environment variable or configure it in smrt.config.`,\n );\n }\n\n this._client = await getProject({\n type: this.providerType,\n projectId: this.projectId,\n token,\n statusFieldId: this.statusFieldId || undefined,\n statusOptions:\n Object.keys(this.statusOptions).length > 0\n ? this.statusOptions\n : undefined,\n });\n\n return this._client;\n }\n\n /**\n * Clear the cached client\n */\n clearClient(): void {\n this._client = undefined;\n }\n\n /**\n * Sync project metadata from the provider\n *\n * @param options - Sync options\n * @returns This project with updated fields\n */\n async sync(options: SyncOptions = {}): Promise<this> {\n // Check if we recently synced (within 5 minutes)\n if (\n !options.force &&\n this.lastSyncedAt &&\n Date.now() - this.lastSyncedAt.getTime() < SYNC_THROTTLE_MS\n ) {\n return this;\n }\n\n const client = await this.getClient();\n const projectData: SDKProject = await client.getProject();\n\n // Update fields from remote\n this.title = projectData.title;\n this.description = projectData.description || '';\n this.owner = projectData.owner;\n this.url = projectData.url;\n this.statuses = projectData.statuses;\n this.fields = projectData.fields;\n this.lastSyncedAt = new Date();\n\n await this.save();\n return this;\n }\n\n /**\n * Add an issue or PR to this project\n *\n * @param item - Issue or PullRequest to add\n * @returns Created ProjectItem\n */\n async addItem(item: Issue | PullRequest): Promise<ProjectItem> {\n if (!item.nodeId) {\n throw new Error('Item must have a nodeId (sync the item first)');\n }\n\n const client = await this.getClient();\n return await client.addItem(item.nodeId);\n }\n\n /**\n * Remove an item from this project\n *\n * @param itemId - Project item ID to remove\n */\n async removeItem(itemId: string): Promise<void> {\n const client = await this.getClient();\n await client.removeItem(itemId);\n }\n\n /**\n * Get a specific item from the project\n *\n * @param itemId - Project item ID\n * @returns ProjectItem or null\n */\n async getItem(itemId: string): Promise<ProjectItem | null> {\n const client = await this.getClient();\n return await client.getItem(itemId);\n }\n\n /**\n * List items in this project\n *\n * @param filters - Optional filters\n * @returns Array of ProjectItems\n */\n async listItems(filters?: ItemFilters): Promise<ProjectItem[]> {\n const client = await this.getClient();\n return await client.listItems(filters);\n }\n\n /**\n * Update an item's status (column)\n *\n * @param itemId - Project item ID\n * @param status - New status name\n */\n async updateItemStatus(itemId: string, status: string): Promise<void> {\n const client = await this.getClient();\n await client.updateItemStatus(itemId, status);\n }\n\n /**\n * Update an item's custom field\n *\n * @param itemId - Project item ID\n * @param fieldId - Field ID\n * @param value - New value\n */\n async updateItemField(\n itemId: string,\n fieldId: string,\n value: unknown,\n ): Promise<void> {\n const client = await this.getClient();\n await client.updateItemField(itemId, fieldId, value);\n }\n\n /**\n * Get available statuses\n *\n * @returns Array of status definitions\n */\n async getStatuses(): Promise<ProjectStatus[]> {\n if (this.statuses.length > 0) {\n return this.statuses;\n }\n\n const client = await this.getClient();\n this.statuses = await client.listStatuses();\n await this.save();\n return this.statuses;\n }\n\n /**\n * Get available fields\n *\n * @returns Array of field definitions\n */\n async getFields(): Promise<ProjectField[]> {\n if (this.fields.length > 0) {\n return this.fields;\n }\n\n const client = await this.getClient();\n this.fields = await client.listFields();\n await this.save();\n return this.fields;\n }\n\n /**\n * Get items in a specific status/column\n *\n * @param status - Status name\n * @returns Array of ProjectItems in that status\n */\n async getItemsByStatus(status: string): Promise<ProjectItem[]> {\n return await this.listItems({ status });\n }\n\n /**\n * Move an item to a new status\n *\n * @param item - Issue or PullRequest\n * @param status - Target status name\n */\n async moveItem(item: Issue | PullRequest, status: string): Promise<void> {\n // First, find the item in the project\n const items = await this.listItems();\n const projectItem = items.find((i) => i.contentId === item.nodeId);\n\n if (!projectItem) {\n throw new Error('Item not found in project');\n }\n\n await this.updateItemStatus(projectItem.id, status);\n }\n\n /**\n * AI-powered: Analyze project health and suggest improvements\n *\n * @returns Analysis of project status\n */\n async analyzeHealth(): Promise<string> {\n const items = await this.listItems();\n const statuses = await this.getStatuses();\n\n // Count items by status\n const statusCounts: Record<string, number> = {};\n for (const status of statuses) {\n statusCounts[status.name] = items.filter(\n (i) => i.status === status.name,\n ).length;\n }\n\n return await this.do(\n `Analyze the health of this project board and suggest improvements.\n\n Project: ${this.title}\n Description: ${this.description}\n\n Item distribution by status:\n ${Object.entries(statusCounts)\n .map(([status, count]) => `- ${status}: ${count} items`)\n .join('\\n')}\n\n Total items: ${items.length}\n\n Provide:\n 1. Overall health assessment\n 2. Potential bottlenecks\n 3. Suggestions for improvement`,\n // Title/description/status counts hand-rolled above; skip do()'s\n // object-data injection so the board context is not duplicated.\n { includeData: false },\n );\n }\n\n /**\n * Get project by title\n *\n * @param title - Project title\n * @param options - Additional options\n * @returns Project or null\n */\n static async getByTitle(\n title: string,\n options: SmrtObjectOptions = {},\n ): Promise<Project | null> {\n const { ProjectCollection } = await import('../collections/Projects');\n const collection = await ProjectCollection.create(options);\n return await collection.findByTitle(title);\n }\n}\n","/**\n * ProjectCollection - Collection manager for Project objects\n *\n * Provides querying and discovery operations for Project entities.\n */\n\nimport { createLogger } from '@happyvertical/logger';\nimport { SmrtCollection } from '@happyvertical/smrt-core';\nimport { queryGlobal, queryWithGlobals } from '@happyvertical/smrt-tenancy';\nimport { Project } from '../models/Project';\nimport type { ProjectProviderType } from '../types';\n\nconst logger = createLogger({ level: 'info' });\n\nexport class ProjectCollection extends SmrtCollection<Project> {\n static readonly _itemClass = Project;\n\n /**\n * Find project by title\n *\n * @param title - Project title\n * @returns Project or null\n */\n async findByTitle(title: string): Promise<Project | null> {\n const results = await this.list({\n where: { title },\n limit: 1,\n });\n return results[0] || null;\n }\n\n /**\n * Find projects by owner\n *\n * @param owner - Project owner (organization or user)\n * @returns Array of projects\n */\n async findByOwner(owner: string): Promise<Project[]> {\n return await this.list({\n where: { owner },\n });\n }\n\n /**\n * Find projects by provider type\n *\n * @param providerType - Provider type\n * @returns Array of projects\n */\n async findByProvider(providerType: ProjectProviderType): Promise<Project[]> {\n return await this.list({\n where: { providerType },\n });\n }\n\n /**\n * Get or create a project by ID\n *\n * @param projectId - Provider-specific project ID\n * @param options - Additional options for creation\n * @returns Project (existing or newly created)\n */\n async getOrCreate(\n projectId: string,\n options: {\n title?: string;\n owner?: string;\n providerType?: ProjectProviderType;\n tokenConfigKey?: string;\n statusFieldId?: string;\n statusOptions?: Record<string, string>;\n } = {},\n ): Promise<Project> {\n let project = await this.findOne({\n where: { projectId },\n });\n\n if (!project) {\n project = await this.create({\n projectId,\n title: options.title || '',\n owner: options.owner || '',\n providerType: options.providerType || 'github',\n tokenConfigKey: options.tokenConfigKey || 'GITHUB_TOKEN',\n statusFieldId: options.statusFieldId || '',\n statusOptions: options.statusOptions || {},\n });\n await project.save();\n\n // Sync to get full project data\n await project.sync({ force: true });\n }\n\n return project;\n }\n\n /**\n * Sync all projects\n *\n * @param options - Sync options\n * @returns Array of synced projects\n */\n async syncAll(options: { force?: boolean } = {}): Promise<Project[]> {\n const projects = await this.list({});\n const synced: Project[] = [];\n\n for (const project of projects) {\n await project.sync(options);\n synced.push(project);\n }\n\n return synced;\n }\n\n /**\n * Find projects with items in a specific status\n *\n * @param status - Status name\n * @returns Array of projects\n */\n async findWithItemsInStatus(status: string): Promise<Project[]> {\n const projects = await this.list({});\n const matching: Project[] = [];\n\n for (const project of projects) {\n try {\n const items = await project.getItemsByStatus(status);\n if (items.length > 0) {\n matching.push(project);\n }\n } catch (error) {\n // Log error and skip projects we can't access\n logger.warn(`Error accessing items for project ${project.projectId}`, {\n error: error instanceof Error ? error.message : error,\n });\n }\n }\n\n return matching;\n }\n\n /**\n * Get project statistics\n *\n * @param projectId - Project ID\n * @returns Statistics object\n */\n async getStatistics(projectId: string): Promise<{\n totalItems: number;\n itemsByStatus: Record<string, number>;\n itemsByType: Record<string, number>;\n }> {\n const project = await this.findOne({ where: { projectId } });\n if (!project) {\n throw new Error(`Project ${projectId} not found`);\n }\n\n const items = await project.listItems();\n const statuses = await project.getStatuses();\n\n const itemsByStatus: Record<string, number> = {};\n for (const status of statuses) {\n itemsByStatus[status.name] = 0;\n }\n\n const itemsByType: Record<string, number> = {\n Issue: 0,\n PullRequest: 0,\n DraftIssue: 0,\n };\n\n for (const item of items) {\n if (item.status && itemsByStatus[item.status] !== undefined) {\n itemsByStatus[item.status]++;\n }\n if (itemsByType[item.type] !== undefined) {\n itemsByType[item.type]++;\n }\n }\n\n return {\n totalItems: items.length,\n itemsByStatus,\n itemsByType,\n };\n }\n\n /**\n * Find projects by tenant ID\n *\n * @param tenantId - Tenant ID to filter by\n * @returns Array of projects for the tenant\n */\n async findByTenant(tenantId: string): Promise<Project[]> {\n return this.list({ where: { tenantId } });\n }\n\n /**\n * Find all global projects (no tenant association).\n *\n * Routes through the shared tenant-global helper so it does not throw under\n * an active tenant context (an explicit `tenant_id IS NULL` filter would be\n * flagged as an isolation violation). (#1600)\n *\n * @returns Array of global projects\n */\n async findGlobal(): Promise<Project[]> {\n return queryGlobal<Project>(this);\n }\n\n /**\n * Find projects for a tenant plus all global projects.\n *\n * Fails closed if an active tenant context requests a different tenant's\n * rows; the admin/system path keeps the cross-tenant capability. (#1600)\n *\n * @param tenantId - Tenant ID to filter by\n * @returns Array of tenant and global projects\n */\n async findWithGlobals(tenantId: string): Promise<Project[]> {\n return queryWithGlobals<Project>(this, tenantId, 'Project.findWithGlobals');\n }\n}\n","/**\n * PullRequestCollection - Collection manager for PullRequest objects\n *\n * Provides querying and discovery operations for PullRequest entities.\n */\n\nimport { createLogger } from '@happyvertical/logger';\nimport { SmrtCollection } from '@happyvertical/smrt-core';\nimport { queryGlobal, queryWithGlobals } from '@happyvertical/smrt-tenancy';\nimport { PullRequest } from '../models/PullRequest';\nimport type { Repository } from '../models/Repository';\nimport type { SDKPullRequest, SearchFilters } from '../types';\n\nconst logger = createLogger({ level: 'info' });\n\nexport class PullRequestCollection extends SmrtCollection<PullRequest> {\n static readonly _itemClass = PullRequest;\n\n /**\n * Discover pull requests from a repository and sync to database\n *\n * @param options - Discovery options\n * @returns Array of PullRequest objects\n */\n async discover(options: {\n repository: Repository;\n filters?: SearchFilters;\n }): Promise<PullRequest[]> {\n const { repository, filters } = options;\n const repositoryId = repository.id ?? undefined;\n\n if (!repositoryId) {\n throw new Error(\n 'Repository must be saved before discovering pull requests',\n );\n }\n\n const repoClient = await repository.getClient();\n\n // Note: searchIssues with type filter would get PRs in GitHub\n // For now, we'll search for all and filter\n const remoteItems = await repoClient.searchIssues('is:pr', filters);\n\n const pullRequests: PullRequest[] = [];\n\n for (const remote of remoteItems) {\n // Get full PR data\n let prData: SDKPullRequest;\n try {\n prData = await repoClient.getPullRequest(remote.number);\n } catch (error) {\n // Log error and skip PR - could be rate limiting, auth, or access issues\n logger.warn(\n `Failed to fetch PR #${remote.number} from ${repository.owner}/${repository.name}`,\n { error: error instanceof Error ? error.message : error },\n );\n continue;\n }\n\n // Find existing PR by repository + number\n let pr = await this.findOne({\n where: {\n repositoryId,\n number: remote.number,\n },\n });\n\n if (!pr) {\n // Create new PR\n pr = await this.create({\n repositoryId,\n number: prData.number,\n nodeId: prData.id,\n title: prData.title,\n body: prData.body,\n state: prData.state,\n author: prData.author.login,\n labels: prData.labels.map((l) => l.name),\n assignees: prData.assignees.map((a) => a.login),\n commentsCount: prData.commentsCount,\n headRef: prData.headRef,\n baseRef: prData.baseRef,\n merged: prData.merged,\n mergedAt: prData.mergedAt || null,\n mergeable: prData.mergeable,\n draft: prData.draft,\n lastSyncedAt: new Date(),\n });\n } else {\n // Update existing PR\n pr.nodeId = prData.id;\n pr.title = prData.title;\n pr.body = prData.body;\n pr.state = prData.state;\n pr.author = prData.author.login;\n pr.labels = prData.labels.map((l) => l.name);\n pr.assignees = prData.assignees.map((a) => a.login);\n pr.commentsCount = prData.commentsCount;\n pr.headRef = prData.headRef;\n pr.baseRef = prData.baseRef;\n pr.merged = prData.merged;\n pr.mergedAt = prData.mergedAt || null;\n pr.mergeable = prData.mergeable;\n pr.draft = prData.draft;\n pr.lastSyncedAt = new Date();\n }\n\n await pr.save();\n pullRequests.push(pr);\n }\n\n return pullRequests;\n }\n\n /**\n * Find PRs by repository\n *\n * @param repositoryId - Repository ID\n * @returns Array of PRs\n */\n async findByRepository(repositoryId: string): Promise<PullRequest[]> {\n return await this.list({\n where: { repositoryId },\n });\n }\n\n /**\n * Find open PRs\n *\n * @param repositoryId - Optional repository filter\n * @returns Array of open PRs\n */\n async findOpen(repositoryId?: string): Promise<PullRequest[]> {\n const where: Record<string, unknown> = { state: 'open' };\n if (repositoryId) {\n where.repositoryId = repositoryId;\n }\n return await this.list({ where });\n }\n\n /**\n * Find draft PRs\n *\n * @param repositoryId - Optional repository filter\n * @returns Array of draft PRs\n */\n async findDrafts(repositoryId?: string): Promise<PullRequest[]> {\n const openPRs = await this.findOpen(repositoryId);\n return openPRs.filter((pr) => pr.draft);\n }\n\n /**\n * Find PRs ready to merge\n *\n * @param repositoryId - Optional repository filter\n * @returns Array of mergeable PRs\n */\n async findReadyToMerge(repositoryId?: string): Promise<PullRequest[]> {\n const openPRs = await this.findOpen(repositoryId);\n return openPRs.filter((pr) => !pr.draft && pr.mergeable);\n }\n\n /**\n * Find PRs by branch\n *\n * @param branch - Branch name (head or base)\n * @param repositoryId - Optional repository filter\n * @returns Array of PRs\n */\n async findByBranch(\n branch: string,\n repositoryId?: string,\n ): Promise<PullRequest[]> {\n const prs = await this.list({\n where: repositoryId ? { repositoryId } : {},\n });\n\n return prs.filter((pr) => pr.headRef === branch || pr.baseRef === branch);\n }\n\n /**\n * Find PR by number in a repository\n *\n * @param repositoryId - Repository ID\n * @param number - PR number\n * @returns PullRequest or null\n */\n async findByNumber(\n repositoryId: string,\n number: number,\n ): Promise<PullRequest | null> {\n const results = await this.list({\n where: { repositoryId, number },\n limit: 1,\n });\n return results[0] || null;\n }\n\n /**\n * Find PRs ready to merge (AI-powered)\n *\n * @param repositoryId - Optional repository filter\n * @returns Array of PRs that are ready\n */\n async findAIReadyToMerge(repositoryId?: string): Promise<PullRequest[]> {\n const openPRs = await this.findOpen(repositoryId);\n const ready: PullRequest[] = [];\n\n for (const pr of openPRs) {\n if (await pr.isReadyToMerge()) {\n ready.push(pr);\n }\n }\n\n return ready;\n }\n\n /**\n * Get PRs by change size\n *\n * @param size - Size classification\n * @param repositoryId - Optional repository filter\n * @returns Array of PRs\n */\n async findBySize(\n size: 'xs' | 's' | 'm' | 'l' | 'xl',\n repositoryId?: string,\n ): Promise<PullRequest[]> {\n const prs = await this.findOpen(repositoryId);\n return prs.filter((pr) => pr.getChangeSize() === size);\n }\n\n /**\n * Batch sync PRs from repository\n *\n * @param repository - Repository to sync from\n * @param options - Sync options\n * @returns Array of synced PRs\n */\n async batchSync(\n repository: Repository,\n options: { force?: boolean } = {},\n ): Promise<PullRequest[]> {\n const prs = await this.findByRepository(repository.id as string);\n const synced: PullRequest[] = [];\n\n for (const pr of prs) {\n await pr.sync(options);\n synced.push(pr);\n }\n\n return synced;\n }\n\n /**\n * Find pull requests by tenant ID\n *\n * @param tenantId - Tenant ID to filter by\n * @returns Array of pull requests for the tenant\n */\n async findByTenant(tenantId: string): Promise<PullRequest[]> {\n return this.list({ where: { tenantId } });\n }\n\n /**\n * Find all global pull requests (no tenant association).\n *\n * Routes through the shared tenant-global helper so it does not throw under\n * an active tenant context (an explicit `tenant_id IS NULL` filter would be\n * flagged as an isolation violation). (#1600)\n *\n * @returns Array of global pull requests\n */\n async findGlobal(): Promise<PullRequest[]> {\n return queryGlobal<PullRequest>(this);\n }\n\n /**\n * Find pull requests for a tenant plus all global pull requests.\n *\n * Fails closed if an active tenant context requests a different tenant's\n * rows; the admin/system path keeps the cross-tenant capability. (#1600)\n *\n * @param tenantId - Tenant ID to filter by\n * @returns Array of tenant and global pull requests\n */\n async findWithGlobals(tenantId: string): Promise<PullRequest[]> {\n return queryWithGlobals<PullRequest>(\n this,\n tenantId,\n 'PullRequest.findWithGlobals',\n );\n }\n}\n","/**\n * Repository model - SMRT wrapper for repository operations\n *\n * Provides persistent repository tracking with provider-agnostic operations.\n * Uses @happyvertical/repos SDK for actual API calls.\n */\n\nimport { getRepository } from '@happyvertical/repos';\nimport { getModuleConfig } from '@happyvertical/smrt-config';\nimport {\n ObjectRegistry,\n SmrtObject,\n type SmrtObjectOptions,\n smrt,\n toSnakeCase,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport { SYNC_THROTTLE_MS } from '../constants';\nimport { getScopedRepositoryClient } from '../repository-client-scope';\nimport type {\n CreateIssueInput,\n CreatePRInput,\n IRepository,\n RepositoryProviderType,\n SDKRepository,\n SearchFilters,\n SyncOptions,\n} from '../types';\nimport type { Issue } from './Issue';\nimport type { PullRequest } from './PullRequest';\n\nexport interface RepositoryOptions extends SmrtObjectOptions {\n owner?: string;\n name?: string;\n fullName?: string;\n description?: string;\n defaultBranch?: string;\n isPrivate?: boolean;\n providerType?: RepositoryProviderType;\n baseUrl?: string;\n tokenConfigKey?: string;\n tenantId?: string | null;\n}\n\n@TenantScoped({ mode: 'optional' })\n@smrt({\n api: { include: ['list', 'get', 'create', 'update'] },\n mcp: { include: ['list', 'get', 'sync'] },\n // sync is an operator command invoked in-process via the CLI;\n // it intentionally isn't exposed over HTTP today.\n cli: { include: ['list', 'get', 'sync', 'create'], skipApiCheck: true },\n})\nexport class Repository extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-projects\";\n /**\n * Tenant ID for multi-tenant isolation\n */\n @tenantId({ nullable: true })\n tenantId: string | null = null;\n\n /**\n * Repository owner (organization or user)\n */\n owner: string = '';\n\n /**\n * Repository name\n */\n name: string = '';\n\n /**\n * Full name in owner/repo format\n */\n fullName: string = '';\n\n /**\n * Repository description\n */\n description: string = '';\n\n /**\n * Default branch name\n */\n defaultBranch: string = 'main';\n\n /**\n * Whether repository is private\n */\n isPrivate: boolean = false;\n\n /**\n * Repository provider type\n */\n providerType: RepositoryProviderType = 'github';\n\n /**\n * Base URL for self-hosted instances (GitHub Enterprise, GitLab self-hosted, etc.)\n */\n baseUrl: string = '';\n\n /**\n * Environment variable name or config key for token resolution\n * The token is NOT stored - only the key name is persisted\n */\n tokenConfigKey: string = 'GITHUB_TOKEN';\n\n /**\n * Last sync timestamp\n */\n lastSyncedAt: Date | null = null;\n\n /**\n * Transient: Cached repository client (not persisted)\n */\n private _client?: IRepository;\n\n constructor(options: RepositoryOptions = {}) {\n super(options);\n if (options.owner !== undefined) this.owner = options.owner;\n if (options.name !== undefined) this.name = options.name;\n if (options.fullName !== undefined) this.fullName = options.fullName;\n if (options.description !== undefined)\n this.description = options.description;\n if (options.defaultBranch !== undefined)\n this.defaultBranch = options.defaultBranch;\n if (options.isPrivate !== undefined) this.isPrivate = options.isPrivate;\n if (options.providerType !== undefined)\n this.providerType = options.providerType;\n if (options.baseUrl !== undefined) this.baseUrl = options.baseUrl;\n if (options.tokenConfigKey !== undefined)\n this.tokenConfigKey = options.tokenConfigKey;\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n }\n\n /**\n * Get the repository client, resolving token from config\n *\n * Token resolution order:\n * 1. Environment variable matching tokenConfigKey\n * 2. Module config value matching tokenConfigKey\n *\n * @returns Repository client for API operations\n * @throws Error if token cannot be resolved\n */\n async getClient(): Promise<IRepository> {\n const scopedClient = getScopedRepositoryClient(this);\n if (scopedClient) {\n return scopedClient;\n }\n if (this._client) {\n return this._client;\n }\n\n // Resolve token from environment or config\n const token =\n process.env[this.tokenConfigKey] ||\n (getModuleConfig<Record<string, string>>('smrt-projects', {})[\n this.tokenConfigKey\n ] as string);\n\n if (!token) {\n throw new Error(\n `Token not found for key '${this.tokenConfigKey}'. ` +\n `Set the ${this.tokenConfigKey} environment variable or configure it in smrt.config.`,\n );\n }\n\n this._client = await getRepository({\n type: this.providerType,\n owner: this.owner,\n repo: this.name,\n token,\n baseUrl: this.baseUrl || undefined,\n });\n\n return this._client;\n }\n\n /**\n * Clear the cached client (useful after token refresh)\n */\n clearClient(): void {\n this._client = undefined;\n }\n\n /**\n * Sync repository metadata from the provider\n *\n * @param options - Sync options\n * @returns This repository with updated fields\n */\n async sync(options: SyncOptions = {}): Promise<this> {\n // Check if we recently synced (within 5 minutes)\n if (\n !options.force &&\n this.lastSyncedAt &&\n Date.now() - this.lastSyncedAt.getTime() < SYNC_THROTTLE_MS\n ) {\n return this;\n }\n\n const client = await this.getClient();\n const repoData: SDKRepository = await client.getRepository();\n\n // Update fields from remote\n this.owner = repoData.owner;\n this.name = repoData.name;\n this.fullName = `${repoData.owner}/${repoData.name}`;\n this.description = repoData.description;\n this.defaultBranch = repoData.defaultBranch;\n this.isPrivate = repoData.isPrivate;\n this.lastSyncedAt = new Date();\n\n await this.save();\n return this;\n }\n\n /**\n * Get issues from this repository\n *\n * @param filters - Optional search filters\n * @returns Array of Issue objects (SMRT models)\n */\n async getIssues(filters?: SearchFilters): Promise<Issue[]> {\n const { IssueCollection } = await import('../collections/Issues');\n const collection = await IssueCollection.create(this.options);\n return await collection.discover({ repository: this, filters });\n }\n\n /**\n * Get pull requests from this repository\n *\n * @param filters - Optional search filters\n * @returns Array of PullRequest objects (SMRT models)\n */\n async getPullRequests(filters?: SearchFilters): Promise<PullRequest[]> {\n const { PullRequestCollection } = await import(\n '../collections/PullRequests'\n );\n const collection = await PullRequestCollection.create(this.options);\n return await collection.discover({ repository: this, filters });\n }\n\n /**\n * Options for an issue or pull request created from this repository: the\n * database connection and tenant context, without any of this repository's\n * own columns (identity, timestamps, data). A repository loaded from the database holds its row's\n * `id`/`slug` in `this.options`; spread into a new issue they would give\n * every issue the repository's primary key and slug, so each save would\n * overwrite the previous issue.\n */\n private childOptions(): Record<string, unknown> {\n const rest = { ...(this.options as Record<string, unknown>) };\n // Every column of the repository's own row goes, not just a known few: a\n // loaded repository's `created_at` (or any other field) would otherwise\n // be copied onto each new issue.\n const ownKeys = new Set([\n 'id',\n 'slug',\n 'context',\n '_skipLoad',\n 'created_at',\n 'updated_at',\n 'createdAt',\n 'updatedAt',\n ]);\n for (const fieldName of ObjectRegistry.getFields(\n this.getResolvedQualifiedName(),\n ).keys()) {\n ownKeys.add(fieldName);\n ownKeys.add(toSnakeCase(fieldName));\n }\n // The tenant is context, not identity: issues belong to the\n // repository's tenant.\n ownKeys.delete('tenantId');\n ownKeys.delete('tenant_id');\n for (const key of ownKeys) delete rest[key];\n return rest;\n }\n\n /**\n * Create a new issue in this repository\n *\n * @param data - Issue creation data\n * @returns Created Issue (SMRT model)\n */\n async createIssue(data: CreateIssueInput): Promise<Issue> {\n const repositoryId = this.id ?? undefined;\n if (!repositoryId) {\n throw new Error('Repository must be saved before creating issues');\n }\n\n const client = await this.getClient();\n const created = await client.createIssue(data);\n\n // Create SMRT Issue from remote data\n const { Issue } = await import('./Issue');\n const issue = new Issue({\n ...this.childOptions(),\n repositoryId,\n number: created.number,\n nodeId: created.id,\n title: created.title,\n body: created.body,\n state: created.state,\n author: created.author.login,\n labels: created.labels.map((l) => l.name),\n assignees: created.assignees.map((a) => a.login),\n commentsCount: created.commentsCount,\n lastSyncedAt: new Date(),\n });\n\n // Directly-constructed models must be initialized before save() can access\n // the database connection (SmrtCollection.create() does this internally).\n await issue.initialize();\n await issue.save();\n return issue;\n }\n\n /**\n * Create a new pull request in this repository\n *\n * @param data - PR creation data\n * @returns Created PullRequest (SMRT model)\n */\n async createPullRequest(data: CreatePRInput): Promise<PullRequest> {\n const repositoryId = this.id ?? undefined;\n if (!repositoryId) {\n throw new Error('Repository must be saved before creating pull requests');\n }\n\n const client = await this.getClient();\n const created = await client.createPullRequest(data);\n\n // Create SMRT PullRequest from remote data\n const { PullRequest } = await import('./PullRequest');\n const pr = new PullRequest({\n ...this.childOptions(),\n repositoryId,\n number: created.number,\n nodeId: created.id,\n title: created.title,\n body: created.body,\n state: created.state,\n author: created.author.login,\n labels: created.labels.map((l) => l.name),\n assignees: created.assignees.map((a) => a.login),\n commentsCount: created.commentsCount,\n headRef: created.headRef,\n baseRef: created.baseRef,\n merged: created.merged,\n draft: created.draft,\n lastSyncedAt: new Date(),\n });\n\n // Directly-constructed models must be initialized before save() can access\n // the database connection (SmrtCollection.create() does this internally).\n await pr.initialize();\n await pr.save();\n return pr;\n }\n\n /**\n * Check if this repository has any open issues matching criteria\n *\n * @param criteria - Natural language description of what to check\n * @returns True if matching issues exist\n */\n async hasOpenIssuesMatching(criteria: string): Promise<boolean> {\n const issues = await this.getIssues({ state: 'open' });\n if (issues.length === 0) return false;\n\n return await this.is(\n `This repository has open issues matching: ${criteria}. ` +\n `Current open issues: ${issues.map((i) => `#${i.number}: ${i.title}`).join(', ')}`,\n );\n }\n\n /**\n * Generate a summary of repository activity\n *\n * @returns AI-generated summary\n */\n async summarizeActivity(): Promise<string> {\n const issues = await this.getIssues({ state: 'open', limit: 10 });\n const prs = await this.getPullRequests({ state: 'open', limit: 10 });\n\n return await this.do(\n `Summarize the current activity in this repository. ` +\n `Open issues: ${issues.map((i) => `#${i.number}: ${i.title}`).join(', ')}. ` +\n `Open PRs: ${prs.map((p) => `#${p.number}: ${p.title}`).join(', ')}.`,\n );\n }\n\n /**\n * Get repository by owner and name\n *\n * @param owner - Repository owner\n * @param name - Repository name\n * @param options - Additional options\n * @returns Repository or null if not found\n */\n static async getByFullName(\n owner: string,\n name: string,\n options: SmrtObjectOptions = {},\n ): Promise<Repository | null> {\n const { RepositoryCollection } = await import(\n '../collections/Repositories'\n );\n const collection = await RepositoryCollection.create(options);\n return await collection.findByFullName(owner, name);\n }\n}\n","/**\n * RepositoryCollection - Collection manager for Repository objects\n *\n * Provides querying and discovery operations for Repository entities.\n */\n\nimport { createLogger } from '@happyvertical/logger';\nimport { SmrtCollection } from '@happyvertical/smrt-core';\nimport { queryGlobal, queryWithGlobals } from '@happyvertical/smrt-tenancy';\nimport { Repository } from '../models/Repository';\nimport type { RepositoryProviderType } from '../types';\n\nconst logger = createLogger({ level: 'info' });\n\nexport class RepositoryCollection extends SmrtCollection<Repository> {\n static readonly _itemClass = Repository;\n\n /**\n * Find a repository by owner and name\n *\n * @param owner - Repository owner\n * @param name - Repository name\n * @returns Repository or null\n */\n async findByFullName(\n owner: string,\n name: string,\n ): Promise<Repository | null> {\n const results = await this.list({\n where: { owner, name },\n limit: 1,\n });\n return results[0] || null;\n }\n\n /**\n * Find repositories by owner\n *\n * @param owner - Repository owner\n * @returns Array of repositories\n */\n async findByOwner(owner: string): Promise<Repository[]> {\n return await this.list({\n where: { owner },\n });\n }\n\n /**\n * Find repositories by provider type\n *\n * @param providerType - Provider type\n * @returns Array of repositories\n */\n async findByProvider(\n providerType: RepositoryProviderType,\n ): Promise<Repository[]> {\n return await this.list({\n where: { providerType },\n });\n }\n\n /**\n * Get or create a repository by owner/name\n *\n * @param owner - Repository owner\n * @param name - Repository name\n * @param options - Additional options for creation\n * @returns Repository (existing or newly created)\n */\n async getOrCreate(\n owner: string,\n name: string,\n options: {\n providerType?: RepositoryProviderType;\n tokenConfigKey?: string;\n baseUrl?: string;\n } = {},\n ): Promise<Repository> {\n let repo = await this.findByFullName(owner, name);\n\n if (!repo) {\n repo = await this.create({\n owner,\n name,\n fullName: `${owner}/${name}`,\n providerType: options.providerType || 'github',\n tokenConfigKey: options.tokenConfigKey || 'GITHUB_TOKEN',\n baseUrl: options.baseUrl || '',\n });\n await repo.save();\n }\n\n return repo;\n }\n\n /**\n * Sync all repositories\n *\n * @param options - Sync options\n * @returns Array of synced repositories\n */\n async syncAll(options: { force?: boolean } = {}): Promise<Repository[]> {\n const repos = await this.list({});\n const synced: Repository[] = [];\n\n for (const repo of repos) {\n await repo.sync(options);\n synced.push(repo);\n }\n\n return synced;\n }\n\n /**\n * Find repositories with open issues\n *\n * @returns Array of repositories with at least one open issue\n */\n async findWithOpenIssues(): Promise<Repository[]> {\n const repos = await this.list({});\n const withIssues: Repository[] = [];\n\n for (const repo of repos) {\n try {\n const issues = await repo.getIssues({ state: 'open', limit: 1 });\n if (issues.length > 0) {\n withIssues.push(repo);\n }\n } catch (error) {\n // Log error and skip repos we can't access\n logger.warn(\n `Error accessing issues for repository ${repo.owner}/${repo.name}`,\n { error: error instanceof Error ? error.message : error },\n );\n }\n }\n\n return withIssues;\n }\n\n /**\n * Find repositories by tenant ID\n *\n * @param tenantId - Tenant ID to filter by\n * @returns Array of repositories for the tenant\n */\n async findByTenant(tenantId: string): Promise<Repository[]> {\n return this.list({ where: { tenantId } });\n }\n\n /**\n * Find all global repositories (no tenant association).\n *\n * Routes through the shared tenant-global helper so it does not throw under\n * an active tenant context (an explicit `tenant_id IS NULL` filter would be\n * flagged as an isolation violation). (#1600)\n *\n * @returns Array of global repositories\n */\n async findGlobal(): Promise<Repository[]> {\n return queryGlobal<Repository>(this);\n }\n\n /**\n * Find repositories for a tenant plus all global repositories.\n *\n * Fails closed if an active tenant context requests a different tenant's\n * rows; the admin/system path keeps the cross-tenant capability. (#1600)\n *\n * @param tenantId - Tenant ID to filter by\n * @returns Array of tenant and global repositories\n */\n async findWithGlobals(tenantId: string): Promise<Repository[]> {\n return queryWithGlobals<Repository>(\n this,\n tenantId,\n 'Repository.findWithGlobals',\n );\n }\n}\n","import {\n field,\n foreignKey,\n SmrtCollection,\n SmrtObject,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport type { AssistanceClassification, DeliveryEventType } from '../types.js';\n\nexport function parseProjectJson<T>(value: string, fallback: T): T {\n try {\n return JSON.parse(value) as T;\n } catch {\n return fallback;\n }\n}\n\nconst INTERNAL_SURFACES = {\n api: false,\n cli: false,\n mcp: false,\n} as const;\n\n/** Provider-neutral connection from a Development Request to canonical work. */\n@TenantScoped({ mode: 'required' })\n@smrt({\n tableName: 'development_request_work_links',\n conflictColumns: ['request_id', 'work_item_type', 'work_item_id'],\n ...INTERNAL_SURFACES,\n})\nexport class DevelopmentRequestWorkLink extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-projects\";\n @tenantId() tenantId: string = '';\n @foreignKey('DevelopmentRequest', { required: true }) requestId: string = '';\n @field({ type: 'text' }) workItemType: string = '';\n @field({ type: 'text' }) workItemId: string = '';\n @field({ type: 'text' }) canonicalStatus: string = '';\n @field({ type: 'text' }) providerRef: string = '';\n @field({ type: 'text' }) metadata: string = '{}';\n lastProjectedAt: Date | null = null;\n}\n\n/** Ordered, idempotent delivery update emitted by the control plane. */\n@TenantScoped({ mode: 'required' })\n@smrt({\n tableName: 'project_delivery_events',\n conflictColumns: ['integration_id', 'idempotency_key'],\n ...INTERNAL_SURFACES,\n})\nexport class ProjectDeliveryEvent extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-projects\";\n @tenantId() tenantId: string = '';\n @foreignKey('ProjectIntegration', { required: true })\n integrationId: string = '';\n @foreignKey('DevelopmentRequest', { required: true }) requestId: string = '';\n @field({ type: 'text' }) idempotencyKey: string = '';\n sequence: number = 0;\n @field({ type: 'text' }) type: DeliveryEventType = 'work_linked';\n @field({ type: 'text' }) payload: string = '{}';\n occurredAt: Date = new Date();\n deliveredAt: Date | null = null;\n deliveryAttempts: number = 0;\n @field({ type: 'text' }) lastDeliveryError: string = '';\n}\n\n/** Client decision state for one preview produced during delivery. */\n@TenantScoped({ mode: 'required' })\n@smrt({\n tableName: 'preview_approvals',\n conflictColumns: ['request_id', 'preview_id'],\n ...INTERNAL_SURFACES,\n})\nexport class PreviewApproval extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-projects\";\n @tenantId() tenantId: string = '';\n @foreignKey('DevelopmentRequest', { required: true }) requestId: string = '';\n @field({ type: 'text' }) previewId: string = '';\n @field({ type: 'text' }) previewUrl: string = '';\n @field({ type: 'text' }) status:\n | 'pending'\n | 'approved'\n | 'rejected'\n | 'stale' = 'pending';\n @field({ type: 'text' }) decidedByRef: string = '';\n @field({ type: 'text' }) reason: string = '';\n createdAt: Date = new Date();\n decidedAt: Date | null = null;\n staleAt: Date | null = null;\n}\n\n/** Lossless conversational intake before support/development classification. */\n@TenantScoped({ mode: 'required' })\n@smrt({ tableName: 'assistance_requests', ...INTERNAL_SURFACES })\nexport class AssistanceRequest extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-projects\";\n @tenantId() tenantId: string = '';\n @foreignKey('ProjectIntegration', { required: true })\n integrationId: string = '';\n @field({ type: 'text' }) requesterId: string = '';\n @field({ type: 'text' }) subject: string = '';\n @field({ type: 'text' }) applicationContext: string = '{}';\n @field({ type: 'text' }) conversation: string = '[]';\n @field({ type: 'text' }) evidence: string = '[]';\n @field({ type: 'text' }) classification: AssistanceClassification =\n 'unclassified';\n @field({ type: 'text' }) supportCaseId: string = '';\n @field({ type: 'text' }) developmentRequestId: string = '';\n deliveryHandoffLinkedAt: Date | null = null;\n createdAt: Date = new Date();\n}\n\n/** Append-only explanation of Assistance Request routing decisions. */\n@TenantScoped({ mode: 'required' })\n@smrt({ tableName: 'assistance_request_events', ...INTERNAL_SURFACES })\nexport class AssistanceRequestEvent extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-projects\";\n @tenantId() tenantId: string = '';\n @foreignKey('AssistanceRequest', { required: true })\n assistanceRequestId: string = '';\n @field({ type: 'text' }) priorClassification: AssistanceClassification =\n 'unclassified';\n @field({ type: 'text' }) resultingClassification: AssistanceClassification =\n 'unclassified';\n @field({ type: 'text' }) actorRef: string = '';\n @field({ type: 'text' }) reason: string = '';\n @field({ type: 'text' }) resultingLinks: string = '{}';\n occurredAt: Date = new Date();\n}\n\nexport class DevelopmentRequestWorkLinkCollection extends SmrtCollection<DevelopmentRequestWorkLink> {\n static readonly _itemClass = DevelopmentRequestWorkLink;\n}\nexport class ProjectDeliveryEventCollection extends SmrtCollection<ProjectDeliveryEvent> {\n static readonly _itemClass = ProjectDeliveryEvent;\n}\nexport class PreviewApprovalCollection extends SmrtCollection<PreviewApproval> {\n static readonly _itemClass = PreviewApproval;\n}\nexport class AssistanceRequestCollection extends SmrtCollection<AssistanceRequest> {\n static readonly _itemClass = AssistanceRequest;\n}\nexport class AssistanceRequestEventCollection extends SmrtCollection<AssistanceRequestEvent> {\n static readonly _itemClass = AssistanceRequestEvent;\n}\n","import type { SmrtClassOptions } from '@happyvertical/smrt-core';\nimport { withTenant } from '@happyvertical/smrt-tenancy';\nimport { DevelopmentRequestCollection } from '../collections/DevelopmentRequests.js';\nimport { ProjectIntegrationCollection } from '../collections/ProjectIntegrations.js';\nimport type { DevelopmentRequest } from '../models/DevelopmentRequest.js';\nimport {\n type PreviewApproval,\n PreviewApprovalCollection,\n type ProjectDeliveryEvent,\n ProjectDeliveryEventCollection,\n parseProjectJson,\n} from '../models/delivery-control-plane.js';\nimport type { ProjectIntegration } from '../models/ProjectIntegration.js';\nimport type { DeliveryEventType } from '../types.js';\nimport type { DevelopmentWorkAdapter } from './development-request-service.js';\n\nexport interface DeliveryEventSender {\n send(event: ProjectDeliveryEvent): Promise<void>;\n}\n\nexport interface ApprovalPolicy {\n canApprove(input: {\n integration: ProjectIntegration;\n requestId: string;\n previewId: string;\n }): Promise<boolean>;\n}\n\nexport class ProjectDeliveryService {\n constructor(\n private readonly integrations: ProjectIntegrationCollection,\n private readonly requests: DevelopmentRequestCollection,\n private readonly events: ProjectDeliveryEventCollection,\n private readonly approvals: PreviewApprovalCollection,\n private readonly workAdapter?: DevelopmentWorkAdapter,\n private readonly approvalPolicy?: ApprovalPolicy,\n ) {}\n\n static async create(\n options: SmrtClassOptions = {},\n dependencies: {\n workAdapter?: DevelopmentWorkAdapter;\n approvalPolicy?: ApprovalPolicy;\n } = {},\n ): Promise<ProjectDeliveryService> {\n const integrations = await ProjectIntegrationCollection.create(options);\n const sharedOptions = { ...options, db: integrations.db };\n const [requests, events, approvals] = await Promise.all([\n DevelopmentRequestCollection.create(sharedOptions),\n ProjectDeliveryEventCollection.create(sharedOptions),\n PreviewApprovalCollection.create(sharedOptions),\n ]);\n return new ProjectDeliveryService(\n integrations,\n requests,\n events,\n approvals,\n dependencies.workAdapter,\n dependencies.approvalPolicy,\n );\n }\n\n async record(input: {\n integration: ProjectIntegration;\n requestId: string;\n idempotencyKey: string;\n sequence: number;\n type: DeliveryEventType;\n payload: Record<string, unknown>;\n occurredAt?: Date;\n }): Promise<ProjectDeliveryEvent> {\n const integration = await requireActiveIntegrationCapability(\n this.integrations,\n input.integration,\n 'delivery:write',\n );\n if (!input.idempotencyKey.trim())\n throw new Error('Delivery event idempotencyKey is required.');\n const existing = (\n await withTenant({ tenantId: integration.tenantId }, () =>\n this.events.list({\n where: {\n integrationId: integration.id,\n idempotencyKey: input.idempotencyKey,\n },\n limit: 1,\n }),\n )\n )[0];\n if (existing) {\n await this.applySideEffects(integration, existing);\n return existing;\n }\n const request = await this.requestForIntegration(\n integration,\n input.requestId,\n );\n const event = await withTenant({ tenantId: integration.tenantId }, () =>\n this.events.create({\n tenantId: integration.tenantId,\n integrationId: requiredId(integration.id, 'Project Integration'),\n requestId: input.requestId,\n idempotencyKey: input.idempotencyKey,\n sequence: input.sequence,\n type: input.type,\n payload: JSON.stringify(input.payload),\n occurredAt: input.occurredAt ?? new Date(),\n }),\n );\n await withTenant({ tenantId: integration.tenantId }, () => event.save());\n await this.applySideEffects(integration, event, request);\n return event;\n }\n\n private async applySideEffects(\n integration: ProjectIntegration,\n event: ProjectDeliveryEvent,\n loadedRequest?: DevelopmentRequest,\n ): Promise<void> {\n const request =\n loadedRequest ??\n (await this.requestForIntegration(integration, event.requestId));\n const payload = parseProjectJson<Record<string, unknown>>(\n event.payload,\n {},\n );\n if (event.type === 'preview') await this.upsertPreview(request, payload);\n if (\n (event.type === 'completed' ||\n event.type === 'deployment' ||\n event.type === 'rejected') &&\n !(await this.isLatestTerminalEvent(event))\n )\n return;\n if (\n (event.type === 'completed' || event.type === 'deployment') &&\n request.status !== 'completed'\n )\n await this.requests.transitionStatus(request.tenantId, event.requestId, {\n status: 'completed',\n actorType: 'integration',\n actorId: integration.id ?? '',\n note: event.type,\n });\n if (event.type === 'rejected' && request.status !== 'declined')\n await this.requests.transitionStatus(request.tenantId, event.requestId, {\n status: 'declined',\n actorType: 'integration',\n actorId: integration.id ?? '',\n note: String(payload.reason ?? 'Delivery rejected'),\n });\n }\n\n async listForIntegration(\n integration: ProjectIntegration,\n requestId: string,\n ): Promise<ProjectDeliveryEvent[]> {\n const active = await requireActiveIntegrationCapability(\n this.integrations,\n integration,\n 'delivery:read',\n );\n await this.requestForIntegration(active, requestId);\n return withTenant({ tenantId: active.tenantId }, () =>\n this.events.list({\n where: { integrationId: active.id, requestId },\n orderBy: 'sequence ASC',\n }),\n );\n }\n\n async deliverPending(\n sender: DeliveryEventSender,\n tenantId: string,\n integrationId?: string,\n ): Promise<void> {\n const pending = await withTenant({ tenantId }, () =>\n this.events.list({\n where: integrationId\n ? { integrationId, deliveredAt: null }\n : { deliveredAt: null },\n orderBy: 'sequence ASC',\n }),\n );\n for (const event of pending) {\n const active = await this.integrations.findActive(\n tenantId,\n event.integrationId,\n );\n if (!active) continue;\n event.deliveryAttempts += 1;\n try {\n await sender.send(event);\n event.deliveredAt = new Date();\n event.lastDeliveryError = '';\n } catch (error) {\n event.lastDeliveryError =\n error instanceof Error ? error.message : String(error);\n }\n await withTenant({ tenantId }, () => event.save());\n }\n }\n\n async replay(\n sender: DeliveryEventSender,\n integration: ProjectIntegration,\n afterSequence = -1,\n ): Promise<void> {\n const active = await requireActiveIntegrationCapability(\n this.integrations,\n integration,\n 'delivery:read',\n );\n const events = (\n await withTenant({ tenantId: active.tenantId }, () =>\n this.events.list({\n where: { integrationId: active.id },\n orderBy: 'sequence ASC',\n }),\n )\n ).filter((event) => event.sequence > afterSequence);\n for (const event of events) await sender.send(event);\n }\n\n async decidePreview(\n integration: ProjectIntegration,\n preview: PreviewApproval,\n input: { approved: boolean; actorRef: string; reason: string },\n ): Promise<PreviewApproval> {\n const active = await requireActiveIntegrationCapability(\n this.integrations,\n integration,\n 'previews:approve',\n );\n if (preview.tenantId !== active.tenantId)\n throw new Error('Preview is outside this Project Integration tenant.');\n if (preview.status === 'stale')\n throw new Error('Stale previews cannot be approved.');\n if (preview.status !== 'pending') return preview;\n const request = await this.requestForIntegration(active, preview.requestId);\n if (\n this.approvalPolicy &&\n !(await this.approvalPolicy.canApprove({\n integration: active,\n requestId: preview.requestId,\n previewId: preview.previewId,\n }))\n )\n throw new Error('Preview approval denied by policy.');\n if (!this.workAdapter?.requestApproval)\n throw new Error('Control-plane approval adapter is not configured.');\n await this.workAdapter.requestApproval({\n request,\n previewId: preview.previewId,\n idempotencyKey: `preview-approval:${requiredId(preview.id, 'Preview Approval')}`,\n approved: input.approved,\n reason: input.reason,\n });\n preview.status = input.approved ? 'approved' : 'rejected';\n preview.decidedByRef = input.actorRef;\n preview.reason = input.reason;\n preview.decidedAt = new Date();\n await withTenant({ tenantId: active.tenantId }, () => preview.save());\n return preview;\n }\n\n async markPreviewStale(preview: PreviewApproval): Promise<PreviewApproval> {\n if (preview.status === 'pending') {\n preview.status = 'stale';\n preview.staleAt = new Date();\n await withTenant({ tenantId: preview.tenantId }, () => preview.save());\n }\n return preview;\n }\n\n private async requestForIntegration(\n integration: ProjectIntegration,\n requestId: string,\n ): Promise<DevelopmentRequest> {\n const request = await withTenant({ tenantId: integration.tenantId }, () =>\n this.requests.get({ id: requestId }),\n );\n if (\n !request ||\n request.integrationId !== integration.id ||\n request.projectId !== integration.projectId\n )\n throw new Error(\n 'Development Request is outside this Project Integration.',\n );\n return request;\n }\n\n private async isLatestTerminalEvent(\n event: ProjectDeliveryEvent,\n ): Promise<boolean> {\n const latest = (\n await withTenant({ tenantId: event.tenantId }, () =>\n this.events.list({\n where: {\n integrationId: event.integrationId,\n requestId: event.requestId,\n type: ['completed', 'deployment', 'rejected'],\n },\n orderBy: 'sequence DESC',\n limit: 1,\n }),\n )\n )[0];\n return !latest || latest.sequence <= event.sequence;\n }\n\n private async upsertPreview(\n request: DevelopmentRequest,\n payload: Record<string, unknown>,\n ): Promise<void> {\n const previewId = String(payload.previewId ?? '');\n if (!previewId) return;\n const existing = (\n await withTenant({ tenantId: request.tenantId }, () =>\n this.approvals.list({\n where: { requestId: request.id, previewId },\n limit: 1,\n }),\n )\n )[0];\n if (existing) return;\n const approval = await withTenant({ tenantId: request.tenantId }, () =>\n this.approvals.create({\n tenantId: request.tenantId,\n requestId: requiredId(request.id, 'Development Request'),\n previewId,\n previewUrl: String(payload.previewUrl ?? ''),\n status: 'pending',\n createdAt: new Date(),\n }),\n );\n await withTenant({ tenantId: request.tenantId }, () => approval.save());\n }\n}\n\nexport function requireIntegrationCapability(\n integration: ProjectIntegration,\n capability: string,\n): void {\n if (!integration.isActive())\n throw new Error('Project Integration is revoked.');\n if (!integration.hasCapability(capability))\n throw new Error(`Project Integration lacks capability '${capability}'.`);\n}\n\nexport async function requireActiveIntegrationCapability(\n integrations: ProjectIntegrationCollection,\n integration: Pick<ProjectIntegration, 'id' | 'tenantId'>,\n capability: string,\n): Promise<ProjectIntegration> {\n const integrationId = requiredId(integration.id, 'Project Integration');\n const active = await integrations.findActive(\n integration.tenantId,\n integrationId,\n );\n if (!active) throw new Error('Project Integration is revoked.');\n requireIntegrationCapability(active, capability);\n return active;\n}\n\nfunction requiredId(value: string | null | undefined, label: string): string {\n if (!value) throw new Error(`${label} must be saved.`);\n return value;\n}\n","import type { SmrtClassOptions } from '@happyvertical/smrt-core';\nimport { withTenant } from '@happyvertical/smrt-tenancy';\nimport { ProjectIntegrationCollection } from '../collections/ProjectIntegrations.js';\nimport { ProjectCollection } from '../collections/Projects.js';\nimport { ProjectIntegration } from '../models/ProjectIntegration.js';\nimport type { ProjectBoardMoveIntent } from '../project-board-types.js';\nimport { requireActiveIntegrationCapability } from './delivery-service.js';\n\nexport type { ProjectBoardMoveIntent } from '../project-board-types.js';\n\n/** Pure data returned after a provider-backed project board move. */\nexport interface ProjectBoardMoveResult {\n projectId: string;\n itemId: string;\n previousStatus: string | null;\n status: string;\n}\n\n/**\n * Capability-checked server boundary for project-board mutations.\n *\n * This service intentionally exposes neither provider credentials nor the\n * provider client. It reloads the supplied server-derived integration before\n * every mutation, verifies its project binding and capability, validates the\n * requested item and status against the authoritative Project, then delegates\n * persistence to Project.updateItemStatus().\n */\nexport class ProjectBoardService {\n constructor(\n private readonly integrations: ProjectIntegrationCollection,\n private readonly projects: ProjectCollection,\n ) {}\n\n static async create(\n options: SmrtClassOptions = {},\n ): Promise<ProjectBoardService> {\n const integrations = await ProjectIntegrationCollection.create(options);\n const projects = await ProjectCollection.create({\n ...options,\n db: integrations.db,\n });\n return new ProjectBoardService(integrations, projects);\n }\n\n async moveItem(\n integration: ProjectIntegration,\n input: ProjectBoardMoveIntent,\n ): Promise<ProjectBoardMoveResult> {\n const projectId = requiredInput(input.projectId, 'Project ID');\n const itemId = requiredInput(input.itemId, 'Project item ID');\n const status = requiredInput(input.status, 'Project status');\n const authorized = await this.requireAuthorizedIntegration(\n integration,\n projectId,\n );\n const project = await this.findProject(authorized.tenantId, projectId);\n if (!project) throw new Error('Project not found for this integration.');\n\n const statuses = await project.getStatuses();\n if (!statuses.some((candidate) => candidate.name === status)) {\n throw new Error(`Project status '${status}' is not available.`);\n }\n\n const item = (await project.listItems()).find(\n (candidate) => candidate.id === itemId,\n );\n if (!item) throw new Error('Project item not found.');\n\n // Reads can take long enough for a capability to be revoked. Revalidate\n // against canonical integration state immediately before the write.\n await this.requireAuthorizedIntegration(integration, projectId);\n await project.updateItemStatus(itemId, status);\n return {\n projectId,\n itemId,\n previousStatus: item.status ?? null,\n status,\n };\n }\n\n private async requireAuthorizedIntegration(\n integration: ProjectIntegration,\n projectId: string,\n ): Promise<ProjectIntegration> {\n if (!(integration instanceof ProjectIntegration)) {\n throw new Error(\n 'Project board moves require an authenticated Project Integration.',\n );\n }\n const active = await requireActiveIntegrationCapability(\n this.integrations,\n integration,\n 'projects:write',\n );\n if (active.projectId !== projectId) {\n throw new Error('Project is outside this Project Integration.');\n }\n return active;\n }\n\n private async findProject(tenantId: string, projectId: string) {\n const tenantProject = (\n await withTenant({ tenantId }, () =>\n this.projects.list({ where: { projectId, tenantId }, limit: 1 }),\n )\n )[0];\n if (tenantProject) return tenantProject;\n return (await this.projects.findGlobal()).find(\n (candidate) => candidate.projectId === projectId,\n );\n }\n}\n\nfunction requiredInput(value: string, label: string): string {\n if (!value?.trim()) throw new Error(`${label} is required.`);\n return value;\n}\n","import type { DatabaseInterface } from '@happyvertical/sql';\nimport { DevelopmentRequestCollection } from './collections/DevelopmentRequests';\nimport { ProjectIntegrationCollection } from './collections/ProjectIntegrations';\nimport type { ProjectIntegration } from './models/ProjectIntegration';\nimport {\n type ProjectBoardMoveIntent,\n ProjectBoardService,\n} from './services/project-board-service';\nimport type { ManagedDevelopmentRequestCreateInput } from './types';\n\nexport class ManagedProjectClient {\n readonly #db: DatabaseInterface;\n readonly #integration: ProjectIntegration;\n readonly #requesterId: string;\n\n private constructor(\n integration: ProjectIntegration,\n options: { db: DatabaseInterface; requesterId: string },\n ) {\n this.#integration = integration;\n this.#db = options.db;\n this.#requesterId = options.requesterId;\n }\n\n static async authenticate(\n credential: string,\n options: { db: DatabaseInterface; requesterId: string },\n ): Promise<ManagedProjectClient> {\n if (!options.requesterId.trim()) {\n throw new Error('Managed project client requires a stable requesterId');\n }\n const integrations = await ProjectIntegrationCollection.create({\n db: options.db,\n });\n const integration = await integrations.authenticate(credential);\n if (!integration) {\n throw new Error('Invalid or revoked project integration credential');\n }\n return new ManagedProjectClient(integration, options);\n }\n\n async createRequest(\n input: Omit<ManagedDevelopmentRequestCreateInput, 'requesterId'>,\n ) {\n const integration = await this.#requireCapability('requests:create');\n if (!input.description.trim()) {\n throw new Error('Managed request creation requires a description');\n }\n\n const requests = await DevelopmentRequestCollection.create({\n db: this.#db,\n });\n return requests.createManaged({\n ...input,\n tenantId: integration.tenantId,\n projectId: integration.projectId,\n integrationId: integration.id as string,\n requesterId: this.#requesterId,\n });\n }\n\n async listRequests() {\n const integration = await this.#requireCapability('requests:read-own');\n const requests = await DevelopmentRequestCollection.create({\n db: this.#db,\n });\n return requests.listByIntegrationRequester({\n tenantId: integration.tenantId,\n integrationId: integration.id as string,\n requesterId: this.#requesterId,\n });\n }\n\n /**\n * Move a project-board item through this authenticated integration.\n *\n * The browser submits only the move intent. This client keeps the credential\n * authentication boundary server-side and ProjectBoardService reloads active\n * capability state again immediately before the provider mutation.\n */\n async moveProjectBoardItem(input: ProjectBoardMoveIntent) {\n const integration = await this.#requireCapability('projects:write');\n const service = await ProjectBoardService.create({ db: this.#db });\n return service.moveItem(integration, input);\n }\n\n async #requireCapability(capability: string): Promise<ProjectIntegration> {\n const tenantId = this.#integration.tenantId;\n const integrationId = this.#integration.id;\n if (!tenantId || !integrationId) {\n throw new Error('Invalid or revoked project integration credential');\n }\n const integrations = await ProjectIntegrationCollection.create({\n db: this.#db,\n });\n const integration = await integrations.findActive(tenantId, integrationId);\n if (!integration) {\n throw new Error('Invalid or revoked project integration credential');\n }\n if (!integration.hasCapability(capability)) {\n throw new Error(\n `Managed project integration lacks required capability '${capability}'`,\n );\n }\n return integration;\n }\n}\n","/**\n * Projects money columns: floating-point major units → integer minor units.\n *\n * Ships as an explicit, opt-in migration rather than a schema-differ upgrade\n * because REAL→INTEGER is not information-preserving: an automatic\n * `ALTER … TYPE integer` would truncate `19.99` to `19`. The values have to be\n * rescaled by the currency's minor-unit factor during the type change (#2401).\n *\n * ```ts\n * console.log((await preflightProjectsMoneyMinorUnits(db)).summary);\n * await migrateProjectsMoneyToMinorUnits(db);\n * ```\n *\n * The two snapshot tables convert together: the delivery margin is\n * `charge - compensation`, so a half-converted pair produces a nonsense number\n * rather than an error.\n *\n * Both tables are immutable-on-save, and the immutability check compares a\n * stringified field snapshot. Rescaling changes those strings, which is\n * harmless — the snapshot is recomputed from the row on load — but it does mean\n * a row must not be mid-flight while the migration runs.\n *\n * On SQLite the values are rescaled but the declared type cannot change in\n * place; those columns come back in `declaredTypeChangePending` and need the\n * table-rebuild path (#2370).\n */\n\nimport {\n type DatabaseInterface,\n type MinorUnitsPreflightResult,\n type MinorUnitsRescaleResult,\n type MoneyColumnTarget,\n preflightMinorUnitsRescale,\n rescaleMoneyColumnsToMinorUnits,\n} from '@happyvertical/smrt-core/migrations';\n\n/** Marker recorded in `_smrt_backfills` once the rescale has run. */\nexport const PROJECTS_MONEY_MINOR_UNITS_BACKFILL =\n '@happyvertical/smrt-projects:money-minor-units:v1';\n\n/** Every projects money column that held major units before #2401. */\nexport const PROJECTS_MONEY_COLUMNS: MoneyColumnTarget[] = [\n { table: 'service_charge_snapshots', columns: ['amount'] },\n { table: 'service_compensation_snapshots', columns: ['amount'] },\n];\n\n/**\n * Report what {@link migrateProjectsMoneyToMinorUnits} would do, without\n * writing anything.\n */\nexport function preflightProjectsMoneyMinorUnits(\n db: DatabaseInterface,\n options: { scale?: number; engineHint?: string } = {},\n): Promise<MinorUnitsPreflightResult> {\n return preflightMinorUnitsRescale(db, PROJECTS_MONEY_COLUMNS, options);\n}\n\n/**\n * Convert every projects money column from floating-point major units to\n * integer minor units. Idempotent via a `_smrt_backfills` marker.\n *\n * @throws `MinorUnitsPreflightError` when a row would be rounded or would\n * overflow `int4` and `force` was not set.\n */\nexport function migrateProjectsMoneyToMinorUnits(\n db: DatabaseInterface,\n options: { scale?: number; engineHint?: string; force?: boolean } = {},\n): Promise<MinorUnitsRescaleResult> {\n return rescaleMoneyColumnsToMinorUnits(db, PROJECTS_MONEY_COLUMNS, {\n ...options,\n backfillName: PROJECTS_MONEY_MINOR_UNITS_BACKFILL,\n packageName: '@happyvertical/smrt-projects',\n });\n}\n","/**\n * Label model - SMRT wrapper for repository labels\n *\n * Represents a label that can be applied to issues and PRs.\n */\n\nimport {\n field,\n foreignKey,\n SmrtObject,\n type SmrtObjectOptions,\n smrt,\n} from '@happyvertical/smrt-core';\n\nexport interface LabelOptions extends SmrtObjectOptions {\n repositoryId?: string;\n projectId?: string;\n name?: string;\n color?: string;\n description?: string;\n}\n\n@smrt({\n api: { include: ['list', 'get', 'create', 'update', 'delete'] },\n mcp: { include: ['list', 'get', 'create'] },\n cli: { include: ['list', 'get', 'create', 'update', 'delete'] },\n})\nexport class Label extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-projects\";\n /**\n * Repository this label belongs to (optional; unset for project-scoped labels)\n */\n @foreignKey('Repository')\n repositoryId?: string;\n\n /**\n * Project this label is scoped to (optional; a label may be scoped to a\n * repository, a project, or neither)\n */\n @field({ description: 'The project this label belongs to.' })\n @foreignKey('Project')\n projectId?: string;\n\n /**\n * Label name\n */\n @field({ description: \"The label's name, for example bug.\" })\n name: string = '';\n\n /**\n * Label color (hex without #)\n */\n @field({ description: \"The label's colour.\" })\n color: string = '';\n\n /**\n * Label description\n */\n @field({ description: 'What the label means.' })\n description: string = '';\n\n constructor(options: LabelOptions = {}) {\n super(options);\n if (options.repositoryId !== undefined)\n this.repositoryId = options.repositoryId;\n if (options.projectId !== undefined) this.projectId = options.projectId;\n if (options.name !== undefined) this.name = options.name;\n if (options.color !== undefined) this.color = options.color;\n if (options.description !== undefined)\n this.description = options.description;\n }\n\n /**\n * Check if this is a type label (bug, feature, etc.)\n */\n isTypeLabel(): boolean {\n const typePatterns = [\n /^type:/i,\n /^kind:/i,\n /^bug$/i,\n /^feature$/i,\n /^enhancement$/i,\n /^docs$/i,\n /^chore$/i,\n ];\n return typePatterns.some((p) => p.test(this.name));\n }\n\n /**\n * Check if this is a priority label\n */\n isPriorityLabel(): boolean {\n const priorityPatterns = [\n /^p[0-4]$/i,\n /^priority:/i,\n /^critical$/i,\n /^high$/i,\n /^medium$/i,\n /^low$/i,\n ];\n return priorityPatterns.some((p) => p.test(this.name));\n }\n\n /**\n * Check if this is a status label\n */\n isStatusLabel(): boolean {\n const statusPatterns = [\n /^status:/i,\n /^wip$/i,\n /^in.?progress$/i,\n /^blocked$/i,\n /^needs.?review$/i,\n /^ready$/i,\n ];\n return statusPatterns.some((p) => p.test(this.name));\n }\n\n /**\n * Get the label category\n *\n * @returns Category name\n */\n getCategory(): 'type' | 'priority' | 'status' | 'area' | 'other' {\n if (this.isTypeLabel()) return 'type';\n if (this.isPriorityLabel()) return 'priority';\n if (this.isStatusLabel()) return 'status';\n if (this.name.includes(':')) return 'area';\n return 'other';\n }\n\n /**\n * Parse priority level from label name\n *\n * @returns Priority level 0-4 or null\n */\n getPriorityLevel(): number | null {\n const match = this.name.match(/p([0-4])/i);\n if (match) {\n return parseInt(match[1], 10);\n }\n if (/critical/i.test(this.name)) return 0;\n if (/high/i.test(this.name)) return 1;\n if (/medium/i.test(this.name)) return 2;\n if (/low/i.test(this.name)) return 3;\n return null;\n }\n\n /**\n * Get label with # prefix for hex color\n */\n getHexColor(): string {\n return this.color.startsWith('#') ? this.color : `#${this.color}`;\n }\n\n /**\n * Create a label in the repository\n */\n async createInRepository(): Promise<void> {\n if (!this.repositoryId) {\n throw new Error('Label must have a repositoryId');\n }\n\n const { RepositoryCollection } = await import(\n '../collections/Repositories'\n );\n const collection = await RepositoryCollection.create(this.options);\n const repo = await collection.get({ id: this.repositoryId });\n\n if (!repo) {\n throw new Error(`Repository ${this.repositoryId} not found`);\n }\n\n const client = await repo.getClient();\n await client.createLabel({\n name: this.name,\n color: this.color,\n description: this.description,\n });\n\n await this.save();\n }\n\n /**\n * Update this label in the repository\n */\n async updateInRepository(): Promise<void> {\n if (!this.repositoryId) {\n throw new Error('Label must have a repositoryId');\n }\n\n const { RepositoryCollection } = await import(\n '../collections/Repositories'\n );\n const collection = await RepositoryCollection.create(this.options);\n const repo = await collection.get({ id: this.repositoryId });\n\n if (!repo) {\n throw new Error(`Repository ${this.repositoryId} not found`);\n }\n\n const client = await repo.getClient();\n await client.updateLabel(this.name, {\n name: this.name,\n color: this.color,\n description: this.description,\n });\n\n await this.save();\n }\n}\n","export type ProjectQuestionStatus =\n | 'open'\n | 'answered'\n | 'deferred'\n | 'superseded';\n\nexport type ProjectDecisionStatus =\n | 'open'\n | 'decided'\n | 'deferred'\n | 'superseded';\n\nexport type ProjectGovernanceVisibility = 'internal' | 'client';\n\nexport type ProjectGovernanceActorType = 'user' | 'agent' | 'system';\n\nexport interface ProjectGovernanceActor {\n type: ProjectGovernanceActorType;\n id: string;\n /** Trusted host authorization. Managers may create, assign, defer, and supersede. */\n canManage?: boolean;\n}\n\nexport interface ProjectGovernanceScope {\n tenantId: string;\n /** Qualified SMRT class name for the host project's record type. */\n projectType: string;\n projectId: string;\n}\n\nexport type ProjectContextReferenceKind =\n | 'spec'\n | 'cookbook'\n | 'conversation'\n | 'asset'\n | 'url'\n | 'other';\n\nexport interface ProjectContextReference {\n kind: ProjectContextReferenceKind;\n ref: string;\n label?: string;\n}\n\nexport interface ProjectGovernanceOwner {\n type: ProjectGovernanceActorType;\n id: string;\n}\n\nexport interface ProjectQuestionCreateInput extends ProjectGovernanceScope {\n prompt: string;\n /** Single-choice suggestions; Other is supplied by the service. */\n options?: ProjectQuestionOption[];\n owner?: ProjectGovernanceOwner | null;\n contextReferences?: ProjectContextReference[];\n visibility?: ProjectGovernanceVisibility;\n actor: ProjectGovernanceActor;\n}\n\nexport interface ProjectDecisionOption {\n id: string;\n label: string;\n description?: string;\n}\n\nexport interface ProjectDecisionCreateInput extends ProjectGovernanceScope {\n question: string;\n options?: ProjectDecisionOption[];\n owner?: ProjectGovernanceOwner | null;\n contextReferences?: ProjectContextReference[];\n visibility?: ProjectGovernanceVisibility;\n actor: ProjectGovernanceActor;\n}\n\nexport type ProjectGovernanceRecordKind = 'question' | 'decision';\n\nexport type ProjectGovernanceAction =\n | 'created'\n | 'assigned'\n | 'answered'\n | 'decided'\n | 'deferred'\n | 'reopened'\n | 'superseded';\n\n/** Reserved identity for the always-available free-text choice. */\nexport const PROJECT_QUESTION_OTHER_OPTION_ID = 'other';\n\n/** Recommendation is display guidance only, never a selected answer. */\nexport interface ProjectQuestionOption extends ProjectDecisionOption {\n recommended?: boolean;\n}\n\n/** Immutable answer provenance; absent on historical free-text events. */\nexport interface ProjectQuestionAnswerSelection {\n answer: string;\n selectedOptionId?: string;\n optionLabel?: string;\n expectedRevision: number;\n idempotencyKey?: string;\n}\n","/**\n * Declared recipes for smrt-projects (#3590, #3604): user-facing units of\n * functionality an app or agent can pick instead of the whole package.\n * The scanner reads these statics into the `recipes` array of `manifest.json`\n * and `smrt-knowledge.json`; nothing here runs at that point.\n *\n * @packageDocumentation\n */\n\nimport { SmrtRecipe } from '@happyvertical/smrt-core';\nimport { Comment } from './models/Comment.js';\nimport { Issue } from './models/Issue.js';\nimport { Label } from './models/Label.js';\nimport { Project } from './models/Project.js';\n\n/** Projects: Track projects and the issues, labels and comments inside them. */\nexport class ProjectTrackerRecipe extends SmrtRecipe {\n static id = 'projects.tracker';\n static help = './tracker.recipe.md';\n static label = 'Projects';\n static summary =\n 'Track projects and the issues, labels and comments inside them.';\n static synonyms = ['issues', 'tasks', 'tickets', 'bugs', 'kanban'];\n static section = {\n id: 'projects',\n label: 'Projects',\n icon: 'briefcase',\n description: 'Projects, their issues, labels and comments.',\n };\n static models = [Project, Issue, Label, Comment];\n static nav = [\n {\n // Not \"Projects\": that is the section the recipe suggests.\n label: 'All projects',\n model: Project,\n icon: 'folder',\n description: 'Bigger jobs broken into steps you can follow.',\n },\n {\n label: 'Issues',\n model: Issue,\n icon: 'wrench',\n description: 'Problems and to-dos to track until they are done.',\n },\n {\n label: 'Labels',\n model: Label,\n icon: 'tag',\n description: 'Tags to sort your projects and issues your way.',\n },\n ];\n static options = {\n Project: {\n fields: {\n projectId: { visibility: 'hidden' },\n projectNumber: { visibility: 'hidden' },\n providerType: { visibility: 'hidden' },\n tokenConfigKey: { visibility: 'hidden' },\n statuses: { visibility: 'hidden' },\n fields: { visibility: 'hidden' },\n statusFieldId: { visibility: 'hidden' },\n statusOptions: { visibility: 'hidden' },\n lastSyncedAt: { visibility: 'hidden' },\n },\n },\n Issue: {\n fields: {\n nodeId: { visibility: 'hidden' },\n originalBody: { visibility: 'hidden' },\n synthesisCount: { visibility: 'hidden' },\n lastSyncedAt: { visibility: 'hidden' },\n commentsCount: { visibility: 'hidden' },\n repositoryId: { visibility: 'hidden' },\n number: { visibility: 'hidden' },\n },\n },\n Comment: {\n fields: {\n commentId: { visibility: 'hidden' },\n url: { visibility: 'hidden' },\n },\n },\n Label: { fields: { repositoryId: { visibility: 'hidden' } } },\n } as const;\n}\n","import type { SmrtClassOptions } from '@happyvertical/smrt-core';\nimport { withTenant } from '@happyvertical/smrt-tenancy';\nimport { DevelopmentRequestCollection } from '../collections/DevelopmentRequests.js';\nimport { ProjectIntegrationCollection } from '../collections/ProjectIntegrations.js';\nimport {\n type AssistanceRequest,\n AssistanceRequestCollection,\n AssistanceRequestEventCollection,\n} from '../models/delivery-control-plane.js';\nimport type { ProjectIntegration } from '../models/ProjectIntegration.js';\nimport type {\n AssistanceClassification,\n DevelopmentRequestEvidence,\n ManagedAssistanceRequestInput,\n} from '../types.js';\nimport { requireActiveIntegrationCapability } from './delivery-service.js';\n\nexport interface AssistanceSupportPort {\n openOrJoin(input: {\n assistanceRequestId: string;\n tenantId: string;\n projectId: string;\n requesterId: string;\n subject: string;\n conversation: Record<string, unknown>[];\n evidence: DevelopmentRequestEvidence[];\n applicationContext: Record<string, unknown>;\n }): Promise<{ caseId: string }>;\n /** Implementations must treat this handoff as idempotent. */\n linkDelivery?(input: {\n tenantId: string;\n caseId: string;\n developmentRequestId: string;\n }): Promise<void>;\n}\n\nexport class AssistanceRequestService {\n constructor(\n private readonly integrations: ProjectIntegrationCollection,\n private readonly development: DevelopmentRequestCollection,\n private readonly requests: AssistanceRequestCollection,\n private readonly events: AssistanceRequestEventCollection,\n private readonly support?: AssistanceSupportPort,\n ) {}\n\n static async create(\n options: SmrtClassOptions = {},\n dependencies: { support?: AssistanceSupportPort } = {},\n ): Promise<AssistanceRequestService> {\n const integrations = await ProjectIntegrationCollection.create(options);\n const sharedOptions = { ...options, db: integrations.db };\n const [development, requests, events] = await Promise.all([\n DevelopmentRequestCollection.create(sharedOptions),\n AssistanceRequestCollection.create(sharedOptions),\n AssistanceRequestEventCollection.create(sharedOptions),\n ]);\n return new AssistanceRequestService(\n integrations,\n development,\n requests,\n events,\n dependencies.support,\n );\n }\n\n async createRequest(\n integration: ProjectIntegration,\n input: ManagedAssistanceRequestInput,\n ): Promise<AssistanceRequest> {\n const active = await requireActiveIntegrationCapability(\n this.integrations,\n integration,\n 'assistance:create',\n );\n if (!input.requesterId.trim())\n throw new Error('Assistance Request requires a stable requesterId.');\n if (!input.subject.trim())\n throw new Error('Assistance Request subject is required.');\n const request = await withTenant({ tenantId: active.tenantId }, () =>\n this.requests.create({\n tenantId: active.tenantId,\n integrationId: requiredId(active.id, 'Project Integration'),\n requesterId: input.requesterId,\n subject: input.subject.trim(),\n applicationContext: JSON.stringify(input.applicationContext ?? {}),\n conversation: JSON.stringify(input.conversation ?? []),\n evidence: JSON.stringify(input.evidence ?? []),\n classification: 'unclassified',\n createdAt: new Date(),\n }),\n );\n await withTenant({ tenantId: active.tenantId }, () => request.save());\n return request;\n }\n\n async classify(\n integration: ProjectIntegration,\n request: AssistanceRequest,\n input: {\n classification: Exclude<AssistanceClassification, 'unclassified'>;\n actorRef: string;\n reason: string;\n developmentType?: string;\n },\n ): Promise<AssistanceRequest> {\n const active = await requireActiveIntegrationCapability(\n this.integrations,\n integration,\n 'assistance:create',\n );\n if (\n request.integrationId !== active.id ||\n request.tenantId !== active.tenantId\n )\n throw new Error(\n 'Assistance Request is outside this Project Integration.',\n );\n if (!input.reason.trim())\n throw new Error('Classification reason is required.');\n const prior = request.classification;\n\n if (\n (input.classification === 'support' || input.classification === 'both') &&\n !request.supportCaseId\n ) {\n if (!this.support)\n throw new Error('Support routing port is not configured.');\n const result = await this.support.openOrJoin({\n assistanceRequestId: requiredId(request.id, 'Assistance Request'),\n tenantId: request.tenantId,\n projectId: active.projectId,\n requesterId: request.requesterId,\n subject: request.subject,\n conversation: parseArray(request.conversation),\n evidence: parseEvidence(request.evidence),\n applicationContext: parseObject(request.applicationContext),\n });\n request.supportCaseId = result.caseId;\n }\n\n if (\n (input.classification === 'development' ||\n input.classification === 'both') &&\n !request.developmentRequestId\n ) {\n const integrationId = requiredId(active.id, 'Project Integration');\n const origin = `assistance:${requiredId(request.id, 'Assistance Request')}`;\n const existing = (\n await withTenant({ tenantId: active.tenantId }, () =>\n this.development.list({\n where: {\n tenantId: active.tenantId,\n projectId: active.projectId,\n integrationId,\n origin,\n },\n orderBy: 'createdAt ASC',\n limit: 1,\n }),\n )\n )[0];\n const developmentRequest =\n existing ??\n (await this.development.createManaged({\n tenantId: active.tenantId,\n projectId: active.projectId,\n integrationId,\n requesterId: request.requesterId,\n type: input.developmentType ?? 'task',\n description:\n conversationText(request.conversation) || request.subject,\n evidence: parseEvidence(request.evidence),\n origin,\n discussion: input.reason,\n visibility: 'requester',\n }));\n request.developmentRequestId = developmentRequest.id ?? '';\n }\n\n if (\n input.classification === 'both' &&\n request.supportCaseId &&\n request.developmentRequestId &&\n !request.deliveryHandoffLinkedAt &&\n this.support?.linkDelivery\n ) {\n await this.support.linkDelivery({\n tenantId: request.tenantId,\n caseId: request.supportCaseId,\n developmentRequestId: request.developmentRequestId,\n });\n request.deliveryHandoffLinkedAt = new Date();\n }\n\n request.classification = input.classification;\n await withTenant({ tenantId: request.tenantId }, () => request.save());\n const event = await withTenant({ tenantId: request.tenantId }, () =>\n this.events.create({\n tenantId: request.tenantId,\n assistanceRequestId: requiredId(request.id, 'Assistance Request'),\n priorClassification: prior,\n resultingClassification: input.classification,\n actorRef: input.actorRef,\n reason: input.reason,\n resultingLinks: JSON.stringify({\n supportCaseId: request.supportCaseId || null,\n developmentRequestId: request.developmentRequestId || null,\n }),\n occurredAt: new Date(),\n }),\n );\n await withTenant({ tenantId: request.tenantId }, () => event.save());\n return request;\n }\n}\n\nfunction parseArray(value: string): Record<string, unknown>[] {\n try {\n const parsed = JSON.parse(value) as unknown;\n return Array.isArray(parsed)\n ? parsed.filter(\n (item): item is Record<string, unknown> =>\n Boolean(item) && typeof item === 'object' && !Array.isArray(item),\n )\n : [];\n } catch {\n return [];\n }\n}\n\nfunction parseObject(value: string): Record<string, unknown> {\n try {\n const parsed = JSON.parse(value) as unknown;\n return parsed && typeof parsed === 'object' && !Array.isArray(parsed)\n ? (parsed as Record<string, unknown>)\n : {};\n } catch {\n return {};\n }\n}\n\nfunction parseEvidence(value: string): DevelopmentRequestEvidence[] {\n return parseArray(value)\n .map((item) => ({\n url: typeof item.url === 'string' ? item.url : '',\n ...(typeof item.label === 'string' ? { label: item.label } : {}),\n }))\n .filter((item) => item.url.length > 0);\n}\n\nfunction conversationText(value: string): string {\n return parseArray(value)\n .map((message) => String(message.body ?? message.text ?? ''))\n .filter(Boolean)\n .join('\\n\\n');\n}\n\nfunction requiredId(value: string | null | undefined, label: string): string {\n if (!value) throw new Error(`${label} must be saved.`);\n return value;\n}\n","import { createHash } from 'node:crypto';\nimport type { SmrtClassOptions } from '@happyvertical/smrt-core';\nimport {\n assertTenantReadAllowed,\n withTenant,\n} from '@happyvertical/smrt-tenancy';\nimport { DevelopmentRequestCollection } from '../collections/DevelopmentRequests.js';\nimport type { DevelopmentRequest } from '../models/DevelopmentRequest.js';\nimport type {\n DevelopmentRequestEvidence,\n DevelopmentRequestVisibility,\n} from '../types.js';\n\nexport interface ParticipantDevelopmentRequestInput {\n tenantId: string;\n projectId: string;\n /** Trusted identity supplied after the host authorizes project participation. */\n requesterId: string;\n requestKey: string;\n type: 'bug' | 'feature' | 'task';\n description: string;\n visibility?: DevelopmentRequestVisibility;\n}\n\nexport class ParticipantDevelopmentRequestConflictError extends Error {\n constructor() {\n super(\n 'This request key has already been used for different request details.',\n );\n this.name = 'ParticipantDevelopmentRequestConflictError';\n }\n}\n\n/** Human participant intake, separate from credential-authenticated managed ingress. */\nexport class ParticipantDevelopmentRequestService {\n private constructor(\n private readonly requests: DevelopmentRequestCollection,\n ) {}\n\n static async create(\n options: SmrtClassOptions = {},\n ): Promise<ParticipantDevelopmentRequestService> {\n return new ParticipantDevelopmentRequestService(\n await DevelopmentRequestCollection.create(options),\n );\n }\n\n async submit(\n input: ParticipantDevelopmentRequestInput,\n ): Promise<DevelopmentRequest> {\n return this.persist(input, {\n participantId: input.requesterId,\n evidence: [],\n origin: 'participant',\n discussion: '',\n actorId: input.requesterId,\n actorType: 'participant',\n });\n }\n\n /** Trusted internal triage path; the host must authorize the supplied actor. */\n async splitFrom(\n parent: DevelopmentRequest,\n input: {\n type: 'bug' | 'feature' | 'task';\n description: string;\n actorRef: string;\n reason: string;\n /** Duplicate occurrence within identical type/description parts, independent of list order. */\n occurrence: number;\n },\n ): Promise<DevelopmentRequest> {\n if (\n !parent.id ||\n parent.integrationId ||\n !input.actorRef.trim() ||\n !input.reason.trim() ||\n !Number.isSafeInteger(input.occurrence) ||\n input.occurrence < 0\n ) {\n throw new TypeError(\n 'A participant parent and trusted triage actor are required.',\n );\n }\n const description = input.description.trim();\n const requestKey = stableId(\n JSON.stringify([\n 'split',\n parent.id,\n input.type,\n description,\n input.occurrence,\n ]),\n );\n return this.persist(\n {\n tenantId: parent.tenantId,\n projectId: parent.projectId,\n requesterId: parent.requesterId,\n requestKey,\n type: input.type,\n description,\n visibility: parent.visibility,\n },\n {\n participantId: parent.participantId,\n evidence: parent.getEvidence(),\n origin: `split:${parent.id}`,\n discussion: input.reason,\n actorId: input.actorRef,\n actorType: 'system',\n },\n );\n }\n\n private async persist(\n input: ParticipantDevelopmentRequestInput,\n provenance: {\n participantId: string;\n evidence: DevelopmentRequestEvidence[];\n origin: string;\n discussion: string;\n actorId: string;\n actorType: 'participant' | 'system';\n },\n ): Promise<DevelopmentRequest> {\n for (const value of [\n input.tenantId,\n input.projectId,\n input.requesterId,\n input.requestKey,\n ]) {\n if (typeof value !== 'string' || !value.trim() || value.length > 200) {\n throw new TypeError(\n 'A tenant, project, participant and request key are required.',\n );\n }\n }\n assertTenantReadAllowed(\n input.tenantId,\n 'ParticipantDevelopmentRequestService',\n );\n if (!['bug', 'feature', 'task'].includes(input.type))\n throw new TypeError('Choose a valid request type.');\n const description = input.description?.trim();\n if (!description || description.length > 8000)\n throw new TypeError('Describe the request in at most 8000 characters.');\n const visibility = input.visibility ?? 'requester';\n if (\n ![\n 'requester',\n 'project_team',\n 'workspace',\n 'public',\n 'internal',\n ].includes(visibility)\n ) {\n throw new TypeError('Choose a valid request visibility.');\n }\n const evidence = JSON.stringify(provenance.evidence);\n const identity = JSON.stringify([\n input.tenantId,\n input.projectId,\n input.requesterId,\n provenance.origin,\n input.requestKey,\n ]);\n const id = stableId(`participant-request:${identity}`);\n const historyId = stableId(`participant-request-history:${identity}`);\n const db = this.requests.db;\n if (!db.transaction)\n throw new Error('Participant request intake requires transactions.');\n const transaction = db.transaction.bind(db);\n return withTenant({ tenantId: input.tenantId }, () =>\n transaction(async (tx) => {\n // Primary-key conflict serialization protects concurrent retries across runtimes.\n // Never UPSERT mutable payload: a reused key cannot replace accepted work.\n await tx.query(\n `INSERT INTO development_requests\n (id, slug, context, tenant_id, project_id, integration_id, requester_id,\n participant_id, type, description, evidence, visibility, origin, discussion, status)\n VALUES (?, ?, ?, ?, ?, NULL, ?, ?, ?, ?, ?, ?, ?, ?, 'submitted')\n ON CONFLICT (id) DO NOTHING`,\n id,\n `participant-${id}`,\n '',\n input.tenantId,\n input.projectId,\n input.requesterId,\n provenance.participantId,\n input.type,\n description,\n evidence,\n visibility,\n provenance.origin,\n provenance.discussion,\n );\n const requests = await DevelopmentRequestCollection.create({ db: tx });\n const request = await requests.findOne({\n where: { id, tenantId: input.tenantId, projectId: input.projectId },\n });\n if (\n !request ||\n request.requesterId !== input.requesterId ||\n request.description !== description ||\n request.type !== input.type ||\n request.visibility !== visibility ||\n request.integrationId ||\n request.origin !== provenance.origin ||\n request.participantId !== provenance.participantId ||\n request.evidence !== evidence ||\n request.discussion !== provenance.discussion\n ) {\n throw new ParticipantDevelopmentRequestConflictError();\n }\n await tx.query(\n `INSERT INTO development_request_histories\n (id, slug, context, tenant_id, request_id, from_status, to_status, actor_type, actor_id, note)\n VALUES (?, ?, '', ?, ?, '', 'submitted', ?, ?, ?)\n ON CONFLICT (id) DO NOTHING`,\n historyId,\n `participant-${historyId}`,\n input.tenantId,\n id,\n provenance.actorType,\n provenance.actorId,\n provenance.discussion,\n );\n return request;\n }),\n );\n }\n}\n\nfunction stableId(value: string): string {\n const hash = createHash('sha256').update(value).digest('hex');\n return `${hash.slice(0, 8)}-${hash.slice(8, 12)}-5${hash.slice(13, 16)}-a${hash.slice(17, 20)}-${hash.slice(20, 32)}`;\n}\n","import type { SmrtClassOptions } from '@happyvertical/smrt-core';\nimport { withTenant } from '@happyvertical/smrt-tenancy';\nimport { DevelopmentRequestCollection } from '../collections/DevelopmentRequests.js';\nimport type { DevelopmentRequest } from '../models/DevelopmentRequest.js';\nimport {\n type DevelopmentRequestWorkLink,\n DevelopmentRequestWorkLinkCollection,\n} from '../models/delivery-control-plane.js';\nimport type { DevelopmentTriageDecision } from '../types.js';\nimport { ParticipantDevelopmentRequestService } from './participant-development-request-service.js';\n\nexport interface DevelopmentWorkItem {\n type: string;\n id: string;\n canonicalStatus: string;\n providerRef?: string;\n metadata?: Record<string, unknown>;\n}\n\nexport interface DevelopmentWorkAdapter {\n createWorkItem(input: {\n request: DevelopmentRequest;\n idempotencyKey: string;\n }): Promise<DevelopmentWorkItem>;\n getWorkItem(link: DevelopmentRequestWorkLink): Promise<DevelopmentWorkItem>;\n requestApproval?(input: {\n request: DevelopmentRequest;\n previewId: string;\n /** Stable across retries; adapters must deduplicate this operation. */\n idempotencyKey: string;\n approved: boolean;\n reason: string;\n }): Promise<void>;\n}\n\nexport interface DevelopmentViewer {\n tenantId: string;\n projectId: string;\n requesterId?: string;\n roles?: Array<'workspace' | 'project_team' | 'internal'>;\n}\n\nexport class DevelopmentRequestService {\n constructor(\n private readonly requests: DevelopmentRequestCollection,\n private readonly links: DevelopmentRequestWorkLinkCollection,\n readonly workAdapter?: DevelopmentWorkAdapter,\n ) {}\n\n static async create(\n options: SmrtClassOptions = {},\n workAdapter?: DevelopmentWorkAdapter,\n ): Promise<DevelopmentRequestService> {\n return new DevelopmentRequestService(\n await DevelopmentRequestCollection.create(options),\n await DevelopmentRequestWorkLinkCollection.create(options),\n workAdapter,\n );\n }\n\n /** Visibility is evaluated after tenant and project scoping. */\n async visibleFor(viewer: DevelopmentViewer): Promise<DevelopmentRequest[]> {\n const all = await this.requests.listForProject(\n viewer.tenantId,\n viewer.projectId,\n );\n const roles = new Set(viewer.roles ?? []);\n return all.filter((request) => {\n if (roles.has('internal')) return true;\n if (request.requesterId === viewer.requesterId) return true;\n if (\n request.visibility === 'internal' ||\n request.visibility === 'requester'\n )\n return false;\n if (request.visibility === 'public') return true;\n if (roles.has('project_team'))\n return (\n request.visibility === 'workspace' ||\n request.visibility === 'project_team'\n );\n return roles.has('workspace') && request.visibility === 'workspace';\n });\n }\n\n async linksFor(\n request: DevelopmentRequest,\n ): Promise<DevelopmentRequestWorkLink[]> {\n return withTenant({ tenantId: request.tenantId }, () =>\n this.links.list({\n where: { requestId: request.id },\n orderBy: 'createdAt ASC',\n }),\n );\n }\n\n async triage(\n request: DevelopmentRequest,\n input: {\n decision: DevelopmentTriageDecision;\n reason: string;\n actorRef: string;\n mergeIntoRequestId?: string;\n split?: Array<{ description: string; type?: string }>;\n },\n ): Promise<{\n request: DevelopmentRequest;\n links: DevelopmentRequestWorkLink[];\n splitRequests: DevelopmentRequest[];\n }> {\n if (!input.reason.trim()) throw new Error('Triage reason is required.');\n requiredId(request.id, 'Development Request');\n const createdLinks: DevelopmentRequestWorkLink[] = [];\n const splitRequests: DevelopmentRequest[] = [];\n\n if (input.decision === 'accept') {\n const existing = await this.linksFor(request);\n if (existing.length > 0) createdLinks.push(...existing);\n else {\n if (!this.workAdapter)\n throw new Error(\n 'DevelopmentWorkAdapter is required to accept requests.',\n );\n const work = await this.workAdapter.createWorkItem({\n request,\n idempotencyKey: `development-request:${request.id}`,\n });\n createdLinks.push(await this.linkWork(request, work));\n }\n if (request.status !== 'planned')\n await this.transition(request, 'planned', input.actorRef, input.reason);\n }\n\n if (input.decision === 'decline' && request.status !== 'declined')\n await this.transition(request, 'declined', input.actorRef, input.reason);\n\n if (input.decision === 'merge') {\n if (!input.mergeIntoRequestId)\n throw new Error('mergeIntoRequestId is required.');\n if (input.mergeIntoRequestId === request.id)\n throw new Error('A Development Request cannot be merged into itself.');\n const target = await withTenant({ tenantId: request.tenantId }, () =>\n this.requests.get({ id: input.mergeIntoRequestId }),\n );\n if (!target || target.projectId !== request.projectId)\n throw new Error(\n 'Merge target must be a Development Request in the same project and tenant.',\n );\n createdLinks.push(\n await this.linkWork(request, {\n type: '@happyvertical/smrt-projects:DevelopmentRequest',\n id: input.mergeIntoRequestId,\n canonicalStatus: 'merged',\n metadata: { reason: input.reason },\n }),\n );\n if (request.status !== 'triaged')\n await this.transition(request, 'triaged', input.actorRef, input.reason);\n }\n\n if (input.decision === 'split') {\n if (!input.split?.length)\n throw new Error('At least one split request is required.');\n const parts = input.split.map((part) => {\n const description = part.description.trim();\n if (!description)\n throw new Error('Split request description is required.');\n const type = part.type ?? request.type;\n if (\n !request.integrationId &&\n (!['bug', 'feature', 'task'].includes(type) ||\n description.length > 8000)\n ) {\n throw new TypeError(\n 'Choose a valid participant split type and description.',\n );\n }\n return { description, type };\n });\n const origin = `split:${request.id}`;\n const unmatchedExisting = await withTenant(\n { tenantId: request.tenantId },\n () =>\n this.requests.list({\n where: {\n tenantId: request.tenantId,\n projectId: request.projectId,\n integrationId: request.integrationId,\n origin,\n },\n orderBy: 'createdAt ASC',\n }),\n );\n const occurrences = new Map<string, number>();\n for (const { description, type } of parts) {\n const contentIdentity = JSON.stringify([type, description]);\n const occurrence = occurrences.get(contentIdentity) ?? 0;\n occurrences.set(contentIdentity, occurrence + 1);\n const existingIndex = unmatchedExisting.findIndex(\n (candidate) =>\n candidate.description.trim() === description &&\n candidate.type === type &&\n candidate.requesterId === request.requesterId &&\n candidate.participantId === request.participantId &&\n candidate.visibility === request.visibility,\n );\n if (existingIndex >= 0) {\n splitRequests.push(unmatchedExisting.splice(existingIndex, 1)[0]);\n } else {\n splitRequests.push(\n request.integrationId\n ? await this.requests.createManaged({\n tenantId: request.tenantId,\n projectId: request.projectId,\n integrationId: request.integrationId,\n requesterId: request.requesterId,\n participantId: request.participantId || undefined,\n type,\n description,\n evidence: request.getEvidence(),\n visibility: request.visibility,\n origin,\n discussion: input.reason,\n })\n : await (\n await ParticipantDevelopmentRequestService.create({\n db: this.requests.db,\n })\n ).splitFrom(request, {\n type: type as 'bug' | 'feature' | 'task',\n description,\n actorRef: input.actorRef,\n reason: input.reason,\n occurrence,\n }),\n );\n }\n }\n if (request.status !== 'triaged')\n await this.transition(request, 'triaged', input.actorRef, input.reason);\n }\n\n return { request, links: createdLinks, splitRequests };\n }\n\n async syncWorkStatus(\n link: DevelopmentRequestWorkLink,\n ): Promise<DevelopmentRequest> {\n if (!this.workAdapter)\n throw new Error(\n 'DevelopmentWorkAdapter is required to project board status.',\n );\n const work = await this.workAdapter.getWorkItem(link);\n link.canonicalStatus = work.canonicalStatus;\n link.metadata = JSON.stringify(work.metadata ?? {});\n link.lastProjectedAt = new Date();\n await withTenant({ tenantId: link.tenantId }, () => link.save());\n const request = await withTenant({ tenantId: link.tenantId }, () =>\n this.requests.get({ id: link.requestId }),\n );\n if (!request)\n throw new Error(`Development Request ${link.requestId} not found.`);\n const requestLinks = await this.linksFor(request);\n const completed = requestLinks.every((item) =>\n ['done', 'closed', 'completed', 'deployed'].includes(\n item.canonicalStatus.toLowerCase(),\n ),\n );\n const nextStatus = completed ? 'completed' : 'in_progress';\n if (request.status !== nextStatus)\n await this.transition(\n request,\n nextStatus,\n 'system',\n `Canonical work status: ${work.canonicalStatus}`,\n );\n return request;\n }\n\n private async transition(\n request: DevelopmentRequest,\n status: 'triaged' | 'planned' | 'in_progress' | 'completed' | 'declined',\n actorRef: string,\n reason: string,\n ): Promise<void> {\n const updated = await this.requests.transitionStatus(\n request.tenantId,\n requiredId(request.id, 'Development Request'),\n { status, actorType: 'system', actorId: actorRef, note: reason },\n );\n request.status = updated.status;\n }\n\n private async linkWork(\n request: DevelopmentRequest,\n work: DevelopmentWorkItem,\n ): Promise<DevelopmentRequestWorkLink> {\n const existing = (\n await withTenant({ tenantId: request.tenantId }, () =>\n this.links.list({\n where: {\n requestId: request.id,\n workItemType: work.type,\n workItemId: work.id,\n },\n limit: 1,\n }),\n )\n )[0];\n if (existing) return existing;\n const link = await withTenant({ tenantId: request.tenantId }, () =>\n this.links.create({\n tenantId: request.tenantId,\n requestId: requiredId(request.id, 'Development Request'),\n workItemType: work.type,\n workItemId: work.id,\n canonicalStatus: work.canonicalStatus,\n providerRef: work.providerRef ?? '',\n metadata: JSON.stringify(work.metadata ?? {}),\n lastProjectedAt: new Date(),\n }),\n );\n await withTenant({ tenantId: request.tenantId }, () => link.save());\n return link;\n }\n}\n\nfunction requiredId(value: string | null | undefined, label: string): string {\n if (!value) throw new Error(`${label} must be saved.`);\n return value;\n}\n","import type { SmrtClassOptions } from '@happyvertical/smrt-core';\nimport {\n assertTenantReadAllowed,\n withTenant,\n} from '@happyvertical/smrt-tenancy';\nimport { ProjectDecisionCollection } from '../collections/ProjectDecisions.js';\nimport { ProjectGovernanceEventCollection } from '../collections/ProjectGovernanceEvents.js';\nimport { ProjectQuestionCollection } from '../collections/ProjectQuestions.js';\nimport type { ProjectDecision } from '../models/ProjectDecision.js';\nimport type { ProjectQuestion } from '../models/ProjectQuestion.js';\nimport {\n serializeContextReferences,\n serializeDecisionOptions,\n serializeQuestionOptions,\n} from '../models/project-governance-validation.js';\nimport type {\n ProjectDecisionCreateInput,\n ProjectDecisionStatus,\n ProjectGovernanceAction,\n ProjectGovernanceActor,\n ProjectGovernanceOwner,\n ProjectGovernanceRecordKind,\n ProjectGovernanceScope,\n ProjectGovernanceVisibility,\n ProjectQuestionAnswerSelection,\n ProjectQuestionCreateInput,\n ProjectQuestionStatus,\n} from '../project-governance-types.js';\n\nconst QUESTION_TYPE = '@happyvertical/smrt-projects:ProjectQuestion';\nconst DECISION_TYPE = '@happyvertical/smrt-projects:ProjectDecision';\ntype Database = ProjectQuestionCollection['db'];\ninterface GovernanceEventDetails {\n note?: string;\n value?: string;\n rationale?: string;\n answerSelection?: ProjectQuestionAnswerSelection;\n fromOwnerType?: ProjectGovernanceActor['type'] | '';\n fromOwnerId?: string;\n toOwnerType?: ProjectGovernanceActor['type'] | '';\n toOwnerId?: string;\n}\n\nexport class ProjectGovernanceConflictError extends Error {\n constructor(message = 'Project governance record has changed.') {\n super(message);\n this.name = 'ProjectGovernanceConflictError';\n }\n}\n\nexport class ProjectGovernanceAuthorizationError extends Error {\n constructor(message = 'Actor cannot change this project governance record.') {\n super(message);\n this.name = 'ProjectGovernanceAuthorizationError';\n }\n}\n\nexport class ProjectGovernanceService {\n constructor(\n private readonly questions: ProjectQuestionCollection,\n private readonly decisions: ProjectDecisionCollection,\n private readonly events: ProjectGovernanceEventCollection,\n ) {}\n\n static async create(\n options: SmrtClassOptions = {},\n ): Promise<ProjectGovernanceService> {\n return new ProjectGovernanceService(\n await ProjectQuestionCollection.create(options),\n await ProjectDecisionCollection.create(options),\n await ProjectGovernanceEventCollection.create(options),\n );\n }\n\n async listForProject(\n scope: ProjectGovernanceScope,\n options: { visibility?: ProjectGovernanceVisibility } = {},\n ): Promise<{\n questions: ProjectQuestion[];\n decisions: ProjectDecision[];\n }> {\n validateScope(scope);\n const [questions, decisions] = await Promise.all([\n this.questions.listForProject(scope, undefined, options.visibility),\n this.decisions.listForProject(scope, undefined, options.visibility),\n ]);\n return { questions, decisions };\n }\n\n async createQuestion(\n input: ProjectQuestionCreateInput,\n ): Promise<ProjectQuestion> {\n validateScope(input);\n requireManager(input.actor);\n const prompt = input.prompt.trim();\n if (!prompt) throw new TypeError('Project question prompt is required.');\n return this.transaction(this.questions, async (db) => {\n const questions = await ProjectQuestionCollection.create({ db });\n const question = await withTenant({ tenantId: input.tenantId }, () =>\n questions.create({\n visibility: input.visibility ?? 'internal',\n tenantId: input.tenantId,\n metaType: input.projectType,\n metaId: input.projectId,\n prompt,\n questionOptions: serializeQuestionOptions(\n input.options === undefined ? [] : input.options,\n ),\n ownerType: input.owner?.type ?? '',\n ownerId: input.owner?.id ?? '',\n contextReferences: serializeContextReferences(\n input.contextReferences ?? [],\n ),\n }),\n );\n await withTenant({ tenantId: input.tenantId }, () => question.save());\n await this.recordEvent(\n db,\n question,\n 'question',\n 'created',\n input.actor,\n '',\n 'open',\n );\n return question;\n });\n }\n\n async createDecision(\n input: ProjectDecisionCreateInput,\n ): Promise<ProjectDecision> {\n validateScope(input);\n requireManager(input.actor);\n const question = input.question.trim();\n if (!question)\n throw new TypeError('Project decision question is required.');\n return this.transaction(this.decisions, async (db) => {\n const decisions = await ProjectDecisionCollection.create({ db });\n const decision = await withTenant({ tenantId: input.tenantId }, () =>\n decisions.create({\n visibility: input.visibility ?? 'internal',\n tenantId: input.tenantId,\n metaType: input.projectType,\n metaId: input.projectId,\n question,\n decisionOptions: serializeDecisionOptions(input.options ?? []),\n ownerType: input.owner?.type ?? '',\n ownerId: input.owner?.id ?? '',\n contextReferences: serializeContextReferences(\n input.contextReferences ?? [],\n ),\n }),\n );\n await withTenant({ tenantId: input.tenantId }, () => decision.save());\n await this.recordEvent(\n db,\n decision,\n 'decision',\n 'created',\n input.actor,\n '',\n 'open',\n );\n return decision;\n });\n }\n\n async answerQuestion(\n input: ProjectGovernanceScope & {\n questionId: string;\n /** Required for old clients too; choices do not silently generate an answer. */\n answer: string;\n selectedOptionId?: string;\n idempotencyKey?: string;\n note?: string;\n expectedRevision: number;\n actor: ProjectGovernanceActor;\n },\n ): Promise<ProjectQuestion> {\n if (typeof input.answer !== 'string' || !input.answer.trim())\n throw new TypeError(\n 'Project question answer is required and must be text.',\n );\n if (\n input.selectedOptionId !== undefined &&\n (typeof input.selectedOptionId !== 'string' ||\n !input.selectedOptionId.trim() ||\n input.selectedOptionId !== input.selectedOptionId.trim())\n )\n throw new TypeError(\n 'Project question selected option id must be non-empty text.',\n );\n if (\n input.idempotencyKey !== undefined &&\n (typeof input.idempotencyKey !== 'string' ||\n !input.idempotencyKey.trim() ||\n input.idempotencyKey.length > 200)\n )\n throw new TypeError(\n 'Project question idempotency key must be non-empty text of at most 200 characters.',\n );\n if (input.note !== undefined && typeof input.note !== 'string')\n throw new TypeError('Project question note must be text.');\n const answer = input.answer.trim();\n const selectedOptionId = input.selectedOptionId;\n return this.mutateQuestion(\n input,\n 'answered',\n 'answered',\n (question) => {\n const option =\n selectedOptionId === undefined\n ? undefined\n : question\n .getOptions()\n .find((entry) => entry.id === selectedOptionId);\n if (selectedOptionId !== undefined && !option)\n throw new TypeError(\n 'Project question answer must match an option id.',\n );\n question.answer = answer;\n question.selectedOptionId = selectedOptionId ?? '';\n question.answeredAt = new Date();\n return {\n value: answer,\n note: input.note ?? '',\n answerSelection: {\n answer,\n expectedRevision: input.expectedRevision,\n ...(option\n ? { selectedOptionId: option.id, optionLabel: option.label }\n : {}),\n ...(input.idempotencyKey !== undefined\n ? { idempotencyKey: input.idempotencyKey }\n : {}),\n },\n };\n },\n true,\n input.idempotencyKey === undefined\n ? undefined\n : async (db) => {\n const events = await ProjectGovernanceEventCollection.create({\n db,\n });\n const history = await events.listForRecord({\n tenantId: input.tenantId,\n recordType: QUESTION_TYPE,\n recordId: input.questionId,\n });\n const previous = history.find(\n (event) =>\n event.getAnswerSelection()?.idempotencyKey ===\n input.idempotencyKey,\n );\n if (!previous) return false;\n const snapshot = previous.getAnswerSelection();\n if (\n previous.actorType !== input.actor.type ||\n previous.actorId !== input.actor.id ||\n snapshot?.expectedRevision !== input.expectedRevision ||\n snapshot.answer !== answer ||\n snapshot.selectedOptionId !== selectedOptionId ||\n previous.note !== (input.note ?? '')\n )\n throw new ProjectGovernanceConflictError(\n 'Project question idempotency key was already used with different input.',\n );\n return true;\n },\n );\n }\n\n async decide(\n input: ProjectGovernanceScope & {\n decisionId: string;\n outcome: string;\n rationale?: string;\n note?: string;\n expectedRevision: number;\n actor: ProjectGovernanceActor;\n },\n ): Promise<ProjectDecision> {\n const outcome = input.outcome.trim();\n if (!outcome) throw new TypeError('Project decision outcome is required.');\n return this.mutateDecision(input, 'decided', 'decided', (decision) => {\n const options = decision.getOptions();\n if (\n options.length > 0 &&\n !options.some((option) => option.id === outcome)\n )\n throw new TypeError(\n 'Project decision outcome must match an option id.',\n );\n decision.outcome = outcome;\n decision.rationale = input.rationale?.trim() ?? '';\n decision.decidedAt = new Date();\n return {\n value: outcome,\n rationale: decision.rationale,\n note: input.note ?? '',\n };\n });\n }\n\n async assignQuestion(\n input: ProjectGovernanceScope & {\n questionId: string;\n owner: ProjectGovernanceOwner | null;\n note?: string;\n expectedRevision: number;\n actor: ProjectGovernanceActor;\n },\n ): Promise<ProjectQuestion> {\n requireManager(input.actor);\n return this.mutateQuestion(\n input,\n undefined,\n 'assigned',\n (question) => {\n const fromOwnerType = question.ownerType;\n const fromOwnerId = question.ownerId;\n assign(question, input.owner);\n return {\n note:\n input.note ?? (input.owner ? 'Owner assigned.' : 'Owner cleared.'),\n fromOwnerType,\n fromOwnerId,\n toOwnerType: question.ownerType,\n toOwnerId: question.ownerId,\n };\n },\n false,\n );\n }\n\n async assignDecision(\n input: ProjectGovernanceScope & {\n decisionId: string;\n owner: ProjectGovernanceOwner | null;\n note?: string;\n expectedRevision: number;\n actor: ProjectGovernanceActor;\n },\n ): Promise<ProjectDecision> {\n requireManager(input.actor);\n return this.mutateDecision(\n input,\n undefined,\n 'assigned',\n (decision) => {\n const fromOwnerType = decision.ownerType;\n const fromOwnerId = decision.ownerId;\n assign(decision, input.owner);\n return {\n note:\n input.note ?? (input.owner ? 'Owner assigned.' : 'Owner cleared.'),\n fromOwnerType,\n fromOwnerId,\n toOwnerType: decision.ownerType,\n toOwnerId: decision.ownerId,\n };\n },\n false,\n );\n }\n\n async deferQuestion(\n input: ProjectGovernanceScope & {\n questionId: string;\n note: string;\n expectedRevision: number;\n actor: ProjectGovernanceActor;\n },\n ): Promise<ProjectQuestion> {\n requireManager(input.actor);\n return this.mutateQuestion(\n input,\n 'deferred',\n 'deferred',\n () => ({ note: requiredNote(input.note) }),\n false,\n );\n }\n\n async deferDecision(\n input: ProjectGovernanceScope & {\n decisionId: string;\n note: string;\n expectedRevision: number;\n actor: ProjectGovernanceActor;\n },\n ): Promise<ProjectDecision> {\n requireManager(input.actor);\n return this.mutateDecision(\n input,\n 'deferred',\n 'deferred',\n () => ({ note: requiredNote(input.note) }),\n false,\n );\n }\n\n async reopenQuestion(\n input: ProjectGovernanceScope & {\n questionId: string;\n note?: string;\n expectedRevision: number;\n actor: ProjectGovernanceActor;\n },\n ): Promise<ProjectQuestion> {\n requireManager(input.actor);\n return this.mutateQuestion(\n input,\n 'open',\n 'reopened',\n (question) => {\n question.answer = '';\n question.selectedOptionId = '';\n question.answeredAt = null;\n return { note: input.note ?? '' };\n },\n false,\n );\n }\n\n async reopenDecision(\n input: ProjectGovernanceScope & {\n decisionId: string;\n note?: string;\n expectedRevision: number;\n actor: ProjectGovernanceActor;\n },\n ): Promise<ProjectDecision> {\n requireManager(input.actor);\n return this.mutateDecision(\n input,\n 'open',\n 'reopened',\n (decision) => {\n decision.outcome = '';\n decision.rationale = '';\n decision.decidedAt = null;\n return { note: input.note ?? '' };\n },\n false,\n );\n }\n\n async supersedeQuestion(\n input: ProjectGovernanceScope & {\n questionId: string;\n note: string;\n expectedRevision: number;\n actor: ProjectGovernanceActor;\n },\n ): Promise<ProjectQuestion> {\n requireManager(input.actor);\n return this.mutateQuestion(\n input,\n 'superseded',\n 'superseded',\n () => ({ note: requiredNote(input.note) }),\n false,\n );\n }\n\n async supersedeDecision(\n input: ProjectGovernanceScope & {\n decisionId: string;\n note: string;\n expectedRevision: number;\n actor: ProjectGovernanceActor;\n },\n ): Promise<ProjectDecision> {\n requireManager(input.actor);\n return this.mutateDecision(\n input,\n 'superseded',\n 'superseded',\n () => ({ note: requiredNote(input.note) }),\n false,\n );\n }\n\n async historyForQuestion(\n input: ProjectGovernanceScope & { questionId: string },\n ) {\n validateScope(input);\n const question = await this.questions.getForProject(\n input,\n input.questionId,\n );\n if (!question) throw new Error('Project question not found.');\n return this.events.listForRecord({\n tenantId: input.tenantId,\n recordType: QUESTION_TYPE,\n recordId: input.questionId,\n });\n }\n\n async historyForDecision(\n input: ProjectGovernanceScope & { decisionId: string },\n ) {\n validateScope(input);\n const decision = await this.decisions.getForProject(\n input,\n input.decisionId,\n );\n if (!decision) throw new Error('Project decision not found.');\n return this.events.listForRecord({\n tenantId: input.tenantId,\n recordType: DECISION_TYPE,\n recordId: input.decisionId,\n });\n }\n\n private async mutateQuestion(\n input: ProjectGovernanceScope & {\n questionId: string;\n expectedRevision: number;\n actor: ProjectGovernanceActor;\n },\n status: ProjectQuestionStatus | undefined,\n action: ProjectGovernanceAction,\n apply: (question: ProjectQuestion) => GovernanceEventDetails,\n allowOwner = true,\n replay?: (db: Database, question: ProjectQuestion) => Promise<boolean>,\n ): Promise<ProjectQuestion> {\n validateScope(input);\n if (\n !Number.isSafeInteger(input.expectedRevision) ||\n input.expectedRevision < 1\n )\n throw new TypeError('Expected revision must be a positive integer.');\n return this.transaction(this.questions, async (db) => {\n const collection = await ProjectQuestionCollection.create({ db });\n const current = await this.lockQuestion(\n db,\n collection,\n input,\n Boolean(replay),\n );\n authorize(current, input.actor, allowOwner);\n if (replay && (await replay(db, current))) return current;\n if (current.revision !== input.expectedRevision)\n throw new ProjectGovernanceConflictError();\n const from = current.status;\n validateQuestionTransition(from, status);\n const event = apply(current);\n if (status) current.status = status;\n current.revision += 1;\n await withTenant({ tenantId: input.tenantId }, () => current.save());\n await this.recordEvent(\n db,\n current,\n 'question',\n action,\n input.actor,\n from,\n current.status,\n event,\n );\n return current;\n });\n }\n\n private async mutateDecision(\n input: ProjectGovernanceScope & {\n decisionId: string;\n expectedRevision: number;\n actor: ProjectGovernanceActor;\n },\n status: ProjectDecisionStatus | undefined,\n action: ProjectGovernanceAction,\n apply: (decision: ProjectDecision) => GovernanceEventDetails,\n allowOwner = true,\n ): Promise<ProjectDecision> {\n validateScope(input);\n return this.transaction(this.decisions, async (db) => {\n const collection = await ProjectDecisionCollection.create({ db });\n const current = await this.lockDecision(db, collection, input);\n authorize(current, input.actor, allowOwner);\n const from = current.status;\n validateDecisionTransition(from, status);\n const event = apply(current);\n if (status) current.status = status;\n current.revision += 1;\n await withTenant({ tenantId: input.tenantId }, () => current.save());\n await this.recordEvent(\n db,\n current,\n 'decision',\n action,\n input.actor,\n from,\n current.status,\n event,\n );\n return current;\n });\n }\n\n private async lockQuestion(\n db: Database,\n collection: ProjectQuestionCollection,\n input: ProjectGovernanceScope & {\n questionId: string;\n expectedRevision: number;\n },\n deferRevisionCheck = false,\n ): Promise<ProjectQuestion> {\n await lockRow(db, collection.tableName, input.questionId, input);\n const current = await collection.getForProject(input, input.questionId);\n if (!current) throw new Error('Project question not found.');\n if (!deferRevisionCheck && current.revision !== input.expectedRevision)\n throw new ProjectGovernanceConflictError();\n return current;\n }\n\n private async lockDecision(\n db: Database,\n collection: ProjectDecisionCollection,\n input: ProjectGovernanceScope & {\n decisionId: string;\n expectedRevision: number;\n },\n ): Promise<ProjectDecision> {\n await lockRow(db, collection.tableName, input.decisionId, input);\n const current = await collection.getForProject(input, input.decisionId);\n if (!current) throw new Error('Project decision not found.');\n if (current.revision !== input.expectedRevision)\n throw new ProjectGovernanceConflictError();\n return current;\n }\n\n private async recordEvent(\n db: Database,\n record: ProjectQuestion | ProjectDecision,\n recordKind: ProjectGovernanceRecordKind,\n action: ProjectGovernanceAction,\n actor: ProjectGovernanceActor,\n fromStatus: string,\n toStatus: string,\n details: GovernanceEventDetails = {},\n ): Promise<void> {\n const events = await ProjectGovernanceEventCollection.create({ db });\n await withTenant({ tenantId: record.tenantId }, () =>\n events.create({\n tenantId: record.tenantId,\n metaType: recordKind === 'question' ? QUESTION_TYPE : DECISION_TYPE,\n metaId: record.id as string,\n recordKind,\n action,\n actorType: actor.type,\n actorId: actor.id,\n fromStatus,\n toStatus,\n note: details.note ?? '',\n value: details.value ?? '',\n rationale: details.rationale ?? '',\n answerSelection: details.answerSelection\n ? JSON.stringify(details.answerSelection)\n : '',\n fromOwnerType: details.fromOwnerType ?? '',\n fromOwnerId: details.fromOwnerId ?? '',\n toOwnerType: details.toOwnerType ?? '',\n toOwnerId: details.toOwnerId ?? '',\n revision: record.revision,\n }),\n );\n }\n\n private async transaction<T>(\n collection: ProjectQuestionCollection | ProjectDecisionCollection,\n work: (db: Database) => Promise<T>,\n ): Promise<T> {\n if (!collection.db.transaction)\n throw new Error('Project governance mutations require transactions.');\n return collection.db.transaction(work);\n }\n}\n\nasync function lockRow(\n db: Database,\n tableName: string,\n id: string,\n scope: ProjectGovernanceScope,\n): Promise<void> {\n const table = `\"${tableName.replace(/\"/g, '\"\"')}\"`;\n await withTenant({ tenantId: scope.tenantId }, () =>\n db.query(\n `UPDATE ${table} SET revision = revision WHERE id = ? AND tenant_id = ? AND meta_type = ? AND meta_id = ?`,\n id,\n scope.tenantId,\n scope.projectType,\n scope.projectId,\n ),\n );\n}\n\nfunction validateScope(scope: ProjectGovernanceScope): void {\n if (\n !scope.tenantId.trim() ||\n !scope.projectType.trim() ||\n !scope.projectId.trim()\n )\n throw new TypeError('Tenant, project type, and project id are required.');\n if (!scope.projectType.includes(':'))\n throw new TypeError('Project type must be a qualified SMRT class name.');\n assertTenantReadAllowed(scope.tenantId, 'ProjectGovernanceService');\n}\n\nfunction requireManager(actor: ProjectGovernanceActor): void {\n validateActor(actor);\n if (!actor.canManage) throw new ProjectGovernanceAuthorizationError();\n}\n\nfunction authorize(\n record: { ownerType: string; ownerId: string },\n actor: ProjectGovernanceActor,\n allowOwner: boolean,\n): void {\n validateActor(actor);\n if (actor.canManage) return;\n if (\n allowOwner &&\n record.ownerType === actor.type &&\n record.ownerId === actor.id\n )\n return;\n throw new ProjectGovernanceAuthorizationError();\n}\n\nfunction validateActor(actor: ProjectGovernanceActor): void {\n if (!['user', 'agent', 'system'].includes(actor.type) || !actor.id.trim())\n throw new TypeError('A valid project governance actor is required.');\n}\n\nfunction assign(\n record: { ownerType: ProjectGovernanceActor['type'] | ''; ownerId: string },\n owner: ProjectGovernanceOwner | null,\n): void {\n if (\n owner &&\n (!owner.id.trim() || !['user', 'agent', 'system'].includes(owner.type))\n )\n throw new TypeError('A valid project governance owner is required.');\n record.ownerType = owner?.type ?? '';\n record.ownerId = owner?.id.trim() ?? '';\n}\n\nfunction requiredNote(note: string): string {\n const value = note.trim();\n if (!value) throw new TypeError('A note is required.');\n return value;\n}\n\nfunction validateQuestionTransition(\n from: ProjectQuestionStatus,\n to?: ProjectQuestionStatus,\n): void {\n if (!to) return;\n const allowed: Record<ProjectQuestionStatus, ProjectQuestionStatus[]> = {\n open: ['answered', 'deferred', 'superseded'],\n answered: ['superseded'],\n deferred: ['open', 'superseded'],\n superseded: [],\n };\n if (!allowed[from].includes(to))\n throw new TypeError(\n `Invalid project question transition: ${from} -> ${to}.`,\n );\n}\n\nfunction validateDecisionTransition(\n from: ProjectDecisionStatus,\n to?: ProjectDecisionStatus,\n): void {\n if (!to) return;\n const allowed: Record<ProjectDecisionStatus, ProjectDecisionStatus[]> = {\n open: ['decided', 'deferred', 'superseded'],\n decided: ['superseded'],\n deferred: ['open', 'superseded'],\n superseded: [],\n };\n if (!allowed[from].includes(to))\n throw new TypeError(\n `Invalid project decision transition: ${from} -> ${to}.`,\n );\n}\n","import {\n isUniqueViolationError,\n type SmrtClassOptions,\n} from '@happyvertical/smrt-core';\nimport { validateCookbook } from '@happyvertical/smrt-core/cookbook';\nimport {\n assertTenantReadAllowed,\n withTenant,\n} from '@happyvertical/smrt-tenancy';\nimport { ProjectSpecificationCollection } from '../collections/ProjectSpecifications.js';\nimport type { ProjectSpecification } from '../models/ProjectSpecification.js';\nimport type {\n ProjectGovernanceActor,\n ProjectGovernanceScope,\n} from '../project-governance-types.js';\nimport {\n ProjectGovernanceAuthorizationError,\n ProjectGovernanceConflictError,\n} from './project-governance-service.js';\n\nexport class ProjectSpecificationValidationError extends TypeError {\n readonly code = 'INVALID_PROJECT_SPECIFICATION';\n readonly status = 400;\n}\n\nexport interface ProjectSpecificationSaveInput extends ProjectGovernanceScope {\n /** null is create-only; an existing specification requires its current revision. */\n expectedRevision: number | null;\n actor: ProjectGovernanceActor;\n title: string;\n summary?: string;\n /** Validated and canonicalized by smrt-core/cookbook before persistence. */\n cookbook: unknown;\n}\n\nexport interface ProjectSpecificationServiceOptions extends SmrtClassOptions {\n /** Explicit caller-owned transaction executor; never pass an ordinary connection here. */\n transaction?: 'caller';\n}\n\n/** Tenant/project isolation and optimistic writes for canonical specifications. */\nexport class ProjectSpecificationService {\n private constructor(\n private readonly collection: ProjectSpecificationCollection,\n private readonly callerTransaction: boolean,\n ) {}\n\n static async create(\n options: ProjectSpecificationServiceOptions = {},\n ): Promise<ProjectSpecificationService> {\n return new ProjectSpecificationService(\n await ProjectSpecificationCollection.create(options),\n options.transaction === 'caller',\n );\n }\n\n async getForProject(\n scope: ProjectGovernanceScope,\n ): Promise<ProjectSpecification | null> {\n validateScope(scope);\n return this.collection.getForProject(scope);\n }\n\n async saveForProject(\n input: ProjectSpecificationSaveInput,\n ): Promise<ProjectSpecification> {\n validateScope(input);\n if (\n !['user', 'agent', 'system'].includes(input.actor.type) ||\n !input.actor.id.trim()\n )\n throw new ProjectSpecificationValidationError(\n 'A valid project specification actor is required.',\n );\n if (!input.actor.canManage) throw new ProjectGovernanceAuthorizationError();\n if (\n input.expectedRevision !== null &&\n (!Number.isSafeInteger(input.expectedRevision) ||\n input.expectedRevision < 1)\n )\n throw new ProjectSpecificationValidationError(\n 'Expected revision must be null or a positive integer.',\n );\n if (typeof input.title !== 'string' || !input.title.trim())\n throw new ProjectSpecificationValidationError(\n 'Project specification title is required.',\n );\n const validated = validateCookbook(input.cookbook);\n if (!validated.ok)\n throw new ProjectSpecificationValidationError(\n validated.errors.join('; '),\n );\n const work = async (db: ProjectSpecificationCollection['db']) => {\n const collection = await ProjectSpecificationCollection.create({ db });\n const table = `\"${collection.tableName.replace(/\"/g, '\"\"')}\"`;\n await db.query(\n `UPDATE ${table} SET revision = revision WHERE tenant_id = ? AND meta_type = ? AND meta_id = ?`,\n input.tenantId,\n input.projectType,\n input.projectId,\n );\n const current = await collection.getForProject(input);\n if ((current?.revision ?? null) !== input.expectedRevision)\n throw new ProjectGovernanceConflictError(\n 'Project specification has changed.',\n );\n const values = {\n title: input.title,\n summary: input.summary ?? '',\n cookbook: JSON.stringify(validated.cookbook),\n actorType: input.actor.type,\n actorId: input.actor.id,\n };\n return withTenant({ tenantId: input.tenantId }, async () => {\n if (current) {\n Object.assign(current, values);\n current.revision += 1;\n await current.save();\n return current;\n }\n try {\n return await collection.create({\n ...values,\n tenantId: input.tenantId,\n metaType: input.projectType,\n metaId: input.projectId,\n _insertOnly: true,\n });\n } catch (error) {\n if (isUniqueViolationError(error))\n throw new ProjectGovernanceConflictError(\n 'Project specification already exists.',\n );\n throw error;\n }\n });\n };\n if (this.callerTransaction) return work(this.collection.db);\n if (!this.collection.db.transaction)\n throw new Error('Project specification mutations require transactions.');\n return this.collection.db.transaction(work);\n }\n}\n\nfunction validateScope(scope: ProjectGovernanceScope): void {\n if (\n !scope.tenantId.trim() ||\n !scope.projectId.trim() ||\n !scope.projectType.includes(':')\n )\n throw new ProjectSpecificationValidationError(\n 'Tenant, qualified project type, and project id are required.',\n );\n assertTenantReadAllowed(scope.tenantId, 'ProjectSpecificationService');\n}\n","import {\n CommercialUsageService,\n type CommercialUsageServiceOptions,\n} from '@happyvertical/smrt-subscriptions';\nimport type { ServiceTimeEntry } from '@happyvertical/smrt-timesheets';\nimport type {\n CommercialSnapshot,\n ServiceCommercialResolver,\n} from './service-evidence-service.js';\n\nexport interface ProviderCompensationResolver {\n compensate(entry: ServiceTimeEntry): Promise<CommercialSnapshot>;\n}\n\n/**\n * A support-case subtype (smrt-support's `ServiceTimeEntry`) carries `caseId` /\n * `specialistId`; the shared entry does not (#3288). Read them when present so\n * case-attached entries keep their usage-event work reference.\n */\nfunction supportContext(entry: ServiceTimeEntry): {\n caseId: string | null;\n specialistId: string | null;\n} {\n const fields = entry as unknown as Record<string, unknown>;\n return {\n caseId: typeof fields.caseId === 'string' ? fields.caseId : null,\n specialistId:\n typeof fields.specialistId === 'string' ? fields.specialistId : null,\n };\n}\n\n/** Bridges shared Professional Service evidence to #1925's effective pricing. */\nexport class SubscriptionServiceCommercialResolver\n implements ServiceCommercialResolver\n{\n constructor(\n private readonly usage: CommercialUsageService,\n private readonly provider: ProviderCompensationResolver,\n ) {}\n\n static async create(\n options: CommercialUsageServiceOptions,\n provider: ProviderCompensationResolver,\n ): Promise<SubscriptionServiceCommercialResolver> {\n return new SubscriptionServiceCommercialResolver(\n await CommercialUsageService.create(options),\n provider,\n );\n }\n\n /** Reject unsupported source quantities before the shared approval writes. */\n validateEntry(entry: ServiceTimeEntry): void {\n entry.requireDurationSeconds();\n }\n\n async priceClient(entry: ServiceTimeEntry): Promise<CommercialSnapshot> {\n if (!entry.id || !entry.tenantId)\n throw new Error(\n 'Saved tenant-scoped ServiceTimeEntry is required for client pricing.',\n );\n const at = entry.endedAt ?? entry.startedAt ?? new Date();\n const metadata = entry.getMetadata();\n const { caseId, specialistId } = supportContext(entry);\n const usageEvent = await this.usage.record({\n tenantId: entry.tenantId,\n metricKey: 'duration.seconds',\n quantity: entry.requireDurationSeconds(),\n windowStart: at,\n windowEnd: at,\n source: 'service-time-entry',\n sourceId: entry.id,\n projectId:\n typeof metadata.projectId === 'string' ? metadata.projectId : undefined,\n workRefType:\n entry.workRefType ??\n (caseId ? '@happyvertical/smrt-support:SupportCase' : undefined),\n workRefId: entry.workRefId ?? caseId ?? undefined,\n provider: entry.participantKind,\n dimensions: {\n serviceKey: 'professional-services',\n source: entry.source,\n specialistId,\n agentRef: entry.agentRef || undefined,\n },\n });\n if (!usageEvent.id)\n throw new Error('Professional Service usage event was not persisted.');\n const charge = await this.usage.price({\n usageEventId: usageEvent.id,\n approved: true,\n at,\n });\n const snapshot = charge.getPricingSnapshot();\n return {\n amount: charge.amount,\n currency: charge.currency,\n version: String(snapshot.ruleKey ?? charge.pricingRuleId),\n strategy: String(snapshot.strategy ?? ''),\n terms: snapshot,\n sourceRef: `@happyvertical/smrt-subscriptions:ClientCharge:${charge.id}`,\n };\n }\n\n compensateProvider(entry: ServiceTimeEntry): Promise<CommercialSnapshot> {\n return this.provider.compensate(entry);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAOA,eAAe,wBAAwB,KAAK,MAAM,ul1KAAuiiM,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MAAM,qDAAqD;EACvE,MAAM,SAAS,MAAM,KAAK,MAAM,MAAM;GACpC,cAAc,WAAW;GACzB,UAAU;GACV;EACF,CAAC;EACD,MAAM,WAAW,OAAO,mBAAmB;EAC3C,OAAO;GACL,QAAQ,OAAO;GACf,UAAU,OAAO;GACjB,SAAS,OAAO,SAAS,WAAW,OAAO,aAAa;GACxD,UAAU,OAAO,SAAS,YAAY,EAAE;GACxC,OAAO;GACP,WAAW,kDAAkD,OAAO;EACtE;CACF;CAEA,mBAAmB,OAAsD;EACvE,OAAO,KAAK,SAAS,WAAW,KAAK;CACvC;AACF"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/__smrt-register__.ts","../src/collections/Comments.ts","../src/models/DevelopmentRequestHistory.ts","../src/collections/DevelopmentRequestHistories.ts","../src/models/DevelopmentRequest.ts","../src/collections/DevelopmentRequests.ts","../src/collections/Issues.ts","../src/models/project-governance-validation.ts","../src/models/ProjectDecision.ts","../src/collections/ProjectDecisions.ts","../src/models/ProjectGovernanceEvent.ts","../src/collections/ProjectGovernanceEvents.ts","../src/models/ProjectIntegrationAudit.ts","../src/collections/ProjectIntegrationAudits.ts","../src/models/ProjectIntegration.ts","../src/collections/ProjectIntegrations.ts","../src/models/ProjectQuestion.ts","../src/collections/ProjectQuestions.ts","../src/models/ProjectSpecification.ts","../src/collections/ProjectSpecifications.ts","../src/models/Project.ts","../src/collections/Projects.ts","../src/collections/PullRequests.ts","../src/models/Repository.ts","../src/collections/Repositories.ts","../src/models/delivery-control-plane.ts","../src/services/delivery-service.ts","../src/services/project-board-service.ts","../src/managed-client.ts","../src/migrations/moneyMinorUnits.ts","../src/models/Label.ts","../src/project-governance-types.ts","../src/recipes.ts","../src/services/assistance-request-service.ts","../src/services/participant-development-request-service.ts","../src/services/development-request-service.ts","../src/services/project-governance-service.ts","../src/services/project-specification-service.ts","../src/services/subscription-commercial-resolver.ts"],"sourcesContent":["// Generated by @happyvertical/smrt-core smrtPlugin at library build time.\n// The package manifest is inlined so self-registration cannot miss when a\n// downstream bundler relocates this module away from dist/manifest.json\n// (https://github.com/happyvertical/smrt/issues/1506,\n// https://github.com/happyvertical/smrt/issues/1507).\nimport { ObjectRegistry } from '@happyvertical/smrt-core';\n\nObjectRegistry.registerPackageManifest(JSON.parse(\"{\\\"version\\\":\\\"1.0.0\\\",\\\"timestamp\\\":0,\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"packageVersion\\\":\\\"0.57.34\\\",\\\"objects\\\":{\\\"@happyvertical/smrt-projects:CommentCollection\\\":{\\\"name\\\":\\\"commentcollection\\\",\\\"className\\\":\\\"CommentCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:CommentCollection\\\",\\\"collection\\\":\\\"comments\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/collections/Comments.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"api\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"]},\\\"mcp\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"]},\\\"cli\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"]}},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"Comment\\\",\\\"exportName\\\":\\\"CommentCollection\\\",\\\"collectionExportName\\\":\\\"CommentCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"comments\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"comments\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"issue_id\\\\\\\" UUID,\\\\n \\\\\\\"comment_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"body\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"author\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"url\\\\\\\" TEXT DEFAULT ''\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"issue_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"issues\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"comment_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"author\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"}},\\\"indexes\\\":[{\\\"name\\\":\\\"comments_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"comments_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"comments_issue_id_idx\\\",\\\"columns\\\":[\\\"issue_id\\\"]}],\\\"version\\\":\\\"ffcc1937\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:DevelopmentRequestHistoryCollection\\\":{\\\"name\\\":\\\"developmentrequesthistorycollection\\\",\\\"className\\\":\\\"DevelopmentRequestHistoryCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:DevelopmentRequestHistoryCollection\\\",\\\"collection\\\":\\\"developmentrequesthistories\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/collections/DevelopmentRequestHistories.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{},\\\"methods\\\":{\\\"listForRequest\\\":{\\\"name\\\":\\\"listForRequest\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"tenantId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"requestId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<DevelopmentRequestHistory[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"development_request_histories\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"DevelopmentRequestHistory\\\",\\\"exportName\\\":\\\"DevelopmentRequestHistoryCollection\\\",\\\"collectionExportName\\\":\\\"DevelopmentRequestHistoryCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"development_request_histories\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"development_request_histories\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"request_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"from_status\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"to_status\\\\\\\" TEXT DEFAULT 'submitted',\\\\n \\\\\\\"actor_type\\\\\\\" TEXT DEFAULT 'system',\\\\n \\\\\\\"actor_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"note\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"request_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"development_requests\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"from_status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"to_status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"submitted\\\"},\\\"actor_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"system\\\"},\\\"actor_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"note\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"development_request_histories_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"development_request_histories_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"development_request_histories_request_id_idx\\\",\\\"columns\\\":[\\\"request_id\\\"]}],\\\"version\\\":\\\"67389678\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:DevelopmentRequestCollection\\\":{\\\"name\\\":\\\"developmentrequestcollection\\\",\\\"className\\\":\\\"DevelopmentRequestCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:DevelopmentRequestCollection\\\",\\\"collection\\\":\\\"developmentrequests\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/collections/DevelopmentRequests.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{},\\\"methods\\\":{\\\"createManaged\\\":{\\\"name\\\":\\\"createManaged\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"input\\\",\\\"type\\\":\\\"any\\\",\\\"optional\\\":false,\\\"typeUnresolved\\\":true}],\\\"returnType\\\":\\\"Promise<DevelopmentRequest>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"listByIntegrationRequester\\\":{\\\"name\\\":\\\"listByIntegrationRequester\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"input\\\",\\\"type\\\":\\\"object\\\",\\\"optional\\\":false,\\\"memberTypes\\\":[\\\"string\\\"]}],\\\"returnType\\\":\\\"Promise<DevelopmentRequest[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"transitionStatus\\\":{\\\"name\\\":\\\"transitionStatus\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"tenantId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"requestId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"transition\\\",\\\"type\\\":\\\"DevelopmentRequestTransitionInput\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<DevelopmentRequest>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"listForProject\\\":{\\\"name\\\":\\\"listForProject\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"tenantId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"projectId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"status\\\",\\\"type\\\":\\\"DevelopmentRequestStatus\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<DevelopmentRequest[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"development_requests\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"DevelopmentRequest\\\",\\\"exportName\\\":\\\"DevelopmentRequestCollection\\\",\\\"collectionExportName\\\":\\\"DevelopmentRequestCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"development_requests\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"development_requests\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"project_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"integration_id\\\\\\\" UUID,\\\\n \\\\\\\"requester_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"participant_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"type\\\\\\\" TEXT DEFAULT 'feature',\\\\n \\\\\\\"description\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"evidence\\\\\\\" TEXT DEFAULT '[]',\\\\n \\\\\\\"visibility\\\\\\\" TEXT DEFAULT 'requester',\\\\n \\\\\\\"origin\\\\\\\" TEXT DEFAULT 'managed-app',\\\\n \\\\\\\"discussion\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'submitted'\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"project_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"integration_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"project_integrations\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"requester_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"participant_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"feature\\\"},\\\"description\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"evidence\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"[]\\\"},\\\"visibility\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"requester\\\"},\\\"origin\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"managed-app\\\"},\\\"discussion\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"submitted\\\"}},\\\"indexes\\\":[{\\\"name\\\":\\\"development_requests_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"development_requests_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"development_requests_integration_id_idx\\\",\\\"columns\\\":[\\\"integration_id\\\"]}],\\\"version\\\":\\\"2f7f7c8a\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:IssueCollection\\\":{\\\"name\\\":\\\"issuecollection\\\",\\\"className\\\":\\\"IssueCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:IssueCollection\\\",\\\"collection\\\":\\\"issues\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/collections/Issues.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{},\\\"methods\\\":{\\\"discover\\\":{\\\"name\\\":\\\"discover\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"object\\\",\\\"optional\\\":false,\\\"memberTypes\\\":[\\\"Repository\\\",\\\"SearchFilters\\\"]}],\\\"returnType\\\":\\\"Promise<Issue[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findByProject\\\":{\\\"name\\\":\\\"findByProject\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"projectId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Issue[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findByRepository\\\":{\\\"name\\\":\\\"findByRepository\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"repositoryId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Issue[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findOpen\\\":{\\\"name\\\":\\\"findOpen\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"repositoryId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<Issue[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findByLabel\\\":{\\\"name\\\":\\\"findByLabel\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"label\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"repositoryId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<Issue[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findByAssignee\\\":{\\\"name\\\":\\\"findByAssignee\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"assignee\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"repositoryId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<Issue[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findNeedingReview\\\":{\\\"name\\\":\\\"findNeedingReview\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"repositoryId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<Issue[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findByNumber\\\":{\\\"name\\\":\\\"findByNumber\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"repositoryId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"number\\\",\\\"type\\\":\\\"number\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Issue | null>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findWithUnincorporatedFeedback\\\":{\\\"name\\\":\\\"findWithUnincorporatedFeedback\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"repositoryId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<Issue[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"batchSync\\\":{\\\"name\\\":\\\"batchSync\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"repository\\\",\\\"type\\\":\\\"Repository\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"object\\\",\\\"optional\\\":true,\\\"memberTypes\\\":[\\\"boolean\\\"]}],\\\"returnType\\\":\\\"Promise<Issue[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findByTenant\\\":{\\\"name\\\":\\\"findByTenant\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"tenantId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Issue[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findGlobal\\\":{\\\"name\\\":\\\"findGlobal\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<Issue[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findWithGlobals\\\":{\\\"name\\\":\\\"findWithGlobals\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"tenantId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Issue[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"api\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"create\\\",\\\"update\\\"]},\\\"mcp\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"]},\\\"cli\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"],\\\"skipApiCheck\\\":true}},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"Issue\\\",\\\"exportName\\\":\\\"IssueCollection\\\",\\\"collectionExportName\\\":\\\"IssueCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"issues\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"issues\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"repository_id\\\\\\\" UUID,\\\\n \\\\\\\"project_id\\\\\\\" UUID,\\\\n \\\\\\\"number\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"node_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"title\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"body\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"state\\\\\\\" TEXT DEFAULT 'open',\\\\n \\\\\\\"author\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"labels\\\\\\\" JSON DEFAULT '[]',\\\\n \\\\\\\"assignees\\\\\\\" JSON DEFAULT '[]',\\\\n \\\\\\\"comments_count\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"last_synced_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"original_body\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"synthesis_count\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"head_ref\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"base_ref\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"merged\\\\\\\" BOOLEAN DEFAULT FALSE,\\\\n \\\\\\\"merged_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"mergeable\\\\\\\" BOOLEAN DEFAULT TRUE,\\\\n \\\\\\\"draft\\\\\\\" BOOLEAN DEFAULT FALSE,\\\\n \\\\\\\"additions\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"deletions\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"changed_files\\\\\\\" INTEGER DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"repository_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"repositories\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"project_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"projects\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"number\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"node_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"state\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"open\\\"},\\\"author\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"labels\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false,\\\"default\\\":[]},\\\"assignees\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false,\\\"default\\\":[]},\\\"comments_count\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"last_synced_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false},\\\"original_body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"synthesis_count\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"head_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"base_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"merged\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":false,\\\"default\\\":false},\\\"merged_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false},\\\"mergeable\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":false,\\\"default\\\":true},\\\"draft\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":false,\\\"default\\\":false},\\\"additions\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"deletions\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"changed_files\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"issues_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"issues_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"issues_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"issues_repository_id_idx\\\",\\\"columns\\\":[\\\"repository_id\\\"]},{\\\"name\\\":\\\"issues_project_id_idx\\\",\\\"columns\\\":[\\\"project_id\\\"]}],\\\"version\\\":\\\"83fb5e05\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:ProjectDecisionCollection\\\":{\\\"name\\\":\\\"projectdecisioncollection\\\",\\\"className\\\":\\\"ProjectDecisionCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:ProjectDecisionCollection\\\",\\\"collection\\\":\\\"projectdecisions\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/collections/ProjectDecisions.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{},\\\"methods\\\":{\\\"listForProject\\\":{\\\"name\\\":\\\"listForProject\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"scope\\\",\\\"type\\\":\\\"ProjectGovernanceScope\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"status\\\",\\\"type\\\":\\\"ProjectDecisionStatus\\\",\\\"optional\\\":true},{\\\"name\\\":\\\"visibility\\\",\\\"type\\\":\\\"ProjectGovernanceVisibility\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<ProjectDecision[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getForProject\\\":{\\\"name\\\":\\\"getForProject\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"scope\\\",\\\"type\\\":\\\"ProjectGovernanceScope\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"id\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<ProjectDecision | null>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"project_decisions\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"ProjectDecision\\\",\\\"exportName\\\":\\\"ProjectDecisionCollection\\\",\\\"collectionExportName\\\":\\\"ProjectDecisionCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"project_decisions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"project_decisions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"meta_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"role\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"question\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"decision_options\\\\\\\" TEXT,\\\\n \\\\\\\"outcome\\\\\\\" TEXT,\\\\n \\\\\\\"rationale\\\\\\\" TEXT,\\\\n \\\\\\\"status\\\\\\\" TEXT NOT NULL DEFAULT 'open',\\\\n \\\\\\\"owner_type\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"owner_id\\\\\\\" TEXT,\\\\n \\\\\\\"visibility\\\\\\\" TEXT DEFAULT 'internal',\\\\n \\\\\\\"context_references\\\\\\\" TEXT,\\\\n \\\\\\\"revision\\\\\\\" INTEGER NOT NULL DEFAULT 1,\\\\n \\\\\\\"decided_at\\\\\\\" TIMESTAMP\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"meta_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"role\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":0},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"question\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"decision_options\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"outcome\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"rationale\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"open\\\"},\\\"owner_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"owner_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"visibility\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"internal\\\"},\\\"context_references\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"revision\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":1},\\\"decided_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"project_decisions_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"project_decisions_project_status_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"meta_type\\\",\\\"meta_id\\\",\\\"status\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"project_decisions_owner_status_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"owner_type\\\",\\\"owner_id\\\",\\\"status\\\"]},{\\\"name\\\":\\\"project_decisions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"project_decisions_meta_type_meta_id_idx\\\",\\\"columns\\\":[\\\"meta_type\\\",\\\"meta_id\\\"]}],\\\"version\\\":\\\"34ed60f9\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:ProjectGovernanceEventCollection\\\":{\\\"name\\\":\\\"projectgovernanceeventcollection\\\",\\\"className\\\":\\\"ProjectGovernanceEventCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:ProjectGovernanceEventCollection\\\",\\\"collection\\\":\\\"projectgovernanceevents\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/collections/ProjectGovernanceEvents.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{},\\\"methods\\\":{\\\"listForRecord\\\":{\\\"name\\\":\\\"listForRecord\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"input\\\",\\\"type\\\":\\\"object\\\",\\\"optional\\\":false,\\\"memberTypes\\\":[\\\"string\\\"]}],\\\"returnType\\\":\\\"Promise<ProjectGovernanceEvent[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"project_governance_events\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"ProjectGovernanceEvent\\\",\\\"exportName\\\":\\\"ProjectGovernanceEventCollection\\\",\\\"collectionExportName\\\":\\\"ProjectGovernanceEventCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"project_governance_events\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"project_governance_events\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"meta_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"role\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"record_kind\\\\\\\" TEXT NOT NULL DEFAULT 'question',\\\\n \\\\\\\"action\\\\\\\" TEXT NOT NULL DEFAULT 'created',\\\\n \\\\\\\"actor_type\\\\\\\" TEXT NOT NULL DEFAULT 'system',\\\\n \\\\\\\"actor_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"from_status\\\\\\\" TEXT,\\\\n \\\\\\\"to_status\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"note\\\\\\\" TEXT,\\\\n \\\\\\\"value\\\\\\\" TEXT,\\\\n \\\\\\\"rationale\\\\\\\" TEXT,\\\\n \\\\\\\"answer_selection\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"revision\\\\\\\" INTEGER NOT NULL DEFAULT 1,\\\\n \\\\\\\"from_owner_type\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"from_owner_id\\\\\\\" TEXT,\\\\n \\\\\\\"to_owner_type\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"to_owner_id\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"meta_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"role\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":0},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"record_kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"question\\\"},\\\"action\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"created\\\"},\\\"actor_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"system\\\"},\\\"actor_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"from_status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"to_status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"note\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"value\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"rationale\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"answer_selection\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"revision\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":1},\\\"from_owner_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"from_owner_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"to_owner_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"to_owner_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"project_governance_events_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"project_governance_events_record_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"meta_type\\\",\\\"meta_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"project_governance_events_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"project_governance_events_meta_type_meta_id_idx\\\",\\\"columns\\\":[\\\"meta_type\\\",\\\"meta_id\\\"]}],\\\"version\\\":\\\"e903aea4\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:ProjectIntegrationAuditCollection\\\":{\\\"name\\\":\\\"projectintegrationauditcollection\\\",\\\"className\\\":\\\"ProjectIntegrationAuditCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:ProjectIntegrationAuditCollection\\\",\\\"collection\\\":\\\"projectintegrationaudits\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/collections/ProjectIntegrationAudits.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{},\\\"methods\\\":{\\\"listForIntegration\\\":{\\\"name\\\":\\\"listForIntegration\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"tenantId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"integrationId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<ProjectIntegrationAudit[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"project_integration_audits\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"ProjectIntegrationAudit\\\",\\\"exportName\\\":\\\"ProjectIntegrationAuditCollection\\\",\\\"collectionExportName\\\":\\\"ProjectIntegrationAuditCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"project_integration_audits\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"project_integration_audits\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"integration_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"action\\\\\\\" TEXT DEFAULT 'created',\\\\n \\\\\\\"note\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"integration_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"project_integrations\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"action\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"created\\\"},\\\"note\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"project_integration_audits_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"project_integration_audits_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"project_integration_audits_integration_id_idx\\\",\\\"columns\\\":[\\\"integration_id\\\"]}],\\\"version\\\":\\\"03cc10a2\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:ProjectIntegrationCollection\\\":{\\\"name\\\":\\\"projectintegrationcollection\\\",\\\"className\\\":\\\"ProjectIntegrationCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:ProjectIntegrationCollection\\\",\\\"collection\\\":\\\"projectintegrations\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/collections/ProjectIntegrations.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{},\\\"methods\\\":{\\\"provision\\\":{\\\"name\\\":\\\"provision\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"input\\\",\\\"type\\\":\\\"object\\\",\\\"optional\\\":false,\\\"memberTypes\\\":[\\\"string\\\",\\\"ProjectIntegrationCapability[]\\\"]}],\\\"returnType\\\":\\\"Promise<object>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"rotate\\\":{\\\"name\\\":\\\"rotate\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"tenantId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"integrationId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<object>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"revoke\\\":{\\\"name\\\":\\\"revoke\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"tenantId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"integrationId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<ProjectIntegration>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"authenticate\\\":{\\\"name\\\":\\\"authenticate\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"credential\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<ProjectIntegration | null>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"listForProject\\\":{\\\"name\\\":\\\"listForProject\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"tenantId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"projectId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<ProjectIntegration[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findActive\\\":{\\\"name\\\":\\\"findActive\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"tenantId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"integrationId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<ProjectIntegration | null>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"project_integrations\\\",\\\"api\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"]},\\\"mcp\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"]},\\\"cli\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"]}},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"ProjectIntegration\\\",\\\"exportName\\\":\\\"ProjectIntegrationCollection\\\",\\\"collectionExportName\\\":\\\"ProjectIntegrationCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"project_integrations\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"project_integrations\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"project_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"name\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"credential_hash\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"capabilities\\\\\\\" JSON DEFAULT '[]',\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'active',\\\\n \\\\\\\"revoked_at\\\\\\\" TIMESTAMP\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"project_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"name\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"credential_hash\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"capabilities\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":[]},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"active\\\"},\\\"revoked_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"project_integrations_tenant_id_project_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"project_id\\\",\\\"name\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"project_integrations_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"project_integrations_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"bfbaa783\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:ProjectQuestionCollection\\\":{\\\"name\\\":\\\"projectquestioncollection\\\",\\\"className\\\":\\\"ProjectQuestionCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:ProjectQuestionCollection\\\",\\\"collection\\\":\\\"projectquestions\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/collections/ProjectQuestions.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{},\\\"methods\\\":{\\\"listForProject\\\":{\\\"name\\\":\\\"listForProject\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"scope\\\",\\\"type\\\":\\\"ProjectGovernanceScope\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"status\\\",\\\"type\\\":\\\"ProjectQuestionStatus\\\",\\\"optional\\\":true},{\\\"name\\\":\\\"visibility\\\",\\\"type\\\":\\\"ProjectGovernanceVisibility\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<ProjectQuestion[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getForProject\\\":{\\\"name\\\":\\\"getForProject\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"scope\\\",\\\"type\\\":\\\"ProjectGovernanceScope\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"id\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<ProjectQuestion | null>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"project_questions\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"ProjectQuestion\\\",\\\"exportName\\\":\\\"ProjectQuestionCollection\\\",\\\"collectionExportName\\\":\\\"ProjectQuestionCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"project_questions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"project_questions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"meta_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"role\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"prompt\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"answer\\\\\\\" TEXT,\\\\n \\\\\\\"question_options\\\\\\\" TEXT DEFAULT '[]',\\\\n \\\\\\\"selected_option_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"status\\\\\\\" TEXT NOT NULL DEFAULT 'open',\\\\n \\\\\\\"owner_type\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"owner_id\\\\\\\" TEXT,\\\\n \\\\\\\"visibility\\\\\\\" TEXT DEFAULT 'internal',\\\\n \\\\\\\"context_references\\\\\\\" TEXT,\\\\n \\\\\\\"revision\\\\\\\" INTEGER NOT NULL DEFAULT 1,\\\\n \\\\\\\"answered_at\\\\\\\" TIMESTAMP\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"meta_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"role\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":0},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"prompt\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"answer\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"question_options\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"[]\\\"},\\\"selected_option_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"open\\\"},\\\"owner_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"owner_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"visibility\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"internal\\\"},\\\"context_references\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"revision\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":1},\\\"answered_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"project_questions_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"project_questions_project_status_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"meta_type\\\",\\\"meta_id\\\",\\\"status\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"project_questions_owner_status_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"owner_type\\\",\\\"owner_id\\\",\\\"status\\\"]},{\\\"name\\\":\\\"project_questions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"project_questions_meta_type_meta_id_idx\\\",\\\"columns\\\":[\\\"meta_type\\\",\\\"meta_id\\\"]}],\\\"version\\\":\\\"9bf3b915\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:ProjectSpecificationCollection\\\":{\\\"name\\\":\\\"projectspecificationcollection\\\",\\\"className\\\":\\\"ProjectSpecificationCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:ProjectSpecificationCollection\\\",\\\"collection\\\":\\\"projectspecifications\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/collections/ProjectSpecifications.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{},\\\"methods\\\":{\\\"getForProject\\\":{\\\"name\\\":\\\"getForProject\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"scope\\\",\\\"type\\\":\\\"ProjectGovernanceScope\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<ProjectSpecification | null>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"project_specifications\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"ProjectSpecification\\\",\\\"exportName\\\":\\\"ProjectSpecificationCollection\\\",\\\"collectionExportName\\\":\\\"ProjectSpecificationCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"project_specifications\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"project_specifications\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"meta_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"role\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"title\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"summary\\\\\\\" TEXT,\\\\n \\\\\\\"cookbook\\\\\\\" TEXT,\\\\n \\\\\\\"revision\\\\\\\" INTEGER NOT NULL DEFAULT 1,\\\\n \\\\\\\"actor_type\\\\\\\" TEXT,\\\\n \\\\\\\"actor_id\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"meta_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"role\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":0},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"summary\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"cookbook\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"revision\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":1},\\\"actor_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"actor_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"project_specifications_tenant_id_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"meta_type\\\",\\\"meta_id\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"project_specifications_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"project_specifications_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"project_specifications_meta_type_meta_id_idx\\\",\\\"columns\\\":[\\\"meta_type\\\",\\\"meta_id\\\"]}],\\\"version\\\":\\\"d3d39d7f\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:ProjectCollection\\\":{\\\"name\\\":\\\"projectcollection\\\",\\\"className\\\":\\\"ProjectCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:ProjectCollection\\\",\\\"collection\\\":\\\"projects\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/collections/Projects.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{},\\\"methods\\\":{\\\"findByTitle\\\":{\\\"name\\\":\\\"findByTitle\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"title\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Project | null>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findByOwner\\\":{\\\"name\\\":\\\"findByOwner\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"owner\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Project[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findByProvider\\\":{\\\"name\\\":\\\"findByProvider\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"providerType\\\",\\\"type\\\":\\\"ProjectProviderType\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Project[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getOrCreate\\\":{\\\"name\\\":\\\"getOrCreate\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"projectId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"object\\\",\\\"optional\\\":true,\\\"memberTypes\\\":[\\\"string\\\",\\\"ProjectProviderType\\\",\\\"Record<string, string>\\\"]}],\\\"returnType\\\":\\\"Promise<Project>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"syncAll\\\":{\\\"name\\\":\\\"syncAll\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"object\\\",\\\"optional\\\":true,\\\"memberTypes\\\":[\\\"boolean\\\"]}],\\\"returnType\\\":\\\"Promise<Project[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findWithItemsInStatus\\\":{\\\"name\\\":\\\"findWithItemsInStatus\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"status\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Project[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getStatistics\\\":{\\\"name\\\":\\\"getStatistics\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"projectId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<object>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findByTenant\\\":{\\\"name\\\":\\\"findByTenant\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"tenantId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Project[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findGlobal\\\":{\\\"name\\\":\\\"findGlobal\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<Project[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findWithGlobals\\\":{\\\"name\\\":\\\"findWithGlobals\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"tenantId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Project[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"api\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"create\\\",\\\"update\\\"]},\\\"mcp\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"]},\\\"cli\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"],\\\"skipApiCheck\\\":true}},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"Project\\\",\\\"exportName\\\":\\\"ProjectCollection\\\",\\\"collectionExportName\\\":\\\"ProjectCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"projects\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"projects\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"project_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"project_number\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"title\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"description\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"owner\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"url\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"provider_type\\\\\\\" TEXT DEFAULT 'github',\\\\n \\\\\\\"token_config_key\\\\\\\" TEXT DEFAULT 'GITHUB_TOKEN',\\\\n \\\\\\\"statuses\\\\\\\" JSON DEFAULT '[]',\\\\n \\\\\\\"fields\\\\\\\" JSON DEFAULT '[]',\\\\n \\\\\\\"status_field_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"status_options\\\\\\\" JSON DEFAULT '{}',\\\\n \\\\\\\"last_synced_at\\\\\\\" TIMESTAMP\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"project_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"project_number\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":0},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"description\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"owner\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"provider_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"github\\\"},\\\"token_config_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"GITHUB_TOKEN\\\"},\\\"statuses\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":[]},\\\"fields\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":[]},\\\"status_field_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"status_options\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":{}},\\\"last_synced_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"projects_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"projects_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"2e8c344a\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:PullRequestCollection\\\":{\\\"name\\\":\\\"pullrequestcollection\\\",\\\"className\\\":\\\"PullRequestCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:PullRequestCollection\\\",\\\"collection\\\":\\\"issues\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/collections/PullRequests.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{},\\\"methods\\\":{\\\"discover\\\":{\\\"name\\\":\\\"discover\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"object\\\",\\\"optional\\\":false,\\\"memberTypes\\\":[\\\"Repository\\\",\\\"SearchFilters\\\"]}],\\\"returnType\\\":\\\"Promise<PullRequest[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findByRepository\\\":{\\\"name\\\":\\\"findByRepository\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"repositoryId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<PullRequest[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findOpen\\\":{\\\"name\\\":\\\"findOpen\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"repositoryId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<PullRequest[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findDrafts\\\":{\\\"name\\\":\\\"findDrafts\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"repositoryId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<PullRequest[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findReadyToMerge\\\":{\\\"name\\\":\\\"findReadyToMerge\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"repositoryId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<PullRequest[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findByBranch\\\":{\\\"name\\\":\\\"findByBranch\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"branch\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"repositoryId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<PullRequest[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findByNumber\\\":{\\\"name\\\":\\\"findByNumber\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"repositoryId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"number\\\",\\\"type\\\":\\\"number\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<PullRequest | null>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findAIReadyToMerge\\\":{\\\"name\\\":\\\"findAIReadyToMerge\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"repositoryId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<PullRequest[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findBySize\\\":{\\\"name\\\":\\\"findBySize\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"size\\\",\\\"type\\\":\\\"'xs' | 's' | 'm' | 'l' | 'xl'\\\",\\\"optional\\\":false,\\\"unionBranches\\\":[{\\\"type\\\":\\\"'xs'\\\"},{\\\"type\\\":\\\"'s'\\\"},{\\\"type\\\":\\\"'m'\\\"},{\\\"type\\\":\\\"'l'\\\"},{\\\"type\\\":\\\"'xl'\\\"}]},{\\\"name\\\":\\\"repositoryId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<PullRequest[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"batchSync\\\":{\\\"name\\\":\\\"batchSync\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"repository\\\",\\\"type\\\":\\\"Repository\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"object\\\",\\\"optional\\\":true,\\\"memberTypes\\\":[\\\"boolean\\\"]}],\\\"returnType\\\":\\\"Promise<PullRequest[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findByTenant\\\":{\\\"name\\\":\\\"findByTenant\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"tenantId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<PullRequest[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findGlobal\\\":{\\\"name\\\":\\\"findGlobal\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<PullRequest[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findWithGlobals\\\":{\\\"name\\\":\\\"findWithGlobals\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"tenantId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<PullRequest[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"issues\\\",\\\"api\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"create\\\",\\\"update\\\"]},\\\"mcp\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"]},\\\"cli\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"],\\\"skipApiCheck\\\":true}},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"PullRequest\\\",\\\"exportName\\\":\\\"PullRequestCollection\\\",\\\"collectionExportName\\\":\\\"PullRequestCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"issues\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"issues\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"repository_id\\\\\\\" UUID,\\\\n \\\\\\\"project_id\\\\\\\" UUID,\\\\n \\\\\\\"number\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"node_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"title\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"body\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"state\\\\\\\" TEXT DEFAULT 'open',\\\\n \\\\\\\"author\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"labels\\\\\\\" JSON DEFAULT '[]',\\\\n \\\\\\\"assignees\\\\\\\" JSON DEFAULT '[]',\\\\n \\\\\\\"comments_count\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"last_synced_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"original_body\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"synthesis_count\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"head_ref\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"base_ref\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"merged\\\\\\\" BOOLEAN DEFAULT FALSE,\\\\n \\\\\\\"merged_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"mergeable\\\\\\\" BOOLEAN DEFAULT TRUE,\\\\n \\\\\\\"draft\\\\\\\" BOOLEAN DEFAULT FALSE,\\\\n \\\\\\\"additions\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"deletions\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"changed_files\\\\\\\" INTEGER DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"repository_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"repositories\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"project_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"projects\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"number\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"node_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"state\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"open\\\"},\\\"author\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"labels\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false,\\\"default\\\":[]},\\\"assignees\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false,\\\"default\\\":[]},\\\"comments_count\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"last_synced_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false},\\\"original_body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"synthesis_count\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"head_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"base_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"merged\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":false,\\\"default\\\":false},\\\"merged_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false},\\\"mergeable\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":false,\\\"default\\\":true},\\\"draft\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":false,\\\"default\\\":false},\\\"additions\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"deletions\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"changed_files\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"issues_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"issues_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"issues_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"issues_repository_id_idx\\\",\\\"columns\\\":[\\\"repository_id\\\"]},{\\\"name\\\":\\\"issues_project_id_idx\\\",\\\"columns\\\":[\\\"project_id\\\"]}],\\\"version\\\":\\\"0ebf6fbd\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:RepositoryCollection\\\":{\\\"name\\\":\\\"repositorycollection\\\",\\\"className\\\":\\\"RepositoryCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:RepositoryCollection\\\",\\\"collection\\\":\\\"repositories\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/collections/Repositories.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{},\\\"methods\\\":{\\\"findByFullName\\\":{\\\"name\\\":\\\"findByFullName\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"owner\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"name\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Repository | null>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findByOwner\\\":{\\\"name\\\":\\\"findByOwner\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"owner\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Repository[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findByProvider\\\":{\\\"name\\\":\\\"findByProvider\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"providerType\\\",\\\"type\\\":\\\"RepositoryProviderType\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Repository[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getOrCreate\\\":{\\\"name\\\":\\\"getOrCreate\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"owner\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"name\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"object\\\",\\\"optional\\\":true,\\\"memberTypes\\\":[\\\"RepositoryProviderType\\\",\\\"string\\\"]}],\\\"returnType\\\":\\\"Promise<Repository>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"syncAll\\\":{\\\"name\\\":\\\"syncAll\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"object\\\",\\\"optional\\\":true,\\\"memberTypes\\\":[\\\"boolean\\\"]}],\\\"returnType\\\":\\\"Promise<Repository[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findWithOpenIssues\\\":{\\\"name\\\":\\\"findWithOpenIssues\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<Repository[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findByTenant\\\":{\\\"name\\\":\\\"findByTenant\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"tenantId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Repository[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findGlobal\\\":{\\\"name\\\":\\\"findGlobal\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<Repository[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findWithGlobals\\\":{\\\"name\\\":\\\"findWithGlobals\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"tenantId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Repository[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"api\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"create\\\",\\\"update\\\"]},\\\"mcp\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"]},\\\"cli\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"create\\\"],\\\"skipApiCheck\\\":true}},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"Repository\\\",\\\"exportName\\\":\\\"RepositoryCollection\\\",\\\"collectionExportName\\\":\\\"RepositoryCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"repositories\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"repositories\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"owner\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"name\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"full_name\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"description\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"default_branch\\\\\\\" TEXT DEFAULT 'main',\\\\n \\\\\\\"is_private\\\\\\\" BOOLEAN DEFAULT FALSE,\\\\n \\\\\\\"provider_type\\\\\\\" TEXT DEFAULT 'github',\\\\n \\\\\\\"base_url\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"token_config_key\\\\\\\" TEXT DEFAULT 'GITHUB_TOKEN',\\\\n \\\\\\\"last_synced_at\\\\\\\" TIMESTAMP\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"owner\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"name\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"full_name\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"description\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"default_branch\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"main\\\"},\\\"is_private\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":false},\\\"provider_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"github\\\"},\\\"base_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"token_config_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"GITHUB_TOKEN\\\"},\\\"last_synced_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"repositories_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"repositories_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"c302a5e5\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:Comment\\\":{\\\"name\\\":\\\"comment\\\",\\\"className\\\":\\\"Comment\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:Comment\\\",\\\"collection\\\":\\\"comments\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/Comment.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"nullable\\\":true,\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":false,\\\"autoPopulate\\\":true,\\\"nullable\\\":true,\\\"mode\\\":\\\"optional\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"issueId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"Issue\\\",\\\"description\\\":\\\"The issue this comment is on.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"The issue this comment is on.\\\"}},\\\"commentId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"body\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"description\\\":\\\"The comment text.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"The comment text.\\\"}},\\\"author\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"description\\\":\\\"Who wrote it.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"Who wrote it.\\\"}},\\\"createdAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"updatedAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"url\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"}},\\\"methods\\\":{\\\"isQuestion\\\":{\\\"name\\\":\\\"isQuestion\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<boolean>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"isApproval\\\":{\\\"name\\\":\\\"isApproval\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<boolean>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"requestsChanges\\\":{\\\"name\\\":\\\"requestsChanges\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<boolean>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"extractActionItems\\\":{\\\"name\\\":\\\"extractActionItems\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<string[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"summarize\\\":{\\\"name\\\":\\\"summarize\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<string>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getSentiment\\\":{\\\"name\\\":\\\"getSentiment\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<CommentSentiment>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"api\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"]},\\\"mcp\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"]},\\\"cli\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"]},\\\"tenantScoped\\\":{\\\"mode\\\":\\\"optional\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"Comment\\\",\\\"collectionExportName\\\":\\\"CommentCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"comments\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"comments\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"issue_id\\\\\\\" UUID,\\\\n \\\\\\\"comment_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"body\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"author\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"url\\\\\\\" TEXT DEFAULT ''\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"issue_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"issues\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"comment_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"author\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"}},\\\"indexes\\\":[{\\\"name\\\":\\\"comments_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"comments_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"comments_issue_id_idx\\\",\\\"columns\\\":[\\\"issue_id\\\"]}],\\\"version\\\":\\\"ffcc1937\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:DevelopmentRequest\\\":{\\\"name\\\":\\\"developmentrequest\\\",\\\"className\\\":\\\"DevelopmentRequest\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:DevelopmentRequest\\\",\\\"collection\\\":\\\"developmentrequests\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/DevelopmentRequest.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"projectId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"integrationId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"ProjectIntegration\\\"},\\\"requesterId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"participantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"type\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"feature\\\"},\\\"description\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"evidence\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"[]\\\"},\\\"visibility\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"requester\\\",\\\"enum\\\":[\\\"requester\\\",\\\"workspace\\\",\\\"public\\\",\\\"project_team\\\",\\\"internal\\\"]},\\\"origin\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"managed-app\\\"},\\\"discussion\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"status\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"submitted\\\",\\\"enum\\\":[\\\"submitted\\\",\\\"triaged\\\",\\\"planned\\\",\\\"in_progress\\\",\\\"completed\\\",\\\"declined\\\"]}},\\\"methods\\\":{\\\"initialize\\\":{\\\"name\\\":\\\"initialize\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getEvidence\\\":{\\\"name\\\":\\\"getEvidence\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"DevelopmentRequestEvidence[]\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"setEvidence\\\":{\\\"name\\\":\\\"setEvidence\\\",\\\"async\\\":false,\\\"parameters\\\":[{\\\"name\\\":\\\"value\\\",\\\"type\\\":\\\"DevelopmentRequestEvidence[] | string\\\",\\\"optional\\\":false,\\\"unionBranches\\\":[{\\\"type\\\":\\\"DevelopmentRequestEvidence[]\\\"},{\\\"type\\\":\\\"string\\\"}]}],\\\"returnType\\\":\\\"void\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"development_requests\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"DevelopmentRequest\\\",\\\"collectionExportName\\\":\\\"DevelopmentRequestCollection\\\",\\\"validationRules\\\":[],\\\"schema\\\":{\\\"tableName\\\":\\\"development_requests\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"development_requests\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"project_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"integration_id\\\\\\\" UUID,\\\\n \\\\\\\"requester_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"participant_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"type\\\\\\\" TEXT DEFAULT 'feature',\\\\n \\\\\\\"description\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"evidence\\\\\\\" TEXT DEFAULT '[]',\\\\n \\\\\\\"visibility\\\\\\\" TEXT DEFAULT 'requester',\\\\n \\\\\\\"origin\\\\\\\" TEXT DEFAULT 'managed-app',\\\\n \\\\\\\"discussion\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'submitted'\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"project_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"integration_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"project_integrations\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"requester_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"participant_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"feature\\\"},\\\"description\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"evidence\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"[]\\\"},\\\"visibility\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"requester\\\"},\\\"origin\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"managed-app\\\"},\\\"discussion\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"submitted\\\"}},\\\"indexes\\\":[{\\\"name\\\":\\\"development_requests_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"development_requests_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"development_requests_integration_id_idx\\\",\\\"columns\\\":[\\\"integration_id\\\"]}],\\\"version\\\":\\\"2f7f7c8a\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:DevelopmentRequestHistory\\\":{\\\"name\\\":\\\"developmentrequesthistory\\\",\\\"className\\\":\\\"DevelopmentRequestHistory\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:DevelopmentRequestHistory\\\",\\\"collection\\\":\\\"developmentrequesthistories\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/DevelopmentRequestHistory.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"requestId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"DevelopmentRequest\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"fromStatus\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"toStatus\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"submitted\\\",\\\"enum\\\":[\\\"submitted\\\",\\\"triaged\\\",\\\"planned\\\",\\\"in_progress\\\",\\\"completed\\\",\\\"declined\\\"]},\\\"actorType\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"system\\\",\\\"enum\\\":[\\\"integration\\\",\\\"participant\\\",\\\"system\\\"]},\\\"actorId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"note\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"development_request_histories\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"DevelopmentRequestHistory\\\",\\\"collectionExportName\\\":\\\"DevelopmentRequestHistoryCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"requestId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"development_request_histories\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"development_request_histories\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"request_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"from_status\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"to_status\\\\\\\" TEXT DEFAULT 'submitted',\\\\n \\\\\\\"actor_type\\\\\\\" TEXT DEFAULT 'system',\\\\n \\\\\\\"actor_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"note\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"request_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"development_requests\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"from_status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"to_status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"submitted\\\"},\\\"actor_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"system\\\"},\\\"actor_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"note\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"development_request_histories_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"development_request_histories_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"development_request_histories_request_id_idx\\\",\\\"columns\\\":[\\\"request_id\\\"]}],\\\"version\\\":\\\"67389678\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:Issue\\\":{\\\"name\\\":\\\"issue\\\",\\\"className\\\":\\\"Issue\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:Issue\\\",\\\"collection\\\":\\\"issues\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/Issue.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"created_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"updated_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"nullable\\\":true,\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":false,\\\"autoPopulate\\\":true,\\\"nullable\\\":true,\\\"mode\\\":\\\"optional\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"repositoryId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"Repository\\\"},\\\"projectId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"Project\\\",\\\"description\\\":\\\"The project this issue belongs to.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"The project this issue belongs to.\\\"}},\\\"number\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"default\\\":0},\\\"nodeId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"title\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"description\\\":\\\"A short summary of the issue.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"A short summary of the issue.\\\"}},\\\"body\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"description\\\":\\\"The full description.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"The full description.\\\"}},\\\"state\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"open\\\",\\\"description\\\":\\\"open or closed.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"open or closed.\\\"},\\\"enum\\\":[\\\"open\\\",\\\"closed\\\"]},\\\"author\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"description\\\":\\\"Who raised the issue.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"Who raised the issue.\\\"}},\\\"labels\\\":{\\\"type\\\":\\\"json\\\",\\\"required\\\":false,\\\"default\\\":[],\\\"description\\\":\\\"The labels attached to the issue.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"The labels attached to the issue.\\\"}},\\\"assignees\\\":{\\\"type\\\":\\\"json\\\",\\\"required\\\":false,\\\"default\\\":[],\\\"description\\\":\\\"The people working on it.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"The people working on it.\\\"}},\\\"commentsCount\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"default\\\":0},\\\"lastSyncedAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"originalBody\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"synthesisCount\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"default\\\":0}},\\\"methods\\\":{\\\"hasRepository\\\":{\\\"name\\\":\\\"hasRepository\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"boolean\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getRepository\\\":{\\\"name\\\":\\\"getRepository\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<Repository>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getClient\\\":{\\\"name\\\":\\\"getClient\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<IRepository>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"clearCache\\\":{\\\"name\\\":\\\"clearCache\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"void\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"sync\\\":{\\\"name\\\":\\\"sync\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SyncOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getComments\\\":{\\\"name\\\":\\\"getComments\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<Comment[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"addComment\\\":{\\\"name\\\":\\\"addComment\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"body\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Comment>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"incorporateFeedback\\\":{\\\"name\\\":\\\"incorporateFeedback\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"IncorporateFeedbackOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<IncorporateFeedbackResult>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"rollback\\\":{\\\"name\\\":\\\"rollback\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<object>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"needsReview\\\":{\\\"name\\\":\\\"needsReview\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<boolean>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"isBugReport\\\":{\\\"name\\\":\\\"isBugReport\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<boolean>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"isFeatureRequest\\\":{\\\"name\\\":\\\"isFeatureRequest\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<boolean>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"suggestLabels\\\":{\\\"name\\\":\\\"suggestLabels\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"vocabulary\\\",\\\"type\\\":\\\"IssueLabelVocabulary\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<string[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"close\\\":{\\\"name\\\":\\\"close\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"addLabels\\\":{\\\"name\\\":\\\"addLabels\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"labels\\\",\\\"type\\\":\\\"string[]\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"removeLabel\\\":{\\\"name\\\":\\\"removeLabel\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"label\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"assign\\\":{\\\"name\\\":\\\"assign\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"assignees\\\",\\\"type\\\":\\\"string[]\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getUrl\\\":{\\\"name\\\":\\\"getUrl\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"string\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableStrategy\\\":\\\"sti\\\",\\\"api\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"create\\\",\\\"update\\\"]},\\\"mcp\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"sync\\\",\\\"incorporateFeedback\\\"]},\\\"cli\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"sync\\\",\\\"incorporateFeedback\\\",\\\"rollback\\\"],\\\"skipApiCheck\\\":true},\\\"tenantScoped\\\":{\\\"mode\\\":\\\"optional\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"Issue\\\",\\\"collectionExportName\\\":\\\"IssueCollection\\\",\\\"displayLabelField\\\":\\\"title\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"issues\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"issues\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"repository_id\\\\\\\" UUID,\\\\n \\\\\\\"project_id\\\\\\\" UUID,\\\\n \\\\\\\"number\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"node_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"title\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"body\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"state\\\\\\\" TEXT DEFAULT 'open',\\\\n \\\\\\\"author\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"labels\\\\\\\" JSON DEFAULT '[]',\\\\n \\\\\\\"assignees\\\\\\\" JSON DEFAULT '[]',\\\\n \\\\\\\"comments_count\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"last_synced_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"original_body\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"synthesis_count\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"head_ref\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"base_ref\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"merged\\\\\\\" BOOLEAN DEFAULT FALSE,\\\\n \\\\\\\"merged_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"mergeable\\\\\\\" BOOLEAN DEFAULT TRUE,\\\\n \\\\\\\"draft\\\\\\\" BOOLEAN DEFAULT FALSE,\\\\n \\\\\\\"additions\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"deletions\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"changed_files\\\\\\\" INTEGER DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"repository_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"repositories\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"project_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"projects\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"number\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"node_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"state\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"open\\\"},\\\"author\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"labels\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false,\\\"default\\\":[]},\\\"assignees\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false,\\\"default\\\":[]},\\\"comments_count\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"last_synced_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false},\\\"original_body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"synthesis_count\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"head_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"base_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"merged\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":false,\\\"default\\\":false},\\\"merged_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false},\\\"mergeable\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":false,\\\"default\\\":true},\\\"draft\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":false,\\\"default\\\":false},\\\"additions\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"deletions\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"changed_files\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"issues_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"issues_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"issues_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"issues_repository_id_idx\\\",\\\"columns\\\":[\\\"repository_id\\\"]},{\\\"name\\\":\\\"issues_project_id_idx\\\",\\\"columns\\\":[\\\"project_id\\\"]}],\\\"version\\\":\\\"83fb5e05\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:Label\\\":{\\\"name\\\":\\\"label\\\",\\\"className\\\":\\\"Label\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:Label\\\",\\\"collection\\\":\\\"labels\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/Label.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"repositoryId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"Repository\\\"},\\\"projectId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"Project\\\",\\\"description\\\":\\\"The project this label belongs to.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"The project this label belongs to.\\\"}},\\\"name\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"description\\\":\\\"The label's name, for example bug.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"The label's name, for example bug.\\\"}},\\\"color\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"description\\\":\\\"The label's colour.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"The label's colour.\\\"}},\\\"description\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"description\\\":\\\"What the label means.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"What the label means.\\\"}}},\\\"methods\\\":{\\\"isTypeLabel\\\":{\\\"name\\\":\\\"isTypeLabel\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"boolean\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"isPriorityLabel\\\":{\\\"name\\\":\\\"isPriorityLabel\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"boolean\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"isStatusLabel\\\":{\\\"name\\\":\\\"isStatusLabel\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"boolean\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getCategory\\\":{\\\"name\\\":\\\"getCategory\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"'type' | 'priority' | 'status' | 'area' | 'other'\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getPriorityLevel\\\":{\\\"name\\\":\\\"getPriorityLevel\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"number | null\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getHexColor\\\":{\\\"name\\\":\\\"getHexColor\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"string\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"createInRepository\\\":{\\\"name\\\":\\\"createInRepository\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"updateInRepository\\\":{\\\"name\\\":\\\"updateInRepository\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"api\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"create\\\",\\\"update\\\",\\\"delete\\\"]},\\\"mcp\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"create\\\"]},\\\"cli\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"create\\\",\\\"update\\\",\\\"delete\\\"]}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"Label\\\",\\\"collectionExportName\\\":\\\"LabelCollection\\\",\\\"displayLabelField\\\":\\\"name\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"labels\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"labels\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"repository_id\\\\\\\" UUID,\\\\n \\\\\\\"project_id\\\\\\\" UUID,\\\\n \\\\\\\"name\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"color\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"description\\\\\\\" TEXT DEFAULT ''\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"repository_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"repositories\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"project_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"projects\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"name\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"color\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"description\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"}},\\\"indexes\\\":[{\\\"name\\\":\\\"labels_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"labels_created_at_idx\\\",\\\"columns\\\":[\\\"created_at\\\"]},{\\\"name\\\":\\\"labels_repository_id_idx\\\",\\\"columns\\\":[\\\"repository_id\\\"]},{\\\"name\\\":\\\"labels_project_id_idx\\\",\\\"columns\\\":[\\\"project_id\\\"]}],\\\"version\\\":\\\"664f110a\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:Project\\\":{\\\"name\\\":\\\"project\\\",\\\"className\\\":\\\"Project\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:Project\\\",\\\"collection\\\":\\\"projects\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/Project.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"nullable\\\":true,\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":false,\\\"autoPopulate\\\":true,\\\"nullable\\\":true,\\\"mode\\\":\\\"optional\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"projectId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"projectNumber\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"default\\\":0},\\\"title\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"description\\\":\\\"The project's name.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"The project's name.\\\"}},\\\"description\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"description\\\":\\\"What the project is about.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"What the project is about.\\\"}},\\\"owner\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"description\\\":\\\"Who owns or runs the project.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"Who owns or runs the project.\\\"}},\\\"url\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"description\\\":\\\"A link to the project elsewhere.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"A link to the project elsewhere.\\\"}},\\\"providerType\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"github\\\",\\\"enum\\\":[\\\"github\\\",\\\"jira\\\",\\\"linear\\\",\\\"zenhub\\\"]},\\\"tokenConfigKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"GITHUB_TOKEN\\\"},\\\"statuses\\\":{\\\"type\\\":\\\"json\\\",\\\"required\\\":false,\\\"default\\\":[]},\\\"fields\\\":{\\\"type\\\":\\\"json\\\",\\\"required\\\":false,\\\"default\\\":[]},\\\"statusFieldId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"statusOptions\\\":{\\\"type\\\":\\\"json\\\",\\\"required\\\":false,\\\"default\\\":{}},\\\"lastSyncedAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"getClient\\\":{\\\"name\\\":\\\"getClient\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<IProject>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"clearClient\\\":{\\\"name\\\":\\\"clearClient\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"void\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"sync\\\":{\\\"name\\\":\\\"sync\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SyncOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"addItem\\\":{\\\"name\\\":\\\"addItem\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"item\\\",\\\"type\\\":\\\"Issue | PullRequest\\\",\\\"optional\\\":false,\\\"unionBranches\\\":[{\\\"type\\\":\\\"Issue\\\"},{\\\"type\\\":\\\"PullRequest\\\"}]}],\\\"returnType\\\":\\\"Promise<ProjectItem>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"removeItem\\\":{\\\"name\\\":\\\"removeItem\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"itemId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getItem\\\":{\\\"name\\\":\\\"getItem\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"itemId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<ProjectItem | null>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"listItems\\\":{\\\"name\\\":\\\"listItems\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"filters\\\",\\\"type\\\":\\\"ItemFilters\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<ProjectItem[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"updateItemStatus\\\":{\\\"name\\\":\\\"updateItemStatus\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"itemId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"status\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"updateItemField\\\":{\\\"name\\\":\\\"updateItemField\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"itemId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"fieldId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"value\\\",\\\"type\\\":\\\"unknown\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getStatuses\\\":{\\\"name\\\":\\\"getStatuses\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<ProjectStatus[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getFields\\\":{\\\"name\\\":\\\"getFields\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<ProjectField[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getItemsByStatus\\\":{\\\"name\\\":\\\"getItemsByStatus\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"status\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<ProjectItem[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"moveItem\\\":{\\\"name\\\":\\\"moveItem\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"item\\\",\\\"type\\\":\\\"Issue | PullRequest\\\",\\\"optional\\\":false,\\\"unionBranches\\\":[{\\\"type\\\":\\\"Issue\\\"},{\\\"type\\\":\\\"PullRequest\\\"}]},{\\\"name\\\":\\\"status\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"analyzeHealth\\\":{\\\"name\\\":\\\"analyzeHealth\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<string>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getByTitle\\\":{\\\"name\\\":\\\"getByTitle\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"title\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtObjectOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<Project | null>\\\",\\\"isStatic\\\":true,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"api\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"create\\\",\\\"update\\\"]},\\\"mcp\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"sync\\\",\\\"addItem\\\",\\\"updateItemStatus\\\"]},\\\"cli\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"sync\\\",\\\"addItem\\\",\\\"updateItemStatus\\\",\\\"listItems\\\"],\\\"skipApiCheck\\\":true},\\\"tenantScoped\\\":{\\\"mode\\\":\\\"optional\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"Project\\\",\\\"collectionExportName\\\":\\\"ProjectCollection\\\",\\\"displayLabelField\\\":\\\"title\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"projects\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"projects\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"project_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"project_number\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"title\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"description\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"owner\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"url\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"provider_type\\\\\\\" TEXT DEFAULT 'github',\\\\n \\\\\\\"token_config_key\\\\\\\" TEXT DEFAULT 'GITHUB_TOKEN',\\\\n \\\\\\\"statuses\\\\\\\" JSON DEFAULT '[]',\\\\n \\\\\\\"fields\\\\\\\" JSON DEFAULT '[]',\\\\n \\\\\\\"status_field_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"status_options\\\\\\\" JSON DEFAULT '{}',\\\\n \\\\\\\"last_synced_at\\\\\\\" TIMESTAMP\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"project_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"project_number\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":0},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"description\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"owner\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"provider_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"github\\\"},\\\"token_config_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"GITHUB_TOKEN\\\"},\\\"statuses\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":[]},\\\"fields\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":[]},\\\"status_field_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"status_options\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":{}},\\\"last_synced_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"projects_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"projects_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"2e8c344a\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:ProjectDecision\\\":{\\\"name\\\":\\\"projectdecision\\\",\\\"className\\\":\\\"ProjectDecision\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:ProjectDecision\\\",\\\"collection\\\":\\\"projectdecisions\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/ProjectDecision.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"metaType\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"metaId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"role\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"sortOrder\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"default\\\":0},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"question\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"decisionOptions\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"outcome\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"rationale\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"status\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"default\\\":\\\"open\\\",\\\"_meta\\\":{\\\"required\\\":true},\\\"enum\\\":[\\\"open\\\",\\\"decided\\\",\\\"deferred\\\",\\\"superseded\\\"]},\\\"ownerType\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"enum\\\":[\\\"user\\\",\\\"agent\\\",\\\"system\\\",\\\"\\\"]},\\\"ownerId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"visibility\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"internal\\\",\\\"enum\\\":[\\\"internal\\\",\\\"client\\\"]},\\\"contextReferences\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"revision\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":1},\\\"decidedAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"nullable\\\":true}}},\\\"methods\\\":{\\\"hydrate\\\":{\\\"name\\\":\\\"hydrate\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<T | null>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getOptions\\\":{\\\"name\\\":\\\"getOptions\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"ProjectDecisionOption[]\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"setOptions\\\":{\\\"name\\\":\\\"setOptions\\\",\\\"async\\\":false,\\\"parameters\\\":[{\\\"name\\\":\\\"value\\\",\\\"type\\\":\\\"ProjectDecisionOption[]\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"void\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getContextReferences\\\":{\\\"name\\\":\\\"getContextReferences\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"ProjectContextReference[]\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"setContextReferences\\\":{\\\"name\\\":\\\"setContextReferences\\\",\\\"async\\\":false,\\\"parameters\\\":[{\\\"name\\\":\\\"value\\\",\\\"type\\\":\\\"ProjectContextReference[]\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"void\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"project_decisions\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"indexes\\\":[{\\\"name\\\":\\\"project_decisions_project_status_idx\\\",\\\"columns\\\":[\\\"tenantId\\\",\\\"metaType\\\",\\\"metaId\\\",\\\"status\\\",\\\"createdAt\\\"]},{\\\"name\\\":\\\"project_decisions_owner_status_idx\\\",\\\"columns\\\":[\\\"tenantId\\\",\\\"ownerType\\\",\\\"ownerId\\\",\\\"status\\\"]}],\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtPolymorphicAssociation\\\",\\\"exportName\\\":\\\"ProjectDecision\\\",\\\"collectionExportName\\\":\\\"ProjectDecisionCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"metaType\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"metaId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"role\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"question\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"status\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"revision\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"project_decisions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"project_decisions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"meta_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"role\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"question\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"decision_options\\\\\\\" TEXT,\\\\n \\\\\\\"outcome\\\\\\\" TEXT,\\\\n \\\\\\\"rationale\\\\\\\" TEXT,\\\\n \\\\\\\"status\\\\\\\" TEXT NOT NULL DEFAULT 'open',\\\\n \\\\\\\"owner_type\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"owner_id\\\\\\\" TEXT,\\\\n \\\\\\\"visibility\\\\\\\" TEXT DEFAULT 'internal',\\\\n \\\\\\\"context_references\\\\\\\" TEXT,\\\\n \\\\\\\"revision\\\\\\\" INTEGER NOT NULL DEFAULT 1,\\\\n \\\\\\\"decided_at\\\\\\\" TIMESTAMP\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"meta_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"role\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":0},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"question\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"decision_options\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"outcome\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"rationale\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"open\\\"},\\\"owner_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"owner_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"visibility\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"internal\\\"},\\\"context_references\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"revision\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":1},\\\"decided_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"project_decisions_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"project_decisions_project_status_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"meta_type\\\",\\\"meta_id\\\",\\\"status\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"project_decisions_owner_status_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"owner_type\\\",\\\"owner_id\\\",\\\"status\\\"]},{\\\"name\\\":\\\"project_decisions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"project_decisions_meta_type_meta_id_idx\\\",\\\"columns\\\":[\\\"meta_type\\\",\\\"meta_id\\\"]}],\\\"version\\\":\\\"34ed60f9\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:ProjectGovernanceEvent\\\":{\\\"name\\\":\\\"projectgovernanceevent\\\",\\\"className\\\":\\\"ProjectGovernanceEvent\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:ProjectGovernanceEvent\\\",\\\"collection\\\":\\\"projectgovernanceevents\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/ProjectGovernanceEvent.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"metaType\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"metaId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"role\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"sortOrder\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"default\\\":0},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"recordKind\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"default\\\":\\\"question\\\",\\\"_meta\\\":{\\\"required\\\":true},\\\"enum\\\":[\\\"question\\\",\\\"decision\\\"]},\\\"action\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"default\\\":\\\"created\\\",\\\"_meta\\\":{\\\"required\\\":true},\\\"enum\\\":[\\\"created\\\",\\\"assigned\\\",\\\"answered\\\",\\\"decided\\\",\\\"deferred\\\",\\\"reopened\\\",\\\"superseded\\\"]},\\\"actorType\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"default\\\":\\\"system\\\",\\\"_meta\\\":{\\\"required\\\":true},\\\"enum\\\":[\\\"user\\\",\\\"agent\\\",\\\"system\\\"]},\\\"actorId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"fromStatus\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"toStatus\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"note\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"value\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"rationale\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"answerSelection\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"_meta\\\":{\\\"default\\\":\\\"\\\"}},\\\"revision\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":1},\\\"fromOwnerType\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"enum\\\":[\\\"user\\\",\\\"agent\\\",\\\"system\\\",\\\"\\\"]},\\\"fromOwnerId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"toOwnerType\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"enum\\\":[\\\"user\\\",\\\"agent\\\",\\\"system\\\",\\\"\\\"]},\\\"toOwnerId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"hydrate\\\":{\\\"name\\\":\\\"hydrate\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<T | null>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getAnswerSelection\\\":{\\\"name\\\":\\\"getAnswerSelection\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"ProjectQuestionAnswerSelection | null\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"beforeDelete\\\":{\\\"name\\\":\\\"beforeDelete\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"project_governance_events\\\",\\\"hooks\\\":{\\\"beforeDelete\\\":\\\"beforeDelete\\\"},\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"indexes\\\":[{\\\"name\\\":\\\"project_governance_events_record_idx\\\",\\\"columns\\\":[\\\"tenantId\\\",\\\"metaType\\\",\\\"metaId\\\",\\\"createdAt\\\"]}],\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtPolymorphicAssociation\\\",\\\"exportName\\\":\\\"ProjectGovernanceEvent\\\",\\\"collectionExportName\\\":\\\"ProjectGovernanceEventCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"metaType\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"metaId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"role\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"recordKind\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"action\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"actorType\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"actorId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"toStatus\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"revision\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"project_governance_events\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"project_governance_events\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"meta_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"role\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"record_kind\\\\\\\" TEXT NOT NULL DEFAULT 'question',\\\\n \\\\\\\"action\\\\\\\" TEXT NOT NULL DEFAULT 'created',\\\\n \\\\\\\"actor_type\\\\\\\" TEXT NOT NULL DEFAULT 'system',\\\\n \\\\\\\"actor_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"from_status\\\\\\\" TEXT,\\\\n \\\\\\\"to_status\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"note\\\\\\\" TEXT,\\\\n \\\\\\\"value\\\\\\\" TEXT,\\\\n \\\\\\\"rationale\\\\\\\" TEXT,\\\\n \\\\\\\"answer_selection\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"revision\\\\\\\" INTEGER NOT NULL DEFAULT 1,\\\\n \\\\\\\"from_owner_type\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"from_owner_id\\\\\\\" TEXT,\\\\n \\\\\\\"to_owner_type\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"to_owner_id\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"meta_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"role\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":0},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"record_kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"question\\\"},\\\"action\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"created\\\"},\\\"actor_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"system\\\"},\\\"actor_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"from_status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"to_status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"note\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"value\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"rationale\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"answer_selection\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"revision\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":1},\\\"from_owner_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"from_owner_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"to_owner_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"to_owner_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"project_governance_events_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"project_governance_events_record_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"meta_type\\\",\\\"meta_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"project_governance_events_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"project_governance_events_meta_type_meta_id_idx\\\",\\\"columns\\\":[\\\"meta_type\\\",\\\"meta_id\\\"]}],\\\"version\\\":\\\"e903aea4\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:ProjectIntegration\\\":{\\\"name\\\":\\\"projectintegration\\\",\\\"className\\\":\\\"ProjectIntegration\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:ProjectIntegration\\\",\\\"collection\\\":\\\"projectintegrations\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/ProjectIntegration.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"projectId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"name\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"credentialHash\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"_meta\\\":{\\\"sensitive\\\":true},\\\"sensitive\\\":true},\\\"capabilities\\\":{\\\"type\\\":\\\"json\\\",\\\"required\\\":false,\\\"default\\\":[]},\\\"status\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"active\\\",\\\"enum\\\":[\\\"active\\\",\\\"revoked\\\"]},\\\"revokedAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"hasCapability\\\":{\\\"name\\\":\\\"hasCapability\\\",\\\"async\\\":false,\\\"parameters\\\":[{\\\"name\\\":\\\"capability\\\",\\\"type\\\":\\\"ProjectIntegrationCapability\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"boolean\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"isActive\\\":{\\\"name\\\":\\\"isActive\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"boolean\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"project_integrations\\\",\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"project_id\\\",\\\"name\\\"],\\\"api\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"]},\\\"mcp\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"]},\\\"cli\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\"]},\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"ProjectIntegration\\\",\\\"collectionExportName\\\":\\\"ProjectIntegrationCollection\\\",\\\"displayLabelField\\\":\\\"name\\\",\\\"validationRules\\\":[],\\\"schema\\\":{\\\"tableName\\\":\\\"project_integrations\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"project_integrations\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"project_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"name\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"credential_hash\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"capabilities\\\\\\\" JSON DEFAULT '[]',\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'active',\\\\n \\\\\\\"revoked_at\\\\\\\" TIMESTAMP\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"project_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"name\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"credential_hash\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"capabilities\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":[]},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"active\\\"},\\\"revoked_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"project_integrations_tenant_id_project_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"project_id\\\",\\\"name\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"project_integrations_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"project_integrations_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"bfbaa783\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:ProjectIntegrationAudit\\\":{\\\"name\\\":\\\"projectintegrationaudit\\\",\\\"className\\\":\\\"ProjectIntegrationAudit\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:ProjectIntegrationAudit\\\",\\\"collection\\\":\\\"projectintegrationaudits\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/ProjectIntegrationAudit.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"integrationId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"ProjectIntegration\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"action\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"created\\\",\\\"enum\\\":[\\\"created\\\",\\\"rotated\\\",\\\"revoked\\\"]},\\\"note\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"project_integration_audits\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"ProjectIntegrationAudit\\\",\\\"collectionExportName\\\":\\\"ProjectIntegrationAuditCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"integrationId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"project_integration_audits\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"project_integration_audits\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"integration_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"action\\\\\\\" TEXT DEFAULT 'created',\\\\n \\\\\\\"note\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"integration_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"project_integrations\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"action\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"created\\\"},\\\"note\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"project_integration_audits_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"project_integration_audits_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"project_integration_audits_integration_id_idx\\\",\\\"columns\\\":[\\\"integration_id\\\"]}],\\\"version\\\":\\\"03cc10a2\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:ProjectQuestion\\\":{\\\"name\\\":\\\"projectquestion\\\",\\\"className\\\":\\\"ProjectQuestion\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:ProjectQuestion\\\",\\\"collection\\\":\\\"projectquestions\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/ProjectQuestion.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"metaType\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"metaId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"role\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"sortOrder\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"default\\\":0},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"prompt\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"answer\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"questionOptions\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"[]\\\",\\\"_meta\\\":{\\\"default\\\":\\\"[]\\\"}},\\\"selectedOptionId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"_meta\\\":{\\\"default\\\":\\\"\\\"}},\\\"status\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"default\\\":\\\"open\\\",\\\"_meta\\\":{\\\"required\\\":true},\\\"enum\\\":[\\\"open\\\",\\\"answered\\\",\\\"deferred\\\",\\\"superseded\\\"]},\\\"ownerType\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"enum\\\":[\\\"user\\\",\\\"agent\\\",\\\"system\\\",\\\"\\\"]},\\\"ownerId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"visibility\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"internal\\\",\\\"enum\\\":[\\\"internal\\\",\\\"client\\\"]},\\\"contextReferences\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"revision\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":1},\\\"answeredAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"nullable\\\":true}}},\\\"methods\\\":{\\\"hydrate\\\":{\\\"name\\\":\\\"hydrate\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<T | null>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getOptions\\\":{\\\"name\\\":\\\"getOptions\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"ProjectQuestionOption[]\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"setOptions\\\":{\\\"name\\\":\\\"setOptions\\\",\\\"async\\\":false,\\\"parameters\\\":[{\\\"name\\\":\\\"value\\\",\\\"type\\\":\\\"ProjectQuestionOption[]\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"void\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getContextReferences\\\":{\\\"name\\\":\\\"getContextReferences\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"ProjectContextReference[]\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"setContextReferences\\\":{\\\"name\\\":\\\"setContextReferences\\\",\\\"async\\\":false,\\\"parameters\\\":[{\\\"name\\\":\\\"value\\\",\\\"type\\\":\\\"ProjectContextReference[]\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"void\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"project_questions\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"indexes\\\":[{\\\"name\\\":\\\"project_questions_project_status_idx\\\",\\\"columns\\\":[\\\"tenantId\\\",\\\"metaType\\\",\\\"metaId\\\",\\\"status\\\",\\\"createdAt\\\"]},{\\\"name\\\":\\\"project_questions_owner_status_idx\\\",\\\"columns\\\":[\\\"tenantId\\\",\\\"ownerType\\\",\\\"ownerId\\\",\\\"status\\\"]}],\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtPolymorphicAssociation\\\",\\\"exportName\\\":\\\"ProjectQuestion\\\",\\\"collectionExportName\\\":\\\"ProjectQuestionCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"metaType\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"metaId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"role\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"prompt\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"status\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"revision\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"project_questions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"project_questions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"meta_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"role\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"prompt\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"answer\\\\\\\" TEXT,\\\\n \\\\\\\"question_options\\\\\\\" TEXT DEFAULT '[]',\\\\n \\\\\\\"selected_option_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"status\\\\\\\" TEXT NOT NULL DEFAULT 'open',\\\\n \\\\\\\"owner_type\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"owner_id\\\\\\\" TEXT,\\\\n \\\\\\\"visibility\\\\\\\" TEXT DEFAULT 'internal',\\\\n \\\\\\\"context_references\\\\\\\" TEXT,\\\\n \\\\\\\"revision\\\\\\\" INTEGER NOT NULL DEFAULT 1,\\\\n \\\\\\\"answered_at\\\\\\\" TIMESTAMP\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"meta_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"role\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":0},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"prompt\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"answer\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"question_options\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"[]\\\"},\\\"selected_option_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"open\\\"},\\\"owner_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"owner_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"visibility\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"internal\\\"},\\\"context_references\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"revision\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":1},\\\"answered_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"project_questions_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"project_questions_project_status_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"meta_type\\\",\\\"meta_id\\\",\\\"status\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"project_questions_owner_status_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"owner_type\\\",\\\"owner_id\\\",\\\"status\\\"]},{\\\"name\\\":\\\"project_questions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"project_questions_meta_type_meta_id_idx\\\",\\\"columns\\\":[\\\"meta_type\\\",\\\"meta_id\\\"]}],\\\"version\\\":\\\"9bf3b915\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:ProjectSpecification\\\":{\\\"name\\\":\\\"projectspecification\\\",\\\"className\\\":\\\"ProjectSpecification\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:ProjectSpecification\\\",\\\"collection\\\":\\\"projectspecifications\\\",\\\"description\\\":\\\"Canonical project requirements and their portable application cookbook.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/ProjectSpecification.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"metaType\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"metaId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"role\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"sortOrder\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"default\\\":0},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"title\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"summary\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"cookbook\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"revision\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":1},\\\"actorType\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"actorId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"hydrate\\\":{\\\"name\\\":\\\"hydrate\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<T | null>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getCookbook\\\":{\\\"name\\\":\\\"getCookbook\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Cookbook\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"project_specifications\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"meta_type\\\",\\\"meta_id\\\"],\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtPolymorphicAssociation\\\",\\\"exportName\\\":\\\"ProjectSpecification\\\",\\\"collectionExportName\\\":\\\"ProjectSpecificationCollection\\\",\\\"displayLabelField\\\":\\\"title\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"metaType\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"metaId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"role\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"title\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"revision\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"project_specifications\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"project_specifications\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"meta_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"role\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"title\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"summary\\\\\\\" TEXT,\\\\n \\\\\\\"cookbook\\\\\\\" TEXT,\\\\n \\\\\\\"revision\\\\\\\" INTEGER NOT NULL DEFAULT 1,\\\\n \\\\\\\"actor_type\\\\\\\" TEXT,\\\\n \\\\\\\"actor_id\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"meta_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"role\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":0},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"summary\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"cookbook\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"revision\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":1},\\\"actor_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"actor_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"project_specifications_tenant_id_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"meta_type\\\",\\\"meta_id\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"project_specifications_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"project_specifications_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"project_specifications_meta_type_meta_id_idx\\\",\\\"columns\\\":[\\\"meta_type\\\",\\\"meta_id\\\"]}],\\\"version\\\":\\\"d3d39d7f\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:PullRequest\\\":{\\\"name\\\":\\\"pullrequest\\\",\\\"className\\\":\\\"PullRequest\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:PullRequest\\\",\\\"collection\\\":\\\"issues\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/PullRequest.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"created_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"updated_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"nullable\\\":true,\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":false,\\\"autoPopulate\\\":true,\\\"nullable\\\":true,\\\"mode\\\":\\\"optional\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"repositoryId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"Repository\\\"},\\\"projectId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"Project\\\",\\\"description\\\":\\\"The project this issue belongs to.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"The project this issue belongs to.\\\"}},\\\"number\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"default\\\":0},\\\"nodeId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"title\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"description\\\":\\\"A short summary of the issue.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"A short summary of the issue.\\\"}},\\\"body\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"description\\\":\\\"The full description.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"The full description.\\\"}},\\\"state\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"open\\\",\\\"description\\\":\\\"open or closed.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"open or closed.\\\"},\\\"enum\\\":[\\\"open\\\",\\\"closed\\\"]},\\\"author\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"description\\\":\\\"Who raised the issue.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"Who raised the issue.\\\"}},\\\"labels\\\":{\\\"type\\\":\\\"json\\\",\\\"required\\\":false,\\\"default\\\":[],\\\"description\\\":\\\"The labels attached to the issue.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"The labels attached to the issue.\\\"}},\\\"assignees\\\":{\\\"type\\\":\\\"json\\\",\\\"required\\\":false,\\\"default\\\":[],\\\"description\\\":\\\"The people working on it.\\\",\\\"_meta\\\":{\\\"description\\\":\\\"The people working on it.\\\"}},\\\"commentsCount\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"default\\\":0},\\\"lastSyncedAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"originalBody\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"synthesisCount\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"default\\\":0},\\\"headRef\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"baseRef\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"merged\\\":{\\\"type\\\":\\\"boolean\\\",\\\"required\\\":false,\\\"default\\\":false},\\\"mergedAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"mergeable\\\":{\\\"type\\\":\\\"boolean\\\",\\\"required\\\":false,\\\"default\\\":true},\\\"draft\\\":{\\\"type\\\":\\\"boolean\\\",\\\"required\\\":false,\\\"default\\\":false},\\\"additions\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"default\\\":0},\\\"deletions\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"default\\\":0},\\\"changedFiles\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"default\\\":0}},\\\"methods\\\":{\\\"hasRepository\\\":{\\\"name\\\":\\\"hasRepository\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"boolean\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getRepository\\\":{\\\"name\\\":\\\"getRepository\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<Repository>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getClient\\\":{\\\"name\\\":\\\"getClient\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<IRepository>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"clearCache\\\":{\\\"name\\\":\\\"clearCache\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"void\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"sync\\\":{\\\"name\\\":\\\"sync\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SyncOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getComments\\\":{\\\"name\\\":\\\"getComments\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<Comment[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"addComment\\\":{\\\"name\\\":\\\"addComment\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"body\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Comment>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"incorporateFeedback\\\":{\\\"name\\\":\\\"incorporateFeedback\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"IncorporateFeedbackOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<IncorporateFeedbackResult>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"rollback\\\":{\\\"name\\\":\\\"rollback\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<object>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"needsReview\\\":{\\\"name\\\":\\\"needsReview\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<boolean>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"isBugReport\\\":{\\\"name\\\":\\\"isBugReport\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<boolean>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"isFeatureRequest\\\":{\\\"name\\\":\\\"isFeatureRequest\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<boolean>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"suggestLabels\\\":{\\\"name\\\":\\\"suggestLabels\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"vocabulary\\\",\\\"type\\\":\\\"IssueLabelVocabulary\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<string[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"close\\\":{\\\"name\\\":\\\"close\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"addLabels\\\":{\\\"name\\\":\\\"addLabels\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"labels\\\",\\\"type\\\":\\\"string[]\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"removeLabel\\\":{\\\"name\\\":\\\"removeLabel\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"label\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"assign\\\":{\\\"name\\\":\\\"assign\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"assignees\\\",\\\"type\\\":\\\"string[]\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getUrl\\\":{\\\"name\\\":\\\"getUrl\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"string\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"summarize\\\":{\\\"name\\\":\\\"summarize\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<string>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"merge\\\":{\\\"name\\\":\\\"merge\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"method\\\",\\\"type\\\":\\\"MergeMethod\\\",\\\"optional\\\":true,\\\"default\\\":\\\"squash\\\"}],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"markReady\\\":{\\\"name\\\":\\\"markReady\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"convertToDraft\\\":{\\\"name\\\":\\\"convertToDraft\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"requestReviewers\\\":{\\\"name\\\":\\\"requestReviewers\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"reviewers\\\",\\\"type\\\":\\\"string[]\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findLinkedIssue\\\":{\\\"name\\\":\\\"findLinkedIssue\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<Issue | null>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"isReadyToMerge\\\":{\\\"name\\\":\\\"isReadyToMerge\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<boolean>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"suggestReviewers\\\":{\\\"name\\\":\\\"suggestReviewers\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<string[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getChangeSize\\\":{\\\"name\\\":\\\"getChangeSize\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"'xs' | 's' | 'm' | 'l' | 'xl'\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"api\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"create\\\",\\\"update\\\"]},\\\"mcp\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"sync\\\",\\\"summarize\\\",\\\"merge\\\"]},\\\"cli\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"sync\\\",\\\"summarize\\\",\\\"merge\\\",\\\"markReady\\\"],\\\"skipApiCheck\\\":true},\\\"tenantScoped\\\":{\\\"mode\\\":\\\"optional\\\"},\\\"tableName\\\":\\\"issues\\\",\\\"tableStrategy\\\":\\\"sti\\\"},\\\"extends\\\":\\\"Issue\\\",\\\"exportName\\\":\\\"PullRequest\\\",\\\"collectionExportName\\\":\\\"PullRequestCollection\\\",\\\"displayLabelField\\\":\\\"title\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"issues\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"issues\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"repository_id\\\\\\\" UUID,\\\\n \\\\\\\"project_id\\\\\\\" UUID,\\\\n \\\\\\\"number\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"node_id\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"title\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"body\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"state\\\\\\\" TEXT DEFAULT 'open',\\\\n \\\\\\\"author\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"labels\\\\\\\" JSON DEFAULT '[]',\\\\n \\\\\\\"assignees\\\\\\\" JSON DEFAULT '[]',\\\\n \\\\\\\"comments_count\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"last_synced_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"original_body\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"synthesis_count\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"head_ref\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"base_ref\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"merged\\\\\\\" BOOLEAN DEFAULT FALSE,\\\\n \\\\\\\"merged_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"mergeable\\\\\\\" BOOLEAN DEFAULT TRUE,\\\\n \\\\\\\"draft\\\\\\\" BOOLEAN DEFAULT FALSE,\\\\n \\\\\\\"additions\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"deletions\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"changed_files\\\\\\\" INTEGER DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"repository_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"repositories\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"project_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"projects\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"number\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"node_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"state\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"open\\\"},\\\"author\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"labels\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false,\\\"default\\\":[]},\\\"assignees\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false,\\\"default\\\":[]},\\\"comments_count\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"last_synced_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false},\\\"original_body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"synthesis_count\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"head_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"base_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"\\\"},\\\"merged\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":false,\\\"default\\\":false},\\\"merged_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false},\\\"mergeable\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":false,\\\"default\\\":true},\\\"draft\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":false,\\\"default\\\":false},\\\"additions\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"deletions\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"changed_files\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"issues_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"issues_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"issues_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"issues_repository_id_idx\\\",\\\"columns\\\":[\\\"repository_id\\\"]},{\\\"name\\\":\\\"issues_project_id_idx\\\",\\\"columns\\\":[\\\"project_id\\\"]}],\\\"version\\\":\\\"0ebf6fbd\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:Repository\\\":{\\\"name\\\":\\\"repository\\\",\\\"className\\\":\\\"Repository\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:Repository\\\",\\\"collection\\\":\\\"repositories\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/Repository.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"nullable\\\":true,\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":false,\\\"autoPopulate\\\":true,\\\"nullable\\\":true,\\\"mode\\\":\\\"optional\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"owner\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"name\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"fullName\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"description\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"defaultBranch\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"main\\\"},\\\"isPrivate\\\":{\\\"type\\\":\\\"boolean\\\",\\\"required\\\":false,\\\"default\\\":false},\\\"providerType\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"github\\\",\\\"enum\\\":[\\\"github\\\",\\\"gitlab\\\",\\\"bitbucket\\\",\\\"azure\\\"]},\\\"baseUrl\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"tokenConfigKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"GITHUB_TOKEN\\\"},\\\"lastSyncedAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"getClient\\\":{\\\"name\\\":\\\"getClient\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<IRepository>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"clearClient\\\":{\\\"name\\\":\\\"clearClient\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"void\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"sync\\\":{\\\"name\\\":\\\"sync\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SyncOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getIssues\\\":{\\\"name\\\":\\\"getIssues\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"filters\\\",\\\"type\\\":\\\"SearchFilters\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<Issue[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getPullRequests\\\":{\\\"name\\\":\\\"getPullRequests\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"filters\\\",\\\"type\\\":\\\"SearchFilters\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<PullRequest[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"createIssue\\\":{\\\"name\\\":\\\"createIssue\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"data\\\",\\\"type\\\":\\\"CreateIssueInput\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Issue>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"createPullRequest\\\":{\\\"name\\\":\\\"createPullRequest\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"data\\\",\\\"type\\\":\\\"CreatePRInput\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<PullRequest>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"hasOpenIssuesMatching\\\":{\\\"name\\\":\\\"hasOpenIssuesMatching\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"criteria\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<boolean>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"summarizeActivity\\\":{\\\"name\\\":\\\"summarizeActivity\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<string>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getByFullName\\\":{\\\"name\\\":\\\"getByFullName\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"owner\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"name\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtObjectOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<Repository | null>\\\",\\\"isStatic\\\":true,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"api\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"create\\\",\\\"update\\\"]},\\\"mcp\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"sync\\\"]},\\\"cli\\\":{\\\"include\\\":[\\\"list\\\",\\\"get\\\",\\\"sync\\\",\\\"create\\\"],\\\"skipApiCheck\\\":true},\\\"tenantScoped\\\":{\\\"mode\\\":\\\"optional\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"Repository\\\",\\\"collectionExportName\\\":\\\"RepositoryCollection\\\",\\\"displayLabelField\\\":\\\"name\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"repositories\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"repositories\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"owner\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"name\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"full_name\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"description\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"default_branch\\\\\\\" TEXT DEFAULT 'main',\\\\n \\\\\\\"is_private\\\\\\\" BOOLEAN DEFAULT FALSE,\\\\n \\\\\\\"provider_type\\\\\\\" TEXT DEFAULT 'github',\\\\n \\\\\\\"base_url\\\\\\\" TEXT DEFAULT '',\\\\n \\\\\\\"token_config_key\\\\\\\" TEXT DEFAULT 'GITHUB_TOKEN',\\\\n \\\\\\\"last_synced_at\\\\\\\" TIMESTAMP\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"owner\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"name\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"full_name\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"description\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"default_branch\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"main\\\"},\\\"is_private\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":false},\\\"provider_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"github\\\"},\\\"base_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"token_config_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"GITHUB_TOKEN\\\"},\\\"last_synced_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"repositories_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"repositories_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"c302a5e5\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:DevelopmentRequestWorkLink\\\":{\\\"name\\\":\\\"developmentrequestworklink\\\",\\\"className\\\":\\\"DevelopmentRequestWorkLink\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:DevelopmentRequestWorkLink\\\",\\\"collection\\\":\\\"developmentrequestworklinks\\\",\\\"description\\\":\\\"Provider-neutral connection from a Development Request to canonical work.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/delivery-control-plane.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"requestId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"DevelopmentRequest\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"workItemType\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"workItemId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"canonicalStatus\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"providerRef\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"metadata\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"lastProjectedAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false}},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"development_request_work_links\\\",\\\"conflictColumns\\\":[\\\"request_id\\\",\\\"work_item_type\\\",\\\"work_item_id\\\"],\\\"api\\\":false,\\\"cli\\\":false,\\\"mcp\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"DevelopmentRequestWorkLink\\\",\\\"collectionExportName\\\":\\\"DevelopmentRequestWorkLinkCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"requestId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"development_request_work_links\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"development_request_work_links\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"request_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"work_item_type\\\\\\\" TEXT,\\\\n \\\\\\\"work_item_id\\\\\\\" TEXT,\\\\n \\\\\\\"canonical_status\\\\\\\" TEXT,\\\\n \\\\\\\"provider_ref\\\\\\\" TEXT,\\\\n \\\\\\\"metadata\\\\\\\" TEXT,\\\\n \\\\\\\"last_projected_at\\\\\\\" TIMESTAMP\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"request_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"development_requests\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"work_item_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"work_item_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"canonical_status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"provider_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"metadata\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"last_projected_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"development_request_work_links_request_id_work_item_type_idx\\\",\\\"columns\\\":[\\\"request_id\\\",\\\"work_item_type\\\",\\\"work_item_id\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"development_request_work_links_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"development_request_work_links_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"adcbaa21\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:ProjectDeliveryEvent\\\":{\\\"name\\\":\\\"projectdeliveryevent\\\",\\\"className\\\":\\\"ProjectDeliveryEvent\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:ProjectDeliveryEvent\\\",\\\"collection\\\":\\\"projectdeliveryevents\\\",\\\"description\\\":\\\"Ordered, idempotent delivery update emitted by the control plane.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/delivery-control-plane.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"integrationId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"ProjectIntegration\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"requestId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"DevelopmentRequest\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"idempotencyKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"sequence\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"default\\\":0},\\\"type\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{},\\\"enum\\\":[\\\"work_linked\\\",\\\"branch\\\",\\\"pull_request\\\",\\\"ci\\\",\\\"preview\\\",\\\"approval\\\",\\\"deployment\\\",\\\"completed\\\",\\\"rejected\\\"]},\\\"payload\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"occurredAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"deliveredAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"deliveryAttempts\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"default\\\":0},\\\"lastDeliveryError\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}}},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"project_delivery_events\\\",\\\"conflictColumns\\\":[\\\"integration_id\\\",\\\"idempotency_key\\\"],\\\"api\\\":false,\\\"cli\\\":false,\\\"mcp\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"ProjectDeliveryEvent\\\",\\\"collectionExportName\\\":\\\"ProjectDeliveryEventCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"integrationId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"requestId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"project_delivery_events\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"project_delivery_events\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"integration_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"request_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"idempotency_key\\\\\\\" TEXT,\\\\n \\\\\\\"sequence\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"type\\\\\\\" TEXT,\\\\n \\\\\\\"payload\\\\\\\" TEXT,\\\\n \\\\\\\"occurred_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"delivered_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"delivery_attempts\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"last_delivery_error\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"integration_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"project_integrations\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"request_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"development_requests\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"idempotency_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"sequence\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":0},\\\"type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"payload\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"occurred_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"delivered_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"delivery_attempts\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":0},\\\"last_delivery_error\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"project_delivery_events_integration_id_idempotency_key_idx\\\",\\\"columns\\\":[\\\"integration_id\\\",\\\"idempotency_key\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"project_delivery_events_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"project_delivery_events_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"project_delivery_events_request_id_idx\\\",\\\"columns\\\":[\\\"request_id\\\"]}],\\\"version\\\":\\\"99b9e301\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:PreviewApproval\\\":{\\\"name\\\":\\\"previewapproval\\\",\\\"className\\\":\\\"PreviewApproval\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:PreviewApproval\\\",\\\"collection\\\":\\\"previewapprovals\\\",\\\"description\\\":\\\"Client decision state for one preview produced during delivery.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/delivery-control-plane.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"requestId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"DevelopmentRequest\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"previewId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"previewUrl\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"status\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{},\\\"enum\\\":[\\\"pending\\\",\\\"approved\\\",\\\"rejected\\\",\\\"stale\\\"]},\\\"decidedByRef\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"reason\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"createdAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"decidedAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"staleAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false}},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"preview_approvals\\\",\\\"conflictColumns\\\":[\\\"request_id\\\",\\\"preview_id\\\"],\\\"api\\\":false,\\\"cli\\\":false,\\\"mcp\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"PreviewApproval\\\",\\\"collectionExportName\\\":\\\"PreviewApprovalCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"requestId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"preview_approvals\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"preview_approvals\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"request_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"preview_id\\\\\\\" TEXT,\\\\n \\\\\\\"preview_url\\\\\\\" TEXT,\\\\n \\\\\\\"status\\\\\\\" TEXT,\\\\n \\\\\\\"decided_by_ref\\\\\\\" TEXT,\\\\n \\\\\\\"reason\\\\\\\" TEXT,\\\\n \\\\\\\"decided_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"stale_at\\\\\\\" TIMESTAMP\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"request_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"development_requests\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"preview_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"preview_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"decided_by_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"reason\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"decided_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"stale_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"preview_approvals_request_id_preview_id_idx\\\",\\\"columns\\\":[\\\"request_id\\\",\\\"preview_id\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"preview_approvals_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"preview_approvals_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"ec7b2b14\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:AssistanceRequest\\\":{\\\"name\\\":\\\"assistancerequest\\\",\\\"className\\\":\\\"AssistanceRequest\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:AssistanceRequest\\\",\\\"collection\\\":\\\"assistancerequests\\\",\\\"description\\\":\\\"Lossless conversational intake before support/development classification.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/delivery-control-plane.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"integrationId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"ProjectIntegration\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"requesterId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"subject\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"applicationContext\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"conversation\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"evidence\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"classification\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{},\\\"enum\\\":[\\\"unclassified\\\",\\\"support\\\",\\\"development\\\",\\\"both\\\"]},\\\"supportCaseId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"developmentRequestId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"deliveryHandoffLinkedAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"createdAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false}},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"assistance_requests\\\",\\\"api\\\":false,\\\"cli\\\":false,\\\"mcp\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"AssistanceRequest\\\",\\\"collectionExportName\\\":\\\"AssistanceRequestCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"integrationId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"assistance_requests\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"assistance_requests\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"integration_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"requester_id\\\\\\\" TEXT,\\\\n \\\\\\\"subject\\\\\\\" TEXT,\\\\n \\\\\\\"application_context\\\\\\\" TEXT,\\\\n \\\\\\\"conversation\\\\\\\" TEXT,\\\\n \\\\\\\"evidence\\\\\\\" TEXT,\\\\n \\\\\\\"classification\\\\\\\" TEXT,\\\\n \\\\\\\"support_case_id\\\\\\\" TEXT,\\\\n \\\\\\\"development_request_id\\\\\\\" TEXT,\\\\n \\\\\\\"delivery_handoff_linked_at\\\\\\\" TIMESTAMP\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"integration_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"project_integrations\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"requester_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"subject\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"application_context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"conversation\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"evidence\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"classification\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"support_case_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"development_request_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"delivery_handoff_linked_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"assistance_requests_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"assistance_requests_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"assistance_requests_integration_id_idx\\\",\\\"columns\\\":[\\\"integration_id\\\"]}],\\\"version\\\":\\\"d1653259\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:AssistanceRequestEvent\\\":{\\\"name\\\":\\\"assistancerequestevent\\\",\\\"className\\\":\\\"AssistanceRequestEvent\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:AssistanceRequestEvent\\\",\\\"collection\\\":\\\"assistancerequestevents\\\",\\\"description\\\":\\\"Append-only explanation of Assistance Request routing decisions.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/delivery-control-plane.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"assistanceRequestId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"AssistanceRequest\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"priorClassification\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{},\\\"enum\\\":[\\\"unclassified\\\",\\\"support\\\",\\\"development\\\",\\\"both\\\"]},\\\"resultingClassification\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{},\\\"enum\\\":[\\\"unclassified\\\",\\\"support\\\",\\\"development\\\",\\\"both\\\"]},\\\"actorRef\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"reason\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"resultingLinks\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"occurredAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false}},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"assistance_request_events\\\",\\\"api\\\":false,\\\"cli\\\":false,\\\"mcp\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"AssistanceRequestEvent\\\",\\\"collectionExportName\\\":\\\"AssistanceRequestEventCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"assistanceRequestId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"assistance_request_events\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"assistance_request_events\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"assistance_request_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"prior_classification\\\\\\\" TEXT,\\\\n \\\\\\\"resulting_classification\\\\\\\" TEXT,\\\\n \\\\\\\"actor_ref\\\\\\\" TEXT,\\\\n \\\\\\\"reason\\\\\\\" TEXT,\\\\n \\\\\\\"resulting_links\\\\\\\" TEXT,\\\\n \\\\\\\"occurred_at\\\\\\\" TIMESTAMP\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"assistance_request_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"assistance_requests\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"prior_classification\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"resulting_classification\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"actor_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"reason\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"resulting_links\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"occurred_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"assistance_request_events_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"assistance_request_events_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"assistance_request_events_assistance_request_id_idx\\\",\\\"columns\\\":[\\\"assistance_request_id\\\"]}],\\\"version\\\":\\\"bcc95ebe\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:DevelopmentRequestWorkLinkCollection\\\":{\\\"name\\\":\\\"developmentrequestworklinkcollection\\\",\\\"className\\\":\\\"DevelopmentRequestWorkLinkCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:DevelopmentRequestWorkLinkCollection\\\",\\\"collection\\\":\\\"developmentrequestworklinks\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/delivery-control-plane.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"development_request_work_links\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"DevelopmentRequestWorkLink\\\",\\\"exportName\\\":\\\"DevelopmentRequestWorkLinkCollection\\\",\\\"collectionExportName\\\":\\\"DevelopmentRequestWorkLinkCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"development_request_work_links\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"development_request_work_links\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"request_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"work_item_type\\\\\\\" TEXT,\\\\n \\\\\\\"work_item_id\\\\\\\" TEXT,\\\\n \\\\\\\"canonical_status\\\\\\\" TEXT,\\\\n \\\\\\\"provider_ref\\\\\\\" TEXT,\\\\n \\\\\\\"metadata\\\\\\\" TEXT,\\\\n \\\\\\\"last_projected_at\\\\\\\" TIMESTAMP\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"request_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"development_requests\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"work_item_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"work_item_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"canonical_status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"provider_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"metadata\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"last_projected_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"development_request_work_links_request_id_work_item_type_idx\\\",\\\"columns\\\":[\\\"request_id\\\",\\\"work_item_type\\\",\\\"work_item_id\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"development_request_work_links_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"development_request_work_links_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"adcbaa21\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:ProjectDeliveryEventCollection\\\":{\\\"name\\\":\\\"projectdeliveryeventcollection\\\",\\\"className\\\":\\\"ProjectDeliveryEventCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:ProjectDeliveryEventCollection\\\",\\\"collection\\\":\\\"projectdeliveryevents\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/delivery-control-plane.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"project_delivery_events\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"ProjectDeliveryEvent\\\",\\\"exportName\\\":\\\"ProjectDeliveryEventCollection\\\",\\\"collectionExportName\\\":\\\"ProjectDeliveryEventCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"project_delivery_events\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"project_delivery_events\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"integration_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"request_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"idempotency_key\\\\\\\" TEXT,\\\\n \\\\\\\"sequence\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"type\\\\\\\" TEXT,\\\\n \\\\\\\"payload\\\\\\\" TEXT,\\\\n \\\\\\\"occurred_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"delivered_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"delivery_attempts\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"last_delivery_error\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"integration_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"project_integrations\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"request_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"development_requests\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"idempotency_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"sequence\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":0},\\\"type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"payload\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"occurred_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"delivered_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"delivery_attempts\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":0},\\\"last_delivery_error\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"project_delivery_events_integration_id_idempotency_key_idx\\\",\\\"columns\\\":[\\\"integration_id\\\",\\\"idempotency_key\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"project_delivery_events_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"project_delivery_events_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"project_delivery_events_request_id_idx\\\",\\\"columns\\\":[\\\"request_id\\\"]}],\\\"version\\\":\\\"99b9e301\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:PreviewApprovalCollection\\\":{\\\"name\\\":\\\"previewapprovalcollection\\\",\\\"className\\\":\\\"PreviewApprovalCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:PreviewApprovalCollection\\\",\\\"collection\\\":\\\"previewapprovals\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/delivery-control-plane.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"preview_approvals\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"PreviewApproval\\\",\\\"exportName\\\":\\\"PreviewApprovalCollection\\\",\\\"collectionExportName\\\":\\\"PreviewApprovalCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"preview_approvals\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"preview_approvals\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"request_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"preview_id\\\\\\\" TEXT,\\\\n \\\\\\\"preview_url\\\\\\\" TEXT,\\\\n \\\\\\\"status\\\\\\\" TEXT,\\\\n \\\\\\\"decided_by_ref\\\\\\\" TEXT,\\\\n \\\\\\\"reason\\\\\\\" TEXT,\\\\n \\\\\\\"decided_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"stale_at\\\\\\\" TIMESTAMP\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"request_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"development_requests\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"preview_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"preview_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"decided_by_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"reason\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"decided_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"stale_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"preview_approvals_request_id_preview_id_idx\\\",\\\"columns\\\":[\\\"request_id\\\",\\\"preview_id\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"preview_approvals_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"preview_approvals_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"ec7b2b14\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:AssistanceRequestCollection\\\":{\\\"name\\\":\\\"assistancerequestcollection\\\",\\\"className\\\":\\\"AssistanceRequestCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:AssistanceRequestCollection\\\",\\\"collection\\\":\\\"assistancerequests\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/delivery-control-plane.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"assistance_requests\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"AssistanceRequest\\\",\\\"exportName\\\":\\\"AssistanceRequestCollection\\\",\\\"collectionExportName\\\":\\\"AssistanceRequestCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"assistance_requests\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"assistance_requests\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"integration_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"requester_id\\\\\\\" TEXT,\\\\n \\\\\\\"subject\\\\\\\" TEXT,\\\\n \\\\\\\"application_context\\\\\\\" TEXT,\\\\n \\\\\\\"conversation\\\\\\\" TEXT,\\\\n \\\\\\\"evidence\\\\\\\" TEXT,\\\\n \\\\\\\"classification\\\\\\\" TEXT,\\\\n \\\\\\\"support_case_id\\\\\\\" TEXT,\\\\n \\\\\\\"development_request_id\\\\\\\" TEXT,\\\\n \\\\\\\"delivery_handoff_linked_at\\\\\\\" TIMESTAMP\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"integration_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"project_integrations\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"requester_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"subject\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"application_context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"conversation\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"evidence\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"classification\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"support_case_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"development_request_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"delivery_handoff_linked_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"assistance_requests_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"assistance_requests_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"assistance_requests_integration_id_idx\\\",\\\"columns\\\":[\\\"integration_id\\\"]}],\\\"version\\\":\\\"d1653259\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"},\\\"@happyvertical/smrt-projects:AssistanceRequestEventCollection\\\":{\\\"name\\\":\\\"assistancerequesteventcollection\\\",\\\"className\\\":\\\"AssistanceRequestEventCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-projects:AssistanceRequestEventCollection\\\",\\\"collection\\\":\\\"assistancerequestevents\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/projects/src/models/delivery-control-plane.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-projects\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"assistance_request_events\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"AssistanceRequestEvent\\\",\\\"exportName\\\":\\\"AssistanceRequestEventCollection\\\",\\\"collectionExportName\\\":\\\"AssistanceRequestEventCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"assistance_request_events\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"assistance_request_events\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"assistance_request_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"prior_classification\\\\\\\" TEXT,\\\\n \\\\\\\"resulting_classification\\\\\\\" TEXT,\\\\n \\\\\\\"actor_ref\\\\\\\" TEXT,\\\\n \\\\\\\"reason\\\\\\\" TEXT,\\\\n \\\\\\\"resulting_links\\\\\\\" TEXT,\\\\n \\\\\\\"occurred_at\\\\\\\" TIMESTAMP\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"assistance_request_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"assistance_requests\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"prior_classification\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"resulting_classification\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"actor_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"reason\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"resulting_links\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"occurred_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"assistance_request_events_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"assistance_request_events_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"assistance_request_events_assistance_request_id_idx\\\",\\\"columns\\\":[\\\"assistance_request_id\\\"]}],\\\"version\\\":\\\"bcc95ebe\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-projects\\\"}},\\\"moduleType\\\":\\\"smrt\\\",\\\"recipes\\\":[{\\\"id\\\":\\\"projects.tracker\\\",\\\"className\\\":\\\"ProjectTrackerRecipe\\\",\\\"label\\\":\\\"Projects\\\",\\\"summary\\\":\\\"Track projects and the issues, labels and comments inside them.\\\",\\\"synonyms\\\":[\\\"issues\\\",\\\"tasks\\\",\\\"tickets\\\",\\\"bugs\\\",\\\"kanban\\\"],\\\"models\\\":[\\\"@happyvertical/smrt-projects:Project\\\",\\\"@happyvertical/smrt-projects:Issue\\\",\\\"@happyvertical/smrt-projects:Label\\\",\\\"@happyvertical/smrt-projects:Comment\\\"],\\\"nav\\\":[{\\\"label\\\":\\\"All projects\\\",\\\"model\\\":\\\"@happyvertical/smrt-projects:Project\\\",\\\"icon\\\":\\\"folder\\\",\\\"description\\\":\\\"Bigger jobs broken into steps you can follow.\\\"},{\\\"label\\\":\\\"Issues\\\",\\\"model\\\":\\\"@happyvertical/smrt-projects:Issue\\\",\\\"icon\\\":\\\"wrench\\\",\\\"description\\\":\\\"Problems and to-dos to track until they are done.\\\"},{\\\"label\\\":\\\"Labels\\\",\\\"model\\\":\\\"@happyvertical/smrt-projects:Label\\\",\\\"icon\\\":\\\"tag\\\",\\\"description\\\":\\\"Tags to sort your projects and issues your way.\\\"}],\\\"requires\\\":[],\\\"section\\\":{\\\"id\\\":\\\"projects\\\",\\\"label\\\":\\\"Projects\\\",\\\"icon\\\":\\\"briefcase\\\",\\\"description\\\":\\\"Projects, their issues, labels and comments.\\\"},\\\"options\\\":{\\\"@happyvertical/smrt-projects:Project\\\":{\\\"fields\\\":{\\\"projectId\\\":{\\\"visibility\\\":\\\"hidden\\\"},\\\"projectNumber\\\":{\\\"visibility\\\":\\\"hidden\\\"},\\\"providerType\\\":{\\\"visibility\\\":\\\"hidden\\\"},\\\"tokenConfigKey\\\":{\\\"visibility\\\":\\\"hidden\\\"},\\\"statuses\\\":{\\\"visibility\\\":\\\"hidden\\\"},\\\"fields\\\":{\\\"visibility\\\":\\\"hidden\\\"},\\\"statusFieldId\\\":{\\\"visibility\\\":\\\"hidden\\\"},\\\"statusOptions\\\":{\\\"visibility\\\":\\\"hidden\\\"},\\\"lastSyncedAt\\\":{\\\"visibility\\\":\\\"hidden\\\"}}},\\\"@happyvertical/smrt-projects:Issue\\\":{\\\"fields\\\":{\\\"nodeId\\\":{\\\"visibility\\\":\\\"hidden\\\"},\\\"originalBody\\\":{\\\"visibility\\\":\\\"hidden\\\"},\\\"synthesisCount\\\":{\\\"visibility\\\":\\\"hidden\\\"},\\\"lastSyncedAt\\\":{\\\"visibility\\\":\\\"hidden\\\"},\\\"commentsCount\\\":{\\\"visibility\\\":\\\"hidden\\\"},\\\"repositoryId\\\":{\\\"visibility\\\":\\\"hidden\\\"},\\\"number\\\":{\\\"visibility\\\":\\\"hidden\\\"}}},\\\"@happyvertical/smrt-projects:Comment\\\":{\\\"fields\\\":{\\\"commentId\\\":{\\\"visibility\\\":\\\"hidden\\\"},\\\"url\\\":{\\\"visibility\\\":\\\"hidden\\\"}}},\\\"@happyvertical/smrt-projects:Label\\\":{\\\"fields\\\":{\\\"repositoryId\\\":{\\\"visibility\\\":\\\"hidden\\\"}}}},\\\"help\\\":{\\\"markdown\\\":\\\"## Overview\\\\n\\\\nProjects tracks the work you are planning: projects, the issues in them, and\\\\nthe labels and comments that organise them.\\\\n\\\\n## Tasks\\\\n\\\\n### Start a project\\\\n\\\\n1. Create a new project.\\\\n2. Give it a **{field:title}** and a **{field:description}**.\\\\n\\\\n### Log an issue\\\\n\\\\n1. Create a new issue and pick the **{field:projectId}**.\\\\n2. Write a **{field:title}** and a **{field:body}**.\\\\n3. Close it by setting **{field:state}** to closed. Comments are attached to the\\\\n issue.\\\\n\\\",\\\"fieldRefs\\\":[\\\"body\\\",\\\"description\\\",\\\"projectId\\\",\\\"state\\\",\\\"title\\\"]},\\\"demo\\\":{\\\"mode\\\":\\\"server\\\",\\\"reasons\\\":[\\\"Needs a server because its package does not build for a browser: node:crypto/async_hooks; core migrations; repos and ai SDKs; and its package depends on @happyvertical/smrt-profiles, @happyvertical/smrt-subscriptions, @happyvertical/smrt-tenancy, @happyvertical/smrt-timesheets, @happyvertical/smrt-users, which do not build for a browser (#3617, #3624, #3626, #3627).\\\"]}}],\\\"smrtDependencies\\\":[\\\"@happyvertical/smrt-core\\\",\\\"@happyvertical/smrt-prompts\\\",\\\"@happyvertical/smrt-subscriptions\\\",\\\"@happyvertical/smrt-tenancy\\\",\\\"@happyvertical/smrt-timesheets\\\"],\\\"browser\\\":{\\\"status\\\":\\\"server-only\\\",\\\"issues\\\":[\\\"#3617\\\",\\\"#3624\\\",\\\"#3626\\\",\\\"#3627\\\"],\\\"reason\\\":\\\"node:crypto/async_hooks; core migrations; repos and ai SDKs\\\",\\\"via\\\":[\\\"@happyvertical/smrt-profiles\\\",\\\"@happyvertical/smrt-subscriptions\\\",\\\"@happyvertical/smrt-tenancy\\\",\\\"@happyvertical/smrt-timesheets\\\",\\\"@happyvertical/smrt-users\\\"]},\\\"stampsConstructors\\\":true}\"));\n","/**\n * CommentCollection - Collection manager for Comment objects\n */\n\nimport { SmrtCollection } from '@happyvertical/smrt-core';\nimport { Comment } from '../models/Comment';\n\nexport class CommentCollection extends SmrtCollection<Comment> {\n static readonly _itemClass = Comment;\n}\n","import {\n foreignKey,\n SmrtObject,\n type SmrtObjectOptions,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport type { DevelopmentRequestStatus } from '../types';\n\nexport interface DevelopmentRequestHistoryOptions extends SmrtObjectOptions {\n tenantId?: string;\n requestId?: string;\n fromStatus?: string;\n toStatus?: DevelopmentRequestStatus;\n actorType?: 'integration' | 'participant' | 'system';\n actorId?: string;\n note?: string | null;\n}\n\n@TenantScoped({ mode: 'required' })\n@smrt({\n tableName: 'development_request_histories',\n api: false,\n mcp: false,\n cli: false,\n})\nexport class DevelopmentRequestHistory extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-projects\";\n @tenantId()\n tenantId: string = '';\n\n @foreignKey('DevelopmentRequest', { required: true })\n requestId: string = '';\n\n fromStatus: string = '';\n\n toStatus: DevelopmentRequestStatus = 'submitted';\n\n actorType: 'integration' | 'participant' | 'system' = 'system';\n\n actorId: string = '';\n\n note: string | null = null;\n\n constructor(options: DevelopmentRequestHistoryOptions = {}) {\n super(options);\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n if (options.requestId !== undefined) this.requestId = options.requestId;\n if (options.fromStatus !== undefined) this.fromStatus = options.fromStatus;\n if (options.toStatus !== undefined) this.toStatus = options.toStatus;\n if (options.actorType !== undefined) this.actorType = options.actorType;\n if (options.actorId !== undefined) this.actorId = options.actorId;\n if (options.note !== undefined) this.note = options.note;\n }\n}\n","import { SmrtCollection } from '@happyvertical/smrt-core';\nimport { withTenant } from '@happyvertical/smrt-tenancy';\nimport { DevelopmentRequestHistory } from '../models/DevelopmentRequestHistory';\n\nexport class DevelopmentRequestHistoryCollection extends SmrtCollection<DevelopmentRequestHistory> {\n static readonly _itemClass = DevelopmentRequestHistory;\n\n async listForRequest(\n tenantId: string,\n requestId: string,\n ): Promise<DevelopmentRequestHistory[]> {\n return withTenant({ tenantId }, () =>\n this.list({\n where: { tenantId, requestId },\n orderBy: 'createdAt ASC',\n }),\n );\n }\n}\n","import {\n foreignKey,\n SmrtObject,\n type SmrtObjectOptions,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport type {\n DevelopmentRequestEvidence,\n DevelopmentRequestOrigin,\n DevelopmentRequestStatus,\n DevelopmentRequestType,\n DevelopmentRequestVisibility,\n} from '../types';\n\nexport interface DevelopmentRequestOptions extends SmrtObjectOptions {\n tenantId?: string;\n projectId?: string;\n integrationId?: string | null;\n requesterId?: string;\n participantId?: string;\n type?: DevelopmentRequestType;\n description?: string;\n evidence?: DevelopmentRequestEvidence[] | string;\n visibility?: DevelopmentRequestVisibility;\n origin?: DevelopmentRequestOrigin;\n discussion?: string;\n status?: DevelopmentRequestStatus;\n}\n\nfunction parseEvidence(raw: unknown): DevelopmentRequestEvidence[] {\n if (!raw) return [];\n if (Array.isArray(raw)) return normalizeEvidence(raw);\n if (typeof raw !== 'string') return [];\n\n try {\n const parsed = JSON.parse(raw);\n return Array.isArray(parsed) ? normalizeEvidence(parsed) : [];\n } catch {\n return [];\n }\n}\n\nfunction normalizeEvidence(raw: unknown[]): DevelopmentRequestEvidence[] {\n return raw\n .filter(\n (entry): entry is Record<string, unknown> =>\n !!entry && typeof entry === 'object' && !Array.isArray(entry),\n )\n .map((entry) => ({\n url: typeof entry.url === 'string' ? entry.url.trim() : '',\n ...(typeof entry.label === 'string' && entry.label.trim().length > 0\n ? { label: entry.label.trim() }\n : {}),\n }))\n .filter((entry) => entry.url.length > 0);\n}\n\nfunction stringifyEvidence(items: DevelopmentRequestEvidence[]): string {\n return JSON.stringify(\n items.map((item) => ({\n url: item.url.trim(),\n ...(item.label?.trim() ? { label: item.label.trim() } : {}),\n })),\n );\n}\n\n@TenantScoped({ mode: 'required' })\n@smrt({\n tableName: 'development_requests',\n // Managed requests must flow through ManagedProjectClient so capability,\n // integration, project, and requester scoping cannot be bypassed.\n api: false,\n mcp: false,\n cli: false,\n})\nexport class DevelopmentRequest extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-projects\";\n @tenantId()\n tenantId: string = '';\n\n projectId: string = '';\n\n // Participant-origin requests have no managed integration credential.\n @foreignKey('ProjectIntegration')\n integrationId: string | null = null;\n\n requesterId: string = '';\n\n participantId: string = '';\n\n type: DevelopmentRequestType = 'feature';\n\n description: string = '';\n\n evidence: string = '[]';\n\n visibility: DevelopmentRequestVisibility = 'requester';\n\n origin: DevelopmentRequestOrigin = 'managed-app';\n\n discussion: string = '';\n\n status: DevelopmentRequestStatus = 'submitted';\n\n constructor(options: DevelopmentRequestOptions = {}) {\n super(options);\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n if (options.projectId !== undefined) this.projectId = options.projectId;\n if (options.integrationId !== undefined)\n this.integrationId = options.integrationId;\n if (options.requesterId !== undefined)\n this.requesterId = options.requesterId;\n if (options.participantId !== undefined)\n this.participantId = options.participantId;\n if (options.type !== undefined) this.type = options.type;\n if (options.description !== undefined)\n this.description = options.description;\n if (options.evidence !== undefined) this.setEvidence(options.evidence);\n if (options.visibility !== undefined) this.visibility = options.visibility;\n if (options.origin !== undefined) this.origin = options.origin;\n if (options.discussion !== undefined) this.discussion = options.discussion;\n if (options.status !== undefined) this.status = options.status;\n }\n\n public override async initialize(): Promise<this> {\n await super.initialize();\n if ((this as unknown as { evidence?: unknown }).evidence == null) {\n this.evidence = '[]';\n } else if (typeof this.evidence !== 'string') {\n this.setEvidence(\n this.evidence as unknown as DevelopmentRequestEvidence[],\n );\n }\n return this;\n }\n\n getEvidence(): DevelopmentRequestEvidence[] {\n return parseEvidence(this.evidence);\n }\n\n setEvidence(value: DevelopmentRequestEvidence[] | string): void {\n this.evidence =\n typeof value === 'string' ? value : stringifyEvidence(value);\n }\n}\n","import { SmrtCollection } from '@happyvertical/smrt-core';\nimport { withTenant } from '@happyvertical/smrt-tenancy';\nimport { DevelopmentRequest } from '../models/DevelopmentRequest';\nimport type {\n DevelopmentRequestStatus,\n DevelopmentRequestTransitionInput,\n ManagedDevelopmentRequestCreateInput,\n} from '../types';\nimport { DevelopmentRequestHistoryCollection } from './DevelopmentRequestHistories';\n\nexport class DevelopmentRequestCollection extends SmrtCollection<DevelopmentRequest> {\n static readonly _itemClass = DevelopmentRequest;\n\n async createManaged(\n input: {\n tenantId: string;\n projectId: string;\n integrationId: string;\n } & ManagedDevelopmentRequestCreateInput,\n ): Promise<DevelopmentRequest> {\n if (!input.integrationId?.trim())\n throw new TypeError('Managed requests require an integration.');\n const request = await withTenant({ tenantId: input.tenantId }, () =>\n this.create({\n tenantId: input.tenantId,\n projectId: input.projectId,\n integrationId: input.integrationId,\n requesterId: input.requesterId,\n participantId: input.participantId ?? '',\n type: input.type,\n description: input.description,\n evidence: JSON.stringify(input.evidence ?? []),\n visibility: input.visibility ?? 'requester',\n origin: input.origin ?? 'managed-app',\n discussion: input.discussion ?? '',\n status: 'submitted',\n }),\n );\n await withTenant({ tenantId: input.tenantId }, () => request.save());\n await this.recordHistory(request, {\n status: 'submitted',\n actorType: 'integration',\n actorId: input.integrationId,\n note: input.discussion ?? '',\n });\n return request;\n }\n\n async listByIntegrationRequester(input: {\n tenantId: string;\n integrationId: string;\n requesterId: string;\n }): Promise<DevelopmentRequest[]> {\n return withTenant({ tenantId: input.tenantId }, () =>\n this.list({\n where: {\n tenantId: input.tenantId,\n integrationId: input.integrationId,\n requesterId: input.requesterId,\n },\n orderBy: 'createdAt ASC',\n }),\n );\n }\n\n async transitionStatus(\n tenantId: string,\n requestId: string,\n transition: DevelopmentRequestTransitionInput,\n ): Promise<DevelopmentRequest> {\n const request = await withTenant({ tenantId }, () =>\n this.findOne({ where: { id: requestId, tenantId } }),\n );\n if (!request) {\n throw new Error(`DevelopmentRequest ${requestId} not found`);\n }\n const fromStatus = request.status;\n request.status = transition.status;\n await withTenant({ tenantId: request.tenantId }, () => request.save());\n await this.recordHistory(request, transition, fromStatus);\n return request;\n }\n\n async listForProject(\n tenantId: string,\n projectId: string,\n status?: DevelopmentRequestStatus,\n ): Promise<DevelopmentRequest[]> {\n return withTenant({ tenantId }, () =>\n this.list({\n where: status\n ? { tenantId, projectId, status }\n : { tenantId, projectId },\n orderBy: 'createdAt ASC',\n }),\n );\n }\n\n private async recordHistory(\n request: DevelopmentRequest,\n transition: DevelopmentRequestTransitionInput,\n fromStatus = '',\n ): Promise<void> {\n const histories = await DevelopmentRequestHistoryCollection.create(\n this.options,\n );\n const entry = await withTenant({ tenantId: request.tenantId }, () =>\n histories.create({\n tenantId: request.tenantId,\n requestId: request.id as string,\n fromStatus,\n toStatus: transition.status,\n actorType: transition.actorType,\n actorId: transition.actorId ?? '',\n note: transition.note ?? '',\n }),\n );\n await withTenant({ tenantId: request.tenantId }, () => entry.save());\n }\n}\n","/**\n * IssueCollection - Collection manager for Issue objects\n *\n * Provides querying and discovery operations for Issue entities.\n */\n\nimport { SmrtCollection } from '@happyvertical/smrt-core';\nimport { queryGlobal, queryWithGlobals } from '@happyvertical/smrt-tenancy';\nimport { Issue } from '../models/Issue';\nimport type { Repository } from '../models/Repository';\nimport type { SearchFilters } from '../types';\n\nexport class IssueCollection extends SmrtCollection<Issue> {\n static readonly _itemClass = Issue;\n\n /**\n * Discover issues from a repository and sync to database\n *\n * This method:\n * 1. Fetches issues from the provider via SDK\n * 2. Creates/updates SMRT Issue records in the database\n * 3. Returns the synced Issue objects\n *\n * @param options - Discovery options\n * @returns Array of Issue objects\n */\n async discover(options: {\n repository: Repository;\n filters?: SearchFilters;\n }): Promise<Issue[]> {\n const { repository, filters } = options;\n const repositoryId = repository.id ?? undefined;\n\n if (!repositoryId) {\n throw new Error('Repository must be saved before discovering issues');\n }\n\n const repoClient = await repository.getClient();\n\n // Fetch issues from provider\n const remoteIssues = await repoClient.searchIssues('', filters);\n\n const issues: Issue[] = [];\n\n for (const remote of remoteIssues) {\n // Find existing issue by repository + number\n let issue = await this.findOne({\n where: {\n repositoryId,\n number: remote.number,\n },\n });\n\n if (!issue) {\n // Create new issue\n issue = await this.create({\n repositoryId,\n number: remote.number,\n nodeId: remote.id,\n title: remote.title,\n body: remote.body,\n state: remote.state,\n author: remote.author.login,\n labels: remote.labels.map((l) => l.name),\n assignees: remote.assignees.map((a) => a.login),\n commentsCount: remote.commentsCount,\n lastSyncedAt: new Date(),\n });\n } else {\n // Update existing issue\n issue.nodeId = remote.id;\n issue.title = remote.title;\n issue.body = remote.body;\n issue.state = remote.state;\n issue.author = remote.author.login;\n issue.labels = remote.labels.map((l) => l.name);\n issue.assignees = remote.assignees.map((a) => a.login);\n issue.commentsCount = remote.commentsCount;\n issue.lastSyncedAt = new Date();\n }\n\n await issue.save();\n issues.push(issue);\n }\n\n return issues;\n }\n\n /**\n * Find issues belonging to a project (repository-backed or project-native)\n *\n * @param projectId - Project ID\n */\n async findByProject(projectId: string): Promise<Issue[]> {\n return await this.list({ where: { projectId } });\n }\n\n /**\n * Find issues by repository\n *\n * @param repositoryId - Repository ID\n * @returns Array of issues\n */\n async findByRepository(repositoryId: string): Promise<Issue[]> {\n return await this.list({\n where: { repositoryId },\n });\n }\n\n /**\n * Find open issues\n *\n * @param repositoryId - Optional repository filter\n * @returns Array of open issues\n */\n async findOpen(repositoryId?: string): Promise<Issue[]> {\n const where: Record<string, unknown> = { state: 'open' };\n if (repositoryId) {\n where.repositoryId = repositoryId;\n }\n return await this.list({ where });\n }\n\n /**\n * Find issues by label\n *\n * @param label - Label name\n * @param repositoryId - Optional repository filter\n * @returns Array of issues with the label\n */\n async findByLabel(label: string, repositoryId?: string): Promise<Issue[]> {\n const issues = await this.list({\n where: repositoryId ? { repositoryId } : {},\n });\n\n // Filter by label (JSON array search)\n return issues.filter((issue) => issue.labels.includes(label));\n }\n\n /**\n * Find issues by assignee\n *\n * @param assignee - Assignee login\n * @param repositoryId - Optional repository filter\n * @returns Array of issues assigned to the user\n */\n async findByAssignee(\n assignee: string,\n repositoryId?: string,\n ): Promise<Issue[]> {\n const issues = await this.list({\n where: repositoryId ? { repositoryId } : {},\n });\n\n // Filter by assignee (JSON array search)\n return issues.filter((issue) => issue.assignees.includes(assignee));\n }\n\n /**\n * Find issues needing review (AI-powered)\n *\n * @param repositoryId - Optional repository filter\n * @returns Array of issues that need review\n */\n async findNeedingReview(repositoryId?: string): Promise<Issue[]> {\n const openIssues = await this.findOpen(repositoryId);\n const needingReview: Issue[] = [];\n\n for (const issue of openIssues) {\n if (await issue.needsReview()) {\n needingReview.push(issue);\n }\n }\n\n return needingReview;\n }\n\n /**\n * Find issue by number in a repository\n *\n * @param repositoryId - Repository ID\n * @param number - Issue number\n * @returns Issue or null\n */\n async findByNumber(\n repositoryId: string,\n number: number,\n ): Promise<Issue | null> {\n const results = await this.list({\n where: { repositoryId, number },\n limit: 1,\n });\n return results[0] || null;\n }\n\n /**\n * Get issues with unincorporated feedback\n *\n * Issues that have comments but haven't had feedback incorporated\n *\n * @param repositoryId - Optional repository filter\n * @returns Array of issues\n */\n async findWithUnincorporatedFeedback(\n repositoryId?: string,\n ): Promise<Issue[]> {\n const issues = await this.findOpen(repositoryId);\n\n return issues.filter(\n (issue) => issue.commentsCount > 0 && issue.synthesisCount === 0,\n );\n }\n\n /**\n * Batch sync issues from repository\n *\n * @param repository - Repository to sync from\n * @param options - Sync options\n * @returns Array of synced issues\n */\n async batchSync(\n repository: Repository,\n options: { force?: boolean } = {},\n ): Promise<Issue[]> {\n const issues = await this.findByRepository(repository.id as string);\n const synced: Issue[] = [];\n\n for (const issue of issues) {\n await issue.sync(options);\n synced.push(issue);\n }\n\n return synced;\n }\n\n /**\n * Find issues by tenant ID\n *\n * @param tenantId - Tenant ID to filter by\n * @returns Array of issues for the tenant\n */\n async findByTenant(tenantId: string): Promise<Issue[]> {\n return this.list({ where: { tenantId } });\n }\n\n /**\n * Find all global issues (no tenant association).\n *\n * Routes through the shared tenant-global helper so it does not throw under\n * an active tenant context (an explicit `tenant_id IS NULL` filter would be\n * flagged as an isolation violation). (#1600)\n *\n * @returns Array of global issues\n */\n async findGlobal(): Promise<Issue[]> {\n return queryGlobal<Issue>(this);\n }\n\n /**\n * Find issues for a tenant plus all global issues.\n *\n * Fails closed if an active tenant context requests a different tenant's\n * rows; the admin/system path keeps the cross-tenant capability. (#1600)\n *\n * @param tenantId - Tenant ID to filter by\n * @returns Array of tenant and global issues\n */\n async findWithGlobals(tenantId: string): Promise<Issue[]> {\n return queryWithGlobals<Issue>(this, tenantId, 'Issue.findWithGlobals');\n }\n}\n","import type {\n ProjectContextReference,\n ProjectDecisionOption,\n ProjectQuestionOption,\n} from '../project-governance-types.js';\n\nconst CONTEXT_KINDS = new Set([\n 'spec',\n 'cookbook',\n 'conversation',\n 'asset',\n 'url',\n 'other',\n]);\n\nexport function parseContextReferences(\n value: string,\n): ProjectContextReference[] {\n let parsed: unknown;\n try {\n parsed = JSON.parse(value);\n } catch {\n throw new TypeError('Project context references must be valid JSON.');\n }\n if (!Array.isArray(parsed) || parsed.length > 100)\n throw new TypeError(\n 'Project context references must be an array of at most 100 items.',\n );\n return parsed.map((entry) => {\n if (!entry || typeof entry !== 'object')\n throw new TypeError('Invalid project context reference.');\n const item = entry as Record<string, unknown>;\n const kind = typeof item.kind === 'string' ? item.kind : '';\n const ref = typeof item.ref === 'string' ? item.ref.trim() : '';\n const label =\n typeof item.label === 'string' ? item.label.trim() : undefined;\n if (!CONTEXT_KINDS.has(kind) || !ref)\n throw new TypeError('Invalid project context reference.');\n return {\n kind,\n ref,\n ...(label ? { label } : {}),\n } as ProjectContextReference;\n });\n}\n\nexport function serializeContextReferences(\n value: readonly ProjectContextReference[],\n): string {\n return JSON.stringify(parseContextReferences(JSON.stringify(value)));\n}\n\nexport function parseDecisionOptions(value: string): ProjectDecisionOption[] {\n let parsed: unknown;\n try {\n parsed = JSON.parse(value);\n } catch {\n throw new TypeError('Project decision options must be valid JSON.');\n }\n if (!Array.isArray(parsed) || parsed.length > 50)\n throw new TypeError(\n 'Project decision options must be an array of at most 50 items.',\n );\n const seen = new Set<string>();\n return parsed.map((entry) => {\n if (!entry || typeof entry !== 'object')\n throw new TypeError('Invalid project decision option.');\n const item = entry as Record<string, unknown>;\n const id = typeof item.id === 'string' ? item.id.trim() : '';\n const label = typeof item.label === 'string' ? item.label.trim() : '';\n const description =\n typeof item.description === 'string'\n ? item.description.trim()\n : undefined;\n if (!id || !label || seen.has(id))\n throw new TypeError(\n 'Project decision option ids and labels must be unique and non-empty.',\n );\n seen.add(id);\n return { id, label, ...(description ? { description } : {}) };\n });\n}\n\nexport function serializeDecisionOptions(\n value: readonly ProjectDecisionOption[],\n): string {\n return JSON.stringify(parseDecisionOptions(JSON.stringify(value)));\n}\n\n/** Normalize authored choices; the reserved Other entry is never caller-authored. */\nexport function parseQuestionOptions(value: string): ProjectQuestionOption[] {\n const options = parseDecisionOptions(value);\n const raw = JSON.parse(value) as Record<string, unknown>[];\n return options.map((option, index) => {\n if (option.id.toLowerCase() === 'other')\n throw new TypeError('Project question option id \"other\" is reserved.');\n if (\n raw[index].recommended !== undefined &&\n typeof raw[index].recommended !== 'boolean'\n )\n throw new TypeError(\n 'Project question option recommended must be boolean.',\n );\n if (\n raw[index].description !== undefined &&\n typeof raw[index].description !== 'string'\n )\n throw new TypeError('Project question option description must be text.');\n return {\n ...option,\n ...(raw[index].recommended === undefined\n ? {}\n : { recommended: raw[index].recommended as boolean }),\n };\n });\n}\n\nexport function serializeQuestionOptions(\n value: readonly ProjectQuestionOption[],\n): string {\n return JSON.stringify(parseQuestionOptions(JSON.stringify(value)));\n}\n","import {\n field,\n SmrtPolymorphicAssociation,\n type SmrtPolymorphicAssociationOptions,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport type {\n ProjectContextReference,\n ProjectDecisionOption,\n ProjectDecisionStatus,\n ProjectGovernanceActorType,\n ProjectGovernanceVisibility,\n} from '../project-governance-types.js';\nimport {\n parseContextReferences,\n parseDecisionOptions,\n serializeContextReferences,\n serializeDecisionOptions,\n} from './project-governance-validation.js';\n\nexport interface ProjectDecisionOptions\n extends SmrtPolymorphicAssociationOptions {\n tenantId?: string;\n visibility?: ProjectGovernanceVisibility;\n question?: string;\n decisionOptions?: ProjectDecisionOption[] | string;\n outcome?: string;\n rationale?: string;\n status?: ProjectDecisionStatus;\n ownerType?: ProjectGovernanceActorType | '';\n ownerId?: string;\n contextReferences?: ProjectContextReference[] | string;\n revision?: number;\n decidedAt?: Date | null;\n}\n\n@TenantScoped({ mode: 'required' })\n@smrt({\n tableName: 'project_decisions',\n api: false,\n mcp: false,\n cli: false,\n indexes: [\n {\n name: 'project_decisions_project_status_idx',\n columns: ['tenantId', 'metaType', 'metaId', 'status', 'createdAt'],\n },\n {\n name: 'project_decisions_owner_status_idx',\n columns: ['tenantId', 'ownerType', 'ownerId', 'status'],\n },\n ],\n})\nexport class ProjectDecision extends SmrtPolymorphicAssociation { static __smrtPackage__ = \"@happyvertical/smrt-projects\";\n @tenantId()\n tenantId = '';\n\n @field({ required: true })\n question = '';\n\n /** JSON array; use getOptions()/setOptions(). */\n decisionOptions = '[]';\n\n outcome = '';\n\n rationale = '';\n\n @field({ required: true })\n status: ProjectDecisionStatus = 'open';\n\n ownerType: ProjectGovernanceActorType | '' = '';\n\n ownerId = '';\n\n visibility: ProjectGovernanceVisibility = 'internal';\n\n /** JSON array; use getContextReferences()/setContextReferences(). */\n contextReferences = '[]';\n\n revision = 1;\n\n @field({ type: 'datetime', nullable: true })\n decidedAt: Date | null = null;\n\n constructor(options: ProjectDecisionOptions = {}) {\n super({ ...options, role: 'decision' });\n if (options.visibility !== undefined) this.visibility = options.visibility;\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n if (options.question !== undefined) this.question = options.question;\n if (options.decisionOptions !== undefined) {\n this.decisionOptions = Array.isArray(options.decisionOptions)\n ? serializeDecisionOptions(options.decisionOptions)\n : options.decisionOptions;\n }\n if (options.outcome !== undefined) this.outcome = options.outcome;\n if (options.rationale !== undefined) this.rationale = options.rationale;\n if (options.status !== undefined) this.status = options.status;\n if (options.ownerType !== undefined) this.ownerType = options.ownerType;\n if (options.ownerId !== undefined) this.ownerId = options.ownerId;\n if (options.contextReferences !== undefined) {\n this.contextReferences = Array.isArray(options.contextReferences)\n ? serializeContextReferences(options.contextReferences)\n : options.contextReferences;\n }\n if (options.revision !== undefined) this.revision = options.revision;\n if (options.decidedAt !== undefined) this.decidedAt = options.decidedAt;\n }\n\n getOptions(): ProjectDecisionOption[] {\n return parseDecisionOptions(this.decisionOptions);\n }\n\n setOptions(value: ProjectDecisionOption[]): void {\n this.decisionOptions = serializeDecisionOptions(value);\n }\n\n getContextReferences(): ProjectContextReference[] {\n return parseContextReferences(this.contextReferences);\n }\n\n setContextReferences(value: ProjectContextReference[]): void {\n this.contextReferences = serializeContextReferences(value);\n }\n\n protected override async validateBeforeSave(): Promise<void> {\n this.question = this.question.trim();\n this.outcome = this.outcome.trim();\n this.rationale = this.rationale.trim();\n this.ownerId = this.ownerId.trim();\n if (!['internal', 'client'].includes(this.visibility))\n throw new TypeError('Invalid project governance visibility.');\n if (!this.question)\n throw new TypeError('Project decision question is required.');\n if (!['open', 'decided', 'deferred', 'superseded'].includes(this.status))\n throw new TypeError('Invalid project decision status.');\n if (this.ownerType && !['user', 'agent', 'system'].includes(this.ownerType))\n throw new TypeError('Invalid project decision owner type.');\n if ((this.ownerType && !this.ownerId) || (!this.ownerType && this.ownerId))\n throw new TypeError(\n 'Project decision owner type and id must be set together.',\n );\n const options = parseDecisionOptions(this.decisionOptions);\n if (this.status === 'decided' && !this.outcome)\n throw new TypeError('A decided project decision requires an outcome.');\n if (\n this.status === 'decided' &&\n options.length > 0 &&\n !options.some((option) => option.id === this.outcome)\n )\n throw new TypeError('Project decision outcome must match an option id.');\n if (!Number.isSafeInteger(this.revision) || this.revision < 1)\n throw new TypeError(\n 'Project decision revision must be a positive integer.',\n );\n this.decisionOptions = serializeDecisionOptions(options);\n this.contextReferences = serializeContextReferences(\n parseContextReferences(this.contextReferences),\n );\n await super.validateBeforeSave();\n }\n}\n","import { SmrtCollection } from '@happyvertical/smrt-core';\nimport {\n assertTenantReadAllowed,\n withTenant,\n} from '@happyvertical/smrt-tenancy';\nimport { ProjectDecision } from '../models/ProjectDecision.js';\nimport type {\n ProjectDecisionStatus,\n ProjectGovernanceScope,\n ProjectGovernanceVisibility,\n} from '../project-governance-types.js';\n\nexport class ProjectDecisionCollection extends SmrtCollection<ProjectDecision> {\n static readonly _itemClass = ProjectDecision;\n\n async listForProject(\n scope: ProjectGovernanceScope,\n status?: ProjectDecisionStatus,\n visibility?: ProjectGovernanceVisibility,\n ): Promise<ProjectDecision[]> {\n assertTenantReadAllowed(scope.tenantId, 'ProjectGovernanceCollection');\n return withTenant({ tenantId: scope.tenantId }, () =>\n this.list({\n where: {\n tenantId: scope.tenantId,\n metaType: scope.projectType,\n metaId: scope.projectId,\n ...(status ? { status } : {}),\n ...(visibility ? { visibility } : {}),\n },\n orderBy: 'createdAt ASC',\n }),\n );\n }\n\n async getForProject(\n scope: ProjectGovernanceScope,\n id: string,\n ): Promise<ProjectDecision | null> {\n assertTenantReadAllowed(scope.tenantId, 'ProjectGovernanceCollection');\n return withTenant({ tenantId: scope.tenantId }, () =>\n this.findOne({\n where: {\n id,\n tenantId: scope.tenantId,\n metaType: scope.projectType,\n metaId: scope.projectId,\n },\n }),\n );\n }\n}\n","import {\n field,\n SmrtPolymorphicAssociation,\n type SmrtPolymorphicAssociationOptions,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport type {\n ProjectGovernanceAction,\n ProjectGovernanceActorType,\n ProjectGovernanceRecordKind,\n ProjectQuestionAnswerSelection,\n} from '../project-governance-types.js';\n\nexport interface ProjectGovernanceEventOptions\n extends SmrtPolymorphicAssociationOptions {\n tenantId?: string;\n recordKind?: ProjectGovernanceRecordKind;\n action?: ProjectGovernanceAction;\n actorType?: ProjectGovernanceActorType;\n actorId?: string;\n fromStatus?: string;\n toStatus?: string;\n note?: string;\n value?: string;\n rationale?: string;\n answerSelection?: string;\n revision?: number;\n fromOwnerType?: ProjectGovernanceActorType | '';\n fromOwnerId?: string;\n toOwnerType?: ProjectGovernanceActorType | '';\n toOwnerId?: string;\n}\n\n@TenantScoped({ mode: 'required' })\n@smrt({\n tableName: 'project_governance_events',\n hooks: { beforeDelete: 'beforeDelete' },\n api: false,\n mcp: false,\n cli: false,\n indexes: [\n {\n name: 'project_governance_events_record_idx',\n columns: ['tenantId', 'metaType', 'metaId', 'createdAt'],\n },\n ],\n})\nexport class ProjectGovernanceEvent extends SmrtPolymorphicAssociation { static __smrtPackage__ = \"@happyvertical/smrt-projects\";\n @tenantId()\n tenantId = '';\n\n @field({ required: true })\n recordKind: ProjectGovernanceRecordKind = 'question';\n\n @field({ required: true })\n action: ProjectGovernanceAction = 'created';\n\n @field({ required: true })\n actorType: ProjectGovernanceActorType = 'system';\n\n @field({ required: true })\n actorId = '';\n\n fromStatus = '';\n\n @field({ required: true })\n toStatus = 'open';\n\n note = '';\n\n value = '';\n\n rationale = '';\n\n /** JSON answer snapshot; empty for events written before structured questions. */\n @field({ default: '' })\n answerSelection = '';\n\n revision = 1;\n\n fromOwnerType: ProjectGovernanceActorType | '' = '';\n fromOwnerId = '';\n toOwnerType: ProjectGovernanceActorType | '' = '';\n toOwnerId = '';\n\n constructor(options: ProjectGovernanceEventOptions = {}) {\n super({ ...options, role: 'history' });\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n if (options.recordKind !== undefined) this.recordKind = options.recordKind;\n if (options.action !== undefined) this.action = options.action;\n if (options.actorType !== undefined) this.actorType = options.actorType;\n if (options.actorId !== undefined) this.actorId = options.actorId;\n if (options.fromStatus !== undefined) this.fromStatus = options.fromStatus;\n if (options.toStatus !== undefined) this.toStatus = options.toStatus;\n if (options.note !== undefined) this.note = options.note;\n if (options.value !== undefined) this.value = options.value;\n if (options.answerSelection !== undefined)\n this.answerSelection = options.answerSelection;\n if (options.rationale !== undefined) this.rationale = options.rationale;\n if (options.revision !== undefined) this.revision = options.revision;\n if (options.fromOwnerType !== undefined)\n this.fromOwnerType = options.fromOwnerType;\n if (options.fromOwnerId !== undefined)\n this.fromOwnerId = options.fromOwnerId;\n if (options.toOwnerType !== undefined)\n this.toOwnerType = options.toOwnerType;\n if (options.toOwnerId !== undefined) this.toOwnerId = options.toOwnerId;\n }\n\n getAnswerSelection(): ProjectQuestionAnswerSelection | null {\n if (!this.answerSelection) return null;\n const value = JSON.parse(this.answerSelection);\n if (\n !value ||\n typeof value !== 'object' ||\n typeof value.answer !== 'string' ||\n !Number.isSafeInteger(value.expectedRevision) ||\n value.expectedRevision < 1 ||\n (value.selectedOptionId !== undefined &&\n typeof value.selectedOptionId !== 'string') ||\n (value.optionLabel !== undefined &&\n typeof value.optionLabel !== 'string') ||\n (value.idempotencyKey !== undefined &&\n typeof value.idempotencyKey !== 'string')\n )\n throw new TypeError('Invalid project question answer snapshot.');\n return value;\n }\n\n async beforeDelete(): Promise<void> {\n throw new TypeError('Project governance history is append-only.');\n }\n\n protected override async validateBeforeSave(): Promise<void> {\n if (this.isPersisted)\n throw new TypeError('Project governance history is append-only.');\n this.getAnswerSelection();\n this.actorId = this.actorId.trim();\n if (!this.actorId)\n throw new TypeError('Project governance event actor id is required.');\n if (!Number.isSafeInteger(this.revision) || this.revision < 1)\n throw new TypeError(\n 'Project governance event revision must be a positive integer.',\n );\n await super.validateBeforeSave();\n }\n}\n","import { SmrtCollection } from '@happyvertical/smrt-core';\nimport {\n assertTenantReadAllowed,\n withTenant,\n} from '@happyvertical/smrt-tenancy';\nimport { ProjectGovernanceEvent } from '../models/ProjectGovernanceEvent.js';\n\nexport class ProjectGovernanceEventCollection extends SmrtCollection<ProjectGovernanceEvent> {\n static readonly _itemClass = ProjectGovernanceEvent;\n\n async listForRecord(input: {\n tenantId: string;\n recordType: string;\n recordId: string;\n }): Promise<ProjectGovernanceEvent[]> {\n assertTenantReadAllowed(input.tenantId, 'ProjectGovernanceEventCollection');\n return withTenant({ tenantId: input.tenantId }, () =>\n this.list({\n where: {\n tenantId: input.tenantId,\n metaType: input.recordType,\n metaId: input.recordId,\n },\n orderBy: 'revision ASC',\n }),\n );\n }\n}\n","import {\n foreignKey,\n SmrtObject,\n type SmrtObjectOptions,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport type { ProjectIntegrationAuditAction } from '../types';\n\nexport interface ProjectIntegrationAuditOptions extends SmrtObjectOptions {\n tenantId?: string;\n integrationId?: string;\n action?: ProjectIntegrationAuditAction;\n note?: string | null;\n}\n\n@TenantScoped({ mode: 'required' })\n@smrt({\n tableName: 'project_integration_audits',\n api: false,\n mcp: false,\n cli: false,\n})\nexport class ProjectIntegrationAudit extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-projects\";\n @tenantId()\n tenantId: string = '';\n\n @foreignKey('ProjectIntegration', { required: true })\n integrationId: string = '';\n\n action: ProjectIntegrationAuditAction = 'created';\n\n note: string | null = null;\n\n constructor(options: ProjectIntegrationAuditOptions = {}) {\n super(options);\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n if (options.integrationId !== undefined)\n this.integrationId = options.integrationId;\n if (options.action !== undefined) this.action = options.action;\n if (options.note !== undefined) this.note = options.note;\n }\n}\n","import { SmrtCollection } from '@happyvertical/smrt-core';\nimport { withTenant } from '@happyvertical/smrt-tenancy';\nimport { ProjectIntegrationAudit } from '../models/ProjectIntegrationAudit';\n\nexport class ProjectIntegrationAuditCollection extends SmrtCollection<ProjectIntegrationAudit> {\n static readonly _itemClass = ProjectIntegrationAudit;\n\n async listForIntegration(\n tenantId: string,\n integrationId: string,\n ): Promise<ProjectIntegrationAudit[]> {\n return withTenant({ tenantId }, () =>\n this.list({\n where: { tenantId, integrationId },\n orderBy: 'createdAt ASC',\n }),\n );\n }\n}\n","import {\n field,\n SmrtObject,\n type SmrtObjectOptions,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport type {\n ProjectIntegrationCapability,\n ProjectIntegrationStatus,\n} from '../types';\n\nexport interface ProjectIntegrationOptions extends SmrtObjectOptions {\n tenantId?: string;\n projectId?: string;\n name?: string;\n credentialHash?: string;\n capabilities?: ProjectIntegrationCapability[];\n status?: ProjectIntegrationStatus;\n revokedAt?: Date | null;\n}\n\n@TenantScoped({ mode: 'required' })\n@smrt({\n tableName: 'project_integrations',\n conflictColumns: ['tenant_id', 'project_id', 'name'],\n api: { include: ['list', 'get'] },\n mcp: { include: ['list', 'get'] },\n cli: { include: ['list', 'get'] },\n})\nexport class ProjectIntegration extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-projects\";\n @tenantId()\n tenantId: string = '';\n\n projectId: string = '';\n\n name: string = '';\n\n @field({ sensitive: true })\n credentialHash: string = '';\n\n capabilities: ProjectIntegrationCapability[] = [];\n\n status: ProjectIntegrationStatus = 'active';\n\n revokedAt: Date | null = null;\n\n constructor(options: ProjectIntegrationOptions = {}) {\n super(options);\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n if (options.projectId !== undefined) this.projectId = options.projectId;\n if (options.name !== undefined) this.name = options.name;\n if (options.credentialHash !== undefined)\n this.credentialHash = options.credentialHash;\n if (options.capabilities !== undefined)\n this.capabilities = [...options.capabilities];\n if (options.status !== undefined) this.status = options.status;\n if (options.revokedAt !== undefined) this.revokedAt = options.revokedAt;\n }\n\n hasCapability(capability: ProjectIntegrationCapability): boolean {\n return this.capabilities.includes(capability);\n }\n\n isActive(): boolean {\n return this.status === 'active' && this.revokedAt === null;\n }\n}\n","import { createHash, randomBytes } from 'node:crypto';\nimport { SmrtCollection } from '@happyvertical/smrt-core';\nimport { withTenant } from '@happyvertical/smrt-tenancy';\nimport { ProjectIntegration } from '../models/ProjectIntegration';\nimport type { ProjectIntegrationCapability } from '../types';\nimport { ProjectIntegrationAuditCollection } from './ProjectIntegrationAudits';\n\nexport class ProjectIntegrationCollection extends SmrtCollection<ProjectIntegration> {\n static readonly _itemClass = ProjectIntegration;\n\n async provision(input: {\n tenantId: string;\n projectId: string;\n name: string;\n capabilities: ProjectIntegrationCapability[];\n }): Promise<{ integration: ProjectIntegration; credential: string }> {\n const credential = issueProjectIntegrationCredential(input.tenantId);\n const integration = await withTenant({ tenantId: input.tenantId }, () =>\n this.create({\n tenantId: input.tenantId,\n projectId: input.projectId,\n name: input.name,\n capabilities: [...input.capabilities],\n credentialHash: hashProjectIntegrationCredential(credential),\n status: 'active',\n revokedAt: null,\n }),\n );\n await withTenant({ tenantId: input.tenantId }, () => integration.save());\n await this.recordAudit(integration, 'created');\n return { integration, credential };\n }\n\n async rotate(\n tenantId: string,\n integrationId: string,\n ): Promise<{ integration: ProjectIntegration; credential: string }> {\n const integration = await this.requireActive(tenantId, integrationId);\n const credential = issueProjectIntegrationCredential(integration.tenantId);\n integration.credentialHash = hashProjectIntegrationCredential(credential);\n await withTenant({ tenantId: integration.tenantId }, () =>\n integration.save(),\n );\n await this.recordAudit(integration, 'rotated');\n return { integration, credential };\n }\n\n async revoke(\n tenantId: string,\n integrationId: string,\n ): Promise<ProjectIntegration> {\n const integration = await this.requireExisting(tenantId, integrationId);\n integration.status = 'revoked';\n integration.revokedAt = new Date();\n integration.credentialHash = '';\n await withTenant({ tenantId: integration.tenantId }, () =>\n integration.save(),\n );\n await this.recordAudit(integration, 'revoked');\n return integration;\n }\n\n async authenticate(credential: string): Promise<ProjectIntegration | null> {\n const tenantId = parseCredentialTenant(credential);\n if (!tenantId) return null;\n const credentialHash = hashProjectIntegrationCredential(credential);\n const integrations = await withTenant({ tenantId }, () =>\n this.list({ where: { tenantId, status: 'active' } }),\n );\n const integration = integrations.find(\n (candidate) => candidate.credentialHash === credentialHash,\n );\n return integration?.isActive() ? integration : null;\n }\n\n async listForProject(\n tenantId: string,\n projectId: string,\n ): Promise<ProjectIntegration[]> {\n return withTenant({ tenantId }, () =>\n this.list({\n where: { tenantId, projectId },\n orderBy: 'name ASC',\n }),\n );\n }\n\n async findActive(\n tenantId: string,\n integrationId: string,\n ): Promise<ProjectIntegration | null> {\n const integration = await withTenant({ tenantId }, () =>\n this.findOne({ where: { id: integrationId, tenantId } }),\n );\n return integration?.isActive() ? integration : null;\n }\n\n private async requireExisting(\n tenantId: string,\n integrationId: string,\n ): Promise<ProjectIntegration> {\n const integration = await withTenant({ tenantId }, () =>\n this.findOne({ where: { id: integrationId, tenantId } }),\n );\n if (!integration) {\n throw new Error(`ProjectIntegration ${integrationId} not found`);\n }\n return integration;\n }\n\n private async requireActive(\n tenantId: string,\n integrationId: string,\n ): Promise<ProjectIntegration> {\n const integration = await this.requireExisting(tenantId, integrationId);\n if (!integration.isActive()) {\n throw new Error(`ProjectIntegration ${integrationId} is not active`);\n }\n return integration;\n }\n\n private async recordAudit(\n integration: ProjectIntegration,\n action: 'created' | 'rotated' | 'revoked',\n ): Promise<void> {\n const audits = await ProjectIntegrationAuditCollection.create(this.options);\n const entry = await withTenant({ tenantId: integration.tenantId }, () =>\n audits.create({\n tenantId: integration.tenantId,\n integrationId: integration.id as string,\n action,\n }),\n );\n await withTenant({ tenantId: integration.tenantId }, () => entry.save());\n }\n}\n\nexport function hashProjectIntegrationCredential(credential: string): string {\n return createHash('sha256').update(credential).digest('hex');\n}\n\nfunction issueProjectIntegrationCredential(tenantId: string): string {\n const tenant = Buffer.from(tenantId, 'utf8').toString('base64url');\n return `smrt_pi_${tenant}_${randomBytes(24).toString('hex')}`;\n}\n\nfunction parseCredentialTenant(credential: string): string | null {\n const match = /^smrt_pi_([A-Za-z0-9_-]+)_[a-f0-9]{48}$/.exec(credential);\n if (!match) return null;\n try {\n const tenantId = Buffer.from(match[1], 'base64url').toString('utf8');\n return tenantId.length > 0 ? tenantId : null;\n } catch {\n return null;\n }\n}\n","import {\n field,\n SmrtPolymorphicAssociation,\n type SmrtPolymorphicAssociationOptions,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport type {\n ProjectContextReference,\n ProjectGovernanceActorType,\n ProjectGovernanceVisibility,\n ProjectQuestionOption,\n ProjectQuestionStatus,\n} from '../project-governance-types.js';\nimport {\n parseContextReferences,\n parseQuestionOptions,\n serializeContextReferences,\n serializeQuestionOptions,\n} from './project-governance-validation.js';\n\nexport interface ProjectQuestionOptions\n extends SmrtPolymorphicAssociationOptions {\n tenantId?: string;\n visibility?: ProjectGovernanceVisibility;\n prompt?: string;\n answer?: string;\n questionOptions?: ProjectQuestionOption[] | string;\n selectedOptionId?: string;\n status?: ProjectQuestionStatus;\n ownerType?: ProjectGovernanceActorType | '';\n ownerId?: string;\n contextReferences?: ProjectContextReference[] | string;\n revision?: number;\n answeredAt?: Date | null;\n}\n\n@TenantScoped({ mode: 'required' })\n@smrt({\n tableName: 'project_questions',\n api: false,\n mcp: false,\n cli: false,\n indexes: [\n {\n name: 'project_questions_project_status_idx',\n columns: ['tenantId', 'metaType', 'metaId', 'status', 'createdAt'],\n },\n {\n name: 'project_questions_owner_status_idx',\n columns: ['tenantId', 'ownerType', 'ownerId', 'status'],\n },\n ],\n})\nexport class ProjectQuestion extends SmrtPolymorphicAssociation { static __smrtPackage__ = \"@happyvertical/smrt-projects\";\n @tenantId()\n tenantId = '';\n\n @field({ required: true })\n prompt = '';\n\n answer = '';\n\n /** JSON authored choices; getOptions() includes implicit Other. */\n @field({ default: '[]' })\n questionOptions = '[]';\n\n @field({ default: '' })\n selectedOptionId = '';\n\n @field({ required: true })\n status: ProjectQuestionStatus = 'open';\n\n ownerType: ProjectGovernanceActorType | '' = '';\n\n ownerId = '';\n\n visibility: ProjectGovernanceVisibility = 'internal';\n\n /** JSON array; use getContextReferences()/setContextReferences(). */\n contextReferences = '[]';\n\n revision = 1;\n\n @field({ type: 'datetime', nullable: true })\n answeredAt: Date | null = null;\n\n constructor(options: ProjectQuestionOptions = {}) {\n super({ ...options, role: 'question' });\n if (options.visibility !== undefined) this.visibility = options.visibility;\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n if (options.prompt !== undefined) this.prompt = options.prompt;\n if (options.answer !== undefined) this.answer = options.answer;\n if (options.questionOptions !== undefined)\n this.questionOptions = Array.isArray(options.questionOptions)\n ? serializeQuestionOptions(options.questionOptions)\n : options.questionOptions;\n if (options.selectedOptionId !== undefined)\n this.selectedOptionId = options.selectedOptionId;\n if (options.status !== undefined) this.status = options.status;\n if (options.ownerType !== undefined) this.ownerType = options.ownerType;\n if (options.ownerId !== undefined) this.ownerId = options.ownerId;\n if (options.contextReferences !== undefined) {\n this.contextReferences = Array.isArray(options.contextReferences)\n ? serializeContextReferences(options.contextReferences)\n : options.contextReferences;\n }\n if (options.revision !== undefined) this.revision = options.revision;\n if (options.answeredAt !== undefined) this.answeredAt = options.answeredAt;\n }\n\n getOptions(): ProjectQuestionOption[] {\n const options = parseQuestionOptions(this.questionOptions);\n return options.length ? [...options, { id: 'other', label: 'Other' }] : [];\n }\n\n setOptions(value: ProjectQuestionOption[]): void {\n this.questionOptions = serializeQuestionOptions(value);\n }\n\n getContextReferences(): ProjectContextReference[] {\n return parseContextReferences(this.contextReferences);\n }\n\n setContextReferences(value: ProjectContextReference[]): void {\n this.contextReferences = serializeContextReferences(value);\n }\n\n protected override async validateBeforeSave(): Promise<void> {\n this.questionOptions = serializeQuestionOptions(\n parseQuestionOptions(this.questionOptions),\n );\n if (typeof this.selectedOptionId !== 'string')\n throw new TypeError('Project question selected option id must be text.');\n if (\n this.selectedOptionId &&\n !this.getOptions().some((option) => option.id === this.selectedOptionId)\n )\n throw new TypeError('Project question answer must match an option id.');\n this.prompt = this.prompt.trim();\n this.answer = this.answer.trim();\n this.ownerId = this.ownerId.trim();\n if (!['internal', 'client'].includes(this.visibility))\n throw new TypeError('Invalid project governance visibility.');\n if (!this.prompt)\n throw new TypeError('Project question prompt is required.');\n if (!['open', 'answered', 'deferred', 'superseded'].includes(this.status))\n throw new TypeError('Invalid project question status.');\n if (this.ownerType && !['user', 'agent', 'system'].includes(this.ownerType))\n throw new TypeError('Invalid project question owner type.');\n if ((this.ownerType && !this.ownerId) || (!this.ownerType && this.ownerId))\n throw new TypeError(\n 'Project question owner type and id must be set together.',\n );\n if (this.status === 'answered' && !this.answer)\n throw new TypeError('An answered project question requires an answer.');\n if (!Number.isSafeInteger(this.revision) || this.revision < 1)\n throw new TypeError(\n 'Project question revision must be a positive integer.',\n );\n this.contextReferences = serializeContextReferences(\n parseContextReferences(this.contextReferences),\n );\n await super.validateBeforeSave();\n }\n}\n","import { SmrtCollection } from '@happyvertical/smrt-core';\nimport {\n assertTenantReadAllowed,\n withTenant,\n} from '@happyvertical/smrt-tenancy';\nimport { ProjectQuestion } from '../models/ProjectQuestion.js';\nimport type {\n ProjectGovernanceScope,\n ProjectGovernanceVisibility,\n ProjectQuestionStatus,\n} from '../project-governance-types.js';\n\nexport class ProjectQuestionCollection extends SmrtCollection<ProjectQuestion> {\n static readonly _itemClass = ProjectQuestion;\n\n async listForProject(\n scope: ProjectGovernanceScope,\n status?: ProjectQuestionStatus,\n visibility?: ProjectGovernanceVisibility,\n ): Promise<ProjectQuestion[]> {\n assertTenantReadAllowed(scope.tenantId, 'ProjectGovernanceCollection');\n return withTenant({ tenantId: scope.tenantId }, () =>\n this.list({\n where: {\n tenantId: scope.tenantId,\n metaType: scope.projectType,\n metaId: scope.projectId,\n ...(status ? { status } : {}),\n ...(visibility ? { visibility } : {}),\n },\n orderBy: 'createdAt ASC',\n }),\n );\n }\n\n async getForProject(\n scope: ProjectGovernanceScope,\n id: string,\n ): Promise<ProjectQuestion | null> {\n assertTenantReadAllowed(scope.tenantId, 'ProjectGovernanceCollection');\n return withTenant({ tenantId: scope.tenantId }, () =>\n this.findOne({\n where: {\n id,\n tenantId: scope.tenantId,\n metaType: scope.projectType,\n metaId: scope.projectId,\n },\n }),\n );\n }\n}\n","import {\n field,\n SmrtPolymorphicAssociation,\n type SmrtPolymorphicAssociationOptions,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { validateCookbook } from '@happyvertical/smrt-core/cookbook';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport type { Cookbook } from '@happyvertical/smrt-types';\n\nexport interface ProjectSpecificationOptions\n extends SmrtPolymorphicAssociationOptions {\n tenantId?: string;\n title?: string;\n summary?: string;\n cookbook?: string;\n revision?: number;\n actorType?: string;\n actorId?: string;\n}\n\n/** Canonical project requirements and their portable application cookbook. */\n@TenantScoped({ mode: 'required' })\n@smrt({\n tableName: 'project_specifications',\n api: false,\n mcp: false,\n cli: false,\n conflictColumns: ['tenant_id', 'meta_type', 'meta_id'],\n})\nexport class ProjectSpecification extends SmrtPolymorphicAssociation { static __smrtPackage__ = \"@happyvertical/smrt-projects\";\n @tenantId()\n tenantId = '';\n @field({ required: true })\n title = '';\n summary = '';\n /** Canonical Cookbook v1 JSON; use getCookbook(). */\n cookbook = '{}';\n revision = 1;\n actorType = '';\n actorId = '';\n\n constructor(options: ProjectSpecificationOptions = {}) {\n super({ ...options, role: 'specification' });\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n if (options.title !== undefined) this.title = options.title;\n if (options.summary !== undefined) this.summary = options.summary;\n if (options.cookbook !== undefined) this.cookbook = options.cookbook;\n if (options.revision !== undefined) this.revision = options.revision;\n if (options.actorType !== undefined) this.actorType = options.actorType;\n if (options.actorId !== undefined) this.actorId = options.actorId;\n }\n\n getCookbook(): Cookbook {\n const result = validateCookbook(JSON.parse(this.cookbook));\n if (!result.ok) throw new TypeError(result.errors.join('; '));\n return result.cookbook;\n }\n\n protected override async validateBeforeSave(): Promise<void> {\n this.title = this.title.trim();\n if (!this.title)\n throw new TypeError('Project specification title is required.');\n if (!Number.isSafeInteger(this.revision) || this.revision < 1)\n throw new TypeError(\n 'Project specification revision must be a positive integer.',\n );\n if (\n !['user', 'agent', 'system'].includes(this.actorType) ||\n !this.actorId.trim()\n )\n throw new TypeError('Project specification actor is required.');\n this.cookbook = JSON.stringify(this.getCookbook());\n await super.validateBeforeSave();\n }\n}\n","import { SmrtCollection } from '@happyvertical/smrt-core';\nimport {\n assertTenantReadAllowed,\n withTenant,\n} from '@happyvertical/smrt-tenancy';\nimport { ProjectSpecification } from '../models/ProjectSpecification.js';\nimport type { ProjectGovernanceScope } from '../project-governance-types.js';\n\nexport class ProjectSpecificationCollection extends SmrtCollection<ProjectSpecification> {\n static readonly _itemClass = ProjectSpecification;\n\n async getForProject(\n scope: ProjectGovernanceScope,\n ): Promise<ProjectSpecification | null> {\n assertTenantReadAllowed(scope.tenantId, 'ProjectSpecificationCollection');\n return withTenant({ tenantId: scope.tenantId }, () =>\n this.findOne({\n where: {\n tenantId: scope.tenantId,\n metaType: scope.projectType,\n metaId: scope.projectId,\n },\n }),\n );\n }\n}\n","/**\n * Project model - SMRT wrapper for project board operations\n *\n * Provides persistent project tracking with provider-agnostic operations.\n * Uses @happyvertical/projects SDK for actual API calls.\n */\n\nimport { getProject } from '@happyvertical/projects';\nimport { getModuleConfig } from '@happyvertical/smrt-config';\nimport {\n field,\n SmrtObject,\n type SmrtObjectOptions,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport { SYNC_THROTTLE_MS } from '../constants';\nimport type {\n IProject,\n ItemFilters,\n ProjectField,\n ProjectItem,\n ProjectProviderType,\n ProjectStatus,\n SDKProject,\n SyncOptions,\n} from '../types';\nimport type { Issue } from './Issue';\nimport type { PullRequest } from './PullRequest';\n\nexport interface ProjectOptions extends SmrtObjectOptions {\n projectId?: string;\n projectNumber?: number;\n title?: string;\n description?: string;\n owner?: string;\n url?: string;\n providerType?: ProjectProviderType;\n tokenConfigKey?: string;\n statuses?: ProjectStatus[];\n fields?: ProjectField[];\n statusFieldId?: string;\n statusOptions?: Record<string, string>;\n tenantId?: string | null;\n}\n\n@TenantScoped({ mode: 'optional' })\n@smrt({\n api: { include: ['list', 'get', 'create', 'update'] },\n mcp: { include: ['list', 'get', 'sync', 'addItem', 'updateItemStatus'] },\n // sync/addItem/updateItemStatus/listItems are operator commands invoked\n // in-process via the CLI; they intentionally aren't exposed over HTTP today.\n cli: {\n include: [\n 'list',\n 'get',\n 'sync',\n 'addItem',\n 'updateItemStatus',\n 'listItems',\n ],\n skipApiCheck: true,\n },\n})\nexport class Project extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-projects\";\n /**\n * Tenant ID for multi-tenant isolation\n */\n @tenantId({ nullable: true })\n tenantId: string | null = null;\n\n /**\n * Provider-specific project ID (e.g., GitHub GraphQL node ID)\n */\n projectId: string = '';\n\n /**\n * Human-readable project number\n */\n projectNumber: number = 0;\n\n /**\n * Project title\n */\n @field({ description: \"The project's name.\" })\n title: string = '';\n\n /**\n * Project description\n */\n @field({ description: 'What the project is about.' })\n description: string = '';\n\n /**\n * Project owner (organization or user)\n */\n @field({ description: 'Who owns or runs the project.' })\n owner: string = '';\n\n /**\n * Project URL\n */\n @field({ description: 'A link to the project elsewhere.' })\n url: string = '';\n\n /**\n * Project provider type\n */\n providerType: ProjectProviderType = 'github';\n\n /**\n * Environment variable name or config key for token resolution\n */\n tokenConfigKey: string = 'GITHUB_TOKEN';\n\n /**\n * Available statuses (columns) in the project\n */\n statuses: ProjectStatus[] = [];\n\n /**\n * Custom fields defined in the project\n */\n fields: ProjectField[] = [];\n\n /**\n * Status field ID for GitHub Projects V2\n */\n statusFieldId: string = '';\n\n /**\n * Maps status name to option ID (for GitHub Projects V2)\n */\n statusOptions: Record<string, string> = {};\n\n /**\n * Last sync timestamp\n */\n lastSyncedAt: Date | null = null;\n\n /**\n * Transient: Cached project client (not persisted)\n */\n private _client?: IProject;\n\n constructor(options: ProjectOptions = {}) {\n super(options);\n if (options.projectId !== undefined) this.projectId = options.projectId;\n if (options.projectNumber !== undefined)\n this.projectNumber = options.projectNumber;\n if (options.title !== undefined) this.title = options.title;\n if (options.description !== undefined)\n this.description = options.description;\n if (options.owner !== undefined) this.owner = options.owner;\n if (options.url !== undefined) this.url = options.url;\n if (options.providerType !== undefined)\n this.providerType = options.providerType;\n if (options.tokenConfigKey !== undefined)\n this.tokenConfigKey = options.tokenConfigKey;\n if (options.statuses !== undefined) this.statuses = options.statuses;\n if (options.fields !== undefined) this.fields = options.fields;\n if (options.statusFieldId !== undefined)\n this.statusFieldId = options.statusFieldId;\n if (options.statusOptions !== undefined)\n this.statusOptions = options.statusOptions;\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n }\n\n /**\n * Get the project client, resolving token from config\n *\n * @returns Project client for API operations\n * @throws Error if token cannot be resolved\n */\n async getClient(): Promise<IProject> {\n if (this._client) {\n return this._client;\n }\n\n // Resolve token from environment or config\n const token =\n process.env[this.tokenConfigKey] ||\n (getModuleConfig<Record<string, string>>('smrt-projects', {})[\n this.tokenConfigKey\n ] as string);\n\n if (!token) {\n throw new Error(\n `Token not found for key '${this.tokenConfigKey}'. ` +\n `Set the ${this.tokenConfigKey} environment variable or configure it in smrt.config.`,\n );\n }\n\n this._client = await getProject({\n type: this.providerType,\n projectId: this.projectId,\n token,\n statusFieldId: this.statusFieldId || undefined,\n statusOptions:\n Object.keys(this.statusOptions).length > 0\n ? this.statusOptions\n : undefined,\n });\n\n return this._client;\n }\n\n /**\n * Clear the cached client\n */\n clearClient(): void {\n this._client = undefined;\n }\n\n /**\n * Sync project metadata from the provider\n *\n * @param options - Sync options\n * @returns This project with updated fields\n */\n async sync(options: SyncOptions = {}): Promise<this> {\n // Check if we recently synced (within 5 minutes)\n if (\n !options.force &&\n this.lastSyncedAt &&\n Date.now() - this.lastSyncedAt.getTime() < SYNC_THROTTLE_MS\n ) {\n return this;\n }\n\n const client = await this.getClient();\n const projectData: SDKProject = await client.getProject();\n\n // Update fields from remote\n this.title = projectData.title;\n this.description = projectData.description || '';\n this.owner = projectData.owner;\n this.url = projectData.url;\n this.statuses = projectData.statuses;\n this.fields = projectData.fields;\n this.lastSyncedAt = new Date();\n\n await this.save();\n return this;\n }\n\n /**\n * Add an issue or PR to this project\n *\n * @param item - Issue or PullRequest to add\n * @returns Created ProjectItem\n */\n async addItem(item: Issue | PullRequest): Promise<ProjectItem> {\n if (!item.nodeId) {\n throw new Error('Item must have a nodeId (sync the item first)');\n }\n\n const client = await this.getClient();\n return await client.addItem(item.nodeId);\n }\n\n /**\n * Remove an item from this project\n *\n * @param itemId - Project item ID to remove\n */\n async removeItem(itemId: string): Promise<void> {\n const client = await this.getClient();\n await client.removeItem(itemId);\n }\n\n /**\n * Get a specific item from the project\n *\n * @param itemId - Project item ID\n * @returns ProjectItem or null\n */\n async getItem(itemId: string): Promise<ProjectItem | null> {\n const client = await this.getClient();\n return await client.getItem(itemId);\n }\n\n /**\n * List items in this project\n *\n * @param filters - Optional filters\n * @returns Array of ProjectItems\n */\n async listItems(filters?: ItemFilters): Promise<ProjectItem[]> {\n const client = await this.getClient();\n return await client.listItems(filters);\n }\n\n /**\n * Update an item's status (column)\n *\n * @param itemId - Project item ID\n * @param status - New status name\n */\n async updateItemStatus(itemId: string, status: string): Promise<void> {\n const client = await this.getClient();\n await client.updateItemStatus(itemId, status);\n }\n\n /**\n * Update an item's custom field\n *\n * @param itemId - Project item ID\n * @param fieldId - Field ID\n * @param value - New value\n */\n async updateItemField(\n itemId: string,\n fieldId: string,\n value: unknown,\n ): Promise<void> {\n const client = await this.getClient();\n await client.updateItemField(itemId, fieldId, value);\n }\n\n /**\n * Get available statuses\n *\n * @returns Array of status definitions\n */\n async getStatuses(): Promise<ProjectStatus[]> {\n if (this.statuses.length > 0) {\n return this.statuses;\n }\n\n const client = await this.getClient();\n this.statuses = await client.listStatuses();\n await this.save();\n return this.statuses;\n }\n\n /**\n * Get available fields\n *\n * @returns Array of field definitions\n */\n async getFields(): Promise<ProjectField[]> {\n if (this.fields.length > 0) {\n return this.fields;\n }\n\n const client = await this.getClient();\n this.fields = await client.listFields();\n await this.save();\n return this.fields;\n }\n\n /**\n * Get items in a specific status/column\n *\n * @param status - Status name\n * @returns Array of ProjectItems in that status\n */\n async getItemsByStatus(status: string): Promise<ProjectItem[]> {\n return await this.listItems({ status });\n }\n\n /**\n * Move an item to a new status\n *\n * @param item - Issue or PullRequest\n * @param status - Target status name\n */\n async moveItem(item: Issue | PullRequest, status: string): Promise<void> {\n // First, find the item in the project\n const items = await this.listItems();\n const projectItem = items.find((i) => i.contentId === item.nodeId);\n\n if (!projectItem) {\n throw new Error('Item not found in project');\n }\n\n await this.updateItemStatus(projectItem.id, status);\n }\n\n /**\n * AI-powered: Analyze project health and suggest improvements\n *\n * @returns Analysis of project status\n */\n async analyzeHealth(): Promise<string> {\n const items = await this.listItems();\n const statuses = await this.getStatuses();\n\n // Count items by status\n const statusCounts: Record<string, number> = {};\n for (const status of statuses) {\n statusCounts[status.name] = items.filter(\n (i) => i.status === status.name,\n ).length;\n }\n\n return await this.do(\n `Analyze the health of this project board and suggest improvements.\n\n Project: ${this.title}\n Description: ${this.description}\n\n Item distribution by status:\n ${Object.entries(statusCounts)\n .map(([status, count]) => `- ${status}: ${count} items`)\n .join('\\n')}\n\n Total items: ${items.length}\n\n Provide:\n 1. Overall health assessment\n 2. Potential bottlenecks\n 3. Suggestions for improvement`,\n // Title/description/status counts hand-rolled above; skip do()'s\n // object-data injection so the board context is not duplicated.\n { includeData: false },\n );\n }\n\n /**\n * Get project by title\n *\n * @param title - Project title\n * @param options - Additional options\n * @returns Project or null\n */\n static async getByTitle(\n title: string,\n options: SmrtObjectOptions = {},\n ): Promise<Project | null> {\n const { ProjectCollection } = await import('../collections/Projects');\n const collection = await ProjectCollection.create(options);\n return await collection.findByTitle(title);\n }\n}\n","/**\n * ProjectCollection - Collection manager for Project objects\n *\n * Provides querying and discovery operations for Project entities.\n */\n\nimport { createLogger } from '@happyvertical/logger';\nimport { SmrtCollection } from '@happyvertical/smrt-core';\nimport { queryGlobal, queryWithGlobals } from '@happyvertical/smrt-tenancy';\nimport { Project } from '../models/Project';\nimport type { ProjectProviderType } from '../types';\n\nconst logger = createLogger({ level: 'info' });\n\nexport class ProjectCollection extends SmrtCollection<Project> {\n static readonly _itemClass = Project;\n\n /**\n * Find project by title\n *\n * @param title - Project title\n * @returns Project or null\n */\n async findByTitle(title: string): Promise<Project | null> {\n const results = await this.list({\n where: { title },\n limit: 1,\n });\n return results[0] || null;\n }\n\n /**\n * Find projects by owner\n *\n * @param owner - Project owner (organization or user)\n * @returns Array of projects\n */\n async findByOwner(owner: string): Promise<Project[]> {\n return await this.list({\n where: { owner },\n });\n }\n\n /**\n * Find projects by provider type\n *\n * @param providerType - Provider type\n * @returns Array of projects\n */\n async findByProvider(providerType: ProjectProviderType): Promise<Project[]> {\n return await this.list({\n where: { providerType },\n });\n }\n\n /**\n * Get or create a project by ID\n *\n * @param projectId - Provider-specific project ID\n * @param options - Additional options for creation\n * @returns Project (existing or newly created)\n */\n async getOrCreate(\n projectId: string,\n options: {\n title?: string;\n owner?: string;\n providerType?: ProjectProviderType;\n tokenConfigKey?: string;\n statusFieldId?: string;\n statusOptions?: Record<string, string>;\n } = {},\n ): Promise<Project> {\n let project = await this.findOne({\n where: { projectId },\n });\n\n if (!project) {\n project = await this.create({\n projectId,\n title: options.title || '',\n owner: options.owner || '',\n providerType: options.providerType || 'github',\n tokenConfigKey: options.tokenConfigKey || 'GITHUB_TOKEN',\n statusFieldId: options.statusFieldId || '',\n statusOptions: options.statusOptions || {},\n });\n await project.save();\n\n // Sync to get full project data\n await project.sync({ force: true });\n }\n\n return project;\n }\n\n /**\n * Sync all projects\n *\n * @param options - Sync options\n * @returns Array of synced projects\n */\n async syncAll(options: { force?: boolean } = {}): Promise<Project[]> {\n const projects = await this.list({});\n const synced: Project[] = [];\n\n for (const project of projects) {\n await project.sync(options);\n synced.push(project);\n }\n\n return synced;\n }\n\n /**\n * Find projects with items in a specific status\n *\n * @param status - Status name\n * @returns Array of projects\n */\n async findWithItemsInStatus(status: string): Promise<Project[]> {\n const projects = await this.list({});\n const matching: Project[] = [];\n\n for (const project of projects) {\n try {\n const items = await project.getItemsByStatus(status);\n if (items.length > 0) {\n matching.push(project);\n }\n } catch (error) {\n // Log error and skip projects we can't access\n logger.warn(`Error accessing items for project ${project.projectId}`, {\n error: error instanceof Error ? error.message : error,\n });\n }\n }\n\n return matching;\n }\n\n /**\n * Get project statistics\n *\n * @param projectId - Project ID\n * @returns Statistics object\n */\n async getStatistics(projectId: string): Promise<{\n totalItems: number;\n itemsByStatus: Record<string, number>;\n itemsByType: Record<string, number>;\n }> {\n const project = await this.findOne({ where: { projectId } });\n if (!project) {\n throw new Error(`Project ${projectId} not found`);\n }\n\n const items = await project.listItems();\n const statuses = await project.getStatuses();\n\n const itemsByStatus: Record<string, number> = {};\n for (const status of statuses) {\n itemsByStatus[status.name] = 0;\n }\n\n const itemsByType: Record<string, number> = {\n Issue: 0,\n PullRequest: 0,\n DraftIssue: 0,\n };\n\n for (const item of items) {\n if (item.status && itemsByStatus[item.status] !== undefined) {\n itemsByStatus[item.status]++;\n }\n if (itemsByType[item.type] !== undefined) {\n itemsByType[item.type]++;\n }\n }\n\n return {\n totalItems: items.length,\n itemsByStatus,\n itemsByType,\n };\n }\n\n /**\n * Find projects by tenant ID\n *\n * @param tenantId - Tenant ID to filter by\n * @returns Array of projects for the tenant\n */\n async findByTenant(tenantId: string): Promise<Project[]> {\n return this.list({ where: { tenantId } });\n }\n\n /**\n * Find all global projects (no tenant association).\n *\n * Routes through the shared tenant-global helper so it does not throw under\n * an active tenant context (an explicit `tenant_id IS NULL` filter would be\n * flagged as an isolation violation). (#1600)\n *\n * @returns Array of global projects\n */\n async findGlobal(): Promise<Project[]> {\n return queryGlobal<Project>(this);\n }\n\n /**\n * Find projects for a tenant plus all global projects.\n *\n * Fails closed if an active tenant context requests a different tenant's\n * rows; the admin/system path keeps the cross-tenant capability. (#1600)\n *\n * @param tenantId - Tenant ID to filter by\n * @returns Array of tenant and global projects\n */\n async findWithGlobals(tenantId: string): Promise<Project[]> {\n return queryWithGlobals<Project>(this, tenantId, 'Project.findWithGlobals');\n }\n}\n","/**\n * PullRequestCollection - Collection manager for PullRequest objects\n *\n * Provides querying and discovery operations for PullRequest entities.\n */\n\nimport { createLogger } from '@happyvertical/logger';\nimport { SmrtCollection } from '@happyvertical/smrt-core';\nimport { queryGlobal, queryWithGlobals } from '@happyvertical/smrt-tenancy';\nimport { PullRequest } from '../models/PullRequest';\nimport type { Repository } from '../models/Repository';\nimport type { SDKPullRequest, SearchFilters } from '../types';\n\nconst logger = createLogger({ level: 'info' });\n\nexport class PullRequestCollection extends SmrtCollection<PullRequest> {\n static readonly _itemClass = PullRequest;\n\n /**\n * Discover pull requests from a repository and sync to database\n *\n * @param options - Discovery options\n * @returns Array of PullRequest objects\n */\n async discover(options: {\n repository: Repository;\n filters?: SearchFilters;\n }): Promise<PullRequest[]> {\n const { repository, filters } = options;\n const repositoryId = repository.id ?? undefined;\n\n if (!repositoryId) {\n throw new Error(\n 'Repository must be saved before discovering pull requests',\n );\n }\n\n const repoClient = await repository.getClient();\n\n // Note: searchIssues with type filter would get PRs in GitHub\n // For now, we'll search for all and filter\n const remoteItems = await repoClient.searchIssues('is:pr', filters);\n\n const pullRequests: PullRequest[] = [];\n\n for (const remote of remoteItems) {\n // Get full PR data\n let prData: SDKPullRequest;\n try {\n prData = await repoClient.getPullRequest(remote.number);\n } catch (error) {\n // Log error and skip PR - could be rate limiting, auth, or access issues\n logger.warn(\n `Failed to fetch PR #${remote.number} from ${repository.owner}/${repository.name}`,\n { error: error instanceof Error ? error.message : error },\n );\n continue;\n }\n\n // Find existing PR by repository + number\n let pr = await this.findOne({\n where: {\n repositoryId,\n number: remote.number,\n },\n });\n\n if (!pr) {\n // Create new PR\n pr = await this.create({\n repositoryId,\n number: prData.number,\n nodeId: prData.id,\n title: prData.title,\n body: prData.body,\n state: prData.state,\n author: prData.author.login,\n labels: prData.labels.map((l) => l.name),\n assignees: prData.assignees.map((a) => a.login),\n commentsCount: prData.commentsCount,\n headRef: prData.headRef,\n baseRef: prData.baseRef,\n merged: prData.merged,\n mergedAt: prData.mergedAt || null,\n mergeable: prData.mergeable,\n draft: prData.draft,\n lastSyncedAt: new Date(),\n });\n } else {\n // Update existing PR\n pr.nodeId = prData.id;\n pr.title = prData.title;\n pr.body = prData.body;\n pr.state = prData.state;\n pr.author = prData.author.login;\n pr.labels = prData.labels.map((l) => l.name);\n pr.assignees = prData.assignees.map((a) => a.login);\n pr.commentsCount = prData.commentsCount;\n pr.headRef = prData.headRef;\n pr.baseRef = prData.baseRef;\n pr.merged = prData.merged;\n pr.mergedAt = prData.mergedAt || null;\n pr.mergeable = prData.mergeable;\n pr.draft = prData.draft;\n pr.lastSyncedAt = new Date();\n }\n\n await pr.save();\n pullRequests.push(pr);\n }\n\n return pullRequests;\n }\n\n /**\n * Find PRs by repository\n *\n * @param repositoryId - Repository ID\n * @returns Array of PRs\n */\n async findByRepository(repositoryId: string): Promise<PullRequest[]> {\n return await this.list({\n where: { repositoryId },\n });\n }\n\n /**\n * Find open PRs\n *\n * @param repositoryId - Optional repository filter\n * @returns Array of open PRs\n */\n async findOpen(repositoryId?: string): Promise<PullRequest[]> {\n const where: Record<string, unknown> = { state: 'open' };\n if (repositoryId) {\n where.repositoryId = repositoryId;\n }\n return await this.list({ where });\n }\n\n /**\n * Find draft PRs\n *\n * @param repositoryId - Optional repository filter\n * @returns Array of draft PRs\n */\n async findDrafts(repositoryId?: string): Promise<PullRequest[]> {\n const openPRs = await this.findOpen(repositoryId);\n return openPRs.filter((pr) => pr.draft);\n }\n\n /**\n * Find PRs ready to merge\n *\n * @param repositoryId - Optional repository filter\n * @returns Array of mergeable PRs\n */\n async findReadyToMerge(repositoryId?: string): Promise<PullRequest[]> {\n const openPRs = await this.findOpen(repositoryId);\n return openPRs.filter((pr) => !pr.draft && pr.mergeable);\n }\n\n /**\n * Find PRs by branch\n *\n * @param branch - Branch name (head or base)\n * @param repositoryId - Optional repository filter\n * @returns Array of PRs\n */\n async findByBranch(\n branch: string,\n repositoryId?: string,\n ): Promise<PullRequest[]> {\n const prs = await this.list({\n where: repositoryId ? { repositoryId } : {},\n });\n\n return prs.filter((pr) => pr.headRef === branch || pr.baseRef === branch);\n }\n\n /**\n * Find PR by number in a repository\n *\n * @param repositoryId - Repository ID\n * @param number - PR number\n * @returns PullRequest or null\n */\n async findByNumber(\n repositoryId: string,\n number: number,\n ): Promise<PullRequest | null> {\n const results = await this.list({\n where: { repositoryId, number },\n limit: 1,\n });\n return results[0] || null;\n }\n\n /**\n * Find PRs ready to merge (AI-powered)\n *\n * @param repositoryId - Optional repository filter\n * @returns Array of PRs that are ready\n */\n async findAIReadyToMerge(repositoryId?: string): Promise<PullRequest[]> {\n const openPRs = await this.findOpen(repositoryId);\n const ready: PullRequest[] = [];\n\n for (const pr of openPRs) {\n if (await pr.isReadyToMerge()) {\n ready.push(pr);\n }\n }\n\n return ready;\n }\n\n /**\n * Get PRs by change size\n *\n * @param size - Size classification\n * @param repositoryId - Optional repository filter\n * @returns Array of PRs\n */\n async findBySize(\n size: 'xs' | 's' | 'm' | 'l' | 'xl',\n repositoryId?: string,\n ): Promise<PullRequest[]> {\n const prs = await this.findOpen(repositoryId);\n return prs.filter((pr) => pr.getChangeSize() === size);\n }\n\n /**\n * Batch sync PRs from repository\n *\n * @param repository - Repository to sync from\n * @param options - Sync options\n * @returns Array of synced PRs\n */\n async batchSync(\n repository: Repository,\n options: { force?: boolean } = {},\n ): Promise<PullRequest[]> {\n const prs = await this.findByRepository(repository.id as string);\n const synced: PullRequest[] = [];\n\n for (const pr of prs) {\n await pr.sync(options);\n synced.push(pr);\n }\n\n return synced;\n }\n\n /**\n * Find pull requests by tenant ID\n *\n * @param tenantId - Tenant ID to filter by\n * @returns Array of pull requests for the tenant\n */\n async findByTenant(tenantId: string): Promise<PullRequest[]> {\n return this.list({ where: { tenantId } });\n }\n\n /**\n * Find all global pull requests (no tenant association).\n *\n * Routes through the shared tenant-global helper so it does not throw under\n * an active tenant context (an explicit `tenant_id IS NULL` filter would be\n * flagged as an isolation violation). (#1600)\n *\n * @returns Array of global pull requests\n */\n async findGlobal(): Promise<PullRequest[]> {\n return queryGlobal<PullRequest>(this);\n }\n\n /**\n * Find pull requests for a tenant plus all global pull requests.\n *\n * Fails closed if an active tenant context requests a different tenant's\n * rows; the admin/system path keeps the cross-tenant capability. (#1600)\n *\n * @param tenantId - Tenant ID to filter by\n * @returns Array of tenant and global pull requests\n */\n async findWithGlobals(tenantId: string): Promise<PullRequest[]> {\n return queryWithGlobals<PullRequest>(\n this,\n tenantId,\n 'PullRequest.findWithGlobals',\n );\n }\n}\n","/**\n * Repository model - SMRT wrapper for repository operations\n *\n * Provides persistent repository tracking with provider-agnostic operations.\n * Uses @happyvertical/repos SDK for actual API calls.\n */\n\nimport { getRepository } from '@happyvertical/repos';\nimport { getModuleConfig } from '@happyvertical/smrt-config';\nimport {\n ObjectRegistry,\n SmrtObject,\n type SmrtObjectOptions,\n smrt,\n toSnakeCase,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport { SYNC_THROTTLE_MS } from '../constants';\nimport { getScopedRepositoryClient } from '../repository-client-scope';\nimport type {\n CreateIssueInput,\n CreatePRInput,\n IRepository,\n RepositoryProviderType,\n SDKRepository,\n SearchFilters,\n SyncOptions,\n} from '../types';\nimport type { Issue } from './Issue';\nimport type { PullRequest } from './PullRequest';\n\nexport interface RepositoryOptions extends SmrtObjectOptions {\n owner?: string;\n name?: string;\n fullName?: string;\n description?: string;\n defaultBranch?: string;\n isPrivate?: boolean;\n providerType?: RepositoryProviderType;\n baseUrl?: string;\n tokenConfigKey?: string;\n tenantId?: string | null;\n}\n\n@TenantScoped({ mode: 'optional' })\n@smrt({\n api: { include: ['list', 'get', 'create', 'update'] },\n mcp: { include: ['list', 'get', 'sync'] },\n // sync is an operator command invoked in-process via the CLI;\n // it intentionally isn't exposed over HTTP today.\n cli: { include: ['list', 'get', 'sync', 'create'], skipApiCheck: true },\n})\nexport class Repository extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-projects\";\n /**\n * Tenant ID for multi-tenant isolation\n */\n @tenantId({ nullable: true })\n tenantId: string | null = null;\n\n /**\n * Repository owner (organization or user)\n */\n owner: string = '';\n\n /**\n * Repository name\n */\n name: string = '';\n\n /**\n * Full name in owner/repo format\n */\n fullName: string = '';\n\n /**\n * Repository description\n */\n description: string = '';\n\n /**\n * Default branch name\n */\n defaultBranch: string = 'main';\n\n /**\n * Whether repository is private\n */\n isPrivate: boolean = false;\n\n /**\n * Repository provider type\n */\n providerType: RepositoryProviderType = 'github';\n\n /**\n * Base URL for self-hosted instances (GitHub Enterprise, GitLab self-hosted, etc.)\n */\n baseUrl: string = '';\n\n /**\n * Environment variable name or config key for token resolution\n * The token is NOT stored - only the key name is persisted\n */\n tokenConfigKey: string = 'GITHUB_TOKEN';\n\n /**\n * Last sync timestamp\n */\n lastSyncedAt: Date | null = null;\n\n /**\n * Transient: Cached repository client (not persisted)\n */\n private _client?: IRepository;\n\n constructor(options: RepositoryOptions = {}) {\n super(options);\n if (options.owner !== undefined) this.owner = options.owner;\n if (options.name !== undefined) this.name = options.name;\n if (options.fullName !== undefined) this.fullName = options.fullName;\n if (options.description !== undefined)\n this.description = options.description;\n if (options.defaultBranch !== undefined)\n this.defaultBranch = options.defaultBranch;\n if (options.isPrivate !== undefined) this.isPrivate = options.isPrivate;\n if (options.providerType !== undefined)\n this.providerType = options.providerType;\n if (options.baseUrl !== undefined) this.baseUrl = options.baseUrl;\n if (options.tokenConfigKey !== undefined)\n this.tokenConfigKey = options.tokenConfigKey;\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n }\n\n /**\n * Get the repository client, resolving token from config\n *\n * Token resolution order:\n * 1. Environment variable matching tokenConfigKey\n * 2. Module config value matching tokenConfigKey\n *\n * @returns Repository client for API operations\n * @throws Error if token cannot be resolved\n */\n async getClient(): Promise<IRepository> {\n const scopedClient = getScopedRepositoryClient(this);\n if (scopedClient) {\n return scopedClient;\n }\n if (this._client) {\n return this._client;\n }\n\n // Resolve token from environment or config\n const token =\n process.env[this.tokenConfigKey] ||\n (getModuleConfig<Record<string, string>>('smrt-projects', {})[\n this.tokenConfigKey\n ] as string);\n\n if (!token) {\n throw new Error(\n `Token not found for key '${this.tokenConfigKey}'. ` +\n `Set the ${this.tokenConfigKey} environment variable or configure it in smrt.config.`,\n );\n }\n\n this._client = await getRepository({\n type: this.providerType,\n owner: this.owner,\n repo: this.name,\n token,\n baseUrl: this.baseUrl || undefined,\n });\n\n return this._client;\n }\n\n /**\n * Clear the cached client (useful after token refresh)\n */\n clearClient(): void {\n this._client = undefined;\n }\n\n /**\n * Sync repository metadata from the provider\n *\n * @param options - Sync options\n * @returns This repository with updated fields\n */\n async sync(options: SyncOptions = {}): Promise<this> {\n // Check if we recently synced (within 5 minutes)\n if (\n !options.force &&\n this.lastSyncedAt &&\n Date.now() - this.lastSyncedAt.getTime() < SYNC_THROTTLE_MS\n ) {\n return this;\n }\n\n const client = await this.getClient();\n const repoData: SDKRepository = await client.getRepository();\n\n // Update fields from remote\n this.owner = repoData.owner;\n this.name = repoData.name;\n this.fullName = `${repoData.owner}/${repoData.name}`;\n this.description = repoData.description;\n this.defaultBranch = repoData.defaultBranch;\n this.isPrivate = repoData.isPrivate;\n this.lastSyncedAt = new Date();\n\n await this.save();\n return this;\n }\n\n /**\n * Get issues from this repository\n *\n * @param filters - Optional search filters\n * @returns Array of Issue objects (SMRT models)\n */\n async getIssues(filters?: SearchFilters): Promise<Issue[]> {\n const { IssueCollection } = await import('../collections/Issues');\n const collection = await IssueCollection.create(this.options);\n return await collection.discover({ repository: this, filters });\n }\n\n /**\n * Get pull requests from this repository\n *\n * @param filters - Optional search filters\n * @returns Array of PullRequest objects (SMRT models)\n */\n async getPullRequests(filters?: SearchFilters): Promise<PullRequest[]> {\n const { PullRequestCollection } = await import(\n '../collections/PullRequests'\n );\n const collection = await PullRequestCollection.create(this.options);\n return await collection.discover({ repository: this, filters });\n }\n\n /**\n * Options for an issue or pull request created from this repository: the\n * database connection and tenant context, without any of this repository's\n * own columns (identity, timestamps, data). A repository loaded from the database holds its row's\n * `id`/`slug` in `this.options`; spread into a new issue they would give\n * every issue the repository's primary key and slug, so each save would\n * overwrite the previous issue.\n */\n private childOptions(): Record<string, unknown> {\n const rest = { ...(this.options as Record<string, unknown>) };\n // Every column of the repository's own row goes, not just a known few: a\n // loaded repository's `created_at` (or any other field) would otherwise\n // be copied onto each new issue.\n const ownKeys = new Set([\n 'id',\n 'slug',\n 'context',\n '_skipLoad',\n 'created_at',\n 'updated_at',\n 'createdAt',\n 'updatedAt',\n ]);\n for (const fieldName of ObjectRegistry.getFields(\n this.getResolvedQualifiedName(),\n ).keys()) {\n ownKeys.add(fieldName);\n ownKeys.add(toSnakeCase(fieldName));\n }\n // The tenant is context, not identity: issues belong to the\n // repository's tenant.\n ownKeys.delete('tenantId');\n ownKeys.delete('tenant_id');\n for (const key of ownKeys) delete rest[key];\n return rest;\n }\n\n /**\n * Create a new issue in this repository\n *\n * @param data - Issue creation data\n * @returns Created Issue (SMRT model)\n */\n async createIssue(data: CreateIssueInput): Promise<Issue> {\n const repositoryId = this.id ?? undefined;\n if (!repositoryId) {\n throw new Error('Repository must be saved before creating issues');\n }\n\n const client = await this.getClient();\n const created = await client.createIssue(data);\n\n // Create SMRT Issue from remote data\n const { Issue } = await import('./Issue');\n const issue = new Issue({\n ...this.childOptions(),\n repositoryId,\n number: created.number,\n nodeId: created.id,\n title: created.title,\n body: created.body,\n state: created.state,\n author: created.author.login,\n labels: created.labels.map((l) => l.name),\n assignees: created.assignees.map((a) => a.login),\n commentsCount: created.commentsCount,\n lastSyncedAt: new Date(),\n });\n\n // Directly-constructed models must be initialized before save() can access\n // the database connection (SmrtCollection.create() does this internally).\n await issue.initialize();\n await issue.save();\n return issue;\n }\n\n /**\n * Create a new pull request in this repository\n *\n * @param data - PR creation data\n * @returns Created PullRequest (SMRT model)\n */\n async createPullRequest(data: CreatePRInput): Promise<PullRequest> {\n const repositoryId = this.id ?? undefined;\n if (!repositoryId) {\n throw new Error('Repository must be saved before creating pull requests');\n }\n\n const client = await this.getClient();\n const created = await client.createPullRequest(data);\n\n // Create SMRT PullRequest from remote data\n const { PullRequest } = await import('./PullRequest');\n const pr = new PullRequest({\n ...this.childOptions(),\n repositoryId,\n number: created.number,\n nodeId: created.id,\n title: created.title,\n body: created.body,\n state: created.state,\n author: created.author.login,\n labels: created.labels.map((l) => l.name),\n assignees: created.assignees.map((a) => a.login),\n commentsCount: created.commentsCount,\n headRef: created.headRef,\n baseRef: created.baseRef,\n merged: created.merged,\n draft: created.draft,\n lastSyncedAt: new Date(),\n });\n\n // Directly-constructed models must be initialized before save() can access\n // the database connection (SmrtCollection.create() does this internally).\n await pr.initialize();\n await pr.save();\n return pr;\n }\n\n /**\n * Check if this repository has any open issues matching criteria\n *\n * @param criteria - Natural language description of what to check\n * @returns True if matching issues exist\n */\n async hasOpenIssuesMatching(criteria: string): Promise<boolean> {\n const issues = await this.getIssues({ state: 'open' });\n if (issues.length === 0) return false;\n\n return await this.is(\n `This repository has open issues matching: ${criteria}. ` +\n `Current open issues: ${issues.map((i) => `#${i.number}: ${i.title}`).join(', ')}`,\n );\n }\n\n /**\n * Generate a summary of repository activity\n *\n * @returns AI-generated summary\n */\n async summarizeActivity(): Promise<string> {\n const issues = await this.getIssues({ state: 'open', limit: 10 });\n const prs = await this.getPullRequests({ state: 'open', limit: 10 });\n\n return await this.do(\n `Summarize the current activity in this repository. ` +\n `Open issues: ${issues.map((i) => `#${i.number}: ${i.title}`).join(', ')}. ` +\n `Open PRs: ${prs.map((p) => `#${p.number}: ${p.title}`).join(', ')}.`,\n );\n }\n\n /**\n * Get repository by owner and name\n *\n * @param owner - Repository owner\n * @param name - Repository name\n * @param options - Additional options\n * @returns Repository or null if not found\n */\n static async getByFullName(\n owner: string,\n name: string,\n options: SmrtObjectOptions = {},\n ): Promise<Repository | null> {\n const { RepositoryCollection } = await import(\n '../collections/Repositories'\n );\n const collection = await RepositoryCollection.create(options);\n return await collection.findByFullName(owner, name);\n }\n}\n","/**\n * RepositoryCollection - Collection manager for Repository objects\n *\n * Provides querying and discovery operations for Repository entities.\n */\n\nimport { createLogger } from '@happyvertical/logger';\nimport { SmrtCollection } from '@happyvertical/smrt-core';\nimport { queryGlobal, queryWithGlobals } from '@happyvertical/smrt-tenancy';\nimport { Repository } from '../models/Repository';\nimport type { RepositoryProviderType } from '../types';\n\nconst logger = createLogger({ level: 'info' });\n\nexport class RepositoryCollection extends SmrtCollection<Repository> {\n static readonly _itemClass = Repository;\n\n /**\n * Find a repository by owner and name\n *\n * @param owner - Repository owner\n * @param name - Repository name\n * @returns Repository or null\n */\n async findByFullName(\n owner: string,\n name: string,\n ): Promise<Repository | null> {\n const results = await this.list({\n where: { owner, name },\n limit: 1,\n });\n return results[0] || null;\n }\n\n /**\n * Find repositories by owner\n *\n * @param owner - Repository owner\n * @returns Array of repositories\n */\n async findByOwner(owner: string): Promise<Repository[]> {\n return await this.list({\n where: { owner },\n });\n }\n\n /**\n * Find repositories by provider type\n *\n * @param providerType - Provider type\n * @returns Array of repositories\n */\n async findByProvider(\n providerType: RepositoryProviderType,\n ): Promise<Repository[]> {\n return await this.list({\n where: { providerType },\n });\n }\n\n /**\n * Get or create a repository by owner/name\n *\n * @param owner - Repository owner\n * @param name - Repository name\n * @param options - Additional options for creation\n * @returns Repository (existing or newly created)\n */\n async getOrCreate(\n owner: string,\n name: string,\n options: {\n providerType?: RepositoryProviderType;\n tokenConfigKey?: string;\n baseUrl?: string;\n } = {},\n ): Promise<Repository> {\n let repo = await this.findByFullName(owner, name);\n\n if (!repo) {\n repo = await this.create({\n owner,\n name,\n fullName: `${owner}/${name}`,\n providerType: options.providerType || 'github',\n tokenConfigKey: options.tokenConfigKey || 'GITHUB_TOKEN',\n baseUrl: options.baseUrl || '',\n });\n await repo.save();\n }\n\n return repo;\n }\n\n /**\n * Sync all repositories\n *\n * @param options - Sync options\n * @returns Array of synced repositories\n */\n async syncAll(options: { force?: boolean } = {}): Promise<Repository[]> {\n const repos = await this.list({});\n const synced: Repository[] = [];\n\n for (const repo of repos) {\n await repo.sync(options);\n synced.push(repo);\n }\n\n return synced;\n }\n\n /**\n * Find repositories with open issues\n *\n * @returns Array of repositories with at least one open issue\n */\n async findWithOpenIssues(): Promise<Repository[]> {\n const repos = await this.list({});\n const withIssues: Repository[] = [];\n\n for (const repo of repos) {\n try {\n const issues = await repo.getIssues({ state: 'open', limit: 1 });\n if (issues.length > 0) {\n withIssues.push(repo);\n }\n } catch (error) {\n // Log error and skip repos we can't access\n logger.warn(\n `Error accessing issues for repository ${repo.owner}/${repo.name}`,\n { error: error instanceof Error ? error.message : error },\n );\n }\n }\n\n return withIssues;\n }\n\n /**\n * Find repositories by tenant ID\n *\n * @param tenantId - Tenant ID to filter by\n * @returns Array of repositories for the tenant\n */\n async findByTenant(tenantId: string): Promise<Repository[]> {\n return this.list({ where: { tenantId } });\n }\n\n /**\n * Find all global repositories (no tenant association).\n *\n * Routes through the shared tenant-global helper so it does not throw under\n * an active tenant context (an explicit `tenant_id IS NULL` filter would be\n * flagged as an isolation violation). (#1600)\n *\n * @returns Array of global repositories\n */\n async findGlobal(): Promise<Repository[]> {\n return queryGlobal<Repository>(this);\n }\n\n /**\n * Find repositories for a tenant plus all global repositories.\n *\n * Fails closed if an active tenant context requests a different tenant's\n * rows; the admin/system path keeps the cross-tenant capability. (#1600)\n *\n * @param tenantId - Tenant ID to filter by\n * @returns Array of tenant and global repositories\n */\n async findWithGlobals(tenantId: string): Promise<Repository[]> {\n return queryWithGlobals<Repository>(\n this,\n tenantId,\n 'Repository.findWithGlobals',\n );\n }\n}\n","import {\n field,\n foreignKey,\n SmrtCollection,\n SmrtObject,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport type { AssistanceClassification, DeliveryEventType } from '../types.js';\n\nexport function parseProjectJson<T>(value: string, fallback: T): T {\n try {\n return JSON.parse(value) as T;\n } catch {\n return fallback;\n }\n}\n\nconst INTERNAL_SURFACES = {\n api: false,\n cli: false,\n mcp: false,\n} as const;\n\n/** Provider-neutral connection from a Development Request to canonical work. */\n@TenantScoped({ mode: 'required' })\n@smrt({\n tableName: 'development_request_work_links',\n conflictColumns: ['request_id', 'work_item_type', 'work_item_id'],\n ...INTERNAL_SURFACES,\n})\nexport class DevelopmentRequestWorkLink extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-projects\";\n @tenantId() tenantId: string = '';\n @foreignKey('DevelopmentRequest', { required: true }) requestId: string = '';\n @field({ type: 'text' }) workItemType: string = '';\n @field({ type: 'text' }) workItemId: string = '';\n @field({ type: 'text' }) canonicalStatus: string = '';\n @field({ type: 'text' }) providerRef: string = '';\n @field({ type: 'text' }) metadata: string = '{}';\n lastProjectedAt: Date | null = null;\n}\n\n/** Ordered, idempotent delivery update emitted by the control plane. */\n@TenantScoped({ mode: 'required' })\n@smrt({\n tableName: 'project_delivery_events',\n conflictColumns: ['integration_id', 'idempotency_key'],\n ...INTERNAL_SURFACES,\n})\nexport class ProjectDeliveryEvent extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-projects\";\n @tenantId() tenantId: string = '';\n @foreignKey('ProjectIntegration', { required: true })\n integrationId: string = '';\n @foreignKey('DevelopmentRequest', { required: true }) requestId: string = '';\n @field({ type: 'text' }) idempotencyKey: string = '';\n sequence: number = 0;\n @field({ type: 'text' }) type: DeliveryEventType = 'work_linked';\n @field({ type: 'text' }) payload: string = '{}';\n occurredAt: Date = new Date();\n deliveredAt: Date | null = null;\n deliveryAttempts: number = 0;\n @field({ type: 'text' }) lastDeliveryError: string = '';\n}\n\n/** Client decision state for one preview produced during delivery. */\n@TenantScoped({ mode: 'required' })\n@smrt({\n tableName: 'preview_approvals',\n conflictColumns: ['request_id', 'preview_id'],\n ...INTERNAL_SURFACES,\n})\nexport class PreviewApproval extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-projects\";\n @tenantId() tenantId: string = '';\n @foreignKey('DevelopmentRequest', { required: true }) requestId: string = '';\n @field({ type: 'text' }) previewId: string = '';\n @field({ type: 'text' }) previewUrl: string = '';\n @field({ type: 'text' }) status:\n | 'pending'\n | 'approved'\n | 'rejected'\n | 'stale' = 'pending';\n @field({ type: 'text' }) decidedByRef: string = '';\n @field({ type: 'text' }) reason: string = '';\n createdAt: Date = new Date();\n decidedAt: Date | null = null;\n staleAt: Date | null = null;\n}\n\n/** Lossless conversational intake before support/development classification. */\n@TenantScoped({ mode: 'required' })\n@smrt({ tableName: 'assistance_requests', ...INTERNAL_SURFACES })\nexport class AssistanceRequest extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-projects\";\n @tenantId() tenantId: string = '';\n @foreignKey('ProjectIntegration', { required: true })\n integrationId: string = '';\n @field({ type: 'text' }) requesterId: string = '';\n @field({ type: 'text' }) subject: string = '';\n @field({ type: 'text' }) applicationContext: string = '{}';\n @field({ type: 'text' }) conversation: string = '[]';\n @field({ type: 'text' }) evidence: string = '[]';\n @field({ type: 'text' }) classification: AssistanceClassification =\n 'unclassified';\n @field({ type: 'text' }) supportCaseId: string = '';\n @field({ type: 'text' }) developmentRequestId: string = '';\n deliveryHandoffLinkedAt: Date | null = null;\n createdAt: Date = new Date();\n}\n\n/** Append-only explanation of Assistance Request routing decisions. */\n@TenantScoped({ mode: 'required' })\n@smrt({ tableName: 'assistance_request_events', ...INTERNAL_SURFACES })\nexport class AssistanceRequestEvent extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-projects\";\n @tenantId() tenantId: string = '';\n @foreignKey('AssistanceRequest', { required: true })\n assistanceRequestId: string = '';\n @field({ type: 'text' }) priorClassification: AssistanceClassification =\n 'unclassified';\n @field({ type: 'text' }) resultingClassification: AssistanceClassification =\n 'unclassified';\n @field({ type: 'text' }) actorRef: string = '';\n @field({ type: 'text' }) reason: string = '';\n @field({ type: 'text' }) resultingLinks: string = '{}';\n occurredAt: Date = new Date();\n}\n\nexport class DevelopmentRequestWorkLinkCollection extends SmrtCollection<DevelopmentRequestWorkLink> {\n static readonly _itemClass = DevelopmentRequestWorkLink;\n}\nexport class ProjectDeliveryEventCollection extends SmrtCollection<ProjectDeliveryEvent> {\n static readonly _itemClass = ProjectDeliveryEvent;\n}\nexport class PreviewApprovalCollection extends SmrtCollection<PreviewApproval> {\n static readonly _itemClass = PreviewApproval;\n}\nexport class AssistanceRequestCollection extends SmrtCollection<AssistanceRequest> {\n static readonly _itemClass = AssistanceRequest;\n}\nexport class AssistanceRequestEventCollection extends SmrtCollection<AssistanceRequestEvent> {\n static readonly _itemClass = AssistanceRequestEvent;\n}\n","import type { SmrtClassOptions } from '@happyvertical/smrt-core';\nimport { withTenant } from '@happyvertical/smrt-tenancy';\nimport { DevelopmentRequestCollection } from '../collections/DevelopmentRequests.js';\nimport { ProjectIntegrationCollection } from '../collections/ProjectIntegrations.js';\nimport type { DevelopmentRequest } from '../models/DevelopmentRequest.js';\nimport {\n type PreviewApproval,\n PreviewApprovalCollection,\n type ProjectDeliveryEvent,\n ProjectDeliveryEventCollection,\n parseProjectJson,\n} from '../models/delivery-control-plane.js';\nimport type { ProjectIntegration } from '../models/ProjectIntegration.js';\nimport type { DeliveryEventType } from '../types.js';\nimport type { DevelopmentWorkAdapter } from './development-request-service.js';\n\nexport interface DeliveryEventSender {\n send(event: ProjectDeliveryEvent): Promise<void>;\n}\n\nexport interface ApprovalPolicy {\n canApprove(input: {\n integration: ProjectIntegration;\n requestId: string;\n previewId: string;\n }): Promise<boolean>;\n}\n\nexport class ProjectDeliveryService {\n constructor(\n private readonly integrations: ProjectIntegrationCollection,\n private readonly requests: DevelopmentRequestCollection,\n private readonly events: ProjectDeliveryEventCollection,\n private readonly approvals: PreviewApprovalCollection,\n private readonly workAdapter?: DevelopmentWorkAdapter,\n private readonly approvalPolicy?: ApprovalPolicy,\n ) {}\n\n static async create(\n options: SmrtClassOptions = {},\n dependencies: {\n workAdapter?: DevelopmentWorkAdapter;\n approvalPolicy?: ApprovalPolicy;\n } = {},\n ): Promise<ProjectDeliveryService> {\n const integrations = await ProjectIntegrationCollection.create(options);\n const sharedOptions = { ...options, db: integrations.db };\n const [requests, events, approvals] = await Promise.all([\n DevelopmentRequestCollection.create(sharedOptions),\n ProjectDeliveryEventCollection.create(sharedOptions),\n PreviewApprovalCollection.create(sharedOptions),\n ]);\n return new ProjectDeliveryService(\n integrations,\n requests,\n events,\n approvals,\n dependencies.workAdapter,\n dependencies.approvalPolicy,\n );\n }\n\n async record(input: {\n integration: ProjectIntegration;\n requestId: string;\n idempotencyKey: string;\n sequence: number;\n type: DeliveryEventType;\n payload: Record<string, unknown>;\n occurredAt?: Date;\n }): Promise<ProjectDeliveryEvent> {\n const integration = await requireActiveIntegrationCapability(\n this.integrations,\n input.integration,\n 'delivery:write',\n );\n if (!input.idempotencyKey.trim())\n throw new Error('Delivery event idempotencyKey is required.');\n const existing = (\n await withTenant({ tenantId: integration.tenantId }, () =>\n this.events.list({\n where: {\n integrationId: integration.id,\n idempotencyKey: input.idempotencyKey,\n },\n limit: 1,\n }),\n )\n )[0];\n if (existing) {\n await this.applySideEffects(integration, existing);\n return existing;\n }\n const request = await this.requestForIntegration(\n integration,\n input.requestId,\n );\n const event = await withTenant({ tenantId: integration.tenantId }, () =>\n this.events.create({\n tenantId: integration.tenantId,\n integrationId: requiredId(integration.id, 'Project Integration'),\n requestId: input.requestId,\n idempotencyKey: input.idempotencyKey,\n sequence: input.sequence,\n type: input.type,\n payload: JSON.stringify(input.payload),\n occurredAt: input.occurredAt ?? new Date(),\n }),\n );\n await withTenant({ tenantId: integration.tenantId }, () => event.save());\n await this.applySideEffects(integration, event, request);\n return event;\n }\n\n private async applySideEffects(\n integration: ProjectIntegration,\n event: ProjectDeliveryEvent,\n loadedRequest?: DevelopmentRequest,\n ): Promise<void> {\n const request =\n loadedRequest ??\n (await this.requestForIntegration(integration, event.requestId));\n const payload = parseProjectJson<Record<string, unknown>>(\n event.payload,\n {},\n );\n if (event.type === 'preview') await this.upsertPreview(request, payload);\n if (\n (event.type === 'completed' ||\n event.type === 'deployment' ||\n event.type === 'rejected') &&\n !(await this.isLatestTerminalEvent(event))\n )\n return;\n if (\n (event.type === 'completed' || event.type === 'deployment') &&\n request.status !== 'completed'\n )\n await this.requests.transitionStatus(request.tenantId, event.requestId, {\n status: 'completed',\n actorType: 'integration',\n actorId: integration.id ?? '',\n note: event.type,\n });\n if (event.type === 'rejected' && request.status !== 'declined')\n await this.requests.transitionStatus(request.tenantId, event.requestId, {\n status: 'declined',\n actorType: 'integration',\n actorId: integration.id ?? '',\n note: String(payload.reason ?? 'Delivery rejected'),\n });\n }\n\n async listForIntegration(\n integration: ProjectIntegration,\n requestId: string,\n ): Promise<ProjectDeliveryEvent[]> {\n const active = await requireActiveIntegrationCapability(\n this.integrations,\n integration,\n 'delivery:read',\n );\n await this.requestForIntegration(active, requestId);\n return withTenant({ tenantId: active.tenantId }, () =>\n this.events.list({\n where: { integrationId: active.id, requestId },\n orderBy: 'sequence ASC',\n }),\n );\n }\n\n async deliverPending(\n sender: DeliveryEventSender,\n tenantId: string,\n integrationId?: string,\n ): Promise<void> {\n const pending = await withTenant({ tenantId }, () =>\n this.events.list({\n where: integrationId\n ? { integrationId, deliveredAt: null }\n : { deliveredAt: null },\n orderBy: 'sequence ASC',\n }),\n );\n for (const event of pending) {\n const active = await this.integrations.findActive(\n tenantId,\n event.integrationId,\n );\n if (!active) continue;\n event.deliveryAttempts += 1;\n try {\n await sender.send(event);\n event.deliveredAt = new Date();\n event.lastDeliveryError = '';\n } catch (error) {\n event.lastDeliveryError =\n error instanceof Error ? error.message : String(error);\n }\n await withTenant({ tenantId }, () => event.save());\n }\n }\n\n async replay(\n sender: DeliveryEventSender,\n integration: ProjectIntegration,\n afterSequence = -1,\n ): Promise<void> {\n const active = await requireActiveIntegrationCapability(\n this.integrations,\n integration,\n 'delivery:read',\n );\n const events = (\n await withTenant({ tenantId: active.tenantId }, () =>\n this.events.list({\n where: { integrationId: active.id },\n orderBy: 'sequence ASC',\n }),\n )\n ).filter((event) => event.sequence > afterSequence);\n for (const event of events) await sender.send(event);\n }\n\n async decidePreview(\n integration: ProjectIntegration,\n preview: PreviewApproval,\n input: { approved: boolean; actorRef: string; reason: string },\n ): Promise<PreviewApproval> {\n const active = await requireActiveIntegrationCapability(\n this.integrations,\n integration,\n 'previews:approve',\n );\n if (preview.tenantId !== active.tenantId)\n throw new Error('Preview is outside this Project Integration tenant.');\n if (preview.status === 'stale')\n throw new Error('Stale previews cannot be approved.');\n if (preview.status !== 'pending') return preview;\n const request = await this.requestForIntegration(active, preview.requestId);\n if (\n this.approvalPolicy &&\n !(await this.approvalPolicy.canApprove({\n integration: active,\n requestId: preview.requestId,\n previewId: preview.previewId,\n }))\n )\n throw new Error('Preview approval denied by policy.');\n if (!this.workAdapter?.requestApproval)\n throw new Error('Control-plane approval adapter is not configured.');\n await this.workAdapter.requestApproval({\n request,\n previewId: preview.previewId,\n idempotencyKey: `preview-approval:${requiredId(preview.id, 'Preview Approval')}`,\n approved: input.approved,\n reason: input.reason,\n });\n preview.status = input.approved ? 'approved' : 'rejected';\n preview.decidedByRef = input.actorRef;\n preview.reason = input.reason;\n preview.decidedAt = new Date();\n await withTenant({ tenantId: active.tenantId }, () => preview.save());\n return preview;\n }\n\n async markPreviewStale(preview: PreviewApproval): Promise<PreviewApproval> {\n if (preview.status === 'pending') {\n preview.status = 'stale';\n preview.staleAt = new Date();\n await withTenant({ tenantId: preview.tenantId }, () => preview.save());\n }\n return preview;\n }\n\n private async requestForIntegration(\n integration: ProjectIntegration,\n requestId: string,\n ): Promise<DevelopmentRequest> {\n const request = await withTenant({ tenantId: integration.tenantId }, () =>\n this.requests.get({ id: requestId }),\n );\n if (\n !request ||\n request.integrationId !== integration.id ||\n request.projectId !== integration.projectId\n )\n throw new Error(\n 'Development Request is outside this Project Integration.',\n );\n return request;\n }\n\n private async isLatestTerminalEvent(\n event: ProjectDeliveryEvent,\n ): Promise<boolean> {\n const latest = (\n await withTenant({ tenantId: event.tenantId }, () =>\n this.events.list({\n where: {\n integrationId: event.integrationId,\n requestId: event.requestId,\n type: ['completed', 'deployment', 'rejected'],\n },\n orderBy: 'sequence DESC',\n limit: 1,\n }),\n )\n )[0];\n return !latest || latest.sequence <= event.sequence;\n }\n\n private async upsertPreview(\n request: DevelopmentRequest,\n payload: Record<string, unknown>,\n ): Promise<void> {\n const previewId = String(payload.previewId ?? '');\n if (!previewId) return;\n const existing = (\n await withTenant({ tenantId: request.tenantId }, () =>\n this.approvals.list({\n where: { requestId: request.id, previewId },\n limit: 1,\n }),\n )\n )[0];\n if (existing) return;\n const approval = await withTenant({ tenantId: request.tenantId }, () =>\n this.approvals.create({\n tenantId: request.tenantId,\n requestId: requiredId(request.id, 'Development Request'),\n previewId,\n previewUrl: String(payload.previewUrl ?? ''),\n status: 'pending',\n createdAt: new Date(),\n }),\n );\n await withTenant({ tenantId: request.tenantId }, () => approval.save());\n }\n}\n\nexport function requireIntegrationCapability(\n integration: ProjectIntegration,\n capability: string,\n): void {\n if (!integration.isActive())\n throw new Error('Project Integration is revoked.');\n if (!integration.hasCapability(capability))\n throw new Error(`Project Integration lacks capability '${capability}'.`);\n}\n\nexport async function requireActiveIntegrationCapability(\n integrations: ProjectIntegrationCollection,\n integration: Pick<ProjectIntegration, 'id' | 'tenantId'>,\n capability: string,\n): Promise<ProjectIntegration> {\n const integrationId = requiredId(integration.id, 'Project Integration');\n const active = await integrations.findActive(\n integration.tenantId,\n integrationId,\n );\n if (!active) throw new Error('Project Integration is revoked.');\n requireIntegrationCapability(active, capability);\n return active;\n}\n\nfunction requiredId(value: string | null | undefined, label: string): string {\n if (!value) throw new Error(`${label} must be saved.`);\n return value;\n}\n","import type { SmrtClassOptions } from '@happyvertical/smrt-core';\nimport { withTenant } from '@happyvertical/smrt-tenancy';\nimport { ProjectIntegrationCollection } from '../collections/ProjectIntegrations.js';\nimport { ProjectCollection } from '../collections/Projects.js';\nimport { ProjectIntegration } from '../models/ProjectIntegration.js';\nimport type { ProjectBoardMoveIntent } from '../project-board-types.js';\nimport { requireActiveIntegrationCapability } from './delivery-service.js';\n\nexport type { ProjectBoardMoveIntent } from '../project-board-types.js';\n\n/** Pure data returned after a provider-backed project board move. */\nexport interface ProjectBoardMoveResult {\n projectId: string;\n itemId: string;\n previousStatus: string | null;\n status: string;\n}\n\n/**\n * Capability-checked server boundary for project-board mutations.\n *\n * This service intentionally exposes neither provider credentials nor the\n * provider client. It reloads the supplied server-derived integration before\n * every mutation, verifies its project binding and capability, validates the\n * requested item and status against the authoritative Project, then delegates\n * persistence to Project.updateItemStatus().\n */\nexport class ProjectBoardService {\n constructor(\n private readonly integrations: ProjectIntegrationCollection,\n private readonly projects: ProjectCollection,\n ) {}\n\n static async create(\n options: SmrtClassOptions = {},\n ): Promise<ProjectBoardService> {\n const integrations = await ProjectIntegrationCollection.create(options);\n const projects = await ProjectCollection.create({\n ...options,\n db: integrations.db,\n });\n return new ProjectBoardService(integrations, projects);\n }\n\n async moveItem(\n integration: ProjectIntegration,\n input: ProjectBoardMoveIntent,\n ): Promise<ProjectBoardMoveResult> {\n const projectId = requiredInput(input.projectId, 'Project ID');\n const itemId = requiredInput(input.itemId, 'Project item ID');\n const status = requiredInput(input.status, 'Project status');\n const authorized = await this.requireAuthorizedIntegration(\n integration,\n projectId,\n );\n const project = await this.findProject(authorized.tenantId, projectId);\n if (!project) throw new Error('Project not found for this integration.');\n\n const statuses = await project.getStatuses();\n if (!statuses.some((candidate) => candidate.name === status)) {\n throw new Error(`Project status '${status}' is not available.`);\n }\n\n const item = (await project.listItems()).find(\n (candidate) => candidate.id === itemId,\n );\n if (!item) throw new Error('Project item not found.');\n\n // Reads can take long enough for a capability to be revoked. Revalidate\n // against canonical integration state immediately before the write.\n await this.requireAuthorizedIntegration(integration, projectId);\n await project.updateItemStatus(itemId, status);\n return {\n projectId,\n itemId,\n previousStatus: item.status ?? null,\n status,\n };\n }\n\n private async requireAuthorizedIntegration(\n integration: ProjectIntegration,\n projectId: string,\n ): Promise<ProjectIntegration> {\n if (!(integration instanceof ProjectIntegration)) {\n throw new Error(\n 'Project board moves require an authenticated Project Integration.',\n );\n }\n const active = await requireActiveIntegrationCapability(\n this.integrations,\n integration,\n 'projects:write',\n );\n if (active.projectId !== projectId) {\n throw new Error('Project is outside this Project Integration.');\n }\n return active;\n }\n\n private async findProject(tenantId: string, projectId: string) {\n const tenantProject = (\n await withTenant({ tenantId }, () =>\n this.projects.list({ where: { projectId, tenantId }, limit: 1 }),\n )\n )[0];\n if (tenantProject) return tenantProject;\n return (await this.projects.findGlobal()).find(\n (candidate) => candidate.projectId === projectId,\n );\n }\n}\n\nfunction requiredInput(value: string, label: string): string {\n if (!value?.trim()) throw new Error(`${label} is required.`);\n return value;\n}\n","import type { DatabaseInterface } from '@happyvertical/sql';\nimport { DevelopmentRequestCollection } from './collections/DevelopmentRequests';\nimport { ProjectIntegrationCollection } from './collections/ProjectIntegrations';\nimport type { ProjectIntegration } from './models/ProjectIntegration';\nimport {\n type ProjectBoardMoveIntent,\n ProjectBoardService,\n} from './services/project-board-service';\nimport type { ManagedDevelopmentRequestCreateInput } from './types';\n\nexport class ManagedProjectClient {\n readonly #db: DatabaseInterface;\n readonly #integration: ProjectIntegration;\n readonly #requesterId: string;\n\n private constructor(\n integration: ProjectIntegration,\n options: { db: DatabaseInterface; requesterId: string },\n ) {\n this.#integration = integration;\n this.#db = options.db;\n this.#requesterId = options.requesterId;\n }\n\n static async authenticate(\n credential: string,\n options: { db: DatabaseInterface; requesterId: string },\n ): Promise<ManagedProjectClient> {\n if (!options.requesterId.trim()) {\n throw new Error('Managed project client requires a stable requesterId');\n }\n const integrations = await ProjectIntegrationCollection.create({\n db: options.db,\n });\n const integration = await integrations.authenticate(credential);\n if (!integration) {\n throw new Error('Invalid or revoked project integration credential');\n }\n return new ManagedProjectClient(integration, options);\n }\n\n async createRequest(\n input: Omit<ManagedDevelopmentRequestCreateInput, 'requesterId'>,\n ) {\n const integration = await this.#requireCapability('requests:create');\n if (!input.description.trim()) {\n throw new Error('Managed request creation requires a description');\n }\n\n const requests = await DevelopmentRequestCollection.create({\n db: this.#db,\n });\n return requests.createManaged({\n ...input,\n tenantId: integration.tenantId,\n projectId: integration.projectId,\n integrationId: integration.id as string,\n requesterId: this.#requesterId,\n });\n }\n\n async listRequests() {\n const integration = await this.#requireCapability('requests:read-own');\n const requests = await DevelopmentRequestCollection.create({\n db: this.#db,\n });\n return requests.listByIntegrationRequester({\n tenantId: integration.tenantId,\n integrationId: integration.id as string,\n requesterId: this.#requesterId,\n });\n }\n\n /**\n * Move a project-board item through this authenticated integration.\n *\n * The browser submits only the move intent. This client keeps the credential\n * authentication boundary server-side and ProjectBoardService reloads active\n * capability state again immediately before the provider mutation.\n */\n async moveProjectBoardItem(input: ProjectBoardMoveIntent) {\n const integration = await this.#requireCapability('projects:write');\n const service = await ProjectBoardService.create({ db: this.#db });\n return service.moveItem(integration, input);\n }\n\n async #requireCapability(capability: string): Promise<ProjectIntegration> {\n const tenantId = this.#integration.tenantId;\n const integrationId = this.#integration.id;\n if (!tenantId || !integrationId) {\n throw new Error('Invalid or revoked project integration credential');\n }\n const integrations = await ProjectIntegrationCollection.create({\n db: this.#db,\n });\n const integration = await integrations.findActive(tenantId, integrationId);\n if (!integration) {\n throw new Error('Invalid or revoked project integration credential');\n }\n if (!integration.hasCapability(capability)) {\n throw new Error(\n `Managed project integration lacks required capability '${capability}'`,\n );\n }\n return integration;\n }\n}\n","/**\n * Projects money columns: floating-point major units → integer minor units.\n *\n * Ships as an explicit, opt-in migration rather than a schema-differ upgrade\n * because REAL→INTEGER is not information-preserving: an automatic\n * `ALTER … TYPE integer` would truncate `19.99` to `19`. The values have to be\n * rescaled by the currency's minor-unit factor during the type change (#2401).\n *\n * ```ts\n * console.log((await preflightProjectsMoneyMinorUnits(db)).summary);\n * await migrateProjectsMoneyToMinorUnits(db);\n * ```\n *\n * The two snapshot tables convert together: the delivery margin is\n * `charge - compensation`, so a half-converted pair produces a nonsense number\n * rather than an error.\n *\n * Both tables are immutable-on-save, and the immutability check compares a\n * stringified field snapshot. Rescaling changes those strings, which is\n * harmless — the snapshot is recomputed from the row on load — but it does mean\n * a row must not be mid-flight while the migration runs.\n *\n * On SQLite the values are rescaled but the declared type cannot change in\n * place; those columns come back in `declaredTypeChangePending` and need the\n * table-rebuild path (#2370).\n */\n\nimport {\n type DatabaseInterface,\n type MinorUnitsPreflightResult,\n type MinorUnitsRescaleResult,\n type MoneyColumnTarget,\n preflightMinorUnitsRescale,\n rescaleMoneyColumnsToMinorUnits,\n} from '@happyvertical/smrt-core/migrations';\n\n/** Marker recorded in `_smrt_backfills` once the rescale has run. */\nexport const PROJECTS_MONEY_MINOR_UNITS_BACKFILL =\n '@happyvertical/smrt-projects:money-minor-units:v1';\n\n/** Every projects money column that held major units before #2401. */\nexport const PROJECTS_MONEY_COLUMNS: MoneyColumnTarget[] = [\n { table: 'service_charge_snapshots', columns: ['amount'] },\n { table: 'service_compensation_snapshots', columns: ['amount'] },\n];\n\n/**\n * Report what {@link migrateProjectsMoneyToMinorUnits} would do, without\n * writing anything.\n */\nexport function preflightProjectsMoneyMinorUnits(\n db: DatabaseInterface,\n options: { scale?: number; engineHint?: string } = {},\n): Promise<MinorUnitsPreflightResult> {\n return preflightMinorUnitsRescale(db, PROJECTS_MONEY_COLUMNS, options);\n}\n\n/**\n * Convert every projects money column from floating-point major units to\n * integer minor units. Idempotent via a `_smrt_backfills` marker.\n *\n * @throws `MinorUnitsPreflightError` when a row would be rounded or would\n * overflow `int4` and `force` was not set.\n */\nexport function migrateProjectsMoneyToMinorUnits(\n db: DatabaseInterface,\n options: { scale?: number; engineHint?: string; force?: boolean } = {},\n): Promise<MinorUnitsRescaleResult> {\n return rescaleMoneyColumnsToMinorUnits(db, PROJECTS_MONEY_COLUMNS, {\n ...options,\n backfillName: PROJECTS_MONEY_MINOR_UNITS_BACKFILL,\n packageName: '@happyvertical/smrt-projects',\n });\n}\n","/**\n * Label model - SMRT wrapper for repository labels\n *\n * Represents a label that can be applied to issues and PRs.\n */\n\nimport {\n field,\n foreignKey,\n SmrtObject,\n type SmrtObjectOptions,\n smrt,\n} from '@happyvertical/smrt-core';\n\nexport interface LabelOptions extends SmrtObjectOptions {\n repositoryId?: string;\n projectId?: string;\n name?: string;\n color?: string;\n description?: string;\n}\n\n@smrt({\n api: { include: ['list', 'get', 'create', 'update', 'delete'] },\n mcp: { include: ['list', 'get', 'create'] },\n cli: { include: ['list', 'get', 'create', 'update', 'delete'] },\n})\nexport class Label extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-projects\";\n /**\n * Repository this label belongs to (optional; unset for project-scoped labels)\n */\n @foreignKey('Repository')\n repositoryId?: string;\n\n /**\n * Project this label is scoped to (optional; a label may be scoped to a\n * repository, a project, or neither)\n */\n @field({ description: 'The project this label belongs to.' })\n @foreignKey('Project')\n projectId?: string;\n\n /**\n * Label name\n */\n @field({ description: \"The label's name, for example bug.\" })\n name: string = '';\n\n /**\n * Label color (hex without #)\n */\n @field({ description: \"The label's colour.\" })\n color: string = '';\n\n /**\n * Label description\n */\n @field({ description: 'What the label means.' })\n description: string = '';\n\n constructor(options: LabelOptions = {}) {\n super(options);\n if (options.repositoryId !== undefined)\n this.repositoryId = options.repositoryId;\n if (options.projectId !== undefined) this.projectId = options.projectId;\n if (options.name !== undefined) this.name = options.name;\n if (options.color !== undefined) this.color = options.color;\n if (options.description !== undefined)\n this.description = options.description;\n }\n\n /**\n * Check if this is a type label (bug, feature, etc.)\n */\n isTypeLabel(): boolean {\n const typePatterns = [\n /^type:/i,\n /^kind:/i,\n /^bug$/i,\n /^feature$/i,\n /^enhancement$/i,\n /^docs$/i,\n /^chore$/i,\n ];\n return typePatterns.some((p) => p.test(this.name));\n }\n\n /**\n * Check if this is a priority label\n */\n isPriorityLabel(): boolean {\n const priorityPatterns = [\n /^p[0-4]$/i,\n /^priority:/i,\n /^critical$/i,\n /^high$/i,\n /^medium$/i,\n /^low$/i,\n ];\n return priorityPatterns.some((p) => p.test(this.name));\n }\n\n /**\n * Check if this is a status label\n */\n isStatusLabel(): boolean {\n const statusPatterns = [\n /^status:/i,\n /^wip$/i,\n /^in.?progress$/i,\n /^blocked$/i,\n /^needs.?review$/i,\n /^ready$/i,\n ];\n return statusPatterns.some((p) => p.test(this.name));\n }\n\n /**\n * Get the label category\n *\n * @returns Category name\n */\n getCategory(): 'type' | 'priority' | 'status' | 'area' | 'other' {\n if (this.isTypeLabel()) return 'type';\n if (this.isPriorityLabel()) return 'priority';\n if (this.isStatusLabel()) return 'status';\n if (this.name.includes(':')) return 'area';\n return 'other';\n }\n\n /**\n * Parse priority level from label name\n *\n * @returns Priority level 0-4 or null\n */\n getPriorityLevel(): number | null {\n const match = this.name.match(/p([0-4])/i);\n if (match) {\n return parseInt(match[1], 10);\n }\n if (/critical/i.test(this.name)) return 0;\n if (/high/i.test(this.name)) return 1;\n if (/medium/i.test(this.name)) return 2;\n if (/low/i.test(this.name)) return 3;\n return null;\n }\n\n /**\n * Get label with # prefix for hex color\n */\n getHexColor(): string {\n return this.color.startsWith('#') ? this.color : `#${this.color}`;\n }\n\n /**\n * Create a label in the repository\n */\n async createInRepository(): Promise<void> {\n if (!this.repositoryId) {\n throw new Error('Label must have a repositoryId');\n }\n\n const { RepositoryCollection } = await import(\n '../collections/Repositories'\n );\n const collection = await RepositoryCollection.create(this.options);\n const repo = await collection.get({ id: this.repositoryId });\n\n if (!repo) {\n throw new Error(`Repository ${this.repositoryId} not found`);\n }\n\n const client = await repo.getClient();\n await client.createLabel({\n name: this.name,\n color: this.color,\n description: this.description,\n });\n\n await this.save();\n }\n\n /**\n * Update this label in the repository\n */\n async updateInRepository(): Promise<void> {\n if (!this.repositoryId) {\n throw new Error('Label must have a repositoryId');\n }\n\n const { RepositoryCollection } = await import(\n '../collections/Repositories'\n );\n const collection = await RepositoryCollection.create(this.options);\n const repo = await collection.get({ id: this.repositoryId });\n\n if (!repo) {\n throw new Error(`Repository ${this.repositoryId} not found`);\n }\n\n const client = await repo.getClient();\n await client.updateLabel(this.name, {\n name: this.name,\n color: this.color,\n description: this.description,\n });\n\n await this.save();\n }\n}\n","export type ProjectQuestionStatus =\n | 'open'\n | 'answered'\n | 'deferred'\n | 'superseded';\n\nexport type ProjectDecisionStatus =\n | 'open'\n | 'decided'\n | 'deferred'\n | 'superseded';\n\nexport type ProjectGovernanceVisibility = 'internal' | 'client';\n\nexport type ProjectGovernanceActorType = 'user' | 'agent' | 'system';\n\nexport interface ProjectGovernanceActor {\n type: ProjectGovernanceActorType;\n id: string;\n /** Trusted host authorization. Managers may create, assign, defer, and supersede. */\n canManage?: boolean;\n}\n\nexport interface ProjectGovernanceScope {\n tenantId: string;\n /** Qualified SMRT class name for the host project's record type. */\n projectType: string;\n projectId: string;\n}\n\nexport type ProjectContextReferenceKind =\n | 'spec'\n | 'cookbook'\n | 'conversation'\n | 'asset'\n | 'url'\n | 'other';\n\nexport interface ProjectContextReference {\n kind: ProjectContextReferenceKind;\n ref: string;\n label?: string;\n}\n\nexport interface ProjectGovernanceOwner {\n type: ProjectGovernanceActorType;\n id: string;\n}\n\nexport interface ProjectQuestionCreateInput extends ProjectGovernanceScope {\n prompt: string;\n /** Single-choice suggestions; Other is supplied by the service. */\n options?: ProjectQuestionOption[];\n owner?: ProjectGovernanceOwner | null;\n contextReferences?: ProjectContextReference[];\n visibility?: ProjectGovernanceVisibility;\n actor: ProjectGovernanceActor;\n}\n\nexport interface ProjectDecisionOption {\n id: string;\n label: string;\n description?: string;\n}\n\nexport interface ProjectDecisionCreateInput extends ProjectGovernanceScope {\n question: string;\n options?: ProjectDecisionOption[];\n owner?: ProjectGovernanceOwner | null;\n contextReferences?: ProjectContextReference[];\n visibility?: ProjectGovernanceVisibility;\n actor: ProjectGovernanceActor;\n}\n\nexport type ProjectGovernanceRecordKind = 'question' | 'decision';\n\nexport type ProjectGovernanceAction =\n | 'created'\n | 'assigned'\n | 'answered'\n | 'decided'\n | 'deferred'\n | 'reopened'\n | 'superseded';\n\n/** Reserved identity for the always-available free-text choice. */\nexport const PROJECT_QUESTION_OTHER_OPTION_ID = 'other';\n\n/** Recommendation is display guidance only, never a selected answer. */\nexport interface ProjectQuestionOption extends ProjectDecisionOption {\n recommended?: boolean;\n}\n\n/** Immutable answer provenance; absent on historical free-text events. */\nexport interface ProjectQuestionAnswerSelection {\n answer: string;\n selectedOptionId?: string;\n optionLabel?: string;\n expectedRevision: number;\n idempotencyKey?: string;\n}\n","/**\n * Declared recipes for smrt-projects (#3590, #3604): user-facing units of\n * functionality an app or agent can pick instead of the whole package.\n * The scanner reads these statics into the `recipes` array of `manifest.json`\n * and `smrt-knowledge.json`; nothing here runs at that point.\n *\n * @packageDocumentation\n */\n\nimport { SmrtRecipe } from '@happyvertical/smrt-core';\nimport { Comment } from './models/Comment.js';\nimport { Issue } from './models/Issue.js';\nimport { Label } from './models/Label.js';\nimport { Project } from './models/Project.js';\n\n/** Projects: Track projects and the issues, labels and comments inside them. */\nexport class ProjectTrackerRecipe extends SmrtRecipe {\n static id = 'projects.tracker';\n static help = './tracker.recipe.md';\n static label = 'Projects';\n static summary =\n 'Track projects and the issues, labels and comments inside them.';\n static synonyms = ['issues', 'tasks', 'tickets', 'bugs', 'kanban'];\n static section = {\n id: 'projects',\n label: 'Projects',\n icon: 'briefcase',\n description: 'Projects, their issues, labels and comments.',\n };\n static models = [Project, Issue, Label, Comment];\n static nav = [\n {\n // Not \"Projects\": that is the section the recipe suggests.\n label: 'All projects',\n model: Project,\n icon: 'folder',\n description: 'Bigger jobs broken into steps you can follow.',\n },\n {\n label: 'Issues',\n model: Issue,\n icon: 'wrench',\n description: 'Problems and to-dos to track until they are done.',\n },\n {\n label: 'Labels',\n model: Label,\n icon: 'tag',\n description: 'Tags to sort your projects and issues your way.',\n },\n ];\n static options = {\n Project: {\n fields: {\n projectId: { visibility: 'hidden' },\n projectNumber: { visibility: 'hidden' },\n providerType: { visibility: 'hidden' },\n tokenConfigKey: { visibility: 'hidden' },\n statuses: { visibility: 'hidden' },\n fields: { visibility: 'hidden' },\n statusFieldId: { visibility: 'hidden' },\n statusOptions: { visibility: 'hidden' },\n lastSyncedAt: { visibility: 'hidden' },\n },\n },\n Issue: {\n fields: {\n nodeId: { visibility: 'hidden' },\n originalBody: { visibility: 'hidden' },\n synthesisCount: { visibility: 'hidden' },\n lastSyncedAt: { visibility: 'hidden' },\n commentsCount: { visibility: 'hidden' },\n repositoryId: { visibility: 'hidden' },\n number: { visibility: 'hidden' },\n },\n },\n Comment: {\n fields: {\n commentId: { visibility: 'hidden' },\n url: { visibility: 'hidden' },\n },\n },\n Label: { fields: { repositoryId: { visibility: 'hidden' } } },\n } as const;\n}\n","import type { SmrtClassOptions } from '@happyvertical/smrt-core';\nimport { withTenant } from '@happyvertical/smrt-tenancy';\nimport { DevelopmentRequestCollection } from '../collections/DevelopmentRequests.js';\nimport { ProjectIntegrationCollection } from '../collections/ProjectIntegrations.js';\nimport {\n type AssistanceRequest,\n AssistanceRequestCollection,\n AssistanceRequestEventCollection,\n} from '../models/delivery-control-plane.js';\nimport type { ProjectIntegration } from '../models/ProjectIntegration.js';\nimport type {\n AssistanceClassification,\n DevelopmentRequestEvidence,\n ManagedAssistanceRequestInput,\n} from '../types.js';\nimport { requireActiveIntegrationCapability } from './delivery-service.js';\n\nexport interface AssistanceSupportPort {\n openOrJoin(input: {\n assistanceRequestId: string;\n tenantId: string;\n projectId: string;\n requesterId: string;\n subject: string;\n conversation: Record<string, unknown>[];\n evidence: DevelopmentRequestEvidence[];\n applicationContext: Record<string, unknown>;\n }): Promise<{ caseId: string }>;\n /** Implementations must treat this handoff as idempotent. */\n linkDelivery?(input: {\n tenantId: string;\n caseId: string;\n developmentRequestId: string;\n }): Promise<void>;\n}\n\nexport class AssistanceRequestService {\n constructor(\n private readonly integrations: ProjectIntegrationCollection,\n private readonly development: DevelopmentRequestCollection,\n private readonly requests: AssistanceRequestCollection,\n private readonly events: AssistanceRequestEventCollection,\n private readonly support?: AssistanceSupportPort,\n ) {}\n\n static async create(\n options: SmrtClassOptions = {},\n dependencies: { support?: AssistanceSupportPort } = {},\n ): Promise<AssistanceRequestService> {\n const integrations = await ProjectIntegrationCollection.create(options);\n const sharedOptions = { ...options, db: integrations.db };\n const [development, requests, events] = await Promise.all([\n DevelopmentRequestCollection.create(sharedOptions),\n AssistanceRequestCollection.create(sharedOptions),\n AssistanceRequestEventCollection.create(sharedOptions),\n ]);\n return new AssistanceRequestService(\n integrations,\n development,\n requests,\n events,\n dependencies.support,\n );\n }\n\n async createRequest(\n integration: ProjectIntegration,\n input: ManagedAssistanceRequestInput,\n ): Promise<AssistanceRequest> {\n const active = await requireActiveIntegrationCapability(\n this.integrations,\n integration,\n 'assistance:create',\n );\n if (!input.requesterId.trim())\n throw new Error('Assistance Request requires a stable requesterId.');\n if (!input.subject.trim())\n throw new Error('Assistance Request subject is required.');\n const request = await withTenant({ tenantId: active.tenantId }, () =>\n this.requests.create({\n tenantId: active.tenantId,\n integrationId: requiredId(active.id, 'Project Integration'),\n requesterId: input.requesterId,\n subject: input.subject.trim(),\n applicationContext: JSON.stringify(input.applicationContext ?? {}),\n conversation: JSON.stringify(input.conversation ?? []),\n evidence: JSON.stringify(input.evidence ?? []),\n classification: 'unclassified',\n createdAt: new Date(),\n }),\n );\n await withTenant({ tenantId: active.tenantId }, () => request.save());\n return request;\n }\n\n async classify(\n integration: ProjectIntegration,\n request: AssistanceRequest,\n input: {\n classification: Exclude<AssistanceClassification, 'unclassified'>;\n actorRef: string;\n reason: string;\n developmentType?: string;\n },\n ): Promise<AssistanceRequest> {\n const active = await requireActiveIntegrationCapability(\n this.integrations,\n integration,\n 'assistance:create',\n );\n if (\n request.integrationId !== active.id ||\n request.tenantId !== active.tenantId\n )\n throw new Error(\n 'Assistance Request is outside this Project Integration.',\n );\n if (!input.reason.trim())\n throw new Error('Classification reason is required.');\n const prior = request.classification;\n\n if (\n (input.classification === 'support' || input.classification === 'both') &&\n !request.supportCaseId\n ) {\n if (!this.support)\n throw new Error('Support routing port is not configured.');\n const result = await this.support.openOrJoin({\n assistanceRequestId: requiredId(request.id, 'Assistance Request'),\n tenantId: request.tenantId,\n projectId: active.projectId,\n requesterId: request.requesterId,\n subject: request.subject,\n conversation: parseArray(request.conversation),\n evidence: parseEvidence(request.evidence),\n applicationContext: parseObject(request.applicationContext),\n });\n request.supportCaseId = result.caseId;\n }\n\n if (\n (input.classification === 'development' ||\n input.classification === 'both') &&\n !request.developmentRequestId\n ) {\n const integrationId = requiredId(active.id, 'Project Integration');\n const origin = `assistance:${requiredId(request.id, 'Assistance Request')}`;\n const existing = (\n await withTenant({ tenantId: active.tenantId }, () =>\n this.development.list({\n where: {\n tenantId: active.tenantId,\n projectId: active.projectId,\n integrationId,\n origin,\n },\n orderBy: 'createdAt ASC',\n limit: 1,\n }),\n )\n )[0];\n const developmentRequest =\n existing ??\n (await this.development.createManaged({\n tenantId: active.tenantId,\n projectId: active.projectId,\n integrationId,\n requesterId: request.requesterId,\n type: input.developmentType ?? 'task',\n description:\n conversationText(request.conversation) || request.subject,\n evidence: parseEvidence(request.evidence),\n origin,\n discussion: input.reason,\n visibility: 'requester',\n }));\n request.developmentRequestId = developmentRequest.id ?? '';\n }\n\n if (\n input.classification === 'both' &&\n request.supportCaseId &&\n request.developmentRequestId &&\n !request.deliveryHandoffLinkedAt &&\n this.support?.linkDelivery\n ) {\n await this.support.linkDelivery({\n tenantId: request.tenantId,\n caseId: request.supportCaseId,\n developmentRequestId: request.developmentRequestId,\n });\n request.deliveryHandoffLinkedAt = new Date();\n }\n\n request.classification = input.classification;\n await withTenant({ tenantId: request.tenantId }, () => request.save());\n const event = await withTenant({ tenantId: request.tenantId }, () =>\n this.events.create({\n tenantId: request.tenantId,\n assistanceRequestId: requiredId(request.id, 'Assistance Request'),\n priorClassification: prior,\n resultingClassification: input.classification,\n actorRef: input.actorRef,\n reason: input.reason,\n resultingLinks: JSON.stringify({\n supportCaseId: request.supportCaseId || null,\n developmentRequestId: request.developmentRequestId || null,\n }),\n occurredAt: new Date(),\n }),\n );\n await withTenant({ tenantId: request.tenantId }, () => event.save());\n return request;\n }\n}\n\nfunction parseArray(value: string): Record<string, unknown>[] {\n try {\n const parsed = JSON.parse(value) as unknown;\n return Array.isArray(parsed)\n ? parsed.filter(\n (item): item is Record<string, unknown> =>\n Boolean(item) && typeof item === 'object' && !Array.isArray(item),\n )\n : [];\n } catch {\n return [];\n }\n}\n\nfunction parseObject(value: string): Record<string, unknown> {\n try {\n const parsed = JSON.parse(value) as unknown;\n return parsed && typeof parsed === 'object' && !Array.isArray(parsed)\n ? (parsed as Record<string, unknown>)\n : {};\n } catch {\n return {};\n }\n}\n\nfunction parseEvidence(value: string): DevelopmentRequestEvidence[] {\n return parseArray(value)\n .map((item) => ({\n url: typeof item.url === 'string' ? item.url : '',\n ...(typeof item.label === 'string' ? { label: item.label } : {}),\n }))\n .filter((item) => item.url.length > 0);\n}\n\nfunction conversationText(value: string): string {\n return parseArray(value)\n .map((message) => String(message.body ?? message.text ?? ''))\n .filter(Boolean)\n .join('\\n\\n');\n}\n\nfunction requiredId(value: string | null | undefined, label: string): string {\n if (!value) throw new Error(`${label} must be saved.`);\n return value;\n}\n","import { createHash } from 'node:crypto';\nimport type { SmrtClassOptions } from '@happyvertical/smrt-core';\nimport {\n assertTenantReadAllowed,\n withTenant,\n} from '@happyvertical/smrt-tenancy';\nimport { DevelopmentRequestCollection } from '../collections/DevelopmentRequests.js';\nimport type { DevelopmentRequest } from '../models/DevelopmentRequest.js';\nimport type {\n DevelopmentRequestEvidence,\n DevelopmentRequestVisibility,\n} from '../types.js';\n\nexport interface ParticipantDevelopmentRequestInput {\n tenantId: string;\n projectId: string;\n /** Trusted identity supplied after the host authorizes project participation. */\n requesterId: string;\n requestKey: string;\n type: 'bug' | 'feature' | 'task';\n description: string;\n visibility?: DevelopmentRequestVisibility;\n}\n\nexport class ParticipantDevelopmentRequestConflictError extends Error {\n constructor() {\n super(\n 'This request key has already been used for different request details.',\n );\n this.name = 'ParticipantDevelopmentRequestConflictError';\n }\n}\n\n/** Human participant intake, separate from credential-authenticated managed ingress. */\nexport class ParticipantDevelopmentRequestService {\n private constructor(\n private readonly requests: DevelopmentRequestCollection,\n ) {}\n\n static async create(\n options: SmrtClassOptions = {},\n ): Promise<ParticipantDevelopmentRequestService> {\n return new ParticipantDevelopmentRequestService(\n await DevelopmentRequestCollection.create(options),\n );\n }\n\n async submit(\n input: ParticipantDevelopmentRequestInput,\n ): Promise<DevelopmentRequest> {\n return this.persist(input, {\n participantId: input.requesterId,\n evidence: [],\n origin: 'participant',\n discussion: '',\n actorId: input.requesterId,\n actorType: 'participant',\n });\n }\n\n /** Trusted internal triage path; the host must authorize the supplied actor. */\n async splitFrom(\n parent: DevelopmentRequest,\n input: {\n type: 'bug' | 'feature' | 'task';\n description: string;\n actorRef: string;\n reason: string;\n /** Duplicate occurrence within identical type/description parts, independent of list order. */\n occurrence: number;\n },\n ): Promise<DevelopmentRequest> {\n if (\n !parent.id ||\n parent.integrationId ||\n !input.actorRef.trim() ||\n !input.reason.trim() ||\n !Number.isSafeInteger(input.occurrence) ||\n input.occurrence < 0\n ) {\n throw new TypeError(\n 'A participant parent and trusted triage actor are required.',\n );\n }\n const description = input.description.trim();\n const requestKey = stableId(\n JSON.stringify([\n 'split',\n parent.id,\n input.type,\n description,\n input.occurrence,\n ]),\n );\n return this.persist(\n {\n tenantId: parent.tenantId,\n projectId: parent.projectId,\n requesterId: parent.requesterId,\n requestKey,\n type: input.type,\n description,\n visibility: parent.visibility,\n },\n {\n participantId: parent.participantId,\n evidence: parent.getEvidence(),\n origin: `split:${parent.id}`,\n discussion: input.reason,\n actorId: input.actorRef,\n actorType: 'system',\n },\n );\n }\n\n private async persist(\n input: ParticipantDevelopmentRequestInput,\n provenance: {\n participantId: string;\n evidence: DevelopmentRequestEvidence[];\n origin: string;\n discussion: string;\n actorId: string;\n actorType: 'participant' | 'system';\n },\n ): Promise<DevelopmentRequest> {\n for (const value of [\n input.tenantId,\n input.projectId,\n input.requesterId,\n input.requestKey,\n ]) {\n if (typeof value !== 'string' || !value.trim() || value.length > 200) {\n throw new TypeError(\n 'A tenant, project, participant and request key are required.',\n );\n }\n }\n assertTenantReadAllowed(\n input.tenantId,\n 'ParticipantDevelopmentRequestService',\n );\n if (!['bug', 'feature', 'task'].includes(input.type))\n throw new TypeError('Choose a valid request type.');\n const description = input.description?.trim();\n if (!description || description.length > 8000)\n throw new TypeError('Describe the request in at most 8000 characters.');\n const visibility = input.visibility ?? 'requester';\n if (\n ![\n 'requester',\n 'project_team',\n 'workspace',\n 'public',\n 'internal',\n ].includes(visibility)\n ) {\n throw new TypeError('Choose a valid request visibility.');\n }\n const evidence = JSON.stringify(provenance.evidence);\n const identity = JSON.stringify([\n input.tenantId,\n input.projectId,\n input.requesterId,\n provenance.origin,\n input.requestKey,\n ]);\n const id = stableId(`participant-request:${identity}`);\n const historyId = stableId(`participant-request-history:${identity}`);\n const db = this.requests.db;\n if (!db.transaction)\n throw new Error('Participant request intake requires transactions.');\n const transaction = db.transaction.bind(db);\n return withTenant({ tenantId: input.tenantId }, () =>\n transaction(async (tx) => {\n // Primary-key conflict serialization protects concurrent retries across runtimes.\n // Never UPSERT mutable payload: a reused key cannot replace accepted work.\n await tx.query(\n `INSERT INTO development_requests\n (id, slug, context, tenant_id, project_id, integration_id, requester_id,\n participant_id, type, description, evidence, visibility, origin, discussion, status)\n VALUES (?, ?, ?, ?, ?, NULL, ?, ?, ?, ?, ?, ?, ?, ?, 'submitted')\n ON CONFLICT (id) DO NOTHING`,\n id,\n `participant-${id}`,\n '',\n input.tenantId,\n input.projectId,\n input.requesterId,\n provenance.participantId,\n input.type,\n description,\n evidence,\n visibility,\n provenance.origin,\n provenance.discussion,\n );\n const requests = await DevelopmentRequestCollection.create({ db: tx });\n const request = await requests.findOne({\n where: { id, tenantId: input.tenantId, projectId: input.projectId },\n });\n if (\n !request ||\n request.requesterId !== input.requesterId ||\n request.description !== description ||\n request.type !== input.type ||\n request.visibility !== visibility ||\n request.integrationId ||\n request.origin !== provenance.origin ||\n request.participantId !== provenance.participantId ||\n request.evidence !== evidence ||\n request.discussion !== provenance.discussion\n ) {\n throw new ParticipantDevelopmentRequestConflictError();\n }\n await tx.query(\n `INSERT INTO development_request_histories\n (id, slug, context, tenant_id, request_id, from_status, to_status, actor_type, actor_id, note)\n VALUES (?, ?, '', ?, ?, '', 'submitted', ?, ?, ?)\n ON CONFLICT (id) DO NOTHING`,\n historyId,\n `participant-${historyId}`,\n input.tenantId,\n id,\n provenance.actorType,\n provenance.actorId,\n provenance.discussion,\n );\n return request;\n }),\n );\n }\n}\n\nfunction stableId(value: string): string {\n const hash = createHash('sha256').update(value).digest('hex');\n return `${hash.slice(0, 8)}-${hash.slice(8, 12)}-5${hash.slice(13, 16)}-a${hash.slice(17, 20)}-${hash.slice(20, 32)}`;\n}\n","import type { SmrtClassOptions } from '@happyvertical/smrt-core';\nimport { withTenant } from '@happyvertical/smrt-tenancy';\nimport { DevelopmentRequestCollection } from '../collections/DevelopmentRequests.js';\nimport type { DevelopmentRequest } from '../models/DevelopmentRequest.js';\nimport {\n type DevelopmentRequestWorkLink,\n DevelopmentRequestWorkLinkCollection,\n} from '../models/delivery-control-plane.js';\nimport type { DevelopmentTriageDecision } from '../types.js';\nimport { ParticipantDevelopmentRequestService } from './participant-development-request-service.js';\n\nexport interface DevelopmentWorkItem {\n type: string;\n id: string;\n canonicalStatus: string;\n providerRef?: string;\n metadata?: Record<string, unknown>;\n}\n\nexport interface DevelopmentWorkAdapter {\n createWorkItem(input: {\n request: DevelopmentRequest;\n idempotencyKey: string;\n }): Promise<DevelopmentWorkItem>;\n getWorkItem(link: DevelopmentRequestWorkLink): Promise<DevelopmentWorkItem>;\n requestApproval?(input: {\n request: DevelopmentRequest;\n previewId: string;\n /** Stable across retries; adapters must deduplicate this operation. */\n idempotencyKey: string;\n approved: boolean;\n reason: string;\n }): Promise<void>;\n}\n\nexport interface DevelopmentViewer {\n tenantId: string;\n projectId: string;\n requesterId?: string;\n roles?: Array<'workspace' | 'project_team' | 'internal'>;\n}\n\nexport class DevelopmentRequestService {\n constructor(\n private readonly requests: DevelopmentRequestCollection,\n private readonly links: DevelopmentRequestWorkLinkCollection,\n readonly workAdapter?: DevelopmentWorkAdapter,\n ) {}\n\n static async create(\n options: SmrtClassOptions = {},\n workAdapter?: DevelopmentWorkAdapter,\n ): Promise<DevelopmentRequestService> {\n return new DevelopmentRequestService(\n await DevelopmentRequestCollection.create(options),\n await DevelopmentRequestWorkLinkCollection.create(options),\n workAdapter,\n );\n }\n\n /** Visibility is evaluated after tenant and project scoping. */\n async visibleFor(viewer: DevelopmentViewer): Promise<DevelopmentRequest[]> {\n const all = await this.requests.listForProject(\n viewer.tenantId,\n viewer.projectId,\n );\n const roles = new Set(viewer.roles ?? []);\n return all.filter((request) => {\n if (roles.has('internal')) return true;\n if (request.requesterId === viewer.requesterId) return true;\n if (\n request.visibility === 'internal' ||\n request.visibility === 'requester'\n )\n return false;\n if (request.visibility === 'public') return true;\n if (roles.has('project_team'))\n return (\n request.visibility === 'workspace' ||\n request.visibility === 'project_team'\n );\n return roles.has('workspace') && request.visibility === 'workspace';\n });\n }\n\n async linksFor(\n request: DevelopmentRequest,\n ): Promise<DevelopmentRequestWorkLink[]> {\n return withTenant({ tenantId: request.tenantId }, () =>\n this.links.list({\n where: { requestId: request.id },\n orderBy: 'createdAt ASC',\n }),\n );\n }\n\n async triage(\n request: DevelopmentRequest,\n input: {\n decision: DevelopmentTriageDecision;\n reason: string;\n actorRef: string;\n mergeIntoRequestId?: string;\n split?: Array<{ description: string; type?: string }>;\n },\n ): Promise<{\n request: DevelopmentRequest;\n links: DevelopmentRequestWorkLink[];\n splitRequests: DevelopmentRequest[];\n }> {\n if (!input.reason.trim()) throw new Error('Triage reason is required.');\n requiredId(request.id, 'Development Request');\n const createdLinks: DevelopmentRequestWorkLink[] = [];\n const splitRequests: DevelopmentRequest[] = [];\n\n if (input.decision === 'accept') {\n const existing = await this.linksFor(request);\n if (existing.length > 0) createdLinks.push(...existing);\n else {\n if (!this.workAdapter)\n throw new Error(\n 'DevelopmentWorkAdapter is required to accept requests.',\n );\n const work = await this.workAdapter.createWorkItem({\n request,\n idempotencyKey: `development-request:${request.id}`,\n });\n createdLinks.push(await this.linkWork(request, work));\n }\n if (request.status !== 'planned')\n await this.transition(request, 'planned', input.actorRef, input.reason);\n }\n\n if (input.decision === 'decline' && request.status !== 'declined')\n await this.transition(request, 'declined', input.actorRef, input.reason);\n\n if (input.decision === 'merge') {\n if (!input.mergeIntoRequestId)\n throw new Error('mergeIntoRequestId is required.');\n if (input.mergeIntoRequestId === request.id)\n throw new Error('A Development Request cannot be merged into itself.');\n const target = await withTenant({ tenantId: request.tenantId }, () =>\n this.requests.get({ id: input.mergeIntoRequestId }),\n );\n if (!target || target.projectId !== request.projectId)\n throw new Error(\n 'Merge target must be a Development Request in the same project and tenant.',\n );\n createdLinks.push(\n await this.linkWork(request, {\n type: '@happyvertical/smrt-projects:DevelopmentRequest',\n id: input.mergeIntoRequestId,\n canonicalStatus: 'merged',\n metadata: { reason: input.reason },\n }),\n );\n if (request.status !== 'triaged')\n await this.transition(request, 'triaged', input.actorRef, input.reason);\n }\n\n if (input.decision === 'split') {\n if (!input.split?.length)\n throw new Error('At least one split request is required.');\n const parts = input.split.map((part) => {\n const description = part.description.trim();\n if (!description)\n throw new Error('Split request description is required.');\n const type = part.type ?? request.type;\n if (\n !request.integrationId &&\n (!['bug', 'feature', 'task'].includes(type) ||\n description.length > 8000)\n ) {\n throw new TypeError(\n 'Choose a valid participant split type and description.',\n );\n }\n return { description, type };\n });\n const origin = `split:${request.id}`;\n const unmatchedExisting = await withTenant(\n { tenantId: request.tenantId },\n () =>\n this.requests.list({\n where: {\n tenantId: request.tenantId,\n projectId: request.projectId,\n integrationId: request.integrationId,\n origin,\n },\n orderBy: 'createdAt ASC',\n }),\n );\n const occurrences = new Map<string, number>();\n for (const { description, type } of parts) {\n const contentIdentity = JSON.stringify([type, description]);\n const occurrence = occurrences.get(contentIdentity) ?? 0;\n occurrences.set(contentIdentity, occurrence + 1);\n const existingIndex = unmatchedExisting.findIndex(\n (candidate) =>\n candidate.description.trim() === description &&\n candidate.type === type &&\n candidate.requesterId === request.requesterId &&\n candidate.participantId === request.participantId &&\n candidate.visibility === request.visibility,\n );\n if (existingIndex >= 0) {\n splitRequests.push(unmatchedExisting.splice(existingIndex, 1)[0]);\n } else {\n splitRequests.push(\n request.integrationId\n ? await this.requests.createManaged({\n tenantId: request.tenantId,\n projectId: request.projectId,\n integrationId: request.integrationId,\n requesterId: request.requesterId,\n participantId: request.participantId || undefined,\n type,\n description,\n evidence: request.getEvidence(),\n visibility: request.visibility,\n origin,\n discussion: input.reason,\n })\n : await (\n await ParticipantDevelopmentRequestService.create({\n db: this.requests.db,\n })\n ).splitFrom(request, {\n type: type as 'bug' | 'feature' | 'task',\n description,\n actorRef: input.actorRef,\n reason: input.reason,\n occurrence,\n }),\n );\n }\n }\n if (request.status !== 'triaged')\n await this.transition(request, 'triaged', input.actorRef, input.reason);\n }\n\n return { request, links: createdLinks, splitRequests };\n }\n\n async syncWorkStatus(\n link: DevelopmentRequestWorkLink,\n ): Promise<DevelopmentRequest> {\n if (!this.workAdapter)\n throw new Error(\n 'DevelopmentWorkAdapter is required to project board status.',\n );\n const work = await this.workAdapter.getWorkItem(link);\n link.canonicalStatus = work.canonicalStatus;\n link.metadata = JSON.stringify(work.metadata ?? {});\n link.lastProjectedAt = new Date();\n await withTenant({ tenantId: link.tenantId }, () => link.save());\n const request = await withTenant({ tenantId: link.tenantId }, () =>\n this.requests.get({ id: link.requestId }),\n );\n if (!request)\n throw new Error(`Development Request ${link.requestId} not found.`);\n const requestLinks = await this.linksFor(request);\n const completed = requestLinks.every((item) =>\n ['done', 'closed', 'completed', 'deployed'].includes(\n item.canonicalStatus.toLowerCase(),\n ),\n );\n const nextStatus = completed ? 'completed' : 'in_progress';\n if (request.status !== nextStatus)\n await this.transition(\n request,\n nextStatus,\n 'system',\n `Canonical work status: ${work.canonicalStatus}`,\n );\n return request;\n }\n\n private async transition(\n request: DevelopmentRequest,\n status: 'triaged' | 'planned' | 'in_progress' | 'completed' | 'declined',\n actorRef: string,\n reason: string,\n ): Promise<void> {\n const updated = await this.requests.transitionStatus(\n request.tenantId,\n requiredId(request.id, 'Development Request'),\n { status, actorType: 'system', actorId: actorRef, note: reason },\n );\n request.status = updated.status;\n }\n\n private async linkWork(\n request: DevelopmentRequest,\n work: DevelopmentWorkItem,\n ): Promise<DevelopmentRequestWorkLink> {\n const existing = (\n await withTenant({ tenantId: request.tenantId }, () =>\n this.links.list({\n where: {\n requestId: request.id,\n workItemType: work.type,\n workItemId: work.id,\n },\n limit: 1,\n }),\n )\n )[0];\n if (existing) return existing;\n const link = await withTenant({ tenantId: request.tenantId }, () =>\n this.links.create({\n tenantId: request.tenantId,\n requestId: requiredId(request.id, 'Development Request'),\n workItemType: work.type,\n workItemId: work.id,\n canonicalStatus: work.canonicalStatus,\n providerRef: work.providerRef ?? '',\n metadata: JSON.stringify(work.metadata ?? {}),\n lastProjectedAt: new Date(),\n }),\n );\n await withTenant({ tenantId: request.tenantId }, () => link.save());\n return link;\n }\n}\n\nfunction requiredId(value: string | null | undefined, label: string): string {\n if (!value) throw new Error(`${label} must be saved.`);\n return value;\n}\n","import type { SmrtClassOptions } from '@happyvertical/smrt-core';\nimport {\n assertTenantReadAllowed,\n withTenant,\n} from '@happyvertical/smrt-tenancy';\nimport { ProjectDecisionCollection } from '../collections/ProjectDecisions.js';\nimport { ProjectGovernanceEventCollection } from '../collections/ProjectGovernanceEvents.js';\nimport { ProjectQuestionCollection } from '../collections/ProjectQuestions.js';\nimport type { ProjectDecision } from '../models/ProjectDecision.js';\nimport type { ProjectQuestion } from '../models/ProjectQuestion.js';\nimport {\n serializeContextReferences,\n serializeDecisionOptions,\n serializeQuestionOptions,\n} from '../models/project-governance-validation.js';\nimport type {\n ProjectDecisionCreateInput,\n ProjectDecisionStatus,\n ProjectGovernanceAction,\n ProjectGovernanceActor,\n ProjectGovernanceOwner,\n ProjectGovernanceRecordKind,\n ProjectGovernanceScope,\n ProjectGovernanceVisibility,\n ProjectQuestionAnswerSelection,\n ProjectQuestionCreateInput,\n ProjectQuestionStatus,\n} from '../project-governance-types.js';\n\nconst QUESTION_TYPE = '@happyvertical/smrt-projects:ProjectQuestion';\nconst DECISION_TYPE = '@happyvertical/smrt-projects:ProjectDecision';\ntype Database = ProjectQuestionCollection['db'];\ninterface GovernanceEventDetails {\n note?: string;\n value?: string;\n rationale?: string;\n answerSelection?: ProjectQuestionAnswerSelection;\n fromOwnerType?: ProjectGovernanceActor['type'] | '';\n fromOwnerId?: string;\n toOwnerType?: ProjectGovernanceActor['type'] | '';\n toOwnerId?: string;\n}\n\nexport class ProjectGovernanceConflictError extends Error {\n constructor(message = 'Project governance record has changed.') {\n super(message);\n this.name = 'ProjectGovernanceConflictError';\n }\n}\n\nexport class ProjectGovernanceAuthorizationError extends Error {\n constructor(message = 'Actor cannot change this project governance record.') {\n super(message);\n this.name = 'ProjectGovernanceAuthorizationError';\n }\n}\n\nexport class ProjectGovernanceService {\n constructor(\n private readonly questions: ProjectQuestionCollection,\n private readonly decisions: ProjectDecisionCollection,\n private readonly events: ProjectGovernanceEventCollection,\n ) {}\n\n static async create(\n options: SmrtClassOptions = {},\n ): Promise<ProjectGovernanceService> {\n return new ProjectGovernanceService(\n await ProjectQuestionCollection.create(options),\n await ProjectDecisionCollection.create(options),\n await ProjectGovernanceEventCollection.create(options),\n );\n }\n\n async listForProject(\n scope: ProjectGovernanceScope,\n options: { visibility?: ProjectGovernanceVisibility } = {},\n ): Promise<{\n questions: ProjectQuestion[];\n decisions: ProjectDecision[];\n }> {\n validateScope(scope);\n const [questions, decisions] = await Promise.all([\n this.questions.listForProject(scope, undefined, options.visibility),\n this.decisions.listForProject(scope, undefined, options.visibility),\n ]);\n return { questions, decisions };\n }\n\n async createQuestion(\n input: ProjectQuestionCreateInput,\n ): Promise<ProjectQuestion> {\n validateScope(input);\n requireManager(input.actor);\n const prompt = input.prompt.trim();\n if (!prompt) throw new TypeError('Project question prompt is required.');\n return this.transaction(this.questions, async (db) => {\n const questions = await ProjectQuestionCollection.create({ db });\n const question = await withTenant({ tenantId: input.tenantId }, () =>\n questions.create({\n visibility: input.visibility ?? 'internal',\n tenantId: input.tenantId,\n metaType: input.projectType,\n metaId: input.projectId,\n prompt,\n questionOptions: serializeQuestionOptions(\n input.options === undefined ? [] : input.options,\n ),\n ownerType: input.owner?.type ?? '',\n ownerId: input.owner?.id ?? '',\n contextReferences: serializeContextReferences(\n input.contextReferences ?? [],\n ),\n }),\n );\n await withTenant({ tenantId: input.tenantId }, () => question.save());\n await this.recordEvent(\n db,\n question,\n 'question',\n 'created',\n input.actor,\n '',\n 'open',\n );\n return question;\n });\n }\n\n async createDecision(\n input: ProjectDecisionCreateInput,\n ): Promise<ProjectDecision> {\n validateScope(input);\n requireManager(input.actor);\n const question = input.question.trim();\n if (!question)\n throw new TypeError('Project decision question is required.');\n return this.transaction(this.decisions, async (db) => {\n const decisions = await ProjectDecisionCollection.create({ db });\n const decision = await withTenant({ tenantId: input.tenantId }, () =>\n decisions.create({\n visibility: input.visibility ?? 'internal',\n tenantId: input.tenantId,\n metaType: input.projectType,\n metaId: input.projectId,\n question,\n decisionOptions: serializeDecisionOptions(input.options ?? []),\n ownerType: input.owner?.type ?? '',\n ownerId: input.owner?.id ?? '',\n contextReferences: serializeContextReferences(\n input.contextReferences ?? [],\n ),\n }),\n );\n await withTenant({ tenantId: input.tenantId }, () => decision.save());\n await this.recordEvent(\n db,\n decision,\n 'decision',\n 'created',\n input.actor,\n '',\n 'open',\n );\n return decision;\n });\n }\n\n async answerQuestion(\n input: ProjectGovernanceScope & {\n questionId: string;\n /** Required for old clients too; choices do not silently generate an answer. */\n answer: string;\n selectedOptionId?: string;\n idempotencyKey?: string;\n note?: string;\n expectedRevision: number;\n actor: ProjectGovernanceActor;\n },\n ): Promise<ProjectQuestion> {\n if (typeof input.answer !== 'string' || !input.answer.trim())\n throw new TypeError(\n 'Project question answer is required and must be text.',\n );\n if (\n input.selectedOptionId !== undefined &&\n (typeof input.selectedOptionId !== 'string' ||\n !input.selectedOptionId.trim() ||\n input.selectedOptionId !== input.selectedOptionId.trim())\n )\n throw new TypeError(\n 'Project question selected option id must be non-empty text.',\n );\n if (\n input.idempotencyKey !== undefined &&\n (typeof input.idempotencyKey !== 'string' ||\n !input.idempotencyKey.trim() ||\n input.idempotencyKey.length > 200)\n )\n throw new TypeError(\n 'Project question idempotency key must be non-empty text of at most 200 characters.',\n );\n if (input.note !== undefined && typeof input.note !== 'string')\n throw new TypeError('Project question note must be text.');\n const answer = input.answer.trim();\n const selectedOptionId = input.selectedOptionId;\n return this.mutateQuestion(\n input,\n 'answered',\n 'answered',\n (question) => {\n const option =\n selectedOptionId === undefined\n ? undefined\n : question\n .getOptions()\n .find((entry) => entry.id === selectedOptionId);\n if (selectedOptionId !== undefined && !option)\n throw new TypeError(\n 'Project question answer must match an option id.',\n );\n question.answer = answer;\n question.selectedOptionId = selectedOptionId ?? '';\n question.answeredAt = new Date();\n return {\n value: answer,\n note: input.note ?? '',\n answerSelection: {\n answer,\n expectedRevision: input.expectedRevision,\n ...(option\n ? { selectedOptionId: option.id, optionLabel: option.label }\n : {}),\n ...(input.idempotencyKey !== undefined\n ? { idempotencyKey: input.idempotencyKey }\n : {}),\n },\n };\n },\n true,\n input.idempotencyKey === undefined\n ? undefined\n : async (db) => {\n const events = await ProjectGovernanceEventCollection.create({\n db,\n });\n const history = await events.listForRecord({\n tenantId: input.tenantId,\n recordType: QUESTION_TYPE,\n recordId: input.questionId,\n });\n const previous = history.find(\n (event) =>\n event.getAnswerSelection()?.idempotencyKey ===\n input.idempotencyKey,\n );\n if (!previous) return false;\n const snapshot = previous.getAnswerSelection();\n if (\n previous.actorType !== input.actor.type ||\n previous.actorId !== input.actor.id ||\n snapshot?.expectedRevision !== input.expectedRevision ||\n snapshot.answer !== answer ||\n snapshot.selectedOptionId !== selectedOptionId ||\n previous.note !== (input.note ?? '')\n )\n throw new ProjectGovernanceConflictError(\n 'Project question idempotency key was already used with different input.',\n );\n return true;\n },\n );\n }\n\n async decide(\n input: ProjectGovernanceScope & {\n decisionId: string;\n outcome: string;\n rationale?: string;\n note?: string;\n expectedRevision: number;\n actor: ProjectGovernanceActor;\n },\n ): Promise<ProjectDecision> {\n const outcome = input.outcome.trim();\n if (!outcome) throw new TypeError('Project decision outcome is required.');\n return this.mutateDecision(input, 'decided', 'decided', (decision) => {\n const options = decision.getOptions();\n if (\n options.length > 0 &&\n !options.some((option) => option.id === outcome)\n )\n throw new TypeError(\n 'Project decision outcome must match an option id.',\n );\n decision.outcome = outcome;\n decision.rationale = input.rationale?.trim() ?? '';\n decision.decidedAt = new Date();\n return {\n value: outcome,\n rationale: decision.rationale,\n note: input.note ?? '',\n };\n });\n }\n\n async assignQuestion(\n input: ProjectGovernanceScope & {\n questionId: string;\n owner: ProjectGovernanceOwner | null;\n note?: string;\n expectedRevision: number;\n actor: ProjectGovernanceActor;\n },\n ): Promise<ProjectQuestion> {\n requireManager(input.actor);\n return this.mutateQuestion(\n input,\n undefined,\n 'assigned',\n (question) => {\n const fromOwnerType = question.ownerType;\n const fromOwnerId = question.ownerId;\n assign(question, input.owner);\n return {\n note:\n input.note ?? (input.owner ? 'Owner assigned.' : 'Owner cleared.'),\n fromOwnerType,\n fromOwnerId,\n toOwnerType: question.ownerType,\n toOwnerId: question.ownerId,\n };\n },\n false,\n );\n }\n\n async assignDecision(\n input: ProjectGovernanceScope & {\n decisionId: string;\n owner: ProjectGovernanceOwner | null;\n note?: string;\n expectedRevision: number;\n actor: ProjectGovernanceActor;\n },\n ): Promise<ProjectDecision> {\n requireManager(input.actor);\n return this.mutateDecision(\n input,\n undefined,\n 'assigned',\n (decision) => {\n const fromOwnerType = decision.ownerType;\n const fromOwnerId = decision.ownerId;\n assign(decision, input.owner);\n return {\n note:\n input.note ?? (input.owner ? 'Owner assigned.' : 'Owner cleared.'),\n fromOwnerType,\n fromOwnerId,\n toOwnerType: decision.ownerType,\n toOwnerId: decision.ownerId,\n };\n },\n false,\n );\n }\n\n async deferQuestion(\n input: ProjectGovernanceScope & {\n questionId: string;\n note: string;\n expectedRevision: number;\n actor: ProjectGovernanceActor;\n },\n ): Promise<ProjectQuestion> {\n requireManager(input.actor);\n return this.mutateQuestion(\n input,\n 'deferred',\n 'deferred',\n () => ({ note: requiredNote(input.note) }),\n false,\n );\n }\n\n async deferDecision(\n input: ProjectGovernanceScope & {\n decisionId: string;\n note: string;\n expectedRevision: number;\n actor: ProjectGovernanceActor;\n },\n ): Promise<ProjectDecision> {\n requireManager(input.actor);\n return this.mutateDecision(\n input,\n 'deferred',\n 'deferred',\n () => ({ note: requiredNote(input.note) }),\n false,\n );\n }\n\n async reopenQuestion(\n input: ProjectGovernanceScope & {\n questionId: string;\n note?: string;\n expectedRevision: number;\n actor: ProjectGovernanceActor;\n },\n ): Promise<ProjectQuestion> {\n requireManager(input.actor);\n return this.mutateQuestion(\n input,\n 'open',\n 'reopened',\n (question) => {\n question.answer = '';\n question.selectedOptionId = '';\n question.answeredAt = null;\n return { note: input.note ?? '' };\n },\n false,\n );\n }\n\n async reopenDecision(\n input: ProjectGovernanceScope & {\n decisionId: string;\n note?: string;\n expectedRevision: number;\n actor: ProjectGovernanceActor;\n },\n ): Promise<ProjectDecision> {\n requireManager(input.actor);\n return this.mutateDecision(\n input,\n 'open',\n 'reopened',\n (decision) => {\n decision.outcome = '';\n decision.rationale = '';\n decision.decidedAt = null;\n return { note: input.note ?? '' };\n },\n false,\n );\n }\n\n async supersedeQuestion(\n input: ProjectGovernanceScope & {\n questionId: string;\n note: string;\n expectedRevision: number;\n actor: ProjectGovernanceActor;\n },\n ): Promise<ProjectQuestion> {\n requireManager(input.actor);\n return this.mutateQuestion(\n input,\n 'superseded',\n 'superseded',\n () => ({ note: requiredNote(input.note) }),\n false,\n );\n }\n\n async supersedeDecision(\n input: ProjectGovernanceScope & {\n decisionId: string;\n note: string;\n expectedRevision: number;\n actor: ProjectGovernanceActor;\n },\n ): Promise<ProjectDecision> {\n requireManager(input.actor);\n return this.mutateDecision(\n input,\n 'superseded',\n 'superseded',\n () => ({ note: requiredNote(input.note) }),\n false,\n );\n }\n\n async historyForQuestion(\n input: ProjectGovernanceScope & { questionId: string },\n ) {\n validateScope(input);\n const question = await this.questions.getForProject(\n input,\n input.questionId,\n );\n if (!question) throw new Error('Project question not found.');\n return this.events.listForRecord({\n tenantId: input.tenantId,\n recordType: QUESTION_TYPE,\n recordId: input.questionId,\n });\n }\n\n async historyForDecision(\n input: ProjectGovernanceScope & { decisionId: string },\n ) {\n validateScope(input);\n const decision = await this.decisions.getForProject(\n input,\n input.decisionId,\n );\n if (!decision) throw new Error('Project decision not found.');\n return this.events.listForRecord({\n tenantId: input.tenantId,\n recordType: DECISION_TYPE,\n recordId: input.decisionId,\n });\n }\n\n private async mutateQuestion(\n input: ProjectGovernanceScope & {\n questionId: string;\n expectedRevision: number;\n actor: ProjectGovernanceActor;\n },\n status: ProjectQuestionStatus | undefined,\n action: ProjectGovernanceAction,\n apply: (question: ProjectQuestion) => GovernanceEventDetails,\n allowOwner = true,\n replay?: (db: Database, question: ProjectQuestion) => Promise<boolean>,\n ): Promise<ProjectQuestion> {\n validateScope(input);\n if (\n !Number.isSafeInteger(input.expectedRevision) ||\n input.expectedRevision < 1\n )\n throw new TypeError('Expected revision must be a positive integer.');\n return this.transaction(this.questions, async (db) => {\n const collection = await ProjectQuestionCollection.create({ db });\n const current = await this.lockQuestion(\n db,\n collection,\n input,\n Boolean(replay),\n );\n authorize(current, input.actor, allowOwner);\n if (replay && (await replay(db, current))) return current;\n if (current.revision !== input.expectedRevision)\n throw new ProjectGovernanceConflictError();\n const from = current.status;\n validateQuestionTransition(from, status);\n const event = apply(current);\n if (status) current.status = status;\n current.revision += 1;\n await withTenant({ tenantId: input.tenantId }, () => current.save());\n await this.recordEvent(\n db,\n current,\n 'question',\n action,\n input.actor,\n from,\n current.status,\n event,\n );\n return current;\n });\n }\n\n private async mutateDecision(\n input: ProjectGovernanceScope & {\n decisionId: string;\n expectedRevision: number;\n actor: ProjectGovernanceActor;\n },\n status: ProjectDecisionStatus | undefined,\n action: ProjectGovernanceAction,\n apply: (decision: ProjectDecision) => GovernanceEventDetails,\n allowOwner = true,\n ): Promise<ProjectDecision> {\n validateScope(input);\n return this.transaction(this.decisions, async (db) => {\n const collection = await ProjectDecisionCollection.create({ db });\n const current = await this.lockDecision(db, collection, input);\n authorize(current, input.actor, allowOwner);\n const from = current.status;\n validateDecisionTransition(from, status);\n const event = apply(current);\n if (status) current.status = status;\n current.revision += 1;\n await withTenant({ tenantId: input.tenantId }, () => current.save());\n await this.recordEvent(\n db,\n current,\n 'decision',\n action,\n input.actor,\n from,\n current.status,\n event,\n );\n return current;\n });\n }\n\n private async lockQuestion(\n db: Database,\n collection: ProjectQuestionCollection,\n input: ProjectGovernanceScope & {\n questionId: string;\n expectedRevision: number;\n },\n deferRevisionCheck = false,\n ): Promise<ProjectQuestion> {\n await lockRow(db, collection.tableName, input.questionId, input);\n const current = await collection.getForProject(input, input.questionId);\n if (!current) throw new Error('Project question not found.');\n if (!deferRevisionCheck && current.revision !== input.expectedRevision)\n throw new ProjectGovernanceConflictError();\n return current;\n }\n\n private async lockDecision(\n db: Database,\n collection: ProjectDecisionCollection,\n input: ProjectGovernanceScope & {\n decisionId: string;\n expectedRevision: number;\n },\n ): Promise<ProjectDecision> {\n await lockRow(db, collection.tableName, input.decisionId, input);\n const current = await collection.getForProject(input, input.decisionId);\n if (!current) throw new Error('Project decision not found.');\n if (current.revision !== input.expectedRevision)\n throw new ProjectGovernanceConflictError();\n return current;\n }\n\n private async recordEvent(\n db: Database,\n record: ProjectQuestion | ProjectDecision,\n recordKind: ProjectGovernanceRecordKind,\n action: ProjectGovernanceAction,\n actor: ProjectGovernanceActor,\n fromStatus: string,\n toStatus: string,\n details: GovernanceEventDetails = {},\n ): Promise<void> {\n const events = await ProjectGovernanceEventCollection.create({ db });\n await withTenant({ tenantId: record.tenantId }, () =>\n events.create({\n tenantId: record.tenantId,\n metaType: recordKind === 'question' ? QUESTION_TYPE : DECISION_TYPE,\n metaId: record.id as string,\n recordKind,\n action,\n actorType: actor.type,\n actorId: actor.id,\n fromStatus,\n toStatus,\n note: details.note ?? '',\n value: details.value ?? '',\n rationale: details.rationale ?? '',\n answerSelection: details.answerSelection\n ? JSON.stringify(details.answerSelection)\n : '',\n fromOwnerType: details.fromOwnerType ?? '',\n fromOwnerId: details.fromOwnerId ?? '',\n toOwnerType: details.toOwnerType ?? '',\n toOwnerId: details.toOwnerId ?? '',\n revision: record.revision,\n }),\n );\n }\n\n private async transaction<T>(\n collection: ProjectQuestionCollection | ProjectDecisionCollection,\n work: (db: Database) => Promise<T>,\n ): Promise<T> {\n if (!collection.db.transaction)\n throw new Error('Project governance mutations require transactions.');\n return collection.db.transaction(work);\n }\n}\n\nasync function lockRow(\n db: Database,\n tableName: string,\n id: string,\n scope: ProjectGovernanceScope,\n): Promise<void> {\n const table = `\"${tableName.replace(/\"/g, '\"\"')}\"`;\n await withTenant({ tenantId: scope.tenantId }, () =>\n db.query(\n `UPDATE ${table} SET revision = revision WHERE id = ? AND tenant_id = ? AND meta_type = ? AND meta_id = ?`,\n id,\n scope.tenantId,\n scope.projectType,\n scope.projectId,\n ),\n );\n}\n\nfunction validateScope(scope: ProjectGovernanceScope): void {\n if (\n !scope.tenantId.trim() ||\n !scope.projectType.trim() ||\n !scope.projectId.trim()\n )\n throw new TypeError('Tenant, project type, and project id are required.');\n if (!scope.projectType.includes(':'))\n throw new TypeError('Project type must be a qualified SMRT class name.');\n assertTenantReadAllowed(scope.tenantId, 'ProjectGovernanceService');\n}\n\nfunction requireManager(actor: ProjectGovernanceActor): void {\n validateActor(actor);\n if (!actor.canManage) throw new ProjectGovernanceAuthorizationError();\n}\n\nfunction authorize(\n record: { ownerType: string; ownerId: string },\n actor: ProjectGovernanceActor,\n allowOwner: boolean,\n): void {\n validateActor(actor);\n if (actor.canManage) return;\n if (\n allowOwner &&\n record.ownerType === actor.type &&\n record.ownerId === actor.id\n )\n return;\n throw new ProjectGovernanceAuthorizationError();\n}\n\nfunction validateActor(actor: ProjectGovernanceActor): void {\n if (!['user', 'agent', 'system'].includes(actor.type) || !actor.id.trim())\n throw new TypeError('A valid project governance actor is required.');\n}\n\nfunction assign(\n record: { ownerType: ProjectGovernanceActor['type'] | ''; ownerId: string },\n owner: ProjectGovernanceOwner | null,\n): void {\n if (\n owner &&\n (!owner.id.trim() || !['user', 'agent', 'system'].includes(owner.type))\n )\n throw new TypeError('A valid project governance owner is required.');\n record.ownerType = owner?.type ?? '';\n record.ownerId = owner?.id.trim() ?? '';\n}\n\nfunction requiredNote(note: string): string {\n const value = note.trim();\n if (!value) throw new TypeError('A note is required.');\n return value;\n}\n\nfunction validateQuestionTransition(\n from: ProjectQuestionStatus,\n to?: ProjectQuestionStatus,\n): void {\n if (!to) return;\n const allowed: Record<ProjectQuestionStatus, ProjectQuestionStatus[]> = {\n open: ['answered', 'deferred', 'superseded'],\n answered: ['superseded'],\n deferred: ['open', 'superseded'],\n superseded: [],\n };\n if (!allowed[from].includes(to))\n throw new TypeError(\n `Invalid project question transition: ${from} -> ${to}.`,\n );\n}\n\nfunction validateDecisionTransition(\n from: ProjectDecisionStatus,\n to?: ProjectDecisionStatus,\n): void {\n if (!to) return;\n const allowed: Record<ProjectDecisionStatus, ProjectDecisionStatus[]> = {\n open: ['decided', 'deferred', 'superseded'],\n decided: ['superseded'],\n deferred: ['open', 'superseded'],\n superseded: [],\n };\n if (!allowed[from].includes(to))\n throw new TypeError(\n `Invalid project decision transition: ${from} -> ${to}.`,\n );\n}\n","import {\n isUniqueViolationError,\n type SmrtClassOptions,\n} from '@happyvertical/smrt-core';\nimport { validateCookbook } from '@happyvertical/smrt-core/cookbook';\nimport {\n assertTenantReadAllowed,\n withTenant,\n} from '@happyvertical/smrt-tenancy';\nimport { ProjectSpecificationCollection } from '../collections/ProjectSpecifications.js';\nimport type { ProjectSpecification } from '../models/ProjectSpecification.js';\nimport type {\n ProjectGovernanceActor,\n ProjectGovernanceScope,\n} from '../project-governance-types.js';\nimport {\n ProjectGovernanceAuthorizationError,\n ProjectGovernanceConflictError,\n} from './project-governance-service.js';\n\nexport class ProjectSpecificationValidationError extends TypeError {\n readonly code = 'INVALID_PROJECT_SPECIFICATION';\n readonly status = 400;\n}\n\nexport interface ProjectSpecificationSaveInput extends ProjectGovernanceScope {\n /** null is create-only; an existing specification requires its current revision. */\n expectedRevision: number | null;\n actor: ProjectGovernanceActor;\n title: string;\n summary?: string;\n /** Validated and canonicalized by smrt-core/cookbook before persistence. */\n cookbook: unknown;\n}\n\nexport interface ProjectSpecificationServiceOptions extends SmrtClassOptions {\n /** Explicit caller-owned transaction executor; never pass an ordinary connection here. */\n transaction?: 'caller';\n}\n\n/** Tenant/project isolation and optimistic writes for canonical specifications. */\nexport class ProjectSpecificationService {\n private constructor(\n private readonly collection: ProjectSpecificationCollection,\n private readonly callerTransaction: boolean,\n ) {}\n\n static async create(\n options: ProjectSpecificationServiceOptions = {},\n ): Promise<ProjectSpecificationService> {\n return new ProjectSpecificationService(\n await ProjectSpecificationCollection.create(options),\n options.transaction === 'caller',\n );\n }\n\n async getForProject(\n scope: ProjectGovernanceScope,\n ): Promise<ProjectSpecification | null> {\n validateScope(scope);\n return this.collection.getForProject(scope);\n }\n\n async saveForProject(\n input: ProjectSpecificationSaveInput,\n ): Promise<ProjectSpecification> {\n validateScope(input);\n if (\n !['user', 'agent', 'system'].includes(input.actor.type) ||\n !input.actor.id.trim()\n )\n throw new ProjectSpecificationValidationError(\n 'A valid project specification actor is required.',\n );\n if (!input.actor.canManage) throw new ProjectGovernanceAuthorizationError();\n if (\n input.expectedRevision !== null &&\n (!Number.isSafeInteger(input.expectedRevision) ||\n input.expectedRevision < 1)\n )\n throw new ProjectSpecificationValidationError(\n 'Expected revision must be null or a positive integer.',\n );\n if (typeof input.title !== 'string' || !input.title.trim())\n throw new ProjectSpecificationValidationError(\n 'Project specification title is required.',\n );\n const validated = validateCookbook(input.cookbook);\n if (!validated.ok)\n throw new ProjectSpecificationValidationError(\n validated.errors.join('; '),\n );\n const work = async (db: ProjectSpecificationCollection['db']) => {\n const collection = await ProjectSpecificationCollection.create({ db });\n const table = `\"${collection.tableName.replace(/\"/g, '\"\"')}\"`;\n await db.query(\n `UPDATE ${table} SET revision = revision WHERE tenant_id = ? AND meta_type = ? AND meta_id = ?`,\n input.tenantId,\n input.projectType,\n input.projectId,\n );\n const current = await collection.getForProject(input);\n if ((current?.revision ?? null) !== input.expectedRevision)\n throw new ProjectGovernanceConflictError(\n 'Project specification has changed.',\n );\n const values = {\n title: input.title,\n summary: input.summary ?? '',\n cookbook: JSON.stringify(validated.cookbook),\n actorType: input.actor.type,\n actorId: input.actor.id,\n };\n return withTenant({ tenantId: input.tenantId }, async () => {\n if (current) {\n Object.assign(current, values);\n current.revision += 1;\n await current.save();\n return current;\n }\n try {\n return await collection.create({\n ...values,\n tenantId: input.tenantId,\n metaType: input.projectType,\n metaId: input.projectId,\n _insertOnly: true,\n });\n } catch (error) {\n if (isUniqueViolationError(error))\n throw new ProjectGovernanceConflictError(\n 'Project specification already exists.',\n );\n throw error;\n }\n });\n };\n if (this.callerTransaction) return work(this.collection.db);\n if (!this.collection.db.transaction)\n throw new Error('Project specification mutations require transactions.');\n return this.collection.db.transaction(work);\n }\n}\n\nfunction validateScope(scope: ProjectGovernanceScope): void {\n if (\n !scope.tenantId.trim() ||\n !scope.projectId.trim() ||\n !scope.projectType.includes(':')\n )\n throw new ProjectSpecificationValidationError(\n 'Tenant, qualified project type, and project id are required.',\n );\n assertTenantReadAllowed(scope.tenantId, 'ProjectSpecificationService');\n}\n","import {\n CommercialUsageService,\n type CommercialUsageServiceOptions,\n} from '@happyvertical/smrt-subscriptions';\nimport type { ServiceTimeEntry } from '@happyvertical/smrt-timesheets';\nimport type {\n CommercialSnapshot,\n ServiceCommercialResolver,\n} from './service-evidence-service.js';\n\nexport interface ProviderCompensationResolver {\n compensate(entry: ServiceTimeEntry): Promise<CommercialSnapshot>;\n}\n\n/**\n * A support-case subtype (smrt-support's `ServiceTimeEntry`) carries `caseId` /\n * `specialistId`; the shared entry does not (#3288). Read them when present so\n * case-attached entries keep their usage-event work reference.\n */\nfunction supportContext(entry: ServiceTimeEntry): {\n caseId: string | null;\n specialistId: string | null;\n} {\n const fields = entry as unknown as Record<string, unknown>;\n return {\n caseId: typeof fields.caseId === 'string' ? fields.caseId : null,\n specialistId:\n typeof fields.specialistId === 'string' ? fields.specialistId : null,\n };\n}\n\n/** Bridges shared Professional Service evidence to #1925's effective pricing. */\nexport class SubscriptionServiceCommercialResolver\n implements ServiceCommercialResolver\n{\n constructor(\n private readonly usage: CommercialUsageService,\n private readonly provider: ProviderCompensationResolver,\n ) {}\n\n static async create(\n options: CommercialUsageServiceOptions,\n provider: ProviderCompensationResolver,\n ): Promise<SubscriptionServiceCommercialResolver> {\n return new SubscriptionServiceCommercialResolver(\n await CommercialUsageService.create(options),\n provider,\n );\n }\n\n /** Reject unsupported source quantities before the shared approval writes. */\n validateEntry(entry: ServiceTimeEntry): void {\n entry.requireDurationSeconds();\n }\n\n async priceClient(entry: ServiceTimeEntry): Promise<CommercialSnapshot> {\n if (!entry.id || !entry.tenantId)\n throw new Error(\n 'Saved tenant-scoped ServiceTimeEntry is required for client pricing.',\n );\n const at = entry.endedAt ?? entry.startedAt ?? new Date();\n const metadata = entry.getMetadata();\n const { caseId, specialistId } = supportContext(entry);\n const usageEvent = await this.usage.record({\n tenantId: entry.tenantId,\n metricKey: 'duration.seconds',\n quantity: entry.requireDurationSeconds(),\n windowStart: at,\n windowEnd: at,\n source: 'service-time-entry',\n sourceId: entry.id,\n projectId:\n typeof metadata.projectId === 'string' ? metadata.projectId : undefined,\n workRefType:\n entry.workRefType ??\n (caseId ? '@happyvertical/smrt-support:SupportCase' : undefined),\n workRefId: entry.workRefId ?? caseId ?? undefined,\n provider: entry.participantKind,\n dimensions: {\n serviceKey: 'professional-services',\n source: entry.source,\n specialistId,\n agentRef: entry.agentRef || undefined,\n },\n });\n if (!usageEvent.id)\n throw new Error('Professional Service usage event was not persisted.');\n const charge = await this.usage.price({\n usageEventId: usageEvent.id,\n approved: true,\n at,\n });\n const snapshot = charge.getPricingSnapshot();\n return {\n amount: charge.amount,\n currency: charge.currency,\n version: String(snapshot.ruleKey ?? charge.pricingRuleId),\n strategy: String(snapshot.strategy ?? ''),\n terms: snapshot,\n sourceRef: `@happyvertical/smrt-subscriptions:ClientCharge:${charge.id}`,\n };\n }\n\n compensateProvider(entry: ServiceTimeEntry):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