@elevasis/sdk 1.22.1 → 1.24.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.
Files changed (70) hide show
  1. package/dist/cli.cjs +5738 -6283
  2. package/dist/index.d.ts +187 -242
  3. package/dist/index.js +1830 -2912
  4. package/dist/node/index.d.ts +3722 -2
  5. package/dist/node/index.js +163 -1
  6. package/dist/test-utils/index.d.ts +61 -72
  7. package/dist/test-utils/index.js +240 -1479
  8. package/dist/types/worker/index.d.ts +2 -0
  9. package/dist/types/worker/utils.d.ts +9 -0
  10. package/dist/worker/index.js +261 -1487
  11. package/package.json +5 -4
  12. package/reference/_navigation.md +1 -0
  13. package/reference/claude-config/rules/active-change-index.md +11 -80
  14. package/reference/claude-config/rules/agent-start-here.md +11 -277
  15. package/reference/claude-config/rules/deployment.md +11 -57
  16. package/reference/claude-config/rules/error-handling.md +11 -56
  17. package/reference/claude-config/rules/execution.md +11 -40
  18. package/reference/claude-config/rules/frontend.md +11 -43
  19. package/reference/claude-config/rules/observability.md +11 -31
  20. package/reference/claude-config/rules/operations.md +11 -80
  21. package/reference/claude-config/rules/organization-model.md +7 -115
  22. package/reference/claude-config/rules/organization-os.md +8 -112
  23. package/reference/claude-config/rules/package-taxonomy.md +11 -33
  24. package/reference/claude-config/rules/platform.md +11 -42
  25. package/reference/claude-config/rules/shared-types.md +10 -48
  26. package/reference/claude-config/rules/task-tracking.md +11 -47
  27. package/reference/claude-config/rules/ui.md +11 -200
  28. package/reference/claude-config/rules/vibe.md +11 -235
  29. package/reference/claude-config/skills/om/SKILL.md +324 -0
  30. package/reference/claude-config/skills/{knowledge → om}/operations/customers.md +110 -109
  31. package/reference/claude-config/skills/{knowledge → om}/operations/features.md +77 -76
  32. package/reference/claude-config/skills/{knowledge → om}/operations/goals.md +119 -118
  33. package/reference/claude-config/skills/{knowledge → om}/operations/identity.md +94 -93
  34. package/reference/claude-config/skills/{knowledge → om}/operations/labels.md +94 -94
  35. package/reference/claude-config/skills/{knowledge → om}/operations/offerings.md +110 -109
  36. package/reference/claude-config/skills/{knowledge → om}/operations/roles.md +100 -99
  37. package/reference/claude-config/skills/{knowledge → om}/operations/techStack.md +30 -30
  38. package/reference/claude-config/skills/project/SKILL.md +1088 -1088
  39. package/reference/claude-config/skills/setup/SKILL.md +275 -275
  40. package/reference/claude-config/skills/tutorial/SKILL.md +259 -259
  41. package/reference/claude-config/skills/tutorial/progress-template.md +74 -74
  42. package/reference/claude-config/skills/tutorial/technical.md +1303 -1303
  43. package/reference/claude-config/skills/tutorial/vibe-coder.md +890 -890
  44. package/reference/claude-config/sync-notes/2026-05-04-knowledge-bundle.md +83 -83
  45. package/reference/claude-config/sync-notes/2026-05-15-om-skill-rename-and-write-family.md +52 -0
  46. package/reference/claude-config/sync-notes/2026-05-17-sdk-boundary-consolidation.md +33 -0
  47. package/reference/rules/active-change-index.md +83 -0
  48. package/reference/rules/agent-start-here.md +280 -0
  49. package/reference/rules/deployment.md +60 -0
  50. package/reference/rules/error-handling.md +59 -0
  51. package/reference/rules/execution.md +43 -0
  52. package/reference/rules/frontend.md +46 -0
  53. package/reference/rules/observability.md +34 -0
  54. package/reference/rules/operations.md +85 -0
  55. package/reference/rules/organization-model.md +119 -0
  56. package/reference/rules/organization-os.md +118 -0
  57. package/reference/rules/package-taxonomy.md +36 -0
  58. package/reference/rules/platform.md +45 -0
  59. package/reference/rules/shared-types.md +52 -0
  60. package/reference/rules/task-tracking.md +50 -0
  61. package/reference/rules/ui.md +203 -0
  62. package/reference/rules/vibe.md +238 -0
  63. package/reference/scaffold/core/organization-graph.mdx +4 -5
  64. package/reference/scaffold/core/organization-model.mdx +1 -1
  65. package/reference/scaffold/recipes/query-the-knowledge-graph.md +189 -185
  66. package/reference/scaffold/reference/contracts.md +108 -96
  67. package/reference/scaffold/reference/glossary.md +71 -69
  68. package/reference/claude-config/skills/knowledge/SKILL.md +0 -345
  69. /package/reference/claude-config/skills/{knowledge → om}/operations/codify-level-a.md +0 -0
  70. /package/reference/claude-config/skills/{knowledge → om}/operations/codify-level-b.md +0 -0
@@ -0,0 +1,45 @@
1
+ ---
2
+ description: Platform conventions -- SDK workflows, agents, deployment, resource registry
3
+ paths:
4
+ - operations/**
5
+ ---
6
+ <!-- @generated by packages/sdk/scripts/copy-reference-docs.mjs -- DO NOT EDIT -->
7
+ <!-- Regenerate: pnpm scaffold:sync -->
8
+
9
+
10
+ # Platform (Elevasis SDK)
11
+
12
+ ## Safety Invariants
13
+
14
+ - Every workflow implements `WorkflowDefinition` from `@elevasis/sdk` with: `config`, `contract` (Zod schemas), `steps` map, and `entryPoint`
15
+ - Input/output schemas MUST come from `@core/types` or browser-safe sibling schema files -- never define reusable workflow contracts inline in Node-only workflow files
16
+ - `operations/src/index.ts` default-exports a `DeploymentSpec` with `workflows` and `agents` arrays -- every resource must be registered here
17
+ - Always run `check` before `deploy`
18
+
19
+ ## Imports
20
+
21
+ - `@elevasis/sdk` for types (`WorkflowDefinition`, `DeploymentSpec`)
22
+ - `@elevasis/sdk/worker` for runtime utilities (`platform`, adapters: `llm`, `storage`, `scheduler`, `notifications`, `acqDb`, `list`)
23
+ - `@core/*` resolves to `../core/*` for shared type and org-model imports
24
+ - Never import from `ui/src/` -- separate runtimes
25
+
26
+ ## Key Rules
27
+
28
+ - Use typed adapters over raw `platform.call()` whenever a typed adapter exists
29
+ - `version` in resource config is semver -- bump on contract changes
30
+ - `status` is `'dev'` or `'prod'` -- new resources start as `'dev'`
31
+
32
+ ## CLI Commands
33
+
34
+ | Command | Purpose |
35
+ | ------------------------------------ | ----------------------------- |
36
+ | `pnpm -C operations run check` | Validate resource definitions |
37
+ | `pnpm -C operations run deploy` | Deploy to dev |
38
+ | `pnpm -C operations run deploy:prod` | Deploy to production |
39
+
40
+ ## Detailed Reference
41
+
42
+ - `node_modules/@elevasis/sdk/reference/scaffold/operations/workflow-recipes.md` -- workflow anatomy, adapter patterns, trigger patterns
43
+ - `node_modules/@elevasis/sdk/reference/scaffold/recipes/add-a-resource.md` -- end-to-end resource authoring guide
44
+ - `node_modules/@elevasis/sdk/reference/scaffold/recipes/extend-lead-gen.md` -- lead-gen UI, hooks, list/member state, artifacts, and workflow adapter extension guide
45
+ - SDK reference docs: `operations/node_modules/@elevasis/sdk/reference/` (concepts, framework, platform-tools, runtime, CLI)
@@ -0,0 +1,52 @@
1
+ ---
2
+ description: Core type boundary -- what belongs in core/types, import rules, schema conventions
3
+ paths:
4
+ - core/types/**
5
+ ---
6
+ <!-- @generated by packages/sdk/scripts/copy-reference-docs.mjs -- DO NOT EDIT -->
7
+ <!-- Regenerate: pnpm scaffold:sync -->
8
+
9
+
10
+ # Core Types
11
+
12
+ `core/types/` is the browser-safe type boundary between the frontend (`ui/`) and platform runtime (`operations/`). Both runtimes import from here but never from each other.
13
+
14
+ Keep this as a standalone rule because it autoloads only for `core/types/**` edits. Operations workflow rules can reference this boundary, but shared browser-safe contract guidance belongs here.
15
+
16
+ ## What Belongs Here
17
+
18
+ - Zod schemas for workflow input/output contracts
19
+ - TypeScript types inferred from those schemas (`z.infer<typeof schema>`)
20
+ - Domain types referenced by both runtimes (status enums, entity shapes)
21
+ - Shared constants
22
+
23
+ ## What Does NOT Belong Here
24
+
25
+ - React components, hooks, or anything importing `react`
26
+ - SDK runtime code or anything importing `@elevasis/sdk/worker`
27
+ - Browser APIs or Node-specific APIs
28
+ - Implementation logic -- types and constants only
29
+
30
+ ## Schema Convention
31
+
32
+ Define Zod schemas first, then infer the type:
33
+
34
+ ```typescript
35
+ export const fooInputSchema = z.object({ ... })
36
+ export type FooInput = z.infer<typeof fooInputSchema>
37
+ ```
38
+
39
+ Name schemas `<name>InputSchema` / `<name>OutputSchema`. Name types `<Name>Input` / `<Name>Output`.
40
+
41
+ ## File Organization
42
+
43
+ Types live in `core/types/`. The directory structure:
44
+
45
+ - `core/types/index.ts` -- Main entry point, re-exports from domain files
46
+ - `core/types/entities.ts` -- Entity contracts extending published base entities
47
+ - As the project grows: split into domain files within the directory (e.g., `core/types/billing.ts`, `core/types/auth.ts`)
48
+ - Re-export new domain files from `core/types/index.ts`
49
+
50
+ ## Path Alias
51
+
52
+ Project tsconfigs resolve `@core/*` to `core/*`. Always use `@core/types` or `@core/types/entities` (not relative paths) when importing shared contracts from `ui/` or `operations/src/`.
@@ -0,0 +1,50 @@
1
+ ---
2
+ description: In-progress task conventions -- doc format, status values, auto-save behavior
3
+ ---
4
+ <!-- @generated by packages/sdk/scripts/copy-reference-docs.mjs -- DO NOT EDIT -->
5
+ <!-- Regenerate: pnpm scaffold:sync -->
6
+
7
+
8
+ # Task Tracking
9
+
10
+ ## Status Values
11
+
12
+ Exactly three values for frontmatter `status`: `planned`, `in-progress`, `complete`.
13
+
14
+ ## Doc Format
15
+
16
+ - Frontmatter: `title`, `description`, `status` only -- nothing else belongs in task-doc frontmatter; `resume_context` is DB-canonical on `prj_tasks`
17
+ - Sections: Objective, Plan, Progress, Resume Context
18
+ - Progress subsections use markers: `### Step N: Title -- PENDING`, `-- IN PROGRESS`, `-- COMPLETE`
19
+
20
+ ## Auto-Update Behavior
21
+
22
+ - When working on a tracked task, update the Progress section when a plan step transitions:
23
+ - PENDING -> IN PROGRESS (starting work on a step)
24
+ - IN PROGRESS -> COMPLETE (finishing a step)
25
+ - Do NOT update on every action -- only on step transitions
26
+
27
+ ## Auto-Save Behavior
28
+
29
+ The agent auto-saves progress (no user action needed) when:
30
+
31
+ - The conversation context is getting heavy (many tool calls, large file reads)
32
+ - The user appears to be wrapping up (thanks, goodbye, switching topics)
33
+ - Significant progress has been made (2+ steps completed without saving)
34
+ - Before a context reset
35
+
36
+ Auto-save updates the task doc's Progress and Resume Context sections silently, then briefly confirms. The canonical persistence path is `pnpm elevasis-sdk project:task:save` -- the CLI writes through to `prj_tasks.resume_context` (JSONB) so another agent can resume without re-deriving intent.
37
+
38
+ ## Completion Suggestions
39
+
40
+ When all plan steps are marked COMPLETE, **suggest** completing the task -- never auto-invoke. Ask: "All steps for '{task}' look done. Want me to finalize it?"
41
+
42
+ ## Where Tasks Live
43
+
44
+ Project tasks for this template live in the `prj_tasks` Supabase table, not in repo-local files. Operate on them via the SDK CLI:
45
+
46
+ - `pnpm elevasis-sdk project:work` -- entrypoint for task work (resume / new intent detection)
47
+ - `pnpm elevasis-sdk project:list` -- portfolio / task listing
48
+ - `pnpm elevasis-sdk project:task:save` -- persist progress + `resume_context` to the DB
49
+
50
+ The monorepo-side `/work` slash command still exists for monorepo task docs under `apps/docs/content/docs/in-progress/**`; that flow is unchanged. What went away is the external template's own `/work` skill and its `docs/in-progress/` directory -- external projects now route through the DB-backed `project:*` surface above.
@@ -0,0 +1,203 @@
1
+ ---
2
+ description: UI shell, route structure, auth flow, API access, and template customization points for the ui/ surface
3
+ paths:
4
+ - ui/**
5
+ ---
6
+ <!-- @generated by packages/sdk/scripts/copy-reference-docs.mjs -- DO NOT EDIT -->
7
+ <!-- Regenerate: pnpm scaffold:sync -->
8
+
9
+
10
+ # UI Features
11
+
12
+ **Status:** Stable
13
+
14
+ ## App Shell Overview
15
+
16
+ The template frontend is a React 19 + TanStack Router app that composes a local dashboard shell with published System modules from `@elevasis/ui`.
17
+
18
+ The main join points are:
19
+
20
+ - `ui/src/main.tsx` -- boots the app with `ElevasisUIProvider`, query client, theme config, WorkOS AuthKit, notifications, and the generated route tree
21
+ - `ui/src/routes/__root.tsx` -- composes the authenticated shell with `ElevasisSystemsProvider`, published System modules, app-local dashboard nav, shell runtime dependencies, and `SystemShell`
22
+ - `ui/src/config/nav-items.ts` -- keeps the host-local dashboard entry separate from the published feature manifests
23
+ - `core/config/organization-model.ts` -- is the template's semantic source of truth, adapting `@elevasis/core/organization-model` into the preserved branding, dashboard label, quick-access, System labels, resource descriptors, and shell helpers
24
+
25
+ Published System modules mounted by the template shell:
26
+
27
+ - `lead-gen`
28
+ - `crm`
29
+ - `delivery` at `/projects`
30
+ - `operations`
31
+ - `monitoring`
32
+ - `settings`
33
+
34
+ Important distinction:
35
+
36
+ - shared modules gate on current org-model System keys such as `sales.lead-gen` and `projects`
37
+ - template routes and local nav may still use legacy aliases such as `crm`, `lead-gen`, and `projects`
38
+ - `core/config/organization-model.ts` and `ui/src/lib/hooks/useFeatureAccess.ts` are the bridge between those two vocabularies
39
+
40
+ Dashboard remains a host-local route at `/`, not a shared feature manifest.
41
+
42
+ This template should be treated as the downstream reference implementation for this composition:
43
+
44
+ - `core/config/organization-model.ts` owns the organization/runtime semantics
45
+ - `ui/src/config/nav-items.ts` preserves the host-local dashboard entry instead of pushing that concern into shared manifests
46
+ - `ui/src/routes/__root.tsx` threads `canonicalOrganizationModel` from `@core/config/organization-model` into `ElevasisSystemsProvider` so the shared shell/runtime uses the same semantic source of truth as the local template helpers
47
+ - host-local customizations still stay local: dashboard remains app-owned nav, branding stays in app config, and quick-access/dashboard UX stays in the template app
48
+
49
+ ## Auth and Initialization
50
+
51
+ The app uses WorkOS AuthKit through `ElevasisUIProvider`. Authentication is enforced by the local `ProtectedRoute` wrapper in `ui/src/features/auth/ProtectedRoute.tsx`.
52
+
53
+ **Sign-in flow:**
54
+
55
+ 1. Unauthenticated user hits a protected route -- `ProtectedRoute` redirects to `/login?returnTo=<path>`
56
+ 2. `/login` renders a sign-in card; user clicks Sign In, triggering `signIn({ returnTo })` from `useAuth()`
57
+ 3. User authenticates on the WorkOS-hosted sign-in page
58
+ 4. WorkOS redirects back to `/auth-redirect` -- `ui/src/routes/auth-redirect.tsx` waits for auth to complete, then navigates to the requested path or `/`
59
+ 5. User lands on the home page, fully authenticated
60
+
61
+ **Route protection:**
62
+
63
+ Wrap protected route components with the local `ProtectedRoute` from `@/features/auth`, which adds the full-screen loader and delegates to the shared guard from `@elevasis/ui/auth`:
64
+
65
+ ```tsx
66
+ import { ProtectedRoute } from '@/features/auth'
67
+
68
+ function HomePageGuarded() {
69
+ return (
70
+ <ProtectedRoute>
71
+ <HomePage />
72
+ </ProtectedRoute>
73
+ )
74
+ }
75
+ ```
76
+
77
+ **Initialization state:**
78
+
79
+ Use `useInitialization()` from `@elevasis/ui/initialization` anywhere inside the app to read aggregated auth + org readiness:
80
+
81
+ ```ts
82
+ const { allReady, userReady, isInitializing, error, retry, profile } = useInitialization()
83
+ ```
84
+
85
+ **Organization context:**
86
+
87
+ Use `useOrganization()` from `@elevasis/ui/organization` to access org-scoped IDs and memberships:
88
+
89
+ ```ts
90
+ const { currentWorkOSOrganizationId, currentSupabaseOrganizationId, memberships, switchOrganization } = useOrganization()
91
+ ```
92
+
93
+ ## API and Streaming
94
+
95
+ Use `useApiClient()` from `@/lib/hooks/useApiClient` in route components and feature hooks:
96
+
97
+ ```ts
98
+ const { apiRequest, isOrganizationReady } = useApiClient()
99
+ const data = await apiRequest('/executions', { method: 'GET' })
100
+ ```
101
+
102
+ The template also re-exports `useApiClientContext()` and the shared API client types from `@/lib/hooks/useApiClient`.
103
+
104
+ For real-time updates, feature surfaces use the local singleton wrapper:
105
+
106
+ ```ts
107
+ import { sseConnectionManager } from '@/lib/sse/SSEConnectionManager'
108
+ ```
109
+
110
+ **WorkOS config:**
111
+
112
+ WorkOS `clientId`, `redirectUri`, and `signoutUri` are hardcoded in `ui/src/config/workos.ts` -- no UI env vars are required to run the template. Edit that file if a fork needs a different WorkOS client. The dev server runs on port `4300` with Vite `strictPort: true`, so a second `pnpm -C ui dev` on the same machine fails fast instead of drifting.
113
+
114
+ The API URL is centralized in `ui/src/lib/constants/api.ts`. In the current template it is hard-coded to `https://api.elevasis.io`, so if the bootstrap is repointed to another API target, that file is the source of truth.
115
+
116
+ ## Route Structure
117
+
118
+ Current top-level app sections:
119
+
120
+ - `/` -- host-local dashboard entrypoint with quick links derived from `organizationModel.navigation.quickAccessSurfaceIds`
121
+ - `/lead-gen/*` -- lead generation pages (`lists`, `companies`, `contacts`)
122
+ - `/crm/*` -- CRM overview, pipeline, and deals
123
+ - `/projects/*` -- delivery feature pages (projects, milestones, tasks, notes)
124
+ - `/operations/*` -- operations overview, resources, command queue, command view, sessions, task scheduler
125
+ - `/monitoring/*` -- execution logs, execution health, activity log, cost analytics, notifications
126
+ - `/settings/*` -- account, organization, credentials, API keys, deployments, webhooks, and appearance
127
+ - `/login` and `/auth-redirect` -- auth entry/callback routes
128
+
129
+ Section guards currently follow this pattern:
130
+
131
+ - `ProtectedRoute` for all authenticated sections
132
+ - `SystemGuard` on sections that should hard-stop when a System is disabled: `crm`, `lead-gen`, `projects`, `operations`, and `monitoring`
133
+ - provider-level shell gating for shared System nav and sub-shell behavior
134
+
135
+ The app shell in `__root.tsx` derives visible nav from `shellModel.systems` and `getSidebarLinks()`, filters admin-only entries locally using the signed-in profile, and passes `canonicalOrganizationModel` into `ElevasisSystemsProvider` so shared nav labels, paths, and graph runtime behavior resolve from the same organization-model semantic source.
136
+
137
+ ## Dashboard and Feature Areas
138
+
139
+ **Dashboard**
140
+
141
+ `ui/src/features/dashboard/components/Dashboard.tsx` is intentionally lightweight. It acts as the host-owned landing page and renders quick access cards for the most important organization surfaces instead of duplicating the shared operations overview.
142
+
143
+ **Operations**
144
+
145
+ The operations area is the richest shared shell in the template. It includes:
146
+
147
+ - resource inventory and detail pages
148
+ - command queue and command view
149
+ - sessions screens
150
+ - the shared operations overview at `/operations/`
151
+
152
+ **Monitoring**
153
+
154
+ Monitoring is scaffolded as a shared feature area with route files for:
155
+
156
+ - activity log
157
+ - cost analytics
158
+ - execution health
159
+ - execution logs
160
+ - notifications
161
+
162
+ ## Customization Points
163
+
164
+ The main template-owned customization surfaces are:
165
+
166
+ - `ui/src/config/app-config.ts` -- brand name, logos, and app version
167
+ - `ui/src/config/theme.ts` -- theme presets and defaults
168
+ - `ui/src/config/background.tsx` -- shared background treatment
169
+ - `ui/src/config/loader.tsx` -- global loader element
170
+ - `ui/src/config/nav-items.ts` -- app-local nav entries, including the preserved dashboard/home entry
171
+ - `core/config/organization-model.ts` -- product labels, System availability, resource descriptors, semantic surfaces, canonical-to-legacy surface aliases, and quick-access behavior
172
+ - `ui/src/config/README.md` -- the deeper guide for those config files
173
+
174
+ ## Customizing System Sidebars
175
+
176
+ The template demonstrates one override pattern in `ui/src/routes/__root.tsx`: it extends `CRM_ITEMS` with a template-owned Reports link and replaces `crmManifest` with `customCrmManifest` in the System module array. The backing route lives at `ui/src/routes/crm/reports.tsx` -- delete both the nav item and the route if you don't need them.
177
+
178
+ Two customization layers are available for every shared System sidebar:
179
+
180
+ 1. **Nav-item shortcut (`items` prop)** -- when you just need to swap or extend the nav array, spread the published items constant and pass the result to `*SidebarMiddle`. The template's CRM customization uses this path.
181
+
182
+ ```tsx
183
+ import { crmManifest, CrmSidebar, CrmSidebarMiddle, CRM_ITEMS } from '@elevasis/ui/features/crm'
184
+ import type { NavItem } from '@elevasis/ui/layout'
185
+
186
+ const customItems: NavItem[] = [...CRM_ITEMS, { label: 'Reports', to: '/crm/reports', icon: IconFileText, exact: false }]
187
+ const CustomCrmSidebar = () => <CrmSidebar><CrmSidebarMiddle items={customItems} /></CrmSidebar>
188
+ const customCrmManifest = { ...crmManifest, sidebar: CustomCrmSidebar }
189
+ ```
190
+
191
+ 2. **Compose-primitives (structural changes)** -- when you need to inject panels, reorder sections, or add a new section, drop down to `CrmSidebarTop` + `SubshellNavList` + `SubshellSidebarSection` + published panels (`MyTasksPanel`, `QuickCreateActions`) and compose your own Middle.
192
+
193
+ `manifest.sidebar` accepts any component, so arbitrary customization is always available. The `items` prop is an abstraction barrier for the common case, not a limit.
194
+
195
+ See `node_modules/@elevasis/sdk/reference/scaffold/ui/customization.md` for the decision tree, page-wrapping pattern, and delivery's three-section variant. For broader CRM extension work across pages, hooks, actions, workflows, and org-model boundaries, start with `node_modules/@elevasis/sdk/reference/scaffold/recipes/extend-crm.md`. For broader lead-gen extension work across pages, hooks, list/member state, artifacts, workflows, and org-model boundaries, start with `node_modules/@elevasis/sdk/reference/scaffold/recipes/extend-lead-gen.md`. See `node_modules/@elevasis/sdk/reference/scaffold/reference/contracts.md` for `NavItem`, `SystemModule`, CRM platform primitives, Lead Gen platform primitives, and related TypeScript shapes.
196
+
197
+ For CRM deal action buttons, read `node_modules/@elevasis/sdk/reference/scaffold/recipes/customize-crm-actions.md` before changing `crmActions`, `DealDetailPage`, `DealDrawer`, or custom workflow buttons. Start with the shared `crmActions` provider path for action visibility, labels, ordering, and render-time configuration. In v1, platform-known/default action endpoint behavior is server-constrained; use project-owned UI that calls the workflow directly when a custom key sits outside that server-dispatched set.
198
+
199
+ ## Notes
200
+
201
+ - `ui/src/routeTree.gen.ts` is generated by TanStack Router tooling. Do not hand-edit it.
202
+ - The template ships a broad route surface so downstream projects can trim or reshape features without having to re-derive the shared shell contract from scratch.
203
+ - For package-export discovery, glob `node_modules/@elevasis/sdk/reference/` or `node_modules/@repo/ui/dist/` for the current SDK/UI package surface.
@@ -0,0 +1,238 @@
1
+ ---
2
+ description: Ambient intent classifier -- routes natural-language input to 7 intent buckets without a slash command; Codify and Toggle delegate to /om
3
+ paths:
4
+ - "**/*"
5
+ ---
6
+ <!-- @generated by packages/sdk/scripts/copy-reference-docs.mjs -- DO NOT EDIT -->
7
+ <!-- Regenerate: pnpm scaffold:sync -->
8
+
9
+
10
+ # Vibe Layer
11
+
12
+ Vibe is an **ambient, always-on** intent classifier. It activates automatically whenever the user speaks in plain language -- no slash command, no activation phrase, no special syntax. Every natural-language message passes through vibe classification before the agent acts.
13
+
14
+ This rule applies to all sessions inside external projects. It does NOT apply in the monorepo (ambient routing is off there by default).
15
+
16
+ ## What Vibe Is
17
+
18
+ Vibe is the translation layer between the user's natural language and the correct agent action. The user describes reality -- "we track deals by Shopify platform", "I'm stuck on this task", "what should I work on next" -- and vibe determines which of the seven intent types the message represents. The agent then routes to the right behavior without the user ever knowing the classification happened.
19
+
20
+ Vibe coders (non-technical builders) are the primary audience. They build by describing. They never memorize commands, IDs, or schema. The ambient layer closes the gap between what they say and what the system can act on.
21
+
22
+ ## The Seven Intent Types
23
+
24
+ ### 1. Capture
25
+
26
+ The user wants to record something new -- a task, a note, a piece of information that should persist.
27
+
28
+ **Recognize by:** action verbs like "add", "create", "remember", "track", "log", "note down", "write down", combined with a thing to record.
29
+
30
+ **Fixture examples:**
31
+
32
+ | Input | Why it's Capture |
33
+ | ------------------------------------------------- | ------------------------------------------- |
34
+ | "Add a task to follow up with the Shopify client" | Explicit "add a task" with a described item |
35
+ | "Remember to run the campaign report on Friday" | "Remember to" signals something to persist |
36
+ | "Run the campaign report every Friday at 9am" | Repeating schedule vocabulary to persist |
37
+ | "Track this conversation as a deal note" | Explicit "track" with a described artifact |
38
+
39
+ **Agent action:** draft the capture in plain language, confirm with the user, then execute via `elevasis-sdk project:*` commands for project records or `elevasis-sdk schedule:create` for recurring automation. Use repetition vocabulary ("every", "daily", "weekly", "monthly") for schedules; one-shot future reminders stay project tasks with due dates. Never write without confirmation.
40
+
41
+ ### 2. Query
42
+
43
+ The user wants to know something about current state -- task priorities, what is pending, what is running, what failed.
44
+
45
+ **Recognize by:** questions about the current list, status, or queue of things. Includes both static-model queries ("what systems are on?") and runtime-entity queries ("what's pending in the queue?"). Route Query to static-model sources (org model, Systems/Actions config) or runtime sources (operations domain) based on the referenced entity.
46
+
47
+ **Fixture examples:**
48
+
49
+ | Input | Why it's Query |
50
+ | -------------------------------------------- | ------------------------------------------- |
51
+ | "What should I work on next?" | Asking for prioritized task list |
52
+ | "What's pending in the HITL queue?" | Runtime-entity query about operations state |
53
+ | "What runs this week?" | Runtime query about upcoming schedules |
54
+ | "What systems are enabled for this project?" | Static-model query about Systems config |
55
+
56
+ **Agent action:** read the relevant source and narrate the answer in plain language. Use org model or `project:*` for project state, `elevasis-sdk queue:list --status pending --pretty` and `queue:status --pretty` for HITL queue state, and `elevasis-sdk schedule:list --status active --pretty` for upcoming recurring automation. No writes.
57
+
58
+ ### 3. Describe
59
+
60
+ The user wants the agent to explain something -- a scope, an entity, a concept within the project.
61
+
62
+ **Recognize by:** "what is", "what does", "tell me about", "explain", "where am I", "what's going on", "describe", "show me" without an action intent attached.
63
+
64
+ **Fixture examples:**
65
+
66
+ | Input | Why it's Describe |
67
+ | ------------------------------------------ | ----------------------------------------------------- |
68
+ | "What's going on with the ZentaraHQ deal?" | Asking for a plain-language description of an entity |
69
+ | "Tell me about the CRM system" | Asking the agent to narrate what a model element does |
70
+ | "Where am I in this project?" | Asking for current scope narration |
71
+
72
+ **Agent action:** read the relevant org-model label, entity, or scope. Narrate in plain language using label fields from the model -- never invent vocabulary not present in the model. Phase-1 scope covers Model, Systems/Actions, and Foundations layers only.
73
+
74
+ **Stage/state/catalog sub-routing:** when the noun being described is a stage, state, status
75
+ bucket, catalog entry, progress step, pipeline column, or similarly closed business vocabulary,
76
+ also show the cross-system impact before the normal description:
77
+
78
+ 1. Read `node_modules/@elevasis/sdk/reference/spine/spine-primer.md` for the layering pattern.
79
+ 2. Read the relevant domain in `core/config/organization-model.ts`.
80
+ 3. Explain the impact in vibe-coder language only: the business profile entry, the saved progress
81
+ on each record, the automations that produce updates, and the dashboard or reports that read it.
82
+ 4. Route follow-up changes through `/om <domain>`. Do not mention the technical pattern name
83
+ unless the user explicitly asks for internals.
84
+
85
+ ### 4. Transition
86
+
87
+ The user wants to change the status of a task or entity.
88
+
89
+ **Recognize by:** single-word or short-phrase state signals -- "done", "finished", "complete", "blocked", "stuck", "waiting", "in review", "cancelled" -- applied to a current task or named entity.
90
+
91
+ **Fixture examples:**
92
+
93
+ | Input | Why it's Transition |
94
+ | --------------------------------------------- | ------------------------------------------- |
95
+ | "Done with the proposal draft" | "Done" + named artifact = status transition |
96
+ | "Stuck -- blocked waiting on client feedback" | "Stuck" + reason = blocked transition |
97
+ | "Mark the onboarding task as complete" | Explicit status-change vocabulary |
98
+ | "Approve the pending checkpoint" | Selects an action from the HITL queue |
99
+ | "Pause the Friday report" | Changes schedule state |
100
+
101
+ **Agent action:** identify the task, queue item, schedule, or entity being transitioned, confirm the new status/action with the user, then apply it via `elevasis-sdk project:task:save`, `elevasis-sdk queue:select <id> --action-id <id>`, `elevasis-sdk queue:expire <id>`, `elevasis-sdk schedule:pause <id>`, `schedule:resume <id>`, or `schedule:cancel <id>` as appropriate. Never auto-transition without confirmation if the target entity is ambiguous.
102
+
103
+ ### 5. Navigate
104
+
105
+ The user wants to shift focus -- to a different task, project, System, Action, or layer of the model.
106
+
107
+ **Recognize by:** focus-shift vocabulary -- "focus on", "let's look at", "switch to", "back to", "move to", "open", "go to" -- followed by a scope target.
108
+
109
+ **Fixture examples:**
110
+
111
+ | Input | Why it's Navigate |
112
+ | -------------------------------------------- | --------------------------------------------------- |
113
+ | "Let's focus on the onboarding flow for now" | "Focus on" + scope target |
114
+ | "Switch to the Shopify integration project" | "Switch to" = navigate to a different project scope |
115
+ | "Back to the CRM tasks" | "Back to" = return to a prior scope |
116
+
117
+ **Agent action:** update the active scope in `prj_tasks.resume_context` (current project + task pointer), then narrate the new scope in plain language so the user knows where they are.
118
+
119
+ ### 6. Codify
120
+
121
+ The user describes organizational reality that is not yet expressed in the model -- industry type, entity kinds, custom attributes, renamed stages, domain vocabulary.
122
+
123
+ **Recognize by:** declarative "we are" / "we use" / "we track" statements, repeated attribute mentions (second time the same attribute appears), or explicit "add a type / add a field / model X as Y" requests.
124
+
125
+ **Fixture examples:**
126
+
127
+ | Input | Why it's Codify |
128
+ | -------------------------------------------------------------------------------- | -------------------------------------------------------- |
129
+ | "We're an e-commerce company -- all our deals come from Shopify or Amazon" | Declares industry + platform attributes not yet in model |
130
+ | "We track deal stage as discovery, scoping, proposal, closed" | Describes custom CRM stages that should replace defaults |
131
+ | "Add a project type called 'retainer' with monthly billing and a contract field" | Explicit request to add a new entity extension |
132
+
133
+ **Agent action:** delegate immediately to `/om`. Do not attempt the ceremony yourself. Invoke with the relevant domain: `/om sales` for deal/contact changes, `/om projects` for project types, `/om systems` for availability/routing toggles, and `/om actions` for invokable operation changes. Plain-language summary of what was detected is acceptable before delegating, but the actual draft-confirm-write ceremony belongs to `/om`.
134
+
135
+ **Stage/state/catalog impact preview:** if the Codify intent adds, renames, removes, reorders, or
136
+ re-scopes a stage, state, status bucket, catalog member, pipeline step, or progress vocabulary,
137
+ preview the cross-system impact before delegating:
138
+
139
+ - Which business-profile entry changes.
140
+ - Which saved record progress keys may already exist.
141
+ - Which automations or templates reference the key.
142
+ - Which dashboard, report, queue, or API reads may display or filter by it.
143
+
144
+ Then delegate to `/om <domain>` with that preview as context. Vibe does not write the
145
+ change and does not expose monorepo-only commands.
146
+
147
+ This routing applies to both codify levels (decision #21 -- Codify ceremony delegated to `/om`):
148
+
149
+ - **Level A** (config-only edits to `organization-model.ts`, System availability/routing toggles, label renames): delegate to `/om <domain>` immediately.
150
+ - **Level B** (new Zod extension files in `core/config/extensions/`): also delegate to `/om <domain>`; `/om` gates Level B to explicit user asks before scaffolding a new TS file.
151
+
152
+ Vibe detects the intent and delegates in both cases. It does not run either pipeline itself.
153
+
154
+ For "build/extend the CRM" asks, classify the structural org-model portion as Codify, then read `node_modules/@elevasis/sdk/reference/scaffold/recipes/extend-crm.md` before editing. CRM work often spans org-model sales semantics, shared UI routes, hooks, workflow adapters, and deal actions; do not reduce it to only `sales` config or only UI.
155
+
156
+ For "build/extend lead gen" / "campaign creator" / "outbound list state" asks, classify the structural org-model portion as Codify, then read `node_modules/@elevasis/sdk/reference/scaffold/recipes/extend-lead-gen.md` before editing. Lead-gen work often spans org-model prospecting semantics, shared UI routes, hooks, list/member state, artifacts, and workflow adapters; do not reduce it to only `prospecting` config or only UI.
157
+
158
+ For "add a custom CRM action" / "Send Quote button" asks, classify as Codify, then read `node_modules/@elevasis/sdk/reference/scaffold/recipes/customize-crm-actions.md` before editing. Start with the shared `crmActions` provider path for action visibility, labels, ordering, and render-time configuration. In v1, platform-known/default action endpoint behavior is server-constrained; use project-owned UI that calls the workflow directly when a custom key sits outside that server-dispatched set.
159
+
160
+ Heuristics for when to propose codification (passed to `/om` as context):
161
+
162
+ - First mention of a new attribute: note to `resume_context`, do not propose yet
163
+ - Second mention OR explicit declaration ("we're ecom"): propose extension
164
+ - Explicit ask ("track ecom deals separately"): propose immediately with fuller scope
165
+ - Attribute appearing across 3+ tasks: propose adding field to existing extension
166
+
167
+ ### 7. Toggle
168
+
169
+ The user wants to enable or disable a System.
170
+
171
+ **Recognize by:** system-control vocabulary -- "turn on", "enable", "disable", "turn off", "activate", "deactivate" -- followed by a System name or description.
172
+
173
+ **Fixture examples:**
174
+
175
+ | Input | Why it's Toggle |
176
+ | ------------------------------- | -------------------------------------------- |
177
+ | "Turn on the lead-gen system" | Explicit "turn on" + System name |
178
+ | "Disable monitoring for now" | "Disable" + System reference |
179
+ | "We don't use SEO, turn it off" | Declarative + "turn it off" = System disable |
180
+
181
+ **Agent action:** delegate to `/om systems`. The ceremony (confirm + edit `core/config/organization-model.ts` + typecheck) belongs to `/om`, not to the ambient rule.
182
+
183
+ ## Quick Reference Table
184
+
185
+ | Intent | Trigger signal | Routed to |
186
+ | ---------- | ---------------------------------------------------------------------- | ----------------------------------------------------------------------- |
187
+ | Capture | "add", "remember", "track", "log" + a thing | Agent -- draft + confirm + `project:*` or `schedule:create` CLI |
188
+ | Query | "what's next", "what's pending", "what failed", "what systems" | Agent -- read with `project:*`, `queue:*`, or `schedule:*` + narrate |
189
+ | Describe | "what is", "tell me about", "explain", "where am I" | Agent -- narrate from org model labels |
190
+ | Transition | "done", "stuck", "blocked", "finished", "complete", "approve", "pause" | Agent -- confirm + `project:task:save`, `queue:select`, or `schedule:*` |
191
+ | Navigate | "focus on", "switch to", "back to", "look at" | Agent -- update scope + narrate |
192
+ | Codify | "we are X", "we track Y", repeated attribute, "add type/field" | Delegate to `/om \<domain>` |
193
+ | Toggle | "enable", "disable", "turn on/off" + system | Delegate to `/om systems` |
194
+
195
+ ## Source of Truth for Plain Language
196
+
197
+ All plain-language labels come from the OrganizationModel itself -- never from hardcoded strings in this rule file. Every status, entity kind, and layer name in the model carries an inline `label` field (e.g., `{ id: 'revision_requested', label: 'changes needed', semanticClass: 'blocked' }`). When narrating state or confirming an action, read the label from the model and use it verbatim. Do not invent synonyms or fallback vocabulary.
198
+
199
+ The unified manifest (delivered via `@elevasis/core/organization-model`) is the canonical vocabulary surface. Vibe classifies against it -- Systems, Actions, statuses, operations entities, and resource kinds are all discoverable from the manifest without hardcoding.
200
+
201
+ ## Ambiguous Intent
202
+
203
+ When the user's input does not clearly map to one of the seven types, ask one clarifying question. Do not guess. Do not apply a precedence rule. Do not route to the "closest" intent.
204
+
205
+ Format: a single neutral question that presents the two (or three) plausible intents as options and asks which the user means.
206
+
207
+ Example: "That could be a note to capture or a status update on the current task -- which did you mean?"
208
+
209
+ Never ask more than one question per ambiguous input. If the user's reply is still ambiguous, ask once more, then surface the options explicitly.
210
+
211
+ ## Classifier Threshold
212
+
213
+ Default threshold: `balanced`.
214
+
215
+ The threshold controls how aggressively the classifier proposes codification from ambiguous signals:
216
+
217
+ - `strict` -- only explicit declarations or repeat mentions trigger codify proposals
218
+ - `balanced` -- second mention OR explicit declaration triggers; default
219
+ - `loose` -- first strong signal triggers a proposal
220
+
221
+ Override per project in `core/config/organization-model.ts` under `vibe.classifierThreshold`. The override is merge-aware (Tier 2 sync) and will not be overwritten by template sync operations.
222
+
223
+ ## Phase-1 Scope
224
+
225
+ This rule covers Phase 1 of the vibe layer rollout. The layers the ambient classifier can narrate and codify in Phase 1 are:
226
+
227
+ - Layer 1 (Model): narrate schema shape, propose codification edits via `/om`
228
+ - Layer 4 (Systems/Actions): describe which Systems are on/off, propose enabling one via `/om`
229
+ - Layer 7 (Foundations): explain and edit `organization-model.ts` and `extensions/` via `/om`
230
+
231
+ Layers 2 (Public API), 3 (UI Shell Runtime), 5 (Toolkit), and 6 (Graph) require runtime read APIs that are not yet available. Do not attempt to narrate or classify against those layers in Phase 1. If the user's input clearly references one of those layers, acknowledge the scope and explain that full support arrives in a later phase.
232
+
233
+ ## What Vibe Is Not
234
+
235
+ - Vibe is not a slash command. There is no `/vibe` invocation (decision #19 -- ambient rule, not a skill or command).
236
+ - Vibe is not a skill. It lives in this rule file + CLAUDE.md + the PreToolUse hook -- not in `.claude/skills/`.
237
+ - Vibe does not own the codify ceremony. `/om` owns draft, confirm, write, and typecheck for both Level A and Level B codify pipelines (decision #21 -- Codify ceremony delegated to `/om`). Vibe detects intent and hands off.
238
+ - Vibe is not active in the monorepo. If working inside the monorepo (not an `external/` project), this ambient routing does not apply.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Organization Graph
3
- description: Organization OS graph layer documentation for the organization graph derived from Organization Model Systems, resources, actions, entities, content nodes, and typed links.
3
+ description: Organization OS graph layer documentation for the organization graph derived from Organization Model Systems, resources, actions, entities, ontology catalogs, and typed links.
4
4
  ---
5
5
  <!-- @generated by packages/sdk/scripts/copy-reference-docs.mjs -- DO NOT EDIT -->
6
6
  <!-- Regenerate: pnpm scaffold:sync -->
@@ -41,7 +41,6 @@ Node kinds:
41
41
  - `goal`
42
42
  - `surface`
43
43
  - `navigation-group`
44
- - `content-node`
45
44
 
46
45
  Edge kinds:
47
46
 
@@ -61,7 +60,7 @@ Edge kinds:
61
60
 
62
61
  System nodes come from the id-keyed `OrganizationModel.systems` map. Their graph IDs use `system:<id>`, such as `system:sales.crm`.
63
62
 
64
- Resource, action, entity, policy, navigation, and content edges are derived from canonical OM maps:
63
+ Resource, action, entity, policy, navigation, and ontology catalog edges are derived from canonical OM maps:
65
64
 
66
65
  ```ts
67
66
  // ResourceEntry.systemPath => system -> resource contains
@@ -70,7 +69,7 @@ Resource, action, entity, policy, navigation, and content edges are derived from
70
69
  // Action.affects[] => action -> entity affects
71
70
  // Entity.links[] => entity -> entity links
72
71
  // ResourceEntry.emits[] => resource -> event emits
73
- // System.content => system -> content-node contains
72
+ // System.ontology.catalogTypes => ontology catalog nodes and relationships
74
73
  // AgentResource.invocations[] => agent resource -> invocation target uses/references
75
74
  ```
76
75
 
@@ -87,7 +86,7 @@ interface BuildOrganizationGraphInput {
87
86
 
88
87
  1. Reads Organization Model Systems and derives `system:*` nodes.
89
88
  2. Reads OM resources, including workflow, agent, integration, and script resources, as `resource` nodes.
90
- 3. Emits derived graph links from System, Resource, Action, Entity, Policy, Agent invocation, Knowledge, navigation, and System content contracts.
89
+ 3. Emits derived graph links from System, Resource, Action, Entity, Policy, Agent invocation, Knowledge, navigation, and ontology catalog contracts.
91
90
  4. Bridges Command View runtime topology into resource nodes and relationship edges.
92
91
  5. Returns a renderer-agnostic DTO.
93
92
 
@@ -182,7 +182,7 @@ The model keeps business semantics in named domains:
182
182
  - `policies` -- operational governance rules over systems, actions, resources, and roles
183
183
  - `knowledge` -- playbooks, strategies, references, and graph-governing links
184
184
 
185
- System-local operational catalogs now live under `System.content`, including pipeline, stage, template, template-step, status-flow, status, and config nodes. The legacy compound and status domains should not be used for new authoring.
185
+ System-local operational catalogs live under `System.ontology.catalogTypes`, including pipeline, stage, template, template-step, status-flow, and status records. System-local settings live in `System.config`. The legacy compound and status domains should not be used for new authoring.
186
186
 
187
187
  ## Authoring and Resolution
188
188