@elevasis/sdk 1.42.0 → 1.44.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elevasis/sdk",
3
- "version": "1.42.0",
3
+ "version": "1.44.0",
4
4
  "description": "SDK for building Elevasis organization resources",
5
5
  "type": "module",
6
6
  "bin": {
@@ -58,7 +58,7 @@
58
58
  "tsup": "^8.0.0",
59
59
  "typescript": "5.9.2",
60
60
  "zod": "^4.1.0",
61
- "@repo/core": "0.57.0",
61
+ "@repo/core": "0.58.0",
62
62
  "@repo/eslint-config": "0.0.0",
63
63
  "@repo/typescript-config": "0.0.0"
64
64
  },
@@ -0,0 +1,114 @@
1
+ # Your login route is now a stub, and pre-provisioned members become visible
2
+
3
+ ## Why this note exists
4
+
5
+ Two independent defects in this train, plus one change to what your `package.json` is required to
6
+ provide. All three reach you through the `@elevasis/ui` and `@elevasis/core` baseline bump.
7
+
8
+ **1. The login route's authentication logic moved into the package.** It used to exist five times —
9
+ once in Command Center and once in each of the four template-family projects — and all four tenant
10
+ copies were byte-identical, same 5,729 bytes, same hash. That duplication had a real cost: an
11
+ invited user who did not yet have an account was sent to the **sign-in** screen instead of the
12
+ **sign-up** screen and could never complete registration, and fixing it meant editing the same line
13
+ in five files. Any project that missed the propagation stayed broken silently.
14
+
15
+ `login.tsx` is now a thin route stub. It registers the path and passes your branding; everything
16
+ else — the invitation-token branch, the sign-up versus sign-in decision, the WorkOS `context`
17
+ branch, `returnTo` handling, and the authenticated-user redirect — lives in `LoginScreen`, exported
18
+ from `@elevasis/ui/features/auth` alongside `validateLoginSearch`.
19
+
20
+ The fix itself already reached you in a previous cycle. This train removes the duplication that
21
+ caused it, verified in a browser before shipping: an invitation token now lands on the WorkOS
22
+ `/invite` accept-invitation screen rather than the sign-in screen.
23
+
24
+ **The standing consequence, stated plainly: every future login change is now a package release.**
25
+ Auth-entry bugs are exactly the class you most want to hotfix quickly, and you can no longer do that
26
+ by editing your own file. The trade was made deliberately — five-way silent divergence was judged
27
+ the worse risk, since your updates already gate on sync regardless.
28
+
29
+ **2. Members who were invited but have not yet signed up were invisible on your settings page.**
30
+ The members list read WorkOS as the primary source, so a member who exists in the platform database
31
+ but has no WorkOS identity yet did not appear at all — your member count was wrong, not just your
32
+ detail view. `MembershipService.listMemberships` now reads the platform database as the primary set
33
+ and enriches from WorkOS where a link exists, and `MembershipWithDetails` gains an optional
34
+ `provisioningState` of `'linked' | 'pre_provisioned' | 'workos_only'`.
35
+
36
+ Correct counts reached you the moment the API deployed — that half was additive and server-side.
37
+ The published `OrgMembersList` renders the new distinction, so the column only appears after this
38
+ baseline bump.
39
+
40
+ **3. `@elevasis/ui` now declares two peer dependencies it previously required but did not name:**
41
+ `@workos-inc/authkit-react` and `@supabase/supabase-js`. This is a published-contract change, not a
42
+ new requirement — the package always needed both at runtime. `@supabase/supabase-js` in particular
43
+ had been shipping undeclared for a long time: it is reachable from roughly twenty published entry
44
+ points through a shared bundle chunk, including entry points whose own subpath never mentions
45
+ Supabase.
46
+
47
+ You almost certainly already have both installed, since the template has depended on them directly
48
+ for as long as it has had auth. Practical risk is low. What changes is that a project missing either
49
+ one now gets an honest peer warning at install time instead of a runtime failure with no
50
+ explanation.
51
+
52
+ ## Applies to
53
+
54
+ - **Every template-family project.** All four `login.tsx` copies are affected and all four are
55
+ currently identical, so this propagates cleanly unless you have edited yours.
56
+ - **Any project whose settings page renders `OrgMembersList`** — that is the published component,
57
+ not a local copy, so the new column arrives with the baseline bump.
58
+ - **Any project that invites members.** The invisible-member defect affected your own settings page,
59
+ not only platform admin.
60
+ - **Not applicable to your agents or operations bundle.** Nothing here touches the worker runtime,
61
+ and no redeploy of `operations/` is required.
62
+
63
+ ## Required actions
64
+
65
+ 1. **Take the `@elevasis/ui` and `@elevasis/core` baseline bump** this train propagates, then
66
+ reinstall in `ui/`.
67
+
68
+ 2. **Clear the Vite cache and restart your dev server.** This is not optional hygiene — a stale
69
+ `.vite` cache serves the _old_ bundle while every gate reports green, which is the specific way
70
+ this failure hides:
71
+
72
+ ```bash
73
+ rm -rf ui/node_modules/.vite
74
+ pnpm -C ui dev
75
+ ```
76
+
77
+ 3. **If you customized `login.tsx`, merge rather than accept.** The sync engine preserves a diverged
78
+ copy instead of overwriting it, which means a customized login route will silently keep its own
79
+ duplicated auth logic and miss future fixes. Port your customization onto the stub shape: the
80
+ branding values are props, and `appConfig={{ workosOrganizationId: __ELEVASIS_WORKOS_ORG_ID__ }}`
81
+ carries the org binding.
82
+
83
+ 4. **You may now drop the local `signUp` override in `ui/src/routes/__tests__/auth-routes.test.tsx`.**
84
+ The shared `mockUseAuth` in `@elevasis/ui/test-utils` gained `signUp`, so the local layer is
85
+ redundant. Leaving it in place is harmless — it just shadows an identical value.
86
+
87
+ ## Verification
88
+
89
+ - **Sign in normally.** This is the check that matters most, because the login route is the only
90
+ entry point to your application and it was rewritten. Confirm the logo and the Sign In button
91
+ render for a signed-out visitor, and that signing in lands you where you expect.
92
+ - **Visit `/login` while already signed in.** You should be redirected to `/`, and `/login?returnTo=/some-path`
93
+ should redirect to that path.
94
+ - **Open your settings members page** and confirm invited-but-not-yet-registered members appear.
95
+ Compare the count against the invitations you have actually sent — a member who has not signed up
96
+ yet should now be listed rather than missing.
97
+ - **Read the installed bundle, not the version number.** A bumped pin and a green sync report are
98
+ claims about intent; the installed file is the only ground truth:
99
+
100
+ ```bash
101
+ grep -rl "LoginScreen" ui/node_modules/@elevasis/ui/dist/features/auth/
102
+ ```
103
+
104
+ No match means the install did not actually land, regardless of what `package.json` says.
105
+
106
+ ## Not handled by /git-sync
107
+
108
+ - **The Vite cache clear and dev-server restart.** `/git-sync` propagates and commits the dependency
109
+ baseline. Your running dev server keeps serving the previously cached bundle until you do step 2
110
+ yourself, and it will look like the sync did nothing.
111
+ - **Merging a customized `login.tsx`.** If your copy has diverged, the engine deliberately preserves
112
+ it and does not merge for you. That file will keep its old duplicated auth logic until you port it
113
+ by hand.
114
+ - **Removing the redundant `signUp` test override.** Cosmetic, and left to you.
@@ -130,12 +130,11 @@ Call any supported LLM from your workflow with no API keys required. Keys are re
130
130
 
131
131
  **Supported models:**
132
132
 
133
- | Provider | Models |
134
- | ------------ | --------------------------------------------------------- |
135
- | `google` | `gemini-3-flash-preview`, `gemini-3.1-flash-lite-preview` |
136
- | `openai` | `gpt-5`, `gpt-5.4-mini`, `gpt-5.4-nano` |
137
- | `anthropic` | `claude-sonnet-5` |
138
- | `openrouter` | `openrouter/z-ai/glm-5` |
133
+ | Provider | Models |
134
+ | ------------ | --------------------------------------- |
135
+ | `openai` | `gpt-5`, `gpt-5.4-mini`, `gpt-5.4-nano` |
136
+ | `anthropic` | `claude-sonnet-5` |
137
+ | `openrouter` | `openrouter/z-ai/glm-5` |
139
138
 
140
139
  **Key params:** `provider`, `model`, `messages` (`{ role, content }[]`), `responseSchema` (optional JSON Schema), `temperature` (optional).
141
140
 
@@ -271,28 +271,63 @@ Agents are autonomous resources that use an LLM and tools to complete a goal. Yo
271
271
 
272
272
  **Note:** Use `elevasis-sdk exec --async` when executing agents. Agents can run for minutes or longer, and the synchronous execute endpoint will time out for long-running runs. The `--async` flag returns an execution ID immediately and polls for the result.
273
273
 
274
+ There is no separate `agentConfig` object — agent-specific fields (`kind`, `systemPrompt`, `constraints`, `sessionCapable`, `securityLevel`, `memoryPreferences`) live directly on `config`, alongside the same identity fields a `WorkflowDefinition` uses. `modelConfig` is a sibling of `config`, not nested inside it. `kind` and `contract` are both required.
275
+
276
+ This example is a minimal single-shot (non-session) agent: one question in, one structured answer out. It is type-checked against the published `@elevasis/sdk` on every `pnpm check:docs-snippets` run — see `operations/src/example/example-agent.ts` in a scaffolded project for the working, OM-descriptor-bound copy (`resourceId` there derives from the OM Resource descriptor, same as the workflow example above; this version inlines the id directly to keep the snippet self-contained).
277
+
278
+ {/* doc-snippet:start:agent-definition-example */}
279
+
274
280
  ```typescript
275
281
  import type { AgentDefinition } from '@elevasis/sdk';
276
- import { resourceDescriptors } from '@core/config/organization-model';
282
+ import { z } from 'zod';
283
+
284
+ const inputSchema = z.object({
285
+ question: z.string().min(1),
286
+ });
287
+ const outputSchema = z.object({
288
+ answer: z.string(),
289
+ confidence: z.enum(['high', 'medium', 'low']),
290
+ });
277
291
 
278
292
  const myAgent: AgentDefinition = {
279
293
  config: {
280
- resource: resourceDescriptors.myAgent,
281
- resourceId: resourceDescriptors.myAgent.id,
282
- name: 'my-agent',
283
- type: resourceDescriptors.myAgent.kind,
284
- description: 'Answers questions using platform tools',
294
+ resourceId: 'my-agent',
295
+ name: 'My Agent',
296
+ description: 'Answers a single question with a structured, confidence-rated response.',
297
+ type: 'agent',
298
+ kind: 'utility',
299
+ version: '1.0.0',
285
300
  status: 'dev',
301
+ systemPrompt:
302
+ 'You answer a single question directly and concisely. State your confidence honestly.',
286
303
  },
287
- agentConfig: {
288
- model: { provider: 'openai', model: 'gpt-5' },
289
- systemPrompt: 'You are a helpful assistant.',
290
- maxIterations: 10,
291
- },
304
+ contract: { inputSchema, outputSchema },
292
305
  tools: [],
306
+ modelConfig: {
307
+ provider: 'anthropic',
308
+ model: 'claude-sonnet-5',
309
+ apiKey: process.env.ANTHROPIC_API_KEY ?? '',
310
+ },
293
311
  };
294
312
  ```
295
313
 
314
+ {/* doc-snippet:end:agent-definition-example */}
315
+
316
+ ### config (agent-specific fields)
317
+
318
+ | Field | Type | Description |
319
+ | ------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
320
+ | `kind` | `'orchestrator' | 'specialist' | 'utility' | 'platform'` | Required. What role this agent plays — not enforced at runtime today, but tenant-authored and validated at deploy against your OM resource descriptor's own `kind`. |
321
+ | `systemPrompt` | `string` | Required. The agent's base system prompt. |
322
+ | `constraints` | `{ maxIterations?, timeout?, maxSessionMemoryKeys?, maxMemoryTokens? }` (optional) | Iteration budget, execution timeout in ms, and session-memory limits. |
323
+ | `sessionCapable` | `boolean` (optional) | Opt in to multi-turn sessions. Defaults to `false` — the shape used in the example above, which completes and returns `contract.outputSchema` in a single turn. |
324
+ | `securityLevel` | `'standard' | 'hardened' | 'none'` (optional) | Prompt-hardening tier. Auto-derived from `sessionCapable` when omitted (`true` → `'hardened'`, `false` → `'standard'`). Never set `'none'` on a session-capable agent. |
325
+ | `memoryPreferences` | `string` (optional) | Guidance injected into the system prompt when session memory management is enabled. |
326
+
327
+ ### contract (agent)
328
+
329
+ `contract.inputSchema` is required, same as a workflow. `contract.outputSchema` is what a **non-session** (single-shot) agent like the example above returns — there is no conversational reply to read a structured answer from otherwise. A `sessionCapable: true` agent typically omits `outputSchema` and speaks through its conversational `message` instead.
330
+
296
331
  ---
297
332
 
298
333
  ## DeploymentSpec
@@ -59,20 +59,20 @@ config: {
59
59
 
60
60
  ## Execution Types
61
61
 
62
- | Type | Description |
63
- | -------------------- | ------------------------------------------------------------------------------ |
64
- | `WorkflowDefinition` | Complete workflow definition including config, contract, steps, and entryPoint |
65
- | `WorkflowStep` | Individual step definition with type, handler, and next routing |
66
- | `WorkflowConfig` | Metadata block: name, description, status, links, category |
67
- | `StepHandler` | Function type: `(input: unknown, context: StepContext) => Promise<unknown>` |
68
- | `NextConfig` | Union of `LinearNext` and `ConditionalNext` |
69
- | `LinearNext` | Fixed next step routing |
70
- | `ConditionalNext` | Branching step routing |
71
- | `StepType` | Runtime enum for step routing |
72
- | `AgentDefinition` | Complete agent definition including config, agentConfig, and tools |
73
- | `ExecutionContext` | Runtime context passed to step handlers |
74
- | `ExecutionMetadata` | Metadata about a running execution |
75
- | `ExecutionInterface` | Interface for triggering and inspecting executions |
62
+ | Type | Description |
63
+ | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
64
+ | `WorkflowDefinition` | Complete workflow definition including config, contract, steps, and entryPoint |
65
+ | `WorkflowStep` | Individual step definition with type, handler, and next routing |
66
+ | `WorkflowConfig` | Metadata block: name, description, status, links, category |
67
+ | `StepHandler` | Function type: `(input: unknown, context: StepContext) => Promise<unknown>` |
68
+ | `NextConfig` | Union of `LinearNext` and `ConditionalNext` |
69
+ | `LinearNext` | Fixed next step routing |
70
+ | `ConditionalNext` | Branching step routing |
71
+ | `StepType` | Runtime enum for step routing |
72
+ | `AgentDefinition` | Complete agent definition: `config` (agent-specific fields live here directly, not in a separate `agentConfig`), `contract`, `tools`, and `modelConfig` |
73
+ | `ExecutionContext` | Runtime context passed to step handlers |
74
+ | `ExecutionMetadata` | Metadata about a running execution |
75
+ | `ExecutionInterface` | Interface for triggering and inspecting executions |
76
76
 
77
77
  ## ElevasConfig
78
78