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
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9,072 changes: 8,637 additions & 435 deletions specs/platform-openapi.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/archastro/platform/__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: d14486b6976e
# Content hash: 1c08783af6ac

from importlib.metadata import version as _pkg_version

Expand Down
154 changes: 119 additions & 35 deletions src/archastro/platform/auth.py

Large diffs are not rendered by default.

137 changes: 136 additions & 1 deletion 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: 068983a8456f
# Content hash: 516661809198

from collections.abc import Callable
from datetime import datetime
Expand Down Expand Up @@ -32,19 +32,43 @@ class ApiChatLoadMoreMessagesInput(TypedDict, total=False):
limit: int


class ApiChatPostMessageInputContextItem(TypedDict, total=False):
attributes: dict[str, Any] | None
"Scalar key-value fields describing the context, such as route, repository, or pull-request number."
content: str | None
"Optional context body. The model receives it as escaped XML data, not a system instruction."
title: str | None
"Optional human-readable label for this context block."
type: Required[str]
"Stable context kind. Must start with a lowercase letter and contain only lowercase letters, numbers, dots, dashes, or underscores."


class ApiChatPostMessageInput(TypedDict, total=False):
"Post a new message with optional uploads and reply-to"

content: Required[str]
context: list[ApiChatPostMessageInputContextItem]
idempotency_key: str
reply_to: str
uploads: list[dict[str, Any]]


class ApiChatPostSimpleMessageInputContextItem(TypedDict, total=False):
attributes: dict[str, Any] | None
"Scalar key-value fields describing the context, such as route, repository, or pull-request number."
content: str | None
"Optional context body. The model receives it as escaped XML data, not a system instruction."
title: str | None
"Optional human-readable label for this context block."
type: Required[str]
"Stable context kind. Must start with a lowercase letter and contain only lowercase letters, numbers, dots, dashes, or underscores."


class ApiChatPostSimpleMessageInput(TypedDict, total=False):
"Post a simple text message"

content: str
context: list[ApiChatPostSimpleMessageInputContextItem]
idempotency_key: str
reply_to: str

Expand Down Expand Up @@ -82,6 +106,35 @@ class ApiChatTypingInput(TypedDict):
is_typing: bool


class ApiChatPublishLocalToolsInputLocalToolsItemFunction(TypedDict):
description: str
name: str
parameters: dict[str, Any]


class ApiChatPublishLocalToolsInputLocalToolsItem(TypedDict):
function: ApiChatPublishLocalToolsInputLocalToolsItemFunction
"A function implemented by the client connected to a personal thread."
type: Literal["function"]


class ApiChatPublishLocalToolsInput(TypedDict):
"Replace the local tools advertised by this connection for later messages it posts"

local_tool_provider_id: str
local_tools: list[ApiChatPublishLocalToolsInputLocalToolsItem]


class ApiChatLocalToolResultInput(TypedDict):
"Return one complete result batch for a connection-local tool request"

agent_id: str
generation: int
provider_id: str
request_id: str
results: list[dict[str, Any] | dict[str, Any] | dict[str, Any]]


class MessageAddedPayloadMessageAclAddItem(TypedDict, total=False):
actions: Required[list[str]]
'Array of action strings the principal is permitted to perform, e.g. `["read", "write"]`. Must contain at least one entry.'
Expand Down Expand Up @@ -242,6 +295,17 @@ class MessageAddedPayloadMessageAttachmentsItem(TypedDict, total=False):
"Width in pixels of the media item. Present on `media` type only. `null` otherwise."


class MessageAddedPayloadMessageContextItem(TypedDict, total=False):
attributes: dict[str, Any] | None
"Scalar key-value fields describing the context, such as route, repository, or pull-request number."
content: str | None
"Optional context body. The model receives it as escaped XML data, not a system instruction."
title: str | None
"Optional human-readable label for this context block."
type: Required[str]
"Stable context kind. Must start with a lowercase letter and contain only lowercase letters, numbers, dots, dashes, or underscores."


class MessageAddedPayloadMessageReactionsItem(TypedDict, total=False):
payload: dict[str, Any] | None
'Type-specific reaction data. For `"emoji_reaction"` reactions, contains an `emoji` key with the Unicode emoji string (e.g., `" "`).'
Expand All @@ -266,6 +330,8 @@ class MessageAddedPayloadMessage(TypedDict, total=False):
"ID of the thread that was branched from this message (`thr_...`). `null` if this message has not spawned a branch thread."
content: str | None
"Text content of the message. `null` for messages that contain only attachments."
context: list[MessageAddedPayloadMessageContextItem] | None
"Immutable structured context captured when the message was posted. Each entry has `type`, optional `title` and `content`, and scalar `attributes`. Always present; defaults to an empty array. Context is delivered to agents as escaped XML data, not as system instructions."
created_at: str | None
"When the message was posted (ISO 8601)."
has_replies: bool | None
Expand Down Expand Up @@ -482,6 +548,17 @@ class MessageUpdatedPayloadMessageAttachmentsItem(TypedDict, total=False):
"Width in pixels of the media item. Present on `media` type only. `null` otherwise."


class MessageUpdatedPayloadMessageContextItem(TypedDict, total=False):
attributes: dict[str, Any] | None
"Scalar key-value fields describing the context, such as route, repository, or pull-request number."
content: str | None
"Optional context body. The model receives it as escaped XML data, not a system instruction."
title: str | None
"Optional human-readable label for this context block."
type: Required[str]
"Stable context kind. Must start with a lowercase letter and contain only lowercase letters, numbers, dots, dashes, or underscores."


class MessageUpdatedPayloadMessageReactionsItem(TypedDict, total=False):
payload: dict[str, Any] | None
'Type-specific reaction data. For `"emoji_reaction"` reactions, contains an `emoji` key with the Unicode emoji string (e.g., `" "`).'
Expand All @@ -506,6 +583,8 @@ class MessageUpdatedPayloadMessage(TypedDict, total=False):
"ID of the thread that was branched from this message (`thr_...`). `null` if this message has not spawned a branch thread."
content: str | None
"Text content of the message. `null` for messages that contain only attachments."
context: list[MessageUpdatedPayloadMessageContextItem] | None
"Immutable structured context captured when the message was posted. Each entry has `type`, optional `title` and `content`, and scalar `attributes`. Always present; defaults to an empty array. Context is delivered to agents as escaped XML data, not as system instructions."
created_at: str | None
"When the message was posted (ISO 8601)."
has_replies: bool | None
Expand Down Expand Up @@ -611,6 +690,38 @@ class TypingPayload(TypedDict, total=False):
thread_id: str | None


class LocalToolCallPayloadRequestCallsItem(TypedDict):
arguments: dict[str, Any]
id: str
name: str


class LocalToolCallPayloadRequest(TypedDict):
calls: list[LocalToolCallPayloadRequestCallsItem]
id: str


class LocalToolCallPayload(TypedDict, total=False):
"Invoke local functions on the exact connection that published them"

agent_id: str | None
expires_at: datetime | None
generation: int | None
provider_id: str | None
request: LocalToolCallPayloadRequest | None
"A correlated batch of local function calls targeted to one connection."
thread_id: str | None


class LocalToolCancelledPayload(TypedDict, total=False):
"Stop local work because the server no longer accepts its result"

generation: int | None
provider_id: str | None
reason: str | None
request_id: str | None


# Channel for real-time chat messaging.
# Supports team-scoped and user-scoped threads with keyed, transient, and direct
# thread access patterns.
Expand Down Expand Up @@ -868,6 +979,18 @@ async def api_chat_remove_reaction(self, payload: ApiChatRemoveReactionInput) ->
async def api_chat_typing(self, payload: ApiChatTypingInput) -> dict[str, Any]:
return await self._channel.push("api:chat:typing", payload)

# Replace the local tools advertised by this connection for later messages it posts
async def api_chat_publish_local_tools(
self, payload: ApiChatPublishLocalToolsInput
) -> dict[str, Any]:
return await self._channel.push("api:chat:publish_local_tools", payload)

# Return one complete result batch for a connection-local tool request
async def api_chat_local_tool_result(
self, payload: ApiChatLocalToolResultInput
) -> dict[str, Any]:
return await self._channel.push("api:chat:local_tool_result", payload)

# Broadcast when a new message is added to a thread
def on_message_added(
self, callback: Callable[[MessageAddedPayload], None]
Expand All @@ -891,3 +1014,15 @@ def on_system_event(self, callback: Callable[[SystemEventPayload], None]) -> Cal
# Broadcast when a participant (human or agent) starts or stops typing. Ephemeral; never persisted.
def on_typing(self, callback: Callable[[TypingPayload], None]) -> Callable[[], None]:
return self._channel.on("typing", callback)

# Invoke local functions on the exact connection that published them
def on_local_tool_call(
self, callback: Callable[[LocalToolCallPayload], None]
) -> Callable[[], None]:
return self._channel.on("local_tool_call", callback)

# Stop local work because the server no longer accepts its result
def on_local_tool_cancelled(
self, callback: Callable[[LocalToolCancelledPayload], None]
) -> Callable[[], None]:
return self._channel.on("local_tool_cancelled", callback)
6 changes: 4 additions & 2 deletions src/archastro/platform/channels/api_tasks_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: 426450fa3df6
# Content hash: 581f4d31d853

from collections.abc import Callable
from datetime import datetime
Expand Down Expand Up @@ -78,6 +78,8 @@ class TasksUpdatedPayloadTasksItemOwnerActor(TypedDict, total=False):
class TasksUpdatedPayloadTasksItem(TypedDict, total=False):
agent: str | None
"ID of the agent that owns this task (`agi_...`). `null` if the task is scoped to a team or user."
aggregate_version: int | None
"Event-stream version for optimistic update fencing. Pass this value as `expected_version` on an update to reject concurrent writes."
blocked_by_count: int | None
"Number of tasks marked as blocking this task, whether or not they are done (see `GET /tasks/{task}/blockers`). Computed on list/show reads; create/update responses may lag one read behind."
closed_at: datetime | None
Expand Down Expand Up @@ -131,7 +133,7 @@ class TasksUpdatedPayloadTasksItem(TypedDict, total=False):
source_type: str | None
"Kind of source object (for example `repository`). `null` when the task has no source."
status: Required[str]
'Current status of the task. One of `"open"`, `"in_progress"`, or `"done"`.'
'Current status of the task. One of `"open"`, `"in_progress"`, `"in_review"`, `"paused"`, `"failed"`, `"superseding"`, `"done"`, or `"cancelled"`.'
subtasks_count: int | None
"Number of subtasks under this task. Computed on list/show reads; create/update responses may report 0 until the next read. Always 0 for subtasks."
tags: list[str] | None
Expand Down
12 changes: 11 additions & 1 deletion 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: f24da3972099
# Content hash: 6a1a025e96fb

from urllib.parse import urlparse, urlunparse

Expand Down Expand Up @@ -55,6 +55,8 @@ def __init__(
self.custom_objects = self.v1.custom_objects
self.event_subscription_deliveries = self.v1.event_subscription_deliveries
self.event_subscriptions = self.v1.event_subscriptions
self.external_object_capabilities = self.v1.external_object_capabilities
self.external_objects = self.v1.external_objects
self.extractions = self.v1.extractions
self.files = self.v1.files
self.installation_sources = self.v1.installation_sources
Expand All @@ -70,11 +72,13 @@ def __init__(
self.private_service_enrollments = self.v1.private_service_enrollments
self.private_services = self.v1.private_services
self.sandboxes = self.v1.sandboxes
self.scripts = self.v1.scripts
self.slack_channel_bindings = self.v1.slack_channel_bindings
self.solution_categories = self.v1.solution_categories
self.solution_instances = self.v1.solution_instances
self.solution_tags = self.v1.solution_tags
self.solutions = self.v1.solutions
self.ssh_keys = self.v1.ssh_keys
self.status = self.v1.status
self.tasks = self.v1.tasks
self.team_memberships = self.v1.team_memberships
Expand All @@ -84,6 +88,7 @@ def __init__(
self.trajectories = self.v1.trajectories
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
Expand Down Expand Up @@ -288,6 +293,8 @@ def __init__(
self.custom_objects = self.v1.custom_objects
self.event_subscription_deliveries = self.v1.event_subscription_deliveries
self.event_subscriptions = self.v1.event_subscriptions
self.external_object_capabilities = self.v1.external_object_capabilities
self.external_objects = self.v1.external_objects
self.extractions = self.v1.extractions
self.files = self.v1.files
self.installation_sources = self.v1.installation_sources
Expand All @@ -303,11 +310,13 @@ def __init__(
self.private_service_enrollments = self.v1.private_service_enrollments
self.private_services = self.v1.private_services
self.sandboxes = self.v1.sandboxes
self.scripts = self.v1.scripts
self.slack_channel_bindings = self.v1.slack_channel_bindings
self.solution_categories = self.v1.solution_categories
self.solution_instances = self.v1.solution_instances
self.solution_tags = self.v1.solution_tags
self.solutions = self.v1.solutions
self.ssh_keys = self.v1.ssh_keys
self.status = self.v1.status
self.tasks = self.v1.tasks
self.team_memberships = self.v1.team_memberships
Expand All @@ -317,6 +326,7 @@ def __init__(
self.trajectories = self.v1.trajectories
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
Expand Down
7 changes: 6 additions & 1 deletion src/archastro/platform/types/__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: e6e437459282
# Content hash: e091b32c718b

from .ai import * # noqa: F401,F403
from .artifacts import * # noqa: F401,F403
Expand All @@ -9,14 +9,19 @@
from .common import * # noqa: F401,F403
from .config import * # noqa: F401,F403
from .device import * # noqa: F401,F403
from .events import * # noqa: F401,F403
from .expressions import * # noqa: F401,F403
from .extractions import * # noqa: F401,F403
from .graph import * # noqa: F401,F403
from .image import * # noqa: F401,F403
from .invites import * # noqa: F401,F403
from .notifications import * # noqa: F401,F403
from .oauth import * # noqa: F401,F403
from .scripts import * # noqa: F401,F403
from .status import * # noqa: F401,F403
from .system import * # noqa: F401,F403
from .tasks import * # noqa: F401,F403
from .teams import * # noqa: F401,F403
from .threads import * # noqa: F401,F403
from .users import * # noqa: F401,F403
from .workflows import * # noqa: F401,F403
10 changes: 9 additions & 1 deletion src/archastro/platform/types/ai.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: 9ba45d20ba35
# Content hash: 7e0accb3214e

from typing import Any

Expand Down Expand Up @@ -252,6 +252,10 @@ class AIImageResult(BaseModel):
default=None,
description="The prompt as rewritten by the provider before generation. Some providers (e.g. DALL-E 3) automatically expand or safety-check the original prompt. `null` when the provider does not revise prompts.",
)
session_id: str | None = Field(
default=None,
description="UUID grouping this image request's provider attempts for usage and billing.",
)
size: str | None = Field(
default=None,
description='Canonical size string as returned by the provider, e.g. `"1024x1024"`. `null` when not reported.',
Expand All @@ -260,6 +264,10 @@ class AIImageResult(BaseModel):
default=None,
description="Provider-reported token and compute usage for the request. Structure varies by provider. `null` when usage data is unavailable.",
)
usage_attempt_count: int | None = Field(
default=None,
description="Number of provider responses contributing usage records to this request, including image-generation retries.",
)
width: int | None = Field(
default=None,
description="Width of the generated image in pixels. `null` when the provider does not report dimensions.",
Expand Down
Loading
Loading