@harness-gw/sdk 0.16.1 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -4
- package/dist/chunks/index.js +42 -12
- package/dist/client/acp-workspace-client-composer.d.ts +1 -1
- package/dist/client/acp-workspace-client-sessions.d.ts +1 -1
- package/dist/client/acp-workspace-client.d.ts +10 -4
- package/dist/client/connection.d.ts +9 -2
- package/dist/client/hgw-client.d.ts +9 -3
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.js +183 -48
- package/dist/client/log.d.ts +2 -2
- package/dist/client/tolerant.d.ts +15 -0
- package/dist/client/types.d.ts +44 -4
- package/dist/client/workspace.d.ts +13 -0
- package/dist/protocol/acp.d.ts +182 -2
- package/dist/protocol/mcp-apps.d.ts +26 -10
- package/dist/protocol/push.d.ts +83 -9
- package/dist/protocol/sdk.js +12 -0
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -35,7 +35,8 @@ guest ── invite link ──────► guest listener ─────
|
|
|
35
35
|
permission requests and elicitations, and answer back the same way.
|
|
36
36
|
- **MCP Apps.** Tool results that carry a `ui://` view are served to the client
|
|
37
37
|
through the gateway, scoped to the tool call's own Session.
|
|
38
|
-
- **Attachments, Artifacts, voice and Web Push
|
|
38
|
+
- **Attachments, Artifacts, voice and push** (Web Push and APNs) over plain
|
|
39
|
+
HTTP routes.
|
|
39
40
|
- **A framework-free browser SDK.** No React, no browser globals: location,
|
|
40
41
|
storage, page visibility and logging arrive as options.
|
|
41
42
|
- **Origin-checked by default.** Each listener admits only its listed browser
|
|
@@ -63,7 +64,7 @@ You need a running harness. Hermes is the primary one; see
|
|
|
63
64
|
docker run --rm \
|
|
64
65
|
-v "$PWD/config.yaml:/run/harness-gw/config.yaml:ro" \
|
|
65
66
|
-v "$PWD/hermes-token:/run/secrets/hermes-token:ro" \
|
|
66
|
-
ghcr.io/almogbaku/harness-gw:0.
|
|
67
|
+
ghcr.io/almogbaku/harness-gw:0.18.0 \
|
|
67
68
|
config check --config /run/harness-gw/config.yaml
|
|
68
69
|
```
|
|
69
70
|
|
|
@@ -73,7 +74,7 @@ You need a running harness. Hermes is the primary one; see
|
|
|
73
74
|
docker run --rm -p 127.0.0.1:4100:4100 \
|
|
74
75
|
-v "$PWD/config.yaml:/run/harness-gw/config.yaml:ro" \
|
|
75
76
|
-v "$PWD/hermes-token:/run/secrets/hermes-token:ro" \
|
|
76
|
-
ghcr.io/almogbaku/harness-gw:0.
|
|
77
|
+
ghcr.io/almogbaku/harness-gw:0.18.0 \
|
|
77
78
|
serve --config /run/harness-gw/config.yaml
|
|
78
79
|
```
|
|
79
80
|
|
|
@@ -97,7 +98,7 @@ Without Docker, run the same CLI from a checkout with `bun run serve --config
|
|
|
97
98
|
## Use the SDK
|
|
98
99
|
|
|
99
100
|
```bash
|
|
100
|
-
npm install @harness-gw/sdk @agentclientprotocol/sdk @modelcontextprotocol/core zod
|
|
101
|
+
npm install @harness-gw/sdk @agentclientprotocol/sdk@2.7.0 @modelcontextprotocol/core zod
|
|
101
102
|
```
|
|
102
103
|
|
|
103
104
|
```ts
|
package/dist/chunks/index.js
CHANGED
|
@@ -103,17 +103,20 @@ function isMcpAppPolicyOrigin2(value) {
|
|
|
103
103
|
return false;
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
+
var MCP_APP_BUNDLED_PAGE_ORIGIN2 = "tauri://localhost";
|
|
107
|
+
function isMcpAppFramingOrigin2(value) {
|
|
108
|
+
return value === MCP_APP_BUNDLED_PAGE_ORIGIN2 || isMcpAppPolicyOrigin2(value);
|
|
109
|
+
}
|
|
106
110
|
function ownHosts({
|
|
107
111
|
frameAncestors,
|
|
108
112
|
sandboxOrigin
|
|
109
113
|
}) {
|
|
110
|
-
const
|
|
111
|
-
const invalid = origins.find((origin) => !isMcpAppPolicyOrigin2(origin));
|
|
114
|
+
const invalid = frameAncestors.find((origin) => !isMcpAppFramingOrigin2(origin)) ?? (isMcpAppPolicyOrigin2(sandboxOrigin) ? undefined : sandboxOrigin);
|
|
112
115
|
if (invalid !== undefined)
|
|
113
116
|
throw new Error(`Not an exact origin a sandbox policy can name: ${invalid}`);
|
|
114
117
|
if (frameAncestors.includes(sandboxOrigin))
|
|
115
118
|
throw new Error(`The sandbox origin is one of the host's: ${sandboxOrigin}`);
|
|
116
|
-
return new Set(
|
|
119
|
+
return new Set([...frameAncestors, sandboxOrigin].filter((origin) => origin !== MCP_APP_BUNDLED_PAGE_ORIGIN2).map((origin) => new URL(origin).host));
|
|
117
120
|
}
|
|
118
121
|
function namesHost(domain, hosts) {
|
|
119
122
|
try {
|
|
@@ -1029,6 +1032,9 @@ var HgwHistoryPageResponseMetaSchema2 = readObject({
|
|
|
1029
1032
|
var HgwHistoryPageTagSchema2 = readObject({
|
|
1030
1033
|
historyPage: readObject({ cursor: z3.string().min(1).max(256) }).optional()
|
|
1031
1034
|
});
|
|
1035
|
+
var HgwSessionSetupResponseMetaSchema2 = readObject({
|
|
1036
|
+
capabilities: SessionWorkspaceCapabilitiesResponseSchema2
|
|
1037
|
+
});
|
|
1032
1038
|
var HgwSessionResumeResponseMetaSchema2 = readObject({
|
|
1033
1039
|
position: readObject({
|
|
1034
1040
|
turnId: IdentifierSchema2,
|
|
@@ -1273,20 +1279,44 @@ var PushSubscriptionJsonSchema2 = z4.strictObject({
|
|
|
1273
1279
|
auth: Base64UrlSchema.length(22)
|
|
1274
1280
|
})
|
|
1275
1281
|
});
|
|
1282
|
+
var apnsAvailability = { apns: z4.literal(true).optional() };
|
|
1276
1283
|
var PushInfoSchema2 = z4.discriminatedUnion("status", [
|
|
1277
|
-
z4.strictObject({ status: z4.literal("not-configured") }),
|
|
1284
|
+
z4.strictObject({ status: z4.literal("not-configured"), ...apnsAvailability }),
|
|
1278
1285
|
z4.strictObject({
|
|
1279
1286
|
status: z4.literal("available"),
|
|
1280
|
-
publicKey: Base64UrlSchema.length(87)
|
|
1287
|
+
publicKey: Base64UrlSchema.length(87),
|
|
1288
|
+
...apnsAvailability
|
|
1281
1289
|
})
|
|
1282
1290
|
]);
|
|
1283
|
-
var
|
|
1284
|
-
subscription: PushSubscriptionJsonSchema2,
|
|
1291
|
+
var devicePreferences = {
|
|
1285
1292
|
locale: PushLocaleSchema2,
|
|
1286
1293
|
categories: PushCategoriesSchema2
|
|
1287
|
-
}
|
|
1288
|
-
var
|
|
1289
|
-
|
|
1290
|
-
|
|
1294
|
+
};
|
|
1295
|
+
var WebPushRegistrationSchema2 = z4.strictObject({
|
|
1296
|
+
transport: z4.literal("web-push").optional(),
|
|
1297
|
+
subscription: PushSubscriptionJsonSchema2,
|
|
1298
|
+
...devicePreferences
|
|
1299
|
+
});
|
|
1300
|
+
var ApnsDeviceTokenSchema2 = z4.string().regex(/^(?:[0-9a-f]{2}){32,100}$/iu).toLowerCase();
|
|
1301
|
+
var ApnsRegistrationSchema2 = z4.strictObject({
|
|
1302
|
+
transport: z4.literal("apns"),
|
|
1303
|
+
token: ApnsDeviceTokenSchema2,
|
|
1304
|
+
environment: z4.enum(["sandbox", "production"]),
|
|
1305
|
+
...devicePreferences
|
|
1306
|
+
});
|
|
1307
|
+
var PushRegistrationSchema2 = z4.discriminatedUnion("transport", [
|
|
1308
|
+
WebPushRegistrationSchema2,
|
|
1309
|
+
ApnsRegistrationSchema2
|
|
1310
|
+
]);
|
|
1311
|
+
var PushUnregistrationSchema2 = z4.discriminatedUnion("transport", [
|
|
1312
|
+
z4.strictObject({
|
|
1313
|
+
transport: z4.literal("web-push").optional(),
|
|
1314
|
+
endpoint: z4.string().max(2048)
|
|
1315
|
+
}),
|
|
1316
|
+
z4.strictObject({
|
|
1317
|
+
transport: z4.literal("apns"),
|
|
1318
|
+
token: ApnsDeviceTokenSchema2
|
|
1319
|
+
})
|
|
1320
|
+
]);
|
|
1291
1321
|
|
|
1292
|
-
export { CallToolResultSchema2, EmptyResultSchema2, ReadResourceResultSchema2, McpUiCspSchema2, isMcpAppCspDomain2, McpUiPermissionsSchema2, McpAppFilesSchema2, McpUiDomainSchema2, McpAppViewSchema2, viewerFileResult2, McpAppToolCallRequestSchema2, McpAppResourceReadRequestSchema2, McpAppModelContextRequestSchema2, MAX_MCP_APP_FILE_BYTES2, McpAppFileReadFailureSchema2, McpAppFileReadErrorDataSchema2, MCP_APP_SANDBOX_PATH2, isMcpAppPolicyOrigin2, appliedMcpAppCsp2, mcpAppSandboxPolicy2, 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, SessionCompactionActivityMessageSchema2, SessionChildActivityMessageSchema2, SessionActivityMessageSchema2, 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_PERMISSION_KIND_SESSION2, HGW_PLAN_ID2, HGW_JSONRPC_ERRORS2, HGW_MAX_FRAME_BYTES2, IdentifierSchema2, HgwExtensionsSchema2, HgwClientCapabilitiesMetaSchema2, HgwInitializeMetaSchema2, HgwLoginMetaSchema2, HgwSessionNewMetaSchema2, HgwSessionListMetaSchema2, HgwSessionSearchMetaSchema2, HgwSessionSearchResponseSchema2, HgwSessionInfoMetaSchema2, HgwSessionResumeMetaSchema2, HGW_REPLAY_POSITION2, HgwReplayPositionSchema2, HGW_REPLAY_BEFORE2, HgwReplayBeforeSchema2, HgwHistoryCursorSchema2, HgwHistoryPageResponseMetaSchema2, HgwHistoryPageTagSchema2, HgwSessionResumeResponseMetaSchema2, HgwPromptMetaSchema2, HgwSessionUpdateRequestSchema2, HgwSessionPartRequestSchema2, HgwSteerRequestSchema2, HgwSteerResponseSchema2, HgwFocusRequestSchema2, HgwAgentsListResponseSchema2, HgwAgentUpdateRequestSchema2, HgwAgentUpdateResponseSchema2, HgwTurnMetaSchema2, HgwNoticeMetaSchema2, HgwMessageMetaSchema2, HgwCostSchema2, HgwChildSessionMetaSchema2, 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 };
|
|
1322
|
+
export { CallToolResultSchema2, EmptyResultSchema2, ReadResourceResultSchema2, McpUiCspSchema2, isMcpAppCspDomain2, McpUiPermissionsSchema2, McpAppFilesSchema2, McpUiDomainSchema2, McpAppViewSchema2, viewerFileResult2, McpAppToolCallRequestSchema2, McpAppResourceReadRequestSchema2, McpAppModelContextRequestSchema2, MAX_MCP_APP_FILE_BYTES2, McpAppFileReadFailureSchema2, McpAppFileReadErrorDataSchema2, MCP_APP_SANDBOX_PATH2, isMcpAppPolicyOrigin2, MCP_APP_BUNDLED_PAGE_ORIGIN2, isMcpAppFramingOrigin2, appliedMcpAppCsp2, mcpAppSandboxPolicy2, 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, SessionCompactionActivityMessageSchema2, SessionChildActivityMessageSchema2, SessionActivityMessageSchema2, 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_PERMISSION_KIND_SESSION2, HGW_PLAN_ID2, HGW_JSONRPC_ERRORS2, HGW_MAX_FRAME_BYTES2, IdentifierSchema2, HgwExtensionsSchema2, HgwClientCapabilitiesMetaSchema2, HgwInitializeMetaSchema2, HgwLoginMetaSchema2, HgwSessionNewMetaSchema2, HgwSessionListMetaSchema2, HgwSessionSearchMetaSchema2, HgwSessionSearchResponseSchema2, HgwSessionInfoMetaSchema2, HgwSessionResumeMetaSchema2, HGW_REPLAY_POSITION2, HgwReplayPositionSchema2, HGW_REPLAY_BEFORE2, HgwReplayBeforeSchema2, HgwHistoryCursorSchema2, HgwHistoryPageResponseMetaSchema2, HgwHistoryPageTagSchema2, HgwSessionSetupResponseMetaSchema2, HgwSessionResumeResponseMetaSchema2, HgwPromptMetaSchema2, HgwSessionUpdateRequestSchema2, HgwSessionPartRequestSchema2, HgwSteerRequestSchema2, HgwSteerResponseSchema2, HgwFocusRequestSchema2, HgwAgentsListResponseSchema2, HgwAgentUpdateRequestSchema2, HgwAgentUpdateResponseSchema2, HgwTurnMetaSchema2, HgwNoticeMetaSchema2, HgwMessageMetaSchema2, HgwCostSchema2, HgwChildSessionMetaSchema2, 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, WebPushRegistrationSchema2, ApnsDeviceTokenSchema2, ApnsRegistrationSchema2, PushRegistrationSchema2, PushUnregistrationSchema2 };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SessionConfigOption, type Usage } from "@agentclientprotocol/sdk/experimental/v2";
|
|
1
|
+
import { SessionConfigOption, type Usage } from "@agentclientprotocol/sdk/experimental/v2/unstable";
|
|
2
2
|
import { type HgwCost } from "../protocol/acp.js";
|
|
3
3
|
import type { ComposerModelFeed, ComposerTurnUsage } from "./workspace.js";
|
|
4
4
|
import type { HgwModelChoices } from "./hgw-client.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type SessionInfo } from "@agentclientprotocol/sdk/experimental/v2";
|
|
1
|
+
import { type SessionInfo } from "@agentclientprotocol/sdk/experimental/v2/unstable";
|
|
2
2
|
import { type HgwSessionInfoMeta } from "../protocol/acp.js";
|
|
3
3
|
import type { SessionMetadata, SessionStatus, TodoItem, WorkspaceActivityEvent } from "./workspace.js";
|
|
4
4
|
import type { Logger } from "../lifecycle/index.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SessionInfo } from "@agentclientprotocol/sdk/experimental/v2";
|
|
1
|
+
import type { SessionInfo } from "@agentclientprotocol/sdk/experimental/v2/unstable";
|
|
2
2
|
import { type Clock, type Logger } from "../lifecycle/index.js";
|
|
3
3
|
import type { SessionModelUpdateRequest, SessionModelUpdateResponse } from "../protocol/index.js";
|
|
4
4
|
import type { AgentUpdate, SessionActionCapabilities, SessionCreationOptions, SessionSearchResult } from "./workspace.js";
|
|
@@ -105,6 +105,12 @@ export declare function createAcpWorkspaceClient({ connection, rest, agentIdFor,
|
|
|
105
105
|
createSession(agentId: string, options?: SessionCreationOptions): Promise<{
|
|
106
106
|
sessionId: string;
|
|
107
107
|
}>;
|
|
108
|
+
/**
|
|
109
|
+
* Ends a Session nothing will use, as an abandoned draft's, stopping its
|
|
110
|
+
* work; one the gateway no longer has resolves as closed. A hold on it
|
|
111
|
+
* stays the holder's to release.
|
|
112
|
+
*/
|
|
113
|
+
closeSession: (sessionId: string) => Promise<void>;
|
|
108
114
|
subscribeSession: (sessionId: string) => () => void;
|
|
109
115
|
markSessionRead(sessionId: string): Promise<void>;
|
|
110
116
|
/** The row leads the write, so a refused pin has to be taken back. */
|
|
@@ -128,15 +134,15 @@ export declare function createAcpWorkspaceClient({ connection, rest, agentIdFor,
|
|
|
128
134
|
workspaceCapabilities: (sessionId: string) => {
|
|
129
135
|
workspace: {
|
|
130
136
|
slashCommands: {
|
|
131
|
-
status: "unavailable";
|
|
132
|
-
reason: string;
|
|
133
|
-
} | {
|
|
134
137
|
status: "available";
|
|
135
138
|
scope: "session";
|
|
136
139
|
commands: {
|
|
137
140
|
name: string;
|
|
138
141
|
description?: string | undefined;
|
|
139
142
|
}[];
|
|
143
|
+
} | {
|
|
144
|
+
status: "unavailable";
|
|
145
|
+
reason: string;
|
|
140
146
|
};
|
|
141
147
|
models: {
|
|
142
148
|
status: "unavailable";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type AgentApp } from "@agentclientprotocol/sdk/experimental/v2";
|
|
1
|
+
import { SessionUpdate, type AgentApp } from "@agentclientprotocol/sdk/experimental/v2/unstable";
|
|
2
2
|
import { type WebSocketConstructor } from "@agentclientprotocol/sdk/experimental/ws-client";
|
|
3
3
|
import { createOwner, type Clock, type Logger } from "../lifecycle/index.js";
|
|
4
|
-
import type { AcpConnection } from "./types.js";
|
|
4
|
+
import type { AcpConnection, AcpSessionSetup } from "./types.js";
|
|
5
5
|
/** Where the client logs when its caller passes no logger. */
|
|
6
6
|
export declare const SILENT_LOGGER: Logger;
|
|
7
7
|
/**
|
|
@@ -50,6 +50,13 @@ export type AcpConnectionOptions = {
|
|
|
50
50
|
});
|
|
51
51
|
/** Whether the gateway refused an invitation it cannot redeem. */
|
|
52
52
|
export declare function isAuthenticationRequired(error: unknown): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* What a `config_option_update` or `available_commands_update` reports of its
|
|
55
|
+
* Session's setup, from the update and its `_meta.hgw`; undefined for any
|
|
56
|
+
* other update. Capabilities this client cannot read are left out, never the
|
|
57
|
+
* commands they travel with.
|
|
58
|
+
*/
|
|
59
|
+
export declare function setupOfUpdate(update: SessionUpdate, meta: unknown): AcpSessionSetup | undefined;
|
|
53
60
|
/** One of the gateway's ACP listener paths as a WebSocket URL from `base`. */
|
|
54
61
|
export declare function acpSocketUrl(path: string, base: string): string;
|
|
55
62
|
type ConnectionEvent = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { z } from "zod";
|
|
2
2
|
import { SessionContextResponseSchema, SessionModelsResponseSchema, SessionWorkspaceCapabilitiesResponseSchema } from "../protocol/index.js";
|
|
3
|
-
import { type PushRegistration } from "../protocol/push.js";
|
|
3
|
+
import { type PushRegistration, type PushUnregistration } from "../protocol/push.js";
|
|
4
4
|
import { type McpAppFileReadFailure, type McpAppModelContextRequest, type McpAppResourceReadRequest, type McpAppToolCallRequest } from "../protocol/mcp-apps.js";
|
|
5
5
|
import type { StagedAttachment } from "./workspace.js";
|
|
6
6
|
export type HgwWorkspaceCapabilities = z.infer<typeof SessionWorkspaceCapabilitiesResponseSchema>;
|
|
@@ -164,14 +164,20 @@ export declare class HgwRemoteClient {
|
|
|
164
164
|
}>;
|
|
165
165
|
/** What this deployment offers for alerts while no tab is open. */
|
|
166
166
|
pushInfo(signal?: AbortSignal): Promise<{
|
|
167
|
+
apns?: true | undefined;
|
|
167
168
|
status: "not-configured";
|
|
168
169
|
} | {
|
|
170
|
+
apns?: true | undefined;
|
|
169
171
|
status: "available";
|
|
170
172
|
publicKey: string;
|
|
171
173
|
}>;
|
|
172
|
-
/**
|
|
174
|
+
/**
|
|
175
|
+
* Registering the same device again is how a preference change travels. A
|
|
176
|
+
* registration naming no `transport` is a browser's, through Web Push.
|
|
177
|
+
*/
|
|
173
178
|
putPushSubscription(registration: PushRegistration): Promise<void>;
|
|
174
|
-
|
|
179
|
+
/** Names the device by its transport's own key: an endpoint, or a token. */
|
|
180
|
+
deletePushSubscription(device: PushUnregistration): Promise<void>;
|
|
175
181
|
/** REST authorizes byte routes per Agent, so every Session names its owner. */
|
|
176
182
|
adoptSessionOwnership(sessionId: string, agentId: string): void;
|
|
177
183
|
stageAttachments(sessionId: string, attachments: readonly StagedAttachment[]): Promise<{
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** `@harness-gw/sdk`: the browser client for the gateway's ACP and HTTP APIs. */
|
|
2
2
|
export { acpSocketUrl, createAcpConnection, isAuthenticationRequired, SILENT_LOGGER, type AcpConnectionOptions, type OwnerInspector, type PageSignals, } from "./connection.js";
|
|
3
|
-
export type { AcpConnection, AcpConnectionOutage, AcpConnectionStatus, AcpHistoryPage, AcpPendingRequest, AcpSessionListener, AcpSessionReplayListener, AcpSessionState, AcpSessionUpdateListener, } from "./types.js";
|
|
3
|
+
export type { AcpConnection, AcpConnectionOutage, AcpConnectionStatus, AcpHistoryPage, AcpPendingRequest, AcpSessionListener, AcpSessionReplayListener, AcpSessionSetup, AcpSessionState, AcpSessionUpdateListener, } from "./types.js";
|
|
4
4
|
export { createAcpWorkspaceClient, type AcpWorkspaceClient, type AcpWorkspaceClientOptions, } from "./acp-workspace-client.js";
|
|
5
5
|
export { createAcpComposerStore, foldTurnUsage, projectModels, type AcpModelProjection, type AcpTurnUsage, } from "./acp-workspace-client-composer.js";
|
|
6
6
|
export { createAcpApprovals, isSettledApproval, type AcpApproval, type AcpApprovalOption, type AcpApprovals, } from "./acp-approvals.js";
|