dreamer 0.0.0-alpha-20251119021619 → 1.0.1
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/index.js +2 -2
- package/package.json +1 -1
- package/dist/template/.vscode/tasks.json +0 -19
- package/dist/template/agent.yaml.example +0 -36
- package/dist/template/build.ts +0 -108
- package/dist/template/examples/ReadContainerSize.tsx +0 -52
- package/dist/template/examples/components/LoadingIcon.tsx +0 -22
- package/dist/template/sdk-helpers/standalone-wrapper.tsx +0 -43
- package/dist/template/src/App.tsx +0 -89
- package/dist/template/src/globals.css +0 -158
- package/dist/template/src/server.ts +0 -45
package/package.json
CHANGED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "2.0.0",
|
|
3
|
-
"tasks": [
|
|
4
|
-
{
|
|
5
|
-
"label": "Agent-code: Build and Push",
|
|
6
|
-
"type": "shell",
|
|
7
|
-
"command": "agent-code",
|
|
8
|
-
"args": ["push"],
|
|
9
|
-
"group": "build",
|
|
10
|
-
"presentation": {
|
|
11
|
-
"echo": true,
|
|
12
|
-
"reveal": "always",
|
|
13
|
-
"focus": false,
|
|
14
|
-
"panel": "shared"
|
|
15
|
-
},
|
|
16
|
-
"problemMatcher": []
|
|
17
|
-
}
|
|
18
|
-
]
|
|
19
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# Agent Configuration Template
|
|
2
|
-
# This file shows the structure of agent.yaml with its configuration options
|
|
3
|
-
|
|
4
|
-
agentId: your-agent-id-here
|
|
5
|
-
name: Your Agent Name
|
|
6
|
-
hasUi: true
|
|
7
|
-
|
|
8
|
-
# UI Views configuration options
|
|
9
|
-
views:
|
|
10
|
-
- type: app
|
|
11
|
-
- type: widget
|
|
12
|
-
name: Single Note
|
|
13
|
-
identifier: note-widget
|
|
14
|
-
constraints:
|
|
15
|
-
minWidth: 120
|
|
16
|
-
minHeight: 120
|
|
17
|
-
maxWidth: 480
|
|
18
|
-
maxHeight: 480
|
|
19
|
-
- type: feed
|
|
20
|
-
|
|
21
|
-
# Optional triggers configuration
|
|
22
|
-
triggers:
|
|
23
|
-
- type: cron
|
|
24
|
-
defaultSchedule: "0 */2 * * *" # Every 2 hours
|
|
25
|
-
entrypoint: "main" # Optional - defaults to 'main'
|
|
26
|
-
name: "Check for Updates" # Optional - custom name for the trigger
|
|
27
|
-
|
|
28
|
-
- type: input
|
|
29
|
-
contentTypes: ["text/uri-list", "text/markdown"]
|
|
30
|
-
entrypoint: "processText"
|
|
31
|
-
name: "Process URLs and Markdown" # Optional - custom name for the trigger
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
# Optional tools configuration
|
|
35
|
-
allowedTools: []
|
|
36
|
-
requiredTools: []
|
package/dist/template/build.ts
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
2
|
-
|
|
3
|
-
import { existsSync } from "node:fs";
|
|
4
|
-
import { cp, mkdir, rm } from "node:fs/promises";
|
|
5
|
-
import { build } from "esbuild";
|
|
6
|
-
import tailwindcss from "esbuild-plugin-tailwindcss";
|
|
7
|
-
|
|
8
|
-
async function buildServer() {
|
|
9
|
-
if (existsSync("src/server.ts")) {
|
|
10
|
-
console.log("Building server...");
|
|
11
|
-
|
|
12
|
-
const outdir = "dist/server";
|
|
13
|
-
|
|
14
|
-
if (existsSync(outdir)) {
|
|
15
|
-
console.log(`🗑️ Cleaning previous build at ${outdir}`);
|
|
16
|
-
await rm(outdir, { recursive: true, force: true });
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const start = performance.now();
|
|
20
|
-
|
|
21
|
-
await build({
|
|
22
|
-
entryPoints: ["src/server.ts"],
|
|
23
|
-
outdir,
|
|
24
|
-
target: "node16",
|
|
25
|
-
platform: "node",
|
|
26
|
-
format: "cjs",
|
|
27
|
-
bundle: true,
|
|
28
|
-
external: ["@dev-agents/sdk-client"],
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
const end = performance.now();
|
|
32
|
-
console.log(`✅ Server build complete in ${(end - start).toFixed(2)}ms`);
|
|
33
|
-
} else {
|
|
34
|
-
console.log("⏭️ Skipping server build (src/server.ts not found)");
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
async function buildFrontend() {
|
|
39
|
-
console.log("🎁 Building frontend bundle...");
|
|
40
|
-
|
|
41
|
-
const outdir = "dist/frontend";
|
|
42
|
-
|
|
43
|
-
if (existsSync(outdir)) {
|
|
44
|
-
console.log(`🗑️ Cleaning previous build at ${outdir}`);
|
|
45
|
-
await rm(outdir, { recursive: true, force: true });
|
|
46
|
-
}
|
|
47
|
-
await mkdir(outdir, { recursive: true });
|
|
48
|
-
|
|
49
|
-
const start = performance.now();
|
|
50
|
-
|
|
51
|
-
await build({
|
|
52
|
-
entryPoints: ["sdk-helpers/standalone-wrapper.tsx"],
|
|
53
|
-
outfile: `${outdir}/app.js`,
|
|
54
|
-
plugins: [tailwindcss()],
|
|
55
|
-
minify: true,
|
|
56
|
-
target: "es2018",
|
|
57
|
-
platform: "browser",
|
|
58
|
-
bundle: true,
|
|
59
|
-
format: "iife",
|
|
60
|
-
globalName: "AgentApp",
|
|
61
|
-
jsx: "automatic",
|
|
62
|
-
jsxImportSource: "react",
|
|
63
|
-
sourcemap: false,
|
|
64
|
-
define: {
|
|
65
|
-
"process.env.NODE_ENV": JSON.stringify("production"),
|
|
66
|
-
},
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
const end = performance.now();
|
|
70
|
-
console.log(`✅ Standalone build complete in ${(end - start).toFixed(2)}ms`);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
async function copyStaticAssets() {
|
|
74
|
-
if (existsSync("static")) {
|
|
75
|
-
console.log("📁 Copying static assets...");
|
|
76
|
-
|
|
77
|
-
const targetDir = "dist/frontend/static";
|
|
78
|
-
|
|
79
|
-
if (existsSync(targetDir)) {
|
|
80
|
-
await rm(targetDir, { recursive: true, force: true });
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
await cp("static", targetDir, { recursive: true });
|
|
84
|
-
console.log("✅ Static assets copied to dist/frontend/static");
|
|
85
|
-
} else {
|
|
86
|
-
console.log("⏭️ No static directory to copy");
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
async function main() {
|
|
91
|
-
const args = process.argv.slice(2);
|
|
92
|
-
|
|
93
|
-
if (args.includes("--server-only")) {
|
|
94
|
-
await buildServer();
|
|
95
|
-
} else if (args.includes("--frontend-only")) {
|
|
96
|
-
await buildFrontend();
|
|
97
|
-
} else {
|
|
98
|
-
// Build both by default
|
|
99
|
-
await buildServer();
|
|
100
|
-
await buildFrontend();
|
|
101
|
-
}
|
|
102
|
-
await copyStaticAssets();
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
main().catch((error) => {
|
|
106
|
-
console.error("Build failed:", error);
|
|
107
|
-
process.exit(1);
|
|
108
|
-
});
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useState } from "react";
|
|
2
|
-
|
|
3
|
-
interface RenderContext {
|
|
4
|
-
type: "widget" | "app" | "feed_item";
|
|
5
|
-
data?: unknown;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export default function App({ renderContext }: { renderContext: RenderContext }) {
|
|
9
|
-
// Apps should use responsive layout, if they MUST know their size, they can use this incantation:
|
|
10
|
-
const [size, setSize] = useState<DOMRect | null>(null);
|
|
11
|
-
const containerRef = React.useRef<HTMLDivElement>(null);
|
|
12
|
-
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
console.log(renderContext);
|
|
15
|
-
|
|
16
|
-
const updateSize = () => {
|
|
17
|
-
if (containerRef.current) {
|
|
18
|
-
setSize(containerRef.current.getBoundingClientRect());
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
// Set initial size
|
|
23
|
-
updateSize();
|
|
24
|
-
|
|
25
|
-
// Create ResizeObserver to watch the container element
|
|
26
|
-
const resizeObserver = new ResizeObserver(() => {
|
|
27
|
-
updateSize();
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
// Start observing the container element
|
|
31
|
-
if (containerRef.current) {
|
|
32
|
-
resizeObserver.observe(containerRef.current);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// Cleanup function to disconnect the observer
|
|
36
|
-
return () => {
|
|
37
|
-
resizeObserver.disconnect();
|
|
38
|
-
};
|
|
39
|
-
}, []);
|
|
40
|
-
// end incantation
|
|
41
|
-
|
|
42
|
-
return (
|
|
43
|
-
<div ref={containerRef} className="w-full h-full">
|
|
44
|
-
<div className="p-8 max-w-2xl mx-auto">
|
|
45
|
-
<p>I'm being rendered in a{renderContext.type || "n unknown"} container.</p>
|
|
46
|
-
<p>
|
|
47
|
-
It is {size?.width}px wide and {size?.height}px tall.
|
|
48
|
-
</p>
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
);
|
|
52
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
type LoadingIconProps = {
|
|
2
|
-
className?: string;
|
|
3
|
-
};
|
|
4
|
-
|
|
5
|
-
function LoadingIcon(props: LoadingIconProps) {
|
|
6
|
-
return (
|
|
7
|
-
<svg
|
|
8
|
-
className={`animate-spin w-5 h-5 ${props.className || ""}`}
|
|
9
|
-
fill="none"
|
|
10
|
-
viewBox="0 0 24 24"
|
|
11
|
-
>
|
|
12
|
-
<circle className="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4" />
|
|
13
|
-
<path
|
|
14
|
-
className="opacity-50"
|
|
15
|
-
fill="currentColor"
|
|
16
|
-
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
17
|
-
/>
|
|
18
|
-
</svg>
|
|
19
|
-
);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export default LoadingIcon;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { createRoot } from "react-dom/client";
|
|
3
|
-
import App from "../src/App";
|
|
4
|
-
|
|
5
|
-
interface RenderContext {
|
|
6
|
-
type: "widget" | "app" | "feed_item";
|
|
7
|
-
data?: unknown;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
function getRenderContext(): RenderContext {
|
|
11
|
-
// Try to read from body data attribute first
|
|
12
|
-
const bodyData = document.body.getAttribute("data-render-context");
|
|
13
|
-
if (bodyData) {
|
|
14
|
-
try {
|
|
15
|
-
return JSON.parse(bodyData);
|
|
16
|
-
} catch (error) {
|
|
17
|
-
console.warn("Failed to parse render context from body data attribute:", error);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return { type: "app" };
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function bootstrap() {
|
|
24
|
-
const existingRoot = document.getElementById("root");
|
|
25
|
-
const rootElement =
|
|
26
|
-
existingRoot ??
|
|
27
|
-
(() => {
|
|
28
|
-
const el = document.createElement("div");
|
|
29
|
-
el.id = "root";
|
|
30
|
-
document.body.appendChild(el);
|
|
31
|
-
return el;
|
|
32
|
-
})();
|
|
33
|
-
|
|
34
|
-
const renderContext = getRenderContext();
|
|
35
|
-
const root = createRoot(rootElement);
|
|
36
|
-
root.render(React.createElement(App, { renderContext }));
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
if (document.readyState === "loading") {
|
|
40
|
-
document.addEventListener("DOMContentLoaded", bootstrap);
|
|
41
|
-
} else {
|
|
42
|
-
bootstrap();
|
|
43
|
-
}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import "./globals.css";
|
|
2
|
-
import { agentQueryClient, call } from "@dev-agents/sdk-client";
|
|
3
|
-
import { QueryClientProvider, useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
4
|
-
import { useState } from "react";
|
|
5
|
-
import type { getMessage, setMessage } from "./server";
|
|
6
|
-
|
|
7
|
-
interface RenderContext {
|
|
8
|
-
type: "widget" | "app" | "feed_item";
|
|
9
|
-
data?: unknown;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
function WelcomeMessage() {
|
|
13
|
-
const queryClient = useQueryClient();
|
|
14
|
-
const [newMessage, setNewMessage] = useState("");
|
|
15
|
-
|
|
16
|
-
// Fetch the welcome message
|
|
17
|
-
const { data, isLoading, error } = useQuery({
|
|
18
|
-
queryKey: ["welcomeMessage"],
|
|
19
|
-
queryFn: () => call<typeof getMessage>("getMessage", {}),
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
// Mutation to update the message
|
|
23
|
-
const setMessageMutation = useMutation({
|
|
24
|
-
mutationFn: (message: string) => call<typeof setMessage>("setMessage", { message }),
|
|
25
|
-
onSuccess: () => {
|
|
26
|
-
// Invalidate and refetch
|
|
27
|
-
queryClient.invalidateQueries({ queryKey: ["welcomeMessage"] });
|
|
28
|
-
setNewMessage("");
|
|
29
|
-
},
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
const handleSubmit = async (e: React.FormEvent) => {
|
|
33
|
-
e.preventDefault();
|
|
34
|
-
if (newMessage.trim()) {
|
|
35
|
-
await setMessageMutation.mutateAsync(newMessage);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
if (isLoading) return <div className="text-muted-foreground">Loading...</div>;
|
|
40
|
-
if (error) return <div className="text-destructive">Error: {String(error)}</div>;
|
|
41
|
-
|
|
42
|
-
return (
|
|
43
|
-
<div className="space-y-4">
|
|
44
|
-
<div className="text-foreground">
|
|
45
|
-
<p className="text-lg mb-2">{data?.message}</p>
|
|
46
|
-
<p className="text-sm text-muted-foreground">Last updated: {data?.timestamp}</p>
|
|
47
|
-
</div>
|
|
48
|
-
|
|
49
|
-
<form onSubmit={handleSubmit} className="space-y-2">
|
|
50
|
-
<input
|
|
51
|
-
type="text"
|
|
52
|
-
value={newMessage}
|
|
53
|
-
onChange={(e) => setNewMessage(e.target.value)}
|
|
54
|
-
placeholder="Enter a custom message"
|
|
55
|
-
disabled={setMessageMutation.isPending}
|
|
56
|
-
className="w-full px-3 py-2 border border-border rounded bg-background text-foreground"
|
|
57
|
-
/>
|
|
58
|
-
<button
|
|
59
|
-
type="submit"
|
|
60
|
-
disabled={setMessageMutation.isPending || !newMessage.trim()}
|
|
61
|
-
className="px-4 py-2 bg-primary text-primary-foreground rounded disabled:opacity-50"
|
|
62
|
-
>
|
|
63
|
-
{setMessageMutation.isPending ? "Updating..." : "Update Message"}
|
|
64
|
-
</button>
|
|
65
|
-
</form>
|
|
66
|
-
</div>
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export default function App({ renderContext }: { renderContext: RenderContext }) {
|
|
71
|
-
// CRITICAL: Wrap your app in QueryClientProvider with agentQueryClient
|
|
72
|
-
return (
|
|
73
|
-
<QueryClientProvider client={agentQueryClient}>
|
|
74
|
-
{renderContext.type === "widget" ? (
|
|
75
|
-
<div className="flex items-center justify-center h-full p-4">
|
|
76
|
-
<div className="text-center">
|
|
77
|
-
<h1 className="text-2xl font-bold text-foreground mb-4">Welcome Agent</h1>
|
|
78
|
-
<WelcomeMessage />
|
|
79
|
-
</div>
|
|
80
|
-
</div>
|
|
81
|
-
) : (
|
|
82
|
-
<div className="p-8 max-w-2xl mx-auto">
|
|
83
|
-
<h1 className="text-3xl font-bold mb-6 text-center text-foreground">Welcome Agent</h1>
|
|
84
|
-
<WelcomeMessage />
|
|
85
|
-
</div>
|
|
86
|
-
)}
|
|
87
|
-
</QueryClientProvider>
|
|
88
|
-
);
|
|
89
|
-
}
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
@import "tailwindcss";
|
|
2
|
-
|
|
3
|
-
@custom-variant dark (&:is(.dark *));
|
|
4
|
-
|
|
5
|
-
:root {
|
|
6
|
-
color-scheme: light dark;
|
|
7
|
-
|
|
8
|
-
--background: oklch(100% 0 0);
|
|
9
|
-
--foreground: oklch(14.5% 0 0);
|
|
10
|
-
--card: oklch(100% 0 0);
|
|
11
|
-
--card-foreground: oklch(14.5% 0 0);
|
|
12
|
-
--popover: oklch(100% 0 0);
|
|
13
|
-
--popover-foreground: oklch(14.5% 0 0);
|
|
14
|
-
--primary: oklch(20.5% 0 0);
|
|
15
|
-
--primary-foreground: oklch(98.5% 0 0);
|
|
16
|
-
--secondary: oklch(97% 0 0);
|
|
17
|
-
--secondary-foreground: oklch(20.5% 0 0);
|
|
18
|
-
--muted: oklch(97% 0 0);
|
|
19
|
-
--muted-foreground: oklch(55.6% 0 0);
|
|
20
|
-
--accent: oklch(97% 0 0);
|
|
21
|
-
--accent-foreground: oklch(20.5% 0 0);
|
|
22
|
-
--destructive: oklch(57.7% 0.245 27.325);
|
|
23
|
-
--destructive-foreground: oklch(14.5% 0 0);
|
|
24
|
-
--border: oklch(0 0 0 / 10%);
|
|
25
|
-
--input: oklch(92.2% 0 0);
|
|
26
|
-
--ring: oklch(70.8% 0 0);
|
|
27
|
-
--chart-1: oklch(64.6% 0.222 41.116);
|
|
28
|
-
--chart-2: oklch(60% 0.118 184.704);
|
|
29
|
-
--chart-3: oklch(39.8% 0.07 227.392);
|
|
30
|
-
--chart-4: oklch(82.8% 0.189 84.429);
|
|
31
|
-
--chart-5: oklch(76.9% 0.188 70.08);
|
|
32
|
-
--radius: 0.625rem;
|
|
33
|
-
--sidebar: oklch(98.5% 0 0);
|
|
34
|
-
--sidebar-foreground: oklch(14.5% 0 0);
|
|
35
|
-
--sidebar-primary: oklch(20.5% 0 0);
|
|
36
|
-
--sidebar-primary-foreground: oklch(98.5% 0 0);
|
|
37
|
-
--sidebar-accent: oklch(97% 0 0);
|
|
38
|
-
--sidebar-accent-foreground: oklch(20.5% 0 0);
|
|
39
|
-
--sidebar-border: oklch(92.2% 0 0);
|
|
40
|
-
--sidebar-ring: oklch(70.8% 0 0);
|
|
41
|
-
--grid-handle: oklch(26.7% 0 0);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.dark {
|
|
45
|
-
--background: oklch(14.5% 0 0);
|
|
46
|
-
--foreground: oklch(98.5% 0 0);
|
|
47
|
-
--card: oklch(25.6% 0.016884 285.1);
|
|
48
|
-
--card-foreground: oklch(98.5% 0 0);
|
|
49
|
-
--popover: oklch(14.5% 0 0);
|
|
50
|
-
--popover-foreground: oklch(98.5% 0 0);
|
|
51
|
-
--primary: oklch(98.5% 0 0);
|
|
52
|
-
--primary-foreground: oklch(20.5% 0 0);
|
|
53
|
-
--secondary: oklch(26.9% 0 0);
|
|
54
|
-
--secondary-foreground: oklch(98.5% 0 0);
|
|
55
|
-
--muted: oklch(26.9% 0 0);
|
|
56
|
-
--muted-foreground: oklch(70.8% 0 0);
|
|
57
|
-
--accent: oklch(26.9% 0 0);
|
|
58
|
-
--accent-foreground: oklch(98.5% 0 0);
|
|
59
|
-
--destructive: oklch(39.6% 0.141 25.723);
|
|
60
|
-
--destructive-foreground: oklch(63.7% 0.237 25.331);
|
|
61
|
-
--border: oklch(26.9% 0 0);
|
|
62
|
-
--input: oklch(26.9% 0 0);
|
|
63
|
-
--ring: oklch(43.9% 0 0);
|
|
64
|
-
--chart-1: oklch(48.8% 0.243 264.376);
|
|
65
|
-
--chart-2: oklch(69.6% 0.17 162.48);
|
|
66
|
-
--chart-3: oklch(76.9% 0.188 70.08);
|
|
67
|
-
--chart-4: oklch(62.7% 0.265 303.9);
|
|
68
|
-
--chart-5: oklch(64.5% 0.246 16.439);
|
|
69
|
-
--sidebar: oklch(20.5% 0 0);
|
|
70
|
-
--sidebar-foreground: oklch(98.5% 0 0);
|
|
71
|
-
--sidebar-primary: oklch(48.8% 0.243 264.376);
|
|
72
|
-
--sidebar-primary-foreground: oklch(98.5% 0 0);
|
|
73
|
-
--sidebar-accent: oklch(26.9% 0 0);
|
|
74
|
-
--sidebar-accent-foreground: oklch(98.5% 0 0);
|
|
75
|
-
--sidebar-border: oklch(26.9% 0 0);
|
|
76
|
-
--sidebar-ring: oklch(43.9% 0 0);
|
|
77
|
-
--grid-handle: oklch(26.7% 0 0);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
@theme inline {
|
|
81
|
-
--color-background: var(--background);
|
|
82
|
-
--color-foreground: var(--foreground);
|
|
83
|
-
--color-card: var(--card);
|
|
84
|
-
--color-card-foreground: var(--card-foreground);
|
|
85
|
-
--color-popover: var(--popover);
|
|
86
|
-
--color-popover-foreground: var(--popover-foreground);
|
|
87
|
-
--color-primary: var(--primary);
|
|
88
|
-
--color-primary-foreground: var(--primary-foreground);
|
|
89
|
-
--color-secondary: var(--secondary);
|
|
90
|
-
--color-secondary-foreground: var(--secondary-foreground);
|
|
91
|
-
--color-muted: var(--muted);
|
|
92
|
-
--color-muted-foreground: var(--muted-foreground);
|
|
93
|
-
--color-accent: var(--accent);
|
|
94
|
-
--color-accent-foreground: var(--accent-foreground);
|
|
95
|
-
--color-destructive: var(--destructive);
|
|
96
|
-
--color-destructive-foreground: var(--destructive-foreground);
|
|
97
|
-
--color-border: var(--border);
|
|
98
|
-
--color-input: var(--input);
|
|
99
|
-
--color-ring: var(--ring);
|
|
100
|
-
--color-chart-1: var(--chart-1);
|
|
101
|
-
--color-chart-2: var(--chart-2);
|
|
102
|
-
--color-chart-3: var(--chart-3);
|
|
103
|
-
--color-chart-4: var(--chart-4);
|
|
104
|
-
--color-chart-5: var(--chart-5);
|
|
105
|
-
--color-grid-handle: var(--grid-handle);
|
|
106
|
-
--color-sidebar: var(--sidebar);
|
|
107
|
-
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
108
|
-
--color-sidebar-primary: var(--sidebar-primary);
|
|
109
|
-
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
110
|
-
--color-sidebar-accent: var(--sidebar-accent);
|
|
111
|
-
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
112
|
-
--color-sidebar-border: var(--sidebar-border);
|
|
113
|
-
--color-sidebar-ring: var(--sidebar-ring);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
@theme inline {
|
|
117
|
-
--radius-sm: calc(var(--radius) - 4px);
|
|
118
|
-
--radius-md: calc(var(--radius) - 2px);
|
|
119
|
-
--radius-lg: var(--radius);
|
|
120
|
-
--radius-xl: calc(var(--radius) + 4px);
|
|
121
|
-
--z-index-content: 0;
|
|
122
|
-
--z-index-content-selected: 1;
|
|
123
|
-
--z-index-content-overlay: 2;
|
|
124
|
-
--z-index-content-menu: 5;
|
|
125
|
-
--z-index-menu: 5;
|
|
126
|
-
--z-index-modal-background: 99;
|
|
127
|
-
--z-index-modal: 100;
|
|
128
|
-
--z-index-modal-menu: 105;
|
|
129
|
-
--z-index-context-menu: 905;
|
|
130
|
-
--z-index-tooltip: 1000;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
@layer base {
|
|
134
|
-
* {
|
|
135
|
-
@apply border-border outline-ring/50;
|
|
136
|
-
}
|
|
137
|
-
body {
|
|
138
|
-
@apply bg-background text-foreground;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
@layer base {
|
|
143
|
-
#root {
|
|
144
|
-
isolation: isolate;
|
|
145
|
-
}
|
|
146
|
-
.page-background {
|
|
147
|
-
@apply bg-page-background;
|
|
148
|
-
}
|
|
149
|
-
:root {
|
|
150
|
-
--page-background: #eee;
|
|
151
|
-
}
|
|
152
|
-
.dark {
|
|
153
|
-
--page-background: #16161d;
|
|
154
|
-
}
|
|
155
|
-
@theme inline {
|
|
156
|
-
--color-page-background: var(--page-background);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { backgroundFunction, type ServerSdk, serverFunction } from "@dev-agents/sdk-server";
|
|
2
|
-
import { Type } from "@dev-agents/sdk-shared";
|
|
3
|
-
|
|
4
|
-
// Import tools from individual modules as needed
|
|
5
|
-
// Example:
|
|
6
|
-
// import { someFunction } from "../tools/github.js";
|
|
7
|
-
// import { anotherFunction } from "../tools/slack.js";
|
|
8
|
-
|
|
9
|
-
// Demo functions - remove these and add your own.
|
|
10
|
-
|
|
11
|
-
export const main = backgroundFunction({
|
|
12
|
-
description: "A simple hello world function that demonstrates server function capabilities",
|
|
13
|
-
params: Type.Object({}),
|
|
14
|
-
execute: async () => {
|
|
15
|
-
console.log("Hello, world! This is a long-running background function.");
|
|
16
|
-
},
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
export const getMessage = serverFunction({
|
|
20
|
-
description: "Gets a welcome message from the server",
|
|
21
|
-
params: Type.Object({}),
|
|
22
|
-
exported: true,
|
|
23
|
-
execute: async (sdk: ServerSdk) => {
|
|
24
|
-
const customMessage = await sdk.getValue<string>("welcomeMessage");
|
|
25
|
-
console.log("getMessage: welcomeMessage is", customMessage);
|
|
26
|
-
return {
|
|
27
|
-
message:
|
|
28
|
-
customMessage || "Welcome to your new agent! Click the button to set a custom message.",
|
|
29
|
-
timestamp: new Date().toISOString(),
|
|
30
|
-
};
|
|
31
|
-
},
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
export const setMessage = serverFunction({
|
|
35
|
-
description: "Sets a custom welcome message",
|
|
36
|
-
params: Type.Object({
|
|
37
|
-
message: Type.String({ minLength: 1, description: "The custom welcome message to display" }),
|
|
38
|
-
}),
|
|
39
|
-
exported: true,
|
|
40
|
-
execute: async (sdk: ServerSdk, { message }) => {
|
|
41
|
-
await sdk.setValue("welcomeMessage", message);
|
|
42
|
-
console.log("setMessage: set welcomeMessage to:", message);
|
|
43
|
-
return { success: true };
|
|
44
|
-
},
|
|
45
|
-
});
|