Skip to content
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ node_modules/

# Build output
dist/
result/

# Platform binaries (built, not committed)
packages/*/bin/oh-my-opencode
Expand Down
59 changes: 59 additions & 0 deletions flake.lock

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

127 changes: 127 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
{
description = "The Best AI Agent Harness - Batteries-Included OpenCode Plugin";

inputs = {
nixpkgs.url = "nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};

outputs =
{
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
packageJson = builtins.fromJSON (builtins.readFile ./package.json);
version = packageJson.version;

node_modules = pkgs.stdenvNoCC.mkDerivation {
name = "oh-my-opencode-node_modules-${version}";
src = pkgs.lib.fileset.toSource {
root = ./.;
fileset = pkgs.lib.fileset.unions [
./package.json
./bun.lock
];
};

nativeBuildInputs = with pkgs; [
bun
cacert
];

buildPhase = ''
export HOME=$(mktemp -d)
export BUN_INSTALL_CACHE_DIR=$(mktemp -d)
bun install --no-progress --ignore-scripts
'';

installPhase = ''
mkdir -p $out
cp -r node_modules $out/
'';

outputHashMode = "recursive";
outputHashAlgo = "sha256";
outputHash = "sha256-KcJmtWLVcJvazLs+Ffb8HWju0pwVlLZHCWQIuzaIeXQ=";
};
in
{
packages.node_modules = node_modules;

packages.oh-my-opencode = pkgs.stdenvNoCC.mkDerivation {
pname = "oh-my-opencode";
inherit version;
src = self;

nativeBuildInputs =
with pkgs;
[
bun
nodejs_24
makeWrapper
autoPatchelfHook
]
++ (with pkgs.nodePackages; [ typescript ]);

buildInputs = with pkgs; [
pkgs.stdenv.cc.cc.lib
];

autoPatchelfIgnoreMissingDeps = [
"libc.musl-x86_64.so.1"
"libc.musl-aarch64.so.1"
];

buildPhase = ''
cp -r ${node_modules}/node_modules .
chmod -R u+w node_modules
patchShebangs node_modules/
export HOME=$(mktemp -d)
bun run build
'';

installPhase = ''
mkdir -p $out/lib/oh-my-opencode
mkdir -p $out/bin

cp -r dist $out/lib/oh-my-opencode/
cp -r node_modules $out/lib/oh-my-opencode/
cp package.json $out/lib/oh-my-opencode/

makeWrapper ${pkgs.bun}/bin/bun $out/bin/oh-my-opencode \
--add-flags "$out/lib/oh-my-opencode/dist/cli/index.js" \
--prefix PATH : ${
pkgs.lib.makeBinPath [
pkgs.bun
pkgs.nodejs_24
]
}
'';

meta = with pkgs.lib; {
description = "The Best AI Agent Harness - Batteries-Included OpenCode Plugin";
homepage = "https://github.com/code-yeongyu/oh-my-opencode";
license = licenses.unfree; # SUL-1.0
platforms = platforms.linux ++ platforms.darwin;
};
};

packages.default = self.packages.${pkgs.stdenv.hostPlatform.system}.oh-my-opencode;

devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
bun
nodejs_24
];
};
}
);
}
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,7 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
);

ralphLoop.startLoop(sessionID, prompt, {
ultrawork: true,
maxIterations: maxIterMatch
? parseInt(maxIterMatch[1], 10)
: undefined,
Expand Down