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
7,600 changes: 7,168 additions & 432 deletions specs/platform-openapi.json

Large diffs are not rendered by default.

49 changes: 43 additions & 6 deletions src/archastro/platform/channels/api_chat_channel.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2026 ArchAstro Inc. Licensed under the MIT License.
# This file is auto-generated by @archastro/sdk-generator. Do not edit.
# Content hash: 516661809198
# Content hash: 6cff96f782bb

from collections.abc import Callable
from datetime import datetime
Expand Down Expand Up @@ -275,16 +275,18 @@ class MessageAddedPayloadMessageAttachmentsItem(TypedDict, total=False):
"URL of the preview image extracted from the scraped page. Present on `scraped_link` type only. `null` otherwise."
image_width: int | None
"Width in pixels of the scraped preview image. Present on `scraped_link` type only. `null` otherwise."
key: str | None
'For `structured_data` type, what the data is about as set by the sender (for example `"pr:14963"`), copied from the record so it can be read without `object`. Not unique. `null` when unset and on other types.'
media_type: str | None
'The media category, e.g. `"video"` or `"audio"`. Present on `media` type only; omitted otherwise.'
name: str | None
"Display name of the media item. Present on `media` type only. `null` otherwise."
object: dict[str, Any] | None
"The full embedded object payload. For `task` type, contains the task record. For `action` type, contains the action definition. For `chart` type, contains the chart with its inline `spec`. Omitted on other types."
"The full embedded object payload. For `task` type, contains the task record. For `action` type, contains the action definition. For `chart` type, contains the chart with its inline `spec`. For `structured_data` type, contains the inline `data` and the `schema_url` or `schema_config` naming its JSON Schema. Omitted on other types."
title: str | None
"Display title. The page title for `scraped_link`, the artifact name for `artifact`, and the task title for `task` types. `null` on other types."
type: Required[str]
'The attachment type. One of `"file"`, `"scraped_link"`, `"artifact"`, `"task"`, `"media"`, `"action"`, or `"chart"`. Determines which additional fields are present.'
'The attachment type. One of `"file"`, `"scraped_link"`, `"artifact"`, `"task"`, `"media"`, `"action"`, `"chart"`, or `"structured_data"`. Determines which additional fields are present.'
url: str | None
"URL to access the resource. A signed download URL for `file` and `artifact` types; the original URL for `scraped_link`; a media playback URL for `media`. `null` on `task` and `action` types."
variants: list[MessageAddedPayloadMessageAttachmentsItemVariantsItem] | None
Expand Down Expand Up @@ -528,16 +530,18 @@ class MessageUpdatedPayloadMessageAttachmentsItem(TypedDict, total=False):
"URL of the preview image extracted from the scraped page. Present on `scraped_link` type only. `null` otherwise."
image_width: int | None
"Width in pixels of the scraped preview image. Present on `scraped_link` type only. `null` otherwise."
key: str | None
'For `structured_data` type, what the data is about as set by the sender (for example `"pr:14963"`), copied from the record so it can be read without `object`. Not unique. `null` when unset and on other types.'
media_type: str | None
'The media category, e.g. `"video"` or `"audio"`. Present on `media` type only; omitted otherwise.'
name: str | None
"Display name of the media item. Present on `media` type only. `null` otherwise."
object: dict[str, Any] | None
"The full embedded object payload. For `task` type, contains the task record. For `action` type, contains the action definition. For `chart` type, contains the chart with its inline `spec`. Omitted on other types."
"The full embedded object payload. For `task` type, contains the task record. For `action` type, contains the action definition. For `chart` type, contains the chart with its inline `spec`. For `structured_data` type, contains the inline `data` and the `schema_url` or `schema_config` naming its JSON Schema. Omitted on other types."
title: str | None
"Display title. The page title for `scraped_link`, the artifact name for `artifact`, and the task title for `task` types. `null` on other types."
type: Required[str]
'The attachment type. One of `"file"`, `"scraped_link"`, `"artifact"`, `"task"`, `"media"`, `"action"`, or `"chart"`. Determines which additional fields are present.'
'The attachment type. One of `"file"`, `"scraped_link"`, `"artifact"`, `"task"`, `"media"`, `"action"`, `"chart"`, or `"structured_data"`. Determines which additional fields are present.'
url: str | None
"URL to access the resource. A signed download URL for `file` and `artifact` types; the original URL for `scraped_link`; a media playback URL for `media`. `null` on `task` and `action` types."
variants: list[MessageUpdatedPayloadMessageAttachmentsItemVariantsItem] | None
Expand Down Expand Up @@ -724,7 +728,8 @@ class LocalToolCancelledPayload(TypedDict, total=False):

# Channel for real-time chat messaging.
# Supports team-scoped and user-scoped threads with keyed, transient, and direct
# thread access patterns.
# thread access patterns, plus org-scoped joins for organization-visibility
# threads, where org membership alone grants read and post.
class ApiChatChannel:
def __init__(self, channel, join_response=None):
self._channel = channel
Expand Down Expand Up @@ -826,6 +831,38 @@ async def join_team_transient(
join_response = await channel.join(payload)
return cls(channel, join_response)

# Join an organization-visibility thread by ID
@staticmethod
def topic_org_thread(org_id: str, thread_id: str) -> str:
return f"api:chat:org:{org_id}:thread:{thread_id}"

# Join an organization-visibility thread by ID
@classmethod
async def join_org_thread(
cls,
socket: "Socket",
org_id: str,
thread_id: str,
*,
after_cursor: str | None = None,
before_cursor: str | None = None,
include_metadata: bool | None = None,
limit: int | None = None,
) -> "ApiChatChannel":
topic = cls.topic_org_thread(org_id, thread_id)
channel = socket.channel(topic)
payload: dict[str, object] = {}
if after_cursor is not None:
payload["after_cursor"] = after_cursor
if before_cursor is not None:
payload["before_cursor"] = before_cursor
if include_metadata is not None:
payload["include_metadata"] = include_metadata
if limit is not None:
payload["limit"] = limit
join_response = await channel.join(payload)
return cls(channel, join_response)

# Join a user-scoped thread by ID, optionally supplying local tools for a personal thread
@staticmethod
def topic_user_thread(thread_id: str) -> str:
Expand Down
6 changes: 3 additions & 3 deletions src/archastro/platform/client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2026 ArchAstro Inc. Licensed under the MIT License.
# This file is auto-generated by @archastro/sdk-generator. Do not edit.
# Content hash: 6a1a025e96fb
# Content hash: 740a9271cb0f

from urllib.parse import urlparse, urlunparse

Expand Down Expand Up @@ -47,6 +47,7 @@ def __init__(
self.agent_skills = self.v1.agent_skills
self.agent_tools = self.v1.agent_tools
self.agents = self.v1.agents
self.ai = self.v1.ai
self.artifacts = self.v1.artifacts
self.automation_runs = self.v1.automation_runs
self.automations = self.v1.automations
Expand Down Expand Up @@ -89,7 +90,6 @@ def __init__(
self.users = self.v1.users
self.work_items = self.v1.work_items
self.workflows = self.v1.workflows
self.ai = self.v1.ai
self.oauth = self.v1.oauth
self._refresh_token: str | None = None
self._extra_http_clients: list[HttpClient] = []
Expand Down Expand Up @@ -285,6 +285,7 @@ def __init__(
self.agent_skills = self.v1.agent_skills
self.agent_tools = self.v1.agent_tools
self.agents = self.v1.agents
self.ai = self.v1.ai
self.artifacts = self.v1.artifacts
self.automation_runs = self.v1.automation_runs
self.automations = self.v1.automations
Expand Down Expand Up @@ -327,7 +328,6 @@ def __init__(
self.users = self.v1.users
self.work_items = self.v1.work_items
self.workflows = self.v1.workflows
self.ai = self.v1.ai
self.oauth = self.v1.oauth
self._refresh_token: str | None = None
self._extra_http_clients: list[SyncHttpClient] = []
Expand Down
83 changes: 81 additions & 2 deletions src/archastro/platform/types/ai.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Copyright (c) 2026 ArchAstro Inc. Licensed under the MIT License.
# This file is auto-generated by @archastro/sdk-generator. Do not edit.
# Content hash: 7e0accb3214e
# Content hash: a2885af89722

from typing import Any
from typing import Annotated, Any, Literal

from pydantic import BaseModel, Field

Expand Down Expand Up @@ -215,6 +215,85 @@ class AICompletionResult(BaseModel):
)


class AIEvaluationAnswerBoolean(BaseModel):
"""
Probability that the statement is true, in `[0, 1]`.
"""

id: str
probability: float
type: Literal["boolean"] = "boolean"


class AIEvaluationAnswerChoice(BaseModel):
"""
Selected option plus the full probability distribution.
"""

choice: str
confidence: float | None = None
id: str
probabilities: dict[str, Any]
type: Literal["choice"] = "choice"


class AIEvaluationAnswerScore(BaseModel):
"""
Probability-weighted position along the caller-defined levels.
"""

confidence: float | None = None
id: str
legend: dict[str, Any]
probabilities: dict[str, Any]
score: float
type: Literal["score"] = "score"


# One typed evaluation answer. `type` selects boolean, choice, or score.
# `id` matches the question id.
AIEvaluationAnswer = Annotated[
AIEvaluationAnswerBoolean | AIEvaluationAnswerChoice | AIEvaluationAnswerScore,
Field(discriminator="type"),
]


class AIEvaluationUsage(BaseModel):
"""
Token counts for one evaluation request.
"""

input_tokens: int | None = Field(
default=None,
description="Provider-reported input tokens. `null` when the provider omitted the count.",
)
output_tokens: int | None = Field(
default=None,
description="Provider-reported output tokens. `null` when the provider omitted the count.",
)


class AIEvaluationResult(BaseModel):
"""
Result of an evaluation request: typed answers, the model that ran, and
token usage.
"""

answers: list[AIEvaluationAnswer] = Field(
...,
description="Typed answers. Each value is a boolean, choice, or score object with the question `id`.",
)
model: str = Field(..., description="Model identifier that produced the answers.")
session_id: str | None = Field(
default=None,
description="UUID grouping this evaluation's usage record. Generated when omitted on the request.",
)
usage: AIEvaluationUsage | None = Field(
default=None,
description="Token usage for this request. `null` when usage data is unavailable.",
)


class AIImageResult(BaseModel):
"""
The result returned by an AI image generation or editing operation. Contains the generated image (as inline data or a URL) along with dimension, size, and usage metadata.
Expand Down
10 changes: 7 additions & 3 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. Licensed under the MIT License.
# This file is auto-generated by @archastro/sdk-generator. Do not edit.
# Content hash: de3c1b188a0c
# Content hash: dbf264aff25a

from datetime import datetime
from typing import Annotated, Any, Literal
Expand Down Expand Up @@ -417,6 +417,10 @@ class Attachment(BaseModel):
default=None,
description="Width in pixels of the scraped preview image. Present on `scraped_link` type only. `null` otherwise.",
)
key: str | None = Field(
default=None,
description='For `structured_data` type, what the data is about as set by the sender (for example `"pr:14963"`), copied from the record so it can be read without `object`. Not unique. `null` when unset and on other types.',
)
media_type: str | None = Field(
default=None,
description='The media category, e.g. `"video"` or `"audio"`. Present on `media` type only; omitted otherwise.',
Expand All @@ -427,15 +431,15 @@ class Attachment(BaseModel):
)
object: dict[str, Any] | None = Field(
default=None,
description="The full embedded object payload. For `task` type, contains the task record. For `action` type, contains the action definition. For `chart` type, contains the chart with its inline `spec`. Omitted on other types.",
description="The full embedded object payload. For `task` type, contains the task record. For `action` type, contains the action definition. For `chart` type, contains the chart with its inline `spec`. For `structured_data` type, contains the inline `data` and the `schema_url` or `schema_config` naming its JSON Schema. Omitted on other types.",
)
title: str | None = Field(
default=None,
description="Display title. The page title for `scraped_link`, the artifact name for `artifact`, and the task title for `task` types. `null` on other types.",
)
type: str = Field(
...,
description='The attachment type. One of `"file"`, `"scraped_link"`, `"artifact"`, `"task"`, `"media"`, `"action"`, or `"chart"`. Determines which additional fields are present.',
description='The attachment type. One of `"file"`, `"scraped_link"`, `"artifact"`, `"task"`, `"media"`, `"action"`, `"chart"`, or `"structured_data"`. Determines which additional fields are present.',
)
url: str | None = Field(
default=None,
Expand Down
16 changes: 15 additions & 1 deletion src/archastro/platform/types/teams.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2026 ArchAstro Inc. Licensed under the MIT License.
# This file is auto-generated by @archastro/sdk-generator. Do not edit.
# Content hash: bd3fc30a03ad
# Content hash: 6ab488d596c8

from datetime import datetime
from typing import Any
Expand Down Expand Up @@ -63,6 +63,20 @@ class Team(BaseModel):
)


class TeamDeleteImpactResponse(BaseModel):
"""
The stored custom-object rows that a Team deletion will physically remove.
"""

custom_object_count: int = Field(
..., description="All custom-object rows owned by the Team, including soft-deleted rows."
)
custom_objects_physically_deleted: bool = Field(
...,
description="Whether Team deletion physically deletes these rows; no restore is provided.",
)


class TeamInvite(BaseModel):
"""
A team invite containing a short alphanumeric code that other users can present to join the team.
Expand Down
8 changes: 4 additions & 4 deletions src/archastro/platform/types/threads.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2026 ArchAstro Inc. Licensed under the MIT License.
# This file is auto-generated by @archastro/sdk-generator. Do not edit.
# Content hash: 60f997dab0c6
# Content hash: fed6220aebf2

from datetime import datetime
from typing import Any, Literal
Expand Down Expand Up @@ -65,7 +65,7 @@ class Thread(BaseModel):
)
kind: str | None = Field(
default=None,
description='Thread subtype: `"standard"` for ordinary threads, `"personal"` for a user-and-owned-agents roster, `"slack_mirror"` for the membership-strict mirror of a Slack channel, or `"slashwork_mirror"` for the membership-strict mirror of a Slashwork group. `personal` is an explicit user-thread creation option; mirror kinds are server-derived.',
description='Thread subtype: `"standard"` for ordinary threads, `"personal"` for a user-and-owned-agents roster, `"feed"` for a post feed with inline replies, `"slack_mirror"` for the membership-strict mirror of a Slack channel, or `"slashwork_mirror"` for the membership-strict mirror of a Slashwork group. `personal` and `feed` are explicit creation options; mirror kinds are server-derived.',
)
last_activity: str | None = Field(
default=None,
Expand Down Expand Up @@ -158,9 +158,9 @@ class Thread(BaseModel):
default=None,
description="ID of the user who owns this thread (`usr_...`). `null` for team-owned or agent-owned threads.",
)
visibility: Literal["team", "restricted", "private"] = Field(
visibility: Literal["team", "restricted", "private", "org"] = Field(
...,
description="Who can read the thread: `team` for every owning-team member, `restricted` for team-readable threads with an explicit roster, or `private` for roster-only access.",
description="Who can read the thread: `team` for every owning-team member, `restricted` for team-readable threads with an explicit roster, `private` for roster-only access, or `org` for every member of the owning organization.",
)


Expand Down
6 changes: 3 additions & 3 deletions src/archastro/platform/v1/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2026 ArchAstro Inc. Licensed under the MIT License.
# This file is auto-generated by @archastro/sdk-generator. Do not edit.
# Content hash: 54d6fea29e1b
# Content hash: a79a7ec7a9c5

from ..runtime.http_client import HttpClient, SyncHttpClient
from .resources.activity_feed import ActivityFeedResource, AsyncActivityFeedResource
Expand Down Expand Up @@ -100,6 +100,7 @@ def __init__(self, http: SyncHttpClient):
self.agent_skills = AgentSkillResource(http)
self.agent_tools = AgentToolResource(http)
self.agents = AgentResource(http)
self.ai = AiResource(http)
self.artifacts = ArtifactResource(http)
self.automation_runs = AutomationRunResource(http)
self.automations = AutomationResource(http)
Expand Down Expand Up @@ -142,7 +143,6 @@ def __init__(self, http: SyncHttpClient):
self.users = UserResource(http)
self.work_items = WorkItemResource(http)
self.workflows = WorkflowResource(http)
self.ai = AiResource(http)
self.oauth = OauthResource(http)


Expand All @@ -159,6 +159,7 @@ def __init__(self, http: HttpClient):
self.agent_skills = AsyncAgentSkillResource(http)
self.agent_tools = AsyncAgentToolResource(http)
self.agents = AsyncAgentResource(http)
self.ai = AsyncAiResource(http)
self.artifacts = AsyncArtifactResource(http)
self.automation_runs = AsyncAutomationRunResource(http)
self.automations = AsyncAutomationResource(http)
Expand Down Expand Up @@ -201,5 +202,4 @@ def __init__(self, http: HttpClient):
self.users = AsyncUserResource(http)
self.work_items = AsyncWorkItemResource(http)
self.workflows = AsyncWorkflowResource(http)
self.ai = AsyncAiResource(http)
self.oauth = AsyncOauthResource(http)
2 changes: 1 addition & 1 deletion src/archastro/platform/v1/resources/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2026 ArchAstro Inc. Licensed under the MIT License.
# This file is auto-generated by @archastro/sdk-generator. Do not edit.
# Content hash: 3a194bfa6a9b
# Content hash: 6852079bf2dc

from .activity_feed import (
ActivityFeedResource, # noqa: F401
Expand Down
Loading
Loading