@tangle-network/agent-app 0.63.75 → 0.63.77

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 (95) hide show
  1. package/dist/{DesignCanvas-566V5KVC.js → DesignCanvas-JA5O6Y6C.js} +4 -5
  2. package/dist/{DesignCanvasEditor-PUO5Y6FB.js → DesignCanvasEditor-6SQAQGOY.js} +5 -6
  3. package/dist/agent-profiles/d1.js +3 -3
  4. package/dist/agent-profiles/index.js +3 -3
  5. package/dist/app-auth/index.js +1 -2
  6. package/dist/app-auth/index.js.map +1 -1
  7. package/dist/assistant/index.js +5 -6
  8. package/dist/assistant/index.js.map +1 -1
  9. package/dist/chat-routes/agent-producers.d.ts +5 -2
  10. package/dist/chat-routes/index.js +9 -10
  11. package/dist/chat-routes/index.js.map +1 -1
  12. package/dist/chat-store/index.js +1 -1
  13. package/dist/chat-store/parts.d.ts +4 -1
  14. package/dist/{chunk-JLFFTSWN.js → chunk-2CRRXINH.js} +20 -8
  15. package/dist/chunk-2CRRXINH.js.map +1 -0
  16. package/dist/{chunk-WYQTPFPI.js → chunk-3ELC7F62.js} +2 -2
  17. package/dist/{chunk-XJ7DC2DI.js → chunk-DNM5CN3R.js} +3 -3
  18. package/dist/{chunk-E2JMXA2V.js → chunk-DURND7YS.js} +5 -5
  19. package/dist/{chunk-E2JMXA2V.js.map → chunk-DURND7YS.js.map} +1 -1
  20. package/dist/{chunk-GAYWV565.js → chunk-H3XWDX4Z.js} +2 -2
  21. package/dist/chunk-H3XWDX4Z.js.map +1 -0
  22. package/dist/{chunk-RKNNMC6T.js → chunk-H6BRJU5M.js} +1 -1
  23. package/dist/{chunk-YG3DSMPS.js → chunk-IWEGCOQR.js} +40 -21
  24. package/dist/chunk-IWEGCOQR.js.map +1 -0
  25. package/dist/{chunk-6IMNAZR7.js → chunk-M42DQ6HM.js} +2 -2
  26. package/dist/{chunk-2ACI3WYT.js → chunk-OWNWWT76.js} +2 -2
  27. package/dist/{chunk-5ERXADSW.js → chunk-Q54SXI57.js} +2 -2
  28. package/dist/{chunk-62BPUU3A.js → chunk-V2BC73KQ.js} +5 -5
  29. package/dist/{chunk-VKJEH6DG.js → chunk-X32H7TXZ.js} +2 -2
  30. package/dist/{chunk-I4CFBLSJ.js → chunk-Y3HRQVAO.js} +10 -10
  31. package/dist/{chunk-KBJZMR4E.js → chunk-Y5WTAHWY.js} +1 -1
  32. package/dist/chunk-Y5WTAHWY.js.map +1 -0
  33. package/dist/{chunk-YQD2RISF.js → chunk-YAIUAUWJ.js} +3 -3
  34. package/dist/{chunk-7O62NYGT.js → chunk-YHA6W3OW.js} +2 -2
  35. package/dist/{chunk-OBKVNZPH.js → chunk-YL5JDX7K.js} +4 -4
  36. package/dist/{chunk-OBKVNZPH.js.map → chunk-YL5JDX7K.js.map} +1 -1
  37. package/dist/design-canvas/index.js +1 -2
  38. package/dist/design-canvas/index.js.map +1 -1
  39. package/dist/design-canvas-react/engine.js +1 -2
  40. package/dist/design-canvas-react/index.js +10 -11
  41. package/dist/design-canvas-react/index.js.map +1 -1
  42. package/dist/design-canvas-react/lazy.js +1 -1
  43. package/dist/platform/index.js +9 -10
  44. package/dist/platform/index.js.map +1 -1
  45. package/dist/preset-cloudflare/index.js +7 -7
  46. package/dist/public-consultation/index.js +8 -9
  47. package/dist/public-consultation/index.js.map +1 -1
  48. package/dist/sandbox/index.js +4 -4
  49. package/dist/sequences/index.js +1 -2
  50. package/dist/sequences/index.js.map +1 -1
  51. package/dist/settings-react/index.js +64 -31
  52. package/dist/settings-react/index.js.map +1 -1
  53. package/dist/settings-react/members-section.d.ts +15 -5
  54. package/dist/stories/chat/fixtures.d.ts +5 -5
  55. package/dist/stories/settings/settings-demo.d.ts +4 -1
  56. package/dist/teams/index.js +1 -1
  57. package/dist/teams/invitations-api.d.ts +6 -4
  58. package/dist/teams/invitations-api.js +4 -2
  59. package/dist/teams/invitations-api.js.map +1 -1
  60. package/dist/teams/invitations.d.ts +2 -0
  61. package/dist/teams/members-api.js +2 -2
  62. package/dist/teams-react/components/invitation-detail.d.ts +4 -2
  63. package/dist/teams-react/index.js +2 -2
  64. package/dist/theme/tokens.css +19 -19
  65. package/dist/tools/index.js +4 -4
  66. package/dist/web/index.d.ts +0 -1
  67. package/dist/web/index.js +1 -7
  68. package/dist/web-react/chat-stream.d.ts +3 -1
  69. package/dist/web-react/index.js +9 -10
  70. package/dist/web-react/message-projection.d.ts +2 -2
  71. package/dist/work-product/index.js +2 -2
  72. package/dist/worker-build/index.d.ts +26 -0
  73. package/dist/worker-build/index.js +73 -0
  74. package/dist/worker-build/index.js.map +1 -0
  75. package/package.json +12 -7
  76. package/dist/chunk-GAYWV565.js.map +0 -1
  77. package/dist/chunk-JLFFTSWN.js.map +0 -1
  78. package/dist/chunk-KBJZMR4E.js.map +0 -1
  79. package/dist/chunk-XBBXPZJI.js +0 -47
  80. package/dist/chunk-XBBXPZJI.js.map +0 -1
  81. package/dist/chunk-YG3DSMPS.js.map +0 -1
  82. package/dist/web/speakers.d.ts +0 -30
  83. /package/dist/{DesignCanvas-566V5KVC.js.map → DesignCanvas-JA5O6Y6C.js.map} +0 -0
  84. /package/dist/{DesignCanvasEditor-PUO5Y6FB.js.map → DesignCanvasEditor-6SQAQGOY.js.map} +0 -0
  85. /package/dist/{chunk-WYQTPFPI.js.map → chunk-3ELC7F62.js.map} +0 -0
  86. /package/dist/{chunk-XJ7DC2DI.js.map → chunk-DNM5CN3R.js.map} +0 -0
  87. /package/dist/{chunk-RKNNMC6T.js.map → chunk-H6BRJU5M.js.map} +0 -0
  88. /package/dist/{chunk-6IMNAZR7.js.map → chunk-M42DQ6HM.js.map} +0 -0
  89. /package/dist/{chunk-2ACI3WYT.js.map → chunk-OWNWWT76.js.map} +0 -0
  90. /package/dist/{chunk-5ERXADSW.js.map → chunk-Q54SXI57.js.map} +0 -0
  91. /package/dist/{chunk-62BPUU3A.js.map → chunk-V2BC73KQ.js.map} +0 -0
  92. /package/dist/{chunk-VKJEH6DG.js.map → chunk-X32H7TXZ.js.map} +0 -0
  93. /package/dist/{chunk-I4CFBLSJ.js.map → chunk-Y3HRQVAO.js.map} +0 -0
  94. /package/dist/{chunk-YQD2RISF.js.map → chunk-YAIUAUWJ.js.map} +0 -0
  95. /package/dist/{chunk-7O62NYGT.js.map → chunk-YHA6W3OW.js.map} +0 -0
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  OPENUI_NODE_JSON_SCHEMA,
6
6
  OPENUI_NODE_TYPES
7
- } from "./chunk-E2JMXA2V.js";
7
+ } from "./chunk-DURND7YS.js";
8
8
 
9
9
  // src/tools/openai.ts
10
10
  var APP_TOOL_NAMES = ["submit_proposal", "schedule_followup", "render_ui", "add_citation"];
@@ -117,4 +117,4 @@ export {
117
117
  customToolToOpenAI,
118
118
  findCustomTool
119
119
  };
120
- //# sourceMappingURL=chunk-6IMNAZR7.js.map
120
+ //# sourceMappingURL=chunk-M42DQ6HM.js.map
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-3CI35I4X.js";
5
5
  import {
6
6
  defineAppTool
7
- } from "./chunk-6IMNAZR7.js";
7
+ } from "./chunk-M42DQ6HM.js";
8
8
  import {
9
9
  ToolInputError
10
10
  } from "./chunk-F4XBNR5L.js";
@@ -672,4 +672,4 @@ export {
672
672
  PROFILE_MEMORY_PREFIX,
673
673
  profileTools
674
674
  };
675
- //# sourceMappingURL=chunk-2ACI3WYT.js.map
675
+ //# sourceMappingURL=chunk-OWNWWT76.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  addStepFinishUsage
3
- } from "./chunk-7O62NYGT.js";
3
+ } from "./chunk-YHA6W3OW.js";
4
4
  import {
5
5
  asRecord,
6
6
  asString,
@@ -480,4 +480,4 @@ export {
480
480
  TOOL_ABORTED_ERROR,
481
481
  observeNativeCompletion
482
482
  };
483
- //# sourceMappingURL=chunk-5ERXADSW.js.map
483
+ //# sourceMappingURL=chunk-Q54SXI57.js.map
@@ -3,10 +3,7 @@ import {
3
3
  BrandKnot,
4
4
  DesignCanvas,
5
5
  ShapesGlyph
6
- } from "./chunk-I4CFBLSJ.js";
7
- import {
8
- PlusGlyph
9
- } from "./chunk-P4RRC4AO.js";
6
+ } from "./chunk-Y3HRQVAO.js";
10
7
  import {
11
8
  DEFAULT_INSERT_TEMPLATES,
12
9
  collectGridTargets,
@@ -30,6 +27,9 @@ import {
30
27
  setAttrsCommand,
31
28
  ungroupElementCommand
32
29
  } from "./chunk-CPWMBYLQ.js";
30
+ import {
31
+ PlusGlyph
32
+ } from "./chunk-P4RRC4AO.js";
33
33
  import {
34
34
  SCENE_SCHEMA_VERSION,
35
35
  boundsIntersect,
@@ -2123,4 +2123,4 @@ export {
2123
2123
  Workspace,
2124
2124
  DesignCanvasEditor
2125
2125
  };
2126
- //# sourceMappingURL=chunk-62BPUU3A.js.map
2126
+ //# sourceMappingURL=chunk-V2BC73KQ.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  validateOpenUIJsonNode
3
- } from "./chunk-E2JMXA2V.js";
3
+ } from "./chunk-DURND7YS.js";
4
4
  import {
5
5
  ToolInputError
6
6
  } from "./chunk-F4XBNR5L.js";
@@ -27,4 +27,4 @@ function parseRenderUiSchema(value) {
27
27
  export {
28
28
  parseRenderUiSchema
29
29
  };
30
- //# sourceMappingURL=chunk-VKJEH6DG.js.map
30
+ //# sourceMappingURL=chunk-X32H7TXZ.js.map
@@ -1,12 +1,3 @@
1
- import {
2
- LockGlyph,
3
- MagnetGlyph,
4
- MinusGlyph,
5
- PlusGlyph,
6
- RedoGlyph,
7
- UndoGlyph,
8
- createEditorGlyph
9
- } from "./chunk-P4RRC4AO.js";
10
1
  import {
11
2
  addPageCommand,
12
3
  bindSlotCommand,
@@ -23,6 +14,15 @@ import {
23
14
  setPagePropsCommand,
24
15
  ungroupElementCommand
25
16
  } from "./chunk-CPWMBYLQ.js";
17
+ import {
18
+ LockGlyph,
19
+ MagnetGlyph,
20
+ MinusGlyph,
21
+ PlusGlyph,
22
+ RedoGlyph,
23
+ UndoGlyph,
24
+ createEditorGlyph
25
+ } from "./chunk-P4RRC4AO.js";
26
26
  import {
27
27
  SIZE_PRESETS,
28
28
  findElement,
@@ -2382,4 +2382,4 @@ export {
2382
2382
  ExportControl,
2383
2383
  DesignCanvas
2384
2384
  };
2385
- //# sourceMappingURL=chunk-I4CFBLSJ.js.map
2385
+ //# sourceMappingURL=chunk-Y3HRQVAO.js.map
@@ -36,4 +36,4 @@ export {
36
36
  generateInvitationToken,
37
37
  inviteUrlForToken
38
38
  };
39
- //# sourceMappingURL=chunk-KBJZMR4E.js.map
39
+ //# sourceMappingURL=chunk-Y5WTAHWY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/teams/invitations.ts"],"sourcesContent":["/**\n * Pure invitation helpers for the teams capability. Zero dependencies: no\n * drizzle, no env, no react, no network. The lifecycle API (`./invitations-api`)\n * and an app's own mail transport build on these; the invitation email itself\n * is `inviteEmail` from `@tangle-network/agent-app/email`.\n */\n\nimport type { AssignableWorkspaceRole } from './roles'\n\n/** The role an invitation grants — the assignable workspace ladder (never owner). */\nexport type InvitationPermission = AssignableWorkspaceRole\n\n/** Define possible states for an invitation's lifecycle including pending, accepted, expired, and revoked */\nexport type InvitationStatus = 'pending' | 'accepted' | 'expired' | 'revoked'\n/** Define possible statuses for the sending state of an invitation email */\nexport type InvitationEmailStatus = 'not_sent' | 'sent' | 'failed'\n/** How an invitation reaches the person: `email` sends them the link; `link` sends nothing, and the inviter shares it. */\nexport type InvitationDelivery = 'email' | 'link'\n\n/** Define the number of days before an invitation expires */\nexport const INVITATION_EXPIRY_DAYS = 7\n\nconst INVITATION_PERMISSIONS = ['admin', 'editor', 'viewer'] as const\nconst TOKEN_BYTE_LENGTH = 32\n\n/** Normalize an invitation email by trimming whitespace and converting to lowercase */\nexport function normalizeInvitationEmail(email: string): string {\n return email.trim().toLowerCase()\n}\n\n// One `@`, a local part, and a domain with a dot and a 2+ letter ending. It is\n// the shape a mail server can deliver to, not full RFC 5322: the invite email\n// itself is the real check, and this only stops `founder@` or `founder@example`.\nconst DELIVERABLE_EMAIL = /^[^\\s@]+@[^\\s@.]+(\\.[^\\s@.]+)*\\.[^\\s@.]{2,}$/\n\n/** Whether an address has the shape an invitation can be delivered to. */\nexport function isInvitationEmail(email: string): boolean {\n return DELIVERABLE_EMAIL.test(email.trim())\n}\n\n/** What to tell someone whose invite address cannot be delivered to. */\nexport const INVITATION_EMAIL_HINT = 'Enter a full email address, such as name@company.com.'\n\n/** Resolve invitation permission from a string or return null if invalid */\nexport function parseInvitationPermission(value: string | undefined): InvitationPermission | null {\n return INVITATION_PERMISSIONS.includes(value as InvitationPermission) ? (value as InvitationPermission) : null\n}\n\n/** Calculate the expiration date of an invitation based on the given or current date */\nexport function getInvitationExpiresAt(now: Date = new Date()): Date {\n return new Date(now.getTime() + INVITATION_EXPIRY_DAYS * 24 * 60 * 60 * 1000)\n}\n\n/**\n * A cryptographically-random, URL-safe invitation token. `inv_`-prefixed so a\n * token is self-identifying and never collides with the workspaceMember invite\n * tokens minted by `members-api` (`generateInviteToken`).\n */\nexport function generateInvitationToken(): string {\n const bytes = new Uint8Array(TOKEN_BYTE_LENGTH)\n globalThis.crypto.getRandomValues(bytes)\n const token = Array.from(bytes, (byte) => String.fromCharCode(byte)).join('')\n return `inv_${btoa(token).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/g, '')}`\n}\n\n/** Generate an invite URL by combining the origin with an encoded token */\nexport function inviteUrlForToken(origin: string, token: string): string {\n return `${origin.replace(/\\/+$/, '')}/invite/${encodeURIComponent(token)}`\n}\n"],"mappings":";AAoBO,IAAM,yBAAyB;AAEtC,IAAM,yBAAyB,CAAC,SAAS,UAAU,QAAQ;AAC3D,IAAM,oBAAoB;AAGnB,SAAS,yBAAyB,OAAuB;AAC9D,SAAO,MAAM,KAAK,EAAE,YAAY;AAClC;AAKA,IAAM,oBAAoB;AAGnB,SAAS,kBAAkB,OAAwB;AACxD,SAAO,kBAAkB,KAAK,MAAM,KAAK,CAAC;AAC5C;AAGO,IAAM,wBAAwB;AAG9B,SAAS,0BAA0B,OAAwD;AAChG,SAAO,uBAAuB,SAAS,KAA6B,IAAK,QAAiC;AAC5G;AAGO,SAAS,uBAAuB,MAAY,oBAAI,KAAK,GAAS;AACnE,SAAO,IAAI,KAAK,IAAI,QAAQ,IAAI,yBAAyB,KAAK,KAAK,KAAK,GAAI;AAC9E;AAOO,SAAS,0BAAkC;AAChD,QAAM,QAAQ,IAAI,WAAW,iBAAiB;AAC9C,aAAW,OAAO,gBAAgB,KAAK;AACvC,QAAM,QAAQ,MAAM,KAAK,OAAO,CAAC,SAAS,OAAO,aAAa,IAAI,CAAC,EAAE,KAAK,EAAE;AAC5E,SAAO,OAAO,KAAK,KAAK,EAAE,QAAQ,OAAO,GAAG,EAAE,QAAQ,OAAO,GAAG,EAAE,QAAQ,QAAQ,EAAE,CAAC;AACvF;AAGO,SAAS,kBAAkB,QAAgB,OAAuB;AACvE,SAAO,GAAG,OAAO,QAAQ,QAAQ,EAAE,CAAC,WAAW,mBAAmB,KAAK,CAAC;AAC1E;","names":[]}
@@ -1,14 +1,14 @@
1
1
  // src/design-canvas-react/lazy.tsx
2
2
  import { lazy } from "react";
3
3
  var DesignCanvasLazy = lazy(
4
- () => import("./DesignCanvasEditor-PUO5Y6FB.js").then((m) => ({ default: m.DesignCanvasEditor }))
4
+ () => import("./DesignCanvasEditor-6SQAQGOY.js").then((m) => ({ default: m.DesignCanvasEditor }))
5
5
  );
6
6
  var DesignCanvasChromeLazy = lazy(
7
- () => import("./DesignCanvas-566V5KVC.js").then((m) => ({ default: m.DesignCanvas }))
7
+ () => import("./DesignCanvas-JA5O6Y6C.js").then((m) => ({ default: m.DesignCanvas }))
8
8
  );
9
9
 
10
10
  export {
11
11
  DesignCanvasLazy,
12
12
  DesignCanvasChromeLazy
13
13
  };
14
- //# sourceMappingURL=chunk-YQD2RISF.js.map
14
+ //# sourceMappingURL=chunk-YAIUAUWJ.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  toChatMessageParts
3
- } from "./chunk-GAYWV565.js";
3
+ } from "./chunk-H3XWDX4Z.js";
4
4
  import {
5
5
  asRecord
6
6
  } from "./chunk-U4F6NHAA.js";
@@ -222,4 +222,4 @@ export {
222
222
  assistantRowIdForTurn,
223
223
  addStepFinishUsage
224
224
  };
225
- //# sourceMappingURL=chunk-7O62NYGT.js.map
225
+ //# sourceMappingURL=chunk-YHA6W3OW.js.map
@@ -44,14 +44,14 @@ function memberRoleLabel(member) {
44
44
  function shortDate(value) {
45
45
  return new Date(value).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" });
46
46
  }
47
- function invitationDetail(invitation) {
47
+ function invitationDetail(invitation, delivery = "email") {
48
48
  const role = ROLE_CAPABILITY[invitation.permissions];
49
49
  switch (invitation.status) {
50
50
  case "accepted":
51
51
  return invitation.acceptedAt ? `${role} \xB7 joined ${shortDate(invitation.acceptedAt)}` : `${role} \xB7 joined`;
52
52
  case "pending": {
53
- const delivery = invitation.emailStatus === "sent" ? "email sent" : invitation.emailStatus === "not_sent" ? "email not sent yet" : null;
54
- return [role, delivery, `expires ${shortDate(invitation.expiresAt)}`].filter(Boolean).join(" \xB7 ");
53
+ const sent = delivery === "link" ? null : invitation.emailStatus === "sent" ? "email sent" : invitation.emailStatus === "not_sent" ? "email not sent yet" : null;
54
+ return [role, sent, `expires ${shortDate(invitation.expiresAt)}`].filter(Boolean).join(" \xB7 ");
55
55
  }
56
56
  case "expired":
57
57
  return `${role} \xB7 expired ${shortDate(invitation.expiresAt)}`;
@@ -67,4 +67,4 @@ export {
67
67
  memberRoleLabel,
68
68
  invitationDetail
69
69
  };
70
- //# sourceMappingURL=chunk-OBKVNZPH.js.map
70
+ //# sourceMappingURL=chunk-YL5JDX7K.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/teams-react/components/RoleSelect.tsx","../src/teams-react/components/member-access.ts","../src/teams-react/components/invitation-detail.ts"],"sourcesContent":["/**\n * The role picker both team panels and the settings sections share: the ui\n * `Select`, with each role named by what it lets a person do and, in the open\n * list, one line on what it adds, so choosing one never needs a help page.\n * The trigger shows the name alone and fills its container; give the\n * container the width.\n */\n\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@tangle-network/ui/primitives'\nimport { ASSIGNABLE_WORKSPACE_ROLES, type AssignableWorkspaceRole, type WorkspaceRole } from '../../teams/roles'\n\n/** Each workspace role in the words a person decides by. */\nexport const ROLE_CAPABILITY: Record<WorkspaceRole, string> = {\n viewer: 'Can view',\n editor: 'Can edit',\n admin: 'Can manage settings and people',\n owner: 'Owner',\n}\n\n// What each assignable role adds, under its name in the open list; chatting\n// with the agent is what a viewer cannot do. Each line fits a phone-width\n// trigger, so the open list is never wider than the screen.\nconst ROLE_DESCRIPTION: Record<AssignableWorkspaceRole, string> = {\n viewer: 'Reads everything; can’t chat or edit',\n editor: 'Also chats with the agent and edits',\n admin: 'Also invites people and sets roles',\n}\n\nexport interface RoleSelectProps {\n value: WorkspaceRole\n onChange(role: WorkspaceRole): void\n /** Accessible name (no visible label — the panels label the row). */\n ariaLabel: string\n id?: string\n disabled?: boolean\n}\n\nexport function RoleSelect({ value, onChange, ariaLabel, id, disabled }: RoleSelectProps) {\n return (\n <Select value={value} onValueChange={(role) => onChange(role as WorkspaceRole)} disabled={disabled}>\n <SelectTrigger id={id} aria-label={ariaLabel}>\n <SelectValue>{ROLE_CAPABILITY[value]}</SelectValue>\n </SelectTrigger>\n <SelectContent>\n {ASSIGNABLE_WORKSPACE_ROLES.map((role) => (\n <SelectItem key={role} value={role} textValue={ROLE_CAPABILITY[role]}>\n <span className=\"block\">{ROLE_CAPABILITY[role]}</span>\n <span className=\"block font-normal text-muted-foreground\" data-role-description>{ROLE_DESCRIPTION[role]}</span>\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n )\n}\n","/**\n * Who may change a member's access, and the words for a role shown as text.\n * `MembersPanel` and the settings `MembersSection` both read these, so the two\n * member lists apply one rule.\n */\n\nimport { hasWorkspaceRole, type WorkspaceRole } from '../../teams/roles'\nimport type { MemberView } from '../contracts'\nimport { ROLE_CAPABILITY } from './RoleSelect'\n\n/**\n * Whether the viewer can change this member's role or remove them: an admin\n * can, except for an owner, an inherited organization admin, or their own row,\n * so no one demotes or removes themselves from a list.\n */\nexport function canManageMember(member: MemberView, currentRole: WorkspaceRole, currentUserId?: string | null): boolean {\n if (!hasWorkspaceRole(currentRole, 'admin') || member.role === 'owner' || member.inherited) return false\n return !isCurrentMember(member, currentUserId)\n}\n\n/** True on the viewer's own row. */\nexport function isCurrentMember(member: MemberView, currentUserId?: string | null): boolean {\n return currentUserId != null && member.userId === currentUserId\n}\n\n/** A role shown as text rather than a picker. */\nexport function memberRoleLabel(member: MemberView): string {\n if (member.role === 'owner') return member.inherited ? 'Organization admin' : 'Owner'\n return ROLE_CAPABILITY[member.role]\n}\n","/** The line under an invitation's address, shared by `InvitationsPanel` and the settings `InvitationsSection`. */\n\nimport type { InvitationView } from '../contracts'\nimport { ROLE_CAPABILITY } from './RoleSelect'\n\nfunction shortDate(value: Date | number | string): string {\n return new Date(value).toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' })\n}\n\n/**\n * The line under the address: what the invitee can do, then only what is true\n * of this invitation now. Every status says itself in words, so a past\n * invitation reads as joined, expired or revoked without a badge.\n */\nexport function invitationDetail(invitation: InvitationView): string {\n const role = ROLE_CAPABILITY[invitation.permissions]\n switch (invitation.status) {\n case 'accepted':\n return invitation.acceptedAt ? `${role} · joined ${shortDate(invitation.acceptedAt)}` : `${role} · joined`\n case 'pending': {\n const delivery = invitation.emailStatus === 'sent' ? 'email sent' : invitation.emailStatus === 'not_sent' ? 'email not sent yet' : null\n return [role, delivery, `expires ${shortDate(invitation.expiresAt)}`].filter(Boolean).join(' · ')\n }\n case 'expired':\n return `${role} · expired ${shortDate(invitation.expiresAt)}`\n case 'revoked':\n return `${role} · revoked`\n }\n}\n"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KAAK,WAAW,MAAM,UAAU,CAAC;AACxG;AAOO,SAAS,iBAAiB,YAAoC;AACnE,QAAM,OAAO,gBAAgB,WAAW,WAAW;AACnD,UAAQ,WAAW,QAAQ;AAAA,IACzB,KAAK;AACH,aAAO,WAAW,aAAa,GAAG,IAAI,gBAAa,UAAU,WAAW,UAAU,CAAC,KAAK,GAAG,IAAI;AAAA,IACjG,KAAK,WAAW;AACd,YAAM,WAAW,WAAW,gBAAgB,SAAS,eAAe,WAAW,gBAAgB,aAAa,uBAAuB;AACnI,aAAO,CAAC,MAAM,UAAU,WAAW,UAAU,WAAW,SAAS,CAAC,EAAE,EAAE,OAAO,OAAO,EAAE,KAAK,QAAK;AAAA,IAClG;AAAA,IACA,KAAK;AACH,aAAO,GAAG,IAAI,iBAAc,UAAU,WAAW,SAAS,CAAC;AAAA,IAC7D,KAAK;AACH,aAAO,GAAG,IAAI;AAAA,EAClB;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/teams-react/components/RoleSelect.tsx","../src/teams-react/components/member-access.ts","../src/teams-react/components/invitation-detail.ts"],"sourcesContent":["/**\n * The role picker both team panels and the settings sections share: the ui\n * `Select`, with each role named by what it lets a person do and, in the open\n * list, one line on what it adds, so choosing one never needs a help page.\n * The trigger shows the name alone and fills its container; give the\n * container the width.\n */\n\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@tangle-network/ui/primitives'\nimport { ASSIGNABLE_WORKSPACE_ROLES, type AssignableWorkspaceRole, type WorkspaceRole } from '../../teams/roles'\n\n/** Each workspace role in the words a person decides by. */\nexport const ROLE_CAPABILITY: Record<WorkspaceRole, string> = {\n viewer: 'Can view',\n editor: 'Can edit',\n admin: 'Can manage settings and people',\n owner: 'Owner',\n}\n\n// What each assignable role adds, under its name in the open list; chatting\n// with the agent is what a viewer cannot do. Each line fits a phone-width\n// trigger, so the open list is never wider than the screen.\nconst ROLE_DESCRIPTION: Record<AssignableWorkspaceRole, string> = {\n viewer: 'Reads everything; can’t chat or edit',\n editor: 'Also chats with the agent and edits',\n admin: 'Also invites people and sets roles',\n}\n\nexport interface RoleSelectProps {\n value: WorkspaceRole\n onChange(role: WorkspaceRole): void\n /** Accessible name (no visible label — the panels label the row). */\n ariaLabel: string\n id?: string\n disabled?: boolean\n}\n\nexport function RoleSelect({ value, onChange, ariaLabel, id, disabled }: RoleSelectProps) {\n return (\n <Select value={value} onValueChange={(role) => onChange(role as WorkspaceRole)} disabled={disabled}>\n <SelectTrigger id={id} aria-label={ariaLabel}>\n <SelectValue>{ROLE_CAPABILITY[value]}</SelectValue>\n </SelectTrigger>\n <SelectContent>\n {ASSIGNABLE_WORKSPACE_ROLES.map((role) => (\n <SelectItem key={role} value={role} textValue={ROLE_CAPABILITY[role]}>\n <span className=\"block\">{ROLE_CAPABILITY[role]}</span>\n <span className=\"block font-normal text-muted-foreground\" data-role-description>{ROLE_DESCRIPTION[role]}</span>\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n )\n}\n","/**\n * Who may change a member's access, and the words for a role shown as text.\n * `MembersPanel` and the settings `MembersSection` both read these, so the two\n * member lists apply one rule.\n */\n\nimport { hasWorkspaceRole, type WorkspaceRole } from '../../teams/roles'\nimport type { MemberView } from '../contracts'\nimport { ROLE_CAPABILITY } from './RoleSelect'\n\n/**\n * Whether the viewer can change this member's role or remove them: an admin\n * can, except for an owner, an inherited organization admin, or their own row,\n * so no one demotes or removes themselves from a list.\n */\nexport function canManageMember(member: MemberView, currentRole: WorkspaceRole, currentUserId?: string | null): boolean {\n if (!hasWorkspaceRole(currentRole, 'admin') || member.role === 'owner' || member.inherited) return false\n return !isCurrentMember(member, currentUserId)\n}\n\n/** True on the viewer's own row. */\nexport function isCurrentMember(member: MemberView, currentUserId?: string | null): boolean {\n return currentUserId != null && member.userId === currentUserId\n}\n\n/** A role shown as text rather than a picker. */\nexport function memberRoleLabel(member: MemberView): string {\n if (member.role === 'owner') return member.inherited ? 'Organization admin' : 'Owner'\n return ROLE_CAPABILITY[member.role]\n}\n","/** The line under an invitation's address, shared by `InvitationsPanel` and the settings `InvitationsSection`. */\n\nimport type { InvitationDelivery } from '../../teams/invitations'\nimport type { InvitationView } from '../contracts'\nimport { ROLE_CAPABILITY } from './RoleSelect'\n\nfunction shortDate(value: Date | number | string): string {\n return new Date(value).toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' })\n}\n\n/**\n * The line under the address: what the invitee can do, then only what is true\n * of this invitation now. Every status says itself in words, so a past\n * invitation reads as joined, expired or revoked without a badge. A link-only\n * invitation never mentions email.\n */\nexport function invitationDetail(invitation: InvitationView, delivery: InvitationDelivery = 'email'): string {\n const role = ROLE_CAPABILITY[invitation.permissions]\n switch (invitation.status) {\n case 'accepted':\n return invitation.acceptedAt ? `${role} · joined ${shortDate(invitation.acceptedAt)}` : `${role} · joined`\n case 'pending': {\n const sent = delivery === 'link' ? null : invitation.emailStatus === 'sent' ? 'email sent' : invitation.emailStatus === 'not_sent' ? 'email not sent yet' : null\n return [role, sent, `expires ${shortDate(invitation.expiresAt)}`].filter(Boolean).join(' · ')\n }\n case 'expired':\n return `${role} · expired ${shortDate(invitation.expiresAt)}`\n case 'revoked':\n return `${role} · revoked`\n }\n}\n"],"mappings":";;;;;;AAQA,SAAS,QAAQ,eAAe,YAAY,eAAe,mBAAmB;AAiCtE,cAIE,YAJF;AA7BD,IAAM,kBAAiD;AAAA,EAC5D,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,OAAO;AACT;AAKA,IAAM,mBAA4D;AAAA,EAChE,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,OAAO;AACT;AAWO,SAAS,WAAW,EAAE,OAAO,UAAU,WAAW,IAAI,SAAS,GAAoB;AACxF,SACE,qBAAC,UAAO,OAAc,eAAe,CAAC,SAAS,SAAS,IAAqB,GAAG,UAC9E;AAAA,wBAAC,iBAAc,IAAQ,cAAY,WACjC,8BAAC,eAAa,0BAAgB,KAAK,GAAE,GACvC;AAAA,IACA,o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A,KAAK;AACH,aAAO,GAAG,IAAI,iBAAc,UAAU,WAAW,SAAS,CAAC;AAAA,IAC7D,KAAK;AACH,aAAO,GAAG,IAAI;AAAA,EAClB;AACF;","names":[]}
@@ -37,8 +37,7 @@ import {
37
37
  validateSceneOperations,
38
38
  validateSlotValue
39
39
  } from "../chunk-VCG4DQC4.js";
40
- import "../chunk-RKNNMC6T.js";
41
- import "../chunk-XBBXPZJI.js";
40
+ import "../chunk-H6BRJU5M.js";
42
41
  import "../chunk-RN4WPTBH.js";
43
42
  import "../chunk-ALIWB2P3.js";
44
43
  import {