@harness-gw/sdk 0.4.1 → 0.5.1
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 +5 -4
- package/dist/chunks/index.js +29 -13
- package/dist/client/acp-workspace-client-composer.d.ts +9 -9
- package/dist/client/acp-workspace-client-sessions.d.ts +9 -2
- package/dist/client/acp-workspace-client.d.ts +27 -23
- package/dist/client/connection.d.ts +26 -26
- package/dist/client/hgw-client.d.ts +64 -64
- package/dist/client/index.js +65 -9
- package/dist/client/log.d.ts +4 -4
- package/dist/client/workspace.d.ts +8 -0
- package/dist/protocol/acp.d.ts +66 -48
- package/dist/protocol/index.d.ts +86 -76
- package/dist/protocol/push.d.ts +32 -12
- package/dist/protocol/sdk.js +4 -0
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -63,7 +63,7 @@ You need a running harness. Hermes is the primary one; see
|
|
|
63
63
|
docker run --rm \
|
|
64
64
|
-v "$PWD/config.yaml:/run/harness-gw/config.yaml:ro" \
|
|
65
65
|
-v "$PWD/hermes-token:/run/secrets/hermes-token:ro" \
|
|
66
|
-
ghcr.io/almogbaku/harness-gw:0.
|
|
66
|
+
ghcr.io/almogbaku/harness-gw:0.5.1 \
|
|
67
67
|
config check --config /run/harness-gw/config.yaml
|
|
68
68
|
```
|
|
69
69
|
|
|
@@ -73,7 +73,7 @@ You need a running harness. Hermes is the primary one; see
|
|
|
73
73
|
docker run --rm -p 127.0.0.1:4100:4100 \
|
|
74
74
|
-v "$PWD/config.yaml:/run/harness-gw/config.yaml:ro" \
|
|
75
75
|
-v "$PWD/hermes-token:/run/secrets/hermes-token:ro" \
|
|
76
|
-
ghcr.io/almogbaku/harness-gw:0.
|
|
76
|
+
ghcr.io/almogbaku/harness-gw:0.5.1 \
|
|
77
77
|
serve --config /run/harness-gw/config.yaml
|
|
78
78
|
```
|
|
79
79
|
|
|
@@ -156,8 +156,9 @@ Use [Bun](https://bun.sh).
|
|
|
156
156
|
|
|
157
157
|
```bash
|
|
158
158
|
bun install
|
|
159
|
-
bun run typecheck
|
|
160
|
-
bun run lint
|
|
159
|
+
bun run typecheck # TypeScript 7
|
|
160
|
+
bun run lint # Oxlint, type-aware
|
|
161
|
+
bun run format # oxfmt
|
|
161
162
|
bun run test # unit and integration
|
|
162
163
|
bun run test:gate # build and packaging checks
|
|
163
164
|
bun run build # the SDK's dist/
|
package/dist/chunks/index.js
CHANGED
|
@@ -84,7 +84,8 @@ var AgentSummarySchema = z.strictObject({
|
|
|
84
84
|
activity: z.enum(["active", "idle", "unknown"]).optional(),
|
|
85
85
|
visibility: z.enum(["visible", "hidden"]).optional(),
|
|
86
86
|
role: z.literal("creator").optional(),
|
|
87
|
-
avatar: AgentAvatarSchema2.optional()
|
|
87
|
+
avatar: AgentAvatarSchema2.optional(),
|
|
88
|
+
muted: z.literal(true).optional()
|
|
88
89
|
});
|
|
89
90
|
var AgentCatalogEntrySchema2 = z.strictObject({
|
|
90
91
|
summary: AgentSummarySchema,
|
|
@@ -92,6 +93,7 @@ var AgentCatalogEntrySchema2 = z.strictObject({
|
|
|
92
93
|
selectable: z.boolean(),
|
|
93
94
|
editable: z.boolean(),
|
|
94
95
|
avatarEditable: z.boolean(),
|
|
96
|
+
muteEditable: z.boolean(),
|
|
95
97
|
revision: IdentifierSchema
|
|
96
98
|
});
|
|
97
99
|
var AgentCatalogResponseSchema2 = z.strictObject({
|
|
@@ -101,12 +103,13 @@ var AgentCatalogResponseSchema2 = z.strictObject({
|
|
|
101
103
|
var AgentUpdateFields2 = {
|
|
102
104
|
visibility: z.enum(["visible", "hidden"]).optional(),
|
|
103
105
|
avatar: AgentAvatarSchema2.nullable().optional(),
|
|
106
|
+
muted: z.boolean().optional(),
|
|
104
107
|
revision: IdentifierSchema
|
|
105
108
|
};
|
|
106
109
|
function writesAgentField2(value) {
|
|
107
|
-
return value.visibility !== undefined || value.avatar !== undefined;
|
|
110
|
+
return value.visibility !== undefined || value.avatar !== undefined || value.muted !== undefined;
|
|
108
111
|
}
|
|
109
|
-
var AgentUpdateRequestSchema2 = z.strictObject(AgentUpdateFields2).refine(writesAgentField2, "At least one of visibility, avatar");
|
|
112
|
+
var AgentUpdateRequestSchema2 = z.strictObject(AgentUpdateFields2).refine(writesAgentField2, "At least one of visibility, avatar, muted");
|
|
110
113
|
var AgentUpdateResponseSchema2 = z.strictObject({
|
|
111
114
|
revision: IdentifierSchema,
|
|
112
115
|
agent: AgentCatalogEntrySchema2
|
|
@@ -842,7 +845,7 @@ var HgwFocusRequestSchema2 = z2.strictObject({
|
|
|
842
845
|
idle: z2.boolean().optional()
|
|
843
846
|
});
|
|
844
847
|
var HgwAgentsListResponseSchema2 = AgentCatalogResponseSchema2;
|
|
845
|
-
var HgwAgentUpdateRequestSchema2 = z2.strictObject({ agentId: IdentifierSchema2, ...AgentUpdateFields2 }).refine(writesAgentField2, "At least one of visibility, avatar");
|
|
848
|
+
var HgwAgentUpdateRequestSchema2 = z2.strictObject({ agentId: IdentifierSchema2, ...AgentUpdateFields2 }).refine(writesAgentField2, "At least one of visibility, avatar, muted");
|
|
846
849
|
var HgwAgentUpdateResponseSchema2 = AgentUpdateResponseSchema2;
|
|
847
850
|
var TurnMetaBase = {
|
|
848
851
|
sequence: SequenceSchema,
|
|
@@ -980,10 +983,12 @@ var HgwErrorNotificationSchema2 = readObject({
|
|
|
980
983
|
code: z2.string().min(1).max(128),
|
|
981
984
|
message: z2.string().max(4096)
|
|
982
985
|
});
|
|
986
|
+
var HGW_REQUEST_TEXT_MAX2 = 200;
|
|
983
987
|
var ActivityBase = {
|
|
984
988
|
agentId: IdentifierSchema2,
|
|
985
989
|
sessionId: IdentifierSchema2,
|
|
986
|
-
occurredAt: z2.iso.datetime()
|
|
990
|
+
occurredAt: z2.iso.datetime(),
|
|
991
|
+
replayed: z2.literal(true).optional()
|
|
987
992
|
};
|
|
988
993
|
var HgwActivityNotificationSchema2 = z2.discriminatedUnion("type", [
|
|
989
994
|
readObject({
|
|
@@ -995,7 +1000,9 @@ var HgwActivityNotificationSchema2 = z2.discriminatedUnion("type", [
|
|
|
995
1000
|
...ActivityBase,
|
|
996
1001
|
type: z2.literal("attention-requested"),
|
|
997
1002
|
requestId: IdentifierSchema2,
|
|
998
|
-
attentionKind: z2.enum(["question", "permission"])
|
|
1003
|
+
attentionKind: z2.enum(["question", "permission"]),
|
|
1004
|
+
requestText: z2.string().min(1).max(HGW_REQUEST_TEXT_MAX2).optional(),
|
|
1005
|
+
requestMore: z2.number().int().min(1).optional()
|
|
999
1006
|
}),
|
|
1000
1007
|
readObject({
|
|
1001
1008
|
...ActivityBase,
|
|
@@ -1036,15 +1043,24 @@ var COALESCE_WINDOW_MS2 = {
|
|
|
1036
1043
|
failure: 5000,
|
|
1037
1044
|
completion: 20000
|
|
1038
1045
|
};
|
|
1046
|
+
var PUSH_TEXT_LIMITS2 = {
|
|
1047
|
+
agentName: 64,
|
|
1048
|
+
sessionTitle: 120,
|
|
1049
|
+
requestText: HGW_REQUEST_TEXT_MAX2
|
|
1050
|
+
};
|
|
1051
|
+
var pushText = (max) => z3.string().min(1).max(max);
|
|
1039
1052
|
var PushMessageSchema2 = z3.strictObject({
|
|
1040
|
-
v: z3.literal(
|
|
1053
|
+
v: z3.literal(2),
|
|
1041
1054
|
category: PushCategorySchema2,
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
sessionId: IdentifierSchema2.optional(),
|
|
1055
|
+
agentId: IdentifierSchema2,
|
|
1056
|
+
sessionId: IdentifierSchema2,
|
|
1045
1057
|
occurredAt: z3.iso.datetime(),
|
|
1046
|
-
locale: PushLocaleSchema2
|
|
1047
|
-
|
|
1058
|
+
locale: PushLocaleSchema2,
|
|
1059
|
+
agentName: pushText(PUSH_TEXT_LIMITS2.agentName).optional(),
|
|
1060
|
+
sessionTitle: pushText(PUSH_TEXT_LIMITS2.sessionTitle).optional(),
|
|
1061
|
+
requestText: pushText(PUSH_TEXT_LIMITS2.requestText).optional(),
|
|
1062
|
+
requestMore: z3.number().int().min(1).optional()
|
|
1063
|
+
});
|
|
1048
1064
|
var PushCategoriesSchema2 = z3.strictObject({
|
|
1049
1065
|
input: z3.boolean(),
|
|
1050
1066
|
failure: z3.boolean(),
|
|
@@ -1164,4 +1180,4 @@ var MCP_APP_SANDBOX_CSP2 = [
|
|
|
1164
1180
|
"frame-ancestors 'self'"
|
|
1165
1181
|
].join("; ");
|
|
1166
1182
|
|
|
1167
|
-
export { SESSION_CATALOG_MAX_WINDOW2, RuntimeAuthStateSchema2, OperationCapabilitySchema2, RuntimeInfoSchema2, AgentAvatarSchema2, AgentCatalogEntrySchema2, AgentCatalogResponseSchema2, AgentUpdateFields2, writesAgentField2, AgentUpdateRequestSchema2, AgentUpdateResponseSchema2, SessionStatusSchema2, SessionPlatformSchema2, SessionSchema2, newestSessionFirst2, SessionCatalogResponseSchema2, StopReason2, ToolKind2, ToolLocationSchema2, DiffOperation2, DiffChangeSchema2, ToolDiffSchema2, SessionMessageErrorStatusSchema2, SessionMessageSchema2, SessionPlanActivityMessageSchema2, SessionHistoryResponseSchema2, SessionCreateRequestSchema2, SessionCreateResponseSchema2, SessionPatchRequestSchema2, TurnStopResponseSchema2, TurnSteerRequestSchema2, TurnSteerResponseSchema2, SlashCommandSchema2, MAX_SLASH_COMMANDS2, INTERACTION_PROTOCOL2, SessionWorkspaceCapabilitiesResponseSchema2, GuestRuntimeCapabilitiesResponseSchema2, SessionModelsResponseSchema2, SessionModelUpdateRequestSchema2, SessionModelUpdateResponseSchema2, SessionContextResponseSchema2, ArtifactDescriptorSchema2, SessionTodosResponseSchema2, SessionActivityResponseSchema2, SessionAttachmentStageRequestSchema2, SessionAttachmentStageResponseSchema2, SessionAudioResponseSchema2, SessionTranscriptionRequestSchema2, SessionTranscriptionResponseSchema2, SessionSpeechRequestSchema2, ErrorResponseSchema2, ACP_PROTOCOL_VERSION2, HGW_API_PREFIX2, HGW_ACP_PATH2, HGW_ACP_AGENTS_PATH2, hgwAcpAgentPath2, HGW_META_KEY2, HGW_EXTENSION_VERSION2, HGW_AUTH_METHOD_INVITE2, HGW_ATTACHMENT_URI_SCHEME2, HGW_ARTIFACT_URI_SCHEME2, HGW_METHODS2, HGW_STOP_REASONS2, HGW_PERMISSION_KIND_SESSION2, HGW_PLAN_ID2, HGW_JSONRPC_ERRORS2, IdentifierSchema2, HgwExtensionsSchema2, HgwClientCapabilitiesMetaSchema2, HgwInitializeMetaSchema2, HgwLoginMetaSchema2, HgwSessionNewMetaSchema2, HgwSessionListMetaSchema2, HgwSessionSearchMetaSchema2, HgwSessionSearchResponseSchema2, HgwSessionInfoMetaSchema2, HgwSessionResumeMetaSchema2, HGW_REPLAY_BEFORE2, HgwReplayBeforeSchema2, HgwHistoryCursorSchema2, HgwHistoryPageResponseMetaSchema2, HgwHistoryPageTagSchema2, HgwSessionResumeResponseMetaSchema2, HgwPromptMetaSchema2, HgwSessionUpdateRequestSchema2, HgwSessionPartRequestSchema2, HgwSteerRequestSchema2, HgwSteerResponseSchema2, HgwFocusRequestSchema2, HgwAgentsListResponseSchema2, HgwAgentUpdateRequestSchema2, HgwAgentUpdateResponseSchema2, HgwTurnMetaSchema2, HgwNoticeMetaSchema2, HgwMessageMetaSchema2, HgwCostSchema2, HGW_SUBAGENT_STATUSES2, HgwSubagentSchema2, HgwStateMetaSchema2, HgwChunkMetaSchema2, HgwToolCallMetaSchema2, HgwPlanMetaSchema2, HgwUsageMetaSchema2, HgwAvailableCommandsMetaSchema2, HgwPermissionMetaSchema2, HgwQuestionOptionSchema2, HgwQuestionSchema2, HgwElicitationMetaSchema2, HgwArtifactDescriptorSchema2, formatArtifactUri2, parseArtifactUri2, HgwComposerPrefillNotificationSchema2, HgwErrorNotificationSchema2, HgwActivityNotificationSchema2, PushCategorySchema2, categoryOf2, PushLocaleSchema2, PRESENCE_IDLE_MS2, PRESENCE_HEARTBEAT_MS2, PRESENCE_GRACE_MS2, PRESENCE_CLOSED_GRACE_MS2, COALESCE_WINDOW_MS2, PushMessageSchema2, PushCategoriesSchema2, PushSubscriptionJsonSchema2, PushInfoSchema2, PushRegistrationSchema2, PushUnregistrationSchema2, CallToolResultSchema2, ReadResourceResultSchema2, McpUiCspSchema2, isMcpAppCspDomain2, McpUiPermissionsSchema2, McpAppFilesSchema2, McpAppViewSchema2, viewerFileResult2, McpAppToolCallRequestSchema2, McpAppResourceReadRequestSchema2, MCP_APP_SANDBOX_PATH2, MCP_APP_SANDBOX_CSP2 };
|
|
1183
|
+
export { SESSION_CATALOG_MAX_WINDOW2, RuntimeAuthStateSchema2, OperationCapabilitySchema2, RuntimeInfoSchema2, AgentAvatarSchema2, AgentCatalogEntrySchema2, AgentCatalogResponseSchema2, AgentUpdateFields2, writesAgentField2, AgentUpdateRequestSchema2, AgentUpdateResponseSchema2, SessionStatusSchema2, SessionPlatformSchema2, SessionSchema2, newestSessionFirst2, SessionCatalogResponseSchema2, StopReason2, ToolKind2, ToolLocationSchema2, DiffOperation2, DiffChangeSchema2, ToolDiffSchema2, SessionMessageErrorStatusSchema2, SessionMessageSchema2, SessionPlanActivityMessageSchema2, SessionHistoryResponseSchema2, SessionCreateRequestSchema2, SessionCreateResponseSchema2, SessionPatchRequestSchema2, TurnStopResponseSchema2, TurnSteerRequestSchema2, TurnSteerResponseSchema2, SlashCommandSchema2, MAX_SLASH_COMMANDS2, INTERACTION_PROTOCOL2, SessionWorkspaceCapabilitiesResponseSchema2, GuestRuntimeCapabilitiesResponseSchema2, SessionModelsResponseSchema2, SessionModelUpdateRequestSchema2, SessionModelUpdateResponseSchema2, SessionContextResponseSchema2, ArtifactDescriptorSchema2, SessionTodosResponseSchema2, SessionActivityResponseSchema2, SessionAttachmentStageRequestSchema2, SessionAttachmentStageResponseSchema2, SessionAudioResponseSchema2, SessionTranscriptionRequestSchema2, SessionTranscriptionResponseSchema2, SessionSpeechRequestSchema2, ErrorResponseSchema2, ACP_PROTOCOL_VERSION2, HGW_API_PREFIX2, HGW_ACP_PATH2, HGW_ACP_AGENTS_PATH2, hgwAcpAgentPath2, HGW_META_KEY2, HGW_EXTENSION_VERSION2, HGW_AUTH_METHOD_INVITE2, HGW_ATTACHMENT_URI_SCHEME2, HGW_ARTIFACT_URI_SCHEME2, HGW_METHODS2, HGW_STOP_REASONS2, HGW_PERMISSION_KIND_SESSION2, HGW_PLAN_ID2, HGW_JSONRPC_ERRORS2, IdentifierSchema2, HgwExtensionsSchema2, HgwClientCapabilitiesMetaSchema2, HgwInitializeMetaSchema2, HgwLoginMetaSchema2, HgwSessionNewMetaSchema2, HgwSessionListMetaSchema2, HgwSessionSearchMetaSchema2, HgwSessionSearchResponseSchema2, HgwSessionInfoMetaSchema2, HgwSessionResumeMetaSchema2, HGW_REPLAY_BEFORE2, HgwReplayBeforeSchema2, HgwHistoryCursorSchema2, HgwHistoryPageResponseMetaSchema2, HgwHistoryPageTagSchema2, HgwSessionResumeResponseMetaSchema2, HgwPromptMetaSchema2, HgwSessionUpdateRequestSchema2, HgwSessionPartRequestSchema2, HgwSteerRequestSchema2, HgwSteerResponseSchema2, HgwFocusRequestSchema2, HgwAgentsListResponseSchema2, HgwAgentUpdateRequestSchema2, HgwAgentUpdateResponseSchema2, HgwTurnMetaSchema2, HgwNoticeMetaSchema2, HgwMessageMetaSchema2, HgwCostSchema2, HGW_SUBAGENT_STATUSES2, HgwSubagentSchema2, HgwStateMetaSchema2, HgwChunkMetaSchema2, HgwToolCallMetaSchema2, HgwPlanMetaSchema2, HgwUsageMetaSchema2, HgwAvailableCommandsMetaSchema2, HgwPermissionMetaSchema2, HgwQuestionOptionSchema2, HgwQuestionSchema2, HgwElicitationMetaSchema2, HgwArtifactDescriptorSchema2, formatArtifactUri2, parseArtifactUri2, HgwComposerPrefillNotificationSchema2, HgwErrorNotificationSchema2, HGW_REQUEST_TEXT_MAX2, HgwActivityNotificationSchema2, PushCategorySchema2, categoryOf2, PushLocaleSchema2, PRESENCE_IDLE_MS2, PRESENCE_HEARTBEAT_MS2, PRESENCE_GRACE_MS2, PRESENCE_CLOSED_GRACE_MS2, COALESCE_WINDOW_MS2, PUSH_TEXT_LIMITS2, PushMessageSchema2, PushCategoriesSchema2, PushSubscriptionJsonSchema2, PushInfoSchema2, PushRegistrationSchema2, PushUnregistrationSchema2, CallToolResultSchema2, ReadResourceResultSchema2, McpUiCspSchema2, isMcpAppCspDomain2, McpUiPermissionsSchema2, McpAppFilesSchema2, McpAppViewSchema2, viewerFileResult2, McpAppToolCallRequestSchema2, McpAppResourceReadRequestSchema2, MCP_APP_SANDBOX_PATH2, MCP_APP_SANDBOX_CSP2 };
|
|
@@ -32,15 +32,15 @@ export declare function createAcpComposerStore(connection: AcpConnection): {
|
|
|
32
32
|
capabilities: (sessionId: string) => {
|
|
33
33
|
workspace: {
|
|
34
34
|
slashCommands: {
|
|
35
|
-
status: "unavailable";
|
|
36
|
-
reason: string;
|
|
37
|
-
} | {
|
|
38
35
|
status: "available";
|
|
39
36
|
scope: "session";
|
|
40
37
|
commands: {
|
|
41
38
|
name: string;
|
|
42
39
|
description?: string | undefined;
|
|
43
40
|
}[];
|
|
41
|
+
} | {
|
|
42
|
+
status: "unavailable";
|
|
43
|
+
reason: string;
|
|
44
44
|
};
|
|
45
45
|
models: {
|
|
46
46
|
status: "unavailable";
|
|
@@ -114,7 +114,7 @@ export declare function createAcpComposerStore(connection: AcpConnection): {
|
|
|
114
114
|
protocol: "acp-request";
|
|
115
115
|
scope: "turn";
|
|
116
116
|
answerModes: ["single", "multiple", "free-text"];
|
|
117
|
-
cancellation: "native-
|
|
117
|
+
cancellation: "native-cancel" | "native-empty-answer" | "native-reject";
|
|
118
118
|
maxQuestions: number;
|
|
119
119
|
maxChoicesPerQuestion: number;
|
|
120
120
|
maxAnswerValuesPerQuestion: number | "complete-request";
|
|
@@ -133,7 +133,7 @@ export declare function createAcpComposerStore(connection: AcpConnection): {
|
|
|
133
133
|
status: "available";
|
|
134
134
|
scope: "session";
|
|
135
135
|
inputs: ["image", "file"];
|
|
136
|
-
imageMimeTypes:
|
|
136
|
+
imageMimeTypes: "provider-dependent" | string[];
|
|
137
137
|
fileMimeTypes: "provider-dependent" | "valid-type/subtype";
|
|
138
138
|
maxMimeTypeBytes: number;
|
|
139
139
|
maxFilenameBytes: number;
|
|
@@ -186,6 +186,7 @@ export declare function createAcpComposerStore(connection: AcpConnection): {
|
|
|
186
186
|
} | undefined;
|
|
187
187
|
models: (sessionId: string) => {
|
|
188
188
|
selectedId: string;
|
|
189
|
+
effortId?: string | undefined;
|
|
189
190
|
options: {
|
|
190
191
|
id: string;
|
|
191
192
|
label: string;
|
|
@@ -195,14 +196,13 @@ export declare function createAcpComposerStore(connection: AcpConnection): {
|
|
|
195
196
|
name?: string | undefined;
|
|
196
197
|
}[] | undefined;
|
|
197
198
|
}[];
|
|
198
|
-
effortId?: string | undefined;
|
|
199
199
|
} | undefined;
|
|
200
200
|
/** The newest reading, or none while the provider has reported none. */
|
|
201
201
|
context: (sessionId: string) => {
|
|
202
202
|
usedTokens: number;
|
|
203
203
|
maxTokens: number;
|
|
204
|
-
source: "provider-usage" | "provider-usage-plus-estimate" | "local-estimate";
|
|
205
204
|
estimated?: true | undefined;
|
|
205
|
+
source: "local-estimate" | "provider-usage" | "provider-usage-plus-estimate";
|
|
206
206
|
breakdown?: {
|
|
207
207
|
systemTokens: number;
|
|
208
208
|
toolTokens: number;
|
|
@@ -219,6 +219,7 @@ export declare function createAcpComposerStore(connection: AcpConnection): {
|
|
|
219
219
|
modelFeed: (sessionId: string) => ComposerModelFeed;
|
|
220
220
|
selectModel: (sessionId: string, selectedId: string) => Promise<{
|
|
221
221
|
selectedId: string;
|
|
222
|
+
effortId?: string | undefined;
|
|
222
223
|
options: {
|
|
223
224
|
id: string;
|
|
224
225
|
label: string;
|
|
@@ -228,10 +229,10 @@ export declare function createAcpComposerStore(connection: AcpConnection): {
|
|
|
228
229
|
name?: string | undefined;
|
|
229
230
|
}[] | undefined;
|
|
230
231
|
}[];
|
|
231
|
-
effortId?: string | undefined;
|
|
232
232
|
}>;
|
|
233
233
|
selectEffort: (sessionId: string, effortId: string) => Promise<{
|
|
234
234
|
selectedId: string;
|
|
235
|
+
effortId?: string | undefined;
|
|
235
236
|
options: {
|
|
236
237
|
id: string;
|
|
237
238
|
label: string;
|
|
@@ -241,6 +242,5 @@ export declare function createAcpComposerStore(connection: AcpConnection): {
|
|
|
241
242
|
name?: string | undefined;
|
|
242
243
|
}[] | undefined;
|
|
243
244
|
}[];
|
|
244
|
-
effortId?: string | undefined;
|
|
245
245
|
}>;
|
|
246
246
|
};
|
|
@@ -17,6 +17,13 @@ export type AcpSessionStoreOptions = {
|
|
|
17
17
|
export declare function createAcpSessionStore({ connection, now, onTurnFinished, }: AcpSessionStoreOptions): {
|
|
18
18
|
subscribe: (sessionId: string, agentId?: string) => () => void;
|
|
19
19
|
dispose(): void;
|
|
20
|
+
/**
|
|
21
|
+
* A connection that starts over re-sends every request still open as it
|
|
22
|
+
* catches up, so one the old connection left open and the new one does
|
|
23
|
+
* not name was settled while nobody was listening; and what it re-sends
|
|
24
|
+
* is no longer marked as already seen.
|
|
25
|
+
*/
|
|
26
|
+
startOver(): void;
|
|
20
27
|
put: (sessionId: string, info: HgwSessionInfoMeta, updatedAt?: string | null) => void;
|
|
21
28
|
rowsFor: (sessionIds: Iterable<string>) => {
|
|
22
29
|
sessionId: string;
|
|
@@ -53,12 +60,12 @@ export declare function rowOf(session: SessionInfo): {
|
|
|
53
60
|
sessionId: string;
|
|
54
61
|
info: {
|
|
55
62
|
agentId: string;
|
|
56
|
-
status: "
|
|
63
|
+
status: "failed" | "idle" | "running" | "unknown" | "waiting-for-input";
|
|
57
64
|
archived: boolean;
|
|
58
65
|
createdAt?: string | undefined;
|
|
59
66
|
unread?: boolean | undefined;
|
|
60
67
|
pinned?: boolean | undefined;
|
|
61
|
-
platform?: "buzz" | "
|
|
68
|
+
platform?: "buzz" | "discord" | "email" | "slack" | "telegram" | "whatsapp" | undefined;
|
|
62
69
|
};
|
|
63
70
|
updatedAt: string | null | undefined;
|
|
64
71
|
title: string | null | undefined;
|
|
@@ -23,22 +23,24 @@ export declare function createAcpWorkspaceClient({ connection, rest, agentIdFor,
|
|
|
23
23
|
id: string;
|
|
24
24
|
name: string;
|
|
25
25
|
description?: string | undefined;
|
|
26
|
-
status?: "active" | "
|
|
27
|
-
activity?: "active" | "
|
|
28
|
-
visibility?: "
|
|
26
|
+
status?: "active" | "attention" | "idle" | "running" | "unknown" | undefined;
|
|
27
|
+
activity?: "active" | "idle" | "unknown" | undefined;
|
|
28
|
+
visibility?: "hidden" | "visible" | undefined;
|
|
29
29
|
role?: "creator" | undefined;
|
|
30
30
|
avatar?: string | undefined;
|
|
31
|
+
muted?: true | undefined;
|
|
31
32
|
}[]>;
|
|
32
33
|
refreshAgents(): Promise<{
|
|
33
34
|
kind: "ready";
|
|
34
35
|
id: string;
|
|
35
36
|
name: string;
|
|
36
37
|
description?: string | undefined;
|
|
37
|
-
status?: "active" | "
|
|
38
|
-
activity?: "active" | "
|
|
39
|
-
visibility?: "
|
|
38
|
+
status?: "active" | "attention" | "idle" | "running" | "unknown" | undefined;
|
|
39
|
+
activity?: "active" | "idle" | "unknown" | undefined;
|
|
40
|
+
visibility?: "hidden" | "visible" | undefined;
|
|
40
41
|
role?: "creator" | undefined;
|
|
41
42
|
avatar?: string | undefined;
|
|
43
|
+
muted?: true | undefined;
|
|
42
44
|
}[]>;
|
|
43
45
|
listAgentCatalog(): Promise<{
|
|
44
46
|
summary: {
|
|
@@ -46,21 +48,22 @@ export declare function createAcpWorkspaceClient({ connection, rest, agentIdFor,
|
|
|
46
48
|
id: string;
|
|
47
49
|
name: string;
|
|
48
50
|
description?: string | undefined;
|
|
49
|
-
status?: "active" | "
|
|
50
|
-
activity?: "active" | "
|
|
51
|
-
visibility?: "
|
|
51
|
+
status?: "active" | "attention" | "idle" | "running" | "unknown" | undefined;
|
|
52
|
+
activity?: "active" | "idle" | "unknown" | undefined;
|
|
53
|
+
visibility?: "hidden" | "visible" | undefined;
|
|
52
54
|
role?: "creator" | undefined;
|
|
53
55
|
avatar?: string | undefined;
|
|
56
|
+
muted?: true | undefined;
|
|
54
57
|
};
|
|
55
|
-
visibility: "
|
|
58
|
+
visibility: "hidden" | "visible";
|
|
56
59
|
selectable: boolean;
|
|
57
60
|
editable: boolean;
|
|
58
61
|
avatarEditable: boolean;
|
|
62
|
+
muteEditable: boolean;
|
|
59
63
|
}[]>;
|
|
60
64
|
updateAgent: (agentId: string, patch: AgentUpdate) => Promise<void>;
|
|
61
65
|
subscribeAgentCatalog: (listener: () => void) => () => void;
|
|
62
66
|
listSessions: (agentId?: string, cursor?: string) => Promise<{
|
|
63
|
-
nextCursor?: string | undefined;
|
|
64
67
|
sessions: {
|
|
65
68
|
sessionId: string;
|
|
66
69
|
agentId: string;
|
|
@@ -72,6 +75,7 @@ export declare function createAcpWorkspaceClient({ connection, rest, agentIdFor,
|
|
|
72
75
|
createdAt?: string;
|
|
73
76
|
platform?: import("./workspace.js").SessionPlatform;
|
|
74
77
|
}[];
|
|
78
|
+
nextCursor?: string | undefined;
|
|
75
79
|
}>;
|
|
76
80
|
readSessionPage: (meta: Parameters<AcpConnection["listSessions"]>[0], cursor?: string) => Promise<{
|
|
77
81
|
sessions: SessionInfo[];
|
|
@@ -122,15 +126,15 @@ export declare function createAcpWorkspaceClient({ connection, rest, agentIdFor,
|
|
|
122
126
|
workspaceCapabilities: (sessionId: string) => {
|
|
123
127
|
workspace: {
|
|
124
128
|
slashCommands: {
|
|
125
|
-
status: "unavailable";
|
|
126
|
-
reason: string;
|
|
127
|
-
} | {
|
|
128
129
|
status: "available";
|
|
129
130
|
scope: "session";
|
|
130
131
|
commands: {
|
|
131
132
|
name: string;
|
|
132
133
|
description?: string | undefined;
|
|
133
134
|
}[];
|
|
135
|
+
} | {
|
|
136
|
+
status: "unavailable";
|
|
137
|
+
reason: string;
|
|
134
138
|
};
|
|
135
139
|
models: {
|
|
136
140
|
status: "unavailable";
|
|
@@ -204,7 +208,7 @@ export declare function createAcpWorkspaceClient({ connection, rest, agentIdFor,
|
|
|
204
208
|
protocol: "acp-request";
|
|
205
209
|
scope: "turn";
|
|
206
210
|
answerModes: ["single", "multiple", "free-text"];
|
|
207
|
-
cancellation: "native-
|
|
211
|
+
cancellation: "native-cancel" | "native-empty-answer" | "native-reject";
|
|
208
212
|
maxQuestions: number;
|
|
209
213
|
maxChoicesPerQuestion: number;
|
|
210
214
|
maxAnswerValuesPerQuestion: number | "complete-request";
|
|
@@ -223,7 +227,7 @@ export declare function createAcpWorkspaceClient({ connection, rest, agentIdFor,
|
|
|
223
227
|
status: "available";
|
|
224
228
|
scope: "session";
|
|
225
229
|
inputs: ["image", "file"];
|
|
226
|
-
imageMimeTypes:
|
|
230
|
+
imageMimeTypes: "provider-dependent" | string[];
|
|
227
231
|
fileMimeTypes: "provider-dependent" | "valid-type/subtype";
|
|
228
232
|
maxMimeTypeBytes: number;
|
|
229
233
|
maxFilenameBytes: number;
|
|
@@ -276,6 +280,7 @@ export declare function createAcpWorkspaceClient({ connection, rest, agentIdFor,
|
|
|
276
280
|
} | undefined;
|
|
277
281
|
models: (sessionId: string) => {
|
|
278
282
|
selectedId: string;
|
|
283
|
+
effortId?: string | undefined;
|
|
279
284
|
options: {
|
|
280
285
|
id: string;
|
|
281
286
|
label: string;
|
|
@@ -285,14 +290,13 @@ export declare function createAcpWorkspaceClient({ connection, rest, agentIdFor,
|
|
|
285
290
|
name?: string | undefined;
|
|
286
291
|
}[] | undefined;
|
|
287
292
|
}[];
|
|
288
|
-
effortId?: string | undefined;
|
|
289
293
|
} | undefined;
|
|
290
294
|
/** The newest usage the provider pushed. */
|
|
291
295
|
context: (sessionId: string) => {
|
|
292
296
|
usedTokens: number;
|
|
293
297
|
maxTokens: number;
|
|
294
|
-
source: "provider-usage" | "provider-usage-plus-estimate" | "local-estimate";
|
|
295
298
|
estimated?: true | undefined;
|
|
299
|
+
source: "local-estimate" | "provider-usage" | "provider-usage-plus-estimate";
|
|
296
300
|
breakdown?: {
|
|
297
301
|
systemTokens: number;
|
|
298
302
|
toolTokens: number;
|
|
@@ -310,6 +314,7 @@ export declare function createAcpWorkspaceClient({ connection, rest, agentIdFor,
|
|
|
310
314
|
modelFeed: (sessionId: string) => import("./workspace.js").ComposerModelFeed;
|
|
311
315
|
selectModel: (sessionId: string, selectedId: string) => Promise<{
|
|
312
316
|
selectedId: string;
|
|
317
|
+
effortId?: string | undefined;
|
|
313
318
|
options: {
|
|
314
319
|
id: string;
|
|
315
320
|
label: string;
|
|
@@ -319,10 +324,10 @@ export declare function createAcpWorkspaceClient({ connection, rest, agentIdFor,
|
|
|
319
324
|
name?: string | undefined;
|
|
320
325
|
}[] | undefined;
|
|
321
326
|
}[];
|
|
322
|
-
effortId?: string | undefined;
|
|
323
327
|
}>;
|
|
324
328
|
selectEffort: (sessionId: string, effortId: string) => Promise<{
|
|
325
329
|
selectedId: string;
|
|
330
|
+
effortId?: string | undefined;
|
|
326
331
|
options: {
|
|
327
332
|
id: string;
|
|
328
333
|
label: string;
|
|
@@ -332,7 +337,6 @@ export declare function createAcpWorkspaceClient({ connection, rest, agentIdFor,
|
|
|
332
337
|
name?: string | undefined;
|
|
333
338
|
}[] | undefined;
|
|
334
339
|
}[];
|
|
335
|
-
effortId?: string | undefined;
|
|
336
340
|
}>;
|
|
337
341
|
/** One provider write per half; the response settles what the Session runs. */
|
|
338
342
|
updateModel(sessionId: string, patch: SessionModelUpdateRequest): Promise<SessionModelUpdateResponse>;
|
|
@@ -340,14 +344,14 @@ export declare function createAcpWorkspaceClient({ connection, rest, agentIdFor,
|
|
|
340
344
|
requestId: string;
|
|
341
345
|
text: string;
|
|
342
346
|
}) => Promise<{
|
|
343
|
-
status: "
|
|
347
|
+
status: "queued" | "steered";
|
|
344
348
|
}>;
|
|
345
349
|
runtimeInfo: (signal?: AbortSignal) => Promise<{
|
|
346
350
|
runtime: {
|
|
347
351
|
id: string;
|
|
348
352
|
name: string;
|
|
349
353
|
};
|
|
350
|
-
status: "
|
|
354
|
+
status: "degraded" | "ready" | "unavailable";
|
|
351
355
|
capabilities: {
|
|
352
356
|
agentCatalog: {
|
|
353
357
|
status: "available";
|
|
@@ -465,8 +469,8 @@ export declare function createAcpWorkspaceClient({ connection, rest, agentIdFor,
|
|
|
465
469
|
filename?: string | undefined;
|
|
466
470
|
} | {
|
|
467
471
|
type: "file";
|
|
468
|
-
mimeType: string;
|
|
469
472
|
filename?: string | undefined;
|
|
473
|
+
mimeType: string;
|
|
470
474
|
})[];
|
|
471
475
|
}>;
|
|
472
476
|
readArtifact: (sessionId: string, artifactId: string, signal?: AbortSignal) => Promise<Blob>;
|
|
@@ -98,15 +98,15 @@ export declare function connectionMachine({ open, handshake, recover, inProcess,
|
|
|
98
98
|
generation: number;
|
|
99
99
|
attempt: number;
|
|
100
100
|
}, ConnectionEvent, {
|
|
101
|
-
[x: string]: import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<
|
|
101
|
+
[x: string]: import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<unknown, import("xstate").NonReducibleUnknown, import("xstate").EventObject> | import("xstate").PromiseActorLogic<void, import("xstate").NonReducibleUnknown, import("xstate").EventObject>> | undefined;
|
|
102
102
|
}, {
|
|
103
|
-
src: "open";
|
|
104
|
-
logic: import("xstate").PromiseActorLogic<void, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
|
|
105
|
-
id: string | undefined;
|
|
106
|
-
} | {
|
|
107
103
|
src: "handshake";
|
|
108
104
|
logic: import("xstate").PromiseActorLogic<unknown, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
|
|
109
105
|
id: string | undefined;
|
|
106
|
+
} | {
|
|
107
|
+
src: "open";
|
|
108
|
+
logic: import("xstate").PromiseActorLogic<void, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
|
|
109
|
+
id: string | undefined;
|
|
110
110
|
} | {
|
|
111
111
|
src: "recover";
|
|
112
112
|
logic: import("xstate").PromiseActorLogic<void, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
|
|
@@ -119,6 +119,9 @@ export declare function connectionMachine({ open, handshake, recover, inProcess,
|
|
|
119
119
|
event: string;
|
|
120
120
|
}[];
|
|
121
121
|
};
|
|
122
|
+
} | {
|
|
123
|
+
type: "bumpGeneration";
|
|
124
|
+
params: undefined;
|
|
122
125
|
} | {
|
|
123
126
|
type: "clearAfter";
|
|
124
127
|
params: {
|
|
@@ -127,29 +130,26 @@ export declare function connectionMachine({ open, handshake, recover, inProcess,
|
|
|
127
130
|
event: string;
|
|
128
131
|
}[];
|
|
129
132
|
};
|
|
133
|
+
} | {
|
|
134
|
+
type: "closeTransport";
|
|
135
|
+
params: unknown;
|
|
136
|
+
} | {
|
|
137
|
+
type: "countAttempt";
|
|
138
|
+
params: undefined;
|
|
130
139
|
} | {
|
|
131
140
|
type: "logTransition";
|
|
132
141
|
params: {
|
|
133
142
|
to: string;
|
|
134
143
|
info: boolean;
|
|
135
144
|
};
|
|
136
|
-
} | {
|
|
137
|
-
type: "bumpGeneration";
|
|
138
|
-
params: undefined;
|
|
139
|
-
} | {
|
|
140
|
-
type: "closeTransport";
|
|
141
|
-
params: unknown;
|
|
142
|
-
} | {
|
|
143
|
-
type: "markReady";
|
|
144
|
-
params: unknown;
|
|
145
145
|
} | {
|
|
146
146
|
type: "lose";
|
|
147
147
|
params: {
|
|
148
148
|
status: "reconnecting" | "capacity";
|
|
149
149
|
};
|
|
150
150
|
} | {
|
|
151
|
-
type: "
|
|
152
|
-
params:
|
|
151
|
+
type: "markReady";
|
|
152
|
+
params: unknown;
|
|
153
153
|
} | {
|
|
154
154
|
type: "resetAttempts";
|
|
155
155
|
params: undefined;
|
|
@@ -162,7 +162,7 @@ export declare function connectionMachine({ open, handshake, recover, inProcess,
|
|
|
162
162
|
} | {
|
|
163
163
|
type: "tryAgainLater";
|
|
164
164
|
params: unknown;
|
|
165
|
-
}, "capacity" | "handshake" | "
|
|
165
|
+
}, "capacity" | "handshake" | "reconnect" | "stable", "capacity" | "closed" | "connecting" | "handshaking" | "ready" | "reconnecting", string, import("xstate").NonReducibleUnknown, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
|
|
166
166
|
states: {
|
|
167
167
|
readonly connecting: {};
|
|
168
168
|
readonly handshaking: {};
|
|
@@ -209,6 +209,9 @@ export declare function sessionMachine({ join, replayOwed, oweReplay, transportL
|
|
|
209
209
|
event: string;
|
|
210
210
|
}[];
|
|
211
211
|
};
|
|
212
|
+
} | {
|
|
213
|
+
type: "bumpGeneration";
|
|
214
|
+
params: undefined;
|
|
212
215
|
} | {
|
|
213
216
|
type: "clearAfter";
|
|
214
217
|
params: {
|
|
@@ -217,6 +220,9 @@ export declare function sessionMachine({ join, replayOwed, oweReplay, transportL
|
|
|
217
220
|
event: string;
|
|
218
221
|
}[];
|
|
219
222
|
};
|
|
223
|
+
} | {
|
|
224
|
+
type: "countAttempt";
|
|
225
|
+
params: undefined;
|
|
220
226
|
} | {
|
|
221
227
|
type: "logTransition";
|
|
222
228
|
params: {
|
|
@@ -224,24 +230,18 @@ export declare function sessionMachine({ join, replayOwed, oweReplay, transportL
|
|
|
224
230
|
info: boolean;
|
|
225
231
|
};
|
|
226
232
|
} | {
|
|
227
|
-
type: "
|
|
228
|
-
params:
|
|
229
|
-
} | {
|
|
230
|
-
type: "countAttempt";
|
|
231
|
-
params: undefined;
|
|
233
|
+
type: "oweReplay";
|
|
234
|
+
params: unknown;
|
|
232
235
|
} | {
|
|
233
236
|
type: "resetAttempts";
|
|
234
237
|
params: undefined;
|
|
235
|
-
} | {
|
|
236
|
-
type: "oweReplay";
|
|
237
|
-
params: unknown;
|
|
238
238
|
}, {
|
|
239
239
|
type: "replayOwed";
|
|
240
240
|
params: unknown;
|
|
241
241
|
} | {
|
|
242
242
|
type: "transportLost";
|
|
243
243
|
params: unknown;
|
|
244
|
-
}, "retry", "
|
|
244
|
+
}, "retry", "detached" | "gone" | "joined" | "joining" | "refused" | "unavailable", string, import("xstate").NonReducibleUnknown, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
|
|
245
245
|
states: {
|
|
246
246
|
readonly joining: {};
|
|
247
247
|
readonly joined: {};
|