@agent-native/core 0.66.1 → 0.66.3

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.
@@ -61,9 +61,20 @@ Organizations are **framework-managed**, not handled by Better Auth's organizati
61
61
 
62
62
  The active org flows automatically: `session.orgId` — resolved by `getOrgContext` from `org_members` plus the user's `active-org-id` setting (_not_ from a Better Auth session field) — → `AGENT_ORG_ID` → SQL scoping (see `security` skill).
63
63
 
64
- **If your template requires an org to function** (data is scoped by `organization_id`, core features can't run without one), set `AUTO_CREATE_DEFAULT_ORG=1` in your `.env`. The framework will auto-create a default org (named after the user) on first login when no memberships exist. This happens inside `getOrgContext` — no template integration needed.
65
-
66
- As a safety net, also wrap your app shell in `<RequireActiveOrg>` from `@agent-native/core/client/org`. It blocks the wrapped area with a "Create your organization" pane (and accept-invite CTAs for pending invitations) if auto-create failed or the account predates it. Place it **inside** the agent sidebar so the setup checklist, chat, and CLI stay usable during setup.
64
+ When an authenticated user has no org memberships, the framework auto-creates a
65
+ default org (named after the user) the first time `getOrgContext` runs. This
66
+ keeps org-scoped templates from showing a manual "create organization" step.
67
+ The auto-create path skips users with pending invites or a matching
68
+ `allowed_domain` org so they can join the intended team instead. Set
69
+ `AUTO_CREATE_DEFAULT_ORG=0` only for deployments that intentionally want manual
70
+ org creation.
71
+
72
+ Do not wrap normal app shells in `<RequireActiveOrg>` just to force setup. Use
73
+ non-blocking org UI such as `InvitationBanner`, `OrgSwitcher`, and a `/team`
74
+ route so users can accept invites, join domain-matched teams, or switch orgs
75
+ without blocking the primary product experience. Place org UI inside the agent
76
+ sidebar so the setup
77
+ checklist, chat, and CLI stay usable during setup.
67
78
 
68
79
  ## A2A Identity
69
80