@elevasis/sdk 1.5.2 → 1.5.4

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 (63) hide show
  1. package/dist/cli.cjs +899 -57
  2. package/dist/index.d.ts +94 -110
  3. package/package.json +3 -3
  4. package/reference/_navigation.md +11 -1
  5. package/reference/_reference-manifest.json +70 -0
  6. package/reference/claude-config/commands/submit-issue.md +12 -0
  7. package/reference/claude-config/hooks/post-edit-validate.mjs +109 -0
  8. package/reference/claude-config/hooks/tool-failure-recovery.mjs +73 -0
  9. package/reference/claude-config/rules/deployment.md +57 -0
  10. package/reference/claude-config/rules/docs.md +26 -0
  11. package/reference/claude-config/rules/error-handling.md +56 -0
  12. package/reference/claude-config/rules/execution.md +40 -0
  13. package/reference/claude-config/rules/frontend.md +43 -0
  14. package/reference/claude-config/rules/observability.md +31 -0
  15. package/reference/claude-config/rules/organization-os.md +62 -0
  16. package/reference/claude-config/rules/platform.md +41 -0
  17. package/reference/claude-config/rules/shared-types.md +46 -0
  18. package/reference/claude-config/rules/task-tracking.md +47 -0
  19. package/reference/claude-config/scripts/statusline-command.js +18 -0
  20. package/reference/claude-config/settings.json +30 -0
  21. package/reference/claude-config/skills/deploy/SKILL.md +166 -0
  22. package/reference/claude-config/skills/dsp/SKILL.md +66 -0
  23. package/reference/claude-config/skills/elevasis/SKILL.md +239 -0
  24. package/reference/claude-config/skills/explore/SKILL.md +78 -0
  25. package/reference/claude-config/skills/project/SKILL.md +918 -0
  26. package/reference/claude-config/skills/save/SKILL.md +197 -0
  27. package/reference/claude-config/skills/setup/SKILL.md +210 -0
  28. package/reference/claude-config/skills/status/SKILL.md +60 -0
  29. package/reference/claude-config/skills/submit-issue/SKILL.md +179 -0
  30. package/reference/claude-config/skills/sync/SKILL.md +81 -0
  31. package/reference/cli.mdx +35 -20
  32. package/reference/deployment/index.mdx +6 -5
  33. package/reference/deployment/provided-features.mdx +62 -40
  34. package/reference/deployment/ui-execution.mdx +1 -2
  35. package/reference/framework/agent.mdx +50 -50
  36. package/reference/framework/index.mdx +13 -10
  37. package/reference/framework/project-structure.mdx +76 -70
  38. package/reference/packages/core/src/README.md +24 -17
  39. package/reference/packages/core/src/business/README.md +52 -0
  40. package/reference/packages/core/src/organization-model/README.md +25 -26
  41. package/reference/packages/ui/src/app/README.md +24 -0
  42. package/reference/packages/ui/src/provider/README.md +8 -7
  43. package/reference/platform-tools/type-safety.mdx +0 -10
  44. package/reference/roadmap.mdx +6 -4
  45. package/reference/scaffold/core/organization-graph.mdx +37 -28
  46. package/reference/scaffold/core/organization-model.mdx +34 -36
  47. package/reference/scaffold/index.mdx +14 -9
  48. package/reference/scaffold/operations/propagation-pipeline.md +133 -0
  49. package/reference/scaffold/operations/scaffold-maintenance.md +125 -0
  50. package/reference/scaffold/operations/workflow-recipes.md +18 -1
  51. package/reference/scaffold/recipes/add-a-feature.md +37 -21
  52. package/reference/scaffold/recipes/add-a-resource.md +16 -12
  53. package/reference/scaffold/recipes/customize-organization-model.md +400 -0
  54. package/reference/scaffold/recipes/extend-a-base-entity.md +140 -0
  55. package/reference/scaffold/recipes/gate-by-feature-or-admin.md +18 -12
  56. package/reference/scaffold/recipes/index.md +3 -3
  57. package/reference/scaffold/reference/contracts.md +11 -32
  58. package/reference/scaffold/reference/feature-registry.md +10 -9
  59. package/reference/scaffold/reference/glossary.md +14 -18
  60. package/reference/scaffold/ui/customization.md +2 -2
  61. package/reference/scaffold/ui/feature-flags-and-gating.md +40 -54
  62. package/reference/scaffold/ui/feature-shell.mdx +23 -24
  63. package/reference/scaffold/ui/recipes.md +118 -3
@@ -0,0 +1,66 @@
1
+ ---
2
+ name: dsp
3
+ description: Dispatch subagents in parallel for implementation tasks
4
+ ---
5
+
6
+ # DSP -- Dispatch Subagents in Parallel
7
+
8
+ Parallel agent dispatch for implementation tasks. Orchestrate, then delegate to subagents.
9
+
10
+ **Usage:** `/dsp <instructions>`
11
+
12
+ ## Rules
13
+
14
+ 1. **Always dispatch, never self-execute** -- the purpose is to offload work to subagents
15
+ 2. **Parallel within waves** -- all agents in a wave dispatched in a SINGLE message
16
+ 3. **Read docs first** -- always read `docs/index.md` before planning to understand project structure
17
+
18
+ ## Process
19
+
20
+ ### Step 1: Understand Context
21
+
22
+ 1. Read `docs/index.md` for project structure and navigation
23
+ 2. Read relevant architecture/feature docs based on the task domain
24
+ 3. If the task touches code, explore the relevant `src/` directories
25
+
26
+ ### Step 2: Analyze Complexity
27
+
28
+ **Single-Wave** -- all tasks independent, dispatch everything at once
29
+ **Multi-Wave** -- tasks have dependencies, execute waves sequentially
30
+
31
+ ### Step 3: Plan
32
+
33
+ For each unit of work, identify:
34
+
35
+ - What files/areas are affected
36
+ - What context the subagent needs
37
+ - Whether it depends on another task's output
38
+
39
+ Print the plan:
40
+
41
+ ```
42
+ DSP Plan: N waves, M tasks
43
+ Wave 1: [description] -- N tasks
44
+ Wave 2: [description] -- N tasks (if multi-wave)
45
+ Dispatching Wave 1...
46
+ ```
47
+
48
+ ### Step 4: Dispatch
49
+
50
+ Use the Agent tool with `subagent_type="general-purpose"` and `model="sonnet"`.
51
+
52
+ Each agent prompt must include:
53
+
54
+ - The specific task to accomplish
55
+ - Relevant file paths and context
56
+ - Instruction to use backslash paths for file operations on Windows
57
+
58
+ ### Step 5: Aggregate Results
59
+
60
+ ```
61
+ DSP Results: [description]
62
+
63
+ Tasks completed: X/Y
64
+ Files modified: [list]
65
+ Next steps: [if any]
66
+ ```
@@ -0,0 +1,239 @@
1
+ ---
2
+ name: elevasis
3
+ description: Elevasis platform operations -- check, deploy, execute, inspect, and debug SDK resources
4
+ ---
5
+
6
+ # Elevasis Platform Operations
7
+
8
+ Manage SDK resources in the `operations/` workspace via the `elevasis-sdk` CLI.
9
+
10
+ **Usage:**
11
+
12
+ - `/elevasis` -- Show available operations
13
+ - `/elevasis check` -- Validate resource definitions
14
+ - `/elevasis deploy [--prod]` -- Deploy resources
15
+ - `/elevasis exec <resourceId> [--input '...']` -- Execute a resource
16
+ - `/elevasis describe <resourceId>` -- Show resource schema
17
+ - `/elevasis logs <resourceId>` -- View recent executions
18
+ - `/elevasis creds` -- Manage credentials
19
+
20
+ ## Critical Rules
21
+
22
+ - **Always describe before exec** -- run `describe` first to see the exact input schema
23
+ - **Use `-f` for complex inputs** -- write JSON to a temp file to avoid shell escaping issues
24
+ - **Always `check` before `deploy`** -- catches schema and config errors early
25
+
26
+ ## Environment
27
+
28
+ The CLI authenticates via `ELEVASIS_PLATFORM_KEY` in the root `.env` file. The CLI walks up directories to find `.env`, so it works from both the project root and `operations/`.
29
+
30
+ For dev vs prod targeting:
31
+
32
+ - Default: production (`https://api.elevasis.io`)
33
+ - `--prod` flag: explicitly targets production (overrides `NODE_ENV=development`)
34
+ - `ELEVASIS_API_URL` env var: override to any custom URL
35
+
36
+ ## Operations
37
+
38
+ ### Check
39
+
40
+ Validate all resource definitions (schemas, contracts, config):
41
+
42
+ ```bash
43
+ pnpm -C operations exec elevasis-sdk check
44
+ ```
45
+
46
+ Reports: resource count, validation errors, schema serialization warnings. Exit code 0 = pass.
47
+
48
+ ### Deploy
49
+
50
+ Bundle and deploy resources to the Elevasis platform.
51
+
52
+ Before calling the SDK deploy, run both doc generators in sequence so the uploaded docs reflect the current resource state (resources first, then nav so `docs/index.md` picks up `resources.md`):
53
+
54
+ ```bash
55
+ pnpm exec elevasis-sdk generate-resources
56
+ pnpm exec elevasis-sdk generate-docs
57
+ pnpm -C operations exec elevasis-sdk deploy [--prod]
58
+ ```
59
+
60
+ Replace `[--prod]` with `--prod` when targeting production.
61
+
62
+ **Version bumping flags** (written back to `src/index.ts`):
63
+
64
+ - `--major` -- bump major (1.0.0 to 2.0.0) for breaking contract changes
65
+ - `--minor` -- bump minor (1.0.0 to 1.1.0) for new features
66
+ - `--patch` -- bump patch (1.0.0 to 1.0.1) for fixes
67
+
68
+ Deploy replaces the previous active deployment. Resources become executable immediately.
69
+
70
+ ### Describe
71
+
72
+ **Always run before executing.** Shows resource metadata, input/output schemas, and step chain:
73
+
74
+ ```bash
75
+ pnpm -C operations exec elevasis-sdk describe <resourceId>
76
+
77
+ # JSON output for programmatic use
78
+ pnpm -C operations exec elevasis-sdk describe <resourceId> --json
79
+ ```
80
+
81
+ Output includes: type, name, version, status, domains, input schema (required/optional fields with types), output schema, step definitions with entry point and routing.
82
+
83
+ ### Execute
84
+
85
+ Run a deployed resource. **Always `describe` first to see the input schema.**
86
+
87
+ ```bash
88
+ # Simple input (inline JSON)
89
+ pnpm -C operations exec elevasis-sdk exec <resourceId> -i '{"key": "value"}'
90
+
91
+ # Complex input (temp file -- PREFERRED for non-trivial payloads)
92
+ # Write input to a temp file first, then reference it with -f
93
+ pnpm -C operations exec elevasis-sdk exec <resourceId> -f .tmp-input.json
94
+
95
+ # Async execution (for long-running workflows -- polls until complete)
96
+ pnpm -C operations exec elevasis-sdk exec <resourceId> -f .tmp-input.json --async
97
+ ```
98
+
99
+ **When to use `-f` (file input):**
100
+
101
+ - Input contains nested objects, arrays, or special characters
102
+ - Input has quotes that conflict with shell escaping
103
+ - Input is reused across multiple executions
104
+ - Any time inline `-i` causes parsing errors
105
+
106
+ **Temp file pattern:**
107
+
108
+ 1. Write the JSON to a temp file inside the project (e.g., `operations/.tmp-input.json`)
109
+ 2. Execute with `-f .tmp-input.json`
110
+ 3. Delete the temp file after
111
+
112
+ **Sync vs async:**
113
+
114
+ - Sync (default): blocks until execution completes, shows result inline
115
+ - Async (`--async`): returns execution ID immediately, polls every 3s with elapsed timer
116
+ - Use `--async` for workflows that may exceed 30 seconds
117
+
118
+ **Connection failure recovery:** If the connection drops during sync execution, the CLI automatically searches recent executions for a running one and resumes polling.
119
+
120
+ ### List Resources
121
+
122
+ View all deployed resources:
123
+
124
+ ```bash
125
+ pnpm -C operations exec elevasis-sdk resources
126
+
127
+ # JSON output
128
+ pnpm -C operations exec elevasis-sdk resources --json
129
+ ```
130
+
131
+ Shows: resource ID, type (workflow/agent), name, description, status.
132
+
133
+ ### Execution History
134
+
135
+ View past executions for a resource:
136
+
137
+ ```bash
138
+ # List recent executions (default: last 50)
139
+ pnpm -C operations exec elevasis-sdk executions <resourceId>
140
+
141
+ # Filter by status
142
+ pnpm -C operations exec elevasis-sdk executions <resourceId> --status failed --limit 10
143
+
144
+ # View specific execution (full detail with logs)
145
+ pnpm -C operations exec elevasis-sdk execution <resourceId> <executionId>
146
+
147
+ # Logs only (skip metadata)
148
+ pnpm -C operations exec elevasis-sdk execution <resourceId> <executionId> --logs-only
149
+
150
+ # Include input and result data
151
+ pnpm -C operations exec elevasis-sdk execution <resourceId> <executionId> --input --result
152
+ ```
153
+
154
+ **`executions` flags:** `--limit <n>` (default 50), `--status running|completed|failed`, `--json`
155
+
156
+ **`execution` flags:** `--logs-only`, `--input`, `--result`, `--json`
157
+
158
+ Execution detail shows: status, start/end times, duration, input, result, error (if failed), and timestamped logs with level (ERROR/WARN/INFO/DEBUG).
159
+
160
+ ### Deployments
161
+
162
+ View deployment history:
163
+
164
+ ```bash
165
+ pnpm -C operations exec elevasis-sdk deployments
166
+ ```
167
+
168
+ Shows: deployment ID, SDK version, status (active/deploying/failed/stopped), created timestamp.
169
+
170
+ ### Credentials
171
+
172
+ Manage integration credentials (API keys, webhook secrets):
173
+
174
+ ```bash
175
+ # List credentials (metadata only, secrets not exposed)
176
+ pnpm -C operations exec elevasis-sdk creds list
177
+
178
+ # Create a credential
179
+ pnpm -C operations exec elevasis-sdk creds create --name my-api-key --type api-key --value '{"apiKey":"sk-..."}'
180
+
181
+ # Update a credential value
182
+ pnpm -C operations exec elevasis-sdk creds update my-api-key --value '{"apiKey":"new-key"}'
183
+
184
+ # Rename a credential
185
+ pnpm -C operations exec elevasis-sdk creds rename old-name --to new-name
186
+
187
+ # Delete a credential
188
+ pnpm -C operations exec elevasis-sdk creds delete my-api-key --force
189
+ ```
190
+
191
+ Credential names: lowercase, digits, hyphens only (`^[a-z0-9]+(-[a-z0-9]+)*$`). Types: `api-key`, `webhook-secret`.
192
+
193
+ ### Rename Resource
194
+
195
+ Rename a resource ID across all platform tables:
196
+
197
+ ```bash
198
+ # Dry run (preview only)
199
+ pnpm -C operations exec elevasis-sdk rename old-id --to new-id
200
+
201
+ # Apply rename
202
+ pnpm -C operations exec elevasis-sdk rename old-id --to new-id --execute
203
+ ```
204
+
205
+ Always dry-run first to see affected tables and row counts.
206
+
207
+ ### Error Resolution
208
+
209
+ Mark execution errors as resolved:
210
+
211
+ ```bash
212
+ # Resolve a specific error
213
+ pnpm -C operations exec elevasis-sdk error resolve <errorId>
214
+
215
+ # Resolve all errors for an execution
216
+ pnpm -C operations exec elevasis-sdk error resolve-execution <executionId>
217
+ ```
218
+
219
+ ## Standard Workflow
220
+
221
+ ```
222
+ 1. Write/modify resources operations/src/
223
+ 2. Type-check pnpm -C operations run check-types
224
+ 3. Validate /elevasis check
225
+ 4. Deploy /elevasis deploy --prod
226
+ 5. Describe /elevasis describe <id>
227
+ 6. Execute /elevasis exec <id> -f input.json
228
+ 7. Inspect logs /elevasis logs <id>
229
+ ```
230
+
231
+ ## Debugging Checklist
232
+
233
+ When an execution fails:
234
+
235
+ 1. **Get the execution ID** from the exec output or `executions <resourceId> --status failed`
236
+ 2. **Read the logs**: `execution <resourceId> <executionId> --logs-only`
237
+ 3. **Check the input**: `execution <resourceId> <executionId> --input`
238
+ 4. **Check the error**: `execution <resourceId> <executionId> --result`
239
+ 5. **Fix the handler**, redeploy, re-execute
@@ -0,0 +1,78 @@
1
+ ---
2
+ name: explore
3
+ description: Codebase exploration anchored to project documentation
4
+ ---
5
+
6
+ # Explore
7
+
8
+ Codebase exploration anchored to project documentation.
9
+
10
+ **Usage:** `/explore [area or question]`
11
+
12
+ ## Process
13
+
14
+ ### Step 0: OS-Vocab Classification
15
+
16
+ Before orienting, scan the user's query for Organization OS terminology. If any of the following appear, classify the query as **OS-relevant** and follow the OS context steps below; otherwise skip to Step 1.
17
+
18
+ **OS vocabulary triggers:**
19
+
20
+ - Feature layer: `feature`, `features`, `FeatureModule`, `feature key`, `feature gate`, `feature access`, `gate`, `gating`, `access`, `enable`, `disable`
21
+ - Shell / nav: `manifest`, `shell`, `sub-shell`, `sidebar`, `nav`, `navigation`, `route`
22
+ - Auth / guards: `guard`, `FeatureGuard`, `AdminGuard`, `ProtectedRoute`, `admin`
23
+ - Org model: `organization`, `org model`, `organization model`, `domain`, `surface`
24
+ - Foundations: `foundation`, `foundations`, `@foundation/`, `adapter`
25
+ - Platform ops: `workflow`, `agent`, `deployment`, `resource`
26
+
27
+ **If OS-relevant:**
28
+
29
+ 1. Read `docs/reference/active-change-index.md` immediately. If the target area is flagged as under active refactor, surface the watch-area warning to the user before proceeding — include the "Load:" doc paths listed in that entry so investigation does not rely on stale scaffold prose.
30
+ 2. Build the OS context bundle to pass into Step 3:
31
+ - Always: `node_modules/@elevasis/sdk/reference/scaffold/reference/glossary.md`, `docs/reference/active-change-index.md`, `docs/agent-start-here.md`
32
+ - Features / Shell / Gating queries: add `node_modules/@elevasis/sdk/reference/scaffold/ui/feature-flags-and-gating.md` + `node_modules/@elevasis/sdk/reference/scaffold/reference/contracts.md`
33
+ - Workflow / Operations queries: add `docs/operations/index.md` + `docs/resources.md`
34
+ - Organization-model queries: add `node_modules/@elevasis/sdk/reference/scaffold/reference/contracts.md` + `foundations/config/README.md`
35
+
36
+ **OS layer → query intent map** (guides which reference docs the investigator loads first):
37
+
38
+ | Query intent | Primary OS layers | Key reference |
39
+ | ---------------------------------------- | -------------------------------- | ---------------------------------------------------------------------------------------- |
40
+ | "Why doesn't my feature show up?" | Features + UI Shell Runtime | `glossary.md` (accessFeatureKey, FEATURE_KEY_ALIASES), `feature-flags-and-gating.md` |
41
+ | "How do I add a nav item?" | Features + Toolkit | `feature-flags-and-gating.md`, `contracts.md` |
42
+ | "How does admin gating work?" | Features + UI Shell Runtime | `glossary.md` (AdminGuard, requiresAdmin, ProtectedRoute), `feature-flags-and-gating.md` |
43
+ | "What runs when this workflow triggers?" | Platform Public API + Operations | `operations/index.md`, `resources.md` |
44
+ | "Why does the foundations adapter fail?" | Foundations | `glossary.md` (domain vs surface, settings asymmetry), `foundations/config/README.md` |
45
+
46
+ ### Step 1: Orient
47
+
48
+ 1. Read `docs/index.md` for the full project structure
49
+ 2. Determine which domain the user's question falls into
50
+
51
+ ### Step 2: Load Domain Context
52
+
53
+ Read the relevant doc(s) and source directories based on the area being explored. Use the Navigation table in `CLAUDE.md` for quick reference.
54
+
55
+ For OS-relevant queries, also inject the OS context bundle assembled in Step 0 into the investigator's starting context.
56
+
57
+ ### Step 3: Investigate
58
+
59
+ For targeted questions:
60
+
61
+ - Use Grep to search for specific patterns, function names, or strings
62
+ - Use Glob to find files by pattern
63
+ - Read specific files for detailed understanding
64
+
65
+ For broad exploration:
66
+
67
+ - Dispatch a `general-purpose` subagent with the domain context and exploration question
68
+ - The subagent should read files, trace data flow, and return a structured report
69
+ - For OS-relevant queries, pass the preloaded OS context bundle so the subagent starts with terminology already resolved
70
+
71
+ ### Step 4: Report
72
+
73
+ Present findings with:
74
+
75
+ - Direct answers to the question
76
+ - Relevant code locations (file:function format)
77
+ - Connections to other parts of the system
78
+ - Suggestions for related areas to explore (if relevant)