@rightkit/agent-ui-settings 0.0.0-stage → 0.1.0
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/CHANGELOG.md +5 -0
- package/LICENSE-APACHE +201 -0
- package/LICENSE-MIT +21 -0
- package/README.md +44 -2
- package/dist/appName.d.ts +2 -0
- package/dist/appName.js +8 -0
- package/dist/components/PluginContributionHost.d.ts +17 -0
- package/dist/components/PluginContributionHost.js +23 -0
- package/dist/components/ReadinessCard.d.ts +4 -0
- package/dist/components/ReadinessCard.js +19 -0
- package/dist/components/remote/RemoteDevicesPanel.d.ts +7 -0
- package/dist/components/remote/RemoteDevicesPanel.js +153 -0
- package/dist/components/remote/RemoteHostsPanel.d.ts +8 -0
- package/dist/components/remote/RemoteHostsPanel.js +139 -0
- package/dist/components/settings/analytics/AnalyticsConsentCard.d.ts +14 -0
- package/dist/components/settings/analytics/AnalyticsConsentCard.js +22 -0
- package/dist/components/settings/cliUpdate/CliUpdatePanel.d.ts +9 -0
- package/dist/components/settings/cliUpdate/CliUpdatePanel.js +18 -0
- package/dist/components/settings/helpers.d.ts +7 -0
- package/dist/components/settings/helpers.js +40 -0
- package/dist/components/settings/keyboard/KeyboardShortcutsSettings.d.ts +12 -0
- package/dist/components/settings/keyboard/KeyboardShortcutsSettings.js +75 -0
- package/dist/components/settings/keyboard/ShortcutRecordingDialog.d.ts +27 -0
- package/dist/components/settings/keyboard/ShortcutRecordingDialog.js +154 -0
- package/dist/components/settings/marketplace/McpDiscoverPanel.d.ts +34 -0
- package/dist/components/settings/marketplace/McpDiscoverPanel.js +66 -0
- package/dist/components/settings/marketplace/SkillMarketplace.d.ts +22 -0
- package/dist/components/settings/marketplace/SkillMarketplace.js +51 -0
- package/dist/components/settings/tabs/ApiKeyAccounts.d.ts +9 -0
- package/dist/components/settings/tabs/ApiKeyAccounts.js +67 -0
- package/dist/components/settings/tabs/AppearanceTab.d.ts +1 -0
- package/dist/components/settings/tabs/AppearanceTab.js +29 -0
- package/dist/components/settings/tabs/AppleSyncPanel.d.ts +14 -0
- package/dist/components/settings/tabs/AppleSyncPanel.js +65 -0
- package/dist/components/settings/tabs/ChildProviderPolicy.d.ts +9 -0
- package/dist/components/settings/tabs/ChildProviderPolicy.js +84 -0
- package/dist/components/settings/tabs/ConductorsTab.d.ts +6 -0
- package/dist/components/settings/tabs/ConductorsTab.js +135 -0
- package/dist/components/settings/tabs/DiagnosticsTab.d.ts +13 -0
- package/dist/components/settings/tabs/DiagnosticsTab.js +39 -0
- package/dist/components/settings/tabs/ExecutionBackendsTab.d.ts +29 -0
- package/dist/components/settings/tabs/ExecutionBackendsTab.js +13 -0
- package/dist/components/settings/tabs/LicenseTab.d.ts +20 -0
- package/dist/components/settings/tabs/LicenseTab.js +66 -0
- package/dist/components/settings/tabs/LinkComputerPanel.d.ts +6 -0
- package/dist/components/settings/tabs/LinkComputerPanel.js +39 -0
- package/dist/components/settings/tabs/LspTab.d.ts +11 -0
- package/dist/components/settings/tabs/LspTab.js +34 -0
- package/dist/components/settings/tabs/MemoryTab.d.ts +7 -0
- package/dist/components/settings/tabs/MemoryTab.js +68 -0
- package/dist/components/settings/tabs/ProvidersTab.d.ts +10 -0
- package/dist/components/settings/tabs/ProvidersTab.js +214 -0
- package/dist/components/settings/tabs/RepairTab.d.ts +6 -0
- package/dist/components/settings/tabs/RepairTab.js +44 -0
- package/dist/components/settings/tabs/RootModelPicker.d.ts +10 -0
- package/dist/components/settings/tabs/RootModelPicker.js +39 -0
- package/dist/components/settings/tabs/RuntimeMiddlewareTab.d.ts +8 -0
- package/dist/components/settings/tabs/RuntimeMiddlewareTab.js +12 -0
- package/dist/components/settings/tabs/WorkspaceTab.d.ts +6 -0
- package/dist/components/settings/tabs/WorkspaceTab.js +9 -0
- package/dist/components/settings/tabs/execution/CoreSandboxTierPanel.d.ts +9 -0
- package/dist/components/settings/tabs/execution/CoreSandboxTierPanel.js +42 -0
- package/dist/components/settings/tabs/execution/ExecutionBackendCard.d.ts +20 -0
- package/dist/components/settings/tabs/execution/ExecutionBackendCard.js +48 -0
- package/dist/components/settings/tabs/execution/ExecutionBackendLimitsForm.d.ts +10 -0
- package/dist/components/settings/tabs/execution/ExecutionBackendLimitsForm.js +62 -0
- package/dist/components/settings/tabs/execution/ExecutionBackendList.d.ts +19 -0
- package/dist/components/settings/tabs/execution/ExecutionBackendList.js +8 -0
- package/dist/components/settings/tabs/execution/ExecutionNetworkProfilesPanel.d.ts +16 -0
- package/dist/components/settings/tabs/execution/ExecutionNetworkProfilesPanel.js +53 -0
- package/dist/components/settings/tabs/execution/RemoteStatusCard.d.ts +2 -0
- package/dist/components/settings/tabs/execution/RemoteStatusCard.js +5 -0
- package/dist/components/settings/tabs/execution/TextSettingInput.d.ts +15 -0
- package/dist/components/settings/tabs/execution/TextSettingInput.js +10 -0
- package/dist/components/settings/tabs/execution/types.d.ts +27 -0
- package/dist/components/settings/tabs/execution/types.js +1 -0
- package/dist/components/settings/tabs/models/ModelEmptyStates.d.ts +12 -0
- package/dist/components/settings/tabs/models/ModelEmptyStates.js +63 -0
- package/dist/components/settings/tabs/permissions/PersistentPermissionRuleList.d.ts +7 -0
- package/dist/components/settings/tabs/permissions/PersistentPermissionRuleList.js +15 -0
- package/dist/components/settings/tabs/plugins/InstalledPluginsList.d.ts +6 -0
- package/dist/components/settings/tabs/plugins/InstalledPluginsList.js +38 -0
- package/dist/components/settings/tabs/remote/RemoteChannelsPanel.d.ts +4 -0
- package/dist/components/settings/tabs/remote/RemoteChannelsPanel.js +14 -0
- package/dist/components/settings/tabs/remote/RemoteStatusCard.d.ts +8 -0
- package/dist/components/settings/tabs/remote/RemoteStatusCard.js +6 -0
- package/dist/components/settings/tabs/remote/TelegramStatusPanel.d.ts +6 -0
- package/dist/components/settings/tabs/remote/TelegramStatusPanel.js +41 -0
- package/dist/components/settings/tabs/shared.d.ts +18 -0
- package/dist/components/settings/tabs/shared.js +36 -0
- package/dist/components/settings/tabs/skills/SkillShared.d.ts +20 -0
- package/dist/components/settings/tabs/skills/SkillShared.js +28 -0
- package/dist/components/settings/tabs/skills/SkillTrainingRunList.d.ts +6 -0
- package/dist/components/settings/tabs/skills/SkillTrainingRunList.js +11 -0
- package/dist/components/settings/tools/ManagedToolHealthPanel.d.ts +16 -0
- package/dist/components/settings/tools/ManagedToolHealthPanel.js +24 -0
- package/dist/env.d.ts +59 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +33 -0
- package/package.json +171 -3
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ExecutionBackendConfig, ExecutionNetworkProfile } from "@rightkit/agent-ui-core/lib/types";
|
|
2
|
+
interface ExecutionBackendListProps {
|
|
3
|
+
backends: ExecutionBackendConfig[];
|
|
4
|
+
defaultBackend: string;
|
|
5
|
+
doctorReports: Record<string, import("@rightkit/agent-ui-core/lib/types").BackendDoctorReport>;
|
|
6
|
+
pendingId: string | null;
|
|
7
|
+
networkProfiles: ExecutionNetworkProfile[];
|
|
8
|
+
onDoctor: (backendId: string) => void;
|
|
9
|
+
onSetDefault: (backendId: string) => void;
|
|
10
|
+
onSetEnabled: (backendId: string, enabled: boolean) => void;
|
|
11
|
+
onSaveResourceLimits: (backendId: string, limits: {
|
|
12
|
+
cpu?: number | null;
|
|
13
|
+
memoryMb?: number | null;
|
|
14
|
+
diskMb?: number | null;
|
|
15
|
+
}) => void;
|
|
16
|
+
onSaveNetworkProfile: (backendId: string, networkProfile: string | null) => void;
|
|
17
|
+
}
|
|
18
|
+
export declare function ExecutionBackendList({ backends, defaultBackend, doctorReports, pendingId, networkProfiles, onDoctor, onSetDefault, onSetEnabled, onSaveResourceLimits, onSaveNetworkProfile, }: ExecutionBackendListProps): import("react").JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ExecutionBackendCard } from "./ExecutionBackendCard.js";
|
|
3
|
+
export function ExecutionBackendList({ backends, defaultBackend, doctorReports, pendingId, networkProfiles, onDoctor, onSetDefault, onSetEnabled, onSaveResourceLimits, onSaveNetworkProfile, }) {
|
|
4
|
+
if (backends.length === 0) {
|
|
5
|
+
return (_jsx("p", { className: "px-4 py-3 text-[13px] text-text-3", children: "No execution backends are registered." }));
|
|
6
|
+
}
|
|
7
|
+
return (_jsx("div", { className: "flex flex-col divide-y divide-line border border-line rounded-xl overflow-hidden max-w-[1100px]", children: backends.map((backend) => (_jsx(ExecutionBackendCard, { backend: backend, isDefault: backend.id === defaultBackend, doctorReport: doctorReports[backend.id], doctorPending: pendingId === `doctor:${backend.id}`, defaultPending: pendingId === `default:${backend.id}`, enabledPending: pendingId === `enabled:${backend.id}`, limitsPending: pendingId === `limits:${backend.id}`, networkPending: pendingId === `network:${backend.id}`, networkProfiles: networkProfiles, onDoctor: () => onDoctor(backend.id), onSetDefault: () => onSetDefault(backend.id), onSetEnabled: () => onSetEnabled(backend.id, !backend.enabled), onSaveResourceLimits: (limits) => onSaveResourceLimits(backend.id, limits), onSaveNetworkProfile: (networkProfile) => onSaveNetworkProfile(backend.id, networkProfile) }, backend.id))) }));
|
|
8
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ExecutionNetworkDefault, ExecutionNetworkProfile } from "@rightkit/agent-ui-core/lib/types";
|
|
2
|
+
interface ExecutionNetworkProfilesPanelProps {
|
|
3
|
+
profiles: ExecutionNetworkProfile[];
|
|
4
|
+
pendingId: string | null;
|
|
5
|
+
workspaceRoot: string;
|
|
6
|
+
onSaveDefinition: (profileId: string, body: {
|
|
7
|
+
name?: string;
|
|
8
|
+
default?: ExecutionNetworkDefault;
|
|
9
|
+
allowHosts?: string[];
|
|
10
|
+
allowPrivateNetworks?: boolean;
|
|
11
|
+
denyPrivateNetworks?: boolean;
|
|
12
|
+
}) => void;
|
|
13
|
+
onDeleteDefinition: (profileId: string) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare function ExecutionNetworkProfilesPanel({ profiles, pendingId, workspaceRoot, onSaveDefinition, onDeleteDefinition, }: ExecutionNetworkProfilesPanelProps): import("react").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { Checkbox, ConfirmDialog, Select } from "@rightkit/react-shell/react";
|
|
4
|
+
import Icon from "@rightkit/agent-ui-core/components/Icon";
|
|
5
|
+
import { TextSettingInput } from "./TextSettingInput.js";
|
|
6
|
+
export function ExecutionNetworkProfilesPanel({ profiles, pendingId, workspaceRoot, onSaveDefinition, onDeleteDefinition, }) {
|
|
7
|
+
const [draft, setDraft] = useState(() => emptyNetworkProfileDraft());
|
|
8
|
+
const [confirmDeleteOpen, setConfirmDeleteOpen] = useState(false);
|
|
9
|
+
const draftId = draft.id.trim();
|
|
10
|
+
const saving = draftId ? pendingId === `profile:${draftId}` : false;
|
|
11
|
+
const deleting = draftId ? pendingId === `profile-delete:${draftId}` : false;
|
|
12
|
+
const saveDisabled = !draftId || saving || deleting;
|
|
13
|
+
const deleteDisabled = !draftId || saving || deleting;
|
|
14
|
+
return (_jsxs("section", { className: "grid gap-4 rounded-xl border border-line bg-panel p-4 max-w-[1100px]", children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("h4", { className: "text-[13px] font-semibold text-text", children: "Workspace network profile" }), _jsx("p", { className: "mt-1 text-[12px] text-text-3 truncate", children: workspaceRoot || "workspace not selected" })] }), _jsxs("div", { className: "flex gap-2", children: [_jsxs("button", { type: "button", className: "inline-flex items-center justify-center gap-2 h-8 px-3 rounded-lg border border-line bg-transparent text-text-2 text-[13px] cursor-pointer hover:bg-panel-2 hover:text-text disabled:opacity-40 whitespace-nowrap", disabled: saveDisabled, onClick: () => onSaveDefinition(draftId, {
|
|
15
|
+
name: draft.name.trim() || draftId,
|
|
16
|
+
default: draft.defaultMode,
|
|
17
|
+
allowHosts: splitNetworkProfileHosts(draft.allowHosts),
|
|
18
|
+
allowPrivateNetworks: draft.allowPrivateNetworks,
|
|
19
|
+
denyPrivateNetworks: draft.denyPrivateNetworks,
|
|
20
|
+
}), children: [_jsx(Icon, { name: "check" }), saving ? "Saving profile" : "Save profile"] }), _jsxs("button", { type: "button", className: "inline-flex items-center justify-center gap-2 h-8 px-3 rounded-lg border border-danger/40 bg-transparent text-danger text-[13px] cursor-pointer hover:bg-danger/10 disabled:opacity-40 whitespace-nowrap", disabled: deleteDisabled, onClick: () => setConfirmDeleteOpen(true), children: [_jsx(Icon, { name: "trash" }), deleting ? "Deleting" : "Delete profile"] })] })] }), _jsxs("div", { className: "grid gap-3 lg:grid-cols-[minmax(0,0.8fr)_minmax(0,1fr)_minmax(0,1.2fr)]", children: [_jsx(TextSettingInput, { label: "Profile ID", value: draft.id, onChange: (id) => setDraft((current) => ({ ...current, id })) }), _jsx(TextSettingInput, { label: "Name", value: draft.name, onChange: (name) => setDraft((current) => ({ ...current, name })) }), _jsxs("label", { className: "flex flex-col gap-1 min-w-0", children: [_jsx("span", { className: "text-[10px] uppercase tracking-[0.08em] text-text-3", children: "Default" }), _jsx(Select, { label: "Default network mode", value: draft.defaultMode, onChange: (defaultMode) => setDraft((current) => ({ ...current, defaultMode })), options: [
|
|
21
|
+
{ value: "deny", label: "Deny" },
|
|
22
|
+
{ value: "allow", label: "Allow" },
|
|
23
|
+
] })] })] }), _jsxs("label", { className: "flex flex-col gap-1 min-w-0", children: [_jsx("span", { className: "text-[10px] uppercase tracking-[0.08em] text-text-3", children: "Allow hosts" }), _jsx("textarea", { className: "min-h-[74px] resize-y rounded-lg border border-line bg-panel-2 px-3 py-2 text-[12px] text-text outline-none focus:border-accent/60", value: draft.allowHosts, onChange: (event) => setDraft((current) => ({ ...current, allowHosts: event.target.value })) })] }), _jsxs("div", { className: "flex flex-wrap gap-3", children: [_jsx(Checkbox, { label: "Allow private networks", checked: draft.allowPrivateNetworks, onChange: (allowPrivateNetworks) => setDraft((current) => ({ ...current, allowPrivateNetworks })) }), _jsx(Checkbox, { label: "Deny private networks", checked: draft.denyPrivateNetworks, onChange: (denyPrivateNetworks) => setDraft((current) => ({ ...current, denyPrivateNetworks })) })] }), _jsx("div", { className: "flex flex-wrap gap-2", children: profiles.map((profile) => (_jsxs("button", { type: "button", className: "inline-flex items-center gap-2 max-w-full rounded-lg border border-line bg-panel-2 px-3 py-2 text-left text-[12px] text-text-2 hover:text-text", onClick: () => setDraft(networkProfileDraftFrom(profile)), children: [_jsx("span", { className: "font-semibold text-text truncate", children: profile.name }), _jsx("span", { className: "text-text-3 truncate", children: profile.id }), _jsx("span", { className: "text-text-3", children: profile.default })] }, profile.id))) }), confirmDeleteOpen ? (_jsx(ConfirmDialog, { title: "Delete network profile?", description: `Delete network profile "${draft.name.trim() || draftId}"? Sessions using it fall back to the workspace default.`, confirmLabel: "Delete", danger: true, onCancel: () => setConfirmDeleteOpen(false), onConfirm: () => {
|
|
24
|
+
setConfirmDeleteOpen(false);
|
|
25
|
+
onDeleteDefinition(draftId);
|
|
26
|
+
} })) : null] }));
|
|
27
|
+
}
|
|
28
|
+
function emptyNetworkProfileDraft() {
|
|
29
|
+
return {
|
|
30
|
+
id: "workspace-egress",
|
|
31
|
+
name: "Workspace egress",
|
|
32
|
+
defaultMode: "deny",
|
|
33
|
+
allowHosts: "",
|
|
34
|
+
allowPrivateNetworks: false,
|
|
35
|
+
denyPrivateNetworks: true,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function networkProfileDraftFrom(profile) {
|
|
39
|
+
return {
|
|
40
|
+
id: profile.id,
|
|
41
|
+
name: profile.name,
|
|
42
|
+
defaultMode: profile.default,
|
|
43
|
+
allowHosts: profile.allowHosts.join("\n"),
|
|
44
|
+
allowPrivateNetworks: profile.allowPrivateNetworks,
|
|
45
|
+
denyPrivateNetworks: profile.denyPrivateNetworks,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function splitNetworkProfileHosts(value) {
|
|
49
|
+
return value
|
|
50
|
+
.split(/[\n,]+/)
|
|
51
|
+
.map((host) => host.trim())
|
|
52
|
+
.filter(Boolean);
|
|
53
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { diagnosticsCardStatusClass } from "../shared.js";
|
|
3
|
+
export function RemoteStatusCard({ title, value, status, detail }) {
|
|
4
|
+
return (_jsxs("div", { className: `flex flex-col gap-1 rounded-lg border px-3 py-2 ${diagnosticsCardStatusClass(status)}`, children: [_jsx("span", { className: "text-[11px] uppercase text-text-3", children: title }), _jsx("strong", { className: "text-[14px] font-semibold text-text", children: value }), detail ? _jsx("span", { className: "text-[12px] text-text-3 break-all", children: detail }) : null] }));
|
|
5
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare function TextSettingInput({ label, value, onChange, }: {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
onChange: (value: string) => void;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
6
|
+
export declare function TextSettingTextarea({ label, value, onChange, }: {
|
|
7
|
+
label: string;
|
|
8
|
+
value: string;
|
|
9
|
+
onChange: (value: string) => void;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
11
|
+
export declare function ResourceLimitInput({ label, value, onChange, }: {
|
|
12
|
+
label: string;
|
|
13
|
+
value: string;
|
|
14
|
+
onChange: (value: string) => void;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export function TextSettingInput({ label, value, onChange, }) {
|
|
3
|
+
return (_jsxs("label", { className: "flex flex-col gap-1 min-w-0", children: [_jsx("span", { className: "text-[10px] uppercase tracking-[0.08em] text-text-3", children: label }), _jsx("input", { className: "h-8 min-w-0 rounded-lg border border-line bg-panel px-2 text-[12px] text-text outline-none focus:border-accent/60", type: "text", value: value, onChange: (event) => onChange(event.target.value) })] }));
|
|
4
|
+
}
|
|
5
|
+
export function TextSettingTextarea({ label, value, onChange, }) {
|
|
6
|
+
return (_jsxs("label", { className: "flex flex-col gap-1 min-w-0", children: [_jsx("span", { className: "text-[10px] uppercase tracking-[0.08em] text-text-3", children: label }), _jsx("textarea", { className: "min-h-20 min-w-0 rounded-lg border border-line bg-panel px-2 py-2 text-[12px] text-text outline-none focus:border-accent/60", value: value, onChange: (event) => onChange(event.target.value) })] }));
|
|
7
|
+
}
|
|
8
|
+
export function ResourceLimitInput({ label, value, onChange, }) {
|
|
9
|
+
return (_jsxs("label", { className: "flex flex-col gap-1 min-w-0", children: [_jsx("span", { className: "text-[10px] uppercase tracking-[0.08em] text-text-3", children: label }), _jsx("input", { className: "h-8 min-w-0 rounded-lg border border-line bg-panel px-2 text-[12px] text-text outline-none focus:border-accent/60", type: "number", min: "1", step: "1", inputMode: "numeric", value: value, onChange: (event) => onChange(event.target.value) })] }));
|
|
10
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ExecutionBackendConfig, ExecutionNetworkDefault } from "@rightkit/agent-ui-core/lib/types";
|
|
2
|
+
export type { ExecutionBackendConfig };
|
|
3
|
+
export interface NetworkProfileDraft {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
defaultMode: ExecutionNetworkDefault;
|
|
7
|
+
allowHosts: string;
|
|
8
|
+
allowPrivateNetworks: boolean;
|
|
9
|
+
denyPrivateNetworks: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface ResourceLimitsDraft {
|
|
12
|
+
cpu: string;
|
|
13
|
+
memoryMb: string;
|
|
14
|
+
diskMb: string;
|
|
15
|
+
}
|
|
16
|
+
export type ResourceLimitsChange = (limits: {
|
|
17
|
+
cpu?: number | null;
|
|
18
|
+
memoryMb?: number | null;
|
|
19
|
+
diskMb?: number | null;
|
|
20
|
+
}) => void;
|
|
21
|
+
export type NetworkProfileChange = (networkProfile: string | null) => void;
|
|
22
|
+
export interface RemoteStatusCardProps {
|
|
23
|
+
title: string;
|
|
24
|
+
value: string;
|
|
25
|
+
status: "pass" | "warn" | "block";
|
|
26
|
+
detail?: string;
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { LocalModelCatalog, LocalModelProbeResult } from "@rightkit/agent-ui-core/lib/types";
|
|
2
|
+
export declare function ModelSettingsEmptyState({ onOpenWorkspace }: {
|
|
3
|
+
onOpenWorkspace: () => void;
|
|
4
|
+
}): import("react").JSX.Element;
|
|
5
|
+
export declare function LocalModelCookbookEmpty({ onRefreshLocalModels, }: {
|
|
6
|
+
onRefreshLocalModels: () => void;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
8
|
+
export declare function localModelFitLabel(fit: LocalModelCatalog["recommendations"][number]["fit"]): "caution" | "good fit" | "too large" | "unknown";
|
|
9
|
+
export declare function localGpuMemoryLabel(gpus: LocalModelCatalog["hardware"]["gpuDevices"]): string;
|
|
10
|
+
export declare function localModelVramLabel(model: LocalModelCatalog["recommendations"][number]): string;
|
|
11
|
+
export declare function localModelSmokeCandidate(probe: LocalModelProbeResult | null, catalog: LocalModelCatalog | null): string | undefined;
|
|
12
|
+
export declare function localModelFitClass(fit: LocalModelCatalog["recommendations"][number]["fit"]): "border-accent-2/40 text-accent-2" | "border-accent/40 text-accent" | "border-danger/40 text-danger" | "border-line text-text-3";
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Icon from "@rightkit/agent-ui-core/components/Icon";
|
|
3
|
+
import { DiagnosticsStat } from "../shared.js";
|
|
4
|
+
import { hostAppName } from "../../../../appName.js";
|
|
5
|
+
export function ModelSettingsEmptyState({ onOpenWorkspace }) {
|
|
6
|
+
return (_jsxs("div", { className: "cr-panel-reveal rounded-xl border border-line bg-panel", children: [_jsxs("div", { className: "flex flex-wrap items-start gap-3 border-b border-line px-4 py-4", children: [_jsx("span", { className: "grid h-9 w-9 flex-shrink-0 place-items-center rounded-lg border border-line bg-bg text-text-2", children: _jsx(Icon, { name: "activity", size: 15 }) }), _jsxs("div", { className: "min-w-[240px] flex-1", children: [_jsx("strong", { className: "block text-[13px] font-semibold text-text", children: "Model settings attach to a workspace" }), _jsxs("p", { className: "mt-1 max-w-[620px] text-[13px] leading-[1.5] text-text-2", children: ["Open a local folder first; ", hostAppName(), " will load the project model map, role overrides, and provider readiness into this panel."] })] }), _jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx("span", { className: "rounded-full border border-line bg-bg px-2.5 py-1 text-[11px] font-semibold text-text-2", children: "Workspace required" }), _jsxs("button", { type: "button", className: "cr-control-pill inline-flex h-8 items-center gap-2 rounded-lg border-0 bg-accent px-3 text-[12px] font-semibold text-on-accent hover:opacity-90", onClick: onOpenWorkspace, children: [_jsx(Icon, { name: "folder", size: 13 }), " Open local folder"] })] })] }), _jsxs("div", { className: "grid gap-2 p-3", children: [_jsx(ModelEmptyStep, { label: "1", title: "Choose workspace", detail: "Open a repo or worktree so settings can attach to the project.", current: true }), _jsx(ModelEmptyStep, { label: "2", title: "Load roles", detail: `${hostAppName()} reads role defaults from the workspace.` }), _jsx(ModelEmptyStep, { label: "3", title: "Save defaults", detail: "The Save button becomes primary after a real setting changes." })] })] }));
|
|
7
|
+
}
|
|
8
|
+
function ModelEmptyStep({ label, title, detail, current = false, }) {
|
|
9
|
+
return (_jsxs("div", { className: `grid min-w-0 grid-cols-[28px_minmax(0,1fr)] gap-3 rounded-lg border px-3 py-3 transition-[border-color,background-color] duration-150 ${current
|
|
10
|
+
? "border-[color-mix(in_srgb,var(--color-accent)_32%,var(--color-line))] bg-[color-mix(in_srgb,var(--color-accent)_5%,var(--color-bg))]"
|
|
11
|
+
: "border-line bg-bg"}`, children: [_jsx("span", { className: `inline-grid h-6 w-6 place-items-center rounded-md border text-[11px] font-semibold ${current
|
|
12
|
+
? "border-[color-mix(in_srgb,var(--color-accent)_42%,var(--color-line))] bg-[color-mix(in_srgb,var(--color-accent)_10%,transparent)] text-accent"
|
|
13
|
+
: "border-line bg-panel text-text-3"}`, children: label }), _jsxs("span", { className: "min-w-0", children: [_jsx("strong", { className: "block text-[13px] font-semibold text-text", children: title }), _jsx("span", { className: "mt-1 block text-[12px] leading-[1.45] text-text-3", children: detail })] })] }));
|
|
14
|
+
}
|
|
15
|
+
export function LocalModelCookbookEmpty({ onRefreshLocalModels, }) {
|
|
16
|
+
return (_jsxs("div", { className: "px-4 py-4", children: [_jsxs("div", { className: "grid gap-3 md:grid-cols-[minmax(0,1fr)_auto] md:items-center", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("strong", { className: "block text-[13px] font-semibold text-text", children: "Inspect local model fit" }), _jsx("p", { className: "mt-1 max-w-[720px] text-[12px] leading-[1.5] text-text-2", children: "Refresh checks CPU, memory, GPU/VRAM, local runtimes, and endpoint compatibility before you save a local default." })] }), _jsxs("button", { type: "button", className: "inline-flex h-8 items-center gap-2 rounded-lg border border-line bg-transparent px-3 text-[12px] text-text-2 cursor-pointer hover:bg-panel-2 hover:text-text", onClick: onRefreshLocalModels, children: [_jsx(Icon, { name: "refresh", size: 13 }), " Inspect fit"] })] }), _jsxs("div", { className: "mt-4 grid gap-3 [grid-template-columns:repeat(auto-fit,minmax(190px,1fr))]", children: [_jsx(DiagnosticsStat, { label: "Hardware", value: "CPU / RAM / GPU", detail: "readiness snapshot" }), _jsx(DiagnosticsStat, { label: "Runtime", value: "Ollama / LM Studio", detail: "detected locally" }), _jsx(DiagnosticsStat, { label: "Route", value: "Endpoint probe", detail: "probe before save" })] })] }));
|
|
17
|
+
}
|
|
18
|
+
export function localModelFitLabel(fit) {
|
|
19
|
+
switch (fit) {
|
|
20
|
+
case "good":
|
|
21
|
+
return "good fit";
|
|
22
|
+
case "caution":
|
|
23
|
+
return "caution";
|
|
24
|
+
case "tooLarge":
|
|
25
|
+
return "too large";
|
|
26
|
+
default:
|
|
27
|
+
return "unknown";
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export function localGpuMemoryLabel(gpus) {
|
|
31
|
+
const maxMemory = Math.max(0, ...gpus.map((gpu) => gpu.memoryMb ?? 0));
|
|
32
|
+
return maxMemory > 0 ? `${maxMemory} MB max VRAM` : "VRAM unknown";
|
|
33
|
+
}
|
|
34
|
+
export function localModelVramLabel(model) {
|
|
35
|
+
const target = model.recommendedVramMb ?? model.minVramMb;
|
|
36
|
+
const detected = model.detectedVramMb;
|
|
37
|
+
if (target && detected) {
|
|
38
|
+
return `VRAM ${detected}/${target} MB`;
|
|
39
|
+
}
|
|
40
|
+
if (target) {
|
|
41
|
+
return `VRAM target ${target} MB`;
|
|
42
|
+
}
|
|
43
|
+
if (detected) {
|
|
44
|
+
return `VRAM detected ${detected} MB`;
|
|
45
|
+
}
|
|
46
|
+
return "VRAM manual check";
|
|
47
|
+
}
|
|
48
|
+
export function localModelSmokeCandidate(probe, catalog) {
|
|
49
|
+
return (probe?.models.find((model) => model.trim()) ??
|
|
50
|
+
catalog?.recommendations.find((model) => model.modelSlug.trim())?.modelSlug);
|
|
51
|
+
}
|
|
52
|
+
export function localModelFitClass(fit) {
|
|
53
|
+
switch (fit) {
|
|
54
|
+
case "good":
|
|
55
|
+
return "border-accent-2/40 text-accent-2";
|
|
56
|
+
case "caution":
|
|
57
|
+
return "border-accent/40 text-accent";
|
|
58
|
+
case "tooLarge":
|
|
59
|
+
return "border-danger/40 text-danger";
|
|
60
|
+
default:
|
|
61
|
+
return "border-line text-text-3";
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PersistentPermissionRuleRow } from "@rightkit/agent-ui-core/lib/types";
|
|
2
|
+
export default function PersistentPermissionRuleList({ title, rules, pendingId, onRemove, }: {
|
|
3
|
+
title: string;
|
|
4
|
+
rules: PersistentPermissionRuleRow[];
|
|
5
|
+
pendingId: string | null;
|
|
6
|
+
onRemove: (rule: PersistentPermissionRuleRow) => void;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { ConfirmDialog } from "@rightkit/react-shell/react";
|
|
4
|
+
import Icon from "@rightkit/agent-ui-core/components/Icon";
|
|
5
|
+
export default function PersistentPermissionRuleList({ title, rules, pendingId, onRemove, }) {
|
|
6
|
+
const [pendingRemove, setPendingRemove] = useState(null);
|
|
7
|
+
return (_jsxs("div", { className: "flex flex-col border border-line rounded-xl overflow-hidden min-w-0", children: [_jsx("div", { className: "px-4 py-2 border-b border-line bg-panel", children: _jsx("h5", { className: "text-[12px] font-semibold text-text", children: title }) }), rules.length > 0 ? (_jsx("div", { className: "flex flex-col divide-y divide-line", children: rules.map((rule) => {
|
|
8
|
+
const key = `${rule.scope}:${rule.workspaceRoot ?? ""}:${rule.index}`;
|
|
9
|
+
return (_jsxs("article", { className: "grid grid-cols-[36px_minmax(0,1fr)_70px_auto] items-center gap-3 px-4 py-3", children: [_jsxs("code", { className: "text-[11px] font-mono text-text-3", children: ["#", rule.index] }), _jsxs("div", { className: "flex flex-col gap-0.5 min-w-0", children: [_jsx("strong", { className: "text-[13px] font-semibold text-text truncate", children: rule.pattern }), rule.workspaceRoot ? (_jsx("span", { className: "text-[11px] text-text-3 truncate", children: rule.workspaceRoot })) : null] }), _jsx("code", { className: "text-[11px] font-mono text-accent-2", children: rule.effect }), _jsx("button", { type: "button", className: "inline-flex items-center justify-center h-8 w-8 rounded-lg border border-line bg-transparent text-text-2 cursor-pointer hover:bg-panel hover:text-danger disabled:opacity-40", disabled: pendingId === key, onClick: () => setPendingRemove(rule), title: "Remove durable rule", children: _jsx(Icon, { name: "trash", size: 14 }) })] }, key));
|
|
10
|
+
}) })) : (_jsxs("div", { className: "px-4 py-3 text-[12px] text-text-3", children: ["No inherited ", title.toLowerCase(), " rules."] })), pendingRemove !== null ? (_jsx(ConfirmDialog, { title: "Remove durable rule?", description: `Remove rule "${pendingRemove?.pattern ?? ""}" (${pendingRemove?.effect ?? ""})? Future matching actions fall back to standard prompts.`, confirmLabel: "Remove", danger: true, onCancel: () => setPendingRemove(null), onConfirm: () => {
|
|
11
|
+
if (pendingRemove)
|
|
12
|
+
onRemove(pendingRemove);
|
|
13
|
+
setPendingRemove(null);
|
|
14
|
+
} })) : null] }));
|
|
15
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { PluginManifest } from "@rightkit/agent-ui-core/lib/types";
|
|
2
|
+
export default function InstalledPluginsList({ plugins, pendingId, onToggle, }: {
|
|
3
|
+
plugins: PluginManifest[];
|
|
4
|
+
pendingId: string | null;
|
|
5
|
+
onToggle: (plugin: PluginManifest) => void;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { EmptyState } from "@rightkit/react-shell/react";
|
|
3
|
+
import Icon from "@rightkit/agent-ui-core/components/Icon";
|
|
4
|
+
export default function InstalledPluginsList({ plugins, pendingId, onToggle, }) {
|
|
5
|
+
if (!plugins.length) {
|
|
6
|
+
return (_jsx(EmptyState, { icon: _jsx(Icon, { name: "attachment", size: 18 }), title: "No plugins discovered.", children: "Reload after adding a plugin manifest under the configured plugin directory." }));
|
|
7
|
+
}
|
|
8
|
+
return (_jsx("div", { className: "flex flex-col divide-y divide-line border border-line rounded-xl overflow-hidden", children: plugins.map((plugin) => {
|
|
9
|
+
const contributionCount = plugin.providesTools.length + plugin.providesCommands.length;
|
|
10
|
+
const describedTools = plugin.providesTools.filter((name) => plugin.tools?.[name]?.description).length;
|
|
11
|
+
const readOnlyTools = plugin.providesTools.filter((name) => plugin.tools?.[name]?.readOnly).length;
|
|
12
|
+
const describedCommands = plugin.providesCommands.filter((name) => plugin.commands?.[name]?.description || plugin.commands?.[name]?.usage).length;
|
|
13
|
+
const promptCount = plugin.prompts?.filter((p) => p.body?.trim()).length ?? 0;
|
|
14
|
+
const isolation = plugin.sandbox?.isolation ?? "restrictedSubprocess";
|
|
15
|
+
const restricted = isolation === "restrictedSubprocess";
|
|
16
|
+
const metadataOnly = isolation === "metadataOnly";
|
|
17
|
+
const sandboxLabel = metadataOnly
|
|
18
|
+
? "metadata only"
|
|
19
|
+
: restricted
|
|
20
|
+
? "restricted subprocess"
|
|
21
|
+
: plugin.sandbox?.allowAbsoluteEntry
|
|
22
|
+
? "loose entry"
|
|
23
|
+
: "contained entry";
|
|
24
|
+
const timeoutMs = restricted
|
|
25
|
+
? Math.min(plugin.sandbox?.timeoutMs ?? 30000, 15000)
|
|
26
|
+
: (plugin.sandbox?.timeoutMs ?? 30000);
|
|
27
|
+
const inheritsEnv = restricted ? false : (plugin.sandbox?.inheritEnv ?? true);
|
|
28
|
+
const allowedEnvCount = plugin.sandbox?.allowedEnv?.length ?? 0;
|
|
29
|
+
const deniedEnvCount = plugin.sandbox?.deniedEnv?.length ?? 0;
|
|
30
|
+
const envPolicy = inheritsEnv ? "inherits env" : "scrubbed env";
|
|
31
|
+
const networkPolicy = restricted || plugin.sandbox?.stripNetworkEnv
|
|
32
|
+
? "network env stripped"
|
|
33
|
+
: "network env inherited";
|
|
34
|
+
return (_jsxs("article", { className: "grid grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-4 px-4 py-3", children: [_jsxs("div", { className: "flex flex-col gap-1 min-w-0", children: [_jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [_jsx("strong", { className: "text-[13px] font-semibold text-text truncate", children: plugin.name || plugin.id }), _jsx("code", { className: "text-[11px] font-mono text-text-3 flex-shrink-0", children: plugin.version })] }), _jsx("span", { className: "text-[12px] text-text-3 truncate", children: plugin.description || plugin.entry }), _jsxs("span", { className: "text-[11px] text-text-3 truncate", children: [plugin.providesTools.join(", ") || "no tools", " /", " ", plugin.providesCommands.join(", ") || "no commands"] }), _jsxs("span", { className: "text-[11px] text-text-3 truncate", children: [metadataOnly ? "execution disabled" : "subprocess", " \u00B7 ", sandboxLabel, " \u00B7", " ", Math.round(timeoutMs / 1000), "s \u00B7 ", plugin.entry || "no entry"] }), _jsxs("span", { className: "text-[11px] text-text-3 truncate", children: ["sandbox env \u00B7 ", envPolicy, " \u00B7 allow ", allowedEnvCount, " \u00B7 deny ", deniedEnvCount, " \u00B7", " ", networkPolicy] }), describedTools || readOnlyTools || describedCommands ? (_jsxs("span", { className: "text-[11px] text-text-3 truncate", children: ["metadata \u00B7 ", describedTools, "/", plugin.providesTools.length, " tools described \u00B7", " ", readOnlyTools, " read-only \u00B7 ", describedCommands, "/", plugin.providesCommands.length, " ", "commands described"] })) : null, promptCount ? (_jsxs("span", { className: "text-[11px] text-text-3 truncate", children: ["prompts \u00B7 ", promptCount, " instruction contribution", promptCount !== 1 ? "s" : ""] })) : null] }), _jsxs("code", { className: "text-[11px] font-mono text-accent-2", children: [contributionCount, " item", contributionCount !== 1 ? "s" : ""] }), _jsxs("button", { type: "button", className: `inline-flex items-center gap-2 h-8 px-3 rounded-lg border text-[12px] cursor-pointer ${plugin.enabled
|
|
35
|
+
? "border-line bg-transparent text-text-2 hover:bg-panel hover:text-text disabled:opacity-40"
|
|
36
|
+
: "border-0 bg-accent text-on-accent font-semibold hover:opacity-90 disabled:border disabled:border-line disabled:bg-panel-2 disabled:text-text-3"}`, disabled: pendingId === plugin.id, onClick: () => onToggle(plugin), children: [_jsx(Icon, { name: plugin.enabled ? "pause" : "play" }), plugin.enabled ? "Disable" : "Enable"] })] }, `${plugin.id}:${plugin.version}`));
|
|
37
|
+
}) }));
|
|
38
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { OfflinePanel } from "../shared.js";
|
|
3
|
+
import { diagnosticsStatusClass } from "./RemoteStatusCard.js";
|
|
4
|
+
function RemoteGatewayChannelRow({ channel, }) {
|
|
5
|
+
const stateStatus = channel.status.state === "ready"
|
|
6
|
+
? "pass"
|
|
7
|
+
: channel.status.state === "notConfigured" || channel.status.state === "blocked"
|
|
8
|
+
? "block"
|
|
9
|
+
: "warn";
|
|
10
|
+
return (_jsxs("article", { className: "grid grid-cols-[minmax(0,1fr)_minmax(170px,0.45fr)] gap-3 px-4 py-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [_jsx("strong", { className: "truncate text-[13px] text-text", children: channel.id }), _jsx("span", { className: `shrink-0 rounded border px-2 py-0.5 text-[10px] ${diagnosticsStatusClass(stateStatus)}`, children: channel.status.state }), _jsx("span", { className: "shrink-0 rounded border border-line bg-panel-2 px-2 py-0.5 text-[10px] text-text-3", children: channel.kind })] }), _jsxs("div", { className: "mt-2 grid grid-cols-1 sm:grid-cols-3 gap-2 text-[11px] text-text-3", children: [_jsxs("span", { children: ["Profile ", channel.profile.profileId] }), _jsxs("span", { children: ["Toolset ", channel.profile.toolset] }), _jsxs("span", { children: ["Trust ", channel.profile.trust] }), _jsxs("span", { children: [channel.status.bindingCount, " bindings"] }), _jsxs("span", { children: [channel.status.activeTargetCount, " active targets"] }), _jsx("span", { children: channel.profile.deliveryPolicy })] }), channel.notes.length ? (_jsx("div", { className: "mt-2 flex flex-col gap-1", children: channel.notes.slice(0, 2).map((note) => (_jsx("p", { className: "text-[11px] leading-relaxed text-text-3", children: note }, note))) })) : null, channel.recentDeliveries.length ? (_jsx("div", { className: "mt-3 overflow-hidden rounded border border-line bg-panel-2", children: channel.recentDeliveries.slice(0, 3).map((delivery) => (_jsxs("div", { className: "grid grid-cols-[minmax(0,1fr)_auto] gap-2 border-b border-line px-2 py-1.5 text-[10px] text-text-3 last:border-b-0", children: [_jsxs("span", { className: "min-w-0 truncate", children: [delivery.deliveryKind, " / ", delivery.targetRedacted] }), _jsx("span", { className: "shrink-0 text-text-2", children: delivery.status })] }, delivery.id))) })) : null] }), _jsxs("div", { className: "min-w-0 text-right text-[11px] text-text-3", children: [_jsxs("span", { className: "block truncate", children: [channel.enabled ? "Enabled" : "Disabled", " /", " ", channel.configured ? "configured" : "not configured"] }), _jsxs("span", { className: "mt-1 block truncate", children: ["Last success ", channel.status.lastSuccessAt ?? "none"] }), _jsxs("span", { className: "mt-1 block truncate", children: ["Last error ", channel.status.lastErrorAt ?? "none"] }), channel.status.lastError ? (_jsx("span", { className: "mt-1 block truncate text-danger", children: channel.status.lastError })) : null] })] }));
|
|
11
|
+
}
|
|
12
|
+
export function RemoteChannelsPanel({ snapshot }) {
|
|
13
|
+
return (_jsxs("div", { className: "rounded-xl border border-line bg-panel overflow-hidden", children: [_jsxs("div", { className: "flex items-start justify-between gap-3 px-4 py-3 border-b border-line", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("h4", { className: "text-[13px] font-semibold text-text", children: "Remote gateway profiles" }), _jsx("p", { className: "text-[12px] text-text-3", children: "Generic channel profiles, delivery policy, trust labels, and redacted binding counts from the daemon gateway snapshot." })] }), _jsx("span", { className: "shrink-0 rounded-full border border-line bg-panel-2 px-2 py-0.5 text-[11px] font-semibold text-text-3", children: snapshot ? `${snapshot.channels.length} channels` : "not loaded" })] }), snapshot ? (_jsxs("div", { className: "grid grid-cols-1 xl:grid-cols-[minmax(220px,0.45fr)_minmax(0,1fr)] gap-4 p-4", children: [_jsx("div", { className: "flex flex-col gap-2", children: snapshot.profiles.length ? (snapshot.profiles.map((profile) => (_jsxs("div", { className: "rounded-lg border border-line bg-panel-2 p-3", children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("strong", { className: "text-[12px] text-text", children: profile.id }), _jsx("span", { className: "rounded border border-line bg-panel px-1.5 py-0.5 text-[10px] text-text-3", children: profile.deliveryPolicy })] }), _jsxs("div", { className: "mt-2 text-[11px] text-text-3", children: ["Toolset ", profile.toolset] }), _jsx("div", { className: "mt-2 flex flex-wrap gap-1", children: profile.channels.map((channel) => (_jsx("span", { className: "rounded border border-line bg-panel px-1.5 py-0.5 text-[10px] text-text-3", children: channel }, `${profile.id}:${channel}`))) })] }, profile.id)))) : (_jsx(OfflinePanel, { title: "No gateway profiles loaded.", action: "Refresh remote status to read channel profiles." })) }), _jsx("div", { className: "min-w-0 rounded-lg border border-line overflow-hidden", children: snapshot.channels.length ? (_jsx("div", { className: "divide-y divide-line", children: snapshot.channels.map((channel) => (_jsx(RemoteGatewayChannelRow, { channel: channel }, channel.id))) })) : (_jsx("div", { className: "px-4 py-3 text-[13px] text-text-3", children: "No remote channels are currently registered." })) })] })) : (_jsx(OfflinePanel, { title: "Remote gateway snapshot not loaded.", action: "Refresh remote status to inspect generic gateway profiles." }))] }));
|
|
14
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { diagnosticsLabel, diagnosticsStatusClass } from "../shared.js";
|
|
2
|
+
import type { DiagnosticsReport } from "@rightkit/agent-ui-core/lib/types";
|
|
3
|
+
export declare function RemoteStatusCard({ title, value, status, detail, }: {
|
|
4
|
+
title: string;
|
|
5
|
+
value: string;
|
|
6
|
+
status: DiagnosticsReport["verdict"];
|
|
7
|
+
detail: string;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export { diagnosticsLabel, diagnosticsStatusClass } from "../shared.js";
|
|
3
|
+
import { diagnosticsLabel, diagnosticsStatusClass } from "../shared.js";
|
|
4
|
+
export function RemoteStatusCard({ title, value, status, detail, }) {
|
|
5
|
+
return (_jsx("div", { className: "flex items-start justify-between gap-3 p-4 rounded-xl border border-line bg-panel", children: _jsxs("div", { className: "flex flex-col gap-1 min-w-0", children: [_jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [_jsx("strong", { className: "text-[13px] text-text truncate", children: title }), _jsx("span", { className: `px-2 py-0.5 rounded-full text-[11px] border ${diagnosticsStatusClass(status)}`, children: diagnosticsLabel(status) })] }), _jsx("span", { className: "text-[12px] text-text-2", children: value }), _jsx("span", { className: "text-[12px] text-text-3 break-all", children: detail })] }) }));
|
|
6
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { TelegramRemoteStatus, TelegramRemoteTest } from "@rightkit/agent-ui-core/lib/types";
|
|
2
|
+
export declare function TelegramStatusPanel({ telegramStatus, telegramTest, error, }: {
|
|
3
|
+
telegramStatus: TelegramRemoteStatus | null;
|
|
4
|
+
telegramTest: TelegramRemoteTest | null;
|
|
5
|
+
error: string | null;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { OfflinePanel } from "../shared.js";
|
|
3
|
+
import { RemoteStatusCard } from "./RemoteStatusCard.js";
|
|
4
|
+
function telegramStatusLabel(state) {
|
|
5
|
+
switch (state) {
|
|
6
|
+
case "long_poll_requested":
|
|
7
|
+
return "Configured";
|
|
8
|
+
case "configured_without_allowlist":
|
|
9
|
+
return "Missing allowlist";
|
|
10
|
+
case "not_configured":
|
|
11
|
+
return "Not configured";
|
|
12
|
+
default:
|
|
13
|
+
return state;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export function TelegramStatusPanel({ telegramStatus, telegramTest, error, }) {
|
|
17
|
+
const runtime = telegramStatus?.runtime;
|
|
18
|
+
const cursorRows = runtime?.chatCursors ?? [];
|
|
19
|
+
return (_jsxs(_Fragment, { children: [telegramStatus ? (_jsxs("div", { className: "grid grid-cols-1 xl:grid-cols-2 gap-3", children: [_jsx(RemoteStatusCard, { title: "Telegram bot", value: telegramStatusLabel(telegramStatus.state), status: telegramStatus.tokenConfigured
|
|
20
|
+
? telegramStatus.allowedUserCount > 0
|
|
21
|
+
? "pass"
|
|
22
|
+
: "warn"
|
|
23
|
+
: "block", detail: telegramStatus.tokenConfigured
|
|
24
|
+
? "Bot token is configured and redacted from this view."
|
|
25
|
+
: "No Telegram bot token is configured." }), _jsx(RemoteStatusCard, { title: "Allowed users", value: String(telegramStatus.allowedUserCount), status: telegramStatus.allowedUserCount > 0 ? "pass" : "warn", detail: "Only configured Telegram user ids can interact with the bot." }), _jsx(RemoteStatusCard, { title: "Long-poll task", value: telegramStatus.longPollRequested ? "Requested" : "Not requested", status: telegramStatus.longPollRequested ? "pass" : "warn", detail: runtime?.lastPollAt
|
|
26
|
+
? `Last poll ${runtime.lastPollAt}`
|
|
27
|
+
: "No poll heartbeat has been recorded for this daemon run." }), _jsx(RemoteStatusCard, { title: "Chat bindings", value: `${telegramStatus.bindingCount} bound`, status: telegramStatus.bindingStoreReadable ? "pass" : "warn", detail: telegramStatus.bindingStoreReadable
|
|
28
|
+
? telegramStatus.bindingStorePath
|
|
29
|
+
: telegramStatus.bindingStoreError || telegramStatus.bindingStorePath }), _jsx(RemoteStatusCard, { title: "Poll success", value: runtime?.lastSuccessAt ?? "No successful poll yet", status: runtime?.lastSuccessAt ? "pass" : telegramStatus.longPollRequested ? "warn" : "block", detail: runtime?.lastError
|
|
30
|
+
? `Last error ${runtime.lastErrorAt ?? "unknown time"}: ${runtime.lastError}`
|
|
31
|
+
: `Update offset ${runtime?.updateOffset ?? 0}` }), _jsx(RemoteStatusCard, { title: "Active chats", value: String(runtime?.activeChatCount ?? 0), status: (runtime?.activeChatCount ?? 0) > 0 ? "pass" : "warn", detail: (runtime?.activeChatCount ?? 0) > 0
|
|
32
|
+
? "An allowed Telegram chat has been observed in this daemon run."
|
|
33
|
+
: "No allowed Telegram chat has been observed yet." })] })) : !error ? (_jsx(OfflinePanel, { title: "No remote status loaded.", action: "Refresh to read Telegram setup state." })) : null, telegramTest ? (_jsxs("div", { className: "rounded-xl border border-line bg-panel overflow-hidden", children: [_jsxs("div", { className: "flex items-center justify-between gap-3 px-4 py-3 border-b border-line", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("h4", { className: "text-[13px] font-semibold text-text", children: "Telegram readiness" }), _jsx("p", { className: "text-[12px] text-text-3", children: "Secret-redacted checks from the daemon remote test endpoint." })] }), _jsx("span", { className: [
|
|
34
|
+
"shrink-0 rounded-full px-2 py-0.5 text-[11px] font-semibold uppercase tracking-wide",
|
|
35
|
+
telegramTest.verdict === "pass"
|
|
36
|
+
? "bg-accent-2/15 text-accent-2"
|
|
37
|
+
: telegramTest.verdict === "warn"
|
|
38
|
+
? "bg-accent/15 text-accent"
|
|
39
|
+
: "bg-danger/15 text-danger",
|
|
40
|
+
].join(" "), children: telegramTest.verdict })] }), _jsx("div", { className: "grid grid-cols-1 xl:grid-cols-2 gap-3 p-3", children: telegramTest.checks.map((check) => (_jsx(RemoteStatusCard, { title: check.label, value: check.status, status: check.status, detail: check.fix ? `${check.detail} - ${check.fix}` : check.detail }, check.id))) }), telegramTest.notes.length ? (_jsx("div", { className: "border-t border-line px-4 py-3 text-[12px] text-text-3 leading-relaxed", children: telegramTest.notes.map((note) => (_jsx("p", { children: note }, note))) })) : null] })) : null, cursorRows.length ? (_jsxs("div", { className: "rounded-xl border border-line bg-panel overflow-hidden", children: [_jsx("div", { className: "flex items-center justify-between gap-3 px-4 py-3 border-b border-line", children: _jsxs("div", { className: "min-w-0", children: [_jsx("h4", { className: "text-[13px] font-semibold text-text", children: "Chat cursors" }), _jsx("p", { className: "text-[12px] text-text-3", children: "Redacted remote sessions and last event sequence pushed to Telegram." })] }) }), _jsx("div", { className: "divide-y divide-line", children: cursorRows.map((row) => (_jsxs("div", { className: "grid grid-cols-[110px_1fr_120px] gap-3 px-4 py-3 text-[12px]", children: [_jsx("span", { className: "text-text-2", children: row.chat }), _jsx("span", { className: "text-text truncate", children: row.sessionId }), _jsxs("span", { className: "text-text-3 text-right", children: ["seq ", row.lastPushedSeq] })] }, `${row.chat}-${row.sessionId}`))) })] })) : null, telegramStatus?.notes.length ? (_jsx("div", { className: "rounded-xl border border-line bg-panel p-4 text-[12px] text-text-3 leading-relaxed", children: telegramStatus.notes.map((note) => (_jsx("p", { children: note }, note))) })) : null] }));
|
|
41
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { DiagnosticsReport } from "@rightkit/agent-ui-core/lib/types";
|
|
2
|
+
export declare function diagnosticsLabel(status: DiagnosticsReport["verdict"]): "Block" | "Pass" | "Warn";
|
|
3
|
+
export declare function diagnosticsStatusClass(status: DiagnosticsReport["verdict"]): "border-accent-2/40 text-accent-2" | "border-danger/40 text-danger" | "border-warning/40 text-warning";
|
|
4
|
+
export declare function diagnosticsCardStatusClass(status: DiagnosticsReport["verdict"]): "border-accent-2/40 bg-accent-2/10" | "border-danger/40 bg-danger/10" | "border-warning/40 bg-warning/10";
|
|
5
|
+
export declare function OfflinePanel({ title, action }: {
|
|
6
|
+
title: string;
|
|
7
|
+
action: string;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
9
|
+
export declare function NumberField({ label, value, onChange, }: {
|
|
10
|
+
label: string;
|
|
11
|
+
value: number;
|
|
12
|
+
onChange: (value: number) => void;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
14
|
+
export declare function DiagnosticsStat({ label, value, detail, }: {
|
|
15
|
+
label: string;
|
|
16
|
+
value: string;
|
|
17
|
+
detail?: string;
|
|
18
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Icon from "@rightkit/agent-ui-core/components/Icon";
|
|
3
|
+
export function diagnosticsLabel(status) {
|
|
4
|
+
if (status === "pass")
|
|
5
|
+
return "Pass";
|
|
6
|
+
if (status === "warn")
|
|
7
|
+
return "Warn";
|
|
8
|
+
return "Block";
|
|
9
|
+
}
|
|
10
|
+
// Single source of truth for status→color: warn is always amber (--color-warning),
|
|
11
|
+
// never the command-accent red or the success green. Every status pill/card in
|
|
12
|
+
// Settings (Diagnostics checks, Execution backend cards, MCP server-mode cards)
|
|
13
|
+
// must read its tone from here so "warn" can't drift back to red in one spot.
|
|
14
|
+
export function diagnosticsStatusClass(status) {
|
|
15
|
+
if (status === "pass")
|
|
16
|
+
return "border-accent-2/40 text-accent-2";
|
|
17
|
+
if (status === "warn")
|
|
18
|
+
return "border-warning/40 text-warning";
|
|
19
|
+
return "border-danger/40 text-danger";
|
|
20
|
+
}
|
|
21
|
+
export function diagnosticsCardStatusClass(status) {
|
|
22
|
+
if (status === "pass")
|
|
23
|
+
return "border-accent-2/40 bg-accent-2/10";
|
|
24
|
+
if (status === "warn")
|
|
25
|
+
return "border-warning/40 bg-warning/10";
|
|
26
|
+
return "border-danger/40 bg-danger/10";
|
|
27
|
+
}
|
|
28
|
+
export function OfflinePanel({ title, action }) {
|
|
29
|
+
return (_jsxs("div", { className: "flex items-start gap-3 p-4 rounded-xl border border-line bg-panel text-text-3", children: [_jsx(Icon, { name: "activity" }), _jsxs("div", { className: "flex flex-col gap-0.5", children: [_jsx("strong", { className: "text-[13px] font-semibold text-text-2", children: title }), _jsx("span", { className: "text-[12px]", children: action })] })] }));
|
|
30
|
+
}
|
|
31
|
+
export function NumberField({ label, value, onChange, }) {
|
|
32
|
+
return (_jsxs("label", { className: "flex flex-col gap-1 text-[13px] text-text-2", children: [label, _jsx("input", { className: "h-9 px-3 rounded-lg border border-line bg-panel text-text text-[13px] outline-none", type: "number", step: "0.01", value: Number.isFinite(value) ? value : 0, onChange: (e) => onChange(Number(e.target.value)) })] }));
|
|
33
|
+
}
|
|
34
|
+
export function DiagnosticsStat({ label, value, detail, }) {
|
|
35
|
+
return (_jsxs("div", { className: "rounded-lg border border-line bg-panel-2 px-3 py-2 min-w-0", children: [_jsx("div", { className: "text-[11px] uppercase text-text-3", children: label }), _jsx("div", { className: "text-[13px] text-text truncate", title: value, children: value }), detail ? (_jsx("div", { className: "text-[11px] text-text-3 truncate", title: detail, children: detail })) : null] }));
|
|
36
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type IconName } from "@rightkit/agent-ui-core/components/Icon";
|
|
2
|
+
import type { SkillOptimizationStatus } from "@rightkit/agent-ui-core/lib/types";
|
|
3
|
+
export declare function SkillProposalStat({ label, value }: {
|
|
4
|
+
label: string;
|
|
5
|
+
value: number;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
7
|
+
export declare function SkillProposalMeta({ label, value }: {
|
|
8
|
+
label: string;
|
|
9
|
+
value: string;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
11
|
+
export declare function SkillBodyPreview({ title, body }: {
|
|
12
|
+
title: string;
|
|
13
|
+
body: string;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
15
|
+
export declare function skillTrainingStatusClass(status: SkillOptimizationStatus): "text-accent-2" | "text-danger" | "text-text-3";
|
|
16
|
+
export declare function skillProvenanceSeverityClass(severity: "info" | "warning" | "error"): "text-accent-2" | "text-danger" | "text-warning";
|
|
17
|
+
export declare function SkillIcon({ name, size }: {
|
|
18
|
+
name: IconName;
|
|
19
|
+
size?: number;
|
|
20
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Icon from "@rightkit/agent-ui-core/components/Icon";
|
|
3
|
+
export function SkillProposalStat({ label, value }) {
|
|
4
|
+
return (_jsxs("div", { className: "rounded-lg border border-line bg-bg p-2", children: [_jsx("span", { className: "block text-[10px] uppercase text-text-3", children: label }), _jsx("strong", { className: "mt-1 block text-[16px] text-text", children: value })] }));
|
|
5
|
+
}
|
|
6
|
+
export function SkillProposalMeta({ label, value }) {
|
|
7
|
+
return (_jsxs("div", { className: "min-w-0 rounded-lg border border-line bg-panel p-3", children: [_jsx("span", { className: "block text-[10px] uppercase text-text-3", children: label }), _jsx("strong", { className: "mt-1 block truncate text-[12px] text-text", children: value })] }));
|
|
8
|
+
}
|
|
9
|
+
export function SkillBodyPreview({ title, body }) {
|
|
10
|
+
return (_jsxs("div", { className: "flex min-w-0 flex-col overflow-hidden", children: [_jsx("div", { className: "border-b border-line bg-panel px-3 py-2 text-[11px] font-semibold text-text-2", children: title }), _jsx("pre", { className: "min-h-0 flex-1 overflow-auto whitespace-pre-wrap break-words p-3 text-[11px] leading-5 text-text-2", children: body })] }));
|
|
11
|
+
}
|
|
12
|
+
export function skillTrainingStatusClass(status) {
|
|
13
|
+
if (status === "accepted" || status === "running")
|
|
14
|
+
return "text-accent-2";
|
|
15
|
+
if (status === "rejected" || status === "cancelled")
|
|
16
|
+
return "text-danger";
|
|
17
|
+
return "text-text-3";
|
|
18
|
+
}
|
|
19
|
+
export function skillProvenanceSeverityClass(severity) {
|
|
20
|
+
if (severity === "error")
|
|
21
|
+
return "text-danger";
|
|
22
|
+
if (severity === "warning")
|
|
23
|
+
return "text-warning";
|
|
24
|
+
return "text-accent-2";
|
|
25
|
+
}
|
|
26
|
+
export function SkillIcon({ name, size }) {
|
|
27
|
+
return _jsx(Icon, { name: name, size: size });
|
|
28
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SkillOptimizationRun } from "@rightkit/agent-ui-core/lib/types";
|
|
2
|
+
export default function SkillTrainingRunList({ runs, selectedRun, onSelectRun, }: {
|
|
3
|
+
runs: SkillOptimizationRun[];
|
|
4
|
+
selectedRun: SkillOptimizationRun | null;
|
|
5
|
+
onSelectRun: (id: string) => void;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { OfflinePanel } from "../shared.js";
|
|
3
|
+
import { skillTrainingStatusClass } from "./SkillShared.js";
|
|
4
|
+
export default function SkillTrainingRunList({ runs, selectedRun, onSelectRun, }) {
|
|
5
|
+
return (_jsxs("div", { className: "flex min-h-0 flex-col overflow-hidden rounded-xl border border-line", children: [_jsxs("div", { className: "grid grid-cols-3 gap-2 border-b border-line bg-panel p-3", children: [_jsx(SkillTrainingStat, { label: "Runs", value: runs.length }), _jsx(SkillTrainingStat, { label: "Accepted", value: runs.reduce((total, run) => total + run.candidates.filter((c) => c.accepted).length, 0) }), _jsx(SkillTrainingStat, { label: "Rejected", value: runs.reduce((total, run) => total + run.candidates.filter((c) => !c.accepted).length, 0) })] }), _jsx("div", { className: "flex min-h-0 flex-col divide-y divide-line overflow-auto", children: runs.length ? (runs.map((run) => (_jsxs("button", { type: "button", className: `grid grid-cols-[minmax(0,1fr)_auto] gap-3 border-0 px-4 py-3 text-left cursor-pointer ${selectedRun?.id === run.id
|
|
6
|
+
? "bg-panel-2 text-text"
|
|
7
|
+
: "bg-transparent text-text-2 hover:bg-panel hover:text-text"}`, onClick: () => onSelectRun(run.id), children: [_jsxs("span", { className: "min-w-0", children: [_jsx("strong", { className: "block truncate text-[13px] font-semibold", children: run.name }), _jsxs("span", { className: "block truncate text-[12px] text-text-3", children: [run.target.skillId, " \u00B7 ", run.target.objective] }), _jsx("span", { className: "block truncate text-[11px] font-mono text-text-3", children: run.bestVersionHash ?? "no best hash" })] }), _jsxs("span", { className: "flex flex-col items-end gap-1", children: [_jsx("code", { className: `text-[10px] ${skillTrainingStatusClass(run.status)}`, children: run.status }), _jsxs("code", { className: "text-[10px] text-text-3", children: ["epoch ", run.currentEpoch, " \u00B7 ", run.candidates.length, " edits"] })] })] }, run.id)))) : (_jsx(OfflinePanel, { title: "No training runs.", action: "Create one below to start validation-gated skill optimization." })) })] }));
|
|
8
|
+
}
|
|
9
|
+
function SkillTrainingStat({ label, value }) {
|
|
10
|
+
return (_jsxs("div", { className: "rounded-lg border border-line bg-bg p-2", children: [_jsx("span", { className: "block text-[10px] uppercase text-text-3", children: label }), _jsx("strong", { className: "mt-1 block text-[16px] text-text", children: value })] }));
|
|
11
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ManagedToolProbe } from "@rightkit/agent-ui-core/lib/tools/managedToolHealth";
|
|
2
|
+
export interface ManagedToolHealthPanelProps {
|
|
3
|
+
toolId: string;
|
|
4
|
+
label?: string;
|
|
5
|
+
probe: ManagedToolProbe;
|
|
6
|
+
onSelectInstallation?: () => void;
|
|
7
|
+
onRemediate?: () => void;
|
|
8
|
+
installUrl?: string;
|
|
9
|
+
enabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Opcode's Topbar version-status projection, adapted for a generic the host app
|
|
13
|
+
* managed tool. Discovery/install effects stay in the injected Tauri connector.
|
|
14
|
+
*/
|
|
15
|
+
export declare function ManagedToolHealthPanel({ toolId, label, probe, onSelectInstallation, onRemediate, installUrl, enabled, }: ManagedToolHealthPanelProps): import("react").JSX.Element;
|
|
16
|
+
export default ManagedToolHealthPanel;
|