@lotics/app-sdk 0.131.13 → 0.131.15

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/hooks.d.ts CHANGED
@@ -151,7 +151,7 @@ export interface MembersOptions {
151
151
  enabled?: boolean;
152
152
  }
153
153
  /**
154
- * The organization's members, for an assign picker. Member-only, and gated on
154
+ * The people of the app's workspace, for an assign picker. Member-only, and gated on
155
155
  * the app declaring a `member`-typed workflow input. `name` may be empty —
156
156
  * fall back to `email`.
157
157
  *
package/dist/index.js CHANGED
@@ -55,7 +55,7 @@ import {
55
55
  subtractDecimal,
56
56
  sumDecimal,
57
57
  urlParam
58
- } from "./chunk-OZ53XZNE.js";
58
+ } from "./chunk-VMPPIPWX.js";
59
59
 
60
60
  // src/mount.tsx
61
61
  import { createRoot } from "react-dom/client";
@@ -11502,6 +11502,9 @@ function useAgentRuns(sessionId, opts) {
11502
11502
  // src/queries.ts
11503
11503
  import { useCallback as useCallback5, useMemo as useMemo3, useState as useState3 } from "react";
11504
11504
 
11505
+ // ../shared/src/iam_helpers.ts
11506
+ var ORGANIZATION_ROLES = ["owner", "admin", "co_owner", "member"];
11507
+
11505
11508
  // ../shared/src/app_screen/cells.ts
11506
11509
  function opt(v) {
11507
11510
  if (typeof v === "string") return v || null;
@@ -11615,7 +11618,8 @@ function readMembers(value) {
11615
11618
  if ("groups" in obj) {
11616
11619
  m.groups = Array.isArray(obj.groups) ? obj.groups.filter((g) => typeof g === "string") : [];
11617
11620
  }
11618
- if (obj.role === "owner" || obj.role === "admin" || obj.role === "member") m.role = obj.role;
11621
+ const role = ORGANIZATION_ROLES.find((one) => one === obj.role);
11622
+ if (role !== void 0) m.role = role;
11619
11623
  if (typeof obj.joined === "string" && obj.joined !== "") m.joined = obj.joined;
11620
11624
  if (obj.archived === true) m.archived = true;
11621
11625
  out.push(m);
package/dist/router.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  setUrlParams,
6
6
  settleOpen,
7
7
  subscribeOpen
8
- } from "./chunk-OZ53XZNE.js";
8
+ } from "./chunk-VMPPIPWX.js";
9
9
 
10
10
  // src/router.tsx
11
11
  import { useEffect, useLayoutEffect, useRef } from "react";
@@ -261,7 +261,7 @@ export interface ResolvedMember {
261
261
  * The organization PERMISSION level, not a job title — "who is this person"
262
262
  * is `groups`. Raw: translate it yourself.
263
263
  */
264
- role?: "admin" | "member" | "owner";
264
+ role?: "admin" | "co_owner" | "member" | "owner";
265
265
  /** ISO timestamp of joining the organization. */
266
266
  joined?: string;
267
267
  /**
@@ -14,7 +14,7 @@ Every select and member value reaches the app in one of two shapes, and most scr
14
14
  | Populate a select picker, or color a stored value | `useFieldOptions(alias)` | Each select column's **complete** option list — `{ key, alias, label, color }` — plus `byKey` and `byAlias` indexes |
15
15
  | Filter a number each row reads in its own unit | `useFieldOptions(alias).units` | The units or currencies a range on it compares in — `{ vocabulary, options }` |
16
16
  | Render a stored member value | `readMembers(cell)` | The members the record actually holds |
17
- | Populate a member picker (assign UIs) | `useMembers(opts?)` | The org roster — every member, not only the referenced ones |
17
+ | Populate a member picker (assign UIs) | `useMembers(opts?)` | The workspace roster — every person of the app's workspace, not only the referenced ones |
18
18
 
19
19
  Cells are **self-describing**: the server rewrites raw storage shapes into resolved objects before
20
20
  rows reach the app, so an app never maintains a hardcoded key→label or id→name map. Catalogs are
@@ -159,9 +159,9 @@ projected `select_member` cell to `Array<{ id, name, email?, image?, groups?, ro
159
159
  Decode with **`readMembers(cell)`** (`dist/members.d.ts`) → `ResolvedMember[]`. Same defensive
160
160
  contract as `readSelect`: `[]` for null/empty/unexpected cells, malformed entries dropped.
161
161
 
162
- ## The org roster: `useMembers(opts?)`
162
+ ## The workspace roster: `useMembers(opts?)`
163
163
 
164
- The candidate set for an "assign to a member" picker (`dist/hooks.d.ts`):
164
+ The candidate set for an "assign to a member" picker (`dist/hooks.d.ts`): the people of the app's workspace, organization owners included. A stored member who is not among them still resolves in a cell (`readMembers`), not in this list.
165
165
 
166
166
  ```tsx
167
167
  const { members, loading, error } = useMembers({ group: GRP.fulfillment });
@@ -191,7 +191,7 @@ three gates are observable as an `error` on the hook:
191
191
  member declaration gets: *"This app has not declared member access — listing members requires a
192
192
  declared workflow `member` input or query `member` param."* Member access is a declared,
193
193
  auditable surface, like queries and workflows.
194
- 3. **Declared groups only.** `{ group }` restricts the roster to one member group — but
194
+ 3. **Declared groups only.** `{ group }` restricts the roster to the people of one member group who are in the app's workspace — but
195
195
  only a group declared on some member input's `group` property. An undeclared group errors; an
196
196
  app can only enumerate groups it actually assigns into. A declared group with no members
197
197
  resolves to `{ members: [] }`.
package/docs/security.md CHANGED
@@ -97,7 +97,7 @@ A publicly-shared app (its own origin, or its public link) is reachable by **any
97
97
  | File upload (workflow `file` inputs) | Yes — bounded to the app's workspace |
98
98
  | Query/workflow file outputs | Yes — file cells and workflow-produced files return direct presigned URLs (24-hour TTL) that anonymous viewers can fetch; see [files](./files.md) |
99
99
  | Agent runs (`useAgentRun`) | **No** — rejected: agent runs require an authenticated member, and each member's run history is private to them (a guessed session id cannot read another member's thread) |
100
- | Member roster (`useMembers`) | **No** — same-org members only (below) |
100
+ | Member roster (`useMembers`) | **No** — signed-in members of the app's organization only (below) |
101
101
 
102
102
  **Warning — `is_current_member` on a public app resolves to the app owner.** An anonymous request has no viewer to bind, so both `is_current_member` and `current_member in_any_group` fall back to the owner's identity and the owner's groups. A "my items" query shows every anonymous visitor the *owner's* items, and a manager-only read template gated on a group the owner belongs to **passes for every anonymous visitor**. Never rely on viewer-bound predicates in a public app.
103
103
 
@@ -105,7 +105,7 @@ A publicly-shared app (its own origin, or its public link) is reachable by **any
105
105
 
106
106
  ### Member roster access
107
107
 
108
- Listing members (`useMembers`) takes an authenticated member of the app's own org, a declared `member` input or param, and a group only where one is declared; in query results a member cell carries `email` only for that same-org member. The gates and their errors: [members_and_options](./members_and_options.md#access-gates-when-it-errors).
108
+ Listing members (`useMembers`) takes an authenticated member of the app's own org, a declared `member` input or param, and a group only where one is declared, and answers the people of the app's workspace (organization owners included); in query results a member cell carries `email` only for a viewer of that same org. The gates and their errors: [members_and_options](./members_and_options.md#access-gates-when-it-errors).
109
109
 
110
110
  ## What runtime refinement cannot widen
111
111
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lotics/app-sdk",
3
- "version": "0.131.13",
3
+ "version": "0.131.15",
4
4
  "description": "The SDK a Lotics custom-code app reads and writes through — typed hooks over the host bridge, cell readers, mount() and AppRouter",
5
5
  "type": "module",
6
6
  "exports": {
File without changes