archastro.platform.types.artifacts

  1# Copyright (c) 2026 ArchAstro Inc. Licensed under the MIT License.
  2# This file is auto-generated by @archastro/sdk-generator. Do not edit.
  3# Content hash: c85f0df95fc5
  4
  5from datetime import datetime
  6from typing import Any
  7
  8from pydantic import BaseModel, Field
  9
 10from .common import Acl
 11from .image import ImageSource
 12
 13
 14class Artifact(BaseModel):
 15    """
 16    A versioned artifact produced or managed by an agent, such as a generated file, report, or code output.
 17    """
 18
 19    acl: Acl | None = Field(
 20        default=None,
 21        description="Access control list for the artifact. Contains a `grants` array where each entry specifies `principal_type`, `principal`, and `actions` (`read`, `write`). `null` when the artifact has no grants or the viewer is not its owner.",
 22    )
 23    agent: str | None = Field(
 24        default=None,
 25        description="ID of the agent that produced this artifact (`agt_...`). `null` if not agent-produced.",
 26    )
 27    content_type: str | None = Field(
 28        default=None,
 29        description='MIME type of the current version\'s file, e.g. `"text/csv"` or `"image/png"`. `null` if no file is attached.',
 30    )
 31    created_at: datetime | None = Field(
 32        default=None, description="When the artifact was first created (ISO 8601)."
 33    )
 34    current_version: str | None = Field(
 35        default=None,
 36        description="ID of the current (latest published) artifact version (`artv_...`). `null` if no version has been published.",
 37    )
 38    description: str | None = Field(
 39        default=None,
 40        description="Optional longer description of the artifact's contents or purpose. `null` if not set.",
 41    )
 42    file: str | None = Field(
 43        default=None,
 44        description="Storage file ID for the current version (`fil_...`). `null` if no file is attached.",
 45    )
 46    file_name: str | None = Field(
 47        default=None,
 48        description='Original filename of the current version\'s file, e.g. `"output.csv"`. `null` if no file is attached.',
 49    )
 50    file_url: str | None = Field(
 51        default=None,
 52        description="Short-lived signed URL for downloading the current version's file. `null` if no file is attached.",
 53    )
 54    group_key: str | None = Field(
 55        default=None,
 56        description="Optional nonunique, case-sensitive grouping key, limited to 1024 UTF-8 bytes. Null when unset; belongs to the artifact, not a content version.",
 57    )
 58    id: str = Field(..., description="Artifact ID (`art_...`).")
 59    image_source: ImageSource | None = Field(
 60        default=None,
 61        description='Image source metadata for rendering the current version\'s file inline. Present only when `content_type` starts with `"image/"`. `null` otherwise.',
 62    )
 63    name: str | None = Field(
 64        default=None,
 65        description='Human-readable name for the artifact, e.g. `"Q2 Report"`. `null` if not set.',
 66    )
 67    org: str | None = Field(
 68        default=None, description="ID of the organization this artifact belongs to (`org_...`)."
 69    )
 70    sandbox: str | None = Field(
 71        default=None,
 72        description="Identifier of the sandbox environment associated with this artifact. `null` if not sandbox-scoped.",
 73    )
 74    system: bool | None = Field(
 75        default=None,
 76        description="True when the artifact has no user, team, or agent owner. An organization may own a system artifact.",
 77    )
 78    team: str | None = Field(
 79        default=None,
 80        description="ID of the team that owns this artifact (`tea_...`). `null` if not team-scoped.",
 81    )
 82    thread: str | None = Field(
 83        default=None,
 84        description="ID of the thread in which this artifact was created (`thr_...`). `null` if not thread-scoped.",
 85    )
 86    updated_at: datetime | None = Field(
 87        default=None, description="When the artifact record was last modified (ISO 8601)."
 88    )
 89    user: str | None = Field(
 90        default=None,
 91        description="ID of the user who created this artifact (`usr_...`). `null` if not user-scoped.",
 92    )
 93    version: int | None = Field(
 94        default=None,
 95        description="Current version number of the artifact. Increments each time a new version is published.",
 96    )
 97
 98
 99class ArtifactEditingAck(BaseModel):
100    """
101    Acknowledges an Artifact editing presence or leave request.
102    """
103
104    ok: bool
105
106
107class ArtifactEditingCursor(BaseModel):
108    """
109    A Unicode code-point cursor and optional selection endpoint.
110    """
111
112    position: int = Field(..., description="Zero-based Unicode code-point position.")
113    selection_end: int | None = Field(
114        default=None, description="Zero-based Unicode code-point selection endpoint."
115    )
116
117
118class ArtifactEditingActor(BaseModel):
119    """
120    A server-issued collaborator identity and its ephemeral presence.
121    """
122
123    actor_id: str = Field(..., description="Opaque identity unique to this channel join.")
124    cursor: ArtifactEditingCursor | None = Field(
125        default=None, description="Current code-point cursor, or null."
126    )
127    meta: dict[str, Any] = Field(..., description="Server-derived collaborator display metadata.")
128
129
130class ArtifactEditingCheckpointResponse(BaseModel):
131    """
132    Confirms the exact live revision that reached durable ArtifactVersion storage.
133    """
134
135    artifact_version: str = Field(..., description="New durable ArtifactVersion ID.")
136    artifact_version_number: int
137    checkpointed_revision: int
138    dirty: bool = Field(..., description="True when later live operations remain unsaved.")
139    incarnation: str
140
141
142class ArtifactEditingJoinResponse(BaseModel):
143    """
144    Authoritative live Artifact snapshot returned by an editing-channel join.
145    """
146
147    actor_id: str = Field(..., description="Server-issued identity for this channel join.")
148    actors: list[ArtifactEditingActor]
149    artifact: str = Field(..., description="Public Artifact ID (`art_...`).")
150    artifact_version: str = Field(..., description="Durable version ID (`artv_...`).")
151    artifact_version_number: int
152    can_write: bool
153    checkpoint_error: str | None = Field(
154        default=None, description="Last durable-save failure reason, or null."
155    )
156    checkpointed_revision: int = Field(..., description="Latest revision known durable.")
157    connection_id: str = Field(..., description="Server-issued connection identity.")
158    content: str = Field(..., description="UTF-8 document content.")
159    dirty: bool = Field(..., description="True while a live tail remains crash-loss exposed.")
160    incarnation: str = Field(..., description="Opaque live-session fence token.")
161    revision: int = Field(..., description="Live OT revision in Unicode code points.")
162
163
164class ArtifactEditingOperationAck(BaseModel):
165    """
166    Acknowledges an operation only after the authoritative OT server applied it.
167    """
168
169    revision: int = Field(..., description="Authoritative live revision after application.")
class Artifact(pydantic.main.BaseModel):
15class Artifact(BaseModel):
16    """
17    A versioned artifact produced or managed by an agent, such as a generated file, report, or code output.
18    """
19
20    acl: Acl | None = Field(
21        default=None,
22        description="Access control list for the artifact. Contains a `grants` array where each entry specifies `principal_type`, `principal`, and `actions` (`read`, `write`). `null` when the artifact has no grants or the viewer is not its owner.",
23    )
24    agent: str | None = Field(
25        default=None,
26        description="ID of the agent that produced this artifact (`agt_...`). `null` if not agent-produced.",
27    )
28    content_type: str | None = Field(
29        default=None,
30        description='MIME type of the current version\'s file, e.g. `"text/csv"` or `"image/png"`. `null` if no file is attached.',
31    )
32    created_at: datetime | None = Field(
33        default=None, description="When the artifact was first created (ISO 8601)."
34    )
35    current_version: str | None = Field(
36        default=None,
37        description="ID of the current (latest published) artifact version (`artv_...`). `null` if no version has been published.",
38    )
39    description: str | None = Field(
40        default=None,
41        description="Optional longer description of the artifact's contents or purpose. `null` if not set.",
42    )
43    file: str | None = Field(
44        default=None,
45        description="Storage file ID for the current version (`fil_...`). `null` if no file is attached.",
46    )
47    file_name: str | None = Field(
48        default=None,
49        description='Original filename of the current version\'s file, e.g. `"output.csv"`. `null` if no file is attached.',
50    )
51    file_url: str | None = Field(
52        default=None,
53        description="Short-lived signed URL for downloading the current version's file. `null` if no file is attached.",
54    )
55    group_key: str | None = Field(
56        default=None,
57        description="Optional nonunique, case-sensitive grouping key, limited to 1024 UTF-8 bytes. Null when unset; belongs to the artifact, not a content version.",
58    )
59    id: str = Field(..., description="Artifact ID (`art_...`).")
60    image_source: ImageSource | None = Field(
61        default=None,
62        description='Image source metadata for rendering the current version\'s file inline. Present only when `content_type` starts with `"image/"`. `null` otherwise.',
63    )
64    name: str | None = Field(
65        default=None,
66        description='Human-readable name for the artifact, e.g. `"Q2 Report"`. `null` if not set.',
67    )
68    org: str | None = Field(
69        default=None, description="ID of the organization this artifact belongs to (`org_...`)."
70    )
71    sandbox: str | None = Field(
72        default=None,
73        description="Identifier of the sandbox environment associated with this artifact. `null` if not sandbox-scoped.",
74    )
75    system: bool | None = Field(
76        default=None,
77        description="True when the artifact has no user, team, or agent owner. An organization may own a system artifact.",
78    )
79    team: str | None = Field(
80        default=None,
81        description="ID of the team that owns this artifact (`tea_...`). `null` if not team-scoped.",
82    )
83    thread: str | None = Field(
84        default=None,
85        description="ID of the thread in which this artifact was created (`thr_...`). `null` if not thread-scoped.",
86    )
87    updated_at: datetime | None = Field(
88        default=None, description="When the artifact record was last modified (ISO 8601)."
89    )
90    user: str | None = Field(
91        default=None,
92        description="ID of the user who created this artifact (`usr_...`). `null` if not user-scoped.",
93    )
94    version: int | None = Field(
95        default=None,
96        description="Current version number of the artifact. Increments each time a new version is published.",
97    )

A versioned artifact produced or managed by an agent, such as a generated file, report, or code output.

Access control list for the artifact. Contains a grants array where each entry specifies principal_type, principal, and actions (read, write). null when the artifact has no grants or the viewer is not its owner.

agent: str | None = None

ID of the agent that produced this artifact (agt_...). null if not agent-produced.

content_type: str | None = None

MIME type of the current version's file, e.g. "text/csv" or "image/png". null if no file is attached.

created_at: datetime.datetime | None = None

When the artifact was first created (ISO 8601).

current_version: str | None = None

ID of the current (latest published) artifact version (artv_...). null if no version has been published.

description: str | None = None

Optional longer description of the artifact's contents or purpose. null if not set.

file: str | None = None

Storage file ID for the current version (fil_...). null if no file is attached.

file_name: str | None = None

Original filename of the current version's file, e.g. "output.csv". null if no file is attached.

file_url: str | None = None

Short-lived signed URL for downloading the current version's file. null if no file is attached.

group_key: str | None = None

Optional nonunique, case-sensitive grouping key, limited to 1024 UTF-8 bytes. Null when unset; belongs to the artifact, not a content version.

id: str = PydanticUndefined

Artifact ID (art_...).

image_source: archastro.platform.types.image.ImageSource | None = None

Image source metadata for rendering the current version's file inline. Present only when content_type starts with "image/". null otherwise.

name: str | None = None

Human-readable name for the artifact, e.g. "Q2 Report". null if not set.

org: str | None = None

ID of the organization this artifact belongs to (org_...).

sandbox: str | None = None

Identifier of the sandbox environment associated with this artifact. null if not sandbox-scoped.

system: bool | None = None

True when the artifact has no user, team, or agent owner. An organization may own a system artifact.

team: str | None = None

ID of the team that owns this artifact (tea_...). null if not team-scoped.

thread: str | None = None

ID of the thread in which this artifact was created (thr_...). null if not thread-scoped.

updated_at: datetime.datetime | None = None

When the artifact record was last modified (ISO 8601).

user: str | None = None

ID of the user who created this artifact (usr_...). null if not user-scoped.

version: int | None = None

Current version number of the artifact. Increments each time a new version is published.

class ArtifactEditingAck(pydantic.main.BaseModel):
100class ArtifactEditingAck(BaseModel):
101    """
102    Acknowledges an Artifact editing presence or leave request.
103    """
104
105    ok: bool

Acknowledges an Artifact editing presence or leave request.

ok: bool = PydanticUndefined
class ArtifactEditingCursor(pydantic.main.BaseModel):
108class ArtifactEditingCursor(BaseModel):
109    """
110    A Unicode code-point cursor and optional selection endpoint.
111    """
112
113    position: int = Field(..., description="Zero-based Unicode code-point position.")
114    selection_end: int | None = Field(
115        default=None, description="Zero-based Unicode code-point selection endpoint."
116    )

A Unicode code-point cursor and optional selection endpoint.

position: int = PydanticUndefined

Zero-based Unicode code-point position.

selection_end: int | None = None

Zero-based Unicode code-point selection endpoint.

class ArtifactEditingActor(pydantic.main.BaseModel):
119class ArtifactEditingActor(BaseModel):
120    """
121    A server-issued collaborator identity and its ephemeral presence.
122    """
123
124    actor_id: str = Field(..., description="Opaque identity unique to this channel join.")
125    cursor: ArtifactEditingCursor | None = Field(
126        default=None, description="Current code-point cursor, or null."
127    )
128    meta: dict[str, Any] = Field(..., description="Server-derived collaborator display metadata.")

A server-issued collaborator identity and its ephemeral presence.

actor_id: str = PydanticUndefined

Opaque identity unique to this channel join.

cursor: ArtifactEditingCursor | None = None

Current code-point cursor, or null.

meta: dict[str, typing.Any] = PydanticUndefined

Server-derived collaborator display metadata.

class ArtifactEditingCheckpointResponse(pydantic.main.BaseModel):
131class ArtifactEditingCheckpointResponse(BaseModel):
132    """
133    Confirms the exact live revision that reached durable ArtifactVersion storage.
134    """
135
136    artifact_version: str = Field(..., description="New durable ArtifactVersion ID.")
137    artifact_version_number: int
138    checkpointed_revision: int
139    dirty: bool = Field(..., description="True when later live operations remain unsaved.")
140    incarnation: str

Confirms the exact live revision that reached durable ArtifactVersion storage.

artifact_version: str = PydanticUndefined

New durable ArtifactVersion ID.

artifact_version_number: int = PydanticUndefined
checkpointed_revision: int = PydanticUndefined
dirty: bool = PydanticUndefined

True when later live operations remain unsaved.

incarnation: str = PydanticUndefined
class ArtifactEditingJoinResponse(pydantic.main.BaseModel):
143class ArtifactEditingJoinResponse(BaseModel):
144    """
145    Authoritative live Artifact snapshot returned by an editing-channel join.
146    """
147
148    actor_id: str = Field(..., description="Server-issued identity for this channel join.")
149    actors: list[ArtifactEditingActor]
150    artifact: str = Field(..., description="Public Artifact ID (`art_...`).")
151    artifact_version: str = Field(..., description="Durable version ID (`artv_...`).")
152    artifact_version_number: int
153    can_write: bool
154    checkpoint_error: str | None = Field(
155        default=None, description="Last durable-save failure reason, or null."
156    )
157    checkpointed_revision: int = Field(..., description="Latest revision known durable.")
158    connection_id: str = Field(..., description="Server-issued connection identity.")
159    content: str = Field(..., description="UTF-8 document content.")
160    dirty: bool = Field(..., description="True while a live tail remains crash-loss exposed.")
161    incarnation: str = Field(..., description="Opaque live-session fence token.")
162    revision: int = Field(..., description="Live OT revision in Unicode code points.")

Authoritative live Artifact snapshot returned by an editing-channel join.

actor_id: str = PydanticUndefined

Server-issued identity for this channel join.

actors: list[ArtifactEditingActor] = PydanticUndefined
artifact: str = PydanticUndefined

Public Artifact ID (art_...).

artifact_version: str = PydanticUndefined

Durable version ID (artv_...).

artifact_version_number: int = PydanticUndefined
can_write: bool = PydanticUndefined
checkpoint_error: str | None = None

Last durable-save failure reason, or null.

checkpointed_revision: int = PydanticUndefined

Latest revision known durable.

connection_id: str = PydanticUndefined

Server-issued connection identity.

content: str = PydanticUndefined

UTF-8 document content.

dirty: bool = PydanticUndefined

True while a live tail remains crash-loss exposed.

incarnation: str = PydanticUndefined

Opaque live-session fence token.

revision: int = PydanticUndefined

Live OT revision in Unicode code points.

class ArtifactEditingOperationAck(pydantic.main.BaseModel):
165class ArtifactEditingOperationAck(BaseModel):
166    """
167    Acknowledges an operation only after the authoritative OT server applied it.
168    """
169
170    revision: int = Field(..., description="Authoritative live revision after application.")

Acknowledges an operation only after the authoritative OT server applied it.

revision: int = PydanticUndefined

Authoritative live revision after application.