@korso/shepherd-ui 0.3.1 → 0.5.0

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 (38) hide show
  1. package/LICENSE +661 -0
  2. package/dist/ShepherdRoot.js +13 -12
  3. package/dist/client.d.ts +6 -0
  4. package/dist/client.js +14 -0
  5. package/dist/components/Dashboard.d.ts +7 -1
  6. package/dist/components/Dashboard.js +2 -2
  7. package/dist/config/ConfigPanel.d.ts +14 -0
  8. package/dist/config/ConfigPanel.js +16 -0
  9. package/dist/config/ConnectAgent.d.ts +1 -2
  10. package/dist/config/ConnectAgent.js +6 -12
  11. package/dist/config/GeneralSettings.d.ts +8 -0
  12. package/dist/config/GeneralSettings.js +27 -0
  13. package/dist/config/Invites.d.ts +7 -0
  14. package/dist/config/Invites.js +84 -0
  15. package/dist/config/Members.d.ts +1 -3
  16. package/dist/config/Members.js +4 -23
  17. package/dist/config/WorkspaceSwitcher.d.ts +14 -0
  18. package/dist/config/WorkspaceSwitcher.js +108 -0
  19. package/dist/config/index.d.ts +8 -2
  20. package/dist/config/index.js +6 -3
  21. package/dist/index.d.ts +2 -2
  22. package/dist/index.js +1 -1
  23. package/dist/lib/Dashboard-C48qY8R2.js +1412 -0
  24. package/dist/lib/index.d.ts +63 -22
  25. package/dist/lib/index.js +552 -302
  26. package/dist/lib/selfhost.js +1 -1
  27. package/dist/lib/styles.css +128 -18
  28. package/dist/preview.js +40 -4
  29. package/dist/selfhost/assets/index-CK7qrsNo.css +1 -0
  30. package/dist/selfhost/assets/index-adPvx18g.js +40 -0
  31. package/dist/selfhost/index.html +2 -2
  32. package/dist/test/mockClient.js +3 -0
  33. package/package.json +2 -2
  34. package/dist/config/Workspaces.d.ts +0 -15
  35. package/dist/config/Workspaces.js +0 -116
  36. package/dist/lib/Dashboard-Bgi50wCo.js +0 -1396
  37. package/dist/selfhost/assets/index-D0C3m6st.js +0 -40
  38. package/dist/selfhost/assets/index-rNR1Acph.css +0 -1
@@ -3,10 +3,24 @@ import { ReactElement } from 'react';
3
3
  import { ReactNode } from 'react';
4
4
  import { z } from 'zod';
5
5
 
6
- export declare function ConnectAgent({ workspaceId, hubUrl }: ConnectAgentProps): JSX_2.Element;
6
+ export declare function ConfigPanel({ workspace, hubUrl, membersRefreshKey, onMembersChanged, onLeft, }: ConfigPanelProps): JSX_2.Element;
7
+
8
+ export declare interface ConfigPanelProps {
9
+ /** The active workspace all sections configure. */
10
+ workspace: WorkspaceSummaryT;
11
+ /** The DIRECT Hub URL embedded in the agent install command. */
12
+ hubUrl?: string;
13
+ /** Bumped by the shell to force the roster to refetch (invite created/redeemed). */
14
+ membersRefreshKey?: number;
15
+ /** Called after an invite is created, so the shell can refresh the roster. */
16
+ onMembersChanged?: () => void;
17
+ /** Called after a successful leave, so the shell re-lists its workspaces. */
18
+ onLeft?: () => void;
19
+ }
20
+
21
+ export declare function ConnectAgent({ hubUrl }: ConnectAgentProps): JSX_2.Element;
7
22
 
8
23
  export declare interface ConnectAgentProps {
9
- workspaceId: string;
10
24
  /**
11
25
  * The DIRECT Hub URL the agent connects to (public Cloud Run URL when hosted).
12
26
  * Defaults to the dashboard client's baseUrl, which is correct for self-host
@@ -92,7 +106,7 @@ declare type CreateWorkspaceResponseT = z.infer<typeof CreateWorkspaceResponse>;
92
106
  *
93
107
  * @returns The dashboard element.
94
108
  */
95
- export declare function Dashboard({ workspaceId, config, hasWorkspace, }?: DashboardProps): ReactElement;
109
+ export declare function Dashboard({ workspaceId, config, switcher, hasWorkspace, }?: DashboardProps): ReactElement;
96
110
 
97
111
  /** Props for {@link Dashboard}. The client comes from context. */
98
112
  export declare interface DashboardProps {
@@ -109,6 +123,12 @@ export declare interface DashboardProps {
109
123
  * (the self-host case) keeps the board a plain two-tab Tasks/Chat wallboard.
110
124
  */
111
125
  config?: ReactNode;
126
+ /**
127
+ * The hosted-shell workspace switcher, rendered in the header beside the brand
128
+ * on EVERY tab (not just Config) so the active workspace is always visible.
129
+ * Omitted for self-host, which has a single implicit team workspace.
130
+ */
131
+ switcher?: ReactNode;
112
132
  /**
113
133
  * Whether the account currently belongs to a workspace. Only meaningful in the
114
134
  * hosted shell (paired with {@link config}). When `false`, the Tasks/Chat
@@ -170,6 +190,15 @@ declare const FeedbackResponse: z.ZodObject<{
170
190
 
171
191
  declare type FeedbackResponseT = z.infer<typeof FeedbackResponse>;
172
192
 
193
+ export declare function GeneralSettings({ workspace, onLeft }: GeneralSettingsProps): JSX_2.Element;
194
+
195
+ export declare interface GeneralSettingsProps {
196
+ /** The active workspace whose identity is shown. */
197
+ workspace: WorkspaceSummaryT;
198
+ /** Called after a successful leave, so the shell refreshes its workspace list. */
199
+ onLeft?: () => void;
200
+ }
201
+
173
202
  declare const InviteByEmailResponse: z.ZodObject<{
174
203
  email: z.ZodString;
175
204
  sentAt: z.ZodString;
@@ -202,6 +231,15 @@ declare const InviteResponse: z.ZodObject<{
202
231
 
203
232
  export declare type InviteResponseT = z.infer<typeof InviteResponse>;
204
233
 
234
+ export declare function Invites({ workspaceId, onMembersChanged }: InvitesProps): JSX_2.Element;
235
+
236
+ export declare interface InvitesProps {
237
+ /** The workspace invites are minted against. */
238
+ workspaceId: string;
239
+ /** Called after an invite is created (may change the pending-invite roster). */
240
+ onMembersChanged?: () => void;
241
+ }
242
+
205
243
  declare const ListMembersResponse: z.ZodObject<{
206
244
  members: z.ZodArray<z.ZodObject<{
207
245
  accountId: z.ZodString;
@@ -317,7 +355,7 @@ declare const ListWorkspacesResponse: z.ZodObject<{
317
355
 
318
356
  declare type ListWorkspacesResponseT = z.infer<typeof ListWorkspacesResponse>;
319
357
 
320
- export declare function Members({ workspaceId, refreshKey, canRemove, onLeft }: MembersProps): JSX_2.Element;
358
+ export declare function Members({ workspaceId, refreshKey, canRemove }: MembersProps): JSX_2.Element;
321
359
 
322
360
  export declare interface MembersProps {
323
361
  workspaceId: string;
@@ -325,8 +363,6 @@ export declare interface MembersProps {
325
363
  refreshKey?: number;
326
364
  /** When true, render the per-member remove control (the caller gates on admin). */
327
365
  canRemove?: boolean;
328
- /** Called after a successful self-service leave, so the shell can refresh. */
329
- onLeft?: () => void;
330
366
  }
331
367
 
332
368
  declare const MemberSummary: z.ZodObject<{
@@ -432,6 +468,12 @@ export declare interface ShepherdClient {
432
468
  listTokens(workspaceId: string): Promise<ListTokensResponseT>;
433
469
  /** DELETE (revoke) a token by id. */
434
470
  revokeToken(workspaceId: string, tokenId: string): Promise<void>;
471
+ /** POST a new account-scoped agent token; the raw `shp_` value is returned exactly once. */
472
+ mintAccountToken(body: MintTokenRequestT): Promise<MintTokenResponseT>;
473
+ /** GET the caller's account-scoped token metadata (never the raw token). */
474
+ listAccountTokens(): Promise<ListTokensResponseT>;
475
+ /** DELETE (revoke) an account-scoped token by id. */
476
+ revokeAccountToken(id: string): Promise<void>;
435
477
  /** POST a new invite code for the workspace (admin only). */
436
478
  createInvite(workspaceId: string, body: CreateInviteRequestT): Promise<InviteResponseT>;
437
479
  /** POST a one-time-use invite emailed directly to an address (admin only). */
@@ -754,22 +796,6 @@ declare const WorkspaceLandscapeResponse: z.ZodObject<{
754
796
 
755
797
  export declare type WorkspaceLandscapeResponseT = z.infer<typeof WorkspaceLandscapeResponse>;
756
798
 
757
- export declare function Workspaces({ workspaces, selected, onChanged, onSelect, onMembersChanged, }: WorkspacesProps): JSX_2.Element;
758
-
759
- export declare interface WorkspacesProps {
760
- /** All workspaces the account belongs to (for the switcher / context). */
761
- workspaces: WorkspaceSummaryT[];
762
- /** The currently-selected workspace, or null when the account has none. */
763
- selected: WorkspaceSummaryT | null;
764
- /** Called after a mutation that changes membership (create / join / leave). */
765
- onChanged: () => void;
766
- /** Switch the active workspace (optional simple switcher). */
767
- onSelect?: (workspaceId: string) => void;
768
- /** Called after a mutation that may change the selected workspace's roster
769
- * (an invite created, a code redeemed), so the sibling <Members> refetches. */
770
- onMembersChanged?: () => void;
771
- }
772
-
773
799
  /** One workspace as seen by an account, with that account's role in it. */
774
800
  declare const WorkspaceSummary: z.ZodObject<{
775
801
  id: z.ZodString;
@@ -790,4 +816,19 @@ declare const WorkspaceSummary: z.ZodObject<{
790
816
 
791
817
  export declare type WorkspaceSummaryT = z.infer<typeof WorkspaceSummary>;
792
818
 
819
+ export declare function WorkspaceSwitcher({ workspaces, selected, onSelect, onChanged, onMembersChanged, }: WorkspaceSwitcherProps): JSX_2.Element;
820
+
821
+ export declare interface WorkspaceSwitcherProps {
822
+ /** All workspaces the account belongs to. */
823
+ workspaces: WorkspaceSummaryT[];
824
+ /** The currently-active workspace, or null when the account has none. */
825
+ selected: WorkspaceSummaryT | null;
826
+ /** Switch the active workspace. */
827
+ onSelect: (workspaceId: string) => void;
828
+ /** Called after a create/join changes membership, so the shell re-lists. */
829
+ onChanged: () => void;
830
+ /** Called after a join (which adds the caller to a new roster). */
831
+ onMembersChanged?: () => void;
832
+ }
833
+
793
834
  export { }