@harness-gw/sdk 0.5.0 → 0.6.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.
@@ -90,7 +90,17 @@ export declare const HGW_JSONRPC_ERRORS: {
90
90
  readonly temporarilyUnavailable: -31013;
91
91
  readonly uncertainMutation: -31014;
92
92
  readonly unsupported: -31015;
93
+ /**
94
+ * Params too large for one frame. The client raises it before sending and
95
+ * the gateway never sends it, so it has no machine name on the wire.
96
+ */
97
+ readonly requestTooLarge: -31016;
93
98
  };
99
+ /**
100
+ * The largest inbound WebSocket frame the gateway takes, in bytes. A larger
101
+ * one closes the socket, and with it every Session on the tab.
102
+ */
103
+ export declare const HGW_MAX_FRAME_BYTES = 1100000;
94
104
  export type HgwJsonRpcErrorCode = (typeof HGW_JSONRPC_ERRORS)[keyof typeof HGW_JSONRPC_ERRORS];
95
105
  export declare const IdentifierSchema: z.ZodString;
96
106
  export declare const HgwExtensionsSchema: z.ZodObject<{
@@ -118,8 +128,8 @@ export declare const HgwClientCapabilitiesMetaSchema: z.ZodObject<{
118
128
  export declare const HgwInitializeMetaSchema: z.ZodObject<{
119
129
  version: z.ZodLiteral<1>;
120
130
  role: z.ZodEnum<{
121
- operator: "operator";
122
131
  guest: "guest";
132
+ operator: "operator";
123
133
  }>;
124
134
  extensions: z.ZodObject<{
125
135
  steer: z.ZodBoolean;
@@ -177,11 +187,11 @@ export declare const HgwSessionSearchResponseSchema: z.ZodObject<{
177
187
  export declare const HgwSessionInfoMetaSchema: z.ZodObject<{
178
188
  agentId: z.ZodString;
179
189
  status: z.ZodEnum<{
180
- unknown: "unknown";
190
+ failed: "failed";
181
191
  idle: "idle";
182
192
  running: "running";
193
+ unknown: "unknown";
183
194
  "waiting-for-input": "waiting-for-input";
184
- failed: "failed";
185
195
  }>;
186
196
  archived: z.ZodBoolean;
187
197
  createdAt: z.ZodOptional<z.ZodISODateTime>;
@@ -189,11 +199,11 @@ export declare const HgwSessionInfoMetaSchema: z.ZodObject<{
189
199
  pinned: z.ZodOptional<z.ZodBoolean>;
190
200
  platform: z.ZodOptional<z.ZodEnum<{
191
201
  buzz: "buzz";
192
- whatsapp: "whatsapp";
202
+ discord: "discord";
203
+ email: "email";
193
204
  slack: "slack";
194
205
  telegram: "telegram";
195
- email: "email";
196
- discord: "discord";
206
+ whatsapp: "whatsapp";
197
207
  }>>;
198
208
  }, z.core.$strip>;
199
209
  export type HgwSessionInfoMeta = z.infer<typeof HgwSessionInfoMetaSchema>;
@@ -292,8 +302,8 @@ export declare const HgwSteerRequestSchema: z.ZodObject<{
292
302
  }, z.core.$strict>;
293
303
  export declare const HgwSteerResponseSchema: z.ZodObject<{
294
304
  status: z.ZodEnum<{
295
- steered: "steered";
296
305
  queued: "queued";
306
+ steered: "steered";
297
307
  }>;
298
308
  }, z.core.$strict>;
299
309
  /**
@@ -319,27 +329,27 @@ export declare const HgwAgentsListResponseSchema: z.ZodObject<{
319
329
  description: z.ZodOptional<z.ZodString>;
320
330
  status: z.ZodOptional<z.ZodEnum<{
321
331
  active: "active";
322
- unknown: "unknown";
332
+ attention: "attention";
323
333
  idle: "idle";
324
334
  running: "running";
325
- attention: "attention";
335
+ unknown: "unknown";
326
336
  }>>;
327
337
  activity: z.ZodOptional<z.ZodEnum<{
328
338
  active: "active";
329
- unknown: "unknown";
330
339
  idle: "idle";
340
+ unknown: "unknown";
331
341
  }>>;
332
342
  visibility: z.ZodOptional<z.ZodEnum<{
333
- visible: "visible";
334
343
  hidden: "hidden";
344
+ visible: "visible";
335
345
  }>>;
336
346
  role: z.ZodOptional<z.ZodLiteral<"creator">>;
337
347
  avatar: z.ZodOptional<z.ZodString>;
338
348
  muted: z.ZodOptional<z.ZodLiteral<true>>;
339
349
  }, z.core.$strict>;
340
350
  visibility: z.ZodEnum<{
341
- visible: "visible";
342
351
  hidden: "hidden";
352
+ visible: "visible";
343
353
  }>;
344
354
  selectable: z.ZodBoolean;
345
355
  editable: z.ZodBoolean;
@@ -351,8 +361,8 @@ export declare const HgwAgentsListResponseSchema: z.ZodObject<{
351
361
  /** `_hgw/agents/update` params: at least one of visibility, avatar, and muted. */
352
362
  export declare const HgwAgentUpdateRequestSchema: z.ZodObject<{
353
363
  visibility: z.ZodOptional<z.ZodEnum<{
354
- visible: "visible";
355
364
  hidden: "hidden";
365
+ visible: "visible";
356
366
  }>>;
357
367
  avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
358
368
  muted: z.ZodOptional<z.ZodBoolean>;
@@ -370,27 +380,27 @@ export declare const HgwAgentUpdateResponseSchema: z.ZodObject<{
370
380
  description: z.ZodOptional<z.ZodString>;
371
381
  status: z.ZodOptional<z.ZodEnum<{
372
382
  active: "active";
373
- unknown: "unknown";
383
+ attention: "attention";
374
384
  idle: "idle";
375
385
  running: "running";
376
- attention: "attention";
386
+ unknown: "unknown";
377
387
  }>>;
378
388
  activity: z.ZodOptional<z.ZodEnum<{
379
389
  active: "active";
380
- unknown: "unknown";
381
390
  idle: "idle";
391
+ unknown: "unknown";
382
392
  }>>;
383
393
  visibility: z.ZodOptional<z.ZodEnum<{
384
- visible: "visible";
385
394
  hidden: "hidden";
395
+ visible: "visible";
386
396
  }>>;
387
397
  role: z.ZodOptional<z.ZodLiteral<"creator">>;
388
398
  avatar: z.ZodOptional<z.ZodString>;
389
399
  muted: z.ZodOptional<z.ZodLiteral<true>>;
390
400
  }, z.core.$strict>;
391
401
  visibility: z.ZodEnum<{
392
- visible: "visible";
393
402
  hidden: "hidden";
403
+ visible: "visible";
394
404
  }>;
395
405
  selectable: z.ZodBoolean;
396
406
  editable: z.ZodBoolean;
@@ -427,8 +437,8 @@ export declare const HgwMessageMetaSchema: z.ZodObject<{
427
437
  opensTurn: z.ZodLiteral<true>;
428
438
  notice: z.ZodOptional<z.ZodObject<{
429
439
  severity: z.ZodEnum<{
430
- info: "info";
431
440
  error: "error";
441
+ info: "info";
432
442
  warning: "warning";
433
443
  }>;
434
444
  title: z.ZodString;
@@ -454,10 +464,10 @@ export declare const HgwSubagentSchema: z.ZodObject<{
454
464
  model: z.ZodOptional<z.ZodString>;
455
465
  depth: z.ZodOptional<z.ZodNumber>;
456
466
  status: z.ZodOptional<z.ZodEnum<{
457
- running: "running";
458
- failed: "failed";
459
467
  cancelled: "cancelled";
460
468
  completed: "completed";
469
+ failed: "failed";
470
+ running: "running";
461
471
  }>>;
462
472
  tokens: z.ZodOptional<z.ZodNumber>;
463
473
  filesRead: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -469,6 +479,8 @@ export declare const HgwSubagentSchema: z.ZodObject<{
469
479
  export type HgwSubagent = z.infer<typeof HgwSubagentSchema>;
470
480
  /** `state_update._meta.hgw` */
471
481
  export declare const HgwStateMetaSchema: z.ZodObject<{
482
+ sequence: z.ZodNumber;
483
+ turnId: z.ZodString;
472
484
  at: z.ZodOptional<z.ZodISODateTime>;
473
485
  execution: z.ZodOptional<z.ZodLiteral<"stopping">>;
474
486
  code: z.ZodOptional<z.ZodString>;
@@ -479,18 +491,20 @@ export declare const HgwStateMetaSchema: z.ZodObject<{
479
491
  amount: z.ZodNumber;
480
492
  currency: z.ZodString;
481
493
  }, z.core.$strip>>;
482
- sequence: z.ZodNumber;
483
- turnId: z.ZodString;
484
494
  }, z.core.$strip>;
485
495
  /** `agent_message_chunk` / `agent_thought_chunk` `_meta.hgw` */
486
496
  export declare const HgwChunkMetaSchema: z.ZodObject<{
487
- subagentId: z.ZodOptional<z.ZodString>;
488
- parentToolCallId: z.ZodOptional<z.ZodString>;
489
497
  sequence: z.ZodNumber;
490
498
  turnId: z.ZodString;
499
+ subagentId: z.ZodOptional<z.ZodString>;
500
+ parentToolCallId: z.ZodOptional<z.ZodString>;
491
501
  }, z.core.$strip>;
492
502
  /** `tool_call_update` / `tool_call_content_chunk` `_meta.hgw` */
493
503
  export declare const HgwToolCallMetaSchema: z.ZodObject<{
504
+ sequence: z.ZodNumber;
505
+ turnId: z.ZodString;
506
+ subagentId: z.ZodOptional<z.ZodString>;
507
+ parentToolCallId: z.ZodOptional<z.ZodString>;
494
508
  messageId: z.ZodString;
495
509
  argsTextDelta: z.ZodOptional<z.ZodString>;
496
510
  argsText: z.ZodOptional<z.ZodString>;
@@ -503,10 +517,10 @@ export declare const HgwToolCallMetaSchema: z.ZodObject<{
503
517
  model: z.ZodOptional<z.ZodString>;
504
518
  depth: z.ZodOptional<z.ZodNumber>;
505
519
  status: z.ZodOptional<z.ZodEnum<{
506
- running: "running";
507
- failed: "failed";
508
520
  cancelled: "cancelled";
509
521
  completed: "completed";
522
+ failed: "failed";
523
+ running: "running";
510
524
  }>>;
511
525
  tokens: z.ZodOptional<z.ZodNumber>;
512
526
  filesRead: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -516,10 +530,6 @@ export declare const HgwToolCallMetaSchema: z.ZodObject<{
516
530
  summary: z.ZodOptional<z.ZodString>;
517
531
  }, z.core.$strip>>;
518
532
  app: z.ZodOptional<z.ZodObject<{}, z.core.$strict>>;
519
- subagentId: z.ZodOptional<z.ZodString>;
520
- parentToolCallId: z.ZodOptional<z.ZodString>;
521
- sequence: z.ZodNumber;
522
- turnId: z.ZodString;
523
533
  }, z.core.$strip>;
524
534
  /** `plan_update._meta.hgw`: the lossless Session Todos. */
525
535
  export declare const HgwPlanMetaSchema: z.ZodObject<{
@@ -530,9 +540,9 @@ export declare const HgwPlanMetaSchema: z.ZodObject<{
530
540
  label: z.ZodString;
531
541
  status: z.ZodEnum<{
532
542
  active: "active";
543
+ completed: "completed";
533
544
  failed: "failed";
534
545
  pending: "pending";
535
- completed: "completed";
536
546
  }>;
537
547
  }, z.core.$strict>>;
538
548
  }, z.core.$strip>;
@@ -545,9 +555,9 @@ export declare const HgwPlanMetaSchema: z.ZodObject<{
545
555
  */
546
556
  export declare const HgwUsageMetaSchema: z.ZodObject<{
547
557
  source: z.ZodEnum<{
558
+ "local-estimate": "local-estimate";
548
559
  "provider-usage": "provider-usage";
549
560
  "provider-usage-plus-estimate": "provider-usage-plus-estimate";
550
- "local-estimate": "local-estimate";
551
561
  }>;
552
562
  estimated: z.ZodOptional<z.ZodLiteral<true>>;
553
563
  breakdown: z.ZodOptional<z.ZodObject<{
@@ -647,9 +657,9 @@ export declare const HgwAvailableCommandsMetaSchema: z.ZodObject<{
647
657
  scope: z.ZodLiteral<"turn">;
648
658
  answerModes: z.ZodTuple<[z.ZodLiteral<"single">, z.ZodLiteral<"multiple">, z.ZodLiteral<"free-text">], null>;
649
659
  cancellation: z.ZodEnum<{
660
+ "native-cancel": "native-cancel";
650
661
  "native-empty-answer": "native-empty-answer";
651
662
  "native-reject": "native-reject";
652
- "native-cancel": "native-cancel";
653
663
  }>;
654
664
  maxQuestions: z.ZodNumber;
655
665
  maxChoicesPerQuestion: z.ZodNumber;
@@ -774,8 +784,8 @@ export declare const HgwArtifactDescriptorSchema: z.ZodObject<{
774
784
  source: z.ZodDiscriminatedUnion<[z.ZodObject<{
775
785
  type: z.ZodLiteral<"inline">;
776
786
  encoding: z.ZodEnum<{
777
- utf8: "utf8";
778
787
  base64: "base64";
788
+ utf8: "utf8";
779
789
  }>;
780
790
  data: z.ZodString;
781
791
  }, z.core.$strict>, z.ZodObject<{
@@ -820,42 +830,42 @@ export declare const HGW_REQUEST_TEXT_MAX = 200;
820
830
  * session list, and those items are marked `replayed`.
821
831
  */
822
832
  export declare const HgwActivityNotificationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
833
+ agentId: z.ZodString;
834
+ sessionId: z.ZodString;
835
+ occurredAt: z.ZodISODateTime;
836
+ replayed: z.ZodOptional<z.ZodLiteral<true>>;
823
837
  type: z.ZodEnum<{
824
- "turn-started": "turn-started";
825
- "turn-finished": "turn-finished";
826
838
  "turn-failed": "turn-failed";
839
+ "turn-finished": "turn-finished";
840
+ "turn-started": "turn-started";
827
841
  }>;
828
842
  turnId: z.ZodString;
843
+ }, z.core.$strip>, z.ZodObject<{
829
844
  agentId: z.ZodString;
830
845
  sessionId: z.ZodString;
831
846
  occurredAt: z.ZodISODateTime;
832
847
  replayed: z.ZodOptional<z.ZodLiteral<true>>;
833
- }, z.core.$strip>, z.ZodObject<{
834
848
  type: z.ZodLiteral<"attention-requested">;
835
849
  requestId: z.ZodString;
836
850
  attentionKind: z.ZodEnum<{
837
- question: "question";
838
851
  permission: "permission";
852
+ question: "question";
839
853
  }>;
840
854
  requestText: z.ZodOptional<z.ZodString>;
841
855
  requestMore: z.ZodOptional<z.ZodNumber>;
856
+ }, z.core.$strip>, z.ZodObject<{
842
857
  agentId: z.ZodString;
843
858
  sessionId: z.ZodString;
844
859
  occurredAt: z.ZodISODateTime;
845
860
  replayed: z.ZodOptional<z.ZodLiteral<true>>;
846
- }, z.core.$strip>, z.ZodObject<{
847
861
  type: z.ZodLiteral<"attention-resolved">;
848
862
  requestId: z.ZodString;
863
+ }, z.core.$strip>, z.ZodObject<{
849
864
  agentId: z.ZodString;
850
865
  sessionId: z.ZodString;
851
866
  occurredAt: z.ZodISODateTime;
852
867
  replayed: z.ZodOptional<z.ZodLiteral<true>>;
853
- }, z.core.$strip>, z.ZodObject<{
854
868
  type: z.ZodLiteral<"unread-changed">;
855
869
  unread: z.ZodBoolean;
856
- agentId: z.ZodString;
857
- sessionId: z.ZodString;
858
- occurredAt: z.ZodISODateTime;
859
- replayed: z.ZodOptional<z.ZodLiteral<true>>;
860
870
  }, z.core.$strip>], "type">;
861
871
  export type HgwActivityNotification = z.infer<typeof HgwActivityNotificationSchema>;