Skip to content

kaichen/prosecode

Repository files navigation

prosecode

Prose-like DSL runtime with OpenAI execution. Parse, validate, and run agent workflows (parallel blocks, loops, conditionals, retries, pipelines).

Docs:

  • docs/usage.md
  • docs/language.md
  • docs/runtime.md

Install

bun install

Run

export OPENAI_API_KEY="your-key"
bun run index.ts run workflow.prose --model gpt-4o-mini

Validate / Parse

bun run index.ts validate workflow.prose
bun run index.ts parse workflow.prose

Example

agent researcher:
  model: "gpt-4o-mini"
  prompt: "You are a research assistant"

agent writer:
  model: "gpt-4o-mini"
  persist: true

parallel:
  research = session: researcher
    prompt: "Research quantum computing breakthroughs"
  competitive = session: researcher
    prompt: "Analyze competitor landscape"

loop until **the draft meets publication standards** (max: 3):
  session: writer
    prompt: "Write and refine the article"
    context: { research, competitive }

Persistence & Resume

Persistent agents store memory across runs. Use persist: true on the agent and resume: agentName in the workflow:

agent writer:
  model: "gpt-4o-mini"
  persist: true

session: writer
  prompt: "First draft"

resume: writer
  prompt: "Revise with the prior memory"

Run artifacts are written to .prose/runs/<runId>/ by default (state, bindings, agent logs). Persistent agent memory is stored in ~/.prose/agents/.

You can control persistence via CLI flags:

bun run index.ts run workflow.prose --no-persist
bun run index.ts run workflow.prose --runs-dir ./my-runs --agents-dir ./my-agents

This project was created using bun init in bun v1.3.5. Bun is a fast all-in-one JavaScript runtime.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors