@astralform/js 8.3.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/README.md +1 -0
- package/dist/index.cjs +56 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +98 -2
- package/dist/index.d.ts +98 -2
- package/dist/index.js +56 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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
|
-
|
|
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;
|
|
@@ -756,6 +799,43 @@ interface SkillInfo {
|
|
|
756
799
|
description: string;
|
|
757
800
|
isEnabled: boolean;
|
|
758
801
|
}
|
|
802
|
+
/**
|
|
803
|
+
* A slash command the active agent offers — the system commands (`/new`,
|
|
804
|
+
* `/goal`, `/plan`, …) followed by its enabled skills, from
|
|
805
|
+
* `GET /v1/skills/commands`.
|
|
806
|
+
*
|
|
807
|
+
* The backend builds this list once and every surface reads it, so the web
|
|
808
|
+
* composer's "/" menu and the Telegram bot's command menu cannot drift.
|
|
809
|
+
*/
|
|
810
|
+
interface SlashCommand {
|
|
811
|
+
/** What the user types after the slash, and what the backend parses. */
|
|
812
|
+
name: string;
|
|
813
|
+
/** Human-readable label for the menu row. May be empty. */
|
|
814
|
+
displayName: string;
|
|
815
|
+
/** One line describing what the command does. May be empty. */
|
|
816
|
+
description: string;
|
|
817
|
+
/**
|
|
818
|
+
* The argument shape a row shows after the name, e.g. `"[goal]"`. Empty
|
|
819
|
+
* when the command takes none — never undefined, so a renderer can
|
|
820
|
+
* concatenate it without a guard.
|
|
821
|
+
*/
|
|
822
|
+
argsHint: string;
|
|
823
|
+
/**
|
|
824
|
+
* Which surfaces can run this command (`"web"`, `"telegram"`).
|
|
825
|
+
*
|
|
826
|
+
* Always populated, whatever surface was asked for — a scoped list has
|
|
827
|
+
* already filtered on it, so every row there names at least the surface
|
|
828
|
+
* requested. It carries information only for `"all"`, where rows that
|
|
829
|
+
* cannot run everywhere sit next to rows that can. Empty rather than
|
|
830
|
+
* undefined for the same reason as `argsHint`.
|
|
831
|
+
*/
|
|
832
|
+
surfaces: string[];
|
|
833
|
+
}
|
|
834
|
+
/**
|
|
835
|
+
* Who will execute the commands {@link AstralformClient.listSkillCommands}
|
|
836
|
+
* returns. `"web"` is the server's default: what `POST /v1/jobs` runs itself.
|
|
837
|
+
*/
|
|
838
|
+
type SlashCommandSurface = "web" | "telegram" | "all";
|
|
759
839
|
interface JobCreateResponse {
|
|
760
840
|
job_id: string;
|
|
761
841
|
conversation_id: string;
|
|
@@ -1467,6 +1547,22 @@ declare class AstralformClient {
|
|
|
1467
1547
|
*/
|
|
1468
1548
|
getModels(): Promise<ModelOption[]>;
|
|
1469
1549
|
getSkills(): Promise<SkillInfo[]>;
|
|
1550
|
+
/**
|
|
1551
|
+
* List the slash commands the active agent offers — the system commands
|
|
1552
|
+
* followed by its enabled skills. Backs the composer's "/" menu.
|
|
1553
|
+
*
|
|
1554
|
+
* @param surface Who will execute them. Omit for the server's default,
|
|
1555
|
+
* `"web"`: what `POST /v1/jobs` runs itself. `"telegram"` returns the
|
|
1556
|
+
* bot's commands under Telegram-valid names; `"all"` returns every
|
|
1557
|
+
* command, including those the other surfaces filter out — `surfaces` is
|
|
1558
|
+
* set on every row either way, and is what tells them apart here.
|
|
1559
|
+
*
|
|
1560
|
+
* The default surface is not sent as a query parameter. The server already
|
|
1561
|
+
* defaults to `web`, so omitting it keeps the request byte-identical to
|
|
1562
|
+
* what clients that call the raw path send today — same reasoning as
|
|
1563
|
+
* {@link getConversationEvents}'s `toolOutputs`.
|
|
1564
|
+
*/
|
|
1565
|
+
listSkillCommands(surface?: SlashCommandSurface): Promise<SlashCommand[]>;
|
|
1470
1566
|
getConversationEvents(conversationId: string, jobId?: string, options?: {
|
|
1471
1567
|
toolOutputs?: ToolOutputMode;
|
|
1472
1568
|
}): Promise<ConversationEvent[]>;
|
|
@@ -2494,4 +2590,4 @@ declare function isEmbeddedResource(value: unknown): value is {
|
|
|
2494
2590
|
*/
|
|
2495
2591
|
declare function parseEmbeddedResource(value: unknown): EmbeddedResource | null;
|
|
2496
2592
|
|
|
2497
|
-
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, 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
|
-
|
|
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;
|
|
@@ -756,6 +799,43 @@ interface SkillInfo {
|
|
|
756
799
|
description: string;
|
|
757
800
|
isEnabled: boolean;
|
|
758
801
|
}
|
|
802
|
+
/**
|
|
803
|
+
* A slash command the active agent offers — the system commands (`/new`,
|
|
804
|
+
* `/goal`, `/plan`, …) followed by its enabled skills, from
|
|
805
|
+
* `GET /v1/skills/commands`.
|
|
806
|
+
*
|
|
807
|
+
* The backend builds this list once and every surface reads it, so the web
|
|
808
|
+
* composer's "/" menu and the Telegram bot's command menu cannot drift.
|
|
809
|
+
*/
|
|
810
|
+
interface SlashCommand {
|
|
811
|
+
/** What the user types after the slash, and what the backend parses. */
|
|
812
|
+
name: string;
|
|
813
|
+
/** Human-readable label for the menu row. May be empty. */
|
|
814
|
+
displayName: string;
|
|
815
|
+
/** One line describing what the command does. May be empty. */
|
|
816
|
+
description: string;
|
|
817
|
+
/**
|
|
818
|
+
* The argument shape a row shows after the name, e.g. `"[goal]"`. Empty
|
|
819
|
+
* when the command takes none — never undefined, so a renderer can
|
|
820
|
+
* concatenate it without a guard.
|
|
821
|
+
*/
|
|
822
|
+
argsHint: string;
|
|
823
|
+
/**
|
|
824
|
+
* Which surfaces can run this command (`"web"`, `"telegram"`).
|
|
825
|
+
*
|
|
826
|
+
* Always populated, whatever surface was asked for — a scoped list has
|
|
827
|
+
* already filtered on it, so every row there names at least the surface
|
|
828
|
+
* requested. It carries information only for `"all"`, where rows that
|
|
829
|
+
* cannot run everywhere sit next to rows that can. Empty rather than
|
|
830
|
+
* undefined for the same reason as `argsHint`.
|
|
831
|
+
*/
|
|
832
|
+
surfaces: string[];
|
|
833
|
+
}
|
|
834
|
+
/**
|
|
835
|
+
* Who will execute the commands {@link AstralformClient.listSkillCommands}
|
|
836
|
+
* returns. `"web"` is the server's default: what `POST /v1/jobs` runs itself.
|
|
837
|
+
*/
|
|
838
|
+
type SlashCommandSurface = "web" | "telegram" | "all";
|
|
759
839
|
interface JobCreateResponse {
|
|
760
840
|
job_id: string;
|
|
761
841
|
conversation_id: string;
|
|
@@ -1467,6 +1547,22 @@ declare class AstralformClient {
|
|
|
1467
1547
|
*/
|
|
1468
1548
|
getModels(): Promise<ModelOption[]>;
|
|
1469
1549
|
getSkills(): Promise<SkillInfo[]>;
|
|
1550
|
+
/**
|
|
1551
|
+
* List the slash commands the active agent offers — the system commands
|
|
1552
|
+
* followed by its enabled skills. Backs the composer's "/" menu.
|
|
1553
|
+
*
|
|
1554
|
+
* @param surface Who will execute them. Omit for the server's default,
|
|
1555
|
+
* `"web"`: what `POST /v1/jobs` runs itself. `"telegram"` returns the
|
|
1556
|
+
* bot's commands under Telegram-valid names; `"all"` returns every
|
|
1557
|
+
* command, including those the other surfaces filter out — `surfaces` is
|
|
1558
|
+
* set on every row either way, and is what tells them apart here.
|
|
1559
|
+
*
|
|
1560
|
+
* The default surface is not sent as a query parameter. The server already
|
|
1561
|
+
* defaults to `web`, so omitting it keeps the request byte-identical to
|
|
1562
|
+
* what clients that call the raw path send today — same reasoning as
|
|
1563
|
+
* {@link getConversationEvents}'s `toolOutputs`.
|
|
1564
|
+
*/
|
|
1565
|
+
listSkillCommands(surface?: SlashCommandSurface): Promise<SlashCommand[]>;
|
|
1470
1566
|
getConversationEvents(conversationId: string, jobId?: string, options?: {
|
|
1471
1567
|
toolOutputs?: ToolOutputMode;
|
|
1472
1568
|
}): Promise<ConversationEvent[]>;
|
|
@@ -2494,4 +2590,4 @@ declare function isEmbeddedResource(value: unknown): value is {
|
|
|
2494
2590
|
*/
|
|
2495
2591
|
declare function parseEmbeddedResource(value: unknown): EmbeddedResource | null;
|
|
2496
2592
|
|
|
2497
|
-
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, 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 {
|
|
@@ -803,6 +827,37 @@ var AstralformClient = class {
|
|
|
803
827
|
const raw = await this.get("/v1/skills");
|
|
804
828
|
return raw.map((s) => camelizeKeys(s));
|
|
805
829
|
}
|
|
830
|
+
/**
|
|
831
|
+
* List the slash commands the active agent offers — the system commands
|
|
832
|
+
* followed by its enabled skills. Backs the composer's "/" menu.
|
|
833
|
+
*
|
|
834
|
+
* @param surface Who will execute them. Omit for the server's default,
|
|
835
|
+
* `"web"`: what `POST /v1/jobs` runs itself. `"telegram"` returns the
|
|
836
|
+
* bot's commands under Telegram-valid names; `"all"` returns every
|
|
837
|
+
* command, including those the other surfaces filter out — `surfaces` is
|
|
838
|
+
* set on every row either way, and is what tells them apart here.
|
|
839
|
+
*
|
|
840
|
+
* The default surface is not sent as a query parameter. The server already
|
|
841
|
+
* defaults to `web`, so omitting it keeps the request byte-identical to
|
|
842
|
+
* what clients that call the raw path send today — same reasoning as
|
|
843
|
+
* {@link getConversationEvents}'s `toolOutputs`.
|
|
844
|
+
*/
|
|
845
|
+
async listSkillCommands(surface) {
|
|
846
|
+
const query = surface && surface !== "web" ? `?surface=${surface}` : "";
|
|
847
|
+
const raw = await this.get(
|
|
848
|
+
`/v1/skills/commands${query}`
|
|
849
|
+
);
|
|
850
|
+
return raw.map((c) => {
|
|
851
|
+
const command = camelizeKeys(c);
|
|
852
|
+
return {
|
|
853
|
+
...command,
|
|
854
|
+
displayName: command.displayName ?? "",
|
|
855
|
+
description: command.description ?? "",
|
|
856
|
+
argsHint: command.argsHint ?? "",
|
|
857
|
+
surfaces: command.surfaces ?? []
|
|
858
|
+
};
|
|
859
|
+
});
|
|
860
|
+
}
|
|
806
861
|
async getConversationEvents(conversationId, jobId, options) {
|
|
807
862
|
const params = new URLSearchParams();
|
|
808
863
|
if (jobId) params.set("job_id", jobId);
|