@astralform/js 1.1.0 → 2.0.0
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/README.md +6 -6
- package/dist/index.cjs +146 -55
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +54 -21
- package/dist/index.d.ts +54 -21
- package/dist/index.js +146 -55
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -122,7 +122,7 @@ interface AstralformBaseConfig {
|
|
|
122
122
|
fetch?: typeof globalThis.fetch;
|
|
123
123
|
}
|
|
124
124
|
interface AstralformApiKeyConfig extends AstralformBaseConfig {
|
|
125
|
-
/**
|
|
125
|
+
/** Agent API key (`sk_live_...` or `sk_test_...`). */
|
|
126
126
|
apiKey: string;
|
|
127
127
|
/**
|
|
128
128
|
* The customer's own identifier for the end user making this call.
|
|
@@ -138,16 +138,16 @@ interface AstralformUserTokenConfig extends AstralformBaseConfig {
|
|
|
138
138
|
*/
|
|
139
139
|
accessToken: string;
|
|
140
140
|
/**
|
|
141
|
-
* Active
|
|
142
|
-
* verifies the token's developer has access to this
|
|
143
|
-
* request; switching
|
|
141
|
+
* Active agent context. Sent as the `X-Project-ID` header (legacy wire name). The backend
|
|
142
|
+
* verifies the token's developer has access to this agent on every
|
|
143
|
+
* request; switching agents is a local `updateAgentId()` call.
|
|
144
144
|
*
|
|
145
145
|
* Optional so a pre-pick client (right after login, before the user has
|
|
146
|
-
* chosen a team/
|
|
147
|
-
* like `listTeams()` / `
|
|
146
|
+
* chosen a team/agent) can still call account-scoped discovery routes
|
|
147
|
+
* like `listTeams()` / `listAgents(teamId)`. Agent-scoped calls
|
|
148
148
|
* (conversations, messages, chat) will error out until one is set.
|
|
149
149
|
*/
|
|
150
|
-
|
|
150
|
+
agentId?: string;
|
|
151
151
|
/**
|
|
152
152
|
* Optional end-user override — lets a developer acting under a user
|
|
153
153
|
* token impersonate a downstream end-user identity for testing
|
|
@@ -533,7 +533,7 @@ interface UIComponentsConfig {
|
|
|
533
533
|
/** MIME type to match against embedded resources (e.g. "application/json+a2ui"). */
|
|
534
534
|
mimeType: string | null;
|
|
535
535
|
}
|
|
536
|
-
interface
|
|
536
|
+
interface AgentStatus {
|
|
537
537
|
isReady: boolean;
|
|
538
538
|
llmConfigured: boolean;
|
|
539
539
|
llmProvider?: string;
|
|
@@ -557,7 +557,12 @@ interface TeamSummary {
|
|
|
557
557
|
/** Caller's role in this team (e.g. "owner", "admin", "member"). */
|
|
558
558
|
role: string;
|
|
559
559
|
}
|
|
560
|
-
|
|
560
|
+
/**
|
|
561
|
+
* A team-level agent (formerly "project") — the workspace a user opens to
|
|
562
|
+
* chat. Distinct from `AgentInfo`, which describes the AI personas available
|
|
563
|
+
* INSIDE an agent workspace (orchestrator + specialists).
|
|
564
|
+
*/
|
|
565
|
+
interface TeamAgentSummary {
|
|
561
566
|
id: string;
|
|
562
567
|
name: string;
|
|
563
568
|
teamId: string;
|
|
@@ -717,7 +722,7 @@ declare class AstralformClient {
|
|
|
717
722
|
private readonly fetchFn;
|
|
718
723
|
/**
|
|
719
724
|
* Auth state is mutable so callers can rotate access tokens or switch
|
|
720
|
-
*
|
|
725
|
+
* agent context without re-instantiating the client. API-key mode is
|
|
721
726
|
* effectively immutable in practice but uses the same shape for uniformity.
|
|
722
727
|
*/
|
|
723
728
|
private auth;
|
|
@@ -729,10 +734,10 @@ declare class AstralformClient {
|
|
|
729
734
|
*/
|
|
730
735
|
updateAccessToken(accessToken: string): void;
|
|
731
736
|
/**
|
|
732
|
-
* Swap the active
|
|
733
|
-
* current developer has access to the new
|
|
737
|
+
* Swap the active agent for a user-token client. The backend verifies the
|
|
738
|
+
* current developer has access to the new agent; a 403 comes back if not.
|
|
734
739
|
*/
|
|
735
|
-
|
|
740
|
+
updateAgentId(agentId: string): void;
|
|
736
741
|
/**
|
|
737
742
|
* Set (or clear) the end-user override for user-token mode.
|
|
738
743
|
*
|
|
@@ -745,12 +750,12 @@ declare class AstralformClient {
|
|
|
745
750
|
/** Current end-user override in user-token mode, or `null` if unset. */
|
|
746
751
|
get endUserId(): string | null;
|
|
747
752
|
/**
|
|
748
|
-
* Active
|
|
749
|
-
* was constructed without one). For API-key mode the
|
|
753
|
+
* Active agent for user-token mode, or `null` if pre-pick (client
|
|
754
|
+
* was constructed without one). For API-key mode the agent is baked
|
|
750
755
|
* into the key, so this getter returns `null` there too — use
|
|
751
756
|
* `authMode` to disambiguate.
|
|
752
757
|
*/
|
|
753
|
-
get
|
|
758
|
+
get agentId(): string | null;
|
|
754
759
|
/** Which auth mode this client was constructed with. */
|
|
755
760
|
get authMode(): "api_key" | "user_token";
|
|
756
761
|
/**
|
|
@@ -771,10 +776,16 @@ declare class AstralformClient {
|
|
|
771
776
|
version: string;
|
|
772
777
|
ollama_connected: boolean;
|
|
773
778
|
}>;
|
|
774
|
-
|
|
779
|
+
getAgentStatus(): Promise<AgentStatus>;
|
|
775
780
|
getConversations(limit?: number, offset?: number): Promise<Conversation[]>;
|
|
776
781
|
getMessages(conversationId: string): Promise<Message[]>;
|
|
777
782
|
deleteConversation(id: string): Promise<void>;
|
|
783
|
+
/**
|
|
784
|
+
* List the AI personas (sub-agents) available INSIDE the client's active
|
|
785
|
+
* agent workspace — orchestrator + specialists, addressed per message via
|
|
786
|
+
* `ChatStreamRequest.agent_name`. Not to be confused with `listAgents()`,
|
|
787
|
+
* which enumerates the team-level agents a signed-in user can open.
|
|
788
|
+
*/
|
|
778
789
|
getAgents(): Promise<AgentInfo[]>;
|
|
779
790
|
getSkills(): Promise<SkillInfo[]>;
|
|
780
791
|
getConversationEvents(conversationId: string, jobId?: string): Promise<ConversationEvent[]>;
|
|
@@ -800,7 +811,12 @@ declare class AstralformClient {
|
|
|
800
811
|
listUploads(conversationId: string): Promise<ConversationAsset[]>;
|
|
801
812
|
listOutputs(conversationId: string): Promise<ConversationAsset[]>;
|
|
802
813
|
listTeams(): Promise<TeamSummary[]>;
|
|
803
|
-
|
|
814
|
+
/**
|
|
815
|
+
* List the team-level agents (formerly "projects") the signed-in user can
|
|
816
|
+
* open — the pickable workspaces under a team. Not to be confused with
|
|
817
|
+
* `getAgents()`, which lists the AI personas inside the active agent.
|
|
818
|
+
*/
|
|
819
|
+
listAgents(teamId: string): Promise<TeamAgentSummary[]>;
|
|
804
820
|
createJob(request: ChatStreamRequest): Promise<JobCreateResponse>;
|
|
805
821
|
streamJobEvents(jobId: string, afterSeq?: number, signal?: AbortSignal): AsyncGenerator<ChatStreamEvent>;
|
|
806
822
|
cancelJob(jobId: string): Promise<void>;
|
|
@@ -887,7 +903,7 @@ declare class ChatSession {
|
|
|
887
903
|
/**
|
|
888
904
|
* Pluggable UI protocol adapters. Consumers register a framework-
|
|
889
905
|
* specific adapter (e.g. React) for each MIME type they can render,
|
|
890
|
-
* typically gated on ``session.
|
|
906
|
+
* typically gated on ``session.agentStatus.uiComponents.protocol``.
|
|
891
907
|
* ``ToolBlock``-style consumers look up the adapter for an incoming
|
|
892
908
|
* embedded resource and hand off rendering.
|
|
893
909
|
*/
|
|
@@ -896,7 +912,7 @@ declare class ChatSession {
|
|
|
896
912
|
conversations: Conversation[];
|
|
897
913
|
messages: Message[];
|
|
898
914
|
isStreaming: boolean;
|
|
899
|
-
|
|
915
|
+
agentStatus: AgentStatus | null;
|
|
900
916
|
agents: AgentInfo[];
|
|
901
917
|
skills: SkillInfo[];
|
|
902
918
|
enabledClientTools: Set<string>;
|
|
@@ -917,6 +933,13 @@ declare class ChatSession {
|
|
|
917
933
|
private processStream;
|
|
918
934
|
/** Last received sequence number for resumable reconnection */
|
|
919
935
|
private lastSeq;
|
|
936
|
+
/**
|
|
937
|
+
* Client-tool call_ids whose result was already submitted this turn. On a
|
|
938
|
+
* reconnect the resumed stream can replay a tool request we already handled;
|
|
939
|
+
* this dedups so each is executed + submitted at most once (but a request we
|
|
940
|
+
* never submitted still runs). Cleared at the start of each turn.
|
|
941
|
+
*/
|
|
942
|
+
private submittedToolCallIds;
|
|
920
943
|
/** Current job ID for cancellation */
|
|
921
944
|
currentJobId: string | null;
|
|
922
945
|
private consumeJobStream;
|
|
@@ -925,6 +948,16 @@ declare class ChatSession {
|
|
|
925
948
|
* minimal session state, and emits typed ChatEvents to consumers.
|
|
926
949
|
*/
|
|
927
950
|
private consumeEventStream;
|
|
951
|
+
/**
|
|
952
|
+
* Consume a single SSE stream to exhaustion. Returns whether a terminal
|
|
953
|
+
* event (``message_stop`` / ``error``) was seen, so the caller can decide
|
|
954
|
+
* whether an ended stream means "turn done" vs "dropped, reconnect".
|
|
955
|
+
*/
|
|
956
|
+
private pumpStream;
|
|
957
|
+
/** Sleep for ``ms``, resolving early if the turn is aborted mid-backoff. */
|
|
958
|
+
private sleepUnlessAborted;
|
|
959
|
+
/** POST a client-tool result, retrying transient failures a few times. */
|
|
960
|
+
private submitToolResultWithRetry;
|
|
928
961
|
private dispatchWireEvent;
|
|
929
962
|
/**
|
|
930
963
|
* State mutations driven by wire events. Kept separate from translation so
|
|
@@ -1158,4 +1191,4 @@ declare function isEmbeddedResource(value: unknown): value is {
|
|
|
1158
1191
|
*/
|
|
1159
1192
|
declare function parseEmbeddedResource(value: unknown): EmbeddedResource | null;
|
|
1160
1193
|
|
|
1161
|
-
export { type ActiveJob, type AgentIdentity, type AgentInfo, type AssetCreatedPayload, type AstralformApiKeyConfig, AstralformClient, type AstralformConfig, AstralformError, type AstralformUserTokenConfig, type AttachmentStagedPayload, AuthenticationError, type BlockDeltaPayload, type ChatEvent, ChatEventType, type ChatEventTypeValue, ChatSession, type ChatStorage, type ChatStreamEvent, type ChatStreamRequest, ConnectionError, type ContextUpdatePayload, type ContextWarningPayload, type Conversation, type ConversationAsset, type ConversationEvent, type DesktopStreamPayload, type EmbeddedResource, type FeedbackRequest, type FeedbackResponse, InMemoryStorage, type JobCreateResponse, type JobStatus, type JobSummary, LLMNotConfiguredError, type MemoryRecallPayload, type MemoryRecord, type MemoryUpdatePayload, type Message, type MyToolGrantsPage, type
|
|
1194
|
+
export { type ActiveJob, type AgentIdentity, type AgentInfo, type AgentStatus, type AssetCreatedPayload, type AstralformApiKeyConfig, AstralformClient, type AstralformConfig, AstralformError, type AstralformUserTokenConfig, type AttachmentStagedPayload, AuthenticationError, type BlockDeltaPayload, type ChatEvent, ChatEventType, type ChatEventTypeValue, ChatSession, type ChatStorage, type ChatStreamEvent, type ChatStreamRequest, ConnectionError, type ContextUpdatePayload, type ContextWarningPayload, type Conversation, type ConversationAsset, type ConversationEvent, type DesktopStreamPayload, type EmbeddedResource, type FeedbackRequest, type FeedbackResponse, InMemoryStorage, type JobCreateResponse, type JobStatus, type JobSummary, LLMNotConfiguredError, type MemoryRecallPayload, type MemoryRecord, type MemoryUpdatePayload, type Message, type MyToolGrantsPage, type PromptSuggestionPayload, type ProtocolAdapter, ProtocolRegistry, RateLimitError, type RateLimitErrorDetails, type RawSseEvent, type SendOptions, ServerError, type SkillInfo, StreamAbortedError, type StreamJobSSEOptions, StreamManager, type StreamManagerEvent, type StreamState, type SubagentStartPayload, type SubagentStopPayload, type TaskStatus, type TeamAgentSummary, type TeamSummary, 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 ToolPermissionDeniedPayload, ToolRegistry, type ToolResult, type ToolResultRequest, type TurnUsage, type UIComponentsConfig, type UserUnavailablePayload, 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, mapSseToChat, parseEmbeddedResource, replayEvents, streamJobSSE, translateDelta };
|
package/dist/index.d.ts
CHANGED
|
@@ -122,7 +122,7 @@ interface AstralformBaseConfig {
|
|
|
122
122
|
fetch?: typeof globalThis.fetch;
|
|
123
123
|
}
|
|
124
124
|
interface AstralformApiKeyConfig extends AstralformBaseConfig {
|
|
125
|
-
/**
|
|
125
|
+
/** Agent API key (`sk_live_...` or `sk_test_...`). */
|
|
126
126
|
apiKey: string;
|
|
127
127
|
/**
|
|
128
128
|
* The customer's own identifier for the end user making this call.
|
|
@@ -138,16 +138,16 @@ interface AstralformUserTokenConfig extends AstralformBaseConfig {
|
|
|
138
138
|
*/
|
|
139
139
|
accessToken: string;
|
|
140
140
|
/**
|
|
141
|
-
* Active
|
|
142
|
-
* verifies the token's developer has access to this
|
|
143
|
-
* request; switching
|
|
141
|
+
* Active agent context. Sent as the `X-Project-ID` header (legacy wire name). The backend
|
|
142
|
+
* verifies the token's developer has access to this agent on every
|
|
143
|
+
* request; switching agents is a local `updateAgentId()` call.
|
|
144
144
|
*
|
|
145
145
|
* Optional so a pre-pick client (right after login, before the user has
|
|
146
|
-
* chosen a team/
|
|
147
|
-
* like `listTeams()` / `
|
|
146
|
+
* chosen a team/agent) can still call account-scoped discovery routes
|
|
147
|
+
* like `listTeams()` / `listAgents(teamId)`. Agent-scoped calls
|
|
148
148
|
* (conversations, messages, chat) will error out until one is set.
|
|
149
149
|
*/
|
|
150
|
-
|
|
150
|
+
agentId?: string;
|
|
151
151
|
/**
|
|
152
152
|
* Optional end-user override — lets a developer acting under a user
|
|
153
153
|
* token impersonate a downstream end-user identity for testing
|
|
@@ -533,7 +533,7 @@ interface UIComponentsConfig {
|
|
|
533
533
|
/** MIME type to match against embedded resources (e.g. "application/json+a2ui"). */
|
|
534
534
|
mimeType: string | null;
|
|
535
535
|
}
|
|
536
|
-
interface
|
|
536
|
+
interface AgentStatus {
|
|
537
537
|
isReady: boolean;
|
|
538
538
|
llmConfigured: boolean;
|
|
539
539
|
llmProvider?: string;
|
|
@@ -557,7 +557,12 @@ interface TeamSummary {
|
|
|
557
557
|
/** Caller's role in this team (e.g. "owner", "admin", "member"). */
|
|
558
558
|
role: string;
|
|
559
559
|
}
|
|
560
|
-
|
|
560
|
+
/**
|
|
561
|
+
* A team-level agent (formerly "project") — the workspace a user opens to
|
|
562
|
+
* chat. Distinct from `AgentInfo`, which describes the AI personas available
|
|
563
|
+
* INSIDE an agent workspace (orchestrator + specialists).
|
|
564
|
+
*/
|
|
565
|
+
interface TeamAgentSummary {
|
|
561
566
|
id: string;
|
|
562
567
|
name: string;
|
|
563
568
|
teamId: string;
|
|
@@ -717,7 +722,7 @@ declare class AstralformClient {
|
|
|
717
722
|
private readonly fetchFn;
|
|
718
723
|
/**
|
|
719
724
|
* Auth state is mutable so callers can rotate access tokens or switch
|
|
720
|
-
*
|
|
725
|
+
* agent context without re-instantiating the client. API-key mode is
|
|
721
726
|
* effectively immutable in practice but uses the same shape for uniformity.
|
|
722
727
|
*/
|
|
723
728
|
private auth;
|
|
@@ -729,10 +734,10 @@ declare class AstralformClient {
|
|
|
729
734
|
*/
|
|
730
735
|
updateAccessToken(accessToken: string): void;
|
|
731
736
|
/**
|
|
732
|
-
* Swap the active
|
|
733
|
-
* current developer has access to the new
|
|
737
|
+
* Swap the active agent for a user-token client. The backend verifies the
|
|
738
|
+
* current developer has access to the new agent; a 403 comes back if not.
|
|
734
739
|
*/
|
|
735
|
-
|
|
740
|
+
updateAgentId(agentId: string): void;
|
|
736
741
|
/**
|
|
737
742
|
* Set (or clear) the end-user override for user-token mode.
|
|
738
743
|
*
|
|
@@ -745,12 +750,12 @@ declare class AstralformClient {
|
|
|
745
750
|
/** Current end-user override in user-token mode, or `null` if unset. */
|
|
746
751
|
get endUserId(): string | null;
|
|
747
752
|
/**
|
|
748
|
-
* Active
|
|
749
|
-
* was constructed without one). For API-key mode the
|
|
753
|
+
* Active agent for user-token mode, or `null` if pre-pick (client
|
|
754
|
+
* was constructed without one). For API-key mode the agent is baked
|
|
750
755
|
* into the key, so this getter returns `null` there too — use
|
|
751
756
|
* `authMode` to disambiguate.
|
|
752
757
|
*/
|
|
753
|
-
get
|
|
758
|
+
get agentId(): string | null;
|
|
754
759
|
/** Which auth mode this client was constructed with. */
|
|
755
760
|
get authMode(): "api_key" | "user_token";
|
|
756
761
|
/**
|
|
@@ -771,10 +776,16 @@ declare class AstralformClient {
|
|
|
771
776
|
version: string;
|
|
772
777
|
ollama_connected: boolean;
|
|
773
778
|
}>;
|
|
774
|
-
|
|
779
|
+
getAgentStatus(): Promise<AgentStatus>;
|
|
775
780
|
getConversations(limit?: number, offset?: number): Promise<Conversation[]>;
|
|
776
781
|
getMessages(conversationId: string): Promise<Message[]>;
|
|
777
782
|
deleteConversation(id: string): Promise<void>;
|
|
783
|
+
/**
|
|
784
|
+
* List the AI personas (sub-agents) available INSIDE the client's active
|
|
785
|
+
* agent workspace — orchestrator + specialists, addressed per message via
|
|
786
|
+
* `ChatStreamRequest.agent_name`. Not to be confused with `listAgents()`,
|
|
787
|
+
* which enumerates the team-level agents a signed-in user can open.
|
|
788
|
+
*/
|
|
778
789
|
getAgents(): Promise<AgentInfo[]>;
|
|
779
790
|
getSkills(): Promise<SkillInfo[]>;
|
|
780
791
|
getConversationEvents(conversationId: string, jobId?: string): Promise<ConversationEvent[]>;
|
|
@@ -800,7 +811,12 @@ declare class AstralformClient {
|
|
|
800
811
|
listUploads(conversationId: string): Promise<ConversationAsset[]>;
|
|
801
812
|
listOutputs(conversationId: string): Promise<ConversationAsset[]>;
|
|
802
813
|
listTeams(): Promise<TeamSummary[]>;
|
|
803
|
-
|
|
814
|
+
/**
|
|
815
|
+
* List the team-level agents (formerly "projects") the signed-in user can
|
|
816
|
+
* open — the pickable workspaces under a team. Not to be confused with
|
|
817
|
+
* `getAgents()`, which lists the AI personas inside the active agent.
|
|
818
|
+
*/
|
|
819
|
+
listAgents(teamId: string): Promise<TeamAgentSummary[]>;
|
|
804
820
|
createJob(request: ChatStreamRequest): Promise<JobCreateResponse>;
|
|
805
821
|
streamJobEvents(jobId: string, afterSeq?: number, signal?: AbortSignal): AsyncGenerator<ChatStreamEvent>;
|
|
806
822
|
cancelJob(jobId: string): Promise<void>;
|
|
@@ -887,7 +903,7 @@ declare class ChatSession {
|
|
|
887
903
|
/**
|
|
888
904
|
* Pluggable UI protocol adapters. Consumers register a framework-
|
|
889
905
|
* specific adapter (e.g. React) for each MIME type they can render,
|
|
890
|
-
* typically gated on ``session.
|
|
906
|
+
* typically gated on ``session.agentStatus.uiComponents.protocol``.
|
|
891
907
|
* ``ToolBlock``-style consumers look up the adapter for an incoming
|
|
892
908
|
* embedded resource and hand off rendering.
|
|
893
909
|
*/
|
|
@@ -896,7 +912,7 @@ declare class ChatSession {
|
|
|
896
912
|
conversations: Conversation[];
|
|
897
913
|
messages: Message[];
|
|
898
914
|
isStreaming: boolean;
|
|
899
|
-
|
|
915
|
+
agentStatus: AgentStatus | null;
|
|
900
916
|
agents: AgentInfo[];
|
|
901
917
|
skills: SkillInfo[];
|
|
902
918
|
enabledClientTools: Set<string>;
|
|
@@ -917,6 +933,13 @@ declare class ChatSession {
|
|
|
917
933
|
private processStream;
|
|
918
934
|
/** Last received sequence number for resumable reconnection */
|
|
919
935
|
private lastSeq;
|
|
936
|
+
/**
|
|
937
|
+
* Client-tool call_ids whose result was already submitted this turn. On a
|
|
938
|
+
* reconnect the resumed stream can replay a tool request we already handled;
|
|
939
|
+
* this dedups so each is executed + submitted at most once (but a request we
|
|
940
|
+
* never submitted still runs). Cleared at the start of each turn.
|
|
941
|
+
*/
|
|
942
|
+
private submittedToolCallIds;
|
|
920
943
|
/** Current job ID for cancellation */
|
|
921
944
|
currentJobId: string | null;
|
|
922
945
|
private consumeJobStream;
|
|
@@ -925,6 +948,16 @@ declare class ChatSession {
|
|
|
925
948
|
* minimal session state, and emits typed ChatEvents to consumers.
|
|
926
949
|
*/
|
|
927
950
|
private consumeEventStream;
|
|
951
|
+
/**
|
|
952
|
+
* Consume a single SSE stream to exhaustion. Returns whether a terminal
|
|
953
|
+
* event (``message_stop`` / ``error``) was seen, so the caller can decide
|
|
954
|
+
* whether an ended stream means "turn done" vs "dropped, reconnect".
|
|
955
|
+
*/
|
|
956
|
+
private pumpStream;
|
|
957
|
+
/** Sleep for ``ms``, resolving early if the turn is aborted mid-backoff. */
|
|
958
|
+
private sleepUnlessAborted;
|
|
959
|
+
/** POST a client-tool result, retrying transient failures a few times. */
|
|
960
|
+
private submitToolResultWithRetry;
|
|
928
961
|
private dispatchWireEvent;
|
|
929
962
|
/**
|
|
930
963
|
* State mutations driven by wire events. Kept separate from translation so
|
|
@@ -1158,4 +1191,4 @@ declare function isEmbeddedResource(value: unknown): value is {
|
|
|
1158
1191
|
*/
|
|
1159
1192
|
declare function parseEmbeddedResource(value: unknown): EmbeddedResource | null;
|
|
1160
1193
|
|
|
1161
|
-
export { type ActiveJob, type AgentIdentity, type AgentInfo, type AssetCreatedPayload, type AstralformApiKeyConfig, AstralformClient, type AstralformConfig, AstralformError, type AstralformUserTokenConfig, type AttachmentStagedPayload, AuthenticationError, type BlockDeltaPayload, type ChatEvent, ChatEventType, type ChatEventTypeValue, ChatSession, type ChatStorage, type ChatStreamEvent, type ChatStreamRequest, ConnectionError, type ContextUpdatePayload, type ContextWarningPayload, type Conversation, type ConversationAsset, type ConversationEvent, type DesktopStreamPayload, type EmbeddedResource, type FeedbackRequest, type FeedbackResponse, InMemoryStorage, type JobCreateResponse, type JobStatus, type JobSummary, LLMNotConfiguredError, type MemoryRecallPayload, type MemoryRecord, type MemoryUpdatePayload, type Message, type MyToolGrantsPage, type
|
|
1194
|
+
export { type ActiveJob, type AgentIdentity, type AgentInfo, type AgentStatus, type AssetCreatedPayload, type AstralformApiKeyConfig, AstralformClient, type AstralformConfig, AstralformError, type AstralformUserTokenConfig, type AttachmentStagedPayload, AuthenticationError, type BlockDeltaPayload, type ChatEvent, ChatEventType, type ChatEventTypeValue, ChatSession, type ChatStorage, type ChatStreamEvent, type ChatStreamRequest, ConnectionError, type ContextUpdatePayload, type ContextWarningPayload, type Conversation, type ConversationAsset, type ConversationEvent, type DesktopStreamPayload, type EmbeddedResource, type FeedbackRequest, type FeedbackResponse, InMemoryStorage, type JobCreateResponse, type JobStatus, type JobSummary, LLMNotConfiguredError, type MemoryRecallPayload, type MemoryRecord, type MemoryUpdatePayload, type Message, type MyToolGrantsPage, type PromptSuggestionPayload, type ProtocolAdapter, ProtocolRegistry, RateLimitError, type RateLimitErrorDetails, type RawSseEvent, type SendOptions, ServerError, type SkillInfo, StreamAbortedError, type StreamJobSSEOptions, StreamManager, type StreamManagerEvent, type StreamState, type SubagentStartPayload, type SubagentStopPayload, type TaskStatus, type TeamAgentSummary, type TeamSummary, 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 ToolPermissionDeniedPayload, ToolRegistry, type ToolResult, type ToolResultRequest, type TurnUsage, type UIComponentsConfig, type UserUnavailablePayload, 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, mapSseToChat, parseEmbeddedResource, replayEvents, streamJobSSE, translateDelta };
|