@elevasis/sdk 1.41.1 → 1.43.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 +16 -75
- package/dist/index.d.ts +265 -140
- package/dist/index.js +15 -74
- package/dist/node/index.d.ts +262 -125
- package/dist/test-utils/index.d.ts +264 -129
- package/dist/test-utils/index.js +461 -917
- package/dist/types/worker/adapters/llm.d.ts +2 -4
- package/dist/worker/index.js +451 -907
- package/package.json +2 -2
- package/reference/claude-config/sync-notes/2026-07-28-agent-reply-is-its-own-field.md +84 -0
- package/reference/claude-config/sync-notes/2026-07-30-login-screen-and-member-provisioning-state.md +114 -0
- package/reference/sdk/platform-tools/index.mdx +5 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elevasis/sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.43.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.
|
|
61
|
+
"@repo/core": "0.58.0",
|
|
62
62
|
"@repo/typescript-config": "0.0.0",
|
|
63
63
|
"@repo/eslint-config": "0.0.0"
|
|
64
64
|
},
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# The agent's reply to the user is now its own field
|
|
2
|
+
|
|
3
|
+
## Why this note exists
|
|
4
|
+
|
|
5
|
+
**Your agents' user-facing text was being silently corrupted, and no layer could catch it.**
|
|
6
|
+
|
|
7
|
+
Measured across three 14-turn production sessions on 2026-07-28: 42 of 42 turns passed, and **20
|
|
8
|
+
corruption sites landed across 12 of the 42 replies — 28.6%**. The model emits a JSON escape
|
|
9
|
+
sequence for an em-dash and then completes it with the next letter of the sentence, so
|
|
10
|
+
`Hold on — red-line for me` becomes `Hold on \red-line for me`. That parses as valid JSON, satisfies
|
|
11
|
+
the response schema, and passes validation. There is no error state, no retry, and no provider-side
|
|
12
|
+
fix to wait for. The characters are simply gone from the stored transcript.
|
|
13
|
+
|
|
14
|
+
The cause is where the text sat in the schema, not the text itself. The reply used to be one variant
|
|
15
|
+
of an `anyOf` union nested inside the `nextActions` array. In the very same responses, the flat
|
|
16
|
+
top-level `reasoning` string carried **33 em-dashes with zero corruption** while the nested reply
|
|
17
|
+
text carried **59 em-dashes with 20 corruption sites** — and `reasoning` is the longer field.
|
|
18
|
+
|
|
19
|
+
The reply is now a flat top-level `message` property, declared beside `reasoning` rather than nested
|
|
20
|
+
inside the actions array. Re-measured over a fresh multi-turn session: **42 em-dashes, zero
|
|
21
|
+
corruption.**
|
|
22
|
+
|
|
23
|
+
**This supersedes the two-field description in `2026-07-27-agent-strict-output-and-turn-drift.md`.**
|
|
24
|
+
That note described the iteration response as `nextActions` then `reasoning`. It is now three
|
|
25
|
+
fields, in this order: `nextActions`, `message`, `reasoning`. The ordering rationale from that note
|
|
26
|
+
is unchanged and still holds — `reasoning` stays last so the actions and the reply are already on the
|
|
27
|
+
wire before any mid-response drift can start.
|
|
28
|
+
|
|
29
|
+
**`message` is required for session-capable agents.** This is not a detail you can ignore. When the
|
|
30
|
+
field shipped as optional, the model filled it **zero times in three turns** and those turns produced
|
|
31
|
+
no user-facing message at all. Under grammar-constrained sampling the model fills keys in declaration
|
|
32
|
+
order, so `nextActions` is chosen before the model has reasoned about the reply, `complete` is the
|
|
33
|
+
cheapest legal action, and a skippable `message` then gets skipped. Making it required costs nothing:
|
|
34
|
+
an empty or whitespace-only value is suppressed and produces no message bubble.
|
|
35
|
+
|
|
36
|
+
## Applies to
|
|
37
|
+
|
|
38
|
+
- **Every `sessionCapable: true` agent.** `message` is the only field the user sees, so this is the
|
|
39
|
+
field that was being damaged.
|
|
40
|
+
- **Agents on Anthropic models**, where the enforced-schema path is active. On the unenforced path
|
|
41
|
+
the platform still accepts a message delivered the old way, as an entry in the actions list, so
|
|
42
|
+
nothing breaks mid-transition.
|
|
43
|
+
- **Anything that reads stored assistant messages** — a transcript, an export, a summarizer, a
|
|
44
|
+
downstream workflow. Already-stored text is not repaired by this change; see below.
|
|
45
|
+
- **No agent definition changes are required.** You do not edit your agents. The shape lives in the
|
|
46
|
+
runtime your bundle carries.
|
|
47
|
+
|
|
48
|
+
## Required actions
|
|
49
|
+
|
|
50
|
+
1. **Take the `@elevasis/sdk` baseline bump** this train propagates, then reinstall in `operations/`
|
|
51
|
+
so the new worker bundle is present.
|
|
52
|
+
2. **Redeploy your operations bundle.** This is the step that actually closes the defect. The
|
|
53
|
+
response schema is emitted by the runtime inlined into your deployed bundle, so an existing
|
|
54
|
+
deployment keeps emitting the old nested shape — and keeps corrupting replies — until it is
|
|
55
|
+
redeployed:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
pnpm -C operations exec elevasis-sdk deploy --prod
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
A platform-side deploy does not fix this for you, and neither does the reinstall on its own.
|
|
62
|
+
|
|
63
|
+
3. **If you read or display stored assistant text, do not treat old records as clean.** Nothing is
|
|
64
|
+
rewritten retroactively. Transcripts written before your redeploy keep whatever corruption they
|
|
65
|
+
already have.
|
|
66
|
+
|
|
67
|
+
## Verification
|
|
68
|
+
|
|
69
|
+
- Run a session and prompt for a reply likely to contain an em-dash — asking the agent to summarize
|
|
70
|
+
something in a couple of sentences is usually enough. Confirm the reply arrives, and read it: the
|
|
71
|
+
signature failure is a missing letter immediately after where punctuation belonged
|
|
72
|
+
(`Hold on \red-line`), not a visible error.
|
|
73
|
+
- **Confirm every turn produced an assistant message at all.** A turn that completes with no message
|
|
74
|
+
is the symptom of a bundle that has the flat field but not the required flag — that combination
|
|
75
|
+
only exists in an unreleased build, but it is the one failure worth ruling out explicitly.
|
|
76
|
+
- Check the observability rows for an execution: iteration calls should still record the enforced
|
|
77
|
+
path with no fallback reasons. This change does not push the schema off it.
|
|
78
|
+
|
|
79
|
+
## Not handled by /git-sync
|
|
80
|
+
|
|
81
|
+
- **The redeploy.** `/git-sync` commits and pushes the propagated dependency baseline. The corruption
|
|
82
|
+
continues on your deployed agents until you run action 2 above.
|
|
83
|
+
- **Repairing existing transcripts.** No backfill is performed, and none is possible — the dropped
|
|
84
|
+
characters were never received.
|
package/reference/claude-config/sync-notes/2026-07-30-login-screen-and-member-provisioning-state.md
ADDED
|
@@ -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
|
-
| `
|
|
136
|
-
| `
|
|
137
|
-
| `
|
|
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
|
|