@astralform/js 9.2.0 → 9.4.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.cjs +134 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +170 -1
- package/dist/index.d.ts +170 -1
- package/dist/index.js +133 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -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;
|
|
@@ -1207,6 +1243,50 @@ interface ToolOutputStub {
|
|
|
1207
1243
|
declare function isToolOutputStub(value: unknown): value is ToolOutputStub;
|
|
1208
1244
|
/** How a restore asks for tool outputs. */
|
|
1209
1245
|
type ToolOutputMode = "inline" | "stub";
|
|
1246
|
+
/**
|
|
1247
|
+
* A tool's image preview the server declined to inline, with a handle to fetch it.
|
|
1248
|
+
*
|
|
1249
|
+
* Restore can ask for these with `toolImages: "stub"`. It replaces an entry of a
|
|
1250
|
+
* `tool_use` final's `images` — and only that entry's `url`: `mime_type`,
|
|
1251
|
+
* `width`, `height` and `bytes` survive, so a consumer can reserve the image's
|
|
1252
|
+
* box before the bytes arrive and the transcript does not jump when they do.
|
|
1253
|
+
* Resolve it with `client.getToolImage`.
|
|
1254
|
+
*
|
|
1255
|
+
* Previews are exempt from `toolOutputs: "stub"`, which is why this is its own
|
|
1256
|
+
* opt-in: they are hoisted out of `output` precisely so a stubbed pill keeps its
|
|
1257
|
+
* thumbnail, and on a picture-heavy conversation they were three quarters of
|
|
1258
|
+
* the bytes a restore shipped before first render.
|
|
1259
|
+
*/
|
|
1260
|
+
interface ToolImageStub {
|
|
1261
|
+
__stub: "tool_image";
|
|
1262
|
+
call_id: string;
|
|
1263
|
+
/** The entry's position in its call's `images` — what the fetch reads. */
|
|
1264
|
+
index: number;
|
|
1265
|
+
/**
|
|
1266
|
+
* The job this call belongs to. The same rule as `ToolOutputStub.job_id`:
|
|
1267
|
+
* a version-switched read returns superseded jobs the unscoped fetch cannot
|
|
1268
|
+
* see. `getToolImage` takes the whole stub so it cannot be dropped.
|
|
1269
|
+
*/
|
|
1270
|
+
job_id?: string;
|
|
1271
|
+
mime_type?: string;
|
|
1272
|
+
/** Pixel size of the preview, for reserving its box. */
|
|
1273
|
+
width?: number;
|
|
1274
|
+
height?: number;
|
|
1275
|
+
/** Encoded size of the preview. */
|
|
1276
|
+
bytes?: number;
|
|
1277
|
+
}
|
|
1278
|
+
/**
|
|
1279
|
+
* Is this `images` entry a stub to fetch rather than a preview with a `url`?
|
|
1280
|
+
*
|
|
1281
|
+
* Checks every field the fetch is built from — `call_id` AND `index` — for the
|
|
1282
|
+
* reason `isToolOutputStub` gives: narrowing on the marker alone hands a caller
|
|
1283
|
+
* fields the type promises but the value lacks, and the next line puts them in
|
|
1284
|
+
* a URL. The display fields are hints and are not required, so a stub missing
|
|
1285
|
+
* its dimensions still resolves; it just cannot reserve its box.
|
|
1286
|
+
*/
|
|
1287
|
+
declare function isToolImageStub(value: unknown): value is ToolImageStub;
|
|
1288
|
+
/** How a restore asks for tool image previews. */
|
|
1289
|
+
type ToolImageMode = "inline" | "stub";
|
|
1210
1290
|
interface ConversationEvent {
|
|
1211
1291
|
seq: number;
|
|
1212
1292
|
event: string;
|
|
@@ -1521,6 +1601,8 @@ declare class AstralformClient {
|
|
|
1521
1601
|
*/
|
|
1522
1602
|
private getWithHeaders;
|
|
1523
1603
|
get<T>(path: string): Promise<T>;
|
|
1604
|
+
/** A GET whose body is binary. Read inside the race, for the reason above. */
|
|
1605
|
+
private getBlob;
|
|
1524
1606
|
post<T>(path: string, body: unknown): Promise<T>;
|
|
1525
1607
|
patch<T>(path: string, body: unknown): Promise<T>;
|
|
1526
1608
|
private del;
|
|
@@ -1619,6 +1701,7 @@ declare class AstralformClient {
|
|
|
1619
1701
|
listSkillCommands(surface?: SlashCommandSurface): Promise<SlashCommand[]>;
|
|
1620
1702
|
getConversationEvents(conversationId: string, jobId?: string, options?: {
|
|
1621
1703
|
toolOutputs?: ToolOutputMode;
|
|
1704
|
+
toolImages?: ToolImageMode;
|
|
1622
1705
|
}): Promise<ConversationEvent[]>;
|
|
1623
1706
|
/**
|
|
1624
1707
|
* The full output behind a {@link ToolOutputStub}.
|
|
@@ -1640,6 +1723,20 @@ declare class AstralformClient {
|
|
|
1640
1723
|
* Prefer the overload above, which takes the stub and cannot be got wrong.
|
|
1641
1724
|
*/
|
|
1642
1725
|
getToolOutput(conversationId: string, callId: string, jobId?: string): Promise<unknown>;
|
|
1726
|
+
/**
|
|
1727
|
+
* The image behind a {@link ToolImageStub}, as a `Blob` of the preview's bytes.
|
|
1728
|
+
*
|
|
1729
|
+
* Takes the stub itself and nothing else — the `job_id` scoping that
|
|
1730
|
+
* `getToolOutput`'s id form warns about cannot be dropped from a value that
|
|
1731
|
+
* carries it. There is deliberately no by-ids form.
|
|
1732
|
+
*
|
|
1733
|
+
* A `Blob` rather than a URL because the route is authenticated: an `<img
|
|
1734
|
+
* src>` cannot send the bearer token, so a browser consumer turns this into
|
|
1735
|
+
* an object URL (`URL.createObjectURL`) and revokes it when the image
|
|
1736
|
+
* unmounts. The response is `private, immutable`, so a repeat fetch of the
|
|
1737
|
+
* same preview is served by the HTTP cache.
|
|
1738
|
+
*/
|
|
1739
|
+
getToolImage(conversationId: string, stub: ToolImageStub): Promise<Blob>;
|
|
1643
1740
|
submitToolResult(request: ToolResultRequest): Promise<void>;
|
|
1644
1741
|
submitToolApproval(request: ToolApprovalRequest): Promise<void>;
|
|
1645
1742
|
/**
|
|
@@ -1729,6 +1826,57 @@ declare class AstralformClient {
|
|
|
1729
1826
|
*/
|
|
1730
1827
|
remove: (owner: string, repo: string) => Promise<void>;
|
|
1731
1828
|
};
|
|
1829
|
+
/**
|
|
1830
|
+
* Code groups: a user-named container under one repository, for a feature
|
|
1831
|
+
* whose work outlives a single session. Its sessions share one plan and one
|
|
1832
|
+
* set of notes, so what one writes the others read.
|
|
1833
|
+
*
|
|
1834
|
+
* A group is a LABEL, not a binding — unlike a task's project, which is
|
|
1835
|
+
* written once on the first turn. A task may join, move between, or leave
|
|
1836
|
+
* groups at any time, and a deleted group's sessions survive as ungrouped.
|
|
1837
|
+
*
|
|
1838
|
+
* The server enforces three things worth knowing before you render a
|
|
1839
|
+
* failure: a group that is not this user's answers `404` (never `403`, so a
|
|
1840
|
+
* group id cannot be probed); filing a task into a group under a DIFFERENT
|
|
1841
|
+
* repository than the task's answers `409`; and the group's plan and notes
|
|
1842
|
+
* are deleted with the group, while each session keeps its own.
|
|
1843
|
+
*/
|
|
1844
|
+
groups: {
|
|
1845
|
+
/**
|
|
1846
|
+
* This user's groups, oldest first. Pass a repository to narrow to one
|
|
1847
|
+
* repository's — the composer's picker does; the sidebar asks once and
|
|
1848
|
+
* nests them itself.
|
|
1849
|
+
*/
|
|
1850
|
+
list: (repository?: string) => Promise<ConversationGroup[]>;
|
|
1851
|
+
/**
|
|
1852
|
+
* Create a group under a repository. The repository goes through the same
|
|
1853
|
+
* normaliser the Projects surface uses, so a pasted GitHub URL is accepted
|
|
1854
|
+
* and anything that is not `owner/repo` is refused.
|
|
1855
|
+
*/
|
|
1856
|
+
create: (repository: string, title: string) => Promise<ConversationGroup>;
|
|
1857
|
+
/** Rename a group. A group that is not this user's answers `404`. */
|
|
1858
|
+
rename: (groupId: string, title: string) => Promise<ConversationGroup>;
|
|
1859
|
+
/**
|
|
1860
|
+
* Delete a group. Its tasks survive and become ungrouped, each keeping its
|
|
1861
|
+
* own plan and notes; the group's SHARED documents are deleted with it.
|
|
1862
|
+
*/
|
|
1863
|
+
remove: (groupId: string) => Promise<void>;
|
|
1864
|
+
/**
|
|
1865
|
+
* File a task into a group. Idempotent — filing an already-filed task
|
|
1866
|
+
* again is the same state, not an error. Refused with `409` when the task
|
|
1867
|
+
* belongs to a different repository than the group, because it would
|
|
1868
|
+
* render nowhere in the sidebar.
|
|
1869
|
+
*/
|
|
1870
|
+
assign: (groupId: string, conversationId: string) => Promise<CodeGroupMembership>;
|
|
1871
|
+
/**
|
|
1872
|
+
* Take a task out of its group. The task and its documents are untouched.
|
|
1873
|
+
*
|
|
1874
|
+
* Deliberately not strict about WHICH group the task is in: a task that is
|
|
1875
|
+
* in a different one (or in none) already satisfies "this task should not
|
|
1876
|
+
* be grouped", so the call clears it rather than refusing.
|
|
1877
|
+
*/
|
|
1878
|
+
unassign: (groupId: string, conversationId: string) => Promise<void>;
|
|
1879
|
+
};
|
|
1732
1880
|
};
|
|
1733
1881
|
createJob(request: ChatStreamRequest): Promise<JobCreateResponse>;
|
|
1734
1882
|
streamJobEvents(jobId: string, afterSeq?: number, signal?: AbortSignal): AsyncGenerator<ChatStreamEvent>;
|
|
@@ -2368,6 +2516,12 @@ declare class StreamManager {
|
|
|
2368
2516
|
* Defaults to inline, so this is inert until a consumer opts in.
|
|
2369
2517
|
*/
|
|
2370
2518
|
private toolOutputs;
|
|
2519
|
+
/**
|
|
2520
|
+
* Whether restore asks for tool image previews inline or as fetch handles.
|
|
2521
|
+
* Separate from `toolOutputs` because the server keeps them separate — see
|
|
2522
|
+
* `ToolImageStub` — and on the same one-setting-both-waves rule.
|
|
2523
|
+
*/
|
|
2524
|
+
private toolImages;
|
|
2371
2525
|
private _state;
|
|
2372
2526
|
private _activeConversationId;
|
|
2373
2527
|
private _backgroundJobs;
|
|
@@ -2407,6 +2561,21 @@ declare class StreamManager {
|
|
|
2407
2561
|
* belongs, because that is what arrives in `final.output`.
|
|
2408
2562
|
*/
|
|
2409
2563
|
setToolOutputMode(mode: ToolOutputMode): void;
|
|
2564
|
+
/**
|
|
2565
|
+
* Ask restore for stubbed image previews, fetched on demand.
|
|
2566
|
+
*
|
|
2567
|
+
* The same caution as `setToolOutputMode`, sharper: a consumer that cannot
|
|
2568
|
+
* resolve one (`isToolImageStub`, `client.getToolImage`) finds an `images`
|
|
2569
|
+
* entry with no `url` and draws a broken image where the preview was.
|
|
2570
|
+
*/
|
|
2571
|
+
setToolImageMode(mode: ToolImageMode): void;
|
|
2572
|
+
/**
|
|
2573
|
+
* The ONE options object both event waves fetch with — the newest page and
|
|
2574
|
+
* every `loadEarlierTurns` page. Built in one place so an opt-in added here
|
|
2575
|
+
* reaches both by construction: two literals at two call sites is how one
|
|
2576
|
+
* wave would silently keep asking for inline payloads.
|
|
2577
|
+
*/
|
|
2578
|
+
private get eventFetchOptions();
|
|
2410
2579
|
private emit;
|
|
2411
2580
|
private setState;
|
|
2412
2581
|
private attach;
|
|
@@ -2684,4 +2853,4 @@ declare function isEmbeddedResource(value: unknown): value is {
|
|
|
2684
2853
|
*/
|
|
2685
2854
|
declare function parseEmbeddedResource(value: unknown): EmbeddedResource | null;
|
|
2686
2855
|
|
|
2687
|
-
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 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, isToolOutputStub, isVoiceLLMMode, isVoicePolishMode, mapSseToChat, parseEmbeddedResource, parseVoicePolishFrame, replayEvents, streamJobSSE, translateDelta };
|
|
2856
|
+
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
|
@@ -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;
|
|
@@ -1207,6 +1243,50 @@ interface ToolOutputStub {
|
|
|
1207
1243
|
declare function isToolOutputStub(value: unknown): value is ToolOutputStub;
|
|
1208
1244
|
/** How a restore asks for tool outputs. */
|
|
1209
1245
|
type ToolOutputMode = "inline" | "stub";
|
|
1246
|
+
/**
|
|
1247
|
+
* A tool's image preview the server declined to inline, with a handle to fetch it.
|
|
1248
|
+
*
|
|
1249
|
+
* Restore can ask for these with `toolImages: "stub"`. It replaces an entry of a
|
|
1250
|
+
* `tool_use` final's `images` — and only that entry's `url`: `mime_type`,
|
|
1251
|
+
* `width`, `height` and `bytes` survive, so a consumer can reserve the image's
|
|
1252
|
+
* box before the bytes arrive and the transcript does not jump when they do.
|
|
1253
|
+
* Resolve it with `client.getToolImage`.
|
|
1254
|
+
*
|
|
1255
|
+
* Previews are exempt from `toolOutputs: "stub"`, which is why this is its own
|
|
1256
|
+
* opt-in: they are hoisted out of `output` precisely so a stubbed pill keeps its
|
|
1257
|
+
* thumbnail, and on a picture-heavy conversation they were three quarters of
|
|
1258
|
+
* the bytes a restore shipped before first render.
|
|
1259
|
+
*/
|
|
1260
|
+
interface ToolImageStub {
|
|
1261
|
+
__stub: "tool_image";
|
|
1262
|
+
call_id: string;
|
|
1263
|
+
/** The entry's position in its call's `images` — what the fetch reads. */
|
|
1264
|
+
index: number;
|
|
1265
|
+
/**
|
|
1266
|
+
* The job this call belongs to. The same rule as `ToolOutputStub.job_id`:
|
|
1267
|
+
* a version-switched read returns superseded jobs the unscoped fetch cannot
|
|
1268
|
+
* see. `getToolImage` takes the whole stub so it cannot be dropped.
|
|
1269
|
+
*/
|
|
1270
|
+
job_id?: string;
|
|
1271
|
+
mime_type?: string;
|
|
1272
|
+
/** Pixel size of the preview, for reserving its box. */
|
|
1273
|
+
width?: number;
|
|
1274
|
+
height?: number;
|
|
1275
|
+
/** Encoded size of the preview. */
|
|
1276
|
+
bytes?: number;
|
|
1277
|
+
}
|
|
1278
|
+
/**
|
|
1279
|
+
* Is this `images` entry a stub to fetch rather than a preview with a `url`?
|
|
1280
|
+
*
|
|
1281
|
+
* Checks every field the fetch is built from — `call_id` AND `index` — for the
|
|
1282
|
+
* reason `isToolOutputStub` gives: narrowing on the marker alone hands a caller
|
|
1283
|
+
* fields the type promises but the value lacks, and the next line puts them in
|
|
1284
|
+
* a URL. The display fields are hints and are not required, so a stub missing
|
|
1285
|
+
* its dimensions still resolves; it just cannot reserve its box.
|
|
1286
|
+
*/
|
|
1287
|
+
declare function isToolImageStub(value: unknown): value is ToolImageStub;
|
|
1288
|
+
/** How a restore asks for tool image previews. */
|
|
1289
|
+
type ToolImageMode = "inline" | "stub";
|
|
1210
1290
|
interface ConversationEvent {
|
|
1211
1291
|
seq: number;
|
|
1212
1292
|
event: string;
|
|
@@ -1521,6 +1601,8 @@ declare class AstralformClient {
|
|
|
1521
1601
|
*/
|
|
1522
1602
|
private getWithHeaders;
|
|
1523
1603
|
get<T>(path: string): Promise<T>;
|
|
1604
|
+
/** A GET whose body is binary. Read inside the race, for the reason above. */
|
|
1605
|
+
private getBlob;
|
|
1524
1606
|
post<T>(path: string, body: unknown): Promise<T>;
|
|
1525
1607
|
patch<T>(path: string, body: unknown): Promise<T>;
|
|
1526
1608
|
private del;
|
|
@@ -1619,6 +1701,7 @@ declare class AstralformClient {
|
|
|
1619
1701
|
listSkillCommands(surface?: SlashCommandSurface): Promise<SlashCommand[]>;
|
|
1620
1702
|
getConversationEvents(conversationId: string, jobId?: string, options?: {
|
|
1621
1703
|
toolOutputs?: ToolOutputMode;
|
|
1704
|
+
toolImages?: ToolImageMode;
|
|
1622
1705
|
}): Promise<ConversationEvent[]>;
|
|
1623
1706
|
/**
|
|
1624
1707
|
* The full output behind a {@link ToolOutputStub}.
|
|
@@ -1640,6 +1723,20 @@ declare class AstralformClient {
|
|
|
1640
1723
|
* Prefer the overload above, which takes the stub and cannot be got wrong.
|
|
1641
1724
|
*/
|
|
1642
1725
|
getToolOutput(conversationId: string, callId: string, jobId?: string): Promise<unknown>;
|
|
1726
|
+
/**
|
|
1727
|
+
* The image behind a {@link ToolImageStub}, as a `Blob` of the preview's bytes.
|
|
1728
|
+
*
|
|
1729
|
+
* Takes the stub itself and nothing else — the `job_id` scoping that
|
|
1730
|
+
* `getToolOutput`'s id form warns about cannot be dropped from a value that
|
|
1731
|
+
* carries it. There is deliberately no by-ids form.
|
|
1732
|
+
*
|
|
1733
|
+
* A `Blob` rather than a URL because the route is authenticated: an `<img
|
|
1734
|
+
* src>` cannot send the bearer token, so a browser consumer turns this into
|
|
1735
|
+
* an object URL (`URL.createObjectURL`) and revokes it when the image
|
|
1736
|
+
* unmounts. The response is `private, immutable`, so a repeat fetch of the
|
|
1737
|
+
* same preview is served by the HTTP cache.
|
|
1738
|
+
*/
|
|
1739
|
+
getToolImage(conversationId: string, stub: ToolImageStub): Promise<Blob>;
|
|
1643
1740
|
submitToolResult(request: ToolResultRequest): Promise<void>;
|
|
1644
1741
|
submitToolApproval(request: ToolApprovalRequest): Promise<void>;
|
|
1645
1742
|
/**
|
|
@@ -1729,6 +1826,57 @@ declare class AstralformClient {
|
|
|
1729
1826
|
*/
|
|
1730
1827
|
remove: (owner: string, repo: string) => Promise<void>;
|
|
1731
1828
|
};
|
|
1829
|
+
/**
|
|
1830
|
+
* Code groups: a user-named container under one repository, for a feature
|
|
1831
|
+
* whose work outlives a single session. Its sessions share one plan and one
|
|
1832
|
+
* set of notes, so what one writes the others read.
|
|
1833
|
+
*
|
|
1834
|
+
* A group is a LABEL, not a binding — unlike a task's project, which is
|
|
1835
|
+
* written once on the first turn. A task may join, move between, or leave
|
|
1836
|
+
* groups at any time, and a deleted group's sessions survive as ungrouped.
|
|
1837
|
+
*
|
|
1838
|
+
* The server enforces three things worth knowing before you render a
|
|
1839
|
+
* failure: a group that is not this user's answers `404` (never `403`, so a
|
|
1840
|
+
* group id cannot be probed); filing a task into a group under a DIFFERENT
|
|
1841
|
+
* repository than the task's answers `409`; and the group's plan and notes
|
|
1842
|
+
* are deleted with the group, while each session keeps its own.
|
|
1843
|
+
*/
|
|
1844
|
+
groups: {
|
|
1845
|
+
/**
|
|
1846
|
+
* This user's groups, oldest first. Pass a repository to narrow to one
|
|
1847
|
+
* repository's — the composer's picker does; the sidebar asks once and
|
|
1848
|
+
* nests them itself.
|
|
1849
|
+
*/
|
|
1850
|
+
list: (repository?: string) => Promise<ConversationGroup[]>;
|
|
1851
|
+
/**
|
|
1852
|
+
* Create a group under a repository. The repository goes through the same
|
|
1853
|
+
* normaliser the Projects surface uses, so a pasted GitHub URL is accepted
|
|
1854
|
+
* and anything that is not `owner/repo` is refused.
|
|
1855
|
+
*/
|
|
1856
|
+
create: (repository: string, title: string) => Promise<ConversationGroup>;
|
|
1857
|
+
/** Rename a group. A group that is not this user's answers `404`. */
|
|
1858
|
+
rename: (groupId: string, title: string) => Promise<ConversationGroup>;
|
|
1859
|
+
/**
|
|
1860
|
+
* Delete a group. Its tasks survive and become ungrouped, each keeping its
|
|
1861
|
+
* own plan and notes; the group's SHARED documents are deleted with it.
|
|
1862
|
+
*/
|
|
1863
|
+
remove: (groupId: string) => Promise<void>;
|
|
1864
|
+
/**
|
|
1865
|
+
* File a task into a group. Idempotent — filing an already-filed task
|
|
1866
|
+
* again is the same state, not an error. Refused with `409` when the task
|
|
1867
|
+
* belongs to a different repository than the group, because it would
|
|
1868
|
+
* render nowhere in the sidebar.
|
|
1869
|
+
*/
|
|
1870
|
+
assign: (groupId: string, conversationId: string) => Promise<CodeGroupMembership>;
|
|
1871
|
+
/**
|
|
1872
|
+
* Take a task out of its group. The task and its documents are untouched.
|
|
1873
|
+
*
|
|
1874
|
+
* Deliberately not strict about WHICH group the task is in: a task that is
|
|
1875
|
+
* in a different one (or in none) already satisfies "this task should not
|
|
1876
|
+
* be grouped", so the call clears it rather than refusing.
|
|
1877
|
+
*/
|
|
1878
|
+
unassign: (groupId: string, conversationId: string) => Promise<void>;
|
|
1879
|
+
};
|
|
1732
1880
|
};
|
|
1733
1881
|
createJob(request: ChatStreamRequest): Promise<JobCreateResponse>;
|
|
1734
1882
|
streamJobEvents(jobId: string, afterSeq?: number, signal?: AbortSignal): AsyncGenerator<ChatStreamEvent>;
|
|
@@ -2368,6 +2516,12 @@ declare class StreamManager {
|
|
|
2368
2516
|
* Defaults to inline, so this is inert until a consumer opts in.
|
|
2369
2517
|
*/
|
|
2370
2518
|
private toolOutputs;
|
|
2519
|
+
/**
|
|
2520
|
+
* Whether restore asks for tool image previews inline or as fetch handles.
|
|
2521
|
+
* Separate from `toolOutputs` because the server keeps them separate — see
|
|
2522
|
+
* `ToolImageStub` — and on the same one-setting-both-waves rule.
|
|
2523
|
+
*/
|
|
2524
|
+
private toolImages;
|
|
2371
2525
|
private _state;
|
|
2372
2526
|
private _activeConversationId;
|
|
2373
2527
|
private _backgroundJobs;
|
|
@@ -2407,6 +2561,21 @@ declare class StreamManager {
|
|
|
2407
2561
|
* belongs, because that is what arrives in `final.output`.
|
|
2408
2562
|
*/
|
|
2409
2563
|
setToolOutputMode(mode: ToolOutputMode): void;
|
|
2564
|
+
/**
|
|
2565
|
+
* Ask restore for stubbed image previews, fetched on demand.
|
|
2566
|
+
*
|
|
2567
|
+
* The same caution as `setToolOutputMode`, sharper: a consumer that cannot
|
|
2568
|
+
* resolve one (`isToolImageStub`, `client.getToolImage`) finds an `images`
|
|
2569
|
+
* entry with no `url` and draws a broken image where the preview was.
|
|
2570
|
+
*/
|
|
2571
|
+
setToolImageMode(mode: ToolImageMode): void;
|
|
2572
|
+
/**
|
|
2573
|
+
* The ONE options object both event waves fetch with — the newest page and
|
|
2574
|
+
* every `loadEarlierTurns` page. Built in one place so an opt-in added here
|
|
2575
|
+
* reaches both by construction: two literals at two call sites is how one
|
|
2576
|
+
* wave would silently keep asking for inline payloads.
|
|
2577
|
+
*/
|
|
2578
|
+
private get eventFetchOptions();
|
|
2410
2579
|
private emit;
|
|
2411
2580
|
private setState;
|
|
2412
2581
|
private attach;
|
|
@@ -2684,4 +2853,4 @@ declare function isEmbeddedResource(value: unknown): value is {
|
|
|
2684
2853
|
*/
|
|
2685
2854
|
declare function parseEmbeddedResource(value: unknown): EmbeddedResource | null;
|
|
2686
2855
|
|
|
2687
|
-
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 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, isToolOutputStub, isVoiceLLMMode, isVoicePolishMode, mapSseToChat, parseEmbeddedResource, parseVoicePolishFrame, replayEvents, streamJobSSE, translateDelta };
|
|
2856
|
+
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 };
|