@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.
Files changed (128) hide show
  1. package/CHANGELOG.md +48 -19
  2. package/dist/actions/provider-api-register.d.ts +7 -7
  3. package/dist/components/app-open-actions.d.ts +1 -1
  4. package/dist/components/app-open-actions.d.ts.map +1 -1
  5. package/dist/components/app-open-actions.js +1 -1
  6. package/dist/components/app-open-actions.js.map +1 -1
  7. package/dist/components/app-row-settings.js +1 -1
  8. package/dist/components/app-row-settings.js.map +1 -1
  9. package/dist/components/automation-create-dialog.js +2 -2
  10. package/dist/components/automation-create-dialog.js.map +1 -1
  11. package/dist/components/automation-details-panel.js +1 -1
  12. package/dist/components/automation-details-panel.js.map +1 -1
  13. package/dist/components/chat-home-apps.js +1 -1
  14. package/dist/components/chat-home-apps.js.map +1 -1
  15. package/dist/components/create-app-popover.js +3 -3
  16. package/dist/components/create-app-popover.js.map +1 -1
  17. package/dist/components/dispatch-control-plane.d.ts.map +1 -1
  18. package/dist/components/dispatch-control-plane.js +9 -30
  19. package/dist/components/dispatch-control-plane.js.map +1 -1
  20. package/dist/components/layout/Header.js +2 -2
  21. package/dist/components/layout/Header.js.map +1 -1
  22. package/dist/components/layout/Layout.d.ts +6 -5
  23. package/dist/components/layout/Layout.d.ts.map +1 -1
  24. package/dist/components/layout/Layout.js +73 -113
  25. package/dist/components/layout/Layout.js.map +1 -1
  26. package/dist/components/layout/workspace-apps-rail.d.ts.map +1 -1
  27. package/dist/components/layout/workspace-apps-rail.js +7 -19
  28. package/dist/components/layout/workspace-apps-rail.js.map +1 -1
  29. package/dist/components/messaging-setup-panel.js +2 -1
  30. package/dist/components/messaging-setup-panel.js.map +1 -1
  31. package/dist/components/workspace-app-card.js +2 -2
  32. package/dist/components/workspace-app-card.js.map +1 -1
  33. package/dist/components/workspace-app-host.d.ts +1 -1
  34. package/dist/components/workspace-app-host.d.ts.map +1 -1
  35. package/dist/components/workspace-app-host.js +7 -74
  36. package/dist/components/workspace-app-host.js.map +1 -1
  37. package/dist/hooks/use-navigation-state.js +1 -1
  38. package/dist/hooks/use-navigation-state.js.map +1 -1
  39. package/dist/lib/workspace-apps.js +1 -1
  40. package/dist/lib/workspace-apps.js.map +1 -1
  41. package/dist/routes/pages/$appId.js +1 -1
  42. package/dist/routes/pages/$appId.js.map +1 -1
  43. package/dist/routes/pages/_index.js +1 -1
  44. package/dist/routes/pages/_index.js.map +1 -1
  45. package/dist/routes/pages/admin._index.js +1 -1
  46. package/dist/routes/pages/admin._index.js.map +1 -1
  47. package/dist/routes/pages/agent-integrations.js +1 -1
  48. package/dist/routes/pages/agent-integrations.js.map +1 -1
  49. package/dist/routes/pages/apps.d.ts.map +1 -1
  50. package/dist/routes/pages/apps.js +3 -43
  51. package/dist/routes/pages/apps.js.map +1 -1
  52. package/dist/routes/pages/browser-chat.js +1 -1
  53. package/dist/routes/pages/browser-chat.js.map +1 -1
  54. package/dist/routes/pages/chat.d.ts.map +1 -1
  55. package/dist/routes/pages/chat.js +24 -43
  56. package/dist/routes/pages/chat.js.map +1 -1
  57. package/dist/routes/pages/extensions.$id.js +1 -1
  58. package/dist/routes/pages/extensions.$id.js.map +1 -1
  59. package/dist/routes/pages/extensions._index.js +1 -1
  60. package/dist/routes/pages/extensions._index.js.map +1 -1
  61. package/dist/routes/pages/integrations.js +1 -1
  62. package/dist/routes/pages/integrations.js.map +1 -1
  63. package/dist/routes/pages/new-app.js +1 -1
  64. package/dist/routes/pages/new-app.js.map +1 -1
  65. package/dist/routes/pages/operations.js +2 -2
  66. package/dist/routes/pages/operations.js.map +1 -1
  67. package/dist/routes/pages/overview.d.ts +2 -2
  68. package/dist/routes/pages/settings-page.d.ts +10 -0
  69. package/dist/routes/pages/settings-page.d.ts.map +1 -0
  70. package/dist/routes/pages/settings-page.js +104 -0
  71. package/dist/routes/pages/settings-page.js.map +1 -0
  72. package/dist/routes/pages/settings.d.ts +4 -12
  73. package/dist/routes/pages/settings.d.ts.map +1 -1
  74. package/dist/routes/pages/settings.js +4 -88
  75. package/dist/routes/pages/settings.js.map +1 -1
  76. package/dist/routes/pages/tools.$id.js +1 -1
  77. package/dist/routes/pages/tools.$id.js.map +1 -1
  78. package/dist/routes/pages/tools._index.js +1 -1
  79. package/dist/routes/pages/tools._index.js.map +1 -1
  80. package/dist/routes/pages/vault.d.ts +1 -1
  81. package/dist/routes/pages/vault.js +1 -1
  82. package/dist/routes/pages/vault.js.map +1 -1
  83. package/dist/shared/app-roles.js.map +1 -1
  84. package/package.json +3 -3
  85. package/src/components/app-open-actions.tsx +1 -1
  86. package/src/components/app-row-settings.tsx +1 -1
  87. package/src/components/automation-create-dialog.tsx +7 -7
  88. package/src/components/automation-details-panel.tsx +1 -1
  89. package/src/components/chat-home-apps.tsx +1 -1
  90. package/src/components/create-app-popover.spec.tsx +5 -7
  91. package/src/components/create-app-popover.tsx +3 -3
  92. package/src/components/dispatch-control-plane.spec.tsx +12 -19
  93. package/src/components/dispatch-control-plane.tsx +10 -84
  94. package/src/components/layout/Header.tsx +2 -2
  95. package/src/components/layout/Layout.app-chat.spec.ts +1 -0
  96. package/src/components/layout/Layout.spec.tsx +49 -30
  97. package/src/components/layout/Layout.tsx +153 -205
  98. package/src/components/layout/workspace-apps-rail.spec.tsx +79 -0
  99. package/src/components/layout/workspace-apps-rail.tsx +6 -30
  100. package/src/components/messaging-setup-panel.tsx +1 -1
  101. package/src/components/workspace-app-card.tsx +2 -2
  102. package/src/components/workspace-app-chat-rail.spec.tsx +2 -2
  103. package/src/components/workspace-app-host.spec.tsx +19 -19
  104. package/src/components/workspace-app-host.tsx +12 -129
  105. package/src/hooks/use-navigation-state.ts +1 -1
  106. package/src/lib/workspace-apps.ts +1 -1
  107. package/src/routes/pages/$appId.tsx +1 -1
  108. package/src/routes/pages/_index.tsx +1 -1
  109. package/src/routes/pages/admin._index.tsx +1 -1
  110. package/src/routes/pages/agent-integrations.tsx +1 -1
  111. package/src/routes/pages/apps.tsx +2 -86
  112. package/src/routes/pages/automations.spec.tsx +1 -1
  113. package/src/routes/pages/browser-chat.spec.tsx +1 -1
  114. package/src/routes/pages/browser-chat.tsx +1 -1
  115. package/src/routes/pages/chat.spec.tsx +23 -46
  116. package/src/routes/pages/chat.tsx +20 -57
  117. package/src/routes/pages/extensions.$id.tsx +1 -1
  118. package/src/routes/pages/extensions._index.tsx +1 -1
  119. package/src/routes/pages/integrations.tsx +1 -1
  120. package/src/routes/pages/new-app.tsx +1 -1
  121. package/src/routes/pages/operations.tsx +2 -2
  122. package/src/routes/pages/settings-page.tsx +250 -0
  123. package/src/routes/pages/settings.spec.tsx +30 -8
  124. package/src/routes/pages/settings.tsx +4 -184
  125. package/src/routes/pages/tools.$id.tsx +1 -1
  126. package/src/routes/pages/tools._index.tsx +1 -1
  127. package/src/routes/pages/vault.tsx +1 -1
  128. 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 { Button } from "../../components/ui/button";
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 interface DispatchSettingsPageProps {
50
- /** Raw CHANGELOG.md behind What's new. */
51
- changelog: string;
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} />;
@@ -1,4 +1,4 @@
1
- import { ToolViewerPage } from "@agent-native/core/client/tools";
1
+ import { ToolViewerPage } from "@agent-native/toolkit/app/extensions";
2
2
 
3
3
  export function meta() {
4
4
  return [{ title: "Extension \u2014 Dispatch" }];
@@ -1,4 +1,4 @@
1
- import { ToolsListPage } from "@agent-native/core/client/tools";
1
+ import { ToolsListPage } from "@agent-native/toolkit/app/extensions";
2
2
 
3
3
  export function meta() {
4
4
  return [{ title: "Extensions \u2014 Dispatch" }];
@@ -7,7 +7,7 @@ import { useOrgRole } from "@agent-native/core/client/org";
7
7
  import {
8
8
  NewKeyMenu,
9
9
  type NewKeyOption,
10
- } from "@agent-native/core/client/settings";
10
+ } from "@agent-native/toolkit/app/settings";
11
11
  import {
12
12
  IconChevronDown,
13
13
  IconChevronRight,
@@ -1,4 +1,4 @@
1
- import type { AppRolesDescriptor } from "@agent-native/core/client/org";
1
+ import type { AppRolesDescriptor } from "@agent-native/core/org/app-roles";
2
2
 
3
3
  export const dispatchAccessDescriptor = {
4
4
  appId: "dispatch",