@finalai/agents 0.8.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.
Potentially problematic release.
This version of @finalai/agents might be problematic. Click here for more details.
- package/README.md +30 -0
- package/dist/modules/agent-client/acp-frames.d.mts +19 -0
- package/dist/modules/agent-client/acp-frames.mjs +49 -0
- package/dist/modules/agent-client/acp-frames.mjs.map +7 -0
- package/dist/modules/agent-client/acp.d.mts +43 -0
- package/dist/modules/agent-client/acp.mjs +76 -0
- package/dist/modules/agent-client/acp.mjs.map +7 -0
- package/dist/modules/agent-client/async-queue.d.mts +10 -0
- package/dist/modules/agent-client/async-queue.mjs +66 -0
- package/dist/modules/agent-client/async-queue.mjs.map +7 -0
- package/dist/modules/agent-client/build.d.mts +107 -0
- package/dist/modules/agent-client/build.mjs +222 -0
- package/dist/modules/agent-client/build.mjs.map +7 -0
- package/dist/modules/agent-client/client.d.mts +111 -0
- package/dist/modules/agent-client/client.mjs +198 -0
- package/dist/modules/agent-client/client.mjs.map +7 -0
- package/dist/modules/agent-client/collection-events.d.mts +35 -0
- package/dist/modules/agent-client/collection-events.mjs +142 -0
- package/dist/modules/agent-client/collection-events.mjs.map +7 -0
- package/dist/modules/agent-client/config-options.d.mts +24 -0
- package/dist/modules/agent-client/config-options.mjs +49 -0
- package/dist/modules/agent-client/config-options.mjs.map +7 -0
- package/dist/modules/agent-client/context.d.mts +31 -0
- package/dist/modules/agent-client/context.mjs +11 -0
- package/dist/modules/agent-client/context.mjs.map +7 -0
- package/dist/modules/agent-client/conversations.d.mts +385 -0
- package/dist/modules/agent-client/conversations.mjs +1156 -0
- package/dist/modules/agent-client/conversations.mjs.map +7 -0
- package/dist/modules/agent-client/errors.d.mts +85 -0
- package/dist/modules/agent-client/errors.mjs +94 -0
- package/dist/modules/agent-client/errors.mjs.map +7 -0
- package/dist/modules/agent-client/event-stream.d.mts +14 -0
- package/dist/modules/agent-client/event-stream.mjs +89 -0
- package/dist/modules/agent-client/event-stream.mjs.map +7 -0
- package/dist/modules/agent-client/frame-stream.d.mts +51 -0
- package/dist/modules/agent-client/frame-stream.mjs +333 -0
- package/dist/modules/agent-client/frame-stream.mjs.map +7 -0
- package/dist/modules/agent-client/http.d.mts +68 -0
- package/dist/modules/agent-client/http.mjs +168 -0
- package/dist/modules/agent-client/http.mjs.map +7 -0
- package/dist/modules/agent-client/index.d.mts +17 -0
- package/dist/modules/agent-client/index.mjs +86 -0
- package/dist/modules/agent-client/index.mjs.map +7 -0
- package/dist/modules/agent-client/live-stream.d.mts +18 -0
- package/dist/modules/agent-client/live-stream.mjs +94 -0
- package/dist/modules/agent-client/live-stream.mjs.map +7 -0
- package/dist/modules/agent-client/realtime.d.mts +72 -0
- package/dist/modules/agent-client/realtime.mjs +186 -0
- package/dist/modules/agent-client/realtime.mjs.map +7 -0
- package/dist/modules/agent-client/sandbox-uri.d.mts +19 -0
- package/dist/modules/agent-client/sandbox-uri.mjs +43 -0
- package/dist/modules/agent-client/sandbox-uri.mjs.map +7 -0
- package/dist/modules/agent-client/sessions.d.mts +124 -0
- package/dist/modules/agent-client/sessions.mjs +350 -0
- package/dist/modules/agent-client/sessions.mjs.map +7 -0
- package/dist/modules/agent-client/test-fakes.d.mts +40 -0
- package/dist/modules/agent-client/test-fakes.mjs +94 -0
- package/dist/modules/agent-client/test-fakes.mjs.map +7 -0
- package/dist/modules/authoring/approval.d.mts +1 -0
- package/dist/modules/authoring/approval.mjs +2 -0
- package/dist/modules/authoring/approval.mjs.map +7 -0
- package/dist/modules/authoring/channels.d.mts +1 -0
- package/dist/modules/authoring/channels.mjs +2 -0
- package/dist/modules/authoring/channels.mjs.map +7 -0
- package/dist/modules/authoring/final-channel.d.mts +1 -0
- package/dist/modules/authoring/final-channel.mjs +2 -0
- package/dist/modules/authoring/final-channel.mjs.map +7 -0
- package/dist/modules/authoring/hooks.d.mts +1 -0
- package/dist/modules/authoring/hooks.mjs +2 -0
- package/dist/modules/authoring/hooks.mjs.map +7 -0
- package/dist/modules/authoring/index.d.mts +1 -0
- package/dist/modules/authoring/index.mjs +2 -0
- package/dist/modules/authoring/index.mjs.map +7 -0
- package/dist/modules/authoring/instructions.d.mts +1 -0
- package/dist/modules/authoring/instructions.mjs +2 -0
- package/dist/modules/authoring/instructions.mjs.map +7 -0
- package/dist/modules/authoring/providers.d.mts +2 -0
- package/dist/modules/authoring/providers.mjs +1 -0
- package/dist/modules/authoring/providers.mjs.map +7 -0
- package/dist/modules/authoring/tools.d.mts +1 -0
- package/dist/modules/authoring/tools.mjs +2 -0
- package/dist/modules/authoring/tools.mjs.map +7 -0
- package/dist/modules/cli/build.d.mts +22 -0
- package/dist/modules/cli/build.mjs +77 -0
- package/dist/modules/cli/build.mjs.map +7 -0
- package/dist/modules/cli/channel-socket.d.mts +9 -0
- package/dist/modules/cli/channel-socket.mjs +114 -0
- package/dist/modules/cli/channel-socket.mjs.map +7 -0
- package/dist/modules/cli/cli.d.mts +16 -0
- package/dist/modules/cli/cli.mjs +151 -0
- package/dist/modules/cli/cli.mjs.map +7 -0
- package/dist/modules/cli/conformance.d.mts +36 -0
- package/dist/modules/cli/conformance.mjs +220 -0
- package/dist/modules/cli/conformance.mjs.map +7 -0
- package/dist/modules/cli/dev.d.mts +24 -0
- package/dist/modules/cli/dev.mjs +263 -0
- package/dist/modules/cli/dev.mjs.map +7 -0
- package/dist/modules/cli/files.d.mts +18 -0
- package/dist/modules/cli/files.mjs +66 -0
- package/dist/modules/cli/files.mjs.map +7 -0
- package/dist/modules/cli/harness-descriptions.d.mts +20 -0
- package/dist/modules/cli/harness-descriptions.mjs +70 -0
- package/dist/modules/cli/harness-descriptions.mjs.map +7 -0
- package/dist/modules/cli/main.d.mts +2 -0
- package/dist/modules/cli/main.mjs +20 -0
- package/dist/modules/cli/main.mjs.map +7 -0
- package/dist/modules/cli/output.d.mts +14 -0
- package/dist/modules/cli/output.mjs +94 -0
- package/dist/modules/cli/output.mjs.map +7 -0
- package/dist/modules/cli/publish.d.mts +14 -0
- package/dist/modules/cli/publish.mjs +89 -0
- package/dist/modules/cli/publish.mjs.map +7 -0
- package/dist/modules/compile.d.mts +3 -0
- package/dist/modules/compile.mjs +62 -0
- package/dist/modules/compile.mjs.map +7 -0
- package/dist/modules/harnesses.d.mts +1 -0
- package/dist/modules/harnesses.mjs +2 -0
- package/dist/modules/harnesses.mjs.map +7 -0
- package/dist/modules/index.browser.d.mts +4 -0
- package/dist/modules/index.browser.mjs +8 -0
- package/dist/modules/index.browser.mjs.map +7 -0
- package/dist/modules/index.d.mts +3 -0
- package/dist/modules/index.mjs +6 -0
- package/dist/modules/index.mjs.map +7 -0
- package/dist/modules/models.d.mts +1 -0
- package/dist/modules/models.mjs +2 -0
- package/dist/modules/models.mjs.map +7 -0
- package/dist/modules/public.d.mts +6 -0
- package/dist/modules/public.mjs +68 -0
- package/dist/modules/public.mjs.map +7 -0
- package/dist/modules/sandboxes.d.mts +1 -0
- package/dist/modules/sandboxes.mjs +2 -0
- package/dist/modules/sandboxes.mjs.map +7 -0
- package/examples/custom-harness/README.md +16 -0
- package/examples/custom-harness/agent.ts +154 -0
- package/examples/custom-sandbox/README.md +12 -0
- package/examples/custom-sandbox/agent.ts +14 -0
- package/examples/custom-sandbox/sandbox.ts +22 -0
- package/examples/release-scout/README.md +11 -0
- package/examples/release-scout/agent/agent.ts +22 -0
- package/examples/release-scout/agent/channels/github-signature.ts +27 -0
- package/examples/release-scout/agent/channels/github.ts +38 -0
- package/examples/release-scout/agent/connections/linear.ts +9 -0
- package/examples/release-scout/agent/hooks/audit.ts +24 -0
- package/examples/release-scout/agent/instructions/org-context.ts +26 -0
- package/examples/release-scout/agent/instructions.md +2 -0
- package/examples/release-scout/agent/sandbox.ts +20 -0
- package/examples/release-scout/agent/schedules/daily-digest.md +7 -0
- package/examples/release-scout/agent/skills/triage/SKILL.md +8 -0
- package/examples/release-scout/agent/skills/triage/checklist.md +3 -0
- package/examples/release-scout/agent/tools/lookup_release_notes.ts +24 -0
- package/examples/release-scout/client.ts +123 -0
- package/package.json +126 -0
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
import { type ProcessInspectionRequestIface, type ProcessInspectionResultIface } from '@finalai/agent-protocol';
|
|
2
|
+
import { AgentSessionState, type AgentRealtimeEvent, type AgentTurnPolicy, type AttachmentDownloadIface, type AttachmentUploadIface, type ContentInput, type ConversationIface, type ConversationKind, type ConversationLinkIface, type ConversationListIface, type ConversationMessageIface, type ConversationMessagesPageIface, type ConversationSandboxIface, type ConversationScheduleIface, type CreateConversationScheduleRequestIface, type DecisionsPageIface, type MessageDeliveryIface, type ParticipantIface, type ParticipantInput, type PostConversationEventRequestIface, type ReactionIface, type ReadStateIface, type RespondPendingResponseIface, type SandboxDirectoryIface, type SandboxEditorSessionIface, type SandboxFileIface, type SandboxPathIface, type SandboxPreviewType, type SandboxSearchIface, type SearchMessagesPageIface, type UpdateConversationRequestIface, type UpdateConversationScheduleRequestIface, type UpdateParticipantRequestIface, type WireFallback } from '@finalai/agent-protocol/agent-platform';
|
|
3
|
+
import { type CollectionEvent, type CollectionEventsOptionsIface } from "./collection-events.mjs";
|
|
4
|
+
import { type ClientContextIface, type EnumInput, type SignalOptionsIface } from "./context.mjs";
|
|
5
|
+
import { type RespondArgs } from "./sessions.mjs";
|
|
6
|
+
export interface SandboxFileContentArgsIface {
|
|
7
|
+
snapshotId?: string;
|
|
8
|
+
bindingId: string;
|
|
9
|
+
path: string;
|
|
10
|
+
download?: boolean;
|
|
11
|
+
/** One HTTP byte range, for example `bytes=1024-2047`. */
|
|
12
|
+
range?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface SandboxFileContentRequestIface {
|
|
15
|
+
url: string;
|
|
16
|
+
/** Supply these to native download/media clients; never put bearer tokens in URLs. */
|
|
17
|
+
headers: Record<string, string>;
|
|
18
|
+
credentials: RequestCredentials;
|
|
19
|
+
}
|
|
20
|
+
export interface ConversationEventMetaIface {
|
|
21
|
+
topic: string;
|
|
22
|
+
cursor: string | null;
|
|
23
|
+
createdAt: string | null;
|
|
24
|
+
/** True for messages the SDK fetched over HTTP to fill a realtime gap. */
|
|
25
|
+
replayed: boolean;
|
|
26
|
+
}
|
|
27
|
+
/** A realtime event of the conversation topic, flattened (`event.message`, `event.pending`). */
|
|
28
|
+
export type ConversationEvent = AgentRealtimeEvent & ConversationEventMetaIface;
|
|
29
|
+
export interface ConversationEventsOptionsIface extends SignalOptionsIface {
|
|
30
|
+
/** Keep streaming; false ends once the subscription is current. Defaults to true. */
|
|
31
|
+
follow?: boolean;
|
|
32
|
+
/** Also replay messages (thread replies included) after this conversation seq when the subscription opens. */
|
|
33
|
+
afterSeq?: number;
|
|
34
|
+
/** Gateway cursor to resume the topic after. */
|
|
35
|
+
afterCursor?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Messages the caller already has (an earlier stream or page). On the first
|
|
38
|
+
* subscription the stream recovers everything created or updated since the
|
|
39
|
+
* newest of them, thread replies included, and skips the versions given, so
|
|
40
|
+
* a client resuming a conversation it rendered before is left with no gap.
|
|
41
|
+
*/
|
|
42
|
+
resumeFrom?: readonly ConversationMessageIface[];
|
|
43
|
+
/**
|
|
44
|
+
* Called on every resubscribe (after the first) and resync, as the stream
|
|
45
|
+
* starts recovering messages. State that messages cannot reconstruct, such
|
|
46
|
+
* as whether an agent's turn ended without a reply, is the caller's to re-read.
|
|
47
|
+
*/
|
|
48
|
+
onResubscribed?: () => void;
|
|
49
|
+
/**
|
|
50
|
+
* Also recover what only realtime carries (default true). On every
|
|
51
|
+
* (re)subscribe, resync and fallback poll the stream re-reads the open
|
|
52
|
+
* permission and elicitation requests of the conversation's agent sessions
|
|
53
|
+
* and emits replayed `acp.pending` events: `created` for an open request it
|
|
54
|
+
* has not emitted, `resolved` for one it emitted open that no longer is. And
|
|
55
|
+
* for every turn it saw start whose session is no longer running, it emits a
|
|
56
|
+
* replayed `conversation.turn.ended` (stop reason null). Turns that started
|
|
57
|
+
* and ended while it was away arrive only as messages.
|
|
58
|
+
*/
|
|
59
|
+
recoverTransient?: boolean;
|
|
60
|
+
}
|
|
61
|
+
export interface SendMessageOptionsIface extends SignalOptionsIface {
|
|
62
|
+
clientMessageId?: string;
|
|
63
|
+
replyTo?: string;
|
|
64
|
+
threadRootId?: string;
|
|
65
|
+
/** Ids of earlier messages in the conversation to quote, in order. */
|
|
66
|
+
quotes?: string[];
|
|
67
|
+
/** Mentioned participant ids. */
|
|
68
|
+
mentions?: string[];
|
|
69
|
+
attachmentIds?: string[];
|
|
70
|
+
/** When the person submitted, for the prompt-to-inference trace; defaults to now. */
|
|
71
|
+
clientSubmittedAtMs?: number;
|
|
72
|
+
}
|
|
73
|
+
export type ParticipantCreateInput = {
|
|
74
|
+
user: string;
|
|
75
|
+
} | {
|
|
76
|
+
agent: string;
|
|
77
|
+
routingMode?: EnumInput<NonNullable<Extract<ParticipantInput, {
|
|
78
|
+
agent: string;
|
|
79
|
+
}>['routingMode']>>;
|
|
80
|
+
} | {
|
|
81
|
+
apiKeyPrincipal: string;
|
|
82
|
+
};
|
|
83
|
+
export interface SentMessageIface {
|
|
84
|
+
message: ConversationMessageIface;
|
|
85
|
+
messageId: string;
|
|
86
|
+
seq: number;
|
|
87
|
+
/** One entry per agent participant the message was routed to. */
|
|
88
|
+
deliveries: MessageDeliveryIface[];
|
|
89
|
+
}
|
|
90
|
+
export interface ListMessagesOptionsIface extends SignalOptionsIface {
|
|
91
|
+
before?: number;
|
|
92
|
+
after?: number;
|
|
93
|
+
limit?: number;
|
|
94
|
+
/** Thread root message id, or `MessageThreadFilter.All` for the timeline plus every thread. */
|
|
95
|
+
thread?: string;
|
|
96
|
+
/** ISO instant: messages created or updated after it (the first page of a change scan). */
|
|
97
|
+
updatedAfter?: string;
|
|
98
|
+
/** A previous page's `nextUpdatedCursor`: continue the change scan after it. */
|
|
99
|
+
updatedCursor?: string;
|
|
100
|
+
}
|
|
101
|
+
export interface UploadAttachmentArgsIface extends SignalOptionsIface {
|
|
102
|
+
name: string;
|
|
103
|
+
contentType: string;
|
|
104
|
+
data: Blob | ArrayBuffer;
|
|
105
|
+
}
|
|
106
|
+
export interface ConversationHandleIface {
|
|
107
|
+
/** Durable accepted prompt receipts for a message, including queued deliveries once admitted. */
|
|
108
|
+
deliveries: (args: {
|
|
109
|
+
messageId: string;
|
|
110
|
+
}, options?: SignalOptionsIface) => Promise<MessageDeliveryIface[]>;
|
|
111
|
+
id: string;
|
|
112
|
+
info: (options?: SignalOptionsIface) => Promise<ConversationIface>;
|
|
113
|
+
send: (content: ContentInput, options?: SendMessageOptionsIface) => Promise<SentMessageIface>;
|
|
114
|
+
events: (options?: ConversationEventsOptionsIface) => AsyncIterableIterator<ConversationEvent>;
|
|
115
|
+
messages: (options?: ListMessagesOptionsIface) => Promise<ConversationMessagesPageIface>;
|
|
116
|
+
/** One message by id (`GET /v1/conversations/:id/messages/:messageId`), e.g. a thread root. */
|
|
117
|
+
message: (args: {
|
|
118
|
+
messageId: string;
|
|
119
|
+
}, options?: SignalOptionsIface) => Promise<ConversationMessageIface>;
|
|
120
|
+
react: (args: {
|
|
121
|
+
messageId: string;
|
|
122
|
+
emoji: string;
|
|
123
|
+
}, options?: SignalOptionsIface) => Promise<ReactionIface[]>;
|
|
124
|
+
unreact: (args: {
|
|
125
|
+
messageId: string;
|
|
126
|
+
emoji: string;
|
|
127
|
+
}, options?: SignalOptionsIface) => Promise<ReactionIface[]>;
|
|
128
|
+
recordPushOpen: (args: {
|
|
129
|
+
deliveryId: string;
|
|
130
|
+
}, options?: SignalOptionsIface) => Promise<{
|
|
131
|
+
recorded: boolean;
|
|
132
|
+
}>;
|
|
133
|
+
markRead: (args: {
|
|
134
|
+
throughSeq: number;
|
|
135
|
+
}, options?: SignalOptionsIface) => Promise<ReadStateIface>;
|
|
136
|
+
/**
|
|
137
|
+
* Marks a thread read through one of its replies' seq and follows it
|
|
138
|
+
* (`POST …/threads/:rootId/read`); the conversation's own unread count
|
|
139
|
+
* moves with `markRead`.
|
|
140
|
+
*/
|
|
141
|
+
markThreadRead: (args: {
|
|
142
|
+
rootId: string;
|
|
143
|
+
throughSeq: number;
|
|
144
|
+
}, options?: SignalOptionsIface) => Promise<void>;
|
|
145
|
+
/**
|
|
146
|
+
* Tells the other members the caller is typing (`POST …/typing`), realtime
|
|
147
|
+
* only. A `true` lapses on its own after a few seconds, so composers repeat
|
|
148
|
+
* it while typing continues and send `false` when the draft is sent or cleared.
|
|
149
|
+
*/
|
|
150
|
+
typing: (args: {
|
|
151
|
+
typing: boolean;
|
|
152
|
+
}, options?: SignalOptionsIface) => Promise<void>;
|
|
153
|
+
/**
|
|
154
|
+
* Posts something that happened outside the conversation (`POST …/events`):
|
|
155
|
+
* a message from the source's system participant (a Goal, a tool, a
|
|
156
|
+
* webhook), routed like one. The same `eventId` from the same source posts once.
|
|
157
|
+
*/
|
|
158
|
+
postEvent: (event: PostConversationEventRequestIface, options?: SignalOptionsIface) => Promise<SentMessageIface>;
|
|
159
|
+
respond: (args: RespondArgs, options?: SignalOptionsIface) => Promise<RespondPendingResponseIface>;
|
|
160
|
+
/** Stops the agents' running turns in this conversation. */
|
|
161
|
+
cancel: (options?: SignalOptionsIface & {
|
|
162
|
+
reason?: string;
|
|
163
|
+
throughMessageSeq?: number;
|
|
164
|
+
}) => Promise<void>;
|
|
165
|
+
participants: (options?: SignalOptionsIface) => Promise<ParticipantIface[]>;
|
|
166
|
+
/**
|
|
167
|
+
* Each agent participant's session state, read now: whether a turn is
|
|
168
|
+
* running in it. What a client re-reads when it may have missed a
|
|
169
|
+
* `conversation.turn.ended` (`events()` reconciles the turns it saw itself).
|
|
170
|
+
*/
|
|
171
|
+
turns: (options?: SignalOptionsIface) => Promise<ConversationAgentTurnIface[]>;
|
|
172
|
+
addParticipant: (participant: ParticipantCreateInput, options?: SignalOptionsIface) => Promise<ParticipantIface>;
|
|
173
|
+
/**
|
|
174
|
+
* Changes an agent's routing mode (owners and admins) or a person's role
|
|
175
|
+
* (owners, groups only; the last owner cannot step down). One field per call.
|
|
176
|
+
*/
|
|
177
|
+
updateParticipant: (args: {
|
|
178
|
+
participantId: string;
|
|
179
|
+
} & Omit<UpdateParticipantRequestIface, 'routingMode' | 'role'> & {
|
|
180
|
+
routingMode?: EnumInput<NonNullable<UpdateParticipantRequestIface['routingMode']>>;
|
|
181
|
+
role?: EnumInput<NonNullable<UpdateParticipantRequestIface['role']>>;
|
|
182
|
+
}, options?: SignalOptionsIface) => Promise<ParticipantIface>;
|
|
183
|
+
removeParticipant: (args: {
|
|
184
|
+
participantId: string;
|
|
185
|
+
}, options?: SignalOptionsIface) => Promise<void>;
|
|
186
|
+
update: (patch: UpdateConversationRequestIface, options?: SignalOptionsIface) => Promise<ConversationIface>;
|
|
187
|
+
delete: (args: {
|
|
188
|
+
messageId: string;
|
|
189
|
+
}, options?: SignalOptionsIface) => Promise<void>;
|
|
190
|
+
uploadAttachment: (args: UploadAttachmentArgsIface) => Promise<AttachmentUploadIface>;
|
|
191
|
+
/**
|
|
192
|
+
* A fresh presigned download URL for one attachment
|
|
193
|
+
* (`GET /v1/conversations/:id/attachments/:attachmentId`). URLs on messages
|
|
194
|
+
* expire; resolve through this before opening one that may be stale.
|
|
195
|
+
*/
|
|
196
|
+
attachmentUrl: (args: {
|
|
197
|
+
attachmentId: string;
|
|
198
|
+
}, options?: SignalOptionsIface) => Promise<AttachmentDownloadIface>;
|
|
199
|
+
/**
|
|
200
|
+
* The conversation's sandboxes (the computer tile): status, capabilities and
|
|
201
|
+
* whether a preview is available (`GET /v1/conversations/:id/sandboxes`).
|
|
202
|
+
* Never starts a parked sandbox.
|
|
203
|
+
*/
|
|
204
|
+
sandboxes: (options?: SignalOptionsIface) => Promise<ConversationSandboxIface[]>;
|
|
205
|
+
/** One directory of a running sandbox, confined to its workspace (`…/sandboxes/:bindingId/files`). */
|
|
206
|
+
sandboxFiles: (args: {
|
|
207
|
+
bindingId: string;
|
|
208
|
+
path?: string;
|
|
209
|
+
snapshotId?: string;
|
|
210
|
+
}, options?: SignalOptionsIface) => Promise<SandboxDirectoryIface>;
|
|
211
|
+
/** Resolves a file or directory without waking its sandbox. */
|
|
212
|
+
sandboxPath: (args: {
|
|
213
|
+
bindingId: string;
|
|
214
|
+
path?: string;
|
|
215
|
+
snapshotId?: string;
|
|
216
|
+
}, options?: SignalOptionsIface) => Promise<SandboxPathIface>;
|
|
217
|
+
/** Bounded recursive path search; truncated signals incomplete traversal. */
|
|
218
|
+
searchSandboxFiles: (args: {
|
|
219
|
+
bindingId: string;
|
|
220
|
+
path?: string;
|
|
221
|
+
query: string;
|
|
222
|
+
limit?: number;
|
|
223
|
+
}, options?: SignalOptionsIface) => Promise<SandboxSearchIface>;
|
|
224
|
+
/** A byte range of a file in a running sandbox, at most 1 MiB (`…/sandboxes/:bindingId/file`). */
|
|
225
|
+
sandboxFile: (args: {
|
|
226
|
+
bindingId: string;
|
|
227
|
+
path: string;
|
|
228
|
+
offset?: number;
|
|
229
|
+
length?: number;
|
|
230
|
+
snapshotId?: string;
|
|
231
|
+
}, options?: SignalOptionsIface) => Promise<SandboxFileIface>;
|
|
232
|
+
inspectSandboxProcesses(args: {
|
|
233
|
+
bindingId: string;
|
|
234
|
+
request: ProcessInspectionRequestIface;
|
|
235
|
+
}, options?: SignalOptionsIface): Promise<ProcessInspectionResultIface>;
|
|
236
|
+
/** Opens a provider editor for an existing workspace, with write authorization. */
|
|
237
|
+
openSandboxEditor(args: {
|
|
238
|
+
bindingId: string;
|
|
239
|
+
}, options?: SignalOptionsIface): Promise<SandboxEditorSessionIface>;
|
|
240
|
+
refreshSandboxEditor(args: {
|
|
241
|
+
bindingId: string;
|
|
242
|
+
editorId: string;
|
|
243
|
+
authorizationId: string;
|
|
244
|
+
}, options?: SignalOptionsIface): Promise<SandboxEditorSessionIface>;
|
|
245
|
+
closeSandboxEditor(args: {
|
|
246
|
+
bindingId: string;
|
|
247
|
+
editorId: string;
|
|
248
|
+
authorizationId: string;
|
|
249
|
+
}, options?: SignalOptionsIface & {
|
|
250
|
+
keepalive?: boolean;
|
|
251
|
+
}): Promise<void>;
|
|
252
|
+
/** Raw streaming bytes (`…/file/content`). The caller consumes or cancels the response body. */
|
|
253
|
+
sandboxFileContent: (args: SandboxFileContentArgsIface, options?: SignalOptionsIface) => Promise<Response>;
|
|
254
|
+
/**
|
|
255
|
+
* An authenticated request for a browser/native media or download client.
|
|
256
|
+
* Cookie clients can use the URL directly; bearer clients must supply headers.
|
|
257
|
+
* Every request rechecks membership and confinement; never wakes the sandbox.
|
|
258
|
+
*/
|
|
259
|
+
sandboxFileContentRequest: (args: SandboxFileContentArgsIface) => Promise<SandboxFileContentRequestIface>;
|
|
260
|
+
/** A short-lived screen preview of a running sandbox; 404 when it serves none (`…/preview`). */
|
|
261
|
+
sandboxPreview: (args: {
|
|
262
|
+
bindingId: string;
|
|
263
|
+
viewOnly?: boolean;
|
|
264
|
+
}, options?: SignalOptionsIface) => Promise<SandboxPreviewType>;
|
|
265
|
+
/** Starts a parked sandbox (conversation owners and admins; `POST …/wake`). */
|
|
266
|
+
wakeSandbox: (args: {
|
|
267
|
+
bindingId: string;
|
|
268
|
+
}, options?: SignalOptionsIface) => Promise<ConversationSandboxIface>;
|
|
269
|
+
/** The conversation's runtime schedules: reminders and recurring checks (`GET …/schedules`). */
|
|
270
|
+
schedules: (options?: SignalOptionsIface) => Promise<ConversationScheduleIface[]>;
|
|
271
|
+
/**
|
|
272
|
+
* Creates a schedule owned by one agent participant (`POST …/schedules`).
|
|
273
|
+
* Agents create their own; people need to be conversation owners or admins.
|
|
274
|
+
*/
|
|
275
|
+
createSchedule: (args: CreateConversationScheduleRequestIface, options?: SignalOptionsIface) => Promise<ConversationScheduleIface>;
|
|
276
|
+
/** Changes a schedule (its agent, or conversation owners and admins; `PATCH …/schedules/:id`). */
|
|
277
|
+
updateSchedule: (args: {
|
|
278
|
+
scheduleId: string;
|
|
279
|
+
} & UpdateConversationScheduleRequestIface, options?: SignalOptionsIface) => Promise<ConversationScheduleIface>;
|
|
280
|
+
/** Deletes a schedule (`DELETE …/schedules/:id`). */
|
|
281
|
+
deleteSchedule: (args: {
|
|
282
|
+
scheduleId: string;
|
|
283
|
+
}, options?: SignalOptionsIface) => Promise<void>;
|
|
284
|
+
/**
|
|
285
|
+
* The conversations this one handed work to, with what their agents are
|
|
286
|
+
* doing (`GET …/links`). Their replies and waits arrive here as messages.
|
|
287
|
+
*/
|
|
288
|
+
links: (options?: SignalOptionsIface) => Promise<ConversationLinkIface[]>;
|
|
289
|
+
/** Conversations receiving this conversation’s delegated results. */
|
|
290
|
+
parentLinks: (options?: SignalOptionsIface) => Promise<ConversationLinkIface[]>;
|
|
291
|
+
/**
|
|
292
|
+
* Links another conversation the caller belongs to (`POST …/links`); linking
|
|
293
|
+
* it again returns the same link. Links never form a cycle.
|
|
294
|
+
*/
|
|
295
|
+
link: (args: {
|
|
296
|
+
conversationId: string;
|
|
297
|
+
}, options?: SignalOptionsIface) => Promise<ConversationLinkIface>;
|
|
298
|
+
/** Removes a link (`DELETE …/links/:linkId`); both conversations remain. */
|
|
299
|
+
unlink: (args: {
|
|
300
|
+
linkId: string;
|
|
301
|
+
}, options?: SignalOptionsIface) => Promise<void>;
|
|
302
|
+
}
|
|
303
|
+
export interface ConversationAgentTurnIface {
|
|
304
|
+
participantId: string;
|
|
305
|
+
sessionId: string;
|
|
306
|
+
state: AgentSessionState | WireFallback;
|
|
307
|
+
/** A turn is running or waiting on a pending request. */
|
|
308
|
+
running: boolean;
|
|
309
|
+
}
|
|
310
|
+
/** Session states in which a turn is open. */
|
|
311
|
+
export declare const TURN_OPEN_SESSION_STATES: ReadonlySet<AgentSessionState | WireFallback>;
|
|
312
|
+
export interface OpenedConversationIface extends ConversationHandleIface {
|
|
313
|
+
conversation: ConversationIface;
|
|
314
|
+
}
|
|
315
|
+
export interface CreateConversationArgsIface extends SignalOptionsIface {
|
|
316
|
+
kind: EnumInput<ConversationKind>;
|
|
317
|
+
title?: string;
|
|
318
|
+
participants: ParticipantCreateInput[];
|
|
319
|
+
turnPolicy?: EnumInput<AgentTurnPolicy>;
|
|
320
|
+
}
|
|
321
|
+
export interface ConversationsApiIface {
|
|
322
|
+
list: (options?: SignalOptionsIface & {
|
|
323
|
+
cursor?: string;
|
|
324
|
+
limit?: number;
|
|
325
|
+
includeArchived?: boolean;
|
|
326
|
+
}) => Promise<ConversationListIface>;
|
|
327
|
+
/** Finds or creates the caller's direct conversation with an agent. */
|
|
328
|
+
direct: (args: {
|
|
329
|
+
agent: string;
|
|
330
|
+
} & SignalOptionsIface) => Promise<OpenedConversationIface>;
|
|
331
|
+
/** Finds or creates the caller's Home conversation. */
|
|
332
|
+
home: (options?: SignalOptionsIface) => Promise<OpenedConversationIface>;
|
|
333
|
+
create: (args: CreateConversationArgsIface) => Promise<OpenedConversationIface>;
|
|
334
|
+
/** I/O-free handle. */
|
|
335
|
+
get: (conversationId: string) => ConversationHandleIface;
|
|
336
|
+
/** Full-text search over the caller's conversations (or one), newest first. */
|
|
337
|
+
search: (args: {
|
|
338
|
+
q: string;
|
|
339
|
+
conversationId?: string;
|
|
340
|
+
cursor?: string;
|
|
341
|
+
limit?: number;
|
|
342
|
+
} & SignalOptionsIface) => Promise<SearchMessagesPageIface>;
|
|
343
|
+
/**
|
|
344
|
+
* The caller's conversation list topic (`user.collection:<userId>:conversations`):
|
|
345
|
+
* `conversation.list.changed` and `conversation.updated` events, and a
|
|
346
|
+
* `collection.resync` whenever `list()` must be re-read (on every
|
|
347
|
+
* subscription, resync and while realtime is down).
|
|
348
|
+
*/
|
|
349
|
+
listEvents: (options?: CollectionEventsOptionsIface) => AsyncIterableIterator<CollectionEvent>;
|
|
350
|
+
/** Everything awaiting the caller's answer across conversations. */
|
|
351
|
+
decisions: (options?: SignalOptionsIface & {
|
|
352
|
+
cursor?: string;
|
|
353
|
+
limit?: number;
|
|
354
|
+
}) => Promise<DecisionsPageIface>;
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Every recovery rescans this far behind the newest change seen: `updated_at`
|
|
358
|
+
* is a transaction's start time, so a slow write (a lock wait) can commit
|
|
359
|
+
* after newer changes were delivered.
|
|
360
|
+
*/
|
|
361
|
+
export declare const RECOVERY_SKEW_MS = 30000;
|
|
362
|
+
/** The newest copy of a message the stream has emitted (or the caller already had). */
|
|
363
|
+
export interface MessageVersionIface {
|
|
364
|
+
/** The server's per-message change counter: a total order when both copies carry it. */
|
|
365
|
+
revision: number | null;
|
|
366
|
+
/** `updatedAt` in ms; distinct changes can share a millisecond. */
|
|
367
|
+
updatedAt: number | null;
|
|
368
|
+
/** Newest of updatedAt/deletedAt/createdAt, for messages without `updatedAt`. */
|
|
369
|
+
stamp: number;
|
|
370
|
+
deleted: boolean;
|
|
371
|
+
final: boolean;
|
|
372
|
+
fingerprint: string;
|
|
373
|
+
}
|
|
374
|
+
export declare const messageVersionOf: (message: ConversationMessageIface) => MessageVersionIface;
|
|
375
|
+
/**
|
|
376
|
+
* Whether `incoming` is newer than the copy already emitted; older or equal
|
|
377
|
+
* copies are dropped. A deletion is never undone. `revision` orders copies
|
|
378
|
+
* when both carry it. Otherwise `updatedAt` does, where a finalized reply
|
|
379
|
+
* beats a streaming copy from the same millisecond; without either, a later
|
|
380
|
+
* change time wins, a finalized reply is never undone by a copy at the same
|
|
381
|
+
* time, and equal times fall back to content.
|
|
382
|
+
*/
|
|
383
|
+
export declare const isNewerMessageVersion: (incoming: MessageVersionIface, current: MessageVersionIface | undefined) => boolean;
|
|
384
|
+
export declare const createConversationHandle: (context: ClientContextIface, conversationId: string) => ConversationHandleIface;
|
|
385
|
+
export declare const createConversationsApi: (context: ClientContextIface) => ConversationsApiIface;
|