@astralform/js 9.3.0 → 9.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -258,7 +258,7 @@ declare const ChatEventType: {
258
258
  type ChatEventTypeValue = (typeof ChatEventType)[keyof typeof ChatEventType];
259
259
  type WireBlockKind = "text" | "thinking" | "tool_use";
260
260
  type WireBlockStatus = "streaming" | "awaiting_client_result" | "ok" | "error" | "denied" | "cancelled";
261
- type WireStopReason = "end_turn" | "tool_use" | "max_tokens" | "context_overflow" | "error";
261
+ type WireStopReason = "end_turn" | "tool_use" | "max_tokens" | "context_overflow" | "incomplete" | "error";
262
262
  interface WireTextDelta {
263
263
  channel: "text";
264
264
  text: string;
@@ -644,6 +644,17 @@ interface Conversation {
644
644
  * null) from an Astralform older than 0.69.46.
645
645
  */
646
646
  repository?: string | null;
647
+ /**
648
+ * The code group this task is filed under, or `null`/absent when it is not in
649
+ * one. MUTABLE — unlike `repository`, which is written once on the first turn:
650
+ * a group is a label the user applies to work that already exists, so a task
651
+ * may join, move between, or leave groups at any time.
652
+ *
653
+ * Absent from an Astralform older than the one that introduced groups (phase 1
654
+ * of `docs/refactor/workspace-groups`), which is why it is optional rather
655
+ * than `string | null`.
656
+ */
657
+ groupId?: string | null;
647
658
  }
648
659
  /** One citation on a `web_search`-style tool row, as the clients parse it. */
649
660
  interface ToolSource {
@@ -959,6 +970,31 @@ interface CodeProject {
959
970
  repoFullName: string;
960
971
  addedAt: string;
961
972
  }
973
+ /**
974
+ * One group of tasks working a single feature, under one repository.
975
+ *
976
+ * Groups are the app user's own, on one agent, under one repository: two people
977
+ * using the same agent curate their own. The title is user-supplied and
978
+ * renameable, and membership is mutable — see {@link Conversation.groupId}.
979
+ */
980
+ interface ConversationGroup {
981
+ id: string;
982
+ repository: string;
983
+ title: string;
984
+ createdAt: string;
985
+ updatedAt: string;
986
+ }
987
+ /**
988
+ * A task filed under a group, as the assign call answers it.
989
+ *
990
+ * The server returns this body rather than `204`: `post` always parses a JSON
991
+ * body, so a No Content reply would surface as a parse error on a successful
992
+ * write. It is also the confirmation that the write landed.
993
+ */
994
+ interface CodeGroupMembership {
995
+ groupId: string;
996
+ conversationId: string;
997
+ }
962
998
  /** A repository the workspace's GitHub installations cover. */
963
999
  interface AvailableRepository {
964
1000
  fullName: string;
@@ -1084,7 +1120,11 @@ interface VoiceConfig {
1084
1120
  * (or compare against `"raw"`) before polishing.
1085
1121
  */
1086
1122
  defaultMode: VoicePolishMode;
1087
- /** In tap-to-talk mode, the pause that ends a recording. */
1123
+ /**
1124
+ * @deprecated Always `2`. The server no longer sends the field and no
1125
+ * shipped client implements pause detection; kept so existing code compiles,
1126
+ * slated for removal in the next major.
1127
+ */
1088
1128
  silenceAutoStopSeconds: number;
1089
1129
  /**
1090
1130
  * @deprecated Always `false`. Auto-send was removed from the platform
@@ -1790,6 +1830,57 @@ declare class AstralformClient {
1790
1830
  */
1791
1831
  remove: (owner: string, repo: string) => Promise<void>;
1792
1832
  };
1833
+ /**
1834
+ * Code groups: a user-named container under one repository, for a feature
1835
+ * whose work outlives a single session. Its sessions share one plan and one
1836
+ * set of notes, so what one writes the others read.
1837
+ *
1838
+ * A group is a LABEL, not a binding — unlike a task's project, which is
1839
+ * written once on the first turn. A task may join, move between, or leave
1840
+ * groups at any time, and a deleted group's sessions survive as ungrouped.
1841
+ *
1842
+ * The server enforces three things worth knowing before you render a
1843
+ * failure: a group that is not this user's answers `404` (never `403`, so a
1844
+ * group id cannot be probed); filing a task into a group under a DIFFERENT
1845
+ * repository than the task's answers `409`; and the group's plan and notes
1846
+ * are deleted with the group, while each session keeps its own.
1847
+ */
1848
+ groups: {
1849
+ /**
1850
+ * This user's groups, oldest first. Pass a repository to narrow to one
1851
+ * repository's — the composer's picker does; the sidebar asks once and
1852
+ * nests them itself.
1853
+ */
1854
+ list: (repository?: string) => Promise<ConversationGroup[]>;
1855
+ /**
1856
+ * Create a group under a repository. The repository goes through the same
1857
+ * normaliser the Projects surface uses, so a pasted GitHub URL is accepted
1858
+ * and anything that is not `owner/repo` is refused.
1859
+ */
1860
+ create: (repository: string, title: string) => Promise<ConversationGroup>;
1861
+ /** Rename a group. A group that is not this user's answers `404`. */
1862
+ rename: (groupId: string, title: string) => Promise<ConversationGroup>;
1863
+ /**
1864
+ * Delete a group. Its tasks survive and become ungrouped, each keeping its
1865
+ * own plan and notes; the group's SHARED documents are deleted with it.
1866
+ */
1867
+ remove: (groupId: string) => Promise<void>;
1868
+ /**
1869
+ * File a task into a group. Idempotent — filing an already-filed task
1870
+ * again is the same state, not an error. Refused with `409` when the task
1871
+ * belongs to a different repository than the group, because it would
1872
+ * render nowhere in the sidebar.
1873
+ */
1874
+ assign: (groupId: string, conversationId: string) => Promise<CodeGroupMembership>;
1875
+ /**
1876
+ * Take a task out of its group. The task and its documents are untouched.
1877
+ *
1878
+ * Deliberately not strict about WHICH group the task is in: a task that is
1879
+ * in a different one (or in none) already satisfies "this task should not
1880
+ * be grouped", so the call clears it rather than refusing.
1881
+ */
1882
+ unassign: (groupId: string, conversationId: string) => Promise<void>;
1883
+ };
1793
1884
  };
1794
1885
  createJob(request: ChatStreamRequest): Promise<JobCreateResponse>;
1795
1886
  streamJobEvents(jobId: string, afterSeq?: number, signal?: AbortSignal): AsyncGenerator<ChatStreamEvent>;
@@ -2766,4 +2857,4 @@ declare function isEmbeddedResource(value: unknown): value is {
2766
2857
  */
2767
2858
  declare function parseEmbeddedResource(value: unknown): EmbeddedResource | null;
2768
2859
 
2769
- export { type ActiveJob, type AgentCapability, type AgentIdentity, type AgentInfo, type AgentStatus, type AssetCreatedPayload, type AstralformApiKeyConfig, AstralformClient, type AstralformConfig, AstralformError, type AstralformUserTokenConfig, type AttachmentStagedPayload, AuthenticationError, type AvailableRepositories, type AvailableRepository, type BlockDeltaPayload, CONVERSATION_PAGE_SIZE, type ChatEvent, ChatEventType, type ChatEventTypeValue, ChatSession, type ChatStorage, type ChatStreamEvent, type ChatStreamRequest, type CodeProject, ConnectionError, type ContextUpdatePayload, type ContextWarningPayload, type Conversation, type ConversationAsset, type ConversationEvent, type ConversationJob, type ConversationJobAttachment, type DesktopStreamPayload, type EffortRung, type EmbeddedResource, type FeedbackRequest, type FeedbackResponse, InMemoryStorage, type JobCreateResponse, type JobStatus, type JobSummary, type JobsPage, LLMNotConfiguredError, type MemoryProviderErrorPayload, type MemoryRecallPayload, type MemoryRecord, type MemoryUpdatePayload, type Message, type MessagesPage, type ModelChoiceOptions, type ModelOption, type MyToolGrantsPage, type NestedLlmUsagePayload, type NoteUpdatePayload, type PlanUpdatePayload, type PromptSuggestionPayload, type ProtocolAdapter, ProtocolRegistry, RateLimitError, type RateLimitErrorDetails, type RawSseEvent, type ReasoningEffort, type SendOptions, ServerError, type SendOptions$1 as SessionSendOptions, type SkillInfo, type SlashCommand, type SlashCommandSurface, StreamAbortedError, type StreamJobSSEOptions, StreamManager, type StreamManagerEvent, type StreamState, type SubagentStartPayload, type SubagentStopPayload, type TaskStatus, type TeamAgentSummary, type TeamSummary, type ThinkingDescriptor, type ThinkingRungOption, type TitleGeneratedPayload, type TodoItem, type TodoUpdatePayload, type ToolApprovalDecision, type ToolApprovalGrantedPayload, type ToolApprovalRequest, type ToolApprovalRequestedPayload, type ToolApprovalScope, type ToolCallRequest, type ToolDefinition, type ToolGrant, type ToolHandler, type ToolHarnessWarningPayload, type ToolImageMode, type ToolImageStub, type ToolOutputMode, type ToolOutputStub, type ToolProgressPayload, ToolRegistry, type ToolResult, type ToolResultRequest, type ToolSource, type TurnUsage, type UIComponentsConfig, type UserUnavailablePayload, VOICE_POLISH_MODES, type VoiceConfig, type VoiceLLMMode, type VoicePolishEvent, type VoicePolishMode, type VoicePolishRequest, type VoiceTranscribeOptions, type VoiceTranscript, type WireBlockDelta, type WireBlockDeltaPayload, type WireBlockKind, type WireBlockStart, type WireBlockStatus, type WireBlockStop, type WireCustomEvent, type WireErrorEvent, type WireEvent, type WireInputArgDelta, type WireInputDelta, type WireKeepalive, type WireMessageStart, type WireMessageStop, type WireOutputDelta, type WireRetryEvent, type WireSignatureDelta, type WireStallWarning, type WireStatusDelta, type WireStopReason, type WireTextDelta, type WireThinkingDelta, type WorkspaceReadyPayload, generateId, isEmbeddedResource, isToolImageStub, isToolOutputStub, isVoiceLLMMode, isVoicePolishMode, mapSseToChat, parseEmbeddedResource, parseVoicePolishFrame, replayEvents, streamJobSSE, translateDelta };
2860
+ export { type ActiveJob, type AgentCapability, type AgentIdentity, type AgentInfo, type AgentStatus, type AssetCreatedPayload, type AstralformApiKeyConfig, AstralformClient, type AstralformConfig, AstralformError, type AstralformUserTokenConfig, type AttachmentStagedPayload, AuthenticationError, type AvailableRepositories, type AvailableRepository, type BlockDeltaPayload, CONVERSATION_PAGE_SIZE, type ChatEvent, ChatEventType, type ChatEventTypeValue, ChatSession, type ChatStorage, type ChatStreamEvent, type ChatStreamRequest, type CodeGroupMembership, type CodeProject, ConnectionError, type ContextUpdatePayload, type ContextWarningPayload, type Conversation, type ConversationAsset, type ConversationEvent, type ConversationGroup, type ConversationJob, type ConversationJobAttachment, type DesktopStreamPayload, type EffortRung, type EmbeddedResource, type FeedbackRequest, type FeedbackResponse, InMemoryStorage, type JobCreateResponse, type JobStatus, type JobSummary, type JobsPage, LLMNotConfiguredError, type MemoryProviderErrorPayload, type MemoryRecallPayload, type MemoryRecord, type MemoryUpdatePayload, type Message, type MessagesPage, type ModelChoiceOptions, type ModelOption, type MyToolGrantsPage, type NestedLlmUsagePayload, type NoteUpdatePayload, type PlanUpdatePayload, type PromptSuggestionPayload, type ProtocolAdapter, ProtocolRegistry, RateLimitError, type RateLimitErrorDetails, type RawSseEvent, type ReasoningEffort, type SendOptions, ServerError, type SendOptions$1 as SessionSendOptions, type SkillInfo, type SlashCommand, type SlashCommandSurface, StreamAbortedError, type StreamJobSSEOptions, StreamManager, type StreamManagerEvent, type StreamState, type SubagentStartPayload, type SubagentStopPayload, type TaskStatus, type TeamAgentSummary, type TeamSummary, type ThinkingDescriptor, type ThinkingRungOption, type TitleGeneratedPayload, type TodoItem, type TodoUpdatePayload, type ToolApprovalDecision, type ToolApprovalGrantedPayload, type ToolApprovalRequest, type ToolApprovalRequestedPayload, type ToolApprovalScope, type ToolCallRequest, type ToolDefinition, type ToolGrant, type ToolHandler, type ToolHarnessWarningPayload, type ToolImageMode, type ToolImageStub, type ToolOutputMode, type ToolOutputStub, type ToolProgressPayload, ToolRegistry, type ToolResult, type ToolResultRequest, type ToolSource, type TurnUsage, type UIComponentsConfig, type UserUnavailablePayload, VOICE_POLISH_MODES, type VoiceConfig, type VoiceLLMMode, type VoicePolishEvent, type VoicePolishMode, type VoicePolishRequest, type VoiceTranscribeOptions, type VoiceTranscript, type WireBlockDelta, type WireBlockDeltaPayload, type WireBlockKind, type WireBlockStart, type WireBlockStatus, type WireBlockStop, type WireCustomEvent, type WireErrorEvent, type WireEvent, type WireInputArgDelta, type WireInputDelta, type WireKeepalive, type WireMessageStart, type WireMessageStop, type WireOutputDelta, type WireRetryEvent, type WireSignatureDelta, type WireStallWarning, type WireStatusDelta, type WireStopReason, type WireTextDelta, type WireThinkingDelta, type WorkspaceReadyPayload, generateId, isEmbeddedResource, isToolImageStub, isToolOutputStub, isVoiceLLMMode, isVoicePolishMode, mapSseToChat, parseEmbeddedResource, parseVoicePolishFrame, replayEvents, streamJobSSE, translateDelta };
package/dist/index.d.ts CHANGED
@@ -258,7 +258,7 @@ declare const ChatEventType: {
258
258
  type ChatEventTypeValue = (typeof ChatEventType)[keyof typeof ChatEventType];
259
259
  type WireBlockKind = "text" | "thinking" | "tool_use";
260
260
  type WireBlockStatus = "streaming" | "awaiting_client_result" | "ok" | "error" | "denied" | "cancelled";
261
- type WireStopReason = "end_turn" | "tool_use" | "max_tokens" | "context_overflow" | "error";
261
+ type WireStopReason = "end_turn" | "tool_use" | "max_tokens" | "context_overflow" | "incomplete" | "error";
262
262
  interface WireTextDelta {
263
263
  channel: "text";
264
264
  text: string;
@@ -644,6 +644,17 @@ interface Conversation {
644
644
  * null) from an Astralform older than 0.69.46.
645
645
  */
646
646
  repository?: string | null;
647
+ /**
648
+ * The code group this task is filed under, or `null`/absent when it is not in
649
+ * one. MUTABLE — unlike `repository`, which is written once on the first turn:
650
+ * a group is a label the user applies to work that already exists, so a task
651
+ * may join, move between, or leave groups at any time.
652
+ *
653
+ * Absent from an Astralform older than the one that introduced groups (phase 1
654
+ * of `docs/refactor/workspace-groups`), which is why it is optional rather
655
+ * than `string | null`.
656
+ */
657
+ groupId?: string | null;
647
658
  }
648
659
  /** One citation on a `web_search`-style tool row, as the clients parse it. */
649
660
  interface ToolSource {
@@ -959,6 +970,31 @@ interface CodeProject {
959
970
  repoFullName: string;
960
971
  addedAt: string;
961
972
  }
973
+ /**
974
+ * One group of tasks working a single feature, under one repository.
975
+ *
976
+ * Groups are the app user's own, on one agent, under one repository: two people
977
+ * using the same agent curate their own. The title is user-supplied and
978
+ * renameable, and membership is mutable — see {@link Conversation.groupId}.
979
+ */
980
+ interface ConversationGroup {
981
+ id: string;
982
+ repository: string;
983
+ title: string;
984
+ createdAt: string;
985
+ updatedAt: string;
986
+ }
987
+ /**
988
+ * A task filed under a group, as the assign call answers it.
989
+ *
990
+ * The server returns this body rather than `204`: `post` always parses a JSON
991
+ * body, so a No Content reply would surface as a parse error on a successful
992
+ * write. It is also the confirmation that the write landed.
993
+ */
994
+ interface CodeGroupMembership {
995
+ groupId: string;
996
+ conversationId: string;
997
+ }
962
998
  /** A repository the workspace's GitHub installations cover. */
963
999
  interface AvailableRepository {
964
1000
  fullName: string;
@@ -1084,7 +1120,11 @@ interface VoiceConfig {
1084
1120
  * (or compare against `"raw"`) before polishing.
1085
1121
  */
1086
1122
  defaultMode: VoicePolishMode;
1087
- /** In tap-to-talk mode, the pause that ends a recording. */
1123
+ /**
1124
+ * @deprecated Always `2`. The server no longer sends the field and no
1125
+ * shipped client implements pause detection; kept so existing code compiles,
1126
+ * slated for removal in the next major.
1127
+ */
1088
1128
  silenceAutoStopSeconds: number;
1089
1129
  /**
1090
1130
  * @deprecated Always `false`. Auto-send was removed from the platform
@@ -1790,6 +1830,57 @@ declare class AstralformClient {
1790
1830
  */
1791
1831
  remove: (owner: string, repo: string) => Promise<void>;
1792
1832
  };
1833
+ /**
1834
+ * Code groups: a user-named container under one repository, for a feature
1835
+ * whose work outlives a single session. Its sessions share one plan and one
1836
+ * set of notes, so what one writes the others read.
1837
+ *
1838
+ * A group is a LABEL, not a binding — unlike a task's project, which is
1839
+ * written once on the first turn. A task may join, move between, or leave
1840
+ * groups at any time, and a deleted group's sessions survive as ungrouped.
1841
+ *
1842
+ * The server enforces three things worth knowing before you render a
1843
+ * failure: a group that is not this user's answers `404` (never `403`, so a
1844
+ * group id cannot be probed); filing a task into a group under a DIFFERENT
1845
+ * repository than the task's answers `409`; and the group's plan and notes
1846
+ * are deleted with the group, while each session keeps its own.
1847
+ */
1848
+ groups: {
1849
+ /**
1850
+ * This user's groups, oldest first. Pass a repository to narrow to one
1851
+ * repository's — the composer's picker does; the sidebar asks once and
1852
+ * nests them itself.
1853
+ */
1854
+ list: (repository?: string) => Promise<ConversationGroup[]>;
1855
+ /**
1856
+ * Create a group under a repository. The repository goes through the same
1857
+ * normaliser the Projects surface uses, so a pasted GitHub URL is accepted
1858
+ * and anything that is not `owner/repo` is refused.
1859
+ */
1860
+ create: (repository: string, title: string) => Promise<ConversationGroup>;
1861
+ /** Rename a group. A group that is not this user's answers `404`. */
1862
+ rename: (groupId: string, title: string) => Promise<ConversationGroup>;
1863
+ /**
1864
+ * Delete a group. Its tasks survive and become ungrouped, each keeping its
1865
+ * own plan and notes; the group's SHARED documents are deleted with it.
1866
+ */
1867
+ remove: (groupId: string) => Promise<void>;
1868
+ /**
1869
+ * File a task into a group. Idempotent — filing an already-filed task
1870
+ * again is the same state, not an error. Refused with `409` when the task
1871
+ * belongs to a different repository than the group, because it would
1872
+ * render nowhere in the sidebar.
1873
+ */
1874
+ assign: (groupId: string, conversationId: string) => Promise<CodeGroupMembership>;
1875
+ /**
1876
+ * Take a task out of its group. The task and its documents are untouched.
1877
+ *
1878
+ * Deliberately not strict about WHICH group the task is in: a task that is
1879
+ * in a different one (or in none) already satisfies "this task should not
1880
+ * be grouped", so the call clears it rather than refusing.
1881
+ */
1882
+ unassign: (groupId: string, conversationId: string) => Promise<void>;
1883
+ };
1793
1884
  };
1794
1885
  createJob(request: ChatStreamRequest): Promise<JobCreateResponse>;
1795
1886
  streamJobEvents(jobId: string, afterSeq?: number, signal?: AbortSignal): AsyncGenerator<ChatStreamEvent>;
@@ -2766,4 +2857,4 @@ declare function isEmbeddedResource(value: unknown): value is {
2766
2857
  */
2767
2858
  declare function parseEmbeddedResource(value: unknown): EmbeddedResource | null;
2768
2859
 
2769
- export { type ActiveJob, type AgentCapability, type AgentIdentity, type AgentInfo, type AgentStatus, type AssetCreatedPayload, type AstralformApiKeyConfig, AstralformClient, type AstralformConfig, AstralformError, type AstralformUserTokenConfig, type AttachmentStagedPayload, AuthenticationError, type AvailableRepositories, type AvailableRepository, type BlockDeltaPayload, CONVERSATION_PAGE_SIZE, type ChatEvent, ChatEventType, type ChatEventTypeValue, ChatSession, type ChatStorage, type ChatStreamEvent, type ChatStreamRequest, type CodeProject, ConnectionError, type ContextUpdatePayload, type ContextWarningPayload, type Conversation, type ConversationAsset, type ConversationEvent, type ConversationJob, type ConversationJobAttachment, type DesktopStreamPayload, type EffortRung, type EmbeddedResource, type FeedbackRequest, type FeedbackResponse, InMemoryStorage, type JobCreateResponse, type JobStatus, type JobSummary, type JobsPage, LLMNotConfiguredError, type MemoryProviderErrorPayload, type MemoryRecallPayload, type MemoryRecord, type MemoryUpdatePayload, type Message, type MessagesPage, type ModelChoiceOptions, type ModelOption, type MyToolGrantsPage, type NestedLlmUsagePayload, type NoteUpdatePayload, type PlanUpdatePayload, type PromptSuggestionPayload, type ProtocolAdapter, ProtocolRegistry, RateLimitError, type RateLimitErrorDetails, type RawSseEvent, type ReasoningEffort, type SendOptions, ServerError, type SendOptions$1 as SessionSendOptions, type SkillInfo, type SlashCommand, type SlashCommandSurface, StreamAbortedError, type StreamJobSSEOptions, StreamManager, type StreamManagerEvent, type StreamState, type SubagentStartPayload, type SubagentStopPayload, type TaskStatus, type TeamAgentSummary, type TeamSummary, type ThinkingDescriptor, type ThinkingRungOption, type TitleGeneratedPayload, type TodoItem, type TodoUpdatePayload, type ToolApprovalDecision, type ToolApprovalGrantedPayload, type ToolApprovalRequest, type ToolApprovalRequestedPayload, type ToolApprovalScope, type ToolCallRequest, type ToolDefinition, type ToolGrant, type ToolHandler, type ToolHarnessWarningPayload, type ToolImageMode, type ToolImageStub, type ToolOutputMode, type ToolOutputStub, type ToolProgressPayload, ToolRegistry, type ToolResult, type ToolResultRequest, type ToolSource, type TurnUsage, type UIComponentsConfig, type UserUnavailablePayload, VOICE_POLISH_MODES, type VoiceConfig, type VoiceLLMMode, type VoicePolishEvent, type VoicePolishMode, type VoicePolishRequest, type VoiceTranscribeOptions, type VoiceTranscript, type WireBlockDelta, type WireBlockDeltaPayload, type WireBlockKind, type WireBlockStart, type WireBlockStatus, type WireBlockStop, type WireCustomEvent, type WireErrorEvent, type WireEvent, type WireInputArgDelta, type WireInputDelta, type WireKeepalive, type WireMessageStart, type WireMessageStop, type WireOutputDelta, type WireRetryEvent, type WireSignatureDelta, type WireStallWarning, type WireStatusDelta, type WireStopReason, type WireTextDelta, type WireThinkingDelta, type WorkspaceReadyPayload, generateId, isEmbeddedResource, isToolImageStub, isToolOutputStub, isVoiceLLMMode, isVoicePolishMode, mapSseToChat, parseEmbeddedResource, parseVoicePolishFrame, replayEvents, streamJobSSE, translateDelta };
2860
+ export { type ActiveJob, type AgentCapability, type AgentIdentity, type AgentInfo, type AgentStatus, type AssetCreatedPayload, type AstralformApiKeyConfig, AstralformClient, type AstralformConfig, AstralformError, type AstralformUserTokenConfig, type AttachmentStagedPayload, AuthenticationError, type AvailableRepositories, type AvailableRepository, type BlockDeltaPayload, CONVERSATION_PAGE_SIZE, type ChatEvent, ChatEventType, type ChatEventTypeValue, ChatSession, type ChatStorage, type ChatStreamEvent, type ChatStreamRequest, type CodeGroupMembership, type CodeProject, ConnectionError, type ContextUpdatePayload, type ContextWarningPayload, type Conversation, type ConversationAsset, type ConversationEvent, type ConversationGroup, type ConversationJob, type ConversationJobAttachment, type DesktopStreamPayload, type EffortRung, type EmbeddedResource, type FeedbackRequest, type FeedbackResponse, InMemoryStorage, type JobCreateResponse, type JobStatus, type JobSummary, type JobsPage, LLMNotConfiguredError, type MemoryProviderErrorPayload, type MemoryRecallPayload, type MemoryRecord, type MemoryUpdatePayload, type Message, type MessagesPage, type ModelChoiceOptions, type ModelOption, type MyToolGrantsPage, type NestedLlmUsagePayload, type NoteUpdatePayload, type PlanUpdatePayload, type PromptSuggestionPayload, type ProtocolAdapter, ProtocolRegistry, RateLimitError, type RateLimitErrorDetails, type RawSseEvent, type ReasoningEffort, type SendOptions, ServerError, type SendOptions$1 as SessionSendOptions, type SkillInfo, type SlashCommand, type SlashCommandSurface, StreamAbortedError, type StreamJobSSEOptions, StreamManager, type StreamManagerEvent, type StreamState, type SubagentStartPayload, type SubagentStopPayload, type TaskStatus, type TeamAgentSummary, type TeamSummary, type ThinkingDescriptor, type ThinkingRungOption, type TitleGeneratedPayload, type TodoItem, type TodoUpdatePayload, type ToolApprovalDecision, type ToolApprovalGrantedPayload, type ToolApprovalRequest, type ToolApprovalRequestedPayload, type ToolApprovalScope, type ToolCallRequest, type ToolDefinition, type ToolGrant, type ToolHandler, type ToolHarnessWarningPayload, type ToolImageMode, type ToolImageStub, type ToolOutputMode, type ToolOutputStub, type ToolProgressPayload, ToolRegistry, type ToolResult, type ToolResultRequest, type ToolSource, type TurnUsage, type UIComponentsConfig, type UserUnavailablePayload, VOICE_POLISH_MODES, type VoiceConfig, type VoiceLLMMode, type VoicePolishEvent, type VoicePolishMode, type VoicePolishRequest, type VoiceTranscribeOptions, type VoiceTranscript, type WireBlockDelta, type WireBlockDeltaPayload, type WireBlockKind, type WireBlockStart, type WireBlockStatus, type WireBlockStop, type WireCustomEvent, type WireErrorEvent, type WireEvent, type WireInputArgDelta, type WireInputDelta, type WireKeepalive, type WireMessageStart, type WireMessageStop, type WireOutputDelta, type WireRetryEvent, type WireSignatureDelta, type WireStallWarning, type WireStatusDelta, type WireStopReason, type WireTextDelta, type WireThinkingDelta, type WorkspaceReadyPayload, generateId, isEmbeddedResource, isToolImageStub, isToolOutputStub, isVoiceLLMMode, isVoicePolishMode, mapSseToChat, parseEmbeddedResource, parseVoicePolishFrame, replayEvents, streamJobSSE, translateDelta };
package/dist/index.js CHANGED
@@ -447,6 +447,79 @@ var AstralformClient = class {
447
447
  `/v1/code/projects/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}`
448
448
  );
449
449
  }
450
+ },
451
+ /**
452
+ * Code groups: a user-named container under one repository, for a feature
453
+ * whose work outlives a single session. Its sessions share one plan and one
454
+ * set of notes, so what one writes the others read.
455
+ *
456
+ * A group is a LABEL, not a binding — unlike a task's project, which is
457
+ * written once on the first turn. A task may join, move between, or leave
458
+ * groups at any time, and a deleted group's sessions survive as ungrouped.
459
+ *
460
+ * The server enforces three things worth knowing before you render a
461
+ * failure: a group that is not this user's answers `404` (never `403`, so a
462
+ * group id cannot be probed); filing a task into a group under a DIFFERENT
463
+ * repository than the task's answers `409`; and the group's plan and notes
464
+ * are deleted with the group, while each session keeps its own.
465
+ */
466
+ groups: {
467
+ /**
468
+ * This user's groups, oldest first. Pass a repository to narrow to one
469
+ * repository's — the composer's picker does; the sidebar asks once and
470
+ * nests them itself.
471
+ */
472
+ list: async (repository) => {
473
+ const query = repository ? `?repository=${encodeURIComponent(repository)}` : "";
474
+ const raw = await this.get(`/v1/code/groups${query}`);
475
+ return raw.map((g) => camelizeKeys(g));
476
+ },
477
+ /**
478
+ * Create a group under a repository. The repository goes through the same
479
+ * normaliser the Projects surface uses, so a pasted GitHub URL is accepted
480
+ * and anything that is not `owner/repo` is refused.
481
+ */
482
+ create: async (repository, title) => {
483
+ const raw = await this.post("/v1/code/groups", { repository, title });
484
+ return camelizeKeys(raw);
485
+ },
486
+ /** Rename a group. A group that is not this user's answers `404`. */
487
+ rename: async (groupId, title) => {
488
+ const raw = await this.patch(`/v1/code/groups/${encodeURIComponent(groupId)}`, { title });
489
+ return camelizeKeys(raw);
490
+ },
491
+ /**
492
+ * Delete a group. Its tasks survive and become ungrouped, each keeping its
493
+ * own plan and notes; the group's SHARED documents are deleted with it.
494
+ */
495
+ remove: async (groupId) => {
496
+ await this.del(`/v1/code/groups/${encodeURIComponent(groupId)}`);
497
+ },
498
+ /**
499
+ * File a task into a group. Idempotent — filing an already-filed task
500
+ * again is the same state, not an error. Refused with `409` when the task
501
+ * belongs to a different repository than the group, because it would
502
+ * render nowhere in the sidebar.
503
+ */
504
+ assign: async (groupId, conversationId) => {
505
+ const raw = await this.post(
506
+ `/v1/code/groups/${encodeURIComponent(groupId)}/tasks/${encodeURIComponent(conversationId)}`,
507
+ void 0
508
+ );
509
+ return camelizeKeys(raw);
510
+ },
511
+ /**
512
+ * Take a task out of its group. The task and its documents are untouched.
513
+ *
514
+ * Deliberately not strict about WHICH group the task is in: a task that is
515
+ * in a different one (or in none) already satisfies "this task should not
516
+ * be grouped", so the call clears it rather than refusing.
517
+ */
518
+ unassign: async (groupId, conversationId) => {
519
+ await this.del(
520
+ `/v1/code/groups/${encodeURIComponent(groupId)}/tasks/${encodeURIComponent(conversationId)}`
521
+ );
522
+ }
450
523
  }
451
524
  };
452
525
  if (isApiKeyConfig(config)) {
@@ -1008,7 +1081,11 @@ var AstralformClient = class {
1008
1081
  // A mode this SDK does not know must not reach a `switch` typed as
1009
1082
  // `VoicePolishMode`; `structured` is the server's own default.
1010
1083
  defaultMode: isVoicePolishMode(raw.default_mode) ? raw.default_mode : "structured",
1011
- silenceAutoStopSeconds: raw.silence_auto_stop_seconds ?? 2,
1084
+ // Deliberately not read from the wire. The field was retired from the
1085
+ // platform (2026-10-09): no shipped client implements pause detection
1086
+ // and the server no longer sends it, so an older server's stored value
1087
+ // must not resurrect it.
1088
+ silenceAutoStopSeconds: 2,
1012
1089
  // Deliberately not read from the wire. Auto-send was removed from the
1013
1090
  // platform (2026-09-14) and the server pins `auto_send` to false; an
1014
1091
  // older server still sending `true` must not make a client auto-send, so
@@ -1665,22 +1742,24 @@ function translateWireEvent(wire) {
1665
1742
  status: wire.status,
1666
1743
  final: wire.final
1667
1744
  };
1668
- case "message_stop":
1745
+ case "message_stop": {
1746
+ const usage = wire.usage ?? {};
1669
1747
  return {
1670
1748
  type: "message_stop",
1671
1749
  turnId: wire.turn_id,
1672
1750
  jobId: wire.job_id,
1673
1751
  stopReason: wire.stop_reason,
1674
1752
  usage: {
1675
- inputTokens: wire.usage.input_tokens ?? 0,
1676
- outputTokens: wire.usage.output_tokens ?? 0,
1677
- cachedTokens: wire.usage.cached_tokens ?? 0,
1678
- cacheCreationTokens: wire.usage.cache_creation_tokens ?? 0
1753
+ inputTokens: usage.input_tokens ?? 0,
1754
+ outputTokens: usage.output_tokens ?? 0,
1755
+ cachedTokens: usage.cached_tokens ?? 0,
1756
+ cacheCreationTokens: usage.cache_creation_tokens ?? 0
1679
1757
  },
1680
1758
  ttfbMs: wire.ttfb_ms,
1681
1759
  totalMs: wire.total_ms,
1682
1760
  stallCount: wire.stall_count
1683
1761
  };
1762
+ }
1684
1763
  case "stall":
1685
1764
  return {
1686
1765
  type: "stall",
@@ -2032,7 +2111,7 @@ var ChatSession = class {
2032
2111
  if (!(err instanceof DOMException && err.name === "AbortError")) {
2033
2112
  this.emit({
2034
2113
  type: "error",
2035
- code: "connection_error",
2114
+ code: err instanceof AstralformError ? err.code : "connection_error",
2036
2115
  message: err instanceof Error ? err.message : String(err),
2037
2116
  blockPath: null
2038
2117
  });
@@ -2184,6 +2263,9 @@ var ChatSession = class {
2184
2263
  if (typeof data?.seq === "number") {
2185
2264
  this.lastSeq = data.seq;
2186
2265
  }
2266
+ if (typeof data === "object" && data !== null && "data" in data && data.data === "[DONE]") {
2267
+ sawTerminal = true;
2268
+ }
2187
2269
  continue;
2188
2270
  }
2189
2271
  parsed = data;
@@ -2313,7 +2395,7 @@ var ChatSession = class {
2313
2395
  }
2314
2396
  return;
2315
2397
  case "block_delta":
2316
- if (ownsTurnState && wire.delta.channel === "text" && this.currentTextPath !== null && pathEquals(this.currentTextPath, wire.path)) {
2398
+ if (ownsTurnState && wire.delta?.channel === "text" && this.currentTextPath !== null && pathEquals(this.currentTextPath, wire.path)) {
2317
2399
  this.accumulatedText += wire.delta.text;
2318
2400
  }
2319
2401
  return;