@jskit-ai/agent-docs 0.1.344 → 0.1.345

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 (36) hide show
  1. package/guide/agent/app-extras/realtime.md +31 -6
  2. package/guide/agent/app-setup/authentication.md +34 -2
  3. package/guide/agent/app-setup/initial-scaffolding.md +14 -3
  4. package/guide/agent/app-setup/more-than-one-server.md +4 -5
  5. package/guide/agent/app-setup/multi-homing.md +91 -8
  6. package/package.json +1 -1
  7. package/patterns/feature-package/example/booking-engine/package.json +1 -1
  8. package/patterns/minimal-foundation/example/package.json +3 -3
  9. package/patterns/shell-foundation/example/package.json +4 -4
  10. package/patterns/shell-foundation/example/packages/main/package.json +1 -1
  11. package/reference/autogen/PATTERN_INDEX.md +38 -38
  12. package/reference/autogen/packages/auth-provider-local-core.md +3 -3
  13. package/reference/autogen/packages/auth-provider-local-db-core.md +4 -0
  14. package/reference/autogen/packages/auth-web.md +13 -1
  15. package/reference/autogen/packages/kernel.md +1 -0
  16. package/reference/autogen/packages/realtime.md +1 -0
  17. package/reference/autogen/packages/workspaces-core.md +23 -8
  18. package/reference/autogen/packages/workspaces-web.md +13 -0
  19. package/skills/jskit/references/multi-homing.md +91 -8
  20. package/skills/jskit/references/pattern-index.md +38 -38
  21. package/skills/jskit/references/patterns/app/minimal-foundation/example/package.json +3 -3
  22. package/skills/jskit/references/patterns/app/shell-foundation/example/package.json +4 -4
  23. package/skills/jskit/references/patterns/app/shell-foundation/example/packages/main/package.json +1 -1
  24. package/skills/jskit/references/patterns/auth/accounts-hub/example/package.json +3 -3
  25. package/skills/jskit/references/patterns/auth/oidc-sign-in/example/package.json +2 -2
  26. package/skills/jskit/references/patterns/auth/supabase-auth/example/package.json +1 -1
  27. package/skills/jskit/references/patterns/connectors/calendar-cli/example/package.json +5 -5
  28. package/skills/jskit/references/patterns/crud/crud-feature-package/example/packages/books/package.json +3 -3
  29. package/skills/jskit/references/patterns/database/mysql-application/example/package.json +2 -2
  30. package/skills/jskit/references/patterns/database/postgres-application/example/package.json +2 -2
  31. package/skills/jskit/references/patterns/realtime/realtime-application/PATTERN.md +2 -0
  32. package/skills/jskit/references/patterns/realtime/realtime-application/example/package.json +2 -2
  33. package/skills/jskit/references/patterns/server/feature-package/example/booking-engine/package.json +1 -1
  34. package/skills/jskit/references/patterns/users/user-administration-server/example/packages/users/package.json +3 -3
  35. package/skills/jskit/references/patterns/users/user-administration-server/example/packages/users-workspace/package.json +6 -6
  36. package/skills/jskit/references/patterns/workspaces/workspace-server/PATTERN.md +26 -6
@@ -34,6 +34,8 @@ staging or production needs a Redis backplane.
34
34
  - Event payloads do not become an undocumented second API.
35
35
  - Socket.IO owns `/socket.io`; other WebSocket routes keep their own upgrade
36
36
  and access-check lifecycle without Socket.IO's one-second cleanup timeout.
37
+ - Realtime connects over WebSocket only, so no address carries its session id;
38
+ whatever runs in front of the app passes WebSocket upgrades on `/socket.io`.
37
39
 
38
40
  ## Framework APIs
39
41
 
@@ -2,7 +2,7 @@
2
2
  "private": true,
3
3
  "type": "module",
4
4
  "dependencies": {
5
- "@jskit-ai/realtime": "0.2.49",
6
- "@jskit-ai/shell-web": "0.2.46"
5
+ "@jskit-ai/realtime": "0.2.50",
6
+ "@jskit-ai/shell-web": "0.2.47"
7
7
  }
8
8
  }
@@ -5,7 +5,7 @@
5
5
  "private": true,
6
6
  "type": "module",
7
7
  "dependencies": {
8
- "@jskit-ai/kernel": "0.2.30",
8
+ "@jskit-ai/kernel": "0.2.31",
9
9
  "json-rest-schema": "^1.0.20"
10
10
  },
11
11
  "exports": {
@@ -10,9 +10,9 @@
10
10
  "./shared": "./src/shared/index.js"
11
11
  },
12
12
  "dependencies": {
13
- "@jskit-ai/crud-core": "0.2.48",
14
- "@jskit-ai/resource-crud-core": "0.1.223",
15
- "@jskit-ai/users-core": "0.2.58"
13
+ "@jskit-ai/crud-core": "0.2.49",
14
+ "@jskit-ai/resource-crud-core": "0.1.224",
15
+ "@jskit-ai/users-core": "0.2.59"
16
16
  },
17
17
  "jskit": {
18
18
  "kind": "runtime",
@@ -10,14 +10,14 @@
10
10
  "./shared": "./src/shared/index.js"
11
11
  },
12
12
  "dependencies": {
13
- "@jskit-ai/crud-core": "0.2.48",
14
- "@jskit-ai/resource-crud-core": "0.1.223",
15
- "@jskit-ai/users-core": "0.2.58",
16
- "@jskit-ai/workspaces-core": "0.2.58"
13
+ "@jskit-ai/crud-core": "0.2.49",
14
+ "@jskit-ai/resource-crud-core": "0.1.224",
15
+ "@jskit-ai/users-core": "0.2.59",
16
+ "@jskit-ai/workspaces-core": "0.2.59"
17
17
  },
18
18
  "peerDependencies": {
19
- "@jskit-ai/kernel": "0.2.30",
20
- "@jskit-ai/resource-runtime": "0.2.44"
19
+ "@jskit-ai/kernel": "0.2.31",
20
+ "@jskit-ai/resource-runtime": "0.2.45"
21
21
  },
22
22
  "jskit": {
23
23
  "kind": "runtime",
@@ -24,11 +24,21 @@ Choose workspace creation policy, roles, invitation policy, expiry, email copy,
24
24
  member permissions, personal-workspace behavior, and surface access rules.
25
25
 
26
26
  In `workspaces` mode, `tenancyPolicy.workspace.autoProvision: true` gives every
27
- user a personal workspace in addition to shared ones; the optional
27
+ user a personal workspace in addition to shared ones, and `"unless-member"` only
28
+ to someone in no workspace who signs in without an invitation; the optional
28
29
  `workspaces.personal-workspace-name` capability, a function of the user, names it. `workspaceSettings.defaults` sets
29
- `invitesEnabled` and the colours (`lightPrimaryColor`, `darkPrimaryColor` and
30
+ `invitesEnabled`, `invitesRequireSameEmail` and the colours (`lightPrimaryColor`, `darkPrimaryColor` and
30
31
  the other palette fields) that new workspaces start with.
31
32
 
33
+ Decide who may accept an invitation: by default only the invited address.
34
+ `workspaceInvitations.anyAccount: true` lets any signed-in account holding the
35
+ link join after confirming (`acceptAs`, else 409
36
+ `workspaces.invite.differentEmailUnconfirmed`), except in a workspace whose
37
+ `invitesRequireSameEmail` setting is on (403 `workspaces.invite.emailMismatchUser`).
38
+ Members then show `invitedEmail`, the address they were invited at, and the
39
+ mailer's optional `sendInviteAcceptedByOtherAddress` tells the inviter after
40
+ commit.
41
+
32
42
  ## Framework APIs
33
43
 
34
44
  Use workspace routes, resources, scope helpers, tenancy profiles, and settings
@@ -84,7 +94,7 @@ catalogue entries. Updating labels requires no database migration.
84
94
  Provide one function as the optional `workspaces.invite-acceptance-participant`
85
95
  capability, from a small application feature that requires only what its writes
86
96
  need (it cannot require `workspaces.core`, which receives it). The built-in
87
- `workspace.invite.redeem` action invokes `fn({ invite, user }, txOptions)`
97
+ `workspace.invite.redeem` action invokes `fn({ invite, user, workspace }, txOptions)`
88
98
  after validating the recipient, state and expiry and activating membership in the
89
99
  uncommitted transaction. Pass `txOptions` to every application owner's calls and
90
100
  propagate failures. JSKIT marks accepted and commits after the function succeeds. Keep
@@ -124,7 +134,8 @@ transactional creation; put related acceptance writes in the participant. Revoca
124
134
  a managed transaction. Raw Knex/savepoint transactions cannot own resource
125
135
  writes. Invitation mutations lock workspace then invitation rows, revalidate
126
136
  current state and reject changes to accepted/revoked invitations. Expiry rejection
127
- for the matching recipient commits revocation before returning 409. Preserve transaction
137
+ commits the invitation as `expired` before returning 409, and it stays `expired`
138
+ (`revoked` is only a workspace's withdrawal). Preserve transaction
128
139
  outcomes and causes; a completion-hook error after commit cannot undo writes.
129
140
 
130
141
  See the human guide's **Workspace tenancy → Transactional invitation
@@ -169,7 +180,14 @@ setup({ env }) {
169
180
 
170
181
  Without a renderer, workspaces-core uses its built-in email; without a mailer,
171
182
  invitations are created and their delivery reports `mailer_unconfigured`. The
172
- feature must not require `workspaces.core`, which receives both.
183
+ feature must not require `workspaces.core`, which receives both. A mailer may
184
+ also have `sendInviteAcceptedByOtherAddress(notice, options)`, which tells the
185
+ inviter, after the acceptance commits, that another address accepted their
186
+ invitation; a failure is logged and never undoes the acceptance.
187
+
188
+ `services.directory.deleteWorkspace(workspaceId, options)` deletes a workspace in
189
+ the caller's transaction (cascading its memberships, settings and invitations),
190
+ answers `false` for a missing one, publishes no event and checks no permission.
173
191
 
174
192
  ## Variation points
175
193
 
@@ -179,7 +197,9 @@ ids, and product-specific workspace settings.
179
197
  ## Verification
180
198
 
181
199
  Test create/list/select, member and non-member access, each role boundary,
182
- invitation expiry/redemption, cross-workspace isolation, and email output.
200
+ invitation expiry/redemption, acceptance by another address where `anyAccount`
201
+ is on (confirmed, unconfirmed and in a workspace requiring the invited address),
202
+ cross-workspace isolation, and email output.
183
203
 
184
204
  ## Avoid
185
205