Skip to content

dominiccooney/deepserve

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

deepserve

Serve an HTTP "web app" that lives entirely inside a Cline SDK agent's conversation history. The agent is given a prompt describing the app (e.g. "a TODO list with HTML pages and a JSON API at /api/todos"), then deepserve opens a TCP port and pipes every raw HTTP request into agent.continue(). The agent replies with a raw HTTP response, which is written straight back to the socket.

This is a toy / demo — there is no context pruning, so long sessions will eventually overflow the model's context window.

Install

Requires Node.js 22+ or Bun.

bun install
export CLINE_API_KEY="cline_..."

Run

# Inline prompt
bun run dev --port 8080 -- "A retro guestbook: GET / shows a form and \
the latest 10 entries; POST / accepts name and message form fields and \
appends an entry; entries are stored in your conversation memory."

# Or load the prompt from a file
bun run dev --port 8080 --prompt-file ./prompts/guestbook.txt

Then in another shell:

curl -v http://127.0.0.1:8080/
curl -v -d 'name=Ada&message=Hello' http://127.0.0.1:8080/

Each curl is one turn in the agent's conversation.

Options

-p, --port <n>          TCP port (default 8080)
    --host <addr>       Bind address (default 127.0.0.1)
-f, --prompt-file <p>   Read the initial prompt from a file
    --provider <id>     SDK provider id (default "cline")
    --model <id>        Model id (default "anthropic/claude-sonnet-4.6")

Anything after -- (or any leftover positional args) becomes the initial prompt.

How it works

  1. Construct an Agent from @cline/sdk with a minimal system prompt that says: first turn → acknowledge the spec in prose; every later turn → respond with raw HTTP/1.1 only.
  2. agent.run(initialPrompt) — the model "boots" the app.
  3. A net.createServer accepts one HTTP request per connection (Content-Length framed), feeds the raw bytes to agent.continue(), and writes the agent's outputText back to the socket.
  4. Requests are serialized so the conversation history stays linear.

About

Have models bitbash HTTP responses

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages