@astralform/js 4.4.0 → 4.6.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
@@ -552,6 +552,12 @@ interface UIComponentsConfig {
552
552
  /** MIME type to match against embedded resources (e.g. "application/json+a2ui"). */
553
553
  mimeType: string | null;
554
554
  }
555
+ /** One capability the agent either has or does not, right now. */
556
+ interface AgentCapability {
557
+ /** Stable key, e.g. `"image"`, `"web"`, `"skills"`. */
558
+ key: string;
559
+ enabled: boolean;
560
+ }
555
561
  interface AgentStatus {
556
562
  isReady: boolean;
557
563
  llmConfigured: boolean;
@@ -559,6 +565,16 @@ interface AgentStatus {
559
565
  llmModel?: string;
560
566
  message: string;
561
567
  uiComponents: UIComponentsConfig;
568
+ /**
569
+ * What the agent can do right now, so a client can offer a capability only
570
+ * where it will actually work rather than failing on send.
571
+ *
572
+ * Empty when the backend does not report it (older servers) or when the agent
573
+ * is not ready — treat an ABSENT key as "not reported", never as disabled.
574
+ * Only capabilities with a real per-agent gate appear; always-on ones do not,
575
+ * because a constant tells a client nothing.
576
+ */
577
+ capabilities: AgentCapability[];
562
578
  }
563
579
  interface AgentInfo {
564
580
  name: string;
@@ -657,6 +673,7 @@ interface ChatStreamRequest {
657
673
  upload_ids?: string[];
658
674
  agent_name?: string;
659
675
  plan_mode?: boolean;
676
+ image_mode?: boolean;
660
677
  /**
661
678
  * Start a durable long-horizon goal for this run (goal mode). The backend mints
662
679
  * an agent_goal from this text and drives the run under a budget until the
@@ -748,6 +765,20 @@ interface SendOptions$1 extends ModelChoiceOptions {
748
765
  uploadIds?: string[];
749
766
  agentName?: string;
750
767
  planMode?: boolean;
768
+ /**
769
+ * Attach the image-generation tool to this turn.
770
+ *
771
+ * Off by default and per-message, because generating costs the developer real
772
+ * money at a third-party provider — the agent does not get to decide on its
773
+ * own that a picture would be nice. The tool is not attached at all unless
774
+ * this is set, so an agent with image generation configured still cannot
775
+ * generate one on an ordinary turn.
776
+ *
777
+ * Gate the affordance on `AgentStatus.capabilities` (Astralform ≥ 0.61.0) —
778
+ * an agent with no provider configured will simply have no tool to call.
779
+ * The `image_mode` field itself is accepted from Astralform ≥ 0.59.0.
780
+ */
781
+ imageMode?: boolean;
751
782
  /**
752
783
  * Start a durable long-horizon goal for this run (goal mode). The text becomes
753
784
  * the goal's objective; the backend keeps the agent working under a budget until
@@ -1404,4 +1435,4 @@ declare function isEmbeddedResource(value: unknown): value is {
1404
1435
  */
1405
1436
  declare function parseEmbeddedResource(value: unknown): EmbeddedResource | null;
1406
1437
 
1407
- export { type ActiveJob, type AgentIdentity, type AgentInfo, type AgentStatus, type AssetCreatedPayload, type AstralformApiKeyConfig, AstralformClient, type AstralformConfig, AstralformError, type AstralformUserTokenConfig, type AttachmentStagedPayload, AuthenticationError, type BlockDeltaPayload, CONVERSATION_PAGE_SIZE, 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 ModelChoiceOptions, type ModelOption, type MyToolGrantsPage, type PromptSuggestionPayload, type ProtocolAdapter, ProtocolRegistry, RateLimitError, type RateLimitErrorDetails, type RawSseEvent, type ReasoningEffort, 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 };
1438
+ 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 BlockDeltaPayload, CONVERSATION_PAGE_SIZE, 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 ModelChoiceOptions, type ModelOption, type MyToolGrantsPage, type PromptSuggestionPayload, type ProtocolAdapter, ProtocolRegistry, RateLimitError, type RateLimitErrorDetails, type RawSseEvent, type ReasoningEffort, 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
@@ -552,6 +552,12 @@ interface UIComponentsConfig {
552
552
  /** MIME type to match against embedded resources (e.g. "application/json+a2ui"). */
553
553
  mimeType: string | null;
554
554
  }
555
+ /** One capability the agent either has or does not, right now. */
556
+ interface AgentCapability {
557
+ /** Stable key, e.g. `"image"`, `"web"`, `"skills"`. */
558
+ key: string;
559
+ enabled: boolean;
560
+ }
555
561
  interface AgentStatus {
556
562
  isReady: boolean;
557
563
  llmConfigured: boolean;
@@ -559,6 +565,16 @@ interface AgentStatus {
559
565
  llmModel?: string;
560
566
  message: string;
561
567
  uiComponents: UIComponentsConfig;
568
+ /**
569
+ * What the agent can do right now, so a client can offer a capability only
570
+ * where it will actually work rather than failing on send.
571
+ *
572
+ * Empty when the backend does not report it (older servers) or when the agent
573
+ * is not ready — treat an ABSENT key as "not reported", never as disabled.
574
+ * Only capabilities with a real per-agent gate appear; always-on ones do not,
575
+ * because a constant tells a client nothing.
576
+ */
577
+ capabilities: AgentCapability[];
562
578
  }
563
579
  interface AgentInfo {
564
580
  name: string;
@@ -657,6 +673,7 @@ interface ChatStreamRequest {
657
673
  upload_ids?: string[];
658
674
  agent_name?: string;
659
675
  plan_mode?: boolean;
676
+ image_mode?: boolean;
660
677
  /**
661
678
  * Start a durable long-horizon goal for this run (goal mode). The backend mints
662
679
  * an agent_goal from this text and drives the run under a budget until the
@@ -748,6 +765,20 @@ interface SendOptions$1 extends ModelChoiceOptions {
748
765
  uploadIds?: string[];
749
766
  agentName?: string;
750
767
  planMode?: boolean;
768
+ /**
769
+ * Attach the image-generation tool to this turn.
770
+ *
771
+ * Off by default and per-message, because generating costs the developer real
772
+ * money at a third-party provider — the agent does not get to decide on its
773
+ * own that a picture would be nice. The tool is not attached at all unless
774
+ * this is set, so an agent with image generation configured still cannot
775
+ * generate one on an ordinary turn.
776
+ *
777
+ * Gate the affordance on `AgentStatus.capabilities` (Astralform ≥ 0.61.0) —
778
+ * an agent with no provider configured will simply have no tool to call.
779
+ * The `image_mode` field itself is accepted from Astralform ≥ 0.59.0.
780
+ */
781
+ imageMode?: boolean;
751
782
  /**
752
783
  * Start a durable long-horizon goal for this run (goal mode). The text becomes
753
784
  * the goal's objective; the backend keeps the agent working under a budget until
@@ -1404,4 +1435,4 @@ declare function isEmbeddedResource(value: unknown): value is {
1404
1435
  */
1405
1436
  declare function parseEmbeddedResource(value: unknown): EmbeddedResource | null;
1406
1437
 
1407
- export { type ActiveJob, type AgentIdentity, type AgentInfo, type AgentStatus, type AssetCreatedPayload, type AstralformApiKeyConfig, AstralformClient, type AstralformConfig, AstralformError, type AstralformUserTokenConfig, type AttachmentStagedPayload, AuthenticationError, type BlockDeltaPayload, CONVERSATION_PAGE_SIZE, 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 ModelChoiceOptions, type ModelOption, type MyToolGrantsPage, type PromptSuggestionPayload, type ProtocolAdapter, ProtocolRegistry, RateLimitError, type RateLimitErrorDetails, type RawSseEvent, type ReasoningEffort, 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 };
1438
+ 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 BlockDeltaPayload, CONVERSATION_PAGE_SIZE, 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 ModelChoiceOptions, type ModelOption, type MyToolGrantsPage, type PromptSuggestionPayload, type ProtocolAdapter, ProtocolRegistry, RateLimitError, type RateLimitErrorDetails, type RawSseEvent, type ReasoningEffort, 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.js CHANGED
@@ -491,6 +491,14 @@ var AstralformClient = class {
491
491
  llmProvider: raw.llm_provider,
492
492
  llmModel: raw.llm_model,
493
493
  message: raw.message,
494
+ // Defaults to [] rather than undefined so a caller can iterate without a
495
+ // guard, and so a server that predates the field behaves as "reports
496
+ // nothing" instead of throwing. Entries missing a key are dropped: a
497
+ // capability with no name cannot be matched against and would render as
498
+ // an unlabelled row.
499
+ capabilities: (raw.capabilities ?? []).flatMap(
500
+ (c) => typeof c?.key === "string" && c.key.length > 0 ? [{ key: c.key, enabled: Boolean(c.enabled) }] : []
501
+ ),
494
502
  uiComponents: {
495
503
  enabled: Boolean(ui.enabled),
496
504
  protocol: ui.protocol ?? null,
@@ -1392,6 +1400,7 @@ var ChatSession = class {
1392
1400
  upload_ids: options?.uploadIds,
1393
1401
  agent_name: options?.agentName,
1394
1402
  plan_mode: options?.planMode,
1403
+ image_mode: options?.imageMode,
1395
1404
  goal: options?.goal,
1396
1405
  // Per-request model choice (client-side model selection).
1397
1406
  provider: options?.provider,