@astralform/js 8.4.0 → 8.5.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/dist/index.d.cts CHANGED
@@ -660,15 +660,58 @@ interface Conversation {
660
660
  */
661
661
  repository?: string | null;
662
662
  }
663
+ /** One citation on a `web_search`-style tool row, as the clients parse it. */
664
+ interface ToolSource {
665
+ title: string;
666
+ url: string;
667
+ snippet?: string;
668
+ }
663
669
  interface Message {
664
670
  id: string;
665
671
  conversationId: string;
666
- role: "user" | "assistant" | "system";
672
+ /**
673
+ * `"tool"` is the role every tool-result row carries, and it was missing
674
+ * here — which is why those rows could not be typed at all.
675
+ *
676
+ * `"system"` is retained but DEAD: `MessageResponse.role` is
677
+ * `Literal["user", "assistant", "tool"]`, and the server skips system rows
678
+ * before responding, so it cannot occur. Narrowing the union would be a
679
+ * source-breaking change for anyone matching on it, so it is grouped with
680
+ * the other breaking cleanups for one deliberate major rather than
681
+ * dribbling a major out of an otherwise additive change.
682
+ */
683
+ role: "user" | "assistant" | "tool" | "system";
667
684
  content: string;
668
685
  parentId?: string;
669
686
  status: "sending" | "streaming" | "complete" | "error";
670
687
  createdAt: string;
671
688
  toolCalls?: ToolCallRequest[];
689
+ /**
690
+ * Result typing for a `role="tool"` row, joined server-side from the tool
691
+ * call's `block_stop.final`. These exist so history rendered from REST —
692
+ * older turns paged in on scroll, or the fallback when replay yields
693
+ * nothing — renders a settled tool row the way its replayed twin does,
694
+ * instead of as raw output under a generic label.
695
+ *
696
+ * All are `undefined` when no block stop matched, which degrades to the
697
+ * row's plain content.
698
+ */
699
+ sources?: ToolSource[];
700
+ durationMs?: number;
701
+ isError?: boolean;
702
+ /**
703
+ * Human-readable prose — a fixed phrase, or a policy rule's own free-text
704
+ * reason. PRESENCE, not value, is the denial signal: a denied tool reports
705
+ * `isError: false` and nothing else on the row distinguishes it.
706
+ */
707
+ deniedBy?: string;
708
+ /**
709
+ * The same denial's machine-readable half: `"policy_rule"` | `"headless"` |
710
+ * `"user"` | `"hook"`. Absent both when the row is not a denial and when the
711
+ * denial predates the field, so branch on it only after `deniedBy` has
712
+ * established there WAS one.
713
+ */
714
+ denialKind?: string;
672
715
  }
673
716
  interface UIComponentsConfig {
674
717
  enabled: boolean;
@@ -2547,4 +2590,4 @@ declare function isEmbeddedResource(value: unknown): value is {
2547
2590
  */
2548
2591
  declare function parseEmbeddedResource(value: unknown): EmbeddedResource | null;
2549
2592
 
2550
- 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 DesktopStreamPayload, type EffortRung, type EmbeddedResource, type FeedbackRequest, type FeedbackResponse, InMemoryStorage, type JobCreateResponse, type JobStatus, type JobSummary, LLMNotConfiguredError, type MemoryProviderErrorPayload, type MemoryRecallPayload, type MemoryRecord, type MemoryUpdatePayload, type Message, 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 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 ToolOutputMode, type ToolOutputStub, type ToolPermissionDeniedPayload, type ToolProgressPayload, ToolRegistry, type ToolResult, type ToolResultRequest, 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, isToolOutputStub, isVoiceLLMMode, isVoicePolishMode, mapSseToChat, parseEmbeddedResource, parseVoicePolishFrame, replayEvents, streamJobSSE, translateDelta };
2593
+ 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 DesktopStreamPayload, type EffortRung, type EmbeddedResource, type FeedbackRequest, type FeedbackResponse, InMemoryStorage, type JobCreateResponse, type JobStatus, type JobSummary, LLMNotConfiguredError, type MemoryProviderErrorPayload, type MemoryRecallPayload, type MemoryRecord, type MemoryUpdatePayload, type Message, 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 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 ToolOutputMode, type ToolOutputStub, type ToolPermissionDeniedPayload, 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, isToolOutputStub, isVoiceLLMMode, isVoicePolishMode, mapSseToChat, parseEmbeddedResource, parseVoicePolishFrame, replayEvents, streamJobSSE, translateDelta };
package/dist/index.d.ts CHANGED
@@ -660,15 +660,58 @@ interface Conversation {
660
660
  */
661
661
  repository?: string | null;
662
662
  }
663
+ /** One citation on a `web_search`-style tool row, as the clients parse it. */
664
+ interface ToolSource {
665
+ title: string;
666
+ url: string;
667
+ snippet?: string;
668
+ }
663
669
  interface Message {
664
670
  id: string;
665
671
  conversationId: string;
666
- role: "user" | "assistant" | "system";
672
+ /**
673
+ * `"tool"` is the role every tool-result row carries, and it was missing
674
+ * here — which is why those rows could not be typed at all.
675
+ *
676
+ * `"system"` is retained but DEAD: `MessageResponse.role` is
677
+ * `Literal["user", "assistant", "tool"]`, and the server skips system rows
678
+ * before responding, so it cannot occur. Narrowing the union would be a
679
+ * source-breaking change for anyone matching on it, so it is grouped with
680
+ * the other breaking cleanups for one deliberate major rather than
681
+ * dribbling a major out of an otherwise additive change.
682
+ */
683
+ role: "user" | "assistant" | "tool" | "system";
667
684
  content: string;
668
685
  parentId?: string;
669
686
  status: "sending" | "streaming" | "complete" | "error";
670
687
  createdAt: string;
671
688
  toolCalls?: ToolCallRequest[];
689
+ /**
690
+ * Result typing for a `role="tool"` row, joined server-side from the tool
691
+ * call's `block_stop.final`. These exist so history rendered from REST —
692
+ * older turns paged in on scroll, or the fallback when replay yields
693
+ * nothing — renders a settled tool row the way its replayed twin does,
694
+ * instead of as raw output under a generic label.
695
+ *
696
+ * All are `undefined` when no block stop matched, which degrades to the
697
+ * row's plain content.
698
+ */
699
+ sources?: ToolSource[];
700
+ durationMs?: number;
701
+ isError?: boolean;
702
+ /**
703
+ * Human-readable prose — a fixed phrase, or a policy rule's own free-text
704
+ * reason. PRESENCE, not value, is the denial signal: a denied tool reports
705
+ * `isError: false` and nothing else on the row distinguishes it.
706
+ */
707
+ deniedBy?: string;
708
+ /**
709
+ * The same denial's machine-readable half: `"policy_rule"` | `"headless"` |
710
+ * `"user"` | `"hook"`. Absent both when the row is not a denial and when the
711
+ * denial predates the field, so branch on it only after `deniedBy` has
712
+ * established there WAS one.
713
+ */
714
+ denialKind?: string;
672
715
  }
673
716
  interface UIComponentsConfig {
674
717
  enabled: boolean;
@@ -2547,4 +2590,4 @@ declare function isEmbeddedResource(value: unknown): value is {
2547
2590
  */
2548
2591
  declare function parseEmbeddedResource(value: unknown): EmbeddedResource | null;
2549
2592
 
2550
- 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 DesktopStreamPayload, type EffortRung, type EmbeddedResource, type FeedbackRequest, type FeedbackResponse, InMemoryStorage, type JobCreateResponse, type JobStatus, type JobSummary, LLMNotConfiguredError, type MemoryProviderErrorPayload, type MemoryRecallPayload, type MemoryRecord, type MemoryUpdatePayload, type Message, 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 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 ToolOutputMode, type ToolOutputStub, type ToolPermissionDeniedPayload, type ToolProgressPayload, ToolRegistry, type ToolResult, type ToolResultRequest, 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, isToolOutputStub, isVoiceLLMMode, isVoicePolishMode, mapSseToChat, parseEmbeddedResource, parseVoicePolishFrame, replayEvents, streamJobSSE, translateDelta };
2593
+ 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 DesktopStreamPayload, type EffortRung, type EmbeddedResource, type FeedbackRequest, type FeedbackResponse, InMemoryStorage, type JobCreateResponse, type JobStatus, type JobSummary, LLMNotConfiguredError, type MemoryProviderErrorPayload, type MemoryRecallPayload, type MemoryRecord, type MemoryUpdatePayload, type Message, 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 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 ToolOutputMode, type ToolOutputStub, type ToolPermissionDeniedPayload, 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, isToolOutputStub, isVoiceLLMMode, isVoicePolishMode, mapSseToChat, parseEmbeddedResource, parseVoicePolishFrame, replayEvents, streamJobSSE, translateDelta };
package/dist/index.js CHANGED
@@ -352,7 +352,31 @@ function toMessage(m) {
352
352
  content: m.content,
353
353
  parentId: m.parent_id,
354
354
  status: "complete",
355
- createdAt: m.created_at
355
+ createdAt: m.created_at,
356
+ // Server-joined result typing. `?? undefined` rather than `?? null` so an
357
+ // absent field and an explicit null both read as "the server said nothing",
358
+ // which is the one distinction a renderer actually makes here.
359
+ toolCalls: m.tool_calls?.map(toToolCallRequest) ?? void 0,
360
+ sources: m.sources?.map(toToolSource) ?? void 0,
361
+ durationMs: m.duration_ms ?? void 0,
362
+ isError: m.is_error ?? void 0,
363
+ deniedBy: m.denied_by ?? void 0,
364
+ denialKind: m.denial_kind ?? void 0
365
+ };
366
+ }
367
+ function toToolSource(s) {
368
+ return { title: s.title, url: s.url, snippet: s.snippet };
369
+ }
370
+ function toToolCallRequest(t) {
371
+ return {
372
+ callId: t.call_id,
373
+ toolName: t.tool_name,
374
+ displayName: t.display_name,
375
+ description: t.description,
376
+ arguments: t.arguments ?? {},
377
+ isClientTool: t.is_client_tool ?? false,
378
+ toolCategory: t.tool_category,
379
+ iconUrl: t.icon_url
356
380
  };
357
381
  }
358
382
  var AstralformClient = class {