@elevasis/sdk 1.25.0 → 1.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/dist/cli.cjs +87 -120
  2. package/dist/index.d.ts +220 -50
  3. package/dist/index.js +4 -435
  4. package/dist/node/index.d.ts +46 -38
  5. package/dist/test-utils/index.d.ts +154 -40
  6. package/dist/test-utils/index.js +27 -355
  7. package/dist/types/worker/adapters/clickup.d.ts +22 -0
  8. package/dist/types/worker/adapters/index.d.ts +1 -0
  9. package/dist/worker/index.js +32 -354
  10. package/package.json +2 -2
  11. package/reference/_navigation.md +11 -1
  12. package/reference/_reference-manifest.json +70 -0
  13. package/reference/claude-config/rules/organization-model.md +12 -1
  14. package/reference/claude-config/rules/organization-os.md +12 -1
  15. package/reference/claude-config/skills/om/SKILL.md +13 -5
  16. package/reference/claude-config/skills/om/operations/codify-level-a.md +109 -100
  17. package/reference/claude-config/skills/om/operations/customers.md +10 -6
  18. package/reference/claude-config/skills/om/operations/features.md +7 -3
  19. package/reference/claude-config/skills/om/operations/goals.md +10 -6
  20. package/reference/claude-config/skills/om/operations/identity.md +8 -5
  21. package/reference/claude-config/skills/om/operations/labels.md +17 -1
  22. package/reference/claude-config/skills/om/operations/offerings.md +11 -7
  23. package/reference/claude-config/skills/om/operations/roles.md +11 -7
  24. package/reference/claude-config/skills/om/operations/techStack.md +10 -2
  25. package/reference/claude-config/skills/setup/SKILL.md +2 -2
  26. package/reference/claude-config/sync-notes/2026-05-20-om-define-helpers.md +32 -0
  27. package/reference/claude-config/sync-notes/2026-05-22-access-model-and-right-panel.md +43 -0
  28. package/reference/claude-config/sync-notes/2026-05-22-lead-gen-tenant-config.md +40 -0
  29. package/reference/claude-config/sync-notes/2026-05-22-org-model-multi-file-split.md +61 -0
  30. package/reference/claude-config/sync-notes/2026-05-23-branding-names-to-identity.md +49 -0
  31. package/reference/claude-config/sync-notes/2026-05-23-om-deployment-drift-detection.md +42 -0
  32. package/reference/cli-management.mdx +541 -0
  33. package/reference/cli.mdx +4 -532
  34. package/reference/concepts.mdx +134 -146
  35. package/reference/deployment/api.mdx +296 -297
  36. package/reference/deployment/command-center.mdx +208 -209
  37. package/reference/deployment/index.mdx +194 -195
  38. package/reference/deployment/provided-features.mdx +110 -107
  39. package/reference/deployment/ui-execution.mdx +249 -250
  40. package/reference/examples/organization-model.ts +14 -4
  41. package/reference/framework/index.mdx +111 -195
  42. package/reference/framework/resource-documentation.mdx +90 -0
  43. package/reference/framework/tutorial-system.mdx +135 -135
  44. package/reference/getting-started.mdx +141 -142
  45. package/reference/index.mdx +95 -106
  46. package/reference/packages/ui/src/auth/README.md +6 -6
  47. package/reference/platform-tools/adapters-integration.mdx +300 -301
  48. package/reference/platform-tools/adapters-platform.mdx +552 -553
  49. package/reference/platform-tools/index.mdx +216 -217
  50. package/reference/platform-tools/type-safety.mdx +82 -82
  51. package/reference/resources/index.mdx +348 -349
  52. package/reference/resources/patterns.mdx +446 -449
  53. package/reference/resources/types.mdx +115 -116
  54. package/reference/roadmap.mdx +164 -165
  55. package/reference/rules/organization-model.md +14 -0
  56. package/reference/runtime.mdx +172 -173
  57. package/reference/scaffold/operations/propagation-pipeline.md +1 -1
  58. package/reference/scaffold/recipes/extend-lead-gen.md +130 -77
  59. package/reference/scaffold/reference/contracts.md +376 -446
  60. package/reference/scaffold/reference/glossary.md +8 -6
  61. package/reference/scaffold/ui/feature-flags-and-gating.md +59 -46
  62. package/reference/scaffold/ui/feature-shell.mdx +11 -11
  63. package/reference/scaffold/ui/recipes.md +24 -24
  64. package/reference/troubleshooting.mdx +222 -223
@@ -1,250 +1,249 @@
1
- ---
2
- title: UI Execution
3
- description: Trigger workflow and agent executions from a custom React UI -- Run buttons, input forms, and result displays via @elevasis/ui
4
- loadWhen: "Building a custom UI that triggers resource executions (Run buttons, input forms)"
5
- ---
6
-
7
- `@elevasis/ui` ships a set of components and hooks that let your custom React pages trigger workflow and agent executions without wiring up API calls manually. This page is for template users building interactive resource pages in `external/_template` who want to add Run buttons, input forms, and execution result displays.
8
-
9
- The API comes in three tiers: a convenience one-tag component that handles everything, a controlled form primitive for custom modal chrome, and low-level hooks for fully custom rendering. Most template pages need only the first tier.
10
-
11
- ---
12
-
13
- ## Quick Start -- `ResourceExecuteDialog`
14
-
15
- `ResourceExecuteDialog` combines a modal shell, an input form, mutation state, and result display into a single component. Drop it next to a Button and you have a working Run dialog in about fifteen lines.
16
-
17
- ```tsx
18
- import { useState } from 'react'
19
- import { Button } from '@mantine/core'
20
- import { ResourceExecuteDialog } from '@elevasis/ui/features/operations'
21
- import { useNavigate } from '@tanstack/react-router'
22
-
23
- const resource = {
24
- resourceId: 'qualify-lead-workflow',
25
- resourceType: 'workflow' as const,
26
- name: 'Qualify Lead',
27
- formSchema: {
28
- fields: [
29
- { name: 'email', label: 'Lead email', type: 'text', required: true },
30
- { name: 'company', label: 'Company', type: 'text', required: false },
31
- ],
32
- },
33
- }
34
-
35
- export function QualifyLeadPage() {
36
- const [opened, setOpened] = useState(false)
37
- const navigate = useNavigate()
38
-
39
- return (
40
- <>
41
- <Button onClick={() => setOpened(true)}>Run</Button>
42
-
43
- <ResourceExecuteDialog
44
- opened={opened}
45
- onClose={() => setOpened(false)}
46
- resource={resource}
47
- onViewExecution={(executionId) =>
48
- navigate({ to: '/logs/$executionId', params: { executionId } })
49
- }
50
- />
51
- </>
52
- )
53
- }
54
- ```
55
-
56
- What the user sees when they click Run:
57
-
58
- - A modal opens titled "Run workflow" with the resource ID displayed.
59
- - The form renders one field per entry in `formSchema.fields`. Required fields show validation errors on submit.
60
- - On submit, a loading overlay appears while the POST is in flight.
61
- - On success, a teal confirmation card shows the execution ID. A "View execution" button calls `onViewExecution` with that ID.
62
- - On error, a red alert shows the error message with a "Try again" option.
63
-
64
- If `formSchema` is omitted or has no fields, the form skips to a single "Run" button with the message "This workflow takes no input."
65
-
66
- ---
67
-
68
- ## The Three-Tier API
69
-
70
- | Tier | Component / Hook | Use case |
71
- | --------------- | ------------------------------------------ | ----------------------------------------------------------------------------------------------- |
72
- | Convenience | `ResourceExecuteDialog` | One-tag Run button + modal + form. Parent only manages `opened` state. |
73
- | Controlled form | `ResourceExecuteForm` | Custom modal chrome; parent owns the mutation and decides where to show results. |
74
- | Low-level | `ExecuteWorkflowModal` + `useExecuteAsync` | Fully custom rendering, non-standard modal behavior, or composing execution into a larger flow. |
75
-
76
- Start with `ResourceExecuteDialog`. Move down the tiers only when you need something the convenience component cannot do.
77
-
78
- ---
79
-
80
- ## Controlled Usage with `ResourceExecuteForm`
81
-
82
- Use `ResourceExecuteForm` when you want to own the modal or display the result somewhere outside the dialog -- for example, rendering the execution ID inline on the page after submission.
83
-
84
- `ResourceExecuteForm` accepts `onSubmit` and `isPending` from the parent. The parent calls `useExecuteAsync()` directly and passes `mutateAsync` as the submit handler.
85
-
86
- ```tsx
87
- import { useState } from 'react'
88
- import { Modal, Button, Text } from '@mantine/core'
89
- import { ResourceExecuteForm } from '@elevasis/ui/features/operations'
90
- import { useExecuteAsync } from '@elevasis/ui/hooks'
91
-
92
- const formSchema = {
93
- fields: [
94
- { name: 'topic', label: 'Topic', type: 'text', required: true },
95
- ],
96
- }
97
-
98
- export function CustomRunPanel() {
99
- const [opened, setOpened] = useState(false)
100
- const mutation = useExecuteAsync()
101
-
102
- const handleSubmit = async (input: Record<string, unknown>) => {
103
- await mutation.mutateAsync({
104
- resourceId: 'research-agent',
105
- resourceType: 'agent',
106
- input,
107
- })
108
- }
109
-
110
- return (
111
- <>
112
- <Button onClick={() => setOpened(true)}>Run agent</Button>
113
-
114
- {mutation.data && (
115
- <Text size="sm">Started: {mutation.data.executionId}</Text>
116
- )}
117
-
118
- <Modal opened={opened} onClose={() => setOpened(false)} title="Run research agent">
119
- <ResourceExecuteForm
120
- formSchema={formSchema}
121
- onSubmit={handleSubmit}
122
- isPending={mutation.isPending}
123
- disabled={mutation.isPending}
124
- submitLabel="Start research"
125
- />
126
- </Modal>
127
- </>
128
- )
129
- }
130
- ```
131
-
132
- `ResourceExecuteForm` props:
133
-
134
- | Prop | Type | Default | Notes |
135
- | ------------- | ------------------------------------ | -------- | ------------------------------------ |
136
- | `formSchema` | `SerializedExecutionFormSchema` | required | Drives field rendering |
137
- | `onSubmit` | `(input) => void | Promise<void>` | required | Called with mapped field values |
138
- | `isPending` | `boolean` | `false` | Shows loading state on submit button |
139
- | `disabled` | `boolean` | `false` | Disables all fields and button |
140
- | `submitLabel` | `string` | `'Run'` | Button label when not pending |
141
-
142
- ---
143
-
144
- ## Low-Level: Hooks and `ExecuteWorkflowModal`
145
-
146
- For complete rendering control, use `useExecuteAsync` and `ExecuteWorkflowModal` independently. `ExecuteWorkflowModal` is a Mantine Modal pre-wired with a loading overlay, a success card (execution ID + "View execution" button), and an error alert. You pass `children` for the input area.
147
-
148
- ```tsx
149
- import { ExecuteWorkflowModal } from '@elevasis/ui/features/operations'
150
- import { useExecuteAsync } from '@elevasis/ui/hooks'
151
-
152
- const { mutateAsync, isPending, error, data, reset } = useExecuteAsync()
153
-
154
- <ExecuteWorkflowModal
155
- opened={opened}
156
- onClose={() => setOpened(false)}
157
- resource={{ resourceId: 'my-workflow', resourceType: 'workflow', name: 'My Workflow' }}
158
- isPending={isPending}
159
- error={error}
160
- result={data ?? null}
161
- onViewExecution={handleViewExecution}
162
- onReset={reset}
163
- >
164
- {/* your custom form or content here */}
165
- </ExecuteWorkflowModal>
166
- ```
167
-
168
- The modal locks close interactions (click-outside, Escape, close button) while `isPending` is true, preventing accidental dismissal mid-execution.
169
-
170
- Source: `packages/ui/src/features/operations/executions/ExecuteWorkflowModal.tsx`, `packages/ui/src/hooks/executions/useExecuteAsync.ts`
171
-
172
- ---
173
-
174
- ## Zod-Validated Execution with `useExecuteWorkflow`
175
-
176
- `useExecuteWorkflow` wraps `useExecuteAsync` with a Zod parse step before the POST. Use it when you are constructing input programmatically (not from a form) and want to catch schema mismatches before they reach the API.
177
-
178
- ```tsx
179
- import { z } from 'zod'
180
- import { useExecuteWorkflow } from '@elevasis/ui/hooks'
181
-
182
- const inputSchema = z.object({
183
- email: z.string().email(),
184
- score: z.number().min(0).max(100),
185
- })
186
-
187
- function useScoredExecution() {
188
- return useExecuteWorkflow({ schema: inputSchema })
189
- }
190
-
191
- // In a component:
192
- const { execute, isPending, data, error } = useScoredExecution()
193
-
194
- await execute({
195
- resourceId: 'score-lead-workflow',
196
- resourceType: 'workflow',
197
- input: { email: 'lead@example.com', score: 72 },
198
- })
199
- ```
200
-
201
- If `input` fails the Zod parse, `execute` throws synchronously with the message `"Invalid workflow input: ..."` before making any network request. The `mutation` object on the return value is the underlying `useExecuteAsync` mutation, giving you full TanStack Query state if needed.
202
-
203
- Prefer `useExecuteWorkflow` over raw `useExecuteAsync` when:
204
-
205
- - Input is assembled from multiple sources (not a single form submit).
206
- - You want TypeScript inference on the input shape via `z.infer`.
207
- - You want a clear validation error message rather than a 400 from the API.
208
-
209
- Source: `packages/ui/src/hooks/executions/useExecuteWorkflow.ts`
210
-
211
- ---
212
-
213
- ## Input Forms
214
-
215
- `ResourceExecuteDialog` and `ResourceExecuteForm` auto-render form fields from `formSchema.fields`. Each field is a `SerializedFormField` with at minimum `name`, `label`, and `type`.
216
-
217
- Supported field types:
218
-
219
- - `text` -- single-line text input
220
- - `textarea` -- multi-line text input
221
- - `number` -- numeric input
222
- - `select` -- dropdown with `options` array
223
- - `checkbox` -- boolean toggle; defaults to `false`
224
- - `radio` -- radio group with `options` array
225
- - `richtext` -- rich text editor
226
-
227
- Required fields (`required: true`) are validated on submit. Custom field-to-input-key remapping is supported via `formSchema.fieldMappings` -- a `Record<string, string>` that renames field values before they are passed to `onSubmit`.
228
-
229
- If `formSchema` is undefined, an empty object, or has `fields: []`, the form skips rendering fields entirely and shows "This workflow takes no input." with a single Run button.
230
-
231
- ---
232
-
233
- ## Error and Result Handling
234
-
235
- Mutation state flows automatically into the modal chrome when using `ResourceExecuteDialog` or `ExecuteWorkflowModal`:
236
-
237
- - **Success** -- a teal alert card displays the execution ID from `result.executionId`. If `onViewExecution` is provided, a "View execution" button calls it with the ID. This is the recommended way to deep-link to the Execution Logs page.
238
- - **Error** -- a red alert displays `error.message`. A "Try again" button calls `onReset`, which clears the mutation state and re-shows the form.
239
- - **Pending** -- a blur overlay covers the form area while the POST is in flight. The modal cannot be dismissed during this state.
240
-
241
- `useExecuteAsync` also invalidates the executions list query on success (keyed by `organizationId` + `resourceId`), so any `useExecutions` query on the page refreshes automatically.
242
-
243
- ---
244
-
245
- ## Related
246
-
247
- - [REST API](api.mdx) -- trigger executions directly over HTTP, without React
248
- - [Command Center](command-center.mdx) -- built-in managed UI; includes Run buttons for all deployed resources
249
- - [Resource Patterns](../resources/patterns.mdx) -- HITL approval patterns and `approval.create()`
250
- - [Platform Adapters](../platform-tools/adapters-platform.mdx) -- `approval.create()` reference
1
+ ---
2
+ title: UI Execution
3
+ description: Trigger workflow and agent executions from a custom React UI -- Run buttons, input forms, and result displays via @elevasis/ui
4
+ ---
5
+
6
+ `@elevasis/ui` ships a set of components and hooks that let your custom React pages trigger workflow and agent executions without wiring up API calls manually. This page is for template users building interactive resource pages in `external/_template` who want to add Run buttons, input forms, and execution result displays.
7
+
8
+ The API comes in three tiers: a convenience one-tag component that handles everything, a controlled form primitive for custom modal chrome, and low-level hooks for fully custom rendering. Most template pages need only the first tier.
9
+
10
+ ---
11
+
12
+ ## Quick Start -- `ResourceExecuteDialog`
13
+
14
+ `ResourceExecuteDialog` combines a modal shell, an input form, mutation state, and result display into a single component. Drop it next to a Button and you have a working Run dialog in about fifteen lines.
15
+
16
+ ```tsx
17
+ import { useState } from 'react'
18
+ import { Button } from '@mantine/core'
19
+ import { ResourceExecuteDialog } from '@elevasis/ui/features/operations'
20
+ import { useNavigate } from '@tanstack/react-router'
21
+
22
+ const resource = {
23
+ resourceId: 'qualify-lead-workflow',
24
+ resourceType: 'workflow' as const,
25
+ name: 'Qualify Lead',
26
+ formSchema: {
27
+ fields: [
28
+ { name: 'email', label: 'Lead email', type: 'text', required: true },
29
+ { name: 'company', label: 'Company', type: 'text', required: false },
30
+ ],
31
+ },
32
+ }
33
+
34
+ export function QualifyLeadPage() {
35
+ const [opened, setOpened] = useState(false)
36
+ const navigate = useNavigate()
37
+
38
+ return (
39
+ <>
40
+ <Button onClick={() => setOpened(true)}>Run</Button>
41
+
42
+ <ResourceExecuteDialog
43
+ opened={opened}
44
+ onClose={() => setOpened(false)}
45
+ resource={resource}
46
+ onViewExecution={(executionId) =>
47
+ navigate({ to: '/logs/$executionId', params: { executionId } })
48
+ }
49
+ />
50
+ </>
51
+ )
52
+ }
53
+ ```
54
+
55
+ What the user sees when they click Run:
56
+
57
+ - A modal opens titled "Run workflow" with the resource ID displayed.
58
+ - The form renders one field per entry in `formSchema.fields`. Required fields show validation errors on submit.
59
+ - On submit, a loading overlay appears while the POST is in flight.
60
+ - On success, a teal confirmation card shows the execution ID. A "View execution" button calls `onViewExecution` with that ID.
61
+ - On error, a red alert shows the error message with a "Try again" option.
62
+
63
+ If `formSchema` is omitted or has no fields, the form skips to a single "Run" button with the message "This workflow takes no input."
64
+
65
+ ---
66
+
67
+ ## The Three-Tier API
68
+
69
+ | Tier | Component / Hook | Use case |
70
+ | --------------- | ------------------------------------------ | ----------------------------------------------------------------------------------------------- |
71
+ | Convenience | `ResourceExecuteDialog` | One-tag Run button + modal + form. Parent only manages `opened` state. |
72
+ | Controlled form | `ResourceExecuteForm` | Custom modal chrome; parent owns the mutation and decides where to show results. |
73
+ | Low-level | `ExecuteWorkflowModal` + `useExecuteAsync` | Fully custom rendering, non-standard modal behavior, or composing execution into a larger flow. |
74
+
75
+ Start with `ResourceExecuteDialog`. Move down the tiers only when you need something the convenience component cannot do.
76
+
77
+ ---
78
+
79
+ ## Controlled Usage with `ResourceExecuteForm`
80
+
81
+ Use `ResourceExecuteForm` when you want to own the modal or display the result somewhere outside the dialog -- for example, rendering the execution ID inline on the page after submission.
82
+
83
+ `ResourceExecuteForm` accepts `onSubmit` and `isPending` from the parent. The parent calls `useExecuteAsync()` directly and passes `mutateAsync` as the submit handler.
84
+
85
+ ```tsx
86
+ import { useState } from 'react'
87
+ import { Modal, Button, Text } from '@mantine/core'
88
+ import { ResourceExecuteForm } from '@elevasis/ui/features/operations'
89
+ import { useExecuteAsync } from '@elevasis/ui/hooks'
90
+
91
+ const formSchema = {
92
+ fields: [
93
+ { name: 'topic', label: 'Topic', type: 'text', required: true },
94
+ ],
95
+ }
96
+
97
+ export function CustomRunPanel() {
98
+ const [opened, setOpened] = useState(false)
99
+ const mutation = useExecuteAsync()
100
+
101
+ const handleSubmit = async (input: Record<string, unknown>) => {
102
+ await mutation.mutateAsync({
103
+ resourceId: 'research-agent',
104
+ resourceType: 'agent',
105
+ input,
106
+ })
107
+ }
108
+
109
+ return (
110
+ <>
111
+ <Button onClick={() => setOpened(true)}>Run agent</Button>
112
+
113
+ {mutation.data && (
114
+ <Text size="sm">Started: {mutation.data.executionId}</Text>
115
+ )}
116
+
117
+ <Modal opened={opened} onClose={() => setOpened(false)} title="Run research agent">
118
+ <ResourceExecuteForm
119
+ formSchema={formSchema}
120
+ onSubmit={handleSubmit}
121
+ isPending={mutation.isPending}
122
+ disabled={mutation.isPending}
123
+ submitLabel="Start research"
124
+ />
125
+ </Modal>
126
+ </>
127
+ )
128
+ }
129
+ ```
130
+
131
+ `ResourceExecuteForm` props:
132
+
133
+ | Prop | Type | Default | Notes |
134
+ | ------------- | ------------------------------------ | -------- | ------------------------------------ |
135
+ | `formSchema` | `SerializedExecutionFormSchema` | required | Drives field rendering |
136
+ | `onSubmit` | `(input) => void | Promise<void>` | required | Called with mapped field values |
137
+ | `isPending` | `boolean` | `false` | Shows loading state on submit button |
138
+ | `disabled` | `boolean` | `false` | Disables all fields and button |
139
+ | `submitLabel` | `string` | `'Run'` | Button label when not pending |
140
+
141
+ ---
142
+
143
+ ## Low-Level: Hooks and `ExecuteWorkflowModal`
144
+
145
+ For complete rendering control, use `useExecuteAsync` and `ExecuteWorkflowModal` independently. `ExecuteWorkflowModal` is a Mantine Modal pre-wired with a loading overlay, a success card (execution ID + "View execution" button), and an error alert. You pass `children` for the input area.
146
+
147
+ ```tsx
148
+ import { ExecuteWorkflowModal } from '@elevasis/ui/features/operations'
149
+ import { useExecuteAsync } from '@elevasis/ui/hooks'
150
+
151
+ const { mutateAsync, isPending, error, data, reset } = useExecuteAsync()
152
+
153
+ <ExecuteWorkflowModal
154
+ opened={opened}
155
+ onClose={() => setOpened(false)}
156
+ resource={{ resourceId: 'my-workflow', resourceType: 'workflow', name: 'My Workflow' }}
157
+ isPending={isPending}
158
+ error={error}
159
+ result={data ?? null}
160
+ onViewExecution={handleViewExecution}
161
+ onReset={reset}
162
+ >
163
+ {/* your custom form or content here */}
164
+ </ExecuteWorkflowModal>
165
+ ```
166
+
167
+ The modal locks close interactions (click-outside, Escape, close button) while `isPending` is true, preventing accidental dismissal mid-execution.
168
+
169
+ Source: `packages/ui/src/features/operations/executions/ExecuteWorkflowModal.tsx`, `packages/ui/src/hooks/executions/useExecuteAsync.ts`
170
+
171
+ ---
172
+
173
+ ## Zod-Validated Execution with `useExecuteWorkflow`
174
+
175
+ `useExecuteWorkflow` wraps `useExecuteAsync` with a Zod parse step before the POST. Use it when you are constructing input programmatically (not from a form) and want to catch schema mismatches before they reach the API.
176
+
177
+ ```tsx
178
+ import { z } from 'zod'
179
+ import { useExecuteWorkflow } from '@elevasis/ui/hooks'
180
+
181
+ const inputSchema = z.object({
182
+ email: z.string().email(),
183
+ score: z.number().min(0).max(100),
184
+ })
185
+
186
+ function useScoredExecution() {
187
+ return useExecuteWorkflow({ schema: inputSchema })
188
+ }
189
+
190
+ // In a component:
191
+ const { execute, isPending, data, error } = useScoredExecution()
192
+
193
+ await execute({
194
+ resourceId: 'score-lead-workflow',
195
+ resourceType: 'workflow',
196
+ input: { email: 'lead@example.com', score: 72 },
197
+ })
198
+ ```
199
+
200
+ If `input` fails the Zod parse, `execute` throws synchronously with the message `"Invalid workflow input: ..."` before making any network request. The `mutation` object on the return value is the underlying `useExecuteAsync` mutation, giving you full TanStack Query state if needed.
201
+
202
+ Prefer `useExecuteWorkflow` over raw `useExecuteAsync` when:
203
+
204
+ - Input is assembled from multiple sources (not a single form submit).
205
+ - You want TypeScript inference on the input shape via `z.infer`.
206
+ - You want a clear validation error message rather than a 400 from the API.
207
+
208
+ Source: `packages/ui/src/hooks/executions/useExecuteWorkflow.ts`
209
+
210
+ ---
211
+
212
+ ## Input Forms
213
+
214
+ `ResourceExecuteDialog` and `ResourceExecuteForm` auto-render form fields from `formSchema.fields`. Each field is a `SerializedFormField` with at minimum `name`, `label`, and `type`.
215
+
216
+ Supported field types:
217
+
218
+ - `text` -- single-line text input
219
+ - `textarea` -- multi-line text input
220
+ - `number` -- numeric input
221
+ - `select` -- dropdown with `options` array
222
+ - `checkbox` -- boolean toggle; defaults to `false`
223
+ - `radio` -- radio group with `options` array
224
+ - `richtext` -- rich text editor
225
+
226
+ Required fields (`required: true`) are validated on submit. Custom field-to-input-key remapping is supported via `formSchema.fieldMappings` -- a `Record<string, string>` that renames field values before they are passed to `onSubmit`.
227
+
228
+ If `formSchema` is undefined, an empty object, or has `fields: []`, the form skips rendering fields entirely and shows "This workflow takes no input." with a single Run button.
229
+
230
+ ---
231
+
232
+ ## Error and Result Handling
233
+
234
+ Mutation state flows automatically into the modal chrome when using `ResourceExecuteDialog` or `ExecuteWorkflowModal`:
235
+
236
+ - **Success** -- a teal alert card displays the execution ID from `result.executionId`. If `onViewExecution` is provided, a "View execution" button calls it with the ID. This is the recommended way to deep-link to the Execution Logs page.
237
+ - **Error** -- a red alert displays `error.message`. A "Try again" button calls `onReset`, which clears the mutation state and re-shows the form.
238
+ - **Pending** -- a blur overlay covers the form area while the POST is in flight. The modal cannot be dismissed during this state.
239
+
240
+ `useExecuteAsync` also invalidates the executions list query on success (keyed by `organizationId` + `resourceId`), so any `useExecutions` query on the page refreshes automatically.
241
+
242
+ ---
243
+
244
+ ## Related
245
+
246
+ - [REST API](api.mdx) -- trigger executions directly over HTTP, without React
247
+ - [Command Center](command-center.mdx) -- built-in managed UI; includes Run buttons for all deployed resources
248
+ - [Resource Patterns](../resources/patterns.mdx) -- HITL approval patterns and `approval.create()`
249
+ - [Platform Adapters](../platform-tools/adapters-platform.mdx) -- `approval.create()` reference
@@ -7,13 +7,23 @@
7
7
  import { defineOrganizationModel, defineResources } from '@elevasis/core/organization-model'
8
8
 
9
9
  // ---------------------------------------------------------------------------
10
- // Branding override
10
+ // Identity and branding override
11
11
  // ---------------------------------------------------------------------------
12
12
  export const brandingOverrideExample = defineOrganizationModel({
13
+ identity: {
14
+ organizationName: 'Northstar Studio',
15
+ productName: 'Northstar Ops',
16
+ shortName: 'Northstar'
17
+ },
13
18
  branding: {
14
- organizationName: 'Acme Corp',
15
- productName: 'Acme Command Center',
16
- shortName: 'Acme'
19
+ logos: {
20
+ light: '/brand/northstar-logo-light.svg',
21
+ dark: '/brand/northstar-logo-dark.svg'
22
+ },
23
+ voice: 'Clear, practical, and calm.',
24
+ tagline: 'Operational clarity for growing teams.',
25
+ values: ['Clarity', 'Reliability', 'Momentum'],
26
+ themePresetId: 'northstar'
17
27
  }
18
28
  })
19
29