@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/dist/protocol/acp.d.ts
CHANGED
|
@@ -118,8 +118,8 @@ export declare const HgwClientCapabilitiesMetaSchema: z.ZodObject<{
|
|
|
118
118
|
export declare const HgwInitializeMetaSchema: z.ZodObject<{
|
|
119
119
|
version: z.ZodLiteral<1>;
|
|
120
120
|
role: z.ZodEnum<{
|
|
121
|
-
operator: "operator";
|
|
122
121
|
guest: "guest";
|
|
122
|
+
operator: "operator";
|
|
123
123
|
}>;
|
|
124
124
|
extensions: z.ZodObject<{
|
|
125
125
|
steer: z.ZodBoolean;
|
|
@@ -177,11 +177,11 @@ export declare const HgwSessionSearchResponseSchema: z.ZodObject<{
|
|
|
177
177
|
export declare const HgwSessionInfoMetaSchema: z.ZodObject<{
|
|
178
178
|
agentId: z.ZodString;
|
|
179
179
|
status: z.ZodEnum<{
|
|
180
|
-
|
|
180
|
+
failed: "failed";
|
|
181
181
|
idle: "idle";
|
|
182
182
|
running: "running";
|
|
183
|
+
unknown: "unknown";
|
|
183
184
|
"waiting-for-input": "waiting-for-input";
|
|
184
|
-
failed: "failed";
|
|
185
185
|
}>;
|
|
186
186
|
archived: z.ZodBoolean;
|
|
187
187
|
createdAt: z.ZodOptional<z.ZodISODateTime>;
|
|
@@ -189,11 +189,11 @@ export declare const HgwSessionInfoMetaSchema: z.ZodObject<{
|
|
|
189
189
|
pinned: z.ZodOptional<z.ZodBoolean>;
|
|
190
190
|
platform: z.ZodOptional<z.ZodEnum<{
|
|
191
191
|
buzz: "buzz";
|
|
192
|
-
|
|
192
|
+
discord: "discord";
|
|
193
|
+
email: "email";
|
|
193
194
|
slack: "slack";
|
|
194
195
|
telegram: "telegram";
|
|
195
|
-
|
|
196
|
-
discord: "discord";
|
|
196
|
+
whatsapp: "whatsapp";
|
|
197
197
|
}>>;
|
|
198
198
|
}, z.core.$strip>;
|
|
199
199
|
export type HgwSessionInfoMeta = z.infer<typeof HgwSessionInfoMetaSchema>;
|
|
@@ -292,8 +292,8 @@ export declare const HgwSteerRequestSchema: z.ZodObject<{
|
|
|
292
292
|
}, z.core.$strict>;
|
|
293
293
|
export declare const HgwSteerResponseSchema: z.ZodObject<{
|
|
294
294
|
status: z.ZodEnum<{
|
|
295
|
-
steered: "steered";
|
|
296
295
|
queued: "queued";
|
|
296
|
+
steered: "steered";
|
|
297
297
|
}>;
|
|
298
298
|
}, z.core.$strict>;
|
|
299
299
|
/**
|
|
@@ -319,40 +319,43 @@ export declare const HgwAgentsListResponseSchema: z.ZodObject<{
|
|
|
319
319
|
description: z.ZodOptional<z.ZodString>;
|
|
320
320
|
status: z.ZodOptional<z.ZodEnum<{
|
|
321
321
|
active: "active";
|
|
322
|
-
|
|
322
|
+
attention: "attention";
|
|
323
323
|
idle: "idle";
|
|
324
324
|
running: "running";
|
|
325
|
-
|
|
325
|
+
unknown: "unknown";
|
|
326
326
|
}>>;
|
|
327
327
|
activity: z.ZodOptional<z.ZodEnum<{
|
|
328
328
|
active: "active";
|
|
329
|
-
unknown: "unknown";
|
|
330
329
|
idle: "idle";
|
|
330
|
+
unknown: "unknown";
|
|
331
331
|
}>>;
|
|
332
332
|
visibility: z.ZodOptional<z.ZodEnum<{
|
|
333
|
-
visible: "visible";
|
|
334
333
|
hidden: "hidden";
|
|
334
|
+
visible: "visible";
|
|
335
335
|
}>>;
|
|
336
336
|
role: z.ZodOptional<z.ZodLiteral<"creator">>;
|
|
337
337
|
avatar: z.ZodOptional<z.ZodString>;
|
|
338
|
+
muted: z.ZodOptional<z.ZodLiteral<true>>;
|
|
338
339
|
}, z.core.$strict>;
|
|
339
340
|
visibility: z.ZodEnum<{
|
|
340
|
-
visible: "visible";
|
|
341
341
|
hidden: "hidden";
|
|
342
|
+
visible: "visible";
|
|
342
343
|
}>;
|
|
343
344
|
selectable: z.ZodBoolean;
|
|
344
345
|
editable: z.ZodBoolean;
|
|
345
346
|
avatarEditable: z.ZodBoolean;
|
|
347
|
+
muteEditable: z.ZodBoolean;
|
|
346
348
|
revision: z.ZodString;
|
|
347
349
|
}, z.core.$strict>>;
|
|
348
350
|
}, z.core.$strict>;
|
|
349
|
-
/** `_hgw/agents/update` params: at least one of visibility and
|
|
351
|
+
/** `_hgw/agents/update` params: at least one of visibility, avatar, and muted. */
|
|
350
352
|
export declare const HgwAgentUpdateRequestSchema: z.ZodObject<{
|
|
351
353
|
visibility: z.ZodOptional<z.ZodEnum<{
|
|
352
|
-
visible: "visible";
|
|
353
354
|
hidden: "hidden";
|
|
355
|
+
visible: "visible";
|
|
354
356
|
}>>;
|
|
355
357
|
avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
358
|
+
muted: z.ZodOptional<z.ZodBoolean>;
|
|
356
359
|
revision: z.ZodString;
|
|
357
360
|
agentId: z.ZodString;
|
|
358
361
|
}, z.core.$strict>;
|
|
@@ -367,30 +370,32 @@ export declare const HgwAgentUpdateResponseSchema: z.ZodObject<{
|
|
|
367
370
|
description: z.ZodOptional<z.ZodString>;
|
|
368
371
|
status: z.ZodOptional<z.ZodEnum<{
|
|
369
372
|
active: "active";
|
|
370
|
-
|
|
373
|
+
attention: "attention";
|
|
371
374
|
idle: "idle";
|
|
372
375
|
running: "running";
|
|
373
|
-
|
|
376
|
+
unknown: "unknown";
|
|
374
377
|
}>>;
|
|
375
378
|
activity: z.ZodOptional<z.ZodEnum<{
|
|
376
379
|
active: "active";
|
|
377
|
-
unknown: "unknown";
|
|
378
380
|
idle: "idle";
|
|
381
|
+
unknown: "unknown";
|
|
379
382
|
}>>;
|
|
380
383
|
visibility: z.ZodOptional<z.ZodEnum<{
|
|
381
|
-
visible: "visible";
|
|
382
384
|
hidden: "hidden";
|
|
385
|
+
visible: "visible";
|
|
383
386
|
}>>;
|
|
384
387
|
role: z.ZodOptional<z.ZodLiteral<"creator">>;
|
|
385
388
|
avatar: z.ZodOptional<z.ZodString>;
|
|
389
|
+
muted: z.ZodOptional<z.ZodLiteral<true>>;
|
|
386
390
|
}, z.core.$strict>;
|
|
387
391
|
visibility: z.ZodEnum<{
|
|
388
|
-
visible: "visible";
|
|
389
392
|
hidden: "hidden";
|
|
393
|
+
visible: "visible";
|
|
390
394
|
}>;
|
|
391
395
|
selectable: z.ZodBoolean;
|
|
392
396
|
editable: z.ZodBoolean;
|
|
393
397
|
avatarEditable: z.ZodBoolean;
|
|
398
|
+
muteEditable: z.ZodBoolean;
|
|
394
399
|
revision: z.ZodString;
|
|
395
400
|
}, z.core.$strict>;
|
|
396
401
|
}, z.core.$strict>;
|
|
@@ -422,8 +427,8 @@ export declare const HgwMessageMetaSchema: z.ZodObject<{
|
|
|
422
427
|
opensTurn: z.ZodLiteral<true>;
|
|
423
428
|
notice: z.ZodOptional<z.ZodObject<{
|
|
424
429
|
severity: z.ZodEnum<{
|
|
425
|
-
info: "info";
|
|
426
430
|
error: "error";
|
|
431
|
+
info: "info";
|
|
427
432
|
warning: "warning";
|
|
428
433
|
}>;
|
|
429
434
|
title: z.ZodString;
|
|
@@ -449,10 +454,10 @@ export declare const HgwSubagentSchema: z.ZodObject<{
|
|
|
449
454
|
model: z.ZodOptional<z.ZodString>;
|
|
450
455
|
depth: z.ZodOptional<z.ZodNumber>;
|
|
451
456
|
status: z.ZodOptional<z.ZodEnum<{
|
|
452
|
-
running: "running";
|
|
453
|
-
failed: "failed";
|
|
454
457
|
cancelled: "cancelled";
|
|
455
458
|
completed: "completed";
|
|
459
|
+
failed: "failed";
|
|
460
|
+
running: "running";
|
|
456
461
|
}>>;
|
|
457
462
|
tokens: z.ZodOptional<z.ZodNumber>;
|
|
458
463
|
filesRead: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -464,6 +469,8 @@ export declare const HgwSubagentSchema: z.ZodObject<{
|
|
|
464
469
|
export type HgwSubagent = z.infer<typeof HgwSubagentSchema>;
|
|
465
470
|
/** `state_update._meta.hgw` */
|
|
466
471
|
export declare const HgwStateMetaSchema: z.ZodObject<{
|
|
472
|
+
sequence: z.ZodNumber;
|
|
473
|
+
turnId: z.ZodString;
|
|
467
474
|
at: z.ZodOptional<z.ZodISODateTime>;
|
|
468
475
|
execution: z.ZodOptional<z.ZodLiteral<"stopping">>;
|
|
469
476
|
code: z.ZodOptional<z.ZodString>;
|
|
@@ -474,18 +481,20 @@ export declare const HgwStateMetaSchema: z.ZodObject<{
|
|
|
474
481
|
amount: z.ZodNumber;
|
|
475
482
|
currency: z.ZodString;
|
|
476
483
|
}, z.core.$strip>>;
|
|
477
|
-
sequence: z.ZodNumber;
|
|
478
|
-
turnId: z.ZodString;
|
|
479
484
|
}, z.core.$strip>;
|
|
480
485
|
/** `agent_message_chunk` / `agent_thought_chunk` `_meta.hgw` */
|
|
481
486
|
export declare const HgwChunkMetaSchema: z.ZodObject<{
|
|
482
|
-
subagentId: z.ZodOptional<z.ZodString>;
|
|
483
|
-
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
484
487
|
sequence: z.ZodNumber;
|
|
485
488
|
turnId: z.ZodString;
|
|
489
|
+
subagentId: z.ZodOptional<z.ZodString>;
|
|
490
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
486
491
|
}, z.core.$strip>;
|
|
487
492
|
/** `tool_call_update` / `tool_call_content_chunk` `_meta.hgw` */
|
|
488
493
|
export declare const HgwToolCallMetaSchema: z.ZodObject<{
|
|
494
|
+
sequence: z.ZodNumber;
|
|
495
|
+
turnId: z.ZodString;
|
|
496
|
+
subagentId: z.ZodOptional<z.ZodString>;
|
|
497
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
489
498
|
messageId: z.ZodString;
|
|
490
499
|
argsTextDelta: z.ZodOptional<z.ZodString>;
|
|
491
500
|
argsText: z.ZodOptional<z.ZodString>;
|
|
@@ -498,10 +507,10 @@ export declare const HgwToolCallMetaSchema: z.ZodObject<{
|
|
|
498
507
|
model: z.ZodOptional<z.ZodString>;
|
|
499
508
|
depth: z.ZodOptional<z.ZodNumber>;
|
|
500
509
|
status: z.ZodOptional<z.ZodEnum<{
|
|
501
|
-
running: "running";
|
|
502
|
-
failed: "failed";
|
|
503
510
|
cancelled: "cancelled";
|
|
504
511
|
completed: "completed";
|
|
512
|
+
failed: "failed";
|
|
513
|
+
running: "running";
|
|
505
514
|
}>>;
|
|
506
515
|
tokens: z.ZodOptional<z.ZodNumber>;
|
|
507
516
|
filesRead: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -511,10 +520,6 @@ export declare const HgwToolCallMetaSchema: z.ZodObject<{
|
|
|
511
520
|
summary: z.ZodOptional<z.ZodString>;
|
|
512
521
|
}, z.core.$strip>>;
|
|
513
522
|
app: z.ZodOptional<z.ZodObject<{}, z.core.$strict>>;
|
|
514
|
-
subagentId: z.ZodOptional<z.ZodString>;
|
|
515
|
-
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
516
|
-
sequence: z.ZodNumber;
|
|
517
|
-
turnId: z.ZodString;
|
|
518
523
|
}, z.core.$strip>;
|
|
519
524
|
/** `plan_update._meta.hgw`: the lossless Session Todos. */
|
|
520
525
|
export declare const HgwPlanMetaSchema: z.ZodObject<{
|
|
@@ -525,9 +530,9 @@ export declare const HgwPlanMetaSchema: z.ZodObject<{
|
|
|
525
530
|
label: z.ZodString;
|
|
526
531
|
status: z.ZodEnum<{
|
|
527
532
|
active: "active";
|
|
533
|
+
completed: "completed";
|
|
528
534
|
failed: "failed";
|
|
529
535
|
pending: "pending";
|
|
530
|
-
completed: "completed";
|
|
531
536
|
}>;
|
|
532
537
|
}, z.core.$strict>>;
|
|
533
538
|
}, z.core.$strip>;
|
|
@@ -540,9 +545,9 @@ export declare const HgwPlanMetaSchema: z.ZodObject<{
|
|
|
540
545
|
*/
|
|
541
546
|
export declare const HgwUsageMetaSchema: z.ZodObject<{
|
|
542
547
|
source: z.ZodEnum<{
|
|
548
|
+
"local-estimate": "local-estimate";
|
|
543
549
|
"provider-usage": "provider-usage";
|
|
544
550
|
"provider-usage-plus-estimate": "provider-usage-plus-estimate";
|
|
545
|
-
"local-estimate": "local-estimate";
|
|
546
551
|
}>;
|
|
547
552
|
estimated: z.ZodOptional<z.ZodLiteral<true>>;
|
|
548
553
|
breakdown: z.ZodOptional<z.ZodObject<{
|
|
@@ -642,9 +647,9 @@ export declare const HgwAvailableCommandsMetaSchema: z.ZodObject<{
|
|
|
642
647
|
scope: z.ZodLiteral<"turn">;
|
|
643
648
|
answerModes: z.ZodTuple<[z.ZodLiteral<"single">, z.ZodLiteral<"multiple">, z.ZodLiteral<"free-text">], null>;
|
|
644
649
|
cancellation: z.ZodEnum<{
|
|
650
|
+
"native-cancel": "native-cancel";
|
|
645
651
|
"native-empty-answer": "native-empty-answer";
|
|
646
652
|
"native-reject": "native-reject";
|
|
647
|
-
"native-cancel": "native-cancel";
|
|
648
653
|
}>;
|
|
649
654
|
maxQuestions: z.ZodNumber;
|
|
650
655
|
maxChoicesPerQuestion: z.ZodNumber;
|
|
@@ -769,8 +774,8 @@ export declare const HgwArtifactDescriptorSchema: z.ZodObject<{
|
|
|
769
774
|
source: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
770
775
|
type: z.ZodLiteral<"inline">;
|
|
771
776
|
encoding: z.ZodEnum<{
|
|
772
|
-
utf8: "utf8";
|
|
773
777
|
base64: "base64";
|
|
778
|
+
utf8: "utf8";
|
|
774
779
|
}>;
|
|
775
780
|
data: z.ZodString;
|
|
776
781
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -803,41 +808,54 @@ export declare const HgwErrorNotificationSchema: z.ZodObject<{
|
|
|
803
808
|
message: z.ZodString;
|
|
804
809
|
}, z.core.$strip>;
|
|
805
810
|
/**
|
|
806
|
-
*
|
|
807
|
-
*
|
|
808
|
-
|
|
811
|
+
* The longest a request preview may be, in UTF-16 units, as zod's `.max`
|
|
812
|
+
* counts; the push payload's `requestText` shares it.
|
|
813
|
+
*/
|
|
814
|
+
export declare const HGW_REQUEST_TEXT_MAX = 200;
|
|
815
|
+
/**
|
|
816
|
+
* `_hgw/activity`: workspace events for every Session the connection may
|
|
817
|
+
* observe, in ids, times, and kinds. An attention request also carries a
|
|
818
|
+
* one-line preview of what it asks, with credentials masked, and how many
|
|
819
|
+
* questions follow it. Hydrated on connect from coordinator snapshots and the
|
|
820
|
+
* session list, and those items are marked `replayed`.
|
|
809
821
|
*/
|
|
810
822
|
export declare const HgwActivityNotificationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
823
|
+
agentId: z.ZodString;
|
|
824
|
+
sessionId: z.ZodString;
|
|
825
|
+
occurredAt: z.ZodISODateTime;
|
|
826
|
+
replayed: z.ZodOptional<z.ZodLiteral<true>>;
|
|
811
827
|
type: z.ZodEnum<{
|
|
812
|
-
"turn-started": "turn-started";
|
|
813
|
-
"turn-finished": "turn-finished";
|
|
814
828
|
"turn-failed": "turn-failed";
|
|
829
|
+
"turn-finished": "turn-finished";
|
|
830
|
+
"turn-started": "turn-started";
|
|
815
831
|
}>;
|
|
816
832
|
turnId: z.ZodString;
|
|
833
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
817
834
|
agentId: z.ZodString;
|
|
818
835
|
sessionId: z.ZodString;
|
|
819
836
|
occurredAt: z.ZodISODateTime;
|
|
820
|
-
|
|
837
|
+
replayed: z.ZodOptional<z.ZodLiteral<true>>;
|
|
821
838
|
type: z.ZodLiteral<"attention-requested">;
|
|
822
839
|
requestId: z.ZodString;
|
|
823
840
|
attentionKind: z.ZodEnum<{
|
|
824
|
-
question: "question";
|
|
825
841
|
permission: "permission";
|
|
842
|
+
question: "question";
|
|
826
843
|
}>;
|
|
844
|
+
requestText: z.ZodOptional<z.ZodString>;
|
|
845
|
+
requestMore: z.ZodOptional<z.ZodNumber>;
|
|
846
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
827
847
|
agentId: z.ZodString;
|
|
828
848
|
sessionId: z.ZodString;
|
|
829
849
|
occurredAt: z.ZodISODateTime;
|
|
830
|
-
|
|
850
|
+
replayed: z.ZodOptional<z.ZodLiteral<true>>;
|
|
831
851
|
type: z.ZodLiteral<"attention-resolved">;
|
|
832
852
|
requestId: z.ZodString;
|
|
853
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
833
854
|
agentId: z.ZodString;
|
|
834
855
|
sessionId: z.ZodString;
|
|
835
856
|
occurredAt: z.ZodISODateTime;
|
|
836
|
-
|
|
857
|
+
replayed: z.ZodOptional<z.ZodLiteral<true>>;
|
|
837
858
|
type: z.ZodLiteral<"unread-changed">;
|
|
838
859
|
unread: z.ZodBoolean;
|
|
839
|
-
agentId: z.ZodString;
|
|
840
|
-
sessionId: z.ZodString;
|
|
841
|
-
occurredAt: z.ZodISODateTime;
|
|
842
860
|
}, z.core.$strip>], "type">;
|
|
843
861
|
export type HgwActivityNotification = z.infer<typeof HgwActivityNotificationSchema>;
|