All files / src/objects Agent.tsx

0% Statements 0/0
0% Branches 0/0
0% Functions 0/0
0% Lines 0/0

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136                                                                                                                                                                                                                                                                               
import { AIGenerated, Resource, SystemManaged } from "@/objects/Doc";
 
export interface Agent extends Resource, AIGenerated, SystemManaged {
  name: string;
  description?: string;
  /** Presentation, chosen by the user (or proposed during generative setup):
   *  a name from `AGENT_ICON_REGISTRY` and a key from the accent palette.
   *  Both fall back client-side, so an unknown value is never an error. */
  icon?: string | null;
  accent?: string | null;
  system_prompt: string;
  tools?: Record<string, unknown>[];
  config?: Record<string, unknown>;
  model_id?: string;
  /** Ask structured clarifying questions in chat when a request's scope is
   *  ambiguous, before any work starts. On for new agents. */
  clarify_scope?: boolean;
  /** How much pipeline work each answer does — a key of
   *  `GET /app/agents/cost-profiles`. Thorough unless chosen. */
  cost_profile?: string;
  created_at?: string;
}
 
/** A cost profile an agent may run under (svc-core
 *  `app/util/cost_profiles.py`): how much pipeline work each answer does. */
export interface CostProfileInfo {
  key: string;
  label: string;
  description: string;
  /** Measured on the platform's gold datasets and found to answer as well
   *  as Thorough. One that is not is offered as such, never a default. */
  measured: boolean;
  /** Whether a lighter model does some of the work (Economy). */
  lighter_model?: boolean;
  /** Asked for one agent: which lighter model it would use in this
   *  workspace, or why none (svc-core `services/lighter_model.py`). */
  lighter?: LighterModelPreview | null;
}
 
/** The lighter model a profile would have do an agent's lighter work. */
export interface LighterModelPreview {
  model_id?: string | null;
  model_name?: string | null;
  display_name?: string | null;
  /** Why there is none, in words; absent when there is one. */
  note?: string | null;
}
 
/** A knowledge repository (collection of sources) granted to an agent.
 *  Expanded to its member knowledge bases at inference time. */
export interface AgentRepository {
  agent_id: string;
  repository_id: string;
  config?: Record<string, unknown> | null;
}
 
/** A skillset (bundle of skills) granted to an agent. Expanded to its
 *  member skills at inference time. Skills reach the agent only this way. */
export interface AgentSkillset {
  agent_id: string;
  skillset_id: string;
  config?: Record<string, unknown> | null;
}
 
/** A toolkit (bundle of tools/MCP servers) granted to an agent. Expanded to
 *  its members at inference time. Tools and MCP servers reach the agent
 *  only this way. */
export interface AgentToolkit {
  agent_id: string;
  toolkit_id: string;
  config?: Record<string, unknown> | null;
}
 
export interface ToolEntry {
  name: string;
  description: string;
  category: "general" | "specialist";
  implementation?: string;
  schema?: Record<string, unknown>;
}
 
export interface EffectiveTools {
  general: ToolEntry[];
  specialist: ToolEntry[];
}
 
export interface AgentMemory {
  id: string;
  user_id: string;
  external_agent_id: string | null;
  conversation_id: string | null;
  memory_key: string;
  content: string;
  created_at: string;
  /** svc-ai `MemoryKind`: one turn, or something kept from the person's own
   *  words (`evidence`). Absent on responses from before kinds. */
  kind?: string;
  evidence?: string | null;
  workspace?: string | null;
  /** A temporary memory's end; recall leaves it out afterwards. */
  expires_at?: string | null;
  /** Replaced by a correction, and when. */
  superseded_at?: string | null;
  superseded_by?: string | null;
  confirmed_at?: string | null;
  recall_count?: number;
  last_recalled_at?: string | null;
}
 
/** One kind of what an agent draws on (svc-core `services/agent_context`):
 *  its knowledge by kind, or one of the five that belong to other features. */
export interface AgentContextKind {
  key: string;
  label: string;
  description: string;
  owner: string;
  owner_label: string;
  /** `present`, `missing`, or `unavailable` when svc-ai could not say. */
  state: string;
  summary: string;
  facts: { label: string; value: string }[];
  /** Where to change it: a tab of the agent's page, or another page. */
  place?: { kind: "tab" | "page" | string; target: string } | null;
  /** The knowledge category, for the three knowledge kinds. */
  category?: string | null;
  /** A missing kind of knowledge: built-in repositories of that kind it
   *  could be granted, best match for the agent first. */
  suggestions?: { id: string; name: string; description: string }[];
}
 
/** `GET /agents/{id}/knowledge-kinds`. */
export interface AgentContext {
  agent_id: string;
  kinds: AgentContextKind[];
}