Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4,299 changes: 3,614 additions & 685 deletions specs/platform-openapi.json

Large diffs are not rendered by default.

179 changes: 116 additions & 63 deletions src/archastro/platform/types/common.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2026 ArchAstro Inc. All Rights Reserved.
# This file is auto-generated by @archastro/sdk-generator. Do not edit.
# Content hash: 2ff0288f177d
# Content hash: 2b0ec0cf1c54

from datetime import datetime

Expand Down Expand Up @@ -82,6 +82,19 @@ class Actor(BaseModel):
profile_picture: ImageSource | None = None # Profile picture


# Compact Config row summary for templates referenced by an agent upgrade.
class UpgradeTemplateSummary(BaseModel):
created_at: datetime | None = None
description: str | None = None # Template description from the config body
display_name: str | None = None # Template display name from the config body
id: str # Template config ID (cfg_...)
kind: str # Template config kind
lookup_key: str | None = None # Stored template lookup_key
name: str | None = None # Template name from the config body
updated_at: datetime | None = None
virtual_path: str | None = None # Stored template virtual_path


# One entry in `AgentCreateResponse.installed_configs` a slim summary
# of a config the install transaction created.
# `key` is the caller-supplied identifier for the input that produced
Expand Down Expand Up @@ -131,19 +144,6 @@ class WorkerStatus(BaseModel):
status: str # Worker state: queued, executing, retrying, completed, discarded, or cancelled


# Compact Config row summary for templates referenced by an agent upgrade.
class UpgradeTemplateSummary(BaseModel):
created_at: datetime | None = None
description: str | None = None # Template description from the config body
display_name: str | None = None # Template display name from the config body
id: str # Template config ID (cfg_...)
kind: str # Template config kind
lookup_key: str | None = None # Stored template lookup_key
name: str | None = None # Template name from the config body
updated_at: datetime | None = None
virtual_path: str | None = None # Stored template virtual_path


# API schema for a media variant.
class MediaVariant(BaseModel):
content_type: str | None = None # File content type
Expand Down Expand Up @@ -584,6 +584,20 @@ class RoutinePreset(BaseModel):
unique: bool


# API schema for a storage file.
class StorageFile(BaseModel):
content_type: str | None = None # MIME content type
created_at: datetime | None = None # Creation timestamp
filename: str | None = None # Original filename
id: str # File ID
image_source: ImageSource | None = None # Image source metadata
org: str | None = None # Organization
sandbox: str | None = None # Sandbox
size: int | None = None # File size in bytes
updated_at: datetime | None = None # Last update timestamp
url: str | None = None # Signed download URL


# Schema for config validation result.
class ValidationResult(BaseModel):
errors: list[str] | None = None # List of validation errors
Expand Down Expand Up @@ -613,6 +627,72 @@ class WorkingMemoryEntryListResponse(BaseModel):
total_pages: int | None = None # Total number of pages


# Template row nested under a `SolutionSummary`.
# Imported Solutions persist each wrapped/bundled template as a Config
# child of the Solution. This schema exposes that child identity so
# clients can display and group Solutions at template granularity.
class SolutionTemplateSummary(BaseModel):
description: str | None = None
display_name: str | None = None
id: str | None = None # Template config ID (cfg_...). Null for inline-only templates.
kind: str
lookup_key: str | None = None # Stored template lookup_key.
name: str | None = None
readme_url: str | None = None
virtual_path: str | None = None # Stored template virtual_path.


# Catalog row for `GET /api/v1/solutions`. One entry per imported
# Solution config the ID + storage location + vanity fields lifted
# from the Solution body, plus the list of owners it appears under
# (`"system"`, `"org"`) so callers can tell where it came from.
# Multi-owner entries are produced when the same Solution (same
# `solution_id`) exists at both the app-level system scope and the
# viewer's org scope. The list endpoint dedupes by `solution_id` and
# merges the owners list. When the system-scope row's version is
# higher than the org-scope row's, `upgrade_available` is `true` and
# `latest_version` carries the system version.
class SolutionSummary(BaseModel):
category_keys: list[str] | None = None # SolutionCategory keys from the Solution body
created_at: datetime | None = None # Creation timestamp
description: str | None = None # Short tagline / summary (from Solution body)
id: str # Solution config ID (cfg_...)
kind: str # Always "Solution"
latest_solution: str | None = None
latest_version: str | None = None
lookup_key: str | None = None # Stored lookup_key
metadata: dict[str, object] | None = None # Arbitrary Solution metadata (e.g. category)
name: str | None = None # Display name (from Solution body)
org: str | None = None # Organization
owners: list[str]
readme_url: str | None = None
solution_id: str | None = None # Stable Solution UUID (from Solution body)
solution_version: str | None = None # Solution semver (from Solution body)
tag_keys: list[str] | None = None # SolutionTag keys from the Solution body
template_kind: str | None = None
templates: list[SolutionTemplateSummary]
updated_at: datetime | None = None # Last update timestamp
upgrade_available: bool
virtual_path: str | None = None # Stored virtual_path (dedupe key across owners)


# Compact read-path summary of the Solution and AgentTemplate that an agent
# was last provisioned from.
# Returned as an optional `source_solution` field on `GET /api/v1/agents/:id`
# when the agent has a `last_applied_template_config` that can be resolved
# to a parent Solution. Null for hand-built agents (no tracked template) and
# for agents whose tracked template or parent Solution has been deleted.
# Unlike the `POST /agents/:id/upgrade` response, this summary does NOT
# compute a change plan. It issues 4 DB queries for system-scoped Solutions
# (template config fetch, parent Solution fetch, current_version preload,
# children list) and 5 for org-scoped Solutions (adds the system-scope
# counterpart lookup for upgrade-availability). This is fast enough for a
# single-agent GET but is intentionally not issued on list endpoints.
class AgentSourceSolution(BaseModel):
solution: SolutionSummary
template: UpgradeTemplateSummary # AgentTemplate config the agent was last provisioned from.


# API schema for an agent.
class Agent(BaseModel):
acl: Acl | None = None
Expand All @@ -631,6 +711,7 @@ class Agent(BaseModel):
originator: str | None = None # Free-form source or author of the agent
phone_number: str | None = None # Agent phone number
sandbox: str | None = None # Sandbox
source_solution: AgentSourceSolution | None = None
team: str | None = None # Owning team
updated_at: datetime | None = None # Last update timestamp
user: str | None = None # Owning user
Expand Down Expand Up @@ -892,9 +973,29 @@ class AgentToolListResponse(BaseModel):
data: list[AgentTool] # List of agent tools


# One field-level diff entry within an agent upgrade change.
# For `:agent_base` entries, two optional annotations are included:
# * `baseline` the value set by the last-applied template version
# (pinned to `last_applied_template_config_version_id`). `null` when
# no baseline is available (legacy agent, deleted version).
# * `locally_edited` `true` when the agent's current value differs from
# `baseline` (the operator changed the field after the last apply, so this
# upgrade will clobber a local edit). `false` when the agent matches the
# baseline. `null` when baseline is unavailable.
# Child entries (tool/routine/skill/computer) never carry these annotations
# their shapes keep plain `{field, old, new}`.
class AgentUpgradeFieldChange(BaseModel):
baseline: object | None = None
field: str # Name of the field that changed
locally_edited: bool | None = None
new: object | None = None
old: object | None = None


# One child-resource change produced by an agent upgrade.
class AgentUpgradeChange(BaseModel):
action: str
field_changes: list[AgentUpgradeFieldChange] | None = None
id: str | None = None
key: str | None = None
name: str | None = None
Expand All @@ -916,59 +1017,11 @@ class AgentUpgradeResult(BaseModel):
changes: list[AgentUpgradeChange]
dry_run: bool
mode: str
review_fingerprint: str | None = None
status: str
summary: AgentUpgradeSummary


# Template row nested under a `SolutionSummary`.
# Imported Solutions persist each wrapped/bundled template as a Config
# child of the Solution. This schema exposes that child identity so
# clients can display and group Solutions at template granularity.
class SolutionTemplateSummary(BaseModel):
description: str | None = None
display_name: str | None = None
id: str | None = None # Template config ID (cfg_...). Null for inline-only templates.
kind: str
lookup_key: str | None = None # Stored template lookup_key.
name: str | None = None
readme_url: str | None = None
virtual_path: str | None = None # Stored template virtual_path.


# Catalog row for `GET /api/v1/solutions`. One entry per imported
# Solution config the ID + storage location + vanity fields lifted
# from the Solution body, plus the list of owners it appears under
# (`"system"`, `"org"`) so callers can tell where it came from.
# Multi-owner entries are produced when the same Solution (same
# `solution_id`) exists at both the app-level system scope and the
# viewer's org scope. The list endpoint dedupes by `solution_id` and
# merges the owners list. When the system-scope row's version is
# higher than the org-scope row's, `upgrade_available` is `true` and
# `latest_version` carries the system version.
class SolutionSummary(BaseModel):
category_keys: list[str] | None = None # SolutionCategory keys from the Solution body
created_at: datetime | None = None # Creation timestamp
description: str | None = None # Short tagline / summary (from Solution body)
id: str # Solution config ID (cfg_...)
kind: str # Always "Solution"
latest_solution: str | None = None
latest_version: str | None = None
lookup_key: str | None = None # Stored lookup_key
metadata: dict[str, object] | None = None # Arbitrary Solution metadata (e.g. category)
name: str | None = None # Display name (from Solution body)
org: str | None = None # Organization
owners: list[str]
readme_url: str | None = None
solution_id: str | None = None # Stable Solution UUID (from Solution body)
solution_version: str | None = None # Solution semver (from Solution body)
tag_keys: list[str] | None = None # SolutionTag keys from the Solution body
template_kind: str | None = None
templates: list[SolutionTemplateSummary]
updated_at: datetime | None = None # Last update timestamp
upgrade_available: bool
virtual_path: str | None = None # Stored virtual_path (dedupe key across owners)


# Wire shape for `POST /api/v1/agents/:agent/upgrade`.
class AgentUpgradeResponse(BaseModel):
agent: Agent | None = None # Updated agent. Null for dry-run responses.
Expand Down
3 changes: 2 additions & 1 deletion src/archastro/platform/types/users.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2026 ArchAstro Inc. All Rights Reserved.
# This file is auto-generated by @archastro/sdk-generator. Do not edit.
# Content hash: d05037052403
# Content hash: c5464bec4976

from datetime import datetime

Expand All @@ -14,6 +14,7 @@ class User(BaseModel):
alias: str | None = None # User alias/handle
email: str | None = None # User email address
id: str # User ID
is_system_user: bool | None = None # Whether this user is a system user
metadata: dict[str, object] | None = None # User metadata
name: str | None = None # User display name. Null when the user has not set a name.
org: str | None = None # Organization
Expand Down
3 changes: 2 additions & 1 deletion src/archastro/platform/v1/resources/agents.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2026 ArchAstro Inc. All Rights Reserved.
# This file is auto-generated by @archastro/sdk-generator. Do not edit.
# Content hash: 36cd4542c0d3
# Content hash: 762a37915e73

from __future__ import annotations

Expand Down Expand Up @@ -326,6 +326,7 @@ class AgentThreadsInput(TypedDict, total=False):
class AgentUpgradeInput(TypedDict, total=False):
dry_run: bool | None # Return the upgrade diff without writing changes
email: str | None # Safe agent email override
expected_review_fingerprint: str | None
identity: str | None # Safe identity prompt override
metadata: dict[str, object] | None # Safe metadata override
mode: Literal["reapply", "replace"] | None
Expand Down
21 changes: 20 additions & 1 deletion src/archastro/platform/v1/resources/files.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
# Copyright (c) 2026 ArchAstro Inc. All Rights Reserved.
# This file is auto-generated by @archastro/sdk-generator. Do not edit.
# Content hash: 91ffe2981ffb
# Content hash: 9081589966b0

from __future__ import annotations

from typing import Required, TypedDict

from ...runtime.http_client import HttpClient, SyncHttpClient
from ...types.common import StorageFile


class FileCreateInput(TypedDict, total=False):
agent: str | None # Agent ID — derives org_id from the agent
content_type: Required[str] # MIME type
data: Required[str] # Base64-encoded file content
filename: Required[str] # Filename
org: str | None # Organization ID
team: str | None # Owning team ID
user: str | None # Owning user ID


class AsyncFileResource:
def __init__(self, http: HttpClient):
self._http = http

async def create(self, input: FileCreateInput) -> StorageFile:
return await self._http.request("/api/v1/files", method="POST", body=input)

async def avatar(self, file: str, token: str) -> dict[str, str]:
query: dict[str, object] = {}
query["token"] = token
Expand All @@ -21,6 +37,9 @@ class FileResource:
def __init__(self, http: SyncHttpClient):
self._http = http

def create(self, input: FileCreateInput) -> StorageFile:
return self._http.request("/api/v1/files", method="POST", body=input)

def avatar(self, file: str, token: str) -> dict[str, str]:
query: dict[str, object] = {}
query["token"] = token
Expand Down
Loading
Loading