zidane-ui 9.1.3 → 9.1.5
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/server-extensions-host.js +1 -1
- package/dist/adapters/server-host.js +2 -1
- package/dist/adapters/server-machines-host.js +1 -1
- package/dist/adapters/server-session-host.js +87 -13
- package/dist/adapters/server-settings-host.js +1 -1
- 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/HostTranscript.d.ts +5 -1
- package/dist/chat/HostTranscript.js +16 -4
- package/dist/chat/RunEstimateChip.d.ts +5 -3
- package/dist/chat/RunEstimateChip.js +33 -3
- package/dist/chat/Transcript.js +1 -1
- package/dist/chat/composer/ComposerEditor.js +1 -1
- package/dist/chat/composer/ConversationBadges.js +16 -10
- package/dist/chat/composer/composer-bus.d.ts +2 -2
- package/dist/chat/composer/composer-bus.js +2 -2
- package/dist/chat/composer/use-composer-stores.js +1 -1
- package/dist/chat/composer/use-run-meter.js +1 -1
- package/dist/chat/headless/composer/conversation-badges.d.ts +8 -3
- package/dist/chat/headless/composer/conversation-badges.js +26 -11
- package/dist/chat/headless/composer/index.js +2 -2
- package/dist/chat/headless/composer/labels-chrome.d.ts +3 -1
- package/dist/chat/headless/composer/labels-chrome.js +3 -1
- package/dist/chat/headless/index.d.ts +5 -3
- package/dist/chat/headless/index.js +17 -15
- package/dist/chat/headless/labels.d.ts +54 -1
- package/dist/chat/headless/labels.js +62 -2
- package/dist/chat/headless/secrets.d.ts +32 -0
- package/dist/chat/headless/secrets.js +43 -0
- package/dist/chat/headless/session-list.d.ts +45 -0
- package/dist/chat/headless/sidebar/estimates.js +13 -1
- package/dist/chat/headless/sidebar/index.d.ts +2 -2
- package/dist/chat/headless/sidebar/index.js +1 -1
- package/dist/chat/headless/sidebar/labels.d.ts +50 -0
- package/dist/chat/headless/sidebar/labels.js +1 -0
- package/dist/chat/headless/sidebar/query.d.ts +2 -2
- package/dist/chat/headless/sidebar/query.js +6 -3
- package/dist/chat/headless/sidebar/types.d.ts +7 -1
- package/dist/chat/headless/sidebar/view.js +2 -0
- package/dist/chat/headless/transcript/auth-failure.d.ts +67 -0
- package/dist/chat/headless/transcript/auth-failure.js +87 -0
- package/dist/chat/headless/transcript/index.d.ts +2 -1
- package/dist/chat/headless/transcript/index.js +2 -1
- package/dist/chat/headless/transcript/nesting.d.ts +3 -3
- package/dist/chat/headless/transcript/nesting.js +12 -4
- package/dist/chat/index.d.ts +4 -2
- package/dist/chat/index.js +3 -1
- package/dist/chat/interactions/InboxPanel.d.ts +6 -2
- package/dist/chat/interactions/InboxPanel.js +82 -44
- package/dist/chat/interactions/PlanCard.d.ts +2 -2
- package/dist/chat/interactions/PlanCard.js +1 -1
- package/dist/chat/interactions/QuestionField.d.ts +8 -3
- package/dist/chat/interactions/QuestionField.js +89 -8
- package/dist/chat/interactions/QuestionForm.d.ts +3 -1
- package/dist/chat/interactions/QuestionForm.js +48 -10
- package/dist/chat/interactions/SecretInput.d.ts +32 -0
- package/dist/chat/interactions/SecretInput.js +72 -0
- package/dist/chat/interactions/card-ui.d.ts +5 -3
- package/dist/chat/interactions/card-ui.js +5 -3
- package/dist/chat/interactions/index.d.ts +2 -1
- package/dist/chat/interactions/index.js +2 -1
- package/dist/chat/sidebar/SessionSidebar.js +2 -0
- package/dist/chat/sidebar/SidebarFilterMenu.d.ts +7 -2
- package/dist/chat/sidebar/SidebarFilterMenu.js +26 -2
- package/dist/chat/sidebar/SidebarSessionRow.d.ts +3 -1
- package/dist/chat/sidebar/SidebarSessionRow.js +8 -3
- package/dist/chat/sidebar/sidebar-live.js +8 -4
- package/dist/chat/transcript/AuthFailureCard.d.ts +34 -0
- package/dist/chat/transcript/AuthFailureCard.js +358 -0
- package/dist/chat/transcript/InteractionToolBody.js +12 -2
- package/dist/chat/transcript/actions.d.ts +24 -1
- package/dist/chat/transcript/index.d.ts +3 -2
- package/dist/chat/transcript/index.js +2 -1
- package/dist/chat/transcript/notices.d.ts +2 -1
- package/dist/chat/transcript/notices.js +13 -1
- package/dist/chat/transcript/script-input.d.ts +1 -1
- package/dist/chat/transcript/shell-block.js +1 -1
- package/dist/components/HowItWorks.d.ts +8 -1
- package/dist/components/HowItWorks.js +2 -2
- package/dist/components/RowActionsMenu.d.ts +6 -1
- package/dist/components/RowActionsMenu.js +4 -0
- package/dist/core.css +24 -0
- package/dist/dist/{index-WlE93Q6d.d.ts → index-BI6RZc60.d.ts} +36 -3
- package/dist/dist/index-f-XWIoYo.d.ts +1 -0
- package/dist/dist/index.d.ts +6 -0
- package/dist/dist/sandbox-B4OW6oNx.d.ts +2 -0
- package/dist/dist/timeout-B5pO5I5a.d.ts +30 -0
- package/dist/extensions/ExtensionSettingsPage.js +1 -1
- package/dist/extensions/ExtensionSettingsSidebar.js +1 -1
- package/dist/extensions/headless/fixture-host.js +1 -1
- package/dist/extensions/headless/index.js +4 -4
- package/dist/extensions/hooks.js +1 -1
- package/dist/files/DiffsTab.js +1 -1
- package/dist/files/EditorColumn.js +1 -1
- package/dist/files/MediaDiff.js +1 -1
- package/dist/files/SearchPanel.js +121 -53
- package/dist/files/headless/name-match.js +29 -14
- package/dist/files/useEntryActions.js +1 -1
- package/dist/files/useOpenFiles.js +1 -1
- package/dist/git/WherePicker.js +2 -2
- package/dist/git/headless/environment.d.ts +6 -1
- package/dist/git/headless/environment.js +5 -2
- package/dist/git/headless/labels.d.ts +2 -0
- package/dist/git/headless/labels.js +2 -0
- package/dist/git/index.d.ts +2 -1
- package/dist/git/index.js +2 -1
- package/dist/git/useStartFromPanel.d.ts +22 -0
- package/dist/git/useStartFromPanel.js +91 -0
- package/dist/keybindings/KeyCommands.js +1 -1
- package/dist/keybindings/KeybindingsProvider.js +1 -1
- package/dist/keybindings/headless/catalog.js +2 -2
- package/dist/keybindings/headless/index.js +2 -2
- package/dist/keybindings/headless/overrides.js +1 -1
- package/dist/machines/HostSyncPanel.js +1 -1
- package/dist/machines/SyncOutcomeBadge.js +1 -1
- package/dist/machines/headless/index.js +1 -1
- package/dist/onboarding/demos/features.d.ts +9 -1
- package/dist/onboarding/demos/features.js +107 -2
- package/dist/onboarding/demos/how-it-works.d.ts +5 -1
- package/dist/onboarding/demos/how-it-works.js +120 -2
- package/dist/onboarding/headless/labels.d.ts +17 -0
- package/dist/onboarding/headless/labels.js +17 -0
- package/dist/onboarding/index.js +1 -1
- package/dist/onboarding/marks.d.ts +1 -2
- package/dist/onboarding/marks.js +4 -12
- package/dist/onboarding/steps/ReadyStep.js +1 -1
- package/dist/onboarding/steps/connect/ProviderPanel.js +1 -1
- package/dist/onboarding/tutorials.d.ts +3 -1
- package/dist/onboarding/tutorials.js +2 -1
- package/dist/palette/app-sources.js +1 -1
- package/dist/session/ArtifactsPanel.js +1 -1
- package/dist/session/PanelAttention.d.ts +14 -6
- package/dist/session/PanelAttention.js +35 -24
- package/dist/session/PlanTracker.d.ts +54 -0
- package/dist/session/PlanTracker.js +412 -0
- package/dist/session/ProjectHome.d.ts +15 -2
- package/dist/session/ProjectHome.js +158 -85
- package/dist/session/RemindersPanel.d.ts +25 -0
- package/dist/session/RemindersPanel.js +526 -0
- package/dist/session/SecretsPanel.d.ts +19 -0
- package/dist/session/SecretsPanel.js +241 -0
- package/dist/session/SessionProvider.d.ts +26 -5
- package/dist/session/SessionProvider.js +51 -6
- package/dist/session/StepStatusIcon.d.ts +24 -0
- package/dist/session/StepStatusIcon.js +50 -0
- package/dist/session/TodoList.d.ts +4 -3
- package/dist/session/TodoList.js +6 -5
- package/dist/session/headless/fixture-host.d.ts +32 -22
- package/dist/session/headless/fixture-host.js +86 -51
- package/dist/session/headless/fixture-plans.d.ts +57 -0
- package/dist/session/headless/fixture-plans.js +141 -0
- package/dist/session/headless/fixture-schedules.d.ts +49 -0
- package/dist/session/headless/fixture-schedules.js +133 -0
- package/dist/session/headless/home-layout.d.ts +10 -2
- package/dist/session/headless/home-layout.js +7 -2
- package/dist/session/headless/host.d.ts +85 -13
- package/dist/session/headless/index.d.ts +5 -3
- package/dist/session/headless/index.js +6 -4
- package/dist/session/headless/labels.d.ts +95 -12
- package/dist/session/headless/labels.js +67 -18
- package/dist/session/headless/plans.d.ts +53 -0
- package/dist/session/headless/plans.js +78 -0
- package/dist/session/headless/reminder-labels.d.ts +63 -0
- package/dist/session/headless/reminder-labels.js +84 -0
- package/dist/session/headless/schedules.d.ts +93 -0
- package/dist/session/headless/schedules.js +190 -0
- package/dist/session/headless/secrets.d.ts +28 -0
- package/dist/session/headless/secrets.js +48 -0
- package/dist/session/index.d.ts +7 -5
- package/dist/session/index.js +6 -4
- package/dist/session/testing/contract.d.ts +18 -5
- package/dist/session/testing/contract.js +351 -43
- package/dist/session/testing/index.d.ts +4 -2
- package/dist/session/testing/index.js +4 -2
- package/dist/settings/headless/catalog.js +17 -1
- package/dist/settings/headless/index.d.ts +2 -2
- package/dist/settings/headless/index.js +3 -3
- package/dist/settings/headless/labels.d.ts +0 -2
- package/dist/settings/headless/labels.js +0 -2
- package/dist/settings/headless/layout.js +7 -1
- package/dist/settings/headless/providers.d.ts +17 -1
- package/dist/settings/headless/providers.js +19 -1
- package/dist/settings/headless/search.d.ts +1 -1
- package/dist/settings/rows.d.ts +1 -1
- package/dist/settings/rows.js +2 -2
- 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 +1 -1
- package/dist/settings/sections/environments/EnvironmentsSection.js +1 -1
- package/dist/settings/sections/extensions/ChangeOriginDialog.js +1 -1
- package/dist/settings/sections/extensions/CreateExtensionDialog.js +1 -1
- package/dist/settings/sections/extensions/ExtensionsSection.js +1 -1
- package/dist/settings/sections/host-catalog/HostCatalogSection.js +1 -1
- package/dist/settings/sections/instructions/InstructionsSection.js +1 -1
- package/dist/settings/sections/mcp/McpSection.js +1 -1
- package/dist/settings/sections/mcp/McpServerRow.js +1 -1
- package/dist/settings/sections/models/ModelRows.js +1 -1
- package/dist/settings/sections/providers/ProvidersSection.js +209 -201
- package/dist/settings/sections/providers/ServerProvidersSection.js +1 -1
- package/dist/settings/sections/shared/catalog.js +1 -1
- package/dist/settings/sections/skills/SkillsSection.js +1 -1
- package/dist/styles.css +59 -1
- package/dist/terminal/HostTerminalSurface.js +2 -2
- package/dist/workspace/PanelContentView.d.ts +22 -4
- package/dist/workspace/PanelContentView.js +112 -16
- package/dist/workspace/PanelGlyph.d.ts +21 -0
- package/dist/workspace/PanelGlyph.js +33 -0
- package/dist/workspace/PanelHome.js +5 -3
- package/dist/workspace/PanelStrip.js +11 -4
- package/dist/workspace/PanelToolbar.d.ts +32 -0
- package/dist/workspace/PanelToolbar.js +194 -0
- package/dist/workspace/WorkspaceProvider.d.ts +3 -1
- package/dist/workspace/WorkspaceProvider.js +6 -2
- package/dist/workspace/extension-tabs.js +5 -2
- package/dist/workspace/headless/host.d.ts +4 -0
- package/dist/workspace/headless/index.d.ts +3 -1
- package/dist/workspace/headless/index.js +4 -2
- package/dist/workspace/headless/labels.d.ts +10 -0
- package/dist/workspace/headless/labels.js +11 -1
- package/dist/workspace/headless/pages.d.ts +15 -0
- package/dist/workspace/headless/pages.js +49 -0
- package/dist/workspace/headless/tab-mark.d.ts +14 -0
- package/dist/workspace/headless/tab-mark.js +27 -0
- package/dist/workspace/headless/view.d.ts +7 -1
- package/dist/workspace/index.d.ts +3 -2
- package/dist/workspace/index.js +3 -2
- package/dist/workspace/testing/index.js +6 -0
- package/dist/workspace/workspace-key-commands.js +3 -3
- package/package.json +2 -2
- package/src/styles/motion.css +13 -0
- package/src/styles/onboarding.css +0 -1
- package/src/styles/primitives.css +10 -0
- package/src/styles/workspace.css +17 -0
- package/dist/session/TodosPanel.d.ts +0 -19
- package/dist/session/TodosPanel.js +0 -251
- package/dist/session/headless/todos.d.ts +0 -22
- package/dist/session/headless/todos.js +0 -38
|
@@ -375,6 +375,61 @@ function DaemonDemo({ on, className, style }) {
|
|
|
375
375
|
})
|
|
376
376
|
});
|
|
377
377
|
}
|
|
378
|
+
/** Reminders: you type `/remind`, its chip counts down to now, and the reminder lands in the session. */
|
|
379
|
+
function RemindersDemo({ on, className, style }) {
|
|
380
|
+
const labels = useOnboardingLabels();
|
|
381
|
+
return /* @__PURE__ */ jsx(DemoStage, {
|
|
382
|
+
on,
|
|
383
|
+
className,
|
|
384
|
+
style,
|
|
385
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
386
|
+
className: "flex flex-col items-stretch gap-2 w-full max-w-[300px] min-w-0",
|
|
387
|
+
children: [/* @__PURE__ */ jsxs(MiniWindow, {
|
|
388
|
+
className: "w-full",
|
|
389
|
+
bodyClassName: "px-2.5 pt-0.5 pb-2.5 gap-1.5",
|
|
390
|
+
children: [
|
|
391
|
+
/* @__PURE__ */ jsx(Line, { width: "64%" }),
|
|
392
|
+
/* @__PURE__ */ jsx(Line, { width: "42%" }),
|
|
393
|
+
/* @__PURE__ */ jsxs("span", {
|
|
394
|
+
className: "flex items-center gap-2 pt-0.5 min-w-0",
|
|
395
|
+
children: [/* @__PURE__ */ jsxs(MetaChip, { children: [/* @__PURE__ */ jsx("span", {
|
|
396
|
+
"aria-hidden": true,
|
|
397
|
+
className: "i-ph-alarm"
|
|
398
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
399
|
+
className: "zg-demo-stack",
|
|
400
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
401
|
+
className: "zg-loop zg-demo-before",
|
|
402
|
+
children: labels.demoReminderIn
|
|
403
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
404
|
+
className: "zg-loop zg-demo-after text-[var(--zg-accent)]",
|
|
405
|
+
children: labels.demoReminderNow
|
|
406
|
+
})]
|
|
407
|
+
})] }), /* @__PURE__ */ jsx("span", {
|
|
408
|
+
className: "relative flex-1 h-1 rounded-full overflow-hidden zg-demo-track",
|
|
409
|
+
children: /* @__PURE__ */ jsx("span", { className: "zg-loop zg-demo-grow absolute inset-0 rounded-full bg-[var(--zg-accent-dot)]" })
|
|
410
|
+
})]
|
|
411
|
+
}),
|
|
412
|
+
/* @__PURE__ */ jsxs("span", {
|
|
413
|
+
className: "zg-loop zg-demo-after zg-tray self-end flex flex-col gap-0.5 max-w-[85%] px-2 py-1 rounded-zg-md min-w-0",
|
|
414
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
415
|
+
className: "zg-meta truncate",
|
|
416
|
+
children: labels.demoReminderFrom
|
|
417
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
418
|
+
className: "text-zg-label truncate",
|
|
419
|
+
children: labels.demoReminderText
|
|
420
|
+
})]
|
|
421
|
+
})
|
|
422
|
+
]
|
|
423
|
+
}), /* @__PURE__ */ jsx(Composer, { children: /* @__PURE__ */ jsxs("span", {
|
|
424
|
+
className: "flex items-center min-w-0 flex-1 text-zg-label whitespace-nowrap overflow-hidden",
|
|
425
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
426
|
+
className: "zg-loop zg-demo-type-early truncate",
|
|
427
|
+
children: labels.demoReminderTyped
|
|
428
|
+
}), /* @__PURE__ */ jsx(Caret, {})]
|
|
429
|
+
}) })]
|
|
430
|
+
})
|
|
431
|
+
});
|
|
432
|
+
}
|
|
378
433
|
/** Browser tab: a page at localhost:5173, and the agent's pointer that clicks its button. */
|
|
379
434
|
function BrowserDemo({ on, className, style }) {
|
|
380
435
|
const labels = useOnboardingLabels();
|
|
@@ -570,6 +625,54 @@ function ProjectExtensionsDemo({ on, className, style }) {
|
|
|
570
625
|
})
|
|
571
626
|
});
|
|
572
627
|
}
|
|
628
|
+
/** Secrets: the agent asks for a key in a password field, and the transcript says it was saved, never the value. */
|
|
629
|
+
function SecretsDemo({ on, className, style }) {
|
|
630
|
+
const labels = useOnboardingLabels();
|
|
631
|
+
return /* @__PURE__ */ jsx(DemoStage, {
|
|
632
|
+
on,
|
|
633
|
+
className,
|
|
634
|
+
style,
|
|
635
|
+
children: /* @__PURE__ */ jsxs(MiniWindow, {
|
|
636
|
+
className: "w-full max-w-[280px]",
|
|
637
|
+
bodyClassName: "px-3 pt-1 pb-2.5 gap-1.5",
|
|
638
|
+
children: [
|
|
639
|
+
/* @__PURE__ */ jsx("span", {
|
|
640
|
+
className: "truncate text-zg-label",
|
|
641
|
+
children: labels.demoSecretPrompt
|
|
642
|
+
}),
|
|
643
|
+
/* @__PURE__ */ jsxs("span", {
|
|
644
|
+
className: "zg-well flex items-center gap-1.5 h-6 px-2 rounded-zg-md min-w-0",
|
|
645
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
646
|
+
"aria-hidden": true,
|
|
647
|
+
className: "i-ph-lock-simple text-zg-label text-[var(--zg-text-muted)] shrink-0"
|
|
648
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
649
|
+
className: "zg-loop zg-demo-type-early truncate font-mono text-zg-badge text-[var(--zg-text)]",
|
|
650
|
+
children: labels.demoSecretDots
|
|
651
|
+
})]
|
|
652
|
+
}),
|
|
653
|
+
/* @__PURE__ */ jsxs("span", {
|
|
654
|
+
className: "flex items-center gap-2 pt-0.5 min-w-0",
|
|
655
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
656
|
+
className: `${buttonClass({
|
|
657
|
+
variant: "solid",
|
|
658
|
+
size: "xs"
|
|
659
|
+
})} zg-loop zg-demo-press`,
|
|
660
|
+
children: labels.demoSecretSave
|
|
661
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
662
|
+
className: "zg-loop zg-demo-after ml-auto min-w-0",
|
|
663
|
+
children: /* @__PURE__ */ jsxs(MetaChip, {
|
|
664
|
+
tone: "success",
|
|
665
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
666
|
+
"aria-hidden": true,
|
|
667
|
+
className: "i-ph-shield-check"
|
|
668
|
+
}), labels.demoSecretSaved]
|
|
669
|
+
})
|
|
670
|
+
})]
|
|
671
|
+
})
|
|
672
|
+
]
|
|
673
|
+
})
|
|
674
|
+
});
|
|
675
|
+
}
|
|
573
676
|
const DEMOS = {
|
|
574
677
|
codemode: CodemodeDemo,
|
|
575
678
|
webSearch: WebSearchDemo,
|
|
@@ -580,10 +683,12 @@ const DEMOS = {
|
|
|
580
683
|
checkForUpdates: UpdatesDemo,
|
|
581
684
|
subscriptionUsage: UsageDemo,
|
|
582
685
|
useDaemon: DaemonDemo,
|
|
686
|
+
schedules: RemindersDemo,
|
|
583
687
|
browser: BrowserDemo,
|
|
584
688
|
terminal: TerminalDemo,
|
|
585
689
|
notifications: NotificationsDemo,
|
|
586
|
-
loadProjectExtensions: ProjectExtensionsDemo
|
|
690
|
+
loadProjectExtensions: ProjectExtensionsDemo,
|
|
691
|
+
secrets: SecretsDemo
|
|
587
692
|
};
|
|
588
693
|
/**
|
|
589
694
|
* Whether a feature has a demo.
|
|
@@ -607,4 +712,4 @@ function FeatureDemo({ feature, on, className, style }) {
|
|
|
607
712
|
}) : null;
|
|
608
713
|
}
|
|
609
714
|
//#endregion
|
|
610
|
-
export { AutoTitleDemo, AutocompleteDemo, BrowserDemo, CodemodeDemo, DaemonDemo, FeatureDemo, NotificationsDemo, ProjectExtensionsDemo, RunEstimatesDemo, SpacesDemo, TerminalDemo, UpdatesDemo, UsageDemo, WebSearchDemo, hasFeatureDemo };
|
|
715
|
+
export { AutoTitleDemo, AutocompleteDemo, BrowserDemo, CodemodeDemo, DaemonDemo, FeatureDemo, NotificationsDemo, ProjectExtensionsDemo, RemindersDemo, RunEstimatesDemo, SecretsDemo, SpacesDemo, TerminalDemo, UpdatesDemo, UsageDemo, WebSearchDemo, hasFeatureDemo };
|
|
@@ -34,7 +34,11 @@ declare function AccountsScene({ step, className, style }: AccountsSceneProps):
|
|
|
34
34
|
type HostsSceneProps = SceneProps;
|
|
35
35
|
/** Hosts: zidane-server starts on a machine, prints a device token, then this app runs its sessions there. */
|
|
36
36
|
declare function HostsScene({ step, className, style }: HostsSceneProps): import("react").JSX.Element;
|
|
37
|
+
/** Props of {@link SecretsScene}. */
|
|
38
|
+
type SecretsSceneProps = SceneProps;
|
|
39
|
+
/** Secrets: a password field the agent asks with, the private file that keeps the key, then a command whose output hides it. */
|
|
40
|
+
declare function SecretsScene({ step, className, style }: SecretsSceneProps): import("react").JSX.Element;
|
|
37
41
|
/** The scene of each tutorial. */
|
|
38
42
|
declare const TUTORIAL_SCENES: Readonly<Record<TutorialTopic, ComponentType<SceneProps>>>;
|
|
39
43
|
//#endregion
|
|
40
|
-
export { AccountsScene, AccountsSceneProps, ConnectorsScene, ConnectorsSceneProps, EnvironmentsScene, EnvironmentsSceneProps, ExtensionsScene, ExtensionsSceneProps, FilesScene, FilesSceneProps, HostsScene, HostsSceneProps, InstructionsScene, InstructionsSceneProps, SkillsScene, SkillsSceneProps, TUTORIAL_SCENES };
|
|
44
|
+
export { AccountsScene, AccountsSceneProps, ConnectorsScene, ConnectorsSceneProps, EnvironmentsScene, EnvironmentsSceneProps, ExtensionsScene, ExtensionsSceneProps, FilesScene, FilesSceneProps, HostsScene, HostsSceneProps, InstructionsScene, InstructionsSceneProps, SecretsScene, SecretsSceneProps, SkillsScene, SkillsSceneProps, TUTORIAL_SCENES };
|
|
@@ -1003,6 +1003,123 @@ function HostsScene({ step, className, style }) {
|
|
|
1003
1003
|
})
|
|
1004
1004
|
});
|
|
1005
1005
|
}
|
|
1006
|
+
/** Secrets: a password field the agent asks with, the private file that keeps the key, then a command whose output hides it. */
|
|
1007
|
+
function SecretsScene({ step, className, style }) {
|
|
1008
|
+
const labels = useOnboardingLabels();
|
|
1009
|
+
return /* @__PURE__ */ jsx(TourStage, {
|
|
1010
|
+
step,
|
|
1011
|
+
className,
|
|
1012
|
+
style,
|
|
1013
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
1014
|
+
className: "zg-demo-stack items-center justify-items-center w-full max-w-[268px]",
|
|
1015
|
+
children: [
|
|
1016
|
+
/* @__PURE__ */ jsxs(Part, {
|
|
1017
|
+
at: [0],
|
|
1018
|
+
className: "relative zg-raised border rounded-zg-lg flex flex-col gap-2 px-3.5 py-3 w-[212px]",
|
|
1019
|
+
children: [
|
|
1020
|
+
/* @__PURE__ */ jsx("span", {
|
|
1021
|
+
className: "truncate text-zg-label text-[var(--zg-text)]",
|
|
1022
|
+
children: labels.sceneSecretPrompt
|
|
1023
|
+
}),
|
|
1024
|
+
/* @__PURE__ */ jsxs("span", {
|
|
1025
|
+
className: "zg-well flex items-center gap-1.5 h-6 px-2 rounded-zg-md min-w-0",
|
|
1026
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
1027
|
+
"aria-hidden": true,
|
|
1028
|
+
className: "i-ph-lock-simple text-zg-label text-[var(--zg-text-muted)] shrink-0"
|
|
1029
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
1030
|
+
className: "zg-loop zg-tour-type truncate font-mono text-zg-badge text-[var(--zg-text)]",
|
|
1031
|
+
style: after(300),
|
|
1032
|
+
children: labels.sceneSecretDots
|
|
1033
|
+
})]
|
|
1034
|
+
}),
|
|
1035
|
+
/* @__PURE__ */ jsx("span", {
|
|
1036
|
+
className: `zg-loop zg-tour-press ${buttonClass({
|
|
1037
|
+
variant: "solid",
|
|
1038
|
+
size: "xs"
|
|
1039
|
+
})} self-start`,
|
|
1040
|
+
style: after(1500),
|
|
1041
|
+
children: labels.sceneSecretSave
|
|
1042
|
+
}),
|
|
1043
|
+
/* @__PURE__ */ jsx(TourPointer, {
|
|
1044
|
+
className: "absolute left-14 bottom-1",
|
|
1045
|
+
from: [40, 30]
|
|
1046
|
+
})
|
|
1047
|
+
]
|
|
1048
|
+
}),
|
|
1049
|
+
/* @__PURE__ */ jsxs(Part, {
|
|
1050
|
+
at: [1],
|
|
1051
|
+
className: "flex items-center w-full",
|
|
1052
|
+
children: [
|
|
1053
|
+
/* @__PURE__ */ jsx("span", {
|
|
1054
|
+
className: "zg-raised border rounded-full grid place-items-center w-9 h-9 shrink-0",
|
|
1055
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
1056
|
+
"aria-hidden": true,
|
|
1057
|
+
className: "i-ph-key text-zg-body text-[var(--zg-accent)]"
|
|
1058
|
+
})
|
|
1059
|
+
}),
|
|
1060
|
+
/* @__PURE__ */ jsx(Link, {
|
|
1061
|
+
lit: [1],
|
|
1062
|
+
dots: [1]
|
|
1063
|
+
}),
|
|
1064
|
+
/* @__PURE__ */ jsxs("span", {
|
|
1065
|
+
className: "zg-raised border rounded-zg-md flex flex-col gap-1 px-2.5 py-2 w-[156px] shrink-0 min-w-0",
|
|
1066
|
+
children: [
|
|
1067
|
+
/* @__PURE__ */ jsxs("span", {
|
|
1068
|
+
className: "flex items-center gap-1.5 min-w-0",
|
|
1069
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
1070
|
+
"aria-hidden": true,
|
|
1071
|
+
className: "i-ph-file-lock text-zg-label text-[var(--zg-text-muted)] shrink-0"
|
|
1072
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
1073
|
+
className: "truncate font-mono text-zg-badge text-[var(--zg-text)]",
|
|
1074
|
+
children: labels.sceneSecretName
|
|
1075
|
+
})]
|
|
1076
|
+
}),
|
|
1077
|
+
/* @__PURE__ */ jsx("span", {
|
|
1078
|
+
className: "truncate font-mono text-zg-badge text-[var(--zg-text-muted)]",
|
|
1079
|
+
children: labels.sceneSecretsFolder
|
|
1080
|
+
}),
|
|
1081
|
+
/* @__PURE__ */ jsx(Pop, {
|
|
1082
|
+
at: 900,
|
|
1083
|
+
className: "self-start",
|
|
1084
|
+
children: /* @__PURE__ */ jsxs(MetaChip, {
|
|
1085
|
+
tone: "success",
|
|
1086
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
1087
|
+
"aria-hidden": true,
|
|
1088
|
+
className: "i-ph-clock"
|
|
1089
|
+
}), labels.sceneSecretTtl]
|
|
1090
|
+
})
|
|
1091
|
+
})
|
|
1092
|
+
]
|
|
1093
|
+
})
|
|
1094
|
+
]
|
|
1095
|
+
}),
|
|
1096
|
+
/* @__PURE__ */ jsx(Part, {
|
|
1097
|
+
at: [2],
|
|
1098
|
+
className: "flex items-center w-full",
|
|
1099
|
+
children: /* @__PURE__ */ jsxs(MiniWindow, {
|
|
1100
|
+
className: "w-full",
|
|
1101
|
+
bodyClassName: "px-2.5 pb-2.5 gap-1 font-mono text-zg-badge",
|
|
1102
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
1103
|
+
className: "zg-loop zg-tour-type truncate text-[var(--zg-text)]",
|
|
1104
|
+
style: after(200),
|
|
1105
|
+
children: labels.sceneSecretCommand
|
|
1106
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
1107
|
+
className: "zg-loop zg-tour-then flex items-center gap-1.5 min-w-0",
|
|
1108
|
+
style: after(1300),
|
|
1109
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
1110
|
+
"aria-hidden": true,
|
|
1111
|
+
className: "i-ph-shield-check shrink-0 text-zg-success"
|
|
1112
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
1113
|
+
className: "truncate text-[var(--zg-accent)]",
|
|
1114
|
+
children: labels.sceneSecretOutput
|
|
1115
|
+
})]
|
|
1116
|
+
})]
|
|
1117
|
+
})
|
|
1118
|
+
})
|
|
1119
|
+
]
|
|
1120
|
+
})
|
|
1121
|
+
});
|
|
1122
|
+
}
|
|
1006
1123
|
/** The scene of each tutorial. */
|
|
1007
1124
|
const TUTORIAL_SCENES = {
|
|
1008
1125
|
connectors: ConnectorsScene,
|
|
@@ -1013,7 +1130,8 @@ const TUTORIAL_SCENES = {
|
|
|
1013
1130
|
environments: EnvironmentsScene,
|
|
1014
1131
|
files: FilesScene,
|
|
1015
1132
|
accounts: AccountsScene,
|
|
1016
|
-
hosts: HostsScene
|
|
1133
|
+
hosts: HostsScene,
|
|
1134
|
+
secrets: SecretsScene
|
|
1017
1135
|
};
|
|
1018
1136
|
//#endregion
|
|
1019
|
-
export { AccountsScene, ConnectorsScene, EnvironmentsScene, ExtensionsScene, FilesScene, HostsScene, InstructionsScene, SkillsScene, TUTORIAL_SCENES };
|
|
1137
|
+
export { AccountsScene, ConnectorsScene, EnvironmentsScene, ExtensionsScene, FilesScene, HostsScene, InstructionsScene, SecretsScene, SkillsScene, TUTORIAL_SCENES };
|
|
@@ -111,6 +111,14 @@ declare const DEFAULT_ONBOARDING_LABELS: {
|
|
|
111
111
|
sceneTokenCreate: string;
|
|
112
112
|
sceneToken: string;
|
|
113
113
|
sceneWss: string;
|
|
114
|
+
sceneSecretPrompt: string;
|
|
115
|
+
sceneSecretDots: string;
|
|
116
|
+
sceneSecretSave: string;
|
|
117
|
+
sceneSecretName: string;
|
|
118
|
+
sceneSecretsFolder: string;
|
|
119
|
+
sceneSecretTtl: string;
|
|
120
|
+
sceneSecretCommand: string;
|
|
121
|
+
sceneSecretOutput: string;
|
|
114
122
|
sourceField: string;
|
|
115
123
|
browse: string;
|
|
116
124
|
sourceName: (label: string, repo: string) => string;
|
|
@@ -185,6 +193,15 @@ declare const DEFAULT_ONBOARDING_LABELS: {
|
|
|
185
193
|
demoNotifyApp: string;
|
|
186
194
|
demoNotifyBody: string;
|
|
187
195
|
demoFolders: readonly ["my-app", ".zidane", "extensions", "deploy.ts"];
|
|
196
|
+
demoSecretPrompt: string;
|
|
197
|
+
demoSecretDots: string;
|
|
198
|
+
demoSecretSave: string;
|
|
199
|
+
demoSecretSaved: string;
|
|
200
|
+
demoReminderTyped: string;
|
|
201
|
+
demoReminderIn: string;
|
|
202
|
+
demoReminderNow: string;
|
|
203
|
+
demoReminderFrom: string;
|
|
204
|
+
demoReminderText: string;
|
|
188
205
|
demoCommitCommand: string;
|
|
189
206
|
demoCommitMessage: string;
|
|
190
207
|
demoBranch: string;
|
|
@@ -165,6 +165,14 @@ const DEFAULT_ONBOARDING_LABELS = {
|
|
|
165
165
|
sceneTokenCreate: "$ zidane server token create --name laptop",
|
|
166
166
|
sceneToken: "zds_3f2a…",
|
|
167
167
|
sceneWss: "wss://",
|
|
168
|
+
sceneSecretPrompt: "Tailscale auth key",
|
|
169
|
+
sceneSecretDots: "••••••••••••",
|
|
170
|
+
sceneSecretSave: "Save securely",
|
|
171
|
+
sceneSecretName: "TS_AUTHKEY",
|
|
172
|
+
sceneSecretsFolder: "~/.zidane/secrets",
|
|
173
|
+
sceneSecretTtl: "24 hours",
|
|
174
|
+
sceneSecretCommand: "$ cat $ZIDANE_SECRETS/TS_AUTHKEY",
|
|
175
|
+
sceneSecretOutput: "[secret:TS_AUTHKEY]",
|
|
168
176
|
sourceField: "Repository or package",
|
|
169
177
|
browse: "Browse",
|
|
170
178
|
sourceName: (label, repo) => `${label}, ${repo}`,
|
|
@@ -252,6 +260,15 @@ const DEFAULT_ONBOARDING_LABELS = {
|
|
|
252
260
|
"extensions",
|
|
253
261
|
"deploy.ts"
|
|
254
262
|
],
|
|
263
|
+
demoSecretPrompt: "Tailscale auth key",
|
|
264
|
+
demoSecretDots: "••••••••••••",
|
|
265
|
+
demoSecretSave: "Save securely",
|
|
266
|
+
demoSecretSaved: "Saved TS_AUTHKEY",
|
|
267
|
+
demoReminderTyped: "/remind in 20m check the deploy",
|
|
268
|
+
demoReminderIn: "in 20 min",
|
|
269
|
+
demoReminderNow: "now",
|
|
270
|
+
demoReminderFrom: "Reminder",
|
|
271
|
+
demoReminderText: "Check the deploy",
|
|
255
272
|
demoCommitCommand: "/commit",
|
|
256
273
|
demoCommitMessage: "feat: rate limit /chat",
|
|
257
274
|
demoBranch: "main",
|
package/dist/onboarding/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OnboardingHostProvider, OnboardingProvider, useOnboarding, useOnboardingHost, useOnboardingLabels, useOnboardingStep } from "./OnboardingProvider.js";
|
|
2
|
-
import { ExtensionMark, NATIVE_EXTENSION_ICONS, ProviderMark, extensionMarkOf } from "./marks.js";
|
|
3
2
|
import { useSignIn } from "./useSignIn.js";
|
|
3
|
+
import { ExtensionMark, NATIVE_EXTENSION_ICONS, ProviderMark, extensionMarkOf } from "./marks.js";
|
|
4
4
|
import { DemoStage } from "./demos/parts.js";
|
|
5
5
|
import { TUTORIAL_SCENES } from "./demos/how-it-works.js";
|
|
6
6
|
import { Tutorial } from "./tutorials.js";
|
|
@@ -33,8 +33,7 @@ interface ExtensionMarkEntry {
|
|
|
33
33
|
brand?: string;
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
|
-
* The mark of an extension: its
|
|
37
|
-
* (the native catalog's logo or icon, else its letter).
|
|
36
|
+
* The mark of an extension: `extensionMark` of its entry, the rule every app and every row shares.
|
|
38
37
|
*
|
|
39
38
|
* @param entry - The extension.
|
|
40
39
|
*/
|
package/dist/onboarding/marks.js
CHANGED
|
@@ -29,24 +29,16 @@ function ProviderMark({ provider, size = "md", className }) {
|
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
|
-
* The mark of an extension: its
|
|
33
|
-
* (the native catalog's logo or icon, else its letter).
|
|
32
|
+
* The mark of an extension: `extensionMark` of its entry, the rule every app and every row shares.
|
|
34
33
|
*
|
|
35
34
|
* @param entry - The extension.
|
|
36
35
|
*/
|
|
37
36
|
function extensionMarkOf(entry) {
|
|
38
|
-
const own = entry.icon?.gui?.trim();
|
|
39
|
-
if (own) return {
|
|
40
|
-
kind: "icon",
|
|
41
|
-
gui: own
|
|
42
|
-
};
|
|
43
|
-
if (entry.brand) return {
|
|
44
|
-
kind: "brand",
|
|
45
|
-
brand: entry.brand
|
|
46
|
-
};
|
|
47
37
|
return extensionMark({
|
|
48
38
|
id: entry.name,
|
|
49
|
-
...entry.label ? { name: entry.label } : {}
|
|
39
|
+
...entry.label ? { name: entry.label } : {},
|
|
40
|
+
...entry.icon ? { icon: entry.icon } : {},
|
|
41
|
+
...entry.brand ? { brand: entry.brand } : {}
|
|
50
42
|
});
|
|
51
43
|
}
|
|
52
44
|
/**
|
|
@@ -4,8 +4,8 @@ import { BrowserSignIn } from "../../components/BrowserSignIn.js";
|
|
|
4
4
|
import { presetFor } from "../../theme/accents.js";
|
|
5
5
|
import { constant, useReadable } from "../../chat/headless/store.js";
|
|
6
6
|
import { useOnboarding, useOnboardingLabels } from "../OnboardingProvider.js";
|
|
7
|
-
import { ExtensionMark as ExtensionMark$1, ProviderMark } from "../marks.js";
|
|
8
7
|
import { useSignIn } from "../useSignIn.js";
|
|
8
|
+
import { ExtensionMark as ExtensionMark$1, ProviderMark } from "../marks.js";
|
|
9
9
|
import { OnboardingStepFrame } from "../OnboardingStepFrame.js";
|
|
10
10
|
import { StepSection } from "./StepSection.js";
|
|
11
11
|
import { TaskChip } from "./tasks.js";
|
|
@@ -3,8 +3,8 @@ import { Segmented } from "../../../components/Segmented.js";
|
|
|
3
3
|
import { ErrorNote, FormCard, OpLine } from "../../../components/Form.js";
|
|
4
4
|
import { BrowserSignIn } from "../../../components/BrowserSignIn.js";
|
|
5
5
|
import { useOnboarding, useOnboardingLabels } from "../../OnboardingProvider.js";
|
|
6
|
-
import { ProviderMark } from "../../marks.js";
|
|
7
6
|
import { useSignIn } from "../../useSignIn.js";
|
|
7
|
+
import { ProviderMark } from "../../marks.js";
|
|
8
8
|
import { KeyForm } from "./KeyForm.js";
|
|
9
9
|
import { ProviderReady } from "./ProviderReady.js";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -9,6 +9,8 @@ interface TutorialProps {
|
|
|
9
9
|
actions?: ReactNode;
|
|
10
10
|
/** The server it is about, by name: the steps that name this computer name it instead. Absent: this computer. */
|
|
11
11
|
host?: string;
|
|
12
|
+
/** The block's surface (`HowItWorks`): `raised` on a bare panel. @default 'tray' */
|
|
13
|
+
surface?: 'tray' | 'raised';
|
|
12
14
|
/** Extra classes on the block. */
|
|
13
15
|
className?: string;
|
|
14
16
|
}
|
|
@@ -17,6 +19,6 @@ interface TutorialProps {
|
|
|
17
19
|
*
|
|
18
20
|
* @param props - Component props.
|
|
19
21
|
*/
|
|
20
|
-
declare function Tutorial({ topic, actions, host, className }: TutorialProps): import("react").JSX.Element;
|
|
22
|
+
declare function Tutorial({ topic, actions, host, surface, className }: TutorialProps): import("react").JSX.Element;
|
|
21
23
|
//#endregion
|
|
22
24
|
export { Tutorial, TutorialProps };
|
|
@@ -8,7 +8,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
8
8
|
*
|
|
9
9
|
* @param props - Component props.
|
|
10
10
|
*/
|
|
11
|
-
function Tutorial({ topic, actions, host, className = "" }) {
|
|
11
|
+
function Tutorial({ topic, actions, host, surface, className = "" }) {
|
|
12
12
|
const labels = useOnboardingLabels();
|
|
13
13
|
const words = host === void 0 ? labels.tutorials[topic] : labels.tutorialOnServer(topic, host);
|
|
14
14
|
const Scene = TUTORIAL_SCENES[topic];
|
|
@@ -17,6 +17,7 @@ function Tutorial({ topic, actions, host, className = "" }) {
|
|
|
17
17
|
steps: words.steps,
|
|
18
18
|
illustration: (step) => /* @__PURE__ */ jsx(Scene, { step }),
|
|
19
19
|
actions,
|
|
20
|
+
...surface ? { surface } : {},
|
|
20
21
|
className
|
|
21
22
|
});
|
|
22
23
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { usePendingApprovals } from "../approvals/ApprovalsProvider.js";
|
|
2
1
|
import { getMergedKeybindings } from "../keybindings/headless/overrides.js";
|
|
2
|
+
import { usePendingApprovals } from "../approvals/ApprovalsProvider.js";
|
|
3
3
|
import { useKeybindingsHost } from "../keybindings/KeybindingsProvider.js";
|
|
4
4
|
import { useKeyCommandActions, useKeyCommandRegistry } from "../keybindings/KeyCommands.js";
|
|
5
5
|
import { usePresenceMap } from "../machines/MachinesProvider.js";
|
|
@@ -2,6 +2,7 @@ import { IconButton } from "../components/IconButton.js";
|
|
|
2
2
|
import { PanelEmpty, PanelLoading } from "../components/PanelEmpty.js";
|
|
3
3
|
import { PANEL_ROW, PANEL_ROW_HOVER, RowBadge } from "../components/PanelRows.js";
|
|
4
4
|
import { RowActionsMenu } from "../components/RowActionsMenu.js";
|
|
5
|
+
import { countArtifacts } from "./headless/artifacts.js";
|
|
5
6
|
import { useExtensionItems } from "../extensions/ExtensionsProvider.js";
|
|
6
7
|
import { useSessionArtifacts, useSessionHost } from "./SessionProvider.js";
|
|
7
8
|
import { useLinkRouter } from "../extensions/links.js";
|
|
@@ -9,7 +10,6 @@ import { useSessionLabels } from "./useSessionLabels.js";
|
|
|
9
10
|
import { ArtifactRowChips, badgeColorStyle, badgeToneClass } from "./ArtifactRowChips.js";
|
|
10
11
|
import { renderersFor } from "../extensions/headless/select.js";
|
|
11
12
|
import { ExtensionRenderer } from "../extensions/ExtensionRenderer.js";
|
|
12
|
-
import { countArtifacts } from "./headless/artifacts.js";
|
|
13
13
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
14
14
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
15
15
|
//#region src/session/ArtifactsPanel.tsx
|
|
@@ -25,16 +25,24 @@ interface InboxAttentionProps extends PanelAttentionProps {
|
|
|
25
25
|
*/
|
|
26
26
|
declare function InboxAttention({ sessionId, actions, reveal }: InboxAttentionProps): null;
|
|
27
27
|
/**
|
|
28
|
-
* Badges the
|
|
28
|
+
* Badges the Queue tab with the active session's queued messages; hidden at zero.
|
|
29
29
|
*
|
|
30
30
|
* @param props - The {@link PanelAttentionProps}.
|
|
31
31
|
*/
|
|
32
|
-
declare function
|
|
32
|
+
declare function QueueAttention({ sessionId, actions }: PanelAttentionProps): null;
|
|
33
|
+
/** Props for {@link SecretsAttention}. */
|
|
34
|
+
interface SecretsAttentionProps {
|
|
35
|
+
/** The active session, or `null`. */
|
|
36
|
+
sessionId: string | null;
|
|
37
|
+
/** Where the open goes. Default: the `WorkspaceProvider` above (none: nothing happens). Keep it stable. */
|
|
38
|
+
actions?: Pick<WorkspaceActions, 'openProactive'>;
|
|
39
|
+
}
|
|
33
40
|
/**
|
|
34
|
-
*
|
|
41
|
+
* Opens the Secrets tab (proactively) the first time the active session saves a secret, once per session. Reads the
|
|
42
|
+
* session's secrets itself, so the change signal reaches it while the panel is closed.
|
|
35
43
|
*
|
|
36
|
-
* @param props - The {@link
|
|
44
|
+
* @param props - The {@link SecretsAttentionProps}.
|
|
37
45
|
*/
|
|
38
|
-
declare function
|
|
46
|
+
declare function SecretsAttention({ sessionId, actions }: SecretsAttentionProps): null;
|
|
39
47
|
//#endregion
|
|
40
|
-
export { AttentionActions, InboxAttention, InboxAttentionProps, PanelAttentionProps, QueueAttention,
|
|
48
|
+
export { AttentionActions, InboxAttention, InboxAttentionProps, PanelAttentionProps, QueueAttention, SecretsAttention, SecretsAttentionProps };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useOptionalChatHost } from "../chat/ChatProvider.js";
|
|
2
|
-
import { useSessionQueue,
|
|
2
|
+
import { useSessionHost, useSessionQueue, useSessionSecrets } from "./SessionProvider.js";
|
|
3
3
|
import { useOptionalWorkspaceActions } from "../workspace/WorkspaceProvider.js";
|
|
4
4
|
import { useAllInteractions, usePendingInteractions } from "../chat/interactions/hooks.js";
|
|
5
5
|
import { useEffect, useLayoutEffect, useRef } from "react";
|
|
6
|
-
import { INBOX_PANEL_ID, QUEUE_PANEL_ID,
|
|
6
|
+
import { INBOX_PANEL_ID, QUEUE_PANEL_ID, SECRETS_PANEL_ID } from "zidane/chat/pure";
|
|
7
7
|
//#region src/session/PanelAttention.tsx
|
|
8
8
|
/**
|
|
9
9
|
* The side panel's attention drivers: they turn what waits in a session into
|
|
@@ -16,12 +16,13 @@ import { INBOX_PANEL_ID, QUEUE_PANEL_ID, TODOS_PANEL_ID } from "zidane/chat/pure
|
|
|
16
16
|
* once); a live request in the active session pins the Inbox tab and
|
|
17
17
|
* shows it, once per request (a blocked run outranks a tab). Rehydrated
|
|
18
18
|
* requests only badge.
|
|
19
|
-
* - `TodosAttention`: open items of the active session's list, info tone.
|
|
20
19
|
* - `QueueAttention`: messages of the active session waiting for its run
|
|
21
20
|
* to end, info tone.
|
|
21
|
+
* - `SecretsAttention`: the first time the active session saves a secret
|
|
22
|
+
* (new, or a replaced one), a proactive open of the Secrets tab, once per
|
|
23
|
+
* session; it never yanks the panel off a tab the user picked.
|
|
22
24
|
*
|
|
23
25
|
* <InboxAttention sessionId={active} />
|
|
24
|
-
* <TodosAttention sessionId={active} />
|
|
25
26
|
* <QueueAttention sessionId={active} />
|
|
26
27
|
*/
|
|
27
28
|
const ATTENTION_TONE = "attention";
|
|
@@ -74,47 +75,57 @@ function InboxAttention({ sessionId, actions, reveal = true }) {
|
|
|
74
75
|
return null;
|
|
75
76
|
}
|
|
76
77
|
/**
|
|
77
|
-
* Badges the
|
|
78
|
+
* Badges the Queue tab with the active session's queued messages; hidden at zero.
|
|
78
79
|
*
|
|
79
80
|
* @param props - The {@link PanelAttentionProps}.
|
|
80
81
|
*/
|
|
81
|
-
function
|
|
82
|
+
function QueueAttention({ sessionId, actions }) {
|
|
82
83
|
const panel = useAttentionActions(actions);
|
|
83
|
-
const
|
|
84
|
-
const open = snap && snap.todos.length > 0 ? snap.tally.pending + snap.tally.in_progress : 0;
|
|
84
|
+
const queued = useSessionQueue(sessionId).length;
|
|
85
85
|
useLayoutEffect(() => {
|
|
86
86
|
if (!sessionId || !panel) return;
|
|
87
|
-
panel.setAttention(sessionId,
|
|
88
|
-
count:
|
|
87
|
+
panel.setAttention(sessionId, QUEUE_PANEL_ID, queued > 0 ? {
|
|
88
|
+
count: queued,
|
|
89
89
|
tone: "info"
|
|
90
90
|
} : null);
|
|
91
91
|
}, [
|
|
92
92
|
sessionId,
|
|
93
|
-
|
|
93
|
+
queued,
|
|
94
94
|
panel
|
|
95
95
|
]);
|
|
96
96
|
return null;
|
|
97
97
|
}
|
|
98
98
|
/**
|
|
99
|
-
*
|
|
99
|
+
* Opens the Secrets tab (proactively) the first time the active session saves a secret, once per session. Reads the
|
|
100
|
+
* session's secrets itself, so the change signal reaches it while the panel is closed.
|
|
100
101
|
*
|
|
101
|
-
* @param props - The {@link
|
|
102
|
+
* @param props - The {@link SecretsAttentionProps}.
|
|
102
103
|
*/
|
|
103
|
-
function
|
|
104
|
-
const
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
104
|
+
function SecretsAttention({ sessionId, actions }) {
|
|
105
|
+
const fromProvider = useOptionalWorkspaceActions();
|
|
106
|
+
const panel = actions ?? fromProvider;
|
|
107
|
+
const secrets = useSessionHost().secrets;
|
|
108
|
+
const entries = useSessionSecrets(sessionId);
|
|
109
|
+
useEffect(() => {
|
|
110
|
+
if (sessionId) secrets?.refresh(sessionId).catch(() => void 0);
|
|
111
|
+
}, [secrets, sessionId]);
|
|
112
|
+
const seen = useRef(/* @__PURE__ */ new Map());
|
|
113
|
+
const opened = useRef(/* @__PURE__ */ new Set());
|
|
114
|
+
useEffect(() => {
|
|
115
|
+
if (!sessionId || !entries) return;
|
|
116
|
+
const known = seen.current.get(sessionId);
|
|
117
|
+
const now = new Map(entries.map((e) => [e.name, e.createdAt]));
|
|
118
|
+
seen.current.set(sessionId, now);
|
|
119
|
+
if (!known || !panel || opened.current.has(sessionId)) return;
|
|
120
|
+
if (!entries.some((e) => e.sessionId === sessionId && known.get(e.name) !== e.createdAt)) return;
|
|
121
|
+
opened.current.add(sessionId);
|
|
122
|
+
panel.openProactive(SECRETS_PANEL_ID);
|
|
112
123
|
}, [
|
|
113
124
|
sessionId,
|
|
114
|
-
|
|
125
|
+
entries,
|
|
115
126
|
panel
|
|
116
127
|
]);
|
|
117
128
|
return null;
|
|
118
129
|
}
|
|
119
130
|
//#endregion
|
|
120
|
-
export { InboxAttention, QueueAttention,
|
|
131
|
+
export { InboxAttention, QueueAttention, SecretsAttention };
|