Skip to content

The open-source agent harness - the runtime layer that turns an LLM into a working agent.

1.0 KB
Raw Blame
'use client';

import type { AgentSpec } from '../../server/types.js';
import { useSlot } from '../../theme/SlotsProvider.js';

export type AgentRuntimeEditorContentProps = {
  spec: AgentSpec;
  sandboxAvailable: boolean;
  webSearchAvailable?: boolean;
  onChange: (spec: AgentSpec) => void;
};

export function AgentRuntimeEditorContent({
  spec,
  sandboxAvailable,
  webSearchAvailable = false,
  onChange,
}: AgentRuntimeEditorContentProps) {
  const AgentRuntimeConfigFields = useSlot('AgentRuntimeConfigFields');

  return (
    <div className="w-full p-5">
      <AgentRuntimeConfigFields
        value={spec.config ?? {}}
        sandboxAvailable={sandboxAvailable}
        webSearchAvailable={webSearchAvailable}
        hasSkills={(spec.skills?.length ?? 0) > 0}
        layout="detailed"
        onChange={config => onChange({ ...spec, config })}
      />
    </div>
  );
}

declare module '../../theme/SlotsProvider.js' {
  interface AtomSlots {
    AgentRuntimeEditorContent: typeof AgentRuntimeEditorContent;
  }
}