@elevasis/core 0.12.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +9 -2
- package/dist/organization-model/index.d.ts +1 -1
- package/dist/organization-model/index.js +9 -2
- package/dist/test-utils/index.d.ts +480 -389
- package/dist/test-utils/index.js +28 -2
- package/package.json +1 -1
- package/src/_gen/__tests__/__snapshots__/contracts.md.snap +2324 -0
- package/src/auth/multi-tenancy/credentials/__tests__/encryption.test.ts +217 -216
- package/src/auth/multi-tenancy/credentials/server/encryption.ts +5 -19
- package/src/auth/multi-tenancy/credentials/server/kek-loader.ts +3 -13
- package/src/auth/multi-tenancy/permissions.ts +12 -5
- package/src/business/acquisition/activity-events.test.ts +250 -0
- package/src/business/acquisition/activity-events.ts +84 -0
- package/src/business/acquisition/api-schemas.test.ts +1180 -0
- package/src/business/acquisition/api-schemas.ts +456 -235
- package/src/business/acquisition/crm-state-actions.test.ts +160 -0
- package/src/business/acquisition/derive-actions.test.ts +518 -0
- package/src/business/acquisition/derive-actions.ts +103 -0
- package/src/business/acquisition/index.ts +51 -11
- package/src/business/acquisition/stateful.ts +30 -0
- package/src/business/acquisition/types.ts +44 -77
- package/src/execution/engine/index.ts +4 -1
- package/src/execution/engine/tools/integration/server/adapters/apify/__tests__/apify-run-actor.integration.test.ts +1 -2
- package/src/execution/engine/tools/integration/server/adapters/attio/__tests__/attio-crud.integration.test.ts +363 -361
- package/src/execution/engine/tools/integration/server/adapters/attio/fetch/get-record/index.test.ts +162 -186
- package/src/execution/engine/tools/integration/server/adapters/attio/fetch/list-records/index.test.ts +316 -338
- package/src/execution/engine/tools/integration/server/adapters/gmail/gmail-adapter.ts +204 -210
- package/src/execution/engine/tools/integration/server/adapters/resend/fetch/send-email/index.test.ts +88 -0
- package/src/execution/engine/tools/integration/server/adapters/resend/fetch/send-email/index.ts +141 -134
- package/src/execution/engine/tools/integration/server/adapters/resend/fetch/utils/types.ts +76 -75
- package/src/execution/engine/tools/integration/service.test.ts +34 -9
- package/src/execution/engine/tools/integration/service.ts +6 -3
- package/src/execution/engine/tools/lead-service-types.ts +90 -30
- package/src/execution/engine/tools/platform/acquisition/types.ts +266 -260
- package/src/execution/engine/tools/registry.ts +5 -4
- package/src/execution/engine/tools/tool-maps.ts +43 -21
- package/src/execution/engine/workflow/types.ts +11 -0
- package/src/organization-model/contracts.ts +4 -4
- package/src/organization-model/domains/navigation.ts +62 -62
- package/src/organization-model/domains/sales.ts +272 -0
- package/src/organization-model/organization-graph.mdx +2 -2
- package/src/organization-model/published.ts +21 -21
- package/src/organization-model/resolve.ts +21 -8
- package/src/platform/constants/versions.ts +1 -1
- package/src/reference/_generated/contracts.md +2324 -0
- package/src/scaffold-registry/index.ts +10 -9
- package/src/scaffold-registry/schema.ts +68 -62
- package/src/supabase/database.types.ts +2958 -2884
- package/src/test-utils/rls/RLSTestContext.ts +585 -553
|
@@ -142,9 +142,7 @@ export function compileScaffoldRegistry(): ScaffoldRegistry {
|
|
|
142
142
|
|
|
143
143
|
const emptySources = findEmptySourcePatterns(registry, root)
|
|
144
144
|
if (emptySources.length > 0) {
|
|
145
|
-
const formatted = emptySources
|
|
146
|
-
.map((source) => ` [${source.entryId}] ${source.pattern}`)
|
|
147
|
-
.join('\n')
|
|
145
|
+
const formatted = emptySources.map((source) => ` [${source.entryId}] ${source.pattern}`).join('\n')
|
|
148
146
|
throw new Error(
|
|
149
147
|
`scaffold-registry: ${emptySources.length} source pattern(s) match no files or directories:\n${formatted}\n` +
|
|
150
148
|
`Fix the stale source glob, create the scaffold surface, or add explicit registry support for intentional empty patterns.`
|
|
@@ -235,14 +233,17 @@ export function loadScaffoldRegistryFast(): ScaffoldRegistry {
|
|
|
235
233
|
|
|
236
234
|
/**
|
|
237
235
|
* Return all entries whose `sources` contain at least one pattern that matches
|
|
238
|
-
* the given file path
|
|
239
|
-
*
|
|
240
|
-
* is implemented.
|
|
236
|
+
* the given file path AND whose `excludes` contain no pattern that matches.
|
|
237
|
+
* Pattern matching is a simple substring/glob-prefix check suitable for hook
|
|
238
|
+
* use; Step 3 will upgrade to full micromatch when the hook is implemented.
|
|
241
239
|
*/
|
|
242
240
|
export function findMatchingEntries(registry: ScaffoldRegistry, filePath: string): ScaffoldRegistryEntry[] {
|
|
243
|
-
return registry.entries.filter((entry) =>
|
|
244
|
-
entry.sources.some((pattern) => scaffoldPathMatchesPattern(filePath, pattern))
|
|
245
|
-
|
|
241
|
+
return registry.entries.filter((entry) => {
|
|
242
|
+
const sourceMatch = entry.sources.some((pattern) => scaffoldPathMatchesPattern(filePath, pattern))
|
|
243
|
+
if (!sourceMatch) return false
|
|
244
|
+
const excluded = (entry.excludes ?? []).some((pattern) => scaffoldPathMatchesPattern(filePath, pattern))
|
|
245
|
+
return !excluded
|
|
246
|
+
})
|
|
246
247
|
}
|
|
247
248
|
|
|
248
249
|
// ---------------------------------------------------------------------------
|
|
@@ -1,25 +1,19 @@
|
|
|
1
|
-
import { z } from 'zod'
|
|
2
|
-
|
|
3
|
-
// ---------------------------------------------------------------------------
|
|
4
|
-
// Kind taxonomy
|
|
5
|
-
// ---------------------------------------------------------------------------
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* The kind of scaffold entry:
|
|
9
|
-
*
|
|
10
|
-
* - autogen: fully derivable from source; regen command is the fix
|
|
11
|
-
* - manual-scaffold: hand-authored structure that must be updated on source change
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
// Kind taxonomy
|
|
5
|
+
// ---------------------------------------------------------------------------
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The kind of scaffold entry:
|
|
9
|
+
*
|
|
10
|
+
* - autogen: fully derivable from source; regen command is the fix
|
|
11
|
+
* - manual-scaffold: hand-authored structure that must be updated on source change
|
|
12
12
|
* - sync-preservation: external-template files with a declared sync tier
|
|
13
13
|
* - validator: drift-detection scripts or CI checks (meta.json pages[] validators, etc.)
|
|
14
14
|
* - other: escape hatch; requires free-form notes
|
|
15
15
|
*/
|
|
16
|
-
export const ScaffoldEntryKindSchema = z.enum([
|
|
17
|
-
'autogen',
|
|
18
|
-
'manual-scaffold',
|
|
19
|
-
'sync-preservation',
|
|
20
|
-
'validator',
|
|
21
|
-
'other'
|
|
22
|
-
])
|
|
16
|
+
export const ScaffoldEntryKindSchema = z.enum(['autogen', 'manual-scaffold', 'sync-preservation', 'validator', 'other'])
|
|
23
17
|
|
|
24
18
|
export type ScaffoldEntryKind = z.infer<typeof ScaffoldEntryKindSchema>
|
|
25
19
|
|
|
@@ -55,35 +49,35 @@ export type ExternalSyncStrategy = z.infer<typeof ExternalSyncStrategySchema>
|
|
|
55
49
|
export const ExternalSyncDeletePolicySchema = z.enum(['none', 'manifest-only'])
|
|
56
50
|
|
|
57
51
|
export type ExternalSyncDeletePolicy = z.infer<typeof ExternalSyncDeletePolicySchema>
|
|
58
|
-
|
|
59
|
-
// ---------------------------------------------------------------------------
|
|
60
|
-
// Scaffold reference (a single downstream artifact that needs attention)
|
|
61
|
-
// ---------------------------------------------------------------------------
|
|
62
|
-
|
|
63
|
-
export const ScaffoldRefSchema = z.object({
|
|
64
|
-
/**
|
|
65
|
-
* File path, glob, or symbolic target (e.g. "docs: sync-preservation-matrix").
|
|
66
|
-
* Symbolic targets begin with "docs:" or "autogen-target:".
|
|
67
|
-
*/
|
|
68
|
-
path: z.string().min(1),
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Command to regenerate, or "manual" if human judgment is required.
|
|
72
|
-
*/
|
|
73
|
-
regen: z.string().min(1).optional(),
|
|
74
|
-
|
|
52
|
+
|
|
53
|
+
// ---------------------------------------------------------------------------
|
|
54
|
+
// Scaffold reference (a single downstream artifact that needs attention)
|
|
55
|
+
// ---------------------------------------------------------------------------
|
|
56
|
+
|
|
57
|
+
export const ScaffoldRefSchema = z.object({
|
|
58
|
+
/**
|
|
59
|
+
* File path, glob, or symbolic target (e.g. "docs: sync-preservation-matrix").
|
|
60
|
+
* Symbolic targets begin with "docs:" or "autogen-target:".
|
|
61
|
+
*/
|
|
62
|
+
path: z.string().min(1),
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Command to regenerate, or "manual" if human judgment is required.
|
|
66
|
+
*/
|
|
67
|
+
regen: z.string().min(1).optional(),
|
|
68
|
+
|
|
75
69
|
/**
|
|
76
70
|
* Human-readable hint shown in reminder messages.
|
|
77
71
|
*/
|
|
78
|
-
hint: z.string().optional()
|
|
79
|
-
})
|
|
80
|
-
|
|
81
|
-
export type ScaffoldRef = z.infer<typeof ScaffoldRefSchema>
|
|
82
|
-
|
|
83
|
-
// ---------------------------------------------------------------------------
|
|
84
|
-
// Registry entry
|
|
85
|
-
// ---------------------------------------------------------------------------
|
|
86
|
-
|
|
72
|
+
hint: z.string().optional()
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
export type ScaffoldRef = z.infer<typeof ScaffoldRefSchema>
|
|
76
|
+
|
|
77
|
+
// ---------------------------------------------------------------------------
|
|
78
|
+
// Registry entry
|
|
79
|
+
// ---------------------------------------------------------------------------
|
|
80
|
+
|
|
87
81
|
export const ScaffoldRegistryEntrySchema = z
|
|
88
82
|
.object({
|
|
89
83
|
/**
|
|
@@ -106,6 +100,18 @@ export const ScaffoldRegistryEntrySchema = z
|
|
|
106
100
|
*/
|
|
107
101
|
sources: z.array(z.string().min(1)).min(1, 'At least one source pattern is required'),
|
|
108
102
|
|
|
103
|
+
/**
|
|
104
|
+
* Optional glob patterns that suppress this entry's reminder when the
|
|
105
|
+
* touched file matches. Applied after `sources`: a path that matches any
|
|
106
|
+
* `sources` pattern AND any `excludes` pattern is treated as no-match.
|
|
107
|
+
*
|
|
108
|
+
* Use case: a broad source glob (e.g. `apps/docs/content/docs/**\/*.mdx`)
|
|
109
|
+
* that should not fire on a sub-tree where the dependent scaffold does not
|
|
110
|
+
* apply (e.g. `apps/docs/content/docs/in-progress/**`, where MDX docs do
|
|
111
|
+
* not take meta.json files).
|
|
112
|
+
*/
|
|
113
|
+
excludes: z.array(z.string().min(1)).optional(),
|
|
114
|
+
|
|
109
115
|
/**
|
|
110
116
|
* Downstream artifacts that need attention when a source changes.
|
|
111
117
|
*/
|
|
@@ -217,21 +223,21 @@ export const ScaffoldRegistryEntrySchema = z
|
|
|
217
223
|
}
|
|
218
224
|
}
|
|
219
225
|
})
|
|
220
|
-
|
|
221
|
-
export type ScaffoldRegistryEntry = z.infer<typeof ScaffoldRegistryEntrySchema>
|
|
222
|
-
|
|
223
|
-
// ---------------------------------------------------------------------------
|
|
224
|
-
// Top-level registry document
|
|
225
|
-
// ---------------------------------------------------------------------------
|
|
226
|
-
|
|
227
|
-
export const ScaffoldRegistrySchema = z.object({
|
|
228
|
-
/**
|
|
229
|
-
* Schema version for forward-compatibility detection.
|
|
230
|
-
* Bump when the shape changes in a breaking way.
|
|
231
|
-
*/
|
|
232
|
-
version: z.string().default('1'),
|
|
233
|
-
|
|
234
|
-
entries: z.array(ScaffoldRegistryEntrySchema).min(1)
|
|
235
|
-
})
|
|
236
|
-
|
|
237
|
-
export type ScaffoldRegistry = z.infer<typeof ScaffoldRegistrySchema>
|
|
226
|
+
|
|
227
|
+
export type ScaffoldRegistryEntry = z.infer<typeof ScaffoldRegistryEntrySchema>
|
|
228
|
+
|
|
229
|
+
// ---------------------------------------------------------------------------
|
|
230
|
+
// Top-level registry document
|
|
231
|
+
// ---------------------------------------------------------------------------
|
|
232
|
+
|
|
233
|
+
export const ScaffoldRegistrySchema = z.object({
|
|
234
|
+
/**
|
|
235
|
+
* Schema version for forward-compatibility detection.
|
|
236
|
+
* Bump when the shape changes in a breaking way.
|
|
237
|
+
*/
|
|
238
|
+
version: z.string().default('1'),
|
|
239
|
+
|
|
240
|
+
entries: z.array(ScaffoldRegistryEntrySchema).min(1)
|
|
241
|
+
})
|
|
242
|
+
|
|
243
|
+
export type ScaffoldRegistry = z.infer<typeof ScaffoldRegistrySchema>
|