@kindgi/client 0.1.4 → 0.1.5-rc.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/index.cjs +906 -418
- package/dist/index.d.cts +9856 -5971
- package/dist/index.d.ts +9856 -5971
- package/dist/index.js +905 -419
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -47,6 +47,8 @@ function classify(body, status) {
|
|
|
47
47
|
case "auth-revoked":
|
|
48
48
|
return { code: "auth", message, reason: "unauthenticated" };
|
|
49
49
|
case "permission-denied":
|
|
50
|
+
case "role-exceeds-principal":
|
|
51
|
+
case "key-project-mismatch":
|
|
50
52
|
return { code: "auth", message, reason: "forbidden" };
|
|
51
53
|
case "rate-limited":
|
|
52
54
|
case "rate-limit-exceeded":
|
|
@@ -75,11 +77,15 @@ function classify(body, status) {
|
|
|
75
77
|
case "token-not-found":
|
|
76
78
|
case "agent-version-not-found":
|
|
77
79
|
case "promotion-not-found":
|
|
80
|
+
case "principal-not-found":
|
|
81
|
+
case "service-account-not-found":
|
|
78
82
|
return notFound(code, message, details);
|
|
79
83
|
case "conflict":
|
|
80
84
|
case "already-terminal":
|
|
81
85
|
case "run-already-terminal":
|
|
82
86
|
case "idempotency-key-body-mismatch":
|
|
87
|
+
case "idempotency-key-in-flight":
|
|
88
|
+
case "idempotency-key-replay-withheld":
|
|
83
89
|
case "hitl-required":
|
|
84
90
|
case "agent-already-registered":
|
|
85
91
|
case "tool-already-registered":
|
|
@@ -111,8 +117,18 @@ function classify(body, status) {
|
|
|
111
117
|
case "gate-policy-scope-changed":
|
|
112
118
|
case "gate-policy-scope-unpinned":
|
|
113
119
|
case "gate-policy-needs-pin":
|
|
120
|
+
case "fact-changed":
|
|
121
|
+
case "legal-hold":
|
|
122
|
+
case "erasure-in-progress":
|
|
114
123
|
case "gate-policy-descendant-unpinned":
|
|
115
|
-
|
|
124
|
+
case "service-account-name-taken":
|
|
125
|
+
case "service-account-unregistered":
|
|
126
|
+
case "identity-user-email-taken":
|
|
127
|
+
case "last-tenant-admin":
|
|
128
|
+
case "seed-user-admin":
|
|
129
|
+
case "identity-user-unregister-refused":
|
|
130
|
+
case "identity-user-unregistered":
|
|
131
|
+
return conflict(code, message, details);
|
|
116
132
|
case "invalid-request":
|
|
117
133
|
case "validation-failed":
|
|
118
134
|
case "unknown-field":
|
|
@@ -126,8 +142,11 @@ function classify(body, status) {
|
|
|
126
142
|
case "unknown-effect":
|
|
127
143
|
case "invalid-guardrail":
|
|
128
144
|
case "invalid-provider":
|
|
145
|
+
case "guardrail-config-invalid":
|
|
146
|
+
case "provider-config-invalid":
|
|
129
147
|
case "supervisor-header-missing":
|
|
130
148
|
case "scope-invalid":
|
|
149
|
+
case "artifact-too-large":
|
|
131
150
|
return invalidRequest(message, obj, details);
|
|
132
151
|
case "guardrail-violation":
|
|
133
152
|
return {
|
|
@@ -140,13 +159,24 @@ function classify(body, status) {
|
|
|
140
159
|
return byStatus(status, code, message, obj, details);
|
|
141
160
|
}
|
|
142
161
|
}
|
|
162
|
+
function conflict(code, message, details) {
|
|
163
|
+
return {
|
|
164
|
+
code: "conflict",
|
|
165
|
+
message,
|
|
166
|
+
reason: code,
|
|
167
|
+
...details !== void 0 ? { fields: details } : {}
|
|
168
|
+
};
|
|
169
|
+
}
|
|
143
170
|
function byStatus(status, code, message, obj, details) {
|
|
144
171
|
switch (status) {
|
|
145
172
|
case 404:
|
|
146
173
|
case 410:
|
|
147
174
|
return notFound(code, message, details);
|
|
148
175
|
case 400:
|
|
176
|
+
case 413:
|
|
149
177
|
return invalidRequest(message, obj, details);
|
|
178
|
+
case 409:
|
|
179
|
+
return conflict(code, message, details);
|
|
150
180
|
case 401:
|
|
151
181
|
return { code: "auth", message, reason: "unauthenticated" };
|
|
152
182
|
case 403:
|
|
@@ -210,10 +240,10 @@ function readStringField(obj, ...keys) {
|
|
|
210
240
|
function asRecord(value) {
|
|
211
241
|
return value !== null && typeof value === "object" ? value : void 0;
|
|
212
242
|
}
|
|
213
|
-
function readGuardrailViolations(
|
|
214
|
-
if (!Array.isArray(
|
|
243
|
+
function readGuardrailViolations(raw2) {
|
|
244
|
+
if (!Array.isArray(raw2)) return [];
|
|
215
245
|
const out = [];
|
|
216
|
-
for (const entry of
|
|
246
|
+
for (const entry of raw2) {
|
|
217
247
|
const v = asRecord(entry);
|
|
218
248
|
if (v === void 0 || typeof v.guardrailId !== "string") continue;
|
|
219
249
|
const reason = asRecord(v.result)?.reason;
|
|
@@ -226,10 +256,10 @@ function readGuardrailViolations(raw) {
|
|
|
226
256
|
}
|
|
227
257
|
return out;
|
|
228
258
|
}
|
|
229
|
-
function readEvaluationErrors(
|
|
230
|
-
if (!Array.isArray(
|
|
259
|
+
function readEvaluationErrors(raw2) {
|
|
260
|
+
if (!Array.isArray(raw2)) return [];
|
|
231
261
|
const out = [];
|
|
232
|
-
for (const entry of
|
|
262
|
+
for (const entry of raw2) {
|
|
233
263
|
const e = asRecord(entry);
|
|
234
264
|
if (e === void 0 || typeof e.guardrailId !== "string") continue;
|
|
235
265
|
out.push({
|
|
@@ -330,9 +360,9 @@ async function* parseSseStream(body) {
|
|
|
330
360
|
newlineIdx = buffer.indexOf("\n");
|
|
331
361
|
if (line === "") {
|
|
332
362
|
if (dataLines.length > 0) {
|
|
333
|
-
const
|
|
363
|
+
const raw2 = dataLines.join("\n");
|
|
334
364
|
try {
|
|
335
|
-
const data = JSON.parse(
|
|
365
|
+
const data = JSON.parse(raw2);
|
|
336
366
|
yield { event: eventName, data, ...eventId !== void 0 ? { id: eventId } : {} };
|
|
337
367
|
} catch {
|
|
338
368
|
}
|
|
@@ -470,12 +500,12 @@ function makeAdaptersClient(transport) {
|
|
|
470
500
|
|
|
471
501
|
// src/resources/agents.ts
|
|
472
502
|
function makeAgentsClient(transport) {
|
|
473
|
-
const
|
|
503
|
+
const seg2 = (s) => encodeURIComponent(s);
|
|
474
504
|
const versions = {
|
|
475
505
|
async list(agentId, filter) {
|
|
476
506
|
return transport.request({
|
|
477
507
|
method: "GET",
|
|
478
|
-
path: `/v1/agents/${
|
|
508
|
+
path: `/v1/agents/${seg2(agentId)}/versions`,
|
|
479
509
|
query: {
|
|
480
510
|
...filter?.limit !== void 0 && { limit: filter.limit },
|
|
481
511
|
...filter?.cursor !== void 0 && { cursor: filter.cursor }
|
|
@@ -485,13 +515,13 @@ function makeAgentsClient(transport) {
|
|
|
485
515
|
async get(agentId, version) {
|
|
486
516
|
return transport.request({
|
|
487
517
|
method: "GET",
|
|
488
|
-
path: `/v1/agents/${
|
|
518
|
+
path: `/v1/agents/${seg2(agentId)}/versions/${seg2(version)}`
|
|
489
519
|
});
|
|
490
520
|
},
|
|
491
521
|
async unregister(agentId, version, options) {
|
|
492
522
|
return transport.request({
|
|
493
523
|
method: "POST",
|
|
494
|
-
path: `/v1/agents/${
|
|
524
|
+
path: `/v1/agents/${seg2(agentId)}/versions/${seg2(version)}/unregister`,
|
|
495
525
|
...options?.idempotencyKey !== void 0 && {
|
|
496
526
|
idempotencyKey: options.idempotencyKey
|
|
497
527
|
}
|
|
@@ -500,7 +530,7 @@ function makeAgentsClient(transport) {
|
|
|
500
530
|
async derive(agentId, input, options) {
|
|
501
531
|
return transport.request({
|
|
502
532
|
method: "POST",
|
|
503
|
-
path: `/v1/agents/${
|
|
533
|
+
path: `/v1/agents/${seg2(agentId)}/versions`,
|
|
504
534
|
body: input,
|
|
505
535
|
...options?.idempotencyKey !== void 0 && {
|
|
506
536
|
idempotencyKey: options.idempotencyKey
|
|
@@ -510,7 +540,7 @@ function makeAgentsClient(transport) {
|
|
|
510
540
|
async reinstate(agentId, version, options) {
|
|
511
541
|
const wire = await transport.request({
|
|
512
542
|
method: "POST",
|
|
513
|
-
path: `/v1/agents/${
|
|
543
|
+
path: `/v1/agents/${seg2(agentId)}/versions/${seg2(version)}/reinstate`,
|
|
514
544
|
...options?.idempotencyKey !== void 0 && {
|
|
515
545
|
idempotencyKey: options.idempotencyKey
|
|
516
546
|
}
|
|
@@ -548,7 +578,7 @@ function makeAgentsClient(transport) {
|
|
|
548
578
|
async get(agentId) {
|
|
549
579
|
return transport.request({
|
|
550
580
|
method: "GET",
|
|
551
|
-
path: `/v1/agents/${
|
|
581
|
+
path: `/v1/agents/${seg2(agentId)}`
|
|
552
582
|
});
|
|
553
583
|
},
|
|
554
584
|
versions,
|
|
@@ -557,7 +587,7 @@ function makeAgentsClient(transport) {
|
|
|
557
587
|
async resolve(agentId, where) {
|
|
558
588
|
return transport.request({
|
|
559
589
|
method: "GET",
|
|
560
|
-
path: `/v1/agents/${
|
|
590
|
+
path: `/v1/agents/${seg2(agentId)}/live`,
|
|
561
591
|
query: {
|
|
562
592
|
...where?.projectId !== void 0 && { projectId: where.projectId },
|
|
563
593
|
...where?.segments !== void 0 && { segment: where.segments.map(segmentParam) }
|
|
@@ -567,13 +597,13 @@ function makeAgentsClient(transport) {
|
|
|
567
597
|
async list(agentId) {
|
|
568
598
|
return transport.request({
|
|
569
599
|
method: "GET",
|
|
570
|
-
path: `/v1/agents/${
|
|
600
|
+
path: `/v1/agents/${seg2(agentId)}/live-versions`
|
|
571
601
|
});
|
|
572
602
|
},
|
|
573
603
|
async rollback(agentId, input, options) {
|
|
574
604
|
return transport.request({
|
|
575
605
|
method: "POST",
|
|
576
|
-
path: `/v1/agents/${
|
|
606
|
+
path: `/v1/agents/${seg2(agentId)}/live/rollback`,
|
|
577
607
|
body: input,
|
|
578
608
|
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
579
609
|
});
|
|
@@ -581,7 +611,7 @@ function makeAgentsClient(transport) {
|
|
|
581
611
|
async unpin(agentId, input, options) {
|
|
582
612
|
return transport.request({
|
|
583
613
|
method: "POST",
|
|
584
|
-
path: `/v1/agents/${
|
|
614
|
+
path: `/v1/agents/${seg2(agentId)}/live/unpin`,
|
|
585
615
|
body: input,
|
|
586
616
|
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
587
617
|
});
|
|
@@ -591,7 +621,7 @@ function makeAgentsClient(transport) {
|
|
|
591
621
|
async create(agentId, input, options) {
|
|
592
622
|
return transport.request({
|
|
593
623
|
method: "POST",
|
|
594
|
-
path: `/v1/agents/${
|
|
624
|
+
path: `/v1/agents/${seg2(agentId)}/promotions`,
|
|
595
625
|
body: input,
|
|
596
626
|
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
597
627
|
});
|
|
@@ -599,14 +629,14 @@ function makeAgentsClient(transport) {
|
|
|
599
629
|
async check(agentId, input) {
|
|
600
630
|
return transport.request({
|
|
601
631
|
method: "POST",
|
|
602
|
-
path: `/v1/agents/${
|
|
632
|
+
path: `/v1/agents/${seg2(agentId)}/promotions/check`,
|
|
603
633
|
body: input
|
|
604
634
|
});
|
|
605
635
|
},
|
|
606
636
|
async list(agentId, filter) {
|
|
607
637
|
return transport.request({
|
|
608
638
|
method: "GET",
|
|
609
|
-
path: `/v1/agents/${
|
|
639
|
+
path: `/v1/agents/${seg2(agentId)}/promotions`,
|
|
610
640
|
query: {
|
|
611
641
|
...filter?.scope !== void 0 && scopeQuery(filter.scope),
|
|
612
642
|
...filter?.limit !== void 0 && { limit: filter.limit },
|
|
@@ -617,7 +647,7 @@ function makeAgentsClient(transport) {
|
|
|
617
647
|
async get(agentId, promotionId) {
|
|
618
648
|
return transport.request({
|
|
619
649
|
method: "GET",
|
|
620
|
-
path: `/v1/agents/${
|
|
650
|
+
path: `/v1/agents/${seg2(agentId)}/promotions/${seg2(promotionId)}`
|
|
621
651
|
});
|
|
622
652
|
}
|
|
623
653
|
},
|
|
@@ -625,7 +655,7 @@ function makeAgentsClient(transport) {
|
|
|
625
655
|
async resolve(agentId, scope) {
|
|
626
656
|
return transport.request({
|
|
627
657
|
method: "GET",
|
|
628
|
-
path: `/v1/agents/${
|
|
658
|
+
path: `/v1/agents/${seg2(agentId)}/gate-policy`,
|
|
629
659
|
query: scopeQuery(scope)
|
|
630
660
|
});
|
|
631
661
|
}
|
|
@@ -680,6 +710,106 @@ function singleStatusQuery(method, status) {
|
|
|
680
710
|
throw new KindgiApiError(error);
|
|
681
711
|
}
|
|
682
712
|
|
|
713
|
+
// src/verify-export.ts
|
|
714
|
+
var ALGORITHMS = {
|
|
715
|
+
ed25519: { key: { name: "Ed25519" }, verify: { name: "Ed25519" } },
|
|
716
|
+
"ecdsa-p256-sha256": {
|
|
717
|
+
key: { name: "ECDSA", namedCurve: "P-256" },
|
|
718
|
+
verify: { name: "ECDSA", hash: "SHA-256" }
|
|
719
|
+
}
|
|
720
|
+
};
|
|
721
|
+
var SIGNED_EXPORT_ALGORITHMS = Object.keys(
|
|
722
|
+
ALGORITHMS
|
|
723
|
+
);
|
|
724
|
+
async function verifySignedExport(envelope, options = {}) {
|
|
725
|
+
const issues = [];
|
|
726
|
+
const checkedAgainst = options.trustedKeys !== void 0 ? "trusted-keys" : "its-own-key";
|
|
727
|
+
const fail = () => ({
|
|
728
|
+
valid: false,
|
|
729
|
+
issues,
|
|
730
|
+
checkedAgainst,
|
|
731
|
+
signingKeyId: envelope.signingKeyId
|
|
732
|
+
});
|
|
733
|
+
const algorithm = Object.hasOwn(ALGORITHMS, envelope.algorithm) ? ALGORITHMS[envelope.algorithm] : void 0;
|
|
734
|
+
if (algorithm === void 0) {
|
|
735
|
+
issues.push(
|
|
736
|
+
`algorithm "${envelope.algorithm}" isn't one this verifier knows (${SIGNED_EXPORT_ALGORITHMS.join(", ")}): a newer verifier may check it`
|
|
737
|
+
);
|
|
738
|
+
}
|
|
739
|
+
if (envelope.canonicalization !== "sorted-key-json") {
|
|
740
|
+
issues.push(`canonicalization "${envelope.canonicalization}" isn't sorted-key-json`);
|
|
741
|
+
}
|
|
742
|
+
if (options.trustedKeys !== void 0 && !options.trustedKeys.some((pem) => samePem(pem, envelope.publicKey))) {
|
|
743
|
+
issues.push(`it was signed with key "${envelope.signingKeyId}", which isn't one you trust`);
|
|
744
|
+
}
|
|
745
|
+
if (issues.length > 0 || algorithm === void 0) return fail();
|
|
746
|
+
let bytes;
|
|
747
|
+
let signed;
|
|
748
|
+
try {
|
|
749
|
+
bytes = fromBase64(envelope.bundle);
|
|
750
|
+
const key = await crypto.subtle.importKey(
|
|
751
|
+
"spki",
|
|
752
|
+
toArrayBuffer(fromPem(envelope.publicKey)),
|
|
753
|
+
algorithm.key,
|
|
754
|
+
false,
|
|
755
|
+
["verify"]
|
|
756
|
+
);
|
|
757
|
+
signed = await crypto.subtle.verify(
|
|
758
|
+
algorithm.verify,
|
|
759
|
+
key,
|
|
760
|
+
toArrayBuffer(fromBase64(envelope.signature)),
|
|
761
|
+
toArrayBuffer(bytes)
|
|
762
|
+
);
|
|
763
|
+
} catch (cause) {
|
|
764
|
+
issues.push(`it can't be checked: ${cause instanceof Error ? cause.message : String(cause)}`);
|
|
765
|
+
return fail();
|
|
766
|
+
}
|
|
767
|
+
if (!signed) {
|
|
768
|
+
issues.push(
|
|
769
|
+
"the signature doesn't match the bundle: it was changed, or signed with another key"
|
|
770
|
+
);
|
|
771
|
+
return fail();
|
|
772
|
+
}
|
|
773
|
+
const body = JSON.parse(new TextDecoder().decode(bytes));
|
|
774
|
+
const notes = [];
|
|
775
|
+
if (body.exportedAt !== void 0 && body.exportedAt !== envelope.exportedAt) {
|
|
776
|
+
if (!madeByKindgi014(envelope, body)) {
|
|
777
|
+
issues.push(
|
|
778
|
+
`the envelope's exportedAt (${envelope.exportedAt}) isn't the signed one (${String(body.exportedAt)})`
|
|
779
|
+
);
|
|
780
|
+
return fail();
|
|
781
|
+
}
|
|
782
|
+
notes.push(
|
|
783
|
+
`made by Kindgi 0.1.4, which stamped the envelope's exportedAt separately: the signed export time is ${String(body.exportedAt)} (the envelope says ${envelope.exportedAt})`
|
|
784
|
+
);
|
|
785
|
+
}
|
|
786
|
+
return {
|
|
787
|
+
valid: true,
|
|
788
|
+
checkedAgainst,
|
|
789
|
+
body,
|
|
790
|
+
signingKeyId: envelope.signingKeyId,
|
|
791
|
+
...notes.length > 0 && { notes }
|
|
792
|
+
};
|
|
793
|
+
}
|
|
794
|
+
function madeByKindgi014(envelope, body) {
|
|
795
|
+
return envelope.bundleSchemaVersion === 1 && body.bundleVersion === 1 && body.bundleSchemaVersion === void 0;
|
|
796
|
+
}
|
|
797
|
+
function samePem(a, b) {
|
|
798
|
+
return a.replace(/\s+/g, "") === b.replace(/\s+/g, "");
|
|
799
|
+
}
|
|
800
|
+
function fromPem(pem) {
|
|
801
|
+
return fromBase64(pem.replace(/-----(BEGIN|END) [A-Z ]+-----/g, "").replace(/\s+/g, ""));
|
|
802
|
+
}
|
|
803
|
+
function fromBase64(b64) {
|
|
804
|
+
const binary = atob(b64);
|
|
805
|
+
const out = new Uint8Array(binary.length);
|
|
806
|
+
for (let i = 0; i < binary.length; i += 1) out[i] = binary.charCodeAt(i);
|
|
807
|
+
return out;
|
|
808
|
+
}
|
|
809
|
+
function toArrayBuffer(bytes) {
|
|
810
|
+
return bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength);
|
|
811
|
+
}
|
|
812
|
+
|
|
683
813
|
// src/resources/approvals.ts
|
|
684
814
|
function makeApprovalsClient(transport) {
|
|
685
815
|
return {
|
|
@@ -801,7 +931,7 @@ function makeApprovalsClient(transport) {
|
|
|
801
931
|
method: "POST",
|
|
802
932
|
path: `/v1/approvals/${encodeURIComponent(input.approvalId)}/audit-bundle`,
|
|
803
933
|
body: {
|
|
804
|
-
signingKeyId: input.signingKeyId,
|
|
934
|
+
...input.signingKeyId !== void 0 && { signingKeyId: input.signingKeyId },
|
|
805
935
|
...input.includeMessages !== void 0 && {
|
|
806
936
|
includeMessages: input.includeMessages
|
|
807
937
|
}
|
|
@@ -825,26 +955,231 @@ function makeApprovalsClient(transport) {
|
|
|
825
955
|
)
|
|
826
956
|
);
|
|
827
957
|
},
|
|
828
|
-
async verify(
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
958
|
+
async verify(bundle, publicKey) {
|
|
959
|
+
const checked = await verifySignedExport(bundle, { trustedKeys: [publicKey] });
|
|
960
|
+
return checked.valid ? { valid: true } : { valid: false, issues: checked.issues ?? [] };
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
};
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
// src/transport.ts
|
|
967
|
+
var DEFAULT_TIMEOUT_MS = 3e4;
|
|
968
|
+
var MUTATING = /* @__PURE__ */ new Set([
|
|
969
|
+
"POST",
|
|
970
|
+
"PUT",
|
|
971
|
+
"PATCH",
|
|
972
|
+
"DELETE"
|
|
973
|
+
]);
|
|
974
|
+
function createTransport(options) {
|
|
975
|
+
const apiUrl = options.apiUrl.replace(/\/+$/u, "");
|
|
976
|
+
const fetchImpl = options.fetch ?? fetch;
|
|
977
|
+
const clientTimeoutMs = checkedTimeoutMs(
|
|
978
|
+
options.timeoutMs ?? DEFAULT_TIMEOUT_MS,
|
|
979
|
+
"ClientOptions.timeoutMs"
|
|
980
|
+
);
|
|
981
|
+
return {
|
|
982
|
+
apiUrl,
|
|
983
|
+
fetchImpl,
|
|
984
|
+
authHeaders() {
|
|
985
|
+
return { Authorization: `Bearer ${authTokenFor(options.auth)}` };
|
|
986
|
+
},
|
|
987
|
+
async request(input) {
|
|
988
|
+
const url = buildUrl(apiUrl, input.path, input.query);
|
|
989
|
+
const headers = buildHeaders(input, options.auth);
|
|
990
|
+
const timeoutMs = input.timeoutMs === void 0 ? clientTimeoutMs : checkedTimeoutMs(input.timeoutMs, "timeoutMs");
|
|
991
|
+
const ac = new AbortController();
|
|
992
|
+
let timedOut = false;
|
|
993
|
+
const timer = setTimeout(() => {
|
|
994
|
+
timedOut = true;
|
|
995
|
+
ac.abort(new Error("timeout"));
|
|
996
|
+
}, timeoutMs);
|
|
997
|
+
let response;
|
|
998
|
+
try {
|
|
999
|
+
response = await fetchImpl(url, {
|
|
1000
|
+
method: input.method,
|
|
1001
|
+
headers,
|
|
1002
|
+
...input.body !== void 0 && { body: JSON.stringify(input.body) },
|
|
1003
|
+
signal: ac.signal
|
|
1004
|
+
});
|
|
1005
|
+
} catch (cause) {
|
|
1006
|
+
clearTimeout(timer);
|
|
1007
|
+
const err = timedOut ? {
|
|
1008
|
+
code: "network",
|
|
1009
|
+
message: `No answer within ${seconds(timeoutMs)}, the client's timeout (timeoutMs).`,
|
|
1010
|
+
cause,
|
|
1011
|
+
timeoutMs
|
|
1012
|
+
} : {
|
|
1013
|
+
code: "network",
|
|
1014
|
+
message: cause instanceof Error ? cause.message : "network request failed",
|
|
1015
|
+
cause
|
|
1016
|
+
};
|
|
1017
|
+
throw new KindgiApiError(err);
|
|
1018
|
+
}
|
|
1019
|
+
clearTimeout(timer);
|
|
1020
|
+
if (response.ok) {
|
|
1021
|
+
if (input.discardResponse === true || response.status === 204) {
|
|
1022
|
+
try {
|
|
1023
|
+
await response.arrayBuffer();
|
|
1024
|
+
} catch {
|
|
1025
|
+
}
|
|
1026
|
+
return void 0;
|
|
1027
|
+
}
|
|
1028
|
+
try {
|
|
1029
|
+
return await response.json();
|
|
1030
|
+
} catch (cause) {
|
|
1031
|
+
const err = {
|
|
1032
|
+
code: "network",
|
|
1033
|
+
message: "Response body was not valid JSON",
|
|
1034
|
+
cause
|
|
1035
|
+
};
|
|
1036
|
+
throw new KindgiApiError(err);
|
|
1037
|
+
}
|
|
835
1038
|
}
|
|
1039
|
+
let body;
|
|
1040
|
+
try {
|
|
1041
|
+
body = await response.json();
|
|
1042
|
+
} catch {
|
|
1043
|
+
body = void 0;
|
|
1044
|
+
}
|
|
1045
|
+
throw new KindgiApiError(
|
|
1046
|
+
fromWire(unwrapErrorEnvelope(body, response.status), response.status)
|
|
1047
|
+
);
|
|
836
1048
|
}
|
|
837
1049
|
};
|
|
838
1050
|
}
|
|
1051
|
+
function checkedTimeoutMs(value, name) {
|
|
1052
|
+
if (!Number.isFinite(value) || value <= 0) {
|
|
1053
|
+
throw new TypeError(`${name} must be a positive number of milliseconds. Got ${String(value)}.`);
|
|
1054
|
+
}
|
|
1055
|
+
return value;
|
|
1056
|
+
}
|
|
1057
|
+
function seconds(ms) {
|
|
1058
|
+
return `${ms / 1e3} s`;
|
|
1059
|
+
}
|
|
1060
|
+
function buildUrl(apiUrl, path, query) {
|
|
1061
|
+
const normalizedPath = path.startsWith("/") ? path : `/${path}`;
|
|
1062
|
+
const base = `${apiUrl}${normalizedPath}`;
|
|
1063
|
+
if (query === void 0) return base;
|
|
1064
|
+
const params = [];
|
|
1065
|
+
for (const key of Object.keys(query)) {
|
|
1066
|
+
const value = query[key];
|
|
1067
|
+
if (value === void 0) continue;
|
|
1068
|
+
const values = typeof value === "object" ? value : [String(value)];
|
|
1069
|
+
for (const v of values) params.push(`${encodeURIComponent(key)}=${encodeURIComponent(v)}`);
|
|
1070
|
+
}
|
|
1071
|
+
return params.length === 0 ? base : `${base}?${params.join("&")}`;
|
|
1072
|
+
}
|
|
1073
|
+
function buildHeaders(input, auth) {
|
|
1074
|
+
const headers = {
|
|
1075
|
+
Accept: "application/json",
|
|
1076
|
+
Authorization: `Bearer ${authTokenFor(auth)}`
|
|
1077
|
+
};
|
|
1078
|
+
if (input.body !== void 0) {
|
|
1079
|
+
headers["Content-Type"] = "application/json; charset=utf-8";
|
|
1080
|
+
}
|
|
1081
|
+
if (input.idempotencyKey !== void 0 && MUTATING.has(input.method)) {
|
|
1082
|
+
headers["Idempotency-Key"] = input.idempotencyKey;
|
|
1083
|
+
}
|
|
1084
|
+
if (input.headers !== void 0) {
|
|
1085
|
+
for (const key of Object.keys(input.headers)) {
|
|
1086
|
+
headers[key] = input.headers[key];
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
return headers;
|
|
1090
|
+
}
|
|
1091
|
+
function authTokenFor(auth) {
|
|
1092
|
+
if (auth.kind === "apiToken") return auth.token;
|
|
1093
|
+
return auth.accessToken;
|
|
1094
|
+
}
|
|
1095
|
+
function unwrapErrorEnvelope(body, status) {
|
|
1096
|
+
if (body !== null && typeof body === "object" && !Array.isArray(body)) {
|
|
1097
|
+
const inner = body.error;
|
|
1098
|
+
if (inner !== null && typeof inner === "object" && !Array.isArray(inner)) {
|
|
1099
|
+
return inner;
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
return { code: "unknown", message: `HTTP ${status} without recognizable error envelope` };
|
|
1103
|
+
}
|
|
839
1104
|
|
|
840
1105
|
// src/resources/artifacts.ts
|
|
1106
|
+
async function raw(transport, req) {
|
|
1107
|
+
const res = await transport.fetchImpl(`${transport.apiUrl}${req.path}`, {
|
|
1108
|
+
method: req.method,
|
|
1109
|
+
headers: { ...transport.authHeaders(), ...req.headers ?? {} },
|
|
1110
|
+
...req.body !== void 0 && { body: req.body }
|
|
1111
|
+
});
|
|
1112
|
+
if (!res.ok) {
|
|
1113
|
+
const body = req.method === "HEAD" ? {
|
|
1114
|
+
error: {
|
|
1115
|
+
code: res.status === 404 ? "blob-not-found" : "unknown",
|
|
1116
|
+
message: res.status === 404 ? "No such artifact, or it's in a project you can't read" : `HTTP ${res.status}`
|
|
1117
|
+
}
|
|
1118
|
+
} : await res.json().catch(() => null);
|
|
1119
|
+
throw new KindgiApiError(fromWire(unwrapErrorEnvelope(body, res.status), res.status));
|
|
1120
|
+
}
|
|
1121
|
+
return res;
|
|
1122
|
+
}
|
|
1123
|
+
function headOf(blobId, res) {
|
|
1124
|
+
const name = res.headers.get("X-Kindgi-Blob-Name");
|
|
1125
|
+
return {
|
|
1126
|
+
blobId,
|
|
1127
|
+
name: name !== null ? decodeURIComponent(name) : "",
|
|
1128
|
+
contentType: res.headers.get("Content-Type") ?? "application/octet-stream",
|
|
1129
|
+
size: Number(res.headers.get("Content-Length") ?? "0"),
|
|
1130
|
+
hash: res.headers.get("X-Kindgi-Blob-Hash") ?? ""
|
|
1131
|
+
};
|
|
1132
|
+
}
|
|
1133
|
+
function uploadForm(input) {
|
|
1134
|
+
const contentType = input.contentType ?? (input.body instanceof Blob && input.body.type !== "" ? input.body.type : "application/octet-stream");
|
|
1135
|
+
const blob = input.body instanceof Blob ? input.body : new Blob([input.body], {
|
|
1136
|
+
type: contentType
|
|
1137
|
+
});
|
|
1138
|
+
const form = new FormData();
|
|
1139
|
+
form.set("file", blob, input.name ?? "file");
|
|
1140
|
+
form.set("contentType", contentType);
|
|
1141
|
+
if (input.name !== void 0) form.set("name", input.name);
|
|
1142
|
+
if (input.tags !== void 0) form.set("tags", JSON.stringify(input.tags));
|
|
1143
|
+
if (input.ownerRunId !== void 0) form.set("ownerRunId", input.ownerRunId);
|
|
1144
|
+
if (input.projectId !== void 0) form.set("projectId", input.projectId);
|
|
1145
|
+
if (input.expectedHash !== void 0) form.set("expectedHash", input.expectedHash);
|
|
1146
|
+
return form;
|
|
1147
|
+
}
|
|
841
1148
|
function makeArtifactsClient(transport) {
|
|
842
1149
|
return {
|
|
1150
|
+
async upload(input, options) {
|
|
1151
|
+
const res = await raw(transport, {
|
|
1152
|
+
method: "POST",
|
|
1153
|
+
path: "/v1/artifacts",
|
|
1154
|
+
body: uploadForm(input),
|
|
1155
|
+
...options?.idempotencyKey !== void 0 && {
|
|
1156
|
+
headers: { "Idempotency-Key": options.idempotencyKey }
|
|
1157
|
+
}
|
|
1158
|
+
});
|
|
1159
|
+
return await res.json();
|
|
1160
|
+
},
|
|
1161
|
+
async download(blobId) {
|
|
1162
|
+
const res = await raw(transport, {
|
|
1163
|
+
method: "GET",
|
|
1164
|
+
path: `/v1/artifacts/${encodeURIComponent(blobId)}`
|
|
1165
|
+
});
|
|
1166
|
+
return {
|
|
1167
|
+
...headOf(blobId, res),
|
|
1168
|
+
body: res.body ?? new Response("").body
|
|
1169
|
+
};
|
|
1170
|
+
},
|
|
1171
|
+
async head(blobId) {
|
|
1172
|
+
const res = await raw(transport, {
|
|
1173
|
+
method: "HEAD",
|
|
1174
|
+
path: `/v1/artifacts/${encodeURIComponent(blobId)}`
|
|
1175
|
+
});
|
|
1176
|
+
return headOf(blobId, res);
|
|
1177
|
+
},
|
|
843
1178
|
async put(_input) {
|
|
844
1179
|
throw new KindgiApiError(
|
|
845
1180
|
notYetWired(
|
|
846
1181
|
"artifacts.put",
|
|
847
|
-
"
|
|
1182
|
+
"no route takes a content-addressed BlobRef: use artifacts.upload, which returns the artifact metadata"
|
|
848
1183
|
)
|
|
849
1184
|
);
|
|
850
1185
|
},
|
|
@@ -852,7 +1187,7 @@ function makeArtifactsClient(transport) {
|
|
|
852
1187
|
throw new KindgiApiError(
|
|
853
1188
|
notYetWired(
|
|
854
1189
|
"artifacts.get",
|
|
855
|
-
"
|
|
1190
|
+
"no route takes a content-addressed BlobRef: use artifacts.download(blobId)"
|
|
856
1191
|
)
|
|
857
1192
|
);
|
|
858
1193
|
},
|
|
@@ -866,7 +1201,8 @@ function makeArtifactsClient(transport) {
|
|
|
866
1201
|
...filter?.ownerRunId !== void 0 && {
|
|
867
1202
|
ownerRunId: filter.ownerRunId
|
|
868
1203
|
},
|
|
869
|
-
...filter?.contentType !== void 0 && { contentType: filter.contentType }
|
|
1204
|
+
...filter?.contentType !== void 0 && { contentType: filter.contentType },
|
|
1205
|
+
...filter?.projectId !== void 0 && { projectId: filter.projectId }
|
|
870
1206
|
}
|
|
871
1207
|
});
|
|
872
1208
|
return listPage(page);
|
|
@@ -928,7 +1264,7 @@ function makeAuditClient(transport) {
|
|
|
928
1264
|
|
|
929
1265
|
// src/resources/auth.ts
|
|
930
1266
|
function makeAuthClient(transport) {
|
|
931
|
-
const
|
|
1267
|
+
const seg2 = (s) => encodeURIComponent(s);
|
|
932
1268
|
return {
|
|
933
1269
|
providers: {
|
|
934
1270
|
async list() {
|
|
@@ -949,15 +1285,43 @@ function makeAuthClient(transport) {
|
|
|
949
1285
|
async unregister(providerId, options) {
|
|
950
1286
|
return transport.request({
|
|
951
1287
|
method: "POST",
|
|
952
|
-
path: `/v1/auth/providers/${
|
|
1288
|
+
path: `/v1/auth/providers/${seg2(providerId)}/unregister`,
|
|
1289
|
+
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
1290
|
+
});
|
|
1291
|
+
},
|
|
1292
|
+
async get(providerId) {
|
|
1293
|
+
return transport.request({
|
|
1294
|
+
method: "GET",
|
|
1295
|
+
path: `/v1/auth/providers/${seg2(providerId)}`
|
|
1296
|
+
});
|
|
1297
|
+
},
|
|
1298
|
+
async signIn(providerId, input) {
|
|
1299
|
+
return transport.request({
|
|
1300
|
+
method: "GET",
|
|
1301
|
+
path: `/v1/auth/providers/${seg2(providerId)}/sign-in`,
|
|
1302
|
+
...input?.kind !== void 0 && { query: { kind: input.kind } }
|
|
1303
|
+
});
|
|
1304
|
+
},
|
|
1305
|
+
async update(providerId, changes, options) {
|
|
1306
|
+
return transport.request({
|
|
1307
|
+
method: "PATCH",
|
|
1308
|
+
path: `/v1/auth/providers/${seg2(providerId)}`,
|
|
1309
|
+
body: changes,
|
|
953
1310
|
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
954
1311
|
});
|
|
955
1312
|
}
|
|
956
1313
|
},
|
|
1314
|
+
async signInOptions(input) {
|
|
1315
|
+
return transport.request({
|
|
1316
|
+
method: "GET",
|
|
1317
|
+
path: "/v1/auth/sign-in-options",
|
|
1318
|
+
...input?.email !== void 0 && { query: { email: input.email } }
|
|
1319
|
+
});
|
|
1320
|
+
},
|
|
957
1321
|
async login(providerId, input, options) {
|
|
958
1322
|
return transport.request({
|
|
959
1323
|
method: "POST",
|
|
960
|
-
path: `/v1/auth/login/${
|
|
1324
|
+
path: `/v1/auth/login/${seg2(providerId)}`,
|
|
961
1325
|
...input !== void 0 && { body: input },
|
|
962
1326
|
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
963
1327
|
});
|
|
@@ -965,7 +1329,7 @@ function makeAuthClient(transport) {
|
|
|
965
1329
|
async callback(providerId, input) {
|
|
966
1330
|
return transport.request({
|
|
967
1331
|
method: "POST",
|
|
968
|
-
path: `/v1/auth/callback/${
|
|
1332
|
+
path: `/v1/auth/callback/${seg2(providerId)}`,
|
|
969
1333
|
body: input
|
|
970
1334
|
});
|
|
971
1335
|
},
|
|
@@ -976,6 +1340,12 @@ function makeAuthClient(transport) {
|
|
|
976
1340
|
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
977
1341
|
});
|
|
978
1342
|
},
|
|
1343
|
+
async tokenSignIn() {
|
|
1344
|
+
return transport.request({
|
|
1345
|
+
method: "POST",
|
|
1346
|
+
path: "/v1/auth/token-sign-in"
|
|
1347
|
+
});
|
|
1348
|
+
},
|
|
979
1349
|
async logout(options) {
|
|
980
1350
|
return transport.request({
|
|
981
1351
|
method: "POST",
|
|
@@ -988,7 +1358,7 @@ function makeAuthClient(transport) {
|
|
|
988
1358
|
|
|
989
1359
|
// src/resources/blocks.ts
|
|
990
1360
|
function makeBlocksClient(transport) {
|
|
991
|
-
const
|
|
1361
|
+
const seg2 = (s) => encodeURIComponent(s);
|
|
992
1362
|
return {
|
|
993
1363
|
async publish(input, options) {
|
|
994
1364
|
return transport.request({
|
|
@@ -1012,13 +1382,13 @@ function makeBlocksClient(transport) {
|
|
|
1012
1382
|
});
|
|
1013
1383
|
},
|
|
1014
1384
|
async get(blockId) {
|
|
1015
|
-
return transport.request({ method: "GET", path: `/v1/blocks/${
|
|
1385
|
+
return transport.request({ method: "GET", path: `/v1/blocks/${seg2(blockId)}` });
|
|
1016
1386
|
},
|
|
1017
1387
|
versions: {
|
|
1018
1388
|
async list(blockId, filter) {
|
|
1019
1389
|
return transport.request({
|
|
1020
1390
|
method: "GET",
|
|
1021
|
-
path: `/v1/blocks/${
|
|
1391
|
+
path: `/v1/blocks/${seg2(blockId)}/versions`,
|
|
1022
1392
|
query: {
|
|
1023
1393
|
...filter?.limit !== void 0 && { limit: filter.limit },
|
|
1024
1394
|
...filter?.cursor !== void 0 && { cursor: filter.cursor },
|
|
@@ -1031,20 +1401,20 @@ function makeBlocksClient(transport) {
|
|
|
1031
1401
|
async get(blockId, version) {
|
|
1032
1402
|
return transport.request({
|
|
1033
1403
|
method: "GET",
|
|
1034
|
-
path: `/v1/blocks/${
|
|
1404
|
+
path: `/v1/blocks/${seg2(blockId)}/versions/${seg2(version)}`
|
|
1035
1405
|
});
|
|
1036
1406
|
},
|
|
1037
1407
|
async unregister(blockId, version, options) {
|
|
1038
1408
|
return transport.request({
|
|
1039
1409
|
method: "POST",
|
|
1040
|
-
path: `/v1/blocks/${
|
|
1410
|
+
path: `/v1/blocks/${seg2(blockId)}/versions/${seg2(version)}/unregister`,
|
|
1041
1411
|
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
1042
1412
|
});
|
|
1043
1413
|
},
|
|
1044
1414
|
async reinstate(blockId, version, options) {
|
|
1045
1415
|
return transport.request({
|
|
1046
1416
|
method: "POST",
|
|
1047
|
-
path: `/v1/blocks/${
|
|
1417
|
+
path: `/v1/blocks/${seg2(blockId)}/versions/${seg2(version)}/reinstate`,
|
|
1048
1418
|
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
1049
1419
|
});
|
|
1050
1420
|
}
|
|
@@ -1180,7 +1550,8 @@ function makeComplianceClient(transport) {
|
|
|
1180
1550
|
body: input,
|
|
1181
1551
|
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
1182
1552
|
});
|
|
1183
|
-
}
|
|
1553
|
+
},
|
|
1554
|
+
verify: (bundle, publicKey) => verifySignedExport(bundle, { trustedKeys: [publicKey] })
|
|
1184
1555
|
}
|
|
1185
1556
|
};
|
|
1186
1557
|
}
|
|
@@ -1238,6 +1609,16 @@ function makeConversationsClient(transport) {
|
|
|
1238
1609
|
}
|
|
1239
1610
|
});
|
|
1240
1611
|
},
|
|
1612
|
+
async unregister(id, options) {
|
|
1613
|
+
return transport.request({
|
|
1614
|
+
method: "POST",
|
|
1615
|
+
path: `/v1/conversations/${encodeURIComponent(id)}/unregister`,
|
|
1616
|
+
body: {},
|
|
1617
|
+
...options?.idempotencyKey !== void 0 && {
|
|
1618
|
+
idempotencyKey: options.idempotencyKey
|
|
1619
|
+
}
|
|
1620
|
+
});
|
|
1621
|
+
},
|
|
1241
1622
|
async messages(id, filter) {
|
|
1242
1623
|
const page = await transport.request({
|
|
1243
1624
|
method: "GET",
|
|
@@ -1448,9 +1829,9 @@ function makeEnvClient(transport) {
|
|
|
1448
1829
|
});
|
|
1449
1830
|
return { kind: "ok", record };
|
|
1450
1831
|
} catch (err) {
|
|
1451
|
-
const
|
|
1452
|
-
if (
|
|
1453
|
-
return { kind: "revision-conflict", currentRevision:
|
|
1832
|
+
const conflict2 = tryReadRevisionConflict(err);
|
|
1833
|
+
if (conflict2 !== null) {
|
|
1834
|
+
return { kind: "revision-conflict", currentRevision: conflict2 };
|
|
1454
1835
|
}
|
|
1455
1836
|
throw err;
|
|
1456
1837
|
}
|
|
@@ -1503,12 +1884,12 @@ function comparisonOf(run) {
|
|
|
1503
1884
|
return run.kind === "judged" && result?.summary !== void 0 && Array.isArray(result.perCase) ? result : void 0;
|
|
1504
1885
|
}
|
|
1505
1886
|
function makeEvalRunsClient(transport) {
|
|
1506
|
-
const
|
|
1887
|
+
const seg2 = (s) => encodeURIComponent(s);
|
|
1507
1888
|
return {
|
|
1508
1889
|
async start(suiteId, input, options) {
|
|
1509
1890
|
return transport.request({
|
|
1510
1891
|
method: "POST",
|
|
1511
|
-
path: `/v1/eval-suites/${
|
|
1892
|
+
path: `/v1/eval-suites/${seg2(suiteId)}/runs`,
|
|
1512
1893
|
body: { ...input, projectId: options.projectId },
|
|
1513
1894
|
...options.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
1514
1895
|
});
|
|
@@ -1529,17 +1910,17 @@ function makeEvalRunsClient(transport) {
|
|
|
1529
1910
|
async get(runId) {
|
|
1530
1911
|
return transport.request({
|
|
1531
1912
|
method: "GET",
|
|
1532
|
-
path: `/v1/eval-runs/${
|
|
1913
|
+
path: `/v1/eval-runs/${seg2(runId)}`
|
|
1533
1914
|
});
|
|
1534
1915
|
},
|
|
1535
1916
|
async cancel(runId) {
|
|
1536
1917
|
return transport.request({
|
|
1537
1918
|
method: "POST",
|
|
1538
|
-
path: `/v1/eval-runs/${
|
|
1919
|
+
path: `/v1/eval-runs/${seg2(runId)}/cancel`
|
|
1539
1920
|
});
|
|
1540
1921
|
},
|
|
1541
1922
|
events(runId, options) {
|
|
1542
|
-
const url = `${transport.apiUrl}/v1/eval-runs/${
|
|
1923
|
+
const url = `${transport.apiUrl}/v1/eval-runs/${seg2(runId)}/events`;
|
|
1543
1924
|
const source = readSse({
|
|
1544
1925
|
url,
|
|
1545
1926
|
headers: transport.authHeaders(),
|
|
@@ -1559,7 +1940,7 @@ function makeEvalRunsClient(transport) {
|
|
|
1559
1940
|
|
|
1560
1941
|
// src/resources/eval-suites.ts
|
|
1561
1942
|
function makeEvalSuitesClient(transport) {
|
|
1562
|
-
const
|
|
1943
|
+
const seg2 = (s) => encodeURIComponent(s);
|
|
1563
1944
|
return {
|
|
1564
1945
|
async publish(input, options) {
|
|
1565
1946
|
return transport.request({
|
|
@@ -1587,13 +1968,13 @@ function makeEvalSuitesClient(transport) {
|
|
|
1587
1968
|
async get(suiteId) {
|
|
1588
1969
|
return transport.request({
|
|
1589
1970
|
method: "GET",
|
|
1590
|
-
path: `/v1/eval-suites/${
|
|
1971
|
+
path: `/v1/eval-suites/${seg2(suiteId)}`
|
|
1591
1972
|
});
|
|
1592
1973
|
},
|
|
1593
1974
|
async buildFromJudgments(suiteId, input, options) {
|
|
1594
1975
|
return transport.request({
|
|
1595
1976
|
method: "POST",
|
|
1596
|
-
path: `/v1/eval-suites/${
|
|
1977
|
+
path: `/v1/eval-suites/${seg2(suiteId)}/versions/from-judgments`,
|
|
1597
1978
|
body: input,
|
|
1598
1979
|
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
1599
1980
|
});
|
|
@@ -1601,7 +1982,7 @@ function makeEvalSuitesClient(transport) {
|
|
|
1601
1982
|
async listCases(suiteId, version, query) {
|
|
1602
1983
|
return transport.request({
|
|
1603
1984
|
method: "GET",
|
|
1604
|
-
path: `/v1/eval-suites/${
|
|
1985
|
+
path: `/v1/eval-suites/${seg2(suiteId)}/versions/${seg2(version)}/cases`,
|
|
1605
1986
|
query: {
|
|
1606
1987
|
...query?.limit !== void 0 && { limit: query.limit },
|
|
1607
1988
|
...query?.cursor !== void 0 && { cursor: query.cursor }
|
|
@@ -1612,7 +1993,7 @@ function makeEvalSuitesClient(transport) {
|
|
|
1612
1993
|
async list(suiteId, filter) {
|
|
1613
1994
|
return transport.request({
|
|
1614
1995
|
method: "GET",
|
|
1615
|
-
path: `/v1/eval-suites/${
|
|
1996
|
+
path: `/v1/eval-suites/${seg2(suiteId)}/versions`,
|
|
1616
1997
|
query: {
|
|
1617
1998
|
...filter?.limit !== void 0 && { limit: filter.limit },
|
|
1618
1999
|
...filter?.cursor !== void 0 && { cursor: filter.cursor }
|
|
@@ -1622,20 +2003,20 @@ function makeEvalSuitesClient(transport) {
|
|
|
1622
2003
|
async get(suiteId, version) {
|
|
1623
2004
|
return transport.request({
|
|
1624
2005
|
method: "GET",
|
|
1625
|
-
path: `/v1/eval-suites/${
|
|
2006
|
+
path: `/v1/eval-suites/${seg2(suiteId)}/versions/${seg2(version)}`
|
|
1626
2007
|
});
|
|
1627
2008
|
},
|
|
1628
2009
|
async unregister(suiteId, version, options) {
|
|
1629
2010
|
return transport.request({
|
|
1630
2011
|
method: "POST",
|
|
1631
|
-
path: `/v1/eval-suites/${
|
|
2012
|
+
path: `/v1/eval-suites/${seg2(suiteId)}/versions/${seg2(version)}/unregister`,
|
|
1632
2013
|
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
1633
2014
|
});
|
|
1634
2015
|
},
|
|
1635
2016
|
async reinstate(suiteId, version, options) {
|
|
1636
2017
|
return transport.request({
|
|
1637
2018
|
method: "POST",
|
|
1638
|
-
path: `/v1/eval-suites/${
|
|
2019
|
+
path: `/v1/eval-suites/${seg2(suiteId)}/versions/${seg2(version)}/reinstate`,
|
|
1639
2020
|
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
1640
2021
|
});
|
|
1641
2022
|
}
|
|
@@ -1758,7 +2139,7 @@ function makeEventsClient(_transport) {
|
|
|
1758
2139
|
new KindgiApiError(
|
|
1759
2140
|
notYetWired(
|
|
1760
2141
|
"events.stream",
|
|
1761
|
-
"no GET /v1/events/subscriptions/{id}/stream route on the API \u2014 subscription-scoped SSE surface has not landed (runtime event bus is live; SDK-side SSE reader is ready via readSse; HTTP route pending). Use client.runs.
|
|
2142
|
+
"no GET /v1/events/subscriptions/{id}/stream route on the API \u2014 subscription-scoped SSE surface has not landed (runtime event bus is live; SDK-side SSE reader is ready via readSse; HTTP route pending). Use client.runs.follow(runId) for live run-scoped events."
|
|
1762
2143
|
)
|
|
1763
2144
|
)
|
|
1764
2145
|
);
|
|
@@ -1779,6 +2160,19 @@ function makeEventsClient(_transport) {
|
|
|
1779
2160
|
};
|
|
1780
2161
|
}
|
|
1781
2162
|
|
|
2163
|
+
// src/resources/export-signing-keys.ts
|
|
2164
|
+
function makeExportSigningKeysClient(transport) {
|
|
2165
|
+
return {
|
|
2166
|
+
async list() {
|
|
2167
|
+
const page = await transport.request({
|
|
2168
|
+
method: "GET",
|
|
2169
|
+
path: "/v1/export-signing-keys"
|
|
2170
|
+
});
|
|
2171
|
+
return page.data;
|
|
2172
|
+
}
|
|
2173
|
+
};
|
|
2174
|
+
}
|
|
2175
|
+
|
|
1782
2176
|
// src/resources/flows.ts
|
|
1783
2177
|
function makeFlowsClient(transport) {
|
|
1784
2178
|
const list = async (id, filter) => {
|
|
@@ -1885,7 +2279,7 @@ function makeFlowsClient(transport) {
|
|
|
1885
2279
|
|
|
1886
2280
|
// src/resources/gate-policies.ts
|
|
1887
2281
|
function makeGatePoliciesClient(transport) {
|
|
1888
|
-
const
|
|
2282
|
+
const seg2 = (s) => encodeURIComponent(s);
|
|
1889
2283
|
return {
|
|
1890
2284
|
async list(filter) {
|
|
1891
2285
|
return transport.request({
|
|
@@ -1902,7 +2296,7 @@ function makeGatePoliciesClient(transport) {
|
|
|
1902
2296
|
async get(policyId) {
|
|
1903
2297
|
return transport.request({
|
|
1904
2298
|
method: "GET",
|
|
1905
|
-
path: `/v1/gate-policies/${
|
|
2299
|
+
path: `/v1/gate-policies/${seg2(policyId)}`
|
|
1906
2300
|
});
|
|
1907
2301
|
},
|
|
1908
2302
|
async publish(input, options) {
|
|
@@ -1917,25 +2311,25 @@ function makeGatePoliciesClient(transport) {
|
|
|
1917
2311
|
async list(policyId) {
|
|
1918
2312
|
return transport.request({
|
|
1919
2313
|
method: "GET",
|
|
1920
|
-
path: `/v1/gate-policies/${
|
|
2314
|
+
path: `/v1/gate-policies/${seg2(policyId)}/versions`
|
|
1921
2315
|
});
|
|
1922
2316
|
},
|
|
1923
2317
|
async get(policyId, version) {
|
|
1924
2318
|
return transport.request({
|
|
1925
2319
|
method: "GET",
|
|
1926
|
-
path: `/v1/gate-policies/${
|
|
2320
|
+
path: `/v1/gate-policies/${seg2(policyId)}/versions/${seg2(version)}`
|
|
1927
2321
|
});
|
|
1928
2322
|
},
|
|
1929
2323
|
async unregister(policyId, version) {
|
|
1930
2324
|
return transport.request({
|
|
1931
2325
|
method: "POST",
|
|
1932
|
-
path: `/v1/gate-policies/${
|
|
2326
|
+
path: `/v1/gate-policies/${seg2(policyId)}/versions/${seg2(version)}/unregister`
|
|
1933
2327
|
});
|
|
1934
2328
|
},
|
|
1935
2329
|
async reinstate(policyId, version) {
|
|
1936
2330
|
return transport.request({
|
|
1937
2331
|
method: "POST",
|
|
1938
|
-
path: `/v1/gate-policies/${
|
|
2332
|
+
path: `/v1/gate-policies/${seg2(policyId)}/versions/${seg2(version)}/reinstate`
|
|
1939
2333
|
});
|
|
1940
2334
|
}
|
|
1941
2335
|
}
|
|
@@ -2008,7 +2402,7 @@ function makeGuardrailsClient(transport) {
|
|
|
2008
2402
|
|
|
2009
2403
|
// src/resources/identity.ts
|
|
2010
2404
|
function makeIdentityClient(transport) {
|
|
2011
|
-
const
|
|
2405
|
+
const seg2 = (s) => encodeURIComponent(s);
|
|
2012
2406
|
return {
|
|
2013
2407
|
async whoami() {
|
|
2014
2408
|
return transport.request({
|
|
@@ -2031,19 +2425,19 @@ function makeIdentityClient(transport) {
|
|
|
2031
2425
|
async get(userId) {
|
|
2032
2426
|
return transport.request({
|
|
2033
2427
|
method: "GET",
|
|
2034
|
-
path: `/v1/identity/users/${
|
|
2428
|
+
path: `/v1/identity/users/${seg2(userId)}`
|
|
2035
2429
|
});
|
|
2036
2430
|
},
|
|
2037
2431
|
async listSessions(userId) {
|
|
2038
2432
|
return transport.request({
|
|
2039
2433
|
method: "GET",
|
|
2040
|
-
path: `/v1/identity/users/${
|
|
2434
|
+
path: `/v1/identity/users/${seg2(userId)}/sessions`
|
|
2041
2435
|
});
|
|
2042
2436
|
},
|
|
2043
2437
|
async revokeSessions(userId, options) {
|
|
2044
2438
|
return transport.request({
|
|
2045
2439
|
method: "POST",
|
|
2046
|
-
path: `/v1/identity/users/${
|
|
2440
|
+
path: `/v1/identity/users/${seg2(userId)}/revoke-sessions`,
|
|
2047
2441
|
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
2048
2442
|
});
|
|
2049
2443
|
}
|
|
@@ -2051,31 +2445,63 @@ function makeIdentityClient(transport) {
|
|
|
2051
2445
|
};
|
|
2052
2446
|
}
|
|
2053
2447
|
|
|
2054
|
-
// src/resources/
|
|
2055
|
-
function
|
|
2056
|
-
if (scope.kind === "tenant") return { scopeKind: "tenant" };
|
|
2057
|
-
if (scope.kind === "project") return { scopeKind: "project", projectId: scope.projectId };
|
|
2058
|
-
return { scopeKind: "agent", projectId: scope.projectId, agentId: scope.agentId };
|
|
2059
|
-
}
|
|
2060
|
-
function makeJudgeClassesClient(transport) {
|
|
2061
|
-
const withKey = (options) => options?.idempotencyKey !== void 0 ? { idempotencyKey: options.idempotencyKey } : {};
|
|
2448
|
+
// src/resources/improvement-passes.ts
|
|
2449
|
+
function makeImprovementPassesClient(transport) {
|
|
2062
2450
|
return {
|
|
2063
|
-
async
|
|
2064
|
-
return transport.request({
|
|
2065
|
-
method: "POST",
|
|
2066
|
-
path: "/v1/judge-classes",
|
|
2067
|
-
body: input,
|
|
2068
|
-
...withKey(options)
|
|
2069
|
-
});
|
|
2070
|
-
},
|
|
2071
|
-
async list(filter) {
|
|
2451
|
+
async list(input = {}) {
|
|
2072
2452
|
const page = await transport.request({
|
|
2073
2453
|
method: "GET",
|
|
2074
|
-
path: "/v1/
|
|
2454
|
+
path: "/v1/improvement-passes",
|
|
2075
2455
|
query: {
|
|
2076
|
-
...
|
|
2077
|
-
...
|
|
2078
|
-
...
|
|
2456
|
+
...input.limit !== void 0 && { limit: input.limit },
|
|
2457
|
+
...input.cursor !== void 0 && { cursor: input.cursor },
|
|
2458
|
+
...input.agentId !== void 0 && { agentId: input.agentId }
|
|
2459
|
+
}
|
|
2460
|
+
});
|
|
2461
|
+
return listPage(page);
|
|
2462
|
+
},
|
|
2463
|
+
async get(passId) {
|
|
2464
|
+
return transport.request({
|
|
2465
|
+
method: "GET",
|
|
2466
|
+
path: `/v1/improvement-passes/${encodeURIComponent(passId)}`
|
|
2467
|
+
});
|
|
2468
|
+
},
|
|
2469
|
+
async cancel(passId, input = {}) {
|
|
2470
|
+
return transport.request({
|
|
2471
|
+
method: "POST",
|
|
2472
|
+
path: `/v1/improvement-passes/${encodeURIComponent(passId)}/cancel`,
|
|
2473
|
+
body: {},
|
|
2474
|
+
...input.idempotencyKey !== void 0 && { idempotencyKey: input.idempotencyKey }
|
|
2475
|
+
});
|
|
2476
|
+
}
|
|
2477
|
+
};
|
|
2478
|
+
}
|
|
2479
|
+
|
|
2480
|
+
// src/resources/judge-classes.ts
|
|
2481
|
+
function scopeQuery2(scope) {
|
|
2482
|
+
if (scope.kind === "tenant") return { scopeKind: "tenant" };
|
|
2483
|
+
if (scope.kind === "project") return { scopeKind: "project", projectId: scope.projectId };
|
|
2484
|
+
return { scopeKind: "agent", projectId: scope.projectId, agentId: scope.agentId };
|
|
2485
|
+
}
|
|
2486
|
+
function makeJudgeClassesClient(transport) {
|
|
2487
|
+
const withKey = (options) => options?.idempotencyKey !== void 0 ? { idempotencyKey: options.idempotencyKey } : {};
|
|
2488
|
+
return {
|
|
2489
|
+
async create(input, options) {
|
|
2490
|
+
return transport.request({
|
|
2491
|
+
method: "POST",
|
|
2492
|
+
path: "/v1/judge-classes",
|
|
2493
|
+
body: input,
|
|
2494
|
+
...withKey(options)
|
|
2495
|
+
});
|
|
2496
|
+
},
|
|
2497
|
+
async list(filter) {
|
|
2498
|
+
const page = await transport.request({
|
|
2499
|
+
method: "GET",
|
|
2500
|
+
path: "/v1/judge-classes",
|
|
2501
|
+
query: {
|
|
2502
|
+
...filter?.limit !== void 0 && { limit: filter.limit },
|
|
2503
|
+
...filter?.cursor !== void 0 && { cursor: filter.cursor },
|
|
2504
|
+
...filter?.scope !== void 0 && scopeQuery2(filter.scope)
|
|
2079
2505
|
}
|
|
2080
2506
|
});
|
|
2081
2507
|
return listPage(page);
|
|
@@ -2278,6 +2704,56 @@ function makeMcpClient(transport) {
|
|
|
2278
2704
|
// src/resources/memory.ts
|
|
2279
2705
|
function makeMemoryClient(transport) {
|
|
2280
2706
|
return {
|
|
2707
|
+
erasures: {
|
|
2708
|
+
async create(selector, options) {
|
|
2709
|
+
return transport.request({
|
|
2710
|
+
method: "POST",
|
|
2711
|
+
path: "/v1/memory/erasures",
|
|
2712
|
+
body: selector,
|
|
2713
|
+
...options?.idempotencyKey !== void 0 && {
|
|
2714
|
+
idempotencyKey: options.idempotencyKey
|
|
2715
|
+
}
|
|
2716
|
+
});
|
|
2717
|
+
},
|
|
2718
|
+
async get(id) {
|
|
2719
|
+
return transport.request({
|
|
2720
|
+
method: "GET",
|
|
2721
|
+
path: `/v1/memory/erasures/${encodeURIComponent(id)}`
|
|
2722
|
+
});
|
|
2723
|
+
},
|
|
2724
|
+
async list(filter) {
|
|
2725
|
+
const page = await transport.request({
|
|
2726
|
+
method: "GET",
|
|
2727
|
+
path: "/v1/memory/erasures",
|
|
2728
|
+
query: {
|
|
2729
|
+
...filter?.limit !== void 0 && { limit: filter.limit },
|
|
2730
|
+
...filter?.cursor !== void 0 && { cursor: filter.cursor }
|
|
2731
|
+
}
|
|
2732
|
+
});
|
|
2733
|
+
return listPage(page);
|
|
2734
|
+
},
|
|
2735
|
+
async resume(id, options) {
|
|
2736
|
+
return transport.request({
|
|
2737
|
+
method: "POST",
|
|
2738
|
+
path: `/v1/memory/erasures/${encodeURIComponent(id)}/resume`,
|
|
2739
|
+
body: { ...options?.force === true && { force: true } }
|
|
2740
|
+
});
|
|
2741
|
+
},
|
|
2742
|
+
async export() {
|
|
2743
|
+
const ledger = await transport.request({ method: "GET", path: "/v1/memory/erasures/export" });
|
|
2744
|
+
return ledger.data;
|
|
2745
|
+
},
|
|
2746
|
+
async replay(erasures, options) {
|
|
2747
|
+
return transport.request({
|
|
2748
|
+
method: "POST",
|
|
2749
|
+
path: "/v1/memory/erasures/replay",
|
|
2750
|
+
body: { erasures },
|
|
2751
|
+
...options?.idempotencyKey !== void 0 && {
|
|
2752
|
+
idempotencyKey: options.idempotencyKey
|
|
2753
|
+
}
|
|
2754
|
+
});
|
|
2755
|
+
}
|
|
2756
|
+
},
|
|
2281
2757
|
facts: {
|
|
2282
2758
|
async write(input, options) {
|
|
2283
2759
|
return transport.request({
|
|
@@ -2289,11 +2765,22 @@ function makeMemoryClient(transport) {
|
|
|
2289
2765
|
}
|
|
2290
2766
|
});
|
|
2291
2767
|
},
|
|
2292
|
-
async read(id) {
|
|
2768
|
+
async read(id, options) {
|
|
2293
2769
|
return transport.request({
|
|
2294
2770
|
method: "GET",
|
|
2295
|
-
path: `/v1/memory/facts/${encodeURIComponent(id)}
|
|
2771
|
+
path: `/v1/memory/facts/${encodeURIComponent(id)}`,
|
|
2772
|
+
query: {
|
|
2773
|
+
...options?.version !== void 0 && { version: options.version },
|
|
2774
|
+
...options?.asOf !== void 0 && { asOf: options.asOf }
|
|
2775
|
+
}
|
|
2776
|
+
});
|
|
2777
|
+
},
|
|
2778
|
+
async revisions(id) {
|
|
2779
|
+
const envelope = await transport.request({
|
|
2780
|
+
method: "GET",
|
|
2781
|
+
path: `/v1/memory/facts/${encodeURIComponent(id)}/revisions`
|
|
2296
2782
|
});
|
|
2783
|
+
return envelope.data;
|
|
2297
2784
|
},
|
|
2298
2785
|
async list(filter) {
|
|
2299
2786
|
const page = await transport.request({
|
|
@@ -2303,16 +2790,38 @@ function makeMemoryClient(transport) {
|
|
|
2303
2790
|
...filter?.limit !== void 0 && { limit: filter.limit },
|
|
2304
2791
|
...filter?.cursor !== void 0 && { cursor: filter.cursor },
|
|
2305
2792
|
...filter?.type !== void 0 && { type: filter.type },
|
|
2306
|
-
...filter?.scope !== void 0 && { scope: JSON.stringify(filter.scope) }
|
|
2793
|
+
...filter?.scope !== void 0 && { scope: JSON.stringify(filter.scope) },
|
|
2794
|
+
...filter?.asOf !== void 0 && { asOf: filter.asOf }
|
|
2307
2795
|
}
|
|
2308
2796
|
});
|
|
2309
2797
|
return listPage(page);
|
|
2310
2798
|
},
|
|
2311
|
-
async
|
|
2799
|
+
async supersede(id, input, options) {
|
|
2312
2800
|
return transport.request({
|
|
2313
2801
|
method: "POST",
|
|
2314
2802
|
path: `/v1/memory/facts/${encodeURIComponent(id)}/supersede`,
|
|
2315
|
-
body:
|
|
2803
|
+
body: input,
|
|
2804
|
+
...options?.idempotencyKey !== void 0 && {
|
|
2805
|
+
idempotencyKey: options.idempotencyKey
|
|
2806
|
+
}
|
|
2807
|
+
});
|
|
2808
|
+
},
|
|
2809
|
+
async delete(id, options) {
|
|
2810
|
+
return transport.request({
|
|
2811
|
+
method: "DELETE",
|
|
2812
|
+
path: `/v1/memory/facts/${encodeURIComponent(id)}`,
|
|
2813
|
+
query: {
|
|
2814
|
+
...options?.expectVersion !== void 0 && { expectVersion: options.expectVersion }
|
|
2815
|
+
}
|
|
2816
|
+
});
|
|
2817
|
+
},
|
|
2818
|
+
async verify(id, options) {
|
|
2819
|
+
return transport.request({
|
|
2820
|
+
method: "POST",
|
|
2821
|
+
path: `/v1/memory/facts/${encodeURIComponent(id)}/verify`,
|
|
2822
|
+
body: {
|
|
2823
|
+
...options?.expectVersion !== void 0 && { expectVersion: options.expectVersion }
|
|
2824
|
+
},
|
|
2316
2825
|
...options?.idempotencyKey !== void 0 && {
|
|
2317
2826
|
idempotencyKey: options.idempotencyKey
|
|
2318
2827
|
}
|
|
@@ -2402,7 +2911,7 @@ function makeObservationsClient(transport) {
|
|
|
2402
2911
|
|
|
2403
2912
|
// src/resources/orgs.ts
|
|
2404
2913
|
function makeOrgsClient(transport) {
|
|
2405
|
-
const
|
|
2914
|
+
const seg2 = (s) => encodeURIComponent(s);
|
|
2406
2915
|
return {
|
|
2407
2916
|
async create(input, options) {
|
|
2408
2917
|
return transport.request({
|
|
@@ -2425,13 +2934,13 @@ function makeOrgsClient(transport) {
|
|
|
2425
2934
|
async get(orgId) {
|
|
2426
2935
|
return transport.request({
|
|
2427
2936
|
method: "GET",
|
|
2428
|
-
path: `/v1/orgs/${
|
|
2937
|
+
path: `/v1/orgs/${seg2(orgId)}`
|
|
2429
2938
|
});
|
|
2430
2939
|
},
|
|
2431
2940
|
async update(orgId, input, options) {
|
|
2432
2941
|
return transport.request({
|
|
2433
2942
|
method: "PATCH",
|
|
2434
|
-
path: `/v1/orgs/${
|
|
2943
|
+
path: `/v1/orgs/${seg2(orgId)}`,
|
|
2435
2944
|
body: input,
|
|
2436
2945
|
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
2437
2946
|
});
|
|
@@ -2439,7 +2948,7 @@ function makeOrgsClient(transport) {
|
|
|
2439
2948
|
async delete(orgId) {
|
|
2440
2949
|
return transport.request({
|
|
2441
2950
|
method: "DELETE",
|
|
2442
|
-
path: `/v1/orgs/${
|
|
2951
|
+
path: `/v1/orgs/${seg2(orgId)}`,
|
|
2443
2952
|
discardResponse: true
|
|
2444
2953
|
});
|
|
2445
2954
|
}
|
|
@@ -2606,7 +3115,7 @@ function makePoliciesClient(transport) {
|
|
|
2606
3115
|
|
|
2607
3116
|
// src/resources/projects.ts
|
|
2608
3117
|
function makeProjectsClient(transport) {
|
|
2609
|
-
const
|
|
3118
|
+
const seg2 = (s) => encodeURIComponent(s);
|
|
2610
3119
|
return {
|
|
2611
3120
|
async create(input, options) {
|
|
2612
3121
|
return transport.request({
|
|
@@ -2635,13 +3144,13 @@ function makeProjectsClient(transport) {
|
|
|
2635
3144
|
async get(projectId) {
|
|
2636
3145
|
return transport.request({
|
|
2637
3146
|
method: "GET",
|
|
2638
|
-
path: `/v1/projects/${
|
|
3147
|
+
path: `/v1/projects/${seg2(projectId)}`
|
|
2639
3148
|
});
|
|
2640
3149
|
},
|
|
2641
3150
|
async update(projectId, input, options) {
|
|
2642
3151
|
return transport.request({
|
|
2643
3152
|
method: "PATCH",
|
|
2644
|
-
path: `/v1/projects/${
|
|
3153
|
+
path: `/v1/projects/${seg2(projectId)}`,
|
|
2645
3154
|
body: input,
|
|
2646
3155
|
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
2647
3156
|
});
|
|
@@ -2649,7 +3158,7 @@ function makeProjectsClient(transport) {
|
|
|
2649
3158
|
async delete(projectId) {
|
|
2650
3159
|
return transport.request({
|
|
2651
3160
|
method: "DELETE",
|
|
2652
|
-
path: `/v1/projects/${
|
|
3161
|
+
path: `/v1/projects/${seg2(projectId)}`,
|
|
2653
3162
|
discardResponse: true
|
|
2654
3163
|
});
|
|
2655
3164
|
},
|
|
@@ -2657,7 +3166,7 @@ function makeProjectsClient(transport) {
|
|
|
2657
3166
|
async list(projectId, filter) {
|
|
2658
3167
|
return transport.request({
|
|
2659
3168
|
method: "GET",
|
|
2660
|
-
path: `/v1/projects/${
|
|
3169
|
+
path: `/v1/projects/${seg2(projectId)}/memberships`,
|
|
2661
3170
|
query: {
|
|
2662
3171
|
...filter?.limit !== void 0 && { limit: filter.limit },
|
|
2663
3172
|
...filter?.cursor !== void 0 && { cursor: filter.cursor }
|
|
@@ -2667,7 +3176,7 @@ function makeProjectsClient(transport) {
|
|
|
2667
3176
|
async add(projectId, input, options) {
|
|
2668
3177
|
return transport.request({
|
|
2669
3178
|
method: "POST",
|
|
2670
|
-
path: `/v1/projects/${
|
|
3179
|
+
path: `/v1/projects/${seg2(projectId)}/memberships`,
|
|
2671
3180
|
body: input,
|
|
2672
3181
|
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
2673
3182
|
});
|
|
@@ -2675,7 +3184,7 @@ function makeProjectsClient(transport) {
|
|
|
2675
3184
|
async updateRole(projectId, userId, role, options) {
|
|
2676
3185
|
return transport.request({
|
|
2677
3186
|
method: "PATCH",
|
|
2678
|
-
path: `/v1/projects/${
|
|
3187
|
+
path: `/v1/projects/${seg2(projectId)}/memberships/${seg2(userId)}`,
|
|
2679
3188
|
body: { role },
|
|
2680
3189
|
discardResponse: true,
|
|
2681
3190
|
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
@@ -2684,7 +3193,7 @@ function makeProjectsClient(transport) {
|
|
|
2684
3193
|
async remove(projectId, userId, options) {
|
|
2685
3194
|
return transport.request({
|
|
2686
3195
|
method: "DELETE",
|
|
2687
|
-
path: `/v1/projects/${
|
|
3196
|
+
path: `/v1/projects/${seg2(projectId)}/memberships/${seg2(userId)}`,
|
|
2688
3197
|
discardResponse: true,
|
|
2689
3198
|
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
2690
3199
|
});
|
|
@@ -2693,6 +3202,71 @@ function makeProjectsClient(transport) {
|
|
|
2693
3202
|
};
|
|
2694
3203
|
}
|
|
2695
3204
|
|
|
3205
|
+
// src/resources/proposals.ts
|
|
3206
|
+
var seg = (id) => encodeURIComponent(id);
|
|
3207
|
+
function makeProposalsClient(transport) {
|
|
3208
|
+
const post = (req) => transport.request({
|
|
3209
|
+
method: "POST",
|
|
3210
|
+
path: req.path,
|
|
3211
|
+
body: req.body,
|
|
3212
|
+
...req.idempotencyKey !== void 0 && { idempotencyKey: req.idempotencyKey }
|
|
3213
|
+
});
|
|
3214
|
+
return {
|
|
3215
|
+
async list(input = {}) {
|
|
3216
|
+
const page = await transport.request({
|
|
3217
|
+
method: "GET",
|
|
3218
|
+
path: "/v1/proposals",
|
|
3219
|
+
query: {
|
|
3220
|
+
...input.limit !== void 0 && { limit: input.limit },
|
|
3221
|
+
...input.cursor !== void 0 && { cursor: input.cursor },
|
|
3222
|
+
...input.agentId !== void 0 && { agentId: input.agentId },
|
|
3223
|
+
...input.tier !== void 0 && { tier: input.tier },
|
|
3224
|
+
...input.status !== void 0 && { status: input.status },
|
|
3225
|
+
...input.scope !== void 0 && scopeQuery(input.scope)
|
|
3226
|
+
}
|
|
3227
|
+
});
|
|
3228
|
+
return listPage(page);
|
|
3229
|
+
},
|
|
3230
|
+
async get(id) {
|
|
3231
|
+
return transport.request({ method: "GET", path: `/v1/proposals/${seg(id)}` });
|
|
3232
|
+
},
|
|
3233
|
+
async create(input) {
|
|
3234
|
+
const { idempotencyKey, ...body } = input;
|
|
3235
|
+
return transport.request({
|
|
3236
|
+
method: "POST",
|
|
3237
|
+
path: "/v1/proposals",
|
|
3238
|
+
body,
|
|
3239
|
+
...idempotencyKey !== void 0 && { idempotencyKey }
|
|
3240
|
+
});
|
|
3241
|
+
},
|
|
3242
|
+
async evaluate(id, input) {
|
|
3243
|
+
const { idempotencyKey, ...body } = input;
|
|
3244
|
+
return post({ path: `/v1/proposals/${seg(id)}/evaluate`, body, idempotencyKey });
|
|
3245
|
+
},
|
|
3246
|
+
async request(id, input = {}) {
|
|
3247
|
+
const { idempotencyKey, ...body } = input;
|
|
3248
|
+
return post({ path: `/v1/proposals/${seg(id)}/request`, body, idempotencyKey });
|
|
3249
|
+
},
|
|
3250
|
+
async rollback(id, input = {}) {
|
|
3251
|
+
const { idempotencyKey, ...body } = input;
|
|
3252
|
+
return post({ path: `/v1/proposals/${seg(id)}/rollback`, body, idempotencyKey });
|
|
3253
|
+
},
|
|
3254
|
+
async withdraw(id, input) {
|
|
3255
|
+
const { idempotencyKey, ...body } = input;
|
|
3256
|
+
return post({ path: `/v1/proposals/${seg(id)}/withdraw`, body, idempotencyKey });
|
|
3257
|
+
},
|
|
3258
|
+
async improve(input) {
|
|
3259
|
+
const { idempotencyKey, ...body } = input;
|
|
3260
|
+
return transport.request({
|
|
3261
|
+
method: "POST",
|
|
3262
|
+
path: "/v1/proposals/improve",
|
|
3263
|
+
body,
|
|
3264
|
+
...idempotencyKey !== void 0 && { idempotencyKey }
|
|
3265
|
+
});
|
|
3266
|
+
}
|
|
3267
|
+
};
|
|
3268
|
+
}
|
|
3269
|
+
|
|
2696
3270
|
// src/resources/provenance.ts
|
|
2697
3271
|
function makeProvenanceClient(transport) {
|
|
2698
3272
|
return {
|
|
@@ -2726,26 +3300,22 @@ function makeProvenanceClient(transport) {
|
|
|
2726
3300
|
method: "POST",
|
|
2727
3301
|
path: `/v1/provenance/${encodeURIComponent(input.runId)}/export`,
|
|
2728
3302
|
body: {
|
|
2729
|
-
signingKeyId: input.signingKeyId,
|
|
3303
|
+
...input.signingKeyId !== void 0 && { signingKeyId: input.signingKeyId },
|
|
2730
3304
|
...input.includeMessages !== void 0 && { includeMessages: input.includeMessages }
|
|
2731
3305
|
},
|
|
2732
3306
|
...input.idempotencyKey !== void 0 && { idempotencyKey: input.idempotencyKey }
|
|
2733
3307
|
});
|
|
2734
3308
|
},
|
|
2735
|
-
async verify(
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
"provenance.verify",
|
|
2739
|
-
"client-side ed25519 verification requires the crypto module subpackage to be reachable from the SDK"
|
|
2740
|
-
)
|
|
2741
|
-
);
|
|
3309
|
+
async verify(exported, publicKey) {
|
|
3310
|
+
const checked = await verifySignedExport(exported, { trustedKeys: [publicKey] });
|
|
3311
|
+
return checked.valid ? { valid: true } : { valid: false, issues: checked.issues ?? [] };
|
|
2742
3312
|
}
|
|
2743
3313
|
};
|
|
2744
3314
|
}
|
|
2745
3315
|
|
|
2746
3316
|
// src/resources/providers.ts
|
|
2747
3317
|
function makeProvidersClient(transport) {
|
|
2748
|
-
const
|
|
3318
|
+
const seg2 = (s) => encodeURIComponent(s);
|
|
2749
3319
|
return {
|
|
2750
3320
|
async register(input, options) {
|
|
2751
3321
|
return transport.request({
|
|
@@ -2769,19 +3339,25 @@ function makeProvidersClient(transport) {
|
|
|
2769
3339
|
async get(providerId) {
|
|
2770
3340
|
return transport.request({
|
|
2771
3341
|
method: "GET",
|
|
2772
|
-
path: `/v1/providers/${
|
|
3342
|
+
path: `/v1/providers/${seg2(providerId)}`
|
|
2773
3343
|
});
|
|
2774
3344
|
},
|
|
2775
3345
|
async capabilities(providerId) {
|
|
2776
3346
|
return transport.request({
|
|
2777
3347
|
method: "GET",
|
|
2778
|
-
path: `/v1/providers/${
|
|
3348
|
+
path: `/v1/providers/${seg2(providerId)}/capabilities`
|
|
3349
|
+
});
|
|
3350
|
+
},
|
|
3351
|
+
async check(providerId) {
|
|
3352
|
+
return transport.request({
|
|
3353
|
+
method: "GET",
|
|
3354
|
+
path: `/v1/providers/${seg2(providerId)}/check`
|
|
2779
3355
|
});
|
|
2780
3356
|
},
|
|
2781
3357
|
async unregister(providerId, options) {
|
|
2782
3358
|
return transport.request({
|
|
2783
3359
|
method: "POST",
|
|
2784
|
-
path: `/v1/providers/${
|
|
3360
|
+
path: `/v1/providers/${seg2(providerId)}/unregister`,
|
|
2785
3361
|
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
2786
3362
|
});
|
|
2787
3363
|
}
|
|
@@ -2892,145 +3468,6 @@ function subscribeToRun(options) {
|
|
|
2892
3468
|
});
|
|
2893
3469
|
}
|
|
2894
3470
|
|
|
2895
|
-
// src/transport.ts
|
|
2896
|
-
var DEFAULT_TIMEOUT_MS = 3e4;
|
|
2897
|
-
var MUTATING = /* @__PURE__ */ new Set([
|
|
2898
|
-
"POST",
|
|
2899
|
-
"PUT",
|
|
2900
|
-
"PATCH",
|
|
2901
|
-
"DELETE"
|
|
2902
|
-
]);
|
|
2903
|
-
function createTransport(options) {
|
|
2904
|
-
const apiUrl = options.apiUrl.replace(/\/+$/u, "");
|
|
2905
|
-
const fetchImpl = options.fetch ?? fetch;
|
|
2906
|
-
const clientTimeoutMs = checkedTimeoutMs(
|
|
2907
|
-
options.timeoutMs ?? DEFAULT_TIMEOUT_MS,
|
|
2908
|
-
"ClientOptions.timeoutMs"
|
|
2909
|
-
);
|
|
2910
|
-
return {
|
|
2911
|
-
apiUrl,
|
|
2912
|
-
fetchImpl,
|
|
2913
|
-
authHeaders() {
|
|
2914
|
-
return { Authorization: `Bearer ${authTokenFor(options.auth)}` };
|
|
2915
|
-
},
|
|
2916
|
-
async request(input) {
|
|
2917
|
-
const url = buildUrl(apiUrl, input.path, input.query);
|
|
2918
|
-
const headers = buildHeaders(input, options.auth);
|
|
2919
|
-
const timeoutMs = input.timeoutMs === void 0 ? clientTimeoutMs : checkedTimeoutMs(input.timeoutMs, "timeoutMs");
|
|
2920
|
-
const ac = new AbortController();
|
|
2921
|
-
let timedOut = false;
|
|
2922
|
-
const timer = setTimeout(() => {
|
|
2923
|
-
timedOut = true;
|
|
2924
|
-
ac.abort(new Error("timeout"));
|
|
2925
|
-
}, timeoutMs);
|
|
2926
|
-
let response;
|
|
2927
|
-
try {
|
|
2928
|
-
response = await fetchImpl(url, {
|
|
2929
|
-
method: input.method,
|
|
2930
|
-
headers,
|
|
2931
|
-
...input.body !== void 0 && { body: JSON.stringify(input.body) },
|
|
2932
|
-
signal: ac.signal
|
|
2933
|
-
});
|
|
2934
|
-
} catch (cause) {
|
|
2935
|
-
clearTimeout(timer);
|
|
2936
|
-
const err = timedOut ? {
|
|
2937
|
-
code: "network",
|
|
2938
|
-
message: `No answer within ${seconds(timeoutMs)}, the client's timeout (timeoutMs).`,
|
|
2939
|
-
cause,
|
|
2940
|
-
timeoutMs
|
|
2941
|
-
} : {
|
|
2942
|
-
code: "network",
|
|
2943
|
-
message: cause instanceof Error ? cause.message : "network request failed",
|
|
2944
|
-
cause
|
|
2945
|
-
};
|
|
2946
|
-
throw new KindgiApiError(err);
|
|
2947
|
-
}
|
|
2948
|
-
clearTimeout(timer);
|
|
2949
|
-
if (response.ok) {
|
|
2950
|
-
if (input.discardResponse === true || response.status === 204) {
|
|
2951
|
-
try {
|
|
2952
|
-
await response.arrayBuffer();
|
|
2953
|
-
} catch {
|
|
2954
|
-
}
|
|
2955
|
-
return void 0;
|
|
2956
|
-
}
|
|
2957
|
-
try {
|
|
2958
|
-
return await response.json();
|
|
2959
|
-
} catch (cause) {
|
|
2960
|
-
const err = {
|
|
2961
|
-
code: "network",
|
|
2962
|
-
message: "Response body was not valid JSON",
|
|
2963
|
-
cause
|
|
2964
|
-
};
|
|
2965
|
-
throw new KindgiApiError(err);
|
|
2966
|
-
}
|
|
2967
|
-
}
|
|
2968
|
-
let body;
|
|
2969
|
-
try {
|
|
2970
|
-
body = await response.json();
|
|
2971
|
-
} catch {
|
|
2972
|
-
body = void 0;
|
|
2973
|
-
}
|
|
2974
|
-
throw new KindgiApiError(
|
|
2975
|
-
fromWire(unwrapErrorEnvelope(body, response.status), response.status)
|
|
2976
|
-
);
|
|
2977
|
-
}
|
|
2978
|
-
};
|
|
2979
|
-
}
|
|
2980
|
-
function checkedTimeoutMs(value, name) {
|
|
2981
|
-
if (!Number.isFinite(value) || value <= 0) {
|
|
2982
|
-
throw new TypeError(`${name} must be a positive number of milliseconds. Got ${String(value)}.`);
|
|
2983
|
-
}
|
|
2984
|
-
return value;
|
|
2985
|
-
}
|
|
2986
|
-
function seconds(ms) {
|
|
2987
|
-
return `${ms / 1e3} s`;
|
|
2988
|
-
}
|
|
2989
|
-
function buildUrl(apiUrl, path, query) {
|
|
2990
|
-
const normalizedPath = path.startsWith("/") ? path : `/${path}`;
|
|
2991
|
-
const base = `${apiUrl}${normalizedPath}`;
|
|
2992
|
-
if (query === void 0) return base;
|
|
2993
|
-
const params = [];
|
|
2994
|
-
for (const key of Object.keys(query)) {
|
|
2995
|
-
const value = query[key];
|
|
2996
|
-
if (value === void 0) continue;
|
|
2997
|
-
const values = typeof value === "object" ? value : [String(value)];
|
|
2998
|
-
for (const v of values) params.push(`${encodeURIComponent(key)}=${encodeURIComponent(v)}`);
|
|
2999
|
-
}
|
|
3000
|
-
return params.length === 0 ? base : `${base}?${params.join("&")}`;
|
|
3001
|
-
}
|
|
3002
|
-
function buildHeaders(input, auth) {
|
|
3003
|
-
const headers = {
|
|
3004
|
-
Accept: "application/json",
|
|
3005
|
-
Authorization: `Bearer ${authTokenFor(auth)}`
|
|
3006
|
-
};
|
|
3007
|
-
if (input.body !== void 0) {
|
|
3008
|
-
headers["Content-Type"] = "application/json; charset=utf-8";
|
|
3009
|
-
}
|
|
3010
|
-
if (input.idempotencyKey !== void 0 && MUTATING.has(input.method)) {
|
|
3011
|
-
headers["Idempotency-Key"] = input.idempotencyKey;
|
|
3012
|
-
}
|
|
3013
|
-
if (input.headers !== void 0) {
|
|
3014
|
-
for (const key of Object.keys(input.headers)) {
|
|
3015
|
-
headers[key] = input.headers[key];
|
|
3016
|
-
}
|
|
3017
|
-
}
|
|
3018
|
-
return headers;
|
|
3019
|
-
}
|
|
3020
|
-
function authTokenFor(auth) {
|
|
3021
|
-
if (auth.kind === "apiToken") return auth.token;
|
|
3022
|
-
return auth.accessToken;
|
|
3023
|
-
}
|
|
3024
|
-
function unwrapErrorEnvelope(body, status) {
|
|
3025
|
-
if (body !== null && typeof body === "object" && !Array.isArray(body)) {
|
|
3026
|
-
const inner = body.error;
|
|
3027
|
-
if (inner !== null && typeof inner === "object" && !Array.isArray(inner)) {
|
|
3028
|
-
return inner;
|
|
3029
|
-
}
|
|
3030
|
-
}
|
|
3031
|
-
return { code: "unknown", message: `HTTP ${status} without recognizable error envelope` };
|
|
3032
|
-
}
|
|
3033
|
-
|
|
3034
3471
|
// src/resources/runs.ts
|
|
3035
3472
|
function waitedStartTimeout(e) {
|
|
3036
3473
|
if (!(e instanceof KindgiApiError) || e.error.code !== "network") return e;
|
|
@@ -3044,6 +3481,30 @@ function waitedStartTimeout(e) {
|
|
|
3044
3481
|
});
|
|
3045
3482
|
}
|
|
3046
3483
|
function makeRunsClient(transport) {
|
|
3484
|
+
const followEvents = (runId, options) => followRun({
|
|
3485
|
+
url: `${transport.apiUrl}/v1/runs/${encodeURIComponent(runId)}/stream`,
|
|
3486
|
+
headers: () => transport.authHeaders(),
|
|
3487
|
+
fetchImpl: transport.fetchImpl,
|
|
3488
|
+
...options?.signal !== void 0 && { signal: options.signal },
|
|
3489
|
+
...options?.initialBackoffMs !== void 0 && {
|
|
3490
|
+
initialBackoffMs: options.initialBackoffMs
|
|
3491
|
+
},
|
|
3492
|
+
...options?.maxBackoffMs !== void 0 && {
|
|
3493
|
+
maxBackoffMs: options.maxBackoffMs
|
|
3494
|
+
}
|
|
3495
|
+
});
|
|
3496
|
+
const followProgressEvents = (runId, options) => followRun({
|
|
3497
|
+
url: `${transport.apiUrl}/v1/runs/${encodeURIComponent(runId)}/progress/stream`,
|
|
3498
|
+
headers: () => transport.authHeaders(),
|
|
3499
|
+
fetchImpl: transport.fetchImpl,
|
|
3500
|
+
...options?.signal !== void 0 && { signal: options.signal },
|
|
3501
|
+
...options?.initialBackoffMs !== void 0 && {
|
|
3502
|
+
initialBackoffMs: options.initialBackoffMs
|
|
3503
|
+
},
|
|
3504
|
+
...options?.maxBackoffMs !== void 0 && {
|
|
3505
|
+
maxBackoffMs: options.maxBackoffMs
|
|
3506
|
+
}
|
|
3507
|
+
});
|
|
3047
3508
|
return {
|
|
3048
3509
|
async start(input) {
|
|
3049
3510
|
const body = "agent" in input ? {
|
|
@@ -3089,34 +3550,10 @@ function makeRunsClient(transport) {
|
|
|
3089
3550
|
path: `/v1/runs/${encodeURIComponent(runId)}/progress`
|
|
3090
3551
|
});
|
|
3091
3552
|
},
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
fetchImpl: transport.fetchImpl,
|
|
3097
|
-
...options?.signal !== void 0 && { signal: options.signal },
|
|
3098
|
-
...options?.initialBackoffMs !== void 0 && {
|
|
3099
|
-
initialBackoffMs: options.initialBackoffMs
|
|
3100
|
-
},
|
|
3101
|
-
...options?.maxBackoffMs !== void 0 && {
|
|
3102
|
-
maxBackoffMs: options.maxBackoffMs
|
|
3103
|
-
}
|
|
3104
|
-
});
|
|
3105
|
-
},
|
|
3106
|
-
stream(runId, options) {
|
|
3107
|
-
return followRun({
|
|
3108
|
-
url: `${transport.apiUrl}/v1/runs/${encodeURIComponent(runId)}/stream`,
|
|
3109
|
-
headers: () => transport.authHeaders(),
|
|
3110
|
-
fetchImpl: transport.fetchImpl,
|
|
3111
|
-
...options?.signal !== void 0 && { signal: options.signal },
|
|
3112
|
-
...options?.initialBackoffMs !== void 0 && {
|
|
3113
|
-
initialBackoffMs: options.initialBackoffMs
|
|
3114
|
-
},
|
|
3115
|
-
...options?.maxBackoffMs !== void 0 && {
|
|
3116
|
-
maxBackoffMs: options.maxBackoffMs
|
|
3117
|
-
}
|
|
3118
|
-
});
|
|
3119
|
-
},
|
|
3553
|
+
followProgress: followProgressEvents,
|
|
3554
|
+
follow: followEvents,
|
|
3555
|
+
streamProgress: followProgressEvents,
|
|
3556
|
+
stream: followEvents,
|
|
3120
3557
|
async get(runId) {
|
|
3121
3558
|
return transport.request({
|
|
3122
3559
|
method: "GET",
|
|
@@ -3161,6 +3598,7 @@ function makeRunsClient(transport) {
|
|
|
3161
3598
|
...filter?.agentId !== void 0 && { agentId: filter.agentId },
|
|
3162
3599
|
...filter?.replays !== void 0 && { replays: filter.replays },
|
|
3163
3600
|
...filter?.evalRunId !== void 0 && { evalRunId: filter.evalRunId },
|
|
3601
|
+
...filter?.triggerId !== void 0 && { triggerId: filter.triggerId },
|
|
3164
3602
|
...filter?.includeOutput === true && { include: "output" }
|
|
3165
3603
|
}
|
|
3166
3604
|
});
|
|
@@ -3201,10 +3639,11 @@ function makeSchedulesClient(transport) {
|
|
|
3201
3639
|
}
|
|
3202
3640
|
});
|
|
3203
3641
|
},
|
|
3204
|
-
async get(triggerId) {
|
|
3642
|
+
async get(triggerId, options) {
|
|
3205
3643
|
return transport.request({
|
|
3206
3644
|
method: "GET",
|
|
3207
|
-
path: `/v1/schedules/${encodeURIComponent(triggerId)}
|
|
3645
|
+
path: `/v1/schedules/${encodeURIComponent(triggerId)}`,
|
|
3646
|
+
...options?.upcoming !== void 0 && { query: { upcoming: options.upcoming } }
|
|
3208
3647
|
});
|
|
3209
3648
|
},
|
|
3210
3649
|
async update(triggerId, input, options) {
|
|
@@ -3235,6 +3674,30 @@ function makeSchedulesClient(transport) {
|
|
|
3235
3674
|
path: `/v1/schedules/${encodeURIComponent(triggerId)}/unregister`,
|
|
3236
3675
|
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
3237
3676
|
});
|
|
3677
|
+
},
|
|
3678
|
+
async fires(triggerId, filter) {
|
|
3679
|
+
return transport.request({
|
|
3680
|
+
method: "GET",
|
|
3681
|
+
path: `/v1/schedules/${encodeURIComponent(triggerId)}/fires`,
|
|
3682
|
+
query: {
|
|
3683
|
+
...filter?.limit !== void 0 && { limit: filter.limit },
|
|
3684
|
+
...filter?.cursor !== void 0 && { cursor: filter.cursor }
|
|
3685
|
+
}
|
|
3686
|
+
});
|
|
3687
|
+
},
|
|
3688
|
+
async runNow(triggerId, options) {
|
|
3689
|
+
return transport.request({
|
|
3690
|
+
method: "POST",
|
|
3691
|
+
path: `/v1/schedules/${encodeURIComponent(triggerId)}/run-now`,
|
|
3692
|
+
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
3693
|
+
});
|
|
3694
|
+
},
|
|
3695
|
+
async takeOwnership(triggerId, options) {
|
|
3696
|
+
return transport.request({
|
|
3697
|
+
method: "POST",
|
|
3698
|
+
path: `/v1/schedules/${encodeURIComponent(triggerId)}/owner`,
|
|
3699
|
+
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
3700
|
+
});
|
|
3238
3701
|
}
|
|
3239
3702
|
};
|
|
3240
3703
|
}
|
|
@@ -3396,8 +3859,8 @@ function makeSecretsClient(transport) {
|
|
|
3396
3859
|
});
|
|
3397
3860
|
return { kind: "ok", record: ok.record, versionId: ok.versionId };
|
|
3398
3861
|
} catch (err) {
|
|
3399
|
-
const
|
|
3400
|
-
if (
|
|
3862
|
+
const conflict2 = tryReadVersionConflict(err);
|
|
3863
|
+
if (conflict2 !== null) return conflict2;
|
|
3401
3864
|
throw err;
|
|
3402
3865
|
}
|
|
3403
3866
|
},
|
|
@@ -3517,6 +3980,63 @@ function tryReadVersionConflict(err) {
|
|
|
3517
3980
|
return { kind: "version-conflict", currentVersion: current };
|
|
3518
3981
|
}
|
|
3519
3982
|
|
|
3983
|
+
// src/resources/service-accounts.ts
|
|
3984
|
+
function makeServiceAccountsClient(transport) {
|
|
3985
|
+
const withKey = (options) => options?.idempotencyKey !== void 0 ? { idempotencyKey: options.idempotencyKey } : {};
|
|
3986
|
+
return {
|
|
3987
|
+
async create(input, options) {
|
|
3988
|
+
return transport.request({
|
|
3989
|
+
method: "POST",
|
|
3990
|
+
path: "/v1/service-accounts",
|
|
3991
|
+
body: input,
|
|
3992
|
+
...withKey(options)
|
|
3993
|
+
});
|
|
3994
|
+
},
|
|
3995
|
+
async list(filter) {
|
|
3996
|
+
const page = await transport.request({
|
|
3997
|
+
method: "GET",
|
|
3998
|
+
path: "/v1/service-accounts",
|
|
3999
|
+
query: {
|
|
4000
|
+
...filter?.limit !== void 0 && { limit: filter.limit },
|
|
4001
|
+
...filter?.cursor !== void 0 && { cursor: filter.cursor },
|
|
4002
|
+
...filter?.includeUnregistered === true && { includeUnregistered: "true" }
|
|
4003
|
+
}
|
|
4004
|
+
});
|
|
4005
|
+
return listPage(page);
|
|
4006
|
+
},
|
|
4007
|
+
async get(serviceAccountId) {
|
|
4008
|
+
return transport.request({
|
|
4009
|
+
method: "GET",
|
|
4010
|
+
path: `/v1/service-accounts/${encodeURIComponent(serviceAccountId)}`
|
|
4011
|
+
});
|
|
4012
|
+
},
|
|
4013
|
+
async grant(serviceAccountId, grant, options) {
|
|
4014
|
+
return transport.request({
|
|
4015
|
+
method: "POST",
|
|
4016
|
+
path: `/v1/service-accounts/${encodeURIComponent(serviceAccountId)}/grant`,
|
|
4017
|
+
body: grant,
|
|
4018
|
+
...withKey(options)
|
|
4019
|
+
});
|
|
4020
|
+
},
|
|
4021
|
+
async ungrant(serviceAccountId, grant, options) {
|
|
4022
|
+
return transport.request({
|
|
4023
|
+
method: "POST",
|
|
4024
|
+
path: `/v1/service-accounts/${encodeURIComponent(serviceAccountId)}/ungrant`,
|
|
4025
|
+
body: grant,
|
|
4026
|
+
...withKey(options)
|
|
4027
|
+
});
|
|
4028
|
+
},
|
|
4029
|
+
async unregister(serviceAccountId, options) {
|
|
4030
|
+
return transport.request({
|
|
4031
|
+
method: "POST",
|
|
4032
|
+
path: `/v1/service-accounts/${encodeURIComponent(serviceAccountId)}/unregister`,
|
|
4033
|
+
body: {},
|
|
4034
|
+
...withKey(options)
|
|
4035
|
+
});
|
|
4036
|
+
}
|
|
4037
|
+
};
|
|
4038
|
+
}
|
|
4039
|
+
|
|
3520
4040
|
// src/resources/signing-keys.ts
|
|
3521
4041
|
function makeSigningKeysClient(transport) {
|
|
3522
4042
|
return {
|
|
@@ -3559,10 +4079,17 @@ function makeSigningKeysClient(transport) {
|
|
|
3559
4079
|
|
|
3560
4080
|
// src/resources/supervisor.ts
|
|
3561
4081
|
var REASON_NO_SUPERVISOR_CRUD = "no /v1/supervisors CRUD routes on the API \u2014 supervisor persistence is caller-plugged via SupervisorBinding at deployment boot (framework does NOT own supervisor storage; analogous to the identity-directory pattern for users)";
|
|
3562
|
-
function
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
4082
|
+
function removed(method, replacement) {
|
|
4083
|
+
return async () => {
|
|
4084
|
+
throw new KindgiApiError(
|
|
4085
|
+
notYetWired(
|
|
4086
|
+
`supervisor.proposals.${method}`,
|
|
4087
|
+
`removed in 0.1.5: proposals now change data blocks; use client.proposals.${replacement} (see client.proposals.create, evaluate and request)`
|
|
4088
|
+
)
|
|
4089
|
+
);
|
|
4090
|
+
};
|
|
4091
|
+
}
|
|
4092
|
+
function makeSupervisorClient(_transport) {
|
|
3566
4093
|
return {
|
|
3567
4094
|
async define(_spec) {
|
|
3568
4095
|
throw new KindgiApiError(notYetWired("supervisor.define", REASON_NO_SUPERVISOR_CRUD));
|
|
@@ -3580,114 +4107,22 @@ function makeSupervisorClient(transport) {
|
|
|
3580
4107
|
throw new KindgiApiError(notYetWired("supervisor.delete", REASON_NO_SUPERVISOR_CRUD));
|
|
3581
4108
|
},
|
|
3582
4109
|
proposals: {
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
change: input.change,
|
|
3593
|
-
patternRefs: input.patternRefs,
|
|
3594
|
-
hypothesis: input.hypothesis,
|
|
3595
|
-
proposerRuleId: input.proposerRuleId
|
|
3596
|
-
},
|
|
3597
|
-
...input.idempotencyKey !== void 0 && { idempotencyKey: input.idempotencyKey }
|
|
3598
|
-
});
|
|
3599
|
-
},
|
|
3600
|
-
async list(input) {
|
|
3601
|
-
const page = await transport.request({
|
|
3602
|
-
method: "GET",
|
|
3603
|
-
path: "/v1/proposals",
|
|
3604
|
-
headers: supervisorHeader(input.supervisorId),
|
|
3605
|
-
query: {
|
|
3606
|
-
...input.limit !== void 0 && { limit: input.limit },
|
|
3607
|
-
...input.cursor !== void 0 && { cursor: input.cursor },
|
|
3608
|
-
...input.status !== void 0 && { status: input.status },
|
|
3609
|
-
...input.agentId !== void 0 && { agentId: input.agentId },
|
|
3610
|
-
...input.tier !== void 0 && { tier: input.tier }
|
|
3611
|
-
}
|
|
3612
|
-
});
|
|
3613
|
-
return listPage(page);
|
|
3614
|
-
},
|
|
3615
|
-
async get(supervisorId, id) {
|
|
3616
|
-
return transport.request({
|
|
3617
|
-
method: "GET",
|
|
3618
|
-
path: `/v1/proposals/${encodeURIComponent(id)}`,
|
|
3619
|
-
headers: supervisorHeader(supervisorId)
|
|
3620
|
-
});
|
|
3621
|
-
},
|
|
3622
|
-
async dryRun(supervisorId, id, input) {
|
|
3623
|
-
return transport.request({
|
|
3624
|
-
method: "POST",
|
|
3625
|
-
path: `/v1/proposals/${encodeURIComponent(id)}/dry-run`,
|
|
3626
|
-
headers: supervisorHeader(supervisorId),
|
|
3627
|
-
body: {
|
|
3628
|
-
datasetId: input.datasetId,
|
|
3629
|
-
datasetVersion: input.datasetVersion,
|
|
3630
|
-
criterion: input.criterion
|
|
3631
|
-
},
|
|
3632
|
-
...input.idempotencyKey !== void 0 && { idempotencyKey: input.idempotencyKey }
|
|
3633
|
-
});
|
|
3634
|
-
},
|
|
3635
|
-
async submitForReview(supervisorId, id, input) {
|
|
3636
|
-
const body = {};
|
|
3637
|
-
if (input?.requiredRole !== void 0) body.requiredRole = input.requiredRole;
|
|
3638
|
-
if (input?.expiresAt !== void 0) body.expiresAt = input.expiresAt;
|
|
3639
|
-
return transport.request({
|
|
3640
|
-
method: "POST",
|
|
3641
|
-
path: `/v1/proposals/${encodeURIComponent(id)}/submit-review`,
|
|
3642
|
-
headers: supervisorHeader(supervisorId),
|
|
3643
|
-
body,
|
|
3644
|
-
...input?.idempotencyKey !== void 0 && { idempotencyKey: input.idempotencyKey }
|
|
3645
|
-
});
|
|
3646
|
-
},
|
|
3647
|
-
async reflectReview(_supervisorId, _id, _input) {
|
|
3648
|
-
throw new KindgiApiError(
|
|
3649
|
-
notYetWired(
|
|
3650
|
-
"supervisor.proposals.reflectReview",
|
|
3651
|
-
"no POST /v1/proposals/{id}/reflect-review route on the API \u2014 review reflection is atomic with POST /v1/approvals/{id}/complete (wire detects the linked proposal + updates status alongside the decision)"
|
|
3652
|
-
)
|
|
3653
|
-
);
|
|
3654
|
-
},
|
|
3655
|
-
async apply(supervisorId, id, input) {
|
|
3656
|
-
const body = {};
|
|
3657
|
-
if (input?.newVersion !== void 0) body.newVersion = input.newVersion;
|
|
3658
|
-
return transport.request({
|
|
3659
|
-
method: "POST",
|
|
3660
|
-
path: `/v1/proposals/${encodeURIComponent(id)}/apply`,
|
|
3661
|
-
headers: supervisorHeader(supervisorId),
|
|
3662
|
-
body,
|
|
3663
|
-
...input?.idempotencyKey !== void 0 && { idempotencyKey: input.idempotencyKey }
|
|
3664
|
-
});
|
|
3665
|
-
},
|
|
3666
|
-
async rollback(supervisorId, id, input) {
|
|
3667
|
-
return transport.request({
|
|
3668
|
-
method: "POST",
|
|
3669
|
-
path: `/v1/proposals/${encodeURIComponent(id)}/rollback`,
|
|
3670
|
-
headers: supervisorHeader(supervisorId),
|
|
3671
|
-
body: { reason: input.reason },
|
|
3672
|
-
...input.idempotencyKey !== void 0 && { idempotencyKey: input.idempotencyKey }
|
|
3673
|
-
});
|
|
3674
|
-
},
|
|
3675
|
-
async withdraw(supervisorId, id, input) {
|
|
3676
|
-
return transport.request({
|
|
3677
|
-
method: "POST",
|
|
3678
|
-
path: `/v1/proposals/${encodeURIComponent(id)}/withdraw`,
|
|
3679
|
-
headers: supervisorHeader(supervisorId),
|
|
3680
|
-
body: { reason: input.reason },
|
|
3681
|
-
...input.idempotencyKey !== void 0 && { idempotencyKey: input.idempotencyKey }
|
|
3682
|
-
});
|
|
3683
|
-
}
|
|
4110
|
+
draft: removed("draft", "create"),
|
|
4111
|
+
list: removed("list", "list"),
|
|
4112
|
+
get: removed("get", "get"),
|
|
4113
|
+
dryRun: removed("dryRun", "evaluate"),
|
|
4114
|
+
submitForReview: removed("submitForReview", "request"),
|
|
4115
|
+
reflectReview: removed("reflectReview", "request"),
|
|
4116
|
+
apply: removed("apply", "request"),
|
|
4117
|
+
rollback: removed("rollback", "rollback"),
|
|
4118
|
+
withdraw: removed("withdraw", "withdraw")
|
|
3684
4119
|
}
|
|
3685
4120
|
};
|
|
3686
4121
|
}
|
|
3687
4122
|
|
|
3688
4123
|
// src/resources/teams.ts
|
|
3689
4124
|
function makeTeamsClient(transport) {
|
|
3690
|
-
const
|
|
4125
|
+
const seg2 = (s) => encodeURIComponent(s);
|
|
3691
4126
|
return {
|
|
3692
4127
|
async create(input, options) {
|
|
3693
4128
|
return transport.request({
|
|
@@ -3710,13 +4145,13 @@ function makeTeamsClient(transport) {
|
|
|
3710
4145
|
async get(teamId) {
|
|
3711
4146
|
return transport.request({
|
|
3712
4147
|
method: "GET",
|
|
3713
|
-
path: `/v1/teams/${
|
|
4148
|
+
path: `/v1/teams/${seg2(teamId)}`
|
|
3714
4149
|
});
|
|
3715
4150
|
},
|
|
3716
4151
|
async update(teamId, input, options) {
|
|
3717
4152
|
return transport.request({
|
|
3718
4153
|
method: "PATCH",
|
|
3719
|
-
path: `/v1/teams/${
|
|
4154
|
+
path: `/v1/teams/${seg2(teamId)}`,
|
|
3720
4155
|
body: input,
|
|
3721
4156
|
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
3722
4157
|
});
|
|
@@ -3724,7 +4159,7 @@ function makeTeamsClient(transport) {
|
|
|
3724
4159
|
async delete(teamId) {
|
|
3725
4160
|
return transport.request({
|
|
3726
4161
|
method: "DELETE",
|
|
3727
|
-
path: `/v1/teams/${
|
|
4162
|
+
path: `/v1/teams/${seg2(teamId)}`,
|
|
3728
4163
|
discardResponse: true
|
|
3729
4164
|
});
|
|
3730
4165
|
},
|
|
@@ -3732,7 +4167,7 @@ function makeTeamsClient(transport) {
|
|
|
3732
4167
|
async list(teamId, filter) {
|
|
3733
4168
|
return transport.request({
|
|
3734
4169
|
method: "GET",
|
|
3735
|
-
path: `/v1/teams/${
|
|
4170
|
+
path: `/v1/teams/${seg2(teamId)}/memberships`,
|
|
3736
4171
|
query: {
|
|
3737
4172
|
...filter?.limit !== void 0 && { limit: filter.limit },
|
|
3738
4173
|
...filter?.cursor !== void 0 && { cursor: filter.cursor }
|
|
@@ -3742,7 +4177,7 @@ function makeTeamsClient(transport) {
|
|
|
3742
4177
|
async add(teamId, input, options) {
|
|
3743
4178
|
return transport.request({
|
|
3744
4179
|
method: "POST",
|
|
3745
|
-
path: `/v1/teams/${
|
|
4180
|
+
path: `/v1/teams/${seg2(teamId)}/memberships`,
|
|
3746
4181
|
body: input,
|
|
3747
4182
|
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
3748
4183
|
});
|
|
@@ -3750,7 +4185,7 @@ function makeTeamsClient(transport) {
|
|
|
3750
4185
|
async updateRole(teamId, userId, role, options) {
|
|
3751
4186
|
return transport.request({
|
|
3752
4187
|
method: "PATCH",
|
|
3753
|
-
path: `/v1/teams/${
|
|
4188
|
+
path: `/v1/teams/${seg2(teamId)}/memberships/${seg2(userId)}`,
|
|
3754
4189
|
body: { role },
|
|
3755
4190
|
discardResponse: true,
|
|
3756
4191
|
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
@@ -3759,7 +4194,7 @@ function makeTeamsClient(transport) {
|
|
|
3759
4194
|
async remove(teamId, userId, options) {
|
|
3760
4195
|
return transport.request({
|
|
3761
4196
|
method: "DELETE",
|
|
3762
|
-
path: `/v1/teams/${
|
|
4197
|
+
path: `/v1/teams/${seg2(teamId)}/memberships/${seg2(userId)}`,
|
|
3763
4198
|
discardResponse: true,
|
|
3764
4199
|
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
3765
4200
|
});
|
|
@@ -3806,6 +4241,7 @@ function makeTenantClient(transport) {
|
|
|
3806
4241
|
function fromWire2(wire) {
|
|
3807
4242
|
return {
|
|
3808
4243
|
id: wire.tokenId,
|
|
4244
|
+
...wire.principal !== void 0 && { principal: wire.principal },
|
|
3809
4245
|
role: wire.role,
|
|
3810
4246
|
capabilities: wire.capabilities,
|
|
3811
4247
|
...wire.label !== void 0 && { label: wire.label },
|
|
@@ -3823,6 +4259,7 @@ function makeTokensClient(transport) {
|
|
|
3823
4259
|
return {
|
|
3824
4260
|
async create(spec, options) {
|
|
3825
4261
|
const body = {};
|
|
4262
|
+
if (spec?.for !== void 0) body.for = { kind: spec.for.kind, id: spec.for.id };
|
|
3826
4263
|
if (spec?.role !== void 0) body.role = spec.role;
|
|
3827
4264
|
if (spec?.capabilities !== void 0) body.capabilities = spec.capabilities;
|
|
3828
4265
|
if (spec?.label !== void 0) body.label = spec.label;
|
|
@@ -3845,7 +4282,10 @@ function makeTokensClient(transport) {
|
|
|
3845
4282
|
path: "/v1/tokens",
|
|
3846
4283
|
query: {
|
|
3847
4284
|
...filter?.limit !== void 0 && { limit: filter.limit },
|
|
3848
|
-
...filter?.cursor !== void 0 && { cursor: filter.cursor }
|
|
4285
|
+
...filter?.cursor !== void 0 && { cursor: filter.cursor },
|
|
4286
|
+
...filter?.principal !== void 0 && {
|
|
4287
|
+
principal: `${filter.principal.kind}:${filter.principal.id}`
|
|
4288
|
+
}
|
|
3849
4289
|
}
|
|
3850
4290
|
});
|
|
3851
4291
|
return listPage({ ...page, data: page.data.map(fromWire2) });
|
|
@@ -3988,13 +4428,24 @@ function makeToolsClient(transport) {
|
|
|
3988
4428
|
// src/resources/users.ts
|
|
3989
4429
|
function makeUsersClient(transport) {
|
|
3990
4430
|
return {
|
|
3991
|
-
async create(
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
"users.create",
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
4431
|
+
async create(spec, options) {
|
|
4432
|
+
if (spec.orgId !== void 0 || spec.metadata !== void 0) {
|
|
4433
|
+
throw new KindgiApiError(
|
|
4434
|
+
notYetWired("users.create", "`orgId` and `metadata` are not on the wire")
|
|
4435
|
+
);
|
|
4436
|
+
}
|
|
4437
|
+
const created = await transport.request({
|
|
4438
|
+
method: "POST",
|
|
4439
|
+
path: "/v1/identity/users",
|
|
4440
|
+
body: {
|
|
4441
|
+
displayName: spec.displayName,
|
|
4442
|
+
...spec.email !== void 0 && { primaryEmail: spec.email }
|
|
4443
|
+
},
|
|
4444
|
+
...options?.idempotencyKey !== void 0 && {
|
|
4445
|
+
idempotencyKey: options.idempotencyKey
|
|
4446
|
+
}
|
|
4447
|
+
});
|
|
4448
|
+
return created.userId;
|
|
3998
4449
|
},
|
|
3999
4450
|
async get(id) {
|
|
4000
4451
|
return transport.request({
|
|
@@ -4015,11 +4466,42 @@ function makeUsersClient(transport) {
|
|
|
4015
4466
|
query: {
|
|
4016
4467
|
...filter?.limit !== void 0 && { limit: filter.limit },
|
|
4017
4468
|
...filter?.cursor !== void 0 && { cursor: filter.cursor },
|
|
4018
|
-
...filter?.query !== void 0 && { query: filter.query }
|
|
4469
|
+
...filter?.query !== void 0 && { query: filter.query },
|
|
4470
|
+
...filter?.includeUnregistered === true && { includeUnregistered: "true" }
|
|
4019
4471
|
}
|
|
4020
4472
|
});
|
|
4021
4473
|
return listPage(page);
|
|
4022
4474
|
},
|
|
4475
|
+
async grants(id) {
|
|
4476
|
+
return transport.request({
|
|
4477
|
+
method: "GET",
|
|
4478
|
+
path: `/v1/identity/users/${encodeURIComponent(id)}/grants`
|
|
4479
|
+
});
|
|
4480
|
+
},
|
|
4481
|
+
async grant(id, grant, options) {
|
|
4482
|
+
return transport.request({
|
|
4483
|
+
method: "POST",
|
|
4484
|
+
path: `/v1/identity/users/${encodeURIComponent(id)}/grant`,
|
|
4485
|
+
body: grant,
|
|
4486
|
+
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
4487
|
+
});
|
|
4488
|
+
},
|
|
4489
|
+
async ungrant(id, grant, options) {
|
|
4490
|
+
return transport.request({
|
|
4491
|
+
method: "POST",
|
|
4492
|
+
path: `/v1/identity/users/${encodeURIComponent(id)}/ungrant`,
|
|
4493
|
+
body: grant,
|
|
4494
|
+
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
4495
|
+
});
|
|
4496
|
+
},
|
|
4497
|
+
async unregister(id, options) {
|
|
4498
|
+
return transport.request({
|
|
4499
|
+
method: "POST",
|
|
4500
|
+
path: `/v1/identity/users/${encodeURIComponent(id)}/unregister`,
|
|
4501
|
+
body: {},
|
|
4502
|
+
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
4503
|
+
});
|
|
4504
|
+
},
|
|
4023
4505
|
async update(_id, _patch) {
|
|
4024
4506
|
throw new KindgiApiError(
|
|
4025
4507
|
notYetWired(
|
|
@@ -4216,7 +4698,9 @@ function createClient(options) {
|
|
|
4216
4698
|
conversations: makeConversationsClient(transport),
|
|
4217
4699
|
memory: makeMemoryClient(transport),
|
|
4218
4700
|
provenance: makeProvenanceClient(transport),
|
|
4219
|
-
supervisor: makeSupervisorClient(
|
|
4701
|
+
supervisor: makeSupervisorClient(),
|
|
4702
|
+
proposals: makeProposalsClient(transport),
|
|
4703
|
+
improvementPasses: makeImprovementPassesClient(transport),
|
|
4220
4704
|
observations: makeObservationsClient(transport),
|
|
4221
4705
|
approvals: makeApprovalsClient(transport),
|
|
4222
4706
|
tenant: makeTenantClient(transport),
|
|
@@ -4244,7 +4728,9 @@ function createClient(options) {
|
|
|
4244
4728
|
teams: makeTeamsClient(transport),
|
|
4245
4729
|
orgs: makeOrgsClient(transport),
|
|
4246
4730
|
signingKeys: makeSigningKeysClient(transport),
|
|
4731
|
+
exportSigningKeys: makeExportSigningKeysClient(transport),
|
|
4247
4732
|
tokens: makeTokensClient(transport),
|
|
4733
|
+
serviceAccounts: makeServiceAccountsClient(transport),
|
|
4248
4734
|
mcp: makeMcpClient(transport),
|
|
4249
4735
|
events: makeEventsClient(),
|
|
4250
4736
|
eventTriggers: makeEventTriggersClient(transport),
|
|
@@ -4255,6 +4741,6 @@ function createClient(options) {
|
|
|
4255
4741
|
};
|
|
4256
4742
|
}
|
|
4257
4743
|
|
|
4258
|
-
export { KindgiApiError, SseHttpError, comparisonOf, createClient, followRun, fromWire, notImplementedInPreview, notYetWired, readSse, subscribeToRun, unwrapSseData };
|
|
4744
|
+
export { KindgiApiError, SIGNED_EXPORT_ALGORITHMS, SseHttpError, comparisonOf, createClient, followRun, fromWire, notImplementedInPreview, notYetWired, readSse, subscribeToRun, unwrapSseData, verifySignedExport };
|
|
4259
4745
|
//# sourceMappingURL=index.js.map
|
|
4260
4746
|
//# sourceMappingURL=index.js.map
|