agentVersionIdidentifierrequiredWhat identifies the version, made by the application
Becomes the column agent_version_id of agent_version.
Written at commons/data/models/identity-agent/mod.ts:62
A version of an agent: which model, which prompt and which tools, pinned, so that a bad one can be pulled from every run
Model identityAgent. Written in commons/data/models/identity-agent/mod.ts:59. Identified by agentVersionId.
agentVersionIdidentifierrequiredWhat identifies the version, made by the application
Becomes the column agent_version_id of agent_version.
Written at commons/data/models/identity-agent/mod.ts:62
approvedAtinstantoptionalWhen it was approved
Becomes the column approved_at of agent_version.
Written at commons/data/models/identity-agent/mod.ts:71
codeReftextoptionalThe commit of its code
Becomes the column code_ref of agent_version.
Written at commons/data/models/identity-agent/mod.ts:69
createdAtinstantrequiredWhen it was made
Becomes the column created_at of agent_version.
Written at commons/data/models/identity-agent/mod.ts:72
modelNametextrequiredThe model
Becomes the column model_name of agent_version.
Written at commons/data/models/identity-agent/mod.ts:65
modelProvidertextrequiredWho makes the model
Becomes the column model_provider of agent_version.
Written at commons/data/models/identity-agent/mod.ts:64
modelVersiontextrequiredThe pinned snapshot of the model, never an alias that moves
Becomes the column model_version of agent_version.
Written at commons/data/models/identity-agent/mod.ts:66
promptHashtextrequiredA hash of the system prompt; the prompt is not kept here
Becomes the column prompt_hash of agent_version.
Written at commons/data/models/identity-agent/mod.ts:67
statuscode of versionStatusrequiredWhere the version is
Becomes the column status of agent_version.
Annotations: quality.transitions={"allowed":{"candidate":["approved","revoked"],"approved":["active","retired","revoked"],"active":["retired","revoked"],"retired":["revoked"],"revoked":[]}}
Written at commons/data/models/identity-agent/mod.ts:70
toolManifestHashtextrequiredA hash of the tools it is given
Becomes the column tool_manifest_hash of agent_version.
Written at commons/data/models/identity-agent/mod.ts:68
versionKeytextrequiredA hash of the agent and the label, unique
Becomes the column version_key of agent_version.
Written at commons/data/models/identity-agent/mod.ts:73
versionLabeltextrequiredWhat the version is called, unique for its agent
Becomes the column version_label of agent_version.
Written at commons/data/models/identity-agent/mod.ts:63
agentoneThe agent To agent. Written at commons/data/models/identity-agent/mod.ts:127
approvedByoptionalWho approved it To principal. Written at commons/data/models/identity-agent/mod.ts:59
Projects to the table agent_version with the primary key agent_version_id.
| Column | Type | Null | Role | From |
|---|---|---|---|---|
agent_principal_id | text | false | reference | agentVersion.agent |
agent_version_id | text | false | attribute | agentVersion.agentVersionId |
approved_at | timestamp | true | attribute | agentVersion.approvedAt |
approved_by_principal_id | text | true | reference | agentVersion.approvedBy |
code_ref | text | true | attribute | agentVersion.codeRef |
created_at | timestamp | false | attribute | agentVersion.createdAt |
model_name | text | false | attribute | agentVersion.modelName |
model_provider | text | false | attribute | agentVersion.modelProvider |
model_version | text | false | attribute | agentVersion.modelVersion |
prompt_hash | text | false | attribute | agentVersion.promptHash |
status | text | false | attribute | agentVersion.status |
tool_manifest_hash | text | false | attribute | agentVersion.toolManifestHash |
version_key | text | false | attribute | agentVersion.versionKey |
version_label | text | false | attribute | agentVersion.versionLabel |
CREATE TABLE IF NOT EXISTS "agent_version" (
"agent_version_id" VARCHAR NOT NULL PRIMARY KEY,
"version_label" VARCHAR NOT NULL,
"model_provider" VARCHAR NOT NULL,
"model_name" VARCHAR NOT NULL,
"model_version" VARCHAR NOT NULL,
"prompt_hash" VARCHAR NOT NULL,
"tool_manifest_hash" VARCHAR NOT NULL,
"code_ref" VARCHAR,
"status" VARCHAR NOT NULL,
"approved_at" TIMESTAMPTZ,
"created_at" TIMESTAMPTZ NOT NULL,
"version_key" VARCHAR NOT NULL,
"agent_principal_id" VARCHAR NOT NULL,
"approved_by_principal_id" VARCHAR,
CONSTRAINT "agent_version_agent_principal_id_fk" FOREIGN KEY ("agent_principal_id") REFERENCES "agent" ("principal_id"),
CONSTRAINT "agent_version_approved_by_principal_id_fk" FOREIGN KEY ("approved_by_principal_id") REFERENCES "principal" ("principal_id"),
CONSTRAINT "agent_version_version_key_uq" UNIQUE ("version_key"),
CONSTRAINT "agent_version_status_ck" CHECK ("status" IN ('candidate', 'approved', 'active', 'retired', 'revoked'))
);CREATE TABLE IF NOT EXISTS "agent_version" (
"agent_version_id" TEXT NOT NULL PRIMARY KEY,
"version_label" TEXT NOT NULL,
"model_provider" TEXT NOT NULL,
"model_name" TEXT NOT NULL,
"model_version" TEXT NOT NULL,
"prompt_hash" TEXT NOT NULL,
"tool_manifest_hash" TEXT NOT NULL,
"code_ref" TEXT,
"status" TEXT NOT NULL,
"approved_at" TIMESTAMPTZ,
"created_at" TIMESTAMPTZ NOT NULL,
"version_key" TEXT NOT NULL,
"agent_principal_id" TEXT NOT NULL,
"approved_by_principal_id" TEXT,
CONSTRAINT "agent_version_agent_principal_id_fk" FOREIGN KEY ("agent_principal_id") REFERENCES "agent" ("principal_id"),
CONSTRAINT "agent_version_approved_by_principal_id_fk" FOREIGN KEY ("approved_by_principal_id") REFERENCES "principal" ("principal_id"),
CONSTRAINT "agent_version_version_key_uq" UNIQUE ("version_key"),
CONSTRAINT "agent_version_status_ck" CHECK ("status" IN ('candidate', 'approved', 'active', 'retired', 'revoked'))
);CREATE TABLE IF NOT EXISTS "agent_version" (
"agent_version_id" TEXT NOT NULL PRIMARY KEY,
"version_label" TEXT NOT NULL,
"model_provider" TEXT NOT NULL,
"model_name" TEXT NOT NULL,
"model_version" TEXT NOT NULL,
"prompt_hash" TEXT NOT NULL,
"tool_manifest_hash" TEXT NOT NULL,
"code_ref" TEXT,
"status" TEXT NOT NULL,
"approved_at" TEXT,
"created_at" TEXT NOT NULL,
"version_key" TEXT NOT NULL,
"agent_principal_id" TEXT NOT NULL,
"approved_by_principal_id" TEXT,
CONSTRAINT "agent_version_agent_principal_id_fk" FOREIGN KEY ("agent_principal_id") REFERENCES "agent" ("principal_id"),
CONSTRAINT "agent_version_approved_by_principal_id_fk" FOREIGN KEY ("approved_by_principal_id") REFERENCES "principal" ("principal_id"),
CONSTRAINT "agent_version_version_key_uq" UNIQUE ("version_key"),
CONSTRAINT "agent_version_status_ck" CHECK ("status" IN ('candidate', 'approved', 'active', 'retired', 'revoked'))
);Read and written from TypeScript with the types the model gives: import { agentVersion } from "@intellectual-frontiers/data/sql/typed/models". Generated in commons/data/sql/typed/models/identity-agent.auto.ts: do not edit.
import { from } from "@intellectual-frontiers/data/sql/typed";
import { agentVersion } from "@intellectual-frontiers/data/sql/typed/models";
const rows = await from(agentVersion).select((s) => ({ agentVersionId: s.agentVersion.agentVersionId, versionLabel: s.agentVersion.versionLabel })).run(runner);