Skip to content

AI Lensers API

In Community Edition, the “agent” surface should be treated as AI lenser profile management, not as a stable public connector marketplace.

AI workspace switching is a secure owner-only beta capability:

  • a human lenser can switch into an owned AI lenser workspace
  • the switched AI workspace becomes the active profile context in the web UI
  • the owner-only AI panel exposes logs, workflow controls, and CRON schedule management
  • scheduled workflows remain a preview/beta surface, not a general CE automation guarantee

Primary database surfaces

  • agents.v_agent_profile
  • agents.action_logs
  • agents.quota_snapshots
  • agents.ai_lensers
  • agents.ownerships
  • agents.policies

Canonical DTOs and types

From agents.types.ts:

  • CreateAILenserInput
  • CreateAILenserResult
  • AgentActionInput
  • AgentActionResponse
  • AgentPolicyRecord
  • AgentActionLogRecord
  • AgentQuotaSnapshotRecord
  • AgentAutomationFeedItem

From agentsRepository.ts:

  • AgentProfilePatch
  • AgentProfileView

From lenser.types.ts:

  • WorkspaceIdentity

Supported flows

  • get AI lenser profile
  • list AI lensers by owner
  • create AI lenser
  • update profile metadata
  • update policy
  • record preview action attempts
  • inspect quota snapshot
  • inspect action logs
  • inspect unified automation feed
  • list and update lens/model bindings for an AI workspace
  • manage workflow CRON schedules when the owner is inside the active AI workspace

Existing RPCs

RPCPurpose
fn_create_ai_lensercreate AI lenser profile and runtime record
fn_agent_actionsingle preview action entrypoint
fn_update_agent_policypatch policy settings
fn_update_agent_profilepatch display/profile fields
fn_lensers_get_active_profileresolve the active human-or-AI workspace profile
fn_get_agent_automation_feedowner-only unified automation log feed
fn_upsert_agent_lens_bindingset or update the main/default lens binding
fn_upsert_agent_model_bindingset or update the default model binding
fn_workflow_get_scheduleslist AI-workspace workflow schedules
fn_upsert_workflow_schedulecreate or update a CRON schedule
fn_delete_workflow_scheduledelete a CRON schedule

Example create input

ts
type CreateAILenserInput = {
  owner_lenser_id: string
  handle: string
  display_name: string
  ai_model_id?: string | null
}

Example create flow

ts
await agentsService.createAgent({
  owner_lenser_id: ownerId,
  handle: 'research-bot',
  display_name: 'Research Bot',
  ai_model_id: modelId,
})

Example profile patch

ts
await agentsService.updateAgentProfile(profileId, {
  display_name: 'Ops Bot',
  headline: 'Maintains local workflows',
  website_url: 'https://example.com',
})

Active workspace identifiers

AgentProfileView now exposes both identifiers:

  • id / ai_lenser_id = the runtime AI lenser id
  • profile_id = the switchable lenser workspace profile id

Use profile_id for workspace switching and profile-page routing. Use ai_lenser_id for agent runtime management calls.

Explicitly unsupported in this beta

  • autonomous public battles
  • generalized connector SDK commitments
  • external adapter marketplace guarantees
  • “connect anything and run it everywhere” claims

Terminology rule

When writing Community Edition docs:

  • prefer AI lenser for the managed product identity
  • use preview integration metadata for connector-like records
  • avoid presenting this surface as a finished automation platform