sunpeak 0.16.29 → 0.17.2
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/bin/commands/dev.mjs +169 -342
- package/bin/commands/inspect.mjs +763 -0
- package/bin/commands/new.mjs +2 -2
- package/bin/lib/inspect/inspect-config.d.mts +20 -0
- package/bin/lib/inspect/inspect-config.mjs +76 -0
- package/bin/lib/live/global-setup.mjs +6 -1
- package/bin/sunpeak.js +11 -1
- package/dist/chatgpt/globals.css +8 -0
- package/dist/chatgpt/index.cjs +3 -11
- package/dist/chatgpt/index.cjs.map +1 -1
- package/dist/chatgpt/index.d.ts +2 -2
- package/dist/chatgpt/index.js +4 -8
- package/dist/chatgpt/index.js.map +1 -1
- package/dist/claude/index.cjs +1 -1
- package/dist/claude/index.js +1 -1
- package/dist/discovery-Cgoegt62.js +114 -0
- package/dist/discovery-Cgoegt62.js.map +1 -0
- package/dist/discovery-Clu4uHp1.cjs +161 -0
- package/dist/discovery-Clu4uHp1.cjs.map +1 -0
- package/dist/index.cjs +1 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/dist/lib/discovery-cli.cjs +1 -1
- package/dist/lib/discovery-cli.js +1 -1
- package/dist/lib/discovery.d.ts +7 -67
- package/dist/lib/index.d.ts +0 -1
- package/dist/mcp/index.cjs +34 -23
- package/dist/mcp/index.cjs.map +1 -1
- package/dist/mcp/index.js +34 -23
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/types.d.ts +5 -0
- package/dist/simulator/index.cjs +5 -11
- package/dist/simulator/index.cjs.map +1 -1
- package/dist/simulator/index.d.ts +4 -2
- package/dist/simulator/index.js +5 -8
- package/dist/simulator/index.js.map +1 -1
- package/dist/simulator/simple-sidebar.d.ts +7 -4
- package/dist/simulator/simulator-url.d.ts +8 -0
- package/dist/simulator/simulator.d.ts +15 -2
- package/dist/simulator/use-mcp-connection.d.ts +19 -0
- package/dist/{simulator-DIVvI69i.cjs → simulator-CH9hs0N6.cjs} +129 -21
- package/dist/simulator-CH9hs0N6.cjs.map +1 -0
- package/dist/{simulator-C7mkK7Sz.js → simulator-Dl8B-Ljb.js} +124 -22
- package/dist/simulator-Dl8B-Ljb.js.map +1 -0
- package/dist/{simulator-url-BDGD4vZD.cjs → simulator-url-CozKF1jf.cjs} +3 -1
- package/dist/simulator-url-CozKF1jf.cjs.map +1 -0
- package/dist/{simulator-url-Bkxj43yT.js → simulator-url-KoS_ToP6.js} +3 -1
- package/dist/simulator-url-KoS_ToP6.js.map +1 -0
- package/dist/style.css +8 -0
- package/package.json +11 -3
- package/template/dist/albums/albums.html +105 -0
- package/template/dist/albums/albums.json +16 -0
- package/template/dist/carousel/carousel.html +105 -0
- package/template/dist/carousel/carousel.json +16 -0
- package/template/dist/map/map.html +3060 -0
- package/template/dist/map/map.json +22 -0
- package/template/dist/review/review.html +105 -0
- package/template/dist/review/review.json +16 -0
- package/template/dist/server.js +15 -0
- package/template/dist/tools/review-diff.js +50 -0
- package/template/dist/tools/review-post.js +50 -0
- package/template/dist/tools/review-purchase.js +61 -0
- package/template/dist/tools/review.js +31 -0
- package/template/dist/tools/show-albums.js +56 -0
- package/template/dist/tools/show-carousel.js +41 -0
- package/template/dist/tools/show-map.js +47 -0
- package/template/node_modules/.vite/deps/_metadata.json +8 -0
- package/template/node_modules/.vite/deps/package.json +3 -0
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps.js +500 -0
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_app-bridge.js +563 -0
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_app-bridge.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_react.js +575 -0
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_react.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/@testing-library_react.js +11363 -0
- package/template/node_modules/.vite-mcp/deps/@testing-library_react.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/_metadata.json +130 -0
- package/template/node_modules/.vite-mcp/deps/chunk-BoAXSpZd.js +33 -0
- package/template/node_modules/.vite-mcp/deps/client-CU1wWud4.js +14385 -0
- package/template/node_modules/.vite-mcp/deps/client-CU1wWud4.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/clsx.js +18 -0
- package/template/node_modules/.vite-mcp/deps/clsx.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/dist-uWX8WbjY.js +505 -0
- package/template/node_modules/.vite-mcp/deps/dist-uWX8WbjY.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/embla-carousel-react.js +1461 -0
- package/template/node_modules/.vite-mcp/deps/embla-carousel-react.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/embla-carousel-wheel-gestures.js +536 -0
- package/template/node_modules/.vite-mcp/deps/embla-carousel-wheel-gestures.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/magic-string.es-Cklsmr-5.js +1013 -0
- package/template/node_modules/.vite-mcp/deps/magic-string.es-Cklsmr-5.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/mapbox-gl.js +46311 -0
- package/template/node_modules/.vite-mcp/deps/mapbox-gl.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/package.json +3 -0
- package/template/node_modules/.vite-mcp/deps/protocol-CTflwIfG.js +2090 -0
- package/template/node_modules/.vite-mcp/deps/protocol-CTflwIfG.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/react-dom.js +186 -0
- package/template/node_modules/.vite-mcp/deps/react-dom.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/react-dom_client.js +2 -0
- package/template/node_modules/.vite-mcp/deps/react.js +769 -0
- package/template/node_modules/.vite-mcp/deps/react.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/react_jsx-dev-runtime.js +205 -0
- package/template/node_modules/.vite-mcp/deps/react_jsx-dev-runtime.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/react_jsx-runtime.js +209 -0
- package/template/node_modules/.vite-mcp/deps/react_jsx-runtime.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/schemas-NsgmY9QV.js +12157 -0
- package/template/node_modules/.vite-mcp/deps/schemas-NsgmY9QV.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/tailwind-merge.js +2025 -0
- package/template/node_modules/.vite-mcp/deps/tailwind-merge.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/vitest.js +14021 -0
- package/template/node_modules/.vite-mcp/deps/vitest.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/zod.js +624 -0
- package/template/node_modules/.vite-mcp/deps/zod.js.map +1 -0
- package/template/src/tools/review-diff.test.ts +5 -1
- package/template/src/tools/review-diff.ts +1 -1
- package/template/src/tools/review-post.test.ts +5 -1
- package/template/src/tools/review-post.ts +1 -1
- package/template/src/tools/review-purchase.test.ts +5 -1
- package/template/src/tools/review-purchase.ts +1 -1
- package/template/src/tools/review.test.ts +5 -1
- package/template/src/tools/review.ts +1 -1
- package/template/src/tools/show-albums.test.ts +5 -1
- package/template/src/tools/show-albums.ts +1 -1
- package/template/src/tools/show-carousel.test.ts +5 -1
- package/template/src/tools/show-carousel.ts +1 -1
- package/template/src/tools/show-map.test.ts +5 -1
- package/template/src/tools/show-map.ts +1 -1
- package/dist/discovery-BxKCIgG5.cjs +0 -332
- package/dist/discovery-BxKCIgG5.cjs.map +0 -1
- package/dist/discovery-Du4LHrih.js +0 -261
- package/dist/discovery-Du4LHrih.js.map +0 -1
- package/dist/simulator-C7mkK7Sz.js.map +0 -1
- package/dist/simulator-DIVvI69i.cjs.map +0 -1
- package/dist/simulator-url-BDGD4vZD.cjs.map +0 -1
- package/dist/simulator-url-Bkxj43yT.js.map +0 -1
- package/template/.sunpeak/dev.tsx +0 -79
- package/template/.sunpeak/resource-loader.html +0 -20
- package/template/.sunpeak/resource-loader.tsx +0 -57
- package/template/index.html +0 -14
- package/template/src/resources/index.ts +0 -17
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Review",
|
|
3
|
+
"description": "Visualize and review a proposed set of changes or actions",
|
|
4
|
+
"mimeType": "text/html;profile=mcp-app",
|
|
5
|
+
"_meta": {
|
|
6
|
+
"ui": {
|
|
7
|
+
"csp": {
|
|
8
|
+
"resourceDomains": [
|
|
9
|
+
"https://cdn.sunpeak.ai"
|
|
10
|
+
]
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"name": "review",
|
|
15
|
+
"uri": "ui://review-mn3eflsg"
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// src/server.ts
|
|
2
|
+
async function auth(req) {
|
|
3
|
+
const token = req.headers.authorization?.replace("Bearer ", "");
|
|
4
|
+
return { token: token ?? "", clientId: "anonymous", scopes: [] };
|
|
5
|
+
}
|
|
6
|
+
var server = {
|
|
7
|
+
// name defaults to package.json "name" field when omitted
|
|
8
|
+
version: "1.0.0",
|
|
9
|
+
description: "A sunpeak MCP app"
|
|
10
|
+
// icons: [{ src: 'data:image/png;base64,...', mimeType: 'image/png', sizes: ['64x64'] }],
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
auth,
|
|
14
|
+
server
|
|
15
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// src/tools/review-diff.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
var tool = {
|
|
4
|
+
resource: "review",
|
|
5
|
+
title: "Diff Review",
|
|
6
|
+
description: "Show a review dialog for a proposed code diff",
|
|
7
|
+
annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: false },
|
|
8
|
+
_meta: {
|
|
9
|
+
ui: { visibility: ["model", "app"] }
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
var schema = {
|
|
13
|
+
changesetId: z.string().describe("Unique identifier for the changeset"),
|
|
14
|
+
title: z.string().describe("Title describing the changes"),
|
|
15
|
+
description: z.string().describe("Detailed description of what the changes accomplish"),
|
|
16
|
+
files: z.array(z.string()).describe("List of file paths affected by this change"),
|
|
17
|
+
runMigrations: z.boolean().describe("Whether to run database migrations as part of the change")
|
|
18
|
+
};
|
|
19
|
+
async function review_diff_default(args, _extra) {
|
|
20
|
+
const files = args.files ?? ["src/app.tsx", "src/utils/helpers.ts"];
|
|
21
|
+
const changes = files.map((file, i) => ({
|
|
22
|
+
id: String(i + 1),
|
|
23
|
+
type: "modify",
|
|
24
|
+
path: file,
|
|
25
|
+
description: `Changes to ${file.split("/").pop()}`
|
|
26
|
+
}));
|
|
27
|
+
if (args.runMigrations) {
|
|
28
|
+
changes.push({
|
|
29
|
+
id: "migration",
|
|
30
|
+
type: "action",
|
|
31
|
+
description: "Run database migrations"
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
structuredContent: {
|
|
36
|
+
title: args.title || "Code Review",
|
|
37
|
+
description: args.description || "Review the proposed changes below",
|
|
38
|
+
sections: [{ type: "changes", title: "File Changes", content: changes }],
|
|
39
|
+
reviewTool: {
|
|
40
|
+
name: "review",
|
|
41
|
+
arguments: { action: "apply_changes", changesetId: args.changesetId || "cs-1" }
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
review_diff_default as default,
|
|
48
|
+
schema,
|
|
49
|
+
tool
|
|
50
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// src/tools/review-post.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
var tool = {
|
|
4
|
+
resource: "review",
|
|
5
|
+
title: "Review Post",
|
|
6
|
+
description: "Review a social media post before publishing",
|
|
7
|
+
annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: false },
|
|
8
|
+
_meta: {
|
|
9
|
+
ui: { visibility: ["model", "app"] }
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
var schema = {
|
|
13
|
+
content: z.string().describe("The text content of the post"),
|
|
14
|
+
platforms: z.array(z.enum(["x", "linkedin", "facebook", "instagram"])).describe("Social media platforms to post to"),
|
|
15
|
+
schedule: z.enum(["now", "scheduled"]).describe("When to publish the post"),
|
|
16
|
+
scheduledTime: z.string().describe("ISO 8601 timestamp for scheduled posts"),
|
|
17
|
+
visibility: z.enum(["public", "connections", "private"]).describe("Post visibility setting")
|
|
18
|
+
};
|
|
19
|
+
async function review_post_default(args, _extra) {
|
|
20
|
+
const platforms = args.platforms?.join(", ") || "X, LinkedIn";
|
|
21
|
+
const content = args.content || "Check out our latest update!";
|
|
22
|
+
return {
|
|
23
|
+
structuredContent: {
|
|
24
|
+
title: "Review Your Post",
|
|
25
|
+
sections: [
|
|
26
|
+
{ type: "preview", title: "Content", content },
|
|
27
|
+
{
|
|
28
|
+
type: "details",
|
|
29
|
+
title: "Publishing Details",
|
|
30
|
+
content: [
|
|
31
|
+
{ label: "Platforms", value: platforms },
|
|
32
|
+
{
|
|
33
|
+
label: "Schedule",
|
|
34
|
+
value: args.schedule === "scheduled" && args.scheduledTime ? new Date(args.scheduledTime).toLocaleString() : "Immediately"
|
|
35
|
+
},
|
|
36
|
+
{ label: "Visibility", value: args.visibility || "public" }
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
acceptLabel: "Publish",
|
|
41
|
+
rejectLabel: "Cancel",
|
|
42
|
+
reviewTool: { name: "review", arguments: { action: "publish" } }
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
review_post_default as default,
|
|
48
|
+
schema,
|
|
49
|
+
tool
|
|
50
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// src/tools/review-purchase.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
var tool = {
|
|
4
|
+
resource: "review",
|
|
5
|
+
title: "Review Purchase",
|
|
6
|
+
description: "Review a purchase before completing the transaction",
|
|
7
|
+
annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: false },
|
|
8
|
+
_meta: {
|
|
9
|
+
ui: { visibility: ["model", "app"] }
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
var schema = {
|
|
13
|
+
cartId: z.string().describe("Shopping cart identifier"),
|
|
14
|
+
items: z.array(
|
|
15
|
+
z.object({
|
|
16
|
+
productId: z.string(),
|
|
17
|
+
quantity: z.number()
|
|
18
|
+
})
|
|
19
|
+
).describe("List of items to purchase"),
|
|
20
|
+
shippingAddressId: z.string().describe("ID of the saved shipping address"),
|
|
21
|
+
shippingMethod: z.enum(["standard", "express", "overnight"]).describe("Shipping speed"),
|
|
22
|
+
paymentMethodId: z.string().describe("ID of the saved payment method")
|
|
23
|
+
};
|
|
24
|
+
async function review_purchase_default(args, _extra) {
|
|
25
|
+
const rawItems = args.items ?? [{ productId: "DEMO-001", quantity: 1 }];
|
|
26
|
+
const items = rawItems.map((item, i) => ({
|
|
27
|
+
id: String(i + 1),
|
|
28
|
+
title: `Item ${item.productId}`,
|
|
29
|
+
subtitle: `Qty: ${item.quantity}`
|
|
30
|
+
}));
|
|
31
|
+
const shippingLabels = {
|
|
32
|
+
standard: "Standard (5-7 days)",
|
|
33
|
+
express: "Express (2-3 days)",
|
|
34
|
+
overnight: "Overnight"
|
|
35
|
+
};
|
|
36
|
+
const shippingMethod = args.shippingMethod || "standard";
|
|
37
|
+
return {
|
|
38
|
+
structuredContent: {
|
|
39
|
+
title: "Confirm Your Order",
|
|
40
|
+
sections: [
|
|
41
|
+
{ type: "items", title: "Items", content: items },
|
|
42
|
+
{
|
|
43
|
+
type: "details",
|
|
44
|
+
title: "Shipping",
|
|
45
|
+
content: [{ label: "Method", value: shippingLabels[shippingMethod] || shippingMethod }]
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
acceptLabel: "Place Order",
|
|
49
|
+
rejectLabel: "Cancel",
|
|
50
|
+
reviewTool: {
|
|
51
|
+
name: "review",
|
|
52
|
+
arguments: { action: "place_order", cartId: args.cartId || "cart-1" }
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
export {
|
|
58
|
+
review_purchase_default as default,
|
|
59
|
+
schema,
|
|
60
|
+
tool
|
|
61
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// src/tools/review.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
var tool = {
|
|
4
|
+
title: "Confirm Review",
|
|
5
|
+
description: "Execute or cancel a reviewed action after user approval in the review UI",
|
|
6
|
+
annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: false },
|
|
7
|
+
_meta: { ui: { visibility: ["model", "app"] } }
|
|
8
|
+
};
|
|
9
|
+
var schema = {
|
|
10
|
+
action: z.string().describe('Action identifier (e.g., "place_order", "apply_changes", "publish")'),
|
|
11
|
+
confirmed: z.boolean().describe("Whether the user confirmed the action"),
|
|
12
|
+
decidedAt: z.string().describe("ISO timestamp of the decision"),
|
|
13
|
+
payload: z.record(z.string(), z.unknown()).optional().describe("Domain-specific data for the action")
|
|
14
|
+
};
|
|
15
|
+
async function review_default(args, _extra) {
|
|
16
|
+
if (!args.confirmed) {
|
|
17
|
+
return {
|
|
18
|
+
content: [{ type: "text", text: "Cancelled." }],
|
|
19
|
+
structuredContent: { status: "cancelled", message: "Cancelled." }
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
content: [{ type: "text", text: "Completed." }],
|
|
24
|
+
structuredContent: { status: "success", message: "Completed." }
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
review_default as default,
|
|
29
|
+
schema,
|
|
30
|
+
tool
|
|
31
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// src/tools/show-albums.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
var tool = {
|
|
4
|
+
resource: "albums",
|
|
5
|
+
title: "Show Albums",
|
|
6
|
+
description: "Show photo albums",
|
|
7
|
+
annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: false },
|
|
8
|
+
_meta: {
|
|
9
|
+
ui: { visibility: ["model", "app"] }
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
var schema = {
|
|
13
|
+
category: z.string().describe("Filter albums by category (e.g., travel, food, family)"),
|
|
14
|
+
search: z.string().describe("Search term to filter albums by title or description"),
|
|
15
|
+
limit: z.number().describe("Maximum number of albums to return")
|
|
16
|
+
};
|
|
17
|
+
var outputSchema = {
|
|
18
|
+
albums: z.array(
|
|
19
|
+
z.object({
|
|
20
|
+
id: z.string(),
|
|
21
|
+
title: z.string(),
|
|
22
|
+
cover: z.string(),
|
|
23
|
+
photos: z.array(
|
|
24
|
+
z.object({
|
|
25
|
+
id: z.string(),
|
|
26
|
+
title: z.string(),
|
|
27
|
+
url: z.string()
|
|
28
|
+
})
|
|
29
|
+
)
|
|
30
|
+
})
|
|
31
|
+
)
|
|
32
|
+
};
|
|
33
|
+
async function show_albums_default(args, _extra) {
|
|
34
|
+
const title = args.category ? `${args.category.charAt(0).toUpperCase() + args.category.slice(1)} Photos` : args.search ? `"${args.search}" Results` : "My Albums";
|
|
35
|
+
return {
|
|
36
|
+
structuredContent: {
|
|
37
|
+
albums: [
|
|
38
|
+
{
|
|
39
|
+
id: "1",
|
|
40
|
+
title,
|
|
41
|
+
cover: "https://cdn.sunpeak.ai/demo/pizza1.jpeg",
|
|
42
|
+
photos: [
|
|
43
|
+
{ id: "p1", title: "Photo 1", url: "https://cdn.sunpeak.ai/demo/pizza1.jpeg" },
|
|
44
|
+
{ id: "p2", title: "Photo 2", url: "https://cdn.sunpeak.ai/demo/pizza2.jpeg" }
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
show_albums_default as default,
|
|
53
|
+
outputSchema,
|
|
54
|
+
schema,
|
|
55
|
+
tool
|
|
56
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// src/tools/show-carousel.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
var tool = {
|
|
4
|
+
resource: "carousel",
|
|
5
|
+
title: "Show Carousel",
|
|
6
|
+
description: "Show popular places to visit",
|
|
7
|
+
annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: false },
|
|
8
|
+
_meta: {
|
|
9
|
+
ui: { visibility: ["model", "app"] }
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
var schema = {
|
|
13
|
+
city: z.string().describe("City name to search for places"),
|
|
14
|
+
state: z.string().describe("State or region"),
|
|
15
|
+
categories: z.array(z.string()).describe("Filter by categories (e.g., parks, restaurants, landmarks)"),
|
|
16
|
+
limit: z.number().describe("Maximum number of places to return")
|
|
17
|
+
};
|
|
18
|
+
async function show_carousel_default(args, _extra) {
|
|
19
|
+
const city = args.city || "Austin";
|
|
20
|
+
const category = args.categories?.[0] || "landmark";
|
|
21
|
+
return {
|
|
22
|
+
structuredContent: {
|
|
23
|
+
places: [
|
|
24
|
+
{
|
|
25
|
+
id: "1",
|
|
26
|
+
name: `${city} ${category.charAt(0).toUpperCase() + category.slice(1)}`,
|
|
27
|
+
rating: 4.7,
|
|
28
|
+
category,
|
|
29
|
+
location: `${city}${args.state ? `, ${args.state}` : ""}`,
|
|
30
|
+
image: "https://cdn.sunpeak.ai/demo/austin1.jpeg",
|
|
31
|
+
description: `A popular ${category} in ${city}`
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
show_carousel_default as default,
|
|
39
|
+
schema,
|
|
40
|
+
tool
|
|
41
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// src/tools/show-map.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
var tool = {
|
|
4
|
+
resource: "map",
|
|
5
|
+
title: "Show Map",
|
|
6
|
+
description: "Show the map",
|
|
7
|
+
annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: false },
|
|
8
|
+
_meta: {
|
|
9
|
+
ui: { visibility: ["model", "app"] }
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
var schema = {
|
|
13
|
+
query: z.string().describe("Search query for places (e.g., pizza, coffee, restaurants)"),
|
|
14
|
+
location: z.object({
|
|
15
|
+
lat: z.number(),
|
|
16
|
+
lng: z.number()
|
|
17
|
+
}).describe("Center location for the search"),
|
|
18
|
+
radius: z.number().describe("Search radius in miles"),
|
|
19
|
+
minRating: z.number().describe("Minimum rating filter (1-5)"),
|
|
20
|
+
priceRange: z.array(z.enum(["$", "$$", "$$$", "$$$$"])).describe("Price range filter")
|
|
21
|
+
};
|
|
22
|
+
async function show_map_default(args, _extra) {
|
|
23
|
+
const lat = args.location?.lat ?? 37.8001;
|
|
24
|
+
const lng = args.location?.lng ?? -122.4098;
|
|
25
|
+
const query = args.query || "pizza";
|
|
26
|
+
return {
|
|
27
|
+
structuredContent: {
|
|
28
|
+
places: [
|
|
29
|
+
{
|
|
30
|
+
id: "1",
|
|
31
|
+
name: `${query.charAt(0).toUpperCase() + query.slice(1)} Place`,
|
|
32
|
+
coords: [lng, lat],
|
|
33
|
+
description: `A great ${query} spot nearby`,
|
|
34
|
+
city: "San Francisco",
|
|
35
|
+
rating: args.minRating ?? 4.5,
|
|
36
|
+
price: args.priceRange?.[0] ?? "$$",
|
|
37
|
+
thumbnail: "https://cdn.sunpeak.ai/demo/pizza1.jpeg"
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export {
|
|
44
|
+
show_map_default as default,
|
|
45
|
+
schema,
|
|
46
|
+
tool
|
|
47
|
+
};
|