zidane-ui 9.1.13 → 9.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/index.d.ts +2 -2
- package/dist/adapters/index.js +2 -2
- package/dist/adapters/live.d.ts +29 -3
- package/dist/adapters/live.js +9 -1
- package/dist/adapters/server-composer-host.js +17 -2
- package/dist/adapters/server-extensions-host.d.ts +0 -1
- package/dist/adapters/server-extensions-host.js +5 -16
- package/dist/adapters/server-git-host.js +7 -16
- package/dist/adapters/server-host.js +181 -43
- package/dist/adapters/server-machines-host.d.ts +2 -0
- package/dist/adapters/server-machines-host.js +24 -25
- package/dist/adapters/server-onboarding-host.d.ts +1 -1
- package/dist/adapters/server-onboarding-host.js +3 -4
- package/dist/adapters/server-session-host.js +22 -3
- package/dist/adapters/server-settings-accounts.js +2 -2
- package/dist/adapters/server-settings-host.js +3 -3
- package/dist/adapters/server-settings-performance.js +7 -9
- package/dist/adapters/server-settings-sections.js +13 -14
- package/dist/adapters/server-sidebar-host.js +2 -2
- package/dist/adapters/sse-host.js +68 -3
- package/dist/adapters/sse-protocol.d.ts +12 -2
- package/dist/adapters/sse-protocol.js +4 -2
- package/dist/app/AppHostProvider.js +4 -3
- package/dist/app/ModalProvider.d.ts +13 -3
- package/dist/app/ModalProvider.js +103 -24
- package/dist/app/NoticeStack.d.ts +33 -0
- package/dist/app/NoticeStack.js +90 -0
- package/dist/app/index.d.ts +3 -2
- package/dist/app/index.js +3 -2
- package/dist/appearance/AppearanceProvider.js +2 -2
- package/dist/appearance/headless/index.js +1 -1
- package/dist/approvals/headless/index.js +2 -2
- package/dist/chat/SessionFilterMenu.d.ts +1 -1
- package/dist/chat/SessionFilterMenu.js +2 -1
- package/dist/chat/Transcript.js +1 -1
- package/dist/chat/composer/Composer.js +9 -6
- package/dist/chat/composer/ComposerEditor.js +1 -1
- package/dist/chat/composer/ConversationBadges.js +1 -1
- package/dist/chat/composer/ModelChainList.js +17 -8
- package/dist/chat/composer/ModelChainTooltip.js +5 -2
- package/dist/chat/composer/use-composer-stores.js +1 -1
- package/dist/chat/composer/use-draft-target.d.ts +20 -1
- package/dist/chat/composer/use-draft-target.js +122 -6
- package/dist/chat/composer/use-new-session-defaults.d.ts +5 -1
- package/dist/chat/composer/use-new-session-defaults.js +17 -4
- package/dist/chat/composer/use-run-meter.js +1 -1
- package/dist/chat/composer/use-send-prompt.js +1 -1
- package/dist/chat/headless/chip-labels.d.ts +1 -0
- package/dist/chat/headless/chip-labels.js +1 -0
- package/dist/chat/headless/composer/index.js +2 -2
- package/dist/chat/headless/draft-target.d.ts +21 -1
- package/dist/chat/headless/fixture-host.js +17 -2
- package/dist/chat/headless/host.d.ts +3 -3
- package/dist/chat/headless/index.d.ts +9 -9
- package/dist/chat/headless/index.js +15 -15
- package/dist/chat/headless/labels.d.ts +13 -4
- package/dist/chat/headless/labels.js +8 -5
- package/dist/chat/headless/session-list.d.ts +20 -6
- package/dist/chat/headless/session-list.js +1 -0
- package/dist/chat/headless/sidebar/directory.d.ts +56 -14
- package/dist/chat/headless/sidebar/directory.js +149 -70
- package/dist/chat/headless/sidebar/index.d.ts +3 -3
- package/dist/chat/headless/sidebar/index.js +3 -3
- package/dist/chat/headless/sidebar/labels.d.ts +15 -6
- package/dist/chat/headless/sidebar/types.d.ts +3 -1
- package/dist/chat/headless/sidebar/view.d.ts +13 -5
- package/dist/chat/headless/sidebar/view.js +31 -11
- package/dist/chat/headless/streams/actions.d.ts +5 -3
- package/dist/chat/headless/streams/actions.js +3 -2
- package/dist/chat/headless/streams/index.d.ts +3 -3
- package/dist/chat/headless/streams/merge.d.ts +6 -10
- package/dist/chat/headless/streams/merge.js +7 -21
- package/dist/chat/headless/streams/session-streams.d.ts +29 -4
- package/dist/chat/headless/streams/session-streams.js +86 -0
- package/dist/chat/headless/streams/store.d.ts +162 -16
- package/dist/chat/headless/streams/store.js +334 -38
- package/dist/chat/headless/streams/types.d.ts +10 -7
- package/dist/chat/headless/transcript-labels.d.ts +1 -0
- package/dist/chat/interactions/PlanCard.js +10 -3
- package/dist/chat/interactions/QuestionForm.js +7 -3
- package/dist/chat/interactions/card-ui.d.ts +5 -3
- package/dist/chat/interactions/card-ui.js +9 -7
- package/dist/chat/sidebar/SessionSidebar.js +5 -5
- package/dist/chat/sidebar/SidebarFilterMenu.js +3 -1
- package/dist/chat/sidebar/SidebarFrame.d.ts +4 -0
- package/dist/chat/sidebar/SidebarFrame.js +27 -9
- package/dist/chat/sidebar/SidebarGroupHeader.js +1 -1
- package/dist/chat/sidebar/SidebarHostProvider.d.ts +8 -5
- package/dist/chat/sidebar/SidebarHostProvider.js +13 -9
- package/dist/chat/sidebar/SidebarToggleButton.js +7 -3
- package/dist/chat/sidebar/index.d.ts +2 -2
- package/dist/chat/sidebar/session-menu.js +4 -4
- package/dist/chat/sidebar/useSaveViewAsSpace.js +2 -2
- package/dist/chat/testing/contract.js +2 -2
- package/dist/chat/transcript/AuthFailureCard.js +11 -8
- package/dist/chat/transcript/BadgeMenu.js +13 -2
- package/dist/chat/transcript/MermaidDiagram.js +7 -3
- package/dist/chat/transcript/fold.d.ts +4 -0
- package/dist/chat/transcript/fold.js +53 -22
- package/dist/chat/transcript/script-input.d.ts +1 -1
- package/dist/chat/transcript/shell-block.js +8 -4
- package/dist/chat/transcript/useStickToBottom.js +12 -0
- package/dist/components/BrowserSignIn.js +23 -21
- package/dist/components/Form.d.ts +6 -4
- package/dist/components/Form.js +16 -8
- package/dist/components/LoadError.d.ts +4 -2
- package/dist/components/LoadError.js +13 -9
- package/dist/components/Notice.d.ts +29 -0
- package/dist/components/Notice.js +63 -0
- package/dist/components/PanelEmpty.d.ts +1 -1
- package/dist/components/PanelEmpty.js +4 -2
- package/dist/components/Restricted.d.ts +1 -1
- package/dist/components/palette/PaletteList.js +8 -1
- package/dist/components/palette/PalettePanel.js +14 -6
- package/dist/core.css +24 -5
- package/dist/dist/{index-Bq87OcGy.d.ts → index-C6rzc-tt.d.ts} +28 -3
- package/dist/dist/index.d.ts +2 -2
- package/dist/dist/{timeout-B5pO5I5a.d.ts → timeout-Cz9dRF8Q.d.ts} +1 -1
- package/dist/extensions/ExtensionSettingsPage.js +2 -5
- package/dist/extensions/ExtensionSettingsSection.js +5 -4
- package/dist/extensions/ExtensionSettingsSidebar.js +3 -7
- package/dist/extensions/SettingsWireForm.d.ts +1 -7
- package/dist/extensions/SettingsWireForm.js +7 -5
- package/dist/extensions/headless/fixture-host.d.ts +1 -5
- package/dist/extensions/headless/fixture-host.js +2 -5
- package/dist/extensions/headless/host.d.ts +1 -11
- package/dist/extensions/headless/index.d.ts +3 -3
- package/dist/extensions/headless/index.js +6 -6
- package/dist/extensions/headless/select.d.ts +1 -11
- package/dist/extensions/headless/select.js +1 -18
- package/dist/extensions/hooks.js +1 -1
- package/dist/files/EditorColumn.js +13 -2
- package/dist/files/MediaDiff.js +1 -1
- package/dist/files/TreeColumn.js +13 -20
- package/dist/files/useEntryActions.js +1 -1
- package/dist/files/useOpenFiles.js +3 -1
- package/dist/git/BranchMenu.js +6 -4
- package/dist/git/ImportRepoDialog.js +18 -9
- package/dist/git/MoveSessionDialog.js +16 -8
- package/dist/git/RemoteFolderPicker.js +35 -17
- package/dist/git/SyncChip.js +17 -17
- package/dist/git/WherePicker.d.ts +16 -1
- package/dist/git/WherePicker.js +81 -37
- package/dist/git/headless/environment.d.ts +33 -3
- package/dist/git/headless/environment.js +33 -5
- package/dist/git/headless/index.d.ts +2 -2
- package/dist/git/headless/index.js +2 -2
- package/dist/git/headless/labels.d.ts +15 -2
- package/dist/git/headless/labels.js +17 -4
- package/dist/git/useEnvironmentChoices.d.ts +3 -1
- package/dist/git/useEnvironmentChoices.js +7 -4
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/keybindings/KeyCommands.js +1 -1
- package/dist/keybindings/KeybindingsProvider.js +1 -1
- package/dist/keybindings/headless/index.js +2 -2
- package/dist/keybindings/headless/overrides.js +1 -1
- package/dist/labels.d.ts +5 -0
- package/dist/labels.js +5 -0
- package/dist/machines/AddMachineDialog.d.ts +34 -0
- package/dist/machines/AddMachineDialog.js +464 -0
- package/dist/machines/Banners.d.ts +33 -4
- package/dist/machines/Banners.js +64 -3
- package/dist/machines/DaemonMenu.js +27 -4
- package/dist/machines/HostCapabilities.d.ts +1 -3
- package/dist/machines/HostCapabilities.js +24 -45
- package/dist/machines/HostSyncPanel.js +124 -130
- package/dist/machines/HostsSection.d.ts +4 -1
- package/dist/machines/HostsSection.js +30 -7
- package/dist/machines/MachinesExplainer.d.ts +17 -0
- package/dist/machines/MachinesExplainer.js +71 -0
- package/dist/machines/MachinesProvider.d.ts +14 -2
- package/dist/machines/MachinesProvider.js +35 -1
- package/dist/machines/ServerAddedCard.d.ts +31 -0
- package/dist/machines/ServerAddedCard.js +72 -0
- package/dist/machines/ServerCard.js +91 -215
- package/dist/machines/ServerMachinesPanel.d.ts +2 -2
- package/dist/machines/ServerMachinesPanel.js +184 -323
- package/dist/machines/ServerUpdatePanel.js +51 -40
- package/dist/machines/ShareThisComputerForm.d.ts +19 -0
- package/dist/machines/ShareThisComputerForm.js +133 -0
- package/dist/machines/SyncOutcomeBadge.js +1 -1
- package/dist/machines/TokensPanel.d.ts +5 -3
- package/dist/machines/TokensPanel.js +98 -78
- package/dist/machines/headless/fixture-host.d.ts +19 -3
- package/dist/machines/headless/fixture-host.js +43 -6
- package/dist/machines/headless/fixtures.js +4 -6
- package/dist/machines/headless/host.d.ts +40 -19
- package/dist/machines/headless/index.d.ts +3 -3
- package/dist/machines/headless/index.js +3 -3
- package/dist/machines/headless/labels.d.ts +63 -20
- package/dist/machines/headless/labels.js +88 -25
- package/dist/machines/headless/messages.js +8 -0
- package/dist/machines/headless/stores.d.ts +9 -2
- package/dist/machines/headless/stores.js +28 -1
- package/dist/machines/index.d.ts +7 -3
- package/dist/machines/index.js +8 -4
- package/dist/machines/testing/contract.d.ts +15 -3
- package/dist/machines/testing/contract.js +68 -14
- package/dist/motion/grow.d.ts +8 -1
- package/dist/motion/grow.js +10 -4
- package/dist/onboarding/headless/labels.d.ts +13 -0
- package/dist/onboarding/headless/labels.js +8 -0
- package/dist/onboarding/sources/SourceBrowser.js +11 -7
- package/dist/onboarding/steps/ImportStep.js +4 -1
- package/dist/onboarding/steps/ReadyStep.js +9 -2
- package/dist/onboarding/steps/connect/KeyForm.js +6 -2
- package/dist/onboarding/steps/connect/ProviderPanel.js +6 -2
- package/dist/onboarding/steps/connect/ProviderReady.js +25 -20
- package/dist/onboarding/steps/tasks.js +17 -14
- package/dist/palette/app-sources.js +1 -1
- package/dist/server/sse-handler.js +141 -19
- package/dist/session/ArtifactsPanel.js +40 -18
- package/dist/session/PlanTracker.js +13 -8
- package/dist/session/ProjectHome.js +13 -11
- package/dist/session/RemindersPanel.js +35 -17
- package/dist/session/RunningWorkDialog.js +6 -2
- package/dist/session/SecretsPanel.js +29 -10
- package/dist/session/SessionDetailsDialog.d.ts +1 -1
- package/dist/session/SessionDetailsDialog.js +18 -10
- package/dist/session/SideChat.js +10 -7
- package/dist/session/TurnDetailsDialog.js +19 -5
- package/dist/session/UsagePanel.js +10 -4
- package/dist/session/headless/host.d.ts +2 -0
- package/dist/session/headless/index.js +2 -2
- package/dist/session/headless/labels.d.ts +19 -1
- package/dist/session/headless/labels.js +15 -1
- package/dist/session/headless/queue.js +2 -1
- package/dist/session/headless/reminder-labels.d.ts +4 -0
- package/dist/session/headless/reminder-labels.js +4 -0
- package/dist/settings/SettingsRestricted.d.ts +1 -1
- package/dist/settings/SettingsRestricted.js +4 -4
- package/dist/settings/SettingsShell.d.ts +7 -0
- package/dist/settings/SettingsShell.js +6 -1
- package/dist/settings/headless/fixture-performance.d.ts +1 -1
- package/dist/settings/headless/host.d.ts +2 -2
- package/dist/settings/headless/index.js +1 -1
- package/dist/settings/headless/labels.d.ts +3 -3
- package/dist/settings/headless/labels.js +3 -3
- package/dist/settings/headless/performance.d.ts +3 -4
- package/dist/settings/headless/search.d.ts +1 -1
- package/dist/settings/index.d.ts +2 -1
- package/dist/settings/index.js +2 -1
- package/dist/settings/sections/appearance/AppearanceSection.js +2 -2
- package/dist/settings/sections/claude-import/ClaudeImportDialog.js +1 -1
- package/dist/settings/sections/editor/EditorSection.js +8 -5
- package/dist/settings/sections/editor/labels.d.ts +1 -0
- package/dist/settings/sections/editor/labels.js +1 -0
- package/dist/settings/sections/environments/EnvironmentsSection.js +21 -14
- package/dist/settings/sections/environments/labels.d.ts +1 -0
- package/dist/settings/sections/environments/labels.js +2 -1
- package/dist/settings/sections/extensions/ChangeOriginDialog.js +1 -1
- package/dist/settings/sections/extensions/CreateExtensionDialog.js +1 -1
- package/dist/settings/sections/extensions/ExtensionConfigRows.d.ts +1 -3
- package/dist/settings/sections/extensions/ExtensionConfigRows.js +20 -19
- package/dist/settings/sections/extensions/ExtensionOptionsSection.js +2 -1
- package/dist/settings/sections/extensions/ExtensionsSection.js +1 -1
- package/dist/settings/sections/extensions/options-labels.d.ts +2 -1
- package/dist/settings/sections/extensions/options-labels.js +2 -1
- package/dist/settings/sections/host-catalog/HostCatalogSection.js +1 -1
- package/dist/settings/sections/index.d.ts +2 -1
- package/dist/settings/sections/index.js +2 -1
- package/dist/settings/sections/instructions/InstructionsSection.js +1 -1
- package/dist/settings/sections/logs/LogsSection.d.ts +2 -2
- package/dist/settings/sections/logs/LogsSection.js +2 -2
- package/dist/settings/sections/mcp/McpSection.d.ts +1 -1
- package/dist/settings/sections/mcp/McpSection.js +13 -7
- package/dist/settings/sections/mcp/McpServerRow.js +21 -14
- package/dist/settings/sections/mcp/labels.d.ts +8 -2
- package/dist/settings/sections/mcp/labels.js +8 -2
- package/dist/settings/sections/models/ModelRows.js +1 -1
- package/dist/settings/sections/models/NewChatPlaceRow.d.ts +26 -0
- package/dist/settings/sections/models/NewChatPlaceRow.js +78 -0
- package/dist/settings/sections/models/SpacesDefaultsSection.js +15 -3
- package/dist/settings/sections/models/labels.d.ts +7 -0
- package/dist/settings/sections/models/labels.js +7 -0
- package/dist/settings/sections/models/model-test.js +7 -4
- package/dist/settings/sections/performance/PerformanceSection.js +16 -6
- package/dist/settings/sections/performance/labels.d.ts +1 -1
- package/dist/settings/sections/performance/labels.js +1 -1
- package/dist/settings/sections/providers/ProvidersSection.d.ts +1 -1
- package/dist/settings/sections/providers/ProvidersSection.js +15 -8
- package/dist/settings/sections/providers/ServerProvidersSection.d.ts +1 -1
- package/dist/settings/sections/providers/ServerProvidersSection.js +12 -6
- package/dist/settings/sections/providers/labels.d.ts +2 -2
- package/dist/settings/sections/providers/labels.js +2 -2
- package/dist/settings/sections/shared/catalog.js +1 -1
- package/dist/settings/sections/skills/SkillsSection.js +1 -1
- package/dist/settings/testing/performance.contract.js +8 -12
- package/dist/styles.css +32 -3
- package/dist/terminal/HostTerminalSurface.js +17 -7
- package/dist/terminal/TerminalPanel.js +30 -17
- package/dist/terminal/TerminalSurface.js +11 -4
- package/dist/terminal/headless/labels.d.ts +5 -0
- package/dist/terminal/headless/labels.js +5 -0
- package/dist/terminal/headless/store.d.ts +1 -1
- package/dist/terminal/headless/store.js +6 -3
- package/dist/workspace/LayoutBudget.d.ts +5 -1
- package/dist/workspace/LayoutBudget.js +14 -1
- package/dist/workspace/PanelContentView.d.ts +1 -1
- package/dist/workspace/PanelContentView.js +17 -6
- package/dist/workspace/WorkspaceProvider.js +4 -3
- package/dist/workspace/extension-tabs.js +1 -1
- package/dist/workspace/headless/index.js +1 -1
- package/dist/workspace/headless/labels.d.ts +1 -0
- package/dist/workspace/headless/labels.js +1 -0
- package/package.json +3 -3
- package/src/styles/motion.css +8 -0
- package/src/styles/primitives.css +7 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { writable } from "../../chat/headless/store.js";
|
|
2
2
|
import { machinesError } from "./host.js";
|
|
3
|
-
import { createPresenceStore } from "./presence.js";
|
|
4
3
|
import { createMachineLists, createOnlineMachines } from "./stores.js";
|
|
4
|
+
import { createPresenceStore } from "./presence.js";
|
|
5
5
|
import { createHostSyncReads } from "./sync.js";
|
|
6
6
|
//#region src/machines/headless/fixture-host.ts
|
|
7
7
|
/** This computer, as every host lists it first. */
|
|
@@ -50,6 +50,15 @@ function createFixtureMachinesHost(options = {}) {
|
|
|
50
50
|
let folderTurn = 0;
|
|
51
51
|
let tokenCount = 0;
|
|
52
52
|
const hostOf = (id) => hosts.get().hosts.find((host) => host.id === id);
|
|
53
|
+
const joinListeners = /* @__PURE__ */ new Set();
|
|
54
|
+
const join = (hostId, machine) => {
|
|
55
|
+
machines.set(hostId, [...(machines.get(hostId) ?? []).filter((m) => m.id !== machine.id), machine]);
|
|
56
|
+
for (const listener of [...statusListeners]) listener({
|
|
57
|
+
hostId,
|
|
58
|
+
name: machine.name,
|
|
59
|
+
status: machine.status
|
|
60
|
+
});
|
|
61
|
+
};
|
|
53
62
|
const patchHost = (id, patch) => hosts.set((state) => ({
|
|
54
63
|
...state,
|
|
55
64
|
hosts: patch ? state.hosts.map((host) => host.id === id ? {
|
|
@@ -248,6 +257,13 @@ function createFixtureMachinesHost(options = {}) {
|
|
|
248
257
|
statusListeners.add(onChange);
|
|
249
258
|
return () => statusListeners.delete(onChange);
|
|
250
259
|
}),
|
|
260
|
+
onJoin(hostId, listener) {
|
|
261
|
+
const own = (from, event) => {
|
|
262
|
+
if (from === hostId) listener(event);
|
|
263
|
+
};
|
|
264
|
+
joinListeners.add(own);
|
|
265
|
+
return () => void joinListeners.delete(own);
|
|
266
|
+
},
|
|
251
267
|
async forget(hostId, machineId) {
|
|
252
268
|
options.onForget?.(hostId, machineId);
|
|
253
269
|
machines.set(hostId, (machines.get(hostId) ?? []).filter((machine) => machine.id !== machineId));
|
|
@@ -255,8 +271,7 @@ function createFixtureMachinesHost(options = {}) {
|
|
|
255
271
|
async invite(hostId, inviteOptions = {}) {
|
|
256
272
|
if (options.permitted && !permitted.get()?.has("machines.invite")) throw {
|
|
257
273
|
kind: "invite",
|
|
258
|
-
detail: "
|
|
259
|
-
forbidden: true
|
|
274
|
+
detail: "This server does not make join codes."
|
|
260
275
|
};
|
|
261
276
|
const made = options.onInvite?.(hostId, inviteOptions) ?? {
|
|
262
277
|
code: "K7Q2-9XPM",
|
|
@@ -264,6 +279,16 @@ function createFixtureMachinesHost(options = {}) {
|
|
|
264
279
|
};
|
|
265
280
|
const host = hostOf(hostId);
|
|
266
281
|
const url = host?.url ?? `wss://${host?.name ?? hostId}`;
|
|
282
|
+
if (options.joinAfterMs !== void 0) {
|
|
283
|
+
const name = inviteOptions.name ?? "gpu-box";
|
|
284
|
+
setTimeout(() => join(hostId, {
|
|
285
|
+
id: `m-${name}-${Date.now()}`,
|
|
286
|
+
name,
|
|
287
|
+
roots: [{ path: `/home/${name}/projects` }],
|
|
288
|
+
status: "online",
|
|
289
|
+
capabilities: { gpu: ["NVIDIA GeForce RTX 4090"] }
|
|
290
|
+
}), options.joinAfterMs);
|
|
291
|
+
}
|
|
267
292
|
return {
|
|
268
293
|
...made,
|
|
269
294
|
join: `${url}#${made.code}`
|
|
@@ -312,6 +337,7 @@ function createFixtureMachinesHost(options = {}) {
|
|
|
312
337
|
}
|
|
313
338
|
},
|
|
314
339
|
pickFolder: async () => folders[folderTurn++ % folders.length] ?? null,
|
|
340
|
+
newChat: (hostId, machine) => options.onNewChat?.(hostId, machine),
|
|
315
341
|
updates: {
|
|
316
342
|
status: async (hostId) => updateOf(hostId),
|
|
317
343
|
async check(hostId) {
|
|
@@ -343,13 +369,13 @@ function createFixtureMachinesHost(options = {}) {
|
|
|
343
369
|
},
|
|
344
370
|
tokens: {
|
|
345
371
|
list: async (hostId) => tokens.get(hostId) ?? [],
|
|
346
|
-
async create(hostId, name
|
|
347
|
-
options.onCreateToken?.(hostId, name
|
|
372
|
+
async create(hostId, name) {
|
|
373
|
+
options.onCreateToken?.(hostId, name);
|
|
348
374
|
tokenCount += 1;
|
|
349
375
|
const created = {
|
|
350
376
|
id: `tok_fixture${tokenCount}`,
|
|
351
377
|
name,
|
|
352
|
-
scope,
|
|
378
|
+
scope: "client",
|
|
353
379
|
createdAt: Date.now()
|
|
354
380
|
};
|
|
355
381
|
tokens.set(hostId, [...tokens.get(hostId) ?? [], created]);
|
|
@@ -358,6 +384,13 @@ function createFixtureMachinesHost(options = {}) {
|
|
|
358
384
|
token: `zds_fixture_secret_${tokenCount}`
|
|
359
385
|
};
|
|
360
386
|
},
|
|
387
|
+
async pair(hostId, pairOptions = {}) {
|
|
388
|
+
options.onPair?.(hostId, pairOptions);
|
|
389
|
+
return {
|
|
390
|
+
code: "P4IR-C0DE",
|
|
391
|
+
expiresAt: Date.now() + Math.min(pairOptions.ttlMs ?? 6e5, 6e5)
|
|
392
|
+
};
|
|
393
|
+
},
|
|
361
394
|
async revoke(hostId, id) {
|
|
362
395
|
options.onRevokeToken?.(hostId, id);
|
|
363
396
|
tokens.set(hostId, (tokens.get(hostId) ?? []).map((token) => token.id === id ? {
|
|
@@ -478,6 +511,10 @@ function createFixtureMachinesHost(options = {}) {
|
|
|
478
511
|
status
|
|
479
512
|
});
|
|
480
513
|
},
|
|
514
|
+
joinMachine: (hostId, machine) => join(hostId, machine),
|
|
515
|
+
pushJoin: (hostId, event) => {
|
|
516
|
+
for (const listener of [...joinListeners]) listener(hostId, event);
|
|
517
|
+
},
|
|
481
518
|
setLinks: (next) => links.set(next),
|
|
482
519
|
setHealth: (next) => health.set(next),
|
|
483
520
|
setPermitted: (actions) => permitted.set(actions ? new Set(actions) : null),
|
|
@@ -63,21 +63,21 @@ const DEMO_TOKENS = [
|
|
|
63
63
|
{
|
|
64
64
|
id: "tok_phone",
|
|
65
65
|
name: "phone",
|
|
66
|
-
scope: "
|
|
66
|
+
scope: "client",
|
|
67
67
|
createdAt: DEMO_NOW - 10 * DAY,
|
|
68
68
|
lastUsedAt: DEMO_NOW - 36e5
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
71
|
id: "tok_laptop",
|
|
72
72
|
name: "laptop",
|
|
73
|
-
scope: "
|
|
73
|
+
scope: "client",
|
|
74
74
|
createdAt: DEMO_NOW - 40 * DAY,
|
|
75
75
|
lastUsedAt: DEMO_NOW - 6e4
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
78
|
id: "tok_old",
|
|
79
79
|
name: "old tablet",
|
|
80
|
-
scope: "
|
|
80
|
+
scope: "client",
|
|
81
81
|
createdAt: DEMO_NOW - 90 * DAY,
|
|
82
82
|
revokedAt: DEMO_NOW - 20 * DAY
|
|
83
83
|
}
|
|
@@ -130,9 +130,7 @@ const DEMO_CAPABILITIES = {
|
|
|
130
130
|
allows: {
|
|
131
131
|
remoteInstalls: true,
|
|
132
132
|
asMachine: true,
|
|
133
|
-
sync: false
|
|
134
|
-
clone: true,
|
|
135
|
-
createFolders: true
|
|
133
|
+
sync: false
|
|
136
134
|
},
|
|
137
135
|
workspace: {
|
|
138
136
|
roots: ["/data/workspaces"],
|
|
@@ -3,8 +3,8 @@ import { HostView } from "../../chat/headless/hosts.js";
|
|
|
3
3
|
import { SignInFlow } from "../../onboarding/headless/host.js";
|
|
4
4
|
import { MachinesPresence } from "./presence.js";
|
|
5
5
|
import { HostSyncPatch, HostSyncRead, HostSyncState, SyncStatus } from "./sync.js";
|
|
6
|
-
import { DaemonHealth, HostCapabilities, MachineInfo, MachineLinksStatus, ServerUpdateStatus } from "zidane/chat/pure";
|
|
7
|
-
import {
|
|
6
|
+
import { DaemonHealth, HostCapabilities, MachineInfo, MachineJoinEvent, MachineLinksStatus, ServerUpdateStatus } from "zidane/chat/pure";
|
|
7
|
+
import { HostProviderAuth } from "zidane/ipc";
|
|
8
8
|
//#region src/machines/headless/host.d.ts
|
|
9
9
|
/** One agent host as the machines components show it: This computer or a server. */
|
|
10
10
|
interface HostSummary extends HostView {
|
|
@@ -18,13 +18,6 @@ interface HostSummary extends HostView {
|
|
|
18
18
|
lastConnectedAt?: number;
|
|
19
19
|
/** The server lends itself as a machine (`allowAsMachine`). */
|
|
20
20
|
machineServe?: boolean;
|
|
21
|
-
/** The scope this app's token has there. Absent: every method (the user's own computer). */
|
|
22
|
-
scope?: ClientScope;
|
|
23
|
-
/** How to get an admin token there: commands to run on its machine (`token` mints one to paste, `pair` a browser code). */
|
|
24
|
-
adminCommands?: {
|
|
25
|
-
token: string;
|
|
26
|
-
pair: string;
|
|
27
|
-
};
|
|
28
21
|
/** When the server process started, epoch ms. */
|
|
29
22
|
startedAt?: number;
|
|
30
23
|
}
|
|
@@ -64,8 +57,6 @@ interface MachinesError {
|
|
|
64
57
|
kind: 'read' | 'update' | 'forget' | 'remove' | 'tokens' | 'daemon' | 'sync' | 'invite' | 'install';
|
|
65
58
|
/** The backend's message, shown as is by the default labels. */
|
|
66
59
|
detail: string;
|
|
67
|
-
/** The token's scope does not reach the action (the server answered Forbidden). */
|
|
68
|
-
forbidden?: boolean;
|
|
69
60
|
}
|
|
70
61
|
/** A one-time machine join code (`tokens.machineInvite`): a new machine runs `zidane machine setup --join <join>`. */
|
|
71
62
|
interface MachineInvite {
|
|
@@ -145,12 +136,17 @@ interface MachinesDirectory {
|
|
|
145
136
|
forget?(hostId: string, machineId: string): Promise<void>;
|
|
146
137
|
/**
|
|
147
138
|
* Creates a one-time join code on `hostId` for a new machine (`name`: the machine's name there). Rejects with a
|
|
148
|
-
* {@link MachinesError} (`invite
|
|
139
|
+
* {@link MachinesError} (`invite`). Absent: no Add a machine.
|
|
149
140
|
*/
|
|
150
141
|
invite?(hostId: string, options?: {
|
|
151
142
|
name?: string;
|
|
152
143
|
ttlMs?: number;
|
|
153
144
|
}): Promise<MachineInvite>;
|
|
145
|
+
/**
|
|
146
|
+
* What becomes of `hostId`'s join codes, as it happens (`machine:join`): paired, joined, refused and why. Returns
|
|
147
|
+
* the unsubscribe. Absent: Add a machine sees a machine join from the list alone, and no refusal.
|
|
148
|
+
*/
|
|
149
|
+
onJoin?(hostId: string, listener: (event: MachineJoinEvent) => void): () => void;
|
|
154
150
|
}
|
|
155
151
|
/** This computer's machine links: shared with servers (it is their machine), and servers used as machines. */
|
|
156
152
|
interface MachineLinks {
|
|
@@ -176,15 +172,15 @@ interface ServerUpdates {
|
|
|
176
172
|
/** Turns the self-update on or off. Absent: no Turn on / off. */
|
|
177
173
|
configure?(hostId: string, enabled: boolean): Promise<ServerUpdateStatus>;
|
|
178
174
|
}
|
|
179
|
-
/** A token's
|
|
180
|
-
type ServerTokenScope =
|
|
175
|
+
/** A token's kind on a server: `client` (an app, a browser, an MCP client), or `machine` (it lends a computer). */
|
|
176
|
+
type ServerTokenScope = 'client' | 'machine';
|
|
181
177
|
/** A server's client token as listed: never its secret. */
|
|
182
178
|
interface ServerToken {
|
|
183
179
|
/** Stable id (`tok_…`). */
|
|
184
180
|
id: string;
|
|
185
181
|
/** The name it was created with, such as the device it is for. */
|
|
186
182
|
name: string;
|
|
187
|
-
/** What it
|
|
183
|
+
/** What it is for. */
|
|
188
184
|
scope: ServerTokenScope;
|
|
189
185
|
/** When it was created, epoch ms. */
|
|
190
186
|
createdAt: number;
|
|
@@ -195,14 +191,26 @@ interface ServerToken {
|
|
|
195
191
|
/** When it stops working, epoch ms. Absent: never. */
|
|
196
192
|
expiresAt?: number;
|
|
197
193
|
}
|
|
194
|
+
/** A one-time code for a browser (`tokens.pair`): typed into the web app's sign-in screen. */
|
|
195
|
+
interface BrowserPairing {
|
|
196
|
+
/** The code (`K7Q2-9XPM`). */
|
|
197
|
+
code: string;
|
|
198
|
+
/** When the code stops working, epoch ms. It works once before then. */
|
|
199
|
+
expiresAt: number;
|
|
200
|
+
}
|
|
198
201
|
/** A server's client tokens. Every method rejects with a {@link MachinesError}. */
|
|
199
202
|
interface ServerTokens {
|
|
200
203
|
/** `hostId`'s tokens, revoked ones included. */
|
|
201
204
|
list(hostId: string): Promise<readonly ServerToken[]>;
|
|
202
|
-
/** Creates a token; the answer carries its secret, shown once. Absent: no create form. */
|
|
203
|
-
create?(hostId: string, name: string
|
|
205
|
+
/** Creates a client token; the answer carries its secret, shown once. Absent: no create form. */
|
|
206
|
+
create?(hostId: string, name: string): Promise<ServerToken & {
|
|
204
207
|
token: string;
|
|
205
208
|
}>;
|
|
209
|
+
/** Makes a one-time code a browser logs in to the web app with (`tokens.pair`). Absent: no Pair a browser. */
|
|
210
|
+
pair?(hostId: string, options?: {
|
|
211
|
+
name?: string;
|
|
212
|
+
ttlMs?: number;
|
|
213
|
+
}): Promise<BrowserPairing>;
|
|
206
214
|
/** Revokes a token. Absent: no revoke buttons. */
|
|
207
215
|
revoke?(hostId: string, id: string): Promise<void>;
|
|
208
216
|
/** Calls `listener` when `hostId`'s tokens changed elsewhere (another page, a pairing, the CLI). Returns the unsubscribe. Absent: the list is read when shown and after its own changes. */
|
|
@@ -230,10 +238,18 @@ interface DaemonStatus {
|
|
|
230
238
|
startedAt: number;
|
|
231
239
|
retiring?: boolean;
|
|
232
240
|
};
|
|
233
|
-
/**
|
|
241
|
+
/**
|
|
242
|
+
* Why the daemon refused this window. `busy`: an older daemon has been
|
|
243
|
+
* finishing its work for longer than this window waits; its writes fail
|
|
244
|
+
* until the daemon is stopped (Restart daemon now). `startsOlder`: the
|
|
245
|
+
* daemon this window starts is older too (the zidane CLI on PATH is older
|
|
246
|
+
* than the app), so chats run in the window.
|
|
247
|
+
*/
|
|
234
248
|
refused?: {
|
|
235
249
|
message: string;
|
|
236
250
|
direction: 'daemon-newer' | 'daemon-older' | 'unknown';
|
|
251
|
+
busy?: boolean;
|
|
252
|
+
startsOlder?: boolean;
|
|
237
253
|
};
|
|
238
254
|
/** Why it is unreachable. */
|
|
239
255
|
error?: string;
|
|
@@ -315,6 +331,11 @@ interface MachinesHost {
|
|
|
315
331
|
links?: MachineLinks;
|
|
316
332
|
/** Picks a folder to share (the native dialog). Absent: no Add a folder. */
|
|
317
333
|
pickFolder?(): Promise<string | null>;
|
|
334
|
+
/**
|
|
335
|
+
* Opens a new chat on `hostId`: on its machine named `machine` when given, else in the server's own folders. The
|
|
336
|
+
* app moves its draft there and shows it. Absent: no New chat buttons.
|
|
337
|
+
*/
|
|
338
|
+
newChat?(hostId: string, machine?: string): void;
|
|
318
339
|
/** A server's self-update. Absent: no update section. */
|
|
319
340
|
updates?: ServerUpdates;
|
|
320
341
|
/** A server's client tokens. Absent: no token list. */
|
|
@@ -360,4 +381,4 @@ declare function isMachinesError(value: unknown): value is MachinesError;
|
|
|
360
381
|
*/
|
|
361
382
|
declare function isPermitted(permitted: ReadonlySet<MachinesAction> | null | undefined, action: MachinesAction): boolean;
|
|
362
383
|
//#endregion
|
|
363
|
-
export { DaemonControl, type DaemonHealth, DaemonStatus, type HostCapabilities, HostCheckError, HostCheckResult, type HostProviderAuth, HostSignInTarget, HostSummary, HostSync, HostsState, MachineActionResult, type MachineInfo, MachineInvite, MachineLinks, type MachineLinksStatus, MachineList, MachineListState, MachinesAction, MachinesDirectory, MachinesError, MachinesHost, SavedHosts, SavedHostsState, ServerToken, ServerTokenScope, ServerTokens, type ServerUpdateStatus, ServerUpdates, ToolInstallResult, isMachinesError, isPermitted, machinesError };
|
|
384
|
+
export { BrowserPairing, DaemonControl, type DaemonHealth, DaemonStatus, type HostCapabilities, HostCheckError, HostCheckResult, type HostProviderAuth, HostSignInTarget, HostSummary, HostSync, HostsState, MachineActionResult, type MachineInfo, MachineInvite, type MachineJoinEvent, MachineLinks, type MachineLinksStatus, MachineList, MachineListState, MachinesAction, MachinesDirectory, MachinesError, MachinesHost, SavedHosts, SavedHostsState, ServerToken, ServerTokenScope, ServerTokens, type ServerUpdateStatus, ServerUpdates, ToolInstallResult, isMachinesError, isPermitted, machinesError };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MachinesPresence, PresenceFeed, SessionPresence, createPresenceStore } from "./presence.js";
|
|
2
2
|
import { DEFAULT_MACHINES_LABELS, MachinesLabels } from "./labels.js";
|
|
3
3
|
import { HostSyncAccount, HostSyncConfig, HostSyncPatch, HostSyncRead, HostSyncState, SyncBlockedReason, SyncCategory, SyncMode, SyncOutcome, SyncPushResult, SyncStatus, createHostSyncReads, shortList, syncBlockedReason, syncOutcome } from "./sync.js";
|
|
4
|
-
import { DaemonControl, DaemonHealth, DaemonStatus, HostCapabilities, HostCheckError, HostCheckResult, HostProviderAuth, HostSignInTarget, HostSummary, HostSync, HostsState, MachineActionResult, MachineInfo, MachineInvite, MachineLinks, MachineLinksStatus, MachineList, MachineListState, MachinesAction, MachinesDirectory, MachinesError, MachinesHost, SavedHosts, SavedHostsState, ServerToken, ServerTokenScope, ServerTokens, ServerUpdateStatus, ServerUpdates, ToolInstallResult, isMachinesError, isPermitted, machinesError } from "./host.js";
|
|
5
|
-
import { LazyReadableOptions, LazySink, createMachineLists, createOnlineMachines, lazyReadable } from "./stores.js";
|
|
4
|
+
import { BrowserPairing, DaemonControl, DaemonHealth, DaemonStatus, HostCapabilities, HostCheckError, HostCheckResult, HostProviderAuth, HostSignInTarget, HostSummary, HostSync, HostsState, MachineActionResult, MachineInfo, MachineInvite, MachineJoinEvent, MachineLinks, MachineLinksStatus, MachineList, MachineListState, MachinesAction, MachinesDirectory, MachinesError, MachinesHost, SavedHosts, SavedHostsState, ServerToken, ServerTokenScope, ServerTokens, ServerUpdateStatus, ServerUpdates, ToolInstallResult, isMachinesError, isPermitted, machinesError } from "./host.js";
|
|
5
|
+
import { LazyReadableOptions, LazySink, createMachineLists, createOnlineMachines, lazyReadable, machinesByHost } from "./stores.js";
|
|
6
6
|
import { MachinesTone, UPDATE_BUSY_STATES, agoText, daemonStatusText, hostCheckMessage, hostCheckOkLine, hostStatusText, hostStatusTone, linkStateText, updateStateLine, uptimeText } from "./messages.js";
|
|
7
7
|
import { hostOfSettingsFocus, hostSettingsFocus } from "./settings-focus.js";
|
|
8
|
-
export { DEFAULT_MACHINES_LABELS, DaemonControl, type DaemonHealth, DaemonStatus, type HostCapabilities, HostCheckError, HostCheckResult, type HostProviderAuth, HostSignInTarget, HostSummary, HostSync, HostSyncAccount, HostSyncConfig, HostSyncPatch, HostSyncRead, HostSyncState, HostsState, LazyReadableOptions, LazySink, MachineActionResult, type MachineInfo, MachineInvite, MachineLinks, type MachineLinksStatus, MachineList, MachineListState, MachinesAction, MachinesDirectory, MachinesError, MachinesHost, MachinesLabels, MachinesPresence, MachinesTone, PresenceFeed, SavedHosts, SavedHostsState, ServerToken, ServerTokenScope, ServerTokens, type ServerUpdateStatus, ServerUpdates, SessionPresence, SyncBlockedReason, type SyncCategory, type SyncMode, SyncOutcome, type SyncPushResult, type SyncStatus, ToolInstallResult, UPDATE_BUSY_STATES, agoText, createHostSyncReads, createMachineLists, createOnlineMachines, createPresenceStore, daemonStatusText, hostCheckMessage, hostCheckOkLine, hostOfSettingsFocus, hostSettingsFocus, hostStatusText, hostStatusTone, isMachinesError, isPermitted, lazyReadable, linkStateText, machinesError, shortList, syncBlockedReason, syncOutcome, updateStateLine, uptimeText };
|
|
8
|
+
export { BrowserPairing, DEFAULT_MACHINES_LABELS, DaemonControl, type DaemonHealth, DaemonStatus, type HostCapabilities, HostCheckError, HostCheckResult, type HostProviderAuth, HostSignInTarget, HostSummary, HostSync, HostSyncAccount, HostSyncConfig, HostSyncPatch, HostSyncRead, HostSyncState, HostsState, LazyReadableOptions, LazySink, MachineActionResult, type MachineInfo, MachineInvite, type MachineJoinEvent, MachineLinks, type MachineLinksStatus, MachineList, MachineListState, MachinesAction, MachinesDirectory, MachinesError, MachinesHost, MachinesLabels, MachinesPresence, MachinesTone, PresenceFeed, SavedHosts, SavedHostsState, ServerToken, ServerTokenScope, ServerTokens, type ServerUpdateStatus, ServerUpdates, SessionPresence, SyncBlockedReason, type SyncCategory, type SyncMode, SyncOutcome, type SyncPushResult, type SyncStatus, ToolInstallResult, UPDATE_BUSY_STATES, agoText, createHostSyncReads, createMachineLists, createOnlineMachines, createPresenceStore, daemonStatusText, hostCheckMessage, hostCheckOkLine, hostOfSettingsFocus, hostSettingsFocus, hostStatusText, hostStatusTone, isMachinesError, isPermitted, lazyReadable, linkStateText, machinesByHost, machinesError, shortList, syncBlockedReason, syncOutcome, updateStateLine, uptimeText };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { isMachinesError, isPermitted, machinesError } from "./host.js";
|
|
2
|
+
import { createMachineLists, createOnlineMachines, lazyReadable, machinesByHost } from "./stores.js";
|
|
3
|
+
import { DEFAULT_MACHINES_LABELS } from "./labels.js";
|
|
2
4
|
import { createPresenceStore } from "./presence.js";
|
|
3
|
-
import { createMachineLists, createOnlineMachines, lazyReadable } from "./stores.js";
|
|
4
5
|
import { createHostSyncReads, shortList, syncBlockedReason, syncOutcome } from "./sync.js";
|
|
5
|
-
import { DEFAULT_MACHINES_LABELS } from "./labels.js";
|
|
6
6
|
import { UPDATE_BUSY_STATES, agoText, daemonStatusText, hostCheckMessage, hostCheckOkLine, hostStatusText, hostStatusTone, linkStateText, updateStateLine, uptimeText } from "./messages.js";
|
|
7
7
|
import { hostOfSettingsFocus, hostSettingsFocus } from "./settings-focus.js";
|
|
8
|
-
export { DEFAULT_MACHINES_LABELS, UPDATE_BUSY_STATES, agoText, createHostSyncReads, createMachineLists, createOnlineMachines, createPresenceStore, daemonStatusText, hostCheckMessage, hostCheckOkLine, hostOfSettingsFocus, hostSettingsFocus, hostStatusText, hostStatusTone, isMachinesError, isPermitted, lazyReadable, linkStateText, machinesError, shortList, syncBlockedReason, syncOutcome, updateStateLine, uptimeText };
|
|
8
|
+
export { DEFAULT_MACHINES_LABELS, UPDATE_BUSY_STATES, agoText, createHostSyncReads, createMachineLists, createOnlineMachines, createPresenceStore, daemonStatusText, hostCheckMessage, hostCheckOkLine, hostOfSettingsFocus, hostSettingsFocus, hostStatusText, hostStatusTone, isMachinesError, isPermitted, lazyReadable, linkStateText, machinesByHost, machinesError, shortList, syncBlockedReason, syncOutcome, updateStateLine, uptimeText };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SyncBlockedReason } from "./sync.js";
|
|
2
2
|
import { HostCheckError, MachinesError, ServerTokenScope } from "./host.js";
|
|
3
|
-
import { SyncCategory, SyncMode } from "zidane/chat/pure";
|
|
3
|
+
import { MachineJoinRefusal, SyncCategory, SyncMode } from "zidane/chat/pure";
|
|
4
4
|
//#region src/machines/headless/labels.d.ts
|
|
5
5
|
/** The default English strings of the machines components. Override any of them through `MachinesProvider` or `LabelsProvider`. */
|
|
6
6
|
declare const DEFAULT_MACHINES_LABELS: {
|
|
@@ -22,6 +22,8 @@ declare const DEFAULT_MACHINES_LABELS: {
|
|
|
22
22
|
machinesRetry: string;
|
|
23
23
|
/** A failed read or action. The default shows the backend's message. */
|
|
24
24
|
machinesError: (error: MachinesError) => string;
|
|
25
|
+
/** A failed read or action, worded by what failed. What the backend said goes under Details. */
|
|
26
|
+
machinesFailed: (kind: MachinesError["kind"]) => string;
|
|
25
27
|
/** "5m" → "5m ago"; a date stays as is. */
|
|
26
28
|
machinesAgo: (short: string) => string;
|
|
27
29
|
machinesThisServer: string;
|
|
@@ -52,20 +54,6 @@ declare const DEFAULT_MACHINES_LABELS: {
|
|
|
52
54
|
machinesFactServerName: (name: string) => string;
|
|
53
55
|
machinesFactVersion: (version: string) => string;
|
|
54
56
|
machinesFactConnected: (ago: string) => string;
|
|
55
|
-
machinesFactScope: (scope: string) => string;
|
|
56
|
-
/** What a section, button or panel says to a connection that may not use it (a chat token). */
|
|
57
|
-
machinesAdminOnly: string;
|
|
58
|
-
/** The chip on a server's card: what this app's token may do there. */
|
|
59
|
-
machinesAccess: (scope: string) => "Admin access" | "Chat access";
|
|
60
|
-
machinesGetAdmin: string;
|
|
61
|
-
machinesGetAdminRun: string;
|
|
62
|
-
machinesGetAdminCopy: string;
|
|
63
|
-
machinesGetAdminToken: string;
|
|
64
|
-
machinesGetAdminTokenField: string;
|
|
65
|
-
machinesGetAdminSave: string;
|
|
66
|
-
machinesGetAdminSaving: string;
|
|
67
|
-
machinesGetAdminSaved: string;
|
|
68
|
-
machinesGetAdminPairNext: string;
|
|
69
57
|
machinesFactUptime: (uptime: string) => string;
|
|
70
58
|
machinesOkLine: (name: string, version?: string, latencyMs?: number) => string;
|
|
71
59
|
/** What to do about a refusal, per registry error code; `message` is the backend's own words. */
|
|
@@ -115,7 +103,6 @@ declare const DEFAULT_MACHINES_LABELS: {
|
|
|
115
103
|
machinesShareTokenPlaceholder: string;
|
|
116
104
|
machinesShareStart: string;
|
|
117
105
|
machinesSharing: (name: string) => string;
|
|
118
|
-
machinesShared: (roots: string, name: string) => string;
|
|
119
106
|
machinesStopping: string;
|
|
120
107
|
machinesUseTitle: (name: string) => string;
|
|
121
108
|
machinesUseMachineName: (machine: string) => string;
|
|
@@ -125,7 +112,31 @@ declare const DEFAULT_MACHINES_LABELS: {
|
|
|
125
112
|
machinesUse: string;
|
|
126
113
|
machinesConnectingTo: (name: string) => string;
|
|
127
114
|
machinesListTitle: (name: string) => string;
|
|
128
|
-
|
|
115
|
+
machinesExplain: string;
|
|
116
|
+
machinesHowItWorks: string;
|
|
117
|
+
machinesEmptyTitle: (name: string) => string;
|
|
118
|
+
machinesPictureApp: string;
|
|
119
|
+
machinesPictureAppFact: string;
|
|
120
|
+
machinesPictureServer: string;
|
|
121
|
+
machinesPictureServerFact: string;
|
|
122
|
+
machinesPictureMachines: string;
|
|
123
|
+
machinesPictureMachinesFact: string;
|
|
124
|
+
machinesServerBadge: string;
|
|
125
|
+
machinesServerRowHint: string;
|
|
126
|
+
machinesNewChat: string;
|
|
127
|
+
machinesAddedTitle: (name: string) => string;
|
|
128
|
+
machinesAddedNewChats: (name: string) => string;
|
|
129
|
+
machinesAddedNewChatsHint: string;
|
|
130
|
+
machinesAddedShare: (name: string) => string;
|
|
131
|
+
machinesAddedShareHint: string;
|
|
132
|
+
machinesDraftServerOffline: (name: string) => string;
|
|
133
|
+
machinesUseThisComputer: string;
|
|
134
|
+
machinesPlaceUnsaved: (name: string) => string;
|
|
135
|
+
machinesPlaceAddServer: (name: string) => string;
|
|
136
|
+
machinesPlaceMachineGone: (machine: string, host: string) => string;
|
|
137
|
+
machinesPlaceFolderGone: (folder: string) => string;
|
|
138
|
+
machinesNewChatLabel: (name: string) => string;
|
|
139
|
+
machinesFoldersMore: (count: number) => string;
|
|
129
140
|
machinesStatus: (status: "online" | "offline") => "offline" | "online";
|
|
130
141
|
machinesForget: string;
|
|
131
142
|
machinesForgetLabel: (machine: string) => string;
|
|
@@ -148,13 +159,31 @@ declare const DEFAULT_MACHINES_LABELS: {
|
|
|
148
159
|
machinesInviteTitle: (name: string) => string;
|
|
149
160
|
machinesInviteCommand: string;
|
|
150
161
|
machinesInviteCopy: string;
|
|
151
|
-
machinesInviteExpires: (time: string) => string;
|
|
152
162
|
machinesInviteHint: string;
|
|
153
163
|
machinesInviteDone: string;
|
|
154
|
-
|
|
164
|
+
machinesAddAnother: string;
|
|
165
|
+
machinesAddThis: string;
|
|
166
|
+
machinesAddWhich: string;
|
|
167
|
+
machinesAddTimeLeft: (minutes: number) => string;
|
|
168
|
+
machinesAddExpired: string;
|
|
169
|
+
machinesAddNewCode: string;
|
|
170
|
+
machinesAddWaiting: string;
|
|
171
|
+
machinesAddPaired: (name?: string) => string;
|
|
172
|
+
machinesAddRefused: (reason: MachineJoinRefusal, name?: string) => string;
|
|
173
|
+
machinesAddLocalAddress: string;
|
|
174
|
+
machinesAddAddress: string;
|
|
175
|
+
machinesAddInstalled: string;
|
|
176
|
+
machinesAddKeepOn: string;
|
|
177
|
+
machinesAddKeepOnHint: string;
|
|
178
|
+
machinesAddKeepOnOpen: string;
|
|
179
|
+
machinesAddThisTerminalHint: string;
|
|
180
|
+
machinesAddInstalledCopy: string;
|
|
181
|
+
machinesAddJoined: (machine: string, server: string) => string;
|
|
182
|
+
machinesAddJoinedHint: string;
|
|
183
|
+
machinesAddStartChat: string;
|
|
184
|
+
machinesAddThisHint: (name: string) => string;
|
|
155
185
|
machinesTokensName: string;
|
|
156
186
|
machinesTokensNamePlaceholder: string;
|
|
157
|
-
machinesTokensScope: string;
|
|
158
187
|
machinesTokensScopes: Record<ServerTokenScope, string>;
|
|
159
188
|
machinesTokensCreate: string;
|
|
160
189
|
machinesTokensCreating: string;
|
|
@@ -171,6 +200,13 @@ declare const DEFAULT_MACHINES_LABELS: {
|
|
|
171
200
|
machinesTokensCreatedAt: (ago: string) => string;
|
|
172
201
|
machinesTokensEmpty: string;
|
|
173
202
|
machinesTokensList: string;
|
|
203
|
+
machinesPairOpen: string;
|
|
204
|
+
machinesPairCreating: string;
|
|
205
|
+
machinesPairCode: string;
|
|
206
|
+
machinesPairCopy: string;
|
|
207
|
+
machinesPairExpires: (time: string) => string;
|
|
208
|
+
machinesPairHint: (url?: string) => string;
|
|
209
|
+
machinesPairDone: string;
|
|
174
210
|
machinesDaemonMenu: (health: string) => string;
|
|
175
211
|
machinesDaemon: string;
|
|
176
212
|
machinesDaemonOff: string;
|
|
@@ -186,6 +222,10 @@ declare const DEFAULT_MACHINES_LABELS: {
|
|
|
186
222
|
machinesDaemonNewerDetail: (versions: string) => string;
|
|
187
223
|
machinesDaemonOlder: string;
|
|
188
224
|
machinesDaemonOlderDetail: (versions: string) => string;
|
|
225
|
+
machinesDaemonOlderBusy: string;
|
|
226
|
+
machinesDaemonOlderBusyDetail: (versions: string) => string;
|
|
227
|
+
machinesDaemonCliOlder: string;
|
|
228
|
+
machinesDaemonCliOlderDetail: (versions: string) => string;
|
|
189
229
|
machinesDaemonRefused: string;
|
|
190
230
|
machinesDaemonConnecting: string;
|
|
191
231
|
machinesDaemonUnreachable: string;
|
|
@@ -224,6 +264,8 @@ declare const DEFAULT_MACHINES_LABELS: {
|
|
|
224
264
|
machinesDaemonCopy: string;
|
|
225
265
|
machinesDaemonCopying: string;
|
|
226
266
|
machinesDaemonCopied: string;
|
|
267
|
+
/** A daemon menu action failed. What it said goes under Details. */
|
|
268
|
+
machinesDaemonActionFailed: string;
|
|
227
269
|
machinesCapsMore: (count: number) => string;
|
|
228
270
|
machinesCapsOs: Record<string, string>;
|
|
229
271
|
machinesCapsFree: (bytes: number) => string;
|
|
@@ -262,6 +304,7 @@ declare const DEFAULT_MACHINES_LABELS: {
|
|
|
262
304
|
machinesAutoUpdateTitle: string;
|
|
263
305
|
machinesSyncTitle: string;
|
|
264
306
|
machinesMachinesTitle: string;
|
|
307
|
+
machinesTokensTitle: string;
|
|
265
308
|
machinesSyncModes: Record<SyncMode, string>;
|
|
266
309
|
machinesSyncCategories: Record<SyncCategory, {
|
|
267
310
|
label: string;
|
|
@@ -17,6 +17,18 @@ const DEFAULT_MACHINES_LABELS = {
|
|
|
17
17
|
machinesRetry: "Retry",
|
|
18
18
|
/** A failed read or action. The default shows the backend's message. */
|
|
19
19
|
machinesError: (error) => error.detail,
|
|
20
|
+
/** A failed read or action, worded by what failed. What the backend said goes under Details. */
|
|
21
|
+
machinesFailed: (kind) => ({
|
|
22
|
+
read: "Could not read it from the server.",
|
|
23
|
+
update: "Could not check or change the server's update.",
|
|
24
|
+
forget: "Could not forget the machine.",
|
|
25
|
+
remove: "Could not remove it.",
|
|
26
|
+
tokens: "Could not change the tokens.",
|
|
27
|
+
daemon: "The daemon could not do that.",
|
|
28
|
+
sync: "Could not sync.",
|
|
29
|
+
invite: "Could not create a join code.",
|
|
30
|
+
install: "Could not install the tool."
|
|
31
|
+
})[kind],
|
|
20
32
|
/** "5m" → "5m ago"; a date stays as is. */
|
|
21
33
|
machinesAgo: (short) => `${short} ago`,
|
|
22
34
|
machinesThisServer: "This server",
|
|
@@ -47,20 +59,6 @@ const DEFAULT_MACHINES_LABELS = {
|
|
|
47
59
|
machinesFactServerName: (name) => `server name ${name}`,
|
|
48
60
|
machinesFactVersion: (version) => `Zidane ${version}`,
|
|
49
61
|
machinesFactConnected: (ago) => `connected ${ago}`,
|
|
50
|
-
machinesFactScope: (scope) => `${scope} token`,
|
|
51
|
-
/** What a section, button or panel says to a connection that may not use it (a chat token). */
|
|
52
|
-
machinesAdminOnly: "Admin only",
|
|
53
|
-
/** The chip on a server's card: what this app's token may do there. */
|
|
54
|
-
machinesAccess: (scope) => scope === "admin" ? "Admin access" : "Chat access",
|
|
55
|
-
machinesGetAdmin: "Get admin",
|
|
56
|
-
machinesGetAdminRun: "Run this on the server:",
|
|
57
|
-
machinesGetAdminCopy: "Copy the command",
|
|
58
|
-
machinesGetAdminToken: "Then paste the token it prints:",
|
|
59
|
-
machinesGetAdminTokenField: "Admin token",
|
|
60
|
-
machinesGetAdminSave: "Use this token",
|
|
61
|
-
machinesGetAdminSaving: "Checking the token…",
|
|
62
|
-
machinesGetAdminSaved: "Connected with the admin token.",
|
|
63
|
-
machinesGetAdminPairNext: "Then sign out, and log in again with the code it prints.",
|
|
64
62
|
machinesFactUptime: (uptime) => `up ${uptime}`,
|
|
65
63
|
machinesOkLine: (name, version, latencyMs) => `${name} answered${version ? ` (zidane ${version})` : ""}${latencyMs !== void 0 ? ` in ${latencyMs} ms` : ""}.`,
|
|
66
64
|
/** What to do about a refusal, per registry error code; `message` is the backend's own words. */
|
|
@@ -121,23 +119,46 @@ const DEFAULT_MACHINES_LABELS = {
|
|
|
121
119
|
machinesShareTokenPlaceholder: "A machine token of the server (zds_…)",
|
|
122
120
|
machinesShareStart: "Start sharing",
|
|
123
121
|
machinesSharing: (name) => `Sharing this computer with ${name}…`,
|
|
124
|
-
machinesShared: (roots, name) => `Sharing ${roots} with ${name}.`,
|
|
125
122
|
machinesStopping: "Stopping…",
|
|
126
123
|
machinesUseTitle: (name) => `Use ${name} as a machine`,
|
|
127
|
-
machinesUseMachineName: (machine) => `
|
|
124
|
+
machinesUseMachineName: (machine) => `Listed as ${machine}`,
|
|
128
125
|
machinesUseHint: (name) => `Run commands on ${name}. Chats stay here.`,
|
|
129
126
|
machinesUseNotLent: (name) => `${name} does not lend itself (allowAsMachine is off).`,
|
|
130
127
|
machinesUseStop: "Stop using",
|
|
131
128
|
machinesUse: "Use",
|
|
132
129
|
machinesConnectingTo: (name) => `Connecting to ${name}…`,
|
|
133
130
|
machinesListTitle: (name) => `Machines on ${name}`,
|
|
134
|
-
|
|
131
|
+
machinesExplain: "Your server keeps your chats, settings and tools. Machines run the work on your projects and data.",
|
|
132
|
+
machinesHowItWorks: "How it works",
|
|
133
|
+
machinesEmptyTitle: (name) => `No machines on ${name} yet`,
|
|
134
|
+
machinesPictureApp: "This app",
|
|
135
|
+
machinesPictureAppFact: "Where you chat",
|
|
136
|
+
machinesPictureServer: "Server",
|
|
137
|
+
machinesPictureServerFact: "Keeps chats, settings and tools",
|
|
138
|
+
machinesPictureMachines: "Machines",
|
|
139
|
+
machinesPictureMachinesFact: "Run the work on your projects and data",
|
|
140
|
+
machinesServerBadge: "Server",
|
|
141
|
+
machinesServerRowHint: "Works in the server's own folders.",
|
|
142
|
+
machinesNewChat: "New chat",
|
|
143
|
+
machinesAddedTitle: (name) => `${name} is ready`,
|
|
144
|
+
machinesAddedNewChats: (name) => `Use ${name} for new chats`,
|
|
145
|
+
machinesAddedNewChatsHint: "New chats start there. You can still pick another place in each chat.",
|
|
146
|
+
machinesAddedShare: (name) => `Let ${name} run work on this computer`,
|
|
147
|
+
machinesAddedShareHint: "Pick the folders it can use. Sharing works while this app runs.",
|
|
148
|
+
machinesDraftServerOffline: (name) => `${name} is offline. Wait for it, or start this chat on this computer.`,
|
|
149
|
+
machinesUseThisComputer: "Use this computer",
|
|
150
|
+
machinesPlaceUnsaved: (name) => `New chats start on ${name}, but this computer has not added it. This chat starts here.`,
|
|
151
|
+
machinesPlaceAddServer: (name) => `Add ${name}`,
|
|
152
|
+
machinesPlaceMachineGone: (machine, host) => `${machine} is no longer a machine of ${host}. This chat starts on ${host}.`,
|
|
153
|
+
machinesPlaceFolderGone: (folder) => `${folder} is not there any more. This chat starts in the usual folder.`,
|
|
154
|
+
machinesNewChatLabel: (name) => `New chat on ${name}`,
|
|
155
|
+
machinesFoldersMore: (count) => `${count} more`,
|
|
135
156
|
machinesStatus: (status) => status,
|
|
136
157
|
machinesForget: "Forget",
|
|
137
158
|
machinesForgetLabel: (machine) => `Forget ${machine}`,
|
|
138
159
|
machinesForgetTitle: (machine) => `Forget ${machine}?`,
|
|
139
160
|
machinesForgetMessage: (name) => `${name} forgets it. Its sessions there stop working. To use it again, add it with a new join code.`,
|
|
140
|
-
machinesListNotPermitted: "
|
|
161
|
+
machinesListNotPermitted: "The machine list is not available.",
|
|
141
162
|
/** An offline machine's chip: `when` is "14:05" today, else a date. */
|
|
142
163
|
machinesOfflineSince: (when) => `offline since ${when}`,
|
|
143
164
|
machinesVersion: (version) => `v${version.replace(/^v/, "")}`,
|
|
@@ -154,21 +175,49 @@ const DEFAULT_MACHINES_LABELS = {
|
|
|
154
175
|
machinesInviteTitle: (name) => `Add a machine to ${name}`,
|
|
155
176
|
machinesInviteCommand: "Join command",
|
|
156
177
|
machinesInviteCopy: "Copy the join command",
|
|
157
|
-
|
|
158
|
-
machinesInviteHint: "Run it on the machine. It installs a service that joins this server.",
|
|
178
|
+
machinesInviteHint: "Run it on the machine. It installs zidane if needed, then a service that joins this server.",
|
|
159
179
|
machinesInviteDone: "Done",
|
|
160
|
-
|
|
180
|
+
machinesAddAnother: "Another computer",
|
|
181
|
+
machinesAddThis: "This computer",
|
|
182
|
+
machinesAddWhich: "Which computer",
|
|
183
|
+
machinesAddTimeLeft: (minutes) => `${Math.max(1, minutes)} min left`,
|
|
184
|
+
machinesAddExpired: "This code ended. Make a new one to add the machine.",
|
|
185
|
+
machinesAddNewCode: "New code",
|
|
186
|
+
machinesAddWaiting: "Waiting for the machine to join…",
|
|
187
|
+
machinesAddPaired: (name) => name ? `${name} used the code. Waiting for it to connect…` : "The machine used the code. Waiting for it to connect…",
|
|
188
|
+
machinesAddRefused: (reason, name) => {
|
|
189
|
+
switch (reason) {
|
|
190
|
+
case "used": return "This code was already used. Make a new one.";
|
|
191
|
+
case "expired": return "This code ended. Make a new one.";
|
|
192
|
+
case "name": return "The server cannot use the name the machine sent. Run the command again with --name and letters, digits, dots, dashes or underscores.";
|
|
193
|
+
case "limit": return "The server has no room for another machine token. Revoke one you do not use in Tokens, then run the command again.";
|
|
194
|
+
case "name-taken": return `Another machine on this server is named ${name ?? "that"}. Run the command again with another --name, or forget the other machine.`;
|
|
195
|
+
case "version": return "The machine runs another zidane version than the server. Update it, then run the command again.";
|
|
196
|
+
case "id-bound": return "The server knows this machine with another token, or forgot it. Make a new code and run the command again.";
|
|
197
|
+
default: return "The server turned the machine away.";
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
machinesAddLocalAddress: "Other computers often cannot reach this address. Change it to one that the machine can reach.",
|
|
201
|
+
machinesAddAddress: "Server address",
|
|
202
|
+
machinesAddInstalled: "If zidane is already there:",
|
|
203
|
+
machinesAddKeepOn: "Keep it on when this app is closed",
|
|
204
|
+
machinesAddKeepOnHint: "Run one command in a terminal here. It installs a service that keeps this computer shared.",
|
|
205
|
+
machinesAddKeepOnOpen: "Get the command",
|
|
206
|
+
machinesAddThisTerminalHint: "Run it in a terminal on this computer. It installs a service that keeps it shared, even with this app closed.",
|
|
207
|
+
machinesAddInstalledCopy: "Copy the setup command",
|
|
208
|
+
machinesAddJoined: (machine, server) => `${machine} joined ${server}`,
|
|
209
|
+
machinesAddJoinedHint: "You can now start chats that run on it.",
|
|
210
|
+
machinesAddStartChat: "Start a chat on it",
|
|
211
|
+
machinesAddThisHint: (name) => `Let ${name} run commands in folders that you pick. Sharing works while this app runs.`,
|
|
161
212
|
machinesTokensName: "Name",
|
|
162
213
|
machinesTokensNamePlaceholder: "The device it is for",
|
|
163
|
-
machinesTokensScope: "Scope",
|
|
164
214
|
machinesTokensScopes: {
|
|
165
|
-
|
|
166
|
-
admin: "Admin",
|
|
215
|
+
client: "Client",
|
|
167
216
|
machine: "Machine"
|
|
168
217
|
},
|
|
169
218
|
machinesTokensCreate: "Create token",
|
|
170
219
|
machinesTokensCreating: "Creating…",
|
|
171
|
-
machinesTokensCreated: (name) => `Copy the token for ${name} now
|
|
220
|
+
machinesTokensCreated: (name) => `Copy the token for ${name} now. It is not shown again.`,
|
|
172
221
|
machinesTokensRevoke: "Revoke",
|
|
173
222
|
machinesTokensRevokeLabel: (name) => `Revoke ${name}`,
|
|
174
223
|
machinesTokensRevokeTitle: (name) => `Revoke ${name}?`,
|
|
@@ -181,6 +230,13 @@ const DEFAULT_MACHINES_LABELS = {
|
|
|
181
230
|
machinesTokensCreatedAt: (ago) => `created ${ago}`,
|
|
182
231
|
machinesTokensEmpty: "No tokens yet.",
|
|
183
232
|
machinesTokensList: "Tokens",
|
|
233
|
+
machinesPairOpen: "Pair a browser",
|
|
234
|
+
machinesPairCreating: "Making a code…",
|
|
235
|
+
machinesPairCode: "Pairing code",
|
|
236
|
+
machinesPairCopy: "Copy the pairing code",
|
|
237
|
+
machinesPairExpires: (time) => `Works once, until ${time}.`,
|
|
238
|
+
machinesPairHint: (url) => `Open ${url ?? "the web app"} in the browser and type this code.`,
|
|
239
|
+
machinesPairDone: "Done",
|
|
184
240
|
machinesDaemonMenu: (health) => `Daemon menu, ${health}`,
|
|
185
241
|
machinesDaemon: "Daemon",
|
|
186
242
|
machinesDaemonOff: "Daemon mode is off",
|
|
@@ -196,6 +252,10 @@ const DEFAULT_MACHINES_LABELS = {
|
|
|
196
252
|
machinesDaemonNewerDetail: (versions) => `${versions} Relaunch Zidane to attach.`,
|
|
197
253
|
machinesDaemonOlder: "Daemon runs older code",
|
|
198
254
|
machinesDaemonOlderDetail: (versions) => `${versions} Restart it to update.`,
|
|
255
|
+
machinesDaemonOlderBusy: "Older daemon still busy",
|
|
256
|
+
machinesDaemonOlderBusyDetail: (versions) => `${versions} It is still finishing its work, and this window saves nothing beside it. Restart daemon now stops it.`,
|
|
257
|
+
machinesDaemonCliOlder: "zidane CLI is older than this app",
|
|
258
|
+
machinesDaemonCliOlderDetail: (versions) => `${versions} The daemon it starts can't serve this window, so chats run here. Update the zidane CLI on your PATH.`,
|
|
199
259
|
machinesDaemonRefused: "Daemon refused this window",
|
|
200
260
|
machinesDaemonConnecting: "Connecting…",
|
|
201
261
|
machinesDaemonUnreachable: "Can't reach the daemon",
|
|
@@ -234,6 +294,8 @@ const DEFAULT_MACHINES_LABELS = {
|
|
|
234
294
|
machinesDaemonCopy: "Copy diagnostics",
|
|
235
295
|
machinesDaemonCopying: "Copying…",
|
|
236
296
|
machinesDaemonCopied: "Diagnostics copied.",
|
|
297
|
+
/** A daemon menu action failed. What it said goes under Details. */
|
|
298
|
+
machinesDaemonActionFailed: "The daemon action failed.",
|
|
237
299
|
machinesCapsMore: (count) => `+${count}`,
|
|
238
300
|
machinesCapsOs: {
|
|
239
301
|
darwin: "macOS",
|
|
@@ -276,6 +338,7 @@ const DEFAULT_MACHINES_LABELS = {
|
|
|
276
338
|
machinesAutoUpdateTitle: "Auto-update",
|
|
277
339
|
machinesSyncTitle: "Settings sync",
|
|
278
340
|
machinesMachinesTitle: "Machines",
|
|
341
|
+
machinesTokensTitle: "Tokens and browsers",
|
|
279
342
|
machinesSyncModes: SYNC_MODE_LABEL,
|
|
280
343
|
machinesSyncCategories: SYNC_CATEGORY_INFO,
|
|
281
344
|
machinesSyncStartsWithHosts: "Settings sync starts with remote hosts.",
|