@elevasis/core 0.31.0 → 0.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,94 +1,122 @@
1
- import { z } from 'zod'
2
-
3
- // ---------------------------------------------------------------------------
4
- // Business hours — simplest shape that captures weekday ranges.
5
- // Each day of the week is optional; when present it holds open/close times
6
- // in "HH:MM" 24-hour format. An empty object (default) means "not configured".
7
- // ---------------------------------------------------------------------------
8
-
9
- export const BusinessHoursDaySchema = z.object({
10
- open: z
11
- .string()
12
- .trim()
13
- .regex(/^\d{2}:\d{2}$/, 'Expected HH:MM format'),
14
- close: z
15
- .string()
16
- .trim()
17
- .regex(/^\d{2}:\d{2}$/, 'Expected HH:MM format')
18
- })
19
-
20
- export const BusinessHoursSchema = z
21
- .object({
22
- monday: BusinessHoursDaySchema.optional(),
23
- tuesday: BusinessHoursDaySchema.optional(),
24
- wednesday: BusinessHoursDaySchema.optional(),
25
- thursday: BusinessHoursDaySchema.optional(),
26
- friday: BusinessHoursDaySchema.optional(),
27
- saturday: BusinessHoursDaySchema.optional(),
28
- sunday: BusinessHoursDaySchema.optional()
29
- })
30
- .default({})
31
-
32
- // ---------------------------------------------------------------------------
33
- // Identity domain schema — legal identity, mission/vision, industry anchors,
34
- // and temporal/geographic context. Distinct from branding (display identity).
35
- // ---------------------------------------------------------------------------
36
-
37
- export const IdentityDomainSchema = z.object({
38
- /** Why the organization exists — one or two plain-language sentences. */
39
- mission: z.string().trim().max(1000).default(''),
40
- /** Long-term direction the organization is moving toward. */
41
- vision: z.string().trim().max(1000).default(''),
42
- /** Legal registered name of the entity. */
43
- legalName: z.string().trim().max(200).default(''),
44
- /**
45
- * Type of legal entity (e.g. "LLC", "Corporation", "Sole Proprietor",
46
- * "Non-profit"). Free-form string so it covers any jurisdiction.
47
- */
48
- entityType: z.string().trim().max(100).default(''),
49
- /**
50
- * Primary jurisdiction of registration or operation
51
- * (e.g. "United States – Delaware", "Canada – Ontario").
52
- */
53
- jurisdiction: z.string().trim().max(200).default(''),
54
- /**
55
- * Industry category — broad classification (e.g. "Marketing Agency",
56
- * "Software / SaaS", "Professional Services").
57
- */
58
- industryCategory: z.string().trim().max(200).default(''),
59
- /**
60
- * Geographic focus — where the organization primarily operates or serves
61
- * (e.g. "North America", "Global", "Southeast Asia").
62
- */
63
- geographicFocus: z.string().trim().max(200).default(''),
64
- /**
65
- * IANA timezone identifier for the organization's primary operating timezone
66
- * (e.g. "America/Los_Angeles", "Europe/London", "UTC").
67
- */
68
- timeZone: z.string().trim().max(100).default('UTC'),
69
- /** Typical operating hours per day of week. Empty object means not configured. */
70
- businessHours: BusinessHoursSchema,
71
- /**
72
- * Long-form markdown capturing client context, problem narrative, and domain
73
- * background. Populated by /setup; surfaced to agents as organizational context.
74
- * Optional many projects have no external client.
75
- */
76
- clientBrief: z.string().trim().default('')
77
- })
78
-
79
- // ---------------------------------------------------------------------------
80
- // Seed placeholder defaults; external adapters override per organization.
81
- // ---------------------------------------------------------------------------
82
-
83
- export const DEFAULT_ORGANIZATION_MODEL_IDENTITY: z.infer<typeof IdentityDomainSchema> = {
84
- mission: '',
85
- vision: '',
86
- legalName: '',
87
- entityType: '',
88
- jurisdiction: '',
89
- industryCategory: '',
90
- geographicFocus: '',
91
- timeZone: 'UTC',
92
- businessHours: {},
93
- clientBrief: ''
94
- }
1
+ import { z } from 'zod'
2
+ import { DescriptionSchema, LabelSchema } from './shared'
3
+
4
+ // ---------------------------------------------------------------------------
5
+ // Business hours simplest shape that captures weekday ranges.
6
+ // Each day of the week is optional; when present it holds open/close times
7
+ // in "HH:MM" 24-hour format. An empty object (default) means "not configured".
8
+ // ---------------------------------------------------------------------------
9
+
10
+ export const BusinessHoursDaySchema = z.object({
11
+ open: z
12
+ .string()
13
+ .trim()
14
+ .regex(/^\d{2}:\d{2}$/, 'Expected HH:MM format'),
15
+ close: z
16
+ .string()
17
+ .trim()
18
+ .regex(/^\d{2}:\d{2}$/, 'Expected HH:MM format')
19
+ })
20
+
21
+ export const BusinessHoursSchema = z
22
+ .object({
23
+ monday: BusinessHoursDaySchema.optional(),
24
+ tuesday: BusinessHoursDaySchema.optional(),
25
+ wednesday: BusinessHoursDaySchema.optional(),
26
+ thursday: BusinessHoursDaySchema.optional(),
27
+ friday: BusinessHoursDaySchema.optional(),
28
+ saturday: BusinessHoursDaySchema.optional(),
29
+ sunday: BusinessHoursDaySchema.optional()
30
+ })
31
+ .default({})
32
+
33
+ // ---------------------------------------------------------------------------
34
+ // Identity domain schema legal identity, mission/vision, industry anchors,
35
+ // and temporal/geographic context. Distinct from branding (display identity).
36
+ // ---------------------------------------------------------------------------
37
+
38
+ export const IdentityDomainSchema = z
39
+ .object({
40
+ /** Why the organization exists one or two plain-language sentences. */
41
+ mission: z.string().trim().max(1000).default(''),
42
+ /** Long-term direction the organization is moving toward. */
43
+ vision: z.string().trim().max(1000).default(''),
44
+ /** Legal registered name of the entity. */
45
+ legalName: z.string().trim().max(200).default(''),
46
+ /**
47
+ * Type of legal entity (e.g. "LLC", "Corporation", "Sole Proprietor",
48
+ * "Non-profit"). Free-form string so it covers any jurisdiction.
49
+ */
50
+ entityType: z.string().trim().max(100).default(''),
51
+ /**
52
+ * Primary jurisdiction of registration or operation
53
+ * (e.g. "United States – Delaware", "Canada – Ontario").
54
+ */
55
+ jurisdiction: z.string().trim().max(200).default(''),
56
+ /**
57
+ * Industry category — broad classification (e.g. "Marketing Agency",
58
+ * "Software / SaaS", "Professional Services").
59
+ */
60
+ industryCategory: z.string().trim().max(200).default(''),
61
+ /**
62
+ * Geographic focus — where the organization primarily operates or serves
63
+ * (e.g. "North America", "Global", "Southeast Asia").
64
+ */
65
+ geographicFocus: z.string().trim().max(200).default(''),
66
+ /**
67
+ * IANA timezone identifier for the organization's primary operating timezone
68
+ * (e.g. "America/Los_Angeles", "Europe/London", "UTC").
69
+ */
70
+ timeZone: z.string().trim().max(100).default('UTC'),
71
+ /** Typical operating hours per day of week. Empty object means not configured. */
72
+ businessHours: BusinessHoursSchema,
73
+ /**
74
+ * Long-form markdown capturing client context, problem narrative, and domain
75
+ * background. Populated by /setup; surfaced to agents as organizational context.
76
+ * Optional — many projects have no external client.
77
+ */
78
+ clientBrief: z.string().trim().default(''),
79
+ /**
80
+ * Display name of the organization as shown to end users.
81
+ * Recommended placement for display naming — prefer this over the deprecated
82
+ * `branding.organizationName`. Falls back to `branding.organizationName` for
83
+ * legacy tenants that have not yet migrated.
84
+ */
85
+ organizationName: LabelSchema.optional(),
86
+ /**
87
+ * Display name of the primary product or platform.
88
+ * Recommended placement for display naming — prefer this over the deprecated
89
+ * `branding.productName`. Falls back to `branding.productName` for legacy tenants.
90
+ */
91
+ productName: LabelSchema.optional(),
92
+ /**
93
+ * Short abbreviated name used in space-constrained UI surfaces (max 40 chars).
94
+ * Recommended placement for display naming — prefer this over the deprecated
95
+ * `branding.shortName`. Falls back to `branding.shortName` for legacy tenants.
96
+ */
97
+ shortName: z.string().trim().min(1).max(40).optional(),
98
+ /**
99
+ * Plain-language description of the organization for display and discovery.
100
+ * Recommended placement for display naming — prefer this over the deprecated
101
+ * `branding.description`. Falls back to `branding.description` for legacy tenants.
102
+ */
103
+ description: DescriptionSchema.optional()
104
+ })
105
+ .passthrough()
106
+
107
+ // ---------------------------------------------------------------------------
108
+ // Seed — placeholder defaults; external adapters override per organization.
109
+ // ---------------------------------------------------------------------------
110
+
111
+ export const DEFAULT_ORGANIZATION_MODEL_IDENTITY: z.infer<typeof IdentityDomainSchema> = {
112
+ mission: '',
113
+ vision: '',
114
+ legalName: '',
115
+ entityType: '',
116
+ jurisdiction: '',
117
+ industryCategory: '',
118
+ geographicFocus: '',
119
+ timeZone: 'UTC',
120
+ businessHours: {},
121
+ clientBrief: ''
122
+ }
@@ -1465,6 +1465,51 @@ export type Database = {
1465
1465
  },
1466
1466
  ]
1467
1467
  }
1468
+ deployment_organization_models: {
1469
+ Row: {
1470
+ created_at: string
1471
+ deployment_id: string
1472
+ model_hash: string | null
1473
+ organization_id: string
1474
+ organization_model: Json
1475
+ schema_version: string
1476
+ updated_at: string
1477
+ }
1478
+ Insert: {
1479
+ created_at?: string
1480
+ deployment_id: string
1481
+ model_hash?: string | null
1482
+ organization_id: string
1483
+ organization_model: Json
1484
+ schema_version?: string
1485
+ updated_at?: string
1486
+ }
1487
+ Update: {
1488
+ created_at?: string
1489
+ deployment_id?: string
1490
+ model_hash?: string | null
1491
+ organization_id?: string
1492
+ organization_model?: Json
1493
+ schema_version?: string
1494
+ updated_at?: string
1495
+ }
1496
+ Relationships: [
1497
+ {
1498
+ foreignKeyName: "deployment_organization_models_deployment_id_fkey"
1499
+ columns: ["deployment_id"]
1500
+ isOneToOne: true
1501
+ referencedRelation: "deployments"
1502
+ referencedColumns: ["id"]
1503
+ },
1504
+ {
1505
+ foreignKeyName: "deployment_organization_models_organization_id_fkey"
1506
+ columns: ["organization_id"]
1507
+ isOneToOne: false
1508
+ referencedRelation: "organizations"
1509
+ referencedColumns: ["id"]
1510
+ },
1511
+ ]
1512
+ }
1468
1513
  deployments: {
1469
1514
  Row: {
1470
1515
  created_at: string