Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,45 @@ jobs:
cli-unit:
runs-on: ubuntu-latest
timeout-minutes: 15
env:
PTYWRIGHT_ZIG_VERSION: "0.15.2"
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: 22
cache: npm
- run: npm ci
- name: Cache Zig toolchain
uses: actions/cache@v4
with:
path: .dev/tools/zig-x86_64-linux-${{ env.PTYWRIGHT_ZIG_VERSION }}
key: zig-${{ runner.os }}-${{ env.PTYWRIGHT_ZIG_VERSION }}
- name: Install Zig ${{ env.PTYWRIGHT_ZIG_VERSION }}
run: |
set -euo pipefail
ZIG_DIR=".dev/tools/zig-x86_64-linux-${PTYWRIGHT_ZIG_VERSION}"
if [ ! -x "${ZIG_DIR}/zig" ]; then
mkdir -p .dev/tools
curl -fsSL "https://ziglang.org/download/${PTYWRIGHT_ZIG_VERSION}/zig-x86_64-linux-${PTYWRIGHT_ZIG_VERSION}.tar.xz" \
| tar -xJ -C .dev/tools
fi
"${ZIG_DIR}/zig" version
echo "${GITHUB_WORKSPACE}/${ZIG_DIR}" >> "${GITHUB_PATH}"
- name: Cache ptywright native artifacts
uses: actions/cache@v4
with:
path: |
packages/ptywright/.cache
packages/ptywright/native/build
key: ptywright-${{ runner.os }}-${{ hashFiles('packages/ptywright/GHOSTTY_UPSTREAM', 'packages/ptywright/native/**', 'packages/ptywright/scripts/**') }}
- run: npm run build --workspace @onkernel/cua-ai
- run: npm run build --workspace @onkernel/cua-agent
- name: Build ptywright (native binding)
run: npm run build --workspace @onkernel/ptywright
- name: CLI unit tests
env:
PTYWRIGHT_REQUIRED: "1"
run: npm test --workspace @onkernel/cua-cli

integration:
Expand Down
18 changes: 17 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/cua-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
},
"dependencies": {
"@earendil-works/pi-coding-agent": "0.79.1",
"@earendil-works/pi-tui": "0.79.1",
"@mariozechner/pi-agent-core": "0.67.6",
"@mariozechner/pi-ai": "0.67.6",
"@mariozechner/pi-coding-agent": "0.67.6",
Expand Down
34 changes: 34 additions & 0 deletions packages/cua-cli/src/cli-harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ export interface HarnessCliFlags {
resumePicker: boolean;
noSession: boolean;
noSkills: boolean;
debugTui: boolean;
jsonlIncludeDeltas: boolean;
jsonlIncludeImages: boolean;
model?: string;
Expand All @@ -182,6 +183,7 @@ export interface HarnessCliFlags {
maxSteps?: number;
out?: string;
output?: string;
imageProtocol?: string;
namedSession?: string;
sessionRef?: string;
sessionDir?: string;
Expand Down Expand Up @@ -490,6 +492,38 @@ export async function runPrintCommand(prompt: string, flags: HarnessCliFlags): P
}
}

/** Run the interactive TUI through the new harness wiring. */
export async function runInteractiveCommand(
initialPrompt: string,
flags: HarnessCliFlags,
): Promise<number> {
const runtime = await setupHarnessRuntime(flags);
const { runInteractive } = await import("./tui/main");
try {
return await runInteractive({
cwd: process.cwd(),
harness: runtime.harness,
browserHandle: runtime.handle,
session: runtime.session,
skills: runtime.skills,
modelRef: runtime.modelRef,
provider: runtime.provider,
initialPrompt: initialPrompt || undefined,
imageProtocol: flags.imageProtocol,
debugTui: flags.debugTui,
resumed: runtime.resolved?.resumed === true,
transcriptPath: runtime.resolved?.transcriptPath,
skipInitialScreenshot: runtime.resolved?.resumed === true,
});
} finally {
try {
await runtime.handle.close();
} catch (err) {
stderr.write(`[cua] cleanup warning: ${(err as Error).message}\n`);
}
}
}

/** Run a one-shot action subcommand through the new harness wiring. */
export async function runActionCommand(
action: ActionType,
Expand Down
Loading
Loading