@happyvertical/smrt-sites 0.51.31 → 0.51.33

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.
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=__smrt-register__.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"__smrt-register__.d.ts","sourceRoot":"","sources":["../src/__smrt-register__.ts"],"names":[],"mappings":""}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * SiteAgentBindingCollection - Collection manager for SiteAgentBinding objects
3
+ *
4
+ * Provides queries for agent bindings by site, agent class, and enabled state.
5
+ */
6
+ import { SmrtCollection } from '@happyvertical/smrt-core';
7
+ import { SiteAgentBinding } from '../models/SiteAgentBinding';
8
+ export declare class SiteAgentBindingCollection extends SmrtCollection<SiteAgentBinding> {
9
+ static readonly _itemClass: typeof SiteAgentBinding;
10
+ /**
11
+ * Find all agent bindings for a site
12
+ */
13
+ findBySite(siteId: string): Promise<SiteAgentBinding[]>;
14
+ /**
15
+ * Find all sites using a specific agent class
16
+ */
17
+ findByAgent(agentClass: string): Promise<SiteAgentBinding[]>;
18
+ /**
19
+ * Find enabled bindings for a site, ordered by priority descending
20
+ */
21
+ findEnabled(siteId: string): Promise<SiteAgentBinding[]>;
22
+ /**
23
+ * Find a specific site-agent binding
24
+ */
25
+ findBySiteAndAgent(siteId: string, agentClass: string): Promise<SiteAgentBinding | null>;
26
+ }
27
+ //# sourceMappingURL=SiteAgentBindingCollection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SiteAgentBindingCollection.d.ts","sourceRoot":"","sources":["../../src/collections/SiteAgentBindingCollection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,qBAAa,0BAA2B,SAAQ,cAAc,CAAC,gBAAgB,CAAC;IAC9E,MAAM,CAAC,QAAQ,CAAC,UAAU,0BAAoB;IAE9C;;OAEG;IACG,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAI7D;;OAEG;IACG,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAIlE;;OAEG;IACG,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAO9D;;OAEG;IACG,kBAAkB,CACtB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;CAMpC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * SiteCollection - Collection manager for Site objects
3
+ *
4
+ * Provides domain lookup, tenant filtering, and status queries.
5
+ */
6
+ import { SmrtCollection } from '@happyvertical/smrt-core';
7
+ import { Site } from '../models/Site';
8
+ import type { SiteStatus } from '../types';
9
+ export declare class SiteCollection extends SmrtCollection<Site> {
10
+ static readonly _itemClass: typeof Site;
11
+ /**
12
+ * Find a site by its primary domain
13
+ */
14
+ findByDomain(domain: string): Promise<Site | null>;
15
+ /**
16
+ * Find all sites belonging to a tenant
17
+ */
18
+ findByTenant(tenantId: string): Promise<Site[]>;
19
+ /**
20
+ * Find sites by lifecycle status
21
+ */
22
+ findByStatus(status: SiteStatus): Promise<Site[]>;
23
+ /**
24
+ * Find all active sites
25
+ */
26
+ findActive(): Promise<Site[]>;
27
+ }
28
+ //# sourceMappingURL=SiteCollection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SiteCollection.d.ts","sourceRoot":"","sources":["../../src/collections/SiteCollection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,qBAAa,cAAe,SAAQ,cAAc,CAAC,IAAI,CAAC;IACtD,MAAM,CAAC,QAAQ,CAAC,UAAU,cAAQ;IAElC;;OAEG;IACG,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IAKxD;;OAEG;IACG,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAIrD;;OAEG;IACG,YAAY,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAIvD;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;CAGpC"}
package/dist/index.d.ts CHANGED
@@ -1,258 +1,20 @@
1
- import { SmrtCollection } from '@happyvertical/smrt-core';
2
- import { SmrtObject } from '@happyvertical/smrt-core';
3
-
4
- /**
5
- * Data required to create a new site
6
- */
7
- export declare interface CreateSiteData {
8
- name: string;
9
- domain: string;
10
- tier?: SiteTier;
11
- databaseUrl?: string;
12
- databaseType?: string;
13
- portalConfig?: SitePortalConfig;
14
- repositoryUrl?: string;
15
- templateName?: string;
16
- metadata?: Record<string, unknown>;
17
- }
18
-
19
- /**
20
- * Infrastructure provisioning status
21
- */
22
- export declare type ProvisioningStatus = 'pending' | 'provisioning' | 'ready' | 'failed';
23
-
24
- export declare class Site extends SmrtObject {
25
- tenantId: string;
26
- /** Display name, e.g. "Bentley Alberta" */
27
- name: string;
28
- /** Primary domain, e.g. "bentleyalberta.com" */
29
- domain: string;
30
- /** Lifecycle status */
31
- status: SiteStatus;
32
- /** Pricing/feature tier */
33
- tier: SiteTier;
34
- /** Site-specific database connection URL */
35
- databaseUrl: string;
36
- /** Database type: sqlite, postgres, libsql */
37
- databaseType: string;
38
- /** Theme, branding, navigation settings (JSON) */
39
- portalConfig: string;
40
- /** Git repository URL */
41
- repositoryUrl: string;
42
- /** Starter template name */
43
- templateName: string;
44
- /** Infrastructure provisioning status */
45
- provisioningStatus: ProvisioningStatus | '';
46
- /** When provisioning completed */
47
- provisionedAt: Date | null;
48
- /** Last provisioning error message */
49
- provisioningError: string;
50
- /** Extensible key-value metadata (JSON) */
51
- metadata: string;
52
- createdAt: Date;
53
- updatedAt: Date;
54
- constructor(options?: SiteOptions);
55
- /**
56
- * Check if the site is active
57
- */
58
- isActive(): boolean;
59
- /**
60
- * Check if the site is provisioned and ready
61
- */
62
- isReady(): boolean;
63
- /**
64
- * Get portal config as parsed object
65
- */
66
- getPortalConfig(): SitePortalConfig;
67
- /**
68
- * Set portal config from object
69
- */
70
- setPortalConfig(config: SitePortalConfig): void;
71
- /**
72
- * Get metadata as parsed object
73
- */
74
- getMetadata(): Record<string, unknown>;
75
- /**
76
- * Set metadata from object
77
- */
78
- setMetadata(data: Record<string, unknown>): void;
79
- /**
80
- * Update metadata by merging with existing values
81
- */
82
- updateMetadata(updates: Record<string, unknown>): void;
83
- }
84
-
85
- export declare class SiteAgentBinding extends SmrtObject {
86
- tenantId: string;
87
- /** FK to sites table */
88
- siteId: string;
89
- /** Agent class name, e.g. "Praeco" */
90
- agentClass: string;
91
- /** Whether this agent is enabled for the site */
92
- enabled: boolean;
93
- /** Per-site agent configuration overrides (JSON) */
94
- config: Record<string, unknown> | null;
95
- /** Sort priority (higher = first) */
96
- priority: number;
97
- constructor(options?: SiteAgentBindingOptions);
98
- }
99
-
100
- export declare class SiteAgentBindingCollection extends SmrtCollection<SiteAgentBinding> {
101
- static readonly _itemClass: typeof SiteAgentBinding;
102
- /**
103
- * Find all agent bindings for a site
104
- */
105
- findBySite(siteId: string): Promise<SiteAgentBinding[]>;
106
- /**
107
- * Find all sites using a specific agent class
108
- */
109
- findByAgent(agentClass: string): Promise<SiteAgentBinding[]>;
110
- /**
111
- * Find enabled bindings for a site, ordered by priority descending
112
- */
113
- findEnabled(siteId: string): Promise<SiteAgentBinding[]>;
114
- /**
115
- * Find a specific site-agent binding
116
- */
117
- findBySiteAndAgent(siteId: string, agentClass: string): Promise<SiteAgentBinding | null>;
118
- }
119
-
120
- /**
121
- * Options for constructing a SiteAgentBinding instance
122
- */
123
- export declare interface SiteAgentBindingOptions {
124
- id?: string;
125
- tenantId?: string;
126
- siteId?: string;
127
- agentClass?: string;
128
- enabled?: boolean;
129
- config?: Record<string, unknown> | string | null;
130
- priority?: number;
131
- createdAt?: Date;
132
- updatedAt?: Date;
133
- }
134
-
135
- export declare class SiteCollection extends SmrtCollection<Site> {
136
- static readonly _itemClass: typeof Site;
137
- /**
138
- * Find a site by its primary domain
139
- */
140
- findByDomain(domain: string): Promise<Site | null>;
141
- /**
142
- * Find all sites belonging to a tenant
143
- */
144
- findByTenant(tenantId: string): Promise<Site[]>;
145
- /**
146
- * Find sites by lifecycle status
147
- */
148
- findByStatus(status: SiteStatus): Promise<Site[]>;
149
- /**
150
- * Find all active sites
151
- */
152
- findActive(): Promise<Site[]>;
153
- }
154
-
155
- /**
156
- * Options for constructing a Site instance
157
- */
158
- export declare interface SiteOptions {
159
- id?: string;
160
- tenantId?: string;
161
- name?: string;
162
- domain?: string;
163
- status?: SiteStatus;
164
- tier?: SiteTier;
165
- databaseUrl?: string;
166
- databaseType?: string;
167
- portalConfig?: SitePortalConfig | string;
168
- repositoryUrl?: string;
169
- templateName?: string;
170
- provisioningStatus?: ProvisioningStatus;
171
- provisionedAt?: Date | null;
172
- provisioningError?: string;
173
- metadata?: Record<string, unknown> | string;
174
- createdAt?: Date;
175
- updatedAt?: Date;
176
- }
177
-
178
- /**
179
- * Portal configuration for theming, branding, and navigation
180
- */
181
- export declare interface SitePortalConfig {
182
- theme?: string;
183
- branding?: Record<string, unknown>;
184
- navigation?: Array<{
185
- label: string;
186
- path: string;
187
- icon?: string;
188
- }>;
189
- }
190
-
191
- export declare class SiteService {
192
- private sites;
193
- private bindings;
194
- constructor(options: SiteServiceOptions);
195
- /**
196
- * Create a new site in draft status
197
- */
198
- createSite(tenantId: string, data: CreateSiteData): Promise<Site>;
199
- /**
200
- * Activate a site — validates required fields then sets status to active
201
- */
202
- activateSite(siteId: string): Promise<Site>;
203
- /**
204
- * Suspend a site
205
- */
206
- suspendSite(siteId: string): Promise<Site>;
207
- /**
208
- * Archive a site
209
- */
210
- archiveSite(siteId: string): Promise<Site>;
211
- /**
212
- * Mark site as provisioned and ready
213
- */
214
- markProvisioned(siteId: string): Promise<Site>;
215
- /**
216
- * Mark site provisioning as failed
217
- */
218
- markProvisioningFailed(siteId: string, error: string): Promise<Site>;
219
- /**
220
- * Bind an agent to a site
221
- */
222
- bindAgent(siteId: string, agentClass: string, config?: Record<string, unknown>): Promise<SiteAgentBinding>;
223
- /**
224
- * Unbind an agent from a site
225
- */
226
- unbindAgent(siteId: string, agentClass: string): Promise<void>;
227
- /**
228
- * Get all enabled agent bindings for a site
229
- */
230
- getEnabledAgents(siteId: string): Promise<SiteAgentBinding[]>;
231
- /**
232
- * Load a site by ID, throwing if not found
233
- */
234
- private requireSite;
235
- }
236
-
237
- /**
238
- * Options for creating a SiteService
239
- */
240
- export declare interface SiteServiceOptions {
241
- sites: SiteCollection;
242
- bindings: SiteAgentBindingCollection;
243
- }
244
-
245
- /**
246
- * Types for smrt-sites package
247
- */
248
- /**
249
- * Site lifecycle status
250
- */
251
- export declare type SiteStatus = 'draft' | 'active' | 'suspended' | 'archived';
252
-
253
- /**
254
- * Site pricing/feature tier
255
- */
256
- export declare type SiteTier = 'free' | 'standard' | 'premium';
257
-
258
- export { }
1
+ /**
2
+ * @happyvertical/smrt-sites
3
+ *
4
+ * Site lifecycle management for multi-tenant SMRT networks.
5
+ *
6
+ * Provides models, collections, and services for managing deployable
7
+ * websites within a tenant hierarchy, including agent binding and
8
+ * infrastructure provisioning tracking.
9
+ *
10
+ * @packageDocumentation
11
+ */
12
+ import './__smrt-register__.js';
13
+ export { SiteAgentBindingCollection } from './collections/SiteAgentBindingCollection';
14
+ export { SiteCollection } from './collections/SiteCollection';
15
+ export { Site } from './models/Site';
16
+ export { SiteAgentBinding } from './models/SiteAgentBinding';
17
+ export type { SiteServiceOptions } from './services/SiteService';
18
+ export { SiteService } from './services/SiteService';
19
+ export type { CreateSiteData, ProvisioningStatus, SiteAgentBindingOptions, SiteOptions, SitePortalConfig, SiteStatus, SiteTier, } from './types';
20
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,OAAO,wBAAwB,CAAC;AAGhC,OAAO,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AACtF,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAG9D,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,YAAY,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAGrD,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,uBAAuB,EACvB,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,QAAQ,GACT,MAAM,SAAS,CAAC"}
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ObjectRegistry, SmrtCollection, SmrtObject, foreignKey, smrt } from "@happyvertical/smrt-core";
2
2
  import { TenantScoped, tenantId } from "@happyvertical/smrt-tenancy";
3
3
  //#region src/__smrt-register__.ts
4
- ObjectRegistry.registerPackageManifest(JSON.parse("{\"version\":\"1.0.0\",\"timestamp\":0,\"packageName\":\"@happyvertical/smrt-sites\",\"packageVersion\":\"0.51.31\",\"objects\":{\"@happyvertical/smrt-sites:SiteAgentBindingCollection\":{\"name\":\"siteagentbindingcollection\",\"className\":\"SiteAgentBindingCollection\",\"qualifiedName\":\"@happyvertical/smrt-sites:SiteAgentBindingCollection\",\"collection\":\"siteagentbindings\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/sites/src/collections/SiteAgentBindingCollection.ts\",\"packageName\":\"@happyvertical/smrt-sites\",\"fields\":{},\"methods\":{\"findBySite\":{\"name\":\"findBySite\",\"async\":true,\"parameters\":[{\"name\":\"siteId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<SiteAgentBinding[]>\",\"isStatic\":false,\"isPublic\":true},\"findByAgent\":{\"name\":\"findByAgent\",\"async\":true,\"parameters\":[{\"name\":\"agentClass\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<SiteAgentBinding[]>\",\"isStatic\":false,\"isPublic\":true},\"findEnabled\":{\"name\":\"findEnabled\",\"async\":true,\"parameters\":[{\"name\":\"siteId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<SiteAgentBinding[]>\",\"isStatic\":false,\"isPublic\":true},\"findBySiteAndAgent\":{\"name\":\"findBySiteAndAgent\",\"async\":true,\"parameters\":[{\"name\":\"siteId\",\"type\":\"string\",\"optional\":false},{\"name\":\"agentClass\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<SiteAgentBinding | null>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"tableName\":\"site_agent_bindings\"},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"SiteAgentBinding\",\"exportName\":\"SiteAgentBindingCollection\",\"collectionExportName\":\"SiteAgentBindingCollectionCollection\",\"schema\":{\"tableName\":\"site_agent_bindings\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"site_agent_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 NOT NULL,\\n \\\"site_id\\\" UUID,\\n \\\"agent_class\\\" TEXT DEFAULT '',\\n \\\"enabled\\\" BOOLEAN DEFAULT TRUE,\\n \\\"config\\\" JSON DEFAULT '{}',\\n \\\"priority\\\" INTEGER DEFAULT 0\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":true,\"unique\":false},\"site_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":false,\"unique\":false,\"foreignKey\":{\"table\":\"sites\",\"column\":\"id\",\"onDelete\":\"CASCADE\",\"onUpdate\":\"CASCADE\"}},\"agent_class\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"enabled\":{\"type\":\"BOOLEAN\",\"notNull\":false,\"unique\":false,\"default\":true},\"config\":{\"type\":\"JSON\",\"notNull\":false,\"unique\":false,\"default\":{}},\"priority\":{\"type\":\"INTEGER\",\"notNull\":false,\"unique\":false,\"default\":0}},\"indexes\":[{\"name\":\"site_agent_bindings_site_id_agent_class_idx\",\"columns\":[\"site_id\",\"agent_class\"],\"unique\":true,\"nullsNotDistinct\":true},{\"name\":\"site_agent_bindings_slug_context_idx\",\"columns\":[\"slug\",\"context\"]},{\"name\":\"site_agent_bindings_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]}],\"version\":\"dec43c9c\"},\"importPath\":\"@happyvertical/smrt-sites\"},\"@happyvertical/smrt-sites:SiteCollection\":{\"name\":\"sitecollection\",\"className\":\"SiteCollection\",\"qualifiedName\":\"@happyvertical/smrt-sites:SiteCollection\",\"collection\":\"sites\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/sites/src/collections/SiteCollection.ts\",\"packageName\":\"@happyvertical/smrt-sites\",\"fields\":{},\"methods\":{\"findByDomain\":{\"name\":\"findByDomain\",\"async\":true,\"parameters\":[{\"name\":\"domain\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Site | null>\",\"isStatic\":false,\"isPublic\":true},\"findByTenant\":{\"name\":\"findByTenant\",\"async\":true,\"parameters\":[{\"name\":\"tenantId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Site[]>\",\"isStatic\":false,\"isPublic\":true},\"findByStatus\":{\"name\":\"findByStatus\",\"async\":true,\"parameters\":[{\"name\":\"status\",\"type\":\"SiteStatus\",\"optional\":false}],\"returnType\":\"Promise<Site[]>\",\"isStatic\":false,\"isPublic\":true},\"findActive\":{\"name\":\"findActive\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<Site[]>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"tableName\":\"sites\"},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"Site\",\"exportName\":\"SiteCollection\",\"collectionExportName\":\"SiteCollectionCollection\",\"schema\":{\"tableName\":\"sites\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"sites\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"tenant_id\\\" UUID NOT NULL,\\n \\\"name\\\" TEXT DEFAULT '',\\n \\\"domain\\\" TEXT DEFAULT '',\\n \\\"status\\\" TEXT DEFAULT 'draft',\\n \\\"tier\\\" TEXT DEFAULT 'free',\\n \\\"database_url\\\" TEXT DEFAULT '',\\n \\\"database_type\\\" TEXT DEFAULT '',\\n \\\"portal_config\\\" TEXT DEFAULT '',\\n \\\"repository_url\\\" TEXT DEFAULT '',\\n \\\"template_name\\\" TEXT DEFAULT '',\\n \\\"provisioning_status\\\" TEXT DEFAULT '',\\n \\\"provisioned_at\\\" TIMESTAMP,\\n \\\"provisioning_error\\\" TEXT DEFAULT '',\\n \\\"metadata\\\" TEXT DEFAULT ''\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":true,\"unique\":false},\"name\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"domain\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"status\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"draft\"},\"tier\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"free\"},\"database_url\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"database_type\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"portal_config\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"repository_url\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"template_name\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"provisioning_status\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"provisioned_at\":{\"type\":\"TIMESTAMP\",\"notNull\":false,\"unique\":false},\"provisioning_error\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"metadata\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"}},\"indexes\":[{\"name\":\"sites_tenant_id_domain_idx\",\"columns\":[\"tenant_id\",\"domain\"],\"unique\":true,\"nullsNotDistinct\":true},{\"name\":\"sites_slug_context_idx\",\"columns\":[\"slug\",\"context\"]},{\"name\":\"sites_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]}],\"version\":\"1845042e\"},\"importPath\":\"@happyvertical/smrt-sites\"},\"@happyvertical/smrt-sites:Site\":{\"name\":\"site\",\"className\":\"Site\",\"qualifiedName\":\"@happyvertical/smrt-sites:Site\",\"collection\":\"sites\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/sites/src/models/Site.ts\",\"packageName\":\"@happyvertical/smrt-sites\",\"fields\":{\"tenantId\":{\"type\":\"text\",\"required\":true,\"_meta\":{\"sqlType\":\"UUID\",\"__tenancy\":{\"isTenantIdField\":true,\"autoFilter\":true,\"required\":true,\"autoPopulate\":true,\"nullable\":false,\"mode\":\"required\",\"field\":\"tenantId\",\"allowSuperAdminBypass\":false}}},\"name\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"domain\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"status\":{\"type\":\"text\",\"required\":false,\"default\":\"draft\"},\"tier\":{\"type\":\"text\",\"required\":false,\"default\":\"free\"},\"databaseUrl\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"databaseType\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"portalConfig\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"repositoryUrl\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"templateName\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"provisioningStatus\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"provisionedAt\":{\"type\":\"datetime\",\"required\":false},\"provisioningError\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"metadata\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"createdAt\":{\"type\":\"datetime\",\"required\":false},\"updatedAt\":{\"type\":\"datetime\",\"required\":false}},\"methods\":{\"isActive\":{\"name\":\"isActive\",\"async\":false,\"parameters\":[],\"returnType\":\"boolean\",\"isStatic\":false,\"isPublic\":true},\"isReady\":{\"name\":\"isReady\",\"async\":false,\"parameters\":[],\"returnType\":\"boolean\",\"isStatic\":false,\"isPublic\":true},\"getPortalConfig\":{\"name\":\"getPortalConfig\",\"async\":false,\"parameters\":[],\"returnType\":\"SitePortalConfig\",\"isStatic\":false,\"isPublic\":true},\"setPortalConfig\":{\"name\":\"setPortalConfig\",\"async\":false,\"parameters\":[{\"name\":\"config\",\"type\":\"SitePortalConfig\",\"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\":\"data\",\"type\":\"Record<string, unknown>\",\"optional\":false}],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"updateMetadata\":{\"name\":\"updateMetadata\",\"async\":false,\"parameters\":[{\"name\":\"updates\",\"type\":\"Record<string, unknown>\",\"optional\":false}],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"tableName\":\"sites\",\"api\":{\"include\":[\"list\",\"get\",\"create\",\"update\",\"delete\"]},\"mcp\":{\"include\":[\"list\",\"get\",\"create\",\"update\"]},\"cli\":{\"skipApiCheck\":true},\"conflictColumns\":[\"tenant_id\",\"domain\"],\"tenantScoped\":{\"mode\":\"required\"}},\"extends\":\"SmrtObject\",\"exportName\":\"Site\",\"collectionExportName\":\"SiteCollection\",\"validationRules\":[],\"schema\":{\"tableName\":\"sites\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"sites\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"tenant_id\\\" UUID NOT NULL,\\n \\\"name\\\" TEXT DEFAULT '',\\n \\\"domain\\\" TEXT DEFAULT '',\\n \\\"status\\\" TEXT DEFAULT 'draft',\\n \\\"tier\\\" TEXT DEFAULT 'free',\\n \\\"database_url\\\" TEXT DEFAULT '',\\n \\\"database_type\\\" TEXT DEFAULT '',\\n \\\"portal_config\\\" TEXT DEFAULT '',\\n \\\"repository_url\\\" TEXT DEFAULT '',\\n \\\"template_name\\\" TEXT DEFAULT '',\\n \\\"provisioning_status\\\" TEXT DEFAULT '',\\n \\\"provisioned_at\\\" TIMESTAMP,\\n \\\"provisioning_error\\\" TEXT DEFAULT '',\\n \\\"metadata\\\" TEXT DEFAULT ''\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":true,\"unique\":false},\"name\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"domain\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"status\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"draft\"},\"tier\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"free\"},\"database_url\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"database_type\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"portal_config\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"repository_url\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"template_name\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"provisioning_status\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"provisioned_at\":{\"type\":\"TIMESTAMP\",\"notNull\":false,\"unique\":false},\"provisioning_error\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"metadata\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"}},\"indexes\":[{\"name\":\"sites_tenant_id_domain_idx\",\"columns\":[\"tenant_id\",\"domain\"],\"unique\":true,\"nullsNotDistinct\":true},{\"name\":\"sites_slug_context_idx\",\"columns\":[\"slug\",\"context\"]},{\"name\":\"sites_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]}],\"version\":\"1845042e\"},\"importPath\":\"@happyvertical/smrt-sites\"},\"@happyvertical/smrt-sites:SiteAgentBinding\":{\"name\":\"siteagentbinding\",\"className\":\"SiteAgentBinding\",\"qualifiedName\":\"@happyvertical/smrt-sites:SiteAgentBinding\",\"collection\":\"siteagentbindings\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/sites/src/models/SiteAgentBinding.ts\",\"packageName\":\"@happyvertical/smrt-sites\",\"fields\":{\"tenantId\":{\"type\":\"text\",\"required\":true,\"_meta\":{\"sqlType\":\"UUID\",\"__tenancy\":{\"isTenantIdField\":true,\"autoFilter\":true,\"required\":true,\"autoPopulate\":true,\"nullable\":false,\"mode\":\"required\",\"field\":\"tenantId\",\"allowSuperAdminBypass\":false}}},\"siteId\":{\"type\":\"foreignKey\",\"required\":false,\"related\":\"Site\"},\"agentClass\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"enabled\":{\"type\":\"boolean\",\"required\":false,\"default\":true},\"config\":{\"type\":\"json\",\"required\":false,\"default\":{}},\"priority\":{\"type\":\"integer\",\"required\":false,\"default\":0}},\"methods\":{},\"decoratorConfig\":{\"tableName\":\"site_agent_bindings\",\"api\":{\"include\":[\"list\",\"get\",\"create\",\"update\",\"delete\"]},\"cli\":{\"include\":[\"list\",\"get\"]},\"mcp\":{\"include\":[\"list\",\"get\"]},\"conflictColumns\":[\"site_id\",\"agent_class\"],\"tenantScoped\":{\"mode\":\"required\"}},\"extends\":\"SmrtObject\",\"exportName\":\"SiteAgentBinding\",\"collectionExportName\":\"SiteAgentBindingCollection\",\"validationRules\":[],\"schema\":{\"tableName\":\"site_agent_bindings\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"site_agent_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 NOT NULL,\\n \\\"site_id\\\" UUID,\\n \\\"agent_class\\\" TEXT DEFAULT '',\\n \\\"enabled\\\" BOOLEAN DEFAULT TRUE,\\n \\\"config\\\" JSON DEFAULT '{}',\\n \\\"priority\\\" INTEGER DEFAULT 0\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":true,\"unique\":false},\"site_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":false,\"unique\":false,\"foreignKey\":{\"table\":\"sites\",\"column\":\"id\",\"onDelete\":\"CASCADE\",\"onUpdate\":\"CASCADE\"}},\"agent_class\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"enabled\":{\"type\":\"BOOLEAN\",\"notNull\":false,\"unique\":false,\"default\":true},\"config\":{\"type\":\"JSON\",\"notNull\":false,\"unique\":false,\"default\":{}},\"priority\":{\"type\":\"INTEGER\",\"notNull\":false,\"unique\":false,\"default\":0}},\"indexes\":[{\"name\":\"site_agent_bindings_site_id_agent_class_idx\",\"columns\":[\"site_id\",\"agent_class\"],\"unique\":true,\"nullsNotDistinct\":true},{\"name\":\"site_agent_bindings_slug_context_idx\",\"columns\":[\"slug\",\"context\"]},{\"name\":\"site_agent_bindings_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]}],\"version\":\"dec43c9c\"},\"importPath\":\"@happyvertical/smrt-sites\"}},\"moduleType\":\"smrt\",\"smrtDependencies\":[\"@happyvertical/smrt-core\",\"@happyvertical/smrt-tenancy\"]}"));
4
+ ObjectRegistry.registerPackageManifest(JSON.parse("{\"version\":\"1.0.0\",\"timestamp\":0,\"packageName\":\"@happyvertical/smrt-sites\",\"packageVersion\":\"0.51.33\",\"objects\":{\"@happyvertical/smrt-sites:SiteAgentBindingCollection\":{\"name\":\"siteagentbindingcollection\",\"className\":\"SiteAgentBindingCollection\",\"qualifiedName\":\"@happyvertical/smrt-sites:SiteAgentBindingCollection\",\"collection\":\"siteagentbindings\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/sites/src/collections/SiteAgentBindingCollection.ts\",\"packageName\":\"@happyvertical/smrt-sites\",\"fields\":{},\"methods\":{\"findBySite\":{\"name\":\"findBySite\",\"async\":true,\"parameters\":[{\"name\":\"siteId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<SiteAgentBinding[]>\",\"isStatic\":false,\"isPublic\":true},\"findByAgent\":{\"name\":\"findByAgent\",\"async\":true,\"parameters\":[{\"name\":\"agentClass\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<SiteAgentBinding[]>\",\"isStatic\":false,\"isPublic\":true},\"findEnabled\":{\"name\":\"findEnabled\",\"async\":true,\"parameters\":[{\"name\":\"siteId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<SiteAgentBinding[]>\",\"isStatic\":false,\"isPublic\":true},\"findBySiteAndAgent\":{\"name\":\"findBySiteAndAgent\",\"async\":true,\"parameters\":[{\"name\":\"siteId\",\"type\":\"string\",\"optional\":false},{\"name\":\"agentClass\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<SiteAgentBinding | null>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"tableName\":\"site_agent_bindings\"},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"SiteAgentBinding\",\"exportName\":\"SiteAgentBindingCollection\",\"collectionExportName\":\"SiteAgentBindingCollectionCollection\",\"schema\":{\"tableName\":\"site_agent_bindings\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"site_agent_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 NOT NULL,\\n \\\"site_id\\\" UUID,\\n \\\"agent_class\\\" TEXT DEFAULT '',\\n \\\"enabled\\\" BOOLEAN DEFAULT TRUE,\\n \\\"config\\\" JSON DEFAULT '{}',\\n \\\"priority\\\" INTEGER DEFAULT 0\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":true,\"unique\":false},\"site_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":false,\"unique\":false,\"foreignKey\":{\"table\":\"sites\",\"column\":\"id\",\"onDelete\":\"CASCADE\",\"onUpdate\":\"CASCADE\"}},\"agent_class\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"enabled\":{\"type\":\"BOOLEAN\",\"notNull\":false,\"unique\":false,\"default\":true},\"config\":{\"type\":\"JSON\",\"notNull\":false,\"unique\":false,\"default\":{}},\"priority\":{\"type\":\"INTEGER\",\"notNull\":false,\"unique\":false,\"default\":0}},\"indexes\":[{\"name\":\"site_agent_bindings_site_id_agent_class_idx\",\"columns\":[\"site_id\",\"agent_class\"],\"unique\":true,\"nullsNotDistinct\":true},{\"name\":\"site_agent_bindings_slug_context_idx\",\"columns\":[\"slug\",\"context\"]},{\"name\":\"site_agent_bindings_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]}],\"version\":\"dec43c9c\"},\"importPath\":\"@happyvertical/smrt-sites\"},\"@happyvertical/smrt-sites:SiteCollection\":{\"name\":\"sitecollection\",\"className\":\"SiteCollection\",\"qualifiedName\":\"@happyvertical/smrt-sites:SiteCollection\",\"collection\":\"sites\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/sites/src/collections/SiteCollection.ts\",\"packageName\":\"@happyvertical/smrt-sites\",\"fields\":{},\"methods\":{\"findByDomain\":{\"name\":\"findByDomain\",\"async\":true,\"parameters\":[{\"name\":\"domain\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Site | null>\",\"isStatic\":false,\"isPublic\":true},\"findByTenant\":{\"name\":\"findByTenant\",\"async\":true,\"parameters\":[{\"name\":\"tenantId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Site[]>\",\"isStatic\":false,\"isPublic\":true},\"findByStatus\":{\"name\":\"findByStatus\",\"async\":true,\"parameters\":[{\"name\":\"status\",\"type\":\"SiteStatus\",\"optional\":false}],\"returnType\":\"Promise<Site[]>\",\"isStatic\":false,\"isPublic\":true},\"findActive\":{\"name\":\"findActive\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<Site[]>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"tableName\":\"sites\"},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"Site\",\"exportName\":\"SiteCollection\",\"collectionExportName\":\"SiteCollectionCollection\",\"schema\":{\"tableName\":\"sites\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"sites\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"tenant_id\\\" UUID NOT NULL,\\n \\\"name\\\" TEXT DEFAULT '',\\n \\\"domain\\\" TEXT DEFAULT '',\\n \\\"status\\\" TEXT DEFAULT 'draft',\\n \\\"tier\\\" TEXT DEFAULT 'free',\\n \\\"database_url\\\" TEXT DEFAULT '',\\n \\\"database_type\\\" TEXT DEFAULT '',\\n \\\"portal_config\\\" TEXT DEFAULT '',\\n \\\"repository_url\\\" TEXT DEFAULT '',\\n \\\"template_name\\\" TEXT DEFAULT '',\\n \\\"provisioning_status\\\" TEXT DEFAULT '',\\n \\\"provisioned_at\\\" TIMESTAMP,\\n \\\"provisioning_error\\\" TEXT DEFAULT '',\\n \\\"metadata\\\" TEXT DEFAULT ''\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":true,\"unique\":false},\"name\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"domain\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"status\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"draft\"},\"tier\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"free\"},\"database_url\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"database_type\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"portal_config\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"repository_url\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"template_name\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"provisioning_status\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"provisioned_at\":{\"type\":\"TIMESTAMP\",\"notNull\":false,\"unique\":false},\"provisioning_error\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"metadata\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"}},\"indexes\":[{\"name\":\"sites_tenant_id_domain_idx\",\"columns\":[\"tenant_id\",\"domain\"],\"unique\":true,\"nullsNotDistinct\":true},{\"name\":\"sites_slug_context_idx\",\"columns\":[\"slug\",\"context\"]},{\"name\":\"sites_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]}],\"version\":\"1845042e\"},\"importPath\":\"@happyvertical/smrt-sites\"},\"@happyvertical/smrt-sites:Site\":{\"name\":\"site\",\"className\":\"Site\",\"qualifiedName\":\"@happyvertical/smrt-sites:Site\",\"collection\":\"sites\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/sites/src/models/Site.ts\",\"packageName\":\"@happyvertical/smrt-sites\",\"fields\":{\"tenantId\":{\"type\":\"text\",\"required\":true,\"_meta\":{\"sqlType\":\"UUID\",\"__tenancy\":{\"isTenantIdField\":true,\"autoFilter\":true,\"required\":true,\"autoPopulate\":true,\"nullable\":false,\"mode\":\"required\",\"field\":\"tenantId\",\"allowSuperAdminBypass\":false}}},\"name\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"domain\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"status\":{\"type\":\"text\",\"required\":false,\"default\":\"draft\"},\"tier\":{\"type\":\"text\",\"required\":false,\"default\":\"free\"},\"databaseUrl\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"databaseType\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"portalConfig\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"repositoryUrl\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"templateName\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"provisioningStatus\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"provisionedAt\":{\"type\":\"datetime\",\"required\":false},\"provisioningError\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"metadata\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"createdAt\":{\"type\":\"datetime\",\"required\":false},\"updatedAt\":{\"type\":\"datetime\",\"required\":false}},\"methods\":{\"isActive\":{\"name\":\"isActive\",\"async\":false,\"parameters\":[],\"returnType\":\"boolean\",\"isStatic\":false,\"isPublic\":true},\"isReady\":{\"name\":\"isReady\",\"async\":false,\"parameters\":[],\"returnType\":\"boolean\",\"isStatic\":false,\"isPublic\":true},\"getPortalConfig\":{\"name\":\"getPortalConfig\",\"async\":false,\"parameters\":[],\"returnType\":\"SitePortalConfig\",\"isStatic\":false,\"isPublic\":true},\"setPortalConfig\":{\"name\":\"setPortalConfig\",\"async\":false,\"parameters\":[{\"name\":\"config\",\"type\":\"SitePortalConfig\",\"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\":\"data\",\"type\":\"Record<string, unknown>\",\"optional\":false}],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"updateMetadata\":{\"name\":\"updateMetadata\",\"async\":false,\"parameters\":[{\"name\":\"updates\",\"type\":\"Record<string, unknown>\",\"optional\":false}],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"tableName\":\"sites\",\"api\":{\"include\":[\"list\",\"get\",\"create\",\"update\",\"delete\"]},\"mcp\":{\"include\":[\"list\",\"get\",\"create\",\"update\"]},\"cli\":{\"skipApiCheck\":true},\"conflictColumns\":[\"tenant_id\",\"domain\"],\"tenantScoped\":{\"mode\":\"required\"}},\"extends\":\"SmrtObject\",\"exportName\":\"Site\",\"collectionExportName\":\"SiteCollection\",\"validationRules\":[],\"schema\":{\"tableName\":\"sites\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"sites\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"tenant_id\\\" UUID NOT NULL,\\n \\\"name\\\" TEXT DEFAULT '',\\n \\\"domain\\\" TEXT DEFAULT '',\\n \\\"status\\\" TEXT DEFAULT 'draft',\\n \\\"tier\\\" TEXT DEFAULT 'free',\\n \\\"database_url\\\" TEXT DEFAULT '',\\n \\\"database_type\\\" TEXT DEFAULT '',\\n \\\"portal_config\\\" TEXT DEFAULT '',\\n \\\"repository_url\\\" TEXT DEFAULT '',\\n \\\"template_name\\\" TEXT DEFAULT '',\\n \\\"provisioning_status\\\" TEXT DEFAULT '',\\n \\\"provisioned_at\\\" TIMESTAMP,\\n \\\"provisioning_error\\\" TEXT DEFAULT '',\\n \\\"metadata\\\" TEXT DEFAULT ''\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":true,\"unique\":false},\"name\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"domain\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"status\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"draft\"},\"tier\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"free\"},\"database_url\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"database_type\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"portal_config\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"repository_url\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"template_name\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"provisioning_status\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"provisioned_at\":{\"type\":\"TIMESTAMP\",\"notNull\":false,\"unique\":false},\"provisioning_error\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"metadata\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"}},\"indexes\":[{\"name\":\"sites_tenant_id_domain_idx\",\"columns\":[\"tenant_id\",\"domain\"],\"unique\":true,\"nullsNotDistinct\":true},{\"name\":\"sites_slug_context_idx\",\"columns\":[\"slug\",\"context\"]},{\"name\":\"sites_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]}],\"version\":\"1845042e\"},\"importPath\":\"@happyvertical/smrt-sites\"},\"@happyvertical/smrt-sites:SiteAgentBinding\":{\"name\":\"siteagentbinding\",\"className\":\"SiteAgentBinding\",\"qualifiedName\":\"@happyvertical/smrt-sites:SiteAgentBinding\",\"collection\":\"siteagentbindings\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/sites/src/models/SiteAgentBinding.ts\",\"packageName\":\"@happyvertical/smrt-sites\",\"fields\":{\"tenantId\":{\"type\":\"text\",\"required\":true,\"_meta\":{\"sqlType\":\"UUID\",\"__tenancy\":{\"isTenantIdField\":true,\"autoFilter\":true,\"required\":true,\"autoPopulate\":true,\"nullable\":false,\"mode\":\"required\",\"field\":\"tenantId\",\"allowSuperAdminBypass\":false}}},\"siteId\":{\"type\":\"foreignKey\",\"required\":false,\"related\":\"Site\"},\"agentClass\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"enabled\":{\"type\":\"boolean\",\"required\":false,\"default\":true},\"config\":{\"type\":\"json\",\"required\":false,\"default\":{}},\"priority\":{\"type\":\"integer\",\"required\":false,\"default\":0}},\"methods\":{},\"decoratorConfig\":{\"tableName\":\"site_agent_bindings\",\"api\":{\"include\":[\"list\",\"get\",\"create\",\"update\",\"delete\"]},\"cli\":{\"include\":[\"list\",\"get\"]},\"mcp\":{\"include\":[\"list\",\"get\"]},\"conflictColumns\":[\"site_id\",\"agent_class\"],\"tenantScoped\":{\"mode\":\"required\"}},\"extends\":\"SmrtObject\",\"exportName\":\"SiteAgentBinding\",\"collectionExportName\":\"SiteAgentBindingCollection\",\"validationRules\":[],\"schema\":{\"tableName\":\"site_agent_bindings\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"site_agent_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 NOT NULL,\\n \\\"site_id\\\" UUID,\\n \\\"agent_class\\\" TEXT DEFAULT '',\\n \\\"enabled\\\" BOOLEAN DEFAULT TRUE,\\n \\\"config\\\" JSON DEFAULT '{}',\\n \\\"priority\\\" INTEGER DEFAULT 0\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":true,\"unique\":false},\"site_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":false,\"unique\":false,\"foreignKey\":{\"table\":\"sites\",\"column\":\"id\",\"onDelete\":\"CASCADE\",\"onUpdate\":\"CASCADE\"}},\"agent_class\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"enabled\":{\"type\":\"BOOLEAN\",\"notNull\":false,\"unique\":false,\"default\":true},\"config\":{\"type\":\"JSON\",\"notNull\":false,\"unique\":false,\"default\":{}},\"priority\":{\"type\":\"INTEGER\",\"notNull\":false,\"unique\":false,\"default\":0}},\"indexes\":[{\"name\":\"site_agent_bindings_site_id_agent_class_idx\",\"columns\":[\"site_id\",\"agent_class\"],\"unique\":true,\"nullsNotDistinct\":true},{\"name\":\"site_agent_bindings_slug_context_idx\",\"columns\":[\"slug\",\"context\"]},{\"name\":\"site_agent_bindings_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]}],\"version\":\"dec43c9c\"},\"importPath\":\"@happyvertical/smrt-sites\"}},\"moduleType\":\"smrt\",\"smrtDependencies\":[\"@happyvertical/smrt-core\",\"@happyvertical/smrt-tenancy\"]}"));
5
5
  //#endregion
6
6
  //#region src/models/SiteAgentBinding.ts
7
7
  var __defProp$1 = Object.defineProperty;
@@ -2,7 +2,7 @@
2
2
  "version": "1.0.0",
3
3
  "timestamp": 0,
4
4
  "packageName": "@happyvertical/smrt-sites",
5
- "packageVersion": "0.51.31",
5
+ "packageVersion": "0.51.33",
6
6
  "objects": {
7
7
  "@happyvertical/smrt-sites:SiteAgentBindingCollection": {
8
8
  "name": "siteagentbindingcollection",
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Site model - Represents a deployable website within a multi-tenant network
3
+ *
4
+ * Manages site lifecycle from draft through active/suspended/archived states,
5
+ * with infrastructure provisioning tracking and portal configuration.
6
+ *
7
+ * Tenancy: Sites are tenant-scoped with required mode — every site
8
+ * belongs to exactly one tenant.
9
+ */
10
+ import { SmrtObject } from '@happyvertical/smrt-core';
11
+ import type { ProvisioningStatus, SiteOptions, SitePortalConfig, SiteStatus, SiteTier } from '../types';
12
+ export declare class Site extends SmrtObject {
13
+ tenantId: string;
14
+ /** Display name, e.g. "Bentley Alberta" */
15
+ name: string;
16
+ /** Primary domain, e.g. "bentleyalberta.com" */
17
+ domain: string;
18
+ /** Lifecycle status */
19
+ status: SiteStatus;
20
+ /** Pricing/feature tier */
21
+ tier: SiteTier;
22
+ /** Site-specific database connection URL */
23
+ databaseUrl: string;
24
+ /** Database type: sqlite, postgres, libsql */
25
+ databaseType: string;
26
+ /** Theme, branding, navigation settings (JSON) */
27
+ portalConfig: string;
28
+ /** Git repository URL */
29
+ repositoryUrl: string;
30
+ /** Starter template name */
31
+ templateName: string;
32
+ /** Infrastructure provisioning status */
33
+ provisioningStatus: ProvisioningStatus | '';
34
+ /** When provisioning completed */
35
+ provisionedAt: Date | null;
36
+ /** Last provisioning error message */
37
+ provisioningError: string;
38
+ /** Extensible key-value metadata (JSON) */
39
+ metadata: string;
40
+ createdAt: Date;
41
+ updatedAt: Date;
42
+ constructor(options?: SiteOptions);
43
+ /**
44
+ * Check if the site is active
45
+ */
46
+ isActive(): boolean;
47
+ /**
48
+ * Check if the site is provisioned and ready
49
+ */
50
+ isReady(): boolean;
51
+ /**
52
+ * Get portal config as parsed object
53
+ */
54
+ getPortalConfig(): SitePortalConfig;
55
+ /**
56
+ * Set portal config from object
57
+ */
58
+ setPortalConfig(config: SitePortalConfig): void;
59
+ /**
60
+ * Get metadata as parsed object
61
+ */
62
+ getMetadata(): Record<string, unknown>;
63
+ /**
64
+ * Set metadata from object
65
+ */
66
+ setMetadata(data: Record<string, unknown>): void;
67
+ /**
68
+ * Update metadata by merging with existing values
69
+ */
70
+ updateMetadata(updates: Record<string, unknown>): void;
71
+ }
72
+ //# sourceMappingURL=Site.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Site.d.ts","sourceRoot":"","sources":["../../src/models/Site.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAQ,MAAM,0BAA0B,CAAC;AAE5D,OAAO,KAAK,EACV,kBAAkB,EAClB,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,QAAQ,EACT,MAAM,UAAU,CAAC;AAElB,qBAQa,IAAK,SAAQ,UAAU;IAElC,QAAQ,EAAE,MAAM,CAAM;IAEtB,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAM;IAElB,gDAAgD;IAChD,MAAM,EAAE,MAAM,CAAM;IAEpB,uBAAuB;IACvB,MAAM,EAAE,UAAU,CAAW;IAE7B,2BAA2B;IAC3B,IAAI,EAAE,QAAQ,CAAU;IAExB,4CAA4C;IAC5C,WAAW,EAAE,MAAM,CAAM;IAEzB,8CAA8C;IAC9C,YAAY,EAAE,MAAM,CAAM;IAE1B,kDAAkD;IAClD,YAAY,EAAE,MAAM,CAAM;IAE1B,yBAAyB;IACzB,aAAa,EAAE,MAAM,CAAM;IAE3B,4BAA4B;IAC5B,YAAY,EAAE,MAAM,CAAM;IAE1B,yCAAyC;IACzC,kBAAkB,EAAE,kBAAkB,GAAG,EAAE,CAAM;IAEjD,kCAAkC;IAClC,aAAa,EAAE,IAAI,GAAG,IAAI,CAAQ;IAElC,sCAAsC;IACtC,iBAAiB,EAAE,MAAM,CAAM;IAE/B,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,CAAM;IAEtB,SAAS,EAAE,IAAI,CAAc;IAC7B,SAAS,EAAE,IAAI,CAAc;gBAEjB,OAAO,GAAE,WAAgB;IA6CrC;;OAEG;IACH,QAAQ,IAAI,OAAO;IAInB;;OAEG;IACH,OAAO,IAAI,OAAO;IAIlB;;OAEG;IACH,eAAe,IAAI,gBAAgB;IASnC;;OAEG;IACH,eAAe,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI;IAI/C;;OAEG;IACH,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAStC;;OAEG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAIhD;;OAEG;IACH,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;CAIvD"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * SiteAgentBinding - Junction between sites and agents
3
+ *
4
+ * Represents which agents are bound to a specific site,
5
+ * with optional per-site agent configuration overrides.
6
+ *
7
+ * Each row binds an agent class to a site. The absence of a row
8
+ * means the agent is not enabled for that site.
9
+ */
10
+ import { SmrtObject } from '@happyvertical/smrt-core';
11
+ import type { SiteAgentBindingOptions } from '../types';
12
+ export declare class SiteAgentBinding extends SmrtObject {
13
+ tenantId: string;
14
+ /** FK to sites table */
15
+ siteId: string;
16
+ /** Agent class name, e.g. "Praeco" */
17
+ agentClass: string;
18
+ /** Whether this agent is enabled for the site */
19
+ enabled: boolean;
20
+ /** Per-site agent configuration overrides (JSON) */
21
+ config: Record<string, unknown> | null;
22
+ /** Sort priority (higher = first) */
23
+ priority: number;
24
+ constructor(options?: SiteAgentBindingOptions);
25
+ }
26
+ //# sourceMappingURL=SiteAgentBinding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SiteAgentBinding.d.ts","sourceRoot":"","sources":["../../src/models/SiteAgentBinding.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAc,UAAU,EAAQ,MAAM,0BAA0B,CAAC;AAExE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExD,qBAQa,gBAAiB,SAAQ,UAAU;IAE9C,QAAQ,EAAE,MAAM,CAAM;IAEtB,wBAAwB;IAExB,MAAM,EAAE,MAAM,CAAM;IAEpB,sCAAsC;IACtC,UAAU,EAAE,MAAM,CAAM;IAExB,iDAAiD;IACjD,OAAO,EAAE,OAAO,CAAQ;IAExB,oDAAoD;IACpD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAQ;IAE9C,qCAAqC;IACrC,QAAQ,EAAE,MAAM,CAAK;gBAET,OAAO,GAAE,uBAA4B;CAsBlD"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * SiteService - High-level API for site lifecycle management
3
+ *
4
+ * Provides stateless operations for creating, activating, suspending,
5
+ * and archiving sites, as well as managing agent bindings.
6
+ */
7
+ import type { SiteAgentBindingCollection } from '../collections/SiteAgentBindingCollection';
8
+ import type { SiteCollection } from '../collections/SiteCollection';
9
+ import type { Site } from '../models/Site';
10
+ import type { SiteAgentBinding } from '../models/SiteAgentBinding';
11
+ import type { CreateSiteData } from '../types';
12
+ /**
13
+ * Options for creating a SiteService
14
+ */
15
+ export interface SiteServiceOptions {
16
+ sites: SiteCollection;
17
+ bindings: SiteAgentBindingCollection;
18
+ }
19
+ export declare class SiteService {
20
+ private sites;
21
+ private bindings;
22
+ constructor(options: SiteServiceOptions);
23
+ /**
24
+ * Create a new site in draft status
25
+ */
26
+ createSite(tenantId: string, data: CreateSiteData): Promise<Site>;
27
+ /**
28
+ * Activate a site — validates required fields then sets status to active
29
+ */
30
+ activateSite(siteId: string): Promise<Site>;
31
+ /**
32
+ * Suspend a site
33
+ */
34
+ suspendSite(siteId: string): Promise<Site>;
35
+ /**
36
+ * Archive a site
37
+ */
38
+ archiveSite(siteId: string): Promise<Site>;
39
+ /**
40
+ * Mark site as provisioned and ready
41
+ */
42
+ markProvisioned(siteId: string): Promise<Site>;
43
+ /**
44
+ * Mark site provisioning as failed
45
+ */
46
+ markProvisioningFailed(siteId: string, error: string): Promise<Site>;
47
+ /**
48
+ * Bind an agent to a site
49
+ */
50
+ bindAgent(siteId: string, agentClass: string, config?: Record<string, unknown>): Promise<SiteAgentBinding>;
51
+ /**
52
+ * Unbind an agent from a site
53
+ */
54
+ unbindAgent(siteId: string, agentClass: string): Promise<void>;
55
+ /**
56
+ * Get all enabled agent bindings for a site
57
+ */
58
+ getEnabledAgents(siteId: string): Promise<SiteAgentBinding[]>;
59
+ /**
60
+ * Load a site by ID, throwing if not found
61
+ */
62
+ private requireSite;
63
+ }
64
+ //# sourceMappingURL=SiteService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SiteService.d.ts","sourceRoot":"","sources":["../../src/services/SiteService.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AAC5F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,cAAc,CAAC;IACtB,QAAQ,EAAE,0BAA0B,CAAC;CACtC;AAED,qBAAa,WAAW;IACtB,OAAO,CAAC,KAAK,CAAiB;IAC9B,OAAO,CAAC,QAAQ,CAA6B;gBAEjC,OAAO,EAAE,kBAAkB;IAKvC;;OAEG;IACG,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBvE;;OAEG;IACG,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBjD;;OAEG;IACG,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQhD;;OAEG;IACG,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQhD;;OAEG;IACG,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAUpD;;OAEG;IACG,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAS1E;;OAEG;IACG,SAAS,CACb,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,OAAO,CAAC,gBAAgB,CAAC;IAsB5B;;OAEG;IACG,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAOpE;;OAEG;IACG,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAInE;;OAEG;YACW,WAAW;CAO1B"}
@@ -3,12 +3,12 @@
3
3
  "sensitiveFieldsExcluded": true,
4
4
  "generatedAt": "1970-01-01T00:00:00.000Z",
5
5
  "packageName": "@happyvertical/smrt-sites",
6
- "packageVersion": "0.51.31",
6
+ "packageVersion": "0.51.33",
7
7
  "sourceManifestPath": "dist/manifest.json",
8
8
  "agentDocPath": "AGENTS.md",
9
9
  "sourceHashes": {
10
- "manifest": "492745afad90719f7e1f6e76aa456ac09043c1cf510202a93f28bce9eda462f9",
11
- "packageJson": "71b0aee28b1d6219bab985ca591e48e0ec6ca7d5f00055211571278e2da5e2f9",
10
+ "manifest": "6a3958ea67437403f246d37d3eebce9257fdbcbbf4e09db02fc43760d26c1068",
11
+ "packageJson": "7ac4f21a5190cf41a5379c158d271ef1569ec19e7b2df5a0804c1c968d97b76d",
12
12
  "agents": "20ecba2963426d3e132157f077fbdc5583a20bb0f68d8a7942cf7f8ada5d5aa2"
13
13
  },
14
14
  "exports": [
@@ -24,7 +24,7 @@
24
24
  "@happyvertical/sql": "catalog:",
25
25
  "@types/node": "24.13.6",
26
26
  "fast-glob": "3.3.3",
27
- "typescript": "5.9.3",
27
+ "typescript": "6.0.3",
28
28
  "vite": "8.1.4",
29
29
  "vitest": "4.1.10"
30
30
  },
package/dist/types.d.ts CHANGED
@@ -1,85 +1,78 @@
1
- /**
2
- * Data required to create a new site
3
- */
4
- export declare interface CreateSiteData {
5
- name: string;
6
- domain: string;
7
- tier?: SiteTier;
8
- databaseUrl?: string;
9
- databaseType?: string;
10
- portalConfig?: SitePortalConfig;
11
- repositoryUrl?: string;
12
- templateName?: string;
13
- metadata?: Record<string, unknown>;
14
- }
15
-
16
- /**
17
- * Infrastructure provisioning status
18
- */
19
- export declare type ProvisioningStatus = 'pending' | 'provisioning' | 'ready' | 'failed';
20
-
21
- /**
22
- * Options for constructing a SiteAgentBinding instance
23
- */
24
- export declare interface SiteAgentBindingOptions {
25
- id?: string;
26
- tenantId?: string;
27
- siteId?: string;
28
- agentClass?: string;
29
- enabled?: boolean;
30
- config?: Record<string, unknown> | string | null;
31
- priority?: number;
32
- createdAt?: Date;
33
- updatedAt?: Date;
34
- }
35
-
36
- /**
37
- * Options for constructing a Site instance
38
- */
39
- export declare interface SiteOptions {
40
- id?: string;
41
- tenantId?: string;
42
- name?: string;
43
- domain?: string;
44
- status?: SiteStatus;
45
- tier?: SiteTier;
46
- databaseUrl?: string;
47
- databaseType?: string;
48
- portalConfig?: SitePortalConfig | string;
49
- repositoryUrl?: string;
50
- templateName?: string;
51
- provisioningStatus?: ProvisioningStatus;
52
- provisionedAt?: Date | null;
53
- provisioningError?: string;
54
- metadata?: Record<string, unknown> | string;
55
- createdAt?: Date;
56
- updatedAt?: Date;
57
- }
58
-
59
- /**
60
- * Portal configuration for theming, branding, and navigation
61
- */
62
- export declare interface SitePortalConfig {
63
- theme?: string;
64
- branding?: Record<string, unknown>;
65
- navigation?: Array<{
66
- label: string;
67
- path: string;
68
- icon?: string;
69
- }>;
70
- }
71
-
72
- /**
73
- * Types for smrt-sites package
74
- */
75
- /**
76
- * Site lifecycle status
77
- */
78
- export declare type SiteStatus = 'draft' | 'active' | 'suspended' | 'archived';
79
-
80
- /**
81
- * Site pricing/feature tier
82
- */
83
- export declare type SiteTier = 'free' | 'standard' | 'premium';
84
-
85
- export { }
1
+ /**
2
+ * Types for smrt-sites package
3
+ */
4
+ /**
5
+ * Site lifecycle status
6
+ */
7
+ export type SiteStatus = 'draft' | 'active' | 'suspended' | 'archived';
8
+ /**
9
+ * Site pricing/feature tier
10
+ */
11
+ export type SiteTier = 'free' | 'standard' | 'premium';
12
+ /**
13
+ * Infrastructure provisioning status
14
+ */
15
+ export type ProvisioningStatus = 'pending' | 'provisioning' | 'ready' | 'failed';
16
+ /**
17
+ * Portal configuration for theming, branding, and navigation
18
+ */
19
+ export interface SitePortalConfig {
20
+ theme?: string;
21
+ branding?: Record<string, unknown>;
22
+ navigation?: Array<{
23
+ label: string;
24
+ path: string;
25
+ icon?: string;
26
+ }>;
27
+ }
28
+ /**
29
+ * Data required to create a new site
30
+ */
31
+ export interface CreateSiteData {
32
+ name: string;
33
+ domain: string;
34
+ tier?: SiteTier;
35
+ databaseUrl?: string;
36
+ databaseType?: string;
37
+ portalConfig?: SitePortalConfig;
38
+ repositoryUrl?: string;
39
+ templateName?: string;
40
+ metadata?: Record<string, unknown>;
41
+ }
42
+ /**
43
+ * Options for constructing a Site instance
44
+ */
45
+ export interface SiteOptions {
46
+ id?: string;
47
+ tenantId?: string;
48
+ name?: string;
49
+ domain?: string;
50
+ status?: SiteStatus;
51
+ tier?: SiteTier;
52
+ databaseUrl?: string;
53
+ databaseType?: string;
54
+ portalConfig?: SitePortalConfig | string;
55
+ repositoryUrl?: string;
56
+ templateName?: string;
57
+ provisioningStatus?: ProvisioningStatus;
58
+ provisionedAt?: Date | null;
59
+ provisioningError?: string;
60
+ metadata?: Record<string, unknown> | string;
61
+ createdAt?: Date;
62
+ updatedAt?: Date;
63
+ }
64
+ /**
65
+ * Options for constructing a SiteAgentBinding instance
66
+ */
67
+ export interface SiteAgentBindingOptions {
68
+ id?: string;
69
+ tenantId?: string;
70
+ siteId?: string;
71
+ agentClass?: string;
72
+ enabled?: boolean;
73
+ config?: Record<string, unknown> | string | null;
74
+ priority?: number;
75
+ createdAt?: Date;
76
+ updatedAt?: Date;
77
+ }
78
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,WAAW,GAAG,UAAU,CAAC;AAEvE;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;AAEvD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,SAAS,GACT,cAAc,GACd,OAAO,GACP,QAAQ,CAAC;AAEb;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,UAAU,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACpE;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,gBAAgB,GAAG,MAAM,CAAC;IACzC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,aAAa,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC;IAC5C,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,IAAI,CAAC;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happyvertical/smrt-sites",
3
- "version": "0.51.31",
3
+ "version": "0.51.33",
4
4
  "description": "Site lifecycle management for multi-tenant SMRT networks",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -19,16 +19,16 @@
19
19
  "./manifest.json": "./dist/manifest.json"
20
20
  },
21
21
  "dependencies": {
22
- "@happyvertical/smrt-core": "0.51.31",
23
- "@happyvertical/smrt-tenancy": "0.51.31"
22
+ "@happyvertical/smrt-core": "0.51.33",
23
+ "@happyvertical/smrt-tenancy": "0.51.33"
24
24
  },
25
25
  "devDependencies": {
26
- "@happyvertical/smrt-cli": "0.51.31",
27
- "@happyvertical/smrt-vitest": "0.51.31",
26
+ "@happyvertical/smrt-cli": "0.51.33",
27
+ "@happyvertical/smrt-vitest": "0.51.33",
28
28
  "@happyvertical/sql": "^0.94.1",
29
29
  "@types/node": "24.13.6",
30
30
  "fast-glob": "3.3.3",
31
- "typescript": "5.9.3",
31
+ "typescript": "6.0.3",
32
32
  "vite": "8.1.4",
33
33
  "vitest": "4.1.10"
34
34
  },