@elevasis/sdk 1.23.0 → 1.25.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/cli.cjs +5927 -6985
- package/dist/index.d.ts +4893 -4759
- package/dist/index.js +1444 -3870
- package/dist/node/index.d.ts +3059 -2
- package/dist/node/index.js +163 -1
- package/dist/test-utils/index.d.ts +4413 -4439
- package/dist/test-utils/index.js +1766 -4753
- package/dist/types/worker/index.d.ts +5 -2
- package/dist/types/worker/platform.d.ts +2 -2
- package/dist/types/worker/utils.d.ts +9 -0
- package/dist/worker/index.js +427 -3708
- package/package.json +5 -4
- package/reference/_navigation.md +1 -0
- package/reference/claude-config/rules/active-change-index.md +11 -80
- package/reference/claude-config/rules/agent-start-here.md +11 -277
- package/reference/claude-config/rules/deployment.md +11 -57
- package/reference/claude-config/rules/error-handling.md +11 -56
- package/reference/claude-config/rules/execution.md +11 -40
- package/reference/claude-config/rules/frontend.md +11 -43
- package/reference/claude-config/rules/observability.md +11 -31
- package/reference/claude-config/rules/operations.md +11 -80
- package/reference/claude-config/rules/organization-model.md +5 -110
- package/reference/claude-config/rules/organization-os.md +7 -111
- package/reference/claude-config/rules/package-taxonomy.md +11 -33
- package/reference/claude-config/rules/platform.md +11 -42
- package/reference/claude-config/rules/shared-types.md +10 -48
- package/reference/claude-config/rules/task-tracking.md +11 -47
- package/reference/claude-config/rules/ui.md +11 -200
- package/reference/claude-config/rules/vibe.md +5 -229
- package/reference/claude-config/sync-notes/2026-05-04-knowledge-bundle.md +83 -83
- package/reference/claude-config/sync-notes/2026-05-15-om-skill-rename-and-write-family.md +2 -2
- package/reference/claude-config/sync-notes/2026-05-17-sdk-boundary-consolidation.md +33 -0
- package/reference/cli.mdx +1107 -808
- package/reference/rules/active-change-index.md +83 -0
- package/reference/rules/agent-start-here.md +280 -0
- package/reference/rules/deployment.md +60 -0
- package/reference/rules/error-handling.md +59 -0
- package/reference/rules/execution.md +43 -0
- package/reference/rules/frontend.md +46 -0
- package/reference/rules/observability.md +34 -0
- package/reference/rules/operations.md +85 -0
- package/reference/rules/organization-model.md +119 -0
- package/reference/rules/organization-os.md +118 -0
- package/reference/rules/package-taxonomy.md +36 -0
- package/reference/rules/platform.md +45 -0
- package/reference/rules/shared-types.md +52 -0
- package/reference/rules/task-tracking.md +50 -0
- package/reference/rules/ui.md +203 -0
- package/reference/rules/vibe.md +238 -0
- package/reference/scaffold/core/organization-graph.mdx +4 -5
- package/reference/scaffold/core/organization-model.mdx +1 -1
- package/reference/scaffold/recipes/customize-crm-actions.md +45 -46
- package/reference/scaffold/recipes/extend-crm.md +253 -255
- package/reference/scaffold/recipes/index.md +43 -44
- package/reference/scaffold/reference/contracts.md +990 -1065
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Platform workflows, agents, resource definitions, and deployment for the operations/ surface
|
|
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
|
+
# Operations
|
|
11
|
+
|
|
12
|
+
**Status:** Stable
|
|
13
|
+
|
|
14
|
+
## Overview
|
|
15
|
+
|
|
16
|
+
The `operations/` directory contains platform resources and deployment metadata that deploy to the Elevasis platform. It is a standalone TypeScript project with its own `package.json`, `tsconfig.json`, and dependencies.
|
|
17
|
+
|
|
18
|
+
**Discovering deployed resources:** Read `operations/src/index.ts` for deployment assembly and `core/config/organization-model.ts` for the OM Resources descriptor catalog. Run `pnpm elevasis-sdk project:list --pretty` against the live DB for the deployed surface.
|
|
19
|
+
|
|
20
|
+
## Echo Workflow (Starter Example)
|
|
21
|
+
|
|
22
|
+
**Location:** `operations/src/example/echo.ts`
|
|
23
|
+
|
|
24
|
+
The echo workflow accepts a message string and returns it unchanged. Its purpose is the wiring, not the logic: input and output schemas are defined in `core/types/index.ts` and imported by both the workflow and the frontend.
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
core/types/index.ts -- defines echoInputSchema, echoOutputSchema
|
|
28
|
+
operations/src/example/echo.ts -- imports schemas for workflow contract
|
|
29
|
+
ui/src/routes/ -- imports schemas for form validation and display
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The workflow is registered in `operations/src/index.ts` as part of the `example` group and deployed with `pnpm -C operations deploy`.
|
|
33
|
+
|
|
34
|
+
## Adding a New Workflow
|
|
35
|
+
|
|
36
|
+
1. **Define the descriptor in `core/config/organization-model.ts`** -- Add the OM Resource descriptor under the id-keyed `resources` map so identity, System membership, owner role, and governance status are authored once.
|
|
37
|
+
|
|
38
|
+
2. **Model the semantic surface** -- Add durable business nouns, verbs, catalogs, links, events, and surfaces to the owning System's `ontology`; bind executable Resources through `resource.ontology.actions` and optional `resource.ontology.primaryAction`; add system-local defaults/settings to `System.config`; add explanatory or governing material to `knowledge`; and keep transient DTOs and handler internals out of the OM. Top-level `entities`, top-level `actions`, and `System.content` are compatibility mirrors only when current published consumers still need them.
|
|
39
|
+
|
|
40
|
+
3. **Define the contract in `core/types/`** -- Add Zod schemas and inferred types to `core/types/index.ts` (or a new file under `core/types/`). Use `core/types/entities.ts` when workflows operate on project-specific entity contracts.
|
|
41
|
+
|
|
42
|
+
4. **Implement the workflow in `operations/src/`** -- Create a new directory under `operations/src/` for the feature. Import the descriptor, derive runtime `resourceId`, `type`, `name`, and `description` from it, export the workflow from its `index.ts`, and register it in `operations/src/index.ts`.
|
|
43
|
+
|
|
44
|
+
Workflow-side signing and platform adapter error bucketing should use the worker SDK surface: import `generateHmacToken` and `classifyPlatformToolError` from `@elevasis/sdk/worker`. Keep provider-specific timeout messages, error codes, and message snippets in tenant code, then pass them into the generic classifier.
|
|
45
|
+
|
|
46
|
+
5. **Add the UI in `ui/src/routes/`** -- Create a new route file. Use TanStack Query to call the workflow execution endpoint. Import schemas from `@core/types` for validation and type inference. Read OM resources, ontology, knowledge, and graph data where possible instead of creating page-local semantic registries.
|
|
47
|
+
|
|
48
|
+
6. **Update rules when the pattern persists** -- If the workflow introduces a reusable adapter pattern, checkpoint/schedule convention, domain vocabulary, or workflow family behavior that future agents must follow, update this rule or add a scoped rule under `.claude/rules/` in the same change.
|
|
49
|
+
|
|
50
|
+
7. **Deploy and verify:**
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pnpm -C operations check # validate resource definitions
|
|
54
|
+
pnpm -C operations deploy # deploy to dev
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Resource Registry
|
|
58
|
+
|
|
59
|
+
`operations/src/index.ts` default-exports a `DeploymentSpec` with `version`, `organizationModel`, `workflows`, `agents`, and optional deployment mechanics such as `triggers`, `integrations`, `relationships`, `humanCheckpoints`, and `externalResources`. Durable operational wiring belongs in `organizationModel.topology.relationships`; deployment mechanics, credentials, provider webhook details, and per-run state stay outside the OM. Each feature group exports `workflows` and `agents` arrays from its own `index.ts`, spread into the top-level spec. `DeploymentSpec` assembles deployable behavior; it should not be treated as a second resource identity catalog.
|
|
60
|
+
|
|
61
|
+
When you need breadth first, read:
|
|
62
|
+
|
|
63
|
+
- `operations/src/README.md` for the source boundary and drill-down guidance
|
|
64
|
+
- `core/config/organization-model.ts` for descriptor identity and governance metadata
|
|
65
|
+
- `operations/src/index.ts` for deployment assembly
|
|
66
|
+
- `pnpm elevasis-sdk project:list --pretty` for the live deployed surface
|
|
67
|
+
|
|
68
|
+
## Commands
|
|
69
|
+
|
|
70
|
+
| Command | Purpose |
|
|
71
|
+
| -------------------------------- | ----------------------------- |
|
|
72
|
+
| `pnpm -C operations check` | Validate resource definitions |
|
|
73
|
+
| `pnpm -C operations check-types` | TypeScript type-check |
|
|
74
|
+
| `pnpm -C operations deploy` | Deploy to dev |
|
|
75
|
+
| `pnpm -C operations deploy:prod` | Deploy to production |
|
|
76
|
+
|
|
77
|
+
Always run `check` before `deploy`.
|
|
78
|
+
|
|
79
|
+
## Rule Updates
|
|
80
|
+
|
|
81
|
+
When developing resources, workflows, agents, integrations, checkpoints, schedules, or recurring operational conventions, keep `.claude/rules/` current.
|
|
82
|
+
|
|
83
|
+
- Update `operations.md` for package-wide operations invariants.
|
|
84
|
+
- Add a scoped rule for domain-specific workflow families whose conventions should autoload for future edits.
|
|
85
|
+
- Do not bury durable operational rules only in task notes or chat context.
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Edits to the canonical organization model go through /om
|
|
3
|
+
paths:
|
|
4
|
+
- core/config/organization-model.ts
|
|
5
|
+
- core/config/extensions/**/*.ts
|
|
6
|
+
---
|
|
7
|
+
<!-- @generated by packages/sdk/scripts/copy-reference-docs.mjs -- DO NOT EDIT -->
|
|
8
|
+
<!-- Regenerate: pnpm scaffold:sync -->
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
# Organization Model Edit Guide
|
|
12
|
+
|
|
13
|
+
`core/config/organization-model.ts` is the single source of truth for this
|
|
14
|
+
project's organizational identity -- it encodes customers, offerings, roles, goals,
|
|
15
|
+
Systems, ontology, Policies, Knowledge, config, and Resources
|
|
16
|
+
descriptors that agents, workflows, and the UI shell all consume at runtime.
|
|
17
|
+
New semantic authoring should start in system-colocated `ontology` scopes. Top-level
|
|
18
|
+
`entities` and top-level `actions` remain compatibility mirrors while published
|
|
19
|
+
consumers finish moving to compiled ontology indexes. `System.content` is retired.
|
|
20
|
+
|
|
21
|
+
## Preferred Entry Point: `/om`
|
|
22
|
+
|
|
23
|
+
Direct edits to `organization-model.ts` are discouraged. Instead, use `/om` (or
|
|
24
|
+
`/om <domain>`) to run the read → propose → confirm → write → validate ceremony:
|
|
25
|
+
|
|
26
|
+
1. The skill reads the current model so proposals start from ground truth.
|
|
27
|
+
2. It drafts only the specific block being changed, leaving everything else intact.
|
|
28
|
+
3. The user confirms before any file is written.
|
|
29
|
+
4. After writing, `pnpm -C operations check-types` runs and `OrganizationModelSchema.parse()`
|
|
30
|
+
is verified. On failure the file is rolled back automatically.
|
|
31
|
+
|
|
32
|
+
Use `/om <domain>` for targeted edits: `identity`, `customers`, `offerings`,
|
|
33
|
+
`roles`, `goals`, `techStack`, `systems`, `actions`, or `labels`. Resource identity and
|
|
34
|
+
governance metadata belong in the id-keyed `resources` map; operations code derives runtime
|
|
35
|
+
`resourceId` / `type` from those descriptors.
|
|
36
|
+
|
|
37
|
+
Author system-local semantics by boundary:
|
|
38
|
+
|
|
39
|
+
- `System.ontology` owns durable object types, action types, catalog types, link types, event types, and surfaces.
|
|
40
|
+
- `System.config` owns system-local JSON settings and defaults.
|
|
41
|
+
- `resources` own executable workflow/agent descriptors, `systemPath`, owners, governance status, code references, and runtime implementation links.
|
|
42
|
+
- `resource.ontology.actions` describes the ontology actions a Resource performs; `resource.ontology.primaryAction` names the default/selectable action when a Resource has one.
|
|
43
|
+
- `resource.ontology` also describes reads, writes, catalog use, and emitted events.
|
|
44
|
+
- `topology.relationships` owns durable operational wiring between Systems, Resources, ontology nodes, policies, roles, triggers, checkpoints, and external resources.
|
|
45
|
+
- `knowledge` owns long-form playbooks, strategies, references, and governance context.
|
|
46
|
+
- Top-level `entities` and top-level `actions` are compatibility mirrors only. Keep them aligned when current published consumers still need them, but do not treat them as the primary authoring surface.
|
|
47
|
+
|
|
48
|
+
Do not author Resource `actionKey` in the target contract. Runtime/UI routing that needs a single selectable action should read `resource.ontology.primaryAction`.
|
|
49
|
+
|
|
50
|
+
## Runtime Validation
|
|
51
|
+
|
|
52
|
+
The model is validated at startup via `resolveOrganizationModel()` followed by
|
|
53
|
+
`OrganizationModelSchema.parse()`. Cross-reference checks (segment ID refs in offerings,
|
|
54
|
+
role reporting lines, period ordering in goals) are runtime-only and not caught by tsc
|
|
55
|
+
alone -- always let the ceremony run both checks before treating a change as complete.
|
|
56
|
+
|
|
57
|
+
## Extension Files
|
|
58
|
+
|
|
59
|
+
New Zod extension files under `core/config/extensions/` are Level B codify
|
|
60
|
+
operations. Route these through `/om <domain>` as well -- the skill gates Level B
|
|
61
|
+
to explicit user confirmation before scaffolding a new `.ts` file.
|
|
62
|
+
|
|
63
|
+
This is a soft guide, not a hard block. The ceremony exists to prevent silent schema
|
|
64
|
+
drift and to keep the model's editorial history visible.
|
|
65
|
+
|
|
66
|
+
## Resource System Attachment
|
|
67
|
+
|
|
68
|
+
Every resource in the id-keyed `organizationModel.resources` map declares which System it belongs to
|
|
69
|
+
via `systemPath` -- a dot-separated path that resolves against the OM system tree
|
|
70
|
+
(e.g. `"sys.operations"`, `"sales.crm"`):
|
|
71
|
+
|
|
72
|
+
```ts
|
|
73
|
+
{
|
|
74
|
+
id: 'apify-website-crawl',
|
|
75
|
+
systemPath: 'sys.operations', // canonical system attachment
|
|
76
|
+
kind: 'workflow',
|
|
77
|
+
...
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
`systemPath` is validated at parse time by `SystemPathSchema` and cross-checked by
|
|
82
|
+
`OrganizationModelSchema.superRefine` -- an unresolvable path causes a Zod error at
|
|
83
|
+
schema validation. Use `getResourcesForSystem(model, path)` (from `@elevasis/core`) to
|
|
84
|
+
query resources for a system at runtime. Pass `{ includeDescendants: true }` to include
|
|
85
|
+
all descendant systems (segment-aware -- `'sales'` does NOT match `'salesforce.foo'`).
|
|
86
|
+
|
|
87
|
+
Some external templates may carry a `systemId` compatibility mirror while published
|
|
88
|
+
`@elevasis/core` releases catch up to the current source contract. Treat that field as
|
|
89
|
+
legacy adapter data only; author new resource relationships against `systemPath`.
|
|
90
|
+
|
|
91
|
+
Do not fetch resources for every system-oriented read by default. For agent workflows, start
|
|
92
|
+
with the user's requested OM/om context and query resources only when the task involves
|
|
93
|
+
runtime ownership, executable implementation, observability, deployment, or resource governance.
|
|
94
|
+
Use the descendant rollup only when parent-system scope is intended.
|
|
95
|
+
|
|
96
|
+
`resource.category` and `resource.links[].nodeId` are **runtime filter overlays** -- they
|
|
97
|
+
drive UI faceted filtering in the Command Center but do NOT define system membership.
|
|
98
|
+
System membership is `systemPath` only.
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
// category and links power UI filter chips; systemPath is the
|
|
102
|
+
// canonical OM attachment used for graph edges and getResourcesForSystem queries.
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
`resource.codeRefs[]` are repo-relative implementation breadcrumbs for agents and
|
|
106
|
+
operators. Use them to point from a governed OM Resource descriptor to the operations
|
|
107
|
+
entrypoint, handler, schema, test, docs, or config files that implement it. They do
|
|
108
|
+
not define resource identity, System membership, runtime execution topology, or graph
|
|
109
|
+
relationships.
|
|
110
|
+
|
|
111
|
+
`topology.relationships` defines durable operational wiring in the OM. Keep credential
|
|
112
|
+
values, provider webhook mechanics, deployment environment settings, execution logs,
|
|
113
|
+
and per-run scheduler state outside the OM.
|
|
114
|
+
|
|
115
|
+
`System.ontology` owns durable semantic contracts: object types, action types, catalog
|
|
116
|
+
types, link types, event types, and surfaces. `System.config` owns local settings and
|
|
117
|
+
defaults. If current UI or runtime code still needs legacy mirrors, keep `entities`
|
|
118
|
+
or `actions` aligned with the ontology record instead of inventing a separate
|
|
119
|
+
source of truth.
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
<!-- @generated by packages/sdk/scripts/copy-reference-docs.mjs -- DO NOT EDIT -->
|
|
2
|
+
<!-- Regenerate: pnpm scaffold:sync -->
|
|
3
|
+
|
|
4
|
+
# Organization OS
|
|
5
|
+
|
|
6
|
+
Organization OS is the semantic contract layer defining how organizations, Systems, Actions, ontology, resources, policies, roles, goals, knowledge, and runtime surfaces relate. This project consumes Organization OS through published `@elevasis/core` / `@elevasis/sdk` configuration and does not maintain the monorepo schema.
|
|
7
|
+
|
|
8
|
+
This rule is an orientation and reference map. Concrete edit rules for `core/config/organization-model.ts`, `systemPath`, resources, ontology, knowledge, and validation live in `.claude/rules/organization-model.md`.
|
|
9
|
+
|
|
10
|
+
## Key Files in This Project
|
|
11
|
+
|
|
12
|
+
- `core/config/organization-model.ts` -- project-specific org model definition, Systems, system-local ontology/config, Knowledge, and Resources descriptor catalog (`organizationModel.resources`)
|
|
13
|
+
- `core/config/extensions/` -- project-owned entity extension schemas
|
|
14
|
+
- `core/types/entities.ts` -- typed entity contracts (Project, Deal, etc.). Extends `BaseProject`, `BaseDeal` from `@elevasis/core/entities` with project-specific metadata. Read this when authoring workflows that operate on these entities.
|
|
15
|
+
- `ui/src/routes/__root.tsx` -- wires `ElevasisSystemsProvider` with `canonicalOrganizationModel`
|
|
16
|
+
- `ui/src/app-config.ts` -- references the org model
|
|
17
|
+
- `operations/src/index.ts` -- `DeploymentSpec` registry for workflows and agents
|
|
18
|
+
|
|
19
|
+
## Domain Overview
|
|
20
|
+
|
|
21
|
+
As of the 2026-05 resource-governance expansion, `OrganizationModel` includes platform configuration, organizational reality, governance, and knowledge domains:
|
|
22
|
+
|
|
23
|
+
**Platform configuration:** `systems`, `branding`, `navigation`
|
|
24
|
+
|
|
25
|
+
**Organizational reality:** `identity`, `customers`, `offerings`, `roles`, `goals`
|
|
26
|
+
|
|
27
|
+
**Governance:** `resources`, `policies`, and resource-to-System relationships
|
|
28
|
+
|
|
29
|
+
**Ontology, config, and knowledge:** `System.ontology` owns durable semantic contracts such as object types, action types, catalog types, link types, event types, and surfaces. `System.config` owns system-local JSON settings and defaults. `knowledge` is a flat id-keyed map of playbooks, strategies, and references that explain or govern systems and ontology records.
|
|
30
|
+
|
|
31
|
+
Resource identity is authored once in the id-keyed `resources` map. Each resource attaches to a System via `systemPath` and can declare ontology relationships through `resource.ontology`. Operations imports those descriptors and derives runtime `resourceId` / `type` while assembling the `DeploymentSpec`.
|
|
32
|
+
|
|
33
|
+
### Domain Rename Note
|
|
34
|
+
|
|
35
|
+
Some legacy UI feature constants and consumer-facing route keys are intentionally unchanged for compatibility:
|
|
36
|
+
|
|
37
|
+
| Old field | New field | Legacy key (unchanged) | UI constant (unchanged) |
|
|
38
|
+
| ---------- | ------------- | ---------------------- | ----------------------- |
|
|
39
|
+
| `crm` | `sales` | `'crm'` | `CRM_FEATURE_ID` |
|
|
40
|
+
| `leadGen` | `prospecting` | `'lead-gen'` | `LEAD_GEN_FEATURE_ID` |
|
|
41
|
+
| `delivery` | `projects` | `'projects'` | `PROJECTS_FEATURE_ID` |
|
|
42
|
+
|
|
43
|
+
## Reference Documentation
|
|
44
|
+
|
|
45
|
+
Full Organization OS documentation ships with the SDK and is available locally after `pnpm install`:
|
|
46
|
+
|
|
47
|
+
### Scaffold Reference (via SDK)
|
|
48
|
+
|
|
49
|
+
All paths under `node_modules/@elevasis/sdk/reference/scaffold/`:
|
|
50
|
+
|
|
51
|
+
- `node_modules/@elevasis/sdk/reference/scaffold/index.mdx` -- scaffold root and navigation
|
|
52
|
+
- `node_modules/@elevasis/sdk/reference/scaffold/core/organization-model.mdx` -- semantic contract, domains, adapter authoring, validation gate, `/om` entry point
|
|
53
|
+
- `node_modules/@elevasis/sdk/reference/scaffold/core/organization-graph.mdx` -- graph derivation, node/edge taxonomy, lenses
|
|
54
|
+
- `node_modules/@elevasis/sdk/reference/scaffold/ui/feature-shell.mdx` -- SystemModule manifest, provider runtime
|
|
55
|
+
- `node_modules/@elevasis/sdk/reference/scaffold/ui/composition-extensibility.mdx` -- layout primitives, router abstraction
|
|
56
|
+
- `node_modules/@elevasis/sdk/reference/scaffold/ui/recipes.md` -- copy-paste UI recipes for pages, nav items, components
|
|
57
|
+
- `node_modules/@elevasis/sdk/reference/scaffold/ui/feature-flags-and-gating.md` -- three-concept gating model
|
|
58
|
+
- `node_modules/@elevasis/sdk/reference/scaffold/ui/customization.md` -- sidebar composition via manifest overrides
|
|
59
|
+
- `node_modules/@elevasis/sdk/reference/scaffold/recipes/add-a-feature.md` -- end-to-end OM-backed System recipe through manifest, routes, and gating
|
|
60
|
+
- `node_modules/@elevasis/sdk/reference/scaffold/recipes/add-a-resource.md` -- author and deploy a workflow or agent
|
|
61
|
+
- `node_modules/@elevasis/sdk/reference/scaffold/recipes/gate-by-feature-or-admin.md` -- decision table for access control patterns
|
|
62
|
+
- `node_modules/@elevasis/sdk/reference/scaffold/recipes/extend-lead-gen.md` -- build or extend lead-gen pages, sidebars, hooks, list/member state, artifacts, workflow adapters, and prospecting semantics
|
|
63
|
+
- `node_modules/@elevasis/sdk/reference/scaffold/operations/workflow-recipes.md` -- workflow anatomy, adapter patterns, trigger patterns
|
|
64
|
+
- `node_modules/@elevasis/sdk/reference/scaffold/operations/propagation-pipeline.md` -- how sync and verification work across projects
|
|
65
|
+
- `node_modules/@elevasis/sdk/reference/scaffold/operations/scaffold-maintenance.md` -- content placement and auto-generation pipeline
|
|
66
|
+
- `node_modules/@elevasis/sdk/reference/scaffold/reference/glossary.md` -- Organization OS term definitions
|
|
67
|
+
- `node_modules/@elevasis/sdk/reference/scaffold/reference/contracts.md` -- auto-generated TypeScript contract shapes
|
|
68
|
+
- `node_modules/@elevasis/sdk/reference/scaffold/reference/feature-registry.md` -- auto-generated feature manifest catalog
|
|
69
|
+
|
|
70
|
+
### Local Project Docs
|
|
71
|
+
|
|
72
|
+
- `.claude/rules/agent-start-here.md` -- canonical first-read for agents (includes task-class routing)
|
|
73
|
+
|
|
74
|
+
## Published Subpaths and Constants
|
|
75
|
+
|
|
76
|
+
- `@elevasis/core/organization-model` -- the curated organization-model barrel. Exports `defineOrganizationModel`, `resolveOrganizationModel`, `OrganizationModelSchema`, `DEFAULT_ORGANIZATION_MODEL`, organization-model types, and typed System/Action plus legacy UI feature/surface constants.
|
|
77
|
+
- Legacy UI feature IDs: `CRM_FEATURE_ID`, `LEAD_GEN_FEATURE_ID`, `PROJECTS_FEATURE_ID`, `OPERATIONS_FEATURE_ID`, `MONITORING_FEATURE_ID`, `SETTINGS_FEATURE_ID`, `SEO_FEATURE_ID`
|
|
78
|
+
- Headline surface IDs: `CRM_PIPELINE_SURFACE_ID`, `LEAD_GEN_LISTS_SURFACE_ID`, `PROJECTS_INDEX_SURFACE_ID`, `OPERATIONS_ORGANIZATION_GRAPH_SURFACE_ID`
|
|
79
|
+
- Reality domain types: `OrganizationModelIdentity`, `OrganizationModelCustomers`, `OrganizationModelCustomerSegment`, `OrganizationModelOfferings`, `OrganizationModelProduct`, `OrganizationModelRoles`, `OrganizationModelRole`, `OrganizationModelGoals`, `OrganizationModelObjective`, `OrganizationModelKeyResult`
|
|
80
|
+
- TechStack: `TechStackEntrySchema`, `OrganizationModelTechStackEntry`
|
|
81
|
+
- Use constants instead of magic strings when overriding the org model.
|
|
82
|
+
- `@elevasis/core/entities` -- entity contracts barrel. Exports `BaseProject`, `BaseProjectSchema`, `BaseProjectInput` and the equivalents for `Milestone`, `Task`, `Deal`, `Company`, `Contact`. Each base interface is generic over a `\<TMeta>` extension slot. Extend these in `core/types/entities.ts` to add project-specific fields.
|
|
83
|
+
|
|
84
|
+
## When Working with Organization OS
|
|
85
|
+
|
|
86
|
+
- **Changing org model (structural reality):** Use `/om` as the entry point. Direct edits to `core/config/organization-model.ts` are discouraged -- `/om` runs the read -> propose -> confirm -> write -> validate ceremony. Run `/om` for the full layered flow or `/om \<domain>` for a targeted domain. See `.claude/rules/organization-model.md` for the concrete authoring boundary.
|
|
87
|
+
- **Building or extending CRM:** Start with `node_modules/@elevasis/sdk/reference/scaffold/recipes/extend-crm.md`. CRM spans Organization OS sales semantics, shared UI primitives, deal hooks, workflow adapters, and generated contracts.
|
|
88
|
+
- **Building or extending lead gen:** Start with `node_modules/@elevasis/sdk/reference/scaffold/recipes/extend-lead-gen.md`. Lead gen spans Organization OS prospecting semantics, shared UI primitives, list/member hooks, artifact hooks, workflow adapters, and generated contracts.
|
|
89
|
+
- **Customizing CRM deal actions:** Follow `node_modules/@elevasis/sdk/reference/scaffold/recipes/customize-crm-actions.md`. Do not add `sales.actions` to the org model; the v1 server-side override surface is intentionally deferred.
|
|
90
|
+
- **Adding or toggling a System:** Follow the current scaffold recipes when they mention UI features, but translate Organization OS changes to Systems, navigation surfaces, and Actions. Use `/om systems` for availability/routing changes.
|
|
91
|
+
- **Adding a resource:** Follow `node_modules/@elevasis/sdk/reference/scaffold/recipes/add-a-resource.md`.
|
|
92
|
+
- **Extending entities:** Start with `core/types/entities.ts` for the demo extension pattern. Base shapes come from `@elevasis/core/entities`.
|
|
93
|
+
- **Authoring a workflow that takes a Project/Deal/etc.:** Reference entity types from `core/types/entities.ts` in the input schema -- do not redeclare them.
|
|
94
|
+
- **Adding system-local ontology/config:** Put durable business schema in `System.ontology`, local defaults/settings in `System.config`, executable implementations in `resources`, and explanatory or governing material in `knowledge`.
|
|
95
|
+
- **Understanding contracts:** Check `node_modules/@elevasis/sdk/reference/scaffold/reference/contracts.md` for current type shapes.
|
|
96
|
+
- **Debugging sync issues:** Check `node_modules/@elevasis/sdk/reference/scaffold/operations/propagation-pipeline.md` for the verification pipeline.
|
|
97
|
+
|
|
98
|
+
## `/om` -- Org Model QA Entry Point
|
|
99
|
+
|
|
100
|
+
`/om` is the recurring, safe-to-re-run org model editor for this project. It is a skill (not a command) at `.claude/skills/om/SKILL.md`.
|
|
101
|
+
|
|
102
|
+
**Usage:**
|
|
103
|
+
|
|
104
|
+
- `/om` -- layered flow: identity → customers → offerings → roles → goals → techStack
|
|
105
|
+
- `/om identity` -- legal identity, mission/vision, industry, geography, timezone
|
|
106
|
+
- `/om customers` -- customer segments with jobs-to-be-done, pains, gains, firmographics
|
|
107
|
+
- `/om offerings` -- products and services with pricing model and segment references
|
|
108
|
+
- `/om roles` -- role chart with responsibilities, reporting lines, and holders
|
|
109
|
+
- `/om goals` -- organizational goals with period and measurable outcomes
|
|
110
|
+
- `/om techStack` -- external-SaaS and integration context; resource identity still belongs in OM Resources descriptors
|
|
111
|
+
- `/om systems` -- enable, disable, or add Systems; route invokable behavior through Actions
|
|
112
|
+
- `/om labels` -- edit display labels on enum entries (statuses, stages)
|
|
113
|
+
|
|
114
|
+
Every write is gated: `resolveOrganizationModel()` must succeed (Zod cross-refs pass) and `pnpm -C operations check-types` must pass. On failure the change is rolled back.
|
|
115
|
+
|
|
116
|
+
**Distinction from `/setup`:** `/setup` is first-time bootstrap only. After bootstrap it delegates here. `/om` is idempotent and safe to re-run at any time.
|
|
117
|
+
|
|
118
|
+
The ambient vibe layer (`.claude/rules/vibe.md`) automatically detects Codify intent in plain language and delegates to `/om`. Power users can invoke `/om` directly to bypass the ambient layer entirely.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<!-- @generated by packages/sdk/scripts/copy-reference-docs.mjs -- DO NOT EDIT -->
|
|
2
|
+
<!-- Regenerate: pnpm scaffold:sync -->
|
|
3
|
+
|
|
4
|
+
# Package Taxonomy (Consumer View)
|
|
5
|
+
|
|
6
|
+
External projects consume the **published `@elevasis/*` surface only**. The Elevasis monorepo also has workspace-internal `@repo/elevasis-*` packages — those are NOT installable here and should never appear in your imports or `package.json`.
|
|
7
|
+
|
|
8
|
+
## What You Can Import
|
|
9
|
+
|
|
10
|
+
| Package | Subpaths | Where it lives in `node_modules` |
|
|
11
|
+
| ---------------- | -------------------------------------------- | -------------------------------- |
|
|
12
|
+
| `@elevasis/sdk` | default, `/worker`, `/node`, `/test-utils` | `node_modules/@elevasis/sdk/` |
|
|
13
|
+
| `@elevasis/ui` | default, `/auth`, `/initialization`, etc. | `node_modules/@elevasis/ui/` |
|
|
14
|
+
| `@elevasis/core` | `/organization-model`, `/entities`, `/utils` | `node_modules/@elevasis/core/` |
|
|
15
|
+
|
|
16
|
+
## What You Will See in Monorepo Docs (and should NOT import)
|
|
17
|
+
|
|
18
|
+
Monorepo source and docs reference `@repo/elevasis-core` and `@repo/elevasis-operations`. These are workspace-internal packages used by Elevasis as a tenant of its own platform. They are `private: true` and never published. If you see them mentioned:
|
|
19
|
+
|
|
20
|
+
- Do NOT add them to this project's `package.json`
|
|
21
|
+
- Do NOT try to import from them — they are not in your `node_modules`
|
|
22
|
+
- They are not a substitute for `@elevasis/core` even though the name overlaps
|
|
23
|
+
|
|
24
|
+
## Confused About Where Something Lives?
|
|
25
|
+
|
|
26
|
+
Check the import path:
|
|
27
|
+
|
|
28
|
+
- `@elevasis/...` → published, consumable here
|
|
29
|
+
- `@repo/...` → monorepo-internal, not consumable
|
|
30
|
+
|
|
31
|
+
This project's own org-model and workflows live in `core/config/organization-model.ts` and `operations/src/**` — those are project-owned, not part of either family above.
|
|
32
|
+
|
|
33
|
+
## References
|
|
34
|
+
|
|
35
|
+
- `node_modules/@elevasis/sdk/reference/scaffold/index.mdx` — full SDK scaffold reference
|
|
36
|
+
- Monorepo source rule: `.claude/rules/package-taxonomy.md` in the elevasis-monorepo (when working across both)
|
|
@@ -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.
|