@harness-gw/sdk 0.3.0 → 0.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/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.3.0 \
66
+ ghcr.io/almogbaku/harness-gw:0.4.0 \
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.3.0 \
76
+ ghcr.io/almogbaku/harness-gw:0.4.0 \
77
77
  serve --config /run/harness-gw/config.yaml
78
78
  ```
79
79
 
@@ -97,7 +97,7 @@ Without Docker, run the same CLI from a checkout with `bun run serve --config
97
97
  ## Use the SDK
98
98
 
99
99
  ```bash
100
- npm install @harness-gw/sdk @agentclientprotocol/sdk @modelcontextprotocol/sdk zod
100
+ npm install @harness-gw/sdk @agentclientprotocol/sdk @modelcontextprotocol/core zod
101
101
  ```
102
102
 
103
103
  ```ts
@@ -1,3 +1,6 @@
1
+ // protocol/acp.ts
2
+ import { z as z2 } from "zod";
3
+
1
4
  // protocol/index.ts
2
5
  import { z } from "zod";
3
6
  var SESSION_CATALOG_MAX_WINDOW2 = 1000;
@@ -128,8 +131,8 @@ var SessionSchema2 = z.strictObject({
128
131
  agentId: IdentifierSchema,
129
132
  title: z.string().min(1).max(4096).optional(),
130
133
  archived: z.boolean(),
131
- createdAt: z.string().datetime().optional(),
132
- updatedAt: z.string().datetime().optional(),
134
+ createdAt: z.iso.datetime().optional(),
135
+ updatedAt: z.iso.datetime().optional(),
133
136
  status: SessionStatusSchema2,
134
137
  unread: z.boolean().optional(),
135
138
  pinned: z.boolean().optional(),
@@ -216,8 +219,8 @@ var SessionMessagePartSchema = z.discriminatedUnion("type", [
216
219
  kind: z.enum(Object.values(ToolKind2)).optional(),
217
220
  locations: z.array(ToolLocationSchema2).max(256).optional(),
218
221
  diffs: z.array(ToolDiffSchema2).max(64).optional(),
219
- startedAt: z.string().datetime().optional(),
220
- completedAt: z.string().datetime().optional(),
222
+ startedAt: z.iso.datetime().optional(),
223
+ completedAt: z.iso.datetime().optional(),
221
224
  durationMs: z.number().int().nonnegative().optional(),
222
225
  app: z.literal(true).optional()
223
226
  }),
@@ -248,8 +251,8 @@ var SessionMessageSchema2 = z.strictObject({
248
251
  role: z.enum(["user", "assistant", "system"]),
249
252
  content: z.array(SessionMessagePartSchema).max(2000),
250
253
  attachments: z.array(SessionMessageAttachmentSchema).max(16).optional(),
251
- createdAt: z.string().datetime(),
252
- completedAt: z.string().datetime().optional(),
254
+ createdAt: z.iso.datetime(),
255
+ completedAt: z.iso.datetime().optional(),
253
256
  status: z.union([
254
257
  z.strictObject({
255
258
  type: z.literal("requires-action"),
@@ -556,7 +559,7 @@ var SessionContextResponseSchema2 = z.strictObject({
556
559
  messageTokens: z.number().int().min(0)
557
560
  }).optional(),
558
561
  cost: z.strictObject({
559
- amount: z.number().finite().min(0),
562
+ amount: z.number().min(0),
560
563
  currency: z.string().min(1)
561
564
  }).optional()
562
565
  });
@@ -571,7 +574,7 @@ var ArtifactDescriptorSchema2 = z.strictObject({
571
574
  encoding: z.enum(["utf8", "base64"]),
572
575
  data: z.string()
573
576
  }),
574
- z.strictObject({ type: z.literal("url"), url: z.string().url() }),
577
+ z.strictObject({ type: z.literal("url"), url: z.url() }),
575
578
  z.strictObject({
576
579
  type: z.literal("provider"),
577
580
  reference: z.string().min(1)
@@ -676,7 +679,6 @@ var ErrorResponseSchema2 = z.strictObject({
676
679
  });
677
680
 
678
681
  // protocol/acp.ts
679
- import { z as z2 } from "zod";
680
682
  var ACP_PROTOCOL_VERSION2 = 2;
681
683
  var HGW_API_PREFIX2 = "/api/v1";
682
684
  var HGW_ACP_PATH2 = `${HGW_API_PREFIX2}/acp`;
@@ -780,7 +782,7 @@ var HgwSessionInfoMetaSchema2 = readObject({
780
782
  agentId: IdentifierSchema2,
781
783
  status: SessionStatusSchema2,
782
784
  archived: z2.boolean(),
783
- createdAt: z2.string().datetime().optional(),
785
+ createdAt: z2.iso.datetime().optional(),
784
786
  unread: z2.boolean().optional(),
785
787
  pinned: z2.boolean().optional(),
786
788
  platform: SessionPlatformSchema2.optional()
@@ -889,7 +891,7 @@ var SubagentAttribution = {
889
891
  };
890
892
  var HgwStateMetaSchema2 = readObject({
891
893
  ...TurnMetaBase,
892
- at: z2.string().datetime().optional(),
894
+ at: z2.iso.datetime().optional(),
893
895
  execution: z2.literal("stopping").optional(),
894
896
  code: z2.string().min(1).max(128).optional(),
895
897
  message: z2.string().max(4096).optional(),
@@ -907,8 +909,8 @@ var HgwToolCallMetaSchema2 = readObject({
907
909
  messageId: IdentifierSchema2,
908
910
  argsTextDelta: z2.string().optional(),
909
911
  argsText: z2.string().optional(),
910
- startedAt: z2.string().datetime().optional(),
911
- completedAt: z2.string().datetime().optional(),
912
+ startedAt: z2.iso.datetime().optional(),
913
+ completedAt: z2.iso.datetime().optional(),
912
914
  durationMs: CountSchema.optional(),
913
915
  subagent: HgwSubagentSchema2.optional(),
914
916
  app: z2.strictObject({}).optional()
@@ -928,7 +930,7 @@ var HgwAvailableCommandsMetaSchema2 = readObject({
928
930
  });
929
931
  var HgwPermissionMetaSchema2 = readObject({
930
932
  requestId: IdentifierSchema2,
931
- expiresAt: z2.string().datetime().optional(),
933
+ expiresAt: z2.iso.datetime().optional(),
932
934
  message: z2.string().max(4096).optional()
933
935
  });
934
936
  var HgwQuestionOptionSchema2 = readObject({
@@ -946,7 +948,7 @@ var HgwQuestionSchema2 = readObject({
946
948
  });
947
949
  var HgwElicitationMetaSchema2 = readObject({
948
950
  requestId: IdentifierSchema2,
949
- expiresAt: z2.string().datetime().optional(),
951
+ expiresAt: z2.iso.datetime().optional(),
950
952
  questions: z2.array(HgwQuestionSchema2).min(1).max(64)
951
953
  });
952
954
  var HgwArtifactDescriptorSchema2 = ArtifactDescriptorSchema2;
@@ -981,7 +983,7 @@ var HgwErrorNotificationSchema2 = readObject({
981
983
  var ActivityBase = {
982
984
  agentId: IdentifierSchema2,
983
985
  sessionId: IdentifierSchema2,
984
- occurredAt: z2.string().datetime()
986
+ occurredAt: z2.iso.datetime()
985
987
  };
986
988
  var HgwActivityNotificationSchema2 = z2.discriminatedUnion("type", [
987
989
  readObject({
@@ -1040,7 +1042,7 @@ var PushMessageSchema2 = z3.strictObject({
1040
1042
  count: z3.number().int().min(1),
1041
1043
  agentId: IdentifierSchema2.optional(),
1042
1044
  sessionId: IdentifierSchema2.optional(),
1043
- occurredAt: z3.string().datetime(),
1045
+ occurredAt: z3.iso.datetime(),
1044
1046
  locale: PushLocaleSchema2
1045
1047
  }).refine((message) => message.count === 1 === (message.agentId !== undefined && message.sessionId !== undefined), { message: "A single-Session push carries both ids; a count carries none" });
1046
1048
  var PushCategoriesSchema2 = z3.strictObject({
@@ -1077,7 +1079,7 @@ var PushUnregistrationSchema2 = z3.strictObject({
1077
1079
  import {
1078
1080
  CallToolResultSchema as CallToolResultSchema2,
1079
1081
  ReadResourceResultSchema as ReadResourceResultSchema2
1080
- } from "@modelcontextprotocol/sdk/types.js";
1082
+ } from "@modelcontextprotocol/core";
1081
1083
  import { z as z4 } from "zod";
1082
1084
  var DomainListSchema = z4.array(z4.string().min(1).max(2048)).max(64);
1083
1085
  var McpUiCspSchema2 = z4.object({
@@ -1104,7 +1106,7 @@ var McpUiPermissionsSchema2 = z4.object({
1104
1106
  });
1105
1107
  var McpAppFilesSchema2 = z4.strictObject({
1106
1108
  addresses: z4.record(z4.string(), z4.string().startsWith("/").max(8192)),
1107
- expiresAt: z4.string().datetime().optional()
1109
+ expiresAt: z4.iso.datetime().optional()
1108
1110
  });
1109
1111
  var McpAppViewSchema2 = z4.strictObject({
1110
1112
  html: z4.string().max(5000000),
@@ -1154,7 +1156,7 @@ var MCP_APP_SANDBOX_CSP2 = [
1154
1156
  ...LOOPBACK_SOURCES("http"),
1155
1157
  ...LOOPBACK_SOURCES("ws")
1156
1158
  ].join(" "),
1157
- "worker-src 'self' blob:",
1159
+ "worker-src 'self' blob: data:",
1158
1160
  "frame-src https:",
1159
1161
  "base-uri https:",
1160
1162
  "object-src 'none'",
@@ -275,12 +275,21 @@ export declare class HgwRemoteClient {
275
275
  })[];
276
276
  _meta?: {
277
277
  [x: string]: unknown;
278
- progressToken?: string | number | undefined;
279
- "io.modelcontextprotocol/related-task"?: {
280
- taskId: string;
278
+ "io.modelcontextprotocol/serverInfo"?: {
279
+ version: string;
280
+ name: string;
281
+ websiteUrl?: string | undefined;
282
+ description?: string | undefined;
283
+ icons?: {
284
+ src: string;
285
+ mimeType?: string | undefined;
286
+ sizes?: string[] | undefined;
287
+ theme?: "light" | "dark" | undefined;
288
+ }[] | undefined;
289
+ title?: string | undefined;
281
290
  } | undefined;
282
291
  } | undefined;
283
- structuredContent?: Record<string, unknown> | undefined;
292
+ structuredContent?: unknown;
284
293
  isError?: boolean | undefined;
285
294
  } | undefined;
286
295
  files?: {
@@ -369,12 +378,21 @@ export declare class HgwRemoteClient {
369
378
  })[];
370
379
  _meta?: {
371
380
  [x: string]: unknown;
372
- progressToken?: string | number | undefined;
373
- "io.modelcontextprotocol/related-task"?: {
374
- taskId: string;
381
+ "io.modelcontextprotocol/serverInfo"?: {
382
+ version: string;
383
+ name: string;
384
+ websiteUrl?: string | undefined;
385
+ description?: string | undefined;
386
+ icons?: {
387
+ src: string;
388
+ mimeType?: string | undefined;
389
+ sizes?: string[] | undefined;
390
+ theme?: "light" | "dark" | undefined;
391
+ }[] | undefined;
392
+ title?: string | undefined;
375
393
  } | undefined;
376
394
  } | undefined;
377
- structuredContent?: Record<string, unknown> | undefined;
395
+ structuredContent?: unknown;
378
396
  isError?: boolean | undefined;
379
397
  }>;
380
398
  /** A resource read the App view makes, answered by the proxy's MCP server. */
@@ -393,9 +411,18 @@ export declare class HgwRemoteClient {
393
411
  })[];
394
412
  _meta?: {
395
413
  [x: string]: unknown;
396
- progressToken?: string | number | undefined;
397
- "io.modelcontextprotocol/related-task"?: {
398
- taskId: string;
414
+ "io.modelcontextprotocol/serverInfo"?: {
415
+ version: string;
416
+ name: string;
417
+ websiteUrl?: string | undefined;
418
+ description?: string | undefined;
419
+ icons?: {
420
+ src: string;
421
+ mimeType?: string | undefined;
422
+ sizes?: string[] | undefined;
423
+ theme?: "light" | "dark" | undefined;
424
+ }[] | undefined;
425
+ title?: string | undefined;
399
426
  } | undefined;
400
427
  } | undefined;
401
428
  }>;
@@ -1,3 +1,4 @@
1
+ import type { UnknownVariant } from "@agentclientprotocol/sdk/experimental/v2";
1
2
  import { z } from "zod";
2
3
  import { type ArtifactDescriptor } from "./index.js";
3
4
  /**
@@ -14,6 +15,20 @@ import { type ArtifactDescriptor } from "./index.js";
14
15
  * adds a key never costs the browser the whole payload. The gateway's builders
15
16
  * stay exact through the inferred types.
16
17
  */
18
+ /**
19
+ * An ACP value either end builds, as opposed to one it received. The SDK
20
+ * brands the variants it does not know so only received values can carry them;
21
+ * that brand also stops TypeScript from checking a built value whose tag is
22
+ * computed (`stopReason: stopping ? "cancelled" : "end_turn"`) against the
23
+ * known variants. Dropping the branded members at every depth restores that
24
+ * check, and a `Built` value is still a plain `T`. The gateway builds every
25
+ * update it sends this way; a browser test builds the updates it feeds in.
26
+ */
27
+ export type Built<T> = T extends UnknownVariant<unknown> ? never : T extends object ? {
28
+ [K in keyof T]: Built<T[K]>;
29
+ } : T;
30
+ /**
31
+ */
17
32
  export declare const ACP_PROTOCOL_VERSION: 2;
18
33
  /**
19
34
  * Every gateway route sits below this prefix, on both listeners: which
@@ -169,7 +184,7 @@ export declare const HgwSessionInfoMetaSchema: z.ZodObject<{
169
184
  failed: "failed";
170
185
  }>;
171
186
  archived: z.ZodBoolean;
172
- createdAt: z.ZodOptional<z.ZodString>;
187
+ createdAt: z.ZodOptional<z.ZodISODateTime>;
173
188
  unread: z.ZodOptional<z.ZodBoolean>;
174
189
  pinned: z.ZodOptional<z.ZodBoolean>;
175
190
  platform: z.ZodOptional<z.ZodEnum<{
@@ -449,7 +464,7 @@ export declare const HgwSubagentSchema: z.ZodObject<{
449
464
  export type HgwSubagent = z.infer<typeof HgwSubagentSchema>;
450
465
  /** `state_update._meta.hgw` */
451
466
  export declare const HgwStateMetaSchema: z.ZodObject<{
452
- at: z.ZodOptional<z.ZodString>;
467
+ at: z.ZodOptional<z.ZodISODateTime>;
453
468
  execution: z.ZodOptional<z.ZodLiteral<"stopping">>;
454
469
  code: z.ZodOptional<z.ZodString>;
455
470
  message: z.ZodOptional<z.ZodString>;
@@ -474,8 +489,8 @@ export declare const HgwToolCallMetaSchema: z.ZodObject<{
474
489
  messageId: z.ZodString;
475
490
  argsTextDelta: z.ZodOptional<z.ZodString>;
476
491
  argsText: z.ZodOptional<z.ZodString>;
477
- startedAt: z.ZodOptional<z.ZodString>;
478
- completedAt: z.ZodOptional<z.ZodString>;
492
+ startedAt: z.ZodOptional<z.ZodISODateTime>;
493
+ completedAt: z.ZodOptional<z.ZodISODateTime>;
479
494
  durationMs: z.ZodOptional<z.ZodNumber>;
480
495
  subagent: z.ZodOptional<z.ZodObject<{
481
496
  id: z.ZodString;
@@ -707,7 +722,7 @@ export declare const HgwAvailableCommandsMetaSchema: z.ZodObject<{
707
722
  /** `RequestPermissionRequest._meta.hgw` */
708
723
  export declare const HgwPermissionMetaSchema: z.ZodObject<{
709
724
  requestId: z.ZodString;
710
- expiresAt: z.ZodOptional<z.ZodString>;
725
+ expiresAt: z.ZodOptional<z.ZodISODateTime>;
711
726
  message: z.ZodOptional<z.ZodString>;
712
727
  }, z.core.$strip>;
713
728
  export declare const HgwQuestionOptionSchema: z.ZodObject<{
@@ -731,7 +746,7 @@ export type HgwQuestion = z.infer<typeof HgwQuestionSchema>;
731
746
  /** `CreateElicitationRequest._meta.hgw`: lossless projection of the questions. */
732
747
  export declare const HgwElicitationMetaSchema: z.ZodObject<{
733
748
  requestId: z.ZodString;
734
- expiresAt: z.ZodOptional<z.ZodString>;
749
+ expiresAt: z.ZodOptional<z.ZodISODateTime>;
735
750
  questions: z.ZodArray<z.ZodObject<{
736
751
  id: z.ZodOptional<z.ZodString>;
737
752
  header: z.ZodOptional<z.ZodString>;
@@ -760,7 +775,7 @@ export declare const HgwArtifactDescriptorSchema: z.ZodObject<{
760
775
  data: z.ZodString;
761
776
  }, z.core.$strict>, z.ZodObject<{
762
777
  type: z.ZodLiteral<"url">;
763
- url: z.ZodString;
778
+ url: z.ZodURL;
764
779
  }, z.core.$strict>, z.ZodObject<{
765
780
  type: z.ZodLiteral<"provider">;
766
781
  reference: z.ZodString;
@@ -801,7 +816,7 @@ export declare const HgwActivityNotificationSchema: z.ZodDiscriminatedUnion<[z.Z
801
816
  turnId: z.ZodString;
802
817
  agentId: z.ZodString;
803
818
  sessionId: z.ZodString;
804
- occurredAt: z.ZodString;
819
+ occurredAt: z.ZodISODateTime;
805
820
  }, z.core.$strip>, z.ZodObject<{
806
821
  type: z.ZodLiteral<"attention-requested">;
807
822
  requestId: z.ZodString;
@@ -811,18 +826,18 @@ export declare const HgwActivityNotificationSchema: z.ZodDiscriminatedUnion<[z.Z
811
826
  }>;
812
827
  agentId: z.ZodString;
813
828
  sessionId: z.ZodString;
814
- occurredAt: z.ZodString;
829
+ occurredAt: z.ZodISODateTime;
815
830
  }, z.core.$strip>, z.ZodObject<{
816
831
  type: z.ZodLiteral<"attention-resolved">;
817
832
  requestId: z.ZodString;
818
833
  agentId: z.ZodString;
819
834
  sessionId: z.ZodString;
820
- occurredAt: z.ZodString;
835
+ occurredAt: z.ZodISODateTime;
821
836
  }, z.core.$strip>, z.ZodObject<{
822
837
  type: z.ZodLiteral<"unread-changed">;
823
838
  unread: z.ZodBoolean;
824
839
  agentId: z.ZodString;
825
840
  sessionId: z.ZodString;
826
- occurredAt: z.ZodString;
841
+ occurredAt: z.ZodISODateTime;
827
842
  }, z.core.$strip>], "type">;
828
843
  export type HgwActivityNotification = z.infer<typeof HgwActivityNotificationSchema>;
@@ -300,8 +300,8 @@ export declare const SessionSchema: z.ZodObject<{
300
300
  agentId: z.ZodString;
301
301
  title: z.ZodOptional<z.ZodString>;
302
302
  archived: z.ZodBoolean;
303
- createdAt: z.ZodOptional<z.ZodString>;
304
- updatedAt: z.ZodOptional<z.ZodString>;
303
+ createdAt: z.ZodOptional<z.ZodISODateTime>;
304
+ updatedAt: z.ZodOptional<z.ZodISODateTime>;
305
305
  status: z.ZodEnum<{
306
306
  unknown: "unknown";
307
307
  idle: "idle";
@@ -329,8 +329,8 @@ export declare const SessionCatalogResponseSchema: z.ZodObject<{
329
329
  agentId: z.ZodString;
330
330
  title: z.ZodOptional<z.ZodString>;
331
331
  archived: z.ZodBoolean;
332
- createdAt: z.ZodOptional<z.ZodString>;
333
- updatedAt: z.ZodOptional<z.ZodString>;
332
+ createdAt: z.ZodOptional<z.ZodISODateTime>;
333
+ updatedAt: z.ZodOptional<z.ZodISODateTime>;
334
334
  status: z.ZodEnum<{
335
335
  unknown: "unknown";
336
336
  idle: "idle";
@@ -496,8 +496,8 @@ export declare const SessionMessageSchema: z.ZodObject<{
496
496
  }, z.core.$strict>]>>;
497
497
  patch: z.ZodOptional<z.ZodString>;
498
498
  }, z.core.$strict>>>;
499
- startedAt: z.ZodOptional<z.ZodString>;
500
- completedAt: z.ZodOptional<z.ZodString>;
499
+ startedAt: z.ZodOptional<z.ZodISODateTime>;
500
+ completedAt: z.ZodOptional<z.ZodISODateTime>;
501
501
  durationMs: z.ZodOptional<z.ZodNumber>;
502
502
  app: z.ZodOptional<z.ZodLiteral<true>>;
503
503
  }, z.core.$strict>, z.ZodObject<{
@@ -515,8 +515,8 @@ export declare const SessionMessageSchema: z.ZodObject<{
515
515
  }, z.core.$strict>;
516
516
  content: z.ZodArray<z.ZodNever>;
517
517
  }, z.core.$strict>>>;
518
- createdAt: z.ZodString;
519
- completedAt: z.ZodOptional<z.ZodString>;
518
+ createdAt: z.ZodISODateTime;
519
+ completedAt: z.ZodOptional<z.ZodISODateTime>;
520
520
  status: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
521
521
  type: z.ZodLiteral<"requires-action">;
522
522
  reason: z.ZodLiteral<"interrupt">;
@@ -618,8 +618,8 @@ export declare const SessionHistoryResponseSchema: z.ZodObject<{
618
618
  }, z.core.$strict>]>>;
619
619
  patch: z.ZodOptional<z.ZodString>;
620
620
  }, z.core.$strict>>>;
621
- startedAt: z.ZodOptional<z.ZodString>;
622
- completedAt: z.ZodOptional<z.ZodString>;
621
+ startedAt: z.ZodOptional<z.ZodISODateTime>;
622
+ completedAt: z.ZodOptional<z.ZodISODateTime>;
623
623
  durationMs: z.ZodOptional<z.ZodNumber>;
624
624
  app: z.ZodOptional<z.ZodLiteral<true>>;
625
625
  }, z.core.$strict>, z.ZodObject<{
@@ -637,8 +637,8 @@ export declare const SessionHistoryResponseSchema: z.ZodObject<{
637
637
  }, z.core.$strict>;
638
638
  content: z.ZodArray<z.ZodNever>;
639
639
  }, z.core.$strict>>>;
640
- createdAt: z.ZodString;
641
- completedAt: z.ZodOptional<z.ZodString>;
640
+ createdAt: z.ZodISODateTime;
641
+ completedAt: z.ZodOptional<z.ZodISODateTime>;
642
642
  status: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
643
643
  type: z.ZodLiteral<"requires-action">;
644
644
  reason: z.ZodLiteral<"interrupt">;
@@ -1093,7 +1093,7 @@ export declare const ArtifactDescriptorSchema: z.ZodObject<{
1093
1093
  data: z.ZodString;
1094
1094
  }, z.core.$strict>, z.ZodObject<{
1095
1095
  type: z.ZodLiteral<"url">;
1096
- url: z.ZodString;
1096
+ url: z.ZodURL;
1097
1097
  }, z.core.$strict>, z.ZodObject<{
1098
1098
  type: z.ZodLiteral<"provider">;
1099
1099
  reference: z.ZodString;
@@ -1,4 +1,4 @@
1
- import { CallToolResultSchema, ReadResourceResultSchema, type CallToolResult, type ReadResourceResult } from "@modelcontextprotocol/sdk/types.js";
1
+ import { CallToolResultSchema, ReadResourceResultSchema } from "@modelcontextprotocol/core";
2
2
  import { z } from "zod";
3
3
  /**
4
4
  * MCP Apps (spec 2026-01-26) as the gateway hands them to the browser. A tool
@@ -7,7 +7,8 @@ import { z } from "zod";
7
7
  * by the tool call that opened it, never the resource URI.
8
8
  */
9
9
  export { CallToolResultSchema, ReadResourceResultSchema };
10
- export type { CallToolResult, ReadResourceResult };
10
+ export type CallToolResult = z.infer<typeof CallToolResultSchema>;
11
+ export type ReadResourceResult = z.infer<typeof ReadResourceResultSchema>;
11
12
  /** A UI resource's `_meta.ui.csp`: the origins its view may reach. */
12
13
  export declare const McpUiCspSchema: z.ZodObject<{
13
14
  connectDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -39,7 +40,7 @@ export type McpUiPermissions = z.infer<typeof McpUiPermissionsSchema>;
39
40
  */
40
41
  export declare const McpAppFilesSchema: z.ZodObject<{
41
42
  addresses: z.ZodRecord<z.ZodString, z.ZodString>;
42
- expiresAt: z.ZodOptional<z.ZodString>;
43
+ expiresAt: z.ZodOptional<z.ZodISODateTime>;
43
44
  }, z.core.$strict>;
44
45
  export type McpAppFiles = z.infer<typeof McpAppFilesSchema>;
45
46
  /** `GET` an MCP App view: its HTML, sandbox policy, and the call it renders. */
@@ -61,10 +62,22 @@ export declare const McpAppViewSchema: z.ZodObject<{
61
62
  toolInput: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
62
63
  toolResult: z.ZodOptional<z.ZodObject<{
63
64
  _meta: z.ZodOptional<z.ZodObject<{
64
- progressToken: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
65
- "io.modelcontextprotocol/related-task": z.ZodOptional<z.ZodObject<{
66
- taskId: z.ZodString;
67
- }, z.core.$strip>>;
65
+ readonly "io.modelcontextprotocol/serverInfo": z.ZodCatch<z.ZodOptional<z.ZodObject<{
66
+ version: z.ZodString;
67
+ websiteUrl: z.ZodOptional<z.ZodString>;
68
+ description: z.ZodOptional<z.ZodString>;
69
+ icons: z.ZodOptional<z.ZodArray<z.ZodObject<{
70
+ src: z.ZodString;
71
+ mimeType: z.ZodOptional<z.ZodString>;
72
+ sizes: z.ZodOptional<z.ZodArray<z.ZodString>>;
73
+ theme: z.ZodOptional<z.ZodEnum<{
74
+ light: "light";
75
+ dark: "dark";
76
+ }>>;
77
+ }, z.core.$strip>>>;
78
+ name: z.ZodString;
79
+ title: z.ZodOptional<z.ZodString>;
80
+ }, z.core.$strip>>>;
68
81
  }, z.core.$loose>>;
69
82
  content: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
70
83
  type: z.ZodLiteral<"text">;
@@ -153,12 +166,12 @@ export declare const McpAppViewSchema: z.ZodObject<{
153
166
  }, z.core.$strip>>;
154
167
  _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
155
168
  }, z.core.$strip>]>>>;
156
- structuredContent: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
169
+ structuredContent: z.ZodOptional<z.ZodUnknown>;
157
170
  isError: z.ZodOptional<z.ZodBoolean>;
158
171
  }, z.core.$loose>>;
159
172
  files: z.ZodOptional<z.ZodObject<{
160
173
  addresses: z.ZodRecord<z.ZodString, z.ZodString>;
161
- expiresAt: z.ZodOptional<z.ZodString>;
174
+ expiresAt: z.ZodOptional<z.ZodISODateTime>;
162
175
  }, z.core.$strict>>;
163
176
  }, z.core.$strict>;
164
177
  export type McpAppView = z.infer<typeof McpAppViewSchema>;
@@ -44,7 +44,7 @@ export declare const PushMessageSchema: z.ZodObject<{
44
44
  count: z.ZodNumber;
45
45
  agentId: z.ZodOptional<z.ZodString>;
46
46
  sessionId: z.ZodOptional<z.ZodString>;
47
- occurredAt: z.ZodString;
47
+ occurredAt: z.ZodISODateTime;
48
48
  locale: z.ZodEnum<{
49
49
  en: "en";
50
50
  he: "he";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harness-gw/sdk",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "A gateway that puts Hermes, OpenClaw, and OpenCode behind one ACP WebSocket, and the browser client and protocol SDK for it.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -38,37 +38,39 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "cockatiel": "4.0.0",
41
- "pino": "10.3.1",
41
+ "pino": "10.4.0",
42
42
  "xstate": "5.33.2"
43
43
  },
44
44
  "peerDependencies": {
45
- "@agentclientprotocol/sdk": "1.5.0",
46
- "@modelcontextprotocol/sdk": "1.30.0",
47
- "zod": "4.5.4"
45
+ "@agentclientprotocol/sdk": "^1.5.0",
46
+ "@modelcontextprotocol/core": "^2.3.1",
47
+ "zod": "^4.5.4"
48
48
  },
49
49
  "devDependencies": {
50
- "@agentclientprotocol/sdk": "1.5.0",
50
+ "@agentclientprotocol/sdk": "1.8.0",
51
51
  "@block65/webcrypto-web-push": "^2.0.0",
52
- "@eslint/js": "9",
53
- "@modelcontextprotocol/sdk": "1.30.0",
54
- "@openclaw/gateway-client": "2026.9.4",
55
- "@openclaw/gateway-protocol": "2026.9.4",
56
- "@opencode-ai/sdk": "1.18.29",
57
- "@types/bun": "^1.4.1",
52
+ "@eslint/js": "10",
53
+ "@modelcontextprotocol/client": "2.3.1",
54
+ "@modelcontextprotocol/core": "2.3.1",
55
+ "@modelcontextprotocol/server": "2.3.1",
56
+ "@openclaw/gateway-client": "2026.10.2",
57
+ "@openclaw/gateway-protocol": "2026.10.2",
58
+ "@opencode-ai/sdk": "1.19.0",
59
+ "@types/bun": "^1.4.3",
58
60
  "@types/ms": "2.1.0",
59
- "@types/node": "^20",
60
- "commander": "14.0.3",
61
- "eslint": "^9",
61
+ "@types/node": "^26",
62
+ "commander": "15.0.0",
63
+ "eslint": "^10",
62
64
  "globals": "^17.12.0",
63
- "hono": "4.13.5",
65
+ "hono": "4.13.13",
64
66
  "ipaddr.js": "^2.5.0",
65
67
  "jose": "6.2.12",
66
68
  "ms": "2.1.3",
67
- "prettier": "^3.8.3",
69
+ "prettier": "^3.9.10",
68
70
  "typescript": "^5",
69
- "typescript-eslint": "^8.70.0",
70
- "vitest": "^5.0.0",
71
- "yaml": "2.9.0",
72
- "zod": "4.5.4"
71
+ "typescript-eslint": "^8.71.1",
72
+ "vitest": "^5.0.4",
73
+ "yaml": "2.9.1",
74
+ "zod": "4.6.6"
73
75
  }
74
76
  }