@happyvertical/smrt-support 0.60.1 → 0.60.3
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 +11 -11
package/dist/index.js
CHANGED
|
@@ -19,7 +19,7 @@ var __exportAll = (all, no_symbols) => {
|
|
|
19
19
|
};
|
|
20
20
|
//#endregion
|
|
21
21
|
//#region src/__smrt-register__.ts
|
|
22
|
-
ObjectRegistry.registerPackageManifest(JSON.parse(`{"version":"1.0.0","timestamp":0,"packageName":"@happyvertical/smrt-support","packageVersion":"0.60.1","objects":{"@happyvertical/smrt-support:ServiceTimeEntry":{"name":"servicetimeentry","className":"ServiceTimeEntry","qualifiedName":"@happyvertical/smrt-support:ServiceTimeEntry","collection":"servicetimeentries","description":"Support subtype over the shared service_time_entries table: the shared entry plus caseId (a SupportCase) and specialistId (a SupportSpecialist).","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/service-time-entry.ts","packageName":"@happyvertical/smrt-support","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}}},"caseId":{"type":"foreignKey","required":false,"related":"SupportCase"},"workRefType":{"type":"text","required":false,"_meta":{"nullable":true}},"workRefId":{"type":"text","required":false,"_meta":{"nullable":true}},"specialistId":{"type":"foreignKey","required":false,"related":"SupportSpecialist"},"participantKind":{"type":"text","required":false,"_meta":{}},"participantProfileId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-profiles:Profile","_meta":{"nullable":true}},"agentRef":{"type":"text","required":false,"_meta":{}},"source":{"type":"text","required":false,"_meta":{}},"description":{"type":"text","required":false,"_meta":{}},"startedAt":{"type":"datetime","required":false},"endedAt":{"type":"datetime","required":false},"durationSeconds":{"type":"integer","required":false,"_meta":{"nullable":true}},"evidence":{"type":"text","required":false,"_meta":{}},"status":{"type":"text","required":false,"_meta":{}},"submittedAt":{"type":"datetime","required":false},"submittedByProfileId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-profiles:Profile","_meta":{"nullable":true}},"approvedAt":{"type":"datetime","required":false},"approvedByProfileId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-profiles:Profile","_meta":{"nullable":true}},"approvalPath":{"type":"text","required":false,"_meta":{}},"rejectedAt":{"type":"datetime","required":false},"rejectedByProfileId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-profiles:Profile","_meta":{"nullable":true}},"rejectionReason":{"type":"text","required":false,"_meta":{}},"correctionOfId":{"type":"foreignKey","required":false,"related":"ServiceTimeEntry"},"metadata":{"type":"text","required":false,"_meta":{}}},"methods":{"getEvidence":{"name":"getEvidence","async":false,"parameters":[],"returnType":"ServiceEvidence[]","isStatic":false,"isPublic":true},"setEvidence":{"name":"setEvidence","async":false,"parameters":[{"name":"value","type":"ServiceEvidence[]","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"getMetadata":{"name":"getMetadata","async":false,"parameters":[],"returnType":"Record<string, unknown>","isStatic":false,"isPublic":true},"setMetadata":{"name":"setMetadata","async":false,"parameters":[{"name":"value","type":"Record<string, unknown>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"durationHoursExact":{"name":"durationHoursExact","async":false,"parameters":[],"returnType":"string | null","isStatic":false,"isPublic":true},"durationHours":{"name":"durationHours","async":false,"parameters":[],"returnType":"number","isStatic":false,"isPublic":true},"requireDurationSeconds":{"name":"requireDurationSeconds","async":false,"parameters":[],"returnType":"number","isStatic":false,"isPublic":true},"initialize":{"name":"initialize","async":true,"parameters":[],"returnType":"Promise<this>","isStatic":false,"isPublic":true},"save":{"name":"save","async":true,"parameters":[{"name":"options","type":"SmrtSaveOptions","optional":true}],"returnType":"Promise<this>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"service_time_entries","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context"]},"extends":"ServiceTimeEntry","extendsQualified":"@happyvertical/smrt-timesheets:ServiceTimeEntry","exportName":"ServiceTimeEntry","collectionExportName":"ServiceTimeEntryCollection","schema":{"tableName":"service_time_entries","ddl":"CREATE TABLE IF NOT EXISTS \\"service_time_entries\\" (\\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 \\"case_id\\" UUID,\\n \\"work_ref_type\\" TEXT,\\n \\"work_ref_id\\" TEXT,\\n \\"specialist_id\\" UUID,\\n \\"participant_kind\\" TEXT,\\n \\"participant_profile_id\\" UUID,\\n \\"agent_ref\\" TEXT,\\n \\"source\\" TEXT,\\n \\"description\\" TEXT,\\n \\"started_at\\" TIMESTAMP,\\n \\"ended_at\\" TIMESTAMP,\\n \\"duration_seconds\\" INTEGER,\\n \\"evidence\\" TEXT,\\n \\"status\\" TEXT,\\n \\"submitted_at\\" TIMESTAMP,\\n \\"submitted_by_profile_id\\" UUID,\\n \\"approved_at\\" TIMESTAMP,\\n \\"approved_by_profile_id\\" UUID,\\n \\"approval_path\\" TEXT,\\n \\"rejected_at\\" TIMESTAMP,\\n \\"rejected_by_profile_id\\" UUID,\\n \\"rejection_reason\\" TEXT,\\n \\"correction_of_id\\" UUID,\\n \\"metadata\\" 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":false,"unique":false},"case_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_cases","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"work_ref_type":{"type":"TEXT","notNull":false,"unique":false},"work_ref_id":{"type":"TEXT","notNull":false,"unique":false},"specialist_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_specialists","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"participant_kind":{"type":"TEXT","notNull":false,"unique":false},"participant_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"agent_ref":{"type":"TEXT","notNull":false,"unique":false},"source":{"type":"TEXT","notNull":false,"unique":false},"description":{"type":"TEXT","notNull":false,"unique":false},"started_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"ended_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"duration_seconds":{"type":"INTEGER","notNull":false,"unique":false},"evidence":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"submitted_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"submitted_by_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"approved_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"approved_by_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"approval_path":{"type":"TEXT","notNull":false,"unique":false},"rejected_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"rejected_by_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"rejection_reason":{"type":"TEXT","notNull":false,"unique":false},"correction_of_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"service_time_entries","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"service_time_entries_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"service_time_entries_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"service_time_entries_case_id_idx","columns":["case_id"]},{"name":"service_time_entries_specialist_id_idx","columns":["specialist_id"]},{"name":"service_time_entries_participant_profile_id_idx","columns":["participant_profile_id"]},{"name":"service_time_entries_submitted_by_profile_id_idx","columns":["submitted_by_profile_id"]},{"name":"service_time_entries_approved_by_profile_id_idx","columns":["approved_by_profile_id"]},{"name":"service_time_entries_rejected_by_profile_id_idx","columns":["rejected_by_profile_id"]},{"name":"service_time_entries_correction_of_id_idx","columns":["correction_of_id"]}],"version":"4a27a55d"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:ServiceTimeEntryCollection":{"name":"servicetimeentrycollection","className":"ServiceTimeEntryCollection","qualifiedName":"@happyvertical/smrt-support:ServiceTimeEntryCollection","collection":"servicetimeentries","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/service-time-entry.ts","packageName":"@happyvertical/smrt-support","fields":{},"methods":{"forCase":{"name":"forCase","async":true,"parameters":[{"name":"caseId","type":"string","optional":false}],"returnType":"Promise<ServiceTimeEntry[]>","isStatic":false,"isPublic":true},"forSpecialist":{"name":"forSpecialist","async":true,"parameters":[{"name":"specialistId","type":"string","optional":false}],"returnType":"Promise<ServiceTimeEntry[]>","isStatic":false,"isPublic":true},"pendingApproval":{"name":"pendingApproval","async":true,"parameters":[],"returnType":"Promise<ServiceTimeEntry[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"service_time_entries","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"ServiceTimeEntry","exportName":"ServiceTimeEntryCollection","collectionExportName":"ServiceTimeEntryCollectionCollection","collectionOf":"@happyvertical/smrt-support:ServiceTimeEntry","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"service_time_entries","ddl":"CREATE TABLE IF NOT EXISTS \\"service_time_entries\\" (\\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 \\"case_id\\" UUID,\\n \\"work_ref_type\\" TEXT,\\n \\"work_ref_id\\" TEXT,\\n \\"specialist_id\\" UUID,\\n \\"participant_kind\\" TEXT,\\n \\"participant_profile_id\\" UUID,\\n \\"agent_ref\\" TEXT,\\n \\"source\\" TEXT,\\n \\"description\\" TEXT,\\n \\"started_at\\" TIMESTAMP,\\n \\"ended_at\\" TIMESTAMP,\\n \\"duration_seconds\\" INTEGER,\\n \\"evidence\\" TEXT,\\n \\"status\\" TEXT,\\n \\"submitted_at\\" TIMESTAMP,\\n \\"submitted_by_profile_id\\" UUID,\\n \\"approved_at\\" TIMESTAMP,\\n \\"approved_by_profile_id\\" UUID,\\n \\"approval_path\\" TEXT,\\n \\"rejected_at\\" TIMESTAMP,\\n \\"rejected_by_profile_id\\" UUID,\\n \\"rejection_reason\\" TEXT,\\n \\"correction_of_id\\" UUID,\\n \\"metadata\\" 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":false,"unique":false},"case_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_cases","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"work_ref_type":{"type":"TEXT","notNull":false,"unique":false},"work_ref_id":{"type":"TEXT","notNull":false,"unique":false},"specialist_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_specialists","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"participant_kind":{"type":"TEXT","notNull":false,"unique":false},"participant_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"agent_ref":{"type":"TEXT","notNull":false,"unique":false},"source":{"type":"TEXT","notNull":false,"unique":false},"description":{"type":"TEXT","notNull":false,"unique":false},"started_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"ended_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"duration_seconds":{"type":"INTEGER","notNull":false,"unique":false},"evidence":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"submitted_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"submitted_by_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"approved_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"approved_by_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"approval_path":{"type":"TEXT","notNull":false,"unique":false},"rejected_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"rejected_by_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"rejection_reason":{"type":"TEXT","notNull":false,"unique":false},"correction_of_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"service_time_entries","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"service_time_entries_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"service_time_entries_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"service_time_entries_case_id_idx","columns":["case_id"]},{"name":"service_time_entries_specialist_id_idx","columns":["specialist_id"]},{"name":"service_time_entries_participant_profile_id_idx","columns":["participant_profile_id"]},{"name":"service_time_entries_submitted_by_profile_id_idx","columns":["submitted_by_profile_id"]},{"name":"service_time_entries_approved_by_profile_id_idx","columns":["approved_by_profile_id"]},{"name":"service_time_entries_rejected_by_profile_id_idx","columns":["rejected_by_profile_id"]},{"name":"service_time_entries_correction_of_id_idx","columns":["correction_of_id"]}],"version":"4a27a55d"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportAiRun":{"name":"supportairun","className":"SupportAiRun","qualifiedName":"@happyvertical/smrt-support:SupportAiRun","collection":"supportairuns","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-ai-run.ts","packageName":"@happyvertical/smrt-support","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}}},"caseId":{"type":"foreignKey","required":true,"related":"SupportCase","_meta":{"required":true}},"interactionId":{"type":"foreignKey","required":false,"related":"SupportInteraction"},"phase":{"type":"text","required":false,"_meta":{},"enum":["acknowledge","classify","answer","troubleshoot","resolve"]},"outcome":{"type":"text","required":false,"_meta":{},"enum":["completed","skipped","failed","handed_off"]},"confidence":{"type":"decimal","required":false,"_meta":{"nullable":true}},"classification":{"type":"text","required":false,"_meta":{}},"responseInteractionId":{"type":"foreignKey","required":false,"related":"SupportInteraction"},"knowledgeRefs":{"type":"text","required":false,"_meta":{}},"toolCalls":{"type":"text","required":false,"_meta":{}},"error":{"type":"text","required":false,"_meta":{}},"correlationId":{"type":"text","required":false,"_meta":{}},"model":{"type":"text","required":false,"_meta":{}},"startedAt":{"type":"datetime","required":false},"completedAt":{"type":"datetime","required":false},"metadata":{"type":"text","required":false,"_meta":{}}},"methods":{"getClassification":{"name":"getClassification","async":false,"parameters":[],"returnType":"Record<string, unknown>","isStatic":false,"isPublic":true},"setClassification":{"name":"setClassification","async":false,"parameters":[{"name":"value","type":"Record<string, unknown>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"getKnowledgeRefs":{"name":"getKnowledgeRefs","async":false,"parameters":[],"returnType":"Array<Record<string, unknown>>","isStatic":false,"isPublic":true},"setKnowledgeRefs":{"name":"setKnowledgeRefs","async":false,"parameters":[{"name":"refs","type":"Array<Record<string, unknown>>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"getToolCalls":{"name":"getToolCalls","async":false,"parameters":[],"returnType":"Array<Record<string, unknown>>","isStatic":false,"isPublic":true},"setToolCalls":{"name":"setToolCalls","async":false,"parameters":[{"name":"calls","type":"Array<Record<string, unknown>>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_ai_runs","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"SupportAiRun","collectionExportName":"SupportAiRunCollection","validationRules":[{"field":"caseId","rule":"required","fieldType":"foreignKey"}],"schema":{"tableName":"support_ai_runs","ddl":"CREATE TABLE IF NOT EXISTS \\"support_ai_runs\\" (\\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 \\"case_id\\" UUID NOT NULL,\\n \\"interaction_id\\" UUID,\\n \\"phase\\" TEXT,\\n \\"outcome\\" TEXT,\\n \\"confidence\\" REAL,\\n \\"classification\\" TEXT,\\n \\"response_interaction_id\\" UUID,\\n \\"knowledge_refs\\" TEXT,\\n \\"tool_calls\\" TEXT,\\n \\"error\\" TEXT,\\n \\"correlation_id\\" TEXT,\\n \\"model\\" TEXT,\\n \\"started_at\\" TIMESTAMP,\\n \\"completed_at\\" TIMESTAMP,\\n \\"metadata\\" 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":false,"unique":false},"case_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"support_cases","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"interaction_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_interactions","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"phase":{"type":"TEXT","notNull":false,"unique":false},"outcome":{"type":"TEXT","notNull":false,"unique":false},"confidence":{"type":"REAL","notNull":false,"unique":false},"classification":{"type":"TEXT","notNull":false,"unique":false},"response_interaction_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_interactions","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"knowledge_refs":{"type":"TEXT","notNull":false,"unique":false},"tool_calls":{"type":"TEXT","notNull":false,"unique":false},"error":{"type":"TEXT","notNull":false,"unique":false},"correlation_id":{"type":"TEXT","notNull":false,"unique":false},"model":{"type":"TEXT","notNull":false,"unique":false},"started_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"completed_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_ai_runs_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"support_ai_runs_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_ai_runs_case_id_idx","columns":["case_id"]},{"name":"support_ai_runs_interaction_id_idx","columns":["interaction_id"]},{"name":"support_ai_runs_response_interaction_id_idx","columns":["response_interaction_id"]}],"version":"5edb948b"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportAiRunCollection":{"name":"supportairuncollection","className":"SupportAiRunCollection","qualifiedName":"@happyvertical/smrt-support:SupportAiRunCollection","collection":"supportairuns","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-ai-run.ts","packageName":"@happyvertical/smrt-support","fields":{},"methods":{"forCase":{"name":"forCase","async":true,"parameters":[{"name":"caseId","type":"string","optional":false}],"returnType":"Promise<SupportAiRun[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_ai_runs","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SupportAiRun","exportName":"SupportAiRunCollection","collectionExportName":"SupportAiRunCollectionCollection","collectionOf":"@happyvertical/smrt-support:SupportAiRun","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"support_ai_runs","ddl":"CREATE TABLE IF NOT EXISTS \\"support_ai_runs\\" (\\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 \\"case_id\\" UUID NOT NULL,\\n \\"interaction_id\\" UUID,\\n \\"phase\\" TEXT,\\n \\"outcome\\" TEXT,\\n \\"confidence\\" REAL,\\n \\"classification\\" TEXT,\\n \\"response_interaction_id\\" UUID,\\n \\"knowledge_refs\\" TEXT,\\n \\"tool_calls\\" TEXT,\\n \\"error\\" TEXT,\\n \\"correlation_id\\" TEXT,\\n \\"model\\" TEXT,\\n \\"started_at\\" TIMESTAMP,\\n \\"completed_at\\" TIMESTAMP,\\n \\"metadata\\" 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":false,"unique":false},"case_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"support_cases","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"interaction_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_interactions","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"phase":{"type":"TEXT","notNull":false,"unique":false},"outcome":{"type":"TEXT","notNull":false,"unique":false},"confidence":{"type":"REAL","notNull":false,"unique":false},"classification":{"type":"TEXT","notNull":false,"unique":false},"response_interaction_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_interactions","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"knowledge_refs":{"type":"TEXT","notNull":false,"unique":false},"tool_calls":{"type":"TEXT","notNull":false,"unique":false},"error":{"type":"TEXT","notNull":false,"unique":false},"correlation_id":{"type":"TEXT","notNull":false,"unique":false},"model":{"type":"TEXT","notNull":false,"unique":false},"started_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"completed_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_ai_runs_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"support_ai_runs_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_ai_runs_case_id_idx","columns":["case_id"]},{"name":"support_ai_runs_interaction_id_idx","columns":["interaction_id"]},{"name":"support_ai_runs_response_interaction_id_idx","columns":["response_interaction_id"]}],"version":"5edb948b"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportCaseEvent":{"name":"supportcaseevent","className":"SupportCaseEvent","qualifiedName":"@happyvertical/smrt-support:SupportCaseEvent","collection":"supportcaseevents","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-case-event.ts","packageName":"@happyvertical/smrt-support","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}}},"caseId":{"type":"foreignKey","required":true,"related":"SupportCase","_meta":{"required":true}},"eventType":{"type":"text","required":false,"_meta":{},"enum":["created","interaction","transition","assignment","ai_run","handoff","human_requested","escalation","target_scheduled","target_satisfied","target_breached","target_paused","target_resumed","work_linked","reopened","plan_applied","time_recorded","note"]},"actorKind":{"type":"text","required":false,"_meta":{},"enum":["client","specialist","agent","system"]},"actorProfileId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-profiles:Profile","_meta":{"nullable":true}},"occurredAt":{"type":"datetime","required":false},"summary":{"type":"text","required":false,"_meta":{}},"payload":{"type":"text","required":false,"_meta":{}}},"methods":{"getPayload":{"name":"getPayload","async":false,"parameters":[],"returnType":"Record<string, unknown>","isStatic":false,"isPublic":true},"setPayload":{"name":"setPayload","async":false,"parameters":[{"name":"value","type":"Record<string, unknown>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_case_events","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"SupportCaseEvent","collectionExportName":"SupportCaseEventCollection","validationRules":[{"field":"caseId","rule":"required","fieldType":"foreignKey"}],"schema":{"tableName":"support_case_events","ddl":"CREATE TABLE IF NOT EXISTS \\"support_case_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,\\n \\"case_id\\" UUID NOT NULL,\\n \\"event_type\\" TEXT,\\n \\"actor_kind\\" TEXT,\\n \\"actor_profile_id\\" UUID,\\n \\"occurred_at\\" TIMESTAMP,\\n \\"summary\\" TEXT,\\n \\"payload\\" 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":false,"unique":false},"case_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"support_cases","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"event_type":{"type":"TEXT","notNull":false,"unique":false},"actor_kind":{"type":"TEXT","notNull":false,"unique":false},"actor_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"occurred_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"summary":{"type":"TEXT","notNull":false,"unique":false},"payload":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_case_events_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"support_case_events_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_case_events_case_id_idx","columns":["case_id"]},{"name":"support_case_events_actor_profile_id_idx","columns":["actor_profile_id"]}],"version":"eff9cadb"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportCaseEventCollection":{"name":"supportcaseeventcollection","className":"SupportCaseEventCollection","qualifiedName":"@happyvertical/smrt-support:SupportCaseEventCollection","collection":"supportcaseevents","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-case-event.ts","packageName":"@happyvertical/smrt-support","fields":{},"methods":{"forCase":{"name":"forCase","async":true,"parameters":[{"name":"caseId","type":"string","optional":false},{"name":"options","type":"object","optional":true,"memberTypes":["SupportCaseEventType"]}],"returnType":"Promise<SupportCaseEvent[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_case_events","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SupportCaseEvent","exportName":"SupportCaseEventCollection","collectionExportName":"SupportCaseEventCollectionCollection","collectionOf":"@happyvertical/smrt-support:SupportCaseEvent","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"support_case_events","ddl":"CREATE TABLE IF NOT EXISTS \\"support_case_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,\\n \\"case_id\\" UUID NOT NULL,\\n \\"event_type\\" TEXT,\\n \\"actor_kind\\" TEXT,\\n \\"actor_profile_id\\" UUID,\\n \\"occurred_at\\" TIMESTAMP,\\n \\"summary\\" TEXT,\\n \\"payload\\" 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":false,"unique":false},"case_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"support_cases","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"event_type":{"type":"TEXT","notNull":false,"unique":false},"actor_kind":{"type":"TEXT","notNull":false,"unique":false},"actor_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"occurred_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"summary":{"type":"TEXT","notNull":false,"unique":false},"payload":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_case_events_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"support_case_events_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_case_events_case_id_idx","columns":["case_id"]},{"name":"support_case_events_actor_profile_id_idx","columns":["actor_profile_id"]}],"version":"eff9cadb"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportCase":{"name":"supportcase","className":"SupportCase","qualifiedName":"@happyvertical/smrt-support:SupportCase","collection":"supportcases","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-case.ts","packageName":"@happyvertical/smrt-support","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}}},"caseNumber":{"type":"text","required":false,"description":"The reference number for this ticket.","_meta":{"description":"The reference number for this ticket."}},"subject":{"type":"text","required":false,"description":"A short summary of what the customer needs.","_meta":{"description":"A short summary of what the customer needs."}},"description":{"type":"text","required":false,"description":"What the customer asked for, in their words.","_meta":{"description":"What the customer asked for, in their words."}},"status":{"type":"text","required":false,"description":"Where the ticket stands, from new to resolved.","_meta":{"description":"Where the ticket stands, from new to resolved."},"enum":["new","triaged","assigned","in_progress","waiting_on_client","escalated","resolved","closed"]},"priority":{"type":"text","required":false,"description":"How soon it needs attention: low, normal, high or urgent.","_meta":{"description":"How soon it needs attention: low, normal, high or urgent."}},"severity":{"type":"text","required":false,"_meta":{}},"category":{"type":"text","required":false,"_meta":{}},"sensitive":{"type":"boolean","required":false,"_meta":{}},"channelKind":{"type":"text","required":false,"_meta":{}},"clientProfileId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-profiles:Profile","description":"The customer who asked for help.","_meta":{"description":"The customer who asked for help.","nullable":true}},"openedByProfileId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-profiles:Profile","_meta":{"nullable":true}},"projectId":{"type":"text","required":false,"_meta":{"nullable":true}},"bindingId":{"type":"foreignKey","required":false,"related":"SupportChannelBinding"},"threadKey":{"type":"text","required":false,"_meta":{}},"planId":{"type":"foreignKey","required":false,"related":"SupportPlan"},"planSnapshot":{"type":"text","required":false,"_meta":{}},"assignedSpecialistId":{"type":"foreignKey","required":false,"related":"SupportSpecialist","description":"The team member handling this ticket.","_meta":{"description":"The team member handling this ticket."}},"assignedAt":{"type":"datetime","required":false},"preferredSpecialistId":{"type":"foreignKey","required":false,"related":"SupportSpecialist"},"escalationLevel":{"type":"integer","required":false,"default":0},"escalatedAt":{"type":"datetime","required":false},"acknowledgedAt":{"type":"datetime","required":false},"firstRespondedAt":{"type":"datetime","required":false},"humanRequestedAt":{"type":"datetime","required":false},"resolvedAt":{"type":"datetime","required":false},"resolvedByProfileId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-profiles:Profile","_meta":{"nullable":true}},"resolutionKind":{"type":"text","required":false,"_meta":{}},"resolutionSummary":{"type":"text","required":false,"_meta":{}},"closedAt":{"type":"datetime","required":false},"reopenCount":{"type":"integer","required":false,"default":0},"lastReopenedAt":{"type":"datetime","required":false},"aiEnabled":{"type":"boolean","required":false,"_meta":{}},"metadata":{"type":"text","required":false,"_meta":{}}},"methods":{"isOpen":{"name":"isOpen","async":false,"parameters":[],"returnType":"boolean","isStatic":false,"isPublic":true},"getMetadata":{"name":"getMetadata","async":false,"parameters":[],"returnType":"Record<string, unknown>","isStatic":false,"isPublic":true},"setMetadata":{"name":"setMetadata","async":false,"parameters":[{"name":"value","type":"Record<string, unknown>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"updateMetadata":{"name":"updateMetadata","async":false,"parameters":[{"name":"patch","type":"Record<string, unknown>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"getPlanSnapshot":{"name":"getPlanSnapshot","async":false,"parameters":[],"returnType":"Record<string, unknown>","isStatic":false,"isPublic":true},"setPlanSnapshot":{"name":"setPlanSnapshot","async":false,"parameters":[{"name":"value","type":"Record<string, unknown>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"attemptTriageDecision":{"name":"attemptTriageDecision","async":true,"parameters":[{"name":"request","type":"DecisionRequest","optional":false}],"returnType":"Promise<DecisionResult | undefined>","isStatic":false,"isPublic":true},"initialize":{"name":"initialize","async":true,"parameters":[],"returnType":"Promise<this>","isStatic":false,"isPublic":true},"save":{"name":"save","async":true,"parameters":[{"name":"options","type":"SmrtSaveOptions","optional":true}],"returnType":"Promise<this>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_cases","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"SupportCase","collectionExportName":"SupportCaseCollection","schema":{"tableName":"support_cases","ddl":"CREATE TABLE IF NOT EXISTS \\"support_cases\\" (\\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 \\"case_number\\" TEXT,\\n \\"subject\\" TEXT,\\n \\"description\\" TEXT,\\n \\"status\\" TEXT,\\n \\"priority\\" TEXT,\\n \\"severity\\" TEXT,\\n \\"category\\" TEXT,\\n \\"sensitive\\" BOOLEAN,\\n \\"channel_kind\\" TEXT,\\n \\"client_profile_id\\" UUID,\\n \\"opened_by_profile_id\\" UUID,\\n \\"project_id\\" TEXT,\\n \\"binding_id\\" UUID,\\n \\"thread_key\\" TEXT,\\n \\"plan_id\\" UUID,\\n \\"plan_snapshot\\" TEXT,\\n \\"assigned_specialist_id\\" UUID,\\n \\"assigned_at\\" TIMESTAMP,\\n \\"preferred_specialist_id\\" UUID,\\n \\"escalation_level\\" INTEGER DEFAULT 0,\\n \\"escalated_at\\" TIMESTAMP,\\n \\"acknowledged_at\\" TIMESTAMP,\\n \\"first_responded_at\\" TIMESTAMP,\\n \\"human_requested_at\\" TIMESTAMP,\\n \\"resolved_at\\" TIMESTAMP,\\n \\"resolved_by_profile_id\\" UUID,\\n \\"resolution_kind\\" TEXT,\\n \\"resolution_summary\\" TEXT,\\n \\"closed_at\\" TIMESTAMP,\\n \\"reopen_count\\" INTEGER DEFAULT 0,\\n \\"last_reopened_at\\" TIMESTAMP,\\n \\"ai_enabled\\" BOOLEAN,\\n \\"metadata\\" 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":false,"unique":false},"case_number":{"type":"TEXT","notNull":false,"unique":false},"subject":{"type":"TEXT","notNull":false,"unique":false},"description":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"priority":{"type":"TEXT","notNull":false,"unique":false},"severity":{"type":"TEXT","notNull":false,"unique":false},"category":{"type":"TEXT","notNull":false,"unique":false},"sensitive":{"type":"BOOLEAN","notNull":false,"unique":false},"channel_kind":{"type":"TEXT","notNull":false,"unique":false},"client_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"opened_by_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"project_id":{"type":"TEXT","notNull":false,"unique":false},"binding_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_channel_bindings","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"thread_key":{"type":"TEXT","notNull":false,"unique":false},"plan_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_plans","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"plan_snapshot":{"type":"TEXT","notNull":false,"unique":false},"assigned_specialist_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_specialists","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"assigned_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"preferred_specialist_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_specialists","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"escalation_level":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"escalated_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"acknowledged_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"first_responded_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"human_requested_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"resolved_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"resolved_by_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"resolution_kind":{"type":"TEXT","notNull":false,"unique":false},"resolution_summary":{"type":"TEXT","notNull":false,"unique":false},"closed_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"reopen_count":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"last_reopened_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"ai_enabled":{"type":"BOOLEAN","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_cases_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"support_cases_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_cases_client_profile_id_idx","columns":["client_profile_id"]},{"name":"support_cases_opened_by_profile_id_idx","columns":["opened_by_profile_id"]},{"name":"support_cases_binding_id_idx","columns":["binding_id"]},{"name":"support_cases_plan_id_idx","columns":["plan_id"]},{"name":"support_cases_assigned_specialist_id_idx","columns":["assigned_specialist_id"]},{"name":"support_cases_preferred_specialist_id_idx","columns":["preferred_specialist_id"]},{"name":"support_cases_resolved_by_profile_id_idx","columns":["resolved_by_profile_id"]}],"version":"b83a4283"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportCaseCollection":{"name":"supportcasecollection","className":"SupportCaseCollection","qualifiedName":"@happyvertical/smrt-support:SupportCaseCollection","collection":"supportcases","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-case.ts","packageName":"@happyvertical/smrt-support","fields":{},"methods":{"findOpenByThreadKey":{"name":"findOpenByThreadKey","async":true,"parameters":[{"name":"threadKey","type":"string","optional":false},{"name":"options","type":"object","optional":true,"memberTypes":["string | null"]}],"returnType":"Promise<SupportCase | null>","isStatic":false,"isPublic":true},"findQueue":{"name":"findQueue","async":true,"parameters":[{"name":"options","type":"object","optional":true,"memberTypes":["SupportCaseStatus | SupportCaseStatus[]","string | null","string","boolean","number"]}],"returnType":"Promise<SupportCase[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_cases","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SupportCase","exportName":"SupportCaseCollection","collectionExportName":"SupportCaseCollectionCollection","collectionOf":"@happyvertical/smrt-support:SupportCase","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"support_cases","ddl":"CREATE TABLE IF NOT EXISTS \\"support_cases\\" (\\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 \\"case_number\\" TEXT,\\n \\"subject\\" TEXT,\\n \\"description\\" TEXT,\\n \\"status\\" TEXT,\\n \\"priority\\" TEXT,\\n \\"severity\\" TEXT,\\n \\"category\\" TEXT,\\n \\"sensitive\\" BOOLEAN,\\n \\"channel_kind\\" TEXT,\\n \\"client_profile_id\\" UUID,\\n \\"opened_by_profile_id\\" UUID,\\n \\"project_id\\" TEXT,\\n \\"binding_id\\" UUID,\\n \\"thread_key\\" TEXT,\\n \\"plan_id\\" UUID,\\n \\"plan_snapshot\\" TEXT,\\n \\"assigned_specialist_id\\" UUID,\\n \\"assigned_at\\" TIMESTAMP,\\n \\"preferred_specialist_id\\" UUID,\\n \\"escalation_level\\" INTEGER DEFAULT 0,\\n \\"escalated_at\\" TIMESTAMP,\\n \\"acknowledged_at\\" TIMESTAMP,\\n \\"first_responded_at\\" TIMESTAMP,\\n \\"human_requested_at\\" TIMESTAMP,\\n \\"resolved_at\\" TIMESTAMP,\\n \\"resolved_by_profile_id\\" UUID,\\n \\"resolution_kind\\" TEXT,\\n \\"resolution_summary\\" TEXT,\\n \\"closed_at\\" TIMESTAMP,\\n \\"reopen_count\\" INTEGER DEFAULT 0,\\n \\"last_reopened_at\\" TIMESTAMP,\\n \\"ai_enabled\\" BOOLEAN,\\n \\"metadata\\" 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":false,"unique":false},"case_number":{"type":"TEXT","notNull":false,"unique":false},"subject":{"type":"TEXT","notNull":false,"unique":false},"description":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"priority":{"type":"TEXT","notNull":false,"unique":false},"severity":{"type":"TEXT","notNull":false,"unique":false},"category":{"type":"TEXT","notNull":false,"unique":false},"sensitive":{"type":"BOOLEAN","notNull":false,"unique":false},"channel_kind":{"type":"TEXT","notNull":false,"unique":false},"client_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"opened_by_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"project_id":{"type":"TEXT","notNull":false,"unique":false},"binding_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_channel_bindings","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"thread_key":{"type":"TEXT","notNull":false,"unique":false},"plan_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_plans","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"plan_snapshot":{"type":"TEXT","notNull":false,"unique":false},"assigned_specialist_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_specialists","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"assigned_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"preferred_specialist_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_specialists","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"escalation_level":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"escalated_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"acknowledged_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"first_responded_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"human_requested_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"resolved_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"resolved_by_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"resolution_kind":{"type":"TEXT","notNull":false,"unique":false},"resolution_summary":{"type":"TEXT","notNull":false,"unique":false},"closed_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"reopen_count":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"last_reopened_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"ai_enabled":{"type":"BOOLEAN","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_cases_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"support_cases_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_cases_client_profile_id_idx","columns":["client_profile_id"]},{"name":"support_cases_opened_by_profile_id_idx","columns":["opened_by_profile_id"]},{"name":"support_cases_binding_id_idx","columns":["binding_id"]},{"name":"support_cases_plan_id_idx","columns":["plan_id"]},{"name":"support_cases_assigned_specialist_id_idx","columns":["assigned_specialist_id"]},{"name":"support_cases_preferred_specialist_id_idx","columns":["preferred_specialist_id"]},{"name":"support_cases_resolved_by_profile_id_idx","columns":["resolved_by_profile_id"]}],"version":"b83a4283"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportChannelBinding":{"name":"supportchannelbinding","className":"SupportChannelBinding","qualifiedName":"@happyvertical/smrt-support:SupportChannelBinding","collection":"supportchannelbindings","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-channel-binding.ts","packageName":"@happyvertical/smrt-support","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}}},"name":{"type":"text","required":false,"default":""},"bindingKind":{"type":"text","required":false,"_meta":{},"enum":["chat_room","email_account"]},"channelKind":{"type":"text","required":false,"_meta":{},"enum":["chat","email","phone","voice","web","api"]},"targetType":{"type":"text","required":false,"_meta":{}},"targetId":{"type":"text","required":false,"_meta":{}},"clientProfileId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-profiles:Profile","_meta":{"nullable":true}},"projectId":{"type":"text","required":false,"_meta":{"nullable":true}},"planId":{"type":"foreignKey","required":false,"related":"SupportPlan"},"enabled":{"type":"boolean","required":false,"_meta":{}},"selfAddresses":{"type":"text","required":false,"_meta":{}},"metadata":{"type":"text","required":false,"_meta":{}}},"methods":{"getSelfAddresses":{"name":"getSelfAddresses","async":false,"parameters":[],"returnType":"string[]","isStatic":false,"isPublic":true},"setSelfAddresses":{"name":"setSelfAddresses","async":false,"parameters":[{"name":"addresses","type":"string[]","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"getMetadata":{"name":"getMetadata","async":false,"parameters":[],"returnType":"Record<string, unknown>","isStatic":false,"isPublic":true},"setMetadata":{"name":"setMetadata","async":false,"parameters":[{"name":"value","type":"Record<string, unknown>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_channel_bindings","api":{"include":["list","get","create","update","delete"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"conflictColumns":["target_type","target_id"],"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"SupportChannelBinding","collectionExportName":"SupportChannelBindingCollection","displayLabelField":"name","schema":{"tableName":"support_channel_bindings","ddl":"CREATE TABLE IF NOT EXISTS \\"support_channel_bindings\\" (\\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 \\"name\\" TEXT DEFAULT '',\\n \\"binding_kind\\" TEXT,\\n \\"channel_kind\\" TEXT,\\n \\"target_type\\" TEXT,\\n \\"target_id\\" TEXT,\\n \\"client_profile_id\\" UUID,\\n \\"project_id\\" TEXT,\\n \\"plan_id\\" UUID,\\n \\"enabled\\" BOOLEAN,\\n \\"self_addresses\\" TEXT,\\n \\"metadata\\" 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":false,"unique":false},"name":{"type":"TEXT","notNull":false,"unique":false,"default":""},"binding_kind":{"type":"TEXT","notNull":false,"unique":false},"channel_kind":{"type":"TEXT","notNull":false,"unique":false},"target_type":{"type":"TEXT","notNull":false,"unique":false},"target_id":{"type":"TEXT","notNull":false,"unique":false},"client_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"project_id":{"type":"TEXT","notNull":false,"unique":false},"plan_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_plans","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"enabled":{"type":"BOOLEAN","notNull":false,"unique":false},"self_addresses":{"type":"TEXT","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_channel_bindings_target_type_target_id_idx","columns":["target_type","target_id"],"unique":true,"nullsNotDistinct":true},{"name":"support_channel_bindings_slug_context_idx","columns":["slug","context"]},{"name":"support_channel_bindings_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_channel_bindings_client_profile_id_idx","columns":["client_profile_id"]},{"name":"support_channel_bindings_plan_id_idx","columns":["plan_id"]}],"version":"f162d069"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportChannelBindingCollection":{"name":"supportchannelbindingcollection","className":"SupportChannelBindingCollection","qualifiedName":"@happyvertical/smrt-support:SupportChannelBindingCollection","collection":"supportchannelbindings","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-channel-binding.ts","packageName":"@happyvertical/smrt-support","fields":{},"methods":{"findForTarget":{"name":"findForTarget","async":true,"parameters":[{"name":"targetType","type":"string","optional":false},{"name":"targetId","type":"string","optional":false}],"returnType":"Promise<SupportChannelBinding | null>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_channel_bindings","api":{"include":["list","get","create","update","delete"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SupportChannelBinding","exportName":"SupportChannelBindingCollection","collectionExportName":"SupportChannelBindingCollectionCollection","collectionOf":"@happyvertical/smrt-support:SupportChannelBinding","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"support_channel_bindings","ddl":"CREATE TABLE IF NOT EXISTS \\"support_channel_bindings\\" (\\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 \\"name\\" TEXT DEFAULT '',\\n \\"binding_kind\\" TEXT,\\n \\"channel_kind\\" TEXT,\\n \\"target_type\\" TEXT,\\n \\"target_id\\" TEXT,\\n \\"client_profile_id\\" UUID,\\n \\"project_id\\" TEXT,\\n \\"plan_id\\" UUID,\\n \\"enabled\\" BOOLEAN,\\n \\"self_addresses\\" TEXT,\\n \\"metadata\\" 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":false,"unique":false},"name":{"type":"TEXT","notNull":false,"unique":false,"default":""},"binding_kind":{"type":"TEXT","notNull":false,"unique":false},"channel_kind":{"type":"TEXT","notNull":false,"unique":false},"target_type":{"type":"TEXT","notNull":false,"unique":false},"target_id":{"type":"TEXT","notNull":false,"unique":false},"client_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"project_id":{"type":"TEXT","notNull":false,"unique":false},"plan_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_plans","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"enabled":{"type":"BOOLEAN","notNull":false,"unique":false},"self_addresses":{"type":"TEXT","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_channel_bindings_target_type_target_id_idx","columns":["target_type","target_id"],"unique":true,"nullsNotDistinct":true},{"name":"support_channel_bindings_slug_context_idx","columns":["slug","context"]},{"name":"support_channel_bindings_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_channel_bindings_client_profile_id_idx","columns":["client_profile_id"]},{"name":"support_channel_bindings_plan_id_idx","columns":["plan_id"]}],"version":"f162d069"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportCompensationPlan":{"name":"supportcompensationplan","className":"SupportCompensationPlan","qualifiedName":"@happyvertical/smrt-support:SupportCompensationPlan","collection":"supportcompensationplans","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-compensation-plan.ts","packageName":"@happyvertical/smrt-support","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}}},"specialistId":{"type":"foreignKey","required":false,"related":"SupportSpecialist"},"name":{"type":"text","required":false,"default":""},"hourlyRate":{"type":"decimal","required":false,"default":0},"currency":{"type":"text","required":false,"_meta":{}},"effectiveFrom":{"type":"datetime","required":false},"effectiveTo":{"type":"datetime","required":false},"status":{"type":"text","required":false,"_meta":{}},"terms":{"type":"text","required":false,"_meta":{}}},"methods":{"getTerms":{"name":"getTerms","async":false,"parameters":[],"returnType":"Record<string, unknown>","isStatic":false,"isPublic":true},"setTerms":{"name":"setTerms","async":false,"parameters":[{"name":"value","type":"Record<string, unknown>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"isEffectiveAt":{"name":"isEffectiveAt","async":false,"parameters":[{"name":"at","type":"Date","optional":true}],"returnType":"boolean","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_compensation_plans","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"conflictColumns":["tenant_id","specialist_id","effective_from"],"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"SupportCompensationPlan","collectionExportName":"SupportCompensationPlanCollection","displayLabelField":"name","schema":{"tableName":"support_compensation_plans","ddl":"CREATE TABLE IF NOT EXISTS \\"support_compensation_plans\\" (\\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 \\"specialist_id\\" UUID,\\n \\"name\\" TEXT DEFAULT '',\\n \\"hourly_rate\\" REAL DEFAULT 0,\\n \\"currency\\" TEXT,\\n \\"effective_from\\" TIMESTAMP,\\n \\"effective_to\\" TIMESTAMP,\\n \\"status\\" TEXT,\\n \\"terms\\" 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":false,"unique":false},"specialist_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_specialists","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"name":{"type":"TEXT","notNull":false,"unique":false,"default":""},"hourly_rate":{"type":"REAL","notNull":false,"unique":false,"default":0},"currency":{"type":"TEXT","notNull":false,"unique":false},"effective_from":{"type":"TIMESTAMP","notNull":false,"unique":false},"effective_to":{"type":"TIMESTAMP","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"terms":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_compensation_plans_tenant_id_specialist_id_idx","columns":["tenant_id","specialist_id","effective_from"],"unique":true,"nullsNotDistinct":true},{"name":"support_compensation_plans_slug_context_idx","columns":["slug","context"]},{"name":"support_compensation_plans_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_compensation_plans_specialist_id_idx","columns":["specialist_id"]}],"version":"1c6b40cd"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportCompensationPlanCollection":{"name":"supportcompensationplancollection","className":"SupportCompensationPlanCollection","qualifiedName":"@happyvertical/smrt-support:SupportCompensationPlanCollection","collection":"supportcompensationplans","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-compensation-plan.ts","packageName":"@happyvertical/smrt-support","fields":{},"methods":{"resolveForSpecialist":{"name":"resolveForSpecialist","async":true,"parameters":[{"name":"specialistId","type":"string","optional":false},{"name":"at","type":"Date","optional":true},{"name":"options","type":"object","optional":true,"memberTypes":["string | null"]}],"returnType":"Promise<SupportCompensationPlan | null>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_compensation_plans","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SupportCompensationPlan","exportName":"SupportCompensationPlanCollection","collectionExportName":"SupportCompensationPlanCollectionCollection","collectionOf":"@happyvertical/smrt-support:SupportCompensationPlan","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"support_compensation_plans","ddl":"CREATE TABLE IF NOT EXISTS \\"support_compensation_plans\\" (\\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 \\"specialist_id\\" UUID,\\n \\"name\\" TEXT DEFAULT '',\\n \\"hourly_rate\\" REAL DEFAULT 0,\\n \\"currency\\" TEXT,\\n \\"effective_from\\" TIMESTAMP,\\n \\"effective_to\\" TIMESTAMP,\\n \\"status\\" TEXT,\\n \\"terms\\" 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":false,"unique":false},"specialist_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_specialists","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"name":{"type":"TEXT","notNull":false,"unique":false,"default":""},"hourly_rate":{"type":"REAL","notNull":false,"unique":false,"default":0},"currency":{"type":"TEXT","notNull":false,"unique":false},"effective_from":{"type":"TIMESTAMP","notNull":false,"unique":false},"effective_to":{"type":"TIMESTAMP","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"terms":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_compensation_plans_tenant_id_specialist_id_idx","columns":["tenant_id","specialist_id","effective_from"],"unique":true,"nullsNotDistinct":true},{"name":"support_compensation_plans_slug_context_idx","columns":["slug","context"]},{"name":"support_compensation_plans_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_compensation_plans_specialist_id_idx","columns":["specialist_id"]}],"version":"1c6b40cd"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportInteraction":{"name":"supportinteraction","className":"SupportInteraction","qualifiedName":"@happyvertical/smrt-support:SupportInteraction","collection":"supportinteractions","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-interaction.ts","packageName":"@happyvertical/smrt-support","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}}},"caseId":{"type":"foreignKey","required":true,"related":"SupportCase","description":"The ticket this message belongs to.","_meta":{"description":"The ticket this message belongs to.","required":true}},"direction":{"type":"text","required":false,"description":"Whether the customer sent it or your team did.","_meta":{"description":"Whether the customer sent it or your team did."},"enum":["inbound","outbound","internal"]},"channelKind":{"type":"text","required":false,"_meta":{},"enum":["chat","email","phone","voice","web","api"]},"actorKind":{"type":"text","required":false,"_meta":{},"enum":["client","specialist","agent","system"]},"authorProfileId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-profiles:Profile","_meta":{"nullable":true}},"occurredAt":{"type":"datetime","required":false,"description":"When the message was sent.","_meta":{"description":"When the message was sent."}},"body":{"type":"text","required":false,"description":"What the message says.","_meta":{"description":"What the message says."}},"sourceType":{"type":"text","required":false,"_meta":{"nullable":true}},"sourceId":{"type":"text","required":false,"_meta":{"nullable":true}},"sourceKey":{"type":"text","required":false,"_meta":{}},"rfcMessageId":{"type":"text","required":false,"_meta":{}},"metadata":{"type":"text","required":false,"_meta":{}}},"methods":{"getMetadata":{"name":"getMetadata","async":false,"parameters":[],"returnType":"Record<string, unknown>","isStatic":false,"isPublic":true},"setMetadata":{"name":"setMetadata","async":false,"parameters":[{"name":"value","type":"Record<string, unknown>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_interactions","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"conflictColumns":["source_key"],"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"SupportInteraction","collectionExportName":"SupportInteractionCollection","validationRules":[{"field":"caseId","rule":"required","fieldType":"foreignKey"}],"schema":{"tableName":"support_interactions","ddl":"CREATE TABLE IF NOT EXISTS \\"support_interactions\\" (\\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 \\"case_id\\" UUID NOT NULL,\\n \\"direction\\" TEXT,\\n \\"channel_kind\\" TEXT,\\n \\"actor_kind\\" TEXT,\\n \\"author_profile_id\\" UUID,\\n \\"occurred_at\\" TIMESTAMP,\\n \\"body\\" TEXT,\\n \\"source_type\\" TEXT,\\n \\"source_id\\" TEXT,\\n \\"source_key\\" TEXT,\\n \\"rfc_message_id\\" TEXT,\\n \\"metadata\\" 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":false,"unique":false},"case_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"support_cases","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"direction":{"type":"TEXT","notNull":false,"unique":false},"channel_kind":{"type":"TEXT","notNull":false,"unique":false},"actor_kind":{"type":"TEXT","notNull":false,"unique":false},"author_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"occurred_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"body":{"type":"TEXT","notNull":false,"unique":false},"source_type":{"type":"TEXT","notNull":false,"unique":false},"source_id":{"type":"TEXT","notNull":false,"unique":false},"source_key":{"type":"TEXT","notNull":false,"unique":false},"rfc_message_id":{"type":"TEXT","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_interactions_source_key_idx","columns":["source_key"],"unique":true,"nullsNotDistinct":true},{"name":"support_interactions_slug_context_idx","columns":["slug","context"]},{"name":"support_interactions_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_interactions_case_id_idx","columns":["case_id"]},{"name":"support_interactions_author_profile_id_idx","columns":["author_profile_id"]}],"version":"83ae00a1"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportInteractionCollection":{"name":"supportinteractioncollection","className":"SupportInteractionCollection","qualifiedName":"@happyvertical/smrt-support:SupportInteractionCollection","collection":"supportinteractions","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-interaction.ts","packageName":"@happyvertical/smrt-support","fields":{},"methods":{"forCase":{"name":"forCase","async":true,"parameters":[{"name":"caseId","type":"string","optional":false}],"returnType":"Promise<SupportInteraction[]>","isStatic":false,"isPublic":true},"bySourceKey":{"name":"bySourceKey","async":true,"parameters":[{"name":"sourceKey","type":"string","optional":false}],"returnType":"Promise<SupportInteraction | null>","isStatic":false,"isPublic":true},"byRfcMessageId":{"name":"byRfcMessageId","async":true,"parameters":[{"name":"rfcMessageId","type":"string","optional":false}],"returnType":"Promise<SupportInteraction | null>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_interactions","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SupportInteraction","exportName":"SupportInteractionCollection","collectionExportName":"SupportInteractionCollectionCollection","collectionOf":"@happyvertical/smrt-support:SupportInteraction","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"support_interactions","ddl":"CREATE TABLE IF NOT EXISTS \\"support_interactions\\" (\\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 \\"case_id\\" UUID NOT NULL,\\n \\"direction\\" TEXT,\\n \\"channel_kind\\" TEXT,\\n \\"actor_kind\\" TEXT,\\n \\"author_profile_id\\" UUID,\\n \\"occurred_at\\" TIMESTAMP,\\n \\"body\\" TEXT,\\n \\"source_type\\" TEXT,\\n \\"source_id\\" TEXT,\\n \\"source_key\\" TEXT,\\n \\"rfc_message_id\\" TEXT,\\n \\"metadata\\" 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":false,"unique":false},"case_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"support_cases","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"direction":{"type":"TEXT","notNull":false,"unique":false},"channel_kind":{"type":"TEXT","notNull":false,"unique":false},"actor_kind":{"type":"TEXT","notNull":false,"unique":false},"author_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"occurred_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"body":{"type":"TEXT","notNull":false,"unique":false},"source_type":{"type":"TEXT","notNull":false,"unique":false},"source_id":{"type":"TEXT","notNull":false,"unique":false},"source_key":{"type":"TEXT","notNull":false,"unique":false},"rfc_message_id":{"type":"TEXT","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_interactions_source_key_idx","columns":["source_key"],"unique":true,"nullsNotDistinct":true},{"name":"support_interactions_slug_context_idx","columns":["slug","context"]},{"name":"support_interactions_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_interactions_case_id_idx","columns":["case_id"]},{"name":"support_interactions_author_profile_id_idx","columns":["author_profile_id"]}],"version":"83ae00a1"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportPlan":{"name":"supportplan","className":"SupportPlan","qualifiedName":"@happyvertical/smrt-support:SupportPlan","collection":"supportplans","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-plan.ts","packageName":"@happyvertical/smrt-support","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}}},"planKey":{"type":"text","required":false,"_meta":{}},"name":{"type":"text","required":false,"default":""},"description":{"type":"text","required":false,"_meta":{}},"status":{"type":"text","required":false,"_meta":{}},"channels":{"type":"text","required":false,"_meta":{}},"timezone":{"type":"text","required":false,"_meta":{}},"coverage":{"type":"text","required":false,"_meta":{}},"holidays":{"type":"text","required":false,"_meta":{}},"severityDefinitions":{"type":"text","required":false,"_meta":{}},"targets":{"type":"text","required":false,"_meta":{}},"pauseStatuses":{"type":"text","required":false,"_meta":{}},"escalationPolicy":{"type":"text","required":false,"_meta":{}},"availabilityFeeAmount":{"type":"integer","required":false,"default":0},"currency":{"type":"text","required":false,"_meta":{}},"includedMinutes":{"type":"integer","required":false,"default":0},"overageHourlyRate":{"type":"decimal","required":false,"default":0},"onCallHourlyRate":{"type":"decimal","required":false,"default":0},"timeApprovalPolicy":{"type":"text","required":false,"_meta":{}},"subscriptionPlanKey":{"type":"text","required":false,"_meta":{}},"metadata":{"type":"text","required":false,"_meta":{}}},"methods":{"getChannels":{"name":"getChannels","async":false,"parameters":[],"returnType":"string[]","isStatic":false,"isPublic":true},"setChannels":{"name":"setChannels","async":false,"parameters":[{"name":"channels","type":"string[]","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"getCoverage":{"name":"getCoverage","async":false,"parameters":[],"returnType":"CoverageWindow[]","isStatic":false,"isPublic":true},"setCoverage":{"name":"setCoverage","async":false,"parameters":[{"name":"windows","type":"CoverageWindow[]","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"getHolidays":{"name":"getHolidays","async":false,"parameters":[],"returnType":"string[]","isStatic":false,"isPublic":true},"setHolidays":{"name":"setHolidays","async":false,"parameters":[{"name":"dates","type":"string[]","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"getSeverityDefinitions":{"name":"getSeverityDefinitions","async":false,"parameters":[],"returnType":"Record<string, SeverityDefinition>","isStatic":false,"isPublic":true},"setSeverityDefinitions":{"name":"setSeverityDefinitions","async":false,"parameters":[{"name":"defs","type":"Record<string, SeverityDefinition>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"getTargets":{"name":"getTargets","async":false,"parameters":[],"returnType":"Record<string, Partial<ServiceTargetMinutes>>","isStatic":false,"isPublic":true},"setTargets":{"name":"setTargets","async":false,"parameters":[{"name":"targets","type":"Record<string, Partial<ServiceTargetMinutes>>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"targetsForSeverity":{"name":"targetsForSeverity","async":false,"parameters":[{"name":"severity","type":"string","optional":false}],"returnType":"ServiceTargetMinutes","isStatic":false,"isPublic":true},"getPauseStatuses":{"name":"getPauseStatuses","async":false,"parameters":[],"returnType":"string[]","isStatic":false,"isPublic":true},"setPauseStatuses":{"name":"setPauseStatuses","async":false,"parameters":[{"name":"statuses","type":"string[]","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"getEscalationPolicy":{"name":"getEscalationPolicy","async":false,"parameters":[],"returnType":"EscalationStep[]","isStatic":false,"isPublic":true},"setEscalationPolicy":{"name":"setEscalationPolicy","async":false,"parameters":[{"name":"steps","type":"EscalationStep[]","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"getTimeApprovalPolicy":{"name":"getTimeApprovalPolicy","async":false,"parameters":[],"returnType":"TimeApprovalPolicy","isStatic":false,"isPublic":true},"setTimeApprovalPolicy":{"name":"setTimeApprovalPolicy","async":false,"parameters":[{"name":"policy","type":"TimeApprovalPolicy","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"getMetadata":{"name":"getMetadata","async":false,"parameters":[],"returnType":"Record<string, unknown>","isStatic":false,"isPublic":true},"setMetadata":{"name":"setMetadata","async":false,"parameters":[{"name":"value","type":"Record<string, unknown>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"snapshotTerms":{"name":"snapshotTerms","async":false,"parameters":[],"returnType":"Record<string, unknown>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_plans","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"conflictColumns":["tenant_id","plan_key"],"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"SupportPlan","collectionExportName":"SupportPlanCollection","displayLabelField":"name","schema":{"tableName":"support_plans","ddl":"CREATE TABLE IF NOT EXISTS \\"support_plans\\" (\\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 \\"plan_key\\" TEXT,\\n \\"name\\" TEXT DEFAULT '',\\n \\"description\\" TEXT,\\n \\"status\\" TEXT,\\n \\"channels\\" TEXT,\\n \\"timezone\\" TEXT,\\n \\"coverage\\" TEXT,\\n \\"holidays\\" TEXT,\\n \\"severity_definitions\\" TEXT,\\n \\"targets\\" TEXT,\\n \\"pause_statuses\\" TEXT,\\n \\"escalation_policy\\" TEXT,\\n \\"availability_fee_amount\\" INTEGER DEFAULT 0,\\n \\"currency\\" TEXT,\\n \\"included_minutes\\" INTEGER DEFAULT 0,\\n \\"overage_hourly_rate\\" REAL DEFAULT 0,\\n \\"on_call_hourly_rate\\" REAL DEFAULT 0,\\n \\"time_approval_policy\\" TEXT,\\n \\"subscription_plan_key\\" TEXT,\\n \\"metadata\\" 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":false,"unique":false},"plan_key":{"type":"TEXT","notNull":false,"unique":false},"name":{"type":"TEXT","notNull":false,"unique":false,"default":""},"description":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"channels":{"type":"TEXT","notNull":false,"unique":false},"timezone":{"type":"TEXT","notNull":false,"unique":false},"coverage":{"type":"TEXT","notNull":false,"unique":false},"holidays":{"type":"TEXT","notNull":false,"unique":false},"severity_definitions":{"type":"TEXT","notNull":false,"unique":false},"targets":{"type":"TEXT","notNull":false,"unique":false},"pause_statuses":{"type":"TEXT","notNull":false,"unique":false},"escalation_policy":{"type":"TEXT","notNull":false,"unique":false},"availability_fee_amount":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"currency":{"type":"TEXT","notNull":false,"unique":false},"included_minutes":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"overage_hourly_rate":{"type":"REAL","notNull":false,"unique":false,"default":0},"on_call_hourly_rate":{"type":"REAL","notNull":false,"unique":false,"default":0},"time_approval_policy":{"type":"TEXT","notNull":false,"unique":false},"subscription_plan_key":{"type":"TEXT","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_plans_tenant_id_plan_key_idx","columns":["tenant_id","plan_key"],"unique":true,"nullsNotDistinct":true},{"name":"support_plans_slug_context_idx","columns":["slug","context"]},{"name":"support_plans_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"492a9cf6"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportPlanCollection":{"name":"supportplancollection","className":"SupportPlanCollection","qualifiedName":"@happyvertical/smrt-support:SupportPlanCollection","collection":"supportplans","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-plan.ts","packageName":"@happyvertical/smrt-support","fields":{},"methods":{"byPlanKey":{"name":"byPlanKey","async":true,"parameters":[{"name":"planKey","type":"string","optional":false}],"returnType":"Promise<SupportPlan | null>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_plans","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SupportPlan","exportName":"SupportPlanCollection","collectionExportName":"SupportPlanCollectionCollection","collectionOf":"@happyvertical/smrt-support:SupportPlan","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"support_plans","ddl":"CREATE TABLE IF NOT EXISTS \\"support_plans\\" (\\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 \\"plan_key\\" TEXT,\\n \\"name\\" TEXT DEFAULT '',\\n \\"description\\" TEXT,\\n \\"status\\" TEXT,\\n \\"channels\\" TEXT,\\n \\"timezone\\" TEXT,\\n \\"coverage\\" TEXT,\\n \\"holidays\\" TEXT,\\n \\"severity_definitions\\" TEXT,\\n \\"targets\\" TEXT,\\n \\"pause_statuses\\" TEXT,\\n \\"escalation_policy\\" TEXT,\\n \\"availability_fee_amount\\" INTEGER DEFAULT 0,\\n \\"currency\\" TEXT,\\n \\"included_minutes\\" INTEGER DEFAULT 0,\\n \\"overage_hourly_rate\\" REAL DEFAULT 0,\\n \\"on_call_hourly_rate\\" REAL DEFAULT 0,\\n \\"time_approval_policy\\" TEXT,\\n \\"subscription_plan_key\\" TEXT,\\n \\"metadata\\" 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":false,"unique":false},"plan_key":{"type":"TEXT","notNull":false,"unique":false},"name":{"type":"TEXT","notNull":false,"unique":false,"default":""},"description":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"channels":{"type":"TEXT","notNull":false,"unique":false},"timezone":{"type":"TEXT","notNull":false,"unique":false},"coverage":{"type":"TEXT","notNull":false,"unique":false},"holidays":{"type":"TEXT","notNull":false,"unique":false},"severity_definitions":{"type":"TEXT","notNull":false,"unique":false},"targets":{"type":"TEXT","notNull":false,"unique":false},"pause_statuses":{"type":"TEXT","notNull":false,"unique":false},"escalation_policy":{"type":"TEXT","notNull":false,"unique":false},"availability_fee_amount":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"currency":{"type":"TEXT","notNull":false,"unique":false},"included_minutes":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"overage_hourly_rate":{"type":"REAL","notNull":false,"unique":false,"default":0},"on_call_hourly_rate":{"type":"REAL","notNull":false,"unique":false,"default":0},"time_approval_policy":{"type":"TEXT","notNull":false,"unique":false},"subscription_plan_key":{"type":"TEXT","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_plans_tenant_id_plan_key_idx","columns":["tenant_id","plan_key"],"unique":true,"nullsNotDistinct":true},{"name":"support_plans_slug_context_idx","columns":["slug","context"]},{"name":"support_plans_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"492a9cf6"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportPolicy":{"name":"supportpolicy","className":"SupportPolicy","qualifiedName":"@happyvertical/smrt-support:SupportPolicy","collection":"supportpolicies","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-policy.ts","packageName":"@happyvertical/smrt-support","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}}},"name":{"type":"text","required":false,"default":""},"planId":{"type":"foreignKey","required":false,"related":"SupportPlan"},"projectId":{"type":"text","required":false,"_meta":{"nullable":true}},"enabled":{"type":"boolean","required":false,"_meta":{}},"autoAcknowledge":{"type":"boolean","required":false,"_meta":{}},"autoClassify":{"type":"boolean","required":false,"_meta":{}},"autoAnswer":{"type":"boolean","required":false,"_meta":{}},"autoTroubleshoot":{"type":"boolean","required":false,"_meta":{}},"autoResolve":{"type":"boolean","required":false,"_meta":{}},"autoResolveMaxSeverity":{"type":"text","required":false,"_meta":{}},"confidenceThreshold":{"type":"decimal","required":false,"default":0.7},"maxAutoAttempts":{"type":"integer","required":false,"default":1},"autoSendEmailReplies":{"type":"boolean","required":false,"_meta":{}},"sensitiveCategories":{"type":"text","required":false,"_meta":{}},"allowedCategories":{"type":"text","required":false,"_meta":{}},"allowedTools":{"type":"text","required":false,"_meta":{}},"metadata":{"type":"text","required":false,"_meta":{}}},"methods":{"getSensitiveCategories":{"name":"getSensitiveCategories","async":false,"parameters":[],"returnType":"string[]","isStatic":false,"isPublic":true},"setSensitiveCategories":{"name":"setSensitiveCategories","async":false,"parameters":[{"name":"categories","type":"string[]","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"getAllowedCategories":{"name":"getAllowedCategories","async":false,"parameters":[],"returnType":"string[]","isStatic":false,"isPublic":true},"setAllowedCategories":{"name":"setAllowedCategories","async":false,"parameters":[{"name":"categories","type":"string[]","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"getAllowedTools":{"name":"getAllowedTools","async":false,"parameters":[],"returnType":"string[]","isStatic":false,"isPublic":true},"setAllowedTools":{"name":"setAllowedTools","async":false,"parameters":[{"name":"tools","type":"string[]","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"getMetadata":{"name":"getMetadata","async":false,"parameters":[],"returnType":"Record<string, unknown>","isStatic":false,"isPublic":true},"setMetadata":{"name":"setMetadata","async":false,"parameters":[{"name":"value","type":"Record<string, unknown>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"scopeRank":{"name":"scopeRank","async":false,"parameters":[],"returnType":"number","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_policies","api":{"include":["list","get","create","update","delete"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"conflictColumns":["tenant_id","name"],"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"SupportPolicy","collectionExportName":"SupportPolicyCollection","displayLabelField":"name","schema":{"tableName":"support_policies","ddl":"CREATE TABLE IF NOT EXISTS \\"support_policies\\" (\\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 \\"name\\" TEXT DEFAULT '',\\n \\"plan_id\\" UUID,\\n \\"project_id\\" TEXT,\\n \\"enabled\\" BOOLEAN,\\n \\"auto_acknowledge\\" BOOLEAN,\\n \\"auto_classify\\" BOOLEAN,\\n \\"auto_answer\\" BOOLEAN,\\n \\"auto_troubleshoot\\" BOOLEAN,\\n \\"auto_resolve\\" BOOLEAN,\\n \\"auto_resolve_max_severity\\" TEXT,\\n \\"confidence_threshold\\" REAL DEFAULT 0.7,\\n \\"max_auto_attempts\\" INTEGER DEFAULT 1,\\n \\"auto_send_email_replies\\" BOOLEAN,\\n \\"sensitive_categories\\" TEXT,\\n \\"allowed_categories\\" TEXT,\\n \\"allowed_tools\\" TEXT,\\n \\"metadata\\" 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":false,"unique":false},"name":{"type":"TEXT","notNull":false,"unique":false,"default":""},"plan_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_plans","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"project_id":{"type":"TEXT","notNull":false,"unique":false},"enabled":{"type":"BOOLEAN","notNull":false,"unique":false},"auto_acknowledge":{"type":"BOOLEAN","notNull":false,"unique":false},"auto_classify":{"type":"BOOLEAN","notNull":false,"unique":false},"auto_answer":{"type":"BOOLEAN","notNull":false,"unique":false},"auto_troubleshoot":{"type":"BOOLEAN","notNull":false,"unique":false},"auto_resolve":{"type":"BOOLEAN","notNull":false,"unique":false},"auto_resolve_max_severity":{"type":"TEXT","notNull":false,"unique":false},"confidence_threshold":{"type":"REAL","notNull":false,"unique":false,"default":0.7},"max_auto_attempts":{"type":"INTEGER","notNull":false,"unique":false,"default":1},"auto_send_email_replies":{"type":"BOOLEAN","notNull":false,"unique":false},"sensitive_categories":{"type":"TEXT","notNull":false,"unique":false},"allowed_categories":{"type":"TEXT","notNull":false,"unique":false},"allowed_tools":{"type":"TEXT","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_policies_tenant_id_name_idx","columns":["tenant_id","name"],"unique":true,"nullsNotDistinct":true},{"name":"support_policies_slug_context_idx","columns":["slug","context"]},{"name":"support_policies_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_policies_plan_id_idx","columns":["plan_id"]}],"version":"db53199e"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportPolicyCollection":{"name":"supportpolicycollection","className":"SupportPolicyCollection","qualifiedName":"@happyvertical/smrt-support:SupportPolicyCollection","collection":"supportpolicies","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-policy.ts","packageName":"@happyvertical/smrt-support","fields":{},"methods":{"resolveForScope":{"name":"resolveForScope","async":true,"parameters":[{"name":"options","type":"object","optional":false,"memberTypes":["string | null"]}],"returnType":"Promise<SupportPolicy | null>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_policies","api":{"include":["list","get","create","update","delete"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SupportPolicy","exportName":"SupportPolicyCollection","collectionExportName":"SupportPolicyCollectionCollection","collectionOf":"@happyvertical/smrt-support:SupportPolicy","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"support_policies","ddl":"CREATE TABLE IF NOT EXISTS \\"support_policies\\" (\\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 \\"name\\" TEXT DEFAULT '',\\n \\"plan_id\\" UUID,\\n \\"project_id\\" TEXT,\\n \\"enabled\\" BOOLEAN,\\n \\"auto_acknowledge\\" BOOLEAN,\\n \\"auto_classify\\" BOOLEAN,\\n \\"auto_answer\\" BOOLEAN,\\n \\"auto_troubleshoot\\" BOOLEAN,\\n \\"auto_resolve\\" BOOLEAN,\\n \\"auto_resolve_max_severity\\" TEXT,\\n \\"confidence_threshold\\" REAL DEFAULT 0.7,\\n \\"max_auto_attempts\\" INTEGER DEFAULT 1,\\n \\"auto_send_email_replies\\" BOOLEAN,\\n \\"sensitive_categories\\" TEXT,\\n \\"allowed_categories\\" TEXT,\\n \\"allowed_tools\\" TEXT,\\n \\"metadata\\" 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":false,"unique":false},"name":{"type":"TEXT","notNull":false,"unique":false,"default":""},"plan_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_plans","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"project_id":{"type":"TEXT","notNull":false,"unique":false},"enabled":{"type":"BOOLEAN","notNull":false,"unique":false},"auto_acknowledge":{"type":"BOOLEAN","notNull":false,"unique":false},"auto_classify":{"type":"BOOLEAN","notNull":false,"unique":false},"auto_answer":{"type":"BOOLEAN","notNull":false,"unique":false},"auto_troubleshoot":{"type":"BOOLEAN","notNull":false,"unique":false},"auto_resolve":{"type":"BOOLEAN","notNull":false,"unique":false},"auto_resolve_max_severity":{"type":"TEXT","notNull":false,"unique":false},"confidence_threshold":{"type":"REAL","notNull":false,"unique":false,"default":0.7},"max_auto_attempts":{"type":"INTEGER","notNull":false,"unique":false,"default":1},"auto_send_email_replies":{"type":"BOOLEAN","notNull":false,"unique":false},"sensitive_categories":{"type":"TEXT","notNull":false,"unique":false},"allowed_categories":{"type":"TEXT","notNull":false,"unique":false},"allowed_tools":{"type":"TEXT","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_policies_tenant_id_name_idx","columns":["tenant_id","name"],"unique":true,"nullsNotDistinct":true},{"name":"support_policies_slug_context_idx","columns":["slug","context"]},{"name":"support_policies_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_policies_plan_id_idx","columns":["plan_id"]}],"version":"db53199e"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportServiceTarget":{"name":"supportservicetarget","className":"SupportServiceTarget","qualifiedName":"@happyvertical/smrt-support:SupportServiceTarget","collection":"supportservicetargets","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-service-target.ts","packageName":"@happyvertical/smrt-support","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}}},"caseId":{"type":"foreignKey","required":true,"related":"SupportCase","_meta":{"required":true}},"targetType":{"type":"text","required":false,"_meta":{},"enum":["acknowledgement","response","update","resolution"]},"cycle":{"type":"integer","required":false,"default":0},"severity":{"type":"text","required":false,"_meta":{}},"baseMinutes":{"type":"integer","required":false,"default":0},"startedAt":{"type":"datetime","required":false},"dueAt":{"type":"datetime","required":false},"status":{"type":"text","required":false,"_meta":{},"enum":["pending","paused","satisfied","breached","cancelled"]},"pausedAt":{"type":"datetime","required":false},"pausedTotalSeconds":{"type":"integer","required":false,"default":0},"satisfiedAt":{"type":"datetime","required":false},"breachedAt":{"type":"datetime","required":false},"cancelledAt":{"type":"datetime","required":false},"escalationJobId":{"type":"text","required":false,"_meta":{}},"metadata":{"type":"text","required":false,"_meta":{}}},"methods":{"getMetadata":{"name":"getMetadata","async":false,"parameters":[],"returnType":"Record<string, unknown>","isStatic":false,"isPublic":true},"setMetadata":{"name":"setMetadata","async":false,"parameters":[{"name":"value","type":"Record<string, unknown>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"isRunning":{"name":"isRunning","async":false,"parameters":[],"returnType":"boolean","isStatic":false,"isPublic":true},"checkAndEscalate":{"name":"checkAndEscalate","async":true,"parameters":[{"name":"args","type":"Record<string, unknown>","optional":true},{"name":"_context","type":"unknown","optional":true}],"returnType":"Promise<CheckAndEscalateResult>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_service_targets","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"conflictColumns":["case_id","target_type","cycle"],"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"SupportServiceTarget","collectionExportName":"SupportServiceTargetCollection","validationRules":[{"field":"caseId","rule":"required","fieldType":"foreignKey"}],"schema":{"tableName":"support_service_targets","ddl":"CREATE TABLE IF NOT EXISTS \\"support_service_targets\\" (\\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 \\"case_id\\" UUID NOT NULL,\\n \\"target_type\\" TEXT,\\n \\"cycle\\" INTEGER DEFAULT 0,\\n \\"severity\\" TEXT,\\n \\"base_minutes\\" INTEGER DEFAULT 0,\\n \\"started_at\\" TIMESTAMP,\\n \\"due_at\\" TIMESTAMP,\\n \\"status\\" TEXT,\\n \\"paused_at\\" TIMESTAMP,\\n \\"paused_total_seconds\\" INTEGER DEFAULT 0,\\n \\"satisfied_at\\" TIMESTAMP,\\n \\"breached_at\\" TIMESTAMP,\\n \\"cancelled_at\\" TIMESTAMP,\\n \\"escalation_job_id\\" TEXT,\\n \\"metadata\\" 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":false,"unique":false},"case_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"support_cases","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"target_type":{"type":"TEXT","notNull":false,"unique":false},"cycle":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"severity":{"type":"TEXT","notNull":false,"unique":false},"base_minutes":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"started_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"due_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"paused_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"paused_total_seconds":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"satisfied_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"breached_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"cancelled_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"escalation_job_id":{"type":"TEXT","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_service_targets_case_id_target_type_idx","columns":["case_id","target_type","cycle"],"unique":true,"nullsNotDistinct":true},{"name":"support_service_targets_slug_context_idx","columns":["slug","context"]},{"name":"support_service_targets_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"40614be1"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportServiceTargetCollection":{"name":"supportservicetargetcollection","className":"SupportServiceTargetCollection","qualifiedName":"@happyvertical/smrt-support:SupportServiceTargetCollection","collection":"supportservicetargets","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-service-target.ts","packageName":"@happyvertical/smrt-support","fields":{},"methods":{"forCase":{"name":"forCase","async":true,"parameters":[{"name":"caseId","type":"string","optional":false}],"returnType":"Promise<SupportServiceTarget[]>","isStatic":false,"isPublic":true},"activeTarget":{"name":"activeTarget","async":true,"parameters":[{"name":"caseId","type":"string","optional":false},{"name":"targetType","type":"ServiceTargetType","optional":false}],"returnType":"Promise<SupportServiceTarget | null>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_service_targets","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SupportServiceTarget","exportName":"SupportServiceTargetCollection","collectionExportName":"SupportServiceTargetCollectionCollection","collectionOf":"@happyvertical/smrt-support:SupportServiceTarget","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"support_service_targets","ddl":"CREATE TABLE IF NOT EXISTS \\"support_service_targets\\" (\\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 \\"case_id\\" UUID NOT NULL,\\n \\"target_type\\" TEXT,\\n \\"cycle\\" INTEGER DEFAULT 0,\\n \\"severity\\" TEXT,\\n \\"base_minutes\\" INTEGER DEFAULT 0,\\n \\"started_at\\" TIMESTAMP,\\n \\"due_at\\" TIMESTAMP,\\n \\"status\\" TEXT,\\n \\"paused_at\\" TIMESTAMP,\\n \\"paused_total_seconds\\" INTEGER DEFAULT 0,\\n \\"satisfied_at\\" TIMESTAMP,\\n \\"breached_at\\" TIMESTAMP,\\n \\"cancelled_at\\" TIMESTAMP,\\n \\"escalation_job_id\\" TEXT,\\n \\"metadata\\" 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":false,"unique":false},"case_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"support_cases","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"target_type":{"type":"TEXT","notNull":false,"unique":false},"cycle":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"severity":{"type":"TEXT","notNull":false,"unique":false},"base_minutes":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"started_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"due_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"paused_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"paused_total_seconds":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"satisfied_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"breached_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"cancelled_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"escalation_job_id":{"type":"TEXT","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_service_targets_case_id_target_type_idx","columns":["case_id","target_type","cycle"],"unique":true,"nullsNotDistinct":true},{"name":"support_service_targets_slug_context_idx","columns":["slug","context"]},{"name":"support_service_targets_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"40614be1"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportEscalation":{"name":"supportescalation","className":"SupportEscalation","qualifiedName":"@happyvertical/smrt-support:SupportEscalation","collection":"supportescalations","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-service-target.ts","packageName":"@happyvertical/smrt-support","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}}},"caseId":{"type":"foreignKey","required":true,"related":"SupportCase","_meta":{"required":true}},"level":{"type":"integer","required":false,"default":1},"reason":{"type":"text","required":false,"_meta":{},"enum":["target_breach","target_risk","manual","ai_trigger"]},"targetId":{"type":"foreignKey","required":false,"related":"SupportServiceTarget"},"targetType":{"type":"text","required":false,"_meta":{}},"action":{"type":"text","required":false,"_meta":{}},"fromSpecialistId":{"type":"foreignKey","required":false,"related":"SupportSpecialist"},"toSpecialistId":{"type":"foreignKey","required":false,"related":"SupportSpecialist"},"notifiedProfileIds":{"type":"text","required":false,"_meta":{}},"occurredAt":{"type":"datetime","required":false},"note":{"type":"text","required":false,"_meta":{}}},"methods":{"getNotifiedProfileIds":{"name":"getNotifiedProfileIds","async":false,"parameters":[],"returnType":"string[]","isStatic":false,"isPublic":true},"setNotifiedProfileIds":{"name":"setNotifiedProfileIds","async":false,"parameters":[{"name":"ids","type":"string[]","optional":false}],"returnType":"void","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_escalations","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"SupportEscalation","collectionExportName":"SupportEscalationCollection","validationRules":[{"field":"caseId","rule":"required","fieldType":"foreignKey"}],"schema":{"tableName":"support_escalations","ddl":"CREATE TABLE IF NOT EXISTS \\"support_escalations\\" (\\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 \\"case_id\\" UUID NOT NULL,\\n \\"level\\" INTEGER DEFAULT 1,\\n \\"reason\\" TEXT,\\n \\"target_id\\" UUID,\\n \\"target_type\\" TEXT,\\n \\"action\\" TEXT,\\n \\"from_specialist_id\\" UUID,\\n \\"to_specialist_id\\" UUID,\\n \\"notified_profile_ids\\" TEXT,\\n \\"occurred_at\\" TIMESTAMP,\\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":false,"unique":false},"case_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"support_cases","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"level":{"type":"INTEGER","notNull":false,"unique":false,"default":1},"reason":{"type":"TEXT","notNull":false,"unique":false},"target_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_service_targets","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"target_type":{"type":"TEXT","notNull":false,"unique":false},"action":{"type":"TEXT","notNull":false,"unique":false},"from_specialist_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_specialists","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"to_specialist_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_specialists","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"notified_profile_ids":{"type":"TEXT","notNull":false,"unique":false},"occurred_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"note":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_escalations_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"support_escalations_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_escalations_case_id_idx","columns":["case_id"]},{"name":"support_escalations_target_id_idx","columns":["target_id"]},{"name":"support_escalations_from_specialist_id_idx","columns":["from_specialist_id"]},{"name":"support_escalations_to_specialist_id_idx","columns":["to_specialist_id"]}],"version":"493f2a61"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportEscalationCollection":{"name":"supportescalationcollection","className":"SupportEscalationCollection","qualifiedName":"@happyvertical/smrt-support:SupportEscalationCollection","collection":"supportescalations","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-service-target.ts","packageName":"@happyvertical/smrt-support","fields":{},"methods":{"forCase":{"name":"forCase","async":true,"parameters":[{"name":"caseId","type":"string","optional":false}],"returnType":"Promise<SupportEscalation[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_escalations","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SupportEscalation","exportName":"SupportEscalationCollection","collectionExportName":"SupportEscalationCollectionCollection","collectionOf":"@happyvertical/smrt-support:SupportEscalation","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"support_escalations","ddl":"CREATE TABLE IF NOT EXISTS \\"support_escalations\\" (\\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 \\"case_id\\" UUID NOT NULL,\\n \\"level\\" INTEGER DEFAULT 1,\\n \\"reason\\" TEXT,\\n \\"target_id\\" UUID,\\n \\"target_type\\" TEXT,\\n \\"action\\" TEXT,\\n \\"from_specialist_id\\" UUID,\\n \\"to_specialist_id\\" UUID,\\n \\"notified_profile_ids\\" TEXT,\\n \\"occurred_at\\" TIMESTAMP,\\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":false,"unique":false},"case_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"support_cases","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"level":{"type":"INTEGER","notNull":false,"unique":false,"default":1},"reason":{"type":"TEXT","notNull":false,"unique":false},"target_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_service_targets","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"target_type":{"type":"TEXT","notNull":false,"unique":false},"action":{"type":"TEXT","notNull":false,"unique":false},"from_specialist_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_specialists","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"to_specialist_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_specialists","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"notified_profile_ids":{"type":"TEXT","notNull":false,"unique":false},"occurred_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"note":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_escalations_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"support_escalations_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_escalations_case_id_idx","columns":["case_id"]},{"name":"support_escalations_target_id_idx","columns":["target_id"]},{"name":"support_escalations_from_specialist_id_idx","columns":["from_specialist_id"]},{"name":"support_escalations_to_specialist_id_idx","columns":["to_specialist_id"]}],"version":"493f2a61"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportCharge":{"name":"supportcharge","className":"SupportCharge","qualifiedName":"@happyvertical/smrt-support:SupportCharge","collection":"supportcharges","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-settlement.ts","packageName":"@happyvertical/smrt-support","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}}},"timeEntryId":{"type":"foreignKey","required":true,"related":"ServiceTimeEntry","_meta":{"required":true}},"caseId":{"type":"foreignKey","required":false,"related":"SupportCase"},"planId":{"type":"foreignKey","required":false,"related":"SupportPlan"},"amount":{"type":"integer","required":false,"default":0},"currency":{"type":"text","required":false,"_meta":{}},"billableSeconds":{"type":"integer","required":false,"default":0},"includedSecondsApplied":{"type":"integer","required":false,"default":0},"rateSnapshot":{"type":"text","required":false,"_meta":{}},"status":{"type":"text","required":false,"_meta":{},"enum":["pending","final","corrected","voided"]},"finalizedAt":{"type":"datetime","required":false},"metadata":{"type":"text","required":false,"_meta":{}}},"methods":{"getRateSnapshot":{"name":"getRateSnapshot","async":false,"parameters":[],"returnType":"Record<string, unknown>","isStatic":false,"isPublic":true},"setRateSnapshot":{"name":"setRateSnapshot","async":false,"parameters":[{"name":"value","type":"Record<string, unknown>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_charges","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"conflictColumns":["time_entry_id"],"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"SupportCharge","collectionExportName":"SupportChargeCollection","validationRules":[{"field":"timeEntryId","rule":"required","fieldType":"foreignKey"}],"schema":{"tableName":"support_charges","ddl":"CREATE TABLE IF NOT EXISTS \\"support_charges\\" (\\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 \\"time_entry_id\\" UUID NOT NULL,\\n \\"case_id\\" UUID,\\n \\"plan_id\\" UUID,\\n \\"amount\\" INTEGER DEFAULT 0,\\n \\"currency\\" TEXT,\\n \\"billable_seconds\\" INTEGER DEFAULT 0,\\n \\"included_seconds_applied\\" INTEGER DEFAULT 0,\\n \\"rate_snapshot\\" TEXT,\\n \\"status\\" TEXT,\\n \\"finalized_at\\" TIMESTAMP,\\n \\"metadata\\" 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":false,"unique":false},"time_entry_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"service_time_entries","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"case_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_cases","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"plan_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_plans","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"amount":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"currency":{"type":"TEXT","notNull":false,"unique":false},"billable_seconds":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"included_seconds_applied":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"rate_snapshot":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"finalized_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_charges_time_entry_id_idx","columns":["time_entry_id"],"unique":true},{"name":"support_charges_slug_context_idx","columns":["slug","context"]},{"name":"support_charges_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_charges_case_id_idx","columns":["case_id"]},{"name":"support_charges_plan_id_idx","columns":["plan_id"]}],"version":"44f149fb"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportChargeCollection":{"name":"supportchargecollection","className":"SupportChargeCollection","qualifiedName":"@happyvertical/smrt-support:SupportChargeCollection","collection":"supportcharges","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-settlement.ts","packageName":"@happyvertical/smrt-support","fields":{},"methods":{"forTimeEntry":{"name":"forTimeEntry","async":true,"parameters":[{"name":"timeEntryId","type":"string","optional":false}],"returnType":"Promise<SupportCharge | null>","isStatic":false,"isPublic":true},"forCase":{"name":"forCase","async":true,"parameters":[{"name":"caseId","type":"string","optional":false}],"returnType":"Promise<SupportCharge[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_charges","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SupportCharge","exportName":"SupportChargeCollection","collectionExportName":"SupportChargeCollectionCollection","collectionOf":"@happyvertical/smrt-support:SupportCharge","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"support_charges","ddl":"CREATE TABLE IF NOT EXISTS \\"support_charges\\" (\\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 \\"time_entry_id\\" UUID NOT NULL,\\n \\"case_id\\" UUID,\\n \\"plan_id\\" UUID,\\n \\"amount\\" INTEGER DEFAULT 0,\\n \\"currency\\" TEXT,\\n \\"billable_seconds\\" INTEGER DEFAULT 0,\\n \\"included_seconds_applied\\" INTEGER DEFAULT 0,\\n \\"rate_snapshot\\" TEXT,\\n \\"status\\" TEXT,\\n \\"finalized_at\\" TIMESTAMP,\\n \\"metadata\\" 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":false,"unique":false},"time_entry_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"service_time_entries","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"case_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_cases","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"plan_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_plans","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"amount":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"currency":{"type":"TEXT","notNull":false,"unique":false},"billable_seconds":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"included_seconds_applied":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"rate_snapshot":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"finalized_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_charges_time_entry_id_idx","columns":["time_entry_id"],"unique":true},{"name":"support_charges_slug_context_idx","columns":["slug","context"]},{"name":"support_charges_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_charges_case_id_idx","columns":["case_id"]},{"name":"support_charges_plan_id_idx","columns":["plan_id"]}],"version":"44f149fb"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportCompensation":{"name":"supportcompensation","className":"SupportCompensation","qualifiedName":"@happyvertical/smrt-support:SupportCompensation","collection":"supportcompensations","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-settlement.ts","packageName":"@happyvertical/smrt-support","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}}},"timeEntryId":{"type":"foreignKey","required":true,"related":"ServiceTimeEntry","_meta":{"required":true}},"specialistId":{"type":"foreignKey","required":false,"related":"SupportSpecialist"},"compensationPlanId":{"type":"foreignKey","required":false,"related":"SupportCompensationPlan"},"amount":{"type":"integer","required":false,"default":0},"currency":{"type":"text","required":false,"_meta":{}},"payableSeconds":{"type":"integer","required":false,"default":0},"rateSnapshot":{"type":"text","required":false,"_meta":{}},"status":{"type":"text","required":false,"_meta":{},"enum":["pending","final","corrected","voided"]},"finalizedAt":{"type":"datetime","required":false},"metadata":{"type":"text","required":false,"_meta":{}}},"methods":{"getRateSnapshot":{"name":"getRateSnapshot","async":false,"parameters":[],"returnType":"Record<string, unknown>","isStatic":false,"isPublic":true},"setRateSnapshot":{"name":"setRateSnapshot","async":false,"parameters":[{"name":"value","type":"Record<string, unknown>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_compensations","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"conflictColumns":["time_entry_id"],"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"SupportCompensation","collectionExportName":"SupportCompensationCollection","validationRules":[{"field":"timeEntryId","rule":"required","fieldType":"foreignKey"}],"schema":{"tableName":"support_compensations","ddl":"CREATE TABLE IF NOT EXISTS \\"support_compensations\\" (\\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 \\"time_entry_id\\" UUID NOT NULL,\\n \\"specialist_id\\" UUID,\\n \\"compensation_plan_id\\" UUID,\\n \\"amount\\" INTEGER DEFAULT 0,\\n \\"currency\\" TEXT,\\n \\"payable_seconds\\" INTEGER DEFAULT 0,\\n \\"rate_snapshot\\" TEXT,\\n \\"status\\" TEXT,\\n \\"finalized_at\\" TIMESTAMP,\\n \\"metadata\\" 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":false,"unique":false},"time_entry_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"service_time_entries","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"specialist_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_specialists","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"compensation_plan_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_compensation_plans","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"amount":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"currency":{"type":"TEXT","notNull":false,"unique":false},"payable_seconds":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"rate_snapshot":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"finalized_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_compensations_time_entry_id_idx","columns":["time_entry_id"],"unique":true},{"name":"support_compensations_slug_context_idx","columns":["slug","context"]},{"name":"support_compensations_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_compensations_specialist_id_idx","columns":["specialist_id"]},{"name":"support_compensations_compensation_plan_id_idx","columns":["compensation_plan_id"]}],"version":"f9de8296"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportCompensationCollection":{"name":"supportcompensationcollection","className":"SupportCompensationCollection","qualifiedName":"@happyvertical/smrt-support:SupportCompensationCollection","collection":"supportcompensations","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-settlement.ts","packageName":"@happyvertical/smrt-support","fields":{},"methods":{"forTimeEntry":{"name":"forTimeEntry","async":true,"parameters":[{"name":"timeEntryId","type":"string","optional":false}],"returnType":"Promise<SupportCompensation | null>","isStatic":false,"isPublic":true},"forSpecialist":{"name":"forSpecialist","async":true,"parameters":[{"name":"specialistId","type":"string","optional":false}],"returnType":"Promise<SupportCompensation[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_compensations","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SupportCompensation","exportName":"SupportCompensationCollection","collectionExportName":"SupportCompensationCollectionCollection","collectionOf":"@happyvertical/smrt-support:SupportCompensation","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"support_compensations","ddl":"CREATE TABLE IF NOT EXISTS \\"support_compensations\\" (\\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 \\"time_entry_id\\" UUID NOT NULL,\\n \\"specialist_id\\" UUID,\\n \\"compensation_plan_id\\" UUID,\\n \\"amount\\" INTEGER DEFAULT 0,\\n \\"currency\\" TEXT,\\n \\"payable_seconds\\" INTEGER DEFAULT 0,\\n \\"rate_snapshot\\" TEXT,\\n \\"status\\" TEXT,\\n \\"finalized_at\\" TIMESTAMP,\\n \\"metadata\\" 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":false,"unique":false},"time_entry_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"service_time_entries","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"specialist_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_specialists","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"compensation_plan_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_compensation_plans","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"amount":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"currency":{"type":"TEXT","notNull":false,"unique":false},"payable_seconds":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"rate_snapshot":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"finalized_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_compensations_time_entry_id_idx","columns":["time_entry_id"],"unique":true},{"name":"support_compensations_slug_context_idx","columns":["slug","context"]},{"name":"support_compensations_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_compensations_specialist_id_idx","columns":["specialist_id"]},{"name":"support_compensations_compensation_plan_id_idx","columns":["compensation_plan_id"]}],"version":"f9de8296"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportSpecialist":{"name":"supportspecialist","className":"SupportSpecialist","qualifiedName":"@happyvertical/smrt-support:SupportSpecialist","collection":"supportspecialists","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-specialist.ts","packageName":"@happyvertical/smrt-support","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}}},"profileId":{"type":"crossPackageRef","required":true,"related":"@happyvertical/smrt-profiles:Profile","description":"The profile of the person on your team.","_meta":{"description":"The profile of the person on your team."}},"displayName":{"type":"text","required":false,"description":"The name your team and customers see.","_meta":{"description":"The name your team and customers see."}},"status":{"type":"text","required":false,"description":"Whether this person is taking tickets right now.","_meta":{"description":"Whether this person is taking tickets right now."},"enum":["active","inactive"]},"languages":{"type":"text","required":false,"_meta":{}},"timezone":{"type":"text","required":false,"_meta":{}},"maxConcurrentCases":{"type":"integer","required":false,"default":10},"onCallPriority":{"type":"integer","required":false,"default":0},"notes":{"type":"text","required":false,"_meta":{}},"metadata":{"type":"text","required":false,"_meta":{}}},"methods":{"getLanguages":{"name":"getLanguages","async":false,"parameters":[],"returnType":"string[]","isStatic":false,"isPublic":true},"setLanguages":{"name":"setLanguages","async":false,"parameters":[{"name":"languages","type":"string[]","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"getMetadata":{"name":"getMetadata","async":false,"parameters":[],"returnType":"Record<string, unknown>","isStatic":false,"isPublic":true},"setMetadata":{"name":"setMetadata","async":false,"parameters":[{"name":"value","type":"Record<string, unknown>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"isActive":{"name":"isActive","async":false,"parameters":[],"returnType":"boolean","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_specialists","api":{"include":["list","get","create","update","delete"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"conflictColumns":["tenant_id","profile_id"],"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"SupportSpecialist","collectionExportName":"SupportSpecialistCollection","validationRules":[{"field":"profileId","rule":"required","fieldType":"crossPackageRef"}],"schema":{"tableName":"support_specialists","ddl":"CREATE TABLE IF NOT EXISTS \\"support_specialists\\" (\\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 \\"profile_id\\" UUID NOT NULL,\\n \\"display_name\\" TEXT,\\n \\"status\\" TEXT,\\n \\"languages\\" TEXT,\\n \\"timezone\\" TEXT,\\n \\"max_concurrent_cases\\" INTEGER DEFAULT 10,\\n \\"on_call_priority\\" INTEGER DEFAULT 0,\\n \\"notes\\" TEXT,\\n \\"metadata\\" 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":false,"unique":false},"profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":true,"unique":false},"display_name":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"languages":{"type":"TEXT","notNull":false,"unique":false},"timezone":{"type":"TEXT","notNull":false,"unique":false},"max_concurrent_cases":{"type":"INTEGER","notNull":false,"unique":false,"default":10},"on_call_priority":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"notes":{"type":"TEXT","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_specialists_tenant_id_profile_id_idx","columns":["tenant_id","profile_id"],"unique":true,"nullsNotDistinct":true},{"name":"support_specialists_slug_context_idx","columns":["slug","context"]},{"name":"support_specialists_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_specialists_profile_id_idx","columns":["profile_id"]}],"version":"ff5305d3"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportSpecialistCollection":{"name":"supportspecialistcollection","className":"SupportSpecialistCollection","qualifiedName":"@happyvertical/smrt-support:SupportSpecialistCollection","collection":"supportspecialists","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-specialist.ts","packageName":"@happyvertical/smrt-support","fields":{},"methods":{"findActive":{"name":"findActive","async":true,"parameters":[],"returnType":"Promise<SupportSpecialist[]>","isStatic":false,"isPublic":true},"byProfile":{"name":"byProfile","async":true,"parameters":[{"name":"profileId","type":"string","optional":false}],"returnType":"Promise<SupportSpecialist | null>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_specialists","api":{"include":["list","get","create","update","delete"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SupportSpecialist","exportName":"SupportSpecialistCollection","collectionExportName":"SupportSpecialistCollectionCollection","collectionOf":"@happyvertical/smrt-support:SupportSpecialist","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"support_specialists","ddl":"CREATE TABLE IF NOT EXISTS \\"support_specialists\\" (\\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 \\"profile_id\\" UUID NOT NULL,\\n \\"display_name\\" TEXT,\\n \\"status\\" TEXT,\\n \\"languages\\" TEXT,\\n \\"timezone\\" TEXT,\\n \\"max_concurrent_cases\\" INTEGER DEFAULT 10,\\n \\"on_call_priority\\" INTEGER DEFAULT 0,\\n \\"notes\\" TEXT,\\n \\"metadata\\" 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":false,"unique":false},"profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":true,"unique":false},"display_name":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"languages":{"type":"TEXT","notNull":false,"unique":false},"timezone":{"type":"TEXT","notNull":false,"unique":false},"max_concurrent_cases":{"type":"INTEGER","notNull":false,"unique":false,"default":10},"on_call_priority":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"notes":{"type":"TEXT","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_specialists_tenant_id_profile_id_idx","columns":["tenant_id","profile_id"],"unique":true,"nullsNotDistinct":true},{"name":"support_specialists_slug_context_idx","columns":["slug","context"]},{"name":"support_specialists_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_specialists_profile_id_idx","columns":["profile_id"]}],"version":"ff5305d3"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportQualification":{"name":"supportqualification","className":"SupportQualification","qualifiedName":"@happyvertical/smrt-support:SupportQualification","collection":"supportqualifications","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-specialist.ts","packageName":"@happyvertical/smrt-support","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}}},"specialistId":{"type":"foreignKey","required":true,"related":"SupportSpecialist","_meta":{"required":true}},"projectId":{"type":"text","required":false,"_meta":{}},"level":{"type":"text","required":false,"_meta":{},"enum":["trainee","qualified","expert"]},"effectiveFrom":{"type":"datetime","required":false},"effectiveTo":{"type":"datetime","required":false},"grantedByProfileId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-profiles:Profile","_meta":{"nullable":true}},"notes":{"type":"text","required":false,"_meta":{}}},"methods":{"isEffectiveAt":{"name":"isEffectiveAt","async":false,"parameters":[{"name":"at","type":"Date","optional":true}],"returnType":"boolean","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_qualifications","api":{"include":["list","get","create","update","delete"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"conflictColumns":["specialist_id","project_id"],"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"SupportQualification","collectionExportName":"SupportQualificationCollection","validationRules":[{"field":"specialistId","rule":"required","fieldType":"foreignKey"}],"schema":{"tableName":"support_qualifications","ddl":"CREATE TABLE IF NOT EXISTS \\"support_qualifications\\" (\\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 \\"specialist_id\\" UUID NOT NULL,\\n \\"project_id\\" TEXT,\\n \\"level\\" TEXT,\\n \\"effective_from\\" TIMESTAMP,\\n \\"effective_to\\" TIMESTAMP,\\n \\"granted_by_profile_id\\" UUID,\\n \\"notes\\" 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":false,"unique":false},"specialist_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"support_specialists","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"project_id":{"type":"TEXT","notNull":false,"unique":false},"level":{"type":"TEXT","notNull":false,"unique":false},"effective_from":{"type":"TIMESTAMP","notNull":false,"unique":false},"effective_to":{"type":"TIMESTAMP","notNull":false,"unique":false},"granted_by_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"notes":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_qualifications_specialist_id_project_id_idx","columns":["specialist_id","project_id"],"unique":true,"nullsNotDistinct":true},{"name":"support_qualifications_slug_context_idx","columns":["slug","context"]},{"name":"support_qualifications_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_qualifications_granted_by_profile_id_idx","columns":["granted_by_profile_id"]}],"version":"566b3428"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportQualificationCollection":{"name":"supportqualificationcollection","className":"SupportQualificationCollection","qualifiedName":"@happyvertical/smrt-support:SupportQualificationCollection","collection":"supportqualifications","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-specialist.ts","packageName":"@happyvertical/smrt-support","fields":{},"methods":{"forSpecialist":{"name":"forSpecialist","async":true,"parameters":[{"name":"specialistId","type":"string","optional":false}],"returnType":"Promise<SupportQualification[]>","isStatic":false,"isPublic":true},"forProject":{"name":"forProject","async":true,"parameters":[{"name":"projectId","type":"string","optional":false}],"returnType":"Promise<SupportQualification[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_qualifications","api":{"include":["list","get","create","update","delete"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SupportQualification","exportName":"SupportQualificationCollection","collectionExportName":"SupportQualificationCollectionCollection","collectionOf":"@happyvertical/smrt-support:SupportQualification","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"support_qualifications","ddl":"CREATE TABLE IF NOT EXISTS \\"support_qualifications\\" (\\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 \\"specialist_id\\" UUID NOT NULL,\\n \\"project_id\\" TEXT,\\n \\"level\\" TEXT,\\n \\"effective_from\\" TIMESTAMP,\\n \\"effective_to\\" TIMESTAMP,\\n \\"granted_by_profile_id\\" UUID,\\n \\"notes\\" 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":false,"unique":false},"specialist_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"support_specialists","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"project_id":{"type":"TEXT","notNull":false,"unique":false},"level":{"type":"TEXT","notNull":false,"unique":false},"effective_from":{"type":"TIMESTAMP","notNull":false,"unique":false},"effective_to":{"type":"TIMESTAMP","notNull":false,"unique":false},"granted_by_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"notes":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_qualifications_specialist_id_project_id_idx","columns":["specialist_id","project_id"],"unique":true,"nullsNotDistinct":true},{"name":"support_qualifications_slug_context_idx","columns":["slug","context"]},{"name":"support_qualifications_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_qualifications_granted_by_profile_id_idx","columns":["granted_by_profile_id"]}],"version":"566b3428"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportAvailability":{"name":"supportavailability","className":"SupportAvailability","qualifiedName":"@happyvertical/smrt-support:SupportAvailability","collection":"supportavailabilities","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-specialist.ts","packageName":"@happyvertical/smrt-support","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}}},"specialistId":{"type":"foreignKey","required":true,"related":"SupportSpecialist","_meta":{"required":true}},"kind":{"type":"text","required":false,"_meta":{},"enum":["weekly","on_call","time_off"]},"weekday":{"type":"integer","required":false,"_meta":{"nullable":true}},"startMinute":{"type":"integer","required":false,"default":0},"endMinute":{"type":"integer","required":false,"default":0},"startsAt":{"type":"datetime","required":false},"endsAt":{"type":"datetime","required":false},"notes":{"type":"text","required":false,"_meta":{}}},"methods":{},"decoratorConfig":{"tableName":"support_availability_windows","api":{"include":["list","get","create","update","delete"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"SupportAvailability","collectionExportName":"SupportAvailabilityCollection","validationRules":[{"field":"specialistId","rule":"required","fieldType":"foreignKey"}],"schema":{"tableName":"support_availability_windows","ddl":"CREATE TABLE IF NOT EXISTS \\"support_availability_windows\\" (\\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 \\"specialist_id\\" UUID NOT NULL,\\n \\"kind\\" TEXT,\\n \\"weekday\\" INTEGER,\\n \\"start_minute\\" INTEGER DEFAULT 0,\\n \\"end_minute\\" INTEGER DEFAULT 0,\\n \\"starts_at\\" TIMESTAMP,\\n \\"ends_at\\" TIMESTAMP,\\n \\"notes\\" 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":false,"unique":false},"specialist_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"support_specialists","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"kind":{"type":"TEXT","notNull":false,"unique":false},"weekday":{"type":"INTEGER","notNull":false,"unique":false},"start_minute":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"end_minute":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"starts_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"ends_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"notes":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_availability_windows_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"support_availability_windows_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_availability_windows_specialist_id_idx","columns":["specialist_id"]}],"version":"2f0cafe3"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportAvailabilityCollection":{"name":"supportavailabilitycollection","className":"SupportAvailabilityCollection","qualifiedName":"@happyvertical/smrt-support:SupportAvailabilityCollection","collection":"supportavailabilities","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-specialist.ts","packageName":"@happyvertical/smrt-support","fields":{},"methods":{"forSpecialist":{"name":"forSpecialist","async":true,"parameters":[{"name":"specialistId","type":"string","optional":false}],"returnType":"Promise<SupportAvailability[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_availability_windows","api":{"include":["list","get","create","update","delete"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SupportAvailability","exportName":"SupportAvailabilityCollection","collectionExportName":"SupportAvailabilityCollectionCollection","collectionOf":"@happyvertical/smrt-support:SupportAvailability","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"support_availability_windows","ddl":"CREATE TABLE IF NOT EXISTS \\"support_availability_windows\\" (\\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 \\"specialist_id\\" UUID NOT NULL,\\n \\"kind\\" TEXT,\\n \\"weekday\\" INTEGER,\\n \\"start_minute\\" INTEGER DEFAULT 0,\\n \\"end_minute\\" INTEGER DEFAULT 0,\\n \\"starts_at\\" TIMESTAMP,\\n \\"ends_at\\" TIMESTAMP,\\n \\"notes\\" 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":false,"unique":false},"specialist_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"support_specialists","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"kind":{"type":"TEXT","notNull":false,"unique":false},"weekday":{"type":"INTEGER","notNull":false,"unique":false},"start_minute":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"end_minute":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"starts_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"ends_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"notes":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_availability_windows_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"support_availability_windows_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_availability_windows_specialist_id_idx","columns":["specialist_id"]}],"version":"2f0cafe3"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportWorkLink":{"name":"supportworklink","className":"SupportWorkLink","qualifiedName":"@happyvertical/smrt-support:SupportWorkLink","collection":"supportworklinks","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-work-link.ts","packageName":"@happyvertical/smrt-support","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}}},"caseId":{"type":"foreignKey","required":true,"related":"SupportCase","_meta":{"required":true}},"linkKind":{"type":"text","required":false,"_meta":{},"enum":["support_work_item","development_work_item"]},"targetType":{"type":"text","required":false,"_meta":{}},"targetId":{"type":"text","required":false,"_meta":{}},"targetLabel":{"type":"text","required":false,"_meta":{}},"externalUrl":{"type":"text","required":false,"_meta":{}},"status":{"type":"text","required":false,"_meta":{}},"lastStatusAt":{"type":"datetime","required":false},"metadata":{"type":"text","required":false,"_meta":{}}},"methods":{"getMetadata":{"name":"getMetadata","async":false,"parameters":[],"returnType":"Record<string, unknown>","isStatic":false,"isPublic":true},"setMetadata":{"name":"setMetadata","async":false,"parameters":[{"name":"value","type":"Record<string, unknown>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_work_links","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"conflictColumns":["case_id","target_type","target_id"],"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"SupportWorkLink","collectionExportName":"SupportWorkLinkCollection","validationRules":[{"field":"caseId","rule":"required","fieldType":"foreignKey"}],"schema":{"tableName":"support_work_links","ddl":"CREATE TABLE IF NOT EXISTS \\"support_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,\\n \\"case_id\\" UUID NOT NULL,\\n \\"link_kind\\" TEXT,\\n \\"target_type\\" TEXT,\\n \\"target_id\\" TEXT,\\n \\"target_label\\" TEXT,\\n \\"external_url\\" TEXT,\\n \\"status\\" TEXT,\\n \\"last_status_at\\" TIMESTAMP,\\n \\"metadata\\" 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":false,"unique":false},"case_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"support_cases","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"link_kind":{"type":"TEXT","notNull":false,"unique":false},"target_type":{"type":"TEXT","notNull":false,"unique":false},"target_id":{"type":"TEXT","notNull":false,"unique":false},"target_label":{"type":"TEXT","notNull":false,"unique":false},"external_url":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"last_status_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_work_links_case_id_target_type_idx","columns":["case_id","target_type","target_id"],"unique":true,"nullsNotDistinct":true},{"name":"support_work_links_slug_context_idx","columns":["slug","context"]},{"name":"support_work_links_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"c9e0e8f5"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportWorkLinkCollection":{"name":"supportworklinkcollection","className":"SupportWorkLinkCollection","qualifiedName":"@happyvertical/smrt-support:SupportWorkLinkCollection","collection":"supportworklinks","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-work-link.ts","packageName":"@happyvertical/smrt-support","fields":{},"methods":{"forCase":{"name":"forCase","async":true,"parameters":[{"name":"caseId","type":"string","optional":false}],"returnType":"Promise<SupportWorkLink[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_work_links","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SupportWorkLink","exportName":"SupportWorkLinkCollection","collectionExportName":"SupportWorkLinkCollectionCollection","collectionOf":"@happyvertical/smrt-support:SupportWorkLink","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"support_work_links","ddl":"CREATE TABLE IF NOT EXISTS \\"support_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,\\n \\"case_id\\" UUID NOT NULL,\\n \\"link_kind\\" TEXT,\\n \\"target_type\\" TEXT,\\n \\"target_id\\" TEXT,\\n \\"target_label\\" TEXT,\\n \\"external_url\\" TEXT,\\n \\"status\\" TEXT,\\n \\"last_status_at\\" TIMESTAMP,\\n \\"metadata\\" 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":false,"unique":false},"case_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"support_cases","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"link_kind":{"type":"TEXT","notNull":false,"unique":false},"target_type":{"type":"TEXT","notNull":false,"unique":false},"target_id":{"type":"TEXT","notNull":false,"unique":false},"target_label":{"type":"TEXT","notNull":false,"unique":false},"external_url":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"last_status_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_work_links_case_id_target_type_idx","columns":["case_id","target_type","target_id"],"unique":true,"nullsNotDistinct":true},{"name":"support_work_links_slug_context_idx","columns":["slug","context"]},{"name":"support_work_links_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"c9e0e8f5"},"importPath":"@happyvertical/smrt-support"}},"moduleType":"smrt","recipes":[{"id":"support.tickets","className":"SupportTicketsRecipe","label":"Support","summary":"Keep every customer request for help in one place until it is solved.","synonyms":["support tickets","tickets","helpdesk","help desk","customer support","cases"],"models":["@happyvertical/smrt-support:SupportCase","@happyvertical/smrt-support:SupportInteraction","@happyvertical/smrt-support:SupportSpecialist"],"nav":[{"label":"Tickets","model":"@happyvertical/smrt-support:SupportCase","icon":"fileText","description":"Every request for help, who is handling it and where it stands.","noun":"ticket"},{"label":"Messages","model":"@happyvertical/smrt-support:SupportInteraction","icon":"book","description":"What was said on each ticket, by the customer or your team.","noun":"message"},{"label":"Support team","model":"@happyvertical/smrt-support:SupportSpecialist","icon":"users","description":"The people who answer tickets and when they are available.","noun":"team member"}],"requires":[],"section":{"id":"support","label":"Support","icon":"users","description":"Help your customers and keep track of every request."},"options":{"@happyvertical/smrt-support:SupportCase":{"fields":{"caseNumber":{"label":"Ticket number","order":1},"subject":{"order":2},"description":{"order":3},"status":{"order":4},"priority":{"order":5},"clientProfileId":{"label":"Customer","order":6},"assignedSpecialistId":{"label":"Assigned to","order":7},"tenantId":{"visibility":"hidden"},"assignedAt":{"visibility":"hidden"},"escalatedAt":{"visibility":"hidden"},"acknowledgedAt":{"visibility":"hidden"},"firstRespondedAt":{"visibility":"hidden"},"humanRequestedAt":{"visibility":"hidden"},"resolvedAt":{"visibility":"hidden"},"closedAt":{"visibility":"hidden"},"lastReopenedAt":{"visibility":"hidden"},"severity":{"visibility":"advanced"},"category":{"visibility":"advanced"},"sensitive":{"visibility":"advanced"},"channelKind":{"visibility":"advanced"},"openedByProfileId":{"visibility":"advanced"},"resolutionSummary":{"visibility":"advanced"},"projectId":{"visibility":"hidden"},"bindingId":{"visibility":"hidden"},"threadKey":{"visibility":"hidden"},"planId":{"visibility":"hidden"},"planSnapshot":{"visibility":"hidden"},"preferredSpecialistId":{"visibility":"hidden"},"escalationLevel":{"visibility":"hidden"},"resolvedByProfileId":{"visibility":"hidden"},"resolutionKind":{"visibility":"hidden"},"reopenCount":{"visibility":"hidden"},"aiEnabled":{"visibility":"hidden"},"metadata":{"visibility":"hidden"}}},"@happyvertical/smrt-support:SupportInteraction":{"fields":{"body":{"label":"Message","order":1},"caseId":{"label":"Ticket","order":2},"direction":{"order":3},"tenantId":{"visibility":"hidden"},"channelKind":{"visibility":"advanced"},"actorKind":{"visibility":"advanced"},"authorProfileId":{"visibility":"advanced"},"sourceType":{"visibility":"hidden"},"sourceId":{"visibility":"hidden"},"sourceKey":{"visibility":"hidden"},"rfcMessageId":{"visibility":"hidden"},"metadata":{"visibility":"hidden"}}},"@happyvertical/smrt-support:SupportSpecialist":{"fields":{"displayName":{"label":"Name","order":1},"status":{"order":2},"tenantId":{"visibility":"hidden"},"profileId":{"visibility":"advanced"},"languages":{"visibility":"advanced"},"timezone":{"visibility":"advanced"},"maxConcurrentCases":{"label":"Most tickets at once","visibility":"advanced"},"onCallPriority":{"visibility":"hidden"},"notes":{"visibility":"advanced"},"metadata":{"visibility":"hidden"}}}},"help":{"markdown":"## Overview\\n\\nSupport keeps every request for help from a customer in one place. Each request\\nis a ticket with a number, a subject, who asked, who is handling it and where\\nit stands, from new to resolved. Messages back and forth stay on the ticket, so\\nanyone on the team can pick it up and see what was said.\\n\\n## Tasks\\n\\nTickets and their messages are created by your support channels (email, chat\\nand the like) and by the support service, not by hand in the app. Here you\\nread them and see where each one stands.\\n\\n### Find a ticket\\n\\n1. Open the list of tickets.\\n2. Look at the **{field:SupportCase.subject}**, the **{field:SupportCase.status}** and the **{field:SupportCase.priority}** to see what needs attention.\\n3. Open a ticket to see who it is **{field:SupportCase.assignedSpecialistId}** and the **{field:SupportCase.description}**.\\n\\n### Read the history of a ticket\\n\\n1. Open the list of messages.\\n2. Find the **{field:SupportInteraction.caseId}** you are interested in.\\n3. Read the **{field:SupportInteraction.body}** of each message, oldest first.\\n\\n### Add someone to the support team\\n\\n1. Open the support team and choose **New**.\\n2. Type the person's **{field:SupportSpecialist.displayName}**.\\n3. Save. They can now be given tickets by the support service.\\n","fieldRefs":["SupportCase.assignedSpecialistId","SupportCase.description","SupportCase.priority","SupportCase.status","SupportCase.subject","SupportInteraction.body","SupportInteraction.caseId","SupportSpecialist.displayName"]},"demo":{"mode":"server","reasons":["Needs a server because its package does not build for a browser: core migrations (node:os); and its package depends on @happyvertical/smrt-agents, @happyvertical/smrt-chat, @happyvertical/smrt-images, @happyvertical/smrt-jobs, @happyvertical/smrt-profiles, @happyvertical/smrt-projects, @happyvertical/smrt-reports, @happyvertical/smrt-secrets, @happyvertical/smrt-subscriptions, @happyvertical/smrt-tenancy, @happyvertical/smrt-timesheets, @happyvertical/smrt-users, which do not build for a browser (#3615, #3617, #3624, #3625, #3626, #3627, #3628)."]}}],"smrtDependencies":["@happyvertical/smrt-chat","@happyvertical/smrt-core","@happyvertical/smrt-jobs","@happyvertical/smrt-messages","@happyvertical/smrt-projects","@happyvertical/smrt-tenancy","@happyvertical/smrt-timesheets","@happyvertical/smrt-users"],"browser":{"status":"server-only","issues":["#3615","#3617","#3624","#3625","#3626","#3627","#3628"],"reason":"core migrations (node:os)","via":["@happyvertical/smrt-agents","@happyvertical/smrt-chat","@happyvertical/smrt-images","@happyvertical/smrt-jobs","@happyvertical/smrt-profiles","@happyvertical/smrt-projects","@happyvertical/smrt-reports","@happyvertical/smrt-secrets","@happyvertical/smrt-subscriptions","@happyvertical/smrt-tenancy","@happyvertical/smrt-timesheets","@happyvertical/smrt-users"]},"stampsConstructors":true}`));
|
|
22
|
+
ObjectRegistry.registerPackageManifest(JSON.parse(`{"version":"1.0.0","timestamp":0,"packageName":"@happyvertical/smrt-support","packageVersion":"0.60.3","objects":{"@happyvertical/smrt-support:ServiceTimeEntry":{"name":"servicetimeentry","className":"ServiceTimeEntry","qualifiedName":"@happyvertical/smrt-support:ServiceTimeEntry","collection":"servicetimeentries","description":"Support subtype over the shared service_time_entries table: the shared entry plus caseId (a SupportCase) and specialistId (a SupportSpecialist).","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/service-time-entry.ts","packageName":"@happyvertical/smrt-support","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}}},"caseId":{"type":"foreignKey","required":false,"related":"SupportCase"},"workRefType":{"type":"text","required":false,"_meta":{"nullable":true}},"workRefId":{"type":"text","required":false,"_meta":{"nullable":true}},"specialistId":{"type":"foreignKey","required":false,"related":"SupportSpecialist"},"participantKind":{"type":"text","required":false,"_meta":{}},"participantProfileId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-profiles:Profile","_meta":{"nullable":true}},"agentRef":{"type":"text","required":false,"_meta":{}},"source":{"type":"text","required":false,"_meta":{}},"description":{"type":"text","required":false,"_meta":{}},"startedAt":{"type":"datetime","required":false},"endedAt":{"type":"datetime","required":false},"durationSeconds":{"type":"integer","required":false,"_meta":{"nullable":true}},"evidence":{"type":"text","required":false,"_meta":{}},"status":{"type":"text","required":false,"_meta":{}},"submittedAt":{"type":"datetime","required":false},"submittedByProfileId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-profiles:Profile","_meta":{"nullable":true}},"approvedAt":{"type":"datetime","required":false},"approvedByProfileId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-profiles:Profile","_meta":{"nullable":true}},"approvalPath":{"type":"text","required":false,"_meta":{}},"rejectedAt":{"type":"datetime","required":false},"rejectedByProfileId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-profiles:Profile","_meta":{"nullable":true}},"rejectionReason":{"type":"text","required":false,"_meta":{}},"correctionOfId":{"type":"foreignKey","required":false,"related":"ServiceTimeEntry"},"metadata":{"type":"text","required":false,"_meta":{}}},"methods":{"getEvidence":{"name":"getEvidence","async":false,"parameters":[],"returnType":"ServiceEvidence[]","isStatic":false,"isPublic":true},"setEvidence":{"name":"setEvidence","async":false,"parameters":[{"name":"value","type":"ServiceEvidence[]","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"getMetadata":{"name":"getMetadata","async":false,"parameters":[],"returnType":"Record<string, unknown>","isStatic":false,"isPublic":true},"setMetadata":{"name":"setMetadata","async":false,"parameters":[{"name":"value","type":"Record<string, unknown>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"durationHoursExact":{"name":"durationHoursExact","async":false,"parameters":[],"returnType":"string | null","isStatic":false,"isPublic":true},"durationHours":{"name":"durationHours","async":false,"parameters":[],"returnType":"number","isStatic":false,"isPublic":true},"requireDurationSeconds":{"name":"requireDurationSeconds","async":false,"parameters":[],"returnType":"number","isStatic":false,"isPublic":true},"initialize":{"name":"initialize","async":true,"parameters":[],"returnType":"Promise<this>","isStatic":false,"isPublic":true},"save":{"name":"save","async":true,"parameters":[{"name":"options","type":"SmrtSaveOptions","optional":true}],"returnType":"Promise<this>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"service_time_entries","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context"]},"extends":"ServiceTimeEntry","extendsQualified":"@happyvertical/smrt-timesheets:ServiceTimeEntry","exportName":"ServiceTimeEntry","collectionExportName":"ServiceTimeEntryCollection","schema":{"tableName":"service_time_entries","ddl":"CREATE TABLE IF NOT EXISTS \\"service_time_entries\\" (\\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 \\"case_id\\" UUID,\\n \\"work_ref_type\\" TEXT,\\n \\"work_ref_id\\" TEXT,\\n \\"specialist_id\\" UUID,\\n \\"participant_kind\\" TEXT,\\n \\"participant_profile_id\\" UUID,\\n \\"agent_ref\\" TEXT,\\n \\"source\\" TEXT,\\n \\"description\\" TEXT,\\n \\"started_at\\" TIMESTAMP,\\n \\"ended_at\\" TIMESTAMP,\\n \\"duration_seconds\\" INTEGER,\\n \\"evidence\\" TEXT,\\n \\"status\\" TEXT,\\n \\"submitted_at\\" TIMESTAMP,\\n \\"submitted_by_profile_id\\" UUID,\\n \\"approved_at\\" TIMESTAMP,\\n \\"approved_by_profile_id\\" UUID,\\n \\"approval_path\\" TEXT,\\n \\"rejected_at\\" TIMESTAMP,\\n \\"rejected_by_profile_id\\" UUID,\\n \\"rejection_reason\\" TEXT,\\n \\"correction_of_id\\" UUID,\\n \\"metadata\\" 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":false,"unique":false},"case_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_cases","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"work_ref_type":{"type":"TEXT","notNull":false,"unique":false},"work_ref_id":{"type":"TEXT","notNull":false,"unique":false},"specialist_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_specialists","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"participant_kind":{"type":"TEXT","notNull":false,"unique":false},"participant_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"agent_ref":{"type":"TEXT","notNull":false,"unique":false},"source":{"type":"TEXT","notNull":false,"unique":false},"description":{"type":"TEXT","notNull":false,"unique":false},"started_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"ended_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"duration_seconds":{"type":"INTEGER","notNull":false,"unique":false},"evidence":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"submitted_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"submitted_by_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"approved_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"approved_by_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"approval_path":{"type":"TEXT","notNull":false,"unique":false},"rejected_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"rejected_by_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"rejection_reason":{"type":"TEXT","notNull":false,"unique":false},"correction_of_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"service_time_entries","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"service_time_entries_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"service_time_entries_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"service_time_entries_case_id_idx","columns":["case_id"]},{"name":"service_time_entries_specialist_id_idx","columns":["specialist_id"]},{"name":"service_time_entries_participant_profile_id_idx","columns":["participant_profile_id"]},{"name":"service_time_entries_submitted_by_profile_id_idx","columns":["submitted_by_profile_id"]},{"name":"service_time_entries_approved_by_profile_id_idx","columns":["approved_by_profile_id"]},{"name":"service_time_entries_rejected_by_profile_id_idx","columns":["rejected_by_profile_id"]},{"name":"service_time_entries_correction_of_id_idx","columns":["correction_of_id"]}],"version":"4a27a55d"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:ServiceTimeEntryCollection":{"name":"servicetimeentrycollection","className":"ServiceTimeEntryCollection","qualifiedName":"@happyvertical/smrt-support:ServiceTimeEntryCollection","collection":"servicetimeentries","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/service-time-entry.ts","packageName":"@happyvertical/smrt-support","fields":{},"methods":{"forCase":{"name":"forCase","async":true,"parameters":[{"name":"caseId","type":"string","optional":false}],"returnType":"Promise<ServiceTimeEntry[]>","isStatic":false,"isPublic":true},"forSpecialist":{"name":"forSpecialist","async":true,"parameters":[{"name":"specialistId","type":"string","optional":false}],"returnType":"Promise<ServiceTimeEntry[]>","isStatic":false,"isPublic":true},"pendingApproval":{"name":"pendingApproval","async":true,"parameters":[],"returnType":"Promise<ServiceTimeEntry[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"service_time_entries","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"ServiceTimeEntry","exportName":"ServiceTimeEntryCollection","collectionExportName":"ServiceTimeEntryCollectionCollection","collectionOf":"@happyvertical/smrt-support:ServiceTimeEntry","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"service_time_entries","ddl":"CREATE TABLE IF NOT EXISTS \\"service_time_entries\\" (\\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 \\"case_id\\" UUID,\\n \\"work_ref_type\\" TEXT,\\n \\"work_ref_id\\" TEXT,\\n \\"specialist_id\\" UUID,\\n \\"participant_kind\\" TEXT,\\n \\"participant_profile_id\\" UUID,\\n \\"agent_ref\\" TEXT,\\n \\"source\\" TEXT,\\n \\"description\\" TEXT,\\n \\"started_at\\" TIMESTAMP,\\n \\"ended_at\\" TIMESTAMP,\\n \\"duration_seconds\\" INTEGER,\\n \\"evidence\\" TEXT,\\n \\"status\\" TEXT,\\n \\"submitted_at\\" TIMESTAMP,\\n \\"submitted_by_profile_id\\" UUID,\\n \\"approved_at\\" TIMESTAMP,\\n \\"approved_by_profile_id\\" UUID,\\n \\"approval_path\\" TEXT,\\n \\"rejected_at\\" TIMESTAMP,\\n \\"rejected_by_profile_id\\" UUID,\\n \\"rejection_reason\\" TEXT,\\n \\"correction_of_id\\" UUID,\\n \\"metadata\\" 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":false,"unique":false},"case_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_cases","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"work_ref_type":{"type":"TEXT","notNull":false,"unique":false},"work_ref_id":{"type":"TEXT","notNull":false,"unique":false},"specialist_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_specialists","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"participant_kind":{"type":"TEXT","notNull":false,"unique":false},"participant_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"agent_ref":{"type":"TEXT","notNull":false,"unique":false},"source":{"type":"TEXT","notNull":false,"unique":false},"description":{"type":"TEXT","notNull":false,"unique":false},"started_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"ended_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"duration_seconds":{"type":"INTEGER","notNull":false,"unique":false},"evidence":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"submitted_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"submitted_by_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"approved_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"approved_by_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"approval_path":{"type":"TEXT","notNull":false,"unique":false},"rejected_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"rejected_by_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"rejection_reason":{"type":"TEXT","notNull":false,"unique":false},"correction_of_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"service_time_entries","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"service_time_entries_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"service_time_entries_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"service_time_entries_case_id_idx","columns":["case_id"]},{"name":"service_time_entries_specialist_id_idx","columns":["specialist_id"]},{"name":"service_time_entries_participant_profile_id_idx","columns":["participant_profile_id"]},{"name":"service_time_entries_submitted_by_profile_id_idx","columns":["submitted_by_profile_id"]},{"name":"service_time_entries_approved_by_profile_id_idx","columns":["approved_by_profile_id"]},{"name":"service_time_entries_rejected_by_profile_id_idx","columns":["rejected_by_profile_id"]},{"name":"service_time_entries_correction_of_id_idx","columns":["correction_of_id"]}],"version":"4a27a55d"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportAiRun":{"name":"supportairun","className":"SupportAiRun","qualifiedName":"@happyvertical/smrt-support:SupportAiRun","collection":"supportairuns","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-ai-run.ts","packageName":"@happyvertical/smrt-support","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}}},"caseId":{"type":"foreignKey","required":true,"related":"SupportCase","_meta":{"required":true}},"interactionId":{"type":"foreignKey","required":false,"related":"SupportInteraction"},"phase":{"type":"text","required":false,"_meta":{},"enum":["acknowledge","classify","answer","troubleshoot","resolve"]},"outcome":{"type":"text","required":false,"_meta":{},"enum":["completed","skipped","failed","handed_off"]},"confidence":{"type":"decimal","required":false,"_meta":{"nullable":true}},"classification":{"type":"text","required":false,"_meta":{}},"responseInteractionId":{"type":"foreignKey","required":false,"related":"SupportInteraction"},"knowledgeRefs":{"type":"text","required":false,"_meta":{}},"toolCalls":{"type":"text","required":false,"_meta":{}},"error":{"type":"text","required":false,"_meta":{}},"correlationId":{"type":"text","required":false,"_meta":{}},"model":{"type":"text","required":false,"_meta":{}},"startedAt":{"type":"datetime","required":false},"completedAt":{"type":"datetime","required":false},"metadata":{"type":"text","required":false,"_meta":{}}},"methods":{"getClassification":{"name":"getClassification","async":false,"parameters":[],"returnType":"Record<string, unknown>","isStatic":false,"isPublic":true},"setClassification":{"name":"setClassification","async":false,"parameters":[{"name":"value","type":"Record<string, unknown>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"getKnowledgeRefs":{"name":"getKnowledgeRefs","async":false,"parameters":[],"returnType":"Array<Record<string, unknown>>","isStatic":false,"isPublic":true},"setKnowledgeRefs":{"name":"setKnowledgeRefs","async":false,"parameters":[{"name":"refs","type":"Array<Record<string, unknown>>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"getToolCalls":{"name":"getToolCalls","async":false,"parameters":[],"returnType":"Array<Record<string, unknown>>","isStatic":false,"isPublic":true},"setToolCalls":{"name":"setToolCalls","async":false,"parameters":[{"name":"calls","type":"Array<Record<string, unknown>>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_ai_runs","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"SupportAiRun","collectionExportName":"SupportAiRunCollection","validationRules":[{"field":"caseId","rule":"required","fieldType":"foreignKey"}],"schema":{"tableName":"support_ai_runs","ddl":"CREATE TABLE IF NOT EXISTS \\"support_ai_runs\\" (\\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 \\"case_id\\" UUID NOT NULL,\\n \\"interaction_id\\" UUID,\\n \\"phase\\" TEXT,\\n \\"outcome\\" TEXT,\\n \\"confidence\\" REAL,\\n \\"classification\\" TEXT,\\n \\"response_interaction_id\\" UUID,\\n \\"knowledge_refs\\" TEXT,\\n \\"tool_calls\\" TEXT,\\n \\"error\\" TEXT,\\n \\"correlation_id\\" TEXT,\\n \\"model\\" TEXT,\\n \\"started_at\\" TIMESTAMP,\\n \\"completed_at\\" TIMESTAMP,\\n \\"metadata\\" 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":false,"unique":false},"case_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"support_cases","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"interaction_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_interactions","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"phase":{"type":"TEXT","notNull":false,"unique":false},"outcome":{"type":"TEXT","notNull":false,"unique":false},"confidence":{"type":"REAL","notNull":false,"unique":false},"classification":{"type":"TEXT","notNull":false,"unique":false},"response_interaction_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_interactions","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"knowledge_refs":{"type":"TEXT","notNull":false,"unique":false},"tool_calls":{"type":"TEXT","notNull":false,"unique":false},"error":{"type":"TEXT","notNull":false,"unique":false},"correlation_id":{"type":"TEXT","notNull":false,"unique":false},"model":{"type":"TEXT","notNull":false,"unique":false},"started_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"completed_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_ai_runs_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"support_ai_runs_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_ai_runs_case_id_idx","columns":["case_id"]},{"name":"support_ai_runs_interaction_id_idx","columns":["interaction_id"]},{"name":"support_ai_runs_response_interaction_id_idx","columns":["response_interaction_id"]}],"version":"5edb948b"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportAiRunCollection":{"name":"supportairuncollection","className":"SupportAiRunCollection","qualifiedName":"@happyvertical/smrt-support:SupportAiRunCollection","collection":"supportairuns","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-ai-run.ts","packageName":"@happyvertical/smrt-support","fields":{},"methods":{"forCase":{"name":"forCase","async":true,"parameters":[{"name":"caseId","type":"string","optional":false}],"returnType":"Promise<SupportAiRun[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_ai_runs","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SupportAiRun","exportName":"SupportAiRunCollection","collectionExportName":"SupportAiRunCollectionCollection","collectionOf":"@happyvertical/smrt-support:SupportAiRun","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"support_ai_runs","ddl":"CREATE TABLE IF NOT EXISTS \\"support_ai_runs\\" (\\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 \\"case_id\\" UUID NOT NULL,\\n \\"interaction_id\\" UUID,\\n \\"phase\\" TEXT,\\n \\"outcome\\" TEXT,\\n \\"confidence\\" REAL,\\n \\"classification\\" TEXT,\\n \\"response_interaction_id\\" UUID,\\n \\"knowledge_refs\\" TEXT,\\n \\"tool_calls\\" TEXT,\\n \\"error\\" TEXT,\\n \\"correlation_id\\" TEXT,\\n \\"model\\" TEXT,\\n \\"started_at\\" TIMESTAMP,\\n \\"completed_at\\" TIMESTAMP,\\n \\"metadata\\" 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":false,"unique":false},"case_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"support_cases","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"interaction_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_interactions","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"phase":{"type":"TEXT","notNull":false,"unique":false},"outcome":{"type":"TEXT","notNull":false,"unique":false},"confidence":{"type":"REAL","notNull":false,"unique":false},"classification":{"type":"TEXT","notNull":false,"unique":false},"response_interaction_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_interactions","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"knowledge_refs":{"type":"TEXT","notNull":false,"unique":false},"tool_calls":{"type":"TEXT","notNull":false,"unique":false},"error":{"type":"TEXT","notNull":false,"unique":false},"correlation_id":{"type":"TEXT","notNull":false,"unique":false},"model":{"type":"TEXT","notNull":false,"unique":false},"started_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"completed_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_ai_runs_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"support_ai_runs_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_ai_runs_case_id_idx","columns":["case_id"]},{"name":"support_ai_runs_interaction_id_idx","columns":["interaction_id"]},{"name":"support_ai_runs_response_interaction_id_idx","columns":["response_interaction_id"]}],"version":"5edb948b"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportCaseEvent":{"name":"supportcaseevent","className":"SupportCaseEvent","qualifiedName":"@happyvertical/smrt-support:SupportCaseEvent","collection":"supportcaseevents","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-case-event.ts","packageName":"@happyvertical/smrt-support","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}}},"caseId":{"type":"foreignKey","required":true,"related":"SupportCase","_meta":{"required":true}},"eventType":{"type":"text","required":false,"_meta":{},"enum":["created","interaction","transition","assignment","ai_run","handoff","human_requested","escalation","target_scheduled","target_satisfied","target_breached","target_paused","target_resumed","work_linked","reopened","plan_applied","time_recorded","note"]},"actorKind":{"type":"text","required":false,"_meta":{},"enum":["client","specialist","agent","system"]},"actorProfileId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-profiles:Profile","_meta":{"nullable":true}},"occurredAt":{"type":"datetime","required":false},"summary":{"type":"text","required":false,"_meta":{}},"payload":{"type":"text","required":false,"_meta":{}}},"methods":{"getPayload":{"name":"getPayload","async":false,"parameters":[],"returnType":"Record<string, unknown>","isStatic":false,"isPublic":true},"setPayload":{"name":"setPayload","async":false,"parameters":[{"name":"value","type":"Record<string, unknown>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_case_events","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"SupportCaseEvent","collectionExportName":"SupportCaseEventCollection","validationRules":[{"field":"caseId","rule":"required","fieldType":"foreignKey"}],"schema":{"tableName":"support_case_events","ddl":"CREATE TABLE IF NOT EXISTS \\"support_case_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,\\n \\"case_id\\" UUID NOT NULL,\\n \\"event_type\\" TEXT,\\n \\"actor_kind\\" TEXT,\\n \\"actor_profile_id\\" UUID,\\n \\"occurred_at\\" TIMESTAMP,\\n \\"summary\\" TEXT,\\n \\"payload\\" 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":false,"unique":false},"case_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"support_cases","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"event_type":{"type":"TEXT","notNull":false,"unique":false},"actor_kind":{"type":"TEXT","notNull":false,"unique":false},"actor_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"occurred_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"summary":{"type":"TEXT","notNull":false,"unique":false},"payload":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_case_events_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"support_case_events_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_case_events_case_id_idx","columns":["case_id"]},{"name":"support_case_events_actor_profile_id_idx","columns":["actor_profile_id"]}],"version":"eff9cadb"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportCaseEventCollection":{"name":"supportcaseeventcollection","className":"SupportCaseEventCollection","qualifiedName":"@happyvertical/smrt-support:SupportCaseEventCollection","collection":"supportcaseevents","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-case-event.ts","packageName":"@happyvertical/smrt-support","fields":{},"methods":{"forCase":{"name":"forCase","async":true,"parameters":[{"name":"caseId","type":"string","optional":false},{"name":"options","type":"object","optional":true,"memberTypes":["SupportCaseEventType"]}],"returnType":"Promise<SupportCaseEvent[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_case_events","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SupportCaseEvent","exportName":"SupportCaseEventCollection","collectionExportName":"SupportCaseEventCollectionCollection","collectionOf":"@happyvertical/smrt-support:SupportCaseEvent","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"support_case_events","ddl":"CREATE TABLE IF NOT EXISTS \\"support_case_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,\\n \\"case_id\\" UUID NOT NULL,\\n \\"event_type\\" TEXT,\\n \\"actor_kind\\" TEXT,\\n \\"actor_profile_id\\" UUID,\\n \\"occurred_at\\" TIMESTAMP,\\n \\"summary\\" TEXT,\\n \\"payload\\" 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":false,"unique":false},"case_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"support_cases","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"event_type":{"type":"TEXT","notNull":false,"unique":false},"actor_kind":{"type":"TEXT","notNull":false,"unique":false},"actor_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"occurred_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"summary":{"type":"TEXT","notNull":false,"unique":false},"payload":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_case_events_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"support_case_events_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_case_events_case_id_idx","columns":["case_id"]},{"name":"support_case_events_actor_profile_id_idx","columns":["actor_profile_id"]}],"version":"eff9cadb"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportCase":{"name":"supportcase","className":"SupportCase","qualifiedName":"@happyvertical/smrt-support:SupportCase","collection":"supportcases","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-case.ts","packageName":"@happyvertical/smrt-support","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}}},"caseNumber":{"type":"text","required":false,"description":"The reference number for this ticket.","_meta":{"description":"The reference number for this ticket."}},"subject":{"type":"text","required":false,"description":"A short summary of what the customer needs.","_meta":{"description":"A short summary of what the customer needs."}},"description":{"type":"text","required":false,"description":"What the customer asked for, in their words.","_meta":{"description":"What the customer asked for, in their words."}},"status":{"type":"text","required":false,"description":"Where the ticket stands, from new to resolved.","_meta":{"description":"Where the ticket stands, from new to resolved."},"enum":["new","triaged","assigned","in_progress","waiting_on_client","escalated","resolved","closed"]},"priority":{"type":"text","required":false,"description":"How soon it needs attention: low, normal, high or urgent.","_meta":{"description":"How soon it needs attention: low, normal, high or urgent."}},"severity":{"type":"text","required":false,"_meta":{}},"category":{"type":"text","required":false,"_meta":{}},"sensitive":{"type":"boolean","required":false,"_meta":{}},"channelKind":{"type":"text","required":false,"_meta":{}},"clientProfileId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-profiles:Profile","description":"The customer who asked for help.","_meta":{"description":"The customer who asked for help.","nullable":true}},"openedByProfileId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-profiles:Profile","_meta":{"nullable":true}},"projectId":{"type":"text","required":false,"_meta":{"nullable":true}},"bindingId":{"type":"foreignKey","required":false,"related":"SupportChannelBinding"},"threadKey":{"type":"text","required":false,"_meta":{}},"planId":{"type":"foreignKey","required":false,"related":"SupportPlan"},"planSnapshot":{"type":"text","required":false,"_meta":{}},"assignedSpecialistId":{"type":"foreignKey","required":false,"related":"SupportSpecialist","description":"The team member handling this ticket.","_meta":{"description":"The team member handling this ticket."}},"assignedAt":{"type":"datetime","required":false},"preferredSpecialistId":{"type":"foreignKey","required":false,"related":"SupportSpecialist"},"escalationLevel":{"type":"integer","required":false,"default":0},"escalatedAt":{"type":"datetime","required":false},"acknowledgedAt":{"type":"datetime","required":false},"firstRespondedAt":{"type":"datetime","required":false},"humanRequestedAt":{"type":"datetime","required":false},"resolvedAt":{"type":"datetime","required":false},"resolvedByProfileId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-profiles:Profile","_meta":{"nullable":true}},"resolutionKind":{"type":"text","required":false,"_meta":{}},"resolutionSummary":{"type":"text","required":false,"_meta":{}},"closedAt":{"type":"datetime","required":false},"reopenCount":{"type":"integer","required":false,"default":0},"lastReopenedAt":{"type":"datetime","required":false},"aiEnabled":{"type":"boolean","required":false,"_meta":{}},"metadata":{"type":"text","required":false,"_meta":{}}},"methods":{"isOpen":{"name":"isOpen","async":false,"parameters":[],"returnType":"boolean","isStatic":false,"isPublic":true},"getMetadata":{"name":"getMetadata","async":false,"parameters":[],"returnType":"Record<string, unknown>","isStatic":false,"isPublic":true},"setMetadata":{"name":"setMetadata","async":false,"parameters":[{"name":"value","type":"Record<string, unknown>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"updateMetadata":{"name":"updateMetadata","async":false,"parameters":[{"name":"patch","type":"Record<string, unknown>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"getPlanSnapshot":{"name":"getPlanSnapshot","async":false,"parameters":[],"returnType":"Record<string, unknown>","isStatic":false,"isPublic":true},"setPlanSnapshot":{"name":"setPlanSnapshot","async":false,"parameters":[{"name":"value","type":"Record<string, unknown>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"attemptTriageDecision":{"name":"attemptTriageDecision","async":true,"parameters":[{"name":"request","type":"DecisionRequest","optional":false}],"returnType":"Promise<DecisionResult | undefined>","isStatic":false,"isPublic":true},"initialize":{"name":"initialize","async":true,"parameters":[],"returnType":"Promise<this>","isStatic":false,"isPublic":true},"save":{"name":"save","async":true,"parameters":[{"name":"options","type":"SmrtSaveOptions","optional":true}],"returnType":"Promise<this>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_cases","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"SupportCase","collectionExportName":"SupportCaseCollection","schema":{"tableName":"support_cases","ddl":"CREATE TABLE IF NOT EXISTS \\"support_cases\\" (\\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 \\"case_number\\" TEXT,\\n \\"subject\\" TEXT,\\n \\"description\\" TEXT,\\n \\"status\\" TEXT,\\n \\"priority\\" TEXT,\\n \\"severity\\" TEXT,\\n \\"category\\" TEXT,\\n \\"sensitive\\" BOOLEAN,\\n \\"channel_kind\\" TEXT,\\n \\"client_profile_id\\" UUID,\\n \\"opened_by_profile_id\\" UUID,\\n \\"project_id\\" TEXT,\\n \\"binding_id\\" UUID,\\n \\"thread_key\\" TEXT,\\n \\"plan_id\\" UUID,\\n \\"plan_snapshot\\" TEXT,\\n \\"assigned_specialist_id\\" UUID,\\n \\"assigned_at\\" TIMESTAMP,\\n \\"preferred_specialist_id\\" UUID,\\n \\"escalation_level\\" INTEGER DEFAULT 0,\\n \\"escalated_at\\" TIMESTAMP,\\n \\"acknowledged_at\\" TIMESTAMP,\\n \\"first_responded_at\\" TIMESTAMP,\\n \\"human_requested_at\\" TIMESTAMP,\\n \\"resolved_at\\" TIMESTAMP,\\n \\"resolved_by_profile_id\\" UUID,\\n \\"resolution_kind\\" TEXT,\\n \\"resolution_summary\\" TEXT,\\n \\"closed_at\\" TIMESTAMP,\\n \\"reopen_count\\" INTEGER DEFAULT 0,\\n \\"last_reopened_at\\" TIMESTAMP,\\n \\"ai_enabled\\" BOOLEAN,\\n \\"metadata\\" 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":false,"unique":false},"case_number":{"type":"TEXT","notNull":false,"unique":false},"subject":{"type":"TEXT","notNull":false,"unique":false},"description":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"priority":{"type":"TEXT","notNull":false,"unique":false},"severity":{"type":"TEXT","notNull":false,"unique":false},"category":{"type":"TEXT","notNull":false,"unique":false},"sensitive":{"type":"BOOLEAN","notNull":false,"unique":false},"channel_kind":{"type":"TEXT","notNull":false,"unique":false},"client_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"opened_by_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"project_id":{"type":"TEXT","notNull":false,"unique":false},"binding_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_channel_bindings","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"thread_key":{"type":"TEXT","notNull":false,"unique":false},"plan_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_plans","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"plan_snapshot":{"type":"TEXT","notNull":false,"unique":false},"assigned_specialist_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_specialists","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"assigned_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"preferred_specialist_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_specialists","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"escalation_level":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"escalated_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"acknowledged_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"first_responded_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"human_requested_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"resolved_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"resolved_by_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"resolution_kind":{"type":"TEXT","notNull":false,"unique":false},"resolution_summary":{"type":"TEXT","notNull":false,"unique":false},"closed_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"reopen_count":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"last_reopened_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"ai_enabled":{"type":"BOOLEAN","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_cases_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"support_cases_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_cases_client_profile_id_idx","columns":["client_profile_id"]},{"name":"support_cases_opened_by_profile_id_idx","columns":["opened_by_profile_id"]},{"name":"support_cases_binding_id_idx","columns":["binding_id"]},{"name":"support_cases_plan_id_idx","columns":["plan_id"]},{"name":"support_cases_assigned_specialist_id_idx","columns":["assigned_specialist_id"]},{"name":"support_cases_preferred_specialist_id_idx","columns":["preferred_specialist_id"]},{"name":"support_cases_resolved_by_profile_id_idx","columns":["resolved_by_profile_id"]}],"version":"b83a4283"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportCaseCollection":{"name":"supportcasecollection","className":"SupportCaseCollection","qualifiedName":"@happyvertical/smrt-support:SupportCaseCollection","collection":"supportcases","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-case.ts","packageName":"@happyvertical/smrt-support","fields":{},"methods":{"findOpenByThreadKey":{"name":"findOpenByThreadKey","async":true,"parameters":[{"name":"threadKey","type":"string","optional":false},{"name":"options","type":"object","optional":true,"memberTypes":["string | null"]}],"returnType":"Promise<SupportCase | null>","isStatic":false,"isPublic":true},"findQueue":{"name":"findQueue","async":true,"parameters":[{"name":"options","type":"object","optional":true,"memberTypes":["SupportCaseStatus | SupportCaseStatus[]","string | null","string","boolean","number"]}],"returnType":"Promise<SupportCase[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_cases","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SupportCase","exportName":"SupportCaseCollection","collectionExportName":"SupportCaseCollectionCollection","collectionOf":"@happyvertical/smrt-support:SupportCase","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"support_cases","ddl":"CREATE TABLE IF NOT EXISTS \\"support_cases\\" (\\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 \\"case_number\\" TEXT,\\n \\"subject\\" TEXT,\\n \\"description\\" TEXT,\\n \\"status\\" TEXT,\\n \\"priority\\" TEXT,\\n \\"severity\\" TEXT,\\n \\"category\\" TEXT,\\n \\"sensitive\\" BOOLEAN,\\n \\"channel_kind\\" TEXT,\\n \\"client_profile_id\\" UUID,\\n \\"opened_by_profile_id\\" UUID,\\n \\"project_id\\" TEXT,\\n \\"binding_id\\" UUID,\\n \\"thread_key\\" TEXT,\\n \\"plan_id\\" UUID,\\n \\"plan_snapshot\\" TEXT,\\n \\"assigned_specialist_id\\" UUID,\\n \\"assigned_at\\" TIMESTAMP,\\n \\"preferred_specialist_id\\" UUID,\\n \\"escalation_level\\" INTEGER DEFAULT 0,\\n \\"escalated_at\\" TIMESTAMP,\\n \\"acknowledged_at\\" TIMESTAMP,\\n \\"first_responded_at\\" TIMESTAMP,\\n \\"human_requested_at\\" TIMESTAMP,\\n \\"resolved_at\\" TIMESTAMP,\\n \\"resolved_by_profile_id\\" UUID,\\n \\"resolution_kind\\" TEXT,\\n \\"resolution_summary\\" TEXT,\\n \\"closed_at\\" TIMESTAMP,\\n \\"reopen_count\\" INTEGER DEFAULT 0,\\n \\"last_reopened_at\\" TIMESTAMP,\\n \\"ai_enabled\\" BOOLEAN,\\n \\"metadata\\" 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":false,"unique":false},"case_number":{"type":"TEXT","notNull":false,"unique":false},"subject":{"type":"TEXT","notNull":false,"unique":false},"description":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"priority":{"type":"TEXT","notNull":false,"unique":false},"severity":{"type":"TEXT","notNull":false,"unique":false},"category":{"type":"TEXT","notNull":false,"unique":false},"sensitive":{"type":"BOOLEAN","notNull":false,"unique":false},"channel_kind":{"type":"TEXT","notNull":false,"unique":false},"client_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"opened_by_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"project_id":{"type":"TEXT","notNull":false,"unique":false},"binding_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_channel_bindings","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"thread_key":{"type":"TEXT","notNull":false,"unique":false},"plan_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_plans","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"plan_snapshot":{"type":"TEXT","notNull":false,"unique":false},"assigned_specialist_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_specialists","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"assigned_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"preferred_specialist_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_specialists","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"escalation_level":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"escalated_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"acknowledged_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"first_responded_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"human_requested_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"resolved_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"resolved_by_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"resolution_kind":{"type":"TEXT","notNull":false,"unique":false},"resolution_summary":{"type":"TEXT","notNull":false,"unique":false},"closed_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"reopen_count":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"last_reopened_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"ai_enabled":{"type":"BOOLEAN","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_cases_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"support_cases_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_cases_client_profile_id_idx","columns":["client_profile_id"]},{"name":"support_cases_opened_by_profile_id_idx","columns":["opened_by_profile_id"]},{"name":"support_cases_binding_id_idx","columns":["binding_id"]},{"name":"support_cases_plan_id_idx","columns":["plan_id"]},{"name":"support_cases_assigned_specialist_id_idx","columns":["assigned_specialist_id"]},{"name":"support_cases_preferred_specialist_id_idx","columns":["preferred_specialist_id"]},{"name":"support_cases_resolved_by_profile_id_idx","columns":["resolved_by_profile_id"]}],"version":"b83a4283"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportChannelBinding":{"name":"supportchannelbinding","className":"SupportChannelBinding","qualifiedName":"@happyvertical/smrt-support:SupportChannelBinding","collection":"supportchannelbindings","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-channel-binding.ts","packageName":"@happyvertical/smrt-support","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}}},"name":{"type":"text","required":false,"default":""},"bindingKind":{"type":"text","required":false,"_meta":{},"enum":["chat_room","email_account"]},"channelKind":{"type":"text","required":false,"_meta":{},"enum":["chat","email","phone","voice","web","api"]},"targetType":{"type":"text","required":false,"_meta":{}},"targetId":{"type":"text","required":false,"_meta":{}},"clientProfileId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-profiles:Profile","_meta":{"nullable":true}},"projectId":{"type":"text","required":false,"_meta":{"nullable":true}},"planId":{"type":"foreignKey","required":false,"related":"SupportPlan"},"enabled":{"type":"boolean","required":false,"_meta":{}},"selfAddresses":{"type":"text","required":false,"_meta":{}},"metadata":{"type":"text","required":false,"_meta":{}}},"methods":{"getSelfAddresses":{"name":"getSelfAddresses","async":false,"parameters":[],"returnType":"string[]","isStatic":false,"isPublic":true},"setSelfAddresses":{"name":"setSelfAddresses","async":false,"parameters":[{"name":"addresses","type":"string[]","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"getMetadata":{"name":"getMetadata","async":false,"parameters":[],"returnType":"Record<string, unknown>","isStatic":false,"isPublic":true},"setMetadata":{"name":"setMetadata","async":false,"parameters":[{"name":"value","type":"Record<string, unknown>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_channel_bindings","api":{"include":["list","get","create","update","delete"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"conflictColumns":["target_type","target_id"],"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"SupportChannelBinding","collectionExportName":"SupportChannelBindingCollection","displayLabelField":"name","schema":{"tableName":"support_channel_bindings","ddl":"CREATE TABLE IF NOT EXISTS \\"support_channel_bindings\\" (\\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 \\"name\\" TEXT DEFAULT '',\\n \\"binding_kind\\" TEXT,\\n \\"channel_kind\\" TEXT,\\n \\"target_type\\" TEXT,\\n \\"target_id\\" TEXT,\\n \\"client_profile_id\\" UUID,\\n \\"project_id\\" TEXT,\\n \\"plan_id\\" UUID,\\n \\"enabled\\" BOOLEAN,\\n \\"self_addresses\\" TEXT,\\n \\"metadata\\" 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":false,"unique":false},"name":{"type":"TEXT","notNull":false,"unique":false,"default":""},"binding_kind":{"type":"TEXT","notNull":false,"unique":false},"channel_kind":{"type":"TEXT","notNull":false,"unique":false},"target_type":{"type":"TEXT","notNull":false,"unique":false},"target_id":{"type":"TEXT","notNull":false,"unique":false},"client_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"project_id":{"type":"TEXT","notNull":false,"unique":false},"plan_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_plans","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"enabled":{"type":"BOOLEAN","notNull":false,"unique":false},"self_addresses":{"type":"TEXT","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_channel_bindings_target_type_target_id_idx","columns":["target_type","target_id"],"unique":true,"nullsNotDistinct":true},{"name":"support_channel_bindings_slug_context_idx","columns":["slug","context"]},{"name":"support_channel_bindings_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_channel_bindings_client_profile_id_idx","columns":["client_profile_id"]},{"name":"support_channel_bindings_plan_id_idx","columns":["plan_id"]}],"version":"f162d069"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportChannelBindingCollection":{"name":"supportchannelbindingcollection","className":"SupportChannelBindingCollection","qualifiedName":"@happyvertical/smrt-support:SupportChannelBindingCollection","collection":"supportchannelbindings","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-channel-binding.ts","packageName":"@happyvertical/smrt-support","fields":{},"methods":{"findForTarget":{"name":"findForTarget","async":true,"parameters":[{"name":"targetType","type":"string","optional":false},{"name":"targetId","type":"string","optional":false}],"returnType":"Promise<SupportChannelBinding | null>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_channel_bindings","api":{"include":["list","get","create","update","delete"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SupportChannelBinding","exportName":"SupportChannelBindingCollection","collectionExportName":"SupportChannelBindingCollectionCollection","collectionOf":"@happyvertical/smrt-support:SupportChannelBinding","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"support_channel_bindings","ddl":"CREATE TABLE IF NOT EXISTS \\"support_channel_bindings\\" (\\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 \\"name\\" TEXT DEFAULT '',\\n \\"binding_kind\\" TEXT,\\n \\"channel_kind\\" TEXT,\\n \\"target_type\\" TEXT,\\n \\"target_id\\" TEXT,\\n \\"client_profile_id\\" UUID,\\n \\"project_id\\" TEXT,\\n \\"plan_id\\" UUID,\\n \\"enabled\\" BOOLEAN,\\n \\"self_addresses\\" TEXT,\\n \\"metadata\\" 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":false,"unique":false},"name":{"type":"TEXT","notNull":false,"unique":false,"default":""},"binding_kind":{"type":"TEXT","notNull":false,"unique":false},"channel_kind":{"type":"TEXT","notNull":false,"unique":false},"target_type":{"type":"TEXT","notNull":false,"unique":false},"target_id":{"type":"TEXT","notNull":false,"unique":false},"client_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"project_id":{"type":"TEXT","notNull":false,"unique":false},"plan_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_plans","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"enabled":{"type":"BOOLEAN","notNull":false,"unique":false},"self_addresses":{"type":"TEXT","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_channel_bindings_target_type_target_id_idx","columns":["target_type","target_id"],"unique":true,"nullsNotDistinct":true},{"name":"support_channel_bindings_slug_context_idx","columns":["slug","context"]},{"name":"support_channel_bindings_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_channel_bindings_client_profile_id_idx","columns":["client_profile_id"]},{"name":"support_channel_bindings_plan_id_idx","columns":["plan_id"]}],"version":"f162d069"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportCompensationPlan":{"name":"supportcompensationplan","className":"SupportCompensationPlan","qualifiedName":"@happyvertical/smrt-support:SupportCompensationPlan","collection":"supportcompensationplans","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-compensation-plan.ts","packageName":"@happyvertical/smrt-support","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}}},"specialistId":{"type":"foreignKey","required":false,"related":"SupportSpecialist"},"name":{"type":"text","required":false,"default":""},"hourlyRate":{"type":"decimal","required":false,"default":0},"currency":{"type":"text","required":false,"_meta":{}},"effectiveFrom":{"type":"datetime","required":false},"effectiveTo":{"type":"datetime","required":false},"status":{"type":"text","required":false,"_meta":{}},"terms":{"type":"text","required":false,"_meta":{}}},"methods":{"getTerms":{"name":"getTerms","async":false,"parameters":[],"returnType":"Record<string, unknown>","isStatic":false,"isPublic":true},"setTerms":{"name":"setTerms","async":false,"parameters":[{"name":"value","type":"Record<string, unknown>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"isEffectiveAt":{"name":"isEffectiveAt","async":false,"parameters":[{"name":"at","type":"Date","optional":true}],"returnType":"boolean","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_compensation_plans","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"conflictColumns":["tenant_id","specialist_id","effective_from"],"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"SupportCompensationPlan","collectionExportName":"SupportCompensationPlanCollection","displayLabelField":"name","schema":{"tableName":"support_compensation_plans","ddl":"CREATE TABLE IF NOT EXISTS \\"support_compensation_plans\\" (\\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 \\"specialist_id\\" UUID,\\n \\"name\\" TEXT DEFAULT '',\\n \\"hourly_rate\\" REAL DEFAULT 0,\\n \\"currency\\" TEXT,\\n \\"effective_from\\" TIMESTAMP,\\n \\"effective_to\\" TIMESTAMP,\\n \\"status\\" TEXT,\\n \\"terms\\" 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":false,"unique":false},"specialist_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_specialists","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"name":{"type":"TEXT","notNull":false,"unique":false,"default":""},"hourly_rate":{"type":"REAL","notNull":false,"unique":false,"default":0},"currency":{"type":"TEXT","notNull":false,"unique":false},"effective_from":{"type":"TIMESTAMP","notNull":false,"unique":false},"effective_to":{"type":"TIMESTAMP","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"terms":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_compensation_plans_tenant_id_specialist_id_idx","columns":["tenant_id","specialist_id","effective_from"],"unique":true,"nullsNotDistinct":true},{"name":"support_compensation_plans_slug_context_idx","columns":["slug","context"]},{"name":"support_compensation_plans_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_compensation_plans_specialist_id_idx","columns":["specialist_id"]}],"version":"1c6b40cd"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportCompensationPlanCollection":{"name":"supportcompensationplancollection","className":"SupportCompensationPlanCollection","qualifiedName":"@happyvertical/smrt-support:SupportCompensationPlanCollection","collection":"supportcompensationplans","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-compensation-plan.ts","packageName":"@happyvertical/smrt-support","fields":{},"methods":{"resolveForSpecialist":{"name":"resolveForSpecialist","async":true,"parameters":[{"name":"specialistId","type":"string","optional":false},{"name":"at","type":"Date","optional":true},{"name":"options","type":"object","optional":true,"memberTypes":["string | null"]}],"returnType":"Promise<SupportCompensationPlan | null>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_compensation_plans","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SupportCompensationPlan","exportName":"SupportCompensationPlanCollection","collectionExportName":"SupportCompensationPlanCollectionCollection","collectionOf":"@happyvertical/smrt-support:SupportCompensationPlan","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"support_compensation_plans","ddl":"CREATE TABLE IF NOT EXISTS \\"support_compensation_plans\\" (\\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 \\"specialist_id\\" UUID,\\n \\"name\\" TEXT DEFAULT '',\\n \\"hourly_rate\\" REAL DEFAULT 0,\\n \\"currency\\" TEXT,\\n \\"effective_from\\" TIMESTAMP,\\n \\"effective_to\\" TIMESTAMP,\\n \\"status\\" TEXT,\\n \\"terms\\" 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":false,"unique":false},"specialist_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_specialists","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"name":{"type":"TEXT","notNull":false,"unique":false,"default":""},"hourly_rate":{"type":"REAL","notNull":false,"unique":false,"default":0},"currency":{"type":"TEXT","notNull":false,"unique":false},"effective_from":{"type":"TIMESTAMP","notNull":false,"unique":false},"effective_to":{"type":"TIMESTAMP","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"terms":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_compensation_plans_tenant_id_specialist_id_idx","columns":["tenant_id","specialist_id","effective_from"],"unique":true,"nullsNotDistinct":true},{"name":"support_compensation_plans_slug_context_idx","columns":["slug","context"]},{"name":"support_compensation_plans_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_compensation_plans_specialist_id_idx","columns":["specialist_id"]}],"version":"1c6b40cd"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportInteraction":{"name":"supportinteraction","className":"SupportInteraction","qualifiedName":"@happyvertical/smrt-support:SupportInteraction","collection":"supportinteractions","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-interaction.ts","packageName":"@happyvertical/smrt-support","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}}},"caseId":{"type":"foreignKey","required":true,"related":"SupportCase","description":"The ticket this message belongs to.","_meta":{"description":"The ticket this message belongs to.","required":true}},"direction":{"type":"text","required":false,"description":"Whether the customer sent it or your team did.","_meta":{"description":"Whether the customer sent it or your team did."},"enum":["inbound","outbound","internal"]},"channelKind":{"type":"text","required":false,"_meta":{},"enum":["chat","email","phone","voice","web","api"]},"actorKind":{"type":"text","required":false,"_meta":{},"enum":["client","specialist","agent","system"]},"authorProfileId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-profiles:Profile","_meta":{"nullable":true}},"occurredAt":{"type":"datetime","required":false,"description":"When the message was sent.","_meta":{"description":"When the message was sent."}},"body":{"type":"text","required":false,"description":"What the message says.","_meta":{"description":"What the message says."}},"sourceType":{"type":"text","required":false,"_meta":{"nullable":true}},"sourceId":{"type":"text","required":false,"_meta":{"nullable":true}},"sourceKey":{"type":"text","required":false,"_meta":{}},"rfcMessageId":{"type":"text","required":false,"_meta":{}},"metadata":{"type":"text","required":false,"_meta":{}}},"methods":{"getMetadata":{"name":"getMetadata","async":false,"parameters":[],"returnType":"Record<string, unknown>","isStatic":false,"isPublic":true},"setMetadata":{"name":"setMetadata","async":false,"parameters":[{"name":"value","type":"Record<string, unknown>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_interactions","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"conflictColumns":["source_key"],"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"SupportInteraction","collectionExportName":"SupportInteractionCollection","validationRules":[{"field":"caseId","rule":"required","fieldType":"foreignKey"}],"schema":{"tableName":"support_interactions","ddl":"CREATE TABLE IF NOT EXISTS \\"support_interactions\\" (\\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 \\"case_id\\" UUID NOT NULL,\\n \\"direction\\" TEXT,\\n \\"channel_kind\\" TEXT,\\n \\"actor_kind\\" TEXT,\\n \\"author_profile_id\\" UUID,\\n \\"occurred_at\\" TIMESTAMP,\\n \\"body\\" TEXT,\\n \\"source_type\\" TEXT,\\n \\"source_id\\" TEXT,\\n \\"source_key\\" TEXT,\\n \\"rfc_message_id\\" TEXT,\\n \\"metadata\\" 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":false,"unique":false},"case_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"support_cases","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"direction":{"type":"TEXT","notNull":false,"unique":false},"channel_kind":{"type":"TEXT","notNull":false,"unique":false},"actor_kind":{"type":"TEXT","notNull":false,"unique":false},"author_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"occurred_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"body":{"type":"TEXT","notNull":false,"unique":false},"source_type":{"type":"TEXT","notNull":false,"unique":false},"source_id":{"type":"TEXT","notNull":false,"unique":false},"source_key":{"type":"TEXT","notNull":false,"unique":false},"rfc_message_id":{"type":"TEXT","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_interactions_source_key_idx","columns":["source_key"],"unique":true,"nullsNotDistinct":true},{"name":"support_interactions_slug_context_idx","columns":["slug","context"]},{"name":"support_interactions_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_interactions_case_id_idx","columns":["case_id"]},{"name":"support_interactions_author_profile_id_idx","columns":["author_profile_id"]}],"version":"83ae00a1"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportInteractionCollection":{"name":"supportinteractioncollection","className":"SupportInteractionCollection","qualifiedName":"@happyvertical/smrt-support:SupportInteractionCollection","collection":"supportinteractions","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-interaction.ts","packageName":"@happyvertical/smrt-support","fields":{},"methods":{"forCase":{"name":"forCase","async":true,"parameters":[{"name":"caseId","type":"string","optional":false}],"returnType":"Promise<SupportInteraction[]>","isStatic":false,"isPublic":true},"bySourceKey":{"name":"bySourceKey","async":true,"parameters":[{"name":"sourceKey","type":"string","optional":false}],"returnType":"Promise<SupportInteraction | null>","isStatic":false,"isPublic":true},"byRfcMessageId":{"name":"byRfcMessageId","async":true,"parameters":[{"name":"rfcMessageId","type":"string","optional":false}],"returnType":"Promise<SupportInteraction | null>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_interactions","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SupportInteraction","exportName":"SupportInteractionCollection","collectionExportName":"SupportInteractionCollectionCollection","collectionOf":"@happyvertical/smrt-support:SupportInteraction","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"support_interactions","ddl":"CREATE TABLE IF NOT EXISTS \\"support_interactions\\" (\\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 \\"case_id\\" UUID NOT NULL,\\n \\"direction\\" TEXT,\\n \\"channel_kind\\" TEXT,\\n \\"actor_kind\\" TEXT,\\n \\"author_profile_id\\" UUID,\\n \\"occurred_at\\" TIMESTAMP,\\n \\"body\\" TEXT,\\n \\"source_type\\" TEXT,\\n \\"source_id\\" TEXT,\\n \\"source_key\\" TEXT,\\n \\"rfc_message_id\\" TEXT,\\n \\"metadata\\" 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":false,"unique":false},"case_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"support_cases","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"direction":{"type":"TEXT","notNull":false,"unique":false},"channel_kind":{"type":"TEXT","notNull":false,"unique":false},"actor_kind":{"type":"TEXT","notNull":false,"unique":false},"author_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"occurred_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"body":{"type":"TEXT","notNull":false,"unique":false},"source_type":{"type":"TEXT","notNull":false,"unique":false},"source_id":{"type":"TEXT","notNull":false,"unique":false},"source_key":{"type":"TEXT","notNull":false,"unique":false},"rfc_message_id":{"type":"TEXT","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_interactions_source_key_idx","columns":["source_key"],"unique":true,"nullsNotDistinct":true},{"name":"support_interactions_slug_context_idx","columns":["slug","context"]},{"name":"support_interactions_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_interactions_case_id_idx","columns":["case_id"]},{"name":"support_interactions_author_profile_id_idx","columns":["author_profile_id"]}],"version":"83ae00a1"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportPlan":{"name":"supportplan","className":"SupportPlan","qualifiedName":"@happyvertical/smrt-support:SupportPlan","collection":"supportplans","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-plan.ts","packageName":"@happyvertical/smrt-support","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}}},"planKey":{"type":"text","required":false,"_meta":{}},"name":{"type":"text","required":false,"default":""},"description":{"type":"text","required":false,"_meta":{}},"status":{"type":"text","required":false,"_meta":{}},"channels":{"type":"text","required":false,"_meta":{}},"timezone":{"type":"text","required":false,"_meta":{}},"coverage":{"type":"text","required":false,"_meta":{}},"holidays":{"type":"text","required":false,"_meta":{}},"severityDefinitions":{"type":"text","required":false,"_meta":{}},"targets":{"type":"text","required":false,"_meta":{}},"pauseStatuses":{"type":"text","required":false,"_meta":{}},"escalationPolicy":{"type":"text","required":false,"_meta":{}},"availabilityFeeAmount":{"type":"integer","required":false,"default":0},"currency":{"type":"text","required":false,"_meta":{}},"includedMinutes":{"type":"integer","required":false,"default":0},"overageHourlyRate":{"type":"decimal","required":false,"default":0},"onCallHourlyRate":{"type":"decimal","required":false,"default":0},"timeApprovalPolicy":{"type":"text","required":false,"_meta":{}},"subscriptionPlanKey":{"type":"text","required":false,"_meta":{}},"metadata":{"type":"text","required":false,"_meta":{}}},"methods":{"getChannels":{"name":"getChannels","async":false,"parameters":[],"returnType":"string[]","isStatic":false,"isPublic":true},"setChannels":{"name":"setChannels","async":false,"parameters":[{"name":"channels","type":"string[]","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"getCoverage":{"name":"getCoverage","async":false,"parameters":[],"returnType":"CoverageWindow[]","isStatic":false,"isPublic":true},"setCoverage":{"name":"setCoverage","async":false,"parameters":[{"name":"windows","type":"CoverageWindow[]","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"getHolidays":{"name":"getHolidays","async":false,"parameters":[],"returnType":"string[]","isStatic":false,"isPublic":true},"setHolidays":{"name":"setHolidays","async":false,"parameters":[{"name":"dates","type":"string[]","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"getSeverityDefinitions":{"name":"getSeverityDefinitions","async":false,"parameters":[],"returnType":"Record<string, SeverityDefinition>","isStatic":false,"isPublic":true},"setSeverityDefinitions":{"name":"setSeverityDefinitions","async":false,"parameters":[{"name":"defs","type":"Record<string, SeverityDefinition>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"getTargets":{"name":"getTargets","async":false,"parameters":[],"returnType":"Record<string, Partial<ServiceTargetMinutes>>","isStatic":false,"isPublic":true},"setTargets":{"name":"setTargets","async":false,"parameters":[{"name":"targets","type":"Record<string, Partial<ServiceTargetMinutes>>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"targetsForSeverity":{"name":"targetsForSeverity","async":false,"parameters":[{"name":"severity","type":"string","optional":false}],"returnType":"ServiceTargetMinutes","isStatic":false,"isPublic":true},"getPauseStatuses":{"name":"getPauseStatuses","async":false,"parameters":[],"returnType":"string[]","isStatic":false,"isPublic":true},"setPauseStatuses":{"name":"setPauseStatuses","async":false,"parameters":[{"name":"statuses","type":"string[]","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"getEscalationPolicy":{"name":"getEscalationPolicy","async":false,"parameters":[],"returnType":"EscalationStep[]","isStatic":false,"isPublic":true},"setEscalationPolicy":{"name":"setEscalationPolicy","async":false,"parameters":[{"name":"steps","type":"EscalationStep[]","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"getTimeApprovalPolicy":{"name":"getTimeApprovalPolicy","async":false,"parameters":[],"returnType":"TimeApprovalPolicy","isStatic":false,"isPublic":true},"setTimeApprovalPolicy":{"name":"setTimeApprovalPolicy","async":false,"parameters":[{"name":"policy","type":"TimeApprovalPolicy","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"getMetadata":{"name":"getMetadata","async":false,"parameters":[],"returnType":"Record<string, unknown>","isStatic":false,"isPublic":true},"setMetadata":{"name":"setMetadata","async":false,"parameters":[{"name":"value","type":"Record<string, unknown>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"snapshotTerms":{"name":"snapshotTerms","async":false,"parameters":[],"returnType":"Record<string, unknown>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_plans","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"conflictColumns":["tenant_id","plan_key"],"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"SupportPlan","collectionExportName":"SupportPlanCollection","displayLabelField":"name","schema":{"tableName":"support_plans","ddl":"CREATE TABLE IF NOT EXISTS \\"support_plans\\" (\\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 \\"plan_key\\" TEXT,\\n \\"name\\" TEXT DEFAULT '',\\n \\"description\\" TEXT,\\n \\"status\\" TEXT,\\n \\"channels\\" TEXT,\\n \\"timezone\\" TEXT,\\n \\"coverage\\" TEXT,\\n \\"holidays\\" TEXT,\\n \\"severity_definitions\\" TEXT,\\n \\"targets\\" TEXT,\\n \\"pause_statuses\\" TEXT,\\n \\"escalation_policy\\" TEXT,\\n \\"availability_fee_amount\\" INTEGER DEFAULT 0,\\n \\"currency\\" TEXT,\\n \\"included_minutes\\" INTEGER DEFAULT 0,\\n \\"overage_hourly_rate\\" REAL DEFAULT 0,\\n \\"on_call_hourly_rate\\" REAL DEFAULT 0,\\n \\"time_approval_policy\\" TEXT,\\n \\"subscription_plan_key\\" TEXT,\\n \\"metadata\\" 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":false,"unique":false},"plan_key":{"type":"TEXT","notNull":false,"unique":false},"name":{"type":"TEXT","notNull":false,"unique":false,"default":""},"description":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"channels":{"type":"TEXT","notNull":false,"unique":false},"timezone":{"type":"TEXT","notNull":false,"unique":false},"coverage":{"type":"TEXT","notNull":false,"unique":false},"holidays":{"type":"TEXT","notNull":false,"unique":false},"severity_definitions":{"type":"TEXT","notNull":false,"unique":false},"targets":{"type":"TEXT","notNull":false,"unique":false},"pause_statuses":{"type":"TEXT","notNull":false,"unique":false},"escalation_policy":{"type":"TEXT","notNull":false,"unique":false},"availability_fee_amount":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"currency":{"type":"TEXT","notNull":false,"unique":false},"included_minutes":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"overage_hourly_rate":{"type":"REAL","notNull":false,"unique":false,"default":0},"on_call_hourly_rate":{"type":"REAL","notNull":false,"unique":false,"default":0},"time_approval_policy":{"type":"TEXT","notNull":false,"unique":false},"subscription_plan_key":{"type":"TEXT","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_plans_tenant_id_plan_key_idx","columns":["tenant_id","plan_key"],"unique":true,"nullsNotDistinct":true},{"name":"support_plans_slug_context_idx","columns":["slug","context"]},{"name":"support_plans_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"492a9cf6"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportPlanCollection":{"name":"supportplancollection","className":"SupportPlanCollection","qualifiedName":"@happyvertical/smrt-support:SupportPlanCollection","collection":"supportplans","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-plan.ts","packageName":"@happyvertical/smrt-support","fields":{},"methods":{"byPlanKey":{"name":"byPlanKey","async":true,"parameters":[{"name":"planKey","type":"string","optional":false}],"returnType":"Promise<SupportPlan | null>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_plans","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SupportPlan","exportName":"SupportPlanCollection","collectionExportName":"SupportPlanCollectionCollection","collectionOf":"@happyvertical/smrt-support:SupportPlan","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"support_plans","ddl":"CREATE TABLE IF NOT EXISTS \\"support_plans\\" (\\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 \\"plan_key\\" TEXT,\\n \\"name\\" TEXT DEFAULT '',\\n \\"description\\" TEXT,\\n \\"status\\" TEXT,\\n \\"channels\\" TEXT,\\n \\"timezone\\" TEXT,\\n \\"coverage\\" TEXT,\\n \\"holidays\\" TEXT,\\n \\"severity_definitions\\" TEXT,\\n \\"targets\\" TEXT,\\n \\"pause_statuses\\" TEXT,\\n \\"escalation_policy\\" TEXT,\\n \\"availability_fee_amount\\" INTEGER DEFAULT 0,\\n \\"currency\\" TEXT,\\n \\"included_minutes\\" INTEGER DEFAULT 0,\\n \\"overage_hourly_rate\\" REAL DEFAULT 0,\\n \\"on_call_hourly_rate\\" REAL DEFAULT 0,\\n \\"time_approval_policy\\" TEXT,\\n \\"subscription_plan_key\\" TEXT,\\n \\"metadata\\" 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":false,"unique":false},"plan_key":{"type":"TEXT","notNull":false,"unique":false},"name":{"type":"TEXT","notNull":false,"unique":false,"default":""},"description":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"channels":{"type":"TEXT","notNull":false,"unique":false},"timezone":{"type":"TEXT","notNull":false,"unique":false},"coverage":{"type":"TEXT","notNull":false,"unique":false},"holidays":{"type":"TEXT","notNull":false,"unique":false},"severity_definitions":{"type":"TEXT","notNull":false,"unique":false},"targets":{"type":"TEXT","notNull":false,"unique":false},"pause_statuses":{"type":"TEXT","notNull":false,"unique":false},"escalation_policy":{"type":"TEXT","notNull":false,"unique":false},"availability_fee_amount":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"currency":{"type":"TEXT","notNull":false,"unique":false},"included_minutes":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"overage_hourly_rate":{"type":"REAL","notNull":false,"unique":false,"default":0},"on_call_hourly_rate":{"type":"REAL","notNull":false,"unique":false,"default":0},"time_approval_policy":{"type":"TEXT","notNull":false,"unique":false},"subscription_plan_key":{"type":"TEXT","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_plans_tenant_id_plan_key_idx","columns":["tenant_id","plan_key"],"unique":true,"nullsNotDistinct":true},{"name":"support_plans_slug_context_idx","columns":["slug","context"]},{"name":"support_plans_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"492a9cf6"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportPolicy":{"name":"supportpolicy","className":"SupportPolicy","qualifiedName":"@happyvertical/smrt-support:SupportPolicy","collection":"supportpolicies","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-policy.ts","packageName":"@happyvertical/smrt-support","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}}},"name":{"type":"text","required":false,"default":""},"planId":{"type":"foreignKey","required":false,"related":"SupportPlan"},"projectId":{"type":"text","required":false,"_meta":{"nullable":true}},"enabled":{"type":"boolean","required":false,"_meta":{}},"autoAcknowledge":{"type":"boolean","required":false,"_meta":{}},"autoClassify":{"type":"boolean","required":false,"_meta":{}},"autoAnswer":{"type":"boolean","required":false,"_meta":{}},"autoTroubleshoot":{"type":"boolean","required":false,"_meta":{}},"autoResolve":{"type":"boolean","required":false,"_meta":{}},"autoResolveMaxSeverity":{"type":"text","required":false,"_meta":{}},"confidenceThreshold":{"type":"decimal","required":false,"default":0.7},"maxAutoAttempts":{"type":"integer","required":false,"default":1},"autoSendEmailReplies":{"type":"boolean","required":false,"_meta":{}},"sensitiveCategories":{"type":"text","required":false,"_meta":{}},"allowedCategories":{"type":"text","required":false,"_meta":{}},"allowedTools":{"type":"text","required":false,"_meta":{}},"metadata":{"type":"text","required":false,"_meta":{}}},"methods":{"getSensitiveCategories":{"name":"getSensitiveCategories","async":false,"parameters":[],"returnType":"string[]","isStatic":false,"isPublic":true},"setSensitiveCategories":{"name":"setSensitiveCategories","async":false,"parameters":[{"name":"categories","type":"string[]","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"getAllowedCategories":{"name":"getAllowedCategories","async":false,"parameters":[],"returnType":"string[]","isStatic":false,"isPublic":true},"setAllowedCategories":{"name":"setAllowedCategories","async":false,"parameters":[{"name":"categories","type":"string[]","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"getAllowedTools":{"name":"getAllowedTools","async":false,"parameters":[],"returnType":"string[]","isStatic":false,"isPublic":true},"setAllowedTools":{"name":"setAllowedTools","async":false,"parameters":[{"name":"tools","type":"string[]","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"getMetadata":{"name":"getMetadata","async":false,"parameters":[],"returnType":"Record<string, unknown>","isStatic":false,"isPublic":true},"setMetadata":{"name":"setMetadata","async":false,"parameters":[{"name":"value","type":"Record<string, unknown>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"scopeRank":{"name":"scopeRank","async":false,"parameters":[],"returnType":"number","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_policies","api":{"include":["list","get","create","update","delete"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"conflictColumns":["tenant_id","name"],"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"SupportPolicy","collectionExportName":"SupportPolicyCollection","displayLabelField":"name","schema":{"tableName":"support_policies","ddl":"CREATE TABLE IF NOT EXISTS \\"support_policies\\" (\\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 \\"name\\" TEXT DEFAULT '',\\n \\"plan_id\\" UUID,\\n \\"project_id\\" TEXT,\\n \\"enabled\\" BOOLEAN,\\n \\"auto_acknowledge\\" BOOLEAN,\\n \\"auto_classify\\" BOOLEAN,\\n \\"auto_answer\\" BOOLEAN,\\n \\"auto_troubleshoot\\" BOOLEAN,\\n \\"auto_resolve\\" BOOLEAN,\\n \\"auto_resolve_max_severity\\" TEXT,\\n \\"confidence_threshold\\" REAL DEFAULT 0.7,\\n \\"max_auto_attempts\\" INTEGER DEFAULT 1,\\n \\"auto_send_email_replies\\" BOOLEAN,\\n \\"sensitive_categories\\" TEXT,\\n \\"allowed_categories\\" TEXT,\\n \\"allowed_tools\\" TEXT,\\n \\"metadata\\" 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":false,"unique":false},"name":{"type":"TEXT","notNull":false,"unique":false,"default":""},"plan_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_plans","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"project_id":{"type":"TEXT","notNull":false,"unique":false},"enabled":{"type":"BOOLEAN","notNull":false,"unique":false},"auto_acknowledge":{"type":"BOOLEAN","notNull":false,"unique":false},"auto_classify":{"type":"BOOLEAN","notNull":false,"unique":false},"auto_answer":{"type":"BOOLEAN","notNull":false,"unique":false},"auto_troubleshoot":{"type":"BOOLEAN","notNull":false,"unique":false},"auto_resolve":{"type":"BOOLEAN","notNull":false,"unique":false},"auto_resolve_max_severity":{"type":"TEXT","notNull":false,"unique":false},"confidence_threshold":{"type":"REAL","notNull":false,"unique":false,"default":0.7},"max_auto_attempts":{"type":"INTEGER","notNull":false,"unique":false,"default":1},"auto_send_email_replies":{"type":"BOOLEAN","notNull":false,"unique":false},"sensitive_categories":{"type":"TEXT","notNull":false,"unique":false},"allowed_categories":{"type":"TEXT","notNull":false,"unique":false},"allowed_tools":{"type":"TEXT","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_policies_tenant_id_name_idx","columns":["tenant_id","name"],"unique":true,"nullsNotDistinct":true},{"name":"support_policies_slug_context_idx","columns":["slug","context"]},{"name":"support_policies_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_policies_plan_id_idx","columns":["plan_id"]}],"version":"db53199e"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportPolicyCollection":{"name":"supportpolicycollection","className":"SupportPolicyCollection","qualifiedName":"@happyvertical/smrt-support:SupportPolicyCollection","collection":"supportpolicies","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-policy.ts","packageName":"@happyvertical/smrt-support","fields":{},"methods":{"resolveForScope":{"name":"resolveForScope","async":true,"parameters":[{"name":"options","type":"object","optional":false,"memberTypes":["string | null"]}],"returnType":"Promise<SupportPolicy | null>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_policies","api":{"include":["list","get","create","update","delete"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SupportPolicy","exportName":"SupportPolicyCollection","collectionExportName":"SupportPolicyCollectionCollection","collectionOf":"@happyvertical/smrt-support:SupportPolicy","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"support_policies","ddl":"CREATE TABLE IF NOT EXISTS \\"support_policies\\" (\\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 \\"name\\" TEXT DEFAULT '',\\n \\"plan_id\\" UUID,\\n \\"project_id\\" TEXT,\\n \\"enabled\\" BOOLEAN,\\n \\"auto_acknowledge\\" BOOLEAN,\\n \\"auto_classify\\" BOOLEAN,\\n \\"auto_answer\\" BOOLEAN,\\n \\"auto_troubleshoot\\" BOOLEAN,\\n \\"auto_resolve\\" BOOLEAN,\\n \\"auto_resolve_max_severity\\" TEXT,\\n \\"confidence_threshold\\" REAL DEFAULT 0.7,\\n \\"max_auto_attempts\\" INTEGER DEFAULT 1,\\n \\"auto_send_email_replies\\" BOOLEAN,\\n \\"sensitive_categories\\" TEXT,\\n \\"allowed_categories\\" TEXT,\\n \\"allowed_tools\\" TEXT,\\n \\"metadata\\" 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":false,"unique":false},"name":{"type":"TEXT","notNull":false,"unique":false,"default":""},"plan_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_plans","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"project_id":{"type":"TEXT","notNull":false,"unique":false},"enabled":{"type":"BOOLEAN","notNull":false,"unique":false},"auto_acknowledge":{"type":"BOOLEAN","notNull":false,"unique":false},"auto_classify":{"type":"BOOLEAN","notNull":false,"unique":false},"auto_answer":{"type":"BOOLEAN","notNull":false,"unique":false},"auto_troubleshoot":{"type":"BOOLEAN","notNull":false,"unique":false},"auto_resolve":{"type":"BOOLEAN","notNull":false,"unique":false},"auto_resolve_max_severity":{"type":"TEXT","notNull":false,"unique":false},"confidence_threshold":{"type":"REAL","notNull":false,"unique":false,"default":0.7},"max_auto_attempts":{"type":"INTEGER","notNull":false,"unique":false,"default":1},"auto_send_email_replies":{"type":"BOOLEAN","notNull":false,"unique":false},"sensitive_categories":{"type":"TEXT","notNull":false,"unique":false},"allowed_categories":{"type":"TEXT","notNull":false,"unique":false},"allowed_tools":{"type":"TEXT","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_policies_tenant_id_name_idx","columns":["tenant_id","name"],"unique":true,"nullsNotDistinct":true},{"name":"support_policies_slug_context_idx","columns":["slug","context"]},{"name":"support_policies_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_policies_plan_id_idx","columns":["plan_id"]}],"version":"db53199e"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportServiceTarget":{"name":"supportservicetarget","className":"SupportServiceTarget","qualifiedName":"@happyvertical/smrt-support:SupportServiceTarget","collection":"supportservicetargets","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-service-target.ts","packageName":"@happyvertical/smrt-support","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}}},"caseId":{"type":"foreignKey","required":true,"related":"SupportCase","_meta":{"required":true}},"targetType":{"type":"text","required":false,"_meta":{},"enum":["acknowledgement","response","update","resolution"]},"cycle":{"type":"integer","required":false,"default":0},"severity":{"type":"text","required":false,"_meta":{}},"baseMinutes":{"type":"integer","required":false,"default":0},"startedAt":{"type":"datetime","required":false},"dueAt":{"type":"datetime","required":false},"status":{"type":"text","required":false,"_meta":{},"enum":["pending","paused","satisfied","breached","cancelled"]},"pausedAt":{"type":"datetime","required":false},"pausedTotalSeconds":{"type":"integer","required":false,"default":0},"satisfiedAt":{"type":"datetime","required":false},"breachedAt":{"type":"datetime","required":false},"cancelledAt":{"type":"datetime","required":false},"escalationJobId":{"type":"text","required":false,"_meta":{}},"metadata":{"type":"text","required":false,"_meta":{}}},"methods":{"getMetadata":{"name":"getMetadata","async":false,"parameters":[],"returnType":"Record<string, unknown>","isStatic":false,"isPublic":true},"setMetadata":{"name":"setMetadata","async":false,"parameters":[{"name":"value","type":"Record<string, unknown>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"isRunning":{"name":"isRunning","async":false,"parameters":[],"returnType":"boolean","isStatic":false,"isPublic":true},"checkAndEscalate":{"name":"checkAndEscalate","async":true,"parameters":[{"name":"args","type":"Record<string, unknown>","optional":true},{"name":"_context","type":"unknown","optional":true}],"returnType":"Promise<CheckAndEscalateResult>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_service_targets","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"conflictColumns":["case_id","target_type","cycle"],"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"SupportServiceTarget","collectionExportName":"SupportServiceTargetCollection","validationRules":[{"field":"caseId","rule":"required","fieldType":"foreignKey"}],"schema":{"tableName":"support_service_targets","ddl":"CREATE TABLE IF NOT EXISTS \\"support_service_targets\\" (\\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 \\"case_id\\" UUID NOT NULL,\\n \\"target_type\\" TEXT,\\n \\"cycle\\" INTEGER DEFAULT 0,\\n \\"severity\\" TEXT,\\n \\"base_minutes\\" INTEGER DEFAULT 0,\\n \\"started_at\\" TIMESTAMP,\\n \\"due_at\\" TIMESTAMP,\\n \\"status\\" TEXT,\\n \\"paused_at\\" TIMESTAMP,\\n \\"paused_total_seconds\\" INTEGER DEFAULT 0,\\n \\"satisfied_at\\" TIMESTAMP,\\n \\"breached_at\\" TIMESTAMP,\\n \\"cancelled_at\\" TIMESTAMP,\\n \\"escalation_job_id\\" TEXT,\\n \\"metadata\\" 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":false,"unique":false},"case_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"support_cases","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"target_type":{"type":"TEXT","notNull":false,"unique":false},"cycle":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"severity":{"type":"TEXT","notNull":false,"unique":false},"base_minutes":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"started_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"due_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"paused_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"paused_total_seconds":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"satisfied_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"breached_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"cancelled_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"escalation_job_id":{"type":"TEXT","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_service_targets_case_id_target_type_idx","columns":["case_id","target_type","cycle"],"unique":true,"nullsNotDistinct":true},{"name":"support_service_targets_slug_context_idx","columns":["slug","context"]},{"name":"support_service_targets_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"40614be1"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportServiceTargetCollection":{"name":"supportservicetargetcollection","className":"SupportServiceTargetCollection","qualifiedName":"@happyvertical/smrt-support:SupportServiceTargetCollection","collection":"supportservicetargets","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-service-target.ts","packageName":"@happyvertical/smrt-support","fields":{},"methods":{"forCase":{"name":"forCase","async":true,"parameters":[{"name":"caseId","type":"string","optional":false}],"returnType":"Promise<SupportServiceTarget[]>","isStatic":false,"isPublic":true},"activeTarget":{"name":"activeTarget","async":true,"parameters":[{"name":"caseId","type":"string","optional":false},{"name":"targetType","type":"ServiceTargetType","optional":false}],"returnType":"Promise<SupportServiceTarget | null>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_service_targets","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SupportServiceTarget","exportName":"SupportServiceTargetCollection","collectionExportName":"SupportServiceTargetCollectionCollection","collectionOf":"@happyvertical/smrt-support:SupportServiceTarget","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"support_service_targets","ddl":"CREATE TABLE IF NOT EXISTS \\"support_service_targets\\" (\\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 \\"case_id\\" UUID NOT NULL,\\n \\"target_type\\" TEXT,\\n \\"cycle\\" INTEGER DEFAULT 0,\\n \\"severity\\" TEXT,\\n \\"base_minutes\\" INTEGER DEFAULT 0,\\n \\"started_at\\" TIMESTAMP,\\n \\"due_at\\" TIMESTAMP,\\n \\"status\\" TEXT,\\n \\"paused_at\\" TIMESTAMP,\\n \\"paused_total_seconds\\" INTEGER DEFAULT 0,\\n \\"satisfied_at\\" TIMESTAMP,\\n \\"breached_at\\" TIMESTAMP,\\n \\"cancelled_at\\" TIMESTAMP,\\n \\"escalation_job_id\\" TEXT,\\n \\"metadata\\" 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":false,"unique":false},"case_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"support_cases","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"target_type":{"type":"TEXT","notNull":false,"unique":false},"cycle":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"severity":{"type":"TEXT","notNull":false,"unique":false},"base_minutes":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"started_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"due_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"paused_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"paused_total_seconds":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"satisfied_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"breached_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"cancelled_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"escalation_job_id":{"type":"TEXT","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_service_targets_case_id_target_type_idx","columns":["case_id","target_type","cycle"],"unique":true,"nullsNotDistinct":true},{"name":"support_service_targets_slug_context_idx","columns":["slug","context"]},{"name":"support_service_targets_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"40614be1"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportEscalation":{"name":"supportescalation","className":"SupportEscalation","qualifiedName":"@happyvertical/smrt-support:SupportEscalation","collection":"supportescalations","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-service-target.ts","packageName":"@happyvertical/smrt-support","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}}},"caseId":{"type":"foreignKey","required":true,"related":"SupportCase","_meta":{"required":true}},"level":{"type":"integer","required":false,"default":1},"reason":{"type":"text","required":false,"_meta":{},"enum":["target_breach","target_risk","manual","ai_trigger"]},"targetId":{"type":"foreignKey","required":false,"related":"SupportServiceTarget"},"targetType":{"type":"text","required":false,"_meta":{}},"action":{"type":"text","required":false,"_meta":{}},"fromSpecialistId":{"type":"foreignKey","required":false,"related":"SupportSpecialist"},"toSpecialistId":{"type":"foreignKey","required":false,"related":"SupportSpecialist"},"notifiedProfileIds":{"type":"text","required":false,"_meta":{}},"occurredAt":{"type":"datetime","required":false},"note":{"type":"text","required":false,"_meta":{}}},"methods":{"getNotifiedProfileIds":{"name":"getNotifiedProfileIds","async":false,"parameters":[],"returnType":"string[]","isStatic":false,"isPublic":true},"setNotifiedProfileIds":{"name":"setNotifiedProfileIds","async":false,"parameters":[{"name":"ids","type":"string[]","optional":false}],"returnType":"void","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_escalations","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"SupportEscalation","collectionExportName":"SupportEscalationCollection","validationRules":[{"field":"caseId","rule":"required","fieldType":"foreignKey"}],"schema":{"tableName":"support_escalations","ddl":"CREATE TABLE IF NOT EXISTS \\"support_escalations\\" (\\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 \\"case_id\\" UUID NOT NULL,\\n \\"level\\" INTEGER DEFAULT 1,\\n \\"reason\\" TEXT,\\n \\"target_id\\" UUID,\\n \\"target_type\\" TEXT,\\n \\"action\\" TEXT,\\n \\"from_specialist_id\\" UUID,\\n \\"to_specialist_id\\" UUID,\\n \\"notified_profile_ids\\" TEXT,\\n \\"occurred_at\\" TIMESTAMP,\\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":false,"unique":false},"case_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"support_cases","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"level":{"type":"INTEGER","notNull":false,"unique":false,"default":1},"reason":{"type":"TEXT","notNull":false,"unique":false},"target_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_service_targets","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"target_type":{"type":"TEXT","notNull":false,"unique":false},"action":{"type":"TEXT","notNull":false,"unique":false},"from_specialist_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_specialists","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"to_specialist_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_specialists","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"notified_profile_ids":{"type":"TEXT","notNull":false,"unique":false},"occurred_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"note":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_escalations_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"support_escalations_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_escalations_case_id_idx","columns":["case_id"]},{"name":"support_escalations_target_id_idx","columns":["target_id"]},{"name":"support_escalations_from_specialist_id_idx","columns":["from_specialist_id"]},{"name":"support_escalations_to_specialist_id_idx","columns":["to_specialist_id"]}],"version":"493f2a61"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportEscalationCollection":{"name":"supportescalationcollection","className":"SupportEscalationCollection","qualifiedName":"@happyvertical/smrt-support:SupportEscalationCollection","collection":"supportescalations","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-service-target.ts","packageName":"@happyvertical/smrt-support","fields":{},"methods":{"forCase":{"name":"forCase","async":true,"parameters":[{"name":"caseId","type":"string","optional":false}],"returnType":"Promise<SupportEscalation[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_escalations","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SupportEscalation","exportName":"SupportEscalationCollection","collectionExportName":"SupportEscalationCollectionCollection","collectionOf":"@happyvertical/smrt-support:SupportEscalation","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"support_escalations","ddl":"CREATE TABLE IF NOT EXISTS \\"support_escalations\\" (\\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 \\"case_id\\" UUID NOT NULL,\\n \\"level\\" INTEGER DEFAULT 1,\\n \\"reason\\" TEXT,\\n \\"target_id\\" UUID,\\n \\"target_type\\" TEXT,\\n \\"action\\" TEXT,\\n \\"from_specialist_id\\" UUID,\\n \\"to_specialist_id\\" UUID,\\n \\"notified_profile_ids\\" TEXT,\\n \\"occurred_at\\" TIMESTAMP,\\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":false,"unique":false},"case_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"support_cases","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"level":{"type":"INTEGER","notNull":false,"unique":false,"default":1},"reason":{"type":"TEXT","notNull":false,"unique":false},"target_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_service_targets","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"target_type":{"type":"TEXT","notNull":false,"unique":false},"action":{"type":"TEXT","notNull":false,"unique":false},"from_specialist_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_specialists","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"to_specialist_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_specialists","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"notified_profile_ids":{"type":"TEXT","notNull":false,"unique":false},"occurred_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"note":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_escalations_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"support_escalations_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_escalations_case_id_idx","columns":["case_id"]},{"name":"support_escalations_target_id_idx","columns":["target_id"]},{"name":"support_escalations_from_specialist_id_idx","columns":["from_specialist_id"]},{"name":"support_escalations_to_specialist_id_idx","columns":["to_specialist_id"]}],"version":"493f2a61"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportCharge":{"name":"supportcharge","className":"SupportCharge","qualifiedName":"@happyvertical/smrt-support:SupportCharge","collection":"supportcharges","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-settlement.ts","packageName":"@happyvertical/smrt-support","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}}},"timeEntryId":{"type":"foreignKey","required":true,"related":"ServiceTimeEntry","_meta":{"required":true}},"caseId":{"type":"foreignKey","required":false,"related":"SupportCase"},"planId":{"type":"foreignKey","required":false,"related":"SupportPlan"},"amount":{"type":"integer","required":false,"default":0},"currency":{"type":"text","required":false,"_meta":{}},"billableSeconds":{"type":"integer","required":false,"default":0},"includedSecondsApplied":{"type":"integer","required":false,"default":0},"rateSnapshot":{"type":"text","required":false,"_meta":{}},"status":{"type":"text","required":false,"_meta":{},"enum":["pending","final","corrected","voided"]},"finalizedAt":{"type":"datetime","required":false},"metadata":{"type":"text","required":false,"_meta":{}}},"methods":{"getRateSnapshot":{"name":"getRateSnapshot","async":false,"parameters":[],"returnType":"Record<string, unknown>","isStatic":false,"isPublic":true},"setRateSnapshot":{"name":"setRateSnapshot","async":false,"parameters":[{"name":"value","type":"Record<string, unknown>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_charges","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"conflictColumns":["time_entry_id"],"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"SupportCharge","collectionExportName":"SupportChargeCollection","validationRules":[{"field":"timeEntryId","rule":"required","fieldType":"foreignKey"}],"schema":{"tableName":"support_charges","ddl":"CREATE TABLE IF NOT EXISTS \\"support_charges\\" (\\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 \\"time_entry_id\\" UUID NOT NULL,\\n \\"case_id\\" UUID,\\n \\"plan_id\\" UUID,\\n \\"amount\\" INTEGER DEFAULT 0,\\n \\"currency\\" TEXT,\\n \\"billable_seconds\\" INTEGER DEFAULT 0,\\n \\"included_seconds_applied\\" INTEGER DEFAULT 0,\\n \\"rate_snapshot\\" TEXT,\\n \\"status\\" TEXT,\\n \\"finalized_at\\" TIMESTAMP,\\n \\"metadata\\" 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":false,"unique":false},"time_entry_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"service_time_entries","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"case_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_cases","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"plan_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_plans","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"amount":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"currency":{"type":"TEXT","notNull":false,"unique":false},"billable_seconds":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"included_seconds_applied":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"rate_snapshot":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"finalized_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_charges_time_entry_id_idx","columns":["time_entry_id"],"unique":true},{"name":"support_charges_slug_context_idx","columns":["slug","context"]},{"name":"support_charges_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_charges_case_id_idx","columns":["case_id"]},{"name":"support_charges_plan_id_idx","columns":["plan_id"]}],"version":"44f149fb"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportChargeCollection":{"name":"supportchargecollection","className":"SupportChargeCollection","qualifiedName":"@happyvertical/smrt-support:SupportChargeCollection","collection":"supportcharges","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-settlement.ts","packageName":"@happyvertical/smrt-support","fields":{},"methods":{"forTimeEntry":{"name":"forTimeEntry","async":true,"parameters":[{"name":"timeEntryId","type":"string","optional":false}],"returnType":"Promise<SupportCharge | null>","isStatic":false,"isPublic":true},"forCase":{"name":"forCase","async":true,"parameters":[{"name":"caseId","type":"string","optional":false}],"returnType":"Promise<SupportCharge[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_charges","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SupportCharge","exportName":"SupportChargeCollection","collectionExportName":"SupportChargeCollectionCollection","collectionOf":"@happyvertical/smrt-support:SupportCharge","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"support_charges","ddl":"CREATE TABLE IF NOT EXISTS \\"support_charges\\" (\\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 \\"time_entry_id\\" UUID NOT NULL,\\n \\"case_id\\" UUID,\\n \\"plan_id\\" UUID,\\n \\"amount\\" INTEGER DEFAULT 0,\\n \\"currency\\" TEXT,\\n \\"billable_seconds\\" INTEGER DEFAULT 0,\\n \\"included_seconds_applied\\" INTEGER DEFAULT 0,\\n \\"rate_snapshot\\" TEXT,\\n \\"status\\" TEXT,\\n \\"finalized_at\\" TIMESTAMP,\\n \\"metadata\\" 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":false,"unique":false},"time_entry_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"service_time_entries","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"case_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_cases","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"plan_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_plans","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"amount":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"currency":{"type":"TEXT","notNull":false,"unique":false},"billable_seconds":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"included_seconds_applied":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"rate_snapshot":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"finalized_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_charges_time_entry_id_idx","columns":["time_entry_id"],"unique":true},{"name":"support_charges_slug_context_idx","columns":["slug","context"]},{"name":"support_charges_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_charges_case_id_idx","columns":["case_id"]},{"name":"support_charges_plan_id_idx","columns":["plan_id"]}],"version":"44f149fb"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportCompensation":{"name":"supportcompensation","className":"SupportCompensation","qualifiedName":"@happyvertical/smrt-support:SupportCompensation","collection":"supportcompensations","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-settlement.ts","packageName":"@happyvertical/smrt-support","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}}},"timeEntryId":{"type":"foreignKey","required":true,"related":"ServiceTimeEntry","_meta":{"required":true}},"specialistId":{"type":"foreignKey","required":false,"related":"SupportSpecialist"},"compensationPlanId":{"type":"foreignKey","required":false,"related":"SupportCompensationPlan"},"amount":{"type":"integer","required":false,"default":0},"currency":{"type":"text","required":false,"_meta":{}},"payableSeconds":{"type":"integer","required":false,"default":0},"rateSnapshot":{"type":"text","required":false,"_meta":{}},"status":{"type":"text","required":false,"_meta":{},"enum":["pending","final","corrected","voided"]},"finalizedAt":{"type":"datetime","required":false},"metadata":{"type":"text","required":false,"_meta":{}}},"methods":{"getRateSnapshot":{"name":"getRateSnapshot","async":false,"parameters":[],"returnType":"Record<string, unknown>","isStatic":false,"isPublic":true},"setRateSnapshot":{"name":"setRateSnapshot","async":false,"parameters":[{"name":"value","type":"Record<string, unknown>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_compensations","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"conflictColumns":["time_entry_id"],"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"SupportCompensation","collectionExportName":"SupportCompensationCollection","validationRules":[{"field":"timeEntryId","rule":"required","fieldType":"foreignKey"}],"schema":{"tableName":"support_compensations","ddl":"CREATE TABLE IF NOT EXISTS \\"support_compensations\\" (\\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 \\"time_entry_id\\" UUID NOT NULL,\\n \\"specialist_id\\" UUID,\\n \\"compensation_plan_id\\" UUID,\\n \\"amount\\" INTEGER DEFAULT 0,\\n \\"currency\\" TEXT,\\n \\"payable_seconds\\" INTEGER DEFAULT 0,\\n \\"rate_snapshot\\" TEXT,\\n \\"status\\" TEXT,\\n \\"finalized_at\\" TIMESTAMP,\\n \\"metadata\\" 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":false,"unique":false},"time_entry_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"service_time_entries","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"specialist_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_specialists","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"compensation_plan_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_compensation_plans","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"amount":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"currency":{"type":"TEXT","notNull":false,"unique":false},"payable_seconds":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"rate_snapshot":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"finalized_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_compensations_time_entry_id_idx","columns":["time_entry_id"],"unique":true},{"name":"support_compensations_slug_context_idx","columns":["slug","context"]},{"name":"support_compensations_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_compensations_specialist_id_idx","columns":["specialist_id"]},{"name":"support_compensations_compensation_plan_id_idx","columns":["compensation_plan_id"]}],"version":"f9de8296"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportCompensationCollection":{"name":"supportcompensationcollection","className":"SupportCompensationCollection","qualifiedName":"@happyvertical/smrt-support:SupportCompensationCollection","collection":"supportcompensations","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-settlement.ts","packageName":"@happyvertical/smrt-support","fields":{},"methods":{"forTimeEntry":{"name":"forTimeEntry","async":true,"parameters":[{"name":"timeEntryId","type":"string","optional":false}],"returnType":"Promise<SupportCompensation | null>","isStatic":false,"isPublic":true},"forSpecialist":{"name":"forSpecialist","async":true,"parameters":[{"name":"specialistId","type":"string","optional":false}],"returnType":"Promise<SupportCompensation[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_compensations","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SupportCompensation","exportName":"SupportCompensationCollection","collectionExportName":"SupportCompensationCollectionCollection","collectionOf":"@happyvertical/smrt-support:SupportCompensation","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"support_compensations","ddl":"CREATE TABLE IF NOT EXISTS \\"support_compensations\\" (\\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 \\"time_entry_id\\" UUID NOT NULL,\\n \\"specialist_id\\" UUID,\\n \\"compensation_plan_id\\" UUID,\\n \\"amount\\" INTEGER DEFAULT 0,\\n \\"currency\\" TEXT,\\n \\"payable_seconds\\" INTEGER DEFAULT 0,\\n \\"rate_snapshot\\" TEXT,\\n \\"status\\" TEXT,\\n \\"finalized_at\\" TIMESTAMP,\\n \\"metadata\\" 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":false,"unique":false},"time_entry_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"service_time_entries","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"specialist_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_specialists","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"compensation_plan_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"support_compensation_plans","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"amount":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"currency":{"type":"TEXT","notNull":false,"unique":false},"payable_seconds":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"rate_snapshot":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"finalized_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_compensations_time_entry_id_idx","columns":["time_entry_id"],"unique":true},{"name":"support_compensations_slug_context_idx","columns":["slug","context"]},{"name":"support_compensations_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_compensations_specialist_id_idx","columns":["specialist_id"]},{"name":"support_compensations_compensation_plan_id_idx","columns":["compensation_plan_id"]}],"version":"f9de8296"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportSpecialist":{"name":"supportspecialist","className":"SupportSpecialist","qualifiedName":"@happyvertical/smrt-support:SupportSpecialist","collection":"supportspecialists","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-specialist.ts","packageName":"@happyvertical/smrt-support","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}}},"profileId":{"type":"crossPackageRef","required":true,"related":"@happyvertical/smrt-profiles:Profile","description":"The profile of the person on your team.","_meta":{"description":"The profile of the person on your team."}},"displayName":{"type":"text","required":false,"description":"The name your team and customers see.","_meta":{"description":"The name your team and customers see."}},"status":{"type":"text","required":false,"description":"Whether this person is taking tickets right now.","_meta":{"description":"Whether this person is taking tickets right now."},"enum":["active","inactive"]},"languages":{"type":"text","required":false,"_meta":{}},"timezone":{"type":"text","required":false,"_meta":{}},"maxConcurrentCases":{"type":"integer","required":false,"default":10},"onCallPriority":{"type":"integer","required":false,"default":0},"notes":{"type":"text","required":false,"_meta":{}},"metadata":{"type":"text","required":false,"_meta":{}}},"methods":{"getLanguages":{"name":"getLanguages","async":false,"parameters":[],"returnType":"string[]","isStatic":false,"isPublic":true},"setLanguages":{"name":"setLanguages","async":false,"parameters":[{"name":"languages","type":"string[]","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"getMetadata":{"name":"getMetadata","async":false,"parameters":[],"returnType":"Record<string, unknown>","isStatic":false,"isPublic":true},"setMetadata":{"name":"setMetadata","async":false,"parameters":[{"name":"value","type":"Record<string, unknown>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true},"isActive":{"name":"isActive","async":false,"parameters":[],"returnType":"boolean","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_specialists","api":{"include":["list","get","create","update","delete"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"conflictColumns":["tenant_id","profile_id"],"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"SupportSpecialist","collectionExportName":"SupportSpecialistCollection","validationRules":[{"field":"profileId","rule":"required","fieldType":"crossPackageRef"}],"schema":{"tableName":"support_specialists","ddl":"CREATE TABLE IF NOT EXISTS \\"support_specialists\\" (\\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 \\"profile_id\\" UUID NOT NULL,\\n \\"display_name\\" TEXT,\\n \\"status\\" TEXT,\\n \\"languages\\" TEXT,\\n \\"timezone\\" TEXT,\\n \\"max_concurrent_cases\\" INTEGER DEFAULT 10,\\n \\"on_call_priority\\" INTEGER DEFAULT 0,\\n \\"notes\\" TEXT,\\n \\"metadata\\" 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":false,"unique":false},"profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":true,"unique":false},"display_name":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"languages":{"type":"TEXT","notNull":false,"unique":false},"timezone":{"type":"TEXT","notNull":false,"unique":false},"max_concurrent_cases":{"type":"INTEGER","notNull":false,"unique":false,"default":10},"on_call_priority":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"notes":{"type":"TEXT","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_specialists_tenant_id_profile_id_idx","columns":["tenant_id","profile_id"],"unique":true,"nullsNotDistinct":true},{"name":"support_specialists_slug_context_idx","columns":["slug","context"]},{"name":"support_specialists_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_specialists_profile_id_idx","columns":["profile_id"]}],"version":"ff5305d3"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportSpecialistCollection":{"name":"supportspecialistcollection","className":"SupportSpecialistCollection","qualifiedName":"@happyvertical/smrt-support:SupportSpecialistCollection","collection":"supportspecialists","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-specialist.ts","packageName":"@happyvertical/smrt-support","fields":{},"methods":{"findActive":{"name":"findActive","async":true,"parameters":[],"returnType":"Promise<SupportSpecialist[]>","isStatic":false,"isPublic":true},"byProfile":{"name":"byProfile","async":true,"parameters":[{"name":"profileId","type":"string","optional":false}],"returnType":"Promise<SupportSpecialist | null>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_specialists","api":{"include":["list","get","create","update","delete"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SupportSpecialist","exportName":"SupportSpecialistCollection","collectionExportName":"SupportSpecialistCollectionCollection","collectionOf":"@happyvertical/smrt-support:SupportSpecialist","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"support_specialists","ddl":"CREATE TABLE IF NOT EXISTS \\"support_specialists\\" (\\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 \\"profile_id\\" UUID NOT NULL,\\n \\"display_name\\" TEXT,\\n \\"status\\" TEXT,\\n \\"languages\\" TEXT,\\n \\"timezone\\" TEXT,\\n \\"max_concurrent_cases\\" INTEGER DEFAULT 10,\\n \\"on_call_priority\\" INTEGER DEFAULT 0,\\n \\"notes\\" TEXT,\\n \\"metadata\\" 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":false,"unique":false},"profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":true,"unique":false},"display_name":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"languages":{"type":"TEXT","notNull":false,"unique":false},"timezone":{"type":"TEXT","notNull":false,"unique":false},"max_concurrent_cases":{"type":"INTEGER","notNull":false,"unique":false,"default":10},"on_call_priority":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"notes":{"type":"TEXT","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_specialists_tenant_id_profile_id_idx","columns":["tenant_id","profile_id"],"unique":true,"nullsNotDistinct":true},{"name":"support_specialists_slug_context_idx","columns":["slug","context"]},{"name":"support_specialists_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_specialists_profile_id_idx","columns":["profile_id"]}],"version":"ff5305d3"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportQualification":{"name":"supportqualification","className":"SupportQualification","qualifiedName":"@happyvertical/smrt-support:SupportQualification","collection":"supportqualifications","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-specialist.ts","packageName":"@happyvertical/smrt-support","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}}},"specialistId":{"type":"foreignKey","required":true,"related":"SupportSpecialist","_meta":{"required":true}},"projectId":{"type":"text","required":false,"_meta":{}},"level":{"type":"text","required":false,"_meta":{},"enum":["trainee","qualified","expert"]},"effectiveFrom":{"type":"datetime","required":false},"effectiveTo":{"type":"datetime","required":false},"grantedByProfileId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-profiles:Profile","_meta":{"nullable":true}},"notes":{"type":"text","required":false,"_meta":{}}},"methods":{"isEffectiveAt":{"name":"isEffectiveAt","async":false,"parameters":[{"name":"at","type":"Date","optional":true}],"returnType":"boolean","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_qualifications","api":{"include":["list","get","create","update","delete"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"conflictColumns":["specialist_id","project_id"],"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"SupportQualification","collectionExportName":"SupportQualificationCollection","validationRules":[{"field":"specialistId","rule":"required","fieldType":"foreignKey"}],"schema":{"tableName":"support_qualifications","ddl":"CREATE TABLE IF NOT EXISTS \\"support_qualifications\\" (\\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 \\"specialist_id\\" UUID NOT NULL,\\n \\"project_id\\" TEXT,\\n \\"level\\" TEXT,\\n \\"effective_from\\" TIMESTAMP,\\n \\"effective_to\\" TIMESTAMP,\\n \\"granted_by_profile_id\\" UUID,\\n \\"notes\\" 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":false,"unique":false},"specialist_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"support_specialists","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"project_id":{"type":"TEXT","notNull":false,"unique":false},"level":{"type":"TEXT","notNull":false,"unique":false},"effective_from":{"type":"TIMESTAMP","notNull":false,"unique":false},"effective_to":{"type":"TIMESTAMP","notNull":false,"unique":false},"granted_by_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"notes":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_qualifications_specialist_id_project_id_idx","columns":["specialist_id","project_id"],"unique":true,"nullsNotDistinct":true},{"name":"support_qualifications_slug_context_idx","columns":["slug","context"]},{"name":"support_qualifications_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_qualifications_granted_by_profile_id_idx","columns":["granted_by_profile_id"]}],"version":"566b3428"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportQualificationCollection":{"name":"supportqualificationcollection","className":"SupportQualificationCollection","qualifiedName":"@happyvertical/smrt-support:SupportQualificationCollection","collection":"supportqualifications","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-specialist.ts","packageName":"@happyvertical/smrt-support","fields":{},"methods":{"forSpecialist":{"name":"forSpecialist","async":true,"parameters":[{"name":"specialistId","type":"string","optional":false}],"returnType":"Promise<SupportQualification[]>","isStatic":false,"isPublic":true},"forProject":{"name":"forProject","async":true,"parameters":[{"name":"projectId","type":"string","optional":false}],"returnType":"Promise<SupportQualification[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_qualifications","api":{"include":["list","get","create","update","delete"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SupportQualification","exportName":"SupportQualificationCollection","collectionExportName":"SupportQualificationCollectionCollection","collectionOf":"@happyvertical/smrt-support:SupportQualification","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"support_qualifications","ddl":"CREATE TABLE IF NOT EXISTS \\"support_qualifications\\" (\\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 \\"specialist_id\\" UUID NOT NULL,\\n \\"project_id\\" TEXT,\\n \\"level\\" TEXT,\\n \\"effective_from\\" TIMESTAMP,\\n \\"effective_to\\" TIMESTAMP,\\n \\"granted_by_profile_id\\" UUID,\\n \\"notes\\" 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":false,"unique":false},"specialist_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"support_specialists","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"project_id":{"type":"TEXT","notNull":false,"unique":false},"level":{"type":"TEXT","notNull":false,"unique":false},"effective_from":{"type":"TIMESTAMP","notNull":false,"unique":false},"effective_to":{"type":"TIMESTAMP","notNull":false,"unique":false},"granted_by_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"notes":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_qualifications_specialist_id_project_id_idx","columns":["specialist_id","project_id"],"unique":true,"nullsNotDistinct":true},{"name":"support_qualifications_slug_context_idx","columns":["slug","context"]},{"name":"support_qualifications_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_qualifications_granted_by_profile_id_idx","columns":["granted_by_profile_id"]}],"version":"566b3428"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportAvailability":{"name":"supportavailability","className":"SupportAvailability","qualifiedName":"@happyvertical/smrt-support:SupportAvailability","collection":"supportavailabilities","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-specialist.ts","packageName":"@happyvertical/smrt-support","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}}},"specialistId":{"type":"foreignKey","required":true,"related":"SupportSpecialist","_meta":{"required":true}},"kind":{"type":"text","required":false,"_meta":{},"enum":["weekly","on_call","time_off"]},"weekday":{"type":"integer","required":false,"_meta":{"nullable":true}},"startMinute":{"type":"integer","required":false,"default":0},"endMinute":{"type":"integer","required":false,"default":0},"startsAt":{"type":"datetime","required":false},"endsAt":{"type":"datetime","required":false},"notes":{"type":"text","required":false,"_meta":{}}},"methods":{},"decoratorConfig":{"tableName":"support_availability_windows","api":{"include":["list","get","create","update","delete"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"SupportAvailability","collectionExportName":"SupportAvailabilityCollection","validationRules":[{"field":"specialistId","rule":"required","fieldType":"foreignKey"}],"schema":{"tableName":"support_availability_windows","ddl":"CREATE TABLE IF NOT EXISTS \\"support_availability_windows\\" (\\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 \\"specialist_id\\" UUID NOT NULL,\\n \\"kind\\" TEXT,\\n \\"weekday\\" INTEGER,\\n \\"start_minute\\" INTEGER DEFAULT 0,\\n \\"end_minute\\" INTEGER DEFAULT 0,\\n \\"starts_at\\" TIMESTAMP,\\n \\"ends_at\\" TIMESTAMP,\\n \\"notes\\" 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":false,"unique":false},"specialist_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"support_specialists","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"kind":{"type":"TEXT","notNull":false,"unique":false},"weekday":{"type":"INTEGER","notNull":false,"unique":false},"start_minute":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"end_minute":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"starts_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"ends_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"notes":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_availability_windows_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"support_availability_windows_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_availability_windows_specialist_id_idx","columns":["specialist_id"]}],"version":"2f0cafe3"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportAvailabilityCollection":{"name":"supportavailabilitycollection","className":"SupportAvailabilityCollection","qualifiedName":"@happyvertical/smrt-support:SupportAvailabilityCollection","collection":"supportavailabilities","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-specialist.ts","packageName":"@happyvertical/smrt-support","fields":{},"methods":{"forSpecialist":{"name":"forSpecialist","async":true,"parameters":[{"name":"specialistId","type":"string","optional":false}],"returnType":"Promise<SupportAvailability[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_availability_windows","api":{"include":["list","get","create","update","delete"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SupportAvailability","exportName":"SupportAvailabilityCollection","collectionExportName":"SupportAvailabilityCollectionCollection","collectionOf":"@happyvertical/smrt-support:SupportAvailability","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"support_availability_windows","ddl":"CREATE TABLE IF NOT EXISTS \\"support_availability_windows\\" (\\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 \\"specialist_id\\" UUID NOT NULL,\\n \\"kind\\" TEXT,\\n \\"weekday\\" INTEGER,\\n \\"start_minute\\" INTEGER DEFAULT 0,\\n \\"end_minute\\" INTEGER DEFAULT 0,\\n \\"starts_at\\" TIMESTAMP,\\n \\"ends_at\\" TIMESTAMP,\\n \\"notes\\" 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":false,"unique":false},"specialist_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"support_specialists","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"kind":{"type":"TEXT","notNull":false,"unique":false},"weekday":{"type":"INTEGER","notNull":false,"unique":false},"start_minute":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"end_minute":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"starts_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"ends_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"notes":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_availability_windows_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"support_availability_windows_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"support_availability_windows_specialist_id_idx","columns":["specialist_id"]}],"version":"2f0cafe3"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportWorkLink":{"name":"supportworklink","className":"SupportWorkLink","qualifiedName":"@happyvertical/smrt-support:SupportWorkLink","collection":"supportworklinks","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-work-link.ts","packageName":"@happyvertical/smrt-support","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}}},"caseId":{"type":"foreignKey","required":true,"related":"SupportCase","_meta":{"required":true}},"linkKind":{"type":"text","required":false,"_meta":{},"enum":["support_work_item","development_work_item"]},"targetType":{"type":"text","required":false,"_meta":{}},"targetId":{"type":"text","required":false,"_meta":{}},"targetLabel":{"type":"text","required":false,"_meta":{}},"externalUrl":{"type":"text","required":false,"_meta":{}},"status":{"type":"text","required":false,"_meta":{}},"lastStatusAt":{"type":"datetime","required":false},"metadata":{"type":"text","required":false,"_meta":{}}},"methods":{"getMetadata":{"name":"getMetadata","async":false,"parameters":[],"returnType":"Record<string, unknown>","isStatic":false,"isPublic":true},"setMetadata":{"name":"setMetadata","async":false,"parameters":[{"name":"value","type":"Record<string, unknown>","optional":false}],"returnType":"void","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_work_links","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"conflictColumns":["case_id","target_type","target_id"],"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"SupportWorkLink","collectionExportName":"SupportWorkLinkCollection","validationRules":[{"field":"caseId","rule":"required","fieldType":"foreignKey"}],"schema":{"tableName":"support_work_links","ddl":"CREATE TABLE IF NOT EXISTS \\"support_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,\\n \\"case_id\\" UUID NOT NULL,\\n \\"link_kind\\" TEXT,\\n \\"target_type\\" TEXT,\\n \\"target_id\\" TEXT,\\n \\"target_label\\" TEXT,\\n \\"external_url\\" TEXT,\\n \\"status\\" TEXT,\\n \\"last_status_at\\" TIMESTAMP,\\n \\"metadata\\" 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":false,"unique":false},"case_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"support_cases","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"link_kind":{"type":"TEXT","notNull":false,"unique":false},"target_type":{"type":"TEXT","notNull":false,"unique":false},"target_id":{"type":"TEXT","notNull":false,"unique":false},"target_label":{"type":"TEXT","notNull":false,"unique":false},"external_url":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"last_status_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_work_links_case_id_target_type_idx","columns":["case_id","target_type","target_id"],"unique":true,"nullsNotDistinct":true},{"name":"support_work_links_slug_context_idx","columns":["slug","context"]},{"name":"support_work_links_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"c9e0e8f5"},"importPath":"@happyvertical/smrt-support"},"@happyvertical/smrt-support:SupportWorkLinkCollection":{"name":"supportworklinkcollection","className":"SupportWorkLinkCollection","qualifiedName":"@happyvertical/smrt-support:SupportWorkLinkCollection","collection":"supportworklinks","filePath":"/home/runner/work/smrt/smrt/packages/support/src/models/support-work-link.ts","packageName":"@happyvertical/smrt-support","fields":{},"methods":{"forCase":{"name":"forCase","async":true,"parameters":[{"name":"caseId","type":"string","optional":false}],"returnType":"Promise<SupportWorkLink[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"support_work_links","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SupportWorkLink","exportName":"SupportWorkLinkCollection","collectionExportName":"SupportWorkLinkCollectionCollection","collectionOf":"@happyvertical/smrt-support:SupportWorkLink","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"support_work_links","ddl":"CREATE TABLE IF NOT EXISTS \\"support_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,\\n \\"case_id\\" UUID NOT NULL,\\n \\"link_kind\\" TEXT,\\n \\"target_type\\" TEXT,\\n \\"target_id\\" TEXT,\\n \\"target_label\\" TEXT,\\n \\"external_url\\" TEXT,\\n \\"status\\" TEXT,\\n \\"last_status_at\\" TIMESTAMP,\\n \\"metadata\\" 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":false,"unique":false},"case_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"support_cases","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"link_kind":{"type":"TEXT","notNull":false,"unique":false},"target_type":{"type":"TEXT","notNull":false,"unique":false},"target_id":{"type":"TEXT","notNull":false,"unique":false},"target_label":{"type":"TEXT","notNull":false,"unique":false},"external_url":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"last_status_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"metadata":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"support_work_links_case_id_target_type_idx","columns":["case_id","target_type","target_id"],"unique":true,"nullsNotDistinct":true},{"name":"support_work_links_slug_context_idx","columns":["slug","context"]},{"name":"support_work_links_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"c9e0e8f5"},"importPath":"@happyvertical/smrt-support"}},"moduleType":"smrt","recipes":[{"id":"support.tickets","className":"SupportTicketsRecipe","label":"Support","summary":"Keep every customer request for help in one place until it is solved.","synonyms":["support tickets","tickets","helpdesk","help desk","customer support","cases"],"models":["@happyvertical/smrt-support:SupportCase","@happyvertical/smrt-support:SupportInteraction","@happyvertical/smrt-support:SupportSpecialist"],"nav":[{"label":"Tickets","model":"@happyvertical/smrt-support:SupportCase","icon":"fileText","description":"Every request for help, who is handling it and where it stands.","noun":"ticket"},{"label":"Messages","model":"@happyvertical/smrt-support:SupportInteraction","icon":"book","description":"What was said on each ticket, by the customer or your team.","noun":"message"},{"label":"Support team","model":"@happyvertical/smrt-support:SupportSpecialist","icon":"users","description":"The people who answer tickets and when they are available.","noun":"team member"}],"requires":[],"section":{"id":"support","label":"Support","icon":"users","description":"Help your customers and keep track of every request."},"options":{"@happyvertical/smrt-support:SupportCase":{"fields":{"caseNumber":{"label":"Ticket number","order":1},"subject":{"order":2},"description":{"order":3},"status":{"order":4},"priority":{"order":5},"clientProfileId":{"label":"Customer","order":6},"assignedSpecialistId":{"label":"Assigned to","order":7},"tenantId":{"visibility":"hidden"},"assignedAt":{"visibility":"hidden"},"escalatedAt":{"visibility":"hidden"},"acknowledgedAt":{"visibility":"hidden"},"firstRespondedAt":{"visibility":"hidden"},"humanRequestedAt":{"visibility":"hidden"},"resolvedAt":{"visibility":"hidden"},"closedAt":{"visibility":"hidden"},"lastReopenedAt":{"visibility":"hidden"},"severity":{"visibility":"advanced"},"category":{"visibility":"advanced"},"sensitive":{"visibility":"advanced"},"channelKind":{"visibility":"advanced"},"openedByProfileId":{"visibility":"advanced"},"resolutionSummary":{"visibility":"advanced"},"projectId":{"visibility":"hidden"},"bindingId":{"visibility":"hidden"},"threadKey":{"visibility":"hidden"},"planId":{"visibility":"hidden"},"planSnapshot":{"visibility":"hidden"},"preferredSpecialistId":{"visibility":"hidden"},"escalationLevel":{"visibility":"hidden"},"resolvedByProfileId":{"visibility":"hidden"},"resolutionKind":{"visibility":"hidden"},"reopenCount":{"visibility":"hidden"},"aiEnabled":{"visibility":"hidden"},"metadata":{"visibility":"hidden"}}},"@happyvertical/smrt-support:SupportInteraction":{"fields":{"body":{"label":"Message","order":1},"caseId":{"label":"Ticket","order":2},"direction":{"order":3},"tenantId":{"visibility":"hidden"},"channelKind":{"visibility":"advanced"},"actorKind":{"visibility":"advanced"},"authorProfileId":{"visibility":"advanced"},"sourceType":{"visibility":"hidden"},"sourceId":{"visibility":"hidden"},"sourceKey":{"visibility":"hidden"},"rfcMessageId":{"visibility":"hidden"},"metadata":{"visibility":"hidden"}}},"@happyvertical/smrt-support:SupportSpecialist":{"fields":{"displayName":{"label":"Name","order":1},"status":{"order":2},"tenantId":{"visibility":"hidden"},"profileId":{"visibility":"advanced"},"languages":{"visibility":"advanced"},"timezone":{"visibility":"advanced"},"maxConcurrentCases":{"label":"Most tickets at once","visibility":"advanced"},"onCallPriority":{"visibility":"hidden"},"notes":{"visibility":"advanced"},"metadata":{"visibility":"hidden"}}}},"help":{"markdown":"## Overview\\n\\nSupport keeps every request for help from a customer in one place. Each request\\nis a ticket with a number, a subject, who asked, who is handling it and where\\nit stands, from new to resolved. Messages back and forth stay on the ticket, so\\nanyone on the team can pick it up and see what was said.\\n\\n## Tasks\\n\\nTickets and their messages are created by your support channels (email, chat\\nand the like) and by the support service, not by hand in the app. Here you\\nread them and see where each one stands.\\n\\n### Find a ticket\\n\\n1. Open the list of tickets.\\n2. Look at the **{field:SupportCase.subject}**, the **{field:SupportCase.status}** and the **{field:SupportCase.priority}** to see what needs attention.\\n3. Open a ticket to see who it is **{field:SupportCase.assignedSpecialistId}** and the **{field:SupportCase.description}**.\\n\\n### Read the history of a ticket\\n\\n1. Open the list of messages.\\n2. Find the **{field:SupportInteraction.caseId}** you are interested in.\\n3. Read the **{field:SupportInteraction.body}** of each message, oldest first.\\n\\n### Add someone to the support team\\n\\n1. Open the support team and choose **New**.\\n2. Type the person's **{field:SupportSpecialist.displayName}**.\\n3. Save. They can now be given tickets by the support service.\\n","fieldRefs":["SupportCase.assignedSpecialistId","SupportCase.description","SupportCase.priority","SupportCase.status","SupportCase.subject","SupportInteraction.body","SupportInteraction.caseId","SupportSpecialist.displayName"]},"demo":{"mode":"server","reasons":["Needs a server because its package does not build for a browser: core migrations (node:os); and its package depends on @happyvertical/smrt-agents, @happyvertical/smrt-chat, @happyvertical/smrt-images, @happyvertical/smrt-jobs, @happyvertical/smrt-profiles, @happyvertical/smrt-projects, @happyvertical/smrt-reports, @happyvertical/smrt-secrets, @happyvertical/smrt-subscriptions, @happyvertical/smrt-tenancy, @happyvertical/smrt-timesheets, @happyvertical/smrt-users, which do not build for a browser (#3615, #3617, #3624, #3625, #3626, #3627, #3628)."]}}],"smrtDependencies":["@happyvertical/smrt-chat","@happyvertical/smrt-core","@happyvertical/smrt-jobs","@happyvertical/smrt-messages","@happyvertical/smrt-projects","@happyvertical/smrt-tenancy","@happyvertical/smrt-timesheets","@happyvertical/smrt-users"],"browser":{"status":"server-only","issues":["#3615","#3617","#3624","#3625","#3626","#3627","#3628"],"reason":"core migrations (node:os)","via":["@happyvertical/smrt-agents","@happyvertical/smrt-chat","@happyvertical/smrt-images","@happyvertical/smrt-jobs","@happyvertical/smrt-profiles","@happyvertical/smrt-projects","@happyvertical/smrt-reports","@happyvertical/smrt-secrets","@happyvertical/smrt-subscriptions","@happyvertical/smrt-tenancy","@happyvertical/smrt-timesheets","@happyvertical/smrt-users"]},"stampsConstructors":true}`));
|
|
23
23
|
//#endregion
|
|
24
24
|
//#region src/permissions.ts
|
|
25
25
|
var REASSIGN_CASE_PERMISSION = "support.reassign-case";
|