Initial commit

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-11 23:08:05 -04:00
commit be7c525063
13 changed files with 2436 additions and 0 deletions
+58
View File
@@ -0,0 +1,58 @@
export const type = "opencode_k8s";
export const label = "OpenCode (Kubernetes)";
export const models = [
{ id: "openai/gpt-5.2-codex", label: "openai/gpt-5.2-codex" },
{ id: "openai/gpt-5.4", label: "openai/gpt-5.4" },
{ id: "openai/gpt-5.2", label: "openai/gpt-5.2" },
{ id: "openai/gpt-5.1-codex-max", label: "openai/gpt-5.1-codex-max" },
{ id: "openai/gpt-5.1-codex-mini", label: "openai/gpt-5.1-codex-mini" },
];
export const agentConfigurationDoc = `# opencode_k8s agent configuration
Adapter: opencode_k8s
Runs OpenCode inside an isolated Kubernetes Job pod instead of the main
Paperclip process. The Job inherits the container image, imagePullSecrets,
DNS config, and PVC from the running Paperclip Deployment automatically.
Core fields:
- model (string, required): OpenCode model id in provider/model format (e.g. anthropic/claude-sonnet-4-6)
- variant (string, optional): provider-specific reasoning/profile variant passed as --variant
- dangerouslySkipPermissions (boolean, optional): inject runtime config with permission.external_directory=allow; defaults to true
- promptTemplate (string, optional): run prompt template
- extraArgs (string[], optional): additional CLI args appended to the opencode command
- env (object, optional): KEY=VALUE environment variables; overrides inherited vars from the Deployment
Kubernetes fields:
- namespace (string, optional): namespace for Jobs; defaults to the Deployment namespace
- image (string, optional): override container image; defaults to the running Deployment image
- imagePullPolicy (string, optional): image pull policy; default "IfNotPresent"
- kubeconfig (string, optional): absolute path to a kubeconfig file on disk; defaults to in-cluster service account auth
- resources (object, optional): { requests: { cpu, memory }, limits: { cpu, memory } }
- nodeSelector (object, optional): node selector for Job pods
- tolerations (array, optional): tolerations for Job pods
- labels (object, optional): extra labels added to Job metadata
- ttlSecondsAfterFinished (number, optional): auto-cleanup delay; default 300
- retainJobs (boolean, optional): skip cleanup on completion for debugging
Operational fields:
- timeoutSec (number, optional): run timeout in seconds; 0 means no timeout
- graceSec (number, optional): additional grace before adapter gives up after Job deadline
Inherited from Deployment (no config needed):
- ANTHROPIC_API_KEY, OPENAI_API_KEY, and other provider keys
- CLAUDE_CODE_USE_BEDROCK, AWS_REGION, AWS_BEARER_TOKEN_BEDROCK
- PAPERCLIP_API_URL
- Container image, imagePullSecrets, DNS config, PVC mount, security context
Notes:
- Session resume works via the shared /paperclip PVC (HOME=/paperclip)
- Skills are bundled in the container image
- Prompts are delivered via a busybox init container writing to an emptyDir volume
- Runtime config (permission.external_directory=allow) is written inside the Job container
- OPENCODE_DISABLE_PROJECT_CONFIG=true is always set to prevent config file pollution
`;
export { createServerAdapter } from "./server/index.js";