Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
136eab6
feat: Initialize CLI prompt entity and generate CLI interface
moshloop Jul 1, 2026
d15f5ff
feat(ai): Add support for Claude and Codex Cmux backends
moshloop Jul 1, 2026
5a0484b
refactor: include cmux backends in AllBackends() and simplify documen…
moshloop Jul 1, 2026
c1f4df2
feat(captainconfig): add PromptDefaults config type and improve test …
moshloop Jul 1, 2026
a21c44a
refactor(cli): extract executePromptRequest function and support new …
moshloop Jul 1, 2026
e2972f9
feat: Add claude-cmux and codex-cmux backend options to AI models filter
moshloop Jul 1, 2026
ece427f
fix: fallback to config defaults for model and budget fields
moshloop Jul 1, 2026
2008fa3
feat(cli): add Claude cmux and Codex cmux backend options
moshloop Jul 1, 2026
3718a41
feat: add prompt workbench UI and entity management
moshloop Jul 1, 2026
c8b36a6
chore: Add Procfile for dev server startup
moshloop Jul 1, 2026
f5f860d
refactor(fe): remove SpecRuntimeEditor component from RuntimeControls
moshloop Jul 1, 2026
42734f3
fix(cmux): confirm paste landed before pressing Enter on first prompt
moshloop Jul 1, 2026
a65be65
feat(cmux): structured CLI option structs + schema-driven editor
moshloop Jul 2, 2026
8cd5c85
refactor: restructure prompt frontend to api and add prompt run strea…
moshloop Jul 2, 2026
cec6a4c
refactor: refactor Spec to consolidate permissions and context into S…
moshloop Jul 2, 2026
318f91c
feat(fe): add home dashboard with live session monitoring
moshloop Jul 2, 2026
9527a52
feat: add session live monitoring with process discovery
moshloop Jul 2, 2026
7bb4cc2
feat(ai): add release date tracking and model filtering by currency
moshloop Jul 2, 2026
9394d74
feat: restructure ai request context and logging
moshloop Jul 2, 2026
85a1e3d
feat(ai): add Gemini 3.0 Pro and improve model family filtering
moshloop Jul 3, 2026
d306421
feat: add structured output support to claude-agent provider
moshloop Jul 3, 2026
836042b
feat(ai): universal Prompt.Schema via SchemaJSON + prompt-file output…
moshloop Jul 3, 2026
238e7f3
claude: docs gavel todo execution
moshloop Jul 5, 2026
80323d4
feat(session): unified session model + history review fixes
moshloop Jul 5, 2026
31e192e
feat(session): add ToUIMessages and ToReplayEntries projections
moshloop Jul 5, 2026
aff096b
fix(cli): report unhandled stream types via Warn log, not raw stderr
moshloop Jul 5, 2026
ef5a9c2
feat(claude): classify operational stream types, surface pr-link
moshloop Jul 5, 2026
d74febf
feat(claude): surface content-bearing system subtypes as rows
moshloop Jul 5, 2026
1ed6689
refactor(session): relocate history render provider into pkg/session
moshloop Jul 5, 2026
ed02fb0
feat(cli): session summary cache + context/phase-timing instrumentation
moshloop Jul 6, 2026
5a21d34
feat(webapp): show session Server-Timing phases in the browser
moshloop Jul 6, 2026
66ed182
feat(ai): forward SchemaJSON through the agent PromptRequest
moshloop Jul 6, 2026
9930a29
test(cmux): remove obsolete structured-output-rejection test
moshloop Jul 6, 2026
bb8306d
test(cli): make session scope tests robust to shared-tmp project markers
moshloop Jul 6, 2026
543371d
feat(session): add Codex support to the unified model
moshloop Jul 6, 2026
7f04759
feat(cli): RunSessionGet returns the unified session model
moshloop Jul 6, 2026
af676b5
fix(cli): let `sessions get` accept the positional id
moshloop Jul 6, 2026
4d16c91
feat(serve): serve the unified session model at /sessions/{id}
moshloop Jul 6, 2026
2b6d962
feat(session): persistent session store (GORM + embedded postgres)
moshloop Jul 6, 2026
b09994f
feat(cli): unify prompt run/render into one command; deprecate ai prompt
moshloop Jul 6, 2026
2a71f45
feat(cli): log prompt source detection (file vs id vs inline vs stdin)
moshloop Jul 6, 2026
d353b78
feat(ai): suggest the correct model name on an unrecognized model
moshloop Jul 6, 2026
4828c3c
feat(cli): warn on a mistyped model at prompt render time too
moshloop Jul 6, 2026
4380b4f
feat(ai): consult the pricing registry for model suggestions
moshloop Jul 6, 2026
381d17a
feat(webapp): session detail consumes the unified session.Session model
moshloop Jul 6, 2026
cda1393
feat: prompt-run SSE emits the unified session.Message model
moshloop Jul 6, 2026
7858ee1
feat(prompt): add Parse and Document.String for non-rendering .prompt…
moshloop Jul 6, 2026
9a08995
feat(ai): drive prompt-run through a spec.Workflow generate→verify loop
moshloop Jul 7, 2026
810c595
feat(webapp): adopt shared PromptRunEditor in the prompt workbench
moshloop Jul 7, 2026
50460a1
refactor(agent): share spec.Workflow→verify-loop construction
moshloop Jul 7, 2026
66e3593
refactor(agent): reconcile runner into a generic hook model
moshloop Jul 7, 2026
996af0d
refactor(api): reframe Workflow as hook declarations
moshloop Jul 7, 2026
b4376c2
refactor(agent): worktree as a thin wt CLI wrapper
moshloop Jul 7, 2026
79a4ed7
feat(api): add model fallbacks and schema strictness validation
moshloop Jul 7, 2026
3a9073a
fix(webapp): align @types/react on 19 so tsc -b passes
moshloop Jul 7, 2026
08156c6
feat(ai): Add model fallback provider and schema validation middleware
moshloop Jul 7, 2026
8090cc7
feat(session): extract and render Codex inline plans from TodoWrite t…
moshloop Jul 7, 2026
dd1f7b7
feat(api,fe,db): Add model fallbacks, prompt schema builder, and gave…
moshloop Jul 7, 2026
599a300
fix(cli): commit built webapp/dist so go:embed build passes in CI
moshloop Jul 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ pkg/cli/webapp/*.tsbuildinfo
!pkg/cli/webapp/dist/
!pkg/cli/webapp/dist/**
.grite/
pkg/cli/webapp/dist/
hack/
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dev: go run ./cmd/captain serve --dev
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ The container workflow is designed to package things like:
```text
captain/
├── cmd/captain/ # CLI entrypoint
├── docs/ # Astro documentation site
├── pkg/ai/ # AI abstraction, provider config, models
├── pkg/ai/agent/ # Iterative agent loop, plugins (verify, worktree, judge)
├── pkg/ai/fixture/ # YAML fixture runner for Claude configuration benchmarks
Expand Down Expand Up @@ -468,9 +469,12 @@ Interactive wizard that writes `~/.captain.yaml` with defaults for backend, mode
captain serve
captain serve --port 8080
captain serve --dev
go run ./cmd/captain serve --dev --open
task www:dev
task www:build
```

Starts an HTTP API and embedded web UI. The UI launches `captain ai agent` operations and opens follow-up chat windows that resume the returned session. `--dev` starts the Vite dev server from `pkg/cli/webapp` and proxies `/api` back to the Go process.
Starts an HTTP API and embedded web UI. The UI launches `captain ai agent` operations and opens follow-up chat windows that resume the returned session. `--dev` starts the Vite dev server from `pkg/cli/webapp` and proxies `/api` back to the Go process. Use `task www:dev` for the local Go-backed Vite proxy with the browser opened, and `task www:build` to rebuild the embedded web UI assets.

### MCP server

Expand Down Expand Up @@ -508,6 +512,15 @@ Binary output:
.bin/captain
```

### Docs

```bash
task docs:dev
task docs:build
```

The Astro docs site lives in `docs/`. The prompts engine is the first complete section; other Captain areas are scaffolded for future expansion.

### Test

```bash
Expand Down
29 changes: 29 additions & 0 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,35 @@ tasks:
- mkdir -p {{.BIN_DIR}}
- go build -o {{.BIN_DIR}}/{{.BINARY}} ./cmd/captain

www:build:
desc: Build the embedded Captain web UI
dir: pkg/cli/webapp
cmds:
- CI=true pnpm install --frozen-lockfile
- pnpm run build
- touch dist/.gitkeep

www:dev:
desc: Start Captain with the Vite dev proxy and open the browser
dir: pkg/cli/webapp
cmds:
- CI=true pnpm install --frozen-lockfile
- cd ../../.. && go run ./cmd/captain serve --dev --open

docs:build:
desc: Build the Captain Astro documentation site
dir: docs
cmds:
- CI=true pnpm install --frozen-lockfile
- pnpm run build

docs:dev:
desc: Start the Captain Astro documentation site
dir: docs
cmds:
- CI=true pnpm install --frozen-lockfile
- pnpm run dev

lint:
desc: Run linters
cmds:
Expand Down
12 changes: 10 additions & 2 deletions cmd/captain/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ func main() {

sessionsCmd := &cobra.Command{Use: "sessions", Short: "Browse Claude and Codex sessions"}
rootCmd.AddCommand(sessionsCmd)
clicky.AddNamedCommand("list", sessionsCmd, cli.SessionListOptions{}, cli.RunSessionList).Short = "List discovered sessions"
clicky.AddNamedCommand("get", sessionsCmd, cli.SessionGetOptions{}, cli.RunSessionGet).Short = "Show a session transcript"
clicky.AddNamedCommandWithContext("list", sessionsCmd, cli.SessionListOptions{}, cli.RunSessionList).Short = "List discovered sessions"
clicky.AddNamedCommandWithContext("live", sessionsCmd, cli.SessionLiveOptions{}, cli.RunSessionLive).Short = "List sessions with live process health"
clicky.AddNamedCommandWithContext("get", sessionsCmd, cli.SessionGetOptions{}, cli.RunSessionGet).Short = "Show a session transcript"

sandboxCmd := &cobra.Command{
Use: "sandbox",
Expand Down Expand Up @@ -169,6 +170,13 @@ func main() {
clicky.AddNamedCommand("build", containerCmd, cli.ContainerBuildOptions{}, cli.RunContainerBuild).Short = "Build container image"
clicky.AddNamedCommand("run", containerCmd, cli.ContainerRunOptions{}, cli.RunContainerRun).Short = "Run container sandbox"

cli.RegisterPromptEntity()
clicky.GenerateCLI(rootCmd)
if err := cli.AttachPromptSchemaFlag(rootCmd); err != nil {
fmt.Fprintf(os.Stderr, "failed to attach prompt schema flag: %v\n", err)
os.Exit(1)
}

mcpConfig := &mcp.Config{
Name: "captain",
Version: version,
Expand Down
4 changes: 4 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
dist
.astro

15 changes: 15 additions & 0 deletions docs/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import mdx from "@astrojs/mdx";
import react from "@astrojs/react";
import tailwindcss from "@tailwindcss/vite";
import { defineConfig } from "astro/config";

export default defineConfig({
integrations: [mdx(), react()],
vite: {
plugins: [tailwindcss()],
resolve: {
dedupe: ["react", "react-dom", "@tanstack/react-query"],
},
},
});

47 changes: 47 additions & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name": "captain-docs",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "astro dev",
"build": "astro build",
"preview": "astro preview",
"check": "astro check"
},
"dependencies": {
"@astrojs/mdx": "^7.0.2",
"@astrojs/react": "^6.0.1",
"@flanksource/clicky-ui": "link:../../clicky-ui/packages/ui",
"@flanksource/icons": "^1.0.60",
"@mdxeditor/editor": "^4.0.4",
"@radix-ui/react-compose-refs": "^1.1.2",
"@radix-ui/react-slot": "^1.1.1",
"@shikijs/langs": "^1.24.0",
"@shikijs/themes": "^1.24.0",
"@shikijs/transformers": "^1.24.0",
"@tailwindcss/vite": "^4.3.2",
"@tanstack/react-query": "^5.90.12",
"ai": "^6.0.199",
"astro": "^7.0.6",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"dompurify": "^3.4.7",
"jotai": "^2.16.0",
"marked": "^17.0.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-rnd": "^10.5.3",
"recharts": "^3.8.1",
"shiki": "^1.24.0",
"streamdown": "^2.5.0",
"tailwind-merge": "^2.6.0",
"tailwindcss": "^4.3.2"
},
"devDependencies": {
"@types/react": "^18.3.28",
"@types/react-dom": "^18.3.7",
"typescript": "~6.0.3"
}
}

Loading
Loading