zidane-ui 9.5.2 → 9.6.1

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 (201) hide show
  1. package/dist/adapters/index.d.ts +2 -1
  2. package/dist/adapters/index.js +2 -1
  3. package/dist/adapters/server-git-host.js +67 -0
  4. package/dist/adapters/server-host.js +9 -0
  5. package/dist/adapters/server-oauth-flow.d.ts +2 -2
  6. package/dist/adapters/server-oauth-flow.js +1 -1
  7. package/dist/adapters/server-projects.d.ts +53 -2
  8. package/dist/adapters/server-projects.js +4 -3
  9. package/dist/adapters/server-session-host.js +112 -4
  10. package/dist/channels/BindingEditorDialog.js +1 -1
  11. package/dist/channels/ChannelDefaultsSection.js +1 -1
  12. package/dist/channels/ChannelsSettingsSection.js +1 -1
  13. package/dist/channels/ConnectionSetupDialog.js +1 -1
  14. package/dist/channels/HeldRepliesList.js +1 -1
  15. package/dist/channels/ProjectChannelsSection.js +1 -1
  16. package/dist/chat/HostTranscript.js +1 -0
  17. package/dist/chat/SessionGroupHeader.js +2 -2
  18. package/dist/chat/composer/ComposerBadges.d.ts +27 -1
  19. package/dist/chat/composer/ComposerBadges.js +41 -5
  20. package/dist/chat/composer/ConversationBadges.d.ts +6 -0
  21. package/dist/chat/composer/ConversationBadges.js +70 -3
  22. package/dist/chat/composer/DraftPickers.js +4 -0
  23. package/dist/chat/composer/ServerScopeToggle.d.ts +16 -1
  24. package/dist/chat/composer/ServerScopeToggle.js +90 -47
  25. package/dist/chat/composer/index.d.ts +2 -2
  26. package/dist/chat/composer/use-draft-target.d.ts +18 -2
  27. package/dist/chat/composer/use-draft-target.js +74 -7
  28. package/dist/chat/composer/use-new-session-defaults.d.ts +3 -1
  29. package/dist/chat/composer/use-new-session-defaults.js +19 -14
  30. package/dist/chat/composer/use-send-prompt.js +2 -2
  31. package/dist/chat/headless/composer/index.d.ts +2 -2
  32. package/dist/chat/headless/composer/index.js +2 -2
  33. package/dist/chat/headless/composer/labels-chrome.d.ts +7 -0
  34. package/dist/chat/headless/composer/labels-chrome.js +7 -0
  35. package/dist/chat/headless/composer/labels-editor.d.ts +4 -0
  36. package/dist/chat/headless/composer/labels-editor.js +4 -0
  37. package/dist/chat/headless/composer/models.d.ts +2 -0
  38. package/dist/chat/headless/composer/new-session-defaults.d.ts +12 -1
  39. package/dist/chat/headless/composer/new-session-defaults.js +30 -1
  40. package/dist/chat/headless/draft-target.d.ts +27 -6
  41. package/dist/chat/headless/draft-target.js +36 -3
  42. package/dist/chat/headless/host.d.ts +7 -0
  43. package/dist/chat/headless/index.d.ts +4 -4
  44. package/dist/chat/headless/index.js +29 -29
  45. package/dist/chat/headless/labels.d.ts +4 -0
  46. package/dist/chat/headless/send-flow.d.ts +2 -0
  47. package/dist/chat/headless/send-flow.js +2 -1
  48. package/dist/chat/headless/session-list.d.ts +4 -0
  49. package/dist/chat/headless/sidebar/index.d.ts +2 -2
  50. package/dist/chat/headless/sidebar/labels.d.ts +9 -1
  51. package/dist/chat/headless/sidebar/labels.js +4 -0
  52. package/dist/chat/headless/sidebar/rows.d.ts +48 -7
  53. package/dist/chat/headless/sidebar/rows.js +121 -22
  54. package/dist/chat/headless/sidebar/types.d.ts +5 -0
  55. package/dist/chat/headless/transcript/fold-actions.d.ts +8 -3
  56. package/dist/chat/headless/transcript/fold-actions.js +29 -1
  57. package/dist/chat/index.d.ts +2 -2
  58. package/dist/chat/index.js +2 -2
  59. package/dist/chat/rich-composer/RichComposer.js +58 -11
  60. package/dist/chat/rich-composer/composer-controls.d.ts +5 -1
  61. package/dist/chat/rich-composer/composer-controls.js +4 -4
  62. package/dist/chat/rich-composer/composer-keys.js +2 -2
  63. package/dist/chat/rich-composer/draft-collab.d.ts +91 -0
  64. package/dist/chat/rich-composer/draft-collab.js +310 -0
  65. package/dist/chat/rich-composer/use-composer-editor.d.ts +2 -0
  66. package/dist/chat/rich-composer/use-draft-collab.d.ts +53 -0
  67. package/dist/chat/rich-composer/use-draft-collab.js +92 -0
  68. package/dist/chat/rich-composer/use-draft-mirror.d.ts +11 -0
  69. package/dist/chat/rich-composer/use-draft-mirror.js +38 -9
  70. package/dist/chat/sidebar/InboxList.js +1 -1
  71. package/dist/chat/sidebar/ProjectIcon.d.ts +6 -2
  72. package/dist/chat/sidebar/ProjectIcon.js +7 -3
  73. package/dist/chat/sidebar/SessionSidebar.d.ts +30 -1
  74. package/dist/chat/sidebar/SessionSidebar.js +79 -7
  75. package/dist/chat/sidebar/SidebarGroupHeader.d.ts +12 -4
  76. package/dist/chat/sidebar/SidebarGroupHeader.js +70 -28
  77. package/dist/chat/sidebar/index.d.ts +2 -2
  78. package/dist/chat/transcript/actions.d.ts +6 -0
  79. package/dist/chat/transcript/fold.d.ts +2 -1
  80. package/dist/chat/transcript/fold.js +26 -1
  81. package/dist/chat/transcript/index.js +3 -3
  82. package/dist/chat/transcript/notices.d.ts +5 -2
  83. package/dist/chat/transcript/notices.js +23 -3
  84. package/dist/chat/transcript/script-input.d.ts +1 -1
  85. package/dist/components/Avatar.d.ts +36 -0
  86. package/dist/components/Avatar.js +56 -0
  87. package/dist/components/AvatarStack.d.ts +58 -0
  88. package/dist/components/AvatarStack.js +187 -0
  89. package/dist/components/Tabs.d.ts +6 -1
  90. package/dist/components/Tabs.js +43 -39
  91. package/dist/core.css +19 -1
  92. package/dist/dist/{index-DPbpsCtl.d.ts → index-ChabiHpR.d.ts} +1 -1
  93. package/dist/dist/index.d.ts +1 -1
  94. package/dist/git/headless/environment.d.ts +15 -0
  95. package/dist/git/headless/environment.js +18 -1
  96. package/dist/git/headless/github.d.ts +11 -0
  97. package/dist/git/headless/github.js +15 -0
  98. package/dist/git/headless/host.d.ts +109 -0
  99. package/dist/git/headless/index.d.ts +5 -4
  100. package/dist/git/headless/index.js +4 -3
  101. package/dist/git/headless/labels.d.ts +16 -1
  102. package/dist/git/headless/labels.js +25 -1
  103. package/dist/git/testing/contract.d.ts +22 -4
  104. package/dist/git/testing/contract.js +173 -3
  105. package/dist/git/testing/index.d.ts +22 -1
  106. package/dist/git/testing/index.js +135 -1
  107. package/dist/index.d.ts +3 -1
  108. package/dist/index.js +3 -1
  109. package/dist/labels.d.ts +4 -0
  110. package/dist/labels.js +4 -0
  111. package/dist/onboarding/headless/labels.d.ts +4 -0
  112. package/dist/session/DraftPeopleStack.d.ts +24 -0
  113. package/dist/session/DraftPeopleStack.js +48 -0
  114. package/dist/session/NewProjectDialog.d.ts +28 -8
  115. package/dist/session/NewProjectDialog.js +225 -40
  116. package/dist/session/PersonCard.d.ts +29 -0
  117. package/dist/session/PersonCard.js +199 -0
  118. package/dist/session/ProjectArtifactsSection.d.ts +4 -1
  119. package/dist/session/ProjectArtifactsSection.js +149 -34
  120. package/dist/session/ProjectHome.d.ts +1 -1
  121. package/dist/session/ProjectHome.js +23 -4
  122. package/dist/session/ProjectName.d.ts +11 -6
  123. package/dist/session/ProjectName.js +27 -13
  124. package/dist/session/ProjectPeopleStack.d.ts +26 -0
  125. package/dist/session/ProjectPeopleStack.js +56 -0
  126. package/dist/session/ProjectPublishDialog.js +9 -3
  127. package/dist/session/ProjectSettingsDialog.d.ts +1 -1
  128. package/dist/session/ProjectSettingsDialog.js +171 -66
  129. package/dist/session/ProjectShareDialog.d.ts +1 -1
  130. package/dist/session/ProjectShareDialog.js +16 -6
  131. package/dist/session/ProjectToolsSection.js +88 -96
  132. package/dist/session/ProjectUsage.d.ts +4 -1
  133. package/dist/session/ProjectUsage.js +13 -4
  134. package/dist/session/SessionDetailsDialog.d.ts +5 -1
  135. package/dist/session/SessionDetailsDialog.js +67 -10
  136. package/dist/session/SessionPeopleStack.js +19 -37
  137. package/dist/session/SessionProjectPicker.d.ts +54 -0
  138. package/dist/session/SessionProjectPicker.js +175 -0
  139. package/dist/session/SessionProvider.d.ts +15 -1
  140. package/dist/session/SessionProvider.js +28 -6
  141. package/dist/session/UsageSection.d.ts +2 -4
  142. package/dist/session/UsageSection.js +57 -55
  143. package/dist/session/headless/draft-collab.d.ts +55 -0
  144. package/dist/session/headless/draft-collab.js +127 -0
  145. package/dist/session/headless/draft-room.d.ts +124 -0
  146. package/dist/session/headless/draft-room.js +340 -0
  147. package/dist/session/headless/drafts.d.ts +93 -0
  148. package/dist/session/headless/drafts.js +79 -0
  149. package/dist/session/headless/fixture-drafts.d.ts +54 -0
  150. package/dist/session/headless/fixture-drafts.js +286 -0
  151. package/dist/session/headless/fixture-host.d.ts +18 -2
  152. package/dist/session/headless/fixture-host.js +41 -7
  153. package/dist/session/headless/fixture-projects.d.ts +6 -4
  154. package/dist/session/headless/fixture-projects.js +25 -4
  155. package/dist/session/headless/host.d.ts +34 -6
  156. package/dist/session/headless/index.d.ts +6 -3
  157. package/dist/session/headless/index.js +6 -3
  158. package/dist/session/headless/labels.d.ts +47 -2
  159. package/dist/session/headless/labels.js +17 -1
  160. package/dist/session/headless/people.d.ts +27 -3
  161. package/dist/session/headless/people.js +38 -20
  162. package/dist/session/headless/project-artifact-labels.d.ts +7 -0
  163. package/dist/session/headless/project-artifact-labels.js +7 -0
  164. package/dist/session/headless/project-artifacts.d.ts +8 -0
  165. package/dist/session/headless/project-artifacts.js +15 -1
  166. package/dist/session/headless/project-labels.d.ts +25 -0
  167. package/dist/session/headless/project-labels.js +25 -0
  168. package/dist/session/headless/shared-with.d.ts +28 -0
  169. package/dist/session/headless/shared-with.js +51 -0
  170. package/dist/session/host-context.d.ts +11 -0
  171. package/dist/session/host-context.js +14 -0
  172. package/dist/session/index.d.ts +7 -3
  173. package/dist/session/index.js +6 -2
  174. package/dist/session/new-project-parts.d.ts +67 -0
  175. package/dist/session/new-project-parts.js +470 -0
  176. package/dist/session/project-artifact-parts.d.ts +2 -1
  177. package/dist/session/project-artifact-parts.js +5 -2
  178. package/dist/session/project-people.d.ts +14 -0
  179. package/dist/session/project-people.js +86 -0
  180. package/dist/session/share-people.d.ts +12 -0
  181. package/dist/session/share-people.js +1 -1
  182. package/dist/session/testing/contract.d.ts +6 -3
  183. package/dist/session/testing/contract.js +24 -3
  184. package/dist/session/testing/drafts.contract.d.ts +30 -0
  185. package/dist/session/testing/drafts.contract.js +126 -0
  186. package/dist/session/testing/index.d.ts +2 -1
  187. package/dist/session/testing/index.js +2 -1
  188. package/dist/session/use-home-projects.d.ts +11 -2
  189. package/dist/session/use-home-projects.js +142 -5
  190. package/dist/session/useDraftCollab.d.ts +24 -0
  191. package/dist/session/useDraftCollab.js +78 -0
  192. package/dist/settings/headless/search.d.ts +1 -1
  193. package/dist/settings/index.js +9 -9
  194. package/dist/settings/sections/index.js +1 -1
  195. package/dist/settings/sections/providers/CredentialSources.d.ts +5 -5
  196. package/dist/settings/sections/providers/CredentialSources.js +5 -22
  197. package/dist/settings/sections/providers/labels.d.ts +1 -9
  198. package/dist/settings/sections/providers/labels.js +1 -9
  199. package/dist/styles.css +20 -9
  200. package/package.json +4 -3
  201. package/src/styles/sidebar.css +2 -3
@@ -5,7 +5,7 @@ import { useProjectIcons } from "../chat/sidebar/ProjectIcon.js";
5
5
  import { errorMessage } from "../components/report-error.js";
6
6
  import { ProjectRefusedError, folderlessProjects, managesProject } from "./headless/projects.js";
7
7
  import { createPushedOnce } from "./headless/pushed-once.js";
8
- import { useProjectList, useSessionProjects } from "./SessionProvider.js";
8
+ import { useProjectList, useSessionProjects, useSessionProjectsOf } from "./SessionProvider.js";
9
9
  import { useSessionLabels } from "./useSessionLabels.js";
10
10
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
11
11
  // src/session/use-home-projects.ts
@@ -16,11 +16,13 @@ const NO_RECORDS = [];
16
16
  const NO_SESSIONS = [];
17
17
  const NOTHING_RESOLVED = /* @__PURE__ */ new Map();
18
18
  const NOTHING_FILED = {};
19
+ const NO_SERVERS = [];
20
+ const NOTHING_READ = /* @__PURE__ */ new Map();
19
21
  /** One key per set of this host's sessions and their folders: what can file a session elsewhere. */
20
22
  function filingKey(sessions) {
21
- let key = "";
22
- for (const session of sessions) if (!session.hostId && session.id !== void 0) key += `${session.id}\u0001${projectPathOf(session)}\u0000`;
23
- return key;
23
+ const keys = [];
24
+ for (const session of sessions) if (!session.hostId && session.id !== void 0) keys.push(`${session.id}\u0001${projectPathOf(session)}`);
25
+ return keys.sort().join("\0");
24
26
  }
25
27
  /** The paths of the sidebar's groups of this host's folders, sorted, one per folder. */
26
28
  function localFolders(sessions) {
@@ -32,8 +34,142 @@ function localFolders(sessions) {
32
34
  return [...folders].sort();
33
35
  }
34
36
  /**
37
+ * The servers the sessions are on, sorted, and one key per set of each one's sessions and their folders: the order
38
+ * the list gives them in (most recent first) does not move it.
39
+ */
40
+ function serverFiling(sessions) {
41
+ const by = /* @__PURE__ */ new Map();
42
+ for (const session of sessions) {
43
+ if (!session.hostId) continue;
44
+ const keys = by.get(session.hostId) ?? [];
45
+ keys.push(`${session.id ?? ""}\u0001${projectPathOf(session)}`);
46
+ by.set(session.hostId, keys);
47
+ }
48
+ const hosts = [...by.keys()].sort();
49
+ return {
50
+ hosts: hosts.join("\0"),
51
+ filing: hosts.map((hostId) => `${hostId}\u0002${by.get(hostId).sort().join("\0")}`).join("")
52
+ };
53
+ }
54
+ /**
55
+ * The projects of each server the sessions are on (`projectsOf`), with the sessions filed in each, once its list is read.
56
+ *
57
+ * @param enabled - Read them. Off, nothing is read.
58
+ * @param sessions - The sessions the sidebar lists.
59
+ */
60
+ function useServerProjects(enabled, sessions) {
61
+ const projectsOf = useSessionProjectsOf();
62
+ const of = enabled ? projectsOf : void 0;
63
+ const { hosts, filing } = useMemo(() => serverFiling(sessions), [sessions]);
64
+ const [reads, setReads] = useState(NOTHING_READ);
65
+ /** Each watched server's read of its filed sessions. */
66
+ const refile = useRef(/* @__PURE__ */ new Set());
67
+ useEffect(() => {
68
+ if (!of || !hosts) return void 0;
69
+ let live = true;
70
+ const write = (hostId, read) => live && setReads((all) => {
71
+ const next = new Map(all);
72
+ if (read) next.set(hostId, read);
73
+ else next.delete(hostId);
74
+ return next;
75
+ });
76
+ const stops = hosts.split("\0").map((hostId) => {
77
+ const store = of(hostId);
78
+ let detach = () => {};
79
+ const attach = () => {
80
+ detach();
81
+ detach = () => {};
82
+ const projects = store.get();
83
+ if (!projects) {
84
+ write(hostId, null);
85
+ return;
86
+ }
87
+ let filed = NOTHING_FILED;
88
+ let seq = 0;
89
+ const publish = () => {
90
+ const list = projects.list.get();
91
+ if (list) write(hostId, {
92
+ list,
93
+ filed
94
+ });
95
+ };
96
+ const readFiled = () => {
97
+ const at = ++seq;
98
+ projects.sessionProjects?.().then((map) => {
99
+ if (!live || at !== seq) return;
100
+ filed = map && typeof map === "object" ? map : NOTHING_FILED;
101
+ publish();
102
+ }, () => void 0);
103
+ };
104
+ const onList = () => {
105
+ if (!projects.list.get()) return;
106
+ publish();
107
+ readFiled();
108
+ };
109
+ const offList = projects.list.subscribe(onList);
110
+ projects.ensure();
111
+ onList();
112
+ refile.current.add(readFiled);
113
+ detach = () => {
114
+ offList();
115
+ refile.current.delete(readFiled);
116
+ seq++;
117
+ };
118
+ };
119
+ const offStore = store.subscribe(attach);
120
+ attach();
121
+ return () => {
122
+ offStore();
123
+ detach();
124
+ };
125
+ });
126
+ return () => {
127
+ live = false;
128
+ for (const stop of stops) stop();
129
+ };
130
+ }, [of, hosts]);
131
+ const filedAt = useRef({
132
+ hosts,
133
+ filing
134
+ });
135
+ useEffect(() => {
136
+ const was = filedAt.current;
137
+ filedAt.current = {
138
+ hosts,
139
+ filing
140
+ };
141
+ if (was.hosts !== hosts || was.filing === filing) return;
142
+ for (const read of refile.current) read();
143
+ }, [hosts, filing]);
144
+ return useMemo(() => {
145
+ if (!of || !hosts) return NO_SERVERS;
146
+ const out = [];
147
+ for (const hostId of hosts.split("\0")) {
148
+ const read = reads.get(hostId);
149
+ if (!read) continue;
150
+ const filedBy = /* @__PURE__ */ new Map();
151
+ for (const [sessionId, projectId] of Object.entries(read.filed)) filedBy.set(projectId, [...filedBy.get(projectId) ?? [], sessionId]);
152
+ out.push({
153
+ hostId,
154
+ projects: read.list.map((p) => ({
155
+ id: p.id,
156
+ name: p.name,
157
+ ...p.home ? { home: p.home } : {},
158
+ ...p.settings?.projectIcon ? { icon: p.settings.projectIcon } : {},
159
+ ...filedBy.has(p.id) ? { sessions: filedBy.get(p.id) } : {}
160
+ }))
161
+ });
162
+ }
163
+ return out.length > 0 ? out : NO_SERVERS;
164
+ }, [
165
+ of,
166
+ hosts,
167
+ reads
168
+ ]);
169
+ }
170
+ /**
35
171
  * The sidebar's projects: those with a home folder, their folders and their icons, and the window's icons sent to the
36
- * host once; and those with no folder, with their icons.
172
+ * host once; and those with no folder, with their icons; and each listed server's.
37
173
  *
38
174
  * @param enabled - Read them (`Settings.projectHome`). Off, nothing is read or written.
39
175
  * @param sessions - The sessions the sidebar lists: their folders that are no project's home are resolved on the host.
@@ -148,6 +284,7 @@ function useHomeProjects(enabled, sessions = NO_SESSIONS) {
148
284
  return {
149
285
  homeProjects,
150
286
  folderlessProjects: recordProjects,
287
+ serverProjects: useServerProjects(enabled, sessions),
151
288
  ...setSettings ? { onSetProjectIcon } : {}
152
289
  };
153
290
  }
@@ -0,0 +1,24 @@
1
+ import { DraftCollab, DraftComposerState } from "./headless/draft-collab.js";
2
+ import { DraftRoomClient, DraftRoomView } from "./headless/draft-room.js";
3
+ import { DraftingPerson } from "./headless/drafts.js";
4
+ /** The window's collaborative drafts, or `null` when the host has none (or outside a `SessionProvider`). */
5
+ export declare function useDraftCollab(): DraftCollab | null;
6
+ /**
7
+ * What a session's composer shows: whose draft, and the room it edits in.
8
+ *
9
+ * @param sessionId - The session (`null`: a new chat, which has none).
10
+ */
11
+ export declare function useDraftComposer(sessionId: string | null): DraftComposerState;
12
+ /**
13
+ * A room's status and people, kept current.
14
+ *
15
+ * @param room - The room's client (`null`: none).
16
+ */
17
+ export declare function useDraftRoomView(room: DraftRoomClient | null): DraftRoomView;
18
+ /**
19
+ * Who else drafts in a session now, newest first: the people who have it open (presence), and the one whose draft
20
+ * the composer shows, whatever presence and the server's list say (its tab is the way back to your own draft).
21
+ *
22
+ * @param sessionId - The session (`null`: none).
23
+ */
24
+ export declare function useDraftingHere(sessionId: string | null): readonly DraftingPerson[];
@@ -0,0 +1,78 @@
1
+ import { draftCollabOf } from "./headless/draft-collab.js";
2
+ import { useSessionSharing } from "./SessionProvider.js";
3
+ import { useEffect, useMemo, useState, useSyncExternalStore } from "react";
4
+ // src/session/useDraftCollab.ts
5
+ const NONE = {
6
+ viewing: null,
7
+ room: null
8
+ };
9
+ const NO_VIEW = {
10
+ status: "idle",
11
+ people: []
12
+ };
13
+ const NOBODY = [];
14
+ const nothing = () => () => {};
15
+ /** The window's collaborative drafts, or `null` when the host has none (or outside a `SessionProvider`). */
16
+ function useDraftCollab() {
17
+ const drafts = useSessionSharing()?.drafts;
18
+ return useMemo(() => drafts ? draftCollabOf(drafts) : null, [drafts]);
19
+ }
20
+ /**
21
+ * What a session's composer shows: whose draft, and the room it edits in.
22
+ *
23
+ * @param sessionId - The session (`null`: a new chat, which has none).
24
+ */
25
+ function useDraftComposer(sessionId) {
26
+ const collab = useDraftCollab();
27
+ const store = useMemo(() => collab && sessionId ? collab.composer(sessionId) : null, [collab, sessionId]);
28
+ return useSyncExternalStore(store ? store.subscribe : nothing, store ? store.get : () => NONE, store ? store.get : () => NONE);
29
+ }
30
+ /**
31
+ * A room's status and people, kept current.
32
+ *
33
+ * @param room - The room's client (`null`: none).
34
+ */
35
+ function useDraftRoomView(room) {
36
+ return useSyncExternalStore(room ? room.view.subscribe : nothing, room ? room.view.get : () => NO_VIEW, room ? room.view.get : () => NO_VIEW);
37
+ }
38
+ /**
39
+ * Who else drafts in a session now, newest first: the people who have it open (presence), and the one whose draft
40
+ * the composer shows, whatever presence and the server's list say (its tab is the way back to your own draft).
41
+ *
42
+ * @param sessionId - The session (`null`: none).
43
+ */
44
+ function useDraftingHere(sessionId) {
45
+ const collab = useDraftCollab();
46
+ const people = useSessionSharing()?.people;
47
+ const { viewing, room } = useDraftComposer(sessionId);
48
+ const roomPeople = useDraftRoomView(room).people;
49
+ const [drafting, setDrafting] = useState(NOBODY);
50
+ const [here, setHere] = useState(null);
51
+ useEffect(() => {
52
+ if (!collab || !sessionId) return void 0;
53
+ return collab.drafting.watch(sessionId, setDrafting);
54
+ }, [collab, sessionId]);
55
+ useEffect(() => {
56
+ if (!people || !sessionId) return void 0;
57
+ return people.watch(sessionId, setHere);
58
+ }, [people, sessionId]);
59
+ return useMemo(() => {
60
+ if (!collab || !sessionId) return NOBODY;
61
+ const present = here ? new Set(here.map((person) => person.userId)) : null;
62
+ const shown = drafting.filter((person) => !present || present.has(person.userId) || person.userId === viewing);
63
+ const owner = viewing !== null && !shown.some((person) => person.userId === viewing) ? roomPeople.find((person) => person.userId === viewing) : void 0;
64
+ if (owner) return [...shown, {
65
+ ...owner,
66
+ since: 0
67
+ }];
68
+ return shown.length === drafting.length ? drafting : shown;
69
+ }, [
70
+ collab,
71
+ sessionId,
72
+ drafting,
73
+ here,
74
+ viewing,
75
+ roomPeople
76
+ ]);
77
+ }
78
+ export { useDraftCollab, useDraftComposer, useDraftRoomView, useDraftingHere };
@@ -12,7 +12,7 @@
12
12
  * best first, once each, and `groupSettingsResults` groups them by page
13
13
  * and section.
14
14
  */
15
- import { TF as Settings } from "../../dist/index-DPbpsCtl.js";
15
+ import { DF as Settings } from "../../dist/index-ChabiHpR.js";
16
16
  import { SettingsActionId, SettingsPage } from "./layout.js";
17
17
  import { SettingsSearchEntry, SettingsSection } from "./registry.js";
18
18
  import { SettingSurface } from "zidane/chat/pure";
@@ -8,25 +8,21 @@ import { DEFAULT_CATALOG_SHARED_LABELS } from "./sections/shared/labels.js";
8
8
  import { DEFAULT_EXTENSION_OPTIONS_LABELS } from "./sections/extensions/options-labels.js";
9
9
  import { McpRequirementRow } from "./sections/extensions/McpRequirementRow.js";
10
10
  import { ExtensionActionRow, ExtensionConfigRow, extensionConfigValue, useExtensionOptionsLabels } from "./sections/extensions/ExtensionConfigRows.js";
11
+ import { DEFAULT_ACCOUNTS_SECTION_LABELS } from "./sections/providers/labels.js";
12
+ import { ProvidersSection, useAccountsSectionLabels } from "./sections/providers/ProvidersSection.js";
13
+ import { ServerSignIn } from "./sections/providers/ServerSignIn.js";
11
14
  import { scopeLabel, useScopeLabel } from "./scope.js";
12
15
  import { SettingFocus, SettingsPanel, SettingsPanelActions, SettingsPanelBody, useSettingsSection } from "./section.js";
13
16
  import { useServerAppSettingsSections } from "./server-app.js";
14
17
  import { ScopeBadge, SettingBadges, SettingCard, SettingChoiceCards, SettingNoteLine } from "./SettingCard.js";
15
- import { DEFAULT_ACCOUNTS_SECTION_LABELS } from "./sections/providers/labels.js";
16
- import { ProvidersSection, useAccountsSectionLabels } from "./sections/providers/ProvidersSection.js";
17
- import { ServerSignIn } from "./sections/providers/ServerSignIn.js";
18
18
  import { SettingDemo } from "./SettingDemo.js";
19
- import { DEFAULT_INSTRUCTIONS_SECTION_LABELS } from "./sections/instructions/labels.js";
20
- import { ContextShareBar, ContextTokensChip, INSTRUCTIONS_FILE_COLOR, InstructionCard, InstructionsSection, useInstructionsSectionLabels } from "./sections/instructions/InstructionsSection.js";
21
- import { ModelPickField, modelPickLabel } from "./sections/models/ModelPickField.js";
22
- import { AgentDefaultsRows, agentDefaultsOf, agentDefaultsPatch } from "./sections/models/AgentDefaults.js";
23
- import { DEFAULT_SKILLS_SECTION_LABELS } from "./sections/skills/labels.js";
24
- import { useSkillsSectionLabels } from "./sections/skills/SkillList.js";
25
19
  import { AppUpdateButton, SettingsSetupRow, SettingsVersionRow } from "./SettingsFooter.js";
26
20
  import { SettingsHeadingText } from "./SettingsHeadingText.js";
27
21
  import { SettingsHostSwitcher } from "./SettingsHostSwitcher.js";
28
22
  import { SettingsNav, navOrder } from "./SettingsNav.js";
29
23
  import { SettingsProvider, useSettings, useSettingsDocument, useSettingsHost, useSettingsHostName, useSettingsLabels, useSettingsWritable } from "./SettingsProvider.js";
24
+ import { ModelPickField, modelPickLabel } from "./sections/models/ModelPickField.js";
25
+ import { AgentDefaultsRows, agentDefaultsOf, agentDefaultsPatch } from "./sections/models/AgentDefaults.js";
30
26
  import { ApprovalModeCard, ApprovalModeRow, CompactionModelRow, ConversationPresetsRow, DecisionModelRow, TextModelRow, automaticTextModel } from "./sections/models/ModelRows.js";
31
27
  import { SettingsRowsPage } from "./SettingsRowsPage.js";
32
28
  import { DEFAULT_KEYBINDINGS_SECTION_LABELS } from "./sections/keybindings/labels.js";
@@ -48,8 +44,12 @@ import { ExtensionSourceBrowser, extensionPickOf } from "./sections/extensions/E
48
44
  import { ExtensionActions, ExtensionList, ExtensionsSection, useExtensionsSectionLabels } from "./sections/extensions/ExtensionsSection.js";
49
45
  import { DEFAULT_PLUGINS_SECTION_LABELS } from "./sections/plugins/labels.js";
50
46
  import { PluginList, PluginsSection, usePluginsSectionLabels } from "./sections/plugins/PluginsSection.js";
47
+ import { DEFAULT_SKILLS_SECTION_LABELS } from "./sections/skills/labels.js";
48
+ import { useSkillsSectionLabels } from "./sections/skills/SkillList.js";
51
49
  import { DEFAULT_HOST_CATALOG_LABELS } from "./sections/host-catalog/labels.js";
52
50
  import { HostCatalogSection, useHostCatalogLabels } from "./sections/host-catalog/HostCatalogSection.js";
51
+ import { DEFAULT_INSTRUCTIONS_SECTION_LABELS } from "./sections/instructions/labels.js";
52
+ import { ContextShareBar, ContextTokensChip, INSTRUCTIONS_FILE_COLOR, InstructionCard, InstructionsSection, useInstructionsSectionLabels } from "./sections/instructions/InstructionsSection.js";
53
53
  import { KeybindingsSection, useKeybindingsSectionLabels } from "./sections/keybindings/KeybindingsSection.js";
54
54
  import { DEFAULT_LOGS_SECTION_LABELS } from "./sections/logs/labels.js";
55
55
  import { LogsSection, useLogsSectionLabels } from "./sections/logs/LogsSection.js";
@@ -14,7 +14,6 @@ import { DEFAULT_CREATE_EXTENSION_LABELS } from "./extensions/create-labels.js";
14
14
  import { CreateExtensionDialog, useCreateExtensionLabels } from "./extensions/CreateExtensionDialog.js";
15
15
  import { ExtensionActionRow, ExtensionConfigRow, extensionConfigValue, useExtensionOptionsLabels } from "./extensions/ExtensionConfigRows.js";
16
16
  import { ExtensionOptionsSection, useExtensionOptionsSearch } from "./extensions/ExtensionOptionsSection.js";
17
- import { useSkillsSectionLabels } from "./skills/SkillList.js";
18
17
  import { ExtensionSourceBrowser, extensionPickOf } from "./extensions/ExtensionSourceBrowser.js";
19
18
  import { ExtensionActions, ExtensionList, ExtensionsSection, useExtensionsSectionLabels } from "./extensions/ExtensionsSection.js";
20
19
  import { DEFAULT_EXTENSIONS_SECTION_LABELS } from "./extensions/labels.js";
@@ -32,6 +31,7 @@ import { LogsSection, useLogsSectionLabels } from "./logs/LogsSection.js";
32
31
  import { DEFAULT_MCP_SECTION_LABELS } from "./mcp/labels.js";
33
32
  import { McpSection, useMcpSectionLabels } from "./mcp/McpSection.js";
34
33
  import { AgentDefaultsRows, agentDefaultsOf, agentDefaultsPatch } from "./models/AgentDefaults.js";
34
+ import { useSkillsSectionLabels } from "./skills/SkillList.js";
35
35
  import { DEFAULT_MODEL_ROWS_LABELS } from "./models/labels.js";
36
36
  import { ModelTestButton, ModelTestLine, useModelRowsLabels, useModelTest } from "./models/model-test.js";
37
37
  import { ModelListPicker, filterModelList } from "./models/ModelListPicker.js";
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * The credential sources of a provider holding more than one stored (an API
3
3
  * key and an OAuth account side by side, or several accounts): each source
4
- * with the one in use marked, and the actions the host offers on it: Use
5
- * (a button, or "In use" in its place), then Rename, Re-auth and Remove as
6
- * icon buttons with tooltips, in one aligned column. Parity with the TUI's expandable auth rows; a
7
- * provider with one stored source never renders this.
4
+ * with the actions the host offers on it, Rename, Re-auth and Remove, as icon
5
+ * buttons with tooltips in one aligned column. Which account a chat runs on
6
+ * is picked with its model, so no source is marked "in use". A provider with
7
+ * one stored source never renders this.
8
8
  *
9
9
  * `env` is shown for context only: it is observed, not stored, so it has no
10
- * action and is never in use.
10
+ * action.
11
11
  */
12
12
  import { ConfirmOptions } from "../../../components/ConfirmDialog.js";
13
13
  import { SettingsError } from "../../headless/host.js";
@@ -12,7 +12,7 @@ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
12
12
  function CredentialSources({ provider, cwd, host, labels: l, confirm, onError, onReauth }) {
13
13
  const [busy, setBusy] = useState(null);
14
14
  const [renaming, setRenaming] = useState(null);
15
- const { setPreferred, remove: removeCredential, rename } = host;
15
+ const { remove: removeCredential, rename } = host;
16
16
  const identity = (method) => method.key ?? method.source;
17
17
  const run = async (id, op) => {
18
18
  try {
@@ -25,12 +25,11 @@ function CredentialSources({ provider, cwd, host, labels: l, confirm, onError, o
25
25
  setBusy(null);
26
26
  }
27
27
  };
28
- const use = (method) => run(`use:${identity(method)}`, () => setPreferred(cwd, provider.key, method.key ? { key: method.key } : method.source));
29
28
  const remove = async (method) => {
30
29
  const key = method.key;
31
30
  if (!key) return;
32
31
  if (!await confirm({
33
- title: l.accountsRemoveConfirm(provider.label, method.label ?? method.source, method.active === true),
32
+ title: l.accountsRemoveConfirm(provider.label, method.label ?? method.source),
34
33
  confirmLabel: l.accountsRemove,
35
34
  destructive: true
36
35
  })) return;
@@ -49,18 +48,16 @@ function CredentialSources({ provider, cwd, host, labels: l, confirm, onError, o
49
48
  "aria-label": l.accountsSources(provider.label),
50
49
  children: provider.methods.map((method) => {
51
50
  const isEnv = method.source === "env";
52
- const selectable = !isEnv && !method.active && setPreferred !== void 0;
53
51
  const id = identity(method);
54
52
  const title = method.label ?? method.source;
55
53
  const isRenaming = renaming !== null && renaming.key === method.key;
56
54
  const renamable = method.source === "oauth" && !!method.key;
57
55
  return /* @__PURE__ */ jsxs("li", {
58
- "data-active": method.active ? "" : void 0,
59
- className: "grid grid-cols-[14px_minmax(0,1fr)_auto] items-center gap-x-2.5 min-h-11 px-2.5 py-1.5 rounded-zg-sm data-[active]:bg-[var(--zg-raised)]",
56
+ className: "grid grid-cols-[14px_minmax(0,1fr)_auto] items-center gap-x-2.5 min-h-11 px-2.5 py-1.5 rounded-zg-sm",
60
57
  children: [
61
58
  /* @__PURE__ */ jsx("span", {
62
59
  "aria-hidden": true,
63
- className: `justify-self-center w-2 h-2 rounded-full ${method.active ? "bg-zg-success" : isEnv ? "bg-[var(--zg-text-subtle)]" : "ring-1 ring-inset ring-[var(--zg-text-subtle)]"}`
60
+ className: `justify-self-center w-2 h-2 rounded-full ${isRenaming ? "self-center" : "self-start mt-1.5"} ${isEnv ? "bg-[var(--zg-text-subtle)]" : "bg-zg-success"}`
64
61
  }),
65
62
  isRenaming ? /* @__PURE__ */ jsx("input", {
66
63
  autoFocus: true,
@@ -80,7 +77,7 @@ function CredentialSources({ provider, cwd, host, labels: l, confirm, onError, o
80
77
  }) : /* @__PURE__ */ jsxs("span", {
81
78
  className: "flex flex-col min-w-0",
82
79
  children: [/* @__PURE__ */ jsx("span", {
83
- className: `text-zg-ui leading-5 truncate text-[var(--zg-text)] ${method.active ? "font-medium" : ""}`,
80
+ className: "text-zg-ui leading-5 truncate text-[var(--zg-text)]",
84
81
  children: title
85
82
  }), (method.email || method.detail) && /* @__PURE__ */ jsxs("span", {
86
83
  className: "flex items-baseline gap-1.5 min-w-0 leading-4",
@@ -114,20 +111,6 @@ function CredentialSources({ provider, cwd, host, labels: l, confirm, onError, o
114
111
  title: l.accountsRenameCancelTitle,
115
112
  children: l.accountsRenameCancel
116
113
  })] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
117
- method.active ? /* @__PURE__ */ jsx("span", {
118
- className: "zg-meta-chip text-zg-meta text-zg-success min-w-[4.5rem] justify-center",
119
- children: l.accountsInUse
120
- }) : selectable ? /* @__PURE__ */ jsx("button", {
121
- type: "button",
122
- disabled: busy !== null,
123
- onClick: () => void use(method),
124
- className: `${buttonClass({
125
- variant: "secondary",
126
- size: "sm"
127
- })} min-w-[4.5rem]`,
128
- title: l.accountsUseTitle(method.source, provider.label),
129
- children: busy === `use:${id}` ? l.accountsSwitching : l.accountsUse
130
- }) : null,
131
114
  renamable && rename && /* @__PURE__ */ jsx(IconButton, {
132
115
  icon: "i-ph-pencil-simple",
133
116
  label: busy === `rename:${id}` ? l.accountsRenaming : l.accountsRename,
@@ -64,8 +64,6 @@ export declare const DEFAULT_ACCOUNTS_SECTION_LABELS: {
64
64
  accountsKeyField: (provider: string) => string;
65
65
  /** The credential sources list's name. */
66
66
  accountsSources: (provider: string) => string;
67
- /** After the credential in use. */
68
- accountsInUse: string;
69
67
  /** The rename field's name. */
70
68
  accountsRenameField: (name: string) => string;
71
69
  /** The rename field's placeholder. */
@@ -78,12 +76,6 @@ export declare const DEFAULT_ACCOUNTS_SECTION_LABELS: {
78
76
  accountsRenameCancel: string;
79
77
  /** Its tooltip. */
80
78
  accountsRenameCancelTitle: string;
81
- /** Makes a credential the one in use. */
82
- accountsUse: string;
83
- /** While that runs. */
84
- accountsSwitching: string;
85
- /** Its tooltip. */
86
- accountsUseTitle: (source: string, provider: string) => string;
87
79
  /** Renames an OAuth account. */
88
80
  accountsRename: string;
89
81
  /** While that runs. */
@@ -101,7 +93,7 @@ export declare const DEFAULT_ACCOUNTS_SECTION_LABELS: {
101
93
  /** Its tooltip. */
102
94
  accountsRemoveTitle: (name: string, provider: string) => string;
103
95
  /** The confirm before Remove. */
104
- accountsRemoveConfirm: (provider: string, name: string, active: boolean) => string;
96
+ accountsRemoveConfirm: (provider: string, name: string) => string;
105
97
  /** Its list could not be read. */
106
98
  accountsServerReadFailed: (host: string, reason: string) => string;
107
99
  /** While it is read. */
@@ -58,8 +58,6 @@ const DEFAULT_ACCOUNTS_SECTION_LABELS = {
58
58
  accountsKeyField: (provider) => `${provider} API key`,
59
59
  /** The credential sources list's name. */
60
60
  accountsSources: (provider) => `${provider} credential sources`,
61
- /** After the credential in use. */
62
- accountsInUse: "In use",
63
61
  /** The rename field's name. */
64
62
  accountsRenameField: (name) => `New name for ${name}`,
65
63
  /** The rename field's placeholder. */
@@ -72,12 +70,6 @@ const DEFAULT_ACCOUNTS_SECTION_LABELS = {
72
70
  accountsRenameCancel: "Cancel",
73
71
  /** Its tooltip. */
74
72
  accountsRenameCancelTitle: "Cancel rename",
75
- /** Makes a credential the one in use. */
76
- accountsUse: "Use",
77
- /** While that runs. */
78
- accountsSwitching: "Switching…",
79
- /** Its tooltip. */
80
- accountsUseTitle: (source, provider) => `Use this ${source} credential for ${provider}`,
81
73
  /** Renames an OAuth account. */
82
74
  accountsRename: "Rename",
83
75
  /** While that runs. */
@@ -95,7 +87,7 @@ const DEFAULT_ACCOUNTS_SECTION_LABELS = {
95
87
  /** Its tooltip. */
96
88
  accountsRemoveTitle: (name, provider) => `Remove ${name} from ${provider}`,
97
89
  /** The confirm before Remove. */
98
- accountsRemoveConfirm: (provider, name, active) => `Remove ${provider} ${name}${active ? " (in use)" : ""}?`,
90
+ accountsRemoveConfirm: (provider, name) => `Remove ${provider} ${name}?`,
99
91
  /** Its list could not be read. */
100
92
  accountsServerReadFailed: (host, reason) => `Couldn't read ${host}'s providers: ${reason}`,
101
93
  /** While it is read. */