@agent-native/dispatch 0.14.14 → 0.15.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/dist/actions/index.d.ts.map +1 -1
- package/dist/actions/index.js +4 -0
- package/dist/actions/index.js.map +1 -1
- package/dist/actions/list-curated-workspace-templates.d.ts +3 -0
- package/dist/actions/list-curated-workspace-templates.d.ts.map +1 -0
- package/dist/actions/list-curated-workspace-templates.js +10 -0
- package/dist/actions/list-curated-workspace-templates.js.map +1 -0
- package/dist/actions/remix-workspace-template.d.ts +60 -0
- package/dist/actions/remix-workspace-template.d.ts.map +1 -0
- package/dist/actions/remix-workspace-template.js +78 -0
- package/dist/actions/remix-workspace-template.js.map +1 -0
- package/dist/actions/upsert-destination.d.ts +12 -12
- package/dist/components/workspace-template-card.d.ts +52 -0
- package/dist/components/workspace-template-card.d.ts.map +1 -0
- package/dist/components/workspace-template-card.js +104 -0
- package/dist/components/workspace-template-card.js.map +1 -0
- package/dist/lib/other-apps.d.ts +14 -0
- package/dist/lib/other-apps.d.ts.map +1 -0
- package/dist/lib/other-apps.js +30 -0
- package/dist/lib/other-apps.js.map +1 -0
- package/dist/routes/pages/apps.d.ts.map +1 -1
- package/dist/routes/pages/apps.js +37 -2
- package/dist/routes/pages/apps.js.map +1 -1
- package/dist/server/lib/app-creation-store.d.ts +1 -0
- package/dist/server/lib/app-creation-store.d.ts.map +1 -1
- package/dist/server/lib/app-creation-store.js +1 -1
- package/dist/server/lib/app-creation-store.js.map +1 -1
- package/dist/server/lib/curated-workspace-templates.d.ts +22 -0
- package/dist/server/lib/curated-workspace-templates.d.ts.map +1 -0
- package/dist/server/lib/curated-workspace-templates.js +137 -0
- package/dist/server/lib/curated-workspace-templates.js.map +1 -0
- package/package.json +2 -2
- package/src/actions/index.ts +4 -0
- package/src/actions/list-curated-workspace-templates.spec.ts +36 -0
- package/src/actions/list-curated-workspace-templates.ts +12 -0
- package/src/actions/remix-workspace-template.spec.ts +116 -0
- package/src/actions/remix-workspace-template.ts +99 -0
- package/src/components/workspace-template-card.spec.tsx +174 -0
- package/src/components/workspace-template-card.tsx +361 -0
- package/src/lib/other-apps.spec.ts +76 -0
- package/src/lib/other-apps.ts +44 -0
- package/src/routes/pages/apps.tsx +165 -0
- package/src/server/lib/app-creation-store.ts +1 -1
- package/src/server/lib/curated-workspace-templates.spec.ts +56 -0
- package/src/server/lib/curated-workspace-templates.ts +187 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { describe, expect, it, vi } from "vitest";
|
|
2
|
+
|
|
3
|
+
const mocks = vi.hoisted(() => ({
|
|
4
|
+
listWorkspaceApps: vi.fn(),
|
|
5
|
+
}));
|
|
6
|
+
|
|
7
|
+
vi.mock("./app-creation-store.js", () => ({
|
|
8
|
+
listWorkspaceApps: mocks.listWorkspaceApps,
|
|
9
|
+
}));
|
|
10
|
+
|
|
11
|
+
import {
|
|
12
|
+
CURATED_WORKSPACE_TEMPLATES,
|
|
13
|
+
getCuratedWorkspaceTemplate,
|
|
14
|
+
listCuratedWorkspaceTemplates,
|
|
15
|
+
} from "./curated-workspace-templates.js";
|
|
16
|
+
|
|
17
|
+
describe("curated workspace templates", () => {
|
|
18
|
+
it("validates only the curated first-party template ids", () => {
|
|
19
|
+
expect(getCuratedWorkspaceTemplate(" MAIL ")).toEqual(
|
|
20
|
+
expect.objectContaining({ id: "mail", template: "mail" }),
|
|
21
|
+
);
|
|
22
|
+
expect(() => getCuratedWorkspaceTemplate("unknown")).toThrow(
|
|
23
|
+
'Unknown curated workspace template "unknown".',
|
|
24
|
+
);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it("returns stable catalog metadata and current installation status", async () => {
|
|
28
|
+
mocks.listWorkspaceApps.mockResolvedValue([
|
|
29
|
+
{ id: "dispatch" },
|
|
30
|
+
{ id: "mail", archived: true },
|
|
31
|
+
{ id: "custom-app" },
|
|
32
|
+
]);
|
|
33
|
+
|
|
34
|
+
const result = await listCuratedWorkspaceTemplates();
|
|
35
|
+
|
|
36
|
+
expect(result).toHaveLength(10);
|
|
37
|
+
expect(result.map((template) => template.id)).toEqual(
|
|
38
|
+
CURATED_WORKSPACE_TEMPLATES.map((template) => template.id),
|
|
39
|
+
);
|
|
40
|
+
expect(result.find((template) => template.id === "mail")).toEqual(
|
|
41
|
+
expect.objectContaining({
|
|
42
|
+
name: "Mail",
|
|
43
|
+
template: "mail",
|
|
44
|
+
liveUrl: "https://mail.agent-native.com",
|
|
45
|
+
installed: true,
|
|
46
|
+
}),
|
|
47
|
+
);
|
|
48
|
+
expect(result.find((template) => template.id === "calendar")).toEqual(
|
|
49
|
+
expect.objectContaining({ installed: false }),
|
|
50
|
+
);
|
|
51
|
+
expect(mocks.listWorkspaceApps).toHaveBeenCalledWith({
|
|
52
|
+
includeAgentCards: false,
|
|
53
|
+
includeArchived: true,
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
});
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { listWorkspaceApps } from "./app-creation-store.js";
|
|
2
|
+
|
|
3
|
+
export interface CuratedWorkspaceTemplate {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
icon: string;
|
|
8
|
+
color: string;
|
|
9
|
+
template: string;
|
|
10
|
+
liveUrl: string;
|
|
11
|
+
category: string;
|
|
12
|
+
setupNote: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface CuratedWorkspaceTemplateStatus extends CuratedWorkspaceTemplate {
|
|
16
|
+
installed: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Stable first-party template metadata for the initial remix catalog.
|
|
21
|
+
* `liveUrl` identifies the product URL; it is not a public-demo claim.
|
|
22
|
+
*/
|
|
23
|
+
export const CURATED_WORKSPACE_TEMPLATES: readonly CuratedWorkspaceTemplate[] =
|
|
24
|
+
[
|
|
25
|
+
{
|
|
26
|
+
id: "mail",
|
|
27
|
+
name: "Mail",
|
|
28
|
+
description:
|
|
29
|
+
"Agent-native email client with keyboard shortcuts and AI triage.",
|
|
30
|
+
icon: "Mail",
|
|
31
|
+
color: "#3B82F6",
|
|
32
|
+
template: "mail",
|
|
33
|
+
liveUrl: "https://mail.agent-native.com",
|
|
34
|
+
category: "communication",
|
|
35
|
+
setupNote:
|
|
36
|
+
"Connect the workspace email integration before working with live mail.",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: "calendar",
|
|
40
|
+
name: "Calendar",
|
|
41
|
+
description:
|
|
42
|
+
"Manage events, synchronization, and public booking with an agent-native calendar.",
|
|
43
|
+
icon: "CalendarDays",
|
|
44
|
+
color: "#00B5FF",
|
|
45
|
+
template: "calendar",
|
|
46
|
+
liveUrl: "https://calendar.agent-native.com",
|
|
47
|
+
category: "productivity",
|
|
48
|
+
setupNote:
|
|
49
|
+
"Connect the workspace calendar integration before working with live events.",
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
id: "analytics",
|
|
53
|
+
name: "Analytics",
|
|
54
|
+
description:
|
|
55
|
+
"Connect data sources and prompt for charts, reports, and product insights.",
|
|
56
|
+
icon: "BarChart2",
|
|
57
|
+
color: "#F59E0B",
|
|
58
|
+
template: "analytics",
|
|
59
|
+
liveUrl: "https://analytics.agent-native.com",
|
|
60
|
+
category: "insights",
|
|
61
|
+
setupNote:
|
|
62
|
+
"Connect a data source or import a representative dataset before analysis.",
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: "slides",
|
|
66
|
+
name: "Slides",
|
|
67
|
+
description:
|
|
68
|
+
"Generate and edit React presentations with agent assistance.",
|
|
69
|
+
icon: "GalleryHorizontal",
|
|
70
|
+
color: "#EC4899",
|
|
71
|
+
template: "slides",
|
|
72
|
+
liveUrl: "https://slides.agent-native.com",
|
|
73
|
+
category: "creative",
|
|
74
|
+
setupNote:
|
|
75
|
+
"Start with a blank deck or connect the workspace presentation integration.",
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
id: "content",
|
|
79
|
+
name: "Content",
|
|
80
|
+
description:
|
|
81
|
+
"Write and organize local MDX content with agent assistance.",
|
|
82
|
+
icon: "FileText",
|
|
83
|
+
color: "#10B981",
|
|
84
|
+
template: "content",
|
|
85
|
+
liveUrl: "https://content.agent-native.com",
|
|
86
|
+
category: "content",
|
|
87
|
+
setupNote:
|
|
88
|
+
"Choose a content folder or create a first document for the private remix.",
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: "clips",
|
|
92
|
+
name: "Clips",
|
|
93
|
+
description:
|
|
94
|
+
"Record screens, capture meeting notes, and use voice dictation with AI.",
|
|
95
|
+
icon: "ScreenShare",
|
|
96
|
+
color: "#0EA5E9",
|
|
97
|
+
template: "clips",
|
|
98
|
+
liveUrl: "https://clips.agent-native.com",
|
|
99
|
+
category: "media",
|
|
100
|
+
setupNote:
|
|
101
|
+
"Grant screen and audio permissions only when the workspace needs recording.",
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
id: "brain",
|
|
105
|
+
name: "Brain",
|
|
106
|
+
description:
|
|
107
|
+
"Search cited company knowledge from conversations, meetings, and decisions.",
|
|
108
|
+
icon: "Brain",
|
|
109
|
+
color: "#8B5CF6",
|
|
110
|
+
template: "brain",
|
|
111
|
+
liveUrl: "https://brain.agent-native.com",
|
|
112
|
+
category: "knowledge",
|
|
113
|
+
setupNote:
|
|
114
|
+
"Connect approved knowledge sources before indexing workspace information.",
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
id: "assets",
|
|
118
|
+
name: "Assets",
|
|
119
|
+
description:
|
|
120
|
+
"Upload, organize, search, and generate on-brand images and videos.",
|
|
121
|
+
icon: "Photo",
|
|
122
|
+
color: "#0F766E",
|
|
123
|
+
template: "assets",
|
|
124
|
+
liveUrl: "https://assets.agent-native.com",
|
|
125
|
+
category: "content",
|
|
126
|
+
setupNote:
|
|
127
|
+
"Upload a representative asset or connect approved asset storage to begin.",
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
id: "forms",
|
|
131
|
+
name: "Forms",
|
|
132
|
+
description: "Create, edit, and manage forms with agent assistance.",
|
|
133
|
+
icon: "ClipboardList",
|
|
134
|
+
color: "#06B6D4",
|
|
135
|
+
template: "forms",
|
|
136
|
+
liveUrl: "https://forms.agent-native.com",
|
|
137
|
+
category: "operations",
|
|
138
|
+
setupNote:
|
|
139
|
+
"Create a form and choose its submission destination before inviting respondents.",
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
id: "design",
|
|
143
|
+
name: "Design",
|
|
144
|
+
description:
|
|
145
|
+
"Create and edit visual designs with agent-assisted exploration.",
|
|
146
|
+
icon: "Brush",
|
|
147
|
+
color: "#F472B6",
|
|
148
|
+
template: "design",
|
|
149
|
+
liveUrl: "https://design.agent-native.com",
|
|
150
|
+
category: "creative",
|
|
151
|
+
setupNote:
|
|
152
|
+
"Create a private project and optionally connect approved asset sources.",
|
|
153
|
+
},
|
|
154
|
+
] as const;
|
|
155
|
+
|
|
156
|
+
const curatedTemplateById = new Map(
|
|
157
|
+
CURATED_WORKSPACE_TEMPLATES.map((template) => [template.id, template]),
|
|
158
|
+
);
|
|
159
|
+
|
|
160
|
+
export function getCuratedWorkspaceTemplate(
|
|
161
|
+
templateId: string,
|
|
162
|
+
): CuratedWorkspaceTemplate {
|
|
163
|
+
const normalized = templateId.trim().toLowerCase();
|
|
164
|
+
const template = curatedTemplateById.get(normalized);
|
|
165
|
+
if (!template) {
|
|
166
|
+
throw new Error(`Unknown curated workspace template "${templateId}".`);
|
|
167
|
+
}
|
|
168
|
+
return template;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export async function listCuratedWorkspaceTemplates(): Promise<
|
|
172
|
+
CuratedWorkspaceTemplateStatus[]
|
|
173
|
+
> {
|
|
174
|
+
const installedIds = new Set(
|
|
175
|
+
(
|
|
176
|
+
await listWorkspaceApps({
|
|
177
|
+
includeAgentCards: false,
|
|
178
|
+
includeArchived: true,
|
|
179
|
+
})
|
|
180
|
+
).map((app) => app.id.trim().toLowerCase()),
|
|
181
|
+
);
|
|
182
|
+
|
|
183
|
+
return CURATED_WORKSPACE_TEMPLATES.map((template) => ({
|
|
184
|
+
...template,
|
|
185
|
+
installed: installedIds.has(template.id),
|
|
186
|
+
}));
|
|
187
|
+
}
|