@puredesktop/puredesktop-ui-bridge 2.1.7 → 2.1.9

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 (119) hide show
  1. package/package.json +89 -5
  2. package/src/agents/mcpServerPresets.test.ts +105 -0
  3. package/src/agents/mcpServerPresets.ts +380 -0
  4. package/src/agents/runtime/index.ts +7 -0
  5. package/src/agents/runtime/mapAgentSnapshot.ts +11 -8
  6. package/src/agents/runtime/pendingAsks.test.ts +117 -0
  7. package/src/agents/runtime/pendingAsks.ts +110 -0
  8. package/src/bridge/agentScopeDefaults.ts +65 -0
  9. package/src/bridge/agentTypes.ts +57 -3
  10. package/src/bridge/agents.d.mts +6 -0
  11. package/src/bridge/agents.mjs +10 -0
  12. package/src/bridge/agents.ts +4 -0
  13. package/src/bridge/collectionImagePaste.ts +19 -1
  14. package/src/bridge/context.mjs +32 -0
  15. package/src/bridge/credentials.d.mts +62 -0
  16. package/src/bridge/credentials.mjs +53 -0
  17. package/src/bridge/documents.d.mts +76 -0
  18. package/src/bridge/documents.mjs +40 -0
  19. package/src/bridge/events.d.mts +1 -0
  20. package/src/bridge/events.mjs +1 -0
  21. package/src/bridge/googleAuth.ts +7 -152
  22. package/src/bridge/mcpClient.d.mts +74 -0
  23. package/src/bridge/mcpClient.mjs +79 -0
  24. package/src/bridge/methods.d.mts +45 -0
  25. package/src/bridge/methods.mjs +46 -0
  26. package/src/bridge/notifications.d.mts +12 -0
  27. package/src/bridge/notifications.mjs +36 -0
  28. package/src/bridge/operations.d.mts +44 -0
  29. package/src/bridge/operations.mjs +40 -0
  30. package/src/bridge/pureRender/base.css +44 -0
  31. package/src/bridge/pureRender/document.ts +29 -2
  32. package/src/bridge/pureRender/index.ts +3 -0
  33. package/src/bridge/pureRender/normalize.ts +167 -0
  34. package/src/bridge/pureRender/sanitizeExportBody.test.ts +51 -0
  35. package/src/bridge/pureRender/sanitizeExportBody.ts +61 -0
  36. package/src/bridge/pureRender/styles.ts +125 -5
  37. package/src/bridge/pureRender/theme.test.ts +259 -0
  38. package/src/bridge/pureRender/theme.ts +19 -1
  39. package/src/bridge/pureRender/types.ts +33 -0
  40. package/src/bridge/pureRender/visualLayoutInspection.test.ts +26 -0
  41. package/src/bridge/pureRender/visualLayoutInspection.ts +75 -0
  42. package/src/bridge/react/useDocumentHotkeys.ts +41 -0
  43. package/src/bridge/react/useDocumentLifecycle.tsx +359 -0
  44. package/src/bridge/react/usePlatformAgentSessionDrive.test.tsx +29 -10
  45. package/src/bridge/react/usePlatformAgentSessionDrive.tsx +10 -81
  46. package/src/bridge/react/usePlatformAppSettings.test.tsx +105 -0
  47. package/src/bridge/react/usePlatformAppSettings.tsx +104 -0
  48. package/src/bridge/react/usePlatformJsonStore.test.tsx +152 -0
  49. package/src/bridge/react/usePlatformJsonStore.tsx +149 -0
  50. package/src/bridge/react/usePlatformOperations.tsx +75 -0
  51. package/src/bridge/storage.d.mts +23 -10
  52. package/src/bridge/storage.mjs +6 -3
  53. package/src/bridge/storage.test.ts +6 -6
  54. package/src/bridge/types.ts +7 -0
  55. package/src/components/agents/AgentComposer.tsx +10 -6
  56. package/src/components/agents/AgentDrawerPanel.test.tsx +2 -205
  57. package/src/components/agents/AgentDrawerPanel.tsx +23 -62
  58. package/src/components/agents/AgentMessageBubble.tsx +59 -33
  59. package/src/components/agents/AgentMessageList.tsx +4 -4
  60. package/src/components/agents/AgentQuestionPromptList.tsx +34 -212
  61. package/src/components/agents/AgentToolApprovalActions.tsx +13 -11
  62. package/src/components/agents/AgentToolCallCard.tsx +20 -20
  63. package/src/components/agents/AgentToolPendingList.tsx +6 -6
  64. package/src/components/agents/AgentToolPendingReview.tsx +6 -6
  65. package/src/components/agents/ContextPicker.tsx +239 -0
  66. package/src/components/agents/QuestionRequestList.tsx +278 -0
  67. package/src/components/agents/agentPanelStyles.ts +8 -31
  68. package/src/components/agents/agentTypes.ts +25 -41
  69. package/src/components/agents/index.ts +4 -0
  70. package/src/components/assets/asset-library/sidebar/AssetLibraryList.tsx +10 -4
  71. package/src/components/chrome/WorkspaceTabStrip.tsx +22 -4
  72. package/src/components/chrome/workspaceTabTypes.ts +2 -0
  73. package/src/components/common/chat/ChatBox.tsx +9 -9
  74. package/src/components/common/chat/ChatModelMenu.tsx +34 -4
  75. package/src/components/common/chat/ChatThread.tsx +23 -7
  76. package/src/components/common/connections/ProviderConnection.test.tsx +208 -0
  77. package/src/components/common/connections/ProviderConnection.tsx +277 -0
  78. package/src/components/common/connections/index.ts +5 -0
  79. package/src/components/common/containers/AppFrame.test.tsx +4 -4
  80. package/src/components/common/containers/AppFrame.tsx +26 -10
  81. package/src/components/common/containers/AppHeader.tsx +37 -15
  82. package/src/components/common/documents/DocumentHeaderActions.tsx +206 -0
  83. package/src/components/common/documents/DocumentSwitcher.tsx +1181 -0
  84. package/src/components/common/documents/index.ts +8 -0
  85. package/src/components/common/dropdown/MenuDropdownItem.tsx +14 -2
  86. package/src/components/common/dropdown/MenuPortal.tsx +3 -1
  87. package/src/components/common/dropdown/menuViewportPosition.test.ts +20 -10
  88. package/src/components/common/dropdown/menuViewportPosition.ts +35 -27
  89. package/src/components/common/overlays/Modal.tsx +13 -2
  90. package/src/components/common/research/EvidenceDossier.tsx +1232 -150
  91. package/src/components/common/research/index.ts +2 -0
  92. package/src/components/editor/EditorLinkPromptDialog.tsx +1 -1
  93. package/src/components/print-design/PrintDesignPanel.test.tsx +430 -40
  94. package/src/components/print-design/PrintDesignPanel.tsx +1770 -207
  95. package/src/components/print-design/index.ts +2 -0
  96. package/src/components/print-design/previewContent.test.ts +32 -0
  97. package/src/components/print-design/previewContent.ts +31 -0
  98. package/src/context/buildContextDocument.test.ts +240 -0
  99. package/src/context/buildContextDocument.ts +309 -0
  100. package/src/context/contextAccess.ts +66 -0
  101. package/src/context/contextConfig.ts +72 -0
  102. package/src/context/contextDocument.test.ts +155 -0
  103. package/src/context/contextDocument.ts +300 -0
  104. package/src/context/contextSections.test.ts +88 -0
  105. package/src/context/contextSections.ts +84 -0
  106. package/src/context/htmlToContextMarkdown.test.ts +134 -0
  107. package/src/context/htmlToContextMarkdown.ts +369 -0
  108. package/src/ics/generateIcs.test.ts +153 -0
  109. package/src/ics/generateIcs.ts +197 -0
  110. package/src/index.ts +3 -0
  111. package/src/net/httpRetry.test.ts +117 -0
  112. package/src/net/httpRetry.ts +111 -0
  113. package/src/theme/appAccents.test.ts +36 -35
  114. package/src/theme/appAccents.ts +93 -104
  115. package/src/theme/appIdentityCss.mjs +178 -229
  116. package/src/theme/appIdentityCss.ts +222 -231
  117. package/src/theme/themes/dark.ts +3 -1
  118. package/src/theme/themes/light.ts +3 -1
  119. package/src/bridge/googleProviderConfig.ts +0 -73
@@ -2,9 +2,13 @@ import type { PlatformTheme } from './tokens.js'
2
2
 
3
3
  /**
4
4
  * App identity is a chrome-only layer. It is exposed through CSS variables
5
- * (`--app-acc`, `--app-bg`, `--app-text`, `--app-block`) and deliberately
6
- * does not override `--platform-colors-accent`, which belongs to theme/status
7
- * meaning.
5
+ * (`--app-acc`, `--app-bg`, `--app-text`) and deliberately does not override
6
+ * `--platform-colors-accent`, which belongs to theme/status meaning.
7
+ *
8
+ * Every app owns one hue on a 20-step ring (even ~18deg spacing, matched
9
+ * lightness/chroma in oklch). Writing and output apps are included; the
10
+ * `desktop` shell carries indigo. Keep these values in sync with
11
+ * `appIdentityCss.ts`.
8
12
  */
9
13
 
10
14
  export interface DerivedAppAccent {
@@ -12,149 +16,134 @@ export interface DerivedAppAccent {
12
16
  accentHover: string
13
17
  accentMuted: string
14
18
  accentText: string
15
- accentBlock: string
16
19
  }
17
20
 
18
21
  const APP_IDENTITY_ACCENTS: Record<string, DerivedAppAccent> = {
19
22
  teams: {
20
- accent: 'oklch(0.58 0.13 8)',
21
- accentHover: 'oklch(0.40 0.06 8)',
22
- accentMuted: 'oklch(0.955 0.03 8)',
23
- accentText: 'oklch(0.40 0.12 8)',
24
- accentBlock: 'oklch(0.40 0.06 8)',
23
+ accent: 'oklch(0.55 0.125 12)',
24
+ accentHover: 'oklch(0.43 0.12 12)',
25
+ accentMuted: 'oklch(0.955 0.03 12)',
26
+ accentText: 'oklch(0.43 0.12 12)',
25
27
  },
26
28
  vibes: {
27
- accent: 'oklch(0.50 0.14 26)',
28
- accentHover: 'oklch(0.40 0.06 26)',
29
- accentMuted: 'oklch(0.955 0.03 26)',
30
- accentText: 'oklch(0.40 0.12 26)',
31
- accentBlock: 'oklch(0.40 0.06 26)',
29
+ accent: 'oklch(0.55 0.125 30)',
30
+ accentHover: 'oklch(0.43 0.12 30)',
31
+ accentMuted: 'oklch(0.955 0.03 30)',
32
+ accentText: 'oklch(0.43 0.12 30)',
32
33
  },
33
34
  mail: {
34
- accent: 'oklch(0.60 0.12 44)',
35
- accentHover: 'oklch(0.40 0.06 44)',
36
- accentMuted: 'oklch(0.93 0.05 44)',
37
- accentText: 'oklch(0.40 0.12 44)',
38
- accentBlock: 'oklch(0.40 0.06 44)',
35
+ accent: 'oklch(0.55 0.125 48)',
36
+ accentHover: 'oklch(0.43 0.12 48)',
37
+ accentMuted: 'oklch(0.93 0.05 48)',
38
+ accentText: 'oklch(0.43 0.12 48)',
39
39
  },
40
40
  files: {
41
- accent: 'oklch(0.50 0.13 64)',
42
- accentHover: 'oklch(0.40 0.06 64)',
43
- accentMuted: 'oklch(0.955 0.03 64)',
44
- accentText: 'oklch(0.40 0.12 64)',
45
- accentBlock: 'oklch(0.40 0.06 64)',
41
+ accent: 'oklch(0.55 0.125 66)',
42
+ accentHover: 'oklch(0.43 0.12 66)',
43
+ accentMuted: 'oklch(0.955 0.03 66)',
44
+ accentText: 'oklch(0.43 0.12 66)',
46
45
  },
47
46
  slides: {
48
- accent: 'oklch(0.61 0.11 84)',
49
- accentHover: 'oklch(0.40 0.06 84)',
47
+ accent: 'oklch(0.55 0.125 84)',
48
+ accentHover: 'oklch(0.43 0.12 84)',
50
49
  accentMuted: 'oklch(0.955 0.03 84)',
51
- accentText: 'oklch(0.40 0.11 84)',
52
- accentBlock: 'oklch(0.40 0.06 84)',
50
+ accentText: 'oklch(0.43 0.12 84)',
53
51
  },
54
52
  writer: {
55
- accent: 'oklch(0.50 0.12 102)',
56
- accentHover: 'oklch(0.40 0.06 102)',
53
+ accent: 'oklch(0.55 0.125 102)',
54
+ accentHover: 'oklch(0.43 0.12 102)',
57
55
  accentMuted: 'oklch(0.955 0.03 102)',
58
- accentText: 'oklch(0.40 0.12 102)',
59
- accentBlock: 'oklch(0.40 0.06 102)',
56
+ accentText: 'oklch(0.43 0.12 102)',
60
57
  },
61
58
  manuscript: {
62
- accent: 'oklch(0.61 0.12 124)',
63
- accentHover: 'oklch(0.40 0.06 124)',
64
- accentMuted: 'oklch(0.955 0.03 124)',
65
- accentText: 'oklch(0.40 0.12 124)',
66
- accentBlock: 'oklch(0.40 0.06 124)',
59
+ accent: 'oklch(0.55 0.125 120)',
60
+ accentHover: 'oklch(0.43 0.12 120)',
61
+ accentMuted: 'oklch(0.955 0.03 120)',
62
+ accentText: 'oklch(0.43 0.12 120)',
67
63
  },
68
64
  book: {
69
- accent: 'oklch(0.48 0.14 148)',
70
- accentHover: 'oklch(0.40 0.06 148)',
71
- accentMuted: 'oklch(0.955 0.03 148)',
72
- accentText: 'oklch(0.40 0.12 148)',
73
- accentBlock: 'oklch(0.40 0.06 148)',
65
+ accent: 'oklch(0.55 0.125 138)',
66
+ accentHover: 'oklch(0.43 0.12 138)',
67
+ accentMuted: 'oklch(0.955 0.03 138)',
68
+ accentText: 'oklch(0.43 0.12 138)',
74
69
  },
75
70
  reports: {
76
- accent: 'oklch(0.61 0.12 166)',
77
- accentHover: 'oklch(0.40 0.06 166)',
78
- accentMuted: 'oklch(0.955 0.03 166)',
79
- accentText: 'oklch(0.40 0.12 166)',
80
- accentBlock: 'oklch(0.40 0.06 166)',
71
+ accent: 'oklch(0.55 0.125 156)',
72
+ accentHover: 'oklch(0.43 0.12 156)',
73
+ accentMuted: 'oklch(0.955 0.03 156)',
74
+ accentText: 'oklch(0.43 0.12 156)',
81
75
  },
82
76
  chart: {
83
- accent: 'oklch(0.48 0.13 184)',
84
- accentHover: 'oklch(0.40 0.06 184)',
85
- accentMuted: 'oklch(0.955 0.03 184)',
86
- accentText: 'oklch(0.40 0.12 184)',
87
- accentBlock: 'oklch(0.40 0.06 184)',
77
+ accent: 'oklch(0.55 0.125 174)',
78
+ accentHover: 'oklch(0.43 0.12 174)',
79
+ accentMuted: 'oklch(0.955 0.03 174)',
80
+ accentText: 'oklch(0.43 0.12 174)',
88
81
  },
89
82
  knowledge: {
90
- accent: 'oklch(0.46 0.11 198)',
91
- accentHover: 'oklch(0.40 0.06 198)',
92
- accentMuted: 'oklch(0.955 0.03 198)',
93
- accentText: 'oklch(0.40 0.11 198)',
94
- accentBlock: 'oklch(0.40 0.06 198)',
83
+ accent: 'oklch(0.55 0.125 192)',
84
+ accentHover: 'oklch(0.43 0.12 192)',
85
+ accentMuted: 'oklch(0.955 0.03 192)',
86
+ accentText: 'oklch(0.43 0.12 192)',
95
87
  },
96
88
  research: {
97
- accent: 'oklch(0.63 0.12 222)',
98
- accentHover: 'oklch(0.40 0.06 222)',
99
- accentMuted: 'oklch(0.955 0.03 222)',
100
- accentText: 'oklch(0.40 0.12 222)',
101
- accentBlock: 'oklch(0.40 0.06 222)',
89
+ accent: 'oklch(0.55 0.125 210)',
90
+ accentHover: 'oklch(0.43 0.12 210)',
91
+ accentMuted: 'oklch(0.955 0.03 210)',
92
+ accentText: 'oklch(0.43 0.12 210)',
102
93
  },
103
94
  sheets: {
104
- accent: 'oklch(0.50 0.13 244)',
105
- accentHover: 'oklch(0.40 0.06 244)',
106
- accentMuted: 'oklch(0.955 0.03 244)',
107
- accentText: 'oklch(0.40 0.12 244)',
108
- accentBlock: 'oklch(0.40 0.06 244)',
95
+ accent: 'oklch(0.55 0.125 228)',
96
+ accentHover: 'oklch(0.43 0.12 228)',
97
+ accentMuted: 'oklch(0.955 0.03 228)',
98
+ accentText: 'oklch(0.43 0.12 228)',
109
99
  },
110
100
  calendar: {
111
- accent: 'oklch(0.63 0.13 258)',
112
- accentHover: 'oklch(0.40 0.06 258)',
113
- accentMuted: 'oklch(0.955 0.03 258)',
114
- accentText: 'oklch(0.40 0.12 258)',
115
- accentBlock: 'oklch(0.40 0.06 258)',
101
+ accent: 'oklch(0.55 0.125 246)',
102
+ accentHover: 'oklch(0.43 0.12 246)',
103
+ accentMuted: 'oklch(0.955 0.03 246)',
104
+ accentText: 'oklch(0.43 0.12 246)',
116
105
  },
117
106
  desktop: {
118
- accent: 'oklch(0.48 0.13 274)',
119
- accentHover: 'oklch(0.40 0.06 274)',
120
- accentMuted: 'oklch(0.955 0.03 274)',
121
- accentText: 'oklch(0.40 0.12 274)',
122
- accentBlock: 'oklch(0.40 0.06 274)',
123
- },
124
- plan: {
125
- accent: 'oklch(0.61 0.14 290)',
126
- accentHover: 'oklch(0.40 0.06 290)',
127
- accentMuted: 'oklch(0.955 0.03 290)',
128
- accentText: 'oklch(0.40 0.12 290)',
129
- accentBlock: 'oklch(0.40 0.06 290)',
107
+ accent: 'oklch(0.55 0.125 264)',
108
+ accentHover: 'oklch(0.43 0.12 264)',
109
+ accentMuted: 'oklch(0.955 0.03 264)',
110
+ accentText: 'oklch(0.43 0.12 264)',
111
+ },
112
+ whiteboard: {
113
+ accent: 'oklch(0.55 0.125 282)',
114
+ accentHover: 'oklch(0.43 0.12 282)',
115
+ accentMuted: 'oklch(0.955 0.03 282)',
116
+ accentText: 'oklch(0.43 0.12 282)',
117
+ },
118
+ gantt: {
119
+ accent: 'oklch(0.55 0.125 306)',
120
+ accentHover: 'oklch(0.43 0.12 306)',
121
+ accentMuted: 'oklch(0.955 0.03 306)',
122
+ accentText: 'oklch(0.43 0.12 306)',
130
123
  },
131
124
  review: {
132
- accent: 'oklch(0.50 0.15 308)',
133
- accentHover: 'oklch(0.40 0.06 308)',
134
- accentMuted: 'oklch(0.955 0.03 308)',
135
- accentText: 'oklch(0.40 0.12 308)',
136
- accentBlock: 'oklch(0.40 0.06 308)',
125
+ accent: 'oklch(0.55 0.125 300)',
126
+ accentHover: 'oklch(0.43 0.12 300)',
127
+ accentMuted: 'oklch(0.955 0.03 300)',
128
+ accentText: 'oklch(0.43 0.12 300)',
137
129
  },
138
130
  tasks: {
139
- accent: 'oklch(0.63 0.15 324)',
140
- accentHover: 'oklch(0.40 0.06 324)',
141
- accentMuted: 'oklch(0.955 0.03 324)',
142
- accentText: 'oklch(0.40 0.12 324)',
143
- accentBlock: 'oklch(0.40 0.06 324)',
131
+ accent: 'oklch(0.55 0.125 318)',
132
+ accentHover: 'oklch(0.43 0.12 318)',
133
+ accentMuted: 'oklch(0.955 0.03 318)',
134
+ accentText: 'oklch(0.43 0.12 318)',
144
135
  },
145
136
  assistant: {
146
- accent: 'oklch(0.50 0.15 340)',
147
- accentHover: 'oklch(0.40 0.06 340)',
148
- accentMuted: 'oklch(0.955 0.03 340)',
149
- accentText: 'oklch(0.40 0.12 340)',
150
- accentBlock: 'oklch(0.40 0.06 340)',
137
+ accent: 'oklch(0.55 0.125 336)',
138
+ accentHover: 'oklch(0.43 0.12 336)',
139
+ accentMuted: 'oklch(0.955 0.03 336)',
140
+ accentText: 'oklch(0.43 0.12 336)',
151
141
  },
152
142
  people: {
153
- accent: 'oklch(0.61 0.14 356)',
154
- accentHover: 'oklch(0.40 0.06 356)',
155
- accentMuted: 'oklch(0.955 0.03 356)',
156
- accentText: 'oklch(0.40 0.12 356)',
157
- accentBlock: 'oklch(0.40 0.06 356)',
143
+ accent: 'oklch(0.55 0.125 354)',
144
+ accentHover: 'oklch(0.43 0.12 354)',
145
+ accentMuted: 'oklch(0.955 0.03 354)',
146
+ accentText: 'oklch(0.43 0.12 354)',
158
147
  },
159
148
  }
160
149