@agent-native/dispatch 0.40.0 → 0.40.3
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 +48 -19
- package/dist/actions/provider-api-register.d.ts +7 -7
- package/dist/components/app-open-actions.d.ts +1 -1
- package/dist/components/app-open-actions.d.ts.map +1 -1
- package/dist/components/app-open-actions.js +1 -1
- package/dist/components/app-open-actions.js.map +1 -1
- package/dist/components/app-row-settings.js +1 -1
- package/dist/components/app-row-settings.js.map +1 -1
- package/dist/components/automation-create-dialog.js +2 -2
- package/dist/components/automation-create-dialog.js.map +1 -1
- package/dist/components/automation-details-panel.js +1 -1
- package/dist/components/automation-details-panel.js.map +1 -1
- package/dist/components/chat-home-apps.js +1 -1
- package/dist/components/chat-home-apps.js.map +1 -1
- package/dist/components/create-app-popover.js +3 -3
- package/dist/components/create-app-popover.js.map +1 -1
- package/dist/components/dispatch-control-plane.d.ts.map +1 -1
- package/dist/components/dispatch-control-plane.js +9 -30
- package/dist/components/dispatch-control-plane.js.map +1 -1
- package/dist/components/layout/Header.js +2 -2
- package/dist/components/layout/Header.js.map +1 -1
- package/dist/components/layout/Layout.d.ts +6 -5
- package/dist/components/layout/Layout.d.ts.map +1 -1
- package/dist/components/layout/Layout.js +73 -113
- package/dist/components/layout/Layout.js.map +1 -1
- package/dist/components/layout/workspace-apps-rail.d.ts.map +1 -1
- package/dist/components/layout/workspace-apps-rail.js +7 -19
- package/dist/components/layout/workspace-apps-rail.js.map +1 -1
- package/dist/components/messaging-setup-panel.js +2 -1
- package/dist/components/messaging-setup-panel.js.map +1 -1
- package/dist/components/workspace-app-card.js +2 -2
- package/dist/components/workspace-app-card.js.map +1 -1
- package/dist/components/workspace-app-host.d.ts +1 -1
- package/dist/components/workspace-app-host.d.ts.map +1 -1
- package/dist/components/workspace-app-host.js +7 -74
- package/dist/components/workspace-app-host.js.map +1 -1
- package/dist/hooks/use-navigation-state.js +1 -1
- package/dist/hooks/use-navigation-state.js.map +1 -1
- package/dist/lib/workspace-apps.js +1 -1
- package/dist/lib/workspace-apps.js.map +1 -1
- package/dist/routes/pages/$appId.js +1 -1
- package/dist/routes/pages/$appId.js.map +1 -1
- package/dist/routes/pages/_index.js +1 -1
- package/dist/routes/pages/_index.js.map +1 -1
- package/dist/routes/pages/admin._index.js +1 -1
- package/dist/routes/pages/admin._index.js.map +1 -1
- package/dist/routes/pages/agent-integrations.js +1 -1
- package/dist/routes/pages/agent-integrations.js.map +1 -1
- package/dist/routes/pages/apps.d.ts.map +1 -1
- package/dist/routes/pages/apps.js +3 -43
- package/dist/routes/pages/apps.js.map +1 -1
- package/dist/routes/pages/browser-chat.js +1 -1
- package/dist/routes/pages/browser-chat.js.map +1 -1
- package/dist/routes/pages/chat.d.ts.map +1 -1
- package/dist/routes/pages/chat.js +24 -43
- package/dist/routes/pages/chat.js.map +1 -1
- package/dist/routes/pages/extensions.$id.js +1 -1
- package/dist/routes/pages/extensions.$id.js.map +1 -1
- package/dist/routes/pages/extensions._index.js +1 -1
- package/dist/routes/pages/extensions._index.js.map +1 -1
- package/dist/routes/pages/integrations.js +1 -1
- package/dist/routes/pages/integrations.js.map +1 -1
- package/dist/routes/pages/new-app.js +1 -1
- package/dist/routes/pages/new-app.js.map +1 -1
- package/dist/routes/pages/operations.js +2 -2
- package/dist/routes/pages/operations.js.map +1 -1
- package/dist/routes/pages/overview.d.ts +2 -2
- package/dist/routes/pages/settings-page.d.ts +10 -0
- package/dist/routes/pages/settings-page.d.ts.map +1 -0
- package/dist/routes/pages/settings-page.js +104 -0
- package/dist/routes/pages/settings-page.js.map +1 -0
- package/dist/routes/pages/settings.d.ts +4 -12
- package/dist/routes/pages/settings.d.ts.map +1 -1
- package/dist/routes/pages/settings.js +4 -88
- package/dist/routes/pages/settings.js.map +1 -1
- package/dist/routes/pages/tools.$id.js +1 -1
- package/dist/routes/pages/tools.$id.js.map +1 -1
- package/dist/routes/pages/tools._index.js +1 -1
- package/dist/routes/pages/tools._index.js.map +1 -1
- package/dist/routes/pages/vault.d.ts +1 -1
- package/dist/routes/pages/vault.js +1 -1
- package/dist/routes/pages/vault.js.map +1 -1
- package/dist/shared/app-roles.js.map +1 -1
- package/package.json +3 -3
- package/src/components/app-open-actions.tsx +1 -1
- package/src/components/app-row-settings.tsx +1 -1
- package/src/components/automation-create-dialog.tsx +7 -7
- package/src/components/automation-details-panel.tsx +1 -1
- package/src/components/chat-home-apps.tsx +1 -1
- package/src/components/create-app-popover.spec.tsx +5 -7
- package/src/components/create-app-popover.tsx +3 -3
- package/src/components/dispatch-control-plane.spec.tsx +12 -19
- package/src/components/dispatch-control-plane.tsx +10 -84
- package/src/components/layout/Header.tsx +2 -2
- package/src/components/layout/Layout.app-chat.spec.ts +1 -0
- package/src/components/layout/Layout.spec.tsx +49 -30
- package/src/components/layout/Layout.tsx +153 -205
- package/src/components/layout/workspace-apps-rail.spec.tsx +79 -0
- package/src/components/layout/workspace-apps-rail.tsx +6 -30
- package/src/components/messaging-setup-panel.tsx +1 -1
- package/src/components/workspace-app-card.tsx +2 -2
- package/src/components/workspace-app-chat-rail.spec.tsx +2 -2
- package/src/components/workspace-app-host.spec.tsx +19 -19
- package/src/components/workspace-app-host.tsx +12 -129
- package/src/hooks/use-navigation-state.ts +1 -1
- package/src/lib/workspace-apps.ts +1 -1
- package/src/routes/pages/$appId.tsx +1 -1
- package/src/routes/pages/_index.tsx +1 -1
- package/src/routes/pages/admin._index.tsx +1 -1
- package/src/routes/pages/agent-integrations.tsx +1 -1
- package/src/routes/pages/apps.tsx +2 -86
- package/src/routes/pages/automations.spec.tsx +1 -1
- package/src/routes/pages/browser-chat.spec.tsx +1 -1
- package/src/routes/pages/browser-chat.tsx +1 -1
- package/src/routes/pages/chat.spec.tsx +23 -46
- package/src/routes/pages/chat.tsx +20 -57
- package/src/routes/pages/extensions.$id.tsx +1 -1
- package/src/routes/pages/extensions._index.tsx +1 -1
- package/src/routes/pages/integrations.tsx +1 -1
- package/src/routes/pages/new-app.tsx +1 -1
- package/src/routes/pages/operations.tsx +2 -2
- package/src/routes/pages/settings-page.tsx +250 -0
- package/src/routes/pages/settings.spec.tsx +30 -8
- package/src/routes/pages/settings.tsx +4 -184
- package/src/routes/pages/tools.$id.tsx +1 -1
- package/src/routes/pages/tools._index.tsx +1 -1
- package/src/routes/pages/vault.tsx +1 -1
- package/src/shared/app-roles.ts +1 -1
|
@@ -1,189 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CHAT_FIRST_MODE_CHANGED_EVENT,
|
|
3
|
-
readChatFirstModeState,
|
|
4
|
-
writeChatFirstMode,
|
|
5
|
-
} from "@agent-native/core/client/agent-chat";
|
|
6
|
-
import { useFeatureFlag } from "@agent-native/core/client/feature-flags";
|
|
7
|
-
import { useT } from "@agent-native/core/client/i18n";
|
|
8
|
-
import { OrgMembersPage, TeamPage } from "@agent-native/core/client/org";
|
|
9
|
-
import {
|
|
10
|
-
CORE_SETTINGS_PAGES,
|
|
11
|
-
registerSettingsPages,
|
|
12
|
-
SettingsGroup,
|
|
13
|
-
SettingsRow,
|
|
14
|
-
SettingsTabsPage,
|
|
15
|
-
useAgentSettingsTabs,
|
|
16
|
-
type SettingsSearchEntry,
|
|
17
|
-
} from "@agent-native/core/client/settings";
|
|
18
|
-
import { IconShield } from "@tabler/icons-react";
|
|
19
|
-
import { useMemo, useState } from "react";
|
|
20
|
-
import { Link } from "react-router";
|
|
21
|
-
|
|
22
1
|
import packageChangelog from "../../../CHANGELOG.md?raw";
|
|
23
|
-
import {
|
|
24
|
-
import { Switch } from "../../components/ui/switch";
|
|
25
|
-
import { dispatchAccessDescriptor } from "../../shared/app-roles.js";
|
|
26
|
-
import { DISPATCH_CONNECT_APPS_FLAG } from "../../shared/feature-flags.js";
|
|
27
|
-
|
|
28
|
-
const coreMembersPage = CORE_SETTINGS_PAGES.find(
|
|
29
|
-
(page) => page.id === "members",
|
|
30
|
-
);
|
|
31
|
-
if (!coreMembersPage) {
|
|
32
|
-
throw new Error("Core Settings has no members page for Dispatch app roles");
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function DispatchMembersSettingsPage() {
|
|
36
|
-
return <OrgMembersPage appRoles={dispatchAccessDescriptor} />;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// Settings shows Members from core; Dispatch's replaces it so the app-role
|
|
40
|
-
// column stays.
|
|
41
|
-
registerSettingsPages([
|
|
42
|
-
{ ...coreMembersPage, component: DispatchMembersSettingsPage },
|
|
43
|
-
]);
|
|
44
|
-
|
|
45
|
-
export function meta() {
|
|
46
|
-
return [{ title: "Settings - Dispatch" }];
|
|
47
|
-
}
|
|
2
|
+
import { DispatchSettingsPage } from "./settings-page.js";
|
|
48
3
|
|
|
49
|
-
export
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Dispatch's Settings. The template route renders it with the app's own
|
|
56
|
-
* changelog; `dispatchRoutes` consumers get the default export.
|
|
57
|
-
*/
|
|
58
|
-
export function DispatchSettingsPage({ changelog }: DispatchSettingsPageProps) {
|
|
59
|
-
const t = useT();
|
|
60
|
-
const connectAppsEnabled = useFeatureFlag(DISPATCH_CONNECT_APPS_FLAG.key);
|
|
61
|
-
const agentSettingsTabs = useAgentSettingsTabs({
|
|
62
|
-
usageAppId: "dispatch",
|
|
63
|
-
usageViewAllHref: "/admin/metrics",
|
|
64
|
-
organizationContent: (
|
|
65
|
-
<div className="mx-auto w-full max-w-3xl">
|
|
66
|
-
<TeamPage
|
|
67
|
-
showTitle={false}
|
|
68
|
-
appRoles={dispatchAccessDescriptor}
|
|
69
|
-
createOrgDescription="Set up a team to share dispatch destinations and approvals with your colleagues."
|
|
70
|
-
/>
|
|
71
|
-
</div>
|
|
72
|
-
),
|
|
73
|
-
});
|
|
74
|
-
const settingsTabs = [
|
|
75
|
-
...agentSettingsTabs,
|
|
76
|
-
{
|
|
77
|
-
id: "admin",
|
|
78
|
-
label: t("dispatch.nav.admin", { defaultValue: "Admin" }),
|
|
79
|
-
icon: IconShield,
|
|
80
|
-
group: "Admin",
|
|
81
|
-
href: "/admin",
|
|
82
|
-
content: null,
|
|
83
|
-
},
|
|
84
|
-
];
|
|
85
|
-
const [chatFirstModeState] = useState(() => readChatFirstModeState());
|
|
86
|
-
const [chatFirstMode, setChatFirstMode] = useState(
|
|
87
|
-
() => chatFirstModeState.enabled,
|
|
88
|
-
);
|
|
89
|
-
const [chatFirstStorageNotice, setChatFirstStorageNotice] = useState<
|
|
90
|
-
string | null
|
|
91
|
-
>(
|
|
92
|
-
chatFirstModeState.availability === "unavailable"
|
|
93
|
-
? t("settings.chatFirstStorageUnavailable")
|
|
94
|
-
: null,
|
|
95
|
-
);
|
|
96
|
-
|
|
97
|
-
function updateChatFirstMode(enabled: boolean) {
|
|
98
|
-
const result = writeChatFirstMode(enabled);
|
|
99
|
-
if (!result.ok) {
|
|
100
|
-
setChatFirstStorageNotice(t("settings.chatFirstStorageBlocked"));
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
setChatFirstStorageNotice(null);
|
|
104
|
-
setChatFirstMode(enabled);
|
|
105
|
-
window.dispatchEvent(
|
|
106
|
-
new CustomEvent(CHAT_FIRST_MODE_CHANGED_EVENT, {
|
|
107
|
-
detail: { enabled },
|
|
108
|
-
}),
|
|
109
|
-
);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
const generalSearchEntries = useMemo<SettingsSearchEntry[]>(
|
|
113
|
-
() => [
|
|
114
|
-
{
|
|
115
|
-
id: "dispatch-workspace",
|
|
116
|
-
label: t("settings.resourcesTitle"),
|
|
117
|
-
keywords: "workspace resources integrations vault destinations",
|
|
118
|
-
hash: "workspace-resources",
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
id: "dispatch-chat-first",
|
|
122
|
-
label: t("settings.chatFirstTitle"),
|
|
123
|
-
keywords: "chat first codex t3 apps pane navigation",
|
|
124
|
-
hash: "chat-first",
|
|
125
|
-
},
|
|
126
|
-
],
|
|
127
|
-
[t],
|
|
128
|
-
);
|
|
129
|
-
|
|
130
|
-
const chatFirstSwitch = (
|
|
131
|
-
<Switch
|
|
132
|
-
aria-label={t("settings.chatFirstAriaLabel")}
|
|
133
|
-
checked={chatFirstMode}
|
|
134
|
-
onCheckedChange={updateChatFirstMode}
|
|
135
|
-
/>
|
|
136
|
-
);
|
|
137
|
-
const chatFirstStorageAlert = chatFirstStorageNotice ? (
|
|
138
|
-
<p className="text-sm text-destructive" role="alert">
|
|
139
|
-
{chatFirstStorageNotice}
|
|
140
|
-
</p>
|
|
141
|
-
) : null;
|
|
142
|
-
const connectAppsRow = connectAppsEnabled ? (
|
|
143
|
-
<SettingsRow
|
|
144
|
-
id="connect-apps"
|
|
145
|
-
label={t("settings.connectApps")}
|
|
146
|
-
description={t("settings.connectAppsDescription")}
|
|
147
|
-
control={
|
|
148
|
-
<Button variant="outline" asChild>
|
|
149
|
-
<Link to="/connect">{t("settings.openConnectApps")}</Link>
|
|
150
|
-
</Button>
|
|
151
|
-
}
|
|
152
|
-
/>
|
|
153
|
-
) : null;
|
|
154
|
-
const resourceSettingsButton = (
|
|
155
|
-
<Button variant="outline" asChild>
|
|
156
|
-
<Link to="/workspace">{t("settings.openResourceSettings")}</Link>
|
|
157
|
-
</Button>
|
|
158
|
-
);
|
|
159
|
-
|
|
160
|
-
return (
|
|
161
|
-
<SettingsTabsPage
|
|
162
|
-
extraTabs={settingsTabs}
|
|
163
|
-
generalSearchEntries={generalSearchEntries}
|
|
164
|
-
generalGroups={
|
|
165
|
-
<SettingsGroup id="workspace" title={t("settings.workspaceTitle")}>
|
|
166
|
-
<SettingsRow
|
|
167
|
-
id="chat-first"
|
|
168
|
-
label={t("settings.chatFirstTitle")}
|
|
169
|
-
description={t("settings.chatFirstDescription")}
|
|
170
|
-
control={chatFirstSwitch}
|
|
171
|
-
>
|
|
172
|
-
{chatFirstStorageAlert}
|
|
173
|
-
</SettingsRow>
|
|
174
|
-
<SettingsRow
|
|
175
|
-
id="workspace-resources"
|
|
176
|
-
label={t("settings.resourcesTitle")}
|
|
177
|
-
description={t("settings.workspaceDescription")}
|
|
178
|
-
control={resourceSettingsButton}
|
|
179
|
-
/>
|
|
180
|
-
{connectAppsRow}
|
|
181
|
-
</SettingsGroup>
|
|
182
|
-
}
|
|
183
|
-
whatsNewMarkdown={changelog}
|
|
184
|
-
/>
|
|
185
|
-
);
|
|
186
|
-
}
|
|
4
|
+
export { DispatchSettingsPage };
|
|
5
|
+
export type { DispatchSettingsPageProps } from "./settings-page.js";
|
|
6
|
+
export { meta } from "./settings-page.js";
|
|
187
7
|
|
|
188
8
|
export default function SettingsRoute() {
|
|
189
9
|
return <DispatchSettingsPage changelog={packageChangelog} />;
|
package/src/shared/app-roles.ts
CHANGED