@elevasis/sdk 1.19.0 → 1.20.1

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.
Files changed (58) hide show
  1. package/dist/cli.cjs +1718 -72
  2. package/dist/index.d.ts +661 -7
  3. package/dist/index.js +565 -42
  4. package/dist/node/index.d.ts +2 -0
  5. package/dist/node/index.js +219 -2
  6. package/dist/test-utils/index.d.ts +459 -4
  7. package/dist/test-utils/index.js +509 -37
  8. package/dist/types/worker/platform.d.ts +15 -1
  9. package/dist/worker/index.js +365 -37
  10. package/package.json +2 -2
  11. package/reference/_navigation.md +2 -1
  12. package/reference/_reference-manifest.json +14 -0
  13. package/reference/claude-config/registries/knowledge-flags.json +156 -0
  14. package/reference/claude-config/rules/agent-start-here.md +5 -5
  15. package/reference/claude-config/rules/deployment.md +4 -3
  16. package/reference/claude-config/rules/frontend.md +2 -2
  17. package/reference/claude-config/rules/operations.md +17 -13
  18. package/reference/claude-config/rules/organization-model.md +7 -5
  19. package/reference/claude-config/rules/organization-os.md +13 -11
  20. package/reference/claude-config/rules/ui.md +3 -3
  21. package/reference/claude-config/rules/vibe.md +4 -4
  22. package/reference/claude-config/skills/explore/SKILL.md +4 -4
  23. package/reference/claude-config/skills/knowledge/SKILL.md +8 -8
  24. package/reference/claude-config/skills/knowledge/operations/codify-level-a.md +7 -7
  25. package/reference/claude-config/skills/knowledge/operations/codify-level-b.md +13 -13
  26. package/reference/claude-config/skills/knowledge/operations/customers.md +1 -1
  27. package/reference/claude-config/skills/knowledge/operations/goals.md +1 -1
  28. package/reference/claude-config/skills/knowledge/operations/identity.md +1 -1
  29. package/reference/claude-config/skills/knowledge/operations/offerings.md +1 -1
  30. package/reference/claude-config/skills/knowledge/operations/roles.md +1 -1
  31. package/reference/claude-config/skills/knowledge/operations/techStack.md +19 -91
  32. package/reference/claude-config/skills/project/SKILL.md +73 -13
  33. package/reference/claude-config/skills/save/SKILL.md +5 -5
  34. package/reference/claude-config/skills/tutorial/technical.md +5 -6
  35. package/reference/claude-config/sync-notes/2026-05-07-sdk-changes-release-train.md +34 -0
  36. package/reference/claude-config/sync-notes/2026-05-08-resource-governance-scaffold-guidance.md +38 -0
  37. package/reference/claude-config/sync-notes/2026-05-09-clients-domain.md +32 -0
  38. package/reference/claude-config/sync-notes/2026-05-09-command-system.md +33 -0
  39. package/reference/claude-config/sync-notes/2026-05-09-resource-governance-and-misc.md +69 -0
  40. package/reference/examples/organization-model.ts +17 -5
  41. package/reference/framework/index.mdx +1 -1
  42. package/reference/framework/project-structure.mdx +10 -8
  43. package/reference/packages/core/src/business/README.md +2 -2
  44. package/reference/packages/core/src/organization-model/README.md +10 -3
  45. package/reference/resources/index.mdx +27 -17
  46. package/reference/scaffold/core/organization-model.mdx +33 -14
  47. package/reference/scaffold/operations/workflow-recipes.md +35 -29
  48. package/reference/scaffold/recipes/add-a-feature.md +18 -3
  49. package/reference/scaffold/recipes/add-a-resource.md +50 -10
  50. package/reference/scaffold/recipes/customize-crm-actions.md +12 -6
  51. package/reference/scaffold/recipes/customize-organization-model.md +18 -3
  52. package/reference/scaffold/recipes/extend-crm.md +17 -19
  53. package/reference/scaffold/recipes/extend-lead-gen.md +31 -31
  54. package/reference/scaffold/recipes/index.md +1 -1
  55. package/reference/scaffold/reference/contracts.md +501 -303
  56. package/reference/scaffold/reference/feature-registry.md +1 -1
  57. package/reference/scaffold/reference/glossary.md +8 -3
  58. package/reference/scaffold/ui/recipes.md +21 -6
@@ -1,7 +1,7 @@
1
1
  # Codify Pipeline: Level A (Config-Only Edits)
2
2
 
3
3
  Level A is the codify pipeline for changes that land exclusively in
4
- `foundations/config/organization-model.ts`. No new TypeScript files are created. The entire
4
+ `core/config/organization-model.ts`. No new TypeScript files are created. The entire
5
5
  ceremony is: snapshot current file, propose the edit, write the edit, validate, and roll back on
6
6
  failure.
7
7
 
@@ -15,18 +15,18 @@ the specific field/block being changed and the proposed new value.
15
15
 
16
16
  ### Step 1: Snapshot
17
17
 
18
- Before any write, read `foundations/config/organization-model.ts` and keep the full file content
18
+ Before any write, read `core/config/organization-model.ts` and keep the full file content
19
19
  in memory as the rollback snapshot. Do not write any file during this step.
20
20
 
21
21
  ```
22
- Read("foundations/config/organization-model.ts")
22
+ Read("core/config/organization-model.ts")
23
23
  -- store as ROLLBACK_SNAPSHOT
24
24
  ```
25
25
 
26
26
  ### Step 2: Apply the edit
27
27
 
28
28
  Use the Edit tool to apply the caller's proposed change to
29
- `foundations/config/organization-model.ts`.
29
+ `core/config/organization-model.ts`.
30
30
 
31
31
  Rules for the edit:
32
32
 
@@ -67,7 +67,7 @@ If either validation step fails, proceed to Step 5 (rollback).
67
67
 
68
68
  If Step 3 or Step 4 failed:
69
69
 
70
- 1. Write the ROLLBACK_SNAPSHOT content back to `foundations/config/organization-model.ts`
70
+ 1. Write the ROLLBACK_SNAPSHOT content back to `core/config/organization-model.ts`
71
71
  verbatim (use the Write tool with the exact snapshot content).
72
72
  2. Confirm the file has been restored by checking that the content matches the snapshot.
73
73
  3. Return the error message to the caller.
@@ -90,9 +90,9 @@ The caller formats and presents the final report.
90
90
 
91
91
  Callers must provide before invoking this pipeline:
92
92
 
93
- - **Target file:** always `foundations/config/organization-model.ts`
93
+ - **Target file:** always `core/config/organization-model.ts`
94
94
  - **Target block:** the specific domain key or sub-key being changed (e.g. `identity`,
95
- `customers.segments`, `roles.roles`, `resourceMappings[id="rm-hubspot"].techStack`)
95
+ `customers.segments`, `roles.roles`, `resources.entries[id="hubspot"]`)
96
96
  - **Proposed value:** the new TypeScript literal to write for that block
97
97
  - **Confirmed:** the user has already said yes to the proposed change
98
98
 
@@ -1,9 +1,9 @@
1
1
  # Codify Pipeline: Level B (New Extension TypeScript Files)
2
2
 
3
3
  Level B is the codify pipeline for changes that require creating a new TypeScript file under
4
- `foundations/config/extensions/`. This pipeline is used when the user wants to add a custom
4
+ `core/config/extensions/`. This pipeline is used when the user wants to add a custom
5
5
  feature, a custom entity type, or any structural addition that cannot be expressed as a simple
6
- field override in `foundations/config/organization-model.ts`.
6
+ field override in `core/config/organization-model.ts`.
7
7
 
8
8
  Level B is **only offered when the user explicitly asks** for something that requires a new file.
9
9
  Never silently escalate from Level A to Level B. If Level A is sufficient, use it.
@@ -29,20 +29,20 @@ and for confirming the intent with the user before invoking this pipeline.
29
29
 
30
30
  Before any write, read and snapshot:
31
31
 
32
- 1. `foundations/config/organization-model.ts` (always touched for wiring)
32
+ 1. `core/config/organization-model.ts` (always touched for wiring)
33
33
  2. The target extension file path (if it already exists -- confirm overwrite with user)
34
34
 
35
35
  ```
36
- Read("foundations/config/organization-model.ts") -- store as ROLLBACK_ADAPTER
37
- Read("foundations/config/extensions/{target}.ts") -- store as ROLLBACK_EXTENSION (if exists)
36
+ Read("core/config/organization-model.ts") -- store as ROLLBACK_ADAPTER
37
+ Read("core/config/extensions/{target}.ts") -- store as ROLLBACK_EXTENSION (if exists)
38
38
  ```
39
39
 
40
40
  The target extension file path follows the naming convention:
41
- `foundations/config/extensions/{kebab-case-feature-id}.ts`
41
+ `core/config/extensions/{kebab-case-feature-id}.ts`
42
42
 
43
43
  ### Step 2: Scaffold the extension file
44
44
 
45
- Create `foundations/config/extensions/{id}.ts` using the Write tool.
45
+ Create `core/config/extensions/{id}.ts` using the Write tool.
46
46
 
47
47
  The file shape depends on the extension type:
48
48
 
@@ -51,7 +51,7 @@ The file shape depends on the extension type:
51
51
  ```typescript
52
52
  /**
53
53
  * {Feature label} feature extension.
54
- * Registered in foundations/config/organization-model.ts.
54
+ * Registered in core/config/organization-model.ts.
55
55
  */
56
56
  import type { OrganizationModelFeature } from '@elevasis/core/organization-model'
57
57
 
@@ -74,7 +74,7 @@ The caller provides the exact field values based on what the user confirmed.
74
74
 
75
75
  ### Step 3: Wire the extension into the adapter
76
76
 
77
- Edit `foundations/config/organization-model.ts` to:
77
+ Edit `core/config/organization-model.ts` to:
78
78
 
79
79
  1. Import the new constant from the extension file.
80
80
  2. Add it to the `features` array in the `defineOrganizationModel({...})` call.
@@ -114,7 +114,7 @@ If either check fails, proceed to Step 6 (rollback).
114
114
 
115
115
  If Step 4 or Step 5 failed:
116
116
 
117
- 1. Restore `foundations/config/organization-model.ts` from ROLLBACK_ADAPTER.
117
+ 1. Restore `core/config/organization-model.ts` from ROLLBACK_ADAPTER.
118
118
  2. If the extension file did not previously exist, delete it. If it previously existed, restore
119
119
  from ROLLBACK_EXTENSION.
120
120
  3. Re-run `pnpm -C operations check-types` to confirm the restore is clean. If the restore
@@ -139,7 +139,7 @@ The caller formats and presents the final report to the user.
139
139
 
140
140
  Callers must provide before invoking this pipeline:
141
141
 
142
- - **Extension file path:** `foundations/config/extensions/{id}.ts`
142
+ - **Extension file path:** `core/config/extensions/{id}.ts`
143
143
  - **Extension file content:** the full TypeScript content for the new file
144
144
  - **Adapter changes:** the exact import line and features-array addition to write into the adapter
145
145
  - **Confirmed:** the user has already said yes to the proposed change and explicitly requested
@@ -152,7 +152,7 @@ happen in the domain operation before this pipeline is invoked.
152
152
 
153
153
  ## Constraint: Extension files are Tier 3 (never synced)
154
154
 
155
- Files under `foundations/config/extensions/` are Tier 3 -- project-specific, never overwritten
155
+ Files under `core/config/extensions/` are Tier 3 -- project-specific, never overwritten
156
156
  by `/external sync`. This means custom features and entity extensions survive template upgrades
157
157
  automatically. Do not put platform-default overrides in extension files; those belong directly in
158
- `foundations/config/organization-model.ts` (Tier 2, merge-aware).
158
+ `core/config/organization-model.ts` (Tier 2, merge-aware).
@@ -89,7 +89,7 @@ customers: {
89
89
 
90
90
  ## Where it lives in the adapter
91
91
 
92
- `foundations/config/organization-model.ts` under the `customers` key of
92
+ `core/config/organization-model.ts` under the `customers` key of
93
93
  `defineOrganizationModel({...})`.
94
94
 
95
95
  To read current segments: open the adapter file and inspect the `customers.segments` array, or
@@ -98,7 +98,7 @@ goals: {
98
98
 
99
99
  ## Where it lives in the adapter
100
100
 
101
- `foundations/config/organization-model.ts` under the `goals` key of
101
+ `core/config/organization-model.ts` under the `goals` key of
102
102
  `defineOrganizationModel({...})`.
103
103
 
104
104
  To read current goals: open the adapter file and inspect the `goals.objectives` array, or use
@@ -74,7 +74,7 @@ identity: {
74
74
 
75
75
  ## Where it lives in the adapter
76
76
 
77
- `foundations/config/organization-model.ts` under the `identity` key of
77
+ `core/config/organization-model.ts` under the `identity` key of
78
78
  `defineOrganizationModel({...})`.
79
79
 
80
80
  To read the current values: open the adapter file and inspect the `identity` block directly, or
@@ -88,7 +88,7 @@ offerings: {
88
88
 
89
89
  ## Where it lives in the adapter
90
90
 
91
- `foundations/config/organization-model.ts` under the `offerings` key of
91
+ `core/config/organization-model.ts` under the `offerings` key of
92
92
  `defineOrganizationModel({...})`.
93
93
 
94
94
  To read current products: open the adapter file and inspect the `offerings.products` array, or
@@ -78,7 +78,7 @@ roles: {
78
78
 
79
79
  ## Where it lives in the adapter
80
80
 
81
- `foundations/config/organization-model.ts` under the `roles` key of
81
+ `core/config/organization-model.ts` under the `roles` key of
82
82
  `defineOrganizationModel({...})`.
83
83
 
84
84
  To read the current role chart: open the adapter file and inspect the `roles.roles` array, or
@@ -1,102 +1,30 @@
1
- # TechStack domain
1
+ # TechStack Context
2
2
 
3
- Tech stack information is not a standalone top-level domain it lives as an optional `techStack`
4
- extension field on individual `ResourceMapping` entries in the organization model. This keeps all
5
- integration metadata co-located with the resource mapping that represents it, while adding fields
6
- that agents need for cross-integration automation and system-of-record resolution.
3
+ Tech stack information is no longer modeled through `resourceMappings`. Resource identity and governance metadata live in OM Resources descriptors under `organizationModel.resources.entries`; external platform context belongs on the relevant integration descriptor or in project knowledge when the descriptor schema does not expose a dedicated field yet.
7
4
 
8
- ## Schema
5
+ ## Current Resource-Governance Contract
9
6
 
10
- Source: `packages/core/src/organization-model/domains/shared.ts`
7
+ - Resource IDs are authored once in `core/config/organization-model.ts`.
8
+ - Runtime workflows, agents, and integrations derive `resourceId` / `type` from OM descriptors during deployment assembly.
9
+ - `DeploymentSpec` remains the runtime/deploy bundle, not an independent identity catalog.
10
+ - `pnpm -C operations check` validates descriptor/code alignment before deploy.
11
11
 
12
- ```typescript
13
- TechStackEntrySchema = z.object({
14
- platform: z.string().trim().min(1).max(200),
15
- purpose: z.string().trim().min(1).max(500),
16
- credentialStatus: z.enum(['configured', 'pending', 'expired', 'missing']),
17
- isSystemOfRecord: z.boolean().default(false)
18
- })
19
- ```
12
+ ## Where To Look
20
13
 
21
- `TechStackEntrySchema` is an optional field on `ResourceMappingSchema`. It applies to resource
22
- mapping entries whose `resourceType` is `'integration'` or `'external'`.
14
+ - `core/config/organization-model.ts` -- Systems and Resources descriptors.
15
+ - `operations/src/index.ts` -- deployment assembly that binds executable behavior to descriptors.
16
+ - `pnpm elevasis-sdk project:list --pretty` -- live deployed resource surface.
17
+ - Project knowledge nodes -- narrative details such as credential owner, setup notes, and system-of-record rationale when they do not fit the descriptor shape.
23
18
 
24
- ## Field reference
19
+ ## Write Path
25
20
 
26
- | Field | Type | Notes |
27
- | ------------------ | ------- | ---------------------------------------------------------------------- |
28
- | `platform` | string | Name of the external platform; e.g. `"HubSpot"`, `"Stripe"`, `"Apify"` |
29
- | `purpose` | string | Free-form description of what this integration is used for |
30
- | `credentialStatus` | enum | `configured`, `pending`, `expired`, or `missing` |
31
- | `isSystemOfRecord` | boolean | `true` if this integration is the authoritative source for its domain |
21
+ When the user wants to document or change integration ownership, credential status, or system-of-record context:
32
22
 
33
- ## Validation rules
34
-
35
- - `platform` and `purpose` are required (min 1 char)
36
- - `credentialStatus` must be one of the four enum values; no free-form strings
37
- - `isSystemOfRecord` defaults to `false`; only one integration per domain should be `true`,
38
- though the schema does not enforce uniqueness — agents should surface conflicts
39
- - `techStack` applies only to resource mappings with `resourceType: 'integration'` or
40
- `'external'`; adding it to other resource types is valid at schema level but semantically
41
- incorrect
42
-
43
- `credentialStatus` semantics:
44
-
45
- - `configured` -- credential present and active
46
- - `pending` -- integration planned but not yet set up
47
- - `expired` -- credential previously configured but has lapsed
48
- - `missing` -- expected to be configured but not present
49
-
50
- ## Examples
51
-
52
- ```typescript
53
- // Inside resourceMappings array in defineOrganizationModel({...})
54
- resourceMappings: [
55
- {
56
- id: "rm-hubspot",
57
- label: "HubSpot CRM Integration",
58
- resourceType: "integration",
59
- techStack: {
60
- platform: "HubSpot",
61
- purpose: "CRM for contacts, companies, and deal pipeline",
62
- credentialStatus: "configured",
63
- isSystemOfRecord: true
64
- }
65
- },
66
- {
67
- id: "rm-apify",
68
- label: "Apify Web Scraping",
69
- resourceType: "integration",
70
- techStack: {
71
- platform: "Apify",
72
- purpose: "Web scraping and data extraction for lead enrichment",
73
- credentialStatus: "pending",
74
- isSystemOfRecord: false
75
- }
76
- }
77
- ]
78
- ```
79
-
80
- ## Where it lives in the adapter
81
-
82
- `foundations/config/organization-model.ts` inside the `resourceMappings` array of
83
- `defineOrganizationModel({...})`. The `techStack` field is set on the matching `ResourceMapping`
84
- object by `id`.
85
-
86
- To read current tech stack entries: open the adapter file and inspect the `resourceMappings`
87
- array, filtering to entries with a `techStack` field, or use
88
- `pnpm exec elevasis-sdk knowledge:cat techStack` (external project).
89
-
90
- ## Write path
91
-
92
- To add or update `techStack` metadata on a resource mapping, the `/knowledge` skill runs the
93
- codify ceremony (`operations/codify-level-a.md`): snapshot → propose → confirm → write →
94
- typecheck → Zod parse → rollback on failure. Only the targeted `resourceMappings` entry (matched
95
- by `id`) is modified; all other entries are left unchanged. If the user only wants to update
96
- `credentialStatus`, a targeted edit to that single field is preferred.
23
+ 1. Inspect `core/config/organization-model.ts` for the relevant integration Resource descriptor.
24
+ 2. If the descriptor identity, System membership, owner role, or status is wrong, update the descriptor through the `/knowledge` ceremony where possible.
25
+ 3. If the requested detail is operational narrative rather than descriptor schema, capture it in a knowledge node or project documentation instead of recreating `resourceMappings`.
26
+ 4. Run `pnpm -C operations check` after descriptor or deployment assembly changes.
97
27
 
98
28
  ---
99
29
 
100
- **Read via `/knowledge`** natural-language queries like "what integrations are configured?" or
101
- "is HubSpot our system of record for contacts?" route to this domain via the skill's intent
102
- classifier.
30
+ **Read via `/knowledge`** -- natural-language queries like "what integrations are configured?" or "is HubSpot our system of record for contacts?" route here for inspection and recommendation.
@@ -41,11 +41,11 @@ allowed-tools: Bash, Read, Write, Edit, Glob, Grep
41
41
 
42
42
  This skill is the landing point for three of the seven vibe intent types. Agents arriving from the ambient layer should behave identically to a direct invocation — vibe is a classifier, not a different code path.
43
43
 
44
- | Vibe intent | What vibe detected | What to do here |
45
- |---|---|---|
46
- | **Capture** | "add a task", "remember to", "track this" | Draft the task/note, confirm with user, then `project:task:create` or `project:note:create` |
47
- | **Transition** | "done", "stuck", "blocked", "finished" | Resolve current task from session context, confirm status, then `project:task:update --status <new>` |
48
- | **Navigate** | "focus on", "switch to", "back to" | Resolve target via `project:resolve <query>` or `project:work <query>`, update scope, narrate new context |
44
+ | Vibe intent | What vibe detected | What to do here |
45
+ | -------------- | ----------------------------------------- | --------------------------------------------------------------------------------------------------------- |
46
+ | **Capture** | "add a task", "remember to", "track this" | Draft the task/note, confirm with user, then `project:task:create` or `project:note:create` |
47
+ | **Transition** | "done", "stuck", "blocked", "finished" | Resolve current task from session context, confirm status, then `project:task:update --status <new>` |
48
+ | **Navigate** | "focus on", "switch to", "back to" | Resolve target via `project:resolve <query>` or `project:work <query>`, update scope, narrate new context |
49
49
 
50
50
  **The full continuity loop** — how work flows across sessions:
51
51
 
@@ -316,7 +316,8 @@ To clear a checklist: `--checklist '[]'`.
316
316
  - `prj_notes.task_id` → `prj_tasks.id` (SET NULL)
317
317
  - `prj_notes.milestone_id` → `prj_milestones.id` (SET NULL)
318
318
  - `prj_projects.deal_id` → `acq_deals.id` (SET NULL)
319
- - `prj_projects.client_company_id` → `acq_companies.id` (SET NULL)
319
+ - `prj_projects.client_id` → `clients.id` (SET NULL) — clients-hub link; set via `--client`
320
+ - `prj_projects.client_company_id` → `acq_companies.id` (SET NULL) — legacy direct-company link; set via `--client-company-id`
320
321
 
321
322
  ---
322
323
 
@@ -328,6 +329,9 @@ For a plain project table without resume context or next-action suggestions (use
328
329
 
329
330
  ```bash
330
331
  pnpm elevasis-sdk project:list --kind client_engagement --pretty
332
+
333
+ # Filter by client (accepts the client's name or UUID)
334
+ pnpm elevasis-sdk project:list --client "Acme" --pretty
331
335
  ```
332
336
 
333
337
  Present as:
@@ -540,11 +544,15 @@ Create everything in sequence using the CLI:
540
544
 
541
545
  ```bash
542
546
  # 1. Create project
547
+ # If the user mentioned a client by name, resolve it first:
548
+ # pnpm elevasis-sdk client:resolve "<client name>"
549
+ # Then pass the name (or UUID) via --client
543
550
  pnpm elevasis-sdk project:create \
544
551
  --name "<name>" \
545
552
  --kind client_engagement \
546
553
  --status active \
547
- --description "<desc>"
554
+ --description "<desc>" \
555
+ --client "<client-name-or-uuid>"
548
556
 
549
557
  # 2. Create milestones
550
558
  pnpm elevasis-sdk project:milestone:create \
@@ -563,12 +571,16 @@ pnpm elevasis-sdk project:note:create \
563
571
  If `--company` or `--deal` linking was confirmed, use `project:update` after creation:
564
572
 
565
573
  ```bash
566
- pnpm elevasis-sdk project:update <project-id> --description "<updated with link info>"
574
+ pnpm elevasis-sdk project:update <project-id> --client "<client-name-or-uuid>"
575
+ ```
576
+
577
+ To remove a client link later:
578
+
579
+ ```bash
580
+ pnpm elevasis-sdk project:update <project-id> --clear-client
567
581
  ```
568
582
 
569
- (Note: company/deal linking fields are set via the API. If the CLI `project:update` command
570
- doesn't expose `--client-company-id` or `--deal-id` directly, document the project ID and
571
- advise the user to link via the Command Center UI.)
583
+ Do NOT pass `--client ""` to clear an empty string is rejected as ambiguous. Use `--clear-client` instead.
572
584
 
573
585
  **Step 7: Summary**
574
586
 
@@ -618,7 +630,7 @@ pnpm elevasis-sdk project:create \
618
630
 
619
631
  ### `update <client> [options]` — Update Project
620
632
 
621
- **Options:** `--status`, `--name`, `--description`
633
+ **Options:** `--status`, `--name`, `--description`, `--client <id-or-name>`, `--clear-client`, `--client-company-id <uuid>`
622
634
 
623
635
  First resolve the client (see Client Inference below), then:
624
636
 
@@ -1005,6 +1017,54 @@ source .env && psql "$SUPABASE_READONLY_URL" -c \
1005
1017
 
1006
1018
  ---
1007
1019
 
1020
+ ## Client Linking
1021
+
1022
+ Projects can be linked to a client in the clients hub. When a user mentions a client by name, resolve it to an ID and use `--client` to wire the project.
1023
+
1024
+ ### Two linking flags, two different columns
1025
+
1026
+ - `--client <name-or-uuid>` — links to a clients-hub record (`prj_projects.client_id`). Use this for new client linkage. Accepts a name (the CLI fuzzy-resolves it) or a UUID.
1027
+ - `--client-company-id <uuid>` — legacy direct-company linkage (`prj_projects.client_company_id`); kept for back-compat. UUID only.
1028
+
1029
+ These are independent. Do not use `--client-company-id` when you mean `--client`.
1030
+
1031
+ ### When the user mentions a client by name
1032
+
1033
+ 1. Resolve the client name to a UUID first (optional but gives an explicit confirmation step):
1034
+ ```bash
1035
+ pnpm elevasis-sdk client:resolve "Acme"
1036
+ ```
1037
+ 2. Pass the name or UUID to `--client` — the CLI fuzzy-resolves names automatically:
1038
+ ```bash
1039
+ pnpm elevasis-sdk project:create --name "Acme Automation" --kind client_engagement --client "Acme"
1040
+ pnpm elevasis-sdk project:update <project-id> --client "Acme"
1041
+ ```
1042
+ 3. If the client name matches multiple records, the CLI returns an error listing candidates. In that case, run `client:resolve "Acme"` to disambiguate, then pass the UUID directly.
1043
+
1044
+ ### Filtering projects by client
1045
+
1046
+ ```bash
1047
+ pnpm elevasis-sdk project:list --client "Acme" --pretty
1048
+ ```
1049
+
1050
+ ### Removing a client link
1051
+
1052
+ ```bash
1053
+ pnpm elevasis-sdk project:update <project-id> --clear-client
1054
+ ```
1055
+
1056
+ `--client` and `--clear-client` are mutually exclusive on the same command call.
1057
+
1058
+ ### Soft recommendation for client engagement projects
1059
+
1060
+ When the user creates a `client_engagement` project without mentioning a client, gently note that linking a client is recommended so the project appears in client lineage views. Do not block creation — the flag is optional.
1061
+
1062
+ ### Client command reference
1063
+
1064
+ The full `client:*` surface (list, get, status, resolve) is available via `elevasis-sdk client:*`. The `client:resolve` command mirrors `project:resolve` in shape and is the canonical tool for name-to-ID translation.
1065
+
1066
+ ---
1067
+
1008
1068
  ## Safety Rules
1009
1069
 
1010
1070
  1. **Always confirm deletes** — show what will be cascade-deleted before executing
@@ -1025,4 +1085,4 @@ source .env && psql "$SUPABASE_READONLY_URL" -c \
1025
1085
 
1026
1086
  ---
1027
1087
 
1028
- **Last Updated:** 2026-04-19
1088
+ **Last Updated:** 2026-05-08
@@ -45,18 +45,18 @@ Review the current conversation to identify:
45
45
  3. **Stale docs** -- information in existing docs that is now outdated
46
46
  4. **Signal events** -- blocker hit, status update worth recording, issue uncovered, call outcome
47
47
  5. **OS contract paths touched** -- scan files read/written/edited for any of these signals:
48
- - `foundations/config/organization-model.ts` -> Foundations layer, Organization Model
49
- - `foundations/types/index.ts` -> Foundations layer, Workflow Contracts
48
+ - `core/config/organization-model.ts` -> Foundations layer, Organization Model
49
+ - `core/types/index.ts` -> Foundations layer, Workflow Contracts
50
50
  - `ui/src/routes/__root.tsx` -> UI Shell Runtime composition
51
51
  - `ui/src/features/**/manifest.ts` or any file defining a `FeatureModule` -> Features layer
52
- - `operations/src/index.ts` or `operations/elevasis.config.ts` -> Foundations/Deployment (DeploymentSpec)
52
+ - `operations/src/index.ts` or `operations/elevasis.config.ts` -> core/Deployment (DeploymentSpec)
53
53
  - Any file inside `ui/src/features/<feature>/` combined with manifest, nav, or sidebar changes -> Features + Toolkit layers
54
54
 
55
55
  Record which OS layers were touched: `foundations`, `features`, `shell-runtime`, `toolkit`, `deployment`. If none matched, OS awareness stays dormant for the rest of this run.
56
56
 
57
57
  ### Step 3: Update Knowledge Docs
58
58
 
59
- Scan for unindexed or stale knowledge docs and draft creates / updates / moves. This template does not have a `docs/` tree — look for any local knowledge files (`.claude/rules/`, `operations/src/README.md`, `foundations/`, or project-specific docs the user has created). All edits are on knowledge/architecture/feature docs -- NOT on task resume state (that flows to the DB in Step 4).
59
+ Scan for unindexed or stale knowledge docs and draft creates / updates / moves. This template does not have a `docs/` tree — look for any local knowledge files (`.claude/rules/`, `operations/src/README.md`, `core/`, or project-specific docs the user has created). All edits are on knowledge/architecture/feature docs -- NOT on task resume state (that flows to the DB in Step 4).
60
60
 
61
61
  Determine what needs to happen:
62
62
 
@@ -115,7 +115,7 @@ pnpm elevasis-sdk project:task:save <task-uuid> \
115
115
  --current-state "<concise prose summary of where we are>" \
116
116
  --next-steps "<concise prose of the next concrete action>" \
117
117
  --files-modified '["path/one.ts","path/two.tsx"]' \
118
- --key-docs '["operations/resources/foo/index.ts"]' \
118
+ --key-docs '["operations/src/foo/index.ts","core/config/organization-model.ts"]' \
119
119
  --tools '["project:task:save","project:note:create"]'
120
120
  ```
121
121
 
@@ -686,7 +686,7 @@ Or target a specific domain:
686
686
  - `/knowledge offerings` -- products and services with pricing model and segment references
687
687
  - `/knowledge roles` -- role chart with responsibilities and reporting lines
688
688
  - `/knowledge goals` -- organizational goals with period and measurable outcomes
689
- - `/knowledge techStack` -- external SaaS integration metadata on resource mappings
689
+ - `/knowledge techStack` -- external SaaS and integration context tied to OM Resources descriptors or knowledge nodes
690
690
 
691
691
  **Demo.** Ask the user to run `/knowledge identity`. Walk through the ceremony together -- read
692
692
  the current state, propose an edit, confirm, watch it validate.
@@ -757,7 +757,7 @@ how to add project-specific metadata fields to base entities.
757
757
  **Estimated time:** 20 min
758
758
 
759
759
  **Files referenced:** `core/types/entities.ts`, `core/config/organization-model.ts`
760
- (for the `resourceMappings` context)
760
+ (for the OM Resources descriptor context)
761
761
 
762
762
  **Flow:**
763
763
 
@@ -953,10 +953,9 @@ await email.send({
953
953
  })
954
954
  ```
955
955
 
956
- **Real adapter integration.** Read `core/config/organization-model.ts` and find the
957
- `resourceMappings` entries. Each entry may carry a `techStack` extension showing the platform
958
- (`attio`, `stripe`, `apify`, etc.), the credential name, and whether a credential is configured.
959
- Use the credential name from there as the constructor argument:
956
+ **Real adapter integration.** Read `core/config/organization-model.ts` and find the relevant
957
+ OM Resources descriptor or project knowledge node for the integration. Use the documented
958
+ credential name as the constructor argument:
960
959
 
961
960
  ```typescript
962
961
  import { createAttioAdapter } from '@elevasis/sdk/worker'
@@ -0,0 +1,34 @@
1
+ # 2026-05-07 -- SDK Changes Release Train
2
+
3
+ ## Why this note exists
4
+
5
+ This train coordinates the DTC list-builder overhaul (Apollo/Apify/ClickUp credential plumbing, live build-status panel, useInFlightExecutions hook) and the right-panel reusability refactor (theme tokens, compact chart sizing, plain chat message variant) into one published `@elevasis/core` + `@elevasis/ui` release plus a coordinated SDK resource deploy and external sync.
6
+
7
+ ## Applies to
8
+
9
+ - Template-derived projects consuming `@elevasis/core` or `@elevasis/ui`.
10
+ - Projects using the lead-gen list-builder UI (selectors, records views, live status panel) or the shared chat/chart primitives.
11
+ - Projects that mount Command Center-style right-panel composition (only the shared `@elevasis/ui` surfaces moved; the panel host itself stays app-local to Command Center).
12
+
13
+ ## Required actions
14
+
15
+ 1. Pull the synced template changes through `/git-sync`.
16
+ 2. Accept the package baseline bumps published by this train:
17
+ - `core/package.json`: `@elevasis/core` patch bump (Apify/Apollo/ClickUp adapter updates + Apollo `credentialRequirements` on prospecting Steps 1 and 5).
18
+ - `ui/package.json`: `@elevasis/ui` minor bump (additive: `useInFlightExecutions` hook, `useListProgress` accepts `{ enabled, refetchInterval }`, `--right-panel-background` theme token, compact `CombinedTrendChart` sizing, plain `ChatInterface` message variant, card-based `MessageBubble` styling).
19
+ 3. If a project pins integration credentials by provider name, verify generic API-key credentials named like `apify`, `apollo`, or `clickup` continue to verify after the adapter alias normalization.
20
+ 4. If a project consumed the shared chat/chart primitives, review compact-variant render output against existing layouts.
21
+
22
+ ## Verification
23
+
24
+ - `pnpm -C ui check-types`
25
+ - `pnpm -C ui build`
26
+ - `pnpm -C ui test`
27
+ - `pnpm -C operations check`
28
+ - `pnpm -C operations check-types`
29
+
30
+ ## Not handled by /git-sync
31
+
32
+ - Project-authored right-panel registries remain project-owned code; the host generalization is app-local to Command Center and does not propagate to template projects.
33
+ - ClickUp List ID destination configuration is per-project and is not synced.
34
+ - The Apollo plan-gated `403 API_INACCESSIBLE` for `mixed_companies/search` is tracked separately in the Elevasis monorepo and is not a tenant migration concern.
@@ -0,0 +1,38 @@
1
+ # Resource Governance Scaffold Guidance
2
+
3
+ ## Why this note exists
4
+
5
+ The template guidance now treats OM Resources descriptors as the source of truth for resource identity and governance metadata. Operations code should import descriptors from `core/config/organization-model.ts`, derive runtime `resourceId` / `type` from them, and use `DeploymentSpec` only as the deployment assembly artifact.
6
+
7
+ This also removes stale references to legacy `resourceMappings`, `organization-model.examples.ts`, `foundations/`, and `operations/resources/**` paths in the template agent guidance.
8
+
9
+ ## Applies to
10
+
11
+ Template-derived projects that author workflows, agents, integrations, or project-local agent guidance from the SDK scaffold reference.
12
+
13
+ ## Required actions
14
+
15
+ - When adding a workflow, agent, or integration, author the descriptor first in `core/config/organization-model.ts` under `resources.entries`.
16
+ - Update operations code to derive deployed runtime IDs from descriptors rather than duplicating raw string IDs.
17
+ - Treat existing `resourceMappings` mentions in project-local notes as stale migration history.
18
+ - Keep runtime invocation calls honest: `/execute`, scheduler targets, and nested execution still call deployed resource IDs.
19
+
20
+ ## Verification
21
+
22
+ Run these after reconciling local project guidance or resource authoring:
23
+
24
+ ```bash
25
+ pnpm -C core test
26
+ pnpm -C operations check
27
+ pnpm -C operations check-types
28
+ ```
29
+
30
+ For UI surfaces that execute resources, also run:
31
+
32
+ ```bash
33
+ pnpm -C ui check-types
34
+ ```
35
+
36
+ ## Not handled by /git-sync
37
+
38
+ `/git-sync` pulls the updated guidance and template-owned files, but it does not rewrite project-owned workflow definitions or decide System ownership for real tenant resources. Maintainers must review existing project resources and migrate any duplicated raw IDs to descriptor-backed authoring intentionally.
@@ -0,0 +1,32 @@
1
+ # Clients Domain Release Train
2
+
3
+ ## Why this note exists
4
+
5
+ The clients domain release train adds client-management surfaces across the shared platform packages and updates template-facing project guidance. Template-derived projects need the new package baselines and guidance before they rely on the clients CLI, published clients UI feature exports, or project skill client-linkage instructions.
6
+
7
+ ## Applies to
8
+
9
+ Template-derived projects that consume `@elevasis/core`, `@elevasis/ui`, or `@elevasis/sdk`, especially projects that expose client management in UI shells or use the SDK CLI for project/client linkage.
10
+
11
+ ## Required actions
12
+
13
+ - Pull the updated template dependency baselines for `core/package.json`, `ui/package.json`, and `operations/package.json` after the release stages publish new package versions.
14
+ - Review project-local usage of project/client CLI flags and prefer `--client` / `--clear-client` for client linkage; keep `--client-company-id` only for the legacy company field.
15
+ - If the project maintains local Claude skill guidance, reconcile the project skill client-linkage wording with the updated template baseline.
16
+ - Smoke the clients UI route only after the project has the updated `@elevasis/ui` baseline.
17
+
18
+ ## Verification
19
+
20
+ Run the package-specific checks after sync:
21
+
22
+ ```bash
23
+ pnpm -C core check-types
24
+ pnpm -C operations check-types
25
+ pnpm -C ui check-types
26
+ ```
27
+
28
+ For projects adopting the clients UI immediately, also open the clients list and detail routes and verify the route renders with the current organization selected.
29
+
30
+ ## Not handled by /git-sync
31
+
32
+ `/git-sync` can propagate template baselines and guidance, but it does not publish packages, deploy the SDK resources bundle, decide project-specific client data migration policy, or validate tenant-specific WorkOS/Supabase data availability.