@kindgi/client 0.1.4-rc.5 → 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/dist/index.cjs CHANGED
@@ -49,6 +49,8 @@ function classify(body, status) {
49
49
  case "auth-revoked":
50
50
  return { code: "auth", message, reason: "unauthenticated" };
51
51
  case "permission-denied":
52
+ case "role-exceeds-principal":
53
+ case "key-project-mismatch":
52
54
  return { code: "auth", message, reason: "forbidden" };
53
55
  case "rate-limited":
54
56
  case "rate-limit-exceeded":
@@ -77,11 +79,15 @@ function classify(body, status) {
77
79
  case "token-not-found":
78
80
  case "agent-version-not-found":
79
81
  case "promotion-not-found":
82
+ case "principal-not-found":
83
+ case "service-account-not-found":
80
84
  return notFound(code, message, details);
81
85
  case "conflict":
82
86
  case "already-terminal":
83
87
  case "run-already-terminal":
84
88
  case "idempotency-key-body-mismatch":
89
+ case "idempotency-key-in-flight":
90
+ case "idempotency-key-replay-withheld":
85
91
  case "hitl-required":
86
92
  case "agent-already-registered":
87
93
  case "tool-already-registered":
@@ -113,8 +119,18 @@ function classify(body, status) {
113
119
  case "gate-policy-scope-changed":
114
120
  case "gate-policy-scope-unpinned":
115
121
  case "gate-policy-needs-pin":
122
+ case "fact-changed":
123
+ case "legal-hold":
124
+ case "erasure-in-progress":
116
125
  case "gate-policy-descendant-unpinned":
117
- return { code: "conflict", message, reason: code };
126
+ case "service-account-name-taken":
127
+ case "service-account-unregistered":
128
+ case "identity-user-email-taken":
129
+ case "last-tenant-admin":
130
+ case "seed-user-admin":
131
+ case "identity-user-unregister-refused":
132
+ case "identity-user-unregistered":
133
+ return conflict(code, message, details);
118
134
  case "invalid-request":
119
135
  case "validation-failed":
120
136
  case "unknown-field":
@@ -128,8 +144,11 @@ function classify(body, status) {
128
144
  case "unknown-effect":
129
145
  case "invalid-guardrail":
130
146
  case "invalid-provider":
147
+ case "guardrail-config-invalid":
148
+ case "provider-config-invalid":
131
149
  case "supervisor-header-missing":
132
150
  case "scope-invalid":
151
+ case "artifact-too-large":
133
152
  return invalidRequest(message, obj, details);
134
153
  case "guardrail-violation":
135
154
  return {
@@ -142,13 +161,24 @@ function classify(body, status) {
142
161
  return byStatus(status, code, message, obj, details);
143
162
  }
144
163
  }
164
+ function conflict(code, message, details) {
165
+ return {
166
+ code: "conflict",
167
+ message,
168
+ reason: code,
169
+ ...details !== void 0 ? { fields: details } : {}
170
+ };
171
+ }
145
172
  function byStatus(status, code, message, obj, details) {
146
173
  switch (status) {
147
174
  case 404:
148
175
  case 410:
149
176
  return notFound(code, message, details);
150
177
  case 400:
178
+ case 413:
151
179
  return invalidRequest(message, obj, details);
180
+ case 409:
181
+ return conflict(code, message, details);
152
182
  case 401:
153
183
  return { code: "auth", message, reason: "unauthenticated" };
154
184
  case 403:
@@ -212,10 +242,10 @@ function readStringField(obj, ...keys) {
212
242
  function asRecord(value) {
213
243
  return value !== null && typeof value === "object" ? value : void 0;
214
244
  }
215
- function readGuardrailViolations(raw) {
216
- if (!Array.isArray(raw)) return [];
245
+ function readGuardrailViolations(raw2) {
246
+ if (!Array.isArray(raw2)) return [];
217
247
  const out = [];
218
- for (const entry of raw) {
248
+ for (const entry of raw2) {
219
249
  const v = asRecord(entry);
220
250
  if (v === void 0 || typeof v.guardrailId !== "string") continue;
221
251
  const reason = asRecord(v.result)?.reason;
@@ -228,10 +258,10 @@ function readGuardrailViolations(raw) {
228
258
  }
229
259
  return out;
230
260
  }
231
- function readEvaluationErrors(raw) {
232
- if (!Array.isArray(raw)) return [];
261
+ function readEvaluationErrors(raw2) {
262
+ if (!Array.isArray(raw2)) return [];
233
263
  const out = [];
234
- for (const entry of raw) {
264
+ for (const entry of raw2) {
235
265
  const e = asRecord(entry);
236
266
  if (e === void 0 || typeof e.guardrailId !== "string") continue;
237
267
  out.push({
@@ -332,9 +362,9 @@ async function* parseSseStream(body) {
332
362
  newlineIdx = buffer.indexOf("\n");
333
363
  if (line === "") {
334
364
  if (dataLines.length > 0) {
335
- const raw = dataLines.join("\n");
365
+ const raw2 = dataLines.join("\n");
336
366
  try {
337
- const data = JSON.parse(raw);
367
+ const data = JSON.parse(raw2);
338
368
  yield { event: eventName, data, ...eventId !== void 0 ? { id: eventId } : {} };
339
369
  } catch {
340
370
  }
@@ -472,12 +502,12 @@ function makeAdaptersClient(transport) {
472
502
 
473
503
  // src/resources/agents.ts
474
504
  function makeAgentsClient(transport) {
475
- const seg = (s) => encodeURIComponent(s);
505
+ const seg2 = (s) => encodeURIComponent(s);
476
506
  const versions = {
477
507
  async list(agentId, filter) {
478
508
  return transport.request({
479
509
  method: "GET",
480
- path: `/v1/agents/${seg(agentId)}/versions`,
510
+ path: `/v1/agents/${seg2(agentId)}/versions`,
481
511
  query: {
482
512
  ...filter?.limit !== void 0 && { limit: filter.limit },
483
513
  ...filter?.cursor !== void 0 && { cursor: filter.cursor }
@@ -487,13 +517,13 @@ function makeAgentsClient(transport) {
487
517
  async get(agentId, version) {
488
518
  return transport.request({
489
519
  method: "GET",
490
- path: `/v1/agents/${seg(agentId)}/versions/${seg(version)}`
520
+ path: `/v1/agents/${seg2(agentId)}/versions/${seg2(version)}`
491
521
  });
492
522
  },
493
523
  async unregister(agentId, version, options) {
494
524
  return transport.request({
495
525
  method: "POST",
496
- path: `/v1/agents/${seg(agentId)}/versions/${seg(version)}/unregister`,
526
+ path: `/v1/agents/${seg2(agentId)}/versions/${seg2(version)}/unregister`,
497
527
  ...options?.idempotencyKey !== void 0 && {
498
528
  idempotencyKey: options.idempotencyKey
499
529
  }
@@ -502,7 +532,7 @@ function makeAgentsClient(transport) {
502
532
  async derive(agentId, input, options) {
503
533
  return transport.request({
504
534
  method: "POST",
505
- path: `/v1/agents/${seg(agentId)}/versions`,
535
+ path: `/v1/agents/${seg2(agentId)}/versions`,
506
536
  body: input,
507
537
  ...options?.idempotencyKey !== void 0 && {
508
538
  idempotencyKey: options.idempotencyKey
@@ -512,7 +542,7 @@ function makeAgentsClient(transport) {
512
542
  async reinstate(agentId, version, options) {
513
543
  const wire = await transport.request({
514
544
  method: "POST",
515
- path: `/v1/agents/${seg(agentId)}/versions/${seg(version)}/reinstate`,
545
+ path: `/v1/agents/${seg2(agentId)}/versions/${seg2(version)}/reinstate`,
516
546
  ...options?.idempotencyKey !== void 0 && {
517
547
  idempotencyKey: options.idempotencyKey
518
548
  }
@@ -550,7 +580,7 @@ function makeAgentsClient(transport) {
550
580
  async get(agentId) {
551
581
  return transport.request({
552
582
  method: "GET",
553
- path: `/v1/agents/${seg(agentId)}`
583
+ path: `/v1/agents/${seg2(agentId)}`
554
584
  });
555
585
  },
556
586
  versions,
@@ -559,7 +589,7 @@ function makeAgentsClient(transport) {
559
589
  async resolve(agentId, where) {
560
590
  return transport.request({
561
591
  method: "GET",
562
- path: `/v1/agents/${seg(agentId)}/live`,
592
+ path: `/v1/agents/${seg2(agentId)}/live`,
563
593
  query: {
564
594
  ...where?.projectId !== void 0 && { projectId: where.projectId },
565
595
  ...where?.segments !== void 0 && { segment: where.segments.map(segmentParam) }
@@ -569,13 +599,13 @@ function makeAgentsClient(transport) {
569
599
  async list(agentId) {
570
600
  return transport.request({
571
601
  method: "GET",
572
- path: `/v1/agents/${seg(agentId)}/live-versions`
602
+ path: `/v1/agents/${seg2(agentId)}/live-versions`
573
603
  });
574
604
  },
575
605
  async rollback(agentId, input, options) {
576
606
  return transport.request({
577
607
  method: "POST",
578
- path: `/v1/agents/${seg(agentId)}/live/rollback`,
608
+ path: `/v1/agents/${seg2(agentId)}/live/rollback`,
579
609
  body: input,
580
610
  ...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
581
611
  });
@@ -583,7 +613,7 @@ function makeAgentsClient(transport) {
583
613
  async unpin(agentId, input, options) {
584
614
  return transport.request({
585
615
  method: "POST",
586
- path: `/v1/agents/${seg(agentId)}/live/unpin`,
616
+ path: `/v1/agents/${seg2(agentId)}/live/unpin`,
587
617
  body: input,
588
618
  ...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
589
619
  });
@@ -593,7 +623,7 @@ function makeAgentsClient(transport) {
593
623
  async create(agentId, input, options) {
594
624
  return transport.request({
595
625
  method: "POST",
596
- path: `/v1/agents/${seg(agentId)}/promotions`,
626
+ path: `/v1/agents/${seg2(agentId)}/promotions`,
597
627
  body: input,
598
628
  ...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
599
629
  });
@@ -601,14 +631,14 @@ function makeAgentsClient(transport) {
601
631
  async check(agentId, input) {
602
632
  return transport.request({
603
633
  method: "POST",
604
- path: `/v1/agents/${seg(agentId)}/promotions/check`,
634
+ path: `/v1/agents/${seg2(agentId)}/promotions/check`,
605
635
  body: input
606
636
  });
607
637
  },
608
638
  async list(agentId, filter) {
609
639
  return transport.request({
610
640
  method: "GET",
611
- path: `/v1/agents/${seg(agentId)}/promotions`,
641
+ path: `/v1/agents/${seg2(agentId)}/promotions`,
612
642
  query: {
613
643
  ...filter?.scope !== void 0 && scopeQuery(filter.scope),
614
644
  ...filter?.limit !== void 0 && { limit: filter.limit },
@@ -619,7 +649,7 @@ function makeAgentsClient(transport) {
619
649
  async get(agentId, promotionId) {
620
650
  return transport.request({
621
651
  method: "GET",
622
- path: `/v1/agents/${seg(agentId)}/promotions/${seg(promotionId)}`
652
+ path: `/v1/agents/${seg2(agentId)}/promotions/${seg2(promotionId)}`
623
653
  });
624
654
  }
625
655
  },
@@ -627,7 +657,7 @@ function makeAgentsClient(transport) {
627
657
  async resolve(agentId, scope) {
628
658
  return transport.request({
629
659
  method: "GET",
630
- path: `/v1/agents/${seg(agentId)}/gate-policy`,
660
+ path: `/v1/agents/${seg2(agentId)}/gate-policy`,
631
661
  query: scopeQuery(scope)
632
662
  });
633
663
  }
@@ -682,6 +712,106 @@ function singleStatusQuery(method, status) {
682
712
  throw new KindgiApiError(error);
683
713
  }
684
714
 
715
+ // src/verify-export.ts
716
+ var ALGORITHMS = {
717
+ ed25519: { key: { name: "Ed25519" }, verify: { name: "Ed25519" } },
718
+ "ecdsa-p256-sha256": {
719
+ key: { name: "ECDSA", namedCurve: "P-256" },
720
+ verify: { name: "ECDSA", hash: "SHA-256" }
721
+ }
722
+ };
723
+ var SIGNED_EXPORT_ALGORITHMS = Object.keys(
724
+ ALGORITHMS
725
+ );
726
+ async function verifySignedExport(envelope, options = {}) {
727
+ const issues = [];
728
+ const checkedAgainst = options.trustedKeys !== void 0 ? "trusted-keys" : "its-own-key";
729
+ const fail = () => ({
730
+ valid: false,
731
+ issues,
732
+ checkedAgainst,
733
+ signingKeyId: envelope.signingKeyId
734
+ });
735
+ const algorithm = Object.hasOwn(ALGORITHMS, envelope.algorithm) ? ALGORITHMS[envelope.algorithm] : void 0;
736
+ if (algorithm === void 0) {
737
+ issues.push(
738
+ `algorithm "${envelope.algorithm}" isn't one this verifier knows (${SIGNED_EXPORT_ALGORITHMS.join(", ")}): a newer verifier may check it`
739
+ );
740
+ }
741
+ if (envelope.canonicalization !== "sorted-key-json") {
742
+ issues.push(`canonicalization "${envelope.canonicalization}" isn't sorted-key-json`);
743
+ }
744
+ if (options.trustedKeys !== void 0 && !options.trustedKeys.some((pem) => samePem(pem, envelope.publicKey))) {
745
+ issues.push(`it was signed with key "${envelope.signingKeyId}", which isn't one you trust`);
746
+ }
747
+ if (issues.length > 0 || algorithm === void 0) return fail();
748
+ let bytes;
749
+ let signed;
750
+ try {
751
+ bytes = fromBase64(envelope.bundle);
752
+ const key = await crypto.subtle.importKey(
753
+ "spki",
754
+ toArrayBuffer(fromPem(envelope.publicKey)),
755
+ algorithm.key,
756
+ false,
757
+ ["verify"]
758
+ );
759
+ signed = await crypto.subtle.verify(
760
+ algorithm.verify,
761
+ key,
762
+ toArrayBuffer(fromBase64(envelope.signature)),
763
+ toArrayBuffer(bytes)
764
+ );
765
+ } catch (cause) {
766
+ issues.push(`it can't be checked: ${cause instanceof Error ? cause.message : String(cause)}`);
767
+ return fail();
768
+ }
769
+ if (!signed) {
770
+ issues.push(
771
+ "the signature doesn't match the bundle: it was changed, or signed with another key"
772
+ );
773
+ return fail();
774
+ }
775
+ const body = JSON.parse(new TextDecoder().decode(bytes));
776
+ const notes = [];
777
+ if (body.exportedAt !== void 0 && body.exportedAt !== envelope.exportedAt) {
778
+ if (!madeByKindgi014(envelope, body)) {
779
+ issues.push(
780
+ `the envelope's exportedAt (${envelope.exportedAt}) isn't the signed one (${String(body.exportedAt)})`
781
+ );
782
+ return fail();
783
+ }
784
+ notes.push(
785
+ `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})`
786
+ );
787
+ }
788
+ return {
789
+ valid: true,
790
+ checkedAgainst,
791
+ body,
792
+ signingKeyId: envelope.signingKeyId,
793
+ ...notes.length > 0 && { notes }
794
+ };
795
+ }
796
+ function madeByKindgi014(envelope, body) {
797
+ return envelope.bundleSchemaVersion === 1 && body.bundleVersion === 1 && body.bundleSchemaVersion === void 0;
798
+ }
799
+ function samePem(a, b) {
800
+ return a.replace(/\s+/g, "") === b.replace(/\s+/g, "");
801
+ }
802
+ function fromPem(pem) {
803
+ return fromBase64(pem.replace(/-----(BEGIN|END) [A-Z ]+-----/g, "").replace(/\s+/g, ""));
804
+ }
805
+ function fromBase64(b64) {
806
+ const binary = atob(b64);
807
+ const out = new Uint8Array(binary.length);
808
+ for (let i = 0; i < binary.length; i += 1) out[i] = binary.charCodeAt(i);
809
+ return out;
810
+ }
811
+ function toArrayBuffer(bytes) {
812
+ return bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength);
813
+ }
814
+
685
815
  // src/resources/approvals.ts
686
816
  function makeApprovalsClient(transport) {
687
817
  return {
@@ -803,7 +933,7 @@ function makeApprovalsClient(transport) {
803
933
  method: "POST",
804
934
  path: `/v1/approvals/${encodeURIComponent(input.approvalId)}/audit-bundle`,
805
935
  body: {
806
- signingKeyId: input.signingKeyId,
936
+ ...input.signingKeyId !== void 0 && { signingKeyId: input.signingKeyId },
807
937
  ...input.includeMessages !== void 0 && {
808
938
  includeMessages: input.includeMessages
809
939
  }
@@ -827,26 +957,231 @@ function makeApprovalsClient(transport) {
827
957
  )
828
958
  );
829
959
  },
830
- async verify(_bundle, _publicKey) {
831
- throw new KindgiApiError(
832
- notYetWired(
833
- "approvals.audit.verify",
834
- "client-side verifier requires the crypto module reachability from the SDK bundle \u2014 not yet vendored (same constraint as provenance.verify + webhooks.verify)"
835
- )
836
- );
960
+ async verify(bundle, publicKey) {
961
+ const checked = await verifySignedExport(bundle, { trustedKeys: [publicKey] });
962
+ return checked.valid ? { valid: true } : { valid: false, issues: checked.issues ?? [] };
963
+ }
964
+ }
965
+ };
966
+ }
967
+
968
+ // src/transport.ts
969
+ var DEFAULT_TIMEOUT_MS = 3e4;
970
+ var MUTATING = /* @__PURE__ */ new Set([
971
+ "POST",
972
+ "PUT",
973
+ "PATCH",
974
+ "DELETE"
975
+ ]);
976
+ function createTransport(options) {
977
+ const apiUrl = options.apiUrl.replace(/\/+$/u, "");
978
+ const fetchImpl = options.fetch ?? fetch;
979
+ const clientTimeoutMs = checkedTimeoutMs(
980
+ options.timeoutMs ?? DEFAULT_TIMEOUT_MS,
981
+ "ClientOptions.timeoutMs"
982
+ );
983
+ return {
984
+ apiUrl,
985
+ fetchImpl,
986
+ authHeaders() {
987
+ return { Authorization: `Bearer ${authTokenFor(options.auth)}` };
988
+ },
989
+ async request(input) {
990
+ const url = buildUrl(apiUrl, input.path, input.query);
991
+ const headers = buildHeaders(input, options.auth);
992
+ const timeoutMs = input.timeoutMs === void 0 ? clientTimeoutMs : checkedTimeoutMs(input.timeoutMs, "timeoutMs");
993
+ const ac = new AbortController();
994
+ let timedOut = false;
995
+ const timer = setTimeout(() => {
996
+ timedOut = true;
997
+ ac.abort(new Error("timeout"));
998
+ }, timeoutMs);
999
+ let response;
1000
+ try {
1001
+ response = await fetchImpl(url, {
1002
+ method: input.method,
1003
+ headers,
1004
+ ...input.body !== void 0 && { body: JSON.stringify(input.body) },
1005
+ signal: ac.signal
1006
+ });
1007
+ } catch (cause) {
1008
+ clearTimeout(timer);
1009
+ const err = timedOut ? {
1010
+ code: "network",
1011
+ message: `No answer within ${seconds(timeoutMs)}, the client's timeout (timeoutMs).`,
1012
+ cause,
1013
+ timeoutMs
1014
+ } : {
1015
+ code: "network",
1016
+ message: cause instanceof Error ? cause.message : "network request failed",
1017
+ cause
1018
+ };
1019
+ throw new KindgiApiError(err);
1020
+ }
1021
+ clearTimeout(timer);
1022
+ if (response.ok) {
1023
+ if (input.discardResponse === true || response.status === 204) {
1024
+ try {
1025
+ await response.arrayBuffer();
1026
+ } catch {
1027
+ }
1028
+ return void 0;
1029
+ }
1030
+ try {
1031
+ return await response.json();
1032
+ } catch (cause) {
1033
+ const err = {
1034
+ code: "network",
1035
+ message: "Response body was not valid JSON",
1036
+ cause
1037
+ };
1038
+ throw new KindgiApiError(err);
1039
+ }
1040
+ }
1041
+ let body;
1042
+ try {
1043
+ body = await response.json();
1044
+ } catch {
1045
+ body = void 0;
837
1046
  }
1047
+ throw new KindgiApiError(
1048
+ fromWire(unwrapErrorEnvelope(body, response.status), response.status)
1049
+ );
838
1050
  }
839
1051
  };
840
1052
  }
1053
+ function checkedTimeoutMs(value, name) {
1054
+ if (!Number.isFinite(value) || value <= 0) {
1055
+ throw new TypeError(`${name} must be a positive number of milliseconds. Got ${String(value)}.`);
1056
+ }
1057
+ return value;
1058
+ }
1059
+ function seconds(ms) {
1060
+ return `${ms / 1e3} s`;
1061
+ }
1062
+ function buildUrl(apiUrl, path, query) {
1063
+ const normalizedPath = path.startsWith("/") ? path : `/${path}`;
1064
+ const base = `${apiUrl}${normalizedPath}`;
1065
+ if (query === void 0) return base;
1066
+ const params = [];
1067
+ for (const key of Object.keys(query)) {
1068
+ const value = query[key];
1069
+ if (value === void 0) continue;
1070
+ const values = typeof value === "object" ? value : [String(value)];
1071
+ for (const v of values) params.push(`${encodeURIComponent(key)}=${encodeURIComponent(v)}`);
1072
+ }
1073
+ return params.length === 0 ? base : `${base}?${params.join("&")}`;
1074
+ }
1075
+ function buildHeaders(input, auth) {
1076
+ const headers = {
1077
+ Accept: "application/json",
1078
+ Authorization: `Bearer ${authTokenFor(auth)}`
1079
+ };
1080
+ if (input.body !== void 0) {
1081
+ headers["Content-Type"] = "application/json; charset=utf-8";
1082
+ }
1083
+ if (input.idempotencyKey !== void 0 && MUTATING.has(input.method)) {
1084
+ headers["Idempotency-Key"] = input.idempotencyKey;
1085
+ }
1086
+ if (input.headers !== void 0) {
1087
+ for (const key of Object.keys(input.headers)) {
1088
+ headers[key] = input.headers[key];
1089
+ }
1090
+ }
1091
+ return headers;
1092
+ }
1093
+ function authTokenFor(auth) {
1094
+ if (auth.kind === "apiToken") return auth.token;
1095
+ return auth.accessToken;
1096
+ }
1097
+ function unwrapErrorEnvelope(body, status) {
1098
+ if (body !== null && typeof body === "object" && !Array.isArray(body)) {
1099
+ const inner = body.error;
1100
+ if (inner !== null && typeof inner === "object" && !Array.isArray(inner)) {
1101
+ return inner;
1102
+ }
1103
+ }
1104
+ return { code: "unknown", message: `HTTP ${status} without recognizable error envelope` };
1105
+ }
841
1106
 
842
1107
  // src/resources/artifacts.ts
1108
+ async function raw(transport, req) {
1109
+ const res = await transport.fetchImpl(`${transport.apiUrl}${req.path}`, {
1110
+ method: req.method,
1111
+ headers: { ...transport.authHeaders(), ...req.headers ?? {} },
1112
+ ...req.body !== void 0 && { body: req.body }
1113
+ });
1114
+ if (!res.ok) {
1115
+ const body = req.method === "HEAD" ? {
1116
+ error: {
1117
+ code: res.status === 404 ? "blob-not-found" : "unknown",
1118
+ message: res.status === 404 ? "No such artifact, or it's in a project you can't read" : `HTTP ${res.status}`
1119
+ }
1120
+ } : await res.json().catch(() => null);
1121
+ throw new KindgiApiError(fromWire(unwrapErrorEnvelope(body, res.status), res.status));
1122
+ }
1123
+ return res;
1124
+ }
1125
+ function headOf(blobId, res) {
1126
+ const name = res.headers.get("X-Kindgi-Blob-Name");
1127
+ return {
1128
+ blobId,
1129
+ name: name !== null ? decodeURIComponent(name) : "",
1130
+ contentType: res.headers.get("Content-Type") ?? "application/octet-stream",
1131
+ size: Number(res.headers.get("Content-Length") ?? "0"),
1132
+ hash: res.headers.get("X-Kindgi-Blob-Hash") ?? ""
1133
+ };
1134
+ }
1135
+ function uploadForm(input) {
1136
+ const contentType = input.contentType ?? (input.body instanceof Blob && input.body.type !== "" ? input.body.type : "application/octet-stream");
1137
+ const blob = input.body instanceof Blob ? input.body : new Blob([input.body], {
1138
+ type: contentType
1139
+ });
1140
+ const form = new FormData();
1141
+ form.set("file", blob, input.name ?? "file");
1142
+ form.set("contentType", contentType);
1143
+ if (input.name !== void 0) form.set("name", input.name);
1144
+ if (input.tags !== void 0) form.set("tags", JSON.stringify(input.tags));
1145
+ if (input.ownerRunId !== void 0) form.set("ownerRunId", input.ownerRunId);
1146
+ if (input.projectId !== void 0) form.set("projectId", input.projectId);
1147
+ if (input.expectedHash !== void 0) form.set("expectedHash", input.expectedHash);
1148
+ return form;
1149
+ }
843
1150
  function makeArtifactsClient(transport) {
844
1151
  return {
1152
+ async upload(input, options) {
1153
+ const res = await raw(transport, {
1154
+ method: "POST",
1155
+ path: "/v1/artifacts",
1156
+ body: uploadForm(input),
1157
+ ...options?.idempotencyKey !== void 0 && {
1158
+ headers: { "Idempotency-Key": options.idempotencyKey }
1159
+ }
1160
+ });
1161
+ return await res.json();
1162
+ },
1163
+ async download(blobId) {
1164
+ const res = await raw(transport, {
1165
+ method: "GET",
1166
+ path: `/v1/artifacts/${encodeURIComponent(blobId)}`
1167
+ });
1168
+ return {
1169
+ ...headOf(blobId, res),
1170
+ body: res.body ?? new Response("").body
1171
+ };
1172
+ },
1173
+ async head(blobId) {
1174
+ const res = await raw(transport, {
1175
+ method: "HEAD",
1176
+ path: `/v1/artifacts/${encodeURIComponent(blobId)}`
1177
+ });
1178
+ return headOf(blobId, res);
1179
+ },
845
1180
  async put(_input) {
846
1181
  throw new KindgiApiError(
847
1182
  notYetWired(
848
1183
  "artifacts.put",
849
- "POST /v1/artifacts is a multipart-form upload; the SDK transport is JSON-only. Multipart / raw-stream body support is a planned follow-up"
1184
+ "no route takes a content-addressed BlobRef: use artifacts.upload, which returns the artifact metadata"
850
1185
  )
851
1186
  );
852
1187
  },
@@ -854,7 +1189,7 @@ function makeArtifactsClient(transport) {
854
1189
  throw new KindgiApiError(
855
1190
  notYetWired(
856
1191
  "artifacts.get",
857
- "GET /v1/artifacts/{blobId} streams binary bytes; the SDK transport hydrates JSON only. Raw-stream response support is a planned follow-up"
1192
+ "no route takes a content-addressed BlobRef: use artifacts.download(blobId)"
858
1193
  )
859
1194
  );
860
1195
  },
@@ -868,7 +1203,8 @@ function makeArtifactsClient(transport) {
868
1203
  ...filter?.ownerRunId !== void 0 && {
869
1204
  ownerRunId: filter.ownerRunId
870
1205
  },
871
- ...filter?.contentType !== void 0 && { contentType: filter.contentType }
1206
+ ...filter?.contentType !== void 0 && { contentType: filter.contentType },
1207
+ ...filter?.projectId !== void 0 && { projectId: filter.projectId }
872
1208
  }
873
1209
  });
874
1210
  return listPage(page);
@@ -930,7 +1266,7 @@ function makeAuditClient(transport) {
930
1266
 
931
1267
  // src/resources/auth.ts
932
1268
  function makeAuthClient(transport) {
933
- const seg = (s) => encodeURIComponent(s);
1269
+ const seg2 = (s) => encodeURIComponent(s);
934
1270
  return {
935
1271
  providers: {
936
1272
  async list() {
@@ -951,15 +1287,43 @@ function makeAuthClient(transport) {
951
1287
  async unregister(providerId, options) {
952
1288
  return transport.request({
953
1289
  method: "POST",
954
- path: `/v1/auth/providers/${seg(providerId)}/unregister`,
1290
+ path: `/v1/auth/providers/${seg2(providerId)}/unregister`,
1291
+ ...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
1292
+ });
1293
+ },
1294
+ async get(providerId) {
1295
+ return transport.request({
1296
+ method: "GET",
1297
+ path: `/v1/auth/providers/${seg2(providerId)}`
1298
+ });
1299
+ },
1300
+ async signIn(providerId, input) {
1301
+ return transport.request({
1302
+ method: "GET",
1303
+ path: `/v1/auth/providers/${seg2(providerId)}/sign-in`,
1304
+ ...input?.kind !== void 0 && { query: { kind: input.kind } }
1305
+ });
1306
+ },
1307
+ async update(providerId, changes, options) {
1308
+ return transport.request({
1309
+ method: "PATCH",
1310
+ path: `/v1/auth/providers/${seg2(providerId)}`,
1311
+ body: changes,
955
1312
  ...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
956
1313
  });
957
1314
  }
958
1315
  },
1316
+ async signInOptions(input) {
1317
+ return transport.request({
1318
+ method: "GET",
1319
+ path: "/v1/auth/sign-in-options",
1320
+ ...input?.email !== void 0 && { query: { email: input.email } }
1321
+ });
1322
+ },
959
1323
  async login(providerId, input, options) {
960
1324
  return transport.request({
961
1325
  method: "POST",
962
- path: `/v1/auth/login/${seg(providerId)}`,
1326
+ path: `/v1/auth/login/${seg2(providerId)}`,
963
1327
  ...input !== void 0 && { body: input },
964
1328
  ...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
965
1329
  });
@@ -967,7 +1331,7 @@ function makeAuthClient(transport) {
967
1331
  async callback(providerId, input) {
968
1332
  return transport.request({
969
1333
  method: "POST",
970
- path: `/v1/auth/callback/${seg(providerId)}`,
1334
+ path: `/v1/auth/callback/${seg2(providerId)}`,
971
1335
  body: input
972
1336
  });
973
1337
  },
@@ -978,6 +1342,12 @@ function makeAuthClient(transport) {
978
1342
  ...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
979
1343
  });
980
1344
  },
1345
+ async tokenSignIn() {
1346
+ return transport.request({
1347
+ method: "POST",
1348
+ path: "/v1/auth/token-sign-in"
1349
+ });
1350
+ },
981
1351
  async logout(options) {
982
1352
  return transport.request({
983
1353
  method: "POST",
@@ -990,7 +1360,7 @@ function makeAuthClient(transport) {
990
1360
 
991
1361
  // src/resources/blocks.ts
992
1362
  function makeBlocksClient(transport) {
993
- const seg = (s) => encodeURIComponent(s);
1363
+ const seg2 = (s) => encodeURIComponent(s);
994
1364
  return {
995
1365
  async publish(input, options) {
996
1366
  return transport.request({
@@ -1014,13 +1384,13 @@ function makeBlocksClient(transport) {
1014
1384
  });
1015
1385
  },
1016
1386
  async get(blockId) {
1017
- return transport.request({ method: "GET", path: `/v1/blocks/${seg(blockId)}` });
1387
+ return transport.request({ method: "GET", path: `/v1/blocks/${seg2(blockId)}` });
1018
1388
  },
1019
1389
  versions: {
1020
1390
  async list(blockId, filter) {
1021
1391
  return transport.request({
1022
1392
  method: "GET",
1023
- path: `/v1/blocks/${seg(blockId)}/versions`,
1393
+ path: `/v1/blocks/${seg2(blockId)}/versions`,
1024
1394
  query: {
1025
1395
  ...filter?.limit !== void 0 && { limit: filter.limit },
1026
1396
  ...filter?.cursor !== void 0 && { cursor: filter.cursor },
@@ -1033,20 +1403,20 @@ function makeBlocksClient(transport) {
1033
1403
  async get(blockId, version) {
1034
1404
  return transport.request({
1035
1405
  method: "GET",
1036
- path: `/v1/blocks/${seg(blockId)}/versions/${seg(version)}`
1406
+ path: `/v1/blocks/${seg2(blockId)}/versions/${seg2(version)}`
1037
1407
  });
1038
1408
  },
1039
1409
  async unregister(blockId, version, options) {
1040
1410
  return transport.request({
1041
1411
  method: "POST",
1042
- path: `/v1/blocks/${seg(blockId)}/versions/${seg(version)}/unregister`,
1412
+ path: `/v1/blocks/${seg2(blockId)}/versions/${seg2(version)}/unregister`,
1043
1413
  ...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
1044
1414
  });
1045
1415
  },
1046
1416
  async reinstate(blockId, version, options) {
1047
1417
  return transport.request({
1048
1418
  method: "POST",
1049
- path: `/v1/blocks/${seg(blockId)}/versions/${seg(version)}/reinstate`,
1419
+ path: `/v1/blocks/${seg2(blockId)}/versions/${seg2(version)}/reinstate`,
1050
1420
  ...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
1051
1421
  });
1052
1422
  }
@@ -1182,7 +1552,8 @@ function makeComplianceClient(transport) {
1182
1552
  body: input,
1183
1553
  ...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
1184
1554
  });
1185
- }
1555
+ },
1556
+ verify: (bundle, publicKey) => verifySignedExport(bundle, { trustedKeys: [publicKey] })
1186
1557
  }
1187
1558
  };
1188
1559
  }
@@ -1240,6 +1611,16 @@ function makeConversationsClient(transport) {
1240
1611
  }
1241
1612
  });
1242
1613
  },
1614
+ async unregister(id, options) {
1615
+ return transport.request({
1616
+ method: "POST",
1617
+ path: `/v1/conversations/${encodeURIComponent(id)}/unregister`,
1618
+ body: {},
1619
+ ...options?.idempotencyKey !== void 0 && {
1620
+ idempotencyKey: options.idempotencyKey
1621
+ }
1622
+ });
1623
+ },
1243
1624
  async messages(id, filter) {
1244
1625
  const page = await transport.request({
1245
1626
  method: "GET",
@@ -1450,9 +1831,9 @@ function makeEnvClient(transport) {
1450
1831
  });
1451
1832
  return { kind: "ok", record };
1452
1833
  } catch (err) {
1453
- const conflict = tryReadRevisionConflict(err);
1454
- if (conflict !== null) {
1455
- return { kind: "revision-conflict", currentRevision: conflict };
1834
+ const conflict2 = tryReadRevisionConflict(err);
1835
+ if (conflict2 !== null) {
1836
+ return { kind: "revision-conflict", currentRevision: conflict2 };
1456
1837
  }
1457
1838
  throw err;
1458
1839
  }
@@ -1505,12 +1886,12 @@ function comparisonOf(run) {
1505
1886
  return run.kind === "judged" && result?.summary !== void 0 && Array.isArray(result.perCase) ? result : void 0;
1506
1887
  }
1507
1888
  function makeEvalRunsClient(transport) {
1508
- const seg = (s) => encodeURIComponent(s);
1889
+ const seg2 = (s) => encodeURIComponent(s);
1509
1890
  return {
1510
1891
  async start(suiteId, input, options) {
1511
1892
  return transport.request({
1512
1893
  method: "POST",
1513
- path: `/v1/eval-suites/${seg(suiteId)}/runs`,
1894
+ path: `/v1/eval-suites/${seg2(suiteId)}/runs`,
1514
1895
  body: { ...input, projectId: options.projectId },
1515
1896
  ...options.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
1516
1897
  });
@@ -1531,17 +1912,17 @@ function makeEvalRunsClient(transport) {
1531
1912
  async get(runId) {
1532
1913
  return transport.request({
1533
1914
  method: "GET",
1534
- path: `/v1/eval-runs/${seg(runId)}`
1915
+ path: `/v1/eval-runs/${seg2(runId)}`
1535
1916
  });
1536
1917
  },
1537
1918
  async cancel(runId) {
1538
1919
  return transport.request({
1539
1920
  method: "POST",
1540
- path: `/v1/eval-runs/${seg(runId)}/cancel`
1921
+ path: `/v1/eval-runs/${seg2(runId)}/cancel`
1541
1922
  });
1542
1923
  },
1543
1924
  events(runId, options) {
1544
- const url = `${transport.apiUrl}/v1/eval-runs/${seg(runId)}/events`;
1925
+ const url = `${transport.apiUrl}/v1/eval-runs/${seg2(runId)}/events`;
1545
1926
  const source = readSse({
1546
1927
  url,
1547
1928
  headers: transport.authHeaders(),
@@ -1561,7 +1942,7 @@ function makeEvalRunsClient(transport) {
1561
1942
 
1562
1943
  // src/resources/eval-suites.ts
1563
1944
  function makeEvalSuitesClient(transport) {
1564
- const seg = (s) => encodeURIComponent(s);
1945
+ const seg2 = (s) => encodeURIComponent(s);
1565
1946
  return {
1566
1947
  async publish(input, options) {
1567
1948
  return transport.request({
@@ -1589,13 +1970,13 @@ function makeEvalSuitesClient(transport) {
1589
1970
  async get(suiteId) {
1590
1971
  return transport.request({
1591
1972
  method: "GET",
1592
- path: `/v1/eval-suites/${seg(suiteId)}`
1973
+ path: `/v1/eval-suites/${seg2(suiteId)}`
1593
1974
  });
1594
1975
  },
1595
1976
  async buildFromJudgments(suiteId, input, options) {
1596
1977
  return transport.request({
1597
1978
  method: "POST",
1598
- path: `/v1/eval-suites/${seg(suiteId)}/versions/from-judgments`,
1979
+ path: `/v1/eval-suites/${seg2(suiteId)}/versions/from-judgments`,
1599
1980
  body: input,
1600
1981
  ...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
1601
1982
  });
@@ -1603,7 +1984,7 @@ function makeEvalSuitesClient(transport) {
1603
1984
  async listCases(suiteId, version, query) {
1604
1985
  return transport.request({
1605
1986
  method: "GET",
1606
- path: `/v1/eval-suites/${seg(suiteId)}/versions/${seg(version)}/cases`,
1987
+ path: `/v1/eval-suites/${seg2(suiteId)}/versions/${seg2(version)}/cases`,
1607
1988
  query: {
1608
1989
  ...query?.limit !== void 0 && { limit: query.limit },
1609
1990
  ...query?.cursor !== void 0 && { cursor: query.cursor }
@@ -1614,7 +1995,7 @@ function makeEvalSuitesClient(transport) {
1614
1995
  async list(suiteId, filter) {
1615
1996
  return transport.request({
1616
1997
  method: "GET",
1617
- path: `/v1/eval-suites/${seg(suiteId)}/versions`,
1998
+ path: `/v1/eval-suites/${seg2(suiteId)}/versions`,
1618
1999
  query: {
1619
2000
  ...filter?.limit !== void 0 && { limit: filter.limit },
1620
2001
  ...filter?.cursor !== void 0 && { cursor: filter.cursor }
@@ -1624,20 +2005,20 @@ function makeEvalSuitesClient(transport) {
1624
2005
  async get(suiteId, version) {
1625
2006
  return transport.request({
1626
2007
  method: "GET",
1627
- path: `/v1/eval-suites/${seg(suiteId)}/versions/${seg(version)}`
2008
+ path: `/v1/eval-suites/${seg2(suiteId)}/versions/${seg2(version)}`
1628
2009
  });
1629
2010
  },
1630
2011
  async unregister(suiteId, version, options) {
1631
2012
  return transport.request({
1632
2013
  method: "POST",
1633
- path: `/v1/eval-suites/${seg(suiteId)}/versions/${seg(version)}/unregister`,
2014
+ path: `/v1/eval-suites/${seg2(suiteId)}/versions/${seg2(version)}/unregister`,
1634
2015
  ...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
1635
2016
  });
1636
2017
  },
1637
2018
  async reinstate(suiteId, version, options) {
1638
2019
  return transport.request({
1639
2020
  method: "POST",
1640
- path: `/v1/eval-suites/${seg(suiteId)}/versions/${seg(version)}/reinstate`,
2021
+ path: `/v1/eval-suites/${seg2(suiteId)}/versions/${seg2(version)}/reinstate`,
1641
2022
  ...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
1642
2023
  });
1643
2024
  }
@@ -1760,7 +2141,7 @@ function makeEventsClient(_transport) {
1760
2141
  new KindgiApiError(
1761
2142
  notYetWired(
1762
2143
  "events.stream",
1763
- "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.stream(runId) for live run-scoped events."
2144
+ "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."
1764
2145
  )
1765
2146
  )
1766
2147
  );
@@ -1781,6 +2162,19 @@ function makeEventsClient(_transport) {
1781
2162
  };
1782
2163
  }
1783
2164
 
2165
+ // src/resources/export-signing-keys.ts
2166
+ function makeExportSigningKeysClient(transport) {
2167
+ return {
2168
+ async list() {
2169
+ const page = await transport.request({
2170
+ method: "GET",
2171
+ path: "/v1/export-signing-keys"
2172
+ });
2173
+ return page.data;
2174
+ }
2175
+ };
2176
+ }
2177
+
1784
2178
  // src/resources/flows.ts
1785
2179
  function makeFlowsClient(transport) {
1786
2180
  const list = async (id, filter) => {
@@ -1887,7 +2281,7 @@ function makeFlowsClient(transport) {
1887
2281
 
1888
2282
  // src/resources/gate-policies.ts
1889
2283
  function makeGatePoliciesClient(transport) {
1890
- const seg = (s) => encodeURIComponent(s);
2284
+ const seg2 = (s) => encodeURIComponent(s);
1891
2285
  return {
1892
2286
  async list(filter) {
1893
2287
  return transport.request({
@@ -1904,7 +2298,7 @@ function makeGatePoliciesClient(transport) {
1904
2298
  async get(policyId) {
1905
2299
  return transport.request({
1906
2300
  method: "GET",
1907
- path: `/v1/gate-policies/${seg(policyId)}`
2301
+ path: `/v1/gate-policies/${seg2(policyId)}`
1908
2302
  });
1909
2303
  },
1910
2304
  async publish(input, options) {
@@ -1919,25 +2313,25 @@ function makeGatePoliciesClient(transport) {
1919
2313
  async list(policyId) {
1920
2314
  return transport.request({
1921
2315
  method: "GET",
1922
- path: `/v1/gate-policies/${seg(policyId)}/versions`
2316
+ path: `/v1/gate-policies/${seg2(policyId)}/versions`
1923
2317
  });
1924
2318
  },
1925
2319
  async get(policyId, version) {
1926
2320
  return transport.request({
1927
2321
  method: "GET",
1928
- path: `/v1/gate-policies/${seg(policyId)}/versions/${seg(version)}`
2322
+ path: `/v1/gate-policies/${seg2(policyId)}/versions/${seg2(version)}`
1929
2323
  });
1930
2324
  },
1931
2325
  async unregister(policyId, version) {
1932
2326
  return transport.request({
1933
2327
  method: "POST",
1934
- path: `/v1/gate-policies/${seg(policyId)}/versions/${seg(version)}/unregister`
2328
+ path: `/v1/gate-policies/${seg2(policyId)}/versions/${seg2(version)}/unregister`
1935
2329
  });
1936
2330
  },
1937
2331
  async reinstate(policyId, version) {
1938
2332
  return transport.request({
1939
2333
  method: "POST",
1940
- path: `/v1/gate-policies/${seg(policyId)}/versions/${seg(version)}/reinstate`
2334
+ path: `/v1/gate-policies/${seg2(policyId)}/versions/${seg2(version)}/reinstate`
1941
2335
  });
1942
2336
  }
1943
2337
  }
@@ -2010,7 +2404,7 @@ function makeGuardrailsClient(transport) {
2010
2404
 
2011
2405
  // src/resources/identity.ts
2012
2406
  function makeIdentityClient(transport) {
2013
- const seg = (s) => encodeURIComponent(s);
2407
+ const seg2 = (s) => encodeURIComponent(s);
2014
2408
  return {
2015
2409
  async whoami() {
2016
2410
  return transport.request({
@@ -2033,19 +2427,19 @@ function makeIdentityClient(transport) {
2033
2427
  async get(userId) {
2034
2428
  return transport.request({
2035
2429
  method: "GET",
2036
- path: `/v1/identity/users/${seg(userId)}`
2430
+ path: `/v1/identity/users/${seg2(userId)}`
2037
2431
  });
2038
2432
  },
2039
2433
  async listSessions(userId) {
2040
2434
  return transport.request({
2041
2435
  method: "GET",
2042
- path: `/v1/identity/users/${seg(userId)}/sessions`
2436
+ path: `/v1/identity/users/${seg2(userId)}/sessions`
2043
2437
  });
2044
2438
  },
2045
2439
  async revokeSessions(userId, options) {
2046
2440
  return transport.request({
2047
2441
  method: "POST",
2048
- path: `/v1/identity/users/${seg(userId)}/revoke-sessions`,
2442
+ path: `/v1/identity/users/${seg2(userId)}/revoke-sessions`,
2049
2443
  ...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
2050
2444
  });
2051
2445
  }
@@ -2053,6 +2447,38 @@ function makeIdentityClient(transport) {
2053
2447
  };
2054
2448
  }
2055
2449
 
2450
+ // src/resources/improvement-passes.ts
2451
+ function makeImprovementPassesClient(transport) {
2452
+ return {
2453
+ async list(input = {}) {
2454
+ const page = await transport.request({
2455
+ method: "GET",
2456
+ path: "/v1/improvement-passes",
2457
+ query: {
2458
+ ...input.limit !== void 0 && { limit: input.limit },
2459
+ ...input.cursor !== void 0 && { cursor: input.cursor },
2460
+ ...input.agentId !== void 0 && { agentId: input.agentId }
2461
+ }
2462
+ });
2463
+ return listPage(page);
2464
+ },
2465
+ async get(passId) {
2466
+ return transport.request({
2467
+ method: "GET",
2468
+ path: `/v1/improvement-passes/${encodeURIComponent(passId)}`
2469
+ });
2470
+ },
2471
+ async cancel(passId, input = {}) {
2472
+ return transport.request({
2473
+ method: "POST",
2474
+ path: `/v1/improvement-passes/${encodeURIComponent(passId)}/cancel`,
2475
+ body: {},
2476
+ ...input.idempotencyKey !== void 0 && { idempotencyKey: input.idempotencyKey }
2477
+ });
2478
+ }
2479
+ };
2480
+ }
2481
+
2056
2482
  // src/resources/judge-classes.ts
2057
2483
  function scopeQuery2(scope) {
2058
2484
  if (scope.kind === "tenant") return { scopeKind: "tenant" };
@@ -2280,49 +2706,132 @@ function makeMcpClient(transport) {
2280
2706
  // src/resources/memory.ts
2281
2707
  function makeMemoryClient(transport) {
2282
2708
  return {
2283
- facts: {
2284
- async write(input, options) {
2709
+ erasures: {
2710
+ async create(selector, options) {
2285
2711
  return transport.request({
2286
2712
  method: "POST",
2287
- path: "/v1/memory/facts",
2288
- body: input,
2713
+ path: "/v1/memory/erasures",
2714
+ body: selector,
2289
2715
  ...options?.idempotencyKey !== void 0 && {
2290
2716
  idempotencyKey: options.idempotencyKey
2291
2717
  }
2292
2718
  });
2293
2719
  },
2294
- async read(id) {
2720
+ async get(id) {
2295
2721
  return transport.request({
2296
2722
  method: "GET",
2297
- path: `/v1/memory/facts/${encodeURIComponent(id)}`
2723
+ path: `/v1/memory/erasures/${encodeURIComponent(id)}`
2298
2724
  });
2299
2725
  },
2300
2726
  async list(filter) {
2301
2727
  const page = await transport.request({
2302
2728
  method: "GET",
2303
- path: "/v1/memory/facts",
2729
+ path: "/v1/memory/erasures",
2304
2730
  query: {
2305
2731
  ...filter?.limit !== void 0 && { limit: filter.limit },
2306
- ...filter?.cursor !== void 0 && { cursor: filter.cursor },
2307
- ...filter?.type !== void 0 && { type: filter.type },
2308
- ...filter?.scope !== void 0 && { scope: JSON.stringify(filter.scope) }
2732
+ ...filter?.cursor !== void 0 && { cursor: filter.cursor }
2309
2733
  }
2310
2734
  });
2311
2735
  return listPage(page);
2312
2736
  },
2313
- async delete(id, options) {
2737
+ async resume(id, options) {
2314
2738
  return transport.request({
2315
2739
  method: "POST",
2316
- path: `/v1/memory/facts/${encodeURIComponent(id)}/supersede`,
2317
- body: {},
2740
+ path: `/v1/memory/erasures/${encodeURIComponent(id)}/resume`,
2741
+ body: { ...options?.force === true && { force: true } }
2742
+ });
2743
+ },
2744
+ async export() {
2745
+ const ledger = await transport.request({ method: "GET", path: "/v1/memory/erasures/export" });
2746
+ return ledger.data;
2747
+ },
2748
+ async replay(erasures, options) {
2749
+ return transport.request({
2750
+ method: "POST",
2751
+ path: "/v1/memory/erasures/replay",
2752
+ body: { erasures },
2318
2753
  ...options?.idempotencyKey !== void 0 && {
2319
2754
  idempotencyKey: options.idempotencyKey
2320
2755
  }
2321
2756
  });
2322
2757
  }
2323
2758
  },
2324
- logs: {
2325
- async append(_input) {
2759
+ facts: {
2760
+ async write(input, options) {
2761
+ return transport.request({
2762
+ method: "POST",
2763
+ path: "/v1/memory/facts",
2764
+ body: input,
2765
+ ...options?.idempotencyKey !== void 0 && {
2766
+ idempotencyKey: options.idempotencyKey
2767
+ }
2768
+ });
2769
+ },
2770
+ async read(id, options) {
2771
+ return transport.request({
2772
+ method: "GET",
2773
+ path: `/v1/memory/facts/${encodeURIComponent(id)}`,
2774
+ query: {
2775
+ ...options?.version !== void 0 && { version: options.version },
2776
+ ...options?.asOf !== void 0 && { asOf: options.asOf }
2777
+ }
2778
+ });
2779
+ },
2780
+ async revisions(id) {
2781
+ const envelope = await transport.request({
2782
+ method: "GET",
2783
+ path: `/v1/memory/facts/${encodeURIComponent(id)}/revisions`
2784
+ });
2785
+ return envelope.data;
2786
+ },
2787
+ async list(filter) {
2788
+ const page = await transport.request({
2789
+ method: "GET",
2790
+ path: "/v1/memory/facts",
2791
+ query: {
2792
+ ...filter?.limit !== void 0 && { limit: filter.limit },
2793
+ ...filter?.cursor !== void 0 && { cursor: filter.cursor },
2794
+ ...filter?.type !== void 0 && { type: filter.type },
2795
+ ...filter?.scope !== void 0 && { scope: JSON.stringify(filter.scope) },
2796
+ ...filter?.asOf !== void 0 && { asOf: filter.asOf }
2797
+ }
2798
+ });
2799
+ return listPage(page);
2800
+ },
2801
+ async supersede(id, input, options) {
2802
+ return transport.request({
2803
+ method: "POST",
2804
+ path: `/v1/memory/facts/${encodeURIComponent(id)}/supersede`,
2805
+ body: input,
2806
+ ...options?.idempotencyKey !== void 0 && {
2807
+ idempotencyKey: options.idempotencyKey
2808
+ }
2809
+ });
2810
+ },
2811
+ async delete(id, options) {
2812
+ return transport.request({
2813
+ method: "DELETE",
2814
+ path: `/v1/memory/facts/${encodeURIComponent(id)}`,
2815
+ query: {
2816
+ ...options?.expectVersion !== void 0 && { expectVersion: options.expectVersion }
2817
+ }
2818
+ });
2819
+ },
2820
+ async verify(id, options) {
2821
+ return transport.request({
2822
+ method: "POST",
2823
+ path: `/v1/memory/facts/${encodeURIComponent(id)}/verify`,
2824
+ body: {
2825
+ ...options?.expectVersion !== void 0 && { expectVersion: options.expectVersion }
2826
+ },
2827
+ ...options?.idempotencyKey !== void 0 && {
2828
+ idempotencyKey: options.idempotencyKey
2829
+ }
2830
+ });
2831
+ }
2832
+ },
2833
+ logs: {
2834
+ async append(_input) {
2326
2835
  throw new KindgiApiError(
2327
2836
  notYetWired(
2328
2837
  "memory.logs.append",
@@ -2404,7 +2913,7 @@ function makeObservationsClient(transport) {
2404
2913
 
2405
2914
  // src/resources/orgs.ts
2406
2915
  function makeOrgsClient(transport) {
2407
- const seg = (s) => encodeURIComponent(s);
2916
+ const seg2 = (s) => encodeURIComponent(s);
2408
2917
  return {
2409
2918
  async create(input, options) {
2410
2919
  return transport.request({
@@ -2427,13 +2936,13 @@ function makeOrgsClient(transport) {
2427
2936
  async get(orgId) {
2428
2937
  return transport.request({
2429
2938
  method: "GET",
2430
- path: `/v1/orgs/${seg(orgId)}`
2939
+ path: `/v1/orgs/${seg2(orgId)}`
2431
2940
  });
2432
2941
  },
2433
2942
  async update(orgId, input, options) {
2434
2943
  return transport.request({
2435
2944
  method: "PATCH",
2436
- path: `/v1/orgs/${seg(orgId)}`,
2945
+ path: `/v1/orgs/${seg2(orgId)}`,
2437
2946
  body: input,
2438
2947
  ...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
2439
2948
  });
@@ -2441,7 +2950,7 @@ function makeOrgsClient(transport) {
2441
2950
  async delete(orgId) {
2442
2951
  return transport.request({
2443
2952
  method: "DELETE",
2444
- path: `/v1/orgs/${seg(orgId)}`,
2953
+ path: `/v1/orgs/${seg2(orgId)}`,
2445
2954
  discardResponse: true
2446
2955
  });
2447
2956
  }
@@ -2608,7 +3117,7 @@ function makePoliciesClient(transport) {
2608
3117
 
2609
3118
  // src/resources/projects.ts
2610
3119
  function makeProjectsClient(transport) {
2611
- const seg = (s) => encodeURIComponent(s);
3120
+ const seg2 = (s) => encodeURIComponent(s);
2612
3121
  return {
2613
3122
  async create(input, options) {
2614
3123
  return transport.request({
@@ -2637,13 +3146,13 @@ function makeProjectsClient(transport) {
2637
3146
  async get(projectId) {
2638
3147
  return transport.request({
2639
3148
  method: "GET",
2640
- path: `/v1/projects/${seg(projectId)}`
3149
+ path: `/v1/projects/${seg2(projectId)}`
2641
3150
  });
2642
3151
  },
2643
3152
  async update(projectId, input, options) {
2644
3153
  return transport.request({
2645
3154
  method: "PATCH",
2646
- path: `/v1/projects/${seg(projectId)}`,
3155
+ path: `/v1/projects/${seg2(projectId)}`,
2647
3156
  body: input,
2648
3157
  ...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
2649
3158
  });
@@ -2651,7 +3160,7 @@ function makeProjectsClient(transport) {
2651
3160
  async delete(projectId) {
2652
3161
  return transport.request({
2653
3162
  method: "DELETE",
2654
- path: `/v1/projects/${seg(projectId)}`,
3163
+ path: `/v1/projects/${seg2(projectId)}`,
2655
3164
  discardResponse: true
2656
3165
  });
2657
3166
  },
@@ -2659,7 +3168,7 @@ function makeProjectsClient(transport) {
2659
3168
  async list(projectId, filter) {
2660
3169
  return transport.request({
2661
3170
  method: "GET",
2662
- path: `/v1/projects/${seg(projectId)}/memberships`,
3171
+ path: `/v1/projects/${seg2(projectId)}/memberships`,
2663
3172
  query: {
2664
3173
  ...filter?.limit !== void 0 && { limit: filter.limit },
2665
3174
  ...filter?.cursor !== void 0 && { cursor: filter.cursor }
@@ -2669,7 +3178,7 @@ function makeProjectsClient(transport) {
2669
3178
  async add(projectId, input, options) {
2670
3179
  return transport.request({
2671
3180
  method: "POST",
2672
- path: `/v1/projects/${seg(projectId)}/memberships`,
3181
+ path: `/v1/projects/${seg2(projectId)}/memberships`,
2673
3182
  body: input,
2674
3183
  ...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
2675
3184
  });
@@ -2677,7 +3186,7 @@ function makeProjectsClient(transport) {
2677
3186
  async updateRole(projectId, userId, role, options) {
2678
3187
  return transport.request({
2679
3188
  method: "PATCH",
2680
- path: `/v1/projects/${seg(projectId)}/memberships/${seg(userId)}`,
3189
+ path: `/v1/projects/${seg2(projectId)}/memberships/${seg2(userId)}`,
2681
3190
  body: { role },
2682
3191
  discardResponse: true,
2683
3192
  ...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
@@ -2686,7 +3195,7 @@ function makeProjectsClient(transport) {
2686
3195
  async remove(projectId, userId, options) {
2687
3196
  return transport.request({
2688
3197
  method: "DELETE",
2689
- path: `/v1/projects/${seg(projectId)}/memberships/${seg(userId)}`,
3198
+ path: `/v1/projects/${seg2(projectId)}/memberships/${seg2(userId)}`,
2690
3199
  discardResponse: true,
2691
3200
  ...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
2692
3201
  });
@@ -2695,6 +3204,71 @@ function makeProjectsClient(transport) {
2695
3204
  };
2696
3205
  }
2697
3206
 
3207
+ // src/resources/proposals.ts
3208
+ var seg = (id) => encodeURIComponent(id);
3209
+ function makeProposalsClient(transport) {
3210
+ const post = (req) => transport.request({
3211
+ method: "POST",
3212
+ path: req.path,
3213
+ body: req.body,
3214
+ ...req.idempotencyKey !== void 0 && { idempotencyKey: req.idempotencyKey }
3215
+ });
3216
+ return {
3217
+ async list(input = {}) {
3218
+ const page = await transport.request({
3219
+ method: "GET",
3220
+ path: "/v1/proposals",
3221
+ query: {
3222
+ ...input.limit !== void 0 && { limit: input.limit },
3223
+ ...input.cursor !== void 0 && { cursor: input.cursor },
3224
+ ...input.agentId !== void 0 && { agentId: input.agentId },
3225
+ ...input.tier !== void 0 && { tier: input.tier },
3226
+ ...input.status !== void 0 && { status: input.status },
3227
+ ...input.scope !== void 0 && scopeQuery(input.scope)
3228
+ }
3229
+ });
3230
+ return listPage(page);
3231
+ },
3232
+ async get(id) {
3233
+ return transport.request({ method: "GET", path: `/v1/proposals/${seg(id)}` });
3234
+ },
3235
+ async create(input) {
3236
+ const { idempotencyKey, ...body } = input;
3237
+ return transport.request({
3238
+ method: "POST",
3239
+ path: "/v1/proposals",
3240
+ body,
3241
+ ...idempotencyKey !== void 0 && { idempotencyKey }
3242
+ });
3243
+ },
3244
+ async evaluate(id, input) {
3245
+ const { idempotencyKey, ...body } = input;
3246
+ return post({ path: `/v1/proposals/${seg(id)}/evaluate`, body, idempotencyKey });
3247
+ },
3248
+ async request(id, input = {}) {
3249
+ const { idempotencyKey, ...body } = input;
3250
+ return post({ path: `/v1/proposals/${seg(id)}/request`, body, idempotencyKey });
3251
+ },
3252
+ async rollback(id, input = {}) {
3253
+ const { idempotencyKey, ...body } = input;
3254
+ return post({ path: `/v1/proposals/${seg(id)}/rollback`, body, idempotencyKey });
3255
+ },
3256
+ async withdraw(id, input) {
3257
+ const { idempotencyKey, ...body } = input;
3258
+ return post({ path: `/v1/proposals/${seg(id)}/withdraw`, body, idempotencyKey });
3259
+ },
3260
+ async improve(input) {
3261
+ const { idempotencyKey, ...body } = input;
3262
+ return transport.request({
3263
+ method: "POST",
3264
+ path: "/v1/proposals/improve",
3265
+ body,
3266
+ ...idempotencyKey !== void 0 && { idempotencyKey }
3267
+ });
3268
+ }
3269
+ };
3270
+ }
3271
+
2698
3272
  // src/resources/provenance.ts
2699
3273
  function makeProvenanceClient(transport) {
2700
3274
  return {
@@ -2728,26 +3302,22 @@ function makeProvenanceClient(transport) {
2728
3302
  method: "POST",
2729
3303
  path: `/v1/provenance/${encodeURIComponent(input.runId)}/export`,
2730
3304
  body: {
2731
- signingKeyId: input.signingKeyId,
3305
+ ...input.signingKeyId !== void 0 && { signingKeyId: input.signingKeyId },
2732
3306
  ...input.includeMessages !== void 0 && { includeMessages: input.includeMessages }
2733
3307
  },
2734
3308
  ...input.idempotencyKey !== void 0 && { idempotencyKey: input.idempotencyKey }
2735
3309
  });
2736
3310
  },
2737
- async verify(_exported, _publicKey) {
2738
- throw new KindgiApiError(
2739
- notYetWired(
2740
- "provenance.verify",
2741
- "client-side ed25519 verification requires the crypto module subpackage to be reachable from the SDK"
2742
- )
2743
- );
3311
+ async verify(exported, publicKey) {
3312
+ const checked = await verifySignedExport(exported, { trustedKeys: [publicKey] });
3313
+ return checked.valid ? { valid: true } : { valid: false, issues: checked.issues ?? [] };
2744
3314
  }
2745
3315
  };
2746
3316
  }
2747
3317
 
2748
3318
  // src/resources/providers.ts
2749
3319
  function makeProvidersClient(transport) {
2750
- const seg = (s) => encodeURIComponent(s);
3320
+ const seg2 = (s) => encodeURIComponent(s);
2751
3321
  return {
2752
3322
  async register(input, options) {
2753
3323
  return transport.request({
@@ -2771,19 +3341,25 @@ function makeProvidersClient(transport) {
2771
3341
  async get(providerId) {
2772
3342
  return transport.request({
2773
3343
  method: "GET",
2774
- path: `/v1/providers/${seg(providerId)}`
3344
+ path: `/v1/providers/${seg2(providerId)}`
2775
3345
  });
2776
3346
  },
2777
3347
  async capabilities(providerId) {
2778
3348
  return transport.request({
2779
3349
  method: "GET",
2780
- path: `/v1/providers/${seg(providerId)}/capabilities`
3350
+ path: `/v1/providers/${seg2(providerId)}/capabilities`
3351
+ });
3352
+ },
3353
+ async check(providerId) {
3354
+ return transport.request({
3355
+ method: "GET",
3356
+ path: `/v1/providers/${seg2(providerId)}/check`
2781
3357
  });
2782
3358
  },
2783
3359
  async unregister(providerId, options) {
2784
3360
  return transport.request({
2785
3361
  method: "POST",
2786
- path: `/v1/providers/${seg(providerId)}/unregister`,
3362
+ path: `/v1/providers/${seg2(providerId)}/unregister`,
2787
3363
  ...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
2788
3364
  });
2789
3365
  }
@@ -2895,7 +3471,42 @@ function subscribeToRun(options) {
2895
3471
  }
2896
3472
 
2897
3473
  // src/resources/runs.ts
3474
+ function waitedStartTimeout(e) {
3475
+ if (!(e instanceof KindgiApiError) || e.error.code !== "network") return e;
3476
+ const { timeoutMs } = e.error;
3477
+ if (timeoutMs === void 0) return e;
3478
+ return new KindgiApiError({
3479
+ code: "network",
3480
+ message: `The run didn't end within ${seconds(timeoutMs)}, the client's timeout (timeoutMs). A waited start answers only when the run ends, so the run may still be going, and its id didn't arrive. Start a run that can take longer with \`options: { wait: false }\`: the answer carries its id at once. Then follow it with \`runs.stream(runId)\` or \`runs.get(runId)\`. Or raise \`timeoutMs\`.`,
3481
+ cause: e.error.cause,
3482
+ timeoutMs
3483
+ });
3484
+ }
2898
3485
  function makeRunsClient(transport) {
3486
+ const followEvents = (runId, options) => followRun({
3487
+ url: `${transport.apiUrl}/v1/runs/${encodeURIComponent(runId)}/stream`,
3488
+ headers: () => transport.authHeaders(),
3489
+ fetchImpl: transport.fetchImpl,
3490
+ ...options?.signal !== void 0 && { signal: options.signal },
3491
+ ...options?.initialBackoffMs !== void 0 && {
3492
+ initialBackoffMs: options.initialBackoffMs
3493
+ },
3494
+ ...options?.maxBackoffMs !== void 0 && {
3495
+ maxBackoffMs: options.maxBackoffMs
3496
+ }
3497
+ });
3498
+ const followProgressEvents = (runId, options) => followRun({
3499
+ url: `${transport.apiUrl}/v1/runs/${encodeURIComponent(runId)}/progress/stream`,
3500
+ headers: () => transport.authHeaders(),
3501
+ fetchImpl: transport.fetchImpl,
3502
+ ...options?.signal !== void 0 && { signal: options.signal },
3503
+ ...options?.initialBackoffMs !== void 0 && {
3504
+ initialBackoffMs: options.initialBackoffMs
3505
+ },
3506
+ ...options?.maxBackoffMs !== void 0 && {
3507
+ maxBackoffMs: options.maxBackoffMs
3508
+ }
3509
+ });
2899
3510
  return {
2900
3511
  async start(input) {
2901
3512
  const body = "agent" in input ? {
@@ -2913,14 +3524,19 @@ function makeRunsClient(transport) {
2913
3524
  input: input.input,
2914
3525
  ...input.options !== void 0 && { options: input.options }
2915
3526
  };
2916
- return transport.request({
2917
- method: "POST",
2918
- path: "/v1/runs",
2919
- body,
2920
- ...input.idempotencyKey !== void 0 && {
2921
- idempotencyKey: input.idempotencyKey
2922
- }
2923
- });
3527
+ try {
3528
+ return await transport.request({
3529
+ method: "POST",
3530
+ path: "/v1/runs",
3531
+ body,
3532
+ ...input.idempotencyKey !== void 0 && {
3533
+ idempotencyKey: input.idempotencyKey
3534
+ },
3535
+ ...input.timeoutMs !== void 0 && { timeoutMs: input.timeoutMs }
3536
+ });
3537
+ } catch (e) {
3538
+ throw input.options?.wait === false ? e : waitedStartTimeout(e);
3539
+ }
2924
3540
  },
2925
3541
  async dryRun(_input) {
2926
3542
  throw new KindgiApiError(
@@ -2936,34 +3552,10 @@ function makeRunsClient(transport) {
2936
3552
  path: `/v1/runs/${encodeURIComponent(runId)}/progress`
2937
3553
  });
2938
3554
  },
2939
- streamProgress(runId, options) {
2940
- return followRun({
2941
- url: `${transport.apiUrl}/v1/runs/${encodeURIComponent(runId)}/progress/stream`,
2942
- headers: () => transport.authHeaders(),
2943
- fetchImpl: transport.fetchImpl,
2944
- ...options?.signal !== void 0 && { signal: options.signal },
2945
- ...options?.initialBackoffMs !== void 0 && {
2946
- initialBackoffMs: options.initialBackoffMs
2947
- },
2948
- ...options?.maxBackoffMs !== void 0 && {
2949
- maxBackoffMs: options.maxBackoffMs
2950
- }
2951
- });
2952
- },
2953
- stream(runId, options) {
2954
- return followRun({
2955
- url: `${transport.apiUrl}/v1/runs/${encodeURIComponent(runId)}/stream`,
2956
- headers: () => transport.authHeaders(),
2957
- fetchImpl: transport.fetchImpl,
2958
- ...options?.signal !== void 0 && { signal: options.signal },
2959
- ...options?.initialBackoffMs !== void 0 && {
2960
- initialBackoffMs: options.initialBackoffMs
2961
- },
2962
- ...options?.maxBackoffMs !== void 0 && {
2963
- maxBackoffMs: options.maxBackoffMs
2964
- }
2965
- });
2966
- },
3555
+ followProgress: followProgressEvents,
3556
+ follow: followEvents,
3557
+ streamProgress: followProgressEvents,
3558
+ stream: followEvents,
2967
3559
  async get(runId) {
2968
3560
  return transport.request({
2969
3561
  method: "GET",
@@ -3008,6 +3600,7 @@ function makeRunsClient(transport) {
3008
3600
  ...filter?.agentId !== void 0 && { agentId: filter.agentId },
3009
3601
  ...filter?.replays !== void 0 && { replays: filter.replays },
3010
3602
  ...filter?.evalRunId !== void 0 && { evalRunId: filter.evalRunId },
3603
+ ...filter?.triggerId !== void 0 && { triggerId: filter.triggerId },
3011
3604
  ...filter?.includeOutput === true && { include: "output" }
3012
3605
  }
3013
3606
  });
@@ -3048,10 +3641,11 @@ function makeSchedulesClient(transport) {
3048
3641
  }
3049
3642
  });
3050
3643
  },
3051
- async get(triggerId) {
3644
+ async get(triggerId, options) {
3052
3645
  return transport.request({
3053
3646
  method: "GET",
3054
- path: `/v1/schedules/${encodeURIComponent(triggerId)}`
3647
+ path: `/v1/schedules/${encodeURIComponent(triggerId)}`,
3648
+ ...options?.upcoming !== void 0 && { query: { upcoming: options.upcoming } }
3055
3649
  });
3056
3650
  },
3057
3651
  async update(triggerId, input, options) {
@@ -3082,6 +3676,30 @@ function makeSchedulesClient(transport) {
3082
3676
  path: `/v1/schedules/${encodeURIComponent(triggerId)}/unregister`,
3083
3677
  ...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
3084
3678
  });
3679
+ },
3680
+ async fires(triggerId, filter) {
3681
+ return transport.request({
3682
+ method: "GET",
3683
+ path: `/v1/schedules/${encodeURIComponent(triggerId)}/fires`,
3684
+ query: {
3685
+ ...filter?.limit !== void 0 && { limit: filter.limit },
3686
+ ...filter?.cursor !== void 0 && { cursor: filter.cursor }
3687
+ }
3688
+ });
3689
+ },
3690
+ async runNow(triggerId, options) {
3691
+ return transport.request({
3692
+ method: "POST",
3693
+ path: `/v1/schedules/${encodeURIComponent(triggerId)}/run-now`,
3694
+ ...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
3695
+ });
3696
+ },
3697
+ async takeOwnership(triggerId, options) {
3698
+ return transport.request({
3699
+ method: "POST",
3700
+ path: `/v1/schedules/${encodeURIComponent(triggerId)}/owner`,
3701
+ ...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
3702
+ });
3085
3703
  }
3086
3704
  };
3087
3705
  }
@@ -3243,8 +3861,8 @@ function makeSecretsClient(transport) {
3243
3861
  });
3244
3862
  return { kind: "ok", record: ok.record, versionId: ok.versionId };
3245
3863
  } catch (err) {
3246
- const conflict = tryReadVersionConflict(err);
3247
- if (conflict !== null) return conflict;
3864
+ const conflict2 = tryReadVersionConflict(err);
3865
+ if (conflict2 !== null) return conflict2;
3248
3866
  throw err;
3249
3867
  }
3250
3868
  },
@@ -3364,6 +3982,63 @@ function tryReadVersionConflict(err) {
3364
3982
  return { kind: "version-conflict", currentVersion: current };
3365
3983
  }
3366
3984
 
3985
+ // src/resources/service-accounts.ts
3986
+ function makeServiceAccountsClient(transport) {
3987
+ const withKey = (options) => options?.idempotencyKey !== void 0 ? { idempotencyKey: options.idempotencyKey } : {};
3988
+ return {
3989
+ async create(input, options) {
3990
+ return transport.request({
3991
+ method: "POST",
3992
+ path: "/v1/service-accounts",
3993
+ body: input,
3994
+ ...withKey(options)
3995
+ });
3996
+ },
3997
+ async list(filter) {
3998
+ const page = await transport.request({
3999
+ method: "GET",
4000
+ path: "/v1/service-accounts",
4001
+ query: {
4002
+ ...filter?.limit !== void 0 && { limit: filter.limit },
4003
+ ...filter?.cursor !== void 0 && { cursor: filter.cursor },
4004
+ ...filter?.includeUnregistered === true && { includeUnregistered: "true" }
4005
+ }
4006
+ });
4007
+ return listPage(page);
4008
+ },
4009
+ async get(serviceAccountId) {
4010
+ return transport.request({
4011
+ method: "GET",
4012
+ path: `/v1/service-accounts/${encodeURIComponent(serviceAccountId)}`
4013
+ });
4014
+ },
4015
+ async grant(serviceAccountId, grant, options) {
4016
+ return transport.request({
4017
+ method: "POST",
4018
+ path: `/v1/service-accounts/${encodeURIComponent(serviceAccountId)}/grant`,
4019
+ body: grant,
4020
+ ...withKey(options)
4021
+ });
4022
+ },
4023
+ async ungrant(serviceAccountId, grant, options) {
4024
+ return transport.request({
4025
+ method: "POST",
4026
+ path: `/v1/service-accounts/${encodeURIComponent(serviceAccountId)}/ungrant`,
4027
+ body: grant,
4028
+ ...withKey(options)
4029
+ });
4030
+ },
4031
+ async unregister(serviceAccountId, options) {
4032
+ return transport.request({
4033
+ method: "POST",
4034
+ path: `/v1/service-accounts/${encodeURIComponent(serviceAccountId)}/unregister`,
4035
+ body: {},
4036
+ ...withKey(options)
4037
+ });
4038
+ }
4039
+ };
4040
+ }
4041
+
3367
4042
  // src/resources/signing-keys.ts
3368
4043
  function makeSigningKeysClient(transport) {
3369
4044
  return {
@@ -3406,10 +4081,17 @@ function makeSigningKeysClient(transport) {
3406
4081
 
3407
4082
  // src/resources/supervisor.ts
3408
4083
  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)";
3409
- function makeSupervisorClient(transport) {
3410
- const supervisorHeader = (supervisorId) => ({
3411
- "X-Supervisor-Id": supervisorId
3412
- });
4084
+ function removed(method, replacement) {
4085
+ return async () => {
4086
+ throw new KindgiApiError(
4087
+ notYetWired(
4088
+ `supervisor.proposals.${method}`,
4089
+ `removed in 0.1.5: proposals now change data blocks; use client.proposals.${replacement} (see client.proposals.create, evaluate and request)`
4090
+ )
4091
+ );
4092
+ };
4093
+ }
4094
+ function makeSupervisorClient(_transport) {
3413
4095
  return {
3414
4096
  async define(_spec) {
3415
4097
  throw new KindgiApiError(notYetWired("supervisor.define", REASON_NO_SUPERVISOR_CRUD));
@@ -3427,114 +4109,22 @@ function makeSupervisorClient(transport) {
3427
4109
  throw new KindgiApiError(notYetWired("supervisor.delete", REASON_NO_SUPERVISOR_CRUD));
3428
4110
  },
3429
4111
  proposals: {
3430
- async draft(input) {
3431
- return transport.request({
3432
- method: "POST",
3433
- path: "/v1/proposals",
3434
- headers: supervisorHeader(input.supervisorId),
3435
- body: {
3436
- agentId: input.agentId,
3437
- agentVersion: input.agentVersion,
3438
- tier: input.tier,
3439
- change: input.change,
3440
- patternRefs: input.patternRefs,
3441
- hypothesis: input.hypothesis,
3442
- proposerRuleId: input.proposerRuleId
3443
- },
3444
- ...input.idempotencyKey !== void 0 && { idempotencyKey: input.idempotencyKey }
3445
- });
3446
- },
3447
- async list(input) {
3448
- const page = await transport.request({
3449
- method: "GET",
3450
- path: "/v1/proposals",
3451
- headers: supervisorHeader(input.supervisorId),
3452
- query: {
3453
- ...input.limit !== void 0 && { limit: input.limit },
3454
- ...input.cursor !== void 0 && { cursor: input.cursor },
3455
- ...input.status !== void 0 && { status: input.status },
3456
- ...input.agentId !== void 0 && { agentId: input.agentId },
3457
- ...input.tier !== void 0 && { tier: input.tier }
3458
- }
3459
- });
3460
- return listPage(page);
3461
- },
3462
- async get(supervisorId, id) {
3463
- return transport.request({
3464
- method: "GET",
3465
- path: `/v1/proposals/${encodeURIComponent(id)}`,
3466
- headers: supervisorHeader(supervisorId)
3467
- });
3468
- },
3469
- async dryRun(supervisorId, id, input) {
3470
- return transport.request({
3471
- method: "POST",
3472
- path: `/v1/proposals/${encodeURIComponent(id)}/dry-run`,
3473
- headers: supervisorHeader(supervisorId),
3474
- body: {
3475
- datasetId: input.datasetId,
3476
- datasetVersion: input.datasetVersion,
3477
- criterion: input.criterion
3478
- },
3479
- ...input.idempotencyKey !== void 0 && { idempotencyKey: input.idempotencyKey }
3480
- });
3481
- },
3482
- async submitForReview(supervisorId, id, input) {
3483
- const body = {};
3484
- if (input?.requiredRole !== void 0) body.requiredRole = input.requiredRole;
3485
- if (input?.expiresAt !== void 0) body.expiresAt = input.expiresAt;
3486
- return transport.request({
3487
- method: "POST",
3488
- path: `/v1/proposals/${encodeURIComponent(id)}/submit-review`,
3489
- headers: supervisorHeader(supervisorId),
3490
- body,
3491
- ...input?.idempotencyKey !== void 0 && { idempotencyKey: input.idempotencyKey }
3492
- });
3493
- },
3494
- async reflectReview(_supervisorId, _id, _input) {
3495
- throw new KindgiApiError(
3496
- notYetWired(
3497
- "supervisor.proposals.reflectReview",
3498
- "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)"
3499
- )
3500
- );
3501
- },
3502
- async apply(supervisorId, id, input) {
3503
- const body = {};
3504
- if (input?.newVersion !== void 0) body.newVersion = input.newVersion;
3505
- return transport.request({
3506
- method: "POST",
3507
- path: `/v1/proposals/${encodeURIComponent(id)}/apply`,
3508
- headers: supervisorHeader(supervisorId),
3509
- body,
3510
- ...input?.idempotencyKey !== void 0 && { idempotencyKey: input.idempotencyKey }
3511
- });
3512
- },
3513
- async rollback(supervisorId, id, input) {
3514
- return transport.request({
3515
- method: "POST",
3516
- path: `/v1/proposals/${encodeURIComponent(id)}/rollback`,
3517
- headers: supervisorHeader(supervisorId),
3518
- body: { reason: input.reason },
3519
- ...input.idempotencyKey !== void 0 && { idempotencyKey: input.idempotencyKey }
3520
- });
3521
- },
3522
- async withdraw(supervisorId, id, input) {
3523
- return transport.request({
3524
- method: "POST",
3525
- path: `/v1/proposals/${encodeURIComponent(id)}/withdraw`,
3526
- headers: supervisorHeader(supervisorId),
3527
- body: { reason: input.reason },
3528
- ...input.idempotencyKey !== void 0 && { idempotencyKey: input.idempotencyKey }
3529
- });
3530
- }
4112
+ draft: removed("draft", "create"),
4113
+ list: removed("list", "list"),
4114
+ get: removed("get", "get"),
4115
+ dryRun: removed("dryRun", "evaluate"),
4116
+ submitForReview: removed("submitForReview", "request"),
4117
+ reflectReview: removed("reflectReview", "request"),
4118
+ apply: removed("apply", "request"),
4119
+ rollback: removed("rollback", "rollback"),
4120
+ withdraw: removed("withdraw", "withdraw")
3531
4121
  }
3532
4122
  };
3533
4123
  }
3534
4124
 
3535
4125
  // src/resources/teams.ts
3536
4126
  function makeTeamsClient(transport) {
3537
- const seg = (s) => encodeURIComponent(s);
4127
+ const seg2 = (s) => encodeURIComponent(s);
3538
4128
  return {
3539
4129
  async create(input, options) {
3540
4130
  return transport.request({
@@ -3557,13 +4147,13 @@ function makeTeamsClient(transport) {
3557
4147
  async get(teamId) {
3558
4148
  return transport.request({
3559
4149
  method: "GET",
3560
- path: `/v1/teams/${seg(teamId)}`
4150
+ path: `/v1/teams/${seg2(teamId)}`
3561
4151
  });
3562
4152
  },
3563
4153
  async update(teamId, input, options) {
3564
4154
  return transport.request({
3565
4155
  method: "PATCH",
3566
- path: `/v1/teams/${seg(teamId)}`,
4156
+ path: `/v1/teams/${seg2(teamId)}`,
3567
4157
  body: input,
3568
4158
  ...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
3569
4159
  });
@@ -3571,7 +4161,7 @@ function makeTeamsClient(transport) {
3571
4161
  async delete(teamId) {
3572
4162
  return transport.request({
3573
4163
  method: "DELETE",
3574
- path: `/v1/teams/${seg(teamId)}`,
4164
+ path: `/v1/teams/${seg2(teamId)}`,
3575
4165
  discardResponse: true
3576
4166
  });
3577
4167
  },
@@ -3579,7 +4169,7 @@ function makeTeamsClient(transport) {
3579
4169
  async list(teamId, filter) {
3580
4170
  return transport.request({
3581
4171
  method: "GET",
3582
- path: `/v1/teams/${seg(teamId)}/memberships`,
4172
+ path: `/v1/teams/${seg2(teamId)}/memberships`,
3583
4173
  query: {
3584
4174
  ...filter?.limit !== void 0 && { limit: filter.limit },
3585
4175
  ...filter?.cursor !== void 0 && { cursor: filter.cursor }
@@ -3589,7 +4179,7 @@ function makeTeamsClient(transport) {
3589
4179
  async add(teamId, input, options) {
3590
4180
  return transport.request({
3591
4181
  method: "POST",
3592
- path: `/v1/teams/${seg(teamId)}/memberships`,
4182
+ path: `/v1/teams/${seg2(teamId)}/memberships`,
3593
4183
  body: input,
3594
4184
  ...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
3595
4185
  });
@@ -3597,7 +4187,7 @@ function makeTeamsClient(transport) {
3597
4187
  async updateRole(teamId, userId, role, options) {
3598
4188
  return transport.request({
3599
4189
  method: "PATCH",
3600
- path: `/v1/teams/${seg(teamId)}/memberships/${seg(userId)}`,
4190
+ path: `/v1/teams/${seg2(teamId)}/memberships/${seg2(userId)}`,
3601
4191
  body: { role },
3602
4192
  discardResponse: true,
3603
4193
  ...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
@@ -3606,7 +4196,7 @@ function makeTeamsClient(transport) {
3606
4196
  async remove(teamId, userId, options) {
3607
4197
  return transport.request({
3608
4198
  method: "DELETE",
3609
- path: `/v1/teams/${seg(teamId)}/memberships/${seg(userId)}`,
4199
+ path: `/v1/teams/${seg2(teamId)}/memberships/${seg2(userId)}`,
3610
4200
  discardResponse: true,
3611
4201
  ...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
3612
4202
  });
@@ -3653,6 +4243,7 @@ function makeTenantClient(transport) {
3653
4243
  function fromWire2(wire) {
3654
4244
  return {
3655
4245
  id: wire.tokenId,
4246
+ ...wire.principal !== void 0 && { principal: wire.principal },
3656
4247
  role: wire.role,
3657
4248
  capabilities: wire.capabilities,
3658
4249
  ...wire.label !== void 0 && { label: wire.label },
@@ -3670,6 +4261,7 @@ function makeTokensClient(transport) {
3670
4261
  return {
3671
4262
  async create(spec, options) {
3672
4263
  const body = {};
4264
+ if (spec?.for !== void 0) body.for = { kind: spec.for.kind, id: spec.for.id };
3673
4265
  if (spec?.role !== void 0) body.role = spec.role;
3674
4266
  if (spec?.capabilities !== void 0) body.capabilities = spec.capabilities;
3675
4267
  if (spec?.label !== void 0) body.label = spec.label;
@@ -3692,7 +4284,10 @@ function makeTokensClient(transport) {
3692
4284
  path: "/v1/tokens",
3693
4285
  query: {
3694
4286
  ...filter?.limit !== void 0 && { limit: filter.limit },
3695
- ...filter?.cursor !== void 0 && { cursor: filter.cursor }
4287
+ ...filter?.cursor !== void 0 && { cursor: filter.cursor },
4288
+ ...filter?.principal !== void 0 && {
4289
+ principal: `${filter.principal.kind}:${filter.principal.id}`
4290
+ }
3696
4291
  }
3697
4292
  });
3698
4293
  return listPage({ ...page, data: page.data.map(fromWire2) });
@@ -3835,13 +4430,24 @@ function makeToolsClient(transport) {
3835
4430
  // src/resources/users.ts
3836
4431
  function makeUsersClient(transport) {
3837
4432
  return {
3838
- async create(_spec) {
3839
- throw new KindgiApiError(
3840
- notYetWired(
3841
- "users.create",
3842
- "no user-creation route on the wire \u2014 framework does NOT own user persistence (deployments plug LDAP / SCIM / bespoke stores via IdentityDirectoryBinding)"
3843
- )
3844
- );
4433
+ async create(spec, options) {
4434
+ if (spec.orgId !== void 0 || spec.metadata !== void 0) {
4435
+ throw new KindgiApiError(
4436
+ notYetWired("users.create", "`orgId` and `metadata` are not on the wire")
4437
+ );
4438
+ }
4439
+ const created = await transport.request({
4440
+ method: "POST",
4441
+ path: "/v1/identity/users",
4442
+ body: {
4443
+ displayName: spec.displayName,
4444
+ ...spec.email !== void 0 && { primaryEmail: spec.email }
4445
+ },
4446
+ ...options?.idempotencyKey !== void 0 && {
4447
+ idempotencyKey: options.idempotencyKey
4448
+ }
4449
+ });
4450
+ return created.userId;
3845
4451
  },
3846
4452
  async get(id) {
3847
4453
  return transport.request({
@@ -3862,11 +4468,42 @@ function makeUsersClient(transport) {
3862
4468
  query: {
3863
4469
  ...filter?.limit !== void 0 && { limit: filter.limit },
3864
4470
  ...filter?.cursor !== void 0 && { cursor: filter.cursor },
3865
- ...filter?.query !== void 0 && { query: filter.query }
4471
+ ...filter?.query !== void 0 && { query: filter.query },
4472
+ ...filter?.includeUnregistered === true && { includeUnregistered: "true" }
3866
4473
  }
3867
4474
  });
3868
4475
  return listPage(page);
3869
4476
  },
4477
+ async grants(id) {
4478
+ return transport.request({
4479
+ method: "GET",
4480
+ path: `/v1/identity/users/${encodeURIComponent(id)}/grants`
4481
+ });
4482
+ },
4483
+ async grant(id, grant, options) {
4484
+ return transport.request({
4485
+ method: "POST",
4486
+ path: `/v1/identity/users/${encodeURIComponent(id)}/grant`,
4487
+ body: grant,
4488
+ ...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
4489
+ });
4490
+ },
4491
+ async ungrant(id, grant, options) {
4492
+ return transport.request({
4493
+ method: "POST",
4494
+ path: `/v1/identity/users/${encodeURIComponent(id)}/ungrant`,
4495
+ body: grant,
4496
+ ...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
4497
+ });
4498
+ },
4499
+ async unregister(id, options) {
4500
+ return transport.request({
4501
+ method: "POST",
4502
+ path: `/v1/identity/users/${encodeURIComponent(id)}/unregister`,
4503
+ body: {},
4504
+ ...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
4505
+ });
4506
+ },
3870
4507
  async update(_id, _patch) {
3871
4508
  throw new KindgiApiError(
3872
4509
  notYetWired(
@@ -4050,127 +4687,6 @@ function makeWebhooksClient(transport) {
4050
4687
  };
4051
4688
  }
4052
4689
 
4053
- // src/transport.ts
4054
- var DEFAULT_TIMEOUT_MS = 3e4;
4055
- var MUTATING = /* @__PURE__ */ new Set([
4056
- "POST",
4057
- "PUT",
4058
- "PATCH",
4059
- "DELETE"
4060
- ]);
4061
- function createTransport(options) {
4062
- const apiUrl = options.apiUrl.replace(/\/+$/u, "");
4063
- const fetchImpl = options.fetch ?? fetch;
4064
- const clientTimeoutMs = DEFAULT_TIMEOUT_MS;
4065
- return {
4066
- apiUrl,
4067
- fetchImpl,
4068
- authHeaders() {
4069
- return { Authorization: `Bearer ${authTokenFor(options.auth)}` };
4070
- },
4071
- async request(input) {
4072
- const url = buildUrl(apiUrl, input.path, input.query);
4073
- const headers = buildHeaders(input, options.auth);
4074
- const timeoutMs = input.timeoutMs ?? clientTimeoutMs;
4075
- const ac = new AbortController();
4076
- const timer = setTimeout(
4077
- () => ac.abort(new Error("timeout")),
4078
- timeoutMs
4079
- );
4080
- let response;
4081
- try {
4082
- response = await fetchImpl(url, {
4083
- method: input.method,
4084
- headers,
4085
- ...input.body !== void 0 && { body: JSON.stringify(input.body) },
4086
- signal: ac.signal
4087
- });
4088
- } catch (cause) {
4089
- clearTimeout(timer);
4090
- const err = {
4091
- code: "network",
4092
- message: cause instanceof Error ? cause.message : "network request failed",
4093
- cause
4094
- };
4095
- throw new KindgiApiError(err);
4096
- }
4097
- clearTimeout(timer);
4098
- if (response.ok) {
4099
- if (input.discardResponse === true || response.status === 204) {
4100
- try {
4101
- await response.arrayBuffer();
4102
- } catch {
4103
- }
4104
- return void 0;
4105
- }
4106
- try {
4107
- return await response.json();
4108
- } catch (cause) {
4109
- const err = {
4110
- code: "network",
4111
- message: "Response body was not valid JSON",
4112
- cause
4113
- };
4114
- throw new KindgiApiError(err);
4115
- }
4116
- }
4117
- let body;
4118
- try {
4119
- body = await response.json();
4120
- } catch {
4121
- body = void 0;
4122
- }
4123
- throw new KindgiApiError(
4124
- fromWire(unwrapErrorEnvelope(body, response.status), response.status)
4125
- );
4126
- }
4127
- };
4128
- }
4129
- function buildUrl(apiUrl, path, query) {
4130
- const normalizedPath = path.startsWith("/") ? path : `/${path}`;
4131
- const base = `${apiUrl}${normalizedPath}`;
4132
- if (query === void 0) return base;
4133
- const params = [];
4134
- for (const key of Object.keys(query)) {
4135
- const value = query[key];
4136
- if (value === void 0) continue;
4137
- const values = typeof value === "object" ? value : [String(value)];
4138
- for (const v of values) params.push(`${encodeURIComponent(key)}=${encodeURIComponent(v)}`);
4139
- }
4140
- return params.length === 0 ? base : `${base}?${params.join("&")}`;
4141
- }
4142
- function buildHeaders(input, auth) {
4143
- const headers = {
4144
- Accept: "application/json",
4145
- Authorization: `Bearer ${authTokenFor(auth)}`
4146
- };
4147
- if (input.body !== void 0) {
4148
- headers["Content-Type"] = "application/json; charset=utf-8";
4149
- }
4150
- if (input.idempotencyKey !== void 0 && MUTATING.has(input.method)) {
4151
- headers["Idempotency-Key"] = input.idempotencyKey;
4152
- }
4153
- if (input.headers !== void 0) {
4154
- for (const key of Object.keys(input.headers)) {
4155
- headers[key] = input.headers[key];
4156
- }
4157
- }
4158
- return headers;
4159
- }
4160
- function authTokenFor(auth) {
4161
- if (auth.kind === "apiToken") return auth.token;
4162
- return auth.accessToken;
4163
- }
4164
- function unwrapErrorEnvelope(body, status) {
4165
- if (body !== null && typeof body === "object" && !Array.isArray(body)) {
4166
- const inner = body.error;
4167
- if (inner !== null && typeof inner === "object" && !Array.isArray(inner)) {
4168
- return inner;
4169
- }
4170
- }
4171
- return { code: "unknown", message: `HTTP ${status} without recognizable error envelope` };
4172
- }
4173
-
4174
4690
  // src/client.ts
4175
4691
  function createClient(options) {
4176
4692
  const transport = createTransport(options);
@@ -4184,7 +4700,9 @@ function createClient(options) {
4184
4700
  conversations: makeConversationsClient(transport),
4185
4701
  memory: makeMemoryClient(transport),
4186
4702
  provenance: makeProvenanceClient(transport),
4187
- supervisor: makeSupervisorClient(transport),
4703
+ supervisor: makeSupervisorClient(),
4704
+ proposals: makeProposalsClient(transport),
4705
+ improvementPasses: makeImprovementPassesClient(transport),
4188
4706
  observations: makeObservationsClient(transport),
4189
4707
  approvals: makeApprovalsClient(transport),
4190
4708
  tenant: makeTenantClient(transport),
@@ -4212,7 +4730,9 @@ function createClient(options) {
4212
4730
  teams: makeTeamsClient(transport),
4213
4731
  orgs: makeOrgsClient(transport),
4214
4732
  signingKeys: makeSigningKeysClient(transport),
4733
+ exportSigningKeys: makeExportSigningKeysClient(transport),
4215
4734
  tokens: makeTokensClient(transport),
4735
+ serviceAccounts: makeServiceAccountsClient(transport),
4216
4736
  mcp: makeMcpClient(transport),
4217
4737
  events: makeEventsClient(),
4218
4738
  eventTriggers: makeEventTriggersClient(transport),
@@ -4224,6 +4744,7 @@ function createClient(options) {
4224
4744
  }
4225
4745
 
4226
4746
  exports.KindgiApiError = KindgiApiError;
4747
+ exports.SIGNED_EXPORT_ALGORITHMS = SIGNED_EXPORT_ALGORITHMS;
4227
4748
  exports.SseHttpError = SseHttpError;
4228
4749
  exports.comparisonOf = comparisonOf;
4229
4750
  exports.createClient = createClient;
@@ -4234,5 +4755,6 @@ exports.notYetWired = notYetWired;
4234
4755
  exports.readSse = readSse;
4235
4756
  exports.subscribeToRun = subscribeToRun;
4236
4757
  exports.unwrapSseData = unwrapSseData;
4758
+ exports.verifySignedExport = verifySignedExport;
4237
4759
  //# sourceMappingURL=index.cjs.map
4238
4760
  //# sourceMappingURL=index.cjs.map