@brydio/manifest 0.1.0-alpha.57 → 0.1.0-alpha.59

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": "@brydio/manifest",
3
- "version": "0.1.0-alpha.57",
3
+ "version": "0.1.0-alpha.59",
4
4
  "description": "The shape of a Brydio app's manifest, its collections' schemas, and the checks that say what is wrong with one.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -10,7 +10,7 @@
10
10
  "url": "https://github.com/nakel-ola/brydio-sdk",
11
11
  "directory": "packages/manifest"
12
12
  },
13
- "gitHead": "0ce11b42dc51c1d6c9cd53dda9cffc2fbe0e73a2",
13
+ "gitHead": "3645964c21307d88950b196e4fd389ad82e6a286",
14
14
  "exports": {
15
15
  ".": {
16
16
  "types": "./src/index.d.ts",
package/src/grants.d.ts CHANGED
@@ -16,8 +16,10 @@
16
16
  * is a handler's `webhooks.send` (FO07); `timers` is a handler's
17
17
  * `timers.*`, running one of the app's own tools later (PJ01); `calendar`
18
18
  * is a handler's `calendar.*`, the caller's events on the event layer (CA02).
19
+ * `people` is a handler's native HR operations as the current caller; it does
20
+ * not broaden `directory` access or authorize private records by itself.
19
21
  */
20
- export declare const HOST_CAPABILITIES: readonly ["navigate", "message", "members", "projects", "files", "chats", "model", "secrets", "notify", "approvals", "chat", "directory", "webhooks", "timers", "calendar", "metrics", "sign", "finance"];
22
+ export declare const HOST_CAPABILITIES: readonly ["navigate", "message", "members", "projects", "files", "chats", "model", "secrets", "notify", "approvals", "chat", "directory", "webhooks", "timers", "calendar", "metrics", "sign", "finance", "people"];
21
23
  /** The older name for `HOST_CAPABILITIES`, kept for what already imports it. */
22
24
  export declare const KNOWN_HOST_GRANTS: readonly string[];
23
25
  /** True for a host grant Brydio knows how to honour: a named capability, or one connection. */
package/src/grants.js CHANGED
@@ -17,6 +17,8 @@ import { BUNDLE_MANIFEST } from "./bundle.js";
17
17
  * is a handler's `webhooks.send` (FO07); `timers` is a handler's
18
18
  * `timers.*`, running one of the app's own tools later (PJ01); `calendar`
19
19
  * is a handler's `calendar.*`, the caller's events on the event layer (CA02).
20
+ * `people` is a handler's native HR operations as the current caller; it does
21
+ * not broaden `directory` access or authorize private records by itself.
20
22
  */
21
23
  export const HOST_CAPABILITIES = [
22
24
  'navigate',
@@ -37,6 +39,7 @@ export const HOST_CAPABILITIES = [
37
39
  'metrics',
38
40
  'sign',
39
41
  'finance',
42
+ 'people',
40
43
  ];
41
44
  /** The older name for `HOST_CAPABILITIES`, kept for what already imports it. */
42
45
  export const KNOWN_HOST_GRANTS = HOST_CAPABILITIES;
package/src/schema.d.ts CHANGED
@@ -107,6 +107,7 @@ declare const extensionShape: {
107
107
  "workspace-sidebar": "workspace-sidebar";
108
108
  "public-page": "public-page";
109
109
  "chat-card": "chat-card";
110
+ "person-profile": "person-profile";
110
111
  }>;
111
112
  screen: z.ZodString;
112
113
  sizes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
@@ -256,7 +257,7 @@ export interface DataProblem {
256
257
  field?: string;
257
258
  message: string;
258
259
  }
259
- export type DataProblemCode = FieldTypeInvalid['code'] | OpenProblemCode | ConfirmProblemCode | AnonymousProblemCode | ReadersProblemCode | EditorsProblemCode | 'data_too_many_collections' | 'data_too_many_fields' | 'data_collection_name_format' | 'data_field_name_format' | 'data_field_reserved' | 'data_label_format' | 'data_label_taken' | 'data_project_field_twice' | 'data_search_unknown_field' | 'data_search_not_text' | 'grant_collection_missing' | 'grant_tool_missing' | 'custom_name_taken' | 'custom_collection_unknown' | 'custom_input_invalid' | 'placement_key_taken' | 'placement_screen_unknown' | 'placement_home_sizes' | 'placement_sizes_not_home' | 'placement_widget_sizes' | 'placement_tab_retired' | 'placement_public_shape' | 'placement_public_nothing' | 'placement_chat_card_shape' | 'grant_tool_cross_app_self' | 'placement_children_too_deep' | 'placement_create_tool_unknown' | 'placement_create_not_write' | 'secret_name_taken' | 'grant_secrets_missing' | 'instances_needs_sidebar';
260
+ export type DataProblemCode = FieldTypeInvalid['code'] | OpenProblemCode | ConfirmProblemCode | AnonymousProblemCode | ReadersProblemCode | EditorsProblemCode | 'data_too_many_collections' | 'data_too_many_fields' | 'data_collection_name_format' | 'data_field_name_format' | 'data_field_reserved' | 'data_label_format' | 'data_label_taken' | 'data_project_field_twice' | 'data_search_unknown_field' | 'data_search_not_text' | 'grant_collection_missing' | 'grant_tool_missing' | 'custom_name_taken' | 'custom_collection_unknown' | 'custom_input_invalid' | 'placement_key_taken' | 'placement_screen_unknown' | 'placement_home_sizes' | 'placement_sizes_not_home' | 'placement_widget_sizes' | 'placement_tab_retired' | 'placement_public_shape' | 'placement_public_nothing' | 'placement_chat_card_shape' | 'placement_person_profile_shape' | 'grant_tool_cross_app_self' | 'placement_children_too_deep' | 'placement_create_tool_unknown' | 'placement_create_not_write' | 'secret_name_taken' | 'grant_secrets_missing' | 'instances_needs_sidebar';
260
261
  type Additions = z.infer<z.ZodObject<typeof extensionShape>>;
261
262
  /**
262
263
  * Everything wrong with an app's additions that a type cannot say.
@@ -295,6 +296,7 @@ export declare const manifestExtensionsSchema: z.ZodObject<{
295
296
  "workspace-sidebar": "workspace-sidebar";
296
297
  "public-page": "public-page";
297
298
  "chat-card": "chat-card";
299
+ "person-profile": "person-profile";
298
300
  }>;
299
301
  screen: z.ZodString;
300
302
  sizes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
@@ -436,6 +438,7 @@ export declare const storedExtensionsSchema: z.ZodObject<{
436
438
  "workspace-sidebar": "workspace-sidebar";
437
439
  "public-page": "public-page";
438
440
  "chat-card": "chat-card";
441
+ "person-profile": "person-profile";
439
442
  }>;
440
443
  screen: z.ZodString;
441
444
  sizes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
@@ -612,6 +615,7 @@ export declare const appManifestSchema: z.ZodObject<{
612
615
  "workspace-sidebar": "workspace-sidebar";
613
616
  "public-page": "public-page";
614
617
  "chat-card": "chat-card";
618
+ "person-profile": "person-profile";
615
619
  }>;
616
620
  screen: z.ZodString;
617
621
  sizes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
@@ -792,6 +796,7 @@ export declare const newAppManifestSchema: z.ZodObject<{
792
796
  "workspace-sidebar": "workspace-sidebar";
793
797
  "public-page": "public-page";
794
798
  "chat-card": "chat-card";
799
+ "person-profile": "person-profile";
795
800
  }>;
796
801
  screen: z.ZodString;
797
802
  sizes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
package/src/schema.js CHANGED
@@ -77,8 +77,12 @@ const placementSchema = z.object({
77
77
  * a handler's `chat.post` (FO03). Nobody places it by hand, so it has no
78
78
  * `sizes`, `children` or `settings` (`placement_chat_card_shape`); its
79
79
  * screen sees `placement.kind === 'chat-card'` and the card's `route`.
80
+ * `person-profile`: a panel on every person's Directory profile, for
81
+ * viewers who can read the instance. Nobody places it by hand, so it has no
82
+ * `sizes`, `children` or `settings` (`placement_person_profile_shape`); its
83
+ * screen sees `placement.personId`, and reads only what the viewer may.
80
84
  */
81
- kind: z.enum(['project-tab', 'project-widget', 'project-sidebar', 'workspace-sidebar', 'home', 'public-page', 'chat-card']),
85
+ kind: z.enum(['project-tab', 'project-widget', 'project-sidebar', 'workspace-sidebar', 'home', 'public-page', 'chat-card', 'person-profile']),
82
86
  screen: z.string().min(1).max(FIELD_LIMITS.nameChars),
83
87
  /** For `home` and `project-widget` only, and required there: the sizes the screen draws well at. */
84
88
  sizes: z.array(z.enum(HOME_CARD_SIZES)).max(3).optional(),
@@ -491,6 +495,13 @@ export function dataProblems(additions, options = {}) {
491
495
  message: `The chat card "${placement.screen}" cannot have sizes, children or settings.`,
492
496
  });
493
497
  }
498
+ // A profile panel is drawn on every profile the viewer opens: nothing to size, configure or list.
499
+ if (placement.kind === 'person-profile' && (placement.sizes?.length || placement.children || placement.settings)) {
500
+ problems.push({
501
+ code: 'placement_person_profile_shape',
502
+ message: `The profile panel "${placement.screen}" cannot have sizes, children or settings.`,
503
+ });
504
+ }
494
505
  }
495
506
  // A public page with nothing public could show a visitor nothing at all.
496
507
  if ((additions.placements ?? []).some(placement => placement.kind === 'public-page')) {