@standards/schema 1.0.0-alpha.403 → 1.0.0-alpha.405

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
1
 
2
2
  import { SchemaError, SchemaErrorCode, ValidationError } from "./exceptions-RCZEE1uQ.mjs";
3
3
  import { TenantId, Uuid } from "./utils-C8viP5ET.mjs";
4
- import { DocumentLayout, ImageShape, ListViewTabVisibility, ObjectDefinition, ObjectImage, ObjectRecord, RecordAppearance, ResourceVisibility, Timestamps, ViewerAccess } from "./objects-Dmn8ZIXZ.mjs";
4
+ import { DocumentLayout, ImageShape, ListViewTabVisibility, ObjectDefinition, ObjectImage, ObjectRecord, RecordAppearance, ResourceVisibility, Timestamps, ViewerAccess } from "./objects-Dmb_qLPW.mjs";
5
5
  import { Attribute, AttributeType, BilateralConfig, CheckboxAttribute, Currency, CurrencyAttribute, DateAttribute, DatePrecision, DateRangeValue, DocumentAttribute, FormulaAttribute, FormulaReturnType, Location, LocationAttribute, LocationGranularity, MultiRelationAttribute, MultiselectAttribute, NumberAttribute, Option, Phone, PhoneAttribute, PropertyAttribute, PropertySchema, RelationAttribute, RelationTarget, RichtextAttribute, RollupAttribute, RollupFunction, SelectAttribute, SingleRelationAttribute, StatusAttribute, TextAttribute, TimeFormat, UserAttribute, UserReferenceType } from "./attributes-CAYOHQLt.mjs";
6
- import { ActivityContentDefinition, BLOCK_PERIODS, BlockContext, BlockDefinition, BlockInput, BlockWidth, CollectionAction, CollectionContentDefinition, CollectionContentSource, ColumnReference, ContentConfiguration, ContentCreateMode, ContentField, ContentFieldGroup, ContentOpenMode, ContentViewContext, ContentViewDefinition, CustomContentDefinition, DocumentsContentDefinition, DynamicValue, Eager, EmailsContentDefinition, FilterOperator, FilterRule, FilterState, FilterValue, FormContentDefinition, FormDensity, FormsContentDefinition, GridPosition, GridViolation, HeightMode, InferAttributeValue, InferQualifiedProps, InputShape, LayoutTraits, ListableBlockInput, MeetingsContentDefinition, ObjectBuilderLike, ObjectViewContext, ObjectViewDefinition, PageContentDefinition, PageViewDefinition, QualifiedDocumentAttributeBuilder, QualifiedDocumentBrand, RecordMetadata, RecordQuery, RecordQueryDefinition, RelativeDateValue, RichtextContentDefinition, SortRule, ViewContentDefinition, WithCustomAttributes, WithCustomRecordAttributes, WithoutSystemFields } from "./all-Y3tO-bfa.mjs";
7
- import { UpdateObjectInput } from "./index-ColQV1OG.mjs";
6
+ import { ActivityContentDefinition, BLOCK_PERIODS, BlockContext, BlockDefinition, BlockInput, BlockWidth, CollectionAction, CollectionContentDefinition, CollectionContentSource, ColumnReference, ContentConfiguration, ContentCreateMode, ContentField, ContentFieldGroup, ContentOpenMode, ContentViewContext, ContentViewDefinition, CustomContentDefinition, DocumentsContentDefinition, DynamicValue, Eager, EmailsContentDefinition, FilterOperator, FilterRule, FilterState, FilterValue, FormContentDefinition, FormDensity, FormsContentDefinition, GridPosition, GridViolation, HeightMode, InferAttributeValue, InferQualifiedProps, InputShape, LayoutTraits, ListableBlockInput, MeetingsContentDefinition, ObjectBuilderLike, ObjectViewContext, ObjectViewDefinition, PageContentDefinition, PageViewDefinition, QualifiedDocumentAttributeBuilder, QualifiedDocumentBrand, RecordMetadata, RecordQuery, RecordQueryDefinition, RelativeDateValue, RichtextContentDefinition, SortRule, ViewContentDefinition, WithCustomAttributes, WithCustomRecordAttributes, WithoutSystemFields } from "./all-Biqbc9qo.mjs";
7
+ import { UpdateObjectInput } from "./index-DL2EgSvl.mjs";
8
8
  import * as z$2 from "zod";
9
9
  import z, { z as z$1 } from "zod";
10
10
  import { ColorId, CountryIso3, CurrencyCode, IconName, MimeType } from "@standards/constants";
@@ -327,6 +327,13 @@ export declare const PERMISSION_CATALOG: readonly [{
327
327
  readonly id: "use";
328
328
  readonly add: readonly ["create"];
329
329
  }];
330
+ }, {
331
+ readonly id: "supervision";
332
+ readonly resources: readonly ["supervision"];
333
+ readonly levels: readonly [{
334
+ readonly id: "use";
335
+ readonly add: readonly ["create"];
336
+ }];
330
337
  }];
331
338
  }, {
332
339
  readonly id: "files";
@@ -3901,6 +3908,14 @@ export type AgentSessionMode = "interactive" | "autonomous";
3901
3908
  */
3902
3909
  export declare const AGENT_SESSION_LIST_ORDERS: readonly ["createdAt", "lastActivity"];
3903
3910
  export type AgentSessionListOrder = (typeof AGENT_SESSION_LIST_ORDERS)[number];
3911
+ /**
3912
+ * Whose conversations a session list reads (spec 2026-10-27 §4.4). `mine` is
3913
+ * everyone's own history, the default and the access clause as ever. `shared`
3914
+ * is the root conversations shared with the caller. `team` is every root
3915
+ * conversation of the tenant, for a holder of `supervision` only (403 else).
3916
+ */
3917
+ export declare const AGENT_SESSION_PROVENANCES: readonly ["mine", "shared", "team"];
3918
+ export type AgentSessionProvenance = (typeof AGENT_SESSION_PROVENANCES)[number];
3904
3919
  /** Whether a class of tool call is confirmed by a human or executed straight away. */
3905
3920
  export type ApprovalMode = "ask" | "auto";
3906
3921
  /**
@@ -4107,6 +4122,26 @@ export interface AgentTriggerDefinition {
4107
4122
  createdAt: Date;
4108
4123
  updatedAt: Date;
4109
4124
  }
4125
+ /** Who a routine in audience mode runs for (spec 2026-10-27 §4.2). */
4126
+ export interface RoutineAudience {
4127
+ /** Every member of the workspace. */
4128
+ workspace: boolean;
4129
+ roleIds: string[];
4130
+ actorIds: string[];
4131
+ }
4132
+ /** Why a person is in a routine audience; the most specific reason wins: the armer, then a named person, a role, the whole workspace. */
4133
+ export type RoutineAudienceSource = "workspace" | `role:${string}` | "direct" | "armer";
4134
+ /** One person a supervised audience resolves to, with why. */
4135
+ export interface RoutineAudienceMember {
4136
+ actorId: string;
4137
+ source: RoutineAudienceSource;
4138
+ }
4139
+ /** `GET /agents/definitions/:id/audience/preview`: the audience resolved now (spec 2026-10-27 §5). */
4140
+ export interface RoutineAudiencePreview {
4141
+ people: Array<RoutineAudienceMember & {
4142
+ missingConnections: string[];
4143
+ }>;
4144
+ }
4110
4145
  export interface AgentSchedule {
4111
4146
  cron: string;
4112
4147
  timezone?: string;
@@ -4118,6 +4153,8 @@ export interface AgentSchedule {
4118
4153
  * routine. Writes that replace the schedule keep it when they omit it.
4119
4154
  */
4120
4155
  runFor?: "armer" | "audience";
4156
+ /** Read only when `runFor === "audience"`: absent keeps the people the routine is shared with. */
4157
+ audience?: RoutineAudience;
4121
4158
  /**
4122
4159
  * Whether an occurrence continues the conversation the last one opened
4123
4160
  * (#5719), under the guards of a threaded trigger fire (#4914): `true`
@@ -4283,6 +4320,12 @@ export interface AgentDefinition {
4283
4320
  scheduleNextRunAt?: Date;
4284
4321
  /** Read-only, computed for the reader by the query (spec 2026-10-08 §4.4). */
4285
4322
  viewerAccess?: ViewerAccess;
4323
+ /**
4324
+ * Read-only, computed for the reader by the query: one of their actors is a
4325
+ * person the supervised audience resolves to, its armer counted (spec
4326
+ * 2026-10-27 §4.2, the fan-out's own membership definition).
4327
+ */
4328
+ viewerInAudience?: boolean;
4286
4329
  /** Read-only: the number of manual grants on a private definition (0 on a workspace one). */
4287
4330
  sharedWithCount?: number;
4288
4331
  /** The harness that drives it; absent = the Standards engine (environments spec §1.4). */
@@ -4410,6 +4453,34 @@ export interface AgentSession {
4410
4453
  environmentId?: string;
4411
4454
  /** Server-managed resume state of the harness (its own session id and the like). */
4412
4455
  harnessState?: unknown;
4456
+ /**
4457
+ * Set only on a read that reached the conversation past its definition's
4458
+ * visibility (supervision, spec 2026-10-27 §4.4) and on every row of a
4459
+ * `shared` or `team` list: the definition's name and face, never its
4460
+ * configuration. Absent when the reader may open the conversation itself
4461
+ * (a `mine` list), or when the definition is gone.
4462
+ */
4463
+ definitionAppearance?: AgentSessionDefinitionAppearance;
4464
+ /**
4465
+ * Set when the reader reached another person's conversation through the
4466
+ * read clause (a share of its root, or supervision; spec 2026-10-27 §4.4),
4467
+ * on one session's read and on each such row of a `shared` or `team` list,
4468
+ * whatever its definition. A supervised read is audited, so a client reads
4469
+ * such a session once per open and never writes to it.
4470
+ */
4471
+ readThrough?: true;
4472
+ /**
4473
+ * Set only on the rows of a `lastActivity` list: this row's keyset position,
4474
+ * opaque. The last row's, passed back as `cursor`, reads the next page.
4475
+ */
4476
+ listCursor?: string;
4477
+ }
4478
+ /** What a conversation's reader learns of a definition it cannot see. */
4479
+ export interface AgentSessionDefinitionAppearance {
4480
+ name: string;
4481
+ kind: AgentDefinitionKind;
4482
+ label?: string;
4483
+ avatar?: AgentAvatar;
4413
4484
  }
4414
4485
  /**
4415
4486
  * Lifecycle of a persisted tool part. The three `approval-*` values are the
@@ -4725,6 +4796,12 @@ export interface AgentSessionHistoryPage {
4725
4796
  nextCursor: string | null;
4726
4797
  hasMore: boolean;
4727
4798
  committedSeq: number;
4799
+ /**
4800
+ * The session's state as of this page. A reader of another person's
4801
+ * conversation (spec 2026-10-27 §4.4) has no stream and reads the session
4802
+ * row once per open: this is how its view learns a turn started or ended.
4803
+ */
4804
+ sessionState?: SessionState;
4728
4805
  }
4729
4806
  /** Canonical persisted-message order: creation time ASC, then id ASC. */
4730
4807
  export declare function compareAgentSessionMessages(left: Pick<AgentSessionMessage, "createdAt" | "id">, right: Pick<AgentSessionMessage, "createdAt" | "id">): number;
@@ -7725,12 +7802,12 @@ export interface EnvironmentList {
7725
7802
  /**
7726
7803
  * Type of resource that can be audited
7727
7804
  */
7728
- export declare const AUDIT_RESOURCE_TYPES: readonly ["record", "object", "attribute", "view", "user", "role", "settings", "file", "agent", "bundle", "tenant_invitation", "api_key"];
7805
+ export declare const AUDIT_RESOURCE_TYPES: readonly ["record", "object", "attribute", "view", "user", "role", "settings", "file", "agent", "bundle", "tenant_invitation", "api_key", "agent_session"];
7729
7806
  export type AuditResourceType = (typeof AUDIT_RESOURCE_TYPES)[number];
7730
7807
  /**
7731
7808
  * Actions that can be audited
7732
7809
  */
7733
- export declare const AUDIT_ACTIONS: readonly ["record.created", "record.updated", "record.deleted", "record.restored", "record.purged", "record.access_changed", "agent.access_changed", "object.created", "object.updated", "object.deleted", "attribute.created", "attribute.updated", "attribute.deleted", "view.created", "view.updated", "view.deleted", "bundle.synced", "bundle.removed", "bundle.added", "user.created", "user.invited", "user.updated", "user.deleted", "user.login", "user.logout", "tenant_invitation.created", "tenant_invitation.delivery_failed", "tenant_invitation.resent", "tenant_invitation.revoked", "tenant_invitation.accepted", "role.created", "role.updated", "role.deleted", "role.assigned", "role.revoked", "api_key.detached", "settings.updated", "file.uploaded", "file.updated", "file.deleted"];
7810
+ export declare const AUDIT_ACTIONS: readonly ["record.created", "record.updated", "record.deleted", "record.restored", "record.purged", "record.access_changed", "agent.access_changed", "agent_session.supervised_read", "object.created", "object.updated", "object.deleted", "attribute.created", "attribute.updated", "attribute.deleted", "view.created", "view.updated", "view.deleted", "bundle.synced", "bundle.removed", "bundle.added", "user.created", "user.invited", "user.updated", "user.deleted", "user.login", "user.logout", "tenant_invitation.created", "tenant_invitation.delivery_failed", "tenant_invitation.resent", "tenant_invitation.revoked", "tenant_invitation.accepted", "role.created", "role.updated", "role.deleted", "role.assigned", "role.revoked", "api_key.detached", "settings.updated", "file.uploaded", "file.updated", "file.deleted"];
7734
7811
  export type AuditAction = (typeof AUDIT_ACTIONS)[number];
7735
7812
  /**
7736
7813
  * Actor type - who performed the action
@@ -13920,6 +13997,27 @@ export type AgentSessionLink = {
13920
13997
  sessionId: string;
13921
13998
  };
13922
13999
  //#endregion
14000
+ //#region src/utils/agent-session-list-cursor.d.ts
14001
+ /**
14002
+ * The keyset position of a session in a `lastActivity` list (spec 2026-10-27
14003
+ * §4.4): its activity instant and its id, the list's two sort keys. The server
14004
+ * issues it on every row of such a list (`AgentSession.listCursor`); a client
14005
+ * passes the last row's back as `cursor` and never reads inside it.
14006
+ *
14007
+ * `at` keeps the store's own precision (Postgres stamps to the microsecond):
14008
+ * a cursor rebuilt from a JS `Date` would round it to the millisecond and skip
14009
+ * the rows written later in that millisecond.
14010
+ */
14011
+ export interface AgentSessionListPosition {
14012
+ /** ISO-8601 UTC instant, `Z`-suffixed, up to six fractional digits. */
14013
+ at: string;
14014
+ id: string;
14015
+ }
14016
+ /** ASCII only (an instant and a uuid), so `btoa` serves both Node and the browser. */
14017
+ export declare function encodeAgentSessionListCursor(position: AgentSessionListPosition): string;
14018
+ /** The position a cursor encodes, or `null` for anything the server never issued. */
14019
+ export declare function decodeAgentSessionListCursor(cursor: string): AgentSessionListPosition | null;
14020
+ //#endregion
13923
14021
  //#region src/validators/agent-message.schema.d.ts
13924
14022
  type AgentDataChunkOptions = {
13925
14023
  id?: string;
@@ -15005,6 +15103,11 @@ export declare const agentScheduleSchema: z$2.ZodObject<{
15005
15103
  armer: "armer";
15006
15104
  audience: "audience";
15007
15105
  }>>;
15106
+ audience: z$2.ZodOptional<z$2.ZodObject<{
15107
+ workspace: z$2.ZodBoolean;
15108
+ roleIds: z$2.ZodArray<z$2.ZodUUID>;
15109
+ actorIds: z$2.ZodArray<z$2.ZodUUID>;
15110
+ }, z$2.core.$strip>>;
15008
15111
  continueConversation: z$2.ZodOptional<z$2.ZodBoolean>;
15009
15112
  }, z$2.core.$strip>;
15010
15113
  /** `event.thread_ts`: names joined by single dots, no empty segment (#4914). */
@@ -1,5 +1,5 @@
1
1
 
2
- import { ObjectDefinition } from "./objects-Dmn8ZIXZ.mjs";
2
+ import { ObjectDefinition } from "./objects-Dmb_qLPW.mjs";
3
3
  import { Attribute } from "./attributes-CAYOHQLt.mjs";
4
4
  import { ValidationMessages, ValidationResult } from "./index-CiKELB3w.mjs";
5
5
  import * as z$2 from "zod";
@@ -1,5 +1,5 @@
1
1
 
2
- import { ObjectImage, RecordAppearance } from "./objects-Dmn8ZIXZ.mjs";
2
+ import { ObjectImage, RecordAppearance } from "./objects-Dmb_qLPW.mjs";
3
3
  import { Attribute, AttributeType } from "./attributes-CAYOHQLt.mjs";
4
4
  import * as z$2 from "zod";
5
5
  import { ColorId, IconName } from "@standards/constants";
@@ -1,10 +1,10 @@
1
1
 
2
2
  import { SchemaError, SchemaErrorCode, ValidationError } from "./exceptions-RCZEE1uQ.js";
3
3
  import { TenantId, Uuid } from "./utils-Brab7BhE.js";
4
- import { DocumentLayout, ImageShape, ListViewTabVisibility, ObjectDefinition, ObjectImage, ObjectRecord, RecordAppearance, ResourceVisibility, Timestamps, ViewerAccess } from "./objects-Dc4zYk9o.js";
4
+ import { DocumentLayout, ImageShape, ListViewTabVisibility, ObjectDefinition, ObjectImage, ObjectRecord, RecordAppearance, ResourceVisibility, Timestamps, ViewerAccess } from "./objects-B8-0pVuJ.js";
5
5
  import { Attribute, AttributeType, BilateralConfig, CheckboxAttribute, Currency, CurrencyAttribute, DateAttribute, DatePrecision, DateRangeValue, DocumentAttribute, FormulaAttribute, FormulaReturnType, Location, LocationAttribute, LocationGranularity, MultiRelationAttribute, MultiselectAttribute, NumberAttribute, Option, Phone, PhoneAttribute, PropertyAttribute, PropertySchema, RelationAttribute, RelationTarget, RichtextAttribute, RollupAttribute, RollupFunction, SelectAttribute, SingleRelationAttribute, StatusAttribute, TextAttribute, TimeFormat, UserAttribute, UserReferenceType } from "./attributes-BOIIZZpP.js";
6
- import { ActivityContentDefinition, BLOCK_PERIODS, BlockContext, BlockDefinition, BlockInput, BlockWidth, CollectionAction, CollectionContentDefinition, CollectionContentSource, ColumnReference, ContentConfiguration, ContentCreateMode, ContentField, ContentFieldGroup, ContentOpenMode, ContentViewContext, ContentViewDefinition, CustomContentDefinition, DocumentsContentDefinition, DynamicValue, Eager, EmailsContentDefinition, FilterOperator, FilterRule, FilterState, FilterValue, FormContentDefinition, FormDensity, FormsContentDefinition, GridPosition, GridViolation, HeightMode, InferAttributeValue, InferQualifiedProps, InputShape, LayoutTraits, ListableBlockInput, MeetingsContentDefinition, ObjectBuilderLike, ObjectViewContext, ObjectViewDefinition, PageContentDefinition, PageViewDefinition, QualifiedDocumentAttributeBuilder, QualifiedDocumentBrand, RecordMetadata, RecordQuery, RecordQueryDefinition, RelativeDateValue, RichtextContentDefinition, SortRule, ViewContentDefinition, WithCustomAttributes, WithCustomRecordAttributes, WithoutSystemFields } from "./all-o498zQ_Z.js";
7
- import { UpdateObjectInput } from "./index-BsOZnVmp.js";
6
+ import { ActivityContentDefinition, BLOCK_PERIODS, BlockContext, BlockDefinition, BlockInput, BlockWidth, CollectionAction, CollectionContentDefinition, CollectionContentSource, ColumnReference, ContentConfiguration, ContentCreateMode, ContentField, ContentFieldGroup, ContentOpenMode, ContentViewContext, ContentViewDefinition, CustomContentDefinition, DocumentsContentDefinition, DynamicValue, Eager, EmailsContentDefinition, FilterOperator, FilterRule, FilterState, FilterValue, FormContentDefinition, FormDensity, FormsContentDefinition, GridPosition, GridViolation, HeightMode, InferAttributeValue, InferQualifiedProps, InputShape, LayoutTraits, ListableBlockInput, MeetingsContentDefinition, ObjectBuilderLike, ObjectViewContext, ObjectViewDefinition, PageContentDefinition, PageViewDefinition, QualifiedDocumentAttributeBuilder, QualifiedDocumentBrand, RecordMetadata, RecordQuery, RecordQueryDefinition, RelativeDateValue, RichtextContentDefinition, SortRule, ViewContentDefinition, WithCustomAttributes, WithCustomRecordAttributes, WithoutSystemFields } from "./all-BLtv6oP5.js";
7
+ import { UpdateObjectInput } from "./index-DkKyC4KB.js";
8
8
  import * as z$2 from "zod";
9
9
  import z, { z as z$1 } from "zod";
10
10
  import { ColorId, CountryIso3, CurrencyCode, IconName, MimeType } from "@standards/constants";
@@ -327,6 +327,13 @@ export declare const PERMISSION_CATALOG: readonly [{
327
327
  readonly id: "use";
328
328
  readonly add: readonly ["create"];
329
329
  }];
330
+ }, {
331
+ readonly id: "supervision";
332
+ readonly resources: readonly ["supervision"];
333
+ readonly levels: readonly [{
334
+ readonly id: "use";
335
+ readonly add: readonly ["create"];
336
+ }];
330
337
  }];
331
338
  }, {
332
339
  readonly id: "files";
@@ -3901,6 +3908,14 @@ export type AgentSessionMode = "interactive" | "autonomous";
3901
3908
  */
3902
3909
  export declare const AGENT_SESSION_LIST_ORDERS: readonly ["createdAt", "lastActivity"];
3903
3910
  export type AgentSessionListOrder = (typeof AGENT_SESSION_LIST_ORDERS)[number];
3911
+ /**
3912
+ * Whose conversations a session list reads (spec 2026-10-27 §4.4). `mine` is
3913
+ * everyone's own history, the default and the access clause as ever. `shared`
3914
+ * is the root conversations shared with the caller. `team` is every root
3915
+ * conversation of the tenant, for a holder of `supervision` only (403 else).
3916
+ */
3917
+ export declare const AGENT_SESSION_PROVENANCES: readonly ["mine", "shared", "team"];
3918
+ export type AgentSessionProvenance = (typeof AGENT_SESSION_PROVENANCES)[number];
3904
3919
  /** Whether a class of tool call is confirmed by a human or executed straight away. */
3905
3920
  export type ApprovalMode = "ask" | "auto";
3906
3921
  /**
@@ -4107,6 +4122,26 @@ export interface AgentTriggerDefinition {
4107
4122
  createdAt: Date;
4108
4123
  updatedAt: Date;
4109
4124
  }
4125
+ /** Who a routine in audience mode runs for (spec 2026-10-27 §4.2). */
4126
+ export interface RoutineAudience {
4127
+ /** Every member of the workspace. */
4128
+ workspace: boolean;
4129
+ roleIds: string[];
4130
+ actorIds: string[];
4131
+ }
4132
+ /** Why a person is in a routine audience; the most specific reason wins: the armer, then a named person, a role, the whole workspace. */
4133
+ export type RoutineAudienceSource = "workspace" | `role:${string}` | "direct" | "armer";
4134
+ /** One person a supervised audience resolves to, with why. */
4135
+ export interface RoutineAudienceMember {
4136
+ actorId: string;
4137
+ source: RoutineAudienceSource;
4138
+ }
4139
+ /** `GET /agents/definitions/:id/audience/preview`: the audience resolved now (spec 2026-10-27 §5). */
4140
+ export interface RoutineAudiencePreview {
4141
+ people: Array<RoutineAudienceMember & {
4142
+ missingConnections: string[];
4143
+ }>;
4144
+ }
4110
4145
  export interface AgentSchedule {
4111
4146
  cron: string;
4112
4147
  timezone?: string;
@@ -4118,6 +4153,8 @@ export interface AgentSchedule {
4118
4153
  * routine. Writes that replace the schedule keep it when they omit it.
4119
4154
  */
4120
4155
  runFor?: "armer" | "audience";
4156
+ /** Read only when `runFor === "audience"`: absent keeps the people the routine is shared with. */
4157
+ audience?: RoutineAudience;
4121
4158
  /**
4122
4159
  * Whether an occurrence continues the conversation the last one opened
4123
4160
  * (#5719), under the guards of a threaded trigger fire (#4914): `true`
@@ -4283,6 +4320,12 @@ export interface AgentDefinition {
4283
4320
  scheduleNextRunAt?: Date;
4284
4321
  /** Read-only, computed for the reader by the query (spec 2026-10-08 §4.4). */
4285
4322
  viewerAccess?: ViewerAccess;
4323
+ /**
4324
+ * Read-only, computed for the reader by the query: one of their actors is a
4325
+ * person the supervised audience resolves to, its armer counted (spec
4326
+ * 2026-10-27 §4.2, the fan-out's own membership definition).
4327
+ */
4328
+ viewerInAudience?: boolean;
4286
4329
  /** Read-only: the number of manual grants on a private definition (0 on a workspace one). */
4287
4330
  sharedWithCount?: number;
4288
4331
  /** The harness that drives it; absent = the Standards engine (environments spec §1.4). */
@@ -4410,6 +4453,34 @@ export interface AgentSession {
4410
4453
  environmentId?: string;
4411
4454
  /** Server-managed resume state of the harness (its own session id and the like). */
4412
4455
  harnessState?: unknown;
4456
+ /**
4457
+ * Set only on a read that reached the conversation past its definition's
4458
+ * visibility (supervision, spec 2026-10-27 §4.4) and on every row of a
4459
+ * `shared` or `team` list: the definition's name and face, never its
4460
+ * configuration. Absent when the reader may open the conversation itself
4461
+ * (a `mine` list), or when the definition is gone.
4462
+ */
4463
+ definitionAppearance?: AgentSessionDefinitionAppearance;
4464
+ /**
4465
+ * Set when the reader reached another person's conversation through the
4466
+ * read clause (a share of its root, or supervision; spec 2026-10-27 §4.4),
4467
+ * on one session's read and on each such row of a `shared` or `team` list,
4468
+ * whatever its definition. A supervised read is audited, so a client reads
4469
+ * such a session once per open and never writes to it.
4470
+ */
4471
+ readThrough?: true;
4472
+ /**
4473
+ * Set only on the rows of a `lastActivity` list: this row's keyset position,
4474
+ * opaque. The last row's, passed back as `cursor`, reads the next page.
4475
+ */
4476
+ listCursor?: string;
4477
+ }
4478
+ /** What a conversation's reader learns of a definition it cannot see. */
4479
+ export interface AgentSessionDefinitionAppearance {
4480
+ name: string;
4481
+ kind: AgentDefinitionKind;
4482
+ label?: string;
4483
+ avatar?: AgentAvatar;
4413
4484
  }
4414
4485
  /**
4415
4486
  * Lifecycle of a persisted tool part. The three `approval-*` values are the
@@ -4725,6 +4796,12 @@ export interface AgentSessionHistoryPage {
4725
4796
  nextCursor: string | null;
4726
4797
  hasMore: boolean;
4727
4798
  committedSeq: number;
4799
+ /**
4800
+ * The session's state as of this page. A reader of another person's
4801
+ * conversation (spec 2026-10-27 §4.4) has no stream and reads the session
4802
+ * row once per open: this is how its view learns a turn started or ended.
4803
+ */
4804
+ sessionState?: SessionState;
4728
4805
  }
4729
4806
  /** Canonical persisted-message order: creation time ASC, then id ASC. */
4730
4807
  export declare function compareAgentSessionMessages(left: Pick<AgentSessionMessage, "createdAt" | "id">, right: Pick<AgentSessionMessage, "createdAt" | "id">): number;
@@ -7725,12 +7802,12 @@ export interface EnvironmentList {
7725
7802
  /**
7726
7803
  * Type of resource that can be audited
7727
7804
  */
7728
- export declare const AUDIT_RESOURCE_TYPES: readonly ["record", "object", "attribute", "view", "user", "role", "settings", "file", "agent", "bundle", "tenant_invitation", "api_key"];
7805
+ export declare const AUDIT_RESOURCE_TYPES: readonly ["record", "object", "attribute", "view", "user", "role", "settings", "file", "agent", "bundle", "tenant_invitation", "api_key", "agent_session"];
7729
7806
  export type AuditResourceType = (typeof AUDIT_RESOURCE_TYPES)[number];
7730
7807
  /**
7731
7808
  * Actions that can be audited
7732
7809
  */
7733
- export declare const AUDIT_ACTIONS: readonly ["record.created", "record.updated", "record.deleted", "record.restored", "record.purged", "record.access_changed", "agent.access_changed", "object.created", "object.updated", "object.deleted", "attribute.created", "attribute.updated", "attribute.deleted", "view.created", "view.updated", "view.deleted", "bundle.synced", "bundle.removed", "bundle.added", "user.created", "user.invited", "user.updated", "user.deleted", "user.login", "user.logout", "tenant_invitation.created", "tenant_invitation.delivery_failed", "tenant_invitation.resent", "tenant_invitation.revoked", "tenant_invitation.accepted", "role.created", "role.updated", "role.deleted", "role.assigned", "role.revoked", "api_key.detached", "settings.updated", "file.uploaded", "file.updated", "file.deleted"];
7810
+ export declare const AUDIT_ACTIONS: readonly ["record.created", "record.updated", "record.deleted", "record.restored", "record.purged", "record.access_changed", "agent.access_changed", "agent_session.supervised_read", "object.created", "object.updated", "object.deleted", "attribute.created", "attribute.updated", "attribute.deleted", "view.created", "view.updated", "view.deleted", "bundle.synced", "bundle.removed", "bundle.added", "user.created", "user.invited", "user.updated", "user.deleted", "user.login", "user.logout", "tenant_invitation.created", "tenant_invitation.delivery_failed", "tenant_invitation.resent", "tenant_invitation.revoked", "tenant_invitation.accepted", "role.created", "role.updated", "role.deleted", "role.assigned", "role.revoked", "api_key.detached", "settings.updated", "file.uploaded", "file.updated", "file.deleted"];
7734
7811
  export type AuditAction = (typeof AUDIT_ACTIONS)[number];
7735
7812
  /**
7736
7813
  * Actor type - who performed the action
@@ -13920,6 +13997,27 @@ export type AgentSessionLink = {
13920
13997
  sessionId: string;
13921
13998
  };
13922
13999
  //#endregion
14000
+ //#region src/utils/agent-session-list-cursor.d.ts
14001
+ /**
14002
+ * The keyset position of a session in a `lastActivity` list (spec 2026-10-27
14003
+ * §4.4): its activity instant and its id, the list's two sort keys. The server
14004
+ * issues it on every row of such a list (`AgentSession.listCursor`); a client
14005
+ * passes the last row's back as `cursor` and never reads inside it.
14006
+ *
14007
+ * `at` keeps the store's own precision (Postgres stamps to the microsecond):
14008
+ * a cursor rebuilt from a JS `Date` would round it to the millisecond and skip
14009
+ * the rows written later in that millisecond.
14010
+ */
14011
+ export interface AgentSessionListPosition {
14012
+ /** ISO-8601 UTC instant, `Z`-suffixed, up to six fractional digits. */
14013
+ at: string;
14014
+ id: string;
14015
+ }
14016
+ /** ASCII only (an instant and a uuid), so `btoa` serves both Node and the browser. */
14017
+ export declare function encodeAgentSessionListCursor(position: AgentSessionListPosition): string;
14018
+ /** The position a cursor encodes, or `null` for anything the server never issued. */
14019
+ export declare function decodeAgentSessionListCursor(cursor: string): AgentSessionListPosition | null;
14020
+ //#endregion
13923
14021
  //#region src/validators/agent-message.schema.d.ts
13924
14022
  type AgentDataChunkOptions = {
13925
14023
  id?: string;
@@ -15005,6 +15103,11 @@ export declare const agentScheduleSchema: z$2.ZodObject<{
15005
15103
  armer: "armer";
15006
15104
  audience: "audience";
15007
15105
  }>>;
15106
+ audience: z$2.ZodOptional<z$2.ZodObject<{
15107
+ workspace: z$2.ZodBoolean;
15108
+ roleIds: z$2.ZodArray<z$2.ZodUUID>;
15109
+ actorIds: z$2.ZodArray<z$2.ZodUUID>;
15110
+ }, z$2.core.$strip>>;
15008
15111
  continueConversation: z$2.ZodOptional<z$2.ZodBoolean>;
15009
15112
  }, z$2.core.$strip>;
15010
15113
  /** `event.thread_ts`: names joined by single dots, no empty segment (#4914). */
@@ -1,5 +1,5 @@
1
1
 
2
- import { ObjectImage, RecordAppearance } from "./objects-Dc4zYk9o.js";
2
+ import { ObjectImage, RecordAppearance } from "./objects-B8-0pVuJ.js";
3
3
  import { Attribute, AttributeType } from "./attributes-BOIIZZpP.js";
4
4
  import * as z$2 from "zod";
5
5
  import { ColorId, IconName } from "@standards/constants";
@@ -1,5 +1,5 @@
1
1
 
2
- import { ObjectDefinition } from "./objects-Dc4zYk9o.js";
2
+ import { ObjectDefinition } from "./objects-B8-0pVuJ.js";
3
3
  import { Attribute } from "./attributes-BOIIZZpP.js";
4
4
  import { ValidationMessages, ValidationResult } from "./index-CFXgKvOC.js";
5
5
  import * as z$2 from "zod";