@elevasis/sdk 1.44.0 → 1.44.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.
package/dist/cli.cjs
CHANGED
|
@@ -46253,7 +46253,7 @@ function wrapAction(commandName, fn) {
|
|
|
46253
46253
|
// package.json
|
|
46254
46254
|
var package_default = {
|
|
46255
46255
|
name: "@elevasis/sdk",
|
|
46256
|
-
version: "1.44.
|
|
46256
|
+
version: "1.44.1",
|
|
46257
46257
|
description: "SDK for building Elevasis organization resources",
|
|
46258
46258
|
type: "module",
|
|
46259
46259
|
bin: {
|
package/dist/test-utils/index.js
CHANGED
|
@@ -5442,10 +5442,15 @@ var DEFAULT_EXECUTION_TIMEOUT = 72e5;
|
|
|
5442
5442
|
|
|
5443
5443
|
// ../core/src/execution/engine/agent/memory/truncation.ts
|
|
5444
5444
|
var CLOSING_BRACKET_RESERVE = 32;
|
|
5445
|
-
|
|
5445
|
+
var DANGLING_KEY_WITH_COLON = /,?\s*"(?:[^"\\]|\\.)*"\s*:\s*$/;
|
|
5446
|
+
var DANGLING_KEY_NO_COLON = /([{,])\s*"(?:[^"\\]|\\.)*"\s*$/;
|
|
5447
|
+
function stripDanglingTail(text, innermostIsObject) {
|
|
5446
5448
|
let out = text.replace(/,\s*$/, "");
|
|
5447
|
-
|
|
5448
|
-
|
|
5449
|
+
if (DANGLING_KEY_WITH_COLON.test(out)) {
|
|
5450
|
+
out = out.replace(DANGLING_KEY_WITH_COLON, "").replace(/,\s*$/, "");
|
|
5451
|
+
} else if (innermostIsObject && DANGLING_KEY_NO_COLON.test(out)) {
|
|
5452
|
+
out = out.replace(DANGLING_KEY_NO_COLON, "$1").replace(/,\s*$/, "");
|
|
5453
|
+
}
|
|
5449
5454
|
return out;
|
|
5450
5455
|
}
|
|
5451
5456
|
function safeStructuralPrefix(raw, cutAt) {
|
|
@@ -5472,7 +5477,7 @@ function safeStructuralPrefix(raw, cutAt) {
|
|
|
5472
5477
|
}
|
|
5473
5478
|
}
|
|
5474
5479
|
const cutPoint = inString ? openStringStart : limit;
|
|
5475
|
-
const base = stripDanglingTail(raw.slice(0, cutPoint));
|
|
5480
|
+
const base = stripDanglingTail(raw.slice(0, cutPoint), stack[stack.length - 1] === "}");
|
|
5476
5481
|
return base + [...stack].reverse().join("");
|
|
5477
5482
|
}
|
|
5478
5483
|
function truncateContent(content, maxTokens) {
|
package/dist/worker/index.js
CHANGED
|
@@ -3534,10 +3534,15 @@ var DEFAULT_EXECUTION_TIMEOUT = 72e5;
|
|
|
3534
3534
|
|
|
3535
3535
|
// ../core/src/execution/engine/agent/memory/truncation.ts
|
|
3536
3536
|
var CLOSING_BRACKET_RESERVE = 32;
|
|
3537
|
-
|
|
3537
|
+
var DANGLING_KEY_WITH_COLON = /,?\s*"(?:[^"\\]|\\.)*"\s*:\s*$/;
|
|
3538
|
+
var DANGLING_KEY_NO_COLON = /([{,])\s*"(?:[^"\\]|\\.)*"\s*$/;
|
|
3539
|
+
function stripDanglingTail(text, innermostIsObject) {
|
|
3538
3540
|
let out = text.replace(/,\s*$/, "");
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
+
if (DANGLING_KEY_WITH_COLON.test(out)) {
|
|
3542
|
+
out = out.replace(DANGLING_KEY_WITH_COLON, "").replace(/,\s*$/, "");
|
|
3543
|
+
} else if (innermostIsObject && DANGLING_KEY_NO_COLON.test(out)) {
|
|
3544
|
+
out = out.replace(DANGLING_KEY_NO_COLON, "$1").replace(/,\s*$/, "");
|
|
3545
|
+
}
|
|
3541
3546
|
return out;
|
|
3542
3547
|
}
|
|
3543
3548
|
function safeStructuralPrefix(raw, cutAt) {
|
|
@@ -3564,7 +3569,7 @@ function safeStructuralPrefix(raw, cutAt) {
|
|
|
3564
3569
|
}
|
|
3565
3570
|
}
|
|
3566
3571
|
const cutPoint = inString ? openStringStart : limit;
|
|
3567
|
-
const base = stripDanglingTail(raw.slice(0, cutPoint));
|
|
3572
|
+
const base = stripDanglingTail(raw.slice(0, cutPoint), stack[stack.length - 1] === "}");
|
|
3568
3573
|
return base + [...stack].reverse().join("");
|
|
3569
3574
|
}
|
|
3570
3575
|
function truncateContent(content, maxTokens) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elevasis/sdk",
|
|
3
|
-
"version": "1.44.
|
|
3
|
+
"version": "1.44.1",
|
|
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.59.0",
|
|
62
62
|
"@repo/eslint-config": "0.0.0",
|
|
63
63
|
"@repo/typescript-config": "0.0.0"
|
|
64
64
|
},
|
package/reference/claude-config/sync-notes/2026-08-02-auth-guard-defaults-and-truncation-fix.md
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# Your auth guards now wait for organization context, and truncated tool results stay valid JSON
|
|
2
|
+
|
|
3
|
+
## Why this note exists
|
|
4
|
+
|
|
5
|
+
This train publishes all three packages at once — `@elevasis/core`, `@elevasis/ui`, and
|
|
6
|
+
`@elevasis/sdk`. Four of the changes are things you can observe without changing a line of your own
|
|
7
|
+
code, which is exactly why they are worth reading before you take the baseline bump.
|
|
8
|
+
|
|
9
|
+
**1. `ProtectedRoute` now waits for organization context by default.** This is the one behavior
|
|
10
|
+
change most likely to surprise you, because nothing in your project asked for it.
|
|
11
|
+
|
|
12
|
+
Until now the default value of `waitForOrganization` depended on which import path a route file
|
|
13
|
+
happened to use. Routes importing the guard from `@elevasis/ui/features/auth` defaulted to `false`
|
|
14
|
+
and rendered before organization context existed; routes importing from `@elevasis/ui/auth`
|
|
15
|
+
defaulted to `true` and waited. One application, two guard behaviors, decided by an import
|
|
16
|
+
specifier. Both defaults are now `true`, resolved through a single shared predicate.
|
|
17
|
+
|
|
18
|
+
We audited every template-family project before shipping this rather than assuming it was safe.
|
|
19
|
+
Between 8 and 9 routes per project are affected — `index.tsx`, `knowledge.tsx`, and every
|
|
20
|
+
`settings/*.tsx` — and **not one route in any project passes the prop explicitly**. Every affected
|
|
21
|
+
route is organization-scoped, so none of them has a legitimate reason to render before organization
|
|
22
|
+
context arrives. The measurable cost is that `settings/appearance.tsx` and `settings/account.tsx`
|
|
23
|
+
are user-scoped and will now wait marginally longer than they strictly need to. That is latency, not
|
|
24
|
+
breakage.
|
|
25
|
+
|
|
26
|
+
If you have a route that genuinely must render before organization context exists, pass
|
|
27
|
+
`waitForOrganization={false}` explicitly. Relying on the old default is no longer possible.
|
|
28
|
+
|
|
29
|
+
**2. Invited members who have not signed up yet are now visibly distinguished.** A previous train
|
|
30
|
+
made them _appear_ in your members list, which fixed wrong counts. It did not make them
|
|
31
|
+
_identifiable_ — the type shipped but the renderer did not, so every member looked equally
|
|
32
|
+
provisioned. `ProvisioningStateBadge` now ships inside `@elevasis/ui` and `OrgMembersList` renders it
|
|
33
|
+
beside the existing status badge, in the same cell rather than a new column. A fully-provisioned
|
|
34
|
+
member renders nothing, so nothing about your existing rows changes.
|
|
35
|
+
|
|
36
|
+
**3. Membership responses carry an explicit `workosMembershipId`, and `membership.id` is the platform
|
|
37
|
+
UUID.** The API used to be inconsistent about which identifier a membership response carried. It is
|
|
38
|
+
now uniform: `id` is always the platform's own UUID, and the WorkOS identifier has its own named
|
|
39
|
+
field. Both forms are accepted on lookup, so a request built either way still resolves.
|
|
40
|
+
|
|
41
|
+
**`organization.workos_org_id` is unchanged and still carries the WorkOS `org_…` value verbatim.**
|
|
42
|
+
That is the field your project selects organizations on and drives `switchToOrganization` with. It
|
|
43
|
+
was audited specifically because this change was in the same area; nothing about it moved.
|
|
44
|
+
|
|
45
|
+
**4. Four invitation API routes were removed** — `POST /api/invitations/accept`, and the
|
|
46
|
+
`GET /api/invitations`, `GET /api/invitations/:id`, `GET /api/invitations/summary` trio. All four
|
|
47
|
+
were dead surface with no caller in any project we could find. If you have an out-of-tree script
|
|
48
|
+
calling one, it will now 404.
|
|
49
|
+
|
|
50
|
+
**5. `@elevasis/sdk` fixes a JSON-safety defect in truncated tool results.** When a long tool result
|
|
51
|
+
was truncated, a cut landing between a key's closing quote and its colon left behind a key with no
|
|
52
|
+
value — `{"alpha":"…","nested"}` — which is not parseable JSON. Your agents read slightly malformed
|
|
53
|
+
JSON rather than crashing, because the parser falls back to the raw string, so the practical impact
|
|
54
|
+
was low. It is fixed regardless. The window was a few characters per key, which is why casual testing
|
|
55
|
+
never surfaced it.
|
|
56
|
+
|
|
57
|
+
## Applies to
|
|
58
|
+
|
|
59
|
+
- **Every template-family project**, for items 1 through 3. All are consumed through the published
|
|
60
|
+
packages with no source edits on your side.
|
|
61
|
+
- **Any project whose settings page renders `OrgMembersList`** — that is the published component,
|
|
62
|
+
so the badge arrives with the `@elevasis/ui` bump.
|
|
63
|
+
- **Every project running agents**, for item 5. The truncation fix lives in the worker runtime that
|
|
64
|
+
`operations/` bundles, so it reaches you through `@elevasis/sdk`.
|
|
65
|
+
- **Not applicable to your organization model, knowledge nodes, or workflow definitions.** Nothing in
|
|
66
|
+
this train touches authored content.
|
|
67
|
+
|
|
68
|
+
## Required actions
|
|
69
|
+
|
|
70
|
+
1. **Take the `@elevasis/core`, `@elevasis/ui`, and `@elevasis/sdk` baseline bumps** this train
|
|
71
|
+
propagates, then reinstall in `core/`, `ui/`, and `operations/`.
|
|
72
|
+
|
|
73
|
+
2. **Clear the Vite cache and restart your dev server.** A stale `.vite` cache serves the old bundle
|
|
74
|
+
while every gate reports green — that is the specific way this failure hides:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
rm -rf ui/node_modules/.vite
|
|
78
|
+
pnpm -C ui dev
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
3. **Redeploy `operations/` to pick up the truncation fix.** The baseline bump changes what your
|
|
82
|
+
next bundle contains; it does not change what is already deployed:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
pnpm -C operations exec elevasis-sdk deploy
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
4. **Check any route that must render before organization context exists.** If you have one, add
|
|
89
|
+
`waitForOrganization={false}` explicitly. If you are unsure whether you have one, the audit result
|
|
90
|
+
above says you almost certainly do not — every affected route in every project is
|
|
91
|
+
organization-scoped already.
|
|
92
|
+
|
|
93
|
+
## Verification
|
|
94
|
+
|
|
95
|
+
- **Sign in and land on your home route.** This is the check that matters most, because the guard
|
|
96
|
+
default changed on the route that greets you. Confirm it renders, and that navigating to
|
|
97
|
+
`settings/appearance` and `settings/account` still works — those are the two user-scoped pages that
|
|
98
|
+
now wait for organization context they do not strictly need.
|
|
99
|
+
- **Open your settings members page.** Any member you have invited who has not completed signup
|
|
100
|
+
should now carry a visible badge; fully-provisioned members should look exactly as before.
|
|
101
|
+
- **Read the installed bundle, not the version number.** A bumped pin and a green sync report are
|
|
102
|
+
claims about intent; the installed file is the only ground truth:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
grep -rl "ProvisioningStateBadge" ui/node_modules/@elevasis/ui/dist/components/
|
|
106
|
+
grep -c "innermostIsObject" operations/node_modules/@elevasis/sdk/dist/worker/index.js
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
No match on the first, or `0` on the second, means the install did not land regardless of what
|
|
110
|
+
`package.json` says.
|
|
111
|
+
|
|
112
|
+
## Not handled by /git-sync
|
|
113
|
+
|
|
114
|
+
- **The Vite cache clear and dev-server restart.** `/git-sync` propagates and commits the dependency
|
|
115
|
+
baseline. Your running dev server keeps serving the previously cached bundle until you do step 2
|
|
116
|
+
yourself, and it will look like the sync did nothing.
|
|
117
|
+
- **The `operations/` redeploy.** Bumping the `@elevasis/sdk` pin changes what your next bundle
|
|
118
|
+
contains. Your currently deployed workers keep running the old bundle until you deploy.
|
|
119
|
+
- **Adding `waitForOrganization={false}` to a route that needs it.** Nothing can detect that
|
|
120
|
+
automatically — only you know whether a route is legitimately pre-organization.
|
|
121
|
+
- **Replacing calls to the four removed invitation routes.** If an out-of-tree script calls one, the
|
|
122
|
+
sync cannot see it.
|