Skip to content

An open-source, faster Devin alternative

TypeScript

Merge pull request #51 from diggerhq/feat/claude-sdk-abstraction

Mohamed Habibe5abe64ec824
diff --cc internal/api/router.go
index 0474f7a6,852d99e8..7dd47b99
--- a/internal/api/router.go
+++ b/internal/api/router.go
@@@ -160,8 -160,14 +160,15 @@@ func NewServer(mgr sandbox.Manager, pty
api.GET("/sandboxes/:id/exec", s.listExecSessions)
api.GET("/sandboxes/:id/exec/:sessionID", s.execSessionWebSocket)
api.POST("/sandboxes/:id/exec/:sessionID/kill", s.killExecSession)
+ api.POST("/sandboxes/:id/exec/run", s.execRun)
+ // Agent sessions (Claude Agent SDK)
+ api.POST("/sandboxes/:id/agent", s.createAgentSession)
+ api.GET("/sandboxes/:id/agent", s.listAgentSessions)
+ api.POST("/sandboxes/:id/agent/:sid/prompt", s.sendAgentPrompt)
+ api.POST("/sandboxes/:id/agent/:sid/interrupt", s.interruptAgent)
+ api.POST("/sandboxes/:id/agent/:sid/kill", s.killAgentSession)
+
// Filesystem
api.GET("/sandboxes/:id/files", s.readFile)
api.PUT("/sandboxes/:id/files", s.writeFile)
diff --cc sdks/typescript/src/sandbox.ts
index c29db23b,6c82f5fc..7600e42d
--- a/sdks/typescript/src/sandbox.ts
+++ b/sdks/typescript/src/sandbox.ts
@@@ -93,9 -93,9 +95,10 @@@ export class Sandbox
const opsKey = this.connectUrl ? "" : apiKey;
const opsToken = this.connectUrl ? this.token : "";
+ this.agent = new Agent(opsUrl, opsKey, this.sandboxId, opsToken);
this.files = new Filesystem(opsUrl, opsKey, this.sandboxId, opsToken);
this.exec = new Exec(opsUrl, opsKey, this.sandboxId, opsToken);
+ this.commands = this.exec; // backwards-compatible alias
this.pty = new Pty(opsUrl, opsKey, this.sandboxId, opsToken);
}