From 445cda567764f30b3b44854fc49daa6b9072a09e Mon Sep 17 00:00:00 2001 From: Calvin Grunewald Date: Sat, 25 Apr 2026 12:47:16 -0700 Subject: [PATCH] chore: regenerate Python SDK with typed query params, response models, datetime, and hoisted nested types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Picks up the four typing improvements landing in ArchAstro/archastro-openapi#14: - `format: date-time` fields are typed as `datetime` (ruff rewrites the post-emit `Optional[datetime]` to `datetime | None`). - Resource methods drop `**params` for typed kw-only query args (`page: int | None = None`, etc.); the call site builds a `query: dict[str, object] = {}` so `None` kwargs never hit the wire as `?key=null`. - Inline-object response schemas produce sibling `{ResourceShort}{Op}Response` Pydantic models, replacing every `dict[str, object]` return for ops whose response shape was described in the spec. - Nested inline objects in inputs / response models / channel payloads are hoisted as named sibling types (`{Parent}{FieldPascal}`, `…Item` for arrays, `…Value` for maps). Empty objects keep `dict[str, object]` (genuine freeform metadata bags). Net effect across the SDK: zero `**params` and zero `dict[str, object]` returns from inline schemas remain; deeply-nested shapes like ACL grants and pagination wrappers are now fully typed. Verified: 51 unit + harness, 670 REST contract, 51 channel contract = 772 tests passing. ruff clean. `uv build` produces a working wheel. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../channels/api_activity_feed_channel.py | 22 +- .../platform/channels/api_chat_channel.py | 339 +++++++++- .../platform/channels/api_object_channel.py | 31 +- src/archastro/platform/types/agents.py | 45 +- src/archastro/platform/types/artifacts.py | 7 +- src/archastro/platform/types/automations.py | 7 +- src/archastro/platform/types/common.py | 35 +- src/archastro/platform/types/config.py | 9 +- src/archastro/platform/types/teams.py | 13 +- src/archastro/platform/types/threads.py | 9 +- src/archastro/platform/types/users.py | 5 +- .../platform/v1/resources/activity_feed.py | 71 ++- .../platform/v1/resources/agent_computers.py | 11 +- .../v1/resources/agent_installations.py | 28 +- .../platform/v1/resources/agent_routines.py | 125 +++- .../platform/v1/resources/agent_sessions.py | 56 +- .../platform/v1/resources/agent_skills.py | 27 +- .../platform/v1/resources/agent_tools.py | 30 +- src/archastro/platform/v1/resources/agents.py | 343 +++++++++- src/archastro/platform/v1/resources/ai.py | 116 +++- .../platform/v1/resources/artifacts.py | 22 +- .../platform/v1/resources/automations.py | 11 +- src/archastro/platform/v1/resources/config.py | 248 +++++++- .../platform/v1/resources/custom_objects.py | 43 +- .../platform/v1/resources/invites.py | 10 +- src/archastro/platform/v1/resources/kv.py | 51 +- src/archastro/platform/v1/resources/orgs.py | 33 +- .../platform/v1/resources/team_memberships.py | 25 +- src/archastro/platform/v1/resources/teams.py | 599 +++++++++++++++++- .../platform/v1/resources/thread_messages.py | 54 +- .../platform/v1/resources/threads.py | 284 ++++++++- src/archastro/platform/v1/resources/users.py | 355 ++++++++++- 32 files changed, 2826 insertions(+), 238 deletions(-) diff --git a/src/archastro/platform/channels/api_activity_feed_channel.py b/src/archastro/platform/channels/api_activity_feed_channel.py index 23f2d90..f735bb6 100644 --- a/src/archastro/platform/channels/api_activity_feed_channel.py +++ b/src/archastro/platform/channels/api_activity_feed_channel.py @@ -1,13 +1,27 @@ # Copyright (c) 2026 ArchAstro Inc. All Rights Reserved. # This file is auto-generated by @archastro/sdk-generator. Do not edit. -# Content hash: dd35ef8c137c +# Content hash: 12874ed2facb -from typing import TYPE_CHECKING +from collections.abc import Callable +from typing import TYPE_CHECKING, TypedDict if TYPE_CHECKING: from archastro.phx_channel.socket import Socket +# List activity feed entries with cursor-based pagination +class ListEntriesInput(TypedDict, total=False): + after_cursor: str + before_cursor: str + kind: str + level: str + limit: int + + +class NewEntryPayload(TypedDict, total=False): + entry: dict[str, object] | None + + # Phoenix channel for real-time activity feed updates. # Clients join a topic scoped to an agent or org and receive # `new_entry` events as feed entries are created. @@ -50,8 +64,8 @@ async def leave(self): await self._channel.leave() # List activity feed entries with cursor-based pagination - async def list_entries(self, payload: dict) -> dict: + async def list_entries(self, payload: ListEntriesInput) -> dict[str, object]: return await self._channel.push("list_entries", payload) - def on_new_entry(self, callback): + def on_new_entry(self, callback: Callable[[NewEntryPayload], None]) -> Callable[[], None]: return self._channel.on("new_entry", callback) diff --git a/src/archastro/platform/channels/api_chat_channel.py b/src/archastro/platform/channels/api_chat_channel.py index 6a2647b..c090f38 100644 --- a/src/archastro/platform/channels/api_chat_channel.py +++ b/src/archastro/platform/channels/api_chat_channel.py @@ -1,13 +1,306 @@ # Copyright (c) 2026 ArchAstro Inc. All Rights Reserved. # This file is auto-generated by @archastro/sdk-generator. Do not edit. -# Content hash: 43a5e72f8141 +# Content hash: 778ff3bdf540 -from typing import TYPE_CHECKING +from collections.abc import Callable +from datetime import datetime +from typing import TYPE_CHECKING, Required, TypedDict if TYPE_CHECKING: from archastro.phx_channel.socket import Socket +# Fork a sub-thread from an existing message +class ApiChatForkThreadInput(TypedDict, total=False): + message_id: Required[str] + title: str + + +# Mark a thread as read up to a given message +class ApiChatMarkThreadReadInput(TypedDict): + message_id: str + + +# Load additional messages with cursor-based pagination +class ApiChatLoadMoreMessagesInput(TypedDict, total=False): + after_cursor: str + before_cursor: str + include_metadata: bool + limit: int + + +# Post a new message with optional uploads and reply-to +class ApiChatPostMessageInput(TypedDict, total=False): + content: Required[str] + idempotency_key: str + reply_to: str + uploads: list[dict[str, object]] + + +# Post a simple text message +class ApiChatPostSimpleMessageInput(TypedDict, total=False): + content: str + idempotency_key: str + reply_to: str + + +# Edit an existing message's content +class ApiChatEditMessageInput(TypedDict): + content: str + message_id: str + + +# Delete a message +class ApiChatDeleteMessageInput(TypedDict): + message_id: str + + +# Add an emoji reaction to a message +class ApiChatAddReactionInput(TypedDict): + emoji: str + message_id: str + + +# Remove an emoji reaction from a message +class ApiChatRemoveReactionInput(TypedDict): + emoji: str + message_id: str + + +class MessageAddedPayloadMessageActorsItemProfilePicture(TypedDict, total=False): + file: str | None # Storage file + height: int | None # Image height in pixels + media: str | None # Media + mime_type: str | None # Image MIME type + refresh_url: str | None # URL to refresh signed URL + url: str | None # Image URL + width: int | None # Image width in pixels + + +class MessageAddedPayloadMessageActorsItem(TypedDict, total=False): + alias: str | None # Actor alias/handle + id: str | None # Actor ID (format: user-xxx or agent-xxx) + name: str | None # Actor display name + profile_picture: MessageAddedPayloadMessageActorsItemProfilePicture | None # Profile picture + + +class MessageAddedPayloadMessageAttachmentsItemImageSource(TypedDict, total=False): + file: str | None # Storage file + height: int | None # Image height in pixels + media: str | None # Media + mime_type: str | None # Image MIME type + refresh_url: str | None # URL to refresh signed URL + url: str | None # Image URL + width: int | None # Image width in pixels + + +class MessageAddedPayloadMessageAttachmentsItemVariantsItemImageSource(TypedDict, total=False): + file: str | None # Storage file + height: int | None # Image height in pixels + media: str | None # Media + mime_type: str | None # Image MIME type + refresh_url: str | None # URL to refresh signed URL + url: str | None # Image URL + width: int | None # Image width in pixels + + +class MessageAddedPayloadMessageAttachmentsItemVariantsItem(TypedDict, total=False): + content_type: str | None # File content type + created_at: datetime | None # Creation timestamp + file: str | None # Storage file + filename: str | None # Original filename + height: int | None # Height in pixels + id: Required[str] # Variant ID + image_source: MessageAddedPayloadMessageAttachmentsItemVariantsItemImageSource | None + updated_at: datetime | None # Last update timestamp + url: str | None # Signed download URL + variant_key: str | None # Variant key (original, thumbnail, etc) + width: int | None # Width in pixels + + +class MessageAddedPayloadMessageAttachmentsItem(TypedDict, total=False): + content_type: str | None # MIME content type (file, artifact, media types) + description: str | None # Description (scraped_link, artifact, task types) + filename: str | None # File name (file, artifact, media types) + height: int | None # Media height (media type) + id: Required[str] # Attachment ID + image_height: int | None # Preview image height (scraped_link type) + image_source: MessageAddedPayloadMessageAttachmentsItemImageSource | None + image_url: str | None # Preview image URL (scraped_link type) + image_width: int | None # Preview image width (scraped_link type) + media_type: str | None # Media type (media type) + name: str | None # Media name (media type) + object: dict[str, object] | None # Embedded object (task, action types) + title: str | None # Title (scraped_link, artifact, task types) + type: Required[str] # Attachment type: file, scraped_link, artifact, task, media, action + url: str | None # URL to the resource (file, scraped_link, artifact, media types) + variants: list[MessageAddedPayloadMessageAttachmentsItemVariantsItem] | None + version: int | None # Artifact version number (artifact type) + width: int | None # Media width (media type) + + +class MessageAddedPayloadMessageReactionsItem(TypedDict, total=False): + payload: dict[str, object] | None # Reaction payload (e.g., {emoji: 'πŸ‘'}) + type: Required[str] # Reaction type (e.g., emoji_reaction) + user: str | None # User who added the reaction + + +class MessageAddedPayloadMessage(TypedDict, total=False): + actors: list[MessageAddedPayloadMessageActorsItem] | None # Message actors + agent: str | None # Agent if sent by an agent user + attachments: list[MessageAddedPayloadMessageAttachmentsItem] | None # Message attachments + branched_thread: str | None # Branched thread (if message spawned a thread) + content: str | None # Message content + created_at: datetime | None # Creation timestamp + has_replies: bool | None # Whether message has replies + id: Required[str] # Message ID (msg_...) + idempotency_key: str | None # Client-provided idempotency key + legacy_agent: str | None # Legacy agent if sent by legacy chat agent + metadata: dict[str, object] | None # Message metadata + org: str | None # Organization + reactions: list[MessageAddedPayloadMessageReactionsItem] | None # Message reactions + rendering_mode: str | None # Rendering mode hint + replies: list[dict[str, object]] | None # Inline replies (if loaded) + replies_after_cursor: str | None # Cursor for replies pagination + replies_before_cursor: str | None # Cursor for replies pagination + reply_count: int | None # Number of replies + reply_to: dict[str, object] | None # Parent message object (if loaded) + sandbox: str | None # Sandbox identifier + team: str | None # Team + thread: str | None # Parent thread + user: str | None # Author user (public ID or expanded object when loaded) + + +# Broadcast when a new message is added to a thread +class MessageAddedPayload(TypedDict, total=False): + after_cursor: str | None + before_cursor: str | None + message: MessageAddedPayloadMessage | None # API schema for a chat message. + thread_id: str | None + + +class MessageUpdatedPayloadMessageActorsItemProfilePicture(TypedDict, total=False): + file: str | None # Storage file + height: int | None # Image height in pixels + media: str | None # Media + mime_type: str | None # Image MIME type + refresh_url: str | None # URL to refresh signed URL + url: str | None # Image URL + width: int | None # Image width in pixels + + +class MessageUpdatedPayloadMessageActorsItem(TypedDict, total=False): + alias: str | None # Actor alias/handle + id: str | None # Actor ID (format: user-xxx or agent-xxx) + name: str | None # Actor display name + profile_picture: MessageUpdatedPayloadMessageActorsItemProfilePicture | None + + +class MessageUpdatedPayloadMessageAttachmentsItemImageSource(TypedDict, total=False): + file: str | None # Storage file + height: int | None # Image height in pixels + media: str | None # Media + mime_type: str | None # Image MIME type + refresh_url: str | None # URL to refresh signed URL + url: str | None # Image URL + width: int | None # Image width in pixels + + +class MessageUpdatedPayloadMessageAttachmentsItemVariantsItemImageSource(TypedDict, total=False): + file: str | None # Storage file + height: int | None # Image height in pixels + media: str | None # Media + mime_type: str | None # Image MIME type + refresh_url: str | None # URL to refresh signed URL + url: str | None # Image URL + width: int | None # Image width in pixels + + +class MessageUpdatedPayloadMessageAttachmentsItemVariantsItem(TypedDict, total=False): + content_type: str | None # File content type + created_at: datetime | None # Creation timestamp + file: str | None # Storage file + filename: str | None # Original filename + height: int | None # Height in pixels + id: Required[str] # Variant ID + image_source: MessageUpdatedPayloadMessageAttachmentsItemVariantsItemImageSource | None + updated_at: datetime | None # Last update timestamp + url: str | None # Signed download URL + variant_key: str | None # Variant key (original, thumbnail, etc) + width: int | None # Width in pixels + + +class MessageUpdatedPayloadMessageAttachmentsItem(TypedDict, total=False): + content_type: str | None # MIME content type (file, artifact, media types) + description: str | None # Description (scraped_link, artifact, task types) + filename: str | None # File name (file, artifact, media types) + height: int | None # Media height (media type) + id: Required[str] # Attachment ID + image_height: int | None # Preview image height (scraped_link type) + image_source: MessageUpdatedPayloadMessageAttachmentsItemImageSource | None + image_url: str | None # Preview image URL (scraped_link type) + image_width: int | None # Preview image width (scraped_link type) + media_type: str | None # Media type (media type) + name: str | None # Media name (media type) + object: dict[str, object] | None # Embedded object (task, action types) + title: str | None # Title (scraped_link, artifact, task types) + type: Required[str] # Attachment type: file, scraped_link, artifact, task, media, action + url: str | None # URL to the resource (file, scraped_link, artifact, media types) + variants: list[MessageUpdatedPayloadMessageAttachmentsItemVariantsItem] | None + version: int | None # Artifact version number (artifact type) + width: int | None # Media width (media type) + + +class MessageUpdatedPayloadMessageReactionsItem(TypedDict, total=False): + payload: dict[str, object] | None # Reaction payload (e.g., {emoji: 'πŸ‘'}) + type: Required[str] # Reaction type (e.g., emoji_reaction) + user: str | None # User who added the reaction + + +class MessageUpdatedPayloadMessage(TypedDict, total=False): + actors: list[MessageUpdatedPayloadMessageActorsItem] | None # Message actors + agent: str | None # Agent if sent by an agent user + attachments: list[MessageUpdatedPayloadMessageAttachmentsItem] | None # Message attachments + branched_thread: str | None # Branched thread (if message spawned a thread) + content: str | None # Message content + created_at: datetime | None # Creation timestamp + has_replies: bool | None # Whether message has replies + id: Required[str] # Message ID (msg_...) + idempotency_key: str | None # Client-provided idempotency key + legacy_agent: str | None # Legacy agent if sent by legacy chat agent + metadata: dict[str, object] | None # Message metadata + org: str | None # Organization + reactions: list[MessageUpdatedPayloadMessageReactionsItem] | None # Message reactions + rendering_mode: str | None # Rendering mode hint + replies: list[dict[str, object]] | None # Inline replies (if loaded) + replies_after_cursor: str | None # Cursor for replies pagination + replies_before_cursor: str | None # Cursor for replies pagination + reply_count: int | None # Number of replies + reply_to: dict[str, object] | None # Parent message object (if loaded) + sandbox: str | None # Sandbox identifier + team: str | None # Team + thread: str | None # Parent thread + user: str | None # Author user (public ID or expanded object when loaded) + + +# Broadcast when a message is updated or removed +class MessageUpdatedPayload(TypedDict, total=False): + message: MessageUpdatedPayloadMessage | None # API schema for a chat message. + thread_id: str | None + + +# Broadcast thread-level events (agent updates, read state, unread counts) +class ThreadEventPayload(TypedDict, total=False): + payload: dict[str, object] | None + thread_id: str | None + type: str | None + + +# Broadcast system-wide events +class SystemEventPayload(TypedDict, total=False): + event: dict[str, object] | None + + # Channel for real-time chat messaging. # Supports team-scoped and user-scoped threads with keyed, transient, and direct # thread access patterns. @@ -210,57 +503,71 @@ async def leave(self): await self._channel.leave() # Fork a sub-thread from an existing message - async def api_chat_fork_thread(self, payload: dict) -> dict: + async def api_chat_fork_thread(self, payload: ApiChatForkThreadInput) -> dict[str, object]: return await self._channel.push("api:chat:fork_thread", payload) # Mark a thread as read up to a given message - async def api_chat_mark_thread_read(self, payload: dict) -> dict: + async def api_chat_mark_thread_read( + self, payload: ApiChatMarkThreadReadInput + ) -> dict[str, object]: return await self._channel.push("api:chat:mark_thread_read", payload) # List all messages in the current thread - async def api_chat_list_messages(self, payload: dict) -> dict: + async def api_chat_list_messages(self, payload: dict) -> dict[str, object]: return await self._channel.push("api:chat:list_messages", payload) # Load additional messages with cursor-based pagination - async def api_chat_load_more_messages(self, payload: dict) -> dict: + async def api_chat_load_more_messages( + self, payload: ApiChatLoadMoreMessagesInput + ) -> dict[str, object]: return await self._channel.push("api:chat:load_more_messages", payload) # Post a new message with optional uploads and reply-to - async def api_chat_post_message(self, payload: dict) -> dict: + async def api_chat_post_message(self, payload: ApiChatPostMessageInput) -> dict[str, object]: return await self._channel.push("api:chat:post_message", payload) # Post a simple text message - async def api_chat_post_simple_message(self, payload: dict) -> dict: + async def api_chat_post_simple_message( + self, payload: ApiChatPostSimpleMessageInput + ) -> dict[str, object]: return await self._channel.push("api:chat:post_simple_message", payload) # Edit an existing message's content - async def api_chat_edit_message(self, payload: dict) -> dict: + async def api_chat_edit_message(self, payload: ApiChatEditMessageInput) -> dict[str, object]: return await self._channel.push("api:chat:edit_message", payload) # Delete a message - async def api_chat_delete_message(self, payload: dict) -> dict: + async def api_chat_delete_message( + self, payload: ApiChatDeleteMessageInput + ) -> dict[str, object]: return await self._channel.push("api:chat:delete_message", payload) # Add an emoji reaction to a message - async def api_chat_add_reaction(self, payload: dict) -> dict: + async def api_chat_add_reaction(self, payload: ApiChatAddReactionInput) -> dict[str, object]: return await self._channel.push("api:chat:add_reaction", payload) # Remove an emoji reaction from a message - async def api_chat_remove_reaction(self, payload: dict) -> dict: + async def api_chat_remove_reaction( + self, payload: ApiChatRemoveReactionInput + ) -> dict[str, object]: return await self._channel.push("api:chat:remove_reaction", payload) # Broadcast when a new message is added to a thread - def on_message_added(self, callback): + def on_message_added( + self, callback: Callable[[MessageAddedPayload], None] + ) -> Callable[[], None]: return self._channel.on("message_added", callback) # Broadcast when a message is updated or removed - def on_message_updated(self, callback): + def on_message_updated( + self, callback: Callable[[MessageUpdatedPayload], None] + ) -> Callable[[], None]: return self._channel.on("message_updated", callback) # Broadcast thread-level events (agent updates, read state, unread counts) - def on_thread_event(self, callback): + def on_thread_event(self, callback: Callable[[ThreadEventPayload], None]) -> Callable[[], None]: return self._channel.on("thread_event", callback) # Broadcast system-wide events - def on_system_event(self, callback): + def on_system_event(self, callback: Callable[[SystemEventPayload], None]) -> Callable[[], None]: return self._channel.on("system_event", callback) diff --git a/src/archastro/platform/channels/api_object_channel.py b/src/archastro/platform/channels/api_object_channel.py index 5b06724..bc74e7b 100644 --- a/src/archastro/platform/channels/api_object_channel.py +++ b/src/archastro/platform/channels/api_object_channel.py @@ -1,13 +1,28 @@ # Copyright (c) 2026 ArchAstro Inc. All Rights Reserved. # This file is auto-generated by @archastro/sdk-generator. Do not edit. -# Content hash: 0a476fd1bde0 +# Content hash: 627be1ddbbf4 -from typing import TYPE_CHECKING +from collections.abc import Callable +from typing import TYPE_CHECKING, TypedDict if TYPE_CHECKING: from archastro.phx_channel.socket import Socket +class UpdateFieldsInput(TypedDict): + fields: dict[str, object] + + +class ObjectUpdatedPayload(TypedDict, total=False): + fields: dict[str, object] | None + id: str | None + + +class ObjectCreatedPayload(TypedDict, total=False): + fields: dict[str, object] | None + id: str | None + + # Channel for real-time custom object collaboration. # Clients join `api:object:{object_id}` to receive the current object state # and subscribe to field-level updates. Mutations are sent as key:value maps. @@ -44,14 +59,18 @@ async def join_by_row_key( async def leave(self): await self._channel.leave() - async def update_fields(self, payload: dict) -> dict: + async def update_fields(self, payload: UpdateFieldsInput) -> dict[str, object]: return await self._channel.push("update_fields", payload) - async def save(self, payload: dict) -> dict: + async def save(self, payload: dict) -> dict[str, object]: return await self._channel.push("save", payload) - def on_object_updated(self, callback): + def on_object_updated( + self, callback: Callable[[ObjectUpdatedPayload], None] + ) -> Callable[[], None]: return self._channel.on("object_updated", callback) - def on_object_created(self, callback): + def on_object_created( + self, callback: Callable[[ObjectCreatedPayload], None] + ) -> Callable[[], None]: return self._channel.on("object_created", callback) diff --git a/src/archastro/platform/types/agents.py b/src/archastro/platform/types/agents.py index ba5691d..5f132bd 100644 --- a/src/archastro/platform/types/agents.py +++ b/src/archastro/platform/types/agents.py @@ -1,7 +1,8 @@ # Copyright (c) 2026 ArchAstro Inc. All Rights Reserved. # This file is auto-generated by @archastro/sdk-generator. Do not edit. -# Content hash: ca785cc1d093 +# Content hash: 403e98dea2f7 +from datetime import datetime from pydantic import BaseModel @@ -13,7 +14,7 @@ class Agent(BaseModel): acl: Acl | None = None app: str | None = None # Application - created_at: str | None = None # Creation timestamp + created_at: datetime | None = None # Creation timestamp default_model: str | None = None # Default AI model email: str | None = None # Agent email id: str # Agent ID (agi_...) @@ -25,7 +26,7 @@ class Agent(BaseModel): phone_number: str | None = None # Agent phone number sandbox: str | None = None # Sandbox team: str | None = None # Owning team - updated_at: str | None = None # Last update timestamp + updated_at: datetime | None = None # Last update timestamp user: str | None = None # Owning user @@ -34,17 +35,17 @@ class AgentComputer(BaseModel): agent: str | None = None # Owning agent app: str | None = None # Application ID config: dict[str, object] | None = None # Configuration - created_at: str | None = None # Creation timestamp + created_at: datetime | None = None # Creation timestamp error_message: str | None = None # Error message id: str # Computer ID (cmp_...) - last_active_at: str | None = None # Last active timestamp + last_active_at: datetime | None = None # Last active timestamp lookup_key: str | None = None # Unique lookup key metadata: dict[str, object] | None = None # Arbitrary metadata name: str | None = None # Computer name region: str | None = None # Region sprite_url: str | None = None # Sprite URL status: str | None = None # Computer status - updated_at: str | None = None # Last update timestamp + updated_at: datetime | None = None # Last update timestamp # List response for agent computers. @@ -77,7 +78,7 @@ class AgentRoutine(BaseModel): agent: str | None = None # Owning agent ID app: str | None = None # Application ID config: str | None = None # Config ID - created_at: str | None = None # Creation timestamp + created_at: datetime | None = None # Creation timestamp description: str | None = None # Routine description event_config: dict[str, object] | None = None # Event configuration event_type: str | None = None # Event type @@ -93,7 +94,7 @@ class AgentRoutine(BaseModel): status: str | None = None # Routine status steps: list[dict[str, object]] | None = None trigger_context: str | None = None # Trigger context - updated_at: str | None = None # Last update timestamp + updated_at: datetime | None = None # Last update timestamp # List response for agent routines. @@ -106,7 +107,7 @@ class AgentRoutineRun(BaseModel): acl: Acl | None = None agent: str | None = None # Agent app: str | None = None # Application - created_at: str | None = None # Creation timestamp + created_at: datetime | None = None # Creation timestamp duration_ms: int | None = None # Duration in milliseconds event_id: str | None = None # Event ID id: str # Run ID (arr_...) @@ -116,7 +117,7 @@ class AgentRoutineRun(BaseModel): routine: str | None = None # Routine status: str | None = None # Run status structured_response: dict[str, object] | None = None - updated_at: str | None = None # Last update timestamp + updated_at: datetime | None = None # Last update timestamp worker: WorkerStatus | None = None @@ -131,28 +132,28 @@ class AgentRoutineRunListResponse(BaseModel): class AgentSchedule(BaseModel): agent: str | None = None # Owning agent ID app: str | None = None # Application ID - created_at: str | None = None # Creation timestamp + created_at: datetime | None = None # Creation timestamp cron_expression: str | None = None # Cron expression (recurring only) id: str # Schedule ID (asc_...) instructions: str | None = None # Task instructions - last_run_at: str | None = None # Last execution time + last_run_at: datetime | None = None # Last execution time max_runs: int | None = None # Maximum runs (recurring only) metadata: dict[str, object] | None = None # Arbitrary metadata - next_run_at: str | None = None # Next scheduled execution + next_run_at: datetime | None = None # Next scheduled execution run_count: int | None = None # Number of times executed schedule_type: str | None = None # Schedule type (once or recurring) - scheduled_at: str | None = None # One-time execution time + scheduled_at: datetime | None = None # One-time execution time status: str | None = None # Schedule status thread: str | None = None # Thread ID (if thread-bound) timezone: str | None = None # Schedule timezone - updated_at: str | None = None # Last update timestamp + updated_at: datetime | None = None # Last update timestamp # API schema for an agent session. class AgentSession(BaseModel): agent: str | None = None # Owning agent ID (agi_...) - completed_at: str | None = None # When the session completed - created_at: str | None = None # Creation timestamp + completed_at: datetime | None = None # When the session completed + created_at: datetime | None = None # Creation timestamp error: str | None = None # Error message if failed id: str # Agent session ID (ase_...) inbox: list[dict[str, object]] | None = None # Inbox messages @@ -164,7 +165,7 @@ class AgentSession(BaseModel): metadata: dict[str, object] | None = None # Arbitrary metadata name: str | None = None # Optional display name for the session result: dict[str, object] | None = None # Session result - started_at: str | None = None # When the session started running + started_at: datetime | None = None # When the session started running status: str | None = None trajectory: str | None = None # Trajectory ID for the durable session transcript @@ -179,12 +180,12 @@ class AgentSkill(BaseModel): agent: str | None = None # Owning agent ID app: str | None = None # Application ID config: str | None = None # Skill config ID - created_at: str | None = None # Creation timestamp + created_at: datetime | None = None # Creation timestamp id: str # Agent skill ID (ask_...) instruction: str | None = None # Instruction override metadata: dict[str, object] | None = None # Arbitrary metadata status: str | None = None # Skill status - updated_at: str | None = None # Last update timestamp + updated_at: datetime | None = None # Last update timestamp # API schema for agent skills list response. @@ -199,7 +200,7 @@ class AgentTool(BaseModel): builtin_tool_config: dict[str, object] | None = None # Builtin tool configuration builtin_tool_key: str | None = None # Builtin tool key config: str | None = None # Config ID - created_at: str | None = None # Creation timestamp + created_at: datetime | None = None # Creation timestamp description: str | None = None # Tool description handler_type: str | None = None # Handler type id: str # Tool ID (atl_...) @@ -211,7 +212,7 @@ class AgentTool(BaseModel): parameters: dict[str, object] | None = None # Tool parameters parameters_config: str | None = None # Parameters config ID status: str | None = None # Tool status - updated_at: str | None = None # Last update timestamp + updated_at: datetime | None = None # Last update timestamp # List response for agent tools. diff --git a/src/archastro/platform/types/artifacts.py b/src/archastro/platform/types/artifacts.py index 516e27e..150bc91 100644 --- a/src/archastro/platform/types/artifacts.py +++ b/src/archastro/platform/types/artifacts.py @@ -1,7 +1,8 @@ # Copyright (c) 2026 ArchAstro Inc. All Rights Reserved. # This file is auto-generated by @archastro/sdk-generator. Do not edit. -# Content hash: b0045e748f72 +# Content hash: 9f4fac005df1 +from datetime import datetime from pydantic import BaseModel @@ -12,7 +13,7 @@ class Artifact(BaseModel): agent: str | None = None # Agent content_type: str | None = None # MIME content type - created_at: str | None = None # Creation timestamp + created_at: datetime | None = None # Creation timestamp current_version: str | None = None # Current version ID description: str | None = None # Artifact description file: str | None = None # Storage file @@ -25,6 +26,6 @@ class Artifact(BaseModel): sandbox: str | None = None # Sandbox identifier team: str | None = None # Team thread: str | None = None # Thread - updated_at: str | None = None # Last update timestamp + updated_at: datetime | None = None # Last update timestamp user: str | None = None # User version: int | None = None # Current version number diff --git a/src/archastro/platform/types/automations.py b/src/archastro/platform/types/automations.py index 697e28e..bb47e32 100644 --- a/src/archastro/platform/types/automations.py +++ b/src/archastro/platform/types/automations.py @@ -1,7 +1,8 @@ # Copyright (c) 2026 ArchAstro Inc. All Rights Reserved. # This file is auto-generated by @archastro/sdk-generator. Do not edit. -# Content hash: 65ce20d0f7e6 +# Content hash: 595972c8b4ba +from datetime import datetime from pydantic import BaseModel @@ -11,12 +12,12 @@ class AutomationRun(BaseModel): app: str # App (dap_...) automation: str # Automation (aut_...) - created_at: str | None = None # Created timestamp + created_at: datetime | None = None # Created timestamp event_id: str | None = None # Triggering event ID id: str # Public ID (atr_...) payload: dict[str, object] | None = None # Event payload result: dict[str, object] | None = None # Workflow execution result (payload and output) status: str # Status: pending, running, completed, failed, cancelled team: str | None = None # Team if team-owned - updated_at: str | None = None # Updated timestamp + updated_at: datetime | None = None # Updated timestamp user: str | None = None # User if user-owned diff --git a/src/archastro/platform/types/common.py b/src/archastro/platform/types/common.py index 5bed0bd..7fb846a 100644 --- a/src/archastro/platform/types/common.py +++ b/src/archastro/platform/types/common.py @@ -1,7 +1,8 @@ # Copyright (c) 2026 ArchAstro Inc. All Rights Reserved. # This file is auto-generated by @archastro/sdk-generator. Do not edit. -# Content hash: dc6b8d943c66 +# Content hash: 4c2e33df75af +from datetime import datetime from pydantic import BaseModel @@ -79,13 +80,13 @@ class WorkerStatus(BaseModel): # API schema for a media variant. class MediaVariant(BaseModel): content_type: str | None = None # File content type - created_at: str | None = None # Creation timestamp + created_at: datetime | None = None # Creation timestamp file: str | None = None # Storage file filename: str | None = None # Original filename height: int | None = None # Height in pixels id: str # Variant ID image_source: ImageSource | None = None # Image source metadata - updated_at: str | None = None # Last update timestamp + updated_at: datetime | None = None # Last update timestamp url: str | None = None # Signed download URL variant_key: str | None = None # Variant key (original, thumbnail, etc) width: int | None = None # Width in pixels @@ -153,7 +154,7 @@ class ComputerExecResult(BaseModel): # API schema for a custom object. class CustomObject(BaseModel): - created_at: str | None = None # Created timestamp + created_at: datetime | None = None # Created timestamp fields: dict[str, object] | None = None # Object field values id: str # Public ID (cobj_...) org: str | None = None # Organization @@ -161,7 +162,7 @@ class CustomObject(BaseModel): sandbox: str | None = None # Sandbox identifier schema_type: str | None = None # Schema type (lookup_key) team: str | None = None # Owning team - updated_at: str | None = None # Updated timestamp + updated_at: datetime | None = None # Updated timestamp user: str | None = None # Owning user version: int | None = None # Aggregate version for OCC @@ -185,13 +186,13 @@ class DeviceAuthorizationStatusResponse(BaseModel): class Installation(BaseModel): agent: str | None = None # Owning agent config: dict[str, object] | None = None # Configuration - created_at: str | None = None # Creation timestamp + created_at: datetime | None = None # Creation timestamp id: str # Installation ID (cin_...) kind: str | None = None # Installation kind shared_integration: str | None = None # Bound shared integration state: str | None = None # Installation state status_payload: dict[str, object] | None = None # Status payload - updated_at: str | None = None # Last update timestamp + updated_at: datetime | None = None # Last update timestamp # API schema for an installation kind. @@ -220,7 +221,7 @@ class InstallationListResponse(BaseModel): class InstallationSource(BaseModel): agent: str | None = None # Owning agent context_installation: str | None = None # Installation ID - created_at: str | None = None # Creation timestamp + created_at: datetime | None = None # Creation timestamp id: str # Source ID (cso_...) metadata: dict[str, object] | None = None # Arbitrary metadata parent_source: str | None = None # Parent source ID @@ -229,7 +230,7 @@ class InstallationSource(BaseModel): team: str | None = None # Team ID thread: str | None = None # Thread ID type: str | None = None # Source type - updated_at: str | None = None # Last update timestamp + updated_at: datetime | None = None # Last update timestamp user: str | None = None # User ID @@ -241,9 +242,9 @@ class InstallationSourceListResponse(BaseModel): # Schema for a key-value storage entry. # Maps exactly to render_entry/1 output in ApiStorageController. class KeyValueStorageEntry(BaseModel): - created_at: str | None = None # Creation timestamp + created_at: datetime | None = None # Creation timestamp key: str # Storage key - updated_at: str | None = None # Last update timestamp + updated_at: datetime | None = None # Last update timestamp user: str # User value: str # Stored value @@ -254,9 +255,9 @@ class KeyValueStorageEntry(BaseModel): # user_name fields (they know who they are); developer / S2S callers populate # them so the portal can render an owner column without a per-row lookup. class KeyValueStorageEntryWithUser(BaseModel): - created_at: str # Creation timestamp + created_at: datetime # Creation timestamp key: str # Storage key - updated_at: str # Last update timestamp + updated_at: datetime # Last update timestamp user: str # User ID user_email: str | None = None # User email (developer / S2S only) user_name: str | None = None # User display name (developer / S2S only) @@ -293,7 +294,7 @@ class Message(BaseModel): attachments: list[Attachment] | None = None # Message attachments branched_thread: str | None = None # Branched thread (if message spawned a thread) content: str | None = None # Message content - created_at: str | None = None # Creation timestamp + created_at: datetime | None = None # Creation timestamp has_replies: bool | None = None # Whether message has replies id: str # Message ID (msg_...) idempotency_key: str | None = None # Client-provided idempotency key @@ -356,11 +357,11 @@ class ValidationResult(BaseModel): # API schema for a working memory entry. class WorkingMemoryEntry(BaseModel): agent: str | None = None # Owning agent - created_at: str | None = None # Creation timestamp - expires_at: str | None = None # Expiration timestamp + created_at: datetime | None = None # Creation timestamp + expires_at: datetime | None = None # Expiration timestamp id: str # Memory entry ID (amm_...) key: str | None = None # Memory key - updated_at: str | None = None # Last update timestamp + updated_at: datetime | None = None # Last update timestamp value: str | None = None # Memory value diff --git a/src/archastro/platform/types/config.py b/src/archastro/platform/types/config.py index 32deb33..0077397 100644 --- a/src/archastro/platform/types/config.py +++ b/src/archastro/platform/types/config.py @@ -1,7 +1,8 @@ # Copyright (c) 2026 ArchAstro Inc. All Rights Reserved. # This file is auto-generated by @archastro/sdk-generator. Do not edit. -# Content hash: 1fd527ba85c1 +# Content hash: a67368438e84 +from datetime import datetime from pydantic import BaseModel @@ -9,7 +10,7 @@ # API schema for a config version. class ConfigVersion(BaseModel): change_description: str | None = None # Description of changes - created_at: str | None = None # Creation timestamp + created_at: datetime | None = None # Creation timestamp data: dict[str, object] | None = None # Additional structured data id: str # Config version ID (cfv_...) org: str | None = None # Organization @@ -19,7 +20,7 @@ class ConfigVersion(BaseModel): # API schema for a config resource. class Config(BaseModel): - created_at: str | None = None # Creation timestamp + created_at: datetime | None = None # Creation timestamp current_version: ConfigVersion | None = None # Current version id: str # Config ID (cfg_...) is_archived: bool | None = None # Whether config is archived @@ -32,7 +33,7 @@ class Config(BaseModel): relative_path: str | None = None # Path within parent bundle (bundle children only) sandbox: str | None = None # Sandbox identifier team: str | None = None # Team - updated_at: str | None = None # Last update timestamp + updated_at: datetime | None = None # Last update timestamp user: str | None = None # User virtual_path: str | None = None # Unique path within the team diff --git a/src/archastro/platform/types/teams.py b/src/archastro/platform/types/teams.py index db3106f..7cf35b0 100644 --- a/src/archastro/platform/types/teams.py +++ b/src/archastro/platform/types/teams.py @@ -1,7 +1,8 @@ # Copyright (c) 2026 ArchAstro Inc. All Rights Reserved. # This file is auto-generated by @archastro/sdk-generator. Do not edit. -# Content hash: a5c81c4952e9 +# Content hash: c40f6d353d51 +from datetime import datetime from pydantic import BaseModel @@ -16,7 +17,7 @@ class Team(BaseModel): acl: Acl | None = None app: str | None = None # Application badges: dict[str, object] | None = None # Badge counts by category - created_at: str | None = None # Creation timestamp + created_at: datetime | None = None # Creation timestamp description: str | None = None # Team description id: str # Team ID membership_status: str | None = None @@ -25,7 +26,7 @@ class Team(BaseModel): org: str | None = None # Organization sandbox: str | None = None # Sandbox slug: str | None = None # URL slug - updated_at: str | None = None # Last update timestamp + updated_at: datetime | None = None # Last update timestamp # Schema for a team invite response. @@ -36,16 +37,16 @@ class TeamInvite(BaseModel): # API schema for a team membership. class TeamMembership(BaseModel): agent: Agent | None = None # Agent object (when loaded) - created_at: str | None = None # Creation timestamp + created_at: datetime | None = None # Creation timestamp id: str # Membership ID - joined_at: str | None = None # Join timestamp + joined_at: datetime | None = None # Join timestamp metadata: dict[str, object] | None = None # Membership metadata name: str | None = None # Member name profile_picture: ImageSource | None = None # Profile picture role: str | None = None # Role in team team: dict[str, object] | None = None # Team object (when loaded) type: str | None = None # Member type (user, agent, unknown) - updated_at: str | None = None # Last update timestamp + updated_at: datetime | None = None # Last update timestamp user: User | None = None # User object (when loaded) diff --git a/src/archastro/platform/types/threads.py b/src/archastro/platform/types/threads.py index 38591d7..7d7f0ce 100644 --- a/src/archastro/platform/types/threads.py +++ b/src/archastro/platform/types/threads.py @@ -1,7 +1,8 @@ # Copyright (c) 2026 ArchAstro Inc. All Rights Reserved. # This file is auto-generated by @archastro/sdk-generator. Do not edit. -# Content hash: 245cb0b878e6 +# Content hash: ac4e8211e449 +from datetime import datetime from pydantic import BaseModel @@ -19,7 +20,7 @@ class ThreadSettings(BaseModel): # API schema for a chat thread. class Thread(BaseModel): agent_user: str | None = None # Owning agent user - created_at: str | None = None # Creation timestamp + created_at: datetime | None = None # Creation timestamp creator: User | None = None # Creator user object description: str | None = None # Thread description id: str # Thread ID (thr_...) @@ -28,7 +29,7 @@ class Thread(BaseModel): is_transient: bool | None = None # Whether this thread is transient is_unlisted: bool | None = None # Whether this thread is unlisted key: str | None = None # Thread key - last_activity: str | None = None # Last activity timestamp + last_activity: datetime | None = None # Last activity timestamp metadata: dict[str, object] | None = None # Thread metadata org: str | None = None # Organization parent_message: Message | None = None # Parent message object @@ -45,7 +46,7 @@ class Thread(BaseModel): title: str | None = None # Thread title ttl: int | None = None # Time-to-live in seconds unread_count: int | None = None # Unread message count - updated_at: str | None = None # Last update timestamp + updated_at: datetime | None = None # Last update timestamp user: str | None = None # Owning user diff --git a/src/archastro/platform/types/users.py b/src/archastro/platform/types/users.py index d6fcc3f..cd15fd4 100644 --- a/src/archastro/platform/types/users.py +++ b/src/archastro/platform/types/users.py @@ -1,7 +1,8 @@ # Copyright (c) 2026 ArchAstro Inc. All Rights Reserved. # This file is auto-generated by @archastro/sdk-generator. Do not edit. -# Content hash: ffe54ff8c4dc +# Content hash: e890061eefe0 +from datetime import datetime from pydantic import BaseModel @@ -21,7 +22,7 @@ class User(BaseModel): # API schema for a user invite. class UserInvite(BaseModel): - created_at: str | None = None # Creation timestamp + created_at: datetime | None = None # Creation timestamp id: str # Invite ID (uin_...) key: str | None = None # Invite key metadata: dict[str, object] | None = None # Invite metadata diff --git a/src/archastro/platform/v1/resources/activity_feed.py b/src/archastro/platform/v1/resources/activity_feed.py index 41f069a..e25635a 100644 --- a/src/archastro/platform/v1/resources/activity_feed.py +++ b/src/archastro/platform/v1/resources/activity_feed.py @@ -1,15 +1,80 @@ # Copyright (c) 2026 ArchAstro Inc. All Rights Reserved. # This file is auto-generated by @archastro/sdk-generator. Do not edit. -# Content hash: 4da450443cc0 +# Content hash: c44553055a49 from __future__ import annotations +from datetime import datetime + +from pydantic import BaseModel + from ...runtime.http_client import HttpClient +class ActivityFeedListResponseDataItem(BaseModel): + agent: str | dict[str, object] | None = None + app: str | None = None # Application + attachments: list[dict[str, object]] | None = None # Entry attachments + automation_run: str | None = None # Automation run + content: str | None = None # Longer explanation (markdown) + correlation_id: str | None = None # Correlation ID for grouped entries + created_at: datetime | None = None # Creation timestamp + id: str # Entry ID (afe_...) + kind: str | None = None # Entry kind + level: str | None = None # Severity level + metadata: dict[str, object] | None = None # Entry metadata + org: str | None = None # Organization + routine_run: str | None = None # Routine run + sandbox: str | None = None # Sandbox identifier + session_record: str | None = None # Agent session + team: str | None = None # Team + thread: str | None = None # Thread + title: str | None = None # One-line summary + updated_at: datetime | None = None # Last update timestamp + user: str | dict[str, object] | None = None + + +class ActivityFeedListResponse(BaseModel): + after_cursor: str | None = None # Cursor for fetching newer entries + before_cursor: str | None = None # Cursor for fetching older entries + data: list[ActivityFeedListResponseDataItem] # The entries + has_more: bool # Whether more items exist beyond this page + + class ActivityFeedResource: def __init__(self, http: HttpClient): self._http = http - async def list(self, **params) -> dict[str, object]: - return await self._http.request("/api/v1/activity_feed", query=params) + async def list( + self, + *, + kind: list[str] | None = None, + level: list[str] | None = None, + agent: list[str] | None = None, + thread: list[str] | None = None, + org: list[str] | None = None, + correlation_id: str | None = None, + limit: int | None = None, + before_cursor: str | None = None, + after_cursor: str | None = None, + ) -> ActivityFeedListResponse: + query: dict[str, object] = {} + if kind is not None: + query["kind"] = kind + if level is not None: + query["level"] = level + if agent is not None: + query["agent"] = agent + if thread is not None: + query["thread"] = thread + if org is not None: + query["org"] = org + if correlation_id is not None: + query["correlationId"] = correlation_id + if limit is not None: + query["limit"] = limit + if before_cursor is not None: + query["beforeCursor"] = before_cursor + if after_cursor is not None: + query["afterCursor"] = after_cursor + return await self._http.request("/api/v1/activity_feed", query=query) diff --git a/src/archastro/platform/v1/resources/agent_computers.py b/src/archastro/platform/v1/resources/agent_computers.py index bd9ef9e..465a318 100644 --- a/src/archastro/platform/v1/resources/agent_computers.py +++ b/src/archastro/platform/v1/resources/agent_computers.py @@ -1,14 +1,21 @@ # Copyright (c) 2026 ArchAstro Inc. All Rights Reserved. # This file is auto-generated by @archastro/sdk-generator. Do not edit. -# Content hash: 3b150acaddae +# Content hash: cc918cdea29c from __future__ import annotations +from typing import Required, TypedDict + from ...runtime.http_client import HttpClient from ...types.agents import AgentComputer from ...types.common import ComputerExecResult +class AgentComputerExecInput(TypedDict, total=False): + command: Required[str] # Shell command to execute + dir: str | None # Working directory for the command + + class AgentComputerResource: def __init__(self, http: HttpClient): self._http = http @@ -19,7 +26,7 @@ async def delete(self, computer: str) -> None: async def get(self, computer: str) -> AgentComputer: return await self._http.request(f"/api/v1/agent_computers/{computer}") - async def exec(self, computer: str, input: dict) -> ComputerExecResult: + async def exec(self, computer: str, input: AgentComputerExecInput) -> ComputerExecResult: return await self._http.request( f"/api/v1/agent_computers/{computer}/exec", method="POST", diff --git a/src/archastro/platform/v1/resources/agent_installations.py b/src/archastro/platform/v1/resources/agent_installations.py index 585960a..a556d59 100644 --- a/src/archastro/platform/v1/resources/agent_installations.py +++ b/src/archastro/platform/v1/resources/agent_installations.py @@ -1,9 +1,11 @@ # Copyright (c) 2026 ArchAstro Inc. All Rights Reserved. # This file is auto-generated by @archastro/sdk-generator. Do not edit. -# Content hash: bacdef93e676 +# Content hash: 2ad07cd44267 from __future__ import annotations +from typing import TypedDict + from ...runtime.http_client import HttpClient from ...types.common import ( Installation, @@ -13,6 +15,15 @@ ) +class AgentInstallationInstallationSourceCreateInput(TypedDict): + payload: dict[str, object] # Source payload + type: str # Source type (e.g. file/document, web/link) + + +class AgentInstallationSuspendInput(TypedDict, total=False): + reason: str | None # Optional suspension reason + + class AgentInstallationInstallationSourceResource: def __init__(self, http: HttpClient): self._http = http @@ -22,7 +33,9 @@ async def list(self, installation: str) -> InstallationSourceListResponse: f"/api/v1/agent_installations/{installation}/installation_sources", ) - async def create(self, installation: str, input: dict) -> InstallationSource: + async def create( + self, installation: str, input: AgentInstallationInstallationSourceCreateInput + ) -> InstallationSource: return await self._http.request( f"/api/v1/agent_installations/{installation}/installation_sources", method="POST", @@ -35,8 +48,11 @@ def __init__(self, http: HttpClient): self._http = http self.installation_sources = AgentInstallationInstallationSourceResource(http) - async def list(self, **params) -> InstallationListResponse: - return await self._http.request("/api/v1/agent_installations", query=params) + async def list(self, *, agent: str | None = None) -> InstallationListResponse: + query: dict[str, object] = {} + if agent is not None: + query["agent"] = agent + return await self._http.request("/api/v1/agent_installations", query=query) async def delete(self, installation: str) -> None: await self._http.request(f"/api/v1/agent_installations/{installation}", method="DELETE") @@ -56,7 +72,9 @@ async def pause(self, installation: str) -> Installation: method="POST", ) - async def suspend(self, installation: str, input: dict) -> Installation: + async def suspend( + self, installation: str, input: AgentInstallationSuspendInput + ) -> Installation: return await self._http.request( f"/api/v1/agent_installations/{installation}/suspend", method="POST", diff --git a/src/archastro/platform/v1/resources/agent_routines.py b/src/archastro/platform/v1/resources/agent_routines.py index c6b1c69..ee0c4f4 100644 --- a/src/archastro/platform/v1/resources/agent_routines.py +++ b/src/archastro/platform/v1/resources/agent_routines.py @@ -1,9 +1,11 @@ # Copyright (c) 2026 ArchAstro Inc. All Rights Reserved. # This file is auto-generated by @archastro/sdk-generator. Do not edit. -# Content hash: eb6304dc8b82 +# Content hash: f796b24b647a from __future__ import annotations +from typing import Required, TypedDict + from ...runtime.http_client import HttpClient from ...types.agents import ( AgentRoutine, @@ -14,6 +16,91 @@ from ...types.common import RoutinePreset +class AgentRoutineUpdateInputAclAddItem(TypedDict, total=False): + actions: Required[list[str]] # List of allowed actions (e.g. read, write) + principal: str | None + principal_type: Required[str] # Principal type: user, team, org, org_role, agent, or everyone + + +class AgentRoutineUpdateInputAclGrantsItem(TypedDict, total=False): + actions: Required[list[str]] # List of allowed actions (e.g. read, write) + principal: str | None + principal_type: Required[str] # Principal type: user, team, org, org_role, agent, or everyone + + +class AgentRoutineUpdateInputAclRemoveItem(TypedDict, total=False): + principal: str | None # Principal identifier to remove (omit for everyone) + principal_type: Required[str] # Principal type to remove + + +class AgentRoutineUpdateInputAcl(TypedDict, total=False): + add: list[AgentRoutineUpdateInputAclAddItem] | None + grants: list[AgentRoutineUpdateInputAclGrantsItem] | None + remove: list[AgentRoutineUpdateInputAclRemoveItem] | None + + +class AgentRoutineUpdateInputPresetConfigLlm(TypedDict, total=False): + model: str | None # Model identifier. When set, overrides the agent's default_model. + + +class AgentRoutineUpdateInputPresetConfig(TypedDict, total=False): + instructions: str | None + llm: AgentRoutineUpdateInputPresetConfigLlm | None + session_mode: str | None + session_scope: str | None + structured_message_template_ids: list[str] | None + + +class AgentRoutineUpdateInputStepsItemPresetConfigLlm(TypedDict, total=False): + model: str | None # Model identifier. When set, overrides the agent's default_model. + + +class AgentRoutineUpdateInputStepsItemPresetConfig(TypedDict, total=False): + instructions: str | None + llm: AgentRoutineUpdateInputStepsItemPresetConfigLlm | None + session_mode: str | None + session_scope: str | None + structured_message_template_ids: list[str] | None + + +class AgentRoutineUpdateInputStepsItem(TypedDict, total=False): + config: str | None + handler_type: Required[str] # Handler type for this step: preset, script, or workflow_graph + inputs: dict[str, object] | None + name: str | None # Optional step label. Must be unique within the chain if set. + on_error: str | None # Error policy: halt (default), continue, or retry. + output_key: str | None + preset_config: AgentRoutineUpdateInputStepsItemPresetConfig | None + preset_name: str | None # Preset name (for handler_type: preset) + script: str | None # Inline script source (for handler_type: script) + + +class AgentRoutineUpdateInput(TypedDict, total=False): + acl: AgentRoutineUpdateInputAcl | None # Access control list + config: str | None # Config ID + description: str | None # Description + event_config: dict[str, object] | None + event_type: str | None # Event type (deprecated, use event_config) + handler_type: str | None # Handler type: workflow_graph, script, preset, or chain + lookup_key: str | None # Lookup key + metadata: dict[str, object] | None # Metadata + name: str | None # Routine name + preset_config: AgentRoutineUpdateInputPresetConfig | None # Preset config + preset_name: str | None # Preset name + schedule: str | None # Cron expression for scheduled routines + script: str | None # Script content + steps: list[AgentRoutineUpdateInputStepsItem] | None + trigger_context: str | None # Trigger context: chat_session or event + + +class AgentRoutineInvokeInput(TypedDict, total=False): + idempotency_key: str | None # Idempotency key to deduplicate invocations + message: Required[str] # The message to send + metadata: dict[str, object] | None # Optional per-call metadata + session_key: str | None # Session key (required when session_scope is per_key) + user: str | None # User ID (S2S/developer only; client uses viewer) + + class AgentRoutineRunResource: def __init__(self, http: HttpClient): self._http = http @@ -27,8 +114,15 @@ def __init__(self, http: HttpClient): self._http = http self.agent_routine_runs = AgentRoutineRunResource(http) - async def list(self, **params) -> AgentRoutineListResponse: - return await self._http.request("/api/v1/agent_routines", query=params) + async def list( + self, *, agent: str | None = None, event_type: str | None = None + ) -> AgentRoutineListResponse: + query: dict[str, object] = {} + if agent is not None: + query["agent"] = agent + if event_type is not None: + query["eventType"] = event_type + return await self._http.request("/api/v1/agent_routines", query=query) async def presets(self) -> list[RoutinePreset]: return await self._http.request("/api/v1/agent_routines/presets") @@ -39,7 +133,7 @@ async def delete(self, routine: str) -> None: async def get(self, routine: str) -> AgentRoutine: return await self._http.request(f"/api/v1/agent_routines/{routine}") - async def update(self, routine: str, input: dict) -> AgentRoutine: + async def update(self, routine: str, input: AgentRoutineUpdateInput) -> AgentRoutine: return await self._http.request( f"/api/v1/agent_routines/{routine}", method="PATCH", @@ -49,7 +143,7 @@ async def update(self, routine: str, input: dict) -> AgentRoutine: async def activate(self, routine: str) -> AgentRoutine: return await self._http.request(f"/api/v1/agent_routines/{routine}/activate", method="POST") - async def invoke(self, routine: str, input: dict) -> AgentRoutineRun: + async def invoke(self, routine: str, input: AgentRoutineInvokeInput) -> AgentRoutineRun: return await self._http.request( f"/api/v1/agent_routines/{routine}/invoke", method="POST", @@ -59,5 +153,22 @@ async def invoke(self, routine: str, input: dict) -> AgentRoutineRun: async def pause(self, routine: str) -> AgentRoutine: return await self._http.request(f"/api/v1/agent_routines/{routine}/pause", method="POST") - async def runs(self, routine: str, **params) -> AgentRoutineRunListResponse: - return await self._http.request(f"/api/v1/agent_routines/{routine}/runs", query=params) + async def runs( + self, + routine: str, + *, + status: str | None = None, + limit: int | None = None, + before_cursor: str | None = None, + after_cursor: str | None = None, + ) -> AgentRoutineRunListResponse: + query: dict[str, object] = {} + if status is not None: + query["status"] = status + if limit is not None: + query["limit"] = limit + if before_cursor is not None: + query["beforeCursor"] = before_cursor + if after_cursor is not None: + query["afterCursor"] = after_cursor + return await self._http.request(f"/api/v1/agent_routines/{routine}/runs", query=query) diff --git a/src/archastro/platform/v1/resources/agent_sessions.py b/src/archastro/platform/v1/resources/agent_sessions.py index d864de9..4094ecc 100644 --- a/src/archastro/platform/v1/resources/agent_sessions.py +++ b/src/archastro/platform/v1/resources/agent_sessions.py @@ -1,21 +1,65 @@ # Copyright (c) 2026 ArchAstro Inc. All Rights Reserved. # This file is auto-generated by @archastro/sdk-generator. Do not edit. -# Content hash: 2688af2a4f73 +# Content hash: 6e66826047b9 from __future__ import annotations +from typing import Required, TypedDict + from ...runtime.http_client import HttpClient from ...types.agents import AgentSession, AgentSessionListResponse +class AgentSessionCreateInput(TypedDict, total=False): + agent: Required[str] # Agent ID + instructions: Required[str] # Task description for the session + max_runs_per_turn: int | None # Max tool runs per turn (default 25) + max_tokens: int | None # Max tokens (default 20000) + max_turns: int | None # Max turns (default 100) + metadata: dict[str, object] | None # Arbitrary metadata + name: str | None # Optional display name for the session + team: str | None # Optional team context + thread: str | None # Optional thread context + user: str | None # Optional user context + + +class AgentSessionUpdateInput(TypedDict, total=False): + metadata: dict[str, object] | None # Arbitrary metadata + + +class AgentSessionMessageInput(TypedDict, total=False): + content: Required[str] # Message content + metadata: dict[str, object] | None # Message metadata + role: str | None # Message role (default: user) + + class AgentSessionResource: def __init__(self, http: HttpClient): self._http = http - async def list(self, **params) -> AgentSessionListResponse: - return await self._http.request("/api/v1/agent_sessions", query=params) + async def list( + self, + *, + agent: str | None = None, + status: list[str] | None = None, + routine_run: list[str] | None = None, + exclude_system: bool | None = None, + limit: int | None = None, + ) -> AgentSessionListResponse: + query: dict[str, object] = {} + if agent is not None: + query["agent"] = agent + if status is not None: + query["status"] = status + if routine_run is not None: + query["routineRun"] = routine_run + if exclude_system is not None: + query["excludeSystem"] = exclude_system + if limit is not None: + query["limit"] = limit + return await self._http.request("/api/v1/agent_sessions", query=query) - async def create(self, input: dict) -> AgentSession: + async def create(self, input: AgentSessionCreateInput) -> AgentSession: return await self._http.request("/api/v1/agent_sessions", method="POST", body=input) async def delete(self, agent_session: str) -> None: @@ -24,7 +68,7 @@ async def delete(self, agent_session: str) -> None: async def get(self, agent_session: str) -> AgentSession: return await self._http.request(f"/api/v1/agent_sessions/{agent_session}") - async def update(self, agent_session: str, input: dict) -> AgentSession: + async def update(self, agent_session: str, input: AgentSessionUpdateInput) -> AgentSession: return await self._http.request( f"/api/v1/agent_sessions/{agent_session}", method="PATCH", @@ -37,7 +81,7 @@ async def cancel(self, agent_session: str) -> AgentSession: method="POST", ) - async def message(self, agent_session: str, input: dict) -> AgentSession: + async def message(self, agent_session: str, input: AgentSessionMessageInput) -> AgentSession: return await self._http.request( f"/api/v1/agent_sessions/{agent_session}/message", method="POST", diff --git a/src/archastro/platform/v1/resources/agent_skills.py b/src/archastro/platform/v1/resources/agent_skills.py index e5f8af3..4c16777 100644 --- a/src/archastro/platform/v1/resources/agent_skills.py +++ b/src/archastro/platform/v1/resources/agent_skills.py @@ -1,21 +1,38 @@ # Copyright (c) 2026 ArchAstro Inc. All Rights Reserved. # This file is auto-generated by @archastro/sdk-generator. Do not edit. -# Content hash: cefc46fa179c +# Content hash: 1b24f96ec340 from __future__ import annotations +from typing import Required, TypedDict + from ...runtime.http_client import HttpClient from ...types.agents import AgentSkill, AgentSkillList +class AgentSkillCreateInput(TypedDict, total=False): + agent: Required[str] # Agent ID + config: Required[str] # Skill config ID + instruction: str | None # Optional instruction override + metadata: dict[str, object] | None # Arbitrary metadata + + +class AgentSkillUpdateInput(TypedDict, total=False): + instruction: str | None # Instruction override + metadata: dict[str, object] | None # Arbitrary metadata + + class AgentSkillResource: def __init__(self, http: HttpClient): self._http = http - async def list(self, **params) -> AgentSkillList: - return await self._http.request("/api/v1/agent_skills", query=params) + async def list(self, *, agent: list[str] | None = None) -> AgentSkillList: + query: dict[str, object] = {} + if agent is not None: + query["agent"] = agent + return await self._http.request("/api/v1/agent_skills", query=query) - async def create(self, input: dict) -> AgentSkill: + async def create(self, input: AgentSkillCreateInput) -> AgentSkill: return await self._http.request("/api/v1/agent_skills", method="POST", body=input) async def delete(self, agent_skill: str) -> None: @@ -24,7 +41,7 @@ async def delete(self, agent_skill: str) -> None: async def get(self, agent_skill: str) -> AgentSkill: return await self._http.request(f"/api/v1/agent_skills/{agent_skill}") - async def update(self, agent_skill: str, input: dict) -> AgentSkill: + async def update(self, agent_skill: str, input: AgentSkillUpdateInput) -> AgentSkill: return await self._http.request( f"/api/v1/agent_skills/{agent_skill}", method="PATCH", diff --git a/src/archastro/platform/v1/resources/agent_tools.py b/src/archastro/platform/v1/resources/agent_tools.py index 901f3fc..9f0f526 100644 --- a/src/archastro/platform/v1/resources/agent_tools.py +++ b/src/archastro/platform/v1/resources/agent_tools.py @@ -1,20 +1,42 @@ # Copyright (c) 2026 ArchAstro Inc. All Rights Reserved. # This file is auto-generated by @archastro/sdk-generator. Do not edit. -# Content hash: e584b56fa939 +# Content hash: 899df6c82011 from __future__ import annotations +from typing import TypedDict + from ...runtime.http_client import HttpClient from ...types.agents import AgentTool, AgentToolListResponse from ...types.common import BuiltinToolCatalogEntry +class AgentToolUpdateInput(TypedDict, total=False): + builtin_tool_config: dict[str, object] | None # Built-in tool config + config: str | None # Config ID + description: str | None # Description + handler_type: str | None # Handler type: script or workflow_graph + instruction: str | None # LLM usage instruction + lookup_key: str | None # Lookup key + metadata: dict[str, object] | None # Metadata + name: str | None # Tool name (custom only) + parameters: dict[str, object] | None # JSON schema for tool input parameters + parameters_config: str | None # Config ID for a reusable JsonSchema + + class AgentToolResource: def __init__(self, http: HttpClient): self._http = http - async def list(self, **params) -> AgentToolListResponse: - return await self._http.request("/api/v1/agent_tools", query=params) + async def list( + self, *, agent: str | None = None, kind: str | None = None + ) -> AgentToolListResponse: + query: dict[str, object] = {} + if agent is not None: + query["agent"] = agent + if kind is not None: + query["kind"] = kind + return await self._http.request("/api/v1/agent_tools", query=query) async def catalog(self) -> list[BuiltinToolCatalogEntry]: return await self._http.request("/api/v1/agent_tools/catalog") @@ -25,7 +47,7 @@ async def delete(self, tool: str) -> None: async def get(self, tool: str) -> AgentTool: return await self._http.request(f"/api/v1/agent_tools/{tool}") - async def update(self, tool: str, input: dict) -> AgentTool: + async def update(self, tool: str, input: AgentToolUpdateInput) -> AgentTool: return await self._http.request(f"/api/v1/agent_tools/{tool}", method="PATCH", body=input) async def activate(self, tool: str) -> AgentTool: diff --git a/src/archastro/platform/v1/resources/agents.py b/src/archastro/platform/v1/resources/agents.py index ff518cc..c0847b7 100644 --- a/src/archastro/platform/v1/resources/agents.py +++ b/src/archastro/platform/v1/resources/agents.py @@ -1,9 +1,14 @@ # Copyright (c) 2026 ArchAstro Inc. All Rights Reserved. # This file is auto-generated by @archastro/sdk-generator. Do not edit. -# Content hash: 28e8f3d932d2 +# Content hash: 8d5691fe4943 from __future__ import annotations +from datetime import datetime +from typing import Required, TypedDict + +from pydantic import BaseModel + from ...runtime.http_client import HttpClient from ...types.agents import ( Agent, @@ -25,6 +30,271 @@ from ...types.threads import Thread +class AgentAgentComputerCreateInput(TypedDict, total=False): + config: dict[str, object] | None # Computer configuration + lookup_key: str | None # Unique lookup key + metadata: dict[str, object] | None # Arbitrary metadata + name: Required[str] # Computer name + region: str | None # Region to provision in (default: iad) + + +class AgentAgentInstallationCreateInputIntegration(TypedDict, total=False): + access_token: str | None # OAuth access token or API key + installation_id: str | None + metadata: dict[str, object] | None # Provider-specific metadata (e.g. bot_user_id) + refresh_token: str | None # OAuth refresh token + workspace_key: str | None # Workspace name or identifier + + +class AgentAgentInstallationCreateInput(TypedDict, total=False): + config: dict[str, object] | None # Optional configuration + integration: AgentAgentInstallationCreateInputIntegration | None + kind: Required[str] # Installation kind (gmail, outlook, github, scrape/site) + shared_integration: str | None # Shared org/app integration ID to bind to this installation + + +class AgentAgentToolCreateInput(TypedDict, total=False): + builtin_tool_config: dict[str, object] | None # Built-in tool config + builtin_tool_key: str | None # Built-in tool key (for builtin kind) + config: str | None # Config ID (for custom kind) + description: str | None # Tool description (for custom kind) + handler_type: str | None # Handler type: script or workflow_graph (for custom kind) + kind: Required[str] # Tool kind: builtin or custom + lookup_key: str | None # Unique lookup key + metadata: dict[str, object] | None # Arbitrary metadata + name: str | None # Tool name (for custom kind) + parameters: dict[str, object] | None # JSON schema for parameters (for custom kind) + status: str | None # Tool status: draft or active (default: draft) + + +class AgentCreateInputAclAddItem(TypedDict, total=False): + actions: Required[list[str]] # List of allowed actions (e.g. read, write) + principal: str | None + principal_type: Required[str] # Principal type: user, team, org, org_role, agent, or everyone + + +class AgentCreateInputAclGrantsItem(TypedDict, total=False): + actions: Required[list[str]] # List of allowed actions (e.g. read, write) + principal: str | None + principal_type: Required[str] # Principal type: user, team, org, org_role, agent, or everyone + + +class AgentCreateInputAclRemoveItem(TypedDict, total=False): + principal: str | None # Principal identifier to remove (omit for everyone) + principal_type: Required[str] # Principal type to remove + + +class AgentCreateInputAcl(TypedDict, total=False): + add: list[AgentCreateInputAclAddItem] | None + grants: list[AgentCreateInputAclGrantsItem] | None + remove: list[AgentCreateInputAclRemoveItem] | None + + +class AgentCreateInputProfilePicture(TypedDict): + data: str # Base64-encoded image data + filename: str # Original filename + mime_type: str # MIME type of the image + + +class AgentCreateInput(TypedDict, total=False): + acl: AgentCreateInputAcl | None # Access control list + email: str | None # Agent email + identity: str | None # Identity prompt describing who the agent is + lookup_key: str | None # Unique lookup key + metadata: dict[str, object] | None # Arbitrary metadata + model: str | None # Default AI model for this agent + name: str | None # Agent name + org: str | None # Organization ID + phone_number: str | None # Agent phone number + profile_picture: AgentCreateInputProfilePicture | None # Base64-encoded profile picture + team: str | None # Team ID + template: str | None # Template ID to provision agent from + user: str | None # User ID + + +class AgentUpdateInputAclAddItem(TypedDict, total=False): + actions: Required[list[str]] # List of allowed actions (e.g. read, write) + principal: str | None + principal_type: Required[str] # Principal type: user, team, org, org_role, agent, or everyone + + +class AgentUpdateInputAclGrantsItem(TypedDict, total=False): + actions: Required[list[str]] # List of allowed actions (e.g. read, write) + principal: str | None + principal_type: Required[str] # Principal type: user, team, org, org_role, agent, or everyone + + +class AgentUpdateInputAclRemoveItem(TypedDict, total=False): + principal: str | None # Principal identifier to remove (omit for everyone) + principal_type: Required[str] # Principal type to remove + + +class AgentUpdateInputAcl(TypedDict, total=False): + add: list[AgentUpdateInputAclAddItem] | None + grants: list[AgentUpdateInputAclGrantsItem] | None + remove: list[AgentUpdateInputAclRemoveItem] | None + + +class AgentUpdateInputProfilePicture(TypedDict): + data: str # Base64-encoded image data + filename: str # Original filename + mime_type: str # MIME type of the image + + +class AgentUpdateInput(TypedDict, total=False): + acl: AgentUpdateInputAcl | None # Access control list + email: str | None # Agent email + identity: str | None # Identity prompt describing who the agent is + lookup_key: str | None # Unique lookup key + metadata: dict[str, object] | None # Arbitrary metadata + model: str | None # Default AI model for this agent + name: str | None # Agent name + org: str | None # Organization ID + phone_number: str | None # Agent phone number + profile_picture: AgentUpdateInputProfilePicture | None # Base64-encoded profile picture + team: str | None # Team ID + user: str | None # User ID + + +class AgentAgentRoutinesInputAclAddItem(TypedDict, total=False): + actions: Required[list[str]] # List of allowed actions (e.g. read, write) + principal: str | None + principal_type: Required[str] # Principal type: user, team, org, org_role, agent, or everyone + + +class AgentAgentRoutinesInputAclGrantsItem(TypedDict, total=False): + actions: Required[list[str]] # List of allowed actions (e.g. read, write) + principal: str | None + principal_type: Required[str] # Principal type: user, team, org, org_role, agent, or everyone + + +class AgentAgentRoutinesInputAclRemoveItem(TypedDict, total=False): + principal: str | None # Principal identifier to remove (omit for everyone) + principal_type: Required[str] # Principal type to remove + + +class AgentAgentRoutinesInputAcl(TypedDict, total=False): + add: list[AgentAgentRoutinesInputAclAddItem] | None + grants: list[AgentAgentRoutinesInputAclGrantsItem] | None + remove: list[AgentAgentRoutinesInputAclRemoveItem] | None + + +class AgentAgentRoutinesInputPresetConfigLlm(TypedDict, total=False): + model: str | None # Model identifier. When set, overrides the agent's default_model. + + +class AgentAgentRoutinesInputPresetConfig(TypedDict, total=False): + instructions: str | None + llm: AgentAgentRoutinesInputPresetConfigLlm | None + session_mode: str | None + session_scope: str | None + structured_message_template_ids: list[str] | None + + +class AgentAgentRoutinesInputStepsItemPresetConfigLlm(TypedDict, total=False): + model: str | None # Model identifier. When set, overrides the agent's default_model. + + +class AgentAgentRoutinesInputStepsItemPresetConfig(TypedDict, total=False): + instructions: str | None + llm: AgentAgentRoutinesInputStepsItemPresetConfigLlm | None + session_mode: str | None + session_scope: str | None + structured_message_template_ids: list[str] | None + + +class AgentAgentRoutinesInputStepsItem(TypedDict, total=False): + config: str | None + handler_type: Required[str] # Handler type for this step: preset, script, or workflow_graph + inputs: dict[str, object] | None + name: str | None # Optional step label. Must be unique within the chain if set. + on_error: str | None # Error policy: halt (default), continue, or retry. + output_key: str | None + preset_config: AgentAgentRoutinesInputStepsItemPresetConfig | None + preset_name: str | None # Preset name (for handler_type: preset) + script: str | None # Inline script source (for handler_type: script) + + +class AgentAgentRoutinesInput(TypedDict, total=False): + acl: AgentAgentRoutinesInputAcl | None # Access control list + config: str | None # Config ID (for workflow_graph handler) + description: str | None # Description + event_config: dict[str, object] | None + event_type: str | None # Event type (deprecated, use event_config) + handler_type: Required[str] # Handler type: workflow_graph, script, preset, or chain + lookup_key: str | None # Unique lookup key + metadata: dict[str, object] | None # Arbitrary metadata + name: Required[str] # Routine name + preset_config: AgentAgentRoutinesInputPresetConfig | None # Preset config + preset_name: str | None # Preset name (for preset handler) + schedule: str | None # Cron expression for scheduled routines + script: str | None # Script content (for script handler) + status: str | None # Initial status: draft or active (default: draft) + steps: list[AgentAgentRoutinesInputStepsItem] | None + trigger_context: str | None # Trigger context: chat_session or event (default: event) + + +class AgentSearchInput(TypedDict, total=False): + max_results: int | None # Max results to return + mode: str | None # Search mode: hybrid, vector, or fulltext + query: Required[str] # Search query + recency_days: int | None # Limit results to last N days + source_types: list[str] | None # Filter by source types + + +class AgentThreadsInputThread(TypedDict, total=False): + description: str | None # Thread description + is_unlisted: bool | None # Whether thread is unlisted + key: str | None # Unique thread key + metadata: dict[str, object] | None # Arbitrary metadata + org: str | None # Organization ID + settings: dict[str, object] | None # Thread settings + title: str | None # Thread title + + +class AgentThreadsInput(TypedDict, total=False): + skip_welcome_message: bool | None # Skip automatic welcome message + thread: Required[AgentThreadsInputThread] # Thread attributes + + +class ScheduleListResponseDataItem(BaseModel): + agent: str | None = None # Owning agent ID + app: str | None = None # Application ID + created_at: datetime | None = None # Creation timestamp + cron_expression: str | None = None # Cron expression (recurring only) + id: str # Schedule ID (asc_...) + instructions: str | None = None # Task instructions + last_run_at: datetime | None = None # Last execution time + max_runs: int | None = None # Maximum runs (recurring only) + metadata: dict[str, object] | None = None # Arbitrary metadata + next_run_at: datetime | None = None # Next scheduled execution + run_count: int | None = None # Number of times executed + schedule_type: str | None = None # Schedule type (once or recurring) + scheduled_at: datetime | None = None # One-time execution time + status: str | None = None # Schedule status + thread: str | None = None # Thread ID (if thread-bound) + timezone: str | None = None # Schedule timezone + updated_at: datetime | None = None # Last update timestamp + + +class ScheduleListResponse(BaseModel): + data: list[ScheduleListResponseDataItem] | None = None # Schedule entries + + +class AgentSearchResponseDataItem(BaseModel): + content: str | None = None # Normalized content text + content_type: str | None = None # Content MIME type + created_at: datetime | None = None # Creation timestamp + id: str # Item ID (cim_...) + metadata: dict[str, object] | None = None # Additional metadata + raw_content: dict[str, object] | None = None # Raw content data + type: str | None = None # Source type (requires preloaded :source association) + + +class AgentSearchResponse(BaseModel): + data: list[AgentSearchResponseDataItem] # Matching knowledge items + + class AgentAgentComputerResource: def __init__(self, http: HttpClient): self._http = http @@ -32,7 +302,7 @@ def __init__(self, http: HttpClient): async def list(self, agent: str) -> AgentComputerListResponse: return await self._http.request(f"/api/v1/agents/{agent}/agent_computers") - async def create(self, agent: str, input: dict) -> AgentComputer: + async def create(self, agent: str, input: AgentAgentComputerCreateInput) -> AgentComputer: return await self._http.request( f"/api/v1/agents/{agent}/agent_computers", method="POST", @@ -47,7 +317,7 @@ def __init__(self, http: HttpClient): async def list(self, agent: str) -> InstallationListResponse: return await self._http.request(f"/api/v1/agents/{agent}/agent_installations") - async def create(self, agent: str, input: dict) -> Installation: + async def create(self, agent: str, input: AgentAgentInstallationCreateInput) -> Installation: return await self._http.request( f"/api/v1/agents/{agent}/agent_installations", method="POST", @@ -62,10 +332,13 @@ class AgentAgentToolResource: def __init__(self, http: HttpClient): self._http = http - async def list(self, agent: str, **params) -> AgentToolListResponse: - return await self._http.request(f"/api/v1/agents/{agent}/agent_tools", query=params) + async def list(self, agent: str, *, kind: str | None = None) -> AgentToolListResponse: + query: dict[str, object] = {} + if kind is not None: + query["kind"] = kind + return await self._http.request(f"/api/v1/agents/{agent}/agent_tools", query=query) - async def create(self, agent: str, input: dict) -> AgentTool: + async def create(self, agent: str, input: AgentAgentToolCreateInput) -> AgentTool: return await self._http.request( f"/api/v1/agents/{agent}/agent_tools", method="POST", @@ -77,8 +350,11 @@ class ScheduleResource: def __init__(self, http: HttpClient): self._http = http - async def list(self, agent: str, **params) -> dict[str, object]: - return await self._http.request(f"/api/v1/agents/{agent}/schedules", query=params) + async def list(self, agent: str, *, status: str | None = None) -> ScheduleListResponse: + query: dict[str, object] = {} + if status is not None: + query["status"] = status + return await self._http.request(f"/api/v1/agents/{agent}/schedules", query=query) async def get(self, agent: str, schedule: str) -> AgentSchedule: return await self._http.request(f"/api/v1/agents/{agent}/schedules/{schedule}") @@ -92,10 +368,26 @@ def __init__(self, http: HttpClient): self.agent_tools = AgentAgentToolResource(http) self.schedules = ScheduleResource(http) - async def list(self, **params) -> AgentListResponse: - return await self._http.request("/api/v1/agents", query=params) + async def list( + self, + *, + page: int | None = None, + page_size: int | None = None, + search: str | None = None, + user: str | None = None, + ) -> AgentListResponse: + query: dict[str, object] = {} + if page is not None: + query["page"] = page + if page_size is not None: + query["pageSize"] = page_size + if search is not None: + query["search"] = search + if user is not None: + query["user"] = user + return await self._http.request("/api/v1/agents", query=query) - async def create(self, input: dict) -> Agent: + async def create(self, input: AgentCreateInput) -> Agent: return await self._http.request("/api/v1/agents", method="POST", body=input) async def delete(self, agent: str) -> None: @@ -104,21 +396,32 @@ async def delete(self, agent: str) -> None: async def get(self, agent: str) -> Agent: return await self._http.request(f"/api/v1/agents/{agent}") - async def update(self, agent: str, input: dict) -> Agent: + async def update(self, agent: str, input: AgentUpdateInput) -> Agent: return await self._http.request(f"/api/v1/agents/{agent}", method="PATCH", body=input) - async def agent_routines(self, agent: str, input: dict) -> AgentRoutine: + async def agent_routines(self, agent: str, input: AgentAgentRoutinesInput) -> AgentRoutine: return await self._http.request( f"/api/v1/agents/{agent}/agent_routines", method="POST", body=input, ) - async def agent_working_memory(self, agent: str, **params) -> WorkingMemoryEntryListResponse: - return await self._http.request( - f"/api/v1/agents/{agent}/agent_working_memory", - query=params, - ) + async def agent_working_memory( + self, + agent: str, + *, + page: int | None = None, + page_size: int | None = None, + search: str | None = None, + ) -> WorkingMemoryEntryListResponse: + query: dict[str, object] = {} + if page is not None: + query["page"] = page + if page_size is not None: + query["pageSize"] = page_size + if search is not None: + query["search"] = search + return await self._http.request(f"/api/v1/agents/{agent}/agent_working_memory", query=query) async def export(self, agent: str) -> AgentExport: """ @@ -130,10 +433,10 @@ async def export(self, agent: str) -> AgentExport: """ return await self._http.request(f"/api/v1/agents/{agent}/export") - async def search(self, agent: str, input: dict) -> dict[str, object]: + async def search(self, agent: str, input: AgentSearchInput) -> AgentSearchResponse: return await self._http.request(f"/api/v1/agents/{agent}/search", method="POST", body=input) - async def threads(self, agent: str, input: dict) -> Thread: + async def threads(self, agent: str, input: AgentThreadsInput) -> Thread: return await self._http.request( f"/api/v1/agents/{agent}/threads", method="POST", diff --git a/src/archastro/platform/v1/resources/ai.py b/src/archastro/platform/v1/resources/ai.py index af9b3f2..1e8b07b 100644 --- a/src/archastro/platform/v1/resources/ai.py +++ b/src/archastro/platform/v1/resources/ai.py @@ -1,21 +1,125 @@ # Copyright (c) 2026 ArchAstro Inc. All Rights Reserved. # This file is auto-generated by @archastro/sdk-generator. Do not edit. -# Content hash: 4f4e804e4e5b +# Content hash: e1c0ad115554 from __future__ import annotations +from typing import Required, TypedDict + +from pydantic import BaseModel + from ...runtime.http_client import HttpClient from ...types.ai import AICompletionResult, AIImageResult +class ChatCompletionsInputMessagesItemToolCallsItem(TypedDict, total=False): + arguments: Required[dict[str, object]] # Tool arguments + id: Required[str] # Tool call ID + name: Required[str] # Tool/function name + thought_signature: str | None # Optional thought signature + + +class ChatCompletionsInputMessagesItemToolResultsItem(TypedDict, total=False): + content: str | None # Tool result content + id: Required[str] # Tool call ID this result responds to + name: Required[str] # Tool/function name + resolution: object | None # Structured tool resolution + + +class ChatCompletionsInputMessagesItem(TypedDict, total=False): + content: str | None # Message text content + content_parts: list[dict[str, object]] | None # Multimodal content parts + resume_token: str | None # Resume token for continuing conversations + role: Required[str] # Message role (system, user, assistant, tool) + structured_output: object | None # Structured output data + tool_calls: list[ChatCompletionsInputMessagesItemToolCallsItem] | None + tool_results: list[ChatCompletionsInputMessagesItemToolResultsItem] | None + + +class ChatCompletionsInputOptsToolsItemFunction(TypedDict, total=False): + description: str | None # Function description + name: Required[str] # Function name + parameters: Required[dict[str, object]] # JSON Schema for function parameters + + +class ChatCompletionsInputOptsToolsItem(TypedDict): + function: ChatCompletionsInputOptsToolsItemFunction # Function tool definition + type: str # Tool type (function) + + +class ChatCompletionsInputOpts(TypedDict, total=False): + max_tokens: int | None # Maximum tokens for the response + model: Required[str] # Model identifier + server_tools: list[dict[str, object]] | None + temperature: float | None # Sampling temperature + tools: list[ChatCompletionsInputOptsToolsItem] | None # OpenAI tool definitions + + +class ChatCompletionsInput(TypedDict, total=False): + context: dict[str, object] | None # Template context map + messages: Required[list[ChatCompletionsInputMessagesItem]] # Chat completion messages + opts: Required[ChatCompletionsInputOpts] # Completion options + + +class ImageEditsInputImagesItem(TypedDict): + image_data: str # Base64-encoded image data + image_type: str # MIME type (e.g. image/png, image/jpeg) + + +class ImageEditsInput(TypedDict, total=False): + aspect_ratio: str | None # Aspect ratio (e.g. 1:1, 16:9) + background: str | None # Background setting (model-dependent) + height: int | None # Image height in pixels + image_size: str | None # Image size tier for Gemini (e.g. 1K, 2K, 4K) + images: Required[list[ImageEditsInputImagesItem]] # Source images to edit + model: str | None # Model identifier (defaults to the platform default) + output_format: str | None # Output format (png, jpeg, webp) + prompt: Required[str] # Text description of the edit to apply + quality: str | None # Quality setting (model-dependent) + size: str | None # Size string for OpenAI models (e.g. 1024x1024) + style: str | None # Style setting (model-dependent) + width: int | None # Image width in pixels + + +class ImageGenerationsInput(TypedDict, total=False): + aspect_ratio: str | None # Aspect ratio (e.g. 1:1, 16:9) + background: str | None # Background setting (model-dependent) + height: int | None # Image height in pixels + image_size: str | None # Image size tier for Gemini (e.g. 1K, 2K, 4K) + model: str | None # Model identifier (defaults to the platform default) + n: int | None # Number of images to generate (default 1) + output_format: str | None # Output format (png, jpeg, webp) + prompt: Required[str] # Text description of the image to generate + quality: str | None # Quality setting (model-dependent) + size: str | None # Size string for OpenAI models (e.g. 1024x1024) + style: str | None # Style setting (model-dependent) + width: int | None # Image width in pixels + + +class ChatModelsResponseDataItem(BaseModel): + id: str # Model identifier + + +class ChatModelsResponse(BaseModel): + data: list[ChatModelsResponseDataItem] # The models + + +class ImageModelsResponseDataItem(BaseModel): + id: str # Model identifier + + +class ImageModelsResponse(BaseModel): + data: list[ImageModelsResponseDataItem] # The models + + class ChatResource: def __init__(self, http: HttpClient): self._http = http - async def completions(self, input: dict) -> AICompletionResult: + async def completions(self, input: ChatCompletionsInput) -> AICompletionResult: return await self._http.request("/api/v1/ai/chat/completions", method="POST", body=input) - async def models(self) -> dict[str, object]: + async def models(self) -> ChatModelsResponse: return await self._http.request("/api/v1/ai/chat/models") @@ -23,13 +127,13 @@ class ImageResource: def __init__(self, http: HttpClient): self._http = http - async def edits(self, input: dict) -> AIImageResult: + async def edits(self, input: ImageEditsInput) -> AIImageResult: return await self._http.request("/api/v1/ai/image/edits", method="POST", body=input) - async def generations(self, input: dict) -> AIImageResult: + async def generations(self, input: ImageGenerationsInput) -> AIImageResult: return await self._http.request("/api/v1/ai/image/generations", method="POST", body=input) - async def models(self) -> dict[str, object]: + async def models(self) -> ImageModelsResponse: return await self._http.request("/api/v1/ai/image/models") diff --git a/src/archastro/platform/v1/resources/artifacts.py b/src/archastro/platform/v1/resources/artifacts.py index 5bfe314..d088bc2 100644 --- a/src/archastro/platform/v1/resources/artifacts.py +++ b/src/archastro/platform/v1/resources/artifacts.py @@ -1,13 +1,24 @@ # Copyright (c) 2026 ArchAstro Inc. All Rights Reserved. # This file is auto-generated by @archastro/sdk-generator. Do not edit. -# Content hash: 8801f42e28cb +# Content hash: 9f86e6a68293 from __future__ import annotations +from typing import Required, TypedDict + from ...runtime.http_client import HttpClient from ...types.artifacts import Artifact +class ArtifactReplaceInput(TypedDict, total=False): + description: str | None # Artifact description + file_content: str | None # Base64 encoded file content + file_content_type: str | None # File MIME type + file_name: str | None # File name + from_version: Required[int] # Current version for optimistic concurrency control + name: str | None # Artifact name + + class ArtifactResource: def __init__(self, http: HttpClient): self._http = http @@ -18,11 +29,14 @@ async def delete(self, artifact: str) -> None: async def get(self, artifact: str) -> Artifact: return await self._http.request(f"/api/v1/artifacts/{artifact}") - async def replace(self, artifact: str, input: dict) -> Artifact: + async def replace(self, artifact: str, input: ArtifactReplaceInput) -> Artifact: return await self._http.request(f"/api/v1/artifacts/{artifact}", method="PUT", body=input) async def archive(self, artifact: str) -> None: await self._http.request(f"/api/v1/artifacts/{artifact}/archive", method="POST") - async def content(self, artifact: str, **params) -> dict[str, str]: - return await self._http.request_raw(f"/api/v1/artifacts/{artifact}/content", query=params) + async def content(self, artifact: str, *, version: int | None = None) -> dict[str, str]: + query: dict[str, object] = {} + if version is not None: + query["version"] = version + return await self._http.request_raw(f"/api/v1/artifacts/{artifact}/content", query=query) diff --git a/src/archastro/platform/v1/resources/automations.py b/src/archastro/platform/v1/resources/automations.py index ebce38e..d4a78ea 100644 --- a/src/archastro/platform/v1/resources/automations.py +++ b/src/archastro/platform/v1/resources/automations.py @@ -1,18 +1,25 @@ # Copyright (c) 2026 ArchAstro Inc. All Rights Reserved. # This file is auto-generated by @archastro/sdk-generator. Do not edit. -# Content hash: ed7fe8aed161 +# Content hash: 78b9bb238f59 from __future__ import annotations +from typing import TypedDict + from ...runtime.http_client import HttpClient from ...types.automations import AutomationRun +class AutomationInvokeInput(TypedDict, total=False): + idempotency_key: str | None # Idempotency key to deduplicate invocations + payload: dict[str, object] | None + + class AutomationResource: def __init__(self, http: HttpClient): self._http = http - async def invoke(self, automation: str, input: dict) -> AutomationRun: + async def invoke(self, automation: str, input: AutomationInvokeInput) -> AutomationRun: return await self._http.request( f"/api/v1/automations/{automation}/invoke", method="POST", diff --git a/src/archastro/platform/v1/resources/config.py b/src/archastro/platform/v1/resources/config.py index 4df8685..6fc2692 100644 --- a/src/archastro/platform/v1/resources/config.py +++ b/src/archastro/platform/v1/resources/config.py @@ -1,20 +1,180 @@ # Copyright (c) 2026 ArchAstro Inc. All Rights Reserved. # This file is auto-generated by @archastro/sdk-generator. Do not edit. -# Content hash: d114f5ce8cbc +# Content hash: 123964157808 from __future__ import annotations +from datetime import datetime +from typing import Required, TypedDict + +from pydantic import BaseModel + from ...runtime.http_client import HttpClient from ...types.common import ValidationResult from ...types.config import Config, ConfigKindSchema +class SystemCloneInput(TypedDict, total=False): + lookup_key: str | None # Override lookup_key on the clone + org: str | None # Scope the clone to an org (must match viewer's org if set) + team: str | None # Clone to this team + user: str | None # Clone to this user + virtual_path: str | None # Override virtual_path on the clone + + +class ConfigCreateInput(TypedDict, total=False): + change_description: str | None # Description of changes + data: dict[str, object] | None # Additional structured data stored on the version + kind: Required[str] # Config kind (e.g., Agent, APITool) + lookup_key: str | None # Optional lookup key + mime_type: Required[str] # Content mime type + parent: str | None # Parent config ID (for bundle children, e.g. files under a Skill) + raw_content: Required[str] # Raw content (YAML/JSON/etc) + relative_path: str | None # Path within the parent bundle (required when parent is set) + team: str | None # Team ID (for team-owned configs) + user: str | None # User ID (for user-owned configs) + virtual_path: str | None # Unique path within the owner scope + + +class ConfigEncryptSecretInput(TypedDict): + plaintext: str # Secret value to encrypt + + +class ConfigValidateInput(TypedDict, total=False): + kind: Required[str] # Config kind to validate against + mime_type: Required[str] # Content mime type + raw_content: Required[str] # Raw content to validate + team: str | None # Team ID (for team-owned configs) + user: str | None # User ID (for user-owned configs) + + +class ConfigReplaceInput(TypedDict, total=False): + change_description: str | None # Description of changes + data: dict[str, object] | None # Additional structured data stored on the version + lookup_key: str | None # Update lookup key + mime_type: Required[str] # Content mime type + raw_content: Required[str] # Raw content (YAML/JSON/etc) + relative_path: str | None # Update relative path within parent bundle + team: str | None # Team ID (for team-owned configs) + user: str | None # User ID (for user-owned configs) + virtual_path: str | None # Update virtual path + + +class ConfigArchiveInput(TypedDict, total=False): + team: str | None # Team ID (for team-owned configs) + user: str | None # User ID (for user-owned configs) + + +class ConfigUnarchiveInput(TypedDict, total=False): + team: str | None # Team ID (for team-owned configs) + user: str | None # User ID (for user-owned configs) + + +class KindListResponseDataItem(BaseModel): + classification: str # Kind classification: root or supplemental + description: str | None = None + kind: str # The config kind name (e.g., Agent, APITool) + sample_available: bool # Whether a YAML sample is available + schema_available: bool # Whether a JSON schema is available + + +class KindListResponse(BaseModel): + data: list[KindListResponseDataItem] # The config kinds + + +class SystemListResponseDataItemCurrentVersion(BaseModel): + change_description: str | None = None # Description of changes + created_at: datetime | None = None # Creation timestamp + data: dict[str, object] | None = None # Additional structured data + id: str # Config version ID (cfv_...) + org: str | None = None # Organization + sandbox: str | None = None # Sandbox + version_number: int # Version number + + +class SystemListResponseDataItem(BaseModel): + created_at: datetime | None = None # Creation timestamp + current_version: SystemListResponseDataItemCurrentVersion | None = None # Current version + id: str # Config ID (cfg_...) + is_archived: bool | None = None # Whether config is archived + kind: str # Config kind (e.g., Agent, APITool) + lookup_key: str | None = None # Optional lookup key + mime_type: str | None = None # Content mime type + org: str | None = None # Organization + parent: str | None = None # Parent config ID (bundle children only) + raw_content: str | None = None # Raw file content (system configs only) + relative_path: str | None = None # Path within parent bundle (bundle children only) + sandbox: str | None = None # Sandbox identifier + team: str | None = None # Team + updated_at: datetime | None = None # Last update timestamp + user: str | None = None # User + virtual_path: str | None = None # Unique path within the team + + +class SystemListResponse(BaseModel): + data: list[SystemListResponseDataItem] # The system configs + + +class ConfigListResponseDataItemCurrentVersion(BaseModel): + change_description: str | None = None # Description of changes + created_at: datetime | None = None # Creation timestamp + data: dict[str, object] | None = None # Additional structured data + id: str # Config version ID (cfv_...) + org: str | None = None # Organization + sandbox: str | None = None # Sandbox + version_number: int # Version number + + +class ConfigListResponseDataItem(BaseModel): + created_at: datetime | None = None # Creation timestamp + current_version: ConfigListResponseDataItemCurrentVersion | None = None # Current version + id: str # Config ID (cfg_...) + is_archived: bool | None = None # Whether config is archived + kind: str # Config kind (e.g., Agent, APITool) + lookup_key: str | None = None # Optional lookup key + mime_type: str | None = None # Content mime type + org: str | None = None # Organization + parent: str | None = None # Parent config ID (bundle children only) + raw_content: str | None = None # Raw file content (system configs only) + relative_path: str | None = None # Path within parent bundle (bundle children only) + sandbox: str | None = None # Sandbox identifier + team: str | None = None # Team + updated_at: datetime | None = None # Last update timestamp + user: str | None = None # User + virtual_path: str | None = None # Unique path within the team + + +class ConfigListResponse(BaseModel): + data: list[ConfigListResponseDataItem] # The configs + + +class ConfigEncryptSecretResponse(BaseModel): + encrypted_value: str # Encrypted ciphertext for use in secret_value! + + +class ConfigVersionsResponseVersionsItem(BaseModel): + change_description: str | None = None # Description of changes + created_at: datetime | None = None # Creation timestamp + data: dict[str, object] | None = None # Additional structured data + id: str # Config version ID (cfv_...) + org: str | None = None # Organization + sandbox: str | None = None # Sandbox + version_number: int # Version number + + +class ConfigVersionsResponse(BaseModel): + versions: list[ConfigVersionsResponseVersionsItem] # List of versions + + class KindResource: def __init__(self, http: HttpClient): self._http = http - async def list(self, **params) -> dict[str, object]: - return await self._http.request("/api/v1/config/kinds", query=params) + async def list(self, *, kind: list[str] | None = None) -> KindListResponse: + query: dict[str, object] = {} + if kind is not None: + query["kind"] = kind + return await self._http.request("/api/v1/config/kinds", query=query) async def schema(self, kind: str) -> ConfigKindSchema: return await self._http.request(f"/api/v1/config/kinds/{kind}/schema") @@ -24,13 +184,16 @@ class SystemResource: def __init__(self, http: HttpClient): self._http = http - async def list(self, **params) -> dict[str, object]: - return await self._http.request("/api/v1/config/system", query=params) + async def list(self, *, kind: str | None = None) -> SystemListResponse: + query: dict[str, object] = {} + if kind is not None: + query["kind"] = kind + return await self._http.request("/api/v1/config/system", query=query) async def get(self, system: str) -> Config: return await self._http.request(f"/api/v1/config/system/{system}") - async def clone(self, system: str, input: dict) -> Config: + async def clone(self, system: str, input: SystemCloneInput) -> Config: return await self._http.request( f"/api/v1/config/system/{system}/clone", method="POST", @@ -44,43 +207,88 @@ def __init__(self, http: HttpClient): self.kinds = KindResource(http) self.system = SystemResource(http) - async def list(self, **params) -> dict[str, object]: - return await self._http.request("/api/v1/config", query=params) + async def list( + self, + *, + team: str | None = None, + user: str | None = None, + kind: str | None = None, + lookup_key: str | None = None, + parents: list[str] | None = None, + ) -> ConfigListResponse: + query: dict[str, object] = {} + if team is not None: + query["team"] = team + if user is not None: + query["user"] = user + if kind is not None: + query["kind"] = kind + if lookup_key is not None: + query["lookupKey"] = lookup_key + if parents is not None: + query["parents"] = parents + return await self._http.request("/api/v1/config", query=query) - async def create(self, input: dict) -> Config: + async def create(self, input: ConfigCreateInput) -> Config: return await self._http.request("/api/v1/config", method="POST", body=input) - async def encrypt_secret(self, input: dict) -> dict[str, object]: + async def encrypt_secret(self, input: ConfigEncryptSecretInput) -> ConfigEncryptSecretResponse: return await self._http.request("/api/v1/config/encrypt_secret", method="POST", body=input) - async def validate(self, input: dict) -> ValidationResult: + async def validate(self, input: ConfigValidateInput) -> ValidationResult: return await self._http.request("/api/v1/config/validate", method="POST", body=input) async def delete(self, config: str) -> None: await self._http.request(f"/api/v1/config/{config}", method="DELETE") - async def get(self, config: str, **params) -> Config: - return await self._http.request(f"/api/v1/config/{config}", query=params) + async def get(self, config: str, *, team: str | None = None, user: str | None = None) -> Config: + query: dict[str, object] = {} + if team is not None: + query["team"] = team + if user is not None: + query["user"] = user + return await self._http.request(f"/api/v1/config/{config}", query=query) - async def replace(self, config: str, input: dict) -> Config: + async def replace(self, config: str, input: ConfigReplaceInput) -> Config: return await self._http.request(f"/api/v1/config/{config}", method="PUT", body=input) - async def archive(self, config: str, input: dict) -> Config: + async def archive(self, config: str, input: ConfigArchiveInput) -> Config: return await self._http.request( f"/api/v1/config/{config}/archive", method="POST", body=input, ) - async def content(self, config: str, **params) -> dict[str, str]: - return await self._http.request_raw(f"/api/v1/config/{config}/content", query=params) + async def content( + self, + config: str, + *, + team: str | None = None, + user: str | None = None, + format: str | None = None, + ) -> dict[str, str]: + query: dict[str, object] = {} + if team is not None: + query["team"] = team + if user is not None: + query["user"] = user + if format is not None: + query["format"] = format + return await self._http.request_raw(f"/api/v1/config/{config}/content", query=query) - async def unarchive(self, config: str, input: dict) -> Config: + async def unarchive(self, config: str, input: ConfigUnarchiveInput) -> Config: return await self._http.request( f"/api/v1/config/{config}/unarchive", method="POST", body=input, ) - async def versions(self, config: str, **params) -> dict[str, object]: - return await self._http.request(f"/api/v1/config/{config}/versions", query=params) + async def versions( + self, config: str, *, team: str | None = None, user: str | None = None + ) -> ConfigVersionsResponse: + query: dict[str, object] = {} + if team is not None: + query["team"] = team + if user is not None: + query["user"] = user + return await self._http.request(f"/api/v1/config/{config}/versions", query=query) diff --git a/src/archastro/platform/v1/resources/custom_objects.py b/src/archastro/platform/v1/resources/custom_objects.py index 78860db..7feb6c9 100644 --- a/src/archastro/platform/v1/resources/custom_objects.py +++ b/src/archastro/platform/v1/resources/custom_objects.py @@ -1,13 +1,43 @@ # Copyright (c) 2026 ArchAstro Inc. All Rights Reserved. # This file is auto-generated by @archastro/sdk-generator. Do not edit. -# Content hash: 3fac1fdb8135 +# Content hash: 58eb873b7c67 from __future__ import annotations +from datetime import datetime +from typing import Required, TypedDict + +from pydantic import BaseModel + from ...runtime.http_client import HttpClient from ...types.common import CustomObject +class CustomObjectReplaceInput(TypedDict, total=False): + field_ops: dict[str, object] | None # Granular array operations per field + fields: Required[dict[str, object]] # Object field values to update + type: str | None # Object schema type (lookup_key) + + +class CustomObjectReplaceResponseData(BaseModel): + created_at: datetime | None = None # Created timestamp + fields: dict[str, object] | None = None # Object field values + id: str # Public ID (cobj_...) + org: str | None = None # Organization + row_key: str | None = None # Row key + sandbox: str | None = None # Sandbox identifier + schema_type: str | None = None # Schema type (lookup_key) + team: str | None = None # Owning team + updated_at: datetime | None = None # Updated timestamp + user: str | None = None # Owning user + version: int | None = None # Aggregate version for OCC + + +class CustomObjectReplaceResponse(BaseModel): + data: CustomObjectReplaceResponseData # The updated object + meta: dict[str, object] | None = None # Version metadata + + class CustomObjectResource: def __init__(self, http: HttpClient): self._http = http @@ -15,10 +45,15 @@ def __init__(self, http: HttpClient): async def delete(self, object: str) -> None: await self._http.request(f"/api/v1/custom_objects/{object}", method="DELETE") - async def get(self, object: str, **params) -> CustomObject: - return await self._http.request(f"/api/v1/custom_objects/{object}", query=params) + async def get(self, object: str, *, type: str | None = None) -> CustomObject: + query: dict[str, object] = {} + if type is not None: + query["type"] = type + return await self._http.request(f"/api/v1/custom_objects/{object}", query=query) - async def replace(self, object: str, input: dict) -> dict[str, object]: + async def replace( + self, object: str, input: CustomObjectReplaceInput + ) -> CustomObjectReplaceResponse: return await self._http.request( f"/api/v1/custom_objects/{object}", method="PUT", diff --git a/src/archastro/platform/v1/resources/invites.py b/src/archastro/platform/v1/resources/invites.py index 29454b8..bd5df2b 100644 --- a/src/archastro/platform/v1/resources/invites.py +++ b/src/archastro/platform/v1/resources/invites.py @@ -1,16 +1,22 @@ # Copyright (c) 2026 ArchAstro Inc. All Rights Reserved. # This file is auto-generated by @archastro/sdk-generator. Do not edit. -# Content hash: 2496705f5593 +# Content hash: aefce4b1e5f1 from __future__ import annotations +from typing import TypedDict + from ...runtime.http_client import HttpClient from ...types.users import UserInvite +class InviteAcceptInput(TypedDict): + key: str # Invite key + + class InviteResource: def __init__(self, http: HttpClient): self._http = http - async def accept(self, input: dict) -> UserInvite: + async def accept(self, input: InviteAcceptInput) -> UserInvite: return await self._http.request("/api/v1/invites/accept", method="POST", body=input) diff --git a/src/archastro/platform/v1/resources/kv.py b/src/archastro/platform/v1/resources/kv.py index 70c15a1..a1c4f58 100644 --- a/src/archastro/platform/v1/resources/kv.py +++ b/src/archastro/platform/v1/resources/kv.py @@ -1,28 +1,63 @@ # Copyright (c) 2026 ArchAstro Inc. All Rights Reserved. # This file is auto-generated by @archastro/sdk-generator. Do not edit. -# Content hash: 60c07cf1454a +# Content hash: 9d8e4c8db1c6 from __future__ import annotations +from typing import Required, TypedDict + from ...runtime.http_client import HttpClient from ...types.common import KeyValueStorageEntry, KeyValueStorageEntryPage +class KvCreateInput(TypedDict, total=False): + key: Required[str] # Storage key + user: str | None + value: Required[str] # Value to store + + +class KvUpsertInput(TypedDict, total=False): + user: str | None + value: Required[str] # Value to store + + class KvResource: def __init__(self, http: HttpClient): self._http = http - async def list(self, **params) -> KeyValueStorageEntryPage: - return await self._http.request("/api/v1/kv", query=params) - - async def create(self, input: dict) -> KeyValueStorageEntry: + async def list( + self, + *, + page: int | None = None, + page_size: int | None = None, + user: str | None = None, + user_search: str | None = None, + key: str | None = None, + ) -> KeyValueStorageEntryPage: + query: dict[str, object] = {} + if page is not None: + query["page"] = page + if page_size is not None: + query["pageSize"] = page_size + if user is not None: + query["user"] = user + if user_search is not None: + query["userSearch"] = user_search + if key is not None: + query["key"] = key + return await self._http.request("/api/v1/kv", query=query) + + async def create(self, input: KvCreateInput) -> KeyValueStorageEntry: return await self._http.request("/api/v1/kv", method="POST", body=input) async def delete(self, key: str) -> None: await self._http.request(f"/api/v1/kv/{key}", method="DELETE") - async def get(self, key: str, **params) -> KeyValueStorageEntry: - return await self._http.request(f"/api/v1/kv/{key}", query=params) + async def get(self, key: str, *, user: str | None = None) -> KeyValueStorageEntry: + query: dict[str, object] = {} + if user is not None: + query["user"] = user + return await self._http.request(f"/api/v1/kv/{key}", query=query) - async def upsert(self, key: str, input: dict) -> KeyValueStorageEntry: + async def upsert(self, key: str, input: KvUpsertInput) -> KeyValueStorageEntry: return await self._http.request(f"/api/v1/kv/{key}", method="PUT", body=input) diff --git a/src/archastro/platform/v1/resources/orgs.py b/src/archastro/platform/v1/resources/orgs.py index f726e88..f54fbcd 100644 --- a/src/archastro/platform/v1/resources/orgs.py +++ b/src/archastro/platform/v1/resources/orgs.py @@ -1,15 +1,42 @@ # Copyright (c) 2026 ArchAstro Inc. All Rights Reserved. # This file is auto-generated by @archastro/sdk-generator. Do not edit. -# Content hash: 22cdcd20f836 +# Content hash: 29a357bc6f84 from __future__ import annotations +from pydantic import BaseModel + from ...runtime.http_client import HttpClient +class OrgListResponseDataItem(BaseModel): + domain: str # Primary domain + id: str # Public ID (org_...) + name: str # Organization name + + +class OrgListResponse(BaseModel): + data: list[OrgListResponseDataItem] # The organizations + has_next: bool | None = None # Whether there are more pages + has_prev: bool | None = None # Whether there are previous pages + page: int | None = None # Current page + page_size: int | None = None # Results per page + total_entries: int | None = None # Total matching organizations + total_pages: int | None = None # Total pages + + class OrgResource: def __init__(self, http: HttpClient): self._http = http - async def list(self, **params) -> dict[str, object]: - return await self._http.request("/api/v1/orgs", query=params) + async def list( + self, *, search: str | None = None, page: int | None = None, page_size: int | None = None + ) -> OrgListResponse: + query: dict[str, object] = {} + if search is not None: + query["search"] = search + if page is not None: + query["page"] = page + if page_size is not None: + query["pageSize"] = page_size + return await self._http.request("/api/v1/orgs", query=query) diff --git a/src/archastro/platform/v1/resources/team_memberships.py b/src/archastro/platform/v1/resources/team_memberships.py index fa3fcb0..b8a5473 100644 --- a/src/archastro/platform/v1/resources/team_memberships.py +++ b/src/archastro/platform/v1/resources/team_memberships.py @@ -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: c579e3ed0f26 +# Content hash: fd3c348f5835 from __future__ import annotations @@ -12,8 +12,27 @@ class TeamMembershipResource: def __init__(self, http: HttpClient): self._http = http - async def list(self, **params) -> TeamMembershipListResponse: - return await self._http.request("/api/v1/team_memberships", query=params) + async def list( + self, + *, + team: list[str] | None = None, + user: list[str] | None = None, + agent: list[str] | None = None, + page: int | None = None, + page_size: int | None = None, + ) -> TeamMembershipListResponse: + query: dict[str, object] = {} + if team is not None: + query["team"] = team + if user is not None: + query["user"] = user + if agent is not None: + query["agent"] = agent + if page is not None: + query["page"] = page + if page_size is not None: + query["pageSize"] = page_size + return await self._http.request("/api/v1/team_memberships", query=query) async def delete(self, team_membership: str) -> None: await self._http.request(f"/api/v1/team_memberships/{team_membership}", method="DELETE") diff --git a/src/archastro/platform/v1/resources/teams.py b/src/archastro/platform/v1/resources/teams.py index c63b907..b1f9c5b 100644 --- a/src/archastro/platform/v1/resources/teams.py +++ b/src/archastro/platform/v1/resources/teams.py @@ -1,9 +1,14 @@ # Copyright (c) 2026 ArchAstro Inc. All Rights Reserved. # This file is auto-generated by @archastro/sdk-generator. Do not edit. -# Content hash: 43dd6f7ebab8 +# Content hash: c6271436868a from __future__ import annotations +from datetime import datetime +from typing import Required, TypedDict + +from pydantic import BaseModel + from ...runtime.http_client import HttpClient from ...types.artifacts import Artifact from ...types.common import CustomObject @@ -11,14 +16,539 @@ from ...types.threads import Thread +class TeamArtifactCreateInput(TypedDict): + artifact: dict[str, object] # Artifact attributes + + +class TeamCustomObjectCreateInput(TypedDict): + fields: dict[str, object] # Object field values + type: str # Object schema type (lookup_key) + + +class MemberCreateInput(TypedDict, total=False): + agent: str | None # Agent ID (provide exactly one of user_id or agent_id) + role: str | None # Member role (default: member) + user: str | None # User ID (provide exactly one of user_id or agent_id) + + +class TeamThreadCreateInputThreadProfilePicture(TypedDict, total=False): + data: str | None # Base64 encoded image data + filename: str | None # Original filename + mime_type: str | None # MIME type of the image + + +class TeamThreadCreateInputThreadSettings(TypedDict, total=False): + agent_enabled: bool | None # Whether the agent is enabled for this thread + + +class TeamThreadCreateInputThread(TypedDict, total=False): + create_legacy_agent: bool | None # Create a legacy chat agent for this thread + description: str | None # Thread description + is_unlisted: bool | None # Whether the thread is unlisted + key: str | None # Unique key for the thread + metadata: dict[str, object] | None # Additional metadata + org_id: str | None # Organization ID + profile_picture: TeamThreadCreateInputThreadProfilePicture | None + settings: TeamThreadCreateInputThreadSettings | None # Thread settings + title: str | None # Thread title + + +class TeamThreadCreateInput(TypedDict, total=False): + skip_welcome_message: bool | None # Skip automatic welcome message + thread: Required[TeamThreadCreateInputThread] # Thread attributes + + +class TeamCreateInputAclAddItem(TypedDict, total=False): + actions: Required[list[str]] # List of allowed actions (e.g. read, write) + principal: str | None + principal_type: Required[str] # Principal type: user, team, org, org_role, agent, or everyone + + +class TeamCreateInputAclGrantsItem(TypedDict, total=False): + actions: Required[list[str]] # List of allowed actions (e.g. read, write) + principal: str | None + principal_type: Required[str] # Principal type: user, team, org, org_role, agent, or everyone + + +class TeamCreateInputAclRemoveItem(TypedDict, total=False): + principal: str | None # Principal identifier to remove (omit for everyone) + principal_type: Required[str] # Principal type to remove + + +class TeamCreateInputAcl(TypedDict, total=False): + add: list[TeamCreateInputAclAddItem] | None + grants: list[TeamCreateInputAclGrantsItem] | None + remove: list[TeamCreateInputAclRemoveItem] | None + + +class TeamCreateInput(TypedDict, total=False): + acl: TeamCreateInputAcl | None # Access control list + description: str | None # Team description + metadata: dict[str, object] | None # Arbitrary key-value metadata + name: Required[str] # Team name + org: str | None # Organization ID + + +# Join a team using an invite code +class TeamJoinByCodeInput(TypedDict, total=False): + agent: str | None + invite_code: str | None # 12-character invite code (alias for join_code) + join_code: str | None # 12-character invite code + user: str | None # User ID to join (required for S2S requests without agent_id) + + +class TeamUpdateInputAclAddItem(TypedDict, total=False): + actions: Required[list[str]] # List of allowed actions (e.g. read, write) + principal: str | None + principal_type: Required[str] # Principal type: user, team, org, org_role, agent, or everyone + + +class TeamUpdateInputAclGrantsItem(TypedDict, total=False): + actions: Required[list[str]] # List of allowed actions (e.g. read, write) + principal: str | None + principal_type: Required[str] # Principal type: user, team, org, org_role, agent, or everyone + + +class TeamUpdateInputAclRemoveItem(TypedDict, total=False): + principal: str | None # Principal identifier to remove (omit for everyone) + principal_type: Required[str] # Principal type to remove + + +class TeamUpdateInputAcl(TypedDict, total=False): + add: list[TeamUpdateInputAclAddItem] | None + grants: list[TeamUpdateInputAclGrantsItem] | None + remove: list[TeamUpdateInputAclRemoveItem] | None + + +class TeamUpdateInputProfilePicture(TypedDict, total=False): + data: str | None # Base64 encoded image data + filename: str | None # Original filename + mime_type: str | None # MIME type of the image + + +class TeamUpdateInput(TypedDict, total=False): + acl: TeamUpdateInputAcl | None # Access control list + description: str | None # Team description + metadata: dict[str, object] | None # Arbitrary key-value metadata + name: str | None # Team name + profile_picture: TeamUpdateInputProfilePicture | None # Base64-encoded profile picture + + +# Join a team the current user can see +class TeamJoinInput(TypedDict, total=False): + agent: str | None + + +class TeamArtifactListResponseDataItemImageSource(BaseModel): + file: str | None = None # Storage file + height: int | None = None # Image height in pixels + media: str | None = None # Media + mime_type: str | None = None # Image MIME type + refresh_url: str | None = None # URL to refresh signed URL + url: str | None = None # Image URL + width: int | None = None # Image width in pixels + + +class TeamArtifactListResponseDataItem(BaseModel): + agent: str | None = None # Agent + content_type: str | None = None # MIME content type + created_at: datetime | None = None # Creation timestamp + current_version: str | None = None # Current version ID + description: str | None = None # Artifact description + file: str | None = None # Storage file + file_name: str | None = None # Original filename + file_url: str | None = None # Signed file URL + id: str # Artifact ID + image_source: TeamArtifactListResponseDataItemImageSource | None = None + name: str | None = None # Artifact name + org: str | None = None # Organization + sandbox: str | None = None # Sandbox identifier + team: str | None = None # Team + thread: str | None = None # Thread + updated_at: datetime | None = None # Last update timestamp + user: str | None = None # User + version: int | None = None # Current version number + + +class TeamArtifactListResponse(BaseModel): + data: list[TeamArtifactListResponseDataItem] # The artifacts + + +class TeamCustomObjectListResponseDataItem(BaseModel): + created_at: datetime | None = None # Created timestamp + fields: dict[str, object] | None = None # Object field values + id: str # Public ID (cobj_...) + org: str | None = None # Organization + row_key: str | None = None # Row key + sandbox: str | None = None # Sandbox identifier + schema_type: str | None = None # Schema type (lookup_key) + team: str | None = None # Owning team + updated_at: datetime | None = None # Updated timestamp + user: str | None = None # Owning user + version: int | None = None # Aggregate version for OCC + + +class TeamCustomObjectListResponse(BaseModel): + data: list[TeamCustomObjectListResponseDataItem] # The objects + meta: dict[str, object] | None = None # Pagination metadata + + +class MemberListResponseDataItemAgentAclAddItem(BaseModel): + actions: list[str] # List of allowed actions (e.g. read, write) + principal: str | None = None + principal_type: str # Principal type: user, team, org, org_role, agent, or everyone + + +class MemberListResponseDataItemAgentAclGrantsItem(BaseModel): + actions: list[str] # List of allowed actions (e.g. read, write) + principal: str | None = None + principal_type: str # Principal type: user, team, org, org_role, agent, or everyone + + +class MemberListResponseDataItemAgentAclRemoveItem(BaseModel): + principal: str | None = None # Principal identifier to remove (omit for everyone) + principal_type: str # Principal type to remove + + +class MemberListResponseDataItemAgentAcl(BaseModel): + add: list[MemberListResponseDataItemAgentAclAddItem] | None = None + grants: list[MemberListResponseDataItemAgentAclGrantsItem] | None = None + remove: list[MemberListResponseDataItemAgentAclRemoveItem] | None = None + + +class MemberListResponseDataItemAgent(BaseModel): + acl: MemberListResponseDataItemAgentAcl | None = None + app: str | None = None # Application + created_at: datetime | None = None # Creation timestamp + default_model: str | None = None # Default AI model + email: str | None = None # Agent email + id: str # Agent ID (agi_...) + identity: str | None = None # Identity prompt + lookup_key: str | None = None # Unique lookup key + metadata: dict[str, object] | None = None # Arbitrary metadata + name: str | None = None # Agent name + org: str | None = None # Organization + phone_number: str | None = None # Agent phone number + sandbox: str | None = None # Sandbox + team: str | None = None # Owning team + updated_at: datetime | None = None # Last update timestamp + user: str | None = None # Owning user + + +class MemberListResponseDataItemProfilePicture(BaseModel): + file: str | None = None # Storage file + height: int | None = None # Image height in pixels + media: str | None = None # Media + mime_type: str | None = None # Image MIME type + refresh_url: str | None = None # URL to refresh signed URL + url: str | None = None # Image URL + width: int | None = None # Image width in pixels + + +class MemberListResponseDataItemUser(BaseModel): + alias: str | None = None # User alias/handle + email: str | None = None # User email address + id: str # User ID + metadata: dict[str, object] | None = None # User metadata + name: str | None = None # User display name + org: str | None = None # Organization + sandbox: str | None = None # Sandbox + + +class MemberListResponseDataItem(BaseModel): + agent: MemberListResponseDataItemAgent | None = None # Agent object (when loaded) + created_at: datetime | None = None # Creation timestamp + id: str # Membership ID + joined_at: datetime | None = None # Join timestamp + metadata: dict[str, object] | None = None # Membership metadata + name: str | None = None # Member name + profile_picture: MemberListResponseDataItemProfilePicture | None = None # Profile picture + role: str | None = None # Role in team + team: dict[str, object] | None = None # Team object (when loaded) + type: str | None = None # Member type (user, agent, unknown) + updated_at: datetime | None = None # Last update timestamp + user: MemberListResponseDataItemUser | None = None # User object (when loaded) + + +class MemberListResponse(BaseModel): + data: list[MemberListResponseDataItem] # The members + + +class TeamThreadListResponseDataItemCreator(BaseModel): + alias: str | None = None # User alias/handle + email: str | None = None # User email address + id: str # User ID + metadata: dict[str, object] | None = None # User metadata + name: str | None = None # User display name + org: str | None = None # Organization + sandbox: str | None = None # Sandbox + + +class TeamThreadListResponseDataItemParentMessageActorsItemProfilePicture(BaseModel): + file: str | None = None # Storage file + height: int | None = None # Image height in pixels + media: str | None = None # Media + mime_type: str | None = None # Image MIME type + refresh_url: str | None = None # URL to refresh signed URL + url: str | None = None # Image URL + width: int | None = None # Image width in pixels + + +class TeamThreadListResponseDataItemParentMessageActorsItem(BaseModel): + alias: str | None = None # Actor alias/handle + id: str | None = None # Actor ID (format: user-xxx or agent-xxx) + name: str | None = None # Actor display name + profile_picture: TeamThreadListResponseDataItemParentMessageActorsItemProfilePicture | None = ( + None + ) + + +class TeamThreadListResponseDataItemParentMessageAttachmentsItemImageSource(BaseModel): + file: str | None = None # Storage file + height: int | None = None # Image height in pixels + media: str | None = None # Media + mime_type: str | None = None # Image MIME type + refresh_url: str | None = None # URL to refresh signed URL + url: str | None = None # Image URL + width: int | None = None # Image width in pixels + + +class TeamThreadListResponseDataItemParentMessageAttachmentsItemVariantsItemImageSource(BaseModel): + file: str | None = None # Storage file + height: int | None = None # Image height in pixels + media: str | None = None # Media + mime_type: str | None = None # Image MIME type + refresh_url: str | None = None # URL to refresh signed URL + url: str | None = None # Image URL + width: int | None = None # Image width in pixels + + +class TeamThreadListResponseDataItemParentMessageAttachmentsItemVariantsItem(BaseModel): + content_type: str | None = None # File content type + created_at: datetime | None = None # Creation timestamp + file: str | None = None # Storage file + filename: str | None = None # Original filename + height: int | None = None # Height in pixels + id: str # Variant ID + image_source: ( + TeamThreadListResponseDataItemParentMessageAttachmentsItemVariantsItemImageSource | None + ) = None + updated_at: datetime | None = None # Last update timestamp + url: str | None = None # Signed download URL + variant_key: str | None = None # Variant key (original, thumbnail, etc) + width: int | None = None # Width in pixels + + +class TeamThreadListResponseDataItemParentMessageAttachmentsItem(BaseModel): + content_type: str | None = None # MIME content type (file, artifact, media types) + description: str | None = None # Description (scraped_link, artifact, task types) + filename: str | None = None # File name (file, artifact, media types) + height: int | None = None # Media height (media type) + id: str # Attachment ID + image_height: int | None = None # Preview image height (scraped_link type) + image_source: TeamThreadListResponseDataItemParentMessageAttachmentsItemImageSource | None = ( + None + ) + image_url: str | None = None # Preview image URL (scraped_link type) + image_width: int | None = None # Preview image width (scraped_link type) + media_type: str | None = None # Media type (media type) + name: str | None = None # Media name (media type) + object: dict[str, object] | None = None # Embedded object (task, action types) + title: str | None = None # Title (scraped_link, artifact, task types) + type: str # Attachment type: file, scraped_link, artifact, task, media, action + url: str | None = None # URL to the resource (file, scraped_link, artifact, media types) + variants: ( + list[TeamThreadListResponseDataItemParentMessageAttachmentsItemVariantsItem] | None + ) = None + version: int | None = None # Artifact version number (artifact type) + width: int | None = None # Media width (media type) + + +class TeamThreadListResponseDataItemParentMessageReactionsItem(BaseModel): + payload: dict[str, object] | None = None # Reaction payload (e.g., {emoji: 'πŸ‘'}) + type: str # Reaction type (e.g., emoji_reaction) + user: str | None = None # User who added the reaction + + +class TeamThreadListResponseDataItemParentMessage(BaseModel): + actors: list[TeamThreadListResponseDataItemParentMessageActorsItem] | None = None + agent: str | None = None # Agent if sent by an agent user + attachments: list[TeamThreadListResponseDataItemParentMessageAttachmentsItem] | None = None + branched_thread: str | None = None # Branched thread (if message spawned a thread) + content: str | None = None # Message content + created_at: datetime | None = None # Creation timestamp + has_replies: bool | None = None # Whether message has replies + id: str # Message ID (msg_...) + idempotency_key: str | None = None # Client-provided idempotency key + legacy_agent: str | None = None # Legacy agent if sent by legacy chat agent + metadata: dict[str, object] | None = None # Message metadata + org: str | None = None # Organization + reactions: list[TeamThreadListResponseDataItemParentMessageReactionsItem] | None = None + rendering_mode: str | None = None # Rendering mode hint + replies: list[dict[str, object]] | None = None # Inline replies (if loaded) + replies_after_cursor: str | None = None # Cursor for replies pagination + replies_before_cursor: str | None = None # Cursor for replies pagination + reply_count: int | None = None # Number of replies + reply_to: dict[str, object] | None = None # Parent message object (if loaded) + sandbox: str | None = None # Sandbox identifier + team: str | None = None # Team + thread: str | None = None # Parent thread + user: str | None = None # Author user (public ID or expanded object when loaded) + + +class TeamThreadListResponseDataItemParticipantsItem(BaseModel): + alias: str | None = None # User alias/handle + email: str | None = None # User email address + id: str # User ID + metadata: dict[str, object] | None = None # User metadata + name: str | None = None # User display name + org: str | None = None # Organization + sandbox: str | None = None # Sandbox + + +class TeamThreadListResponseDataItemParticipatingAgentsItemAclAddItem(BaseModel): + actions: list[str] # List of allowed actions (e.g. read, write) + principal: str | None = None + principal_type: str # Principal type: user, team, org, org_role, agent, or everyone + + +class TeamThreadListResponseDataItemParticipatingAgentsItemAclGrantsItem(BaseModel): + actions: list[str] # List of allowed actions (e.g. read, write) + principal: str | None = None + principal_type: str # Principal type: user, team, org, org_role, agent, or everyone + + +class TeamThreadListResponseDataItemParticipatingAgentsItemAclRemoveItem(BaseModel): + principal: str | None = None # Principal identifier to remove (omit for everyone) + principal_type: str # Principal type to remove + + +class TeamThreadListResponseDataItemParticipatingAgentsItemAcl(BaseModel): + add: list[TeamThreadListResponseDataItemParticipatingAgentsItemAclAddItem] | None = None + grants: list[TeamThreadListResponseDataItemParticipatingAgentsItemAclGrantsItem] | None = None + remove: list[TeamThreadListResponseDataItemParticipatingAgentsItemAclRemoveItem] | None = None + + +class TeamThreadListResponseDataItemParticipatingAgentsItem(BaseModel): + acl: TeamThreadListResponseDataItemParticipatingAgentsItemAcl | None = None + app: str | None = None # Application + created_at: datetime | None = None # Creation timestamp + default_model: str | None = None # Default AI model + email: str | None = None # Agent email + id: str # Agent ID (agi_...) + identity: str | None = None # Identity prompt + lookup_key: str | None = None # Unique lookup key + metadata: dict[str, object] | None = None # Arbitrary metadata + name: str | None = None # Agent name + org: str | None = None # Organization + phone_number: str | None = None # Agent phone number + sandbox: str | None = None # Sandbox + team: str | None = None # Owning team + updated_at: datetime | None = None # Last update timestamp + user: str | None = None # Owning user + + +class TeamThreadListResponseDataItemSettings(BaseModel): + agent_enabled: bool | None = None # Whether the agent is enabled for this thread + + +class TeamThreadListResponseDataItem(BaseModel): + agent_user: str | None = None # Owning agent user + created_at: datetime | None = None # Creation timestamp + creator: TeamThreadListResponseDataItemCreator | None = None # Creator user object + description: str | None = None # Thread description + id: str # Thread ID (thr_...) + is_channel: bool | None = None # Whether this is a channel + is_default: bool | None = None # Whether this is the default thread + is_transient: bool | None = None # Whether this thread is transient + is_unlisted: bool | None = None # Whether this thread is unlisted + key: str | None = None # Thread key + last_activity: datetime | None = None # Last activity timestamp + metadata: dict[str, object] | None = None # Thread metadata + org: str | None = None # Organization + parent_message: TeamThreadListResponseDataItemParentMessage | None = None + participant: list[str] | None = None # Participant users + participants: list[TeamThreadListResponseDataItemParticipantsItem] | None = None + participating_actor: list[str] | None = None # Actors participating in thread + participating_agents: list[TeamThreadListResponseDataItemParticipatingAgentsItem] | None = None + role: str | None = None # User's role in the thread + sandbox: str | None = None # Sandbox identifier + settings: TeamThreadListResponseDataItemSettings | None = None # Thread settings + slug: str | None = None # Thread slug + sub_threads: list[dict[str, object]] | None = None # Sub-threads + team: str | None = None # Owning team + title: str | None = None # Thread title + ttl: int | None = None # Time-to-live in seconds + unread_count: int | None = None # Unread message count + updated_at: datetime | None = None # Last update timestamp + user: str | None = None # Owning user + + +class TeamThreadListResponse(BaseModel): + data: list[TeamThreadListResponseDataItem] # The threads + + +class TeamListResponseDataItemAclAddItem(BaseModel): + actions: list[str] # List of allowed actions (e.g. read, write) + principal: str | None = None + principal_type: str # Principal type: user, team, org, org_role, agent, or everyone + + +class TeamListResponseDataItemAclGrantsItem(BaseModel): + actions: list[str] # List of allowed actions (e.g. read, write) + principal: str | None = None + principal_type: str # Principal type: user, team, org, org_role, agent, or everyone + + +class TeamListResponseDataItemAclRemoveItem(BaseModel): + principal: str | None = None # Principal identifier to remove (omit for everyone) + principal_type: str # Principal type to remove + + +class TeamListResponseDataItemAcl(BaseModel): + add: list[TeamListResponseDataItemAclAddItem] | None = None + grants: list[TeamListResponseDataItemAclGrantsItem] | None = None + remove: list[TeamListResponseDataItemAclRemoveItem] | None = None + + +class TeamListResponseDataItem(BaseModel): + acl: TeamListResponseDataItemAcl | None = None + app: str | None = None # Application + badges: dict[str, object] | None = None # Badge counts by category + created_at: datetime | None = None # Creation timestamp + description: str | None = None # Team description + id: str # Team ID + membership_status: str | None = None + metadata: dict[str, object] | None = None # Team metadata + name: str | None = None # Team name + org: str | None = None # Organization + sandbox: str | None = None # Sandbox + slug: str | None = None # URL slug + updated_at: datetime | None = None # Last update timestamp + + +class TeamListResponse(BaseModel): + data: list[TeamListResponseDataItem] # The teams + has_next: bool # Whether there is a next page + has_prev: bool # Whether there is a previous page + page: int # Current page number + page_size: int # Results per page + total_entries: int # Total number of teams + total_pages: int # Total number of pages + + +class TeamInvitesResponse(BaseModel): + code: str # 6-character join code + + class TeamArtifactResource: def __init__(self, http: HttpClient): self._http = http - async def list(self, team: str) -> dict[str, object]: + async def list(self, team: str) -> TeamArtifactListResponse: return await self._http.request(f"/api/v1/teams/{team}/artifacts") - async def create(self, team: str, input: dict) -> Artifact: + async def create(self, team: str, input: TeamArtifactCreateInput) -> Artifact: return await self._http.request( f"/api/v1/teams/{team}/artifacts", method="POST", @@ -30,10 +560,29 @@ class TeamCustomObjectResource: def __init__(self, http: HttpClient): self._http = http - async def list(self, team: str, **params) -> dict[str, object]: - return await self._http.request(f"/api/v1/teams/{team}/custom_objects", query=params) + async def list( + self, + team: str, + type: str, + *, + limit: int | None = None, + offset: int | None = None, + row_key: str | None = None, + sort_key: str | None = None, + ) -> TeamCustomObjectListResponse: + query: dict[str, object] = {} + query["type"] = type + if limit is not None: + query["limit"] = limit + if offset is not None: + query["offset"] = offset + if row_key is not None: + query["rowKey"] = row_key + if sort_key is not None: + query["sortKey"] = sort_key + return await self._http.request(f"/api/v1/teams/{team}/custom_objects", query=query) - async def create(self, team: str, input: dict) -> CustomObject: + async def create(self, team: str, input: TeamCustomObjectCreateInput) -> CustomObject: return await self._http.request( f"/api/v1/teams/{team}/custom_objects", method="POST", @@ -45,10 +594,10 @@ class MemberResource: def __init__(self, http: HttpClient): self._http = http - async def list(self, team: str) -> dict[str, object]: + async def list(self, team: str) -> MemberListResponse: return await self._http.request(f"/api/v1/teams/{team}/members") - async def create(self, team: str, input: dict) -> TeamMembership: + async def create(self, team: str, input: MemberCreateInput) -> TeamMembership: return await self._http.request(f"/api/v1/teams/{team}/members", method="POST", body=input) @@ -56,10 +605,10 @@ class TeamThreadResource: def __init__(self, http: HttpClient): self._http = http - async def list(self, team: str) -> dict[str, object]: + async def list(self, team: str) -> TeamThreadListResponse: return await self._http.request(f"/api/v1/teams/{team}/threads") - async def create(self, team: str, input: dict) -> Thread: + async def create(self, team: str, input: TeamThreadCreateInput) -> Thread: return await self._http.request(f"/api/v1/teams/{team}/threads", method="POST", body=input) @@ -71,13 +620,29 @@ def __init__(self, http: HttpClient): self.members = MemberResource(http) self.threads = TeamThreadResource(http) - async def list(self, **params) -> dict[str, object]: - return await self._http.request("/api/v1/teams", query=params) + async def list( + self, + *, + page: int | None = None, + page_size: int | None = None, + search: str | None = None, + membership: str | None = None, + ) -> TeamListResponse: + query: dict[str, object] = {} + if page is not None: + query["page"] = page + if page_size is not None: + query["pageSize"] = page_size + if search is not None: + query["search"] = search + if membership is not None: + query["membership"] = membership + return await self._http.request("/api/v1/teams", query=query) - async def create(self, input: dict) -> Team: + async def create(self, input: TeamCreateInput) -> Team: return await self._http.request("/api/v1/teams", method="POST", body=input) - async def join_by_code(self, input: dict) -> Team: + async def join_by_code(self, input: TeamJoinByCodeInput) -> Team: """ Join a team using an invite code Accepts either `join_code` or `invite_code`. @@ -93,16 +658,16 @@ async def delete(self, team: str) -> None: async def get(self, team: str) -> Team: return await self._http.request(f"/api/v1/teams/{team}") - async def update(self, team: str, input: dict) -> Team: + async def update(self, team: str, input: TeamUpdateInput) -> Team: return await self._http.request(f"/api/v1/teams/{team}", method="PATCH", body=input) async def invite(self, team: str) -> TeamInvite: return await self._http.request(f"/api/v1/teams/{team}/invite", method="POST") - async def invites(self, team: str) -> dict[str, object]: + async def invites(self, team: str) -> TeamInvitesResponse: return await self._http.request(f"/api/v1/teams/{team}/invites", method="POST") - async def join(self, team: str, input: dict) -> None: + async def join(self, team: str, input: TeamJoinInput) -> None: """ Join a team the current user can see Joins a specific visible team by team ID. diff --git a/src/archastro/platform/v1/resources/thread_messages.py b/src/archastro/platform/v1/resources/thread_messages.py index 07f3654..9608655 100644 --- a/src/archastro/platform/v1/resources/thread_messages.py +++ b/src/archastro/platform/v1/resources/thread_messages.py @@ -1,13 +1,40 @@ # Copyright (c) 2026 ArchAstro Inc. All Rights Reserved. # This file is auto-generated by @archastro/sdk-generator. Do not edit. -# Content hash: 6f44448912b6 +# Content hash: ce84bb76d7b8 from __future__ import annotations +from datetime import datetime +from typing import TypedDict + +from pydantic import BaseModel + from ...runtime.http_client import HttpClient from ...types.common import Message, PaginatedReplies +class ReactionCreateInput(TypedDict): + emoji: str # Emoji to add as reaction + + +class ThreadMessageReplaceInput(TypedDict, total=False): + content: str | None # New message content + + +class ReactionCreateResponseData(BaseModel): + created_at: datetime | None = None # Creation timestamp + feedback_type: str | None = None # Type of feedback (e.g., emoji_reaction) + id: str # Reaction ID (umf_...) + message: str | None = None # Message the reaction is on + payload: dict[str, object] | None = None # Reaction payload (e.g., {emoji: ...}) + updated_at: datetime | None = None # Last update timestamp + user: str | None = None # User who added the reaction + + +class ReactionCreateResponse(BaseModel): + data: ReactionCreateResponseData # The created reaction + + class ReactionResource: def __init__(self, http: HttpClient): self._http = http @@ -15,7 +42,7 @@ def __init__(self, http: HttpClient): async def remove(self, message: str) -> None: await self._http.request(f"/api/v1/thread_messages/{message}/reactions", method="DELETE") - async def create(self, message: str, input: dict) -> dict[str, object]: + async def create(self, message: str, input: ReactionCreateInput) -> ReactionCreateResponse: return await self._http.request( f"/api/v1/thread_messages/{message}/reactions", method="POST", @@ -31,12 +58,29 @@ def __init__(self, http: HttpClient): async def delete(self, message: str) -> None: await self._http.request(f"/api/v1/thread_messages/{message}", method="DELETE") - async def replace(self, message: str, input: dict) -> Message: + async def replace(self, message: str, input: ThreadMessageReplaceInput) -> Message: return await self._http.request( f"/api/v1/thread_messages/{message}", method="PUT", body=input, ) - async def replies(self, message: str, **params) -> PaginatedReplies: - return await self._http.request(f"/api/v1/thread_messages/{message}/replies", query=params) + async def replies( + self, + message: str, + *, + before_cursor: str | None = None, + after_cursor: str | None = None, + limit: int | None = None, + tree: bool | None = None, + ) -> PaginatedReplies: + query: dict[str, object] = {} + if before_cursor is not None: + query["beforeCursor"] = before_cursor + if after_cursor is not None: + query["afterCursor"] = after_cursor + if limit is not None: + query["limit"] = limit + if tree is not None: + query["tree"] = tree + return await self._http.request(f"/api/v1/thread_messages/{message}/replies", query=query) diff --git a/src/archastro/platform/v1/resources/threads.py b/src/archastro/platform/v1/resources/threads.py index f627f74..6e97442 100644 --- a/src/archastro/platform/v1/resources/threads.py +++ b/src/archastro/platform/v1/resources/threads.py @@ -1,13 +1,241 @@ # Copyright (c) 2026 ArchAstro Inc. All Rights Reserved. # This file is auto-generated by @archastro/sdk-generator. Do not edit. -# Content hash: d068f97dd895 +# Content hash: 8e8ef8a665b7 from __future__ import annotations +from datetime import datetime +from typing import Required, TypedDict + +from pydantic import BaseModel + from ...runtime.http_client import HttpClient from ...types.threads import Thread, ThreadMember, ThreadReadStatus, ThreadSettings +class ThreadMemberCreateInput(TypedDict, total=False): + agent: str | None # Agent ID (required when type is "agent") + membership_type: str | None # Membership type: "owner" or "member" (defaults to "member") + type: Required[str] # Member type: "user" or "agent" + user: str | None # User ID (required when type is "user") + + +class SettingReplaceInput(TypedDict): + settings: dict[str, object] # Settings to update + + +class ThreadReplaceInputProfilePicture(TypedDict, total=False): + data: str | None # Base64 encoded image data + filename: str | None # Original filename + mime_type: str | None # MIME type of the image + + +class ThreadReplaceInput(TypedDict, total=False): + description: str | None # Thread description + metadata: dict[str, object] | None # Additional metadata + profile_picture: ThreadReplaceInputProfilePicture | None # Base64 encoded profile picture + title: str | None # Thread title + + +class ThreadMarkReadInput(TypedDict, total=False): + last_read_message: str | None # The message ID to mark as the last read + use_latest_message: bool | None # If true, uses the latest message in the thread + user: str | None # User ID to mark as read for (required for S2S) + + +class ThreadPictureInputPicture(TypedDict): + data: str # Base64 encoded image data + filename: str # Original filename + mime_type: str # MIME type of the image + + +class ThreadPictureInput(TypedDict): + picture: ThreadPictureInputPicture # Picture data to upload + + +class ThreadMemberListResponseDataItemUser(BaseModel): + alias: str | None = None # User alias/handle + email: str | None = None # User email address + id: str # User ID + metadata: dict[str, object] | None = None # User metadata + name: str | None = None # User display name + org: str | None = None # Organization + sandbox: str | None = None # Sandbox + + +class ThreadMemberListResponseDataItem(BaseModel): + membership_type: str | None = None # Membership type (owner or member) + thread: str | None = None # Thread + user: ThreadMemberListResponseDataItemUser | None = None # User details (when loaded) + + +class ThreadMemberListResponse(BaseModel): + data: list[ThreadMemberListResponseDataItem] # The members + + +class SettingListResponse(BaseModel): + agent_enabled: bool | None = None # Whether the agent is enabled for this thread + + +class ThreadAgentsResponse(BaseModel): + data: list[dict[str, object]] # The agents + + +class ThreadArtifactsResponseDataItemImageSource(BaseModel): + file: str | None = None # Storage file + height: int | None = None # Image height in pixels + media: str | None = None # Media + mime_type: str | None = None # Image MIME type + refresh_url: str | None = None # URL to refresh signed URL + url: str | None = None # Image URL + width: int | None = None # Image width in pixels + + +class ThreadArtifactsResponseDataItem(BaseModel): + agent: str | None = None # Agent + content_type: str | None = None # MIME content type + created_at: datetime | None = None # Creation timestamp + current_version: str | None = None # Current version ID + description: str | None = None # Artifact description + file: str | None = None # Storage file + file_name: str | None = None # Original filename + file_url: str | None = None # Signed file URL + id: str # Artifact ID + image_source: ThreadArtifactsResponseDataItemImageSource | None = None + name: str | None = None # Artifact name + org: str | None = None # Organization + sandbox: str | None = None # Sandbox identifier + team: str | None = None # Team + thread: str | None = None # Thread + updated_at: datetime | None = None # Last update timestamp + user: str | None = None # User + version: int | None = None # Current version number + + +class ThreadArtifactsResponse(BaseModel): + data: list[ThreadArtifactsResponseDataItem] # The artifacts + + +class ThreadMessagesResponseDataMessagesItemActorsItemProfilePicture(BaseModel): + file: str | None = None # Storage file + height: int | None = None # Image height in pixels + media: str | None = None # Media + mime_type: str | None = None # Image MIME type + refresh_url: str | None = None # URL to refresh signed URL + url: str | None = None # Image URL + width: int | None = None # Image width in pixels + + +class ThreadMessagesResponseDataMessagesItemActorsItem(BaseModel): + alias: str | None = None # Actor alias/handle + id: str | None = None # Actor ID (format: user-xxx or agent-xxx) + name: str | None = None # Actor display name + profile_picture: ThreadMessagesResponseDataMessagesItemActorsItemProfilePicture | None = None + + +class ThreadMessagesResponseDataMessagesItemAttachmentsItemImageSource(BaseModel): + file: str | None = None # Storage file + height: int | None = None # Image height in pixels + media: str | None = None # Media + mime_type: str | None = None # Image MIME type + refresh_url: str | None = None # URL to refresh signed URL + url: str | None = None # Image URL + width: int | None = None # Image width in pixels + + +class ThreadMessagesResponseDataMessagesItemAttachmentsItemVariantsItemImageSource(BaseModel): + file: str | None = None # Storage file + height: int | None = None # Image height in pixels + media: str | None = None # Media + mime_type: str | None = None # Image MIME type + refresh_url: str | None = None # URL to refresh signed URL + url: str | None = None # Image URL + width: int | None = None # Image width in pixels + + +class ThreadMessagesResponseDataMessagesItemAttachmentsItemVariantsItem(BaseModel): + content_type: str | None = None # File content type + created_at: datetime | None = None # Creation timestamp + file: str | None = None # Storage file + filename: str | None = None # Original filename + height: int | None = None # Height in pixels + id: str # Variant ID + image_source: ( + ThreadMessagesResponseDataMessagesItemAttachmentsItemVariantsItemImageSource | None + ) = None + updated_at: datetime | None = None # Last update timestamp + url: str | None = None # Signed download URL + variant_key: str | None = None # Variant key (original, thumbnail, etc) + width: int | None = None # Width in pixels + + +class ThreadMessagesResponseDataMessagesItemAttachmentsItem(BaseModel): + content_type: str | None = None # MIME content type (file, artifact, media types) + description: str | None = None # Description (scraped_link, artifact, task types) + filename: str | None = None # File name (file, artifact, media types) + height: int | None = None # Media height (media type) + id: str # Attachment ID + image_height: int | None = None # Preview image height (scraped_link type) + image_source: ThreadMessagesResponseDataMessagesItemAttachmentsItemImageSource | None = None + image_url: str | None = None # Preview image URL (scraped_link type) + image_width: int | None = None # Preview image width (scraped_link type) + media_type: str | None = None # Media type (media type) + name: str | None = None # Media name (media type) + object: dict[str, object] | None = None # Embedded object (task, action types) + title: str | None = None # Title (scraped_link, artifact, task types) + type: str # Attachment type: file, scraped_link, artifact, task, media, action + url: str | None = None # URL to the resource (file, scraped_link, artifact, media types) + variants: list[ThreadMessagesResponseDataMessagesItemAttachmentsItemVariantsItem] | None = None + version: int | None = None # Artifact version number (artifact type) + width: int | None = None # Media width (media type) + + +class ThreadMessagesResponseDataMessagesItemReactionsItem(BaseModel): + payload: dict[str, object] | None = None # Reaction payload (e.g., {emoji: 'πŸ‘'}) + type: str # Reaction type (e.g., emoji_reaction) + user: str | None = None # User who added the reaction + + +class ThreadMessagesResponseDataMessagesItem(BaseModel): + actors: list[ThreadMessagesResponseDataMessagesItemActorsItem] | None = None + agent: str | None = None # Agent if sent by an agent user + attachments: list[ThreadMessagesResponseDataMessagesItemAttachmentsItem] | None = None + branched_thread: str | None = None # Branched thread (if message spawned a thread) + content: str | None = None # Message content + created_at: datetime | None = None # Creation timestamp + has_replies: bool | None = None # Whether message has replies + id: str # Message ID (msg_...) + idempotency_key: str | None = None # Client-provided idempotency key + legacy_agent: str | None = None # Legacy agent if sent by legacy chat agent + metadata: dict[str, object] | None = None # Message metadata + org: str | None = None # Organization + reactions: list[ThreadMessagesResponseDataMessagesItemReactionsItem] | None = None + rendering_mode: str | None = None # Rendering mode hint + replies: list[dict[str, object]] | None = None # Inline replies (if loaded) + replies_after_cursor: str | None = None # Cursor for replies pagination + replies_before_cursor: str | None = None # Cursor for replies pagination + reply_count: int | None = None # Number of replies + reply_to: dict[str, object] | None = None # Parent message object (if loaded) + sandbox: str | None = None # Sandbox identifier + team: str | None = None # Team + thread: str | None = None # Parent thread + user: str | None = None # Author user (public ID or expanded object when loaded) + + +class ThreadMessagesResponseData(BaseModel): + after_cursor: str | None = None # Cursor for fetching items after this point + before_cursor: str | None = None # Cursor for fetching items before this point + messages: list[ThreadMessagesResponseDataMessagesItem] # List of message objects + + +class ThreadMessagesResponse(BaseModel): + data: ThreadMessagesResponseData # Message data wrapper + + +class ThreadSearchResponse(BaseModel): + data: list[dict[str, object]] # Matching context items (tagged objects) + + class ThreadMemberResource: def __init__(self, http: HttpClient): self._http = http @@ -15,10 +243,10 @@ def __init__(self, http: HttpClient): async def remove(self, thread: str) -> None: await self._http.request(f"/api/v1/threads/{thread}/members", method="DELETE") - async def list(self, thread: str) -> dict[str, object]: + async def list(self, thread: str) -> ThreadMemberListResponse: return await self._http.request(f"/api/v1/threads/{thread}/members") - async def create(self, thread: str, input: dict) -> ThreadMember: + async def create(self, thread: str, input: ThreadMemberCreateInput) -> ThreadMember: return await self._http.request( f"/api/v1/threads/{thread}/members", method="POST", @@ -30,10 +258,10 @@ class SettingResource: def __init__(self, http: HttpClient): self._http = http - async def list(self, thread: str) -> dict[str, object]: + async def list(self, thread: str) -> SettingListResponse: return await self._http.request(f"/api/v1/threads/{thread}/settings") - async def replace(self, thread: str, input: dict) -> ThreadSettings: + async def replace(self, thread: str, input: SettingReplaceInput) -> ThreadSettings: return await self._http.request( f"/api/v1/threads/{thread}/settings", method="PUT", @@ -53,30 +281,54 @@ async def delete(self, thread: str) -> None: async def get(self, thread: str) -> Thread: return await self._http.request(f"/api/v1/threads/{thread}") - async def replace(self, thread: str, input: dict) -> Thread: + async def replace(self, thread: str, input: ThreadReplaceInput) -> Thread: return await self._http.request(f"/api/v1/threads/{thread}", method="PUT", body=input) - async def agents(self, thread: str) -> dict[str, object]: + async def agents(self, thread: str) -> ThreadAgentsResponse: return await self._http.request(f"/api/v1/threads/{thread}/agents") - async def artifacts(self, thread: str) -> dict[str, object]: + async def artifacts(self, thread: str) -> ThreadArtifactsResponse: return await self._http.request(f"/api/v1/threads/{thread}/artifacts") - async def mark_read(self, thread: str, input: dict) -> None: + async def mark_read(self, thread: str, input: ThreadMarkReadInput) -> None: await self._http.request(f"/api/v1/threads/{thread}/mark_read", method="POST", body=input) - async def messages(self, thread: str, **params) -> dict[str, object]: - return await self._http.request(f"/api/v1/threads/{thread}/messages", query=params) + async def messages( + self, + thread: str, + *, + before_cursor: str | None = None, + after_cursor: str | None = None, + limit: int | None = None, + include_reply_counts: bool | None = None, + ) -> ThreadMessagesResponse: + query: dict[str, object] = {} + if before_cursor is not None: + query["beforeCursor"] = before_cursor + if after_cursor is not None: + query["afterCursor"] = after_cursor + if limit is not None: + query["limit"] = limit + if include_reply_counts is not None: + query["includeReplyCounts"] = include_reply_counts + return await self._http.request(f"/api/v1/threads/{thread}/messages", query=query) - async def picture(self, thread: str, input: dict) -> Thread: + async def picture(self, thread: str, input: ThreadPictureInput) -> Thread: return await self._http.request( f"/api/v1/threads/{thread}/picture", method="PUT", body=input, ) - async def read_status(self, thread: str, **params) -> ThreadReadStatus: - return await self._http.request(f"/api/v1/threads/{thread}/read_status", query=params) + async def read_status(self, thread: str, *, user: str | None = None) -> ThreadReadStatus: + query: dict[str, object] = {} + if user is not None: + query["user"] = user + return await self._http.request(f"/api/v1/threads/{thread}/read_status", query=query) - async def search(self, thread: str, **params) -> dict[str, object]: - return await self._http.request(f"/api/v1/threads/{thread}/search", query=params) + async def search(self, thread: str, q: str, *, type: str | None = None) -> ThreadSearchResponse: + query: dict[str, object] = {} + query["q"] = q + if type is not None: + query["type"] = type + return await self._http.request(f"/api/v1/threads/{thread}/search", query=query) diff --git a/src/archastro/platform/v1/resources/users.py b/src/archastro/platform/v1/resources/users.py index 1703be7..94d855b 100644 --- a/src/archastro/platform/v1/resources/users.py +++ b/src/archastro/platform/v1/resources/users.py @@ -1,23 +1,349 @@ # Copyright (c) 2026 ArchAstro Inc. All Rights Reserved. # This file is auto-generated by @archastro/sdk-generator. Do not edit. -# Content hash: 523e3fab9259 +# Content hash: c77ff24d1eba from __future__ import annotations +from datetime import datetime +from typing import Required, TypedDict + +from pydantic import BaseModel + from ...runtime.http_client import HttpClient from ...types.artifacts import Artifact from ...types.threads import Thread from ...types.users import User, UserInvite +class UserArtifactCreateInput(TypedDict): + artifact: dict[str, object] # Artifact attributes + + +class UserThreadCreateInputThreadProfilePicture(TypedDict, total=False): + data: str | None # Base64 encoded image data + filename: str | None # Original filename + mime_type: str | None # MIME type of the image + + +class UserThreadCreateInputThreadSettings(TypedDict, total=False): + agent_enabled: bool | None # Whether the agent is enabled for this thread + + +class UserThreadCreateInputThread(TypedDict, total=False): + create_legacy_agent: bool | None # Create a legacy chat agent for this thread + description: str | None # Thread description + is_unlisted: bool | None # Whether the thread is unlisted + key: str | None # Unique key for the thread + metadata: dict[str, object] | None # Additional metadata + org_id: str | None # Organization ID + profile_picture: UserThreadCreateInputThreadProfilePicture | None + settings: UserThreadCreateInputThreadSettings | None # Thread settings + title: str | None # Thread title + + +class UserThreadCreateInput(TypedDict, total=False): + skip_welcome_message: bool | None # Skip automatic welcome message + thread: Required[UserThreadCreateInputThread] # Thread attributes + + +class UserInvitesInputInvite(TypedDict, total=False): + metadata: dict[str, object] | None # Arbitrary JSON metadata attached to the invite + persona_id: str | None # Optional persona to bind the invite to + thread_id: str | None # Optional thread to bind the invite to (thr_...) + + +class UserInvitesInput(TypedDict): + invite: UserInvitesInputInvite # Invite parameters + + +class UserProfileInputProfilePicture(TypedDict, total=False): + data: str | None # Base64 encoded image data + filename: str | None # Original filename + mime_type: str | None # MIME type of the image + + +class UserProfileInput(TypedDict, total=False): + alias: str | None # Display alias + full_name: str | None # Full name + metadata: dict[str, object] | None # User metadata + profile_picture: UserProfileInputProfilePicture | None # Base64 encoded profile picture + + +class UserArtifactListResponseDataItemImageSource(BaseModel): + file: str | None = None # Storage file + height: int | None = None # Image height in pixels + media: str | None = None # Media + mime_type: str | None = None # Image MIME type + refresh_url: str | None = None # URL to refresh signed URL + url: str | None = None # Image URL + width: int | None = None # Image width in pixels + + +class UserArtifactListResponseDataItem(BaseModel): + agent: str | None = None # Agent + content_type: str | None = None # MIME content type + created_at: datetime | None = None # Creation timestamp + current_version: str | None = None # Current version ID + description: str | None = None # Artifact description + file: str | None = None # Storage file + file_name: str | None = None # Original filename + file_url: str | None = None # Signed file URL + id: str # Artifact ID + image_source: UserArtifactListResponseDataItemImageSource | None = None + name: str | None = None # Artifact name + org: str | None = None # Organization + sandbox: str | None = None # Sandbox identifier + team: str | None = None # Team + thread: str | None = None # Thread + updated_at: datetime | None = None # Last update timestamp + user: str | None = None # User + version: int | None = None # Current version number + + +class UserArtifactListResponse(BaseModel): + data: list[UserArtifactListResponseDataItem] # The artifacts + + +class UserThreadListResponseDataItemCreator(BaseModel): + alias: str | None = None # User alias/handle + email: str | None = None # User email address + id: str # User ID + metadata: dict[str, object] | None = None # User metadata + name: str | None = None # User display name + org: str | None = None # Organization + sandbox: str | None = None # Sandbox + + +class UserThreadListResponseDataItemParentMessageActorsItemProfilePicture(BaseModel): + file: str | None = None # Storage file + height: int | None = None # Image height in pixels + media: str | None = None # Media + mime_type: str | None = None # Image MIME type + refresh_url: str | None = None # URL to refresh signed URL + url: str | None = None # Image URL + width: int | None = None # Image width in pixels + + +class UserThreadListResponseDataItemParentMessageActorsItem(BaseModel): + alias: str | None = None # Actor alias/handle + id: str | None = None # Actor ID (format: user-xxx or agent-xxx) + name: str | None = None # Actor display name + profile_picture: UserThreadListResponseDataItemParentMessageActorsItemProfilePicture | None = ( + None + ) + + +class UserThreadListResponseDataItemParentMessageAttachmentsItemImageSource(BaseModel): + file: str | None = None # Storage file + height: int | None = None # Image height in pixels + media: str | None = None # Media + mime_type: str | None = None # Image MIME type + refresh_url: str | None = None # URL to refresh signed URL + url: str | None = None # Image URL + width: int | None = None # Image width in pixels + + +class UserThreadListResponseDataItemParentMessageAttachmentsItemVariantsItemImageSource(BaseModel): + file: str | None = None # Storage file + height: int | None = None # Image height in pixels + media: str | None = None # Media + mime_type: str | None = None # Image MIME type + refresh_url: str | None = None # URL to refresh signed URL + url: str | None = None # Image URL + width: int | None = None # Image width in pixels + + +class UserThreadListResponseDataItemParentMessageAttachmentsItemVariantsItem(BaseModel): + content_type: str | None = None # File content type + created_at: datetime | None = None # Creation timestamp + file: str | None = None # Storage file + filename: str | None = None # Original filename + height: int | None = None # Height in pixels + id: str # Variant ID + image_source: ( + UserThreadListResponseDataItemParentMessageAttachmentsItemVariantsItemImageSource | None + ) = None + updated_at: datetime | None = None # Last update timestamp + url: str | None = None # Signed download URL + variant_key: str | None = None # Variant key (original, thumbnail, etc) + width: int | None = None # Width in pixels + + +class UserThreadListResponseDataItemParentMessageAttachmentsItem(BaseModel): + content_type: str | None = None # MIME content type (file, artifact, media types) + description: str | None = None # Description (scraped_link, artifact, task types) + filename: str | None = None # File name (file, artifact, media types) + height: int | None = None # Media height (media type) + id: str # Attachment ID + image_height: int | None = None # Preview image height (scraped_link type) + image_source: UserThreadListResponseDataItemParentMessageAttachmentsItemImageSource | None = ( + None + ) + image_url: str | None = None # Preview image URL (scraped_link type) + image_width: int | None = None # Preview image width (scraped_link type) + media_type: str | None = None # Media type (media type) + name: str | None = None # Media name (media type) + object: dict[str, object] | None = None # Embedded object (task, action types) + title: str | None = None # Title (scraped_link, artifact, task types) + type: str # Attachment type: file, scraped_link, artifact, task, media, action + url: str | None = None # URL to the resource (file, scraped_link, artifact, media types) + variants: ( + list[UserThreadListResponseDataItemParentMessageAttachmentsItemVariantsItem] | None + ) = None + version: int | None = None # Artifact version number (artifact type) + width: int | None = None # Media width (media type) + + +class UserThreadListResponseDataItemParentMessageReactionsItem(BaseModel): + payload: dict[str, object] | None = None # Reaction payload (e.g., {emoji: 'πŸ‘'}) + type: str # Reaction type (e.g., emoji_reaction) + user: str | None = None # User who added the reaction + + +class UserThreadListResponseDataItemParentMessage(BaseModel): + actors: list[UserThreadListResponseDataItemParentMessageActorsItem] | None = None + agent: str | None = None # Agent if sent by an agent user + attachments: list[UserThreadListResponseDataItemParentMessageAttachmentsItem] | None = None + branched_thread: str | None = None # Branched thread (if message spawned a thread) + content: str | None = None # Message content + created_at: datetime | None = None # Creation timestamp + has_replies: bool | None = None # Whether message has replies + id: str # Message ID (msg_...) + idempotency_key: str | None = None # Client-provided idempotency key + legacy_agent: str | None = None # Legacy agent if sent by legacy chat agent + metadata: dict[str, object] | None = None # Message metadata + org: str | None = None # Organization + reactions: list[UserThreadListResponseDataItemParentMessageReactionsItem] | None = None + rendering_mode: str | None = None # Rendering mode hint + replies: list[dict[str, object]] | None = None # Inline replies (if loaded) + replies_after_cursor: str | None = None # Cursor for replies pagination + replies_before_cursor: str | None = None # Cursor for replies pagination + reply_count: int | None = None # Number of replies + reply_to: dict[str, object] | None = None # Parent message object (if loaded) + sandbox: str | None = None # Sandbox identifier + team: str | None = None # Team + thread: str | None = None # Parent thread + user: str | None = None # Author user (public ID or expanded object when loaded) + + +class UserThreadListResponseDataItemParticipantsItem(BaseModel): + alias: str | None = None # User alias/handle + email: str | None = None # User email address + id: str # User ID + metadata: dict[str, object] | None = None # User metadata + name: str | None = None # User display name + org: str | None = None # Organization + sandbox: str | None = None # Sandbox + + +class UserThreadListResponseDataItemParticipatingAgentsItemAclAddItem(BaseModel): + actions: list[str] # List of allowed actions (e.g. read, write) + principal: str | None = None + principal_type: str # Principal type: user, team, org, org_role, agent, or everyone + + +class UserThreadListResponseDataItemParticipatingAgentsItemAclGrantsItem(BaseModel): + actions: list[str] # List of allowed actions (e.g. read, write) + principal: str | None = None + principal_type: str # Principal type: user, team, org, org_role, agent, or everyone + + +class UserThreadListResponseDataItemParticipatingAgentsItemAclRemoveItem(BaseModel): + principal: str | None = None # Principal identifier to remove (omit for everyone) + principal_type: str # Principal type to remove + + +class UserThreadListResponseDataItemParticipatingAgentsItemAcl(BaseModel): + add: list[UserThreadListResponseDataItemParticipatingAgentsItemAclAddItem] | None = None + grants: list[UserThreadListResponseDataItemParticipatingAgentsItemAclGrantsItem] | None = None + remove: list[UserThreadListResponseDataItemParticipatingAgentsItemAclRemoveItem] | None = None + + +class UserThreadListResponseDataItemParticipatingAgentsItem(BaseModel): + acl: UserThreadListResponseDataItemParticipatingAgentsItemAcl | None = None + app: str | None = None # Application + created_at: datetime | None = None # Creation timestamp + default_model: str | None = None # Default AI model + email: str | None = None # Agent email + id: str # Agent ID (agi_...) + identity: str | None = None # Identity prompt + lookup_key: str | None = None # Unique lookup key + metadata: dict[str, object] | None = None # Arbitrary metadata + name: str | None = None # Agent name + org: str | None = None # Organization + phone_number: str | None = None # Agent phone number + sandbox: str | None = None # Sandbox + team: str | None = None # Owning team + updated_at: datetime | None = None # Last update timestamp + user: str | None = None # Owning user + + +class UserThreadListResponseDataItemSettings(BaseModel): + agent_enabled: bool | None = None # Whether the agent is enabled for this thread + + +class UserThreadListResponseDataItem(BaseModel): + agent_user: str | None = None # Owning agent user + created_at: datetime | None = None # Creation timestamp + creator: UserThreadListResponseDataItemCreator | None = None # Creator user object + description: str | None = None # Thread description + id: str # Thread ID (thr_...) + is_channel: bool | None = None # Whether this is a channel + is_default: bool | None = None # Whether this is the default thread + is_transient: bool | None = None # Whether this thread is transient + is_unlisted: bool | None = None # Whether this thread is unlisted + key: str | None = None # Thread key + last_activity: datetime | None = None # Last activity timestamp + metadata: dict[str, object] | None = None # Thread metadata + org: str | None = None # Organization + parent_message: UserThreadListResponseDataItemParentMessage | None = None + participant: list[str] | None = None # Participant users + participants: list[UserThreadListResponseDataItemParticipantsItem] | None = None + participating_actor: list[str] | None = None # Actors participating in thread + participating_agents: list[UserThreadListResponseDataItemParticipatingAgentsItem] | None = None + role: str | None = None # User's role in the thread + sandbox: str | None = None # Sandbox identifier + settings: UserThreadListResponseDataItemSettings | None = None # Thread settings + slug: str | None = None # Thread slug + sub_threads: list[dict[str, object]] | None = None # Sub-threads + team: str | None = None # Owning team + title: str | None = None # Thread title + ttl: int | None = None # Time-to-live in seconds + unread_count: int | None = None # Unread message count + updated_at: datetime | None = None # Last update timestamp + user: str | None = None # Owning user + + +class UserThreadListResponse(BaseModel): + data: list[UserThreadListResponseDataItem] # The threads + + +class UserOrgsResponseDataItem(BaseModel): + created_at: datetime | None = None # Creation timestamp + description: str | None = None # Description + domain: str | None = None # Domain + id: str # Organization ID (org_...) + industry: str | None = None # Industry + name: str | None = None # Organization name + sandbox: str | None = None # Sandbox + slug: str | None = None # URL slug + status: str | None = None # Status + updated_at: datetime | None = None # Last update timestamp + website: str | None = None # Website URL + + +class UserOrgsResponse(BaseModel): + data: list[UserOrgsResponseDataItem] # Organization list + + class UserArtifactResource: def __init__(self, http: HttpClient): self._http = http - async def list(self, user: str) -> dict[str, object]: + async def list(self, user: str) -> UserArtifactListResponse: return await self._http.request(f"/api/v1/users/{user}/artifacts") - async def create(self, user: str, input: dict) -> Artifact: + async def create(self, user: str, input: UserArtifactCreateInput) -> Artifact: return await self._http.request( f"/api/v1/users/{user}/artifacts", method="POST", @@ -29,10 +355,21 @@ class UserThreadResource: def __init__(self, http: HttpClient): self._http = http - async def list(self, user: str, **params) -> dict[str, object]: - return await self._http.request(f"/api/v1/users/{user}/threads", query=params) + async def list( + self, + user: str, + *, + agent: list[str] | None = None, + filter: list[dict[str, object]] | None = None, + ) -> UserThreadListResponse: + query: dict[str, object] = {} + if agent is not None: + query["agent"] = agent + if filter is not None: + query["filter"] = filter + return await self._http.request(f"/api/v1/users/{user}/threads", query=query) - async def create(self, user: str, input: dict) -> Thread: + async def create(self, user: str, input: UserThreadCreateInput) -> Thread: return await self._http.request(f"/api/v1/users/{user}/threads", method="POST", body=input) @@ -48,11 +385,11 @@ async def me(self) -> User: async def get(self, user: str) -> User: return await self._http.request(f"/api/v1/users/{user}") - async def invites(self, user: str, input: dict) -> UserInvite: + async def invites(self, user: str, input: UserInvitesInput) -> UserInvite: return await self._http.request(f"/api/v1/users/{user}/invites", method="POST", body=input) - async def orgs(self, user: str) -> dict[str, object]: + async def orgs(self, user: str) -> UserOrgsResponse: return await self._http.request(f"/api/v1/users/{user}/orgs") - async def profile(self, user: str, input: dict) -> User: + async def profile(self, user: str, input: UserProfileInput) -> User: return await self._http.request(f"/api/v1/users/{user}/profile", method="PUT", body=input)