Types

Every entity in Aeontel as a TypeScript type. Field shapes, constraints, and back-references to the methods that consume them.

Every entity in Aeontel as a TypeScript type. Field shapes, constraints, and back-references to the methods that consume them.

All

id is a prefixed entity ID (agt*, fun*, swm*, wfl*) — the handler detects the entity type from the prefix. input defaults to { text: string } but accepts any JSON object when the entity defines a custom input schema.

Spec: docs/endpoints.md §6.

  • EndpointHandlerType — The EndpointHandlerType entity.
  • Event — The flat audit-log row, as stored in the event table.

Producers (services) emit events via logEvent — those calls are type-narrowed against the EventInput discriminated union in packages/services/src/events.ts, so each variant's data shape is type-checked at the call site. This schema is the consumer shape: what GET /api/events returns. data is delivered as opaque JSON; clients discriminate on type and parse data per the catalogue in docs/events.md.

Subject type isn't stored separately — the subjectId prefix encodes it (agt_… = agent, wsp_… = workspace, …). Use detectEntityType from @aeontel/shared to recover it.

  • ExecuteSqlBody — The ExecuteSqlBody entity.
  • ExtractGraphBody — Request body for a Graph operation.
  • File — File — unified content entity. Every piece of user content (document, image, video, anything) is a file row. Image and video specializations live in side tables and are surfaced via the filtered image/video convenience endpoints.

Multipart upload state is inline on the file row (r2MultipartId, parts, etc.) and null once status = "ready".

  • FileStatus — FileStatus — lifecycle state of a file row.

  • uploading — multipart upload is in progress, bytes not all written

  • ready — upload finalized, bytes in R2, mime sniffed

  • error — terminal failure (upload, mime mismatch, R2 error, etc.)

  • FileUploadPart — The FileUploadPart entity.

  • Function — The Function entity.

  • FunctionFile — A single source file belonging to a function version. A function version captures the full file set at the moment it was saved; the run worker materialises these into a Worker Loader bundle on demand and compiles TS/JS sources in-isolate via @cloudflare/worker-bundler.

Files reference only versionId; reach the function via functionVersion.functionId.

The url field is derived at read time from the CF Images account hash and the cfImageId, signed with a short-lived JWT if signing is configured.

Same primitive for docs, runbooks, knowledge base entries (kind "page", tree-structured via parentId), and dashboards (kind "dashboard", flat list on the workspace home). Only kind and surface differ; the data model does not.

body is MDX text. Element tags (<Table …/>, <Chart …/>) resolve to the workspace's Element registry at render time; unknown tags render as inline error cards, not crashes.

  • PageKind — Discriminates flat dashboards (workspace home) from tree-structured pages.
  • Permission — Permission — universal per-entity ACL grant. Binds (subject, entity, tier).

The caller's effective tier on an entity is the max of:

  • global admin bypass
  • workspace-member default tier
  • direct user grant
  • team grants where the caller is a member
  • org grants where the caller is a member of the parent org
  • public grants (any authenticated user)

Soft-delete semantics: revoke = soft-delete (permission.revoked), restore within retention = permission.restored, hard-delete past retention = permission.purged. Soft-deleted grants are filtered out of every effective-tier query so a revoked grant cannot grant access even momentarily — same precedent as verifyApiKey.

Both entityId and subjectId are polymorphic. The type is encoded in the ID prefix; clients call detectEntityType to label them.

displayName is required for visitors (they have no other human-readable identity) and optional as a cache for the rest.

Transcoding is async inside CF. The row starts in processing and lazy-reconciles to ready/error on subsequent GET /api/videos/:id calls (the service hits CF Stream's status API and updates the row).