All files / src/objects Doc.tsx

100% Statements 2/2
100% Branches 0/0
100% Functions 1/1
100% Lines 2/2

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                                                                                                  39x   1433x  
export interface Doc {
  id: string;
}
 
export interface Resource extends Doc {
  owner_user_id?: string | null;
  owner_organisation_id?: string | null;
  owner_project_id?: string | null;
  /** Why it is in the workspace it was listed in (svc-core `_WorkspaceTag`):
   *  its own, inherited from the project's parent, required by the parent
   *  (a rule), or built in. Set on lists that name a workspace. */
  origin?: "own" | "inherited" | "required" | "built_in" | null;
  /** The key of the workspace that owns it; null for a built-in. */
  home_workspace?: string | null;
}
 
/**
 * AI-generation provenance, set when a resource was created by a generative
 * flow rather than by hand.
 *
 * The three fields answer three different questions and none replaces
 * another — see CLAUDE.md, *Resource History & Generative Provenance*:
 * whether it was generated, which invocation produced it, and which agent
 * that invocation was building when this resource is a dependent of one.
 */
export interface AIGenerated {
  is_ai_generated?: boolean;
  /** The invocation that produced it — resolves through
   *  `GET /app/generations/{id}` to the flow, arguments and model behind it. */
  generation_id?: string | null;
  /** The agent whose generative setup created this resource (dependents only). */
  generated_by_agent_id?: string | null;
}
 
/**
 * Platform-managed resources: CHAINR Bot, the user guide it answers from, the
 * built-in skillsets and their skills, the gold datasets, the News repository
 * and the built-in rules.
 *
 * Readable by every user and changeable by none — the API refuses every
 * write with 403 — so a surface that finds `is_system` renders the resource
 * read-only and apart from what the user built, never with edit or delete
 * controls that could only fail.
 */
export interface SystemManaged {
  is_system?: boolean;
}
 
/** Whether `resource` is platform-managed (see {@link SystemManaged}). */
export const isSystemManaged = (
  resource: SystemManaged | null | undefined,
): boolean => resource?.is_system === true;