@crossworks/client-types 0.232.380 → 0.232.384

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crossworks/client-types",
3
- "version": "0.232.380",
3
+ "version": "0.232.384",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Who runs a mini app (app identity, 2026-10-02): what `host.me()` answers
3
+ * inside the app, and what the server fills into the reserved SQL parameters
4
+ * `:host_me_id`, `:host_me_name` and `:host_me_kind`. Docs:
5
+ * docs/app-authoring-guide.md, "Who is running the app".
6
+ *
7
+ * There is no email field, by design: an app is code the admin may not have
8
+ * written. `id` is a per-app pseudonym (the same person has a different id in
9
+ * every app), so an app cannot join a person across apps.
10
+ */
11
+
12
+ /** The kind of viewer: the owner or an admin login, a member login, a client
13
+ * login, a Contact share's contact, or an open /s link (no person). */
14
+ export type AppViewerKind = 'admin' | 'member' | 'client' | 'contact' | 'public';
15
+
16
+ export type AppViewer = {
17
+ /** Stable for this person inside this app only; null on an open link. */
18
+ id: string | null;
19
+ /** The display name, for display; null when none is set, and on an open
20
+ * link. Never use it for permission logic. */
21
+ name: string | null;
22
+ kind: AppViewerKind;
23
+ };
24
+
25
+ /** The viewer on an open /s link: nobody in particular. */
26
+ export const PUBLIC_APP_VIEWER: AppViewer = Object.freeze({
27
+ id: null,
28
+ name: null,
29
+ kind: 'public',
30
+ }) as AppViewer;
31
+
32
+ /** Every SQL parameter name with this prefix (any case, after the `:`, `@` or
33
+ * `$`) is the server's: an app may use the three below in its SQL, and a
34
+ * value the browser sends for any such name is refused. */
35
+ export const APP_VIEWER_PARAM_PREFIX = 'host_me_';
36
+
37
+ /** The reserved parameter names (without the prefix character) and the
38
+ * AppViewer field each one is filled from. */
39
+ export const APP_VIEWER_PARAMS = {
40
+ host_me_id: 'id',
41
+ host_me_name: 'name',
42
+ host_me_kind: 'kind',
43
+ } as const satisfies Record<string, keyof AppViewer>;
@@ -9,6 +9,8 @@
9
9
  * public surface is byte-identical — only the file a symbol lives in moved.
10
10
  */
11
11
 
12
+ import type { AccessLevel } from './access';
13
+
12
14
  // ── Skills ────────────────────────────────────────────────────────────────────
13
15
 
14
16
  /** A skill as returned by `GET /api/skills`. */
@@ -191,6 +193,11 @@ export interface ToolGroupDTO {
191
193
  /** Set when the group is an API integration; null for capability-only bundles. */
192
194
  integration: ToolGroupIntegrationDTO | null;
193
195
  enabled: boolean;
196
+ /** The group's level: an agent or a team app may hold it only at or above
197
+ * it, and team apps call only tools in an enabled group at team level or
198
+ * below. Absent from servers before it shipped. Set it with
199
+ * `PATCH /api/access/tool-groups/:slug { audience }`. */
200
+ audience?: AccessLevel;
194
201
  createdAt: string;
195
202
  updatedAt: string;
196
203
  }
package/src/index.ts CHANGED
@@ -178,6 +178,10 @@ export type {
178
178
  AppTint,
179
179
  } from './app-nav';
180
180
 
181
+ // Types only at the root; the runtime constants (the reserved parameter names)
182
+ // are the `@mantle/client-types/app-viewer` subpath.
183
+ export type { AppViewer, AppViewerKind } from './app-viewer';
184
+
181
185
  // Types only at the root; the runtime constants (kinds, specs, limits) are the
182
186
  // `@mantle/client-types/tree` subpath.
183
187
  export type {