diff --git a/frontend/packages/website/src/components/GetStarted.tsx b/frontend/packages/website/src/components/GetStarted.tsx index 21761e7..1b0df8b 100644 --- a/frontend/packages/website/src/components/GetStarted.tsx +++ b/frontend/packages/website/src/components/GetStarted.tsx @@ -3,7 +3,7 @@ import { Code, Cloud, GitBranch } from 'lucide-react'; import { CopyButton } from './ui/CopyButton'; -const sdkCode = `import { SandboxAgent } from "sandbox-agent"; +const sdkCodeRaw = `import { SandboxAgent } from "sandbox-agent"; const client = await SandboxAgent.start(); @@ -19,6 +19,73 @@ for await (const event of client.streamEvents("my-session")) { console.log(event.type, event.data); }`; +function SdkCodeHighlighted() { + return ( +
+
+ import
+ {" { "}
+ SandboxAgent
+ {" } "}
+ from
+
+ "sandbox-agent"
+ ;
+ {"\n\n"}
+ const
+ client =
+ await
+ SandboxAgent.
+ start
+ ();
+ {"\n\n"}
+ await
+ client.
+ createSession
+ (
+ "my-session"
+ {", {"}
+ {"\n"}
+ {" agent: "}
+ "claude-code"
+ ,
+ {"\n"}
+ {"});"}
+ {"\n\n"}
+ await
+ client.
+ postMessage
+ (
+ "my-session"
+ {", {"}
+ {"\n"}
+ {" message: "}
+ "Hello, world!"
+ ,
+ {"\n"}
+ {"});"}
+ {"\n\n"}
+ for await
+ (
+ const
+ event
+ of
+ client.
+ streamEvents
+ (
+ "my-session"
+ {")) {"}
+ {"\n"}
+ {" console."}
+ log
+ (event.type, event.data);
+ {"\n"}
+ {"}"}
+
+
+ );
+}
+
const sandboxCommand = `curl -sSL https://sandboxagent.dev/install | sh`;
const sourceCommands = `git clone https://github.com/rivet-dev/sandbox-agent
@@ -63,11 +130,9 @@ export function GetStarted() {
- {sdkCode}
-
+