Skip to content

Commit b8b96de

Browse files
stubbiclaude
andauthored
feat: spec.adapters.registry -> PAPERCLIP_ADAPTERS (#79)
* feat(crd): add spec.adapters.registry declarative adapter entries Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(operator): emit PAPERCLIP_ADAPTERS from spec.adapters.registry Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * chore(operator): regenerate CRD + chart + deepcopy for adapters.registry Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * docs(operator): regenerate api-reference for adapters.registry (+ pre-existing K8sExecution/PlatformAdmin drift) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 8624cca commit b8b96de

7 files changed

Lines changed: 356 additions & 0 deletions

File tree

api/v1alpha1/paperclipinstance_types.go

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,13 @@ type AdaptersSpec struct {
531531
// in-cluster Kubernetes API.
532532
// +optional
533533
Execution *ExecutionSpec `json:"execution,omitempty"`
534+
535+
// Registry declaratively defines which agent harnesses ("adapters") this
536+
// instance offers and how each is wired. Marshaled to the PAPERCLIP_ADAPTERS
537+
// env var consumed by the server's adapter-registry bootstrap. When empty,
538+
// the server uses its built-in defaults (no PAPERCLIP_ADAPTERS emitted).
539+
// +optional
540+
Registry []AdapterRegistryEntry `json:"registry,omitempty"`
534541
}
535542

536543
// ExecutionSpec configures the agent execution policy enforced by the Paperclip
@@ -602,6 +609,43 @@ type K8sExecutionSpec struct {
602609
NamespacePrefix string `json:"namespacePrefix,omitempty"`
603610
}
604611

612+
// AdapterRegistryEntry is one declarative agent-harness entry. Mirrors the
613+
// server's shared AdapterRegistryEntry shape (packages/shared) and the plugin's
614+
// local copy. Runtime fields are honored only for sandboxed (Kubernetes)
615+
// execution. Keep the json tags in sync with the server zod schema.
616+
type AdapterRegistryEntry struct {
617+
// AdapterType is the harness identifier, e.g. "opencode_local".
618+
// +kubebuilder:validation:MinLength=1
619+
AdapterType string `json:"adapterType"`
620+
621+
// Enabled controls availability in the agent-creation picker. Defaults true.
622+
// +optional
623+
Enabled *bool `json:"enabled,omitempty"`
624+
625+
// RuntimeImage is the container image the agent Job/Sandbox runs (k8s only).
626+
// +optional
627+
RuntimeImage string `json:"runtimeImage,omitempty"`
628+
629+
// EnvKeys are process-env keys forwarded into the agent Job (k8s only),
630+
// e.g. ANTHROPIC_API_KEY.
631+
// +optional
632+
EnvKeys []string `json:"envKeys,omitempty"`
633+
634+
// AllowFQDNs is the egress FQDN allow-list for the agent pod (k8s only).
635+
// +optional
636+
AllowFQDNs []string `json:"allowFqdns,omitempty"`
637+
638+
// ProbeCommand is the adapter liveness/probe command (k8s only).
639+
// +optional
640+
ProbeCommand []string `json:"probeCommand,omitempty"`
641+
642+
// DefaultEnv are NON-SECRET env defaults injected as the base layer for the
643+
// agent Job (process-env secrets override them), e.g. ANTHROPIC_BASE_URL set
644+
// to the in-cluster inference gateway. Never put secrets here.
645+
// +optional
646+
DefaultEnv map[string]string `json:"defaultEnv,omitempty"`
647+
}
648+
605649
// E2BSpec configures the E2B sandbox provider API key.
606650
type E2BSpec struct {
607651
// APIKeySecretRef references a Secret key holding the E2B API key.

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 49 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charts/paperclip-operator/templates/crds/paperclip.inc_instances.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,63 @@ spec:
387387
- any
388388
type: string
389389
type: object
390+
registry:
391+
description: |-
392+
Registry declaratively defines which agent harnesses ("adapters") this
393+
instance offers and how each is wired. Marshaled to the PAPERCLIP_ADAPTERS
394+
env var consumed by the server's adapter-registry bootstrap. When empty,
395+
the server uses its built-in defaults (no PAPERCLIP_ADAPTERS emitted).
396+
items:
397+
description: |-
398+
AdapterRegistryEntry is one declarative agent-harness entry. Mirrors the
399+
server's shared AdapterRegistryEntry shape (packages/shared) and the plugin's
400+
local copy. Runtime fields are honored only for sandboxed (Kubernetes)
401+
execution. Keep the json tags in sync with the server zod schema.
402+
properties:
403+
adapterType:
404+
description: AdapterType is the harness identifier, e.g.
405+
"opencode_local".
406+
minLength: 1
407+
type: string
408+
allowFqdns:
409+
description: AllowFQDNs is the egress FQDN allow-list for
410+
the agent pod (k8s only).
411+
items:
412+
type: string
413+
type: array
414+
defaultEnv:
415+
additionalProperties:
416+
type: string
417+
description: |-
418+
DefaultEnv are NON-SECRET env defaults injected as the base layer for the
419+
agent Job (process-env secrets override them), e.g. ANTHROPIC_BASE_URL set
420+
to the in-cluster inference gateway. Never put secrets here.
421+
type: object
422+
enabled:
423+
description: Enabled controls availability in the agent-creation
424+
picker. Defaults true.
425+
type: boolean
426+
envKeys:
427+
description: |-
428+
EnvKeys are process-env keys forwarded into the agent Job (k8s only),
429+
e.g. ANTHROPIC_API_KEY.
430+
items:
431+
type: string
432+
type: array
433+
probeCommand:
434+
description: ProbeCommand is the adapter liveness/probe
435+
command (k8s only).
436+
items:
437+
type: string
438+
type: array
439+
runtimeImage:
440+
description: RuntimeImage is the container image the agent
441+
Job/Sandbox runs (k8s only).
442+
type: string
443+
required:
444+
- adapterType
445+
type: object
446+
type: array
390447
type: object
391448
auth:
392449
description: Auth configures authentication settings.

config/crd/bases/paperclip.inc_instances.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,63 @@ spec:
381381
- any
382382
type: string
383383
type: object
384+
registry:
385+
description: |-
386+
Registry declaratively defines which agent harnesses ("adapters") this
387+
instance offers and how each is wired. Marshaled to the PAPERCLIP_ADAPTERS
388+
env var consumed by the server's adapter-registry bootstrap. When empty,
389+
the server uses its built-in defaults (no PAPERCLIP_ADAPTERS emitted).
390+
items:
391+
description: |-
392+
AdapterRegistryEntry is one declarative agent-harness entry. Mirrors the
393+
server's shared AdapterRegistryEntry shape (packages/shared) and the plugin's
394+
local copy. Runtime fields are honored only for sandboxed (Kubernetes)
395+
execution. Keep the json tags in sync with the server zod schema.
396+
properties:
397+
adapterType:
398+
description: AdapterType is the harness identifier, e.g.
399+
"opencode_local".
400+
minLength: 1
401+
type: string
402+
allowFqdns:
403+
description: AllowFQDNs is the egress FQDN allow-list for
404+
the agent pod (k8s only).
405+
items:
406+
type: string
407+
type: array
408+
defaultEnv:
409+
additionalProperties:
410+
type: string
411+
description: |-
412+
DefaultEnv are NON-SECRET env defaults injected as the base layer for the
413+
agent Job (process-env secrets override them), e.g. ANTHROPIC_BASE_URL set
414+
to the in-cluster inference gateway. Never put secrets here.
415+
type: object
416+
enabled:
417+
description: Enabled controls availability in the agent-creation
418+
picker. Defaults true.
419+
type: boolean
420+
envKeys:
421+
description: |-
422+
EnvKeys are process-env keys forwarded into the agent Job (k8s only),
423+
e.g. ANTHROPIC_API_KEY.
424+
items:
425+
type: string
426+
type: array
427+
probeCommand:
428+
description: ProbeCommand is the adapter liveness/probe
429+
command (k8s only).
430+
items:
431+
type: string
432+
type: array
433+
runtimeImage:
434+
description: RuntimeImage is the container image the agent
435+
Job/Sandbox runs (k8s only).
436+
type: string
437+
required:
438+
- adapterType
439+
type: object
440+
type: array
384441
type: object
385442
auth:
386443
description: Auth configures authentication settings.

0 commit comments

Comments
 (0)