(define-module (ruther packages node)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (nonguix build-system binary)
#:use-module (nonguix utils)
#:use-module (guix packages)
#:use-module (guix gexp)
#:use-module (guix utils)
#:use-module (guix build-system node)
#:use-module (gnu packages base)
#:use-module (gnu packages gcc)
#:use-module (gnu packages node-xyz)
#:use-module (gnu packages tls)
#:use-module (guix download))
(define-public node-anthropic-ai-claude-code-1.0.72
(package
(name "claude-code")
(version "2.1.9")
(source
(origin
(method url-fetch)
(uri
(string-append "https://registry.npmjs.org/@anthropic-ai/claude-code/-/claude-code-" version ".tgz"))
(sha256
(base32 "0l3r2s64dvcwhnvfw1jaq8dx1lz92q0iygnc9amlzz33206pix6x"))))
(build-system node-build-system)
(arguments
(list
#:tests? #f
#:phases
#~(modify-phases %standard-phases
;; (delete 'build)
(delete 'validate-runpath))))
(home-page "https://github.com/anthropics/claude-code")
(synopsis
"Use Claude, Anthropic's AI assistant, right from your terminal. Claude can understand your codebase, edit files, run terminal commands, and handle entire workflows for you.")
(description
"Use Claude, Anthropic's AI assistant, right from your terminal. Claude can understand your codebase, edit files, run terminal commands, and handle entire workflows for you.")
(license #f)))
(define-public openai-codex
(package
(name "codex")
(version "0.89.0")
(source
(origin
(method url-fetch)
(uri "https://registry.npmjs.org/@openai/codex/-/codex-0.89.0.tgz")
(sha256
(base32 "13nww8bi6ww56nsgccq0ri31p1dz95wkr9dvchdwbqb96zkz53s5"))))
(build-system node-build-system)
(arguments
(list
#:tests? #f
#:phases
#~(modify-phases %standard-phases
(delete 'build)
(delete 'validate-runpath))))
(home-page "https://github.com/openai/codex#readme")
(synopsis
"<p align=\"center\"><code>npm i -g @openai/codex</code><br />or <code>brew install --cask codex</code></p> <p align=\"center\"><strong>Codex CLI</strong> is a coding agent from OpenAI that runs locally on your computer. <p align=\"center\"> <img src=\"./.githu")
(description
"<p align=\"center\"><code>npm i -g @openai/codex</code><br />or <code>brew install --cask codex</code></p> <p align=\"center\"><strong>Codex CLI</strong> is a coding agent from OpenAI that runs locally on your computer. <p align=\"center\"> <img src=\"./.githu")
(license license:asl2.0)))
(define-public codex-acp
(package
(name "codex-acp")
(version "0.9.0")
(source
(origin
(method url-fetch)
(uri
"https://registry.npmjs.org/@zed-industries/codex-acp-linux-x64/-/codex-acp-linux-x64-0.9.0.tgz")
(sha256
(base32 "19jz5psj59jn56vvmhp2b70fx321q11n0n18kj9dfbsx517zf4v0"))))
(build-system node-build-system)
(native-inputs (list (default-patchelf)))
(inputs (list `("openssl" ,openssl)
`("gcc:lib" ,gcc "lib")
`("libc32" ,(to32 glibc))))
(arguments
(list
#:tests? #f
#:imported-modules `((nonguix build binary-build-system)
(nonguix build utils)
,@%node-build-system-modules)
#:modules
'((guix build node-build-system)
(guix build utils)
((nonguix build binary-build-system) #:prefix binary:))
#:phases
#~(modify-phases %standard-phases
(delete 'build)
(add-before 'repack 'patchelf
(lambda* (#:rest args)
(apply
(assoc-ref binary:%standard-phases 'patchelf)
`(#:patchelf-plan
(("bin/codex-acp"
("gcc:lib" "openssl" "libc")))
,@args))))
(add-after 'install 'symlink
(lambda _
(symlink (string-append #$output "/bin/codex-acp-linux-x64")
(string-append #$output "/bin/codex-acp")))))))
(home-page "https://github.com/zed-industries/codex-acp")
(synopsis
"An ACP-compatible coding agent powered by Codex - linux x64 binary")
(description
"An ACP-compatible coding agent powered by Codex - linux x64 binary")
(license license:asl2.0)))